Raised This Month: $32 Target: $400
 8% 

[ANY] Voice Enforcement


Post New Thread Reply   
 
Thread Tools Display Modes
Author
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Plugin ID:
2098
Plugin Version:
1.6c
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Old 11-25-2010 , 18:11   [ANY] Voice Enforcement
    Reply With Quote #1

    What is this? It sounds Evil! D:!
    Basically what this plugin does is allows countries on a White list to talk on their microphone. If the client is not in the said countries, they're not allowed to talk. Yes, it is Evil to a certain extent, but childish players leave some of us with no option D:!

    Why would you make this :<
    The inspiration for the plugin came around when we started having random people from other countries joining and just screaming and swearing into their microphone. Not caring if they're banned or not. After I saw Psychonic's "Mute the Canucks/Msleeper" joke plugin that didn't function. I thought what the hell. Gave it a whirl, then just like that, the screaming was gone.

    Sounds... kind of cool. How would I add countries to the list?
    Well, first you'd find what the Country Code is for the Country that you want to Blacklist/Whitelist by going here: http://www.uspto.gov/patft/help/helpctry.htm (I use this, you don't have to).
    Then you'd have to make a list, an example would be sm_voicelist "US, CA, SE, AF, GN, UA"

    But I don't want to Whitelist countries, I want to Blacklist them!
    Cool. Just set sm_voicetoggle to 1 and away you go.

    I'm inside of a whitelisted country, but SourceMod doesn't recognize me and mutes me anyways.
    The GeoIP database is no where near complete. I'm personally using the MaxMind database which seems to have a lot more entires in it, and appears to be more accurate. Entries are still missing from it, though.

    Well... I took a look at your Source and noticed you're using a statically set string array. Why don't you use X or Y instead?
    To be perfectly honest, show me how and I'll move over to it. I spent all of 15minutes making this kind of user friendly, then an hour or so scratching my head wondering why it was only checking one array and not the others (while annoying the hell out 40 or so innocent clients getting printouts while playing). Then I found this which reminded me that if I made a String:Meh[9999999] or someone silly did in IRC a while back. I'd be sitting on a bigger binary which would save stack space to allocate data into the string. You cannot dynamically change the size of an array and or string.

    Where's your Public CVAR @:<
    There's no need for it, load it or don't. Stats don't really matter, especially for something like this.

    tl;dr
    sm_voicelist = Country list, separated by a simple comma. (,)
    sm_voicetoggle = Changes from a whitelist to a blacklist. 0 for the Whitelist functionality, 1 for the Blacklist functionality.
    sm_voicelevel = Command string used to check if the client has authorization or not to bypass the check. At the moment this is set to the reservation flag. As requested, you may change it using admin_overrides.cfg
    Attached Files
    File Type: sp Get Plugin or Get Source (Voice.sp - 1357 views - 2.6 KB)

    Last edited by KyleS; 12-29-2010 at 20:41.
    KyleS is offline
    CatsyLady
    Senior Member
    Join Date: Oct 2009
    Location: Germany
    Old 11-26-2010 , 15:37   Re: [ANY] Voice Enforcement
    Reply With Quote #2

    thats pretty usefull plugin,
    thank you
    CatsyLady is offline
    psychonic

    BAFFLED
    Join Date: May 2008
    Old 11-26-2010 , 15:48   Re: [ANY] Voice Enforcement
    Reply With Quote #3

    Some suggestions to make it infinitely more useful to more people without it having to be edited first:
    • Leave the country list defaulting to empty (else this will not likely get approved as it's somewhere between politically incorrect, racist, and ethnocentric at best
    • Allow the countries to be named in a config file or provide a cvar that allowed a string of comma-separated country codes
    • Allow toggle of whether it behaves as a whitelist or a blacklist
    • Leave the admin immunity in but use the CheckCommandAccess function to check it. This will allow you to not only easily set a default flag for it, but also give a 'command name' to tie it to so that it can be overridden in admin_overrides.txt if admins want to set it to different flag(s).

    Last edited by psychonic; 11-26-2010 at 15:51.
    psychonic is offline
    CatsyLady
    Senior Member
    Join Date: Oct 2009
    Location: Germany
    Old 11-26-2010 , 20:58   Re: [ANY] Voice Enforcement
    Reply With Quote #4

    something more on your wishlist?
    lol
    CatsyLady is offline
    KyleS
    SourceMod Plugin Approver
    Join Date: Jul 2009
    Location: Segmentation Fault.
    Old 11-27-2010 , 06:35   Re: [ANY] Voice Enforcement
    Reply With Quote #5

    Quote:
    Originally Posted by psychonic View Post
    Some suggestions to make it infinitely more useful to more people without it having to be edited first:
    • Leave the country list defaulting to empty (else this will not likely get approved as it's somewhere between politically incorrect, racist, and ethnocentric at best
    • Allow the countries to be named in a config file or provide a cvar that allowed a string of comma-separated country codes
    • Allow toggle of whether it behaves as a whitelist or a blacklist
    • Leave the admin immunity in but use the CheckCommandAccess function to check it. This will allow you to not only easily set a default flag for it, but also give a 'command name' to tie it to so that it can be overridden in admin_overrides.txt if admins want to set it to different flag(s).
    Rectified, did a quick test and everything seemed in order.
    KyleS is offline
    Matheus28
    Senior Member
    Join Date: Aug 2009
    Old 11-28-2010 , 08:50   Re: [ANY] Voice Enforcement
    Reply With Quote #6

    What about you use ExplodeString on sm_voicelist with just a comma, then trim the spaces?
    Matheus28 is offline
    psychonic

    BAFFLED
    Join Date: May 2008
    Old 11-28-2010 , 14:24   Re: [ANY] Voice Enforcement
    Reply With Quote #7

    Quote:
    Originally Posted by Kyle12 View Post
    Rectified, did a quick test and everything seemed in order.
    That was quick. Nice job.

    Quote:
    Originally Posted by Matheus28 View Post
    What about you use ExplodeString on sm_voicelist with just a comma, then trim the spaces?
    I agree. It would make sense to trim all space as it is inevitable that someone will not put the space or put extra space and then say it doesn't work.

    Also, your buffer is too small on line 63
    Code:
    decl String:IPAddress[16], String:CC[2];
    CC needs to have a size of (at least) 3. 2 for the country characters + 1 for null.
    psychonic is offline
    KyleS
    SourceMod Plugin Approver
    Join Date: Jul 2009
    Location: Segmentation Fault.
    Old 11-28-2010 , 19:16   Re: [ANY] Voice Enforcement
    Reply With Quote #8

    Quote:
    Originally Posted by psychonic View Post
    Quote:
    Originally Posted by Matheus28 View Post
    What about you use ExplodeString on sm_voicelist with just a comma, then trim the spaces
    I agree. It would make sense to trim all space as it is inevitable that someone will not put the space or put extra space and then say it doesn't work.
    Very true, fixed.
    Quote:
    Originally Posted by psychonic View Post
    Also, your buffer is too small on line 63
    Code:
    decl String:IPAddress[16], String:CC[2];
    CC needs to have a size of (at least) 3. 2 for the country characters + 1 for null.
    Fixed.

    Prototype-ish, I haven't tested it yet but I've fixed at least three other issues. Will update the main once LimeStone fixes my IPMI issue.

    EDIT: Thought about it in the shower. I'm going to have to use StrContains in comparison to StrEqual, and I'm going to have to allocate more cells.

    Last edited by KyleS; 11-28-2010 at 21:23.
    KyleS is offline
    KyleS
    SourceMod Plugin Approver
    Join Date: Jul 2009
    Location: Segmentation Fault.
    Old 12-03-2010 , 14:38   Re: [ANY] Voice Enforcement
    Reply With Quote #9

    Has a fault tolerance of up to four spaces, fixed some other issues with it and fully tested.

    Updated the OP.

    EDIT: Psychonic told me how to handle this a bit better, updated again to 1.6.

    Last edited by KyleS; 12-03-2010 at 15:23.
    KyleS is offline
    KyleS
    SourceMod Plugin Approver
    Join Date: Jul 2009
    Location: Segmentation Fault.
    Old 12-19-2010 , 14:20   Re: [ANY] Voice Enforcement
    Reply With Quote #10

    Had some useless code left over from the previous method change.

    1.6b is up.
    KyleS is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 04:49.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode