Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 09-01-2015, 02:20 AM
Midgett
Fire Beetle
 
Join Date: May 2009
Location: AL
Posts: 29
Default

Thanks for the sanity check!

Part of my investigation was looking at bots.cpp.

Here is the Load Pet Buffs code block in bots.cpp.

Code:
void Bot::LoadPetBuffs(SpellBuff_Struct* petBuffs, uint32 botPetSaveId) {
	if(!petBuffs || botPetSaveId == 0)
        return;

    std::string query = StringFormat("SELECT SpellId, CasterLevel, Duration FROM botpetbuffs WHERE BotPetsId = %u;", botPetSaveId);
    auto results = database.QueryDatabase(query);
	if(!results.Success())
		return;

	int buffIndex = 0;
	for (auto row = results.begin();row != results.end(); ++row) {
		if(buffIndex == BUFF_COUNT)
			break;

		petBuffs[buffIndex].spellid = atoi(row[0]);
		petBuffs[buffIndex].level = atoi(row[1]);
		petBuffs[buffIndex].duration = atoi(row[2]);
		buffIndex++;
	}
	query = StringFormat("DELETE FROM botpetbuffs WHERE BotPetsId = %u;", botPetSaveId);
	results = database.QueryDatabase(query);
}
Here is the Save Pet Buffs code block in bots.cpp.

Code:
void Bot::SavePetBuffs(SpellBuff_Struct* petBuffs, uint32 botPetSaveId) {
	if(!petBuffs || botPetSaveId == 0)
        return;

	int buffIndex = 0;
	while(buffIndex < BUFF_COUNT) {
        if(petBuffs[buffIndex].spellid > 0 && petBuffs[buffIndex].spellid != SPELL_UNKNOWN) {

            std::string query = StringFormat("INSERT INTO botpetbuffs (BotPetsId, SpellId, CasterLevel, Duration) VALUES(%u, %u, %u, %u)", botPetSaveId, petBuffs[buffIndex].spellid, petBuffs[buffIndex].level, petBuffs[buffIndex].duration);
            auto results = database.QueryDatabase(query);
            if(!results.Success())
                break;
        }
        buffIndex++;
    }
If you notice I printed in RED the database queries. All those fields are present in the botpetbuffs table.

If I copy my botpetbuffs from my old server db (same fields) to my new database, the buffs won't load either.
So not only will the bot pet's buffs won't save, they won't load either.
Reply With Quote
 

Thread Tools
Display Modes

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 08:32 PM.


 

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