Core/Cleanup: Drop some unused code.

Closes #1010, #581, and #248
This commit is contained in:
laly
2011-03-26 03:28:59 +02:00
committed by Shocker
parent 30d6b0fcd6
commit b9af020e72
3 changed files with 9 additions and 23 deletions
@@ -805,11 +805,6 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
m_summon_y = 0.0f; m_summon_y = 0.0f;
m_summon_z = 0.0f; m_summon_z = 0.0f;
//Default movement to run mode
//m_unit_movement_flags = 0;
m_AreaID = 0;
m_mover = this; m_mover = this;
m_movedPlayer = this; m_movedPlayer = this;
m_seer = this; m_seer = this;
@@ -6770,11 +6765,6 @@ void Player::CheckAreaExploreAndOutdoor()
if (isInFlight()) if (isInFlight())
return; return;
if (!m_AreaID)
m_AreaID = GetAreaId();
if (m_AreaID != GetAreaId())
m_AreaID = GetAreaId();
bool isOutdoor; bool isOutdoor;
uint16 areaFlag = GetBaseMap()->GetAreaFlag(GetPositionX(),GetPositionY(),GetPositionZ(), &isOutdoor); uint16 areaFlag = GetBaseMap()->GetAreaFlag(GetPositionX(),GetPositionY(),GetPositionZ(), &isOutdoor);
-1
View File
@@ -2429,7 +2429,6 @@ class Player : public Unit, public GridObject<Player>
bool isDebugAreaTriggers; bool isDebugAreaTriggers;
protected: protected:
uint32 m_AreaID;
uint32 m_regenTimerCount; uint32 m_regenTimerCount;
float m_powerFraction[MAX_POWERS]; float m_powerFraction[MAX_POWERS];
uint32 m_contestedPvPTimer; uint32 m_contestedPvPTimer;
+9 -12
View File
@@ -83,7 +83,7 @@ public:
{ {
if (!_delaytime) if (!_delaytime)
return; return;
sLog->outString("Starting up anti-freeze thread (%u seconds max stuck time)...",_delaytime/1000); sLog->outString("Starting up anti-freeze thread (%u seconds max stuck time)...", _delaytime/1000);
m_loops = 0; m_loops = 0;
w_loops = 0; w_loops = 0;
m_lastchange = 0; m_lastchange = 0;
@@ -210,13 +210,13 @@ int Master::Run()
ULONG_PTR appAff; ULONG_PTR appAff;
ULONG_PTR sysAff; ULONG_PTR sysAff;
if (GetProcessAffinityMask(hProcess,&appAff,&sysAff)) if (GetProcessAffinityMask(hProcess, &appAff, &sysAff))
{ {
ULONG_PTR curAff = Aff & appAff; // remove non accessible processors ULONG_PTR curAff = Aff & appAff; // remove non accessible processors
if (!curAff) if (!curAff)
{ {
sLog->outError("Processors marked in UseProcessors bitmask (hex) %x not accessible for Trinityd. Accessible processors bitmask (hex): %x",Aff,appAff); sLog->outError("Processors marked in UseProcessors bitmask (hex) %x not accessible for Trinityd. Accessible processors bitmask (hex): %x", Aff, appAff);
} }
else else
{ {
@@ -234,7 +234,7 @@ int Master::Run()
//if (Prio && (m_ServiceStatus == -1) /* need set to default process priority class in service mode*/) //if (Prio && (m_ServiceStatus == -1) /* need set to default process priority class in service mode*/)
if (Prio) if (Prio)
{ {
if(SetPriorityClass(hProcess,HIGH_PRIORITY_CLASS)) if (SetPriorityClass(hProcess, HIGH_PRIORITY_CLASS))
sLog->outString("TrinityCore process priority class set to HIGH"); sLog->outString("TrinityCore process priority class set to HIGH");
else else
sLog->outError("Can't set Trinityd process priority class."); sLog->outError("Can't set Trinityd process priority class.");
@@ -252,9 +252,6 @@ int Master::Run()
soap_thread = new ACE_Based::Thread(runnable); soap_thread = new ACE_Based::Thread(runnable);
} }
uint32 realCurrTime, realPrevTime;
realCurrTime = realPrevTime = getMSTime();
///- Start up freeze catcher thread ///- Start up freeze catcher thread
if (uint32 freeze_delay = sConfig->GetIntDefault("MaxCoreStuckTime", 0)) if (uint32 freeze_delay = sConfig->GetIntDefault("MaxCoreStuckTime", 0))
{ {
@@ -270,7 +267,7 @@ int Master::Run()
if (sWorldSocketMgr->StartNetwork(wsport, bind_ip.c_str ()) == -1) if (sWorldSocketMgr->StartNetwork(wsport, bind_ip.c_str ()) == -1)
{ {
sLog->outError ("Failed to start network"); sLog->outError("Failed to start network");
World::StopNow(ERROR_EXIT_CODE); World::StopNow(ERROR_EXIT_CODE);
// go down and shutdown the server // go down and shutdown the server
} }
@@ -385,13 +382,13 @@ bool Master::_StartDB()
} }
synch_threads = sConfig->GetIntDefault("WorldDatabase.SynchThreads", 1); synch_threads = sConfig->GetIntDefault("WorldDatabase.SynchThreads", 1);
///- Initialise the world database ///- Initialise the world database
if (!WorldDatabase.Open(dbstring, async_threads, synch_threads)) if (!WorldDatabase.Open(dbstring, async_threads, synch_threads))
{ {
sLog->outError("Cannot connect to world database %s", dbstring.c_str()); sLog->outError("Cannot connect to world database %s", dbstring.c_str());
return false; return false;
} }
///- Get character database info from configuration file ///- Get character database info from configuration file
dbstring = sConfig->GetStringDefault("CharacterDatabaseInfo", ""); dbstring = sConfig->GetStringDefault("CharacterDatabaseInfo", "");
if (dbstring.empty()) if (dbstring.empty())
@@ -434,13 +431,13 @@ bool Master::_StartDB()
} }
synch_threads = sConfig->GetIntDefault("LoginDatabase.SynchThreads", 1); synch_threads = sConfig->GetIntDefault("LoginDatabase.SynchThreads", 1);
///- Initialise the login database ///- Initialise the login database
if (!LoginDatabase.Open(dbstring, async_threads, synch_threads)) if (!LoginDatabase.Open(dbstring, async_threads, synch_threads))
{ {
sLog->outError("Cannot connect to login database %s", dbstring.c_str()); sLog->outError("Cannot connect to login database %s", dbstring.c_str());
return false; return false;
} }
///- Get the realm Id from the configuration file ///- Get the realm Id from the configuration file
realmID = sConfig->GetIntDefault("RealmID", 0); realmID = sConfig->GetIntDefault("RealmID", 0);
if (!realmID) if (!realmID)
@@ -484,9 +481,9 @@ void Master::clearOnlineAccounts()
/// \todo Only accounts with characters logged on *this* realm should have online status reset. Move the online column from 'account' to 'realmcharacters'? /// \todo Only accounts with characters logged on *this* realm should have online status reset. Move the online column from 'account' to 'realmcharacters'?
LoginDatabase.DirectPExecute( LoginDatabase.DirectPExecute(
"UPDATE account SET online = 0 WHERE online > 0 " "UPDATE account SET online = 0 WHERE online > 0 "
"AND id IN (SELECT acctid FROM realmcharacters WHERE realmid = '%d')",realmID); "AND id IN (SELECT acctid FROM realmcharacters WHERE realmid = '%d')", realmID);
CharacterDatabase.DirectExecute("UPDATE characters SET online = 0 WHERE online<>0"); CharacterDatabase.DirectExecute("UPDATE characters SET online = 0 WHERE online <> 0");
// Battleground instance ids reset at server restart // Battleground instance ids reset at server restart
CharacterDatabase.DirectExecute("UPDATE character_battleground_data SET instance_id = 0"); CharacterDatabase.DirectExecute("UPDATE character_battleground_data SET instance_id = 0");