mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[11226] More strict checks for insatance data load.
This commit is contained in:
parent
a3f9d3a4dc
commit
275928e504
2 changed files with 18 additions and 4 deletions
|
|
@ -313,11 +313,20 @@ void DungeonResetScheduler::LoadResetTimes()
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if(time_t resettime = time_t((*result)[3].GetUInt64()))
|
if (time_t resettime = time_t((*result)[3].GetUInt64()))
|
||||||
{
|
{
|
||||||
uint32 id = (*result)[0].GetUInt32();
|
uint32 id = (*result)[0].GetUInt32();
|
||||||
uint32 mapid = (*result)[1].GetUInt32();
|
uint32 mapid = (*result)[1].GetUInt32();
|
||||||
uint32 difficulty = (*result)[2].GetUInt32();
|
uint32 difficulty = (*result)[2].GetUInt32();
|
||||||
|
|
||||||
|
MapEntry const* mapEntry = sMapStore.LookupEntry(mapid);
|
||||||
|
|
||||||
|
if (!mapEntry || !mapEntry->IsDungeon() || !GetMapDifficultyData(mapid, Difficulty(difficulty)))
|
||||||
|
{
|
||||||
|
sMapPersistentStateMgr.DeleteInstanceFromDB(id);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
instResetTime[id] = ResetTimeMapDiffType(MAKE_PAIR32(mapid,difficulty), resettime);
|
instResetTime[id] = ResetTimeMapDiffType(MAKE_PAIR32(mapid,difficulty), resettime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -362,8 +371,9 @@ void DungeonResetScheduler::LoadResetTimes()
|
||||||
Difficulty difficulty = Difficulty(fields[1].GetUInt32());
|
Difficulty difficulty = Difficulty(fields[1].GetUInt32());
|
||||||
uint64 oldresettime = fields[2].GetUInt64();
|
uint64 oldresettime = fields[2].GetUInt64();
|
||||||
|
|
||||||
MapDifficulty const* mapDiff = GetMapDifficultyData(mapid,difficulty);
|
MapEntry const* mapEntry = sMapStore.LookupEntry(mapid);
|
||||||
if(!mapDiff)
|
|
||||||
|
if (!mapEntry || !mapEntry->IsDungeon() || !GetMapDifficultyData(mapid,difficulty))
|
||||||
{
|
{
|
||||||
sLog.outError("MapPersistentStateManager::LoadResetTimes: invalid mapid(%u)/difficulty(%u) pair in instance_reset!", mapid, difficulty);
|
sLog.outError("MapPersistentStateManager::LoadResetTimes: invalid mapid(%u)/difficulty(%u) pair in instance_reset!", mapid, difficulty);
|
||||||
CharacterDatabase.DirectPExecute("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);
|
||||||
|
|
@ -397,6 +407,10 @@ void DungeonResetScheduler::LoadResetTimes()
|
||||||
if (!mapDiff->resetTime)
|
if (!mapDiff->resetTime)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
MapEntry const* mapEntry = sMapStore.LookupEntry(mapid);
|
||||||
|
if (!mapEntry || !mapEntry->IsDungeon())
|
||||||
|
continue;
|
||||||
|
|
||||||
uint32 period = GetMaxResetTimeFor(mapDiff);
|
uint32 period = GetMaxResetTimeFor(mapDiff);
|
||||||
time_t t = GetResetTimeFor(mapid,difficulty);
|
time_t t = GetResetTimeFor(mapid,difficulty);
|
||||||
if(!t)
|
if(!t)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11225"
|
#define REVISION_NR "11226"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue