store name, anon has random suffix, color a hash of name

This commit is contained in:
evanpelle
2024-09-11 20:06:55 -07:00
parent 76634489aa
commit 8f56fea0cd
8 changed files with 72 additions and 28 deletions
+3 -1
View File
@@ -11,6 +11,7 @@ import {and, bfs, dist, manhattanDist} from "../core/Util";
import {TerrainRenderer} from "./graphics/TerrainRenderer";
export function createClientGame(name: string, clientID: ClientID, playerID: PlayerID, ip: string | null, gameID: GameID, config: Config, terrainMap: TerrainMap): ClientGame {
let eventBus = new EventBus()
let game = createGame(terrainMap, eventBus, config)
@@ -32,7 +33,6 @@ export function createClientGame(name: string, clientID: ClientID, playerID: Pla
}
export class ClientGame {
private myPlayer: Player
private turns: Turn[] = []
private socket: WebSocket
@@ -119,6 +119,8 @@ export class ClientGame {
public start() {
console.log('version 3')
this.isActive = true
// TODO: make each class do this, or maybe have client intercept all requests?
//this.eventBus.on(TickEvent, (e) => this.tick(e))