Core/DBLayer: Converted player login queries into prepared statements

Core/DBLayer: Added missing implementation for SQLQueryHolder::SetPreparedQuery

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-09-20 18:20:40 +02:00
parent cd40ab6776
commit a509976369
23 changed files with 601 additions and 481 deletions

View File

@@ -452,7 +452,7 @@ void ReputationMgr::SetInactive(FactionState* faction, bool inactive)
faction->Changed = true;
}
void ReputationMgr::LoadFromDB(QueryResult result)
void ReputationMgr::LoadFromDB(PreparedQueryResult result)
{
// Set initial reputations (so everything is nifty before DB data load)
Initialize();
@@ -463,23 +463,21 @@ void ReputationMgr::LoadFromDB(QueryResult result)
{
do
{
Field *fields = result->Fetch();
FactionEntry const *factionEntry = sFactionStore.LookupEntry(fields[0].GetUInt32());
FactionEntry const *factionEntry = sFactionStore.LookupEntry(result->GetUInt32(0));
if (factionEntry && (factionEntry->reputationListID >= 0))
{
FactionState* faction = &m_factions[factionEntry->reputationListID];
// update standing to current
faction->Standing = int32(fields[1].GetUInt32());
faction->Standing = int32(result->GetUInt32(1));
// update counters
int32 BaseRep = GetBaseReputation(factionEntry);
ReputationRank old_rank = ReputationToRank(BaseRep);
ReputationRank new_rank = ReputationToRank(BaseRep + faction->Standing);
UpdateRankCounters(old_rank,new_rank);
UpdateRankCounters(old_rank, new_rank);
uint32 dbFactionFlags = fields[2].GetUInt32();
uint32 dbFactionFlags = result->GetUInt32(2);
if (dbFactionFlags & FACTION_FLAG_VISIBLE)
SetVisible(faction); // have internal checks for forced invisibility