ZoneServer Timers - possible oversight?

Old bugs stored here for reference.
Locked
User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

ZoneServer Timers - possible oversight?

Post by John Adams » Tue Dec 04, 2012 3:47 pm

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();

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: ZoneServer Timers - possible oversight?

Post by Scatman » Tue Dec 04, 2012 7:06 pm

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.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: ZoneServer Timers - possible oversight?

Post by John Adams » Wed Dec 05, 2012 10:54 am

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?

Locked

Who is online

Users browsing this forum: No registered users and 0 guests