sanitize profane usernames

This commit is contained in:
Evan
2025-02-08 19:00:35 -08:00
parent 1594a45dac
commit 2fa576c841
9 changed files with 92 additions and 37 deletions
+7 -2
View File
@@ -5,7 +5,7 @@ import {
PlayerProfile,
} from "../game/Game";
import { ErrorUpdate, GameUpdateViewData } from "../game/GameUpdates";
import { GameConfig, GameID, Turn } from "../Schemas";
import { ClientID, GameConfig, GameID, Turn } from "../Schemas";
import { generateID } from "../Util";
import { WorkerMessage } from "./WorkerMessages";
@@ -17,7 +17,11 @@ export class WorkerClient {
update: GameUpdateViewData | ErrorUpdate
) => void;
constructor(private gameID: GameID, private gameConfig: GameConfig) {
constructor(
private gameID: GameID,
private gameConfig: GameConfig,
private clientID: ClientID
) {
this.worker = new Worker(new URL("./Worker.worker.ts", import.meta.url));
this.messageHandlers = new Map();
@@ -65,6 +69,7 @@ export class WorkerClient {
id: messageId,
gameID: this.gameID,
gameConfig: this.gameConfig,
clientID: this.clientID,
});
// Add timeout for initialization