-
Notifications
You must be signed in to change notification settings - Fork 3
fix: Handle admin permissions for VIP users without admin flags #13
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
base: master
Are you sure you want to change the base?
Conversation
|
I keep it as draft for now but can you review the logic @maxime1907 ? |
|
Seem to work fine without issue reported for now. I will mark this PR as ready. |
There was a problem hiding this 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 simplifies the VIP Sourcemod Flags plugin by removing complex group-based flag management in favor of direct flag assignment, while adding proper late plugin loading support to handle VIP users without admin flags.
Key changes include:
- Replaced group inheritance system with direct flag assignment to admin IDs
- Added late plugin loading support with
AskPluginLoad2and proper client state tracking - Implemented immunity level preservation to handle cases where VIP immunity shouldn't override higher existing immunity
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| } | ||
|
|
||
| CheckLoadAdmin(client); | ||
| TryNotifyPostAdminCheck(client); |
Copilot
AI
Sep 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function name TryNotifyPostAdminCheck is inconsistent with the usage of NotifyPostAdminCheck on line 163. These should use the same function name for consistency.
There was a problem hiding this 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 simplifies the VIP Sourcemod Flags plugin by removing complex group management in favor of direct flag assignment and adds proper late load support. The changes improve reliability and make the codebase more maintainable.
Key Changes
- Replaced group inheritance system with direct flag assignment to admin accounts
- Added late plugin loading detection and handling via
AskPluginLoad2 - Simplified client state management with better tracking of immunity levels
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| if (g_bReloadVips) | ||
| ReloadVIPs(); | ||
|
|
||
| g_bReloadVips = false; | ||
| } |
Copilot
AI
Sep 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The g_bReloadVips flag is reset regardless of whether ReloadVIPs() was called. This could cause issues if the flag was set for a different AdminCachePart type. The flag should only be reset when the reload actually occurs.
| if (g_bReloadVips) | |
| ReloadVIPs(); | |
| g_bReloadVips = false; | |
| } | |
| if (g_bReloadVips) | |
| { | |
| ReloadVIPs(); | |
| g_bReloadVips = false; | |
| } | |
| } |
Changes Overview
This PR simplifies and improves the VIP Sourcemod Flags plugin by removing unnecessary complexity and adding proper late load support.
Key Improvements
Simplified Group Management
Late Load Support
AskPluginLoad2to properly detect late plugin loadingg_bLateLoadedflag to track plugin load stateSourceBans++ Integration
Code Structure
Technical Details
sm_vip_group_nameConVar as it's no longer neededRepro
Testing
The changes have been tested with:
Related Issues