Core/Player: Change equipmentset saving to use prepared statements.

Update issue #4550
Please try to re-reproduce

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2010-12-17 17:29:16 +01:00
parent d38b171391
commit 1cdeb4d057
3 changed files with 33 additions and 12 deletions

View File

@@ -246,5 +246,10 @@ bool CharacterDatabaseConnection::Open()
PrepareStatement(CHAR_SET_CHANNEL_USAGE, "UPDATE channels SET last_used = UNIX_TIMESTAMP() WHERE m_name = ? AND m_team = ?", true);
PrepareStatement(CHAR_CLEAN_CHANNEL, "DELETE FROM channels WHERE m_ownership = 1 AND (last_used + ?) < UNIX_TIMESTAMP()", true);
// Equipmentsets
PrepareStatement(CHAR_SET_EQUIP_SET, "UPDATE character_equipmentsets SET name=?, iconname=?, item0=?, item1=?, item2=?, item3=?, item4=?, item5=?, item6=?, item7=?, item8=?, item9=?, item10=?, item11=?, item12=?, item13=?, item14=?, item15=?, item16=?, item17=?, item18=? WHERE guid=? AND setguid=? AND setindex=?", 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);
return true;
}

View File

@@ -206,6 +206,10 @@ enum CharacterDatabaseStatements
CHAR_SET_CHANNEL_USAGE,
CHAR_CLEAN_CHANNEL,
CHAR_SET_EQUIP_SET,
CHAR_ADD_EQUIP_SET,
CHAR_DEL_EQUIP_SET,
MAX_CHARACTERDATABASE_STATEMENTS,
};