Skip to content
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

feat(checker): Mutes & gags count natives, late load #1032

Open
wants to merge 1 commit into
base: php81
Choose a base branch
from

Conversation

Rushaway
Copy link
Contributor

@Rushaway Rushaway commented Jan 8, 2025

Description

  1. Edited SQL query to retrieve separate counts for mutes and gags instead of a combined value. The query now returns distinct counts for:

    • Steam ID bans
    • IP bans
    • Voice mutes (type 1)
    • Chat gags (type 2)
  2. Created two new natives to provide more granular access to client communication restrictions:

    • SBPP_CheckerGetClientMutes: Returns the number of mutes
    • SBPP_CheckerGetClientGags: Returns the number of gags
  3. Updated existing SBPP_CheckerGetClientComms native to maintain backward compatibility by returning the sum of mutes and gags.

Motivation and Context

This change provides more detailed information about client restrictions, allowing developers to distinguish between different types of communication blocks. This granular access enables better decision-making in plugins that need to handle mutes and gags differently.

How Has This Been Tested?

Testing was performed on a local SourceMod server with MySQL database running the latest version of SourceBans++. Tests included:

  1. Checking counts for clients with various combinations of bans/mutes/gags
  2. Verifying backward compatibility of the SBPP_CheckerGetClientComms native
  3. Validating the accuracy of the new natives

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.

Thanks to @srcdslab for the idea.

@Rushaway
Copy link
Contributor Author

Rushaway commented Jan 8, 2025

cc @maxime1907 @Hackmastr

@@ -64,6 +67,11 @@ public void OnPluginStart()
RegAdminCmd("sb_reload", OnReloadCmd, ADMFLAG_RCON, "Reload sourcebans config and ban reason menu options");
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion:

  • sm_listgags
  • sm_listmutes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, this feature can be done on the next version (1.8.4) 👍

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