Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 03-13-2004, 05:06 AM
Armanthuz
Sarnak
 
Join Date: Apr 2003
Posts: 72
Default repost of code that works REALLY well for me

Been searching for 10 min now cant find original author of this codes post, but its not me. I just fixed it a bit. Solved 98 percent of all the LDs peoeple were having on my server... Just wanted to repost in fixed version so it dont get lost...

this goes in client.cpp in world folder starting at line 419 right after the line that says "int32 tmpaccid = 0;"

Code:
         long LOCounter; 
			LOCounter = 0;
             do { 
                 charid = database.GetCharacterInfo(char_name, &tmpaccid, &zoneID); 
                 LOCounter++; 
                }while ((zoneID == 0) && (LOCounter < 10000));
Thanks to whoever figured out original code and problem, worked very well..
Reply With Quote
  #2  
Old 03-13-2004, 05:29 AM
samandhi's Avatar
samandhi
Demi-God
 
Join Date: Aug 2003
Posts: 1,056
Default

screamingogre was the original one that came out with that one... Though there was some discussion about it.. and the LOCounter was not initialized as it should have been, and the statement LOCounter < 1000 was set as LOCounter > 1000.... and dont forget this one too:
Quote:
Originally Posted by toolh3
I based mine on time passed, that way it doesn't matter how fast your machine is. This code waits 20 seconds before it gives up. Note that if it does get a good zone id, it breaks out of the loop.


Code:
__time64_t curtime1,curtime2;
_time64(&curtime1);
do
{
charid = database.GetCharacterInfo(char_name, &tmpaccid, &zoneID);
_time64(&curtime2);
}while(curtime2 - curtime1 <= 20 && zoneID == 0);
__________________

Quote:
Analysis paralysis will keep you from failing, but it will also keep you from succeeding.
  • L.L. CoolJ
Reply With Quote
  #3  
Old 03-13-2004, 06:18 AM
kathgar
Discordant
 
Join Date: May 2002
Posts: 434
Default

That code is a horrible hack and I would not suggest using it on any heavily populated server.
__________________
++[>++++++<-]>[<++++++>-]<.>++++[>+++++<-]>[<
+++++>-]<+.+++++++..+++.>>+++++[<++++++>-]<+
+.<<+++++++++++++++.>.+++.------.--------.>+.
Reply With Quote
  #4  
Old 03-13-2004, 06:29 AM
samandhi's Avatar
samandhi
Demi-God
 
Join Date: Aug 2003
Posts: 1,056
Default

__________________

Quote:
Analysis paralysis will keep you from failing, but it will also keep you from succeeding.
  • L.L. CoolJ
Reply With Quote
  #5  
Old 03-13-2004, 06:35 AM
Windcatcher
Demi-God
 
Join Date: Jan 2002
Posts: 1,175
Default

I don't know if it pertains to this issue, but my server is running Client::EnterWorld() in a different thread for each person playing so the world server doesn't freeze. Potentially this same thing could be done on non-ZP servers. If anyone wants to log in to test it feel free. If the server stays up with no problems I'll release what I have later tonight.

WC

Edit: I did some looking at the code in question and what I'm doing could conceivably be done in the enterworld case block as well, where the above code lives. My understanding is that the world server wants to get the zone ID but the zone server hasn't written it yet. Is this correct?
Reply With Quote
  #6  
Old 03-13-2004, 07:21 AM
Armanthuz
Sarnak
 
Join Date: Apr 2003
Posts: 72
Default

So if i understand this right...

If you slow down world.exe by using that counter you can (under heavy usage) stall or freeze up people attempting to shift zones? Instead windcatcher is proposing to make it so each person attempting to enter a diff zone each gets a thread and therefore can wait whatever amount of time necc without holding up others from zoning?
Reply With Quote
  #7  
Old 03-13-2004, 07:25 AM
samandhi's Avatar
samandhi
Demi-God
 
Join Date: Aug 2003
Posts: 1,056
Default

Quote:
My understanding is that the world server wants to get the zone ID but the zone server hasn't written it yet. Is this correct?
Yes, I think (If I am understanding it correclty aslo) that is what is happening....

