refactor(Core): code cleanup (part 3) (#6380)

This commit is contained in:
Francesco Borzì
2021-06-19 01:25:29 +02:00
committed by GitHub
parent 4d20442a1e
commit 23e9b85d0e
31 changed files with 34 additions and 65 deletions

View File

@@ -17,7 +17,6 @@
#include "World.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include <openssl/md5.h>
#include <openssl/sha.h>
Warden::Warden() : _session(nullptr), _checkTimer(10000/*10 sec*/), _clientResponseTimer(0),
@@ -281,7 +280,7 @@ bool Warden::ProcessLuaCheckResponse(std::string const& msg)
{
static constexpr char WARDEN_TOKEN[] = "_TW\t";
// if msg starts with WARDEN_TOKEN
if (!(msg.rfind(WARDEN_TOKEN, 0) == 0))
if (msg.rfind(WARDEN_TOKEN, 0) != 0)
{
return false;
}

View File

@@ -4,13 +4,11 @@
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*/
#include "Common.h"
#include "Database/DatabaseEnv.h"
#include "Log.h"
#include "Util.h"
#include "Warden.h"
#include "WardenCheckMgr.h"
#include "WorldPacket.h"
#include "WorldSession.h"
WardenCheckMgr::WardenCheckMgr()
@@ -128,9 +126,9 @@ void WardenCheckMgr::LoadWardenChecks()
continue;
}
std::string str = fmt::sprintf("%04u", id);
ASSERT(str.size() == 4);
std::copy(str.begin(), str.end(), wardenCheck.IdStr.begin());
std::string str2 = Acore::StringFormat("%04u", id);
ASSERT(str2.size() == 4);
std::copy(str2.begin(), str2.end(), wardenCheck.IdStr.begin());
CheckIdPool[WARDEN_CHECK_LUA_TYPE].push_back(id);
break;

View File

@@ -5,15 +5,12 @@
*/
#include "ByteBuffer.h"
#include "Common.h"
#include "Log.h"
#include "Opcodes.h"
#include "Player.h"
#include "SessionKeyGenerator.h"
#include "Util.h"
#include "WardenMac.h"
#include "WardenModuleMac.h"
#include "World.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include <openssl/md5.h>

View File

@@ -4,13 +4,10 @@
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*/
#include "AccountMgr.h"
#include "ByteBuffer.h"
#include "Common.h"
#include "CryptoRandom.h"
#include "Database/DatabaseEnv.h"
#include "HMAC.h"
#include "Log.h"
#include "Opcodes.h"
#include "Player.h"
#include "SessionKeyGenerator.h"