adding persistent id

This commit is contained in:
Evan
2024-12-17 14:30:16 -08:00
committed by evanpelle
parent d99b60b477
commit 722165c401
15 changed files with 65 additions and 23 deletions
+3 -1
View File
@@ -224,6 +224,7 @@ export const ClientIntentMessageSchema = ClientBaseMessageSchema.extend({
export const ClientJoinMessageSchema = ClientBaseMessageSchema.extend({
type: z.literal('join'),
persistentID: z.string(),
lastTurn: z.number() // The last turn the client saw.
})
@@ -236,7 +237,8 @@ export const PlayerRecordSchema = z.object({
})
export const GameRecordSchema = z.object({
id: z.string(),
id: z.string(), // WARNING: PII
persistentID: z.string(), // WARNING: PII
gameConfig: GameConfigSchema,
players: z.array(PlayerRecordSchema),
startTimestampMS: z.number(),
+1 -1
View File
@@ -3,7 +3,7 @@ import { Cell, Execution, MutableGame, MutablePlayer, Player, PlayerID, PlayerTy
import { PseudoRandom } from "../PseudoRandom";
import { manhattanDist } from "../Util";
import { MessageType } from "../../client/graphics/layers/EventsDisplay";
import { renderNumber } from "../../client/graphics/Utils";
import { renderNumber } from "../../client/Utils";
export class AttackExecution implements Execution {
private breakAlliance = false
+1 -1
View File
@@ -1,5 +1,5 @@
import { MessageType } from "../../client/graphics/layers/EventsDisplay";
import { renderNumber } from "../../client/graphics/Utils";
import { renderNumber } from "../../client/Utils";
import { AllPlayers, Cell, Execution, MutableGame, MutablePlayer, MutableUnit, Player, PlayerID, Tile, Unit, UnitType } from "../game/Game";
import { PathFinder } from "../pathfinding/PathFinding";
import { PathFindResultType } from "../pathfinding/AStar";
+1 -1
View File
@@ -5,7 +5,7 @@ import { CellString, GameImpl } from "./GameImpl";
import { UnitImpl } from "./UnitImpl";
import { TileImpl } from "./TileImpl";
import { MessageType } from "../../client/graphics/layers/EventsDisplay";
import { renderTroops } from "../../client/graphics/Utils";
import { renderTroops } from "../../client/Utils";
interface Target {
tick: Tick