mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-27 17:14:39 +00:00
send game hash to server each second
This commit is contained in:
@@ -3,11 +3,8 @@ import {
|
||||
ClientMessage,
|
||||
ClientMessageSchema,
|
||||
GameConfig,
|
||||
GameRecordSchema,
|
||||
Intent,
|
||||
PlayerRecord,
|
||||
ServerPingMessageSchema,
|
||||
ServerStartGameMessage,
|
||||
ServerStartGameMessageSchema,
|
||||
ServerTurnMessageSchema,
|
||||
Turn,
|
||||
@@ -162,6 +159,12 @@ export class GameServer {
|
||||
this.lastPingUpdate = Date.now();
|
||||
client.lastPing = Date.now();
|
||||
}
|
||||
if (clientMsg.type == "hash") {
|
||||
console.log(
|
||||
`client ${clientMsg.clientID} got hash ${clientMsg.hash} on tick ${clientMsg.tick}`,
|
||||
);
|
||||
client.hashes.set(clientMsg.tick, clientMsg.hash);
|
||||
}
|
||||
if (clientMsg.type == "winner") {
|
||||
this.winner = clientMsg.winner;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user