EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Database/World Building (https://www.eqemulator.org/forums/forumdisplay.php?f=625)
-   -   zoneing crash useing mw_052_053_alpha2 (https://www.eqemulator.org/forums/showthread.php?t=11497)

toolh3 02-08-2004 03:53 PM

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);


Monrezz 02-10-2004 07:11 AM

Code:

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

Has anyone using Dev-C++ or Win32 tried to compile using this? I get the following log when trying to compile:

Code:

Compiler: Default compiler
Building Makefile: "C:\EQEmu\cvs\eqemu\eqemu\Dev-C++ Compat\world\Makefile.win"
Executing  make clean
rm -f client.o console.o LoginServer.o net.o zoneserver.o ../common/classes.o ../common/crc32.o ../common/database.o ../common/dbasync.o ../common/dbcore.o ../common/DBMemLeak.o ../common/debug.o ../common/EMuShareMem.o ../common/EQEMuError.o ../common/EQNetwork.o ../common/eqtime.o ../common/guilds.o ../common/Item.o ../common/md5.o ../common/misc.o ../common/MiscFunctions.o ../common/moremath.o ../common/Mutex.o ../common/packet_dump.o ../common/packet_dump_file.o ../common/packet_functions.o ../common/races.o ../common/serverinfo.o ../common/TCPConnection.o ../common/timer.o ../common/Portable_vsnprintf.o World_private.res World.exe

g++.exe -c client.cpp -o client.o -I"C:/Dev-C++/include/c++"  -I"C:/Dev-C++/include/c++/mingw32"  -I"C:/Dev-C++/include/c++/backward"  -I"C:/Dev-C++/include"  -I"c:/eqemu/zlib"  -I"c:/mysql/include" -D__GNUWIN32__ -w -finline-functions -DWORLD -DSHAREMEM -DINVERSEXY -D_WIN32_WINNT=0x0400 -DWIN32 -D_CONSOLE -D_MBCS -DFIELD_ITEMS -DSHAREMEM  -fexpensive-optimizations

client.cpp: In member function `bool Client::HandlePacket(const APPLAYER*)':
client.cpp:486: `__time64_t' undeclared (first use this function)
client.cpp:486: (Each undeclared identifier is reported only once for each
  function it appears in.)
client.cpp:486: parse error before `,' token
client.cpp:487: `curtime1' undeclared (first use this function)
client.cpp:487: `_time64' undeclared (first use this function)
client.cpp:491: `curtime2' undeclared (first use this function)

make.exe: *** [client.o] Error 1

Execution terminated

Looks pretty simple to fix...but I know no C at all :(

Any help would be appreciated,

Monrezz

wagenworld 02-28-2004 10:05 AM

I seem to be having the same problem.

I've had a great time setting it up. I absorbed the boards and searched twice for all of my questions. I've edited database tables, added and removed fields. I'm having a great time! :D

I am not able to zone however. It's 4pm now and i've been fiddling with everything I could get my hands into all day. I've broke it and fixed it all day long.... Last night was the server set up.

I suppose the next thing to do is start playing with the code. That I will save for tomorow.

Wag
yikes, is this my first post?

Rogean 03-06-2004 08:55 PM

Re: Code fix for ZoneID issue
 
Quote:

Originally Posted by screamingogre
This is the fix I made to get rid of the ZoneID =0 error.

Add this to the Client.cpp file for the world compile. Under case OP_EnterWorld: // Enter world.

Replace the Current call "charid = database.GetCharacterInfo(char_name, &tmpaccid, &zoneID);" with this


Code:

long LOCounter;
                        do {
                            charid = database.GetCharacterInfo(char_name, &tmpaccid, &zoneID);
                                LOCounter++;
                        }while ((zoneID == 0) && (LOCounter > 10000));

This will call the database until the ZoneID is not equal to 0 or the counter hits 10001. You may need to tweek the counter number for your server depending on how fast or slow it is.

**SO

Id just like to point out that i was having the zoneid=0 problem, and was getting frustrated, Until i noticed that:
}while ((zoneID == 0) && (LOCounter > 10000));
should be
}while ((zoneID == 0) && (LOCounter < 10000));

Its checking if LOCounter is LESS THAN 10k and entering the loop if is, and increasing it by 1 every time it loops until its GREATER THAN 10k.

And that's rogean's math lesson of the day. tks

jbb 03-07-2004 12:43 AM

Quote:

Id just like to point out that i was having the zoneid=0 problem, and was getting frustrated, Until i noticed that:
}while ((zoneID == 0) && (LOCounter > 10000));
should be
}while ((zoneID == 0) && (LOCounter < 10000));
Hehe, I pointed this out about 10 messages ago - although to be fair my message wasn't very clear. Also LOCounter is uninitialised too in the version of code printed. Best add an "=0" to it's declaration.


All times are GMT -4. The time now is 08:14 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.