ScardyBobScardyBobJoin Date: 2009-11-25Member: 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.
devicenullJoin Date: 2003-04-30Member: 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)
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-->
Comments
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>
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)
<!--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-->