Getting server tickrate

devicenulldevicenull Join Date: 2003-04-30 Member: 15967Members, NS2 Playtester, Squad Five Blue
Has anyone come up with a way to retrieve the server's tickrate? I'd love to get it so I can add it to my memory/cpu/player graphs

Comments

  • ScardyBobScardyBob ScardyBob Join Date: 2009-11-25 Member: 69528Forum Admins, Forum Moderators, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow
    edited June 2011
    Plasma's dev stalker server list seems able to get the server tickrate, but only from ones running GmOvrmind (<a href="http://www.play4dead.com/ns2/" target="_blank">http://www.play4dead.com/ns2/</a>). You might want to ask either him or player to see how they did that.
  • Kouji_SanKouji_San Sr. Hινε Uρкεερεг - EUPT Deputy The Netherlands Join Date: 2003-05-13 Member: 16271Members, NS2 Playtester, Squad Five Blue
    edited June 2011
    When on a server pop open the console (~) and type the following

    net_stats


    also:

    <a href="http://www.unknownworlds.com/ns2/wiki/index.php/Console_Commands" target="_blank">http://www.unknownworlds.com/ns2/wiki/inde...onsole_Commands</a>
  • devicenulldevicenull Join Date: 2003-04-30 Member: 15967Members, NS2 Playtester, Squad Five Blue
    <!--quoteo(post=1854059:date=Jun 17 2011, 08:09 PM:name=ScardyBob)--><div class='quotetop'>QUOTE (ScardyBob @ Jun 17 2011, 08:09 PM) <a href="index.php?act=findpost&pid=1854059"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Plasma's dev stalker server list seems able to get the server tickrate, but only from ones running GmOvrmind (<a href="http://www.play4dead.com/ns2/" target="_blank">http://www.play4dead.com/ns2/</a>). You might want to either him or player to see how they did that.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Ah, thanks. I remember seeing that server list in the past, but I couldn't find it.

    <!--quoteo(post=1854063:date=Jun 17 2011, 08:20 PM:name=Kouji_San)--><div class='quotetop'>QUOTE (Kouji_San @ Jun 17 2011, 08:20 PM) <a href="index.php?act=findpost&pid=1854063"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->When on a server pop open the console (~) and type the following

    net_stats<!--QuoteEnd--></div><!--QuoteEEnd-->

    That really doesn't help me generate graphs, unless I want to create them manually (I don't)
  • wulf 21wulf 21 Join Date: 2011-05-03 Member: 96875Members
    edited July 2011
    ah, I finally figured out that its actually an easy task to do, hope you are still interested in after a month. Just Hook into the Event "OnUpdateServer" or hook into the NS2Gamerules:OnUpdate() function (both are called once every tick). The last thing you would do e.g. by

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->/*    NS2Gamerules.lua    */
    Script.Load('../ns2/lua/NS2GameRules.lua') //load all the original functions

    local originalOnUpdate = NS2Gamerules.OnUpdate //store a pointer to the original function. important to not use ':'
                                                   //or having '()' at the end of the function as both are interpreted as calling the function

    function NS2Gamerules:OnUpdate()
        originalOnUpdate (self) //call the original
        //do your stuff below
        if lasttick then
            tickrate = 1/(Shared.GetTime()-lasttick)
        end
        lasttick=Shared.GetTime()
    end<!--c2--></div><!--ec2-->
Sign In or Register to comment.