mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-17 05:34:37 +00:00
Customizable creative mode
This commit is contained in:
@@ -54,9 +54,11 @@ export class GameManager {
|
||||
gameMap: GameMapType.World,
|
||||
gameType: GameType.Private,
|
||||
difficulty: Difficulty.Medium,
|
||||
disableBots: false,
|
||||
disableNPCs: false,
|
||||
creativeMode: false,
|
||||
infiniteGold: false,
|
||||
infiniteTroops: false,
|
||||
instantBuild: false,
|
||||
bots: 400,
|
||||
}),
|
||||
);
|
||||
return id;
|
||||
@@ -139,9 +141,11 @@ export class GameManager {
|
||||
gameMap: this.getNextMap(),
|
||||
gameType: GameType.Public,
|
||||
difficulty: Difficulty.Medium,
|
||||
disableBots: false,
|
||||
infiniteGold: false,
|
||||
infiniteTroops: false,
|
||||
instantBuild: false,
|
||||
disableNPCs: false,
|
||||
creativeMode: false,
|
||||
bots: 400,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -63,14 +63,20 @@ export class GameServer {
|
||||
if (gameConfig.difficulty != null) {
|
||||
this.gameConfig.difficulty = gameConfig.difficulty;
|
||||
}
|
||||
if (gameConfig.disableBots != null) {
|
||||
this.gameConfig.disableBots = gameConfig.disableBots;
|
||||
}
|
||||
if (gameConfig.disableNPCs != null) {
|
||||
this.gameConfig.disableNPCs = gameConfig.disableNPCs;
|
||||
}
|
||||
if (gameConfig.creativeMode != null) {
|
||||
this.gameConfig.creativeMode = gameConfig.creativeMode;
|
||||
if (gameConfig.bots != null) {
|
||||
this.gameConfig.bots = gameConfig.bots;
|
||||
}
|
||||
if (gameConfig.infiniteGold != null) {
|
||||
this.gameConfig.infiniteGold = gameConfig.infiniteGold;
|
||||
}
|
||||
if (gameConfig.infiniteTroops != null) {
|
||||
this.gameConfig.infiniteTroops = gameConfig.infiniteTroops;
|
||||
}
|
||||
if (gameConfig.instantBuild != null) {
|
||||
this.gameConfig.instantBuild = gameConfig.instantBuild;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -225,9 +225,11 @@ app.put(
|
||||
gm.updateGameConfig(lobbyID, {
|
||||
gameMap: req.body.gameMap,
|
||||
difficulty: req.body.difficulty,
|
||||
disableBots: req.body.disableBots,
|
||||
infiniteGold: req.body.infiniteGold,
|
||||
infiniteTroops: req.body.infiniteTroops,
|
||||
instantBuild: req.body.instantBuild,
|
||||
bots: req.body.bots,
|
||||
disableNPCs: req.body.disableNPCs,
|
||||
creativeMode: req.body.creativeMode,
|
||||
});
|
||||
res.status(200).json({ success: true });
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user