Reserved Slots

Virtual_AddictVirtual_Addict US Join Date: 2014-04-13 Member: 195367Members
Hello,

I'm hosting an NS2 server since a few days now. It looks like its gaining popularity and is often full. I wanted to play on it the other day but couldn't join, despite having a reserved slot for my Steam ID specified. I did click on Attempt Join and got the Server Full message.
I did some research on the subject but most of the discussions I was able to find were quite old and it seems like the feature wasn't fully implemented at that time.
I'm wondering now if that's still the case or if I made a mistake in my config files.

Heres my ServerConfig.json

{
"tags": [ "rookie" ],
"settings": {
"rookie_friendly": true,
"auto_kick_afk_capacity": 0.7,
"end_round_on_team_unbalance": 0,
"voting": {
"votekickplayer": true,
"votechangemap": true,
"voterandomizerr": true,
"voteresetgame": true
},
"auto_team_balance": {
"enabled_after_seconds": 10,
"enabled_on_unbalance_amount": 2
},
"reserved_slots": {
"amount": 4,
"ids": [ 110273543, 50112279, 61576643, 46063571 ]
},
"end_round_on_team_unbalance_check_after_time": 300,
"end_round_on_team_unbalance_after_warning_time": 60,
"auto_kick_afk_time": 240,
"force_even_teams_on_join": true
}


I tried other ways too, like "Steam ID", "Steam ID ",... ect. I suppose it is a formatting error, would be grateful if someone could point it out for me, as I know nothing about JavaScript. :(


I'm also using ShineAdmin, this is the ReservedSlots.json:

{
"Slots": 4,
"TakeSlotInstantly": false
}


The server has a real limit of 20, it displays 16 in the browser which is correct, since 4 slots are reserved. Thus I assume everything is placed correctly.

Comments

  • GhoulofGSG9GhoulofGSG9 Join Date: 2013-03-31 Member: 184566Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Reinforced - Supporter, WC 2013 - Supporter, Pistachionauts
    edited April 2014
    Ok first shine reserved slots and vanilla reserved slots don't have anything to do with each other.

    FYI: Shine overrides the vanilla system, so it doesn't matter who is set as reserved slot in the ServerConfig once you enabled the shine reserved slots plugin !


    I'm not sure how the vanilla system works exactly atm, but the shine one is prettty detailed explained here: https://github.com/Person8880/Shine/wiki/Reserved-Slots

    So to give a player access to a reserved slot you have to give him the right to use "sh_reservedslot" in the UserConfig.json.

    If you need more info about the shine user permissions system read this: https://github.com/Person8880/Shine/wiki/Configuring-Users

    Hope this helps and happy eastern to you ;)

    BTW: your ServerConfig.json has a json syntax error ( missing } at the end ). You can avoid this in the future by checking your config files with http://jsonlint.com/

    PS: Please use the ["code"] ["/code"] ( without the "" ) bb code ( the little C button at the top of the post editor bar ) to mark code correctly :)
  • Virtual_AddictVirtual_Addict US Join Date: 2014-04-13 Member: 195367Members
    edited April 2014
    Thank you for your answer.

    I played with it now and seems like I got it working, at least for me. I did not realize I had to give myself access to sh_reservedslot. I was under the impression that Shine only affects how the slots are handled via TakeSlotInstantly.
    So I added sh_reservedslots to my allowed commands in the UserConfig and it worked.

    Now I have 3 more SteamIDs to add, but I don't want those to be admin. I guess I have to create a new group for them and allow that command only? Problem is, as I mentioned I have no knowledge at all when it comes to Javascript, I don't know how to format that.

    I hate to impose like this but could you do me a quick favor and just write one more user (just make up an imaginary SteamID) to my config file. If I see what you did there I can replicate it and add my own users from here on out.

    {
    "Users": {
    "50112279": {
    "Group": "admin_group"
    }
    },


    I guess right below that I'd start a new line with "SteamID":{.......
    I don't know how to explain it, I just don't know when to use which sign, where to add spaces, when to start a new line and so on. If I could just see you add another user to that list and post it, I will know what to do.

    Here is the entire file:



    {
    "Users": {
    "50112279": {
    "Group": "admin_group"
    }
    },
    "Groups": {
    "admin_group": {
    "Immunity": 100,
    "Commands": ["sh_ban", "sh_reset", "sh_kick", "sh_verify", "sh_reservedslot", "sh_switchteam", "sv_switchteam", "changemap", "sv_changemap", "addbot", "removebot" ],
    "IsBlacklist": false
    },
    "reserved_slots_group": {
    "Immunity": 10,
    "Commands": [ "sh_reservedslot" ],
    "IsBlacklist": false
    }
    }
    }
  • GhoulofGSG9GhoulofGSG9 Join Date: 2013-03-31 Member: 184566Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Reinforced - Supporter, WC 2013 - Supporter, Pistachionauts
    edited April 2014
    Thank you for your answer.

    I played with it now and seems like I got it working, at least for me. I did not realize I had to give myself access to sh_reservedslot. I was under the impression that Shine only affects how the slots are handled via TakeSlotInstantly.
    So I added sh_reservedslots to my allowed commands in the UserConfig and it worked.

    Now I have 3 more SteamIDs to add, but I don't want those to be admin. I guess I have to create a new group for them and allow that command only? Problem is, as I mentioned I have no knowledge at all when it comes to Javascript, I don't know how to format that.

    I hate to impose like this but could you do me a quick favor and just write one more user (just make up an imaginary SteamID) to my config file. If I see what you did there I can replicate it and add my own users from here on out.

    {
    "Users": {
    "50112279": {
    "Group": "admin_group"
    }
    },


    I guess right below that I'd start a new line with "SteamID":{.......
    I don't know how to explain it, I just don't know when to use which sign, where to add spaces, when to start a new line and so on. If I could just see you add another user to that list and post it, I will know what to do.

    Here is the entire file:



    {
    "Users": {
    "50112279": {
    "Group": "admin_group"
    }
    },
    "Groups": {
    "admin_group": {
    "Immunity": 100,
    "Commands": ["sh_ban", "sh_reset", "sh_kick", "sh_verify", "sh_reservedslot", "sh_switchteam", "sv_switchteam", "changemap", "sv_changemap", "addbot", "removebot" ],
    "IsBlacklist": false
    },
    "reserved_slots_group": {
    "Immunity": 10,
    "Commands": [ "sh_reservedslot" ],
    "IsBlacklist": false
    }
    }
    }

    As wished here is a example UserConfig.json
    {
        "Users": {
            "42351847": {
                "Group": "mod_group"
            },
            "106377166": {
                "Group": "mod_group"
            },
            "49750268": {
                "Group": "mod_group"
            },
            "841433": {
                "Group": "mod_group"
            },
            "39045034": {
                "Group": "admin_group"
            },
            "49071975": {
                "Group": "admin_group",
                "Badge": "unicorn"
            }
        },
        "Groups": {
            "mod_group": {
                "Immunity": 10,
                "IsBlacklist": false,
                "Commands": [
                    "sh_reset",
                    "sh_kick",
                    "sh_forcemapvote",
                    "sh_enablerandom",
                    "sh_afk"
                ],
                "Badge": "mod"
            },
            "admin_group": {
                "Immunity": 100,
                "IsBlacklist": true,
                "Commands": [],
                "Badges": [
                    "star",
                    "crown"
                ]
            }
        }
    }
    
    ( Don't be confused by the "Badge" entry in each Group thats part of the badge plugin /Badges+ Mod ;) )

    Again i would suggest you to validate your json yourself always with http://jsonlint.com/

    It's quiet easy to use and you don't need much knowlegde about json syntax to use it.
    So you could learn the json syntax with it via trial and error.

    BTW: A true admin group (access to all commands) is this:
    "Admin": {
            "IsBlacklist": true,
            "Immunity": 100,
            "Commands": [  ]
          }
    

    If you want to add more users just add a field like this to the "Users" field:
    "userid1": {
            "Group": "group1"
          },
    "userid2": {
            "Group": "group2"
          },
    

    The json sytax just requires a "," to part different entries of a list. But if you feel unsafe with json jsonlint should help you alot. Just try to understand the jsonlint errors ;)

    Here is the basic json syntax:
    { } : ( = a list which can contain entries )
    "index": {} ( = new entry with the index "index" in list which is also a list (sublist), in other languages it would be index = {} )
    [] ( = enum, this means each entry gets its position as index )
    , ( = end of entry used to part entries in a list or enum )
    "2" = "value" ( = a simple "value" which would be safed in entry with index "2")
  • Virtual_AddictVirtual_Addict US Join Date: 2014-04-13 Member: 195367Members
    Thanks a lot, I will work on my Java for sure. Its all working now, couldn't be happier.

    Also I did have my admin commands blank as you suggested, for obvious reasons. It was in fact the only thing I changed after reading your first post and that made the reserved slots work for myself.

    Another thing that has me scratching my head is "IfBlackList true". Wouldn't that suggest that the commands specified are NOT allowed? So if you leave the list blank and BlackList on true, it would basically mean no commands are allowed? I had this issue when I first set my admin account up. I had it blank and Blacklist on true, nothing worked, so I changed it to false and everything worked. (except for the reserved slots)

    Ah anyway, I appreciate your support a lot and my server is finally up and running the way I want it to. Thank you!
  • GhoulofGSG9GhoulofGSG9 Join Date: 2013-03-31 Member: 184566Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Reinforced - Supporter, WC 2013 - Supporter, Pistachionauts
    edited April 2014
    Thanks a lot, I will work on my Java for sure. Its all working now, couldn't be happier.

    Also I did have my admin commands blank as you suggested, for obvious reasons. It was in fact the only thing I changed after reading your first post and that made the reserved slots work for myself.

    Another thing that has me scratching my head is "IfBlackList true". Wouldn't that suggest that the commands specified are NOT allowed? So if you leave the list blank and BlackList on true, it would basically mean no commands are allowed? I had this issue when I first set my admin account up. I had it blank and Blacklist on true, nothing worked, so I changed it to false and everything worked. (except for the reserved slots)

    Ah anyway, I appreciate your support a lot and my server is finally up and running the way I want it to. Thank you!

    From the shine wiki:
    IsBlacklist: If it is a blacklist, then it is a list of commands the group cannot run. Otherwise it is a list of commands they can run.

    So users of a blacklist group have all rights of shine except the in their group listed ones

    I would say at the moment it was not working you had a json issue in your userconfig.
  • jason8jason8 Join Date: 2017-09-07 Member: 232838Members
    Check your cofig files using json formatter
  • KeatsKeats United States Join Date: 2014-11-04 Member: 199413Members, NS2 Playtester, Reinforced - Shadow
    edited September 2017
    Check the date of posts using reading
Sign In or Register to comment.