From 418045c76725c3d4d5cd9e9948105c0943fb673d Mon Sep 17 00:00:00 2001 From: Virx Date: Sun, 1 Feb 2026 21:48:08 -0500 Subject: [PATCH 1/3] Fix typo --- RLBotCS/ManagerTools/ConfigParser.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RLBotCS/ManagerTools/ConfigParser.cs b/RLBotCS/ManagerTools/ConfigParser.cs index 8bbb6d4..5062421 100644 --- a/RLBotCS/ManagerTools/ConfigParser.cs +++ b/RLBotCS/ManagerTools/ConfigParser.cs @@ -167,7 +167,7 @@ private T GetEnum(TomlTable table, string key, T fallback) return res; throw new InvalidCastException( $"{_context.ToStringWithEnd(key)} has invalid value \"{raw}\". " - + $"Find valid values on https:/wiki.rlbot.org." + + $"Find valid values on https://wiki.rlbot.org." ); } else @@ -199,7 +199,7 @@ private PlayerClass GetAgentType(TomlTable table) default: throw new InvalidCastException( $"{_context.ToStringWithEnd(Fields.AgentType)} has invalid value \"{raw}\". " - + $"Find valid values on https:/wiki.rlbot.org." + + $"Find valid values on https://wiki.rlbot.org." ); } } From 17e75e8aef6dce485c81da527f4bffc6e6ac0ab7 Mon Sep 17 00:00:00 2001 From: Virx Date: Sun, 1 Feb 2026 22:02:52 -0500 Subject: [PATCH 2/3] Fix #143 --- RLBotCS/ManagerTools/MatchStarter.cs | 58 ++++++++++++++-------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/RLBotCS/ManagerTools/MatchStarter.cs b/RLBotCS/ManagerTools/MatchStarter.cs index 3d0f1ad..1ac63f0 100644 --- a/RLBotCS/ManagerTools/MatchStarter.cs +++ b/RLBotCS/ManagerTools/MatchStarter.cs @@ -130,6 +130,21 @@ public void OnMapSpawn(string mapName, PlayerSpawner spawner) } } + private static string DedupName(string name, Dictionary nameCounts) + { + if (nameCounts.TryGetValue(name, out int count)) + { + nameCounts[name] = ++count; + name += $" ({count})"; + } + else + { + nameCounts[name] = 0; + } + + return name; + } + private void PreprocessMatch(MatchConfigurationT matchConfig) { Dictionary playerNames = []; @@ -138,43 +153,28 @@ private void PreprocessMatch(MatchConfigurationT matchConfig) foreach (var player in matchConfig.PlayerConfigurations) { // De-duplicating similar names. Overwrites original value. - - if (player.Variety.Value is CustomBotT config) + switch (player.Variety.Value) { - string playerName = config.Name ?? ""; - if (playerNames.TryGetValue(playerName, out int value)) - { - playerNames[playerName] = ++value; - config.Name = playerName + $" ({value + 1})"; - } - else - { - playerNames[playerName] = 0; - config.Name = playerName; - } + case CustomBotT config: + string playerName = config.Name ?? ""; + config.Name = DedupName(playerName, playerNames); - if (config.Hivemind) - { - _hivemindNameMap[config.Name] = playerName; - } + if (config.Hivemind) + { + _hivemindNameMap[config.Name] = playerName; + } + break; + case PsyonixBotT config: + config.Name = DedupName(config.Name ?? "", playerNames); + break; } } Dictionary scriptNames = []; - foreach (var scriptConfig in matchConfig.ScriptConfigurations) + foreach (var script in matchConfig.ScriptConfigurations) { // De-duplicating similar names. Overwrites original value. - string scriptName = scriptConfig.Name ?? ""; - if (scriptNames.TryGetValue(scriptName, out int value)) - { - scriptNames[scriptName] = ++value; - scriptConfig.Name = scriptName + $" ({value})"; - } - else - { - scriptNames[scriptName] = 0; - scriptConfig.Name = scriptName; - } + script.Name = DedupName(script.Name ?? "", scriptNames); } } From a19bb2fb6675766d89d5804ce81ddf32da7b081a Mon Sep 17 00:00:00 2001 From: Virx Date: Sun, 1 Feb 2026 22:07:02 -0500 Subject: [PATCH 3/3] `count + 1` --- RLBotCS/ManagerTools/MatchStarter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RLBotCS/ManagerTools/MatchStarter.cs b/RLBotCS/ManagerTools/MatchStarter.cs index 1ac63f0..dd01036 100644 --- a/RLBotCS/ManagerTools/MatchStarter.cs +++ b/RLBotCS/ManagerTools/MatchStarter.cs @@ -135,7 +135,7 @@ private static string DedupName(string name, Dictionary nameCounts) if (nameCounts.TryGetValue(name, out int count)) { nameCounts[name] = ++count; - name += $" ({count})"; + name += $" ({count + 1})"; } else {