Core/Warden: Various cleanups and warning fixes
This commit is contained in:
@@ -96,8 +96,10 @@ m_playerRecentlyLogout(false), m_playerSave(false),
|
||||
m_sessionDbcLocale(sWorld->GetAvailableDbcLocale(locale)),
|
||||
m_sessionDbLocaleIndex(locale),
|
||||
m_latency(0), m_TutorialsChanged(false), recruiterId(recruiter),
|
||||
isRecruiter(isARecruiter), timeLastWhoCommand(0),_warden(NULL)
|
||||
isRecruiter(isARecruiter), timeLastWhoCommand(0)
|
||||
{
|
||||
_warden = NULL;
|
||||
|
||||
if (sock)
|
||||
{
|
||||
m_Address = sock->GetRemoteAddress();
|
||||
@@ -1123,13 +1125,13 @@ void WorldSession::InitWarden(BigNumber* k, std::string os)
|
||||
{
|
||||
if (os == "Win")
|
||||
{
|
||||
_warden = (Warden*)new WardenWin();
|
||||
_warden = new WardenWin();
|
||||
_warden->Init(this, k);
|
||||
}
|
||||
else if (os == "OSX")
|
||||
{
|
||||
// Disabled as it is causing the client to crash
|
||||
// _warden = (Warden*)new WardenMac();
|
||||
// _warden = new WardenMac();
|
||||
// _warden->Init(this, k);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,12 +42,12 @@ Warden::~Warden()
|
||||
_initialized = false;
|
||||
}
|
||||
|
||||
void Warden::Init(WorldSession* session, BigNumber* k)
|
||||
void Warden::Init(WorldSession* /*session*/, BigNumber* /*k*/)
|
||||
{
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
ClientWardenModule* Warden::GetModuleForClient(WorldSession* session)
|
||||
ClientWardenModule* Warden::GetModuleForClient()
|
||||
{
|
||||
ASSERT(false);
|
||||
return NULL;
|
||||
@@ -63,7 +63,7 @@ void Warden::RequestHash()
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
void Warden::HandleHashResult(ByteBuffer &buff)
|
||||
void Warden::HandleHashResult(ByteBuffer& /*buff*/)
|
||||
{
|
||||
ASSERT(false);
|
||||
}
|
||||
@@ -73,7 +73,7 @@ void Warden::RequestData()
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
void Warden::HandleData(ByteBuffer &buff)
|
||||
void Warden::HandleData(ByteBuffer& /*buff*/)
|
||||
{
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ struct ClientWardenModule
|
||||
uint8 Id[16];
|
||||
uint8 Key[16];
|
||||
uint32 CompressedSize;
|
||||
uint8 *CompressedData;
|
||||
uint8* CompressedData;
|
||||
};
|
||||
|
||||
class WorldSession;
|
||||
@@ -110,7 +110,7 @@ class Warden
|
||||
~Warden();
|
||||
|
||||
virtual void Init(WorldSession* session, BigNumber* k);
|
||||
virtual ClientWardenModule* GetModuleForClient(WorldSession* session);
|
||||
virtual ClientWardenModule* GetModuleForClient();
|
||||
virtual void InitializeModule();
|
||||
virtual void RequestHash();
|
||||
virtual void HandleHashResult(ByteBuffer &buff);
|
||||
@@ -130,17 +130,17 @@ class Warden
|
||||
std::string Penalty(WardenCheck* check = NULL);
|
||||
|
||||
private:
|
||||
WorldSession *_session;
|
||||
WorldSession* _session;
|
||||
uint8 _inputKey[16];
|
||||
uint8 _outputKey[16];
|
||||
uint8 _seed[16];
|
||||
ARC4 _inputCrypto;
|
||||
ARC4 _outputCrypto;
|
||||
uint32 _checkTimer; // Timer for sending check requests
|
||||
bool _dataSent;
|
||||
uint32 _clientResponseTimer; // Timer for client response delay
|
||||
bool _dataSent;
|
||||
uint32 _previousTimestamp;
|
||||
ClientWardenModule *_module;
|
||||
ClientWardenModule* _module;
|
||||
bool _initialized;
|
||||
};
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ WardenCheckMgr::WardenCheckMgr()
|
||||
|
||||
WardenCheckMgr::~WardenCheckMgr()
|
||||
{
|
||||
for (int i = 0; i < CheckStore.size(); ++i)
|
||||
for (uint16 i = 0; i < CheckStore.size(); ++i)
|
||||
delete CheckStore[i];
|
||||
|
||||
for (CheckResultContainer::iterator itr = CheckResultStore.begin(); itr != CheckResultStore.end(); ++itr)
|
||||
@@ -51,7 +51,7 @@ void WardenCheckMgr::LoadWardenChecks()
|
||||
}
|
||||
|
||||
// For reload case
|
||||
for (int i = 0; i < CheckStore.size(); ++i)
|
||||
for (uint16 i = 0; i < CheckStore.size(); ++i)
|
||||
delete CheckStore[i];
|
||||
|
||||
CheckStore.clear();
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "WardenMac.h"
|
||||
#include "WardenModuleMac.h"
|
||||
|
||||
WardenMac::WardenMac()
|
||||
WardenMac::WardenMac() : Warden()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -64,14 +64,14 @@ void WardenMac::Init(WorldSession *pClient, BigNumber *K)
|
||||
sLog->outDebug(LOG_FILTER_WARDEN, " Seed: %s", ByteArrayToHexStr(_seed, 16).c_str());
|
||||
sLog->outDebug(LOG_FILTER_WARDEN, "Loading Module...");
|
||||
|
||||
_module = GetModuleForClient(_session);
|
||||
_module = GetModuleForClient();
|
||||
|
||||
sLog->outDebug(LOG_FILTER_WARDEN, "Module Key: %s", ByteArrayToHexStr(_module->Key, 16).c_str());
|
||||
sLog->outDebug(LOG_FILTER_WARDEN, "Module ID: %s", ByteArrayToHexStr(_module->Id, 16).c_str());
|
||||
RequestModule();
|
||||
}
|
||||
|
||||
ClientWardenModule *WardenMac::GetModuleForClient(WorldSession *session)
|
||||
ClientWardenModule* WardenMac::GetModuleForClient()
|
||||
{
|
||||
ClientWardenModule *mod = new ClientWardenModule;
|
||||
|
||||
|
||||
@@ -28,14 +28,14 @@
|
||||
class WorldSession;
|
||||
class Warden;
|
||||
|
||||
class WardenMac : Warden
|
||||
class WardenMac : public Warden
|
||||
{
|
||||
public:
|
||||
WardenMac();
|
||||
~WardenMac();
|
||||
|
||||
void Init(WorldSession* session, BigNumber* k);
|
||||
ClientWardenModule* GetModuleForClient(WorldSession* session);
|
||||
ClientWardenModule* GetModuleForClient();
|
||||
void InitializeModule();
|
||||
void RequestHash();
|
||||
void HandleHashResult(ByteBuffer& buff);
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "WardenCheckMgr.h"
|
||||
#include "AccountMgr.h"
|
||||
|
||||
WardenWin::WardenWin()
|
||||
WardenWin::WardenWin() : Warden()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -68,14 +68,14 @@ void WardenWin::Init(WorldSession* session, BigNumber *k)
|
||||
sLog->outDebug(LOG_FILTER_WARDEN, " Seed: %s", ByteArrayToHexStr(_seed, 16).c_str());
|
||||
sLog->outDebug(LOG_FILTER_WARDEN, "Loading Module...");
|
||||
|
||||
_module = GetModuleForClient(_session);
|
||||
_module = GetModuleForClient();
|
||||
|
||||
sLog->outDebug(LOG_FILTER_WARDEN, "Module Key: %s", ByteArrayToHexStr(_module->Key, 16).c_str());
|
||||
sLog->outDebug(LOG_FILTER_WARDEN, "Module ID: %s", ByteArrayToHexStr(_module->Id, 16).c_str());
|
||||
RequestModule();
|
||||
}
|
||||
|
||||
ClientWardenModule *WardenWin::GetModuleForClient(WorldSession *session)
|
||||
ClientWardenModule* WardenWin::GetModuleForClient()
|
||||
{
|
||||
ClientWardenModule *mod = new ClientWardenModule;
|
||||
|
||||
@@ -339,7 +339,7 @@ void WardenWin::RequestData()
|
||||
for (std::list<uint16>::iterator itr = _currentChecks.begin(); itr != _currentChecks.end(); ++itr)
|
||||
stream << *itr << " ";
|
||||
|
||||
sLog->outWarden(stream.str().c_str());
|
||||
sLog->outWarden("%s", stream.str().c_str());
|
||||
}
|
||||
|
||||
void WardenWin::HandleData(ByteBuffer &buff)
|
||||
|
||||
@@ -70,14 +70,14 @@ struct WardenInitModuleRequest
|
||||
class WorldSession;
|
||||
class Warden;
|
||||
|
||||
class WardenWin : Warden
|
||||
class WardenWin : public Warden
|
||||
{
|
||||
public:
|
||||
WardenWin();
|
||||
~WardenWin();
|
||||
|
||||
void Init(WorldSession* session, BigNumber* K);
|
||||
ClientWardenModule* GetModuleForClient(WorldSession* session);
|
||||
ClientWardenModule* GetModuleForClient();
|
||||
void InitializeModule();
|
||||
void RequestHash();
|
||||
void HandleHashResult(ByteBuffer &buff);
|
||||
|
||||
Reference in New Issue
Block a user