Skip to content

Conversation

@Rushaway
Copy link
Member

@Rushaway Rushaway commented Jun 4, 2025

Changes Overview

This PR simplifies and improves the VIP Sourcemod Flags plugin by removing unnecessary complexity and adding proper late load support.

Key Improvements

  1. Simplified Group Management

    • Removed complex group handling system
    • Direct flag management instead of group inheritance
    • More straightforward immunity level handling
  2. Late Load Support

    • Added AskPluginLoad2 to properly detect late plugin loading
    • Added g_bLateLoaded flag to track plugin load state
    • Proper handling of existing clients when plugin loads late
  3. SourceBans++ Integration

    • Simplified synchronization with SourceBans++
    • Removed unnecessary admin reload commands
    • Better handling of admin cache rebuilding
  4. Code Structure

    • Removed unnecessary ArrayList usage
    • Simplified client loading/unloading logic
    • More efficient flag management

Technical Details

  • Removed sm_vip_group_name ConVar as it's no longer needed
  • Simplified flag application process
  • Added proper late load detection
  • Improved client state management

Repro

  • Create user on sbpp
  • Dont give him servers flags
  • Set him web group with no flags
  • Let him connect with his VIP already stored in DB
  • Issue triggered

Testing

The changes have been tested with:

  • Late plugin loading
  • SourceBans++ integration
  • CCC integration
  • VIP flag changes
  • Admin cache rebuilding

Related Issues

  • Fixes issue with VIP flags not being properly applied
  • Resolves late load problems
  • Improves overall plugin reliability

@Rushaway Rushaway marked this pull request as draft June 4, 2025 19:19
@Rushaway
Copy link
Member Author

Rushaway commented Jun 5, 2025

I keep it as draft for now but can you review the logic @maxime1907 ?

@Rushaway
Copy link
Member Author

Rushaway commented Jun 8, 2025

Seem to work fine without issue reported for now. I will mark this PR as ready.

@Rushaway Rushaway marked this pull request as ready for review June 8, 2025 08:27
@Rushaway Rushaway requested a review from maxime1907 June 16, 2025 06:09
@Rushaway Rushaway requested a review from Copilot August 19, 2025 14:17

This comment was marked as outdated.

@Rushaway Rushaway requested a review from Copilot September 2, 2025 13:33

This comment was marked as outdated.

@Rushaway Rushaway requested a review from Copilot September 3, 2025 06:31

This comment was marked as outdated.

@Rushaway Rushaway requested a review from Copilot September 3, 2025 14:05
Copy link

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 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 AskPluginLoad2 and 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);
Copy link

Copilot AI Sep 3, 2025

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.

Copilot uses AI. Check for mistakes.
@Rushaway Rushaway requested a review from Copilot September 3, 2025 14:58

This comment was marked as outdated.

@Rushaway Rushaway requested a review from Copilot September 4, 2025 04:33

This comment was marked as outdated.

@Rushaway Rushaway requested a review from Copilot September 4, 2025 08:28
Copy link

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 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.

Comment on lines 177 to 181
if (g_bReloadVips)
ReloadVIPs();

g_bReloadVips = false;
}
Copy link

Copilot AI Sep 4, 2025

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.

Suggested change
if (g_bReloadVips)
ReloadVIPs();
g_bReloadVips = false;
}
if (g_bReloadVips)
{
ReloadVIPs();
g_bReloadVips = false;
}
}

Copilot uses AI. Check for mistakes.
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