Core/Warden: Base implementation for Warden functionality
Note: The default config file action for clients failing the checks can be changed for each check via the characters.warden_action table Credits to TOM_RUS
This commit is contained in:
1 parent
f0f68f15a8
commit
8e3a4b956e
34 files changed
+4568
-41
No files matched your search
@@ -42,6 +42,8 @@
|
||||
#include "zlib.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "Transport.h"
|
||||
#include "WardenWin.h"
|
||||
#include "WardenMac.h"
|
||||
|
||||
bool MapSessionFilter::Process(WorldPacket* packet)
|
||||
{
|
||||
@@ -94,7 +96,7 @@ 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)
|
||||
isRecruiter(isARecruiter), timeLastWhoCommand(0),_warden(NULL)
|
||||
{
|
||||
if (sock)
|
||||
{
|
||||
@@ -122,6 +124,9 @@ WorldSession::~WorldSession()
|
||||
m_Socket = NULL;
|
||||
}
|
||||
|
||||
if (_warden)
|
||||
delete _warden;
|
||||
|
||||
///- empty incoming packet queue
|
||||
WorldPacket* packet = NULL;
|
||||
while (_recvQueue.next(packet))
|
||||
@@ -142,6 +147,12 @@ char const* WorldSession::GetPlayerName() const
|
||||
return GetPlayer() ? GetPlayer()->GetName() : "<none>";
|
||||
}
|
||||
|
||||
/// Get player guid if available. Use for logging purposes only
|
||||
uint32 WorldSession::GetGuidLow() const
|
||||
{
|
||||
return GetPlayer() ? GetPlayer()->GetGUIDLow() : 0;
|
||||
}
|
||||
|
||||
/// Send a packet to the client
|
||||
void WorldSession::SendPacket(WorldPacket const* packet)
|
||||
{
|
||||
@@ -348,6 +359,9 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
|
||||
delete packet;
|
||||
}
|
||||
|
||||
if (m_Socket && !m_Socket->IsClosed() && _warden)
|
||||
_warden->Update();
|
||||
|
||||
ProcessQueryCallbacks();
|
||||
|
||||
//check if we are safe to proceed with logout
|
||||
@@ -359,6 +373,9 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
|
||||
if (ShouldLogOut(currTime) && !m_playerLoading)
|
||||
LogoutPlayer(true);
|
||||
|
||||
if (m_Socket && GetPlayer() && _warden)
|
||||
_warden->Update();
|
||||
|
||||
///- Cleanup socket pointer if need
|
||||
if (m_Socket && m_Socket->IsClosed())
|
||||
{
|
||||
@@ -1101,3 +1118,18 @@ void WorldSession::ProcessQueryCallbacks()
|
||||
_stableSwapCallback.FreeResult();
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::InitWarden(BigNumber* k, std::string os)
|
||||
{
|
||||
if (os == "Win")
|
||||
{
|
||||
_warden = (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->Init(this, k);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user