Skip to content
Snippets Groups Projects

Development

Merged Ghost User requested to merge Development into testing
13 files
+ 134
33
Compare changes
  • Side-by-side
  • Inline
Files
13
@@ -9,6 +9,7 @@ import {
Put,
UseInterceptors,
ClassSerializerInterceptor,
Delete,
} from '@nestjs/common';
import { AuthGuard } from '../shared/auth.guard';
@@ -19,6 +20,7 @@ import {
PromotePlayerDTO,
JoinFactionDTO,
JoinGameGroupDTO,
FactionDTO,
} from './faction.dto';
import { FactionService } from './faction.service';
import { Roles, GameStates } from '../shared/guard.decorator';
@@ -90,6 +92,22 @@ export class FactionController {
return this.factionservice.joinFaction(person, data);
}
// used to leave a faction
// :id is the if of the game
@Delete('leave/:id')
@Roles('soldier', 'factionleader')
@GameStates('CREATED')
leaveFaction(@GamePerson('gamepersonId') gamepersonId) {
return this.factionservice.leaveFaction(gamepersonId);
}
// used to change factions multiplier
@Put('faction-multiplier/:id')
@Roles('admin')
@GameStates('STARTED')
factionMultiplier(@Param('id') game, @Body() body: FactionDTO) {
return this.factionservice.changeFactionMultiplier(body);
}
// check if person belongs to a faction in a game
@Get('check-faction/:id')
@UseGuards(new AuthGuard())
Loading