Quote:
I don't know if it pertains to this issue, but my server is running Client::EnterWorld() in a different thread for each person playing so the world server doesn't freeze.
I believe that is VERY relevant to this issue... And also believe making it a person by person case would better solve the issue...
__________________

Quote:
Analysis paralysis will keep you from failing, but it will also keep you from succeeding.
  • L.L. CoolJ
Reply With Quote
  #8  
Old 03-13-2004, 08:06 AM
Windcatcher
Demi-God
 
Join Date: Jan 2002
Posts: 1,175
Default

I'm going to try running that case block in a different thread and then I'll put my server back up. I do multhreaded programming at work to death (albeit in Java) so I think I can do it. We'll wee how it works...

WC
Reply With Quote
  #9  
Old 03-13-2004, 09:01 AM
samandhi's Avatar
samandhi
Demi-God
 
Join Date: Aug 2003
Posts: 1,056
Default

Great!!!!!! I look forward to the results...
__________________

Quote:
Analysis paralysis will keep you from failing, but it will also keep you from succeeding.
  • L.L. CoolJ
Reply With Quote
  #10  
Old 03-13-2004, 10:07 AM
Windcatcher
Demi-God
 
Join Date: Jan 2002
Posts: 1,175
Default

Okay, my server is up and unlocked. My implementation of ClientList and ZSList should be thread-safe, and I have Client::EnterWorld() and the OP_EnterWorld portion of the case block running in separate threads from the main thread. It's working like a champ for me, but I need people to log in so I can see if the world server handles multiple clients simultaneously going through the EnterWorld process. The world server will either stay up or it will crash, but this is the only way to be sure that everything is thread-safe.

WC
Reply With Quote
  #11  
Old 03-13-2004, 10:32 AM
samandhi's Avatar
samandhi
Demi-God
 
Join Date: Aug 2003
Posts: 1,056
Default

give me a time (and the name of your server) and Ill log in.. You can log in at the same time (ish) and well see what we see....
__________________

Quote:
Analysis paralysis will keep you from failing, but it will also keep you from succeeding.
  • L.L. CoolJ
Reply With Quote
  #12  
Old 03-13-2004, 10:35 AM
Windcatcher
Demi-God
 
Join Date: Jan 2002
Posts: 1,175
Default

I have the server up right now, though I'm already logged in. It''s called Windcatcher's ZoneProxy Test Server. Someone already logged in and while that was happening I zoned so both clients were going through the enterworld process at the same time. So far no problems -- at this point I think I need lots of people to just log in and stress it.

This change affects other things as well -- for instance, doing /who all should always work regardless of whether someone is logging in.

WC

P.S. I just re-uploaded my server code with all of the changes. Threre is more info on it in this thread:

http://www.eqemulator.net/forums/vie...?p=73082#73082

All of my changes are in #ifdef...ZONEPROXY...#endif blocks so as not to affect anything else, but it means that to get multithreaded support you'll have to compile with ZoneProxy support on.
Reply With Quote
  #13  
Old 03-13-2004, 06:07 PM
Windcatcher
Demi-God
 
Join Date: Jan 2002
Posts: 1,175
Default

Well the changes I made were close, but testing showed that it wasn't quite right. I've since found some more things that needed fixing and I've got the server back up. I'll leave it up overnight for any night owls that want to log in :P

WC
Reply With Quote
  #14  
Old 03-14-2004, 04:36 AM
Armanthuz
Sarnak
 
Join Date: Apr 2003
Posts: 72
Default

spent around 45 mins on it so far zoning back and forth , cant get it to puke yet..
Reply With Quote
  #15  
Old 03-14-2004, 04:39 AM
Windcatcher
Demi-God
 
Join Date: Jan 2002
Posts: 1,175
Default

Yeah I couldn't get it to fail last night before I went to bed either, but I think the real test is when there are multiple people logging in and zoning back and forth at the same time. That would really test the multithreaded code and was what caused the crash before I made the latest round of changes.

WC
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 07:38 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3