Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 01-17-2008, 06:16 AM
Knightly
Accomplished Programmer
 
Join Date: Nov 2006
Location: Honolulu, HI
Posts: 91
Default

I did some testing on the "time sync" issue and modified the code for testing. My initial thoughts were that it was due to "gottime" still being true when a zone booted up. However, I had an error in my logic on my first test and ended up adding a bunch of other tests to check the server packets. Turns out, I was right originally.

The reason that the sync doesn't update properly for dynamic zones is because sometimes a dynamic zone comes up in a place where gottime is actually "true" even though it shouldn't be for that zone. (gottime gets set to false when a zone shuts down).

For testing I changed zone.cpp to:
Code:
void Zone::GetTimeSync()
{
	LogFile->write(EQEMuLog::Status, "KNIGHTLY -- The value of gottime is %s", gottime ? "true" : "false");
	if (worldserver.Connected() && !gottime) {
		LogFile->write(EQEMuLog::Status, "KNIGHTLY -- Building Time Sync Packet");
		ServerPacket* pack = new ServerPacket(ServerOP_GetWorldTime, 0);
		LogFile->write(EQEMuLog::Status, "KNIGHTLY -- Sending Time Sync Packet");
		worldserver.SendPacket(pack);
		LogFile->write(EQEMuLog::Status, "KNIGHTLY -- Deleting Time Sync Packet");
		safe_delete(pack);
		LogFile->write(EQEMuLog::Status, "KNIGHTLY -- All done with Time Sync Packet");
	}
}
Now all of the information we need regarding what's going on is stored in the log files. NOTE: If I planned on keeping this code in, there would need to be debug logic rather than just writing it to the normal log. However, since I was just trying to track this one issue down, there's no reason to put in all the debug logic.

