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; |
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:
|
That code is a horrible hack and I would not suggest using it on any heavily populated server.
|
:)
|
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? |
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? |
Quote:
Quote:
|
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 |
Great!!!!!! I look forward to the results...:)
|
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 |
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....:)
|
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. |
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 |
spent around 45 mins on it so far zoning back and forth , cant get it to puke yet.. :)
|
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 |
All times are GMT -4. The time now is 02:34 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.