Raised This Month: $51 Target: $400
 12% 

[ANY] Name Reserve [v1.2.2]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
moiph
Junior Member
Join Date: Mar 2009
Location: Seattle, WA
Plugin ID:
2109
Plugin Version:
1.2.2
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    2 
    Plugin Description:
    Name reservation system -- prevents non whitelisted users from using a reserved list of names
    Old 12-02-2010 , 03:32   [ANY] Name Reserve [v1.2.2]
    Reply With Quote #1

    Name Reserve [1.2.2]
    This plugin allows you to specify a list of reserved names, so that if a random person joins your server with your name (or anyone's name you list in the config), they'll be renamed or kicked (configurable). Note: this only renames players *onconnect* -- if they rename themselves while in-game, they can bypass this. (See future ideas)

    For example, if your name is "EngineerSpy" and you list that name in the config, then if a user connects with that name, one of the following will happen depending on your settings:
    • They'll be renamed to "EngineerSpy (guest)" (where '(guest)' is a configurable cvar).
    • They'll be renamed to "I tried to use a bad name ;_;" (where the name is a configurable cvar)
    • They'll be kicked after X seconds, with warning messages displayed.

    This also supports partial name matches. So if you set in your config a reserved name of "Foo", then a user joining with the name of "Foo" or "FooBar" or "BarFoo" they'll be renamed (unless authorized, of course).

    This is my first plugin so please leave comments/suggestions so I can improve upon this :)

    Also note: I flagged this under "Any" though I really only tested on TF2 -- in theory it should handle other games fine, but if anyone finds that's not the case please let me know!

    Cvars:
    When you load the plugin it'll create a namereserve.cfg in your cfg/sourcemod directory. You can edit the cvars there to modify these settings.
    Code:
    // Admin flag for reserved name use immunity. Empty string means all admins are checked and must have steam ids listed in the config.
    // -
    // Default: "b"
    sm_namereserve_adminsflag "b"
    
    // If PunishType is set to rename, this is the name the user will be changed to.
    // -
    // Default: "I tried to use a bad name ;_;"
    sm_namereserve_badname "I tried to use a bad name ;_;"
    
    // If PunishType is set to kick, this value is used as the delay before kicking the user.
    // -
    // Default: "60"
    sm_namereserve_kickdelay "60"
    
    // Set this to the kick message a user will see (if PunishType is set to kick)
    // -
    // Default: "Using a reserved name"
    sm_namereserve_kickmsg "Using a reserved name"
    
    // If PunishType is set to kick, this value is used as the amount of times the user will be issued warnings that they're going to get kicked. (This will be evenly divided out of kickDelay, so if you set kickDelay to 10 and this to 5, the user will be warned
    // -
    // Default: "1"
    sm_namereserve_kickwarnamount "1"
    
    // Message displayed to the user with each warning when a kick is pending. {rn} will be replaced by the reserved name.
    // -
    // Default: "If you don't change your name, you're gonna be kicked ({rn} is reserved)"
    sm_namereserve_kickwarnmsg "If you don't change your name, you're gonna be kicked ({rn} is reserved)"
    
    // The text to append to a user's name if it's reserved
    // -
    // Default: " (imposter)"
    sm_namereserve_namesuffix " (imposter)"
    
    // The punishment type to use when someone uses a reserved name. (0 = append suffix, 1= rename, 2 = kick)
    // -
    // Default: "0"
    sm_namereserve_punishtype "0"
    
    // The message shown to the user to let them know they've been renamed. {rn} will be replaced with the reserved name.
    // -
    // Default: "You were renamed to avoid admin confusion <3 ({rn} is reserved)"
    sm_namereserve_renamemsg "You were renamed to avoid admin confusion <3 ({rn} is reserved)"
    
    // Whether or not to inform the user that they've been renamed
    // -
    // Default: "1"
    sm_namereserve_showrenamemsg "1"
    
    // NameReserve version
    // -
    // Default: "1.2.2"
    sm_namereserve_version "1.2.2"


    Changelog:
    Code:
    2010-12-2 (v1.0.0)
        - Initial release
    
    2010-12-2 (v1.1.0)
        - Added "Punishment types", so that rather than only appending a suffix on a player using a restricted name, they can now be entirely renamed or kicked 
    
    2010-12-2 (v1.1.1)
        - Typo fix in one of the cvar comments, added a couple logging statements for debug
    
    2010-12-3 (v1.2.0)
        - Added support for partial name matching; also added cvar support to output the reserved name that was flagged to output to the user. (see cvars section)
    
    2010-12-4 (v1.2.1)
        - Added admins flag cvar to allow more specific immunity (rather than just generic admin checks)
    
    2010-12-4(v1.2.2)
        - Added config support for specifying admin flag immunity per name (the global cvar takes precedence)


    Installation:
    Installation is easy!
    Drop namereserve.smx to your sourcemod/plugins directory.
    Drop namereserve.cfg to your sourcemod/configs directory and edit as desired.

    Sample Config:
    In your configuration file, you list out the names which are reserved and the associated steam IDs that are allowed to use them. Set "isPartial "1" for partial matches. To have admin immunity per name (so you don't need to list steamIds), set "adminFlag" "b" (or whatever flag). Note that the admin flag cvar overrides anything set via config.
    Code:
    "Names"
    {
        "TheSpy"
        {
             // specify each user, e.g. user1, user2, etc
             "user1"
             {
                 "id" "steamid"
             }
             "user2"
             {
                 "id" "steamid"
             }
        }
        "TheEngineer"
        {
            "adminFlag" "a"
            "user1"
            {
                "id" "steamid"
            }
        }
        "morenames..."
        {
        }
        "partialname"
        {
            "isPartial" "1"
             // list users
        }
    }


    Future ideas:

    • Add rename monitoring support. Right now the plugin only renames a user when they connect; I didn't want to tackle monitoring renames and throttling the plugin to prevent rename spam in game. If there's demand for this I'll investigate it further but for now I left this out.
    • Allow partial matching, e.g. for clan tag support done!
    • Add cvar for admin flag (right now it's hard-coded to any admin) done!
    • Add config level admin flags, e.g. to allow a particular name to have access granted for kick flag, and another for root done!

    Thanks

    Woo for IRC: A little thanks to thorrr and flaminsarge on irc for responding to a few questions I had on keyvalues, and to FlyingMongoose and asherkin for cvar questions :) And to Atreus for early feedback :P
    Attached Files
    File Type: zip namereserve_1.2.2.zip (13.4 KB, 699 views)
    File Type: sp Get Plugin or Get Source (namereserve.sp - 1396 views - 12.9 KB)

    Last edited by moiph; 12-06-2010 at 22:02.
    moiph is offline
    Send a message via AIM to moiph
    Atreus
    SourceMod Donor
    Join Date: Apr 2005
    Location: San Diego, CA
    Old 12-02-2010 , 04:50   Re: [ANY] Name Reservation [v1.0.0]
    Reply With Quote #2

    You asked me for feecback, so here it is, in its likely far-too-nitpicky form!
    • I have a snippet I can give you that one of the plugins written for us uses for mid-game monitoring support.
    • Allow a name to be defined as acceptable by a flag in the config, and possibly a global flag for immunity done via cvar.
    • Allow a global rename name as an alternative to kicking or appending something to the name. Then it could be "I tried to use a bad name ;_;" "I tried to use a bad name ;_; (1)" or whatever.
    • Set it up so the 'punishment' style can be changed from the default per-name. Values like "kick", "append", or "rename" are probably good.
    • Allow partials. That way, in combination with the above, a fellow could possibly use it as a better version of the existing Tag-checkers or the like

    I had one or two more but I forget what they are
    Atreus is offline
    Send a message via AIM to Atreus Send a message via MSN to Atreus
    moiph
    Junior Member
    Join Date: Mar 2009
    Location: Seattle, WA
    Old 12-02-2010 , 16:40   Re: [ANY] Name Reservation [v1.0.0]
    Reply With Quote #3

    Updated version!

    Quote:
    Originally Posted by Atreus View Post
    You asked me for feecback, so here it is, in its likely far-too-nitpicky form!
    Any feedback is helpful

    Quote:
    Originally Posted by Atreus View Post
    • Allow a name to be defined as acceptable by a flag in the config, and possibly a global flag for immunity done via cvar.
    Can you clarify this a bit? I'm not sure I understand what you're asking for.
    Quote:
    Originally Posted by Atreus View Post
    • Allow a global rename name as an alternative to kicking or appending something to the name. Then it could be "I tried to use a bad name ;_;" "I tried to use a bad name ;_; (1)" or whatever.
    • Set it up so the 'punishment' style can be changed from the default per-name. Values like "kick", "append", or "rename" are probably good.
    Support for this is now added in 1.1.0

    Quote:
    Originally Posted by Atreus View Post
    • Allow partials. That way, in combination with the above, a fellow could possibly use it as a better version of the existing Tag-checkers or the like
    Good idea. I'll add this one to the future ideas list.
    moiph is offline
    Send a message via AIM to moiph
    HSFighter
    Veteran Member
    Join Date: Aug 2007
    Location: Flensburg - Germany
    Old 12-02-2010 , 17:03   Re: [ANY] Name Reserve [v1.1.0]
    Reply With Quote #4

    I think the the rename function is broken in OB games!
    Or is it possible to rename players again?
    __________________



    Sorry for my very bad english
    Greetings HSFighter
    HSFighter is offline
    Send a message via ICQ to HSFighter
    moiph
    Junior Member
    Join Date: Mar 2009
    Location: Seattle, WA
    Old 12-02-2010 , 17:12   Re: [ANY] Name Reserve [v1.1.0]
    Reply With Quote #5

    I thought it was broken for a long time too but the built in admin function is sm_rename (it used to be sm_name, right?), and it's worked for me (and the methods I use to do rename in this plugin are working as well).
    moiph is offline
    Send a message via AIM to moiph
    criminalist
    Member
    Join Date: Apr 2010
    Old 12-02-2010 , 17:16   Re: [ANY] Name Reserve [v1.1.0]
    Reply With Quote #6

    * criminalist (Guest) изменил имя на criminalist
    What I do not understand? why change the name of * criminalist (Guest) on criminalist?

    PHP Code:
    "Names"
    {
        
    "criminalist"
        
    {
            
    "criminalist"
            
    {
                
    "id" "STEAM_0:1:31952524"
            
    }
        }


    criminalist is offline
    moiph
    Junior Member
    Join Date: Mar 2009
    Location: Seattle, WA
    Old 12-02-2010 , 17:18   Re: [ANY] Name Reserve [v1.1.0]
    Reply With Quote #7

    Try doing this instead:

    PHP Code:
    "Names"
    {
        
    "criminalist"
        
    {
            
    "user1"
            
    {
                
    "id" "STEAM_0:1:31952524"
            
    }
        }


    You may have found a bug where if the player name matches that inner name there's a problem...so try "user1" and see what happens. The "user1" name is arbitrary, but necessary in order to list out any number of potential ids (I think. That's based on my limited knowledge of how KeyValues work here). I'll investigate some more on my side too.
    moiph is offline
    Send a message via AIM to moiph
    criminalist
    Member
    Join Date: Apr 2010
    Old 12-02-2010 , 17:21   Re: [ANY] Name Reserve [v1.1.0]
    Reply With Quote #8

    same = (
    criminalist is offline
    HSFighter
    Veteran Member
    Join Date: Aug 2007
    Location: Flensburg - Germany
    Old 12-02-2010 , 17:26   Re: [ANY] Name Reserve [v1.1.0]
    Reply With Quote #9

    Quote:
    Originally Posted by moiph View Post
    I thought it was broken for a long time too but the built in admin function is sm_rename (it used to be sm_name, right?), and it's worked for me (and the methods I use to do rename in this plugin are working as well).

    Thank's
    __________________



    Sorry for my very bad english
    Greetings HSFighter
    HSFighter is offline
    Send a message via ICQ to HSFighter
    moiph
    Junior Member
    Join Date: Mar 2009
    Location: Seattle, WA
    Old 12-02-2010 , 17:27   Re: [ANY] Name Reserve [v1.1.0]
    Reply With Quote #10

    Quote:
    Originally Posted by criminalist View Post
    same = (
    PM'd criminalist offline to follow up...will report back to the thread when we've figured out what's up

    Edit:
    Updated plugin with a couple log statements, not sure yet why crimanlist is seeing an issue. He's trying the plugin in CS:S, and it seems to be triggering a rename even though he should be authorized to use the name.

    Last edited by moiph; 12-03-2010 at 02:26.
    moiph is offline
    Send a message via AIM to moiph
    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 15:56.


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