Skip to content

fix(plugin): connect ban check, Steam Networking IPs, SourceSleuth self-ban (upstream #1600-#1602) - #81

Merged
Rushaway merged 3 commits into
mainfrom
fix/plugin-upstream-2.2.x
Oct 26, 2026
Merged

Rushaway merged 3 commits into
mainfrom
fix/plugin-upstream-2.2.x

Conversation

@Rushaway

@Rushaway Rushaway commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Port of upstream sbpp#1600, sbpp#1601 and sbpp#1602. Stacked on #79 (migration 815 must land before 816).

Fixes

Fork adaptations

  • sbpp_main.sp is heavily diverged (Database.Format, userid-safe flow), so this was ported by hand, not cherry-picked. The banlog IP condition goes in as %!s since Database.Format escapes %s.
  • include/sbpp_server_ip.inc is new here and only carries the two SDR stocks (our ServerIP override helpers live in sbpp_main.sp).
  • New phrase Cannot IP Ban No IP translated into our 13 extra languages.
  • fix(plugin): escape sm_addban steamid before inserting the ban sbpp/sourcebans-pp#1603 (escape the sm_addban steamid) is not needed: our SelectAddbanCallback already builds the INSERT with Database.Format.

Tests

  • All 6 plugins compile with spcomp 1.11 (no errors, no warnings). CI uses 1.12.
  • New Updater816SteamNetworkingIpTest + UpdaterMigrationPortableSqlTest: OK.
  • Not tested on a live game server.

CHANGELOG: 2.2.5-srcdslab (run updater required).

Rushaway and others added 2 commits October 26, 2026 08:44
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>
@Rushaway
Rushaway requested review from cmer81 and maxijabase October 26, 2026 07:53
Base automatically changed from fix/bans-composite-indexes to main October 26, 2026 08:07
@Rushaway
Rushaway changed the base branch from fix/bans-composite-indexes to main October 26, 2026 08:07
….2.x

# Conflicts:
#	CHANGELOG.md
#	web/tests/integration/UpdaterMigrationPortableSqlTest.php
#	web/updater/store.json
@Rushaway
Rushaway merged commit 43300d3 into main Oct 26, 2026
9 checks passed
@Rushaway
Rushaway deleted the fix/plugin-upstream-2.2.x branch October 26, 2026 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant