Core/DBLayer: Use DirectPExecute, NOT DirectExecute, since we're actually using parameters in the queries - my bad!
--HG-- branch : trunk
This commit is contained in:
@@ -241,7 +241,7 @@ void InstanceSaveManager::_DelHelper(const char *fields, const char *table, cons
|
|||||||
CharacterDatabase.escape_string(fieldValue);
|
CharacterDatabase.escape_string(fieldValue);
|
||||||
ss << (i != 0 ? " AND " : "") << fieldTokens[i] << " = '" << fieldValue << "'";
|
ss << (i != 0 ? " AND " : "") << fieldTokens[i] << " = '" << fieldValue << "'";
|
||||||
}
|
}
|
||||||
CharacterDatabase.DirectExecute("DELETE FROM %s WHERE %s", table, ss.str().c_str());
|
CharacterDatabase.DirectPExecute("DELETE FROM %s WHERE %s", table, ss.str().c_str());
|
||||||
} while (result->NextRow());
|
} while (result->NextRow());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -431,7 +431,7 @@ void InstanceSaveManager::LoadResetTimes()
|
|||||||
InstResetTimeMapDiffType::iterator itr = instResetTime.find(instance);
|
InstResetTimeMapDiffType::iterator itr = instResetTime.find(instance);
|
||||||
if (itr != instResetTime.end() && itr->second.second != resettime)
|
if (itr != instResetTime.end() && itr->second.second != resettime)
|
||||||
{
|
{
|
||||||
CharacterDatabase.DirectExecute("UPDATE instance SET resettime = '"UI64FMTD"' WHERE id = '%u'", uint64(resettime), instance);
|
CharacterDatabase.DirectPExecute("UPDATE instance SET resettime = '"UI64FMTD"' WHERE id = '%u'", uint64(resettime), instance);
|
||||||
itr->second.second = resettime;
|
itr->second.second = resettime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -460,7 +460,7 @@ void InstanceSaveManager::LoadResetTimes()
|
|||||||
if (!mapDiff)
|
if (!mapDiff)
|
||||||
{
|
{
|
||||||
sLog.outError("InstanceSaveManager::LoadResetTimes: invalid mapid(%u)/difficulty(%u) pair in instance_reset!", mapid, difficulty);
|
sLog.outError("InstanceSaveManager::LoadResetTimes: invalid mapid(%u)/difficulty(%u) pair in instance_reset!", mapid, difficulty);
|
||||||
CharacterDatabase.DirectExecute("DELETE FROM instance_reset WHERE mapid = '%u' AND difficulty = '%u'", mapid,difficulty);
|
CharacterDatabase.DirectPExecute("DELETE FROM instance_reset WHERE mapid = '%u' AND difficulty = '%u'", mapid,difficulty);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -498,7 +498,7 @@ void InstanceSaveManager::LoadResetTimes()
|
|||||||
{
|
{
|
||||||
// initialize the reset time
|
// initialize the reset time
|
||||||
t = today + period + diff;
|
t = today + period + diff;
|
||||||
CharacterDatabase.DirectExecute("INSERT INTO instance_reset VALUES ('%u','%u','"UI64FMTD"')", mapid, difficulty, (uint64)t);
|
CharacterDatabase.DirectPExecute("INSERT INTO instance_reset VALUES ('%u','%u','"UI64FMTD"')", mapid, difficulty, (uint64)t);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (t < now)
|
if (t < now)
|
||||||
@@ -507,7 +507,7 @@ void InstanceSaveManager::LoadResetTimes()
|
|||||||
// calculate the next reset time
|
// calculate the next reset time
|
||||||
t = (t / DAY) * DAY;
|
t = (t / DAY) * DAY;
|
||||||
t += ((today - t) / period + 1) * period + diff;
|
t += ((today - t) / period + 1) * period + diff;
|
||||||
CharacterDatabase.DirectExecute("UPDATE instance_reset SET resettime = '"UI64FMTD"' WHERE mapid = '%u' AND difficulty= '%u'", (uint64)t, mapid, difficulty);
|
CharacterDatabase.DirectPExecute("UPDATE instance_reset SET resettime = '"UI64FMTD"' WHERE mapid = '%u' AND difficulty= '%u'", (uint64)t, mapid, difficulty);
|
||||||
}
|
}
|
||||||
|
|
||||||
SetResetTimeFor(mapid,difficulty,t);
|
SetResetTimeFor(mapid,difficulty,t);
|
||||||
|
|||||||
Reference in New Issue
Block a user