diff options
author | Shocker <shocker@freakz.ro> | 2011-04-29 22:24:26 +0300 |
---|---|---|
committer | Shocker <shocker@freakz.ro> | 2011-04-29 22:24:26 +0300 |
commit | 0fb8f057974cdf3107084be65005956efb5191dc (patch) | |
tree | 8fe211ecee643625c01ec3970038e345ec44c5f0 /src/server/game/Instances/InstanceSaveMgr.cpp | |
parent | f96e1ce1d7b10074750da761ff9b219a24d0f09f (diff) | |
parent | 1b1d7507f1c3ea768f3fdaf4e1729b66fe590a68 (diff) |
Merge branch 'master' of github.com:TrinityCore/TrinityCore
Diffstat (limited to 'src/server/game/Instances/InstanceSaveMgr.cpp')
-rwxr-xr-x | src/server/game/Instances/InstanceSaveMgr.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index ddd27b273b0..9a322cc1681 100755 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -96,7 +96,7 @@ InstanceSave* InstanceSaveManager::AddInstanceSave(uint32 mapId, uint32 instance // initialize reset time // for normal instances if no creatures are killed the instance will reset in two hours if (entry->map_type == MAP_RAID || difficulty > DUNGEON_DIFFICULTY_NORMAL) - resetTime = GetResetTimeFor(mapId,difficulty); + resetTime = GetResetTimeFor(mapId, difficulty); else { resetTime = time(NULL) + 2 * HOUR; @@ -227,9 +227,9 @@ bool InstanceSave::UnloadIfEmpty() return true; } -void InstanceSaveManager::_DelHelper(const char *fields, const char *table, const char *queryTail,...) +void InstanceSaveManager::_DelHelper(const char *fields, const char *table, const char *queryTail, ...) { - Tokens fieldTokens(fields, ','); + Tokens fieldTokens(fields, ', '); ASSERT(fieldTokens.size() != 0); va_list ap; @@ -297,12 +297,12 @@ void InstanceSaveManager::LoadResetTimes() // get the current reset times for normal instances (these may need to be updated) // these are only kept in memory for InstanceSaves that are loaded later // resettime = 0 in the DB for raid/heroic instances so those are skipped - typedef std::pair<uint32 /*PAIR32(map,difficulty)*/, time_t> ResetTimeMapDiffType; + typedef std::pair<uint32 /*PAIR32(map, difficulty)*/, time_t> ResetTimeMapDiffType; typedef std::map<uint32, ResetTimeMapDiffType> InstResetTimeMapDiffType; InstResetTimeMapDiffType instResetTime; // index instance ids by map/difficulty pairs for fast reset warning send - typedef std::multimap<uint32 /*PAIR32(map,difficulty)*/, uint32 /*instanceid*/ > ResetTimeMapDiffInstances; + typedef std::multimap<uint32 /*PAIR32(map, difficulty)*/, uint32 /*instanceid*/ > ResetTimeMapDiffInstances; ResetTimeMapDiffInstances mapDiffResetInstances; QueryResult result = CharacterDatabase.Query("SELECT id, map, difficulty, resettime FROM instance ORDER BY id ASC"); @@ -373,7 +373,7 @@ void InstanceSaveManager::LoadResetTimes() if (!mapDiff) { sLog->outError("InstanceSaveManager::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); continue; } @@ -408,12 +408,12 @@ void InstanceSaveManager::LoadResetTimes() if (period < DAY) period = DAY; - time_t t = GetResetTimeFor(mapid,difficulty); + time_t t = GetResetTimeFor(mapid, difficulty); if (!t) { // initialize the reset time t = today + period + diff; - CharacterDatabase.DirectPExecute("INSERT INTO instance_reset VALUES ('%u','%u','%u')", mapid, difficulty, (uint32)t); + CharacterDatabase.DirectPExecute("INSERT INTO instance_reset VALUES ('%u', '%u', '%u')", mapid, difficulty, (uint32)t); } if (t < now) @@ -425,7 +425,7 @@ void InstanceSaveManager::LoadResetTimes() 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); // schedule the global reset/warning uint8 type; @@ -470,7 +470,7 @@ void InstanceSaveManager::ScheduleReset(bool add, time_t time, InstResetEvent ev } if (itr == m_resetTimeQueue.end()) - sLog->outError("InstanceSaveManager::ScheduleReset: cannot cancel the reset, the event(%d,%d,%d) was not found!", event.type, event.mapid, event.instanceId); + sLog->outError("InstanceSaveManager::ScheduleReset: cannot cancel the reset, the event(%d, %d, %d) was not found!", event.type, event.mapid, event.instanceId); } } else @@ -498,7 +498,7 @@ void InstanceSaveManager::Update() else { // global reset/warning for a certain map - time_t resetTime = GetResetTimeFor(event.mapid,event.difficulty); + time_t resetTime = GetResetTimeFor(event.mapid, event.difficulty); _ResetOrWarnAll(event.mapid, event.difficulty, event.type != 4, resetTime); if (event.type != 4) { |