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