You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
css_csp_grant/css_csp_reset bot:<name> is case-sensitive: "bot:muhlik" names a different, nonexistent persona than the connected bot "Muhlik" #68
CorrectionTargets.Resolve (CounterStrikeProgression.Core/Admin/CorrectionTargets.cs:50-56) handles the bot: prefix by hashing whatever the admin typed:
if(text.StartsWith(BotPrefix,StringComparison.OrdinalIgnoreCase)){stringbotName=text[BotPrefix.Length..].Trim();returnbotName.Length==0?new(0,text,$"Name a bot as {BotPrefix}<name>."):new(BotIds.For(botName),botName,null);}
BotIds.For keeps case, as its docs say, so the persona id depends on the exact capitalization. Everything else an admin types for a target ignores case: exact and partial names (OrdinalIgnoreCase, lines 69-70), the prefix itself, and the BotNames config keys. Resolve also never checks the connected bots in players, so it has no chance to correct the case.
The result counts as found and names a persona that does not exist.
Failure scenario
The bot Muhlik is on the server. An admin types css_csp_reset bot:muhlik in the console.
The confirmation warning names muhlik (10000000075765951). That id looks valid, so the admin confirms.
SessionManager.Correct finds no session and no stored row for that id. ApplyToStoredAsync returns null, and the admin gets FailedMessage (AdminCorrection.cs:175): "they have no stored progress, or the database write failed". Nothing tells them the cause was capitalization. The real persona is untouched.
The same happens with css_csp_grant bot:muhlik -5000 when an admin is trying to remove exploited XP from a bot persona.
Why it matters
Bot names are typed by hand, often in lower case in the console. This is the documented way to correct a persona (README "Bot personas"), so a wrong-case name quietly misses its target.
Suggested fix / acceptance criteria
With bot:<name>, first look for a connected tracked bot whose name matches ignoring case (players already holds them), and use its id and name.
If no bot is connected, keep hashing the typed name. Optionally, make the error say that persona names are case-sensitive when the target has no stored progress.
Test: Resolve("bot:muhlik", [new(BotIds.For("Muhlik"), 3, "Muhlik")]) returns BotIds.For("Muhlik") and the name Muhlik. The existing Resolve_NamesAnOfflineBotByPrefix test still passes.
Priority: Medium. An admin correction (css_csp_reset / css_csp_grant) quietly misses its bot persona when the name's case is wrong. Nothing is corrupted and the real persona is untouched, but the documented way to fix exploited XP fails with a misleading "no stored progress" message.
Suggested area / assignment: Admin commands, CounterStrikeProgression.Core/Admin/CorrectionTargets.cs. The fix is small: resolve bot:<name> against the connected players with a case-insensitive match first, then fall back to BotIds.For.
Activity
matt-edmondson commentedon Nov 1, 2026
Triage
css_csp_reset/css_csp_grant) quietly misses its bot persona when the name's case is wrong. Nothing is corrupted and the real persona is untouched, but the documented way to fix exploited XP fails with a misleading "no stored progress" message.CounterStrikeProgression.Core/Admin/CorrectionTargets.cs. The fix is small: resolvebot:<name>against the connectedplayerswith a case-insensitive match first, then fall back toBotIds.For.BotNamesentry, closed).buglabel yet.Generated by Claude Code