DAK Server Admin Mod

1356727

Comments

  • LofungLofung Join Date: 2004-08-21 Member: 30757Members
    hey guys. i am a new server host and i had just installed DAK mod yesterday thanks to the guide of dodging steam workshop. i didnt have much experience on sever hosting or C++ or lua so i need some help. i manage to boot up the mod from Script.Load("lua/DAKLoader.lua") from server.lua and change the MOTD but some functions are just not working well.

    the following functions:

    Server Admin commands added:
    sv_rcon - allows an admin to execute a command on the servers console.
    sv_reloadconfig - reloads the DAKConfig.json file.
    sv_plugins - displays all loaded plugins, their revisions and if they are enabled/disabled.
    sv_maps - lists all maps currently available on the server
    sv_randomon - will turn on random teams
    sv_randomoff - will turn off random teams
    sv_tournamentmode - will enable/disable tournamentmode - The current state of the tournamentmode is saved in the DAKSettings.json file, so this will
    persist between map changes.
    sv_forceroundstart - Used in tournamentmode to force the round start as an Admin.
    sv_cancelroundstart - Used in tournamentmode to cancel the round start as an Admin.
    sv_friendlyfire - will enable/disable friendlyfire
    sv_votemap - starts a mapvote at anytime
    sv_cancelmapvote - cancels any in progress map votes.
    sv_listadmins - will list all groups and admins configured in the DAKServerAdmin.json file
    sv_killserver - Does exactly what it says - This is not a clean closing of the server, it uses a bug which causes a crash.
    sv_hasreserve - Will grant this admin a reserve slot that does not expire.

    are basically not working. did I miss somthing i should have done?

    also i wanted to turn off rtv and map voting system at the end of the round as there are only 6 maps and one cycle is just 2 1/2 hours, most think that it is a waste of time to take 1/2 minute to vote for a map (and then got tired and go over again). how can i turn it off and let the stock map cycle system work? i saw that there is a mod called kDAKOverrideMapChange but i cant locate it nor i know how to disable it..

    is there a way to twist the afk kick module such that it starts working only when the server reaches a particular number of players like 16/18? i personally think that there is just no point to kick afk when the server is pretty empty. i often call friends (~2,3) just to afk in my server in order to make it look popular and lure people in. the warm up phase could take up to as long as one hour to get the server full.

    thank you for helping this noob :)
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    To disable the mapvote plugin, you can just remove it from the plugin list.
    "DAKLoader": {
    "kPluginsList" [ "x", "y", "z" ] - Just remove "mapvote" from this list.

    For the AFK kick,
    "AFKKicker": {
    "kAFKKickMinimumPlayers": Amount of players required before people will be kicked for being AFK. - You can adjust this value to adjust the minimum number of players needed before the AFK kick will 'kick' (lol) in and start kicking people.

    If those commands are not working, you will want to check to make sure you set "LoadFromServerLUA" under DAKLoader to true.

    All these options are in the DAKConfig.json file.
  • itspreachitspreach Join Date: 2012-10-30 Member: 164638Members
    Hi dragon..sorry to bother you again. I really like the mod and I'm slowly getting it configured just right for my servers needs.

    Can you tell me what I need to do in the event that at the end of the map, and a map vote does not pass (due to not enough votes or no votes) that the next map in mapcycle is loaded instead of continuing to stay on existing map?
  • TechnIckSTechnIckS Join Date: 2007-01-14 Member: 59616Members
    edited November 2012
    Hello Dragon,

    Can you give us a little more detail on how the reserved slots work?
    Specifically on this:
    "kReservedSlots": 2,
    "kMaximumSlots": 22,

    I noticed that if i set reserved slots to 2 and maximum slots is 22, it keeps two fake players in the RR.
    Does this mean that 2 reserved players can join at this time, and the fake players get kicked?

    I basically want to make it so when the server has 20 people and 2 reserved players join, we have a full 11 on 11 game. Then, if a non-reserved player leaves, a fake player gets added, so more reserved players can join. (Or, when server gets full, auto-kick 1 random player so reserved players can always join).

    Edit: If the above is true, then i can change reserved slots to 1.

    Thanks in advance!
  • itspreachitspreach Join Date: 2012-10-30 Member: 164638Members
    wire - basically (in its current form) it works like you said in a sense. if there are 20 people in with 2 reserved slots, there will be 2 fake clients connected. If a player joins that is NOT on the reserved list, he will get a message that he is being kicked because he is not in the reserved list.

    I have actually disabled this plugin because of how inconvenient it is, which is also dragons suggestion. If you read a page back or so, fake clients shouldn't even be being used and dragon suggests not using this plugin.
  • TechnIckSTechnIckS Join Date: 2007-01-14 Member: 59616Members
    itspreach, i do have 3 servers that are full almost all the time. Without these inconvenient slots, no admin would be able to join the servers. As inconvenient as it is, we do have to have it, at least until a better option arises.

    What i don't get is this:
    Why would you ever have more than 1 reserved slot? Right now, this is what is hapening:

    22 players, 2 reserved. 19 players can join max. Once player nr 20 joins, if not reserved, it gets kicked. If a reserved player joins, then there are 20 players total. Until then, it's always 19.

    I have 3 players with reserved slots at once on server, the 2 bots still remain in RR, they don't get kicked.
    I'm really confused on how it does it....

    Dragon, can we please get your input on this?
  • itspreachitspreach Join Date: 2012-10-30 Member: 164638Members
    what are your values for these variables:

    "kReservedSlots"
    "kMaximumSlots"
    "kMinimumSlots"
  • TechnIckSTechnIckS Join Date: 2007-01-14 Member: 59616Members
    reserved: 2
    maximum: 22 (same as server max)
    minimum: 1

    As long as i don't know what these values really do, it's all guesswork. It's not documented anywhere.
  • TechnIckSTechnIckS Join Date: 2007-01-14 Member: 59616Members
    edited November 2012
    oops double post, ignore this one :P
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    My input - reserve slots are pretty broken tbh, there is still not a great way of doing them besides a client/server side mod atm, unless there is some hidden functionality I have yet to uncover.

    Current mod will/does work like this.

    kMaximumSlots - 19 - needs to match your current maximum players on the server, basically the -limit.
    kMinimumSlots - 1 - is the amount of slots that are always left open, should usually be left at 1 (0 would make it so no one could join once your reserve slots are full, any higher is kinda wasteful).
    kReservedSlots - 3 - is the number of actual reserve slots plus kMinimumSlots (2 + 1).

    Currently the plugin will let the server fill up to kMaximumSlots - kReservedSlots, default being 16 players. Once that number is reached, any new player that joins that doesnt have a reserve slot will be kicked after they fully join (this is the part that sucks). kReservedSlots - kMinimumSlots more players would be able to join that do have reserve slots, leaving kMinimumSlots always available. If another person with a reserve slot joined after those slots were full (18/19 in the default example), then it would start kicking players without a reserve slot (automatically determined based on score excluding commanders).

    Let me know if you have any other questions about it. I dont suggest using it atm mainly because of how it has to kick people (they fully join first :/)
  • CamronCamron Join Date: 2011-01-06 Member: 76356Members
    <!--quoteo(post=2019447:date=Nov 11 2012, 06:19 AM:name=xDragon)--><div class='quotetop'>QUOTE (xDragon @ Nov 11 2012, 06:19 AM) <a href="index.php?act=findpost&pid=2019447"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->My input - reserve slots are pretty broken tbh, there is still not a great way of doing them besides a client/server side mod atm, unless there is some hidden functionality I have yet to uncover.

    Current mod will/does work like this.

    kMaximumSlots - 19 - needs to match your current maximum players on the server, basically the -limit.
    kMinimumSlots - 1 - is the amount of slots that are always left open, should usually be left at 1 (0 would make it so no one could join once your reserve slots are full, any higher is kinda wasteful).
    kReservedSlots - 3 - is the number of actual reserve slots plus kMinimumSlots (2 + 1).

    Currently the plugin will let the server fill up to kMaximumSlots - kReservedSlots, default being 16 players. Once that number is reached, any new player that joins that doesnt have a reserve slot will be kicked after they fully join (this is the part that sucks). kReservedSlots - kMinimumSlots more players would be able to join that do have reserve slots, leaving kMinimumSlots always available. If another person with a reserve slot joined after those slots were full (18/19 in the default example), then it would start kicking players without a reserve slot (automatically determined based on score excluding commanders).

    Let me know if you have any other questions about it. I dont suggest using it atm mainly because of how it has to kick people (they fully join first :/)<!--QuoteEnd--></div><!--QuoteEEnd-->
    I'm kinda working on a server side dll plugin that might work for reserved slots. One feature would let you mess with the server info. This could let you change the max/current players on the fly. You could also change if the server has a pw or not. Maybe you could make the server set a pw when the server reaches it's desired maxplayers, while the real maxplayer count holds slots for reserved players who know the password. The password is removed on the fly when the playercount drops below the threshold. I think you would also be able to do reserve checking before the map the load.

    I would only be interested in making a dll mod like metamod/sourceOP that exposes engine functions to LUA. People could then use it for their own server mods/plugins (DAK/ns2stats).
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    You can actually set the password in LUA now, and that gives me an idea for making the reserve slots work better.
  • TechnIckSTechnIckS Join Date: 2007-01-14 Member: 59616Members
    Thanks Dragon, much appreciated.

    Ok so here's my input. The 2 reserved slots do NOT show in the server list as players. The server always shows 19 (or 20) / 22.
    I just made a local server with 2 slots, and 2 reserved, and minimum at 0.
    In server list, even though 2 bots are there, it shows 0/2. It did let me connect right away. Once i joined, one bot got kicked since my reserved slot was valid.

    So for a second, there were 3 players on, 2 bots and myself, and server limit is 2. This is good. Off course, once another player joins, if not reserved, it will not let him on, leaving the server with 1 player and 1 bot just as it was.

    Now, from reading your code, i understand that it does kick a player if server is "ReallyFull" - from function OnReserveSlotClientConnected(client).

    So if i understand this right, if setting the minslots to 0, and there are at least 1 bot (reservedslots = 1), and a reserved player joins, the bot technically should get kicked, however, since the "serverReallyFull and reserved" condition is true, it should kick a player instead. (I think, I haven't looked more to see if it kicks a bot then kicks a player and re-inserts a bot, but either way, the end result is the same).

    I'll try this now and see how it does one one of my 22 mans, and i'll get back to you.
  • TechnIckSTechnIckS Join Date: 2007-01-14 Member: 59616Members
    And about password, it would be good to add the functionality of adding a password that can be shared between all admins/reserved players, but it should still check if a reserve slot exists once player connects (in case someone knows passsword that had a reserved slot in the past). The password should add just a connection prevention layer so people don't have to load the map just to get kicked in the end if they dont have a reserved slot.
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    That is the idea for the password part.. Regarding the fake clients, the rest of the code that made them take up a slot isnt there because I didnt actually intend to publish that version of it (mainly because of the cpu overhead). So ATM they do not do anything.
  • TechnIckSTechnIckS Join Date: 2007-01-14 Member: 59616Members
    Not like we want the bots to do anything, that's a good thing!

    Ok so with max at 22, 1 reserved and 0 minimum, we get a 10 on 10 going, with 1 empty spot and one nsplayer fake. I was expecting it to do 11 on 10 with 1 nsplayer. But it still shows in server list 20/22 (i thought slot nr 21 would be taken, but i was wrong - it still leaves 1 slot open on top of the nsplayer where new players can join - it doesn't make it 21 with 1 bot - 22 total - and allow #23 to connect). Technically it should have kicked the last NSPlayer when i joined.
  • TechnIckSTechnIckS Join Date: 2007-01-14 Member: 59616Members
    I also recommend for the map voting mod to add the following as accepted versions of voting: vote 1, vote1, 1, vote #1, vote#1.
    I'm amazed how many people type it this way lol
  • LofungLofung Join Date: 2004-08-21 Member: 30757Members
    actually can u do the vote in the old way? i.e. you just have to press 1/2/3/4/5/ to vote...
  • StukaJU87cStukaJU87c Join Date: 2012-11-04 Member: 166988Members
    Ok, I got DAK up and running with the lua method but the server is showing as modded.

    I wanted to check, is mod id supposed to be in the mapcycle folder using this method? If so, what else could be causing it to flag my server?
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    edited November 2012
    I just updated this on Workshop, which should improve the reserveslots (adds password/removes fake clients), adds extend mapvote and automatic mapcycle if no vote passes, an autoconcede plugin which works like NS1 (can adjust players and not %). Also I corrected the inaccuracy in the logging times and added an option to set your timezone. There are other changes that ive forgotten about also.

    regarding the mapcycle, you would not want the modID in there if loading from server.lua
    If your still getting flagged as modded i would check to make sure you dont pass anything for -mods on the command line.
  • TechnIckSTechnIckS Join Date: 2007-01-14 Member: 59616Members
    You are the man! Ill try it as soon as I get home.
    Still works loaded from server.lua, right?
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    Yep it should, it did in my testing and I didnt make to many changes to the core loader.
  • StukaJU87cStukaJU87c Join Date: 2012-11-04 Member: 166988Members
    Ok...there is no mod line in the command line, and I removed the ModID from mapcycle, and now the mod does not work. What am I doing wrong?
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    So you have the line in Server.lua between line 13 and 24 to load DAKloader.lua?

    And you have the variable set to true to load from Server.lua in DAKConfig.json?
  • StukaJU87cStukaJU87c Join Date: 2012-11-04 Member: 166988Members
    edited November 2012
    <a href="http://imageshack.us/photo/my-images/266/loadfromlua.png/" target="_blank"><img src="http://img266.imageshack.us/img266/7429/loadfromlua.png" border="0" class="linked-image" /></a>

    -


    <a href="http://imageshack.us/photo/my-images/28/serverlua.png/" target="_blank"><img src="http://img28.imageshack.us/img28/7591/serverlua.png" border="0" class="linked-image" /></a>

    Edit:


    sv_listplugins shows DAKLoader is running...but no commands work, nor are they listed in under sv_help
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    edited November 2012
    Well you only need to load DAKLoader once, so you can get rid of the second Script.Load statement for DAKLoader in Server.lua.

    Beyond that, how are you testing that the mod is loaded? And are you able to see the server console/any errors?
  • StukaJU87cStukaJU87c Join Date: 2012-11-04 Member: 166988Members
    edited November 2012
    Last night (with ModID in mapcycle) I knew it was loaded due to the MOTD..today I've been looking for that, and trying commands such as sv_votemap or rtv, and looking in sv_help for the DAK admin commands. (Last night all commands seemed to work except surrender vote)

    sv_listplugins shows DAKLoader is loaded...but nothing works

    No errors related to DAK...just some shaders/animation errors which I get even on vanilla ns2
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    Hmm, how are you placing the files in the ns2 lua folder, and what version of the files do you have?

    Also have you tried starting with a new DAKConfig?
  • StukaJU87cStukaJU87c Join Date: 2012-11-04 Member: 166988Members
    edited November 2012
    All DAK files are copied into /lua...plugins in /lua/plugins and theres also /lua/gui.

    also the "git" files are in /ns2 as well as the publish folder.

    It's v2.1, and I've only tried using copies of the original. Ill try using a new config post back.

    I wanted to confirm with you, does anything need to be done withe gamesetup.xml file? Originally placing this gave me a client/server differ error
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    You would not want to change the game_setup.xml file.
Sign In or Register to comment.