-
-
Notifications
You must be signed in to change notification settings - Fork 422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix invalid client index in Basebans menu #1998
Open
Rainyan
wants to merge
7
commits into
alliedmodders:master
Choose a base branch
from
Rainyan:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Commits on May 11, 2023
-
Fix invalid client index in Basebans menu
Fix alliedmodders#1768 The `sm_admin`-triggered Menu flow for banning players is caching client indices inside the basebans.sp `PlayerInfo` struct, and can then incorrectly use them in the menu callback without checking for the related client's UserId validity. This leads to bug alliedmodders#1768 occurring when the ban target player disconnects from the server before the banning admin could complete the banmenu UI flow. Since the related menu callbacks can't rely on the cached client index, I have removed the basebans.sp `PlayerInfo.banTarget` member entirely, in favor of the `PlayerInfo.banTarget`, and instead call `GetClientOfUserId(...)` to get & validate the target client index where necessary. The `PrepareBan(...)` function has been refactored to take a ban target UserId (instead of the target client index) accordingly.
Configuration menu - View commit details
-
Copy full SHA for bf72128 - Browse repository at this point
Copy the full SHA bf72128View commit details
Commits on Oct 15, 2023
-
Use auth strings when banning from menu
When an admin initiates a ban from a BaseBans GUI menu, track players by their AuthId (SteamID) instead of userid, so that the admin is able to target players who disconnect after that menu was constructed. If the target player is still connected, use their userid to ban the same as before this commit. If the target has disconnected, write a ban using their stored AuthId value, as with "sm_addban". This commit also revertss the `(admin==0)` check from PrepareBan that was mistakenly added by bf72128, because it would prevent banning from server/RCON (client index 0).
Configuration menu - View commit details
-
Copy full SHA for f9ec381 - Browse repository at this point
Copy the full SHA f9ec381View commit details -
Use userid to find client when possible
Only fall back to authid lookup if userid no longer resolved to client index
Configuration menu - View commit details
-
Copy full SHA for 5ac6be0 - Browse repository at this point
Copy the full SHA 5ac6be0View commit details -
In function "PrepareBan", use the global PlayerInfo struct array members directly, instead of passing them as function parameters.
Configuration menu - View commit details
-
Copy full SHA for 67f5fcd - Browse repository at this point
Copy the full SHA 67f5fcdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9b06d85 - Browse repository at this point
Copy the full SHA 9b06d85View commit details -
Unify the client validity checks with AddTargetsToMenuByAuthId checks
Configuration menu - View commit details
-
Copy full SHA for 3b6f18e - Browse repository at this point
Copy the full SHA 3b6f18eView commit details
Commits on Dec 9, 2023
-
Use MAX_TARGET_LENGTH over defining a new custom length
Configuration menu - View commit details
-
Copy full SHA for 69988c8 - Browse repository at this point
Copy the full SHA 69988c8View commit details
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.