Core: header cleanup, split realmlist, boost compatibility, cotire, remove stormlib/zlib and stormlib/bzip2 and instead use dep sources
This commit is contained in:
1 parent
7fff6c424f
commit
5ff847159c
1243 files changed
+29780
-36517
No files matched your search
@@ -16,21 +16,23 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "Player.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "Log.h"
|
||||
#include "GridStates.h"
|
||||
#include "Map.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapInstanced.h"
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "Timer.h"
|
||||
#include "Common.h"
|
||||
#include "Config.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "World.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DBCStores.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridStates.h"
|
||||
#include "Group.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Log.h"
|
||||
#include "Map.h"
|
||||
#include "MapInstanced.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "Timer.h"
|
||||
#include "World.h"
|
||||
|
||||
uint16 InstanceSaveManager::ResetTimeDelay[] = {3600, 900, 300, 60};
|
||||
|
||||
@@ -76,23 +78,23 @@ InstanceSave* InstanceSaveManager::AddInstanceSave(uint32 mapId, uint32 instance
|
||||
if (InstanceSave* old_save = GetInstanceSave(instanceId))
|
||||
return old_save;
|
||||
|
||||
const MapEntry* entry = sMapStore.LookupEntry(mapId);
|
||||
MapEntry const* entry = sMapStore.LookupEntry(mapId);
|
||||
if (!entry)
|
||||
{
|
||||
TC_LOG_ERROR("misc", "InstanceSaveManager::AddInstanceSave: wrong mapid = %d, instanceid = %d!", mapId, instanceId);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (instanceId == 0)
|
||||
{
|
||||
TC_LOG_ERROR("misc", "InstanceSaveManager::AddInstanceSave: mapid = %d, wrong instanceid = %d!", mapId, instanceId);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (difficulty >= (entry->IsRaid() ? MAX_RAID_DIFFICULTY : MAX_DUNGEON_DIFFICULTY))
|
||||
{
|
||||
TC_LOG_ERROR("misc", "InstanceSaveManager::AddInstanceSave: mapid = %d, instanceid = %d, wrong dificalty %u!", mapId, instanceId, difficulty);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!resetTime)
|
||||
@@ -103,7 +105,7 @@ InstanceSave* InstanceSaveManager::AddInstanceSave(uint32 mapId, uint32 instance
|
||||
resetTime = GetResetTimeFor(mapId, difficulty);
|
||||
else
|
||||
{
|
||||
resetTime = time(NULL) + 2 * HOUR;
|
||||
resetTime = time(nullptr) + 2 * HOUR;
|
||||
// normally this will be removed soon after in InstanceMap::Add, prevent error
|
||||
ScheduleReset(true, resetTime, InstResetEvent(0, mapId, difficulty, instanceId));
|
||||
}
|
||||
@@ -122,7 +124,7 @@ InstanceSave* InstanceSaveManager::AddInstanceSave(uint32 mapId, uint32 instance
|
||||
InstanceSave* InstanceSaveManager::GetInstanceSave(uint32 InstanceId)
|
||||
{
|
||||
InstanceSaveHashMap::iterator itr = m_instanceSaveById.find(InstanceId);
|
||||
return itr != m_instanceSaveById.end() ? itr->second : NULL;
|
||||
return itr != m_instanceSaveById.end() ? itr->second : nullptr;
|
||||
}
|
||||
|
||||
void InstanceSaveManager::DeleteInstanceFromDB(uint32 instanceid)
|
||||
@@ -219,7 +221,7 @@ void InstanceSave::SaveToDB()
|
||||
time_t InstanceSave::GetResetTimeForDB()
|
||||
{
|
||||
// only save the reset time for normal instances
|
||||
const MapEntry* entry = sMapStore.LookupEntry(GetMapId());
|
||||
MapEntry const* entry = sMapStore.LookupEntry(GetMapId());
|
||||
if (!entry || entry->map_type == MAP_RAID || GetDifficulty() == DUNGEON_DIFFICULTY_HEROIC)
|
||||
return 0;
|
||||
else
|
||||
@@ -298,7 +300,7 @@ void InstanceSaveManager::LoadInstances()
|
||||
|
||||
void InstanceSaveManager::LoadResetTimes()
|
||||
{
|
||||
time_t now = time(NULL);
|
||||
time_t now = time(nullptr);
|
||||
time_t today = (now / DAY) * DAY;
|
||||
|
||||
// NOTE: Use DirectPExecute for tables that will be queried later
|
||||
@@ -457,6 +459,13 @@ time_t InstanceSaveManager::GetSubsequentResetTime(uint32 mapid, Difficulty diff
|
||||
return ((resetTime + MINUTE) / DAY * DAY) + period + diff;
|
||||
}
|
||||
|
||||
void InstanceSaveManager::SetResetTimeFor(uint32 mapid, Difficulty d, time_t t)
|
||||
{
|
||||
ResetTimeByMapDifficultyMap::iterator itr = m_resetTimeByMapDifficulty.find(MAKE_PAIR32(mapid, d));
|
||||
ASSERT(itr != m_resetTimeByMapDifficulty.end());
|
||||
itr->second = t;
|
||||
}
|
||||
|
||||
void InstanceSaveManager::ScheduleReset(bool add, time_t time, InstResetEvent event)
|
||||
{
|
||||
if (!add)
|
||||
@@ -507,7 +516,7 @@ void InstanceSaveManager::ForceGlobalReset(uint32 mapId, Difficulty difficulty)
|
||||
|
||||
void InstanceSaveManager::Update()
|
||||
{
|
||||
time_t now = time(NULL);
|
||||
time_t now = time(nullptr);
|
||||
time_t t;
|
||||
|
||||
while (!m_resetTimeQueue.empty())
|
||||
@@ -624,7 +633,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b
|
||||
return;
|
||||
TC_LOG_DEBUG("misc", "InstanceSaveManager::ResetOrWarnAll: Processing map %s (%u) on difficulty %u (warn? %u)", mapEntry->name, mapid, uint8(difficulty), warn);
|
||||
|
||||
time_t now = time(NULL);
|
||||
time_t now = time(nullptr);
|
||||
|
||||
if (!warn)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user