Skip to content
Snippets Groups Projects
Commit fe8c6626 authored by L4072's avatar L4072
Browse files

Comments conformed

parent b651be99
No related branches found
No related tags found
2 merge requests!59Development to master,!58Development to testing
Showing
with 103 additions and 105 deletions
...@@ -21,22 +21,22 @@ import { GameModule } from './game/game.module'; ...@@ -21,22 +21,22 @@ import { GameModule } from './game/game.module';
import { ScoreModule } from './score/score.module'; import { ScoreModule } from './score/score.module';
import { ReplayModule } from './replay/replay.module'; import { ReplayModule } from './replay/replay.module';
/* ///////////////////////////////////////////////////////////////////////////////////////////////////////////
Core of the server, /// Core of the server, ///
Every module is being imported and combined here. /// Every module is being imported and combined here. ///
/// ///
AppController needs to be kept in for SSL verification to work (root needs to return something) /// AppController needs to be kept in for SSL verification to work (root needs to return something) ///
/// ///
TypeOrmModule checks ormconfig.json for database connection. /// TypeOrmModule checks ormconfig.json for database connection. ///
/// ///
More information on global decorators can be found from shared folder. /// More information on global decorators can be found from shared folder. ///
/// ///
Providers can be found from shared folder /// Providers can be found from shared folder ///
- HttpErrorFilter /// - HttpErrorFilter ///
- LoggingInterceptor /// - LoggingInterceptor ///
- RolesGuard Decorator /// - RolesGuard Decorator ///
- StatesGuard Decorator /// - StatesGuard Decorator ///
*/ ///////////////////////////////////////////////////////////////////////////////////////////////////////////
@Module({ @Module({
imports: [ imports: [
......
...@@ -3,11 +3,11 @@ import { Entity, Column, PrimaryGeneratedColumn, ManyToOne } from 'typeorm'; ...@@ -3,11 +3,11 @@ import { Entity, Column, PrimaryGeneratedColumn, ManyToOne } from 'typeorm';
import { GameEntity } from '../game/game.entity'; import { GameEntity } from '../game/game.entity';
import { FactionEntity } from '../faction/faction.entity'; import { FactionEntity } from '../faction/faction.entity';
/* ///////////////////////////////////////////////////////////////////////////
MapDrawingEntity & MapDrawingHistoryEntity reflect database tables. /// MapDrawingEntity & MapDrawingHistoryEntity reflect database tables. ///
/// ///
MapDrawing ownershipCheck checks users rights to MapDrawing /// MapDrawing ownershipCheck checks users rights to MapDrawing ///
*/ ///////////////////////////////////////////////////////////////////////////
@Entity('MapDrawing') @Entity('MapDrawing')
export class MapDrawingEntity { export class MapDrawingEntity {
......
...@@ -15,8 +15,6 @@ import { Roles, GameStates } from '../shared/guard.decorator'; ...@@ -15,8 +15,6 @@ import { Roles, GameStates } from '../shared/guard.decorator';
import { MapDrawingDTO } from './mapdrawing.dto'; import { MapDrawingDTO } from './mapdrawing.dto';
import { GamePerson } from '../game/gameperson.decorator'; import { GamePerson } from '../game/gameperson.decorator';
/*
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/// DrawController /// /// DrawController ///
/// /// /// ///
...@@ -27,8 +25,6 @@ import { GamePerson } from '../game/gameperson.decorator'; ...@@ -27,8 +25,6 @@ import { GamePerson } from '../game/gameperson.decorator';
/// Data return functions require atleast spectator role. /// /// Data return functions require atleast spectator role. ///
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
*/
@Controller('draw') @Controller('draw')
export class DrawController { export class DrawController {
constructor(private drawService: DrawService) {} constructor(private drawService: DrawService) {}
......
...@@ -10,12 +10,12 @@ import { ...@@ -10,12 +10,12 @@ import {
import { FactionEntity } from '../faction/faction.entity'; import { FactionEntity } from '../faction/faction.entity';
import { Game_PersonEntity } from '../game/game.entity'; import { Game_PersonEntity } from '../game/game.entity';
import { NotificationModule } from 'src/notifications/notifications.module'; import { NotificationModule } from 'src/notifications/notifications.module';
/*
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
/// Draw /// /// Draw ///
/// - contains everything to do with mapdrawing data. /// /// - contains everything to do with mapdrawing data. ///
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
*/
@Module({ @Module({
imports: [ imports: [
TypeOrmModule.forFeature([ TypeOrmModule.forFeature([
......
...@@ -9,9 +9,9 @@ import { ...@@ -9,9 +9,9 @@ import {
import { MapDrawingDTO } from './mapdrawing.dto'; import { MapDrawingDTO } from './mapdrawing.dto';
import { NotificationGateway } from '../notifications/notifications.gateway'; import { NotificationGateway } from '../notifications/notifications.gateway';
/* ///////////////////////////////////////////////////////////////////////////
DrawService contains handling of MapDrawings and MapDrawinghistory /// DrawService contains handling of MapDrawings and MapDrawinghistory ///
*/ ///////////////////////////////////////////////////////////////////////////
@Injectable() @Injectable()
export class DrawService { export class DrawService {
......
...@@ -24,22 +24,22 @@ import { FactionService } from './faction.service'; ...@@ -24,22 +24,22 @@ import { FactionService } from './faction.service';
import { Roles, GameStates } from '../shared/guard.decorator'; import { Roles, GameStates } from '../shared/guard.decorator';
import { GamePerson } from '../game/gameperson.decorator'; import { GamePerson } from '../game/gameperson.decorator';
/* /////////////////////////////////////////////////////////////////////////////////
FactionController is being used for routing: /// FactionController is being used for routing: ///
/// ///
Group /// Group ///
- create group when game status is CREATED /// - create group when game status is CREATED ///
- getting groups with faction id(this is used mainly for listing players) /// - getting groups with faction id(this is used mainly for listing players) ///
- joining group when game status is CREATED /// - joining group when game status is CREATED ///
/// ///
Faction /// Faction ///
- checking users faction /// - checking users faction ///
- joining faction /// - joining faction ///
- leaving faction /// - leaving faction ///
- changing faction multiplier (not implemented) /// - changing faction multiplier (not implemented) ///
/// ///
See shared folder files for more information on decorators. /// See shared folder files for more information on decorators. ///
*/ /////////////////////////////////////////////////////////////////////////////////
@Controller('faction') @Controller('faction')
export class FactionController { export class FactionController {
......
...@@ -16,12 +16,12 @@ import { GameEntity } from '../game/game.entity'; ...@@ -16,12 +16,12 @@ import { GameEntity } from '../game/game.entity';
import { GameDTO } from '../game/game.dto'; import { GameDTO } from '../game/game.dto';
import { FactionEntity, GameGroupEntity } from './faction.entity'; import { FactionEntity, GameGroupEntity } from './faction.entity';
/* /////////////////////////////////////////////////////////////////////////////////////////////////////////////
Contains Validation for FactionDTO, JoinFactionDTO, PromotePlayerDTO, GameGroupDTO, JoinGameGroupDTO /// Contains Validation for FactionDTO, JoinFactionDTO, PromotePlayerDTO, GameGroupDTO, JoinGameGroupDTO ///
/// ///
uses class-validator built in validations /// uses class-validator built in validations ///
see https://github.com/typestack/class-validator /// see https://github.com/typestack/class-validator ///
*/ /////////////////////////////////////////////////////////////////////////////////////////////////////////////
export class FactionDTO { export class FactionDTO {
@IsOptional() @IsOptional()
......
...@@ -14,9 +14,9 @@ import { MapDrawingEntity } from '../draw/coordinate.entity'; ...@@ -14,9 +14,9 @@ import { MapDrawingEntity } from '../draw/coordinate.entity';
import { Exclude } from 'class-transformer'; import { Exclude } from 'class-transformer';
import { ScoreEntity } from '../score/score.entity'; import { ScoreEntity } from '../score/score.entity';
/* ///////////////////////////////////////////////////////////////////
FactionEntity & GameGroupEntity reflect database tables. /// FactionEntity & GameGroupEntity reflect database tables. ///
*/ ///////////////////////////////////////////////////////////////////
@Entity('Faction') @Entity('Faction')
export class FactionEntity { export class FactionEntity {
......
...@@ -6,18 +6,18 @@ import { FactionService } from './faction.service'; ...@@ -6,18 +6,18 @@ import { FactionService } from './faction.service';
import { GameGroupEntity, FactionEntity } from './faction.entity'; import { GameGroupEntity, FactionEntity } from './faction.entity';
import { Game_PersonEntity } from '../game/game.entity'; import { Game_PersonEntity } from '../game/game.entity';
/* /////////////////////////////
Entities /// Entities ///
- FactionEntity /// - FactionEntity ///
- Game_PersonEntity /// - Game_PersonEntity ///
- GameGroupEntity /// - GameGroupEntity ///
/// ///
Controllers /// Controllers ///
- FactionController /// - FactionController ///
/// ///
Provider /// Provider ///
- FactionService /// - FactionService ///
*/ /////////////////////////////
@Module({ @Module({
imports: [ imports: [
......
...@@ -11,20 +11,20 @@ import { ...@@ -11,20 +11,20 @@ import {
} from './faction.dto'; } from './faction.dto';
import { Game_PersonEntity } from '../game/game.entity'; import { Game_PersonEntity } from '../game/game.entity';
/* ///////////////////////////////////////////////////////
FactionService contains functions for /// FactionService contains functions for ///
- Joining faction /// - Joining faction ///
- Leaving faction /// - Leaving faction ///
- Change faction multiplier (not implemented) /// - Change faction multiplier (not implemented) ///
/// ///
Group /// Group ///
- Creating group /// - Creating group ///
- List faction players in groups /// - List faction players in groups ///
/// ///
Player /// Player ///
- Promote player /// - Promote player ///
- verifying user /// - verifying user ///
*/ ///////////////////////////////////////////////////////
@Injectable() @Injectable()
export class FactionService { export class FactionService {
......
...@@ -22,6 +22,7 @@ import { MulterModule } from '@nestjs/platform-express'; ...@@ -22,6 +22,7 @@ import { MulterModule } from '@nestjs/platform-express';
/// Game /// /// Game ///
/// - contains everything to do with Game data /// /// - contains everything to do with Game data ///
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
@Module({ @Module({
imports: [ imports: [
TypeOrmModule.forFeature([ TypeOrmModule.forFeature([
......
import { createParamDecorator } from '@nestjs/common'; import { createParamDecorator } from '@nestjs/common';
/* ///////////////////////////////////////////////////////////////////////////
gives service access to the gameperson object /// gives service access to the gameperson object ///
Game_PersonEntity { /// Game_PersonEntity { ///
gamepersonId /// gamepersonId ///
role /// role ///
faction /// faction ///
} /// } ///
/// ///
/// See more information from decorators in shared folder files. ///
///////////////////////////////////////////////////////////////////////////
See more information from decorators in shared folder files.
*/
export const GamePerson = createParamDecorator((data, req) => { export const GamePerson = createParamDecorator((data, req) => {
return data ? req.gameperson[data] : req.gameperson; return data ? req.gameperson[data] : req.gameperson;
}); });
...@@ -2,11 +2,11 @@ import { NestFactory } from '@nestjs/core'; ...@@ -2,11 +2,11 @@ import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module'; import { AppModule } from './app.module';
/* ///////////////////////////////////////////////////////////////////////////
Main.ts starts the server. /// Main.ts starts the server. ///
/// ///
.env.PORT is not defined, port 5000 will be listened by default /// .env.PORT is not defined, port 5000 will be listened by default ///
*/ ///////////////////////////////////////////////////////////////////////////
async function bootstrap() { async function bootstrap() {
// port opened // port opened
......
...@@ -16,9 +16,9 @@ import { GameEntity } from '../game/game.entity'; ...@@ -16,9 +16,9 @@ import { GameEntity } from '../game/game.entity';
import { NotificationdDTO } from './notification.dto'; import { NotificationdDTO } from './notification.dto';
import { ValidationPipe } from '../shared/validation.pipe'; import { ValidationPipe } from '../shared/validation.pipe';
/* ///////////////////////////////////////////////////////////////////////////////////
NotificationGateway contains websocket server and listener for game-info /// NotificationGateway contains websocket server and listener for game-info ///
*/ ///////////////////////////////////////////////////////////////////////////////////
@WebSocketGateway() @WebSocketGateway()
export class NotificationGateway export class NotificationGateway
......
...@@ -7,15 +7,11 @@ import { GameEntity } from '../game/game.entity'; ...@@ -7,15 +7,11 @@ import { GameEntity } from '../game/game.entity';
import { NotificationsController } from './notifications.controller'; import { NotificationsController } from './notifications.controller';
import { NotificationsService } from './notifications.service'; import { NotificationsService } from './notifications.service';
/*
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
/// Notification /// /// Notification ///
/// - contains everything to do with Notification data. /// /// - contains everything to do with Notification data. ///
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
*/
@Module({ @Module({
imports: [TypeOrmModule.forFeature([NotificationEntity, GameEntity])], imports: [TypeOrmModule.forFeature([NotificationEntity, GameEntity])],
providers: [NotificationGateway, NotificationsService], providers: [NotificationGateway, NotificationsService],
......
...@@ -9,9 +9,9 @@ import { ...@@ -9,9 +9,9 @@ import {
import { ReplayService } from './replay.service'; import { ReplayService } from './replay.service';
import { Roles } from 'src/shared/guard.decorator'; import { Roles } from 'src/shared/guard.decorator';
/* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
POST mockdata is mainly used for development, it can be removed from the code when needed, remember to remove service & test relations. /// POST mockdata is mainly used for development, it can be removed from the code when needed, remember to remove service & test relations. ///
*/ /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@Controller('replay') @Controller('replay')
export class ReplayController { export class ReplayController {
......
...@@ -29,6 +29,7 @@ import { TickService } from 'src/game/tick.service'; ...@@ -29,6 +29,7 @@ import { TickService } from 'src/game/tick.service';
/// Replay /// /// Replay ///
/// - contains everything to do with Replay data. /// /// - contains everything to do with Replay data. ///
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
@Module({ @Module({
imports: [ imports: [
TypeOrmModule.forFeature([ TypeOrmModule.forFeature([
......
...@@ -15,6 +15,7 @@ import { NotificationModule } from '../notifications/notifications.module'; ...@@ -15,6 +15,7 @@ import { NotificationModule } from '../notifications/notifications.module';
/// Score /// /// Score ///
/// - contains everything to do with Score data. /// /// - contains everything to do with Score data. ///
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
@Module({ @Module({
imports: [ imports: [
TypeOrmModule.forFeature([ TypeOrmModule.forFeature([
......
...@@ -11,6 +11,7 @@ import { NotificationModule } from '../notifications/notifications.module'; ...@@ -11,6 +11,7 @@ import { NotificationModule } from '../notifications/notifications.module';
/// Task /// /// Task ///
/// - contains everything to do with Task data. /// /// - contains everything to do with Task data. ///
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
@Module({ @Module({
imports: [ imports: [
TypeOrmModule.forFeature([TaskEntity, FactionEntity]), TypeOrmModule.forFeature([TaskEntity, FactionEntity]),
......
...@@ -12,6 +12,7 @@ import { FactionEntity } from '../faction/faction.entity'; ...@@ -12,6 +12,7 @@ import { FactionEntity } from '../faction/faction.entity';
/// Tracking /// /// Tracking ///
/// - contains everything to do with Tracking data. /// /// - contains everything to do with Tracking data. ///
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
@Module({ @Module({
imports: [ imports: [
TypeOrmModule.forFeature([ TypeOrmModule.forFeature([
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment