Page 1 of 1

ZoneServer Timers - possible oversight?

Posted: Tue Dec 04, 2012 3:47 pm
by John Adams
C++ dudes, I have a question. In the ZoneServer::ZoneServer() function, one of the default values passed belongs to Timer widget_timer, and is set to 5000ms.

However, in the list of timers "Start" in ZoneServer, never is "widget_timer.Start()" ever set. Furthermore, nowhere else in code is widget_timer set, but is referenced in ZoneServer::SpawnProcess() as "if(widget_timer.Check() && !zoneShuttingDown)".

Correct me if I'm wrong, but if the widget_timer.Start() is never called, this "if" is never actually hit, right?

Code: Select all

		if(widget_timer.Check() && !zoneShuttingDown)
			CheckWidgetTimers();
This is called instead -

Code: Select all

MutexMap<Spawn*, int32> widget_timers;
So I am just checking to make sure nothing is missing, because I am sure it's been like this forever. Not even sure what Widget Timers might do... any ideas?


Edit: There's also one for spawn_range I just found, also never "started", but I do see code that says spawn_range.Trigger();

Re: ZoneServer Timers - possible oversight?

Posted: Tue Dec 04, 2012 7:06 pm
by Scatman
If you look at the 3 contructors for Timer.cpp, there are 2 that take the timer time. If > 0, the timer is started automatically (enabled set to true), so it doesn't appear you need to call Start() on those timers.

Re: ZoneServer Timers - possible oversight?

Posted: Wed Dec 05, 2012 10:54 am
by John Adams
Ahh, good catch Scat. Thanks, I will have to re-evaluate these as new Rules.

Though I wonder if there are some timers that should just remain hard-coded?