fix(plugin): enforce bans via engine-supported method (Synergy) - #27
fix(plugin): enforce bans via engine-supported method (Synergy)#27Rushaway wants to merge 2 commits into
Conversation
The SB++ plugin enforced bans of already-connected / reconnecting players
and temp-ban queue retries by sending "banid <minutes> STEAM_X:Y:Z" to the
server console. Some engines (notably Synergy, appid 17520) reject the
STEAM_ format for that command ("STEAM_ format is not supported for this
command"), so the ban was silently dropped and the player kept rejoining.
Route these paths through BanClient() when the target is still connected so
SourceMod selects a ban method the running engine actually supports, and
fall back to "banid" with the SteamID3 form when the player is offline.
Fixes sbpp#1507
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Follow-ups on the Synergy engine-ban fix:
- Restore per-client translation. KickClient() set the global translation
target before formatting; FormatEx() does not, so "Banned Check Site" /
"Kick Reason" were rendered against whatever target happened to be set
last. Added SetGlobalTransTarget() in VerifyBan() and UTIL_InsertTempBan().
- SBPP_BanIdentity(): take an optional client hint (UTIL_InsertTempBan
already knows the target), skip fake clients so BanClient() cannot throw
"Cannot ban fake client", bail on an empty authid, and clamp minutes to
>= 1 so a misconfigured ProcessQueueTime cannot turn a temporary hold into
a permanent ban written to banned_user.cfg.
- SBPP_BanIdentity(): build the localised "Banned Check Site" message when no
kick message is supplied, instead of letting SourceMod kick with "Kicked"
(hit by the AddedFromSQLiteCallback retry path).
- Use the BanIdentity() native for the offline path rather than a hand-built
ServerCommand("banid ..."): it strips command separators from the identity
and fires OnBanIdentity, matching the RemoveBan() call already used nearby.
- SBPP_Steam2ToSteam3(): reject STEAM_ID_PENDING / STEAM_ID_LAN and empty
fields, and render the account id with %u so ids past 2^31 do not come out
negative.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Review: approach is correct, five follow-up fixes pushed (6895d2c)Verdict: the fix is sound and I verified the mechanism against SourceMod's own source, not just the symptom.
Fixes pushed
Checked and found fine
CI green: Compile SourceMod plugins — pass, zero |
Problem
Ports upstream issue sbpp#1507.
On some engines (notably Synergy, appid 17520) the server console command
banid <minutes> STEAM_X:Y:Zis rejected with "STEAM_ format is not supportedfor this command". SB++ used that raw command in the paths that enforce a ban
against a player who is already connected / reconnecting and in the offline
temp-ban queue retry, so on those engines the ban was silently dropped and the
player kept rejoining (log shows
Banid: "<><UNKNOWN><>").sm_ban/PrepareBanalready went throughBanClient()and worked; only thereconnect-check and queue paths still used the raw command.
Change
game/addons/sourcemod/scripting/sbpp_main.sp:SBPP_BanIdentity(auth, minutes, kickMessage)— if the target isstill connected it bans through
BanClient(... BANFLAG_AUTHID ...)soSourceMod picks a ban method the running engine supports; otherwise it falls
back to
banidusing the SteamID3 ([U:1:W]) form, which those enginesaccept. Helper
SBPP_Steam2ToSteam3()does the conversion.VerifyBan()reconnect enforcement now callsBanClient()instead ofbanid <STEAM_...>+KickClient().AddedFromSQLiteCallback()andUTIL_InsertTempBan()queue paths now useSBPP_BanIdentity().No DB/schema changes; fork-specific
DB.Format/admin_nameINSERT paths areuntouched. No local SourcePawn compiler available — relying on
plugin-buildCI.🤖 Generated with Claude Code