Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Database/World Building

Archive::Database/World Building Archive area for General Discussion's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #16  
Old 02-08-2004, 03:53 PM
toolh3
Sarnak
 
Join Date: Jul 2003
Posts: 35
Default

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);
Reply With Quote
  #17  
Old 02-10-2004, 07:11 AM
Monrezz's Avatar
Monrezz
Dragon
 
Join Date: Mar 2003
Location: #loc
Posts: 745
Default

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
__________________

kRPG Profile
Reply With Quote
  #18  
Old 02-28-2004, 10:05 AM
wagenworld
Fire Beetle
 
Join Date: Feb 2004
Posts: 2
Default

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!

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?
Reply With Quote
  #19  
Old 03-06-2004, 08:55 PM
Rogean's Avatar
Rogean
Administrator
 
Join Date: Jul 2003
Location: Massachusetts
Posts: 708
Default 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
__________________
EQEmulator Developer / Administrator
Reply With Quote
  #20  
Old 03-07-2004, 12:43 AM
jbb
Hill Giant
 
Join Date: Mar 2003
Location: UK
Posts: 242
Default

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.
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 03:01 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