Core/DBLayer: Convert PAppend() queries to prepared statements No.1
This commit is contained in:
1 parent
56fac5e1af
commit
c6cbe4c77c
22 files changed
+288
-91
No files matched your search
@@ -568,8 +568,18 @@ void ReputationMgr::SaveToDB(SQLTransaction& trans)
|
||||
{
|
||||
if (itr->second.needSave)
|
||||
{
|
||||
trans->PAppend("DELETE FROM character_reputation WHERE guid = '%u' AND faction='%u'", _player->GetGUIDLow(), itr->second.ID);
|
||||
trans->PAppend("INSERT INTO character_reputation (guid, faction, standing, flags) VALUES ('%u', '%u', '%i', '%u')", _player->GetGUIDLow(), itr->second.ID, itr->second.Standing, itr->second.Flags);
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_REPUTATION_BY_FACTION);
|
||||
stmt->setUInt32(0, _player->GetGUIDLow());
|
||||
stmt->setUInt16(1, uint16(itr->second.ID));
|
||||
trans->Append(stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_REPUTATION_BY_FACTION);
|
||||
stmt->setUInt32(0, _player->GetGUIDLow());
|
||||
stmt->setUInt16(1, uint16(itr->second.ID));
|
||||
stmt->setInt32(2, itr->second.Standing);
|
||||
stmt->setUInt16(3, uint16(itr->second.Flags));
|
||||
trans->Append(stmt);
|
||||
|
||||
itr->second.needSave = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user