Skip to content
Snippets Groups Projects
Commit 4b1e2eee authored by Samuli Virtapohja's avatar Samuli Virtapohja
Browse files

weekend

parent e408ac59
No related branches found
No related tags found
3 merge requests!59Development to master,!36Development,!34Get player location
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne } from 'typeorm';
import { Game_PersonEntity } from '../game/game.entity';
import { Game_PersonEntity, GameEntity } from '../game/game.entity';
import { FactionEntity } from 'src/faction/faction.entity';
@Entity('Tracking')
......@@ -10,4 +10,6 @@ export class TrackingEntity {
gamepersonId: Game_PersonEntity;
@ManyToOne(type => FactionEntity, faction => faction.factionId)
faction: FactionEntity;
@ManyToOne(type => GameEntity, game => game.id)
game: GameEntity;
}
......@@ -64,10 +64,16 @@ export class TrackingService {
relations: ['faction'],
});
// if faction is not null, user is factionleader
// if user , user is factionleader
if (gameperson.faction) {
return 'factionleader';
const playerdata = await this.trackingrepository.find({
where: { faction: gameperson.faction },
});
return playerdata;
} else {
const playerdata = await this.trackingrepository.find({
where: { game: gameId },
});
return 'admin';
}
}
......
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