Skip to content

Fix SBPP_OnClientPreAdminCheck blocking other plugins#26

Open
Rushaway wants to merge 1 commit into
masterfrom
Rushaway-patch-1
Open

Fix SBPP_OnClientPreAdminCheck blocking other plugins#26
Rushaway wants to merge 1 commit into
masterfrom
Rushaway-patch-1

Conversation

@Rushaway
Copy link
Copy Markdown
Member

Problem

SBPP_OnClientPreAdminCheck was returning false, which sets bNotify = false in CheckLoadAdmins and prevents its NotifyPostAdminCheck loop from running. Any other plugin registered to this forward would silently never receive its post-admin check notification.

Additionally, the previous implementation had several correctness issues:

  • RemoveClient called RemoveAdmin entirely instead of only stripping VIP flags, which would wipe the admin entry for real admins who also have VIP.
  • No late-load support — if the plugin loaded while clients were already connected, their VIP state would never be applied.

Solution

SBPP_OnClientPreAdminCheck now returns true, letting CheckLoadAdmins run its NotifyPostAdminCheck loop normally for all plugins.

To avoid double-calling NotifyPostAdminCheck (once from this plugin, once from CheckLoadAdmins), a g_bInSBPPCallback flag is set during the forward callback. TryNotifyPostAdminCheck checks this flag and skips the individual notification when CheckLoadAdmins is already going to handle it.

OnClientPreAdminCheck now correctly handles both VIP and non-VIP clients without blocking, and always returns Plugin_Continue.

Changelog

  • SBPP_OnClientPreAdminCheck: return true instead of false
  • Add g_bInSBPPCallback flag to prevent double NotifyPostAdminCheck calls
  • Version bumped to 3.2.5

Copilot AI review requested due to automatic review settings May 21, 2026 21:02
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes [VIP] Sourcemod Flags interaction with SourceBans++’s SBPP_OnClientPreAdminCheck so it no longer blocks SourceMod’s normal post-admin-check notification flow, which could prevent other plugins from receiving their post-admin check callbacks.

Changes:

  • Change SBPP_OnClientPreAdminCheck to return true so CheckLoadAdmins continues and runs its NotifyPostAdminCheck loop normally.
  • Add g_bInSBPPCallback and use it to suppress per-client NotifyPostAdminCheck calls while CheckLoadAdmins is already going to notify clients.
  • Bump plugin version to 3.2.5.

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.

2 participants