mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-24 13:52:45 +00:00
Added checkboxes to disable Bots and NPCs for single player and private lobbies
This commit is contained in:
@@ -49,6 +49,8 @@ export class GameManager {
|
||||
gameMap: GameMapType.World,
|
||||
gameType: GameType.Private,
|
||||
difficulty: Difficulty.Medium,
|
||||
disableBots: false,
|
||||
disableNPCs: false,
|
||||
})
|
||||
);
|
||||
return id;
|
||||
@@ -87,6 +89,8 @@ export class GameManager {
|
||||
gameMap: this.random.randElement(Object.values(GameMapType)),
|
||||
gameType: GameType.Public,
|
||||
difficulty: Difficulty.Medium,
|
||||
disableBots: false,
|
||||
disableNPCs: false,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@@ -57,6 +57,12 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
public addClient(client: Client, lastTurn: number) {
|
||||
|
||||
@@ -94,6 +94,8 @@ app.put("/private_lobby/:id", (req, res) => {
|
||||
gm.updateGameConfig(lobbyID, {
|
||||
gameMap: req.body.gameMap,
|
||||
difficulty: req.body.difficulty,
|
||||
disableBots: req.body.disableBots,
|
||||
disableNPCs: req.body.disableNPCs,
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user