Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-23-2004, 01:06 PM
tofuwarrior
Fire Beetle
 
Join Date: Feb 2004
Posts: 19
Default 5.5DR1 Character Creation bug

I found worlddebug.exe blowing up on me during character creation and I narrowed it down to a bug in database.cpp

The problem is in:

bool Database::GetStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct* in_cc)

The original code looked like this:
Code:
if((rows = mysql_num_rows(result)) == 1) row = mysql_fetch_row(result);
if(result) mysql_free_result(result);	

if(row)
{         
	LogFile->write(EQEMuLog::Status, "Found starting location in start_zones");
	in_pp->x = atoi(row[0]); 
	in_pp->y = atoi(row[1]); 
	in_pp->z = atoi(row[2]); 
	in_pp->zone_id = atoi(row[3]); 
	in_pp->bind_zone_id = atoi(row[4]); 
}
The problem with this was that, on my system anyway, when mysql_free_result was called... row was no longer a valid pointer but it was also not 0. For this reason, the first atoi call caused the system to crash.

I modifed this section to this:
Code:
rows = mysql_num_rows(result);

LogFile->write(EQEMuLog::Status, "Rows returned %d\n",rows);

if(rows == 1) row = mysql_fetch_row(result);
	
if(row)
{         
	LogFile->write(EQEMuLog::Status, "Found starting location in start_zones... ");
	in_pp->x = atoi(row[0]); 
	in_pp->y = atoi(row[1]); 
	in_pp->z = atoi(row[2]); 
	in_pp->zone_id = atoi(row[3]); 
	in_pp->bind_zone_id = atoi(row[4]); 
	LogFile->write(EQEMuLog::Status, "success! \n");
}
and I moved the mysql_free_result to the end:

Code:
	
if(result) mysql_free_result(result);

if(in_pp->x == 0 && in_pp->y == 0 && in_pp->z == 0)	database.GetSafePoints(in_pp->zone_id, &in_pp->x, &in_pp->y, &in_pp->z);

if(in_pp->bind_x == 0 && in_pp->bind_y == 0 && in_pp->bind_z == 0) database.GetSafePoints(in_pp->bind_zone_id, &in_pp->bind_x, &in_pp->bind_y, &in_pp->bind_z);

LogFile->write(EQEMuLog::Status, "Returning True from GetStartZone\n");
return true;
}
After this.. I was able to create characters properly. I still can't zone into the game without crashing the client though (
Reply With Quote
 


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 10:15 AM.


 

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