Allow specifying max number of bots allowed on a map

This commit is contained in:
UnknownShadow200 2017-09-02 23:11:53 +10:00
parent 2766924ed7
commit 8bd33f42f3
2 changed files with 5 additions and 0 deletions

View File

@ -56,6 +56,9 @@ namespace MCGalaxy.Commands.Bots {
if (BotExists(p.level, botName)) { if (BotExists(p.level, botName)) {
Player.Message(p, "A bot with that name already exists."); return; Player.Message(p, "A bot with that name already exists."); return;
} }
if (p.level.Bots.Count >= ServerConfig.MaxBotsPerLevel) {
Player.Message(p, "Reached maximum number of bots allowed on this map."); return;
}
PlayerBot bot = new PlayerBot(botName, p.level); PlayerBot bot = new PlayerBot(botName, p.level);
bot.Pos = p.Pos; bot.Pos = p.Pos;

View File

@ -102,6 +102,8 @@ namespace MCGalaxy {
[ConfigString("default-rank", "General", "guest")] [ConfigString("default-rank", "General", "guest")]
public static string DefaultRankName = "guest"; public static string DefaultRankName = "guest";
[ConfigInt("max-bots-per-level", "Other", 192, 0, 256)]
public static int MaxBotsPerLevel = 192;
[ConfigBool("deathcount", "Other", true)] [ConfigBool("deathcount", "Other", true)]
public static bool AnnounceDeathCount = true; public static bool AnnounceDeathCount = true;
[ConfigBool("use-whitelist", "Other", false)] [ConfigBool("use-whitelist", "Other", false)]