DAK Server Admin Mod

xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
edited November 2012 in Modding
Figure ill post this here finally, as quite a few people are using it and there is somewhat of a need to update the plugins now, plus it has somewhat reached a state where id like to start taking feedback/requests.

The reason for this update is to hopefully resolve an issue with the NS2Stats system, where the round is possibly restarting to quickly..

The files can be found on the duplex link below, ask any questions you may have and ill try my best to answer. Some options have changed, i would look over the readme file and the config files to verify your stuff is still valid.

Editing this to avoid any confusion, link in next post is more valid than what was here.

Also mod is now on steam workshop, and can be checked out here - <a href="http://steamcommunity.com/sharedfiles/filedetails/?id=99938680" target="_blank">http://steamcommunity.com/sharedfiles/file...ls/?id=99938680</a>
«13456727

Comments

  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    Updated this for B220, not sure how many servers are still running it but i believe it to be a decent number, readme has been expanded upon to include a better explanation on the mod and the 'plugins'

    Also added is a surrender vote plugin for both teams.

    <a href="https://github.com/xToken/DAK" target="_blank">https://github.com/xToken/DAK</a>
  • WalsaWalsa Join Date: 2011-06-28 Member: 106813Members, Reinforced - Shadow
    I have updated to the latest release in <a href="https://github.com/xToken/DAK" target="_blank">https://github.com/xToken/DAK</a>, but for some reason, the plugin stopped working since B220. When entering my server, I have no motd, rtv doesnt work, and all the command issued in the console (client side) return " not having access to that command" in the server. It was working in B219.
    I can issue the command in the server console with success (like sv:changemap).
    DAK doesn't create new logs either.
    The console output seems normal.

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->C:\ns2server>Server.exe -file "c:\ns2server\server.xml"
    Changing settings file to: c:\ns2server\server.xml
    Press Tab to open the console window
    Press Ctrl-C to exit
    --------------------------------------------------------------------------------

    Build 220
    Starting Natural Selection 2
    Failed to load Steam Service
    ServiceStart: failed to start
    ServiceStart: failed to start
    Setting breakpad minidump AppID = 4920
    Connected to Steam servers
    Loading config://ServerConfig.json
    Loading config://ServerAdmin.json
    Loading config://BannedPlayers.json
    Loading config://MapCycle.json
    Loading config://DAKServerAdmin.json
    Loading config://BannedPlayers.json
    Loading 'maps/ns2_tram.level'
    Error: Couldn't open file 'models/props/refinery/refinery_fan128_blades.animatio
    n_graph'
    Error: Couldn't open file 'models/effects/halo_blue.model'
    Error: Couldn't open file 'models/effects/halo_rounded_blue.model'
    Error: Couldn't open file 'models/props/refinery/refinery_shipping_hologram_anim
    ated.animation_graph'
    Error: Couldn't open file ''
    Finished loading 'maps/ns2_tram.level'
    Disconnected from Steam servers
    Connected to Steam servers
    Disconnected from Steam servers
    Connected to Steam servers<!--c2--></div><!--ec2-->
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    Looks like the mod is loading fine, but not loading the config file.

    It should echo back Loading DAK settings if it loads the config file correctly, can you check that the DAKConfig.json file is in the correct place and is valid?
  • WalsaWalsa Join Date: 2011-06-28 Member: 106813Members, Reinforced - Shadow
    Here is the file <a href="https://dl.dropbox.com/u/2214790/DAKconfig.json" target="_blank">https://dl.dropbox.com/u/2214790/DAKconfig.json</a>
  • DghelneshiDghelneshi Aims to surpass Fana in post edits. Join Date: 2011-11-01 Member: 130634Members, Squad Five Blue, Reinforced - Shadow
    Walsa:
    Afaik, UWE changed the config path from %APPDATA%\Natural Selection 2\config to just %APPDATA%\Natural Selection 2\
    Maybe that is the issue?
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    Yep also check the configuration path, or use the -config_path server command line to change that directory.
  • WalsaWalsa Join Date: 2011-06-28 Member: 106813Members, Reinforced - Shadow
    <!--quoteo(post=1980729:date=Sep 20 2012, 10:02 AM:name=Dghelneshi)--><div class='quotetop'>QUOTE (Dghelneshi @ Sep 20 2012, 10:02 AM) <a href="index.php?act=findpost&pid=1980729"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Walsa:
    Afaik, UWE changed the config path from %APPDATA%\Natural Selection 2\config to just %APPDATA%\Natural Selection 2\
    Maybe that is the issue?<!--QuoteEnd--></div><!--QuoteEEnd-->

    That did it, thanks
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    edited September 2012
    B221 changed alot with this, I have put together a version that works leaving almost everything intact. I have detailed the installation steps below as it does now require editing lua files on the server.

    With 221, this has changed somewhat. The best way IMO to load this if you wish to use Consistency Checks is to add the following line to ConsistencyConfig.json
    "ignore": [ "lua/Server.lua" ]
    This will have Server.lua not checked (which shouldnt matter IMO as clients shouldnt load that anyways regardless even when trying to exploit the game). This allows DAK to be loaded there.
    You will want to replace line 26 in Server.lua, Script.Load("lua/ServerAdminCommands.lua"), with Script.Load("lua/DAKLoader.lua")
    If you wish to enable chat logging/processing for commands, you will want to edit line 71 in Server.lua, adding in
    DAKChatLogging(message, playerName, steamId, teamNumber, teamOnly)

    Also updated a few other plugins to resolve issues with commands changed in B221.

    Link remains the same at <a href="https://github.com/xToken/DAK" target="_blank">https://github.com/xToken/DAK</a>
  • WalsaWalsa Join Date: 2011-06-28 Member: 106813Members, Reinforced - Shadow
    After Installing the new Dak mod I i got several errors:

    First, without any changes in default installation I got this error message in console, and I cant connect to the server:

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->Date: 09/29/12
    Time: 17:21:15
    --------------------------------------------------------------
    Steam initialized
    Build 221
    Connected to Steam servers
    Loading config://DAKServerAdmin.json
    Loading DAK configuration.
    Loading DAK settings.
    Loading config://BannedPlayers.json
    Script Error #1: lua/DAKLoader.lua:377: Base class undefined
        Call stack:
        #1: [C]:-1
        #2: lua/DAKLoader.lua:377
            settings =  {groups= {admin_group= {commands= { }, type="disallowed" }, clan_group= {commands= {1="sv_kick", 2="sv_say" }, type="allowed" }, mod_group= {commands= {1="sv_ban", 2="sv_reset" }, type="disallowed" } }, users= {Gody= {groups= {1="admin_group" }, id=34583831 }, Onty= {groups= {1="admin_group" }, id=24990216 }, Walsa= {groups= {1="admin_group" }, id=28152187 }, mickie= {groups= {1="admin_group" }, id=40788109 }, sven= {groups= {1="admin_group" }, id=45462551 } } }
            DAKConfigFileName = "config://DAKConfig.json"
            DAKSettingsFileName = "config://DAKSettings.json"
            DAKServerAdminFileName = "config://DAKServerAdmin.json"
            DelayedClientConnect =  { }
            lastserverupdate = 0
            DAKRevision = 1.6
            LoadServerAdminSettings = function
            DisableAllPlugins = function
            LoadDAKConfig = function
            LoadDAKSettings = function
            DAKOnClientConnected = function
            DAKOnClientDisconnected = function
            DAKUpdateServer = function
    Loading 'maps/ns2_tram.level'
    Finished loading 'maps/ns2_tram.level'<!--c2--></div><!--ec2-->

    Changing "_GamerulesExtensions": false to true in DAKconfig.json got me this:


    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->Date: 09/29/12
    Time: 17:21:47
    --------------------------------------------------------------
    Steam initialized
    Build 221
    Connected to Steam servers
    Loading config://DAKServerAdmin.json
    Loading DAK configuration.
    Loading DAK settings.
    Loading config://BannedPlayers.json
    EnhancedLogging Loading Complete
    Loading Reserve slot players.
    ReserveSlot Loading Complete
    VoteRandom Loading Complete
    AFKKicker Loading Complete
    Loading config://MapCycle.json
    MapVote Loading Complete
    VoteSurrender Loading Complete
    ServerMOTD Loading Complete
    Loading 'maps/ns2_tram.level'
    Finished loading 'maps/ns2_tram.level'
    Script Error #1: lua/VoteSurrender.lua:43: attempt to call global 'GetGamerules' (a nil value)
        Call stack:
        #1: lua/VoteSurrender.lua:43
        #2:  (tail call):-1
        #3: lua/DAKLoader.lua:342
            deltaTime = 0.033999871462584
            (for index) = 5
            (for limit) = 6
            (for step) = 1
            i = 5
    Script Error #2: lua/VoteSurrender.lua:43: attempt to call global 'GetGamerules' (a nil value)
        Call stack:
        #1: lua/VoteSurrender.lua:43
        #2:  (tail call):-1
        #3: lua/DAKLoader.lua:342
            deltaTime = 0.032997664064169
            (for index) = 5
            (for limit) = 6
            (for step) = 1
            i = 5
    Script Error #3: lua/VoteSurrender.lua:43: attempt to call global 'GetGamerules' (a nil value)
        Call stack:
        #1: lua/VoteSurrender.lua:43
        #2:  (tail call):-1
        #3: lua/DAKLoader.lua:342
            deltaTime = 0.032999008893967
            (for index) = 5
            (for limit) = 6
            (for step) = 1
            i = 5<!--c2--></div><!--ec2-->

    setting "_VoteSurrender" to false, got the server up an running but when trying to connect I get "Invalid Data" in the client and in the server log.

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->Date: 09/29/12
    Time: 17:22:09
    --------------------------------------------------------------
    Steam initialized
    Build 221
    Connected to Steam servers
    Loading config://DAKServerAdmin.json
    Loading DAK configuration.
    Loading DAK settings.
    Loading config://BannedPlayers.json
    EnhancedLogging Loading Complete
    Loading Reserve slot players.
    ReserveSlot Loading Complete
    VoteRandom Loading Complete
    AFKKicker Loading Complete
    Loading config://MapCycle.json
    MapVote Loading Complete
    ServerMOTD Loading Complete
    Loading 'maps/ns2_tram.level'
    Finished loading 'maps/ns2_tram.level'
    Client connecting (168.226.144.65)
    Client disconnected (168.226.144.65) Invalid data<!--c2--></div><!--ec2-->

    The server works fine vanilla.
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    edited September 2012
    Are you still loading it the old way (via game_setup.xml)? For better compatibility with 221 i had changed how it expects to load, if you still want to load it from game_setup.xml with consistency checks disabled then just add Script.Load("lua/Server.lua") to line 4 in DAKLoader.lua
  • WalsaWalsa Join Date: 2011-06-28 Member: 106813Members, Reinforced - Shadow
    Yes, I was using the game_setup.xml. Now that I am using the other way, it seem to be loading but when trying to connect I get client and server differ.

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->C:\ns2server>Server.exe -file "c:\ns2server\server.xml"
    Changing settings file to: c:\ns2server\server.xml
    Press Tab to open the console window
    Press Ctrl-C to exit
    Setting breakpad minidump AppID = 4920
    Steam_SetMinidumpSteamID:  Caching Steam ID:  76561197960265728 [API loaded no]
    Steam initialized
    Build 221
    Connected to Steam servers
    Loading config://ServerConfig.json
    Loading config://ServerAdmin.json
    Loading config://DAKServerAdmin.json
    Loading DAK configuration.
    Loading DAK settings.
    Loading config://BannedPlayers.json
    EnhancedLogging Loading Complete
    Loading Reserve slot players.
    ReserveSlot Loading Complete
    VoteRandom Loading Complete
    AFKKicker Loading Complete
    Loading config://MapCycle.json
    MapVote Loading Complete
    VoteSurrender Loading Complete
    ServerMOTD Loading Complete
    Loading config://MapCycle.json
    Loading config://ConsistencyConfig.json
    Hashed 1 game_setup.xml files for consistency
    Hashed 648 *.lua files for consistency
    Hashed 31 *.fx files for consistency
    Hashed 13 *.screenfx files for consistency
    Hashed 58 *.surface_shader files for consistency
    Hashed 3 *.fxh files for consistency
    Hashed 2 *.render_setup files for consistency
    Hashed 2 *.shader_template files for consistency
    Skipped 1 lua/Server.lua files for consistency
    Loading 'maps/ns2_tram.level'
    Error: Couldn't open file 'models/props/refinery/refinery_fan128_blades.animatio
    n_graph'
    Error: Couldn't open file 'models/effects/halo_blue.model'
    Error: Couldn't open file 'models/effects/halo_rounded_blue.model'
    Error: Couldn't open file 'models/props/refinery/refinery_shipping_hologram_anim
    ated.animation_graph'
    Error: Couldn't open file ''
    Finished loading 'maps/ns2_tram.level'
    Client connecting (168.226.144.65)
    Client disconnected (168.226.144.65) Client and server differ<!--c2--></div><!--ec2-->
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    Does it happen to tell you client side what file(s) differ?
  • WalsaWalsa Join Date: 2011-06-28 Member: 106813Members, Reinforced - Shadow
    It was game_setup.xml, but it seems to be allright, here is the content:

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><game>
        <name>ns2</name>
        <description>Natural Selection 2</description>
        <client>lua/Client.lua</client>
        <server>lua/Server.lua</server>
        <soundinfo>sound/NS2.soundinfo</soundinfo>
    </game><!--c2--></div><!--ec2-->

    I had changed the ignore line to look like this
    "ignore": ["game_setup.xml", "lua/Server.lua" ]
    in ConsistencyConfig.json, and I can connect to the server and issue dak commands.
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    Maybe try defaulting the server one incase you edited it twice, might have a space or something
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    Tested and uploaded the DAK on steam workshop, it also includes a method to set mods that will persist on map change.
  • WhosatWhosat Singapore Join Date: 2006-11-03 Member: 58301Members, Reinforced - Shadow
    Odd, seems like adding <mods>5f4f178</mods> to server.xml does not load the mod, whereas adding -mods "5f4f178" to the command line does.

    Any clues?
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    Seems like they have removed the mods tag in the server.xml, with it only being set on the command line now. Would like to see an option in the ServerConfig.json eventually, but I suggest just sticking to the cmd line arg for now.
  • WhosatWhosat Singapore Join Date: 2006-11-03 Member: 58301Members, Reinforced - Shadow
    Ah I see! Must be UWE's move towards ServerConfig.json.
    I've updated the wiki to reflect this. Thanks!
  • eLboteLbot Join Date: 2012-09-13 Member: 159229Members
    <!--quoteo(post=1985619:date=Oct 1 2012, 07:19 AM:name=Whosat)--><div class='quotetop'>QUOTE (Whosat @ Oct 1 2012, 07:19 AM) <a href="index.php?act=findpost&pid=1985619"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Ah I see! Must be UWE's move towards ServerConfig.json.
    I've updated the wiki to reflect this. Thanks!<!--QuoteEnd--></div><!--QuoteEEnd-->

    Can I just say, that i've seen you make many posts about changing the wiki and I really appreciate the time you take to keep it updated. Thank you :)
  • WhosatWhosat Singapore Join Date: 2006-11-03 Member: 58301Members, Reinforced - Shadow
    Ah thank you (: it's more of just really making the information available to everyone, seeing as how the wiki is now THE place to go to get information on setting up servers. Helps to reduce the number of repetitive questions on the forums too (:
  • SkieSkie Skulk Progenitor Join Date: 2003-10-18 Member: 21766Members, NS2 Playtester, Reinforced - Shadow
    edited October 2012
    There's a bug with this mod that it doesn't clear players' Pres amounts when the round ends. So if you join the next round from RR after the round has already started, you preserve your res from last round. I've confimed that this doesn't happen without this mod (vanilla).

    Or alternatively disconnect from the server after round end and join back in when a new one has started. You preserve your pres.
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    That bug is in vanilla AFAIK......
  • SkieSkie Skulk Progenitor Join Date: 2003-10-18 Member: 21766Members, NS2 Playtester, Reinforced - Shadow
    <!--quoteo(post=1988836:date=Oct 9 2012, 07:49 PM:name=xDragon)--><div class='quotetop'>QUOTE (xDragon @ Oct 9 2012, 07:49 PM) <a href="index.php?act=findpost&pid=1988836"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->That bug is in vanilla AFAIK......<!--QuoteEnd--></div><!--QuoteEEnd-->
    All right, I'll try to look into it again. Just never seen it happen in vanilla and the devs outright rejected the bug report about it earlier.
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    Without trying to give exact steps, ill say that the reset of previous players resources doesnt happen until the game actually "starts".
  • eLboteLbot Join Date: 2012-09-13 Member: 159229Members
    edited October 2012
    Sure Dragon, but I've seen this bug myself too - only on DAK servers; the players res will persist into the next round start and beyond even the reset into the next live game!
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    Considering DAK doesnt modify the event where the players resources are set - RoundReset, I find it hard to believe this is caused by it.

    Basically if you want to repro this join a game and build up your pres, and wait for the round to end and everyone to return to the readyroom. Then wait for the game to reset in the readyroom, and join your team during the countdown period.
  • SkieSkie Skulk Progenitor Join Date: 2003-10-18 Member: 21766Members, NS2 Playtester, Reinforced - Shadow
    Yeah, it's not DAK. Sorry for the trouble.
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    No worries...

    I have also updated this to support 222 on workshop, which should also fix voterandom incorrectly warning people and surrender being broke (for real i hope this time).
  • eLboteLbot Join Date: 2012-09-13 Member: 159229Members
    <!--quoteo(post=1990011:date=Oct 11 2012, 07:11 PM:name=Skie)--><div class='quotetop'>QUOTE (Skie @ Oct 11 2012, 07:11 PM) <a href="index.php?act=findpost&pid=1990011"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Yeah, it's not DAK. Sorry for the trouble.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Confirmed on Vanilla also, sorry for the unhelpful misdirection.
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    Looking to see if anyone still uses this, I have been working on some changes to how DAK is loaded to make it better work with mods, added an unstuck plugin, and started some basic GUI framework for a menu system. With modded servers being filtered out I am thinking that this will become unused, so I am trying to gauge interest to see if I should continue development.
Sign In or Register to comment.