mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-05 03:32:02 +00:00
teams (#349)
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
ClientID,
|
||||
ClientMessage,
|
||||
ClientMessageSchema,
|
||||
ClientSendWinnerMessage,
|
||||
GameConfig,
|
||||
GameInfo,
|
||||
Intent,
|
||||
@@ -45,7 +46,7 @@ export class GameServer {
|
||||
|
||||
private lastPingUpdate = 0;
|
||||
|
||||
private winner: ClientID | null = null;
|
||||
private winner: ClientSendWinnerMessage = null;
|
||||
// This field is currently only filled at victory
|
||||
private allPlayersStats: AllPlayersStats = {};
|
||||
|
||||
@@ -86,6 +87,9 @@ export class GameServer {
|
||||
if (gameConfig.instantBuild != null) {
|
||||
this.gameConfig.instantBuild = gameConfig.instantBuild;
|
||||
}
|
||||
if (gameConfig.gameMode != null) {
|
||||
this.gameConfig.gameMode = gameConfig.gameMode;
|
||||
}
|
||||
}
|
||||
|
||||
public addClient(client: Client, lastTurn: number) {
|
||||
@@ -171,7 +175,7 @@ export class GameServer {
|
||||
client.hashes.set(clientMsg.turnNumber, clientMsg.hash);
|
||||
}
|
||||
if (clientMsg.type == "winner") {
|
||||
this.winner = clientMsg.winner;
|
||||
this.winner = clientMsg;
|
||||
this.allPlayersStats = clientMsg.allPlayersStats;
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -318,7 +322,8 @@ export class GameServer {
|
||||
this.turns,
|
||||
this._startTime,
|
||||
Date.now(),
|
||||
this.winner,
|
||||
this.winner.winner,
|
||||
this.winner.winnerType,
|
||||
this.allPlayersStats,
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user