mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-17 18:19:17 +00:00
Player can now disable emojis
This commit is contained in:
@@ -20,20 +20,24 @@ import { DefaultConfig } from "./DefaultConfig";
|
||||
import { DevConfig, DevServerConfig } from "./DevConfig";
|
||||
import { GameMap, TileRef } from "../game/GameMap";
|
||||
import { PlayerView } from "../game/GameView";
|
||||
import { UserSettings } from "../game/UserSettings";
|
||||
|
||||
export enum GameEnv {
|
||||
Dev,
|
||||
Prod,
|
||||
}
|
||||
export function getConfig(gameConfig: GameConfig): Config {
|
||||
export function getConfig(
|
||||
gameConfig: GameConfig,
|
||||
userSettings: UserSettings,
|
||||
): Config {
|
||||
const sc = getServerConfig();
|
||||
switch (process.env.GAME_ENV) {
|
||||
case "dev":
|
||||
return new DevConfig(sc, gameConfig);
|
||||
return new DevConfig(sc, gameConfig, userSettings);
|
||||
case "preprod":
|
||||
case "prod":
|
||||
consolex.log("using prod config");
|
||||
return new DefaultConfig(sc, gameConfig);
|
||||
return new DefaultConfig(sc, gameConfig, userSettings);
|
||||
default:
|
||||
throw Error(`unsupported server configuration: ${process.env.GAME_ENV}`);
|
||||
}
|
||||
@@ -73,6 +77,7 @@ export interface Config {
|
||||
spawnBots(): boolean;
|
||||
creativeMode(): boolean;
|
||||
numSpawnPhaseTurns(): number;
|
||||
userSettings(): UserSettings;
|
||||
|
||||
startManpower(playerInfo: PlayerInfo): number;
|
||||
populationIncreaseRate(player: Player | PlayerView): number;
|
||||
|
||||
Reference in New Issue
Block a user