Core/Player: Convert _SaveAuras to prepared statement format
--HG-- branch : trunk
This commit is contained in:
@@ -18086,7 +18086,9 @@ void Player::_SaveActions(SQLTransaction& trans)
|
|||||||
|
|
||||||
void Player::_SaveAuras(SQLTransaction& trans)
|
void Player::_SaveAuras(SQLTransaction& trans)
|
||||||
{
|
{
|
||||||
trans->PAppend("DELETE FROM character_aura WHERE guid = '%u'",GetGUIDLow());
|
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_AURA);
|
||||||
|
stmt->setUInt32(0, GetGUIDLow());
|
||||||
|
trans->Append(stmt);
|
||||||
|
|
||||||
for (AuraMap::const_iterator itr = m_ownedAuras.begin(); itr != m_ownedAuras.end() ; ++itr)
|
for (AuraMap::const_iterator itr = m_ownedAuras.begin(); itr != m_ownedAuras.end() ; ++itr)
|
||||||
{
|
{
|
||||||
@@ -18116,11 +18118,24 @@ void Player::_SaveAuras(SQLTransaction& trans)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
trans->PAppend("INSERT INTO character_aura (guid,caster_guid,spell,effect_mask,recalculate_mask,stackcount,amount0,amount1,amount2,base_amount0,base_amount1,base_amount2,maxduration,remaintime,remaincharges) "
|
uint8 index = 0;
|
||||||
"VALUES ('%u', '" UI64FMTD "', '%u', '%u', '%u', '%u', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%u')",
|
stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_AURA);
|
||||||
GetGUIDLow(), itr->second->GetCasterGUID(), itr->second->GetId(), effMask, recalculateMask,
|
stmt->setUInt32(index++, GetGUIDLow());
|
||||||
itr->second->GetStackAmount(), damage[0], damage[1], damage[2], baseDamage[0], baseDamage[1], baseDamage[2],
|
stmt->setUInt64(index++, itr->second->GetCasterGUID());
|
||||||
itr->second->GetMaxDuration(), itr->second->GetDuration(),itr->second->GetCharges());
|
stmt->setUInt32(index++, itr->second->GetId());
|
||||||
|
stmt->setUInt8(index++, effMask);
|
||||||
|
stmt->setUInt8(index++, recalculateMask);
|
||||||
|
stmt->setUInt8(index++, itr->second->GetStackAmount());
|
||||||
|
stmt->setInt32(index++, damage[0]);
|
||||||
|
stmt->setInt32(index++, damage[1]);
|
||||||
|
stmt->setInt32(index++, damage[2]);
|
||||||
|
stmt->setInt32(index++, baseDamage[0]);
|
||||||
|
stmt->setInt32(index++, baseDamage[1]);
|
||||||
|
stmt->setInt32(index++, baseDamage[2]);
|
||||||
|
stmt->setInt32(index++, itr->second->GetMaxDuration());
|
||||||
|
stmt->setInt32(index++, itr->second->GetDuration());
|
||||||
|
stmt->setUInt8(index, itr->second->GetCharges());
|
||||||
|
trans->Append(stmt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -251,5 +251,10 @@ bool CharacterDatabaseConnection::Open()
|
|||||||
PrepareStatement(CHAR_ADD_EQUIP_SET, "INSERT INTO character_equipmentsets (guid,setguid,setindex,name,iconname,item0,item1,item2,item3,item4,item5,item6,item7,item8,item9,item10,item11,item12,item13,item14,item15,item16,item17,item18) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", true);
|
PrepareStatement(CHAR_ADD_EQUIP_SET, "INSERT INTO character_equipmentsets (guid,setguid,setindex,name,iconname,item0,item1,item2,item3,item4,item5,item6,item7,item8,item9,item10,item11,item12,item13,item14,item15,item16,item17,item18) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", true);
|
||||||
PrepareStatement(CHAR_DEL_EQUIP_SET, "DELETE FROM character_equipmentsets WHERE setguid=?", true);
|
PrepareStatement(CHAR_DEL_EQUIP_SET, "DELETE FROM character_equipmentsets WHERE setguid=?", true);
|
||||||
|
|
||||||
|
// Auras
|
||||||
|
PrepareStatement(CHAR_DEL_AURA, "DELETE FROM character_aura WHERE guid = ?", true);
|
||||||
|
PrepareStatement(CHAR_ADD_AURA, "INSERT INTO character_aura (guid,caster_guid,spell,effect_mask,recalculate_mask,stackcount,amount0,amount1,amount2,base_amount0,base_amount1,base_amount2,maxduration,remaintime,remaincharges) "
|
||||||
|
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", true);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -210,6 +210,9 @@ enum CharacterDatabaseStatements
|
|||||||
CHAR_ADD_EQUIP_SET,
|
CHAR_ADD_EQUIP_SET,
|
||||||
CHAR_DEL_EQUIP_SET,
|
CHAR_DEL_EQUIP_SET,
|
||||||
|
|
||||||
|
CHAR_DEL_AURA,
|
||||||
|
CHAR_ADD_AURA,
|
||||||
|
|
||||||
MAX_CHARACTERDATABASE_STATEMENTS,
|
MAX_CHARACTERDATABASE_STATEMENTS,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user