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

Removed password from game

parent b955007d
No related branches found
No related tags found
4 merge requests!59Development to master,!14Type orm,!13Type orm,!11Type orm
......@@ -23,8 +23,6 @@ export class CreateGameDTO {
@IsJSON() @IsNotEmpty()
mapCoordinates: JSON;
@IsString() @IsNotEmpty() @Length(3, 255)
GM_Password?: string;
}
/*export class EditGameDTO {
......
import { Entity, Column, PrimaryGeneratedColumn, OneToMany, ManyToOne, Timestamp} from 'typeorm';
import * as bcrypt from 'bcryptjs';
import {PersonEntity, PersonRoleEntity} from '../user/user.entity'
import {FactionEntity} from './faction.entity'
import {CoordinateEntity, MapEntity} from './coordinate.entity'
......@@ -13,7 +12,6 @@ export class GameEntity {
@Column({type: 'text'}) gameDescription: string;
@Column({type: 'date'}) startDate: string;
@Column({type: 'date'}) endDate: string;
@Column({type: 'text'}) GM_Password: string;
@ManyToOne(type => MapEntity, map => map.games)
map: MapEntity;
......@@ -25,13 +23,10 @@ export class GameEntity {
objective_points: ObjectivePointEntity[];
gameObject() {
const {gameId, gameName, gameDescription, startDate, endDate, factions, objective_points, map, GM_Password} = this;
return {gameId, gameName, gameDescription, startDate, endDate, factions, objective_points, map, GM_Password};
const {gameId, gameName, gameDescription, startDate, endDate, factions, objective_points, map} = this;
return {gameId, gameName, gameDescription, startDate, endDate, factions, objective_points, map};
}
async comparePassword(attempt: string) {
return await bcrypt.compareSync(attempt, this.GM_Password);
}
}
@Entity('Game_Person')
......@@ -68,7 +63,7 @@ export class ObjectivePointEntity {
export class ObjectivePoint_HistoryEntity {
@PrimaryGeneratedColumn('uuid') oP_HistoryId: string;
@Column({type: 'timestamp'}) oP_HistoryTimestamp: Timestamp;
@Column({/*type: 'timestamp'*/}) oP_HistoryStatus: number;
@Column({}) oP_HistoryStatus: number;
@ManyToOne(type => ObjectivePointEntity, objective_point => objective_point.op_history)
objective_point: ObjectivePointEntity;
......
......@@ -78,8 +78,6 @@ export class GameService {
});
const game = await this.gameRepository.findOne({ where: { id: gameId } });
const index = game.GM_Password.indexOf(json.password);
// create game_Person entry
/* const gamePerson = await this.game_PersonRepository.create({
faction,
......
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