View Single Post
  #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