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

Reply
 
Thread Tools Display Modes
  #1  
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
  #2  
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
  #3  
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
  #4  
Old 06-27-2008, 03:04 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Quote:
Originally Posted by Angelox View Post
what about gottime? should I leave as original, Knightly, or your change?
I don't understand why you get different results with Knightly's change or mine, on the face of it they should have the same effect.

I was more interested in why the statics had a different time than dynamics. My 'gottime fix' seems the more 'correct' one to me, but you can try with either.
Reply With Quote
  #5  
Old 06-27-2008, 03:17 PM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

Quote:
Originally Posted by Derision View Post
I don't understand why you get different results with Knightly's change or mine, on the face of it they should have the same effect.

I was more interested in why the statics had a different time than dynamics. My 'gottime fix' seems the more 'correct' one to me, but you can try with either.
O well, I already compiled with your "zone->GetTimeSync();" fix and knightlys - I was just wanting to have it the way you wanted it.
BtW, it's working fine, all zones Sync together, static and dynamic. I'll watch it for a while and see i f it stays.
If so, what is "gottime" needed for? seems your insert will render gottime useless?
Reply With Quote
  #6  
Old 06-27-2008, 03:24 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Quote:
Originally Posted by Angelox View Post
If so, what is "gottime" needed for? seems your insert will render gottime useless?
It appears that whoever wrote the code meant the 'gottime' flag to mean that the zone had already synced it's time and didn't need to go to the trouble of sending another TimeSync request packet to world to sync again.

Since GetTimeSync is only called once during zone bootup, it doesn't seem to serve any purpose at present.
Reply With Quote
  #7  
Old 06-27-2008, 03:50 PM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

Well, this fix you made is working - best fix I've seen yet, MUCH better now.
I was just looking at a few old things I did - believe it or not, I hadn't looked at this time thing since I first came out with my "day and night" logic (from a dummies' point of view), sort of got burnt out on it. And now I'm out of work again and at home, so I'm back to learning all this.
Maybe you can find time to make a diff (probably quote out, the "gottime" entries ), see if the Devs can put it in.
Reply With Quote
Reply


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 09:02 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