Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::General Support

Support::General Support Post all topics here having to do with errors while trying to connect to an EQEMu server but not about the setup/running of the Server itself.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 07-22-2014, 03:05 PM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default

Patch code below:

Code:
***************
*** 2440,2459 ****
--- 2440,2464 ----
  				errbuf);
  			safe_delete_array(query);
  		}
  	}
  
+ 	database.RunQuery(query, MakeAnyLenString(&query, "LOCK TABLES `character_pet_inventory` WRITE", errbuf));
+ 	printf(errbuf);
+ 
  	for(i=0; i<MAX_WORN_INVENTORY; i++) {
  		if(petinfo->Items[i]) {
  			database.RunQuery(query, MakeAnyLenString(&query,
  				"INSERT INTO `character_pet_inventory` (`char_id`, `pet`, `slot`, `item_id`) values (%u, 0, %u, %u)",
  				c->CharacterID(), i, petinfo->Items[i]), errbuf);
  			// should check for errors
  			safe_delete_array(query);
  		}
  	}
  
+ 	database.RunQuery(query, MakeAnyLenString(&query,"UNLOCK TABLES", errbuf));
+ 	printf(errbuf);
  	
  	if(!database.RunQuery(query, MakeAnyLenString(&query,
  		"INSERT INTO `character_pet_info` (`char_id`, `pet`, `petname`, `petpower`, `spell_id`, `hp`, `mana`) "
  		"values (%u, 1, '%s', %u, %u, %u, %u) "
  		"ON DUPLICATE KEY UPDATE `petname`='%s', `petpower`=%i, `spell_id`=%u, `hp`=%u, `mana`=%u",
***************
*** 2581,2590 ****
--- 2586,2598 ----
  		LogFile->write(EQEMuLog::Error, "Error in LoadPetInfo query '%s': %s", query, errbuf);
  		safe_delete_array(query);
          return;
  	}
  
+ 	database.RunQuery(query, MakeAnyLenString(&query, "LOCK TABLES `character_pet_inventory` WRITE", errbuf));
+ 	printf(errbuf);
+ 
  	if (database.RunQuery(query, MakeAnyLenString(&query,
  		"SELECT `pet`, `slot`, `item_id` FROM `character_pet_inventory` WHERE `char_id`=%u",
  		c->CharacterID()), errbuf, &result))
  	{
  		safe_delete_array(query);
***************
*** 2608,2614 ****
--- 2616,2625 ----
  	else {
  		LogFile->write(EQEMuLog::Error, "Error in LoadPetInfo query '%s': %s", query, errbuf);
  		safe_delete_array(query);
          	return;
  	}
+ 	// Unlock the character_pet_inventory table so people can read
+ 	database.RunQuery(query, MakeAnyLenString(&query, "UNLOCK TABLES",errbuf));
+ 	printf(errbuf);
  
  }
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 04:11 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