mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 09:30:45 +00:00
Made UserSettings nullable
This commit is contained in:
@@ -24,7 +24,6 @@ import { createGame } from "./game/GameImpl";
|
||||
import { loadTerrainMap as loadGameMap } from "./game/TerrainMapLoader";
|
||||
import { ClientID, GameConfig, Turn } from "./Schemas";
|
||||
import { GameUpdateViewData } from "./game/GameUpdates";
|
||||
import { UserSettings } from "./game/UserSettings";
|
||||
|
||||
export async function createGameRunner(
|
||||
gameID: string,
|
||||
@@ -32,8 +31,7 @@ export async function createGameRunner(
|
||||
clientID: ClientID,
|
||||
callBack: (gu: GameUpdateViewData) => void,
|
||||
): Promise<GameRunner> {
|
||||
const userSettings: UserSettings = new UserSettings();
|
||||
const config = getConfig(gameConfig, userSettings);
|
||||
const config = getConfig(gameConfig, null);
|
||||
const gameMap = await loadGameMap(gameConfig.gameMap);
|
||||
const game = createGame(
|
||||
gameMap.gameMap,
|
||||
|
||||
@@ -28,7 +28,7 @@ export enum GameEnv {
|
||||
}
|
||||
export function getConfig(
|
||||
gameConfig: GameConfig,
|
||||
userSettings: UserSettings,
|
||||
userSettings: UserSettings | null = null,
|
||||
): Config {
|
||||
const sc = getServerConfig();
|
||||
switch (process.env.GAME_ENV) {
|
||||
|
||||
@@ -52,7 +52,7 @@ export class DefaultConfig implements Config {
|
||||
return this._serverConfig;
|
||||
}
|
||||
|
||||
userSettings(): UserSettings {
|
||||
userSettings(): UserSettings | null {
|
||||
return this._userSettings;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user