mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-18 09:14:09 +00:00
Added custom disable settings (#593)
## Description: I will write an issue later as I don't have time.  <img width="735" alt="スクリーンショット 2025-04-23 22 04 40" src="https://github.com/user-attachments/assets/24bb3461-8e05-418c-8dbf-2ba1a624fe27" /> <img width="790" alt="スクリーンショット 2025-04-23 22 04 47" src="https://github.com/user-attachments/assets/33387200-d0af-4394-9d60-af1f88a036e9" /> ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: aotumuri
This commit is contained in:
+13
-1
@@ -101,6 +101,7 @@
|
|||||||
"infinite_gold": "Infinite gold",
|
"infinite_gold": "Infinite gold",
|
||||||
"infinite_troops": "Infinite troops",
|
"infinite_troops": "Infinite troops",
|
||||||
"disable_nukes": "Disable Nukes",
|
"disable_nukes": "Disable Nukes",
|
||||||
|
"enables_title": "Enable Settings",
|
||||||
"start": "Start Game"
|
"start": "Start Game"
|
||||||
},
|
},
|
||||||
"map": {
|
"map": {
|
||||||
@@ -167,7 +168,7 @@
|
|||||||
"instant_build": "Instant build",
|
"instant_build": "Instant build",
|
||||||
"infinite_gold": "Infinite gold",
|
"infinite_gold": "Infinite gold",
|
||||||
"infinite_troops": "Infinite troops",
|
"infinite_troops": "Infinite troops",
|
||||||
"disable_nukes": "Disable Nukes",
|
"enables_title": "Enable Settings",
|
||||||
"player": "Player",
|
"player": "Player",
|
||||||
"players": "Players",
|
"players": "Players",
|
||||||
"waiting": "Waiting for players...",
|
"waiting": "Waiting for players...",
|
||||||
@@ -191,6 +192,17 @@
|
|||||||
"select_lang": {
|
"select_lang": {
|
||||||
"title": "Select Language"
|
"title": "Select Language"
|
||||||
},
|
},
|
||||||
|
"unit_type": {
|
||||||
|
"city": "City",
|
||||||
|
"defense_post": "Defense Post",
|
||||||
|
"port": "Port",
|
||||||
|
"warship": "Warship",
|
||||||
|
"missile_silo": "Missile Silo",
|
||||||
|
"sam_launcher": "SAM Launcher",
|
||||||
|
"atom_bomb": "Atom Bomb",
|
||||||
|
"hydrogen_bomb": "Hydrogen Bomb",
|
||||||
|
"mirv": "MIRV"
|
||||||
|
},
|
||||||
"user_setting": {
|
"user_setting": {
|
||||||
"title": "User Settings",
|
"title": "User Settings",
|
||||||
"tab_basic": "Basic Settings",
|
"tab_basic": "Basic Settings",
|
||||||
|
|||||||
+13
-2
@@ -97,7 +97,7 @@
|
|||||||
"instant_build": "即時建設",
|
"instant_build": "即時建設",
|
||||||
"infinite_gold": "資金無限",
|
"infinite_gold": "資金無限",
|
||||||
"infinite_troops": "兵士無限",
|
"infinite_troops": "兵士無限",
|
||||||
"disable_nukes": "核兵器使用禁止",
|
"enables_title": "有効化設定",
|
||||||
"start": "ゲーム開始"
|
"start": "ゲーム開始"
|
||||||
},
|
},
|
||||||
"map": {
|
"map": {
|
||||||
@@ -158,7 +158,7 @@
|
|||||||
"instant_build": "実在する国家を無効化",
|
"instant_build": "実在する国家を無効化",
|
||||||
"infinite_gold": "資金無限",
|
"infinite_gold": "資金無限",
|
||||||
"infinite_troops": "兵士無限",
|
"infinite_troops": "兵士無限",
|
||||||
"disable_nukes": "核兵器使用禁止",
|
"enables_title": "有効化設定",
|
||||||
"player": "プレイヤー",
|
"player": "プレイヤー",
|
||||||
"players": "プレイヤー",
|
"players": "プレイヤー",
|
||||||
"waiting": "他のプレイヤーの参加を待っています...",
|
"waiting": "他のプレイヤーの参加を待っています...",
|
||||||
@@ -182,6 +182,17 @@
|
|||||||
"select_lang": {
|
"select_lang": {
|
||||||
"title": "言語を選択"
|
"title": "言語を選択"
|
||||||
},
|
},
|
||||||
|
"unit_type": {
|
||||||
|
"city": "都市",
|
||||||
|
"defense_post": "防衛ポスト",
|
||||||
|
"port": "港",
|
||||||
|
"warship": "戦艦",
|
||||||
|
"missile_silo": "ミサイル格納庫",
|
||||||
|
"sam_launcher": "SAMランチャー",
|
||||||
|
"atom_bomb": "原子爆弾",
|
||||||
|
"hydrogen_bomb": "水素爆弾",
|
||||||
|
"mirv": "MIRV"
|
||||||
|
},
|
||||||
"user_setting": {
|
"user_setting": {
|
||||||
"title": "ユーザー設定",
|
"title": "ユーザー設定",
|
||||||
"tab_basic": "基本設定",
|
"tab_basic": "基本設定",
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
Duos,
|
Duos,
|
||||||
GameMapType,
|
GameMapType,
|
||||||
GameMode,
|
GameMode,
|
||||||
|
UnitType,
|
||||||
mapCategories,
|
mapCategories,
|
||||||
} from "../core/game/Game";
|
} from "../core/game/Game";
|
||||||
import { GameConfig, GameInfo } from "../core/Schemas";
|
import { GameConfig, GameInfo } from "../core/Schemas";
|
||||||
@@ -39,6 +40,7 @@ export class HostLobbyModal extends LitElement {
|
|||||||
@state() private copySuccess = false;
|
@state() private copySuccess = false;
|
||||||
@state() private players: string[] = [];
|
@state() private players: string[] = [];
|
||||||
@state() private useRandomMap: boolean = false;
|
@state() private useRandomMap: boolean = false;
|
||||||
|
@state() private disabledUnits: string[] = [];
|
||||||
|
|
||||||
private playersInterval = null;
|
private playersInterval = null;
|
||||||
// Add a new timer for debouncing bot changes
|
// Add a new timer for debouncing bot changes
|
||||||
@@ -302,21 +304,72 @@ export class HostLobbyModal extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label
|
<hr style="width: 100%; border-top: 1px solid #444; margin: 16px 0;" />
|
||||||
for="disable-nukes"
|
|
||||||
class="option-card ${this.disableNukes ? "selected" : ""}"
|
<!-- Individual disables for structures/weapons -->
|
||||||
|
<div
|
||||||
|
style="margin: 8px 0 12px 0; font-weight: bold; color: #ccc; text-align: center;"
|
||||||
>
|
>
|
||||||
<div class="checkbox-icon"></div>
|
${translateText("host_modal.enables_title")}
|
||||||
<input
|
</div>
|
||||||
type="checkbox"
|
<div
|
||||||
id="disable-nukes"
|
style="display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;"
|
||||||
@change=${this.handleDisableNukesChange}
|
>
|
||||||
.checked=${this.disableNukes}
|
${[
|
||||||
/>
|
[UnitType.City, "unit_type.city"],
|
||||||
<div class="option-card-title">
|
[UnitType.DefensePost, "unit_type.defense_post"],
|
||||||
${translateText("host_modal.disable_nukes")}
|
[UnitType.Port, "unit_type.port"],
|
||||||
|
[UnitType.Warship, "unit_type.warship"],
|
||||||
|
[UnitType.MissileSilo, "unit_type.missile_silo"],
|
||||||
|
[UnitType.SAMLauncher, "unit_type.sam_launcher"],
|
||||||
|
[UnitType.AtomBomb, "unit_type.atom_bomb"],
|
||||||
|
[UnitType.HydrogenBomb, "unit_type.hydrogen_bomb"],
|
||||||
|
[UnitType.MIRV, "unit_type.mirv"],
|
||||||
|
].map(
|
||||||
|
([unitType, translationKey]) => html`
|
||||||
|
<label
|
||||||
|
class="option-card ${this.disabledUnits.includes(
|
||||||
|
unitType,
|
||||||
|
)
|
||||||
|
? ""
|
||||||
|
: "selected"}"
|
||||||
|
style="width: 140px;"
|
||||||
|
>
|
||||||
|
<div class="checkbox-icon"></div>
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
@change=${(e: Event) => {
|
||||||
|
const checked = (e.target as HTMLInputElement)
|
||||||
|
.checked;
|
||||||
|
const parsedUnitType =
|
||||||
|
UnitType[unitType as keyof typeof UnitType];
|
||||||
|
if (parsedUnitType) {
|
||||||
|
if (checked) {
|
||||||
|
this.disabledUnits = [
|
||||||
|
...this.disabledUnits,
|
||||||
|
parsedUnitType,
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
this.disabledUnits = this.disabledUnits.filter(
|
||||||
|
(u) => u !== parsedUnitType,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
this.putGameConfig();
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
.checked=${this.disabledUnits.includes(unitType)}
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
class="option-card-title"
|
||||||
|
style="text-align: center;"
|
||||||
|
>
|
||||||
|
${translateText(translationKey)}
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
`,
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -490,6 +543,8 @@ export class HostLobbyModal extends LitElement {
|
|||||||
infiniteTroops: this.infiniteTroops,
|
infiniteTroops: this.infiniteTroops,
|
||||||
instantBuild: this.instantBuild,
|
instantBuild: this.instantBuild,
|
||||||
gameMode: this.gameMode,
|
gameMode: this.gameMode,
|
||||||
|
numPlayerTeams: this.teamCount,
|
||||||
|
disabledUnits: this.disabledUnits,
|
||||||
playerTeams: this.teamCount,
|
playerTeams: this.teamCount,
|
||||||
} as GameConfig),
|
} as GameConfig),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
GameMapType,
|
GameMapType,
|
||||||
GameMode,
|
GameMode,
|
||||||
GameType,
|
GameType,
|
||||||
|
UnitType,
|
||||||
mapCategories,
|
mapCategories,
|
||||||
} from "../core/game/Game";
|
} from "../core/game/Game";
|
||||||
import { generateID } from "../core/Util";
|
import { generateID } from "../core/Util";
|
||||||
@@ -39,6 +40,8 @@ export class SinglePlayerModal extends LitElement {
|
|||||||
@state() private gameMode: GameMode = GameMode.FFA;
|
@state() private gameMode: GameMode = GameMode.FFA;
|
||||||
@state() private teamCount: number | typeof Duos = 2;
|
@state() private teamCount: number | typeof Duos = 2;
|
||||||
|
|
||||||
|
@state() private disabledUnits: string[] = [];
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return html`
|
return html`
|
||||||
<o-modal title=${translateText("single_modal.title")}>
|
<o-modal title=${translateText("single_modal.title")}>
|
||||||
@@ -269,22 +272,61 @@ export class SinglePlayerModal extends LitElement {
|
|||||||
${translateText("single_modal.infinite_troops")}
|
${translateText("single_modal.infinite_troops")}
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<label
|
<hr
|
||||||
for="singleplayer-modal-disable-nukes"
|
style="width: 100%; border-top: 1px solid #444; margin: 16px 0;"
|
||||||
class="option-card ${this.disableNukes ? "selected" : ""}"
|
/>
|
||||||
>
|
<div
|
||||||
<div class="checkbox-icon"></div>
|
style="margin: 8px 0 12px 0; font-weight: bold; color: #ccc; text-align: center;"
|
||||||
<input
|
>
|
||||||
type="checkbox"
|
${translateText("single_modal.enables_title")}
|
||||||
id="singleplayer-modal-disable-nukes"
|
</div>
|
||||||
@change=${this.handleDisableNukesChange}
|
<div
|
||||||
.checked=${this.disableNukes}
|
style="display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;"
|
||||||
/>
|
>
|
||||||
<div class="option-card-title">
|
${[
|
||||||
${translateText("single_modal.disable_nukes")}
|
[UnitType.City, "unit_type.city"],
|
||||||
</div>
|
[UnitType.DefensePost, "unit_type.defense_post"],
|
||||||
</label>
|
[UnitType.Port, "unit_type.port"],
|
||||||
|
[UnitType.Warship, "unit_type.warship"],
|
||||||
|
[UnitType.MissileSilo, "unit_type.missile_silo"],
|
||||||
|
[UnitType.SAMLauncher, "unit_type.sam_launcher"],
|
||||||
|
[UnitType.AtomBomb, "unit_type.atom_bomb"],
|
||||||
|
[UnitType.HydrogenBomb, "unit_type.hydrogen_bomb"],
|
||||||
|
[UnitType.MIRV, "unit_type.mirv"],
|
||||||
|
].map(
|
||||||
|
([unitType, translationKey]) => html`
|
||||||
|
<label
|
||||||
|
class="option-card ${this.disabledUnits.includes(unitType)
|
||||||
|
? ""
|
||||||
|
: "selected"}"
|
||||||
|
style="width: 140px;"
|
||||||
|
>
|
||||||
|
<div class="checkbox-icon"></div>
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
@change=${(e: Event) => {
|
||||||
|
const checked = (e.target as HTMLInputElement).checked;
|
||||||
|
if (checked) {
|
||||||
|
this.disabledUnits = [
|
||||||
|
...this.disabledUnits,
|
||||||
|
unitType,
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
this.disabledUnits = this.disabledUnits.filter(
|
||||||
|
(u) => u !== unitType,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
.checked=${this.disabledUnits.includes(unitType)}
|
||||||
|
/>
|
||||||
|
<div class="option-card-title" style="text-align: center;">
|
||||||
|
${translateText(translationKey)}
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
`,
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -419,6 +461,7 @@ export class SinglePlayerModal extends LitElement {
|
|||||||
infiniteGold: this.infiniteGold,
|
infiniteGold: this.infiniteGold,
|
||||||
infiniteTroops: this.infiniteTroops,
|
infiniteTroops: this.infiniteTroops,
|
||||||
instantBuild: this.instantBuild,
|
instantBuild: this.instantBuild,
|
||||||
|
disabledUnits: this.disabledUnits,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} as JoinLobbyEvent,
|
} as JoinLobbyEvent,
|
||||||
|
|||||||
@@ -409,21 +409,9 @@ export class BuildMenu extends LitElement implements Layer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private getBuildableUnits(): BuildItemDisplay[][] {
|
private getBuildableUnits(): BuildItemDisplay[][] {
|
||||||
if (this.game?.config()?.disableNukes()) {
|
return buildTable.map((row) =>
|
||||||
return buildTable.map((row) =>
|
row.filter((item) => !this.game?.config()?.isUnitDisabled(item.unitType)),
|
||||||
row.filter(
|
);
|
||||||
(item) =>
|
|
||||||
![
|
|
||||||
UnitType.AtomBomb,
|
|
||||||
UnitType.MIRV,
|
|
||||||
UnitType.HydrogenBomb,
|
|
||||||
UnitType.MissileSilo,
|
|
||||||
UnitType.SAMLauncher,
|
|
||||||
].includes(item.unitType),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return buildTable;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get isVisible() {
|
get isVisible() {
|
||||||
|
|||||||
+2
-1
@@ -116,12 +116,13 @@ const GameConfigSchema = z.object({
|
|||||||
gameType: z.nativeEnum(GameType),
|
gameType: z.nativeEnum(GameType),
|
||||||
gameMode: z.nativeEnum(GameMode),
|
gameMode: z.nativeEnum(GameMode),
|
||||||
disableNPCs: z.boolean(),
|
disableNPCs: z.boolean(),
|
||||||
disableNukes: z.boolean(),
|
|
||||||
bots: z.number().int().min(0).max(400),
|
bots: z.number().int().min(0).max(400),
|
||||||
infiniteGold: z.boolean(),
|
infiniteGold: z.boolean(),
|
||||||
infiniteTroops: z.boolean(),
|
infiniteTroops: z.boolean(),
|
||||||
instantBuild: z.boolean(),
|
instantBuild: z.boolean(),
|
||||||
maxPlayers: z.number().optional(),
|
maxPlayers: z.number().optional(),
|
||||||
|
numPlayerTeams: z.number().optional(),
|
||||||
|
disabledUnits: z.array(z.nativeEnum(UnitType)).optional(),
|
||||||
playerTeams: z.union([z.number().optional(), z.literal(Duos)]),
|
playerTeams: z.union([z.number().optional(), z.literal(Duos)]),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ export interface Config {
|
|||||||
percentageTilesOwnedToWin(): number;
|
percentageTilesOwnedToWin(): number;
|
||||||
numBots(): number;
|
numBots(): number;
|
||||||
spawnNPCs(): boolean;
|
spawnNPCs(): boolean;
|
||||||
disableNukes(): boolean;
|
isUnitDisabled(unitType: UnitType): boolean;
|
||||||
bots(): number;
|
bots(): number;
|
||||||
infiniteGold(): boolean;
|
infiniteGold(): boolean;
|
||||||
infiniteTroops(): boolean;
|
infiniteTroops(): boolean;
|
||||||
|
|||||||
@@ -231,9 +231,10 @@ export class DefaultConfig implements Config {
|
|||||||
return !this._gameConfig.disableNPCs;
|
return !this._gameConfig.disableNPCs;
|
||||||
}
|
}
|
||||||
|
|
||||||
disableNukes(): boolean {
|
isUnitDisabled(unitType: UnitType): boolean {
|
||||||
return this._gameConfig.disableNukes;
|
return this._gameConfig.disabledUnits?.includes(unitType) ?? false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bots(): number {
|
bots(): number {
|
||||||
return this._gameConfig.bots;
|
return this._gameConfig.bots;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -421,9 +421,7 @@ export class FakeHumanExecution implements Execution {
|
|||||||
if (this.maybeSpawnWarship()) {
|
if (this.maybeSpawnWarship()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!this.mg.config().disableNukes()) {
|
this.maybeSpawnStructure(UnitType.MissileSilo, 1);
|
||||||
this.maybeSpawnStructure(UnitType.MissileSilo, 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private maybeSpawnStructure(type: UnitType, maxNum: number) {
|
private maybeSpawnStructure(type: UnitType, maxNum: number) {
|
||||||
|
|||||||
@@ -709,6 +709,12 @@ export class PlayerImpl implements Player {
|
|||||||
spawnTile: TileRef,
|
spawnTile: TileRef,
|
||||||
unitSpecificInfos: UnitSpecificInfos = {},
|
unitSpecificInfos: UnitSpecificInfos = {},
|
||||||
): UnitImpl {
|
): UnitImpl {
|
||||||
|
if (this.mg.config().isUnitDisabled(type)) {
|
||||||
|
throw new Error(
|
||||||
|
`Attempted to build disabled unit ${type} at tile ${spawnTile} by player ${this.name()}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const cost = this.mg.unitInfo(type).cost(this);
|
const cost = this.mg.unitInfo(type).cost(this);
|
||||||
const b = new UnitImpl(
|
const b = new UnitImpl(
|
||||||
type,
|
type,
|
||||||
@@ -746,19 +752,8 @@ export class PlayerImpl implements Player {
|
|||||||
targetTile: TileRef,
|
targetTile: TileRef,
|
||||||
validTiles: TileRef[] | null = null,
|
validTiles: TileRef[] | null = null,
|
||||||
): TileRef | false {
|
): TileRef | false {
|
||||||
// prevent the building of nukes and nuke related buildings
|
if (this.mg.config().isUnitDisabled(unitType)) {
|
||||||
if (this.mg.config().disableNukes()) {
|
return false;
|
||||||
if (
|
|
||||||
unitType === UnitType.MissileSilo ||
|
|
||||||
unitType === UnitType.MIRV ||
|
|
||||||
unitType === UnitType.AtomBomb ||
|
|
||||||
unitType === UnitType.HydrogenBomb ||
|
|
||||||
unitType === UnitType.SAMLauncher ||
|
|
||||||
unitType === UnitType.SAMMissile ||
|
|
||||||
unitType === UnitType.MIRVWarhead
|
|
||||||
) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const cost = this.mg.unitInfo(unitType).cost(this);
|
const cost = this.mg.unitInfo(unitType).cost(this);
|
||||||
|
|||||||
@@ -34,12 +34,12 @@ export class GameManager {
|
|||||||
gameType: GameType.Private,
|
gameType: GameType.Private,
|
||||||
difficulty: Difficulty.Medium,
|
difficulty: Difficulty.Medium,
|
||||||
disableNPCs: false,
|
disableNPCs: false,
|
||||||
disableNukes: false,
|
|
||||||
infiniteGold: false,
|
infiniteGold: false,
|
||||||
infiniteTroops: false,
|
infiniteTroops: false,
|
||||||
instantBuild: false,
|
instantBuild: false,
|
||||||
gameMode: GameMode.FFA,
|
gameMode: GameMode.FFA,
|
||||||
bots: 400,
|
bots: 400,
|
||||||
|
disabledUnits: [],
|
||||||
...gameConfig,
|
...gameConfig,
|
||||||
});
|
});
|
||||||
this.games.set(id, game);
|
this.games.set(id, game);
|
||||||
|
|||||||
@@ -77,9 +77,6 @@ export class GameServer {
|
|||||||
if (gameConfig.disableNPCs != null) {
|
if (gameConfig.disableNPCs != null) {
|
||||||
this.gameConfig.disableNPCs = gameConfig.disableNPCs;
|
this.gameConfig.disableNPCs = gameConfig.disableNPCs;
|
||||||
}
|
}
|
||||||
if (gameConfig.disableNukes != null) {
|
|
||||||
this.gameConfig.disableNukes = gameConfig.disableNukes;
|
|
||||||
}
|
|
||||||
if (gameConfig.bots != null) {
|
if (gameConfig.bots != null) {
|
||||||
this.gameConfig.bots = gameConfig.bots;
|
this.gameConfig.bots = gameConfig.bots;
|
||||||
}
|
}
|
||||||
@@ -95,6 +92,11 @@ export class GameServer {
|
|||||||
if (gameConfig.gameMode != null) {
|
if (gameConfig.gameMode != null) {
|
||||||
this.gameConfig.gameMode = gameConfig.gameMode;
|
this.gameConfig.gameMode = gameConfig.gameMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gameConfig.disabledUnits != null) {
|
||||||
|
this.gameConfig.disabledUnits = gameConfig.disabledUnits;
|
||||||
|
}
|
||||||
|
|
||||||
if (gameConfig.playerTeams != null) {
|
if (gameConfig.playerTeams != null) {
|
||||||
this.gameConfig.playerTeams = gameConfig.playerTeams;
|
this.gameConfig.playerTeams = gameConfig.playerTeams;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ export function startWorker() {
|
|||||||
instantBuild: req.body.instantBuild,
|
instantBuild: req.body.instantBuild,
|
||||||
bots: req.body.bots,
|
bots: req.body.bots,
|
||||||
disableNPCs: req.body.disableNPCs,
|
disableNPCs: req.body.disableNPCs,
|
||||||
disableNukes: req.body.disableNukes,
|
disabledUnits: req.body.disabledUnits,
|
||||||
gameMode: req.body.gameMode,
|
gameMode: req.body.gameMode,
|
||||||
playerTeams: req.body.playerTeams,
|
playerTeams: req.body.playerTeams,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user