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

Reply
 
Thread Tools Display Modes
  #1  
Old 01-17-2008, 06:17 AM
Knightly
Accomplished Programmer
 
Join Date: Nov 2006
Location: Honolulu, HI
Posts: 91
Default

To remove the conditional for gottime, just change the code in zone.cpp from:
Code:
void Zone::GetTimeSync()
{
	if (worldserver.Connected() && !gottime) {
		ServerPacket* pack = new ServerPacket(ServerOP_GetWorldTime, 0);
		worldserver.SendPacket(pack);
		safe_delete(pack);
	}
}
To:
Code:
void Zone::GetTimeSync()
{
	if (worldserver.Connected()) {
		ServerPacket* pack = new ServerPacket(ServerOP_GetWorldTime, 0);
		worldserver.SendPacket(pack);
		safe_delete(pack);
	}
}
But again, I don't have time to test to see if that causes an egregious amount of time sync'ing or other issues.
Reply With Quote
  #2  
Old 02-02-2008, 07:09 AM
Knightly
Accomplished Programmer
 
Join Date: Nov 2006
Location: Honolulu, HI
Posts: 91
Default

I've been running the above change (removing the !gottime conditional) since this was posted, except with the addition that I wrote an entry to the log every time that it was used. So, I can now verify that this doesn't cause an inordinate amount of time synchronization and, indeed, keeps all of my dynamic zones in sync with time.
Reply With Quote
  #3  
Old 02-02-2008, 07:32 AM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

I didn't even see that snippet, I'll have to try it out on TGC next time I patch. I know the rest of your submissions are in the official code, but I have yet to find time to play. :(
Reply With Quote
  #4  
Old 06-27-2008, 08:53 AM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

Quote:
Originally Posted by Knightly View Post
To remove the conditional for gottime, just change the code in zone.cpp from:
Code:
void Zone::GetTimeSync()
{
	if (worldserver.Connected() && !gottime) {
		ServerPacket* pack = new ServerPacket(ServerOP_GetWorldTime, 0);
		worldserver.SendPacket(pack);
		safe_delete(pack);
	}
}
To:
Code:
void Zone::GetTimeSync()
{
	if (worldserver.Connected()) {
		ServerPacket* pack = new ServerPacket(ServerOP_GetWorldTime, 0);
		worldserver.SendPacket(pack);
		safe_delete(pack);
	}
}
But again, I don't have time to test to see if that causes an egregious amount of time sync'ing or other issues.
This change never went into the source, did I miss something - or it just got forgotten?
Reply With Quote
  #5  
Old 06-27-2008, 09:16 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

It may be the case that the problem described by Knightly is due to the
fact that 'gottime' is not initialised in the zone constructor and therefore
has a random value each time a zone is booted up.

In zone/zone.cpp, Zone::Zone(int32 in_zoneid, const char* in_short_name)

Around line 700:

After:

Code:
        aas = NULL;
        totalAAs = 0;
Add:

Code:
       gottime = false;
I can't test this, but I'm bored at work and just had a quick look at the code
Reply With Quote
  #6  
Old 06-27-2008, 01:15 PM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

I just got back, saw your post. Before i tested , i pulled all "settime" scripts ;
Here's a summary of what happened:
With Knightlys gottime-removal fix, all dynamic zones start at 8pm, then continue to count normally ; all static zones start at 8am.
With Derisions gottime = false; fix, all dynamic zones start at 2:00pm, and continue normally.
so with one they stay 12 hours apart (dynamic vs static) and the other 6.
I stood around a while checked a lot of zones, and times remain stable, but with the mentioned time difference.
Reply With Quote
  #7  
Old 06-27-2008, 01:58 PM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

can't some sort of GLOBAL server side timer be build INTO server code istelf?

which will start when server itself is started (regardless if any zones have been booted or not) and then ALL zone will read time from that timer

in other words, tie timer to SERVER itself not to any zone in specific

OR as a cheap solution- make zones read time of current PC time and convert into EQ

since eq day is what 2 hours? then 11.30 am will be 6pm game time
Reply With Quote
  #8  
Old 06-27-2008, 02:38 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

I've been looking at this some more. It appears that when a static zone
loads, it makes the call to GetTimeSync before it is actually connected
to the world server, hence the check for worldserver.connected fails.

Angelox, try this. In zone/worldserver.cpp void WorldServer::OnConnected():

Around line 124, After:

Code:
 if (ZoneLoaded) {
                this->SetZone(zone->GetZoneID());
                entity_list.UpdateWho(true);
                this->SendEmoteMessage(0, 0, 15, "Zone connect: %s", zone->GetLongName());
Add:

Code:
                 zone->GetTimeSync();
So the whole section of code reads:

Code:
 if (ZoneLoaded) {
                this->SetZone(zone->GetZoneID());
                entity_list.UpdateWho(true);
                this->SendEmoteMessage(0, 0, 15, "Zone connect: %s", zone->GetLongName());
                zone->GetTimeSync();
        } else {
                this->SetZone(0);
        }
I started and stopped my server a couple of times and the time in my 5 dynamic and 1 static were now in sync.

This is purely experimental code
Reply With Quote
  #9  
Old 06-27-2008, 02:56 PM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

what about gottime? should I leave as original, Knightly, or your change?
Reply With Quote
Reply

Thread Tools
Display Modes

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 08:55 AM.


 

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