fix: Resolve userSettings is null error in worker

This commit fixes the "userSettings is null" error that occurred in the worker when trying to join or create a game.

- Introduced IUserSettings interface to define the contract for user settings used in the worker.

- Updated UserSettings class to implement IUserSettings and provide a getData() method for serialization.

- Modified WorkerMessages to include serialized user settings in the InitMessage.

- Passed user settings from ClientGameRunner to WorkerClient, and then to the worker.

- Updated createGameRunner to accept IUserSettings and pass it to getConfig.

- Corrected type inconsistencies across various configuration and theme classes to align with IUserSettings.

- Re-added missing imports in relevant files.
This commit is contained in:
Restart2008
2025-10-26 17:44:11 -07:00
parent c79e8022b9
commit 215511de5d
14 changed files with 148 additions and 19 deletions
+1
View File
@@ -162,6 +162,7 @@ async function createClientGame(
const worker = new WorkerClient(
lobbyConfig.gameStartInfo,
lobbyConfig.clientID,
userSettings,
);
await worker.initialize();
const gameView = new GameView(