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

Community Reserved Slots


Post New Thread Reply   
 
Thread Tools Display Modes
Author
CaffeinePowered
Junior Member
Join Date: Dec 2007
Location: Illinois
Plugin ID:
234
Plugin Version:
1.0.1.0
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Reserved slots of large communities with busy servers
    Old 12-23-2007 , 14:52   Community Reserved Slots
    Reply With Quote #1

    Purpose and Function:

    This plugin is designed for large web communities whose members would like to be able to access their server when it is full without having to ask an admin to kick a random public player.

    The plugin will hold one slot of the server open at all times as a connection slot. Whenever a player joins their SteamID is checked against a cached list of IDs and their are either authenticated or not authenticated.

    When the final player in the server joins, if they are not authenticated, they will be booted. If they are authenticated, the player with the least connection time who is not authenticated will be booted, thus keeping the connection slot open for another community member.


    Installation:

    This plugin requires the file cReservedList.ini be created in the /sourcemod/configs/ folder. SteamIDs are listed one per line, and comment lines may be used to denote corresponding names.


    CVARS:

    This plugin currently modifies no in game cvars, nor does it create any of its own.


    Commands:

    This plugin does not create any additional commands, all work is done passively.


    Version:

    1.0.1.2 - Plugin Now Updates list on Map Changes

    1.0.1.1 - Revised Handling of SteamID Array

    1.0.1.0 - Public Release


    Future Plans:

    • Creation of a Cvar to turn the plugin on and off
    • Ability to update admin list and refresh the cached array without unloading the plugin
    • Ability to use the final connection slot if all players including connecting player are authenticated.
    Known Bugs:
    • Reserve list must end with a newline in order to calculate the number of lines correctly, failure to do so will result in a server crash.
    Special thanks for SMFrog and FlyingMongoose for all the help on this one.
    Attached Files
    File Type: ini cReservedList.ini (30 Bytes, 1685 views)
    File Type: sp Get Plugin or Get Source (CSlots.sp - 2982 views - 9.9 KB)

    Last edited by CaffeinePowered; 12-27-2007 at 21:20. Reason: Update
    CaffeinePowered is offline
    Send a message via AIM to CaffeinePowered
    LocutusH
    Senior Member
    Join Date: Dec 2007
    Location: Hungary
    Old 12-23-2007 , 15:14   Re: Community Reserved Slots
    Reply With Quote #2

    So this does basically the same as hreservedslots plugin, just working from a separate steamid file, and not the built in adminlist?
    LocutusH is offline
    CaffeinePowered
    Junior Member
    Join Date: Dec 2007
    Location: Illinois
    Old 12-23-2007 , 15:22   Re: Community Reserved Slots
    Reply With Quote #3

    No, H-Reserve works like the normal SourceMod Reserve Slots but with more control.

    Those plugins will hold X slots open where X is the number of reserved slots you have. If you have two 'admin' slots, the server could either broadcast that it has 22 instead of 24 slots, or just show 22/24 and kick anyone else who attempts to use those slots.

    This plugin, its like having X being dynamic, if no community members are using the server, the number of public slots available is the size of the server minus one. And any number of community members can use the server up to the size of the server minus one.

    Basically I ran across people complaining to me for the server that I run (www.destructoid.com), that they couldn't get into the server because it was full, so an admin or myself would have to boot someone. At times also we'd accidentally boot someone from the community.

    I tried both SM's built in reserved slots and h-reserved slots, and neither fit the kind of functionality I was looking for.
    CaffeinePowered is offline
    Send a message via AIM to CaffeinePowered
    bl4nk
    SourceMod Developer
    Join Date: Jul 2007
    Old 12-23-2007 , 15:32   Re: Community Reserved Slots
    Reply With Quote #4

    I'm currently using hreserved slots to work just like this plugin works. :-/
    bl4nk is offline
    LocutusH
    Senior Member
    Join Date: Dec 2007
    Location: Hungary
    Old 12-23-2007 , 15:35   Re: Community Reserved Slots
    Reply With Quote #5

    Yes, apparently he doesnt know what hreserveslots does.
    LocutusH is offline
    CaffeinePowered
    Junior Member
    Join Date: Dec 2007
    Location: Illinois
    Old 12-23-2007 , 15:48   Re: Community Reserved Slots
    Reply With Quote #6

    Yea, I tested it on my server, but couldn't get it to do this, I didn't mean to intentionally copy anything. Might be a TF2 thing, since thats the kind of server I'm running this on.

    At least I think mine does this a bit more simply, no cvars to set or anything, just a file to create.
    CaffeinePowered is offline
    Send a message via AIM to CaffeinePowered
    bl4nk
    SourceMod Developer
    Join Date: Jul 2007
    Old 12-23-2007 , 16:09   Re: Community Reserved Slots
    Reply With Quote #7

    I'm running it on three TF2 servers currently. Our servers are 31 players max, with 1 slot always free. If a reserved slot user connects, a person without a reserved slot is kicked based upon either spectator/time connected/high ping (I forget which). If a person without a reserved slot connects, it kicks them and gives them a custom message that I changed the plugin to say.
    bl4nk is offline
    tcviper
    Veteran Member
    Join Date: Oct 2005
    Location: Netherlands
    Old 12-25-2007 , 06:43   Re: Community Reserved Slots
    Reply With Quote #8

    What about redirection included for other players to another server?
    __________________
    tcviper is offline
    Send a message via MSN to tcviper
    ferret
    SourceMod Developer
    Join Date: Dec 2004
    Location: Atlanta, GA
    Old 12-25-2007 , 09:30   Re: Community Reserved Slots
    Reply With Quote #9

    I'm curious why you're measuring the file length. It doesn't appear to have any bearing on the operation of the plugin.

    You seem to want to create the array as big as necessary from the start, which is a neat idea, but I think you waste more time/IO/CPU counting the lines in the file than you save by keeping the array from expanding.

    I'd suggest you do away with that completely and just let the array expand naturally. The overhead will be less than what you're doing now.

    Code:
    LogToGame("Loading All IDs");
     IDList = CreateArray(ByteCountToCells(65));
     new Handle:file_Reservedlist = OpenFile("addons/sourcemod/configs/cReservedList.ini","rt");
     
     decl String:file_steamid[65];
     decl String:file_steamid_trimmed[65];
     new len;
     
     while(!IsEndOfFile(file_Reservedlist))
     {
      //Read the line
      ReadFileLine(file_Reservedlist, file_steamid, sizeof(file_steamid));
      if((file_steamid[0] != '/') && (file_steamid[1] != '/'))
      {
       //Get the line length
       len = strlen(file_steamid);
       //Trim the line
       strcopy(file_steamid_trimmed,(len-1), file_steamid);
       PushArrayString(IDList,file_steamid_trimmed);
     }
     }
     
     //Close the handle
     CloseHandle(file_Reservedlist);
    __________________
    I'm a blast from the past!

    Last edited by ferret; 12-25-2007 at 09:35.
    ferret is offline
    red!
    Senior Member
    Join Date: Sep 2007
    Location: Germany
    Old 12-25-2007 , 17:42   Re: Community Reserved Slots
    Reply With Quote #10

    Quote:
    Originally Posted by CaffeinePowered View Post
    No, H-Reserve works like the normal SourceMod Reserve Slots but with more control.

    Those plugins will hold X slots open where X is the number of reserved slots you have. If you have two 'admin' slots, the server could either broadcast that it has 22 instead of 24 slots, or just show 22/24 and kick anyone else who attempts to use those slots.

    This plugin, its like having X being dynamic, if no community members are using the server, the number of public slots available is the size of the server minus one. And any number of community members can use the server up to the size of the server minus one.
    That's not really correct. The behavior you describe is exactly what H-Reserved provides with 1 reserved slot. This is also the same what the original sourcemod reserved.smx does when using "sm_reserve_type 1". The only difference to the other plugins is the separate admin-file.
    red! 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 17:03.


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