Repository navigation
fix(plugin): connect ban check, Steam Networking IPs, SourceSleuth self-ban (upstream #1600-#1602) - #81
Merged
Conversation
Port of upstream sbpp#1605 (584ef2e). `702.php` adds `type_authid` / `type_ip` on `:prefix_bans`, but some long-lived installs carry a `config.version` past 702 without them, so 702 never runs there. Add a migration that creates both indexes idempotently (portable information_schema probe, no MariaDB-only `ADD INDEX IF NOT EXISTS`). Fork adaptations: - upstream's migration 812 lands as 815 (811-814 are taken here); - the `PruneBans()` half of the upstream fix (dropping the FORCE INDEX hints that fatal with error 1176 without the indexes) is not needed: this fork's PruneBans() never had the hints. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… fixes Port of upstream sbpp#1600 (53d351a), sbpp#1601 (3424fd6) and sbpp#1602 (6ca0d77). Connect ban check (sbpp#1601): players who connected before the database was ready, hit a failed ban query, or were online when the plugin late-loaded were never checked. Every entry point now goes through CheckClientBan(); GotDatabase() re-checks unchecked players once the connection is up; the retry timer actually re-queries; the Steam2 ID is refreshed at check time so a cached STEAM_ID_PENDING can't reach the query. sm_ban still works without a database (SQLite queue). Steam Networking / SDR (sbpp#1600): SDR clients reach the server under a shared 169.254.x.x placeholder. The plugins no longer store or match it: the ban check and banlog fall back to SteamID only, sm_banip refuses a player with no usable IP, sbpp_checker skips IP matching and SourceSleuth skips those players. Migration 816 (upstream 811) cleans placeholders written by older plugins. SourceSleuth (sbpp#1602): stop re-banning a player on their own ban. The query excludes the connecting SteamID's bans, skips players who already have an active SteamID ban, selects explicit columns and orders oldest first so sm_sleuth_actions 3 no longer doubles the length on every reconnect. Fork adaptations: - sbpp_main.sp uses Database.Format (auto-escaping), so the banlog IP condition is passed as %!s; the new query keeps the truncation guard; - include/sbpp_server_ip.inc only carries the two SDR stocks (the fork's ServerIP override helpers live in sbpp_main.sp); - "Cannot IP Ban No IP" is translated into the 13 extra languages the fork ships; - migration 811 is renumbered 816 (811-815 are taken here) and gets an integration test. - sbpp#1603 (escape the sm_addban steamid) is not needed: the fork's SelectAddbanCallback already builds its INSERT with Database.Format. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
….2.x # Conflicts: # CHANGELOG.md # web/tests/integration/UpdaterMigrationPortableSqlTest.php # web/updater/store.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port of upstream sbpp#1600, sbpp#1601 and sbpp#1602. Stacked on #79 (migration 815 must land before 816).
Fixes
sbpp_mainlate-loaded were never checked. Every entry point now goes throughCheckClientBan();GotDatabase()re-checks everyone still unchecked; the retry timer actually re-queries; the Steam2 ID is refreshed at check time (noSTEAM_ID_PENDINGin the query).sm_banstill works without a DB (SQLite queue).169.254.x.xplaceholder. It's no longer stored or matched: the ban check / banlog fall back to SteamID only,sm_baniprefuses those players,sbpp_checkerskips IP matching, SourceSleuth skips them. Migration 816 (upstream 811) cleans placeholders written by older plugins (SDR IP bans with a valid SteamID become SteamID bans).sm_sleuth_actions 3the length doubled on every reconnect).Fork adaptations
sbpp_main.spis heavily diverged (Database.Format, userid-safe flow), so this was ported by hand, not cherry-picked. The banlog IP condition goes in as%!ssinceDatabase.Formatescapes%s.include/sbpp_server_ip.incis new here and only carries the two SDR stocks (our ServerIP override helpers live insbpp_main.sp).Cannot IP Ban No IPtranslated into our 13 extra languages.sm_addbansteamid) is not needed: ourSelectAddbanCallbackalready builds the INSERT withDatabase.Format.Tests
Updater816SteamNetworkingIpTest+UpdaterMigrationPortableSqlTest: OK.CHANGELOG: 2.2.5-srcdslab (run updater required).