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
  #5  
Old 08-04-2003, 08:24 PM
Deawin
Fire Beetle
 
Join Date: Jun 2003
Location: Vienna, Austria
Posts: 11
Default

If you didn't have time to check this yet, I have made a patch against the latest CVS source that fixes all this stuff in client.cpp

Apply with "patch client.cpp <patchfile"

Code:
--- client.cpp	2003-08-05 10:18:30.000000000 +0200
+++ working/client.cpp	2003-08-05 09:59:36.000000000 +0200
@@ -1596,9 +1596,8 @@
 		else {
 			char errbuf[MYSQL_ERRMSG_SIZE];
 			char *query = 0;
-			MYSQL_RES *result;
 			Message(15,"Setting NPC %u to faction %i",target->CastToNPC()->GetNPCTypeID(),atoi(sep->argplus[1]));
-			if (database.RunQuery(query, MakeAnyLenString(&query, "update npc_types set npc_faction_id=%i where id=%i",atoi(sep->argplus[1]),target->CastToNPC()->GetNPCTypeID()), errbuf, &result)) {
+			if (database.RunQuery(query, MakeAnyLenString(&query, "update npc_types set npc_faction_id=%i where id=%i",atoi(sep->argplus[1]),target->CastToNPC()->GetNPCTypeID()), errbuf)) {
 				delete[] query;
 			}
 		}
@@ -2124,7 +2123,6 @@
 			char errbuf[MYSQL_ERRMSG_SIZE];
 			char *query = 0;
 			//int queryfound = 0;
-			MYSQL_RES *result;
 			//MYSQL_ROW row;
 			//Petition* newpet;
 			//char* blah32;
@@ -2132,7 +2130,7 @@
 			//char* querystring;
 			//querystring=strcat("DELETE from petitions where petid=",blah32);
 			Message(13,"Attempting to delete petition number: %i",atoi(sep->argplus[1]));
-			if (database.RunQuery(query, MakeAnyLenString(&query, "DELETE from petitions where petid=%i",atoi(sep->argplus[1])), errbuf, &result)) {
+			if (database.RunQuery(query, MakeAnyLenString(&query, "DELETE from petitions where petid=%i",atoi(sep->argplus[1])), errbuf)) {
 				safe_delete_array(query);
 				LogFile->write(EQEMuLog::Normal,"Delete petition request from %s, petition number:", GetName(), atoi(sep->argplus[1]) );
 			}
@@ -3230,6 +3228,7 @@
 						x++;
 					}
 					Message(0, " %u backups found.", x);
+					mysql_free_result(result);
 				}
 				else {
 					Message(13, "Query error: '%s' %s", query, errbuf);
@@ -4091,7 +4090,6 @@
 			if (database.RunQuery(query, MakeAnyLenString(&query, "SELECT id from spawn2 where zone='%s' AND x='%f' AND y='%f' AND heading='%f'", zone->GetShortName(), target->GetX(), target->GetY(), target->GetHeading()), errbuf, &result)) {
 				if (mysql_num_rows(result) == 1) {
 					row = mysql_fetch_row(result);
-					mysql_free_result(result);
 					tmp = atoi(row[0]);
 					if(database.RunQuery(query, MakeAnyLenString(&query, "UPDATE spawn2 SET x='%f', y='%f', z='%f', heading='%f' WHERE id='%i'",this->GetX(), this->GetY(), this->GetZ(), this->GetHeading(),tmp), errbuf, 0)) {
 						Message(0, "Updating coordinates successful.");
@@ -4099,16 +4097,14 @@
 					}
 					else {
 						Message(0, "Update failed, UPDATE command error!");
-						mysql_free_result(result);
 					}
 				}
 				else {
-					mysql_free_result(result);
 					Message(0, "Update failed, duplicate spawns detected!");
 				}
+				mysql_free_result(result);
 			}
 			else {
-				mysql_free_result(result);
 				Message(0, "Update failed, SELECT command error!");
 			}

@@ -4361,16 +4357,16 @@
 				//char *name=this->name;
 				if (mysql_num_rows(result)==1){
 				row = mysql_fetch_row(result);
+				mysql_free_result(result);
 				if (strcasecmp((char*) this->name, (char*) row[2]) == 0){
 					Message(15,"ID: %s,Sent Date: %s,Sender: %s,Message: %s",row[0],row[1],row[3],row[4]);
-					database.RunQuery(query, MakeAnyLenString(&query, "Delete from tellque where id=%s",row[0]), errbuf, &result);
+					database.RunQuery(query, MakeAnyLenString(&query, "Delete from tellque where id=%s",row[0]), errbuf);
 				}
 				else
 					Message(13,"Invalid Message Number, check the number and try again.");
 				}
 				else
 					Message(13,"Invalid Message Number, check the number and try again.");
-				mysql_free_result(result);
 			}
 			safe_delete_array(query);

@@ -7029,7 +7025,8 @@
 				mysql_free_result(result);
 				return false;
 			}
-
+
+			// code below will never be reached
 			mysql_free_result(result);
 			return false;
 		}
Regards,
Markus
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 09:49 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