Fix SBPP_OnClientPreAdminCheck blocking other plugins#26
Open
Rushaway wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
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_OnClientPreAdminCheckto returntruesoCheckLoadAdminscontinues and runs itsNotifyPostAdminCheckloop normally. - Add
g_bInSBPPCallbackand use it to suppress per-clientNotifyPostAdminCheckcalls whileCheckLoadAdminsis already going to notify clients. - Bump plugin version to
3.2.5.
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.
Problem
SBPP_OnClientPreAdminCheckwas returningfalse, which setsbNotify = falseinCheckLoadAdminsand prevents itsNotifyPostAdminCheckloop 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:
RemoveClientcalledRemoveAdminentirely instead of only stripping VIP flags, which would wipe the admin entry for real admins who also have VIP.Solution
SBPP_OnClientPreAdminChecknow returnstrue, lettingCheckLoadAdminsrun itsNotifyPostAdminCheckloop normally for all plugins.To avoid double-calling
NotifyPostAdminCheck(once from this plugin, once fromCheckLoadAdmins), ag_bInSBPPCallbackflag is set during the forward callback.TryNotifyPostAdminCheckchecks this flag and skips the individual notification whenCheckLoadAdminsis already going to handle it.OnClientPreAdminChecknow correctly handles both VIP and non-VIP clients without blocking, and always returnsPlugin_Continue.Changelog
SBPP_OnClientPreAdminCheck: returntrueinstead offalseg_bInSBPPCallbackflag to prevent doubleNotifyPostAdminCheckcalls3.2.5