mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-13 22:18:01 +00:00
record game metadata to gcs
This commit is contained in:
@@ -3,7 +3,7 @@ import { ClientID, GameConfig, GameID } from "../core/Schemas";
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { Client } from "./Client";
|
||||
import { GamePhase, GameServer } from "./GameServer";
|
||||
import { Difficulty, GameMap } from "../core/game/Game";
|
||||
import { Difficulty, GameMap, GameType } from "../core/game/Game";
|
||||
|
||||
|
||||
|
||||
@@ -39,7 +39,17 @@ export class GameManager {
|
||||
|
||||
createPrivateGame(): string {
|
||||
const id = genSmallGameID()
|
||||
this.games.push(new GameServer(id, Date.now(), false, this.config, { gameMap: GameMap.World, difficulty: Difficulty.Medium }))
|
||||
this.games.push(new GameServer(
|
||||
id,
|
||||
Date.now(),
|
||||
false,
|
||||
this.config,
|
||||
{
|
||||
gameMap: GameMap.World,
|
||||
gameType: GameType.Private,
|
||||
difficulty: Difficulty.Medium
|
||||
}
|
||||
))
|
||||
return id
|
||||
}
|
||||
|
||||
@@ -68,7 +78,17 @@ export class GameManager {
|
||||
if (now > this.lastNewLobby + this.config.gameCreationRate()) {
|
||||
this.lastNewLobby = now
|
||||
const id = uuidv4()
|
||||
lobbies.push(new GameServer(id, now, true, this.config, { gameMap: GameMap.World, difficulty: Difficulty.Medium }))
|
||||
lobbies.push(new GameServer(
|
||||
id,
|
||||
now,
|
||||
true,
|
||||
this.config,
|
||||
{
|
||||
gameMap: GameMap.World,
|
||||
gameType: GameType.Public,
|
||||
difficulty: Difficulty.Medium
|
||||
}
|
||||
))
|
||||
}
|
||||
|
||||
active.filter(g => !g.hasStarted() && g.isPublic).forEach(g => {
|
||||
|
||||
Reference in New Issue
Block a user