I then zoned from neriakc to neriakb to neriaka to nektulos (all dynamic for my testing). NeriakC was the first zone to come up:
Code:
---------------------------------------------
[01.17. - 07:38:27] Starting Log: logs/eqemu_zone_17164.log
[01.17. - 07:38:27] Using database 'ProjectEQ' at localhost:3306
[01.17. - 07:38:27] EMuShareMem loaded
[01.17. - 07:39:49] Booting neriakc
[01.17. - 07:39:49] Loading spawn conditions...
[01.17. - 07:39:49] Loading static zone points...
[01.17. - 07:39:49] Loading spawn groups...
[01.17. - 07:39:49] Loading spawn2 points...
[01.17. - 07:39:49] Loading player corpses...
[01.17. - 07:39:49] Loading traps...
[01.17. - 07:39:49] Loading ground spawns...
[01.17. - 07:39:49] Loading Ground Spawns from DB...
[01.17. - 07:39:49] Loading World Objects from DB...
[01.17. - 07:39:49] Loading Objects from DB...
[01.17. - 07:39:49] Loading doors for neriakc ...
[01.17. - 07:39:49] Loading Doors from database...
[01.17. - 07:39:49] Loading AA information...
[01.17. - 07:39:49] Loading Merchant Lists...
[01.17. - 07:39:49] Loading Temporary Merchant Lists...
[01.17. - 07:39:49] Successfully loaded Zone Config.
[01.17. - 07:39:49] Loading timezone data...
[01.17. - 07:39:49] Init Finished: ZoneID = 42, Time Offset = 0
---------------------------------------------
[01.17. - 07:39:49] Starting Log: logs/eqemu_zone_17164.log
[01.17. - 07:39:49] ---- Zone server neriakc, listening on port:7004 ----
[01.17. - 07:39:49] Zone Bootup: neriakc (42)
[01.17. - 07:39:49] KNIGHTLY -- The value of gottime is true
[01.17. - 07:40:31] Zoning 'Testers' to: neriakb (41) x=-499.910004, y=2.970000, z=-10.250000
[01.17. - 07:40:49] Zone Shutdown: neriakc (42)
[01.17. - 07:40:49] Zone shutdown: going to sleep
Next neriakb came up (and the time did not get set):
Code:
---------------------------------------------
[01.17. - 07:38:23] Starting Log: logs/eqemu_zone_17528.log
[01.17. - 07:38:23] Using database 'ProjectEQ' at localhost:3306
[01.17. - 07:38:23] EMuShareMem loaded
[01.17. - 07:40:31] Booting neriakb
[01.17. - 07:40:31] Loading spawn conditions...
[01.17. - 07:40:31] Loading static zone points...
[01.17. - 07:40:31] Loading spawn groups...
[01.17. - 07:40:31] Loading spawn2 points...
[01.17. - 07:40:31] Loading player corpses...
[01.17. - 07:40:31] Loading traps...
[01.17. - 07:40:31] Loading ground spawns...
[01.17. - 07:40:31] Loading Ground Spawns from DB...
[01.17. - 07:40:31] Loading World Objects from DB...
[01.17. - 07:40:31] Loading Objects from DB...
[01.17. - 07:40:31] Loading doors for neriakb ...
[01.17. - 07:40:31] Loading Doors from database...
[01.17. - 07:40:31] Loading AA information...
[01.17. - 07:40:31] Loading Merchant Lists...
[01.17. - 07:40:31] Loading Temporary Merchant Lists...
[01.17. - 07:40:31] Successfully loaded Zone Config.
[01.17. - 07:40:31] Loading timezone data...
[01.17. - 07:40:31] Init Finished: ZoneID = 41, Time Offset = 0
---------------------------------------------
[01.17. - 07:40:31] Starting Log: logs/eqemu_zone_17528.log
[01.17. - 07:40:31] ---- Zone server neriakb, listening on port:7003 ----
[01.17. - 07:40:31] Zone Bootup: neriakb (41)
[01.17. - 07:40:31] KNIGHTLY -- The value of gottime is true
[01.17. - 07:41:08] Zoning 'Testers' to: neriaka (40) x=156.919998, y=-2.940000, z=31.750000
[01.17. - 07:41:34] Zone Shutdown: neriakb (41)
[01.17. - 07:41:34] Zone shutdown: going to sleep
Then I went to neriaka (which was in the same logfile as neriakc) and the time did not get set:
Code:
[01.17. - 07:41:08] Booting neriaka
[01.17. - 07:41:08] Loading spawn conditions...
[01.17. - 07:41:08] Loading static zone points...
[01.17. - 07:41:08] Loading spawn groups...
[01.17. - 07:41:08] Loading spawn2 points...
[01.17. - 07:41:08] Loading player corpses...
[01.17. - 07:41:08] Loading traps...
[01.17. - 07:41:08] Loading ground spawns...
[01.17. - 07:41:08] Loading Ground Spawns from DB...
[01.17. - 07:41:08] Loading World Objects from DB...
[01.17. - 07:41:08] Loading Objects from DB...
[01.17. - 07:41:08] Loading doors for neriaka ...
[01.17. - 07:41:08] Loading Doors from database...
[01.17. - 07:41:08] Loading AA information...
[01.17. - 07:41:08] Loading Merchant Lists...
[01.17. - 07:41:08] Loading Temporary Merchant Lists...
[01.17. - 07:41:08] Successfully loaded Zone Config.
[01.17. - 07:41:08] Loading timezone data...
[01.17. - 07:41:08] Init Finished: ZoneID = 40, Time Offset = 0
[01.17. - 07:41:08] ---- Zone server neriaka, listening on port:7004 ----
[01.17. - 07:41:08] Zone Bootup: neriaka (40)
[01.17. - 07:41:08] KNIGHTLY -- The value of gottime is true
[01.17. - 07:43:42] Zoning 'Testers' to: nektulos (25) x=-259.000000, y=-1201.000000, z=-5.000000
[01.17. - 07:43:47] Zone Shutdown: neriaka (40)
[01.17. - 07:43:47] Zone shutdown: going to sleep
And finally, I went to nektulos (which was in the same log file that neriakb was in originally) and the time did get set:
Code:
[01.17. - 07:43:42] Booting nektulos
[01.17. - 07:43:42] Loading spawn conditions...
[01.17. - 07:43:42] Loading static zone points...
[01.17. - 07:43:42] Loading spawn groups...
[01.17. - 07:43:42] Loading spawn2 points...
[01.17. - 07:43:42] Loading player corpses...
[01.17. - 07:43:42] Loading traps...
[01.17. - 07:43:42] Loading ground spawns...
[01.17. - 07:43:42] Loading Ground Spawns from DB...
[01.17. - 07:43:42] Loading World Objects from DB...
[01.17. - 07:43:42] Loading Objects from DB...
[01.17. - 07:43:42] Loading doors for nektulos ...
[01.17. - 07:43:42] Loading Doors from database...
[01.17. - 07:43:42] Loading AA information...
[01.17. - 07:43:42] Loading Merchant Lists...
[01.17. - 07:43:42] Loading Temporary Merchant Lists...
[01.17. - 07:43:42] Successfully loaded Zone Config.
[01.17. - 07:43:42] Loading timezone data...
[01.17. - 07:43:42] Init Finished: ZoneID = 25, Time Offset = 0
[01.17. - 07:43:42] ---- Zone server nektulos, listening on port:7003 ----
[01.17. - 07:43:42] Zone Bootup: nektulos (25)
[01.17. - 07:43:42] KNIGHTLY -- The value of gottime is false
[01.17. - 07:43:42] KNIGHTLY -- Building Time Sync Packet
[01.17. - 07:43:42] KNIGHTLY -- Sending Time Sync Packet
[01.17. - 07:43:42] KNIGHTLY -- Deleting Time Sync Packet
[01.17. - 07:43:42] KNIGHTLY -- All done with Time Sync Packet
[01.17. - 07:45:05] Zone Shutdown: nektulos (25)
[01.17. - 07:45:05] Zone shutdown: going to sleep
Note the value of gottime when the zone syncs properly is "false" as it should be. However, on the other zones, the value was true and as such, the server does not attempt to synchronize the time.

There are two ways to go about fixing this. There's the real way, and the Knight way (tm). The real way would be to find out why gottime is true and fix those conditions such that gottime is false when it should be false and true when it should be true.

The Knight way (tm) was to find out how often gottime is being used (appears to be only in the TimeSync stuff); find out how often GetTimeSync is used (appears to be only when the zone is booting up); and just remove the conditional so that the time sync is done whether we have time or not.

Now, after a brief look at the code, this should only cause us to try to sync time when the zone comes up and it should force a sync every time. HOWEVER, I did not run a debug to trace all of the instances of this to make sure that it's not being done too often. I can't help but think the reason that gottime was there was because someone had a problem with the zones repeatedly synchronizing even though they already had synchronized the time.

I won't have any more time to spend on this until next week, so I thought I'd post my findings here in case anyone else wanted to pick up the testing or try to fix the real problem.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 07:24 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3