refactor(Core/Misc): acore to Acore (#6043)
This commit is contained in:
parent
7eeae6866e
commit
897a02bb75
224 changed files with 942 additions and 942 deletions
|
|
@ -98,7 +98,7 @@ def processFile(path, filename):
|
|||
output.write('#include "SmartEnum.h"\n')
|
||||
output.write('#include <stdexcept>\n')
|
||||
output.write('\n')
|
||||
output.write('namespace acore::Impl::EnumUtilsImpl\n')
|
||||
output.write('namespace Acore::Impl::EnumUtilsImpl\n')
|
||||
output.write('{\n')
|
||||
for name, prefix, values in enums:
|
||||
tag = ('data for enum \'%s\' in \'%s.h\' auto-generated' % (name, filename))
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ namespace boost::asio::ip
|
|||
typedef basic_endpoint<tcp> tcp_endpoint;
|
||||
}
|
||||
|
||||
namespace acore::Asio
|
||||
namespace Acore::Asio
|
||||
{
|
||||
class DeadlineTimer;
|
||||
class IoContext;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
#define DeadlineTimerBase boost::asio::basic_deadline_timer<boost::posix_time::ptime, boost::asio::time_traits<boost::posix_time::ptime> BasicDeadlineTimerThirdTemplateArg>
|
||||
|
||||
namespace acore::Asio
|
||||
namespace Acore::Asio
|
||||
{
|
||||
class DeadlineTimer : public DeadlineTimerBase
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
#define IoContextBase io_service
|
||||
#endif
|
||||
|
||||
namespace acore::Asio
|
||||
namespace Acore::Asio
|
||||
{
|
||||
class IoContext
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include "Define.h"
|
||||
#include <boost/asio/ip/address.hpp>
|
||||
|
||||
namespace acore::Net
|
||||
namespace Acore::Net
|
||||
{
|
||||
#if BOOST_VERSION >= 106600
|
||||
using boost::asio::ip::make_address;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
#include <boost/asio/ip/network_v6.hpp>
|
||||
#endif
|
||||
|
||||
namespace acore::Net
|
||||
namespace Acore::Net
|
||||
{
|
||||
inline bool IsInNetwork(boost::asio::ip::address_v4 const& networkAddress, boost::asio::ip::address_v4 const& mask, boost::asio::ip::address_v4 const& clientAddress)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include <boost/asio/ip/tcp.hpp>
|
||||
#include <string>
|
||||
|
||||
namespace acore::Asio
|
||||
namespace Acore::Asio
|
||||
{
|
||||
/**
|
||||
Hack to make it possible to forward declare resolver (one of its template arguments is a typedef to something super long and using nested classes)
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
#include <boost/asio/bind_executor.hpp>
|
||||
#endif
|
||||
|
||||
namespace acore::Asio
|
||||
namespace Acore::Asio
|
||||
{
|
||||
/**
|
||||
Hack to make it possible to forward declare strand (which is a inner class)
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@
|
|||
#include "GitRevision.h"
|
||||
#include "StringFormat.h"
|
||||
|
||||
void acore::Banner::Show(char const* applicationName, void(*log)(char const* text), void(*logExtraInfo)())
|
||||
void Acore::Banner::Show(char const* applicationName, void(*log)(char const* text), void(*logExtraInfo)())
|
||||
{
|
||||
log(acore::StringFormat("%s (%s)", GitRevision::GetFullVersion(), applicationName).c_str());
|
||||
log(Acore::StringFormat("%s (%s)", GitRevision::GetFullVersion(), applicationName).c_str());
|
||||
log("<Ctrl-C> to stop.\n");
|
||||
log(" █████╗ ███████╗███████╗██████╗ ██████╗ ████████╗██╗ ██╗");
|
||||
log(" ██╔══██╗╚══███╔╝██╔════╝██╔══██╗██╔═══██╗╚══██╔══╝██║ ██║");
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include "Define.h"
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
namespace Banner
|
||||
{
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ namespace MMAP
|
|||
}
|
||||
|
||||
// load and init dtNavMesh - read parameters from file
|
||||
std::string fileName = acore::StringFormat(MAP_FILE_NAME_FORMAT, sConfigMgr->GetOption<std::string>("DataDir", ".").c_str(), mapId);
|
||||
std::string fileName = Acore::StringFormat(MAP_FILE_NAME_FORMAT, sConfigMgr->GetOption<std::string>("DataDir", ".").c_str(), mapId);
|
||||
|
||||
FILE* file = fopen(fileName.c_str(), "rb");
|
||||
if (!file)
|
||||
|
|
@ -122,7 +122,7 @@ namespace MMAP
|
|||
}
|
||||
|
||||
// load this tile :: mmaps/MMMXXYY.mmtile
|
||||
std::string fileName = acore::StringFormat(TILE_FILE_NAME_FORMAT, sConfigMgr->GetOption<std::string>("DataDir", ".").c_str(), mapId, x, y);
|
||||
std::string fileName = Acore::StringFormat(TILE_FILE_NAME_FORMAT, sConfigMgr->GetOption<std::string>("DataDir", ".").c_str(), mapId, x, y);
|
||||
FILE* file = fopen(fileName.c_str(), "rb");
|
||||
if (!file)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ AC_COMMON_API void CleanStringForMysqlQuery(std::string& str);
|
|||
|
||||
#define MAX_QUERY_LEN 32*1024
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
template<class ArgumentType, class ResultType>
|
||||
struct unary_function
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ namespace
|
|||
template<typename Format, typename... Args>
|
||||
inline void PrintError(std::string_view filename, Format&& fmt, Args&& ... args)
|
||||
{
|
||||
std::string message = acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...);
|
||||
std::string message = Acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...);
|
||||
|
||||
if (IsAppConfig(filename))
|
||||
{
|
||||
|
|
@ -76,7 +76,7 @@ namespace
|
|||
|
||||
if (in.fail())
|
||||
{
|
||||
throw ConfigException(acore::StringFormat("Config::LoadFile: Failed open file '%s'", file.c_str()));
|
||||
throw ConfigException(Acore::StringFormat("Config::LoadFile: Failed open file '%s'", file.c_str()));
|
||||
}
|
||||
|
||||
uint32 count = 0;
|
||||
|
|
@ -104,11 +104,11 @@ namespace
|
|||
// read line error
|
||||
if (!in.good() && !in.eof())
|
||||
{
|
||||
throw ConfigException(acore::StringFormat("> Config::LoadFile: Failure to read line number %u in file '%s'", lineNumber, file.c_str()));
|
||||
throw ConfigException(Acore::StringFormat("> Config::LoadFile: Failure to read line number %u in file '%s'", lineNumber, file.c_str()));
|
||||
}
|
||||
|
||||
// remove whitespace in line
|
||||
line = acore::String::Trim(line, in.getloc());
|
||||
line = Acore::String::Trim(line, in.getloc());
|
||||
|
||||
if (line.empty())
|
||||
{
|
||||
|
|
@ -135,8 +135,8 @@ namespace
|
|||
continue;
|
||||
}
|
||||
|
||||
auto entry = acore::String::Trim(line.substr(0, equal_pos), in.getloc());
|
||||
auto value = acore::String::Trim(line.substr(equal_pos + 1, std::string::npos), in.getloc());
|
||||
auto entry = Acore::String::Trim(line.substr(0, equal_pos), in.getloc());
|
||||
auto value = Acore::String::Trim(line.substr(equal_pos + 1, std::string::npos), in.getloc());
|
||||
|
||||
value.erase(std::remove(value.begin(), value.end(), '"'), value.end());
|
||||
|
||||
|
|
@ -153,7 +153,7 @@ namespace
|
|||
|
||||
// No lines read
|
||||
if (!count)
|
||||
throw ConfigException(acore::StringFormat("Config::LoadFile: Empty file '%s'", file.c_str()));
|
||||
throw ConfigException(Acore::StringFormat("Config::LoadFile: Empty file '%s'", file.c_str()));
|
||||
|
||||
// Add correct keys if file load without errors
|
||||
for (auto const& [entry, key] : fileConfigs)
|
||||
|
|
@ -214,19 +214,19 @@ T ConfigMgr::GetValueDefault(std::string const& name, T const& def, bool showLog
|
|||
if (showLogs)
|
||||
{
|
||||
LOG_ERROR("server", "> Config: Missing name %s in config, add \"%s = %s\"",
|
||||
name.c_str(), name.c_str(), acore::ToString(def).c_str());
|
||||
name.c_str(), name.c_str(), Acore::ToString(def).c_str());
|
||||
}
|
||||
|
||||
return def;
|
||||
}
|
||||
|
||||
auto value = acore::StringTo<T>(itr->second);
|
||||
auto value = Acore::StringTo<T>(itr->second);
|
||||
if (!value)
|
||||
{
|
||||
if (showLogs)
|
||||
{
|
||||
LOG_ERROR("server", "> Config: Bad value defined for name '%s', going to use '%s' instead",
|
||||
name.c_str(), acore::ToString(def).c_str());
|
||||
name.c_str(), Acore::ToString(def).c_str());
|
||||
}
|
||||
|
||||
return def;
|
||||
|
|
@ -264,7 +264,7 @@ bool ConfigMgr::GetOption<bool>(std::string const& name, bool const& def, bool s
|
|||
{
|
||||
std::string val = GetValueDefault(name, std::string(def ? "1" : "0"), showLogs);
|
||||
|
||||
auto boolVal = acore::StringTo<bool>(val);
|
||||
auto boolVal = Acore::StringTo<bool>(val);
|
||||
if (!boolVal)
|
||||
{
|
||||
if (showLogs)
|
||||
|
|
|
|||
|
|
@ -7,25 +7,25 @@
|
|||
#include "Errors.h"
|
||||
#include <limits>
|
||||
|
||||
acore::Crypto::AES::AES(bool encrypting) : _ctx(EVP_CIPHER_CTX_new()), _encrypting(encrypting)
|
||||
Acore::Crypto::AES::AES(bool encrypting) : _ctx(EVP_CIPHER_CTX_new()), _encrypting(encrypting)
|
||||
{
|
||||
EVP_CIPHER_CTX_init(_ctx);
|
||||
int status = EVP_CipherInit_ex(_ctx, EVP_aes_128_gcm(), nullptr, nullptr, nullptr, _encrypting ? 1 : 0);
|
||||
ASSERT(status);
|
||||
}
|
||||
|
||||
acore::Crypto::AES::~AES()
|
||||
Acore::Crypto::AES::~AES()
|
||||
{
|
||||
EVP_CIPHER_CTX_free(_ctx);
|
||||
}
|
||||
|
||||
void acore::Crypto::AES::Init(Key const& key)
|
||||
void Acore::Crypto::AES::Init(Key const& key)
|
||||
{
|
||||
int status = EVP_CipherInit_ex(_ctx, nullptr, nullptr, key.data(), nullptr, -1);
|
||||
ASSERT(status);
|
||||
}
|
||||
|
||||
bool acore::Crypto::AES::Process(IV const& iv, uint8* data, size_t length, Tag& tag)
|
||||
bool Acore::Crypto::AES::Process(IV const& iv, uint8* data, size_t length, Tag& tag)
|
||||
{
|
||||
ASSERT(length <= static_cast<size_t>(std::numeric_limits<int>::max()));
|
||||
int len = static_cast<int>(length);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#include <array>
|
||||
#include <openssl/evp.h>
|
||||
|
||||
namespace acore::Crypto
|
||||
namespace Acore::Crypto
|
||||
{
|
||||
class AC_COMMON_API AES
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include "ARC4.h"
|
||||
#include "Errors.h"
|
||||
|
||||
acore::Crypto::ARC4::ARC4()
|
||||
Acore::Crypto::ARC4::ARC4()
|
||||
: _ctx(EVP_CIPHER_CTX_new())
|
||||
{
|
||||
EVP_CIPHER_CTX_init(_ctx);
|
||||
|
|
@ -15,12 +15,12 @@ acore::Crypto::ARC4::ARC4()
|
|||
ASSERT(result == 1);
|
||||
}
|
||||
|
||||
acore::Crypto::ARC4::~ARC4()
|
||||
Acore::Crypto::ARC4::~ARC4()
|
||||
{
|
||||
EVP_CIPHER_CTX_free(_ctx);
|
||||
}
|
||||
|
||||
void acore::Crypto::ARC4::Init(uint8 const* seed, size_t len)
|
||||
void Acore::Crypto::ARC4::Init(uint8 const* seed, size_t len)
|
||||
{
|
||||
int result1 = EVP_CIPHER_CTX_set_key_length(_ctx, len);
|
||||
ASSERT(result1 == 1);
|
||||
|
|
@ -28,7 +28,7 @@ void acore::Crypto::ARC4::Init(uint8 const* seed, size_t len)
|
|||
ASSERT(result2 == 1);
|
||||
}
|
||||
|
||||
void acore::Crypto::ARC4::UpdateData(uint8* data, size_t len)
|
||||
void Acore::Crypto::ARC4::UpdateData(uint8* data, size_t len)
|
||||
{
|
||||
int outlen = 0;
|
||||
int result1 = EVP_EncryptUpdate(_ctx, data, &outlen, data, len);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include <array>
|
||||
#include <openssl/evp.h>
|
||||
|
||||
namespace acore::Crypto
|
||||
namespace Acore::Crypto
|
||||
{
|
||||
class ARC4
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include "Argon2.h"
|
||||
#include <argon2/argon2.h>
|
||||
|
||||
/*static*/ Optional<std::string> acore::Crypto::Argon2::Hash(std::string const& password, BigNumber const& salt, uint32 nIterations, uint32 kibMemoryCost)
|
||||
/*static*/ Optional<std::string> Acore::Crypto::Argon2::Hash(std::string const& password, BigNumber const& salt, uint32 nIterations, uint32 kibMemoryCost)
|
||||
{
|
||||
char buf[ENCODED_HASH_LEN];
|
||||
std::vector<uint8> saltBytes = salt.ToByteVector();
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
return {};
|
||||
}
|
||||
|
||||
/*static*/ bool acore::Crypto::Argon2::Verify(std::string const& password, std::string const& hash)
|
||||
/*static*/ bool Acore::Crypto::Argon2::Verify(std::string const& password, std::string const& hash)
|
||||
{
|
||||
int status = argon2id_verify(hash.c_str(), password.c_str(), password.length());
|
||||
return (status == ARGON2_OK);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include "Optional.h"
|
||||
#include <string>
|
||||
|
||||
namespace acore::Crypto
|
||||
namespace Acore::Crypto
|
||||
{
|
||||
struct AC_COMMON_API Argon2
|
||||
{
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@ AuthCrypt::AuthCrypt() : _initialized(false)
|
|||
void AuthCrypt::Init(SessionKey const& K)
|
||||
{
|
||||
uint8 ServerEncryptionKey[] = { 0xCC, 0x98, 0xAE, 0x04, 0xE8, 0x97, 0xEA, 0xCA, 0x12, 0xDD, 0xC0, 0x93, 0x42, 0x91, 0x53, 0x57 };
|
||||
_serverEncrypt.Init(acore::Crypto::HMAC_SHA1::GetDigestOf(ServerEncryptionKey, K));
|
||||
_serverEncrypt.Init(Acore::Crypto::HMAC_SHA1::GetDigestOf(ServerEncryptionKey, K));
|
||||
uint8 ServerDecryptionKey[] = { 0xC2, 0xB3, 0x72, 0x3C, 0xC6, 0xAE, 0xD9, 0xB5, 0x34, 0x3C, 0x53, 0xEE, 0x2F, 0x43, 0x67, 0xCE };
|
||||
_clientDecrypt.Init(acore::Crypto::HMAC_SHA1::GetDigestOf(ServerDecryptionKey, K));
|
||||
_clientDecrypt.Init(Acore::Crypto::HMAC_SHA1::GetDigestOf(ServerDecryptionKey, K));
|
||||
|
||||
// Drop first 1024 bytes, as WoW uses ARC4-drop1024.
|
||||
std::array<uint8, 1024> syncBuf;
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ public:
|
|||
bool IsInitialized() const { return _initialized; }
|
||||
|
||||
private:
|
||||
acore::Crypto::ARC4 _clientDecrypt;
|
||||
acore::Crypto::ARC4 _serverEncrypt;
|
||||
Acore::Crypto::ARC4 _clientDecrypt;
|
||||
Acore::Crypto::ARC4 _serverEncrypt;
|
||||
bool _initialized;
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@
|
|||
#include <algorithm>
|
||||
#include <functional>
|
||||
|
||||
using SHA1 = acore::Crypto::SHA1;
|
||||
using SRP6 = acore::Crypto::SRP6;
|
||||
using SHA1 = Acore::Crypto::SHA1;
|
||||
using SRP6 = Acore::Crypto::SRP6;
|
||||
|
||||
/*static*/ std::array<uint8, 1> const SRP6::g = { 7 };
|
||||
/*static*/ std::array<uint8, 32> const SRP6::N = HexStrToByteArray<32>("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7", true);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#include <array>
|
||||
#include <optional>
|
||||
|
||||
namespace acore::Crypto
|
||||
namespace Acore::Crypto
|
||||
{
|
||||
class SRP6
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include "Define.h"
|
||||
|
||||
namespace acore::Crypto
|
||||
namespace Acore::Crypto
|
||||
{
|
||||
struct Constants
|
||||
{
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
#include <iterator>
|
||||
#include <vector>
|
||||
|
||||
namespace acore::Impl
|
||||
namespace Acore::Impl
|
||||
{
|
||||
struct CryptoGenericsImpl
|
||||
{
|
||||
|
|
@ -21,7 +21,7 @@ namespace acore::Impl
|
|||
static typename Cipher::IV GenerateRandomIV()
|
||||
{
|
||||
typename Cipher::IV iv;
|
||||
acore::Crypto::GetRandomBytes(iv);
|
||||
Acore::Crypto::GetRandomBytes(iv);
|
||||
return iv;
|
||||
}
|
||||
|
||||
|
|
@ -44,7 +44,7 @@ namespace acore::Impl
|
|||
};
|
||||
}
|
||||
|
||||
namespace acore::Crypto
|
||||
namespace Acore::Crypto
|
||||
{
|
||||
template <typename Cipher>
|
||||
void AEEncryptWithRandomIV(std::vector<uint8>& data, typename Cipher::Key const& key)
|
||||
|
|
@ -52,7 +52,7 @@ namespace acore::Crypto
|
|||
using IV = typename Cipher::IV;
|
||||
using Tag = typename Cipher::Tag;
|
||||
// select random IV
|
||||
IV iv = acore::Impl::CryptoGenericsImpl::GenerateRandomIV<Cipher>();
|
||||
IV iv = Acore::Impl::CryptoGenericsImpl::GenerateRandomIV<Cipher>();
|
||||
Tag tag;
|
||||
|
||||
// encrypt data
|
||||
|
|
@ -62,8 +62,8 @@ namespace acore::Crypto
|
|||
ASSERT(success);
|
||||
|
||||
// append trailing IV and tag
|
||||
acore::Impl::CryptoGenericsImpl::AppendToBack(data, iv);
|
||||
acore::Impl::CryptoGenericsImpl::AppendToBack(data, tag);
|
||||
Acore::Impl::CryptoGenericsImpl::AppendToBack(data, iv);
|
||||
Acore::Impl::CryptoGenericsImpl::AppendToBack(data, tag);
|
||||
}
|
||||
|
||||
template <typename Cipher>
|
||||
|
|
@ -80,8 +80,8 @@ namespace acore::Crypto
|
|||
// extract trailing IV and tag
|
||||
IV iv;
|
||||
Tag tag;
|
||||
acore::Impl::CryptoGenericsImpl::SplitFromBack(data, tag);
|
||||
acore::Impl::CryptoGenericsImpl::SplitFromBack(data, iv);
|
||||
Acore::Impl::CryptoGenericsImpl::SplitFromBack(data, tag);
|
||||
Acore::Impl::CryptoGenericsImpl::SplitFromBack(data, iv);
|
||||
|
||||
// decrypt data
|
||||
Cipher cipher(false);
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
class BigNumber;
|
||||
|
||||
namespace acore::Impl
|
||||
namespace Acore::Impl
|
||||
{
|
||||
struct GenericHashImpl
|
||||
{
|
||||
|
|
@ -98,10 +98,10 @@ namespace acore::Impl
|
|||
};
|
||||
}
|
||||
|
||||
namespace acore::Crypto
|
||||
namespace Acore::Crypto
|
||||
{
|
||||
using SHA1 = acore::Impl::GenericHash<EVP_sha1, Constants::SHA1_DIGEST_LENGTH_BYTES>;
|
||||
using SHA256 = acore::Impl::GenericHash<EVP_sha256, Constants::SHA256_DIGEST_LENGTH_BYTES>;
|
||||
using SHA1 = Acore::Impl::GenericHash<EVP_sha1, Constants::SHA1_DIGEST_LENGTH_BYTES>;
|
||||
using SHA256 = Acore::Impl::GenericHash<EVP_sha256, Constants::SHA256_DIGEST_LENGTH_BYTES>;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include "Errors.h"
|
||||
#include <openssl/rand.h>
|
||||
|
||||
void acore::Crypto::GetRandomBytes(uint8* buf, size_t len)
|
||||
void Acore::Crypto::GetRandomBytes(uint8* buf, size_t len)
|
||||
{
|
||||
int result = RAND_bytes(buf, len);
|
||||
ASSERT(result == 1);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include "Define.h"
|
||||
#include <array>
|
||||
|
||||
namespace acore::Crypto
|
||||
namespace Acore::Crypto
|
||||
{
|
||||
void GetRandomBytes(uint8* buf, size_t len);
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
class BigNumber;
|
||||
|
||||
namespace acore::Impl
|
||||
namespace Acore::Impl
|
||||
{
|
||||
struct HMACImpl
|
||||
{
|
||||
|
|
@ -110,9 +110,9 @@ namespace acore::Impl
|
|||
};
|
||||
}
|
||||
|
||||
namespace acore::Crypto
|
||||
namespace Acore::Crypto
|
||||
{
|
||||
using HMAC_SHA1 = acore::Impl::GenericHMAC<EVP_sha1, Constants::SHA1_DIGEST_LENGTH_BYTES>;
|
||||
using HMAC_SHA256 = acore::Impl::GenericHMAC<EVP_sha256, Constants::SHA256_DIGEST_LENGTH_BYTES>;
|
||||
using HMAC_SHA1 = Acore::Impl::GenericHMAC<EVP_sha1, Constants::SHA1_DIGEST_LENGTH_BYTES>;
|
||||
using HMAC_SHA256 = Acore::Impl::GenericHMAC<EVP_sha256, Constants::SHA256_DIGEST_LENGTH_BYTES>;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@
|
|||
#include <openssl/evp.h>
|
||||
#include <openssl/hmac.h>
|
||||
|
||||
constexpr std::size_t acore::Crypto::TOTP::RECOMMENDED_SECRET_LENGTH;
|
||||
constexpr std::size_t Acore::Crypto::TOTP::RECOMMENDED_SECRET_LENGTH;
|
||||
static constexpr uint32 TOTP_INTERVAL = 30;
|
||||
static constexpr uint32 HMAC_RESULT_SIZE = 20;
|
||||
|
||||
/*static*/ uint32 acore::Crypto::TOTP::GenerateToken(Secret const& secret, time_t timestamp)
|
||||
/*static*/ uint32 Acore::Crypto::TOTP::GenerateToken(Secret const& secret, time_t timestamp)
|
||||
{
|
||||
timestamp /= TOTP_INTERVAL;
|
||||
unsigned char challenge[8];
|
||||
|
|
@ -31,7 +31,7 @@ static constexpr uint32 HMAC_RESULT_SIZE = 20;
|
|||
return (truncated % 1000000);
|
||||
}
|
||||
|
||||
/*static*/ bool acore::Crypto::TOTP::ValidateToken(Secret const& secret, uint32 token)
|
||||
/*static*/ bool Acore::Crypto::TOTP::ValidateToken(Secret const& secret, uint32 token)
|
||||
{
|
||||
time_t now = time(nullptr);
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#include <ctime>
|
||||
#include <vector>
|
||||
|
||||
namespace acore::Crypto
|
||||
namespace Acore::Crypto
|
||||
{
|
||||
struct AC_COMMON_API TOTP
|
||||
{
|
||||
|
|
|
|||
|
|
@ -54,11 +54,11 @@ namespace
|
|||
}
|
||||
}
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
void Assert(char const* file, int line, char const* function, std::string const& debugInfo, char const* message)
|
||||
{
|
||||
std::string formattedMessage = acore::StringFormat("\n%s:%i in %s ASSERTION FAILED:\n %s\n", file, line, function, message) + debugInfo + '\n';
|
||||
std::string formattedMessage = Acore::StringFormat("\n%s:%i in %s ASSERTION FAILED:\n %s\n", file, line, function, message) + debugInfo + '\n';
|
||||
fprintf(stderr, "%s", formattedMessage.c_str());
|
||||
fflush(stderr);
|
||||
Crash(formattedMessage.c_str());
|
||||
|
|
@ -69,7 +69,7 @@ namespace acore
|
|||
va_list args;
|
||||
va_start(args, format);
|
||||
|
||||
std::string formattedMessage = acore::StringFormat("\n%s:%i in %s ASSERTION FAILED:\n %s\n", file, line, function, message) + FormatAssertionMessage(format, args) + '\n' + debugInfo + '\n';
|
||||
std::string formattedMessage = Acore::StringFormat("\n%s:%i in %s ASSERTION FAILED:\n %s\n", file, line, function, message) + FormatAssertionMessage(format, args) + '\n' + debugInfo + '\n';
|
||||
va_end(args);
|
||||
|
||||
fprintf(stderr, "%s", formattedMessage.c_str());
|
||||
|
|
@ -83,7 +83,7 @@ namespace acore
|
|||
va_list args;
|
||||
va_start(args, message);
|
||||
|
||||
std::string formattedMessage = acore::StringFormat("\n%s:%i in %s FATAL ERROR:\n", file, line, function) + FormatAssertionMessage(message, args) + '\n';
|
||||
std::string formattedMessage = Acore::StringFormat("\n%s:%i in %s FATAL ERROR:\n", file, line, function) + FormatAssertionMessage(message, args) + '\n';
|
||||
va_end(args);
|
||||
|
||||
fprintf(stderr, "%s", formattedMessage.c_str());
|
||||
|
|
@ -95,7 +95,7 @@ namespace acore
|
|||
|
||||
void Error(char const* file, int line, char const* function, char const* message)
|
||||
{
|
||||
std::string formattedMessage = acore::StringFormat("\n%s:%i in %s ERROR:\n %s\n", file, line, function, message);
|
||||
std::string formattedMessage = Acore::StringFormat("\n%s:%i in %s ERROR:\n %s\n", file, line, function, message);
|
||||
fprintf(stderr, "%s", formattedMessage.c_str());
|
||||
fflush(stderr);
|
||||
Crash(formattedMessage.c_str());
|
||||
|
|
@ -109,7 +109,7 @@ namespace acore
|
|||
|
||||
void Abort(char const* file, int line, char const* function)
|
||||
{
|
||||
std::string formattedMessage = acore::StringFormat("\n%s:%i in %s ABORTED.\n", file, line, function);
|
||||
std::string formattedMessage = Acore::StringFormat("\n%s:%i in %s ABORTED.\n", file, line, function);
|
||||
fprintf(stderr, "%s", formattedMessage.c_str());
|
||||
fflush(stderr);
|
||||
Crash(formattedMessage.c_str());
|
||||
|
|
@ -132,13 +132,13 @@ namespace acore
|
|||
void AbortHandler(int sigval)
|
||||
{
|
||||
// nothing useful to log here, no way to pass args
|
||||
std::string formattedMessage = acore::StringFormat("Caught signal %i\n", sigval);
|
||||
std::string formattedMessage = Acore::StringFormat("Caught signal %i\n", sigval);
|
||||
fprintf(stderr, "%s", formattedMessage.c_str());
|
||||
fflush(stderr);
|
||||
Crash(formattedMessage.c_str());
|
||||
}
|
||||
|
||||
} // namespace acore
|
||||
} // namespace Acore
|
||||
|
||||
std::string GetDebugInfo()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#include "Define.h"
|
||||
#include <string>
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
DECLSPEC_NORETURN void Assert(char const* file, int line, char const* function, std::string const& debugInfo, char const* message) ATTR_NORETURN;
|
||||
DECLSPEC_NORETURN void Assert(char const* file, int line, char const* function, std::string const& debugInfo, char const* message, char const* format, ...) ATTR_NORETURN ATTR_PRINTF(6, 7);
|
||||
|
|
@ -27,7 +27,7 @@ namespace acore
|
|||
|
||||
DECLSPEC_NORETURN void AbortHandler(int sigval) ATTR_NORETURN;
|
||||
|
||||
} // namespace acore
|
||||
} // namespace Acore
|
||||
|
||||
std::string GetDebugInfo();
|
||||
|
||||
|
|
@ -43,13 +43,13 @@ std::string GetDebugInfo();
|
|||
#define EXCEPTION_ASSERTION_FAILURE 0xC0000420L
|
||||
#endif
|
||||
|
||||
#define WPAssert(cond, ...) ASSERT_BEGIN do { if (!(cond)) acore::Assert(__FILE__, __LINE__, __FUNCTION__, GetDebugInfo(), #cond, ##__VA_ARGS__); } while(0) ASSERT_END
|
||||
#define WPAssert_NODEBUGINFO(cond, ...) ASSERT_BEGIN do { if (!(cond)) acore::Assert(__FILE__, __LINE__, __FUNCTION__, "", #cond, ##__VA_ARGS__); } while(0) ASSERT_END
|
||||
#define WPFatal(cond, ...) ASSERT_BEGIN do { if (!(cond)) acore::Fatal(__FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__); } while(0) ASSERT_END
|
||||
#define WPError(cond, msg) ASSERT_BEGIN do { if (!(cond)) acore::Error(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END
|
||||
#define WPWarning(cond, msg) ASSERT_BEGIN do { if (!(cond)) acore::Warning(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END
|
||||
#define WPAbort() ASSERT_BEGIN do { acore::Abort(__FILE__, __LINE__, __FUNCTION__); } while(0) ASSERT_END
|
||||
#define WPAbort_MSG(msg, ...) ASSERT_BEGIN do { acore::Abort(__FILE__, __LINE__, __FUNCTION__, (msg), ##__VA_ARGS__); } while(0) ASSERT_END
|
||||
#define WPAssert(cond, ...) ASSERT_BEGIN do { if (!(cond)) Acore::Assert(__FILE__, __LINE__, __FUNCTION__, GetDebugInfo(), #cond, ##__VA_ARGS__); } while(0) ASSERT_END
|
||||
#define WPAssert_NODEBUGINFO(cond, ...) ASSERT_BEGIN do { if (!(cond)) Acore::Assert(__FILE__, __LINE__, __FUNCTION__, "", #cond, ##__VA_ARGS__); } while(0) ASSERT_END
|
||||
#define WPFatal(cond, ...) ASSERT_BEGIN do { if (!(cond)) Acore::Fatal(__FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__); } while(0) ASSERT_END
|
||||
#define WPError(cond, msg) ASSERT_BEGIN do { if (!(cond)) Acore::Error(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END
|
||||
#define WPWarning(cond, msg) ASSERT_BEGIN do { if (!(cond)) Acore::Warning(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END
|
||||
#define WPAbort() ASSERT_BEGIN do { Acore::Abort(__FILE__, __LINE__, __FUNCTION__); } while(0) ASSERT_END
|
||||
#define WPAbort_MSG(msg, ...) ASSERT_BEGIN do { Acore::Abort(__FILE__, __LINE__, __FUNCTION__, (msg), ##__VA_ARGS__); } while(0) ASSERT_END
|
||||
|
||||
#ifdef PERFORMANCE_PROFILING
|
||||
#define ASSERT(cond, ...) ((void)0)
|
||||
|
|
|
|||
|
|
@ -91,13 +91,13 @@ template<class OBJECT_TYPES>
|
|||
class TypeMapContainer
|
||||
{
|
||||
public:
|
||||
template<class SPECIFIC_TYPE> [[nodiscard]] size_t Count() const { return acore::Count(i_elements, (SPECIFIC_TYPE*)nullptr); }
|
||||
template<class SPECIFIC_TYPE> [[nodiscard]] size_t Count() const { return Acore::Count(i_elements, (SPECIFIC_TYPE*)nullptr); }
|
||||
|
||||
/// inserts a specific object into the container
|
||||
template<class SPECIFIC_TYPE>
|
||||
bool insert(SPECIFIC_TYPE* obj)
|
||||
{
|
||||
SPECIFIC_TYPE* t = acore::Insert(i_elements, obj);
|
||||
SPECIFIC_TYPE* t = Acore::Insert(i_elements, obj);
|
||||
return (t != nullptr);
|
||||
}
|
||||
|
||||
|
|
@ -105,7 +105,7 @@ public:
|
|||
//template<class SPECIFIC_TYPE>
|
||||
// bool remove(SPECIFIC_TYPE* obj)
|
||||
//{
|
||||
// SPECIFIC_TYPE* t = acore::Remove(i_elements, obj);
|
||||
// SPECIFIC_TYPE* t = Acore::Remove(i_elements, obj);
|
||||
// return (t != nullptr);
|
||||
//}
|
||||
|
||||
|
|
@ -123,19 +123,19 @@ public:
|
|||
template<class SPECIFIC_TYPE>
|
||||
bool Insert(KEY_TYPE const& handle, SPECIFIC_TYPE* obj)
|
||||
{
|
||||
return acore::Insert(_elements, handle, obj);
|
||||
return Acore::Insert(_elements, handle, obj);
|
||||
}
|
||||
|
||||
template<class SPECIFIC_TYPE>
|
||||
bool Remove(KEY_TYPE const& handle)
|
||||
{
|
||||
return acore::Remove(_elements, handle, (SPECIFIC_TYPE*)nullptr);
|
||||
return Acore::Remove(_elements, handle, (SPECIFIC_TYPE*)nullptr);
|
||||
}
|
||||
|
||||
template<class SPECIFIC_TYPE>
|
||||
SPECIFIC_TYPE* Find(KEY_TYPE const& handle)
|
||||
{
|
||||
return acore::Find(_elements, handle, (SPECIFIC_TYPE*)nullptr);
|
||||
return Acore::Find(_elements, handle, (SPECIFIC_TYPE*)nullptr);
|
||||
}
|
||||
|
||||
ContainerUnorderedMap<OBJECT_TYPES, KEY_TYPE>& GetElements() { return _elements; }
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
#include <map>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
// Helpers
|
||||
// Insert helpers
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
#include "Utilities/TypeList.h"
|
||||
#include <map>
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
/* ContainerMapList Helpers */
|
||||
// count functions
|
||||
|
|
|
|||
|
|
@ -32,12 +32,12 @@ struct B32Impl
|
|||
}
|
||||
};
|
||||
|
||||
/*static*/ std::string acore::Encoding::Base32::Encode(std::vector<uint8> const& data)
|
||||
/*static*/ std::string Acore::Encoding::Base32::Encode(std::vector<uint8> const& data)
|
||||
{
|
||||
return acore::Impl::GenericBaseEncoding<B32Impl>::Encode(data);
|
||||
return Acore::Impl::GenericBaseEncoding<B32Impl>::Encode(data);
|
||||
}
|
||||
|
||||
/*static*/ Optional<std::vector<uint8>> acore::Encoding::Base32::Decode(std::string const& data)
|
||||
/*static*/ Optional<std::vector<uint8>> Acore::Encoding::Base32::Decode(std::string const& data)
|
||||
{
|
||||
return acore::Impl::GenericBaseEncoding<B32Impl>::Decode(data);
|
||||
return Acore::Impl::GenericBaseEncoding<B32Impl>::Decode(data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace acore::Encoding
|
||||
namespace Acore::Encoding
|
||||
{
|
||||
struct AC_COMMON_API Base32
|
||||
{
|
||||
|
|
|
|||
|
|
@ -34,12 +34,12 @@ struct B64Impl
|
|||
}
|
||||
};
|
||||
|
||||
/*static*/ std::string acore::Encoding::Base64::Encode(std::vector<uint8> const& data)
|
||||
/*static*/ std::string Acore::Encoding::Base64::Encode(std::vector<uint8> const& data)
|
||||
{
|
||||
return acore::Impl::GenericBaseEncoding<B64Impl>::Encode(data);
|
||||
return Acore::Impl::GenericBaseEncoding<B64Impl>::Encode(data);
|
||||
}
|
||||
|
||||
/*static*/ Optional<std::vector<uint8>> acore::Encoding::Base64::Decode(std::string const& data)
|
||||
/*static*/ Optional<std::vector<uint8>> Acore::Encoding::Base64::Decode(std::string const& data)
|
||||
{
|
||||
return acore::Impl::GenericBaseEncoding<B64Impl>::Decode(data);
|
||||
return Acore::Impl::GenericBaseEncoding<B64Impl>::Decode(data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace acore::Encoding
|
||||
namespace Acore::Encoding
|
||||
{
|
||||
struct AC_COMMON_API Base64
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace acore::Impl
|
||||
namespace Acore::Impl
|
||||
{
|
||||
template <typename Encoding>
|
||||
struct GenericBaseEncoding
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ void Appender::write(LogMessage* message)
|
|||
ss << message->getTimeStr() << ' ';
|
||||
|
||||
if (flags & APPENDER_FLAGS_PREFIX_LOGLEVEL)
|
||||
ss << acore::StringFormat("%-5s ", Appender::getLogLevelString(message->level));
|
||||
ss << Acore::StringFormat("%-5s ", Appender::getLogLevelString(message->level));
|
||||
|
||||
if (flags & APPENDER_FLAGS_PREFIX_LOGFILTERTYPE)
|
||||
ss << '[' << message->type << "] ";
|
||||
|
|
|
|||
|
|
@ -34,20 +34,20 @@ void AppenderConsole::InitColors(std::string const& name, std::string_view str)
|
|||
return;
|
||||
}
|
||||
|
||||
std::vector<std::string_view> colorStrs = acore::Tokenize(str, ' ', false);
|
||||
std::vector<std::string_view> colorStrs = Acore::Tokenize(str, ' ', false);
|
||||
if (colorStrs.size() != NUM_ENABLED_LOG_LEVELS)
|
||||
{
|
||||
throw InvalidAppenderArgsException(acore::StringFormat("Log::CreateAppenderFromConfig: Invalid color data '%s' for console appender %s (expected %u entries, got %zu)",
|
||||
throw InvalidAppenderArgsException(Acore::StringFormat("Log::CreateAppenderFromConfig: Invalid color data '%s' for console appender %s (expected %u entries, got %zu)",
|
||||
std::string(str).c_str(), name.c_str(), NUM_ENABLED_LOG_LEVELS, colorStrs.size()));
|
||||
}
|
||||
|
||||
for (uint8 i = 0; i < NUM_ENABLED_LOG_LEVELS; ++i)
|
||||
{
|
||||
if (Optional<uint8> color = acore::StringTo<uint8>(colorStrs[i]); color && EnumUtils::IsValid<ColorTypes>(*color))
|
||||
if (Optional<uint8> color = Acore::StringTo<uint8>(colorStrs[i]); color && EnumUtils::IsValid<ColorTypes>(*color))
|
||||
_colors[i] = static_cast<ColorTypes>(*color);
|
||||
else
|
||||
{
|
||||
throw InvalidAppenderArgsException(acore::StringFormat("Log::CreateAppenderFromConfig: Invalid color '%s' for log level %s on console appender %s",
|
||||
throw InvalidAppenderArgsException(Acore::StringFormat("Log::CreateAppenderFromConfig: Invalid color '%s' for log level %s on console appender %s",
|
||||
std::string(colorStrs[i]).c_str(), EnumUtils::ToTitle(static_cast<LogLevel>(i)), name.c_str()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ AppenderFile::AppenderFile(uint8 id, std::string const& name, LogLevel level, Ap
|
|||
_fileSize(0)
|
||||
{
|
||||
if (args.size() < 4)
|
||||
throw InvalidAppenderArgsException(acore::StringFormat("Log::CreateAppenderFromConfig: Missing file name for appender %s", name.c_str()));
|
||||
throw InvalidAppenderArgsException(Acore::StringFormat("Log::CreateAppenderFromConfig: Missing file name for appender %s", name.c_str()));
|
||||
|
||||
_fileName.assign(args[3]);
|
||||
|
||||
|
|
@ -37,10 +37,10 @@ AppenderFile::AppenderFile(uint8 id, std::string const& name, LogLevel level, Ap
|
|||
|
||||
if (5 < args.size())
|
||||
{
|
||||
if (Optional<uint32> size = acore::StringTo<uint32>(args[5]))
|
||||
if (Optional<uint32> size = Acore::StringTo<uint32>(args[5]))
|
||||
_maxFileSize = *size;
|
||||
else
|
||||
throw InvalidAppenderArgsException(acore::StringFormat("Log::CreateAppenderFromConfig: Invalid size '%s' for appender %s", std::string(args[5]).c_str(), name.c_str()));
|
||||
throw InvalidAppenderArgsException(Acore::StringFormat("Log::CreateAppenderFromConfig: Invalid size '%s' for appender %s", std::string(args[5]).c_str(), name.c_str()));
|
||||
}
|
||||
|
||||
_dynamicName = std::string::npos != _fileName.find("%s");
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ void Log::CreateAppenderFromConfig(std::string const& appenderName)
|
|||
// if type = Console. optional1 = Color
|
||||
std::string options = sConfigMgr->GetStringDefault(appenderName, "");
|
||||
|
||||
std::vector<std::string_view> tokens = acore::Tokenize(options, ',', true);
|
||||
std::vector<std::string_view> tokens = Acore::Tokenize(options, ',', true);
|
||||
|
||||
size_t const size = tokens.size();
|
||||
std::string name = appenderName.substr(9);
|
||||
|
|
@ -66,8 +66,8 @@ void Log::CreateAppenderFromConfig(std::string const& appenderName)
|
|||
}
|
||||
|
||||
AppenderFlags flags = APPENDER_FLAGS_NONE;
|
||||
AppenderType type = AppenderType(acore::StringTo<uint8>(tokens[0]).value_or(APPENDER_INVALID));
|
||||
LogLevel level = LogLevel(acore::StringTo<uint8>(tokens[1]).value_or(LOG_LEVEL_INVALID));
|
||||
AppenderType type = AppenderType(Acore::StringTo<uint8>(tokens[0]).value_or(APPENDER_INVALID));
|
||||
LogLevel level = LogLevel(Acore::StringTo<uint8>(tokens[1]).value_or(LOG_LEVEL_INVALID));
|
||||
|
||||
auto factoryFunction = appenderFactory.find(type);
|
||||
if (factoryFunction == appenderFactory.end())
|
||||
|
|
@ -84,7 +84,7 @@ void Log::CreateAppenderFromConfig(std::string const& appenderName)
|
|||
|
||||
if (size > 2)
|
||||
{
|
||||
if (Optional<uint8> flagsVal = acore::StringTo<uint8>(tokens[2]))
|
||||
if (Optional<uint8> flagsVal = Acore::StringTo<uint8>(tokens[2]))
|
||||
flags = AppenderFlags(*flagsVal);
|
||||
else
|
||||
{
|
||||
|
|
@ -120,7 +120,7 @@ void Log::CreateLoggerFromConfig(std::string const& appenderName)
|
|||
return;
|
||||
}
|
||||
|
||||
std::vector<std::string_view> tokens = acore::Tokenize(options, ',', true);
|
||||
std::vector<std::string_view> tokens = Acore::Tokenize(options, ',', true);
|
||||
|
||||
if (tokens.size() != 2)
|
||||
{
|
||||
|
|
@ -135,7 +135,7 @@ void Log::CreateLoggerFromConfig(std::string const& appenderName)
|
|||
return;
|
||||
}
|
||||
|
||||
level = LogLevel(acore::StringTo<uint8>(tokens[0]).value_or(LOG_LEVEL_INVALID));
|
||||
level = LogLevel(Acore::StringTo<uint8>(tokens[0]).value_or(LOG_LEVEL_INVALID));
|
||||
if (level > NUM_ENABLED_LOG_LEVELS)
|
||||
{
|
||||
fprintf(stderr, "Log::CreateLoggerFromConfig: Wrong Log Level '%s' for logger %s\n", std::string(tokens[0]).c_str(), name.c_str());
|
||||
|
|
@ -148,7 +148,7 @@ void Log::CreateLoggerFromConfig(std::string const& appenderName)
|
|||
logger = std::make_unique<Logger>(name, level);
|
||||
//fprintf(stdout, "Log::CreateLoggerFromConfig: Created Logger %s, Level %u\n", name.c_str(), level);
|
||||
|
||||
for (std::string_view appenderName : acore::Tokenize(tokens[1], ' ', false))
|
||||
for (std::string_view appenderName : Acore::Tokenize(tokens[1], ' ', false))
|
||||
{
|
||||
if (Appender* appender = GetAppenderByName(appenderName))
|
||||
{
|
||||
|
|
@ -248,7 +248,7 @@ std::string Log::GetTimestampStr()
|
|||
// HH hour (2 digits 00-23)
|
||||
// MM minutes (2 digits 00-59)
|
||||
// SS seconds (2 digits 00-59)
|
||||
return acore::StringFormat("%04d-%02d-%02d_%02d-%02d-%02d",
|
||||
return Acore::StringFormat("%04d-%02d-%02d_%02d-%02d-%02d",
|
||||
aTm.tm_year + 1900, aTm.tm_mon + 1, aTm.tm_mday, aTm.tm_hour, aTm.tm_min, aTm.tm_sec);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public:
|
|||
template<typename Format, typename... Args>
|
||||
inline void outMessage(std::string const& filter, LogLevel const level, Format&& fmt, Args&&... args)
|
||||
{
|
||||
outMessage(filter, level, acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...));
|
||||
outMessage(filter, level, Acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
template<typename Format, typename... Args>
|
||||
|
|
@ -61,7 +61,7 @@ public:
|
|||
if (!ShouldLog("commands.gm", LOG_LEVEL_INFO))
|
||||
return;
|
||||
|
||||
outCommand(acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...), std::to_string(account));
|
||||
outCommand(Acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...), std::to_string(account));
|
||||
}
|
||||
|
||||
void outCharDump(char const* str, uint32 account_id, uint64 guid, char const* name);
|
||||
|
|
@ -81,7 +81,7 @@ public:
|
|||
template<typename Format, typename... Args>
|
||||
inline void outString(Format&& fmt, Args&& ... args)
|
||||
{
|
||||
outMessage("server", LOG_LEVEL_INFO, acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...));
|
||||
outMessage("server", LOG_LEVEL_INFO, Acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
inline void outString()
|
||||
|
|
@ -92,7 +92,7 @@ public:
|
|||
template<typename Format, typename... Args>
|
||||
inline void outError(Format&& fmt, Args&& ... args)
|
||||
{
|
||||
outMessage("server", LOG_LEVEL_ERROR, acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...));
|
||||
outMessage("server", LOG_LEVEL_ERROR, Acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
template<typename Format, typename... Args>
|
||||
|
|
@ -101,19 +101,19 @@ public:
|
|||
if (!ShouldLog("sql.sql", LOG_LEVEL_ERROR))
|
||||
return;
|
||||
|
||||
outMessage("sql.sql", LOG_LEVEL_ERROR, acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...));
|
||||
outMessage("sql.sql", LOG_LEVEL_ERROR, Acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
template<typename Format, typename... Args>
|
||||
inline void outBasic(Format&& fmt, Args&& ... args)
|
||||
{
|
||||
outMessage("server", LOG_LEVEL_INFO, acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...));
|
||||
outMessage("server", LOG_LEVEL_INFO, Acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
template<typename Format, typename... Args>
|
||||
inline void outDetail(Format&& fmt, Args&& ... args)
|
||||
{
|
||||
outMessage("server", LOG_LEVEL_INFO, acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...));
|
||||
outMessage("server", LOG_LEVEL_INFO, Acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
template<typename Format, typename... Args>
|
||||
|
|
@ -122,7 +122,7 @@ public:
|
|||
if (!ShouldLog("sql.dev", LOG_LEVEL_INFO))
|
||||
return;
|
||||
|
||||
outMessage("sql.dev", LOG_LEVEL_INFO, acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...));
|
||||
outMessage("sql.dev", LOG_LEVEL_INFO, Acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
template<typename Format, typename... Args>
|
||||
|
|
@ -131,13 +131,13 @@ public:
|
|||
if (!ShouldLog("sql.driver", LOG_LEVEL_INFO))
|
||||
return;
|
||||
|
||||
outMessage("sql.driver", LOG_LEVEL_INFO, acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...));
|
||||
outMessage("sql.driver", LOG_LEVEL_INFO, Acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
template<typename Format, typename... Args>
|
||||
inline void outMisc(Format&& fmt, Args&& ... args)
|
||||
{
|
||||
outMessage("server", LOG_LEVEL_INFO, acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...));
|
||||
outMessage("server", LOG_LEVEL_INFO, Acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
template<typename Format, typename... Args>
|
||||
|
|
@ -149,7 +149,7 @@ public:
|
|||
if (!ShouldLog("server", LOG_LEVEL_DEBUG))
|
||||
return;
|
||||
|
||||
outMessage("server", LOG_LEVEL_DEBUG, acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...));
|
||||
outMessage("server", LOG_LEVEL_DEBUG, Acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ std::string LogMessage::getTimeStr(time_t time)
|
|||
{
|
||||
tm aTm;
|
||||
localtime_r(&time, &aTm);
|
||||
return acore::StringFormat("%04d-%02d-%02d_%02d:%02d:%02d", aTm.tm_year + 1900, aTm.tm_mon + 1, aTm.tm_mday, aTm.tm_hour, aTm.tm_min, aTm.tm_sec);
|
||||
return Acore::StringFormat("%04d-%02d-%02d_%02d:%02d:%02d", aTm.tm_year + 1900, aTm.tm_mon + 1, aTm.tm_mday, aTm.tm_hour, aTm.tm_min, aTm.tm_sec);
|
||||
}
|
||||
|
||||
std::string LogMessage::getTimeStr() const
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include "SmartEnum.h"
|
||||
#include <stdexcept>
|
||||
|
||||
namespace acore::Impl::EnumUtilsImpl
|
||||
namespace Acore::Impl::EnumUtilsImpl
|
||||
{
|
||||
|
||||
/********************************************************************\
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include "SmartEnum.h"
|
||||
#include <stdexcept>
|
||||
|
||||
namespace acore::Impl::EnumUtilsImpl
|
||||
namespace Acore::Impl::EnumUtilsImpl
|
||||
{
|
||||
|
||||
/************************************************************\
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#endif // WIN32
|
||||
using namespace acore;
|
||||
using namespace Acore;
|
||||
|
||||
Thread::Thread() : m_task(nullptr), m_iThreadId(), m_ThreadImp()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#include <thread>
|
||||
#include <atomic>
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
class Runnable
|
||||
{
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include "Define.h"
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
template<typename MUTEX>
|
||||
class GeneralLock
|
||||
|
|
@ -126,9 +126,9 @@ namespace acore
|
|||
};
|
||||
}
|
||||
|
||||
template<class T, class MUTEX> MUTEX acore::ClassLevelLockable<T, MUTEX>::si_mtx;
|
||||
template<class T, class MUTEX> MUTEX Acore::ClassLevelLockable<T, MUTEX>::si_mtx;
|
||||
|
||||
#define INSTANTIATE_CLASS_MUTEX(CTYPE, MUTEX) \
|
||||
template class acore::ClassLevelLockable<CTYPE, MUTEX>
|
||||
template class Acore::ClassLevelLockable<CTYPE, MUTEX>
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
template<class T>
|
||||
constexpr inline T* AddressOrSelf(T* ptr)
|
||||
|
|
@ -60,14 +60,14 @@ namespace acore
|
|||
};
|
||||
}
|
||||
|
||||
namespace acore::Containers
|
||||
namespace Acore::Containers
|
||||
{
|
||||
// resizes <container> to have at most <requestedSize> elements
|
||||
// if it has more than <requestedSize> elements, the elements to keep are selected randomly
|
||||
template<class C>
|
||||
void RandomResize(C& container, std::size_t requestedSize)
|
||||
{
|
||||
static_assert(std::is_base_of<std::forward_iterator_tag, typename std::iterator_traits<typename C::iterator>::iterator_category>::value, "Invalid container passed to acore::Containers::RandomResize");
|
||||
static_assert(std::is_base_of<std::forward_iterator_tag, typename std::iterator_traits<typename C::iterator>::iterator_category>::value, "Invalid container passed to Acore::Containers::RandomResize");
|
||||
|
||||
if (std::size(container) <= requestedSize)
|
||||
return;
|
||||
|
|
@ -176,7 +176,7 @@ namespace acore::Containers
|
|||
}
|
||||
|
||||
/*
|
||||
* @fn void acore::Containers::RandomShuffle(C& container)
|
||||
* @fn void Acore::Containers::RandomShuffle(C& container)
|
||||
*
|
||||
* @brief Reorder the elements of the container randomly.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include "Define.h"
|
||||
#include <utility>
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
/**
|
||||
* @class IteratorPair
|
||||
|
|
@ -41,6 +41,6 @@ namespace acore
|
|||
}
|
||||
//! namespace Containers
|
||||
}
|
||||
//! namespace acore
|
||||
//! namespace Acore
|
||||
|
||||
#endif // IteratorPair_h__
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include <unordered_set>
|
||||
#include <mutex>
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
/// Handle termination signals
|
||||
class SignalHandler
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ struct EnumText
|
|||
char const* const Description;
|
||||
};
|
||||
|
||||
namespace acore::Impl::EnumUtilsImpl
|
||||
namespace Acore::Impl::EnumUtilsImpl
|
||||
{
|
||||
template <typename Enum>
|
||||
struct EnumUtils
|
||||
|
|
@ -36,20 +36,20 @@ class EnumUtils
|
|||
{
|
||||
public:
|
||||
template <typename Enum>
|
||||
static size_t Count() { return acore::Impl::EnumUtilsImpl::EnumUtils<Enum>::Count(); }
|
||||
static size_t Count() { return Acore::Impl::EnumUtilsImpl::EnumUtils<Enum>::Count(); }
|
||||
template <typename Enum>
|
||||
static EnumText ToString(Enum value) { return acore::Impl::EnumUtilsImpl::EnumUtils<Enum>::ToString(value); }
|
||||
static EnumText ToString(Enum value) { return Acore::Impl::EnumUtilsImpl::EnumUtils<Enum>::ToString(value); }
|
||||
template <typename Enum>
|
||||
static Enum FromIndex(size_t index) { return acore::Impl::EnumUtilsImpl::EnumUtils<Enum>::FromIndex(index); }
|
||||
static Enum FromIndex(size_t index) { return Acore::Impl::EnumUtilsImpl::EnumUtils<Enum>::FromIndex(index); }
|
||||
template <typename Enum>
|
||||
static uint32 ToIndex(Enum value) { return acore::Impl::EnumUtilsImpl::EnumUtils<Enum>::ToIndex(value);}
|
||||
static uint32 ToIndex(Enum value) { return Acore::Impl::EnumUtilsImpl::EnumUtils<Enum>::ToIndex(value);}
|
||||
|
||||
template<typename Enum>
|
||||
static bool IsValid(Enum value)
|
||||
{
|
||||
try
|
||||
{
|
||||
acore::Impl::EnumUtilsImpl::EnumUtils<Enum>::ToIndex(value);
|
||||
Acore::Impl::EnumUtilsImpl::EnumUtils<Enum>::ToIndex(value);
|
||||
return true;
|
||||
} catch (...)
|
||||
{
|
||||
|
|
@ -105,7 +105,7 @@ class EnumUtils
|
|||
static Iterator<Enum> End() { return Iterator<Enum>(); }
|
||||
|
||||
template <typename Enum>
|
||||
static acore::IteratorPair<Iterator<Enum>> Iterate() { return { Begin<Enum>(), End<Enum>() }; }
|
||||
static Acore::IteratorPair<Iterator<Enum>> Iterate() { return { Begin<Enum>(), End<Enum>() }; }
|
||||
|
||||
template <typename Enum>
|
||||
static char const* ToConstant(Enum value) { return ToString(value).Constant; }
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@
|
|||
#include <string_view>
|
||||
#include <type_traits>
|
||||
|
||||
namespace acore::Impl::StringConvertImpl
|
||||
namespace Acore::Impl::StringConvertImpl
|
||||
{
|
||||
template <typename T, typename = void> struct For
|
||||
{
|
||||
static_assert(acore::dependant_false_v<T>, "Unsupported type used for ToString or StringTo");
|
||||
static_assert(Acore::dependant_false_v<T>, "Unsupported type used for ToString or StringTo");
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
|
|
@ -241,18 +241,18 @@ namespace acore::Impl::StringConvertImpl
|
|||
#endif
|
||||
}
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
template <typename Result, typename... Params>
|
||||
Optional<Result> StringTo(std::string_view str, Params&&... params)
|
||||
{
|
||||
return acore::Impl::StringConvertImpl::For<Result>::FromString(str, std::forward<Params>(params)...);
|
||||
return Acore::Impl::StringConvertImpl::For<Result>::FromString(str, std::forward<Params>(params)...);
|
||||
}
|
||||
|
||||
template <typename Type, typename... Params>
|
||||
std::string ToString(Type&& val, Params&&... params)
|
||||
{
|
||||
return acore::Impl::StringConvertImpl::For<std::decay_t<Type>>::ToString(std::forward<Type>(val), std::forward<Params>(params)...);
|
||||
return Acore::Impl::StringConvertImpl::For<std::decay_t<Type>>::ToString(std::forward<Type>(val), std::forward<Params>(params)...);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include <locale>
|
||||
|
||||
template<class Str>
|
||||
Str acore::String::Trim(const Str& s, const std::locale& loc /*= std::locale()*/)
|
||||
Str Acore::String::Trim(const Str& s, const std::locale& loc /*= std::locale()*/)
|
||||
{
|
||||
typename Str::const_iterator first = s.begin();
|
||||
typename Str::const_iterator end = s.end();
|
||||
|
|
@ -31,4 +31,4 @@ Str acore::String::Trim(const Str& s, const std::locale& loc /*= std::locale()*/
|
|||
}
|
||||
|
||||
// Template Trim
|
||||
template std::string acore::String::Trim<std::string>(const std::string& s, const std::locale& loc /*= std::locale()*/);
|
||||
template std::string Acore::String::Trim<std::string>(const std::string& s, const std::locale& loc /*= std::locale()*/);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include <fmt/printf.h>
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
/// Default AC string format function.
|
||||
template<typename Format, typename... Args>
|
||||
|
|
@ -40,7 +40,7 @@ namespace acore
|
|||
}
|
||||
}
|
||||
|
||||
namespace acore::String
|
||||
namespace Acore::String
|
||||
{
|
||||
template<class Str>
|
||||
Str Trim(const Str& s, const std::locale& loc = std::locale());
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "Tokenize.h"
|
||||
|
||||
std::vector<std::string_view> acore::Tokenize(std::string_view str, char sep, bool keepEmpty)
|
||||
std::vector<std::string_view> Acore::Tokenize(std::string_view str, char sep, bool keepEmpty)
|
||||
{
|
||||
std::vector<std::string_view> tokens;
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
std::vector<std::string_view> Tokenize(std::string_view str, char sep, bool keepEmpty);
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include <tuple>
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
template <typename T, typename Tuple>
|
||||
struct has_type;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include "advstd.h"
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
// end "iterator" tag for find_type_if
|
||||
struct find_type_end;
|
||||
|
|
@ -35,11 +35,11 @@ namespace acore
|
|||
template<typename... Ts>
|
||||
struct Example
|
||||
{
|
||||
using TupleArg = acore::find_type_if_t<acore::is_tuple, Ts...>;
|
||||
using TupleArg = Acore::find_type_if_t<Acore::is_tuple, Ts...>;
|
||||
|
||||
bool HasTuple()
|
||||
{
|
||||
return !std::is_same_v<TupleArg, acore::find_type_end>;
|
||||
return !std::is_same_v<TupleArg, Acore::find_type_end>;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ namespace acore
|
|||
example.HasTuple() == true; // TupleArg is std::tuple<int, int, int>
|
||||
|
||||
Example<int, std::string, char> example2;
|
||||
example2.HasTuple() == false; // TupleArg is acore::find_type_end
|
||||
example2.HasTuple() == false; // TupleArg is Acore::find_type_end
|
||||
*/
|
||||
|
||||
template<template<typename...> typename Check, typename... Ts>
|
||||
|
|
|
|||
|
|
@ -343,7 +343,7 @@ bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize)
|
|||
{
|
||||
try
|
||||
{
|
||||
acore::CheckedBufferOutputIterator<wchar_t> out(wstr, wsize);
|
||||
Acore::CheckedBufferOutputIterator<wchar_t> out(wstr, wsize);
|
||||
out = utf8::utf8to16(utf8str, utf8str + csize, out);
|
||||
wsize -= out.remaining(); // remaining unused space
|
||||
wstr[wsize] = L'\0';
|
||||
|
|
@ -585,7 +585,7 @@ bool Utf8ToUpperOnlyLatin(std::string& utf8String)
|
|||
return WStrToUtf8(wstr, utf8String);
|
||||
}
|
||||
|
||||
std::string acore::Impl::ByteArrayToHexStr(uint8 const* bytes, size_t arrayLen, bool reverse /* = false */)
|
||||
std::string Acore::Impl::ByteArrayToHexStr(uint8 const* bytes, size_t arrayLen, bool reverse /* = false */)
|
||||
{
|
||||
int32 init = 0;
|
||||
int32 end = arrayLen;
|
||||
|
|
@ -609,7 +609,7 @@ std::string acore::Impl::ByteArrayToHexStr(uint8 const* bytes, size_t arrayLen,
|
|||
return ss.str();
|
||||
}
|
||||
|
||||
void acore::Impl::HexStrToByteArray(std::string const& str, uint8* out, size_t outlen, bool reverse /*= false*/)
|
||||
void Acore::Impl::HexStrToByteArray(std::string const& str, uint8* out, size_t outlen, bool reverse /*= false*/)
|
||||
{
|
||||
ASSERT(str.size() == (2 * outlen));
|
||||
|
||||
|
|
|
|||
|
|
@ -314,7 +314,7 @@ uint32 GetPID();
|
|||
|
||||
bool StringEqualI(std::string_view str1, std::string_view str2);
|
||||
|
||||
namespace acore::Impl
|
||||
namespace Acore::Impl
|
||||
{
|
||||
std::string ByteArrayToHexStr(uint8 const* bytes, size_t length, bool reverse = false);
|
||||
void HexStrToByteArray(std::string const& str, uint8* out, size_t outlen, bool reverse = false);
|
||||
|
|
@ -323,13 +323,13 @@ namespace acore::Impl
|
|||
template<typename Container>
|
||||
std::string ByteArrayToHexStr(Container const& c, bool reverse = false)
|
||||
{
|
||||
return acore::Impl::ByteArrayToHexStr(std::data(c), std::size(c), reverse);
|
||||
return Acore::Impl::ByteArrayToHexStr(std::data(c), std::size(c), reverse);
|
||||
}
|
||||
|
||||
template<size_t Size>
|
||||
void HexStrToByteArray(std::string const& str, std::array<uint8, Size>& buf, bool reverse = false)
|
||||
{
|
||||
acore::Impl::HexStrToByteArray(str, buf.data(), Size, reverse);
|
||||
Acore::Impl::HexStrToByteArray(str, buf.data(), Size, reverse);
|
||||
}
|
||||
template<size_t Size>
|
||||
std::array<uint8, Size> HexStrToByteArray(std::string const& str, bool reverse = false)
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ void usage(const char* prog)
|
|||
/// Launch the auth server
|
||||
extern int main(int argc, char** argv)
|
||||
{
|
||||
acore::Impl::CurrentServerProcessHolder::_type = SERVER_PROCESS_AUTHSERVER;
|
||||
Acore::Impl::CurrentServerProcessHolder::_type = SERVER_PROCESS_AUTHSERVER;
|
||||
|
||||
// Command line parsing to get the configuration file name
|
||||
std::string configFile = sConfigMgr->GetConfigPath() + std::string(_ACORE_REALM_CONFIG);
|
||||
|
|
@ -92,7 +92,7 @@ extern int main(int argc, char** argv)
|
|||
sLog->RegisterAppender<AppenderDB>();
|
||||
sLog->Initialize();
|
||||
|
||||
acore::Banner::Show("authserver",
|
||||
Acore::Banner::Show("authserver",
|
||||
[](char const* text)
|
||||
{
|
||||
LOG_INFO("server.authserver", "%s", text);
|
||||
|
|
@ -164,7 +164,7 @@ extern int main(int argc, char** argv)
|
|||
LOG_INFO("server.authserver", "Authserver listening to %s:%d", bind_ip.c_str(), rmport);
|
||||
|
||||
// Initialize the signal handlers
|
||||
acore::SignalHandler signalHandler;
|
||||
Acore::SignalHandler signalHandler;
|
||||
auto const _handler = [](int) { stopEvent = true; };
|
||||
|
||||
// Register authservers's signal handlers
|
||||
|
|
|
|||
|
|
@ -69,9 +69,9 @@ typedef struct AUTH_LOGON_CHALLENGE_C
|
|||
typedef struct AUTH_LOGON_PROOF_C
|
||||
{
|
||||
uint8 cmd;
|
||||
acore::Crypto::SRP6::EphemeralKey A;
|
||||
acore::Crypto::SHA1::Digest clientM;
|
||||
acore::Crypto::SHA1::Digest crc_hash;
|
||||
Acore::Crypto::SRP6::EphemeralKey A;
|
||||
Acore::Crypto::SHA1::Digest clientM;
|
||||
Acore::Crypto::SHA1::Digest crc_hash;
|
||||
uint8 number_of_keys;
|
||||
uint8 securityFlags; // 0x00-0x04
|
||||
} sAuthLogonProof_C;
|
||||
|
|
@ -80,7 +80,7 @@ typedef struct AUTH_LOGON_PROOF_S
|
|||
{
|
||||
uint8 cmd;
|
||||
uint8 error;
|
||||
acore::Crypto::SHA1::Digest M2;
|
||||
Acore::Crypto::SHA1::Digest M2;
|
||||
uint32 unk1;
|
||||
uint32 unk2;
|
||||
uint16 unk3;
|
||||
|
|
@ -90,7 +90,7 @@ typedef struct AUTH_LOGON_PROOF_S_OLD
|
|||
{
|
||||
uint8 cmd;
|
||||
uint8 error;
|
||||
acore::Crypto::SHA1::Digest M2;
|
||||
Acore::Crypto::SHA1::Digest M2;
|
||||
uint32 unk2;
|
||||
} sAuthLogonProof_S_Old;
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ typedef struct AUTH_RECONNECT_PROOF_C
|
|||
{
|
||||
uint8 cmd;
|
||||
uint8 R1[16];
|
||||
acore::Crypto::SHA1::Digest R2, R3;
|
||||
Acore::Crypto::SHA1::Digest R2, R3;
|
||||
uint8 number_of_keys;
|
||||
} sAuthReconnectProof_C;
|
||||
|
||||
|
|
@ -133,7 +133,7 @@ typedef struct AuthHandler
|
|||
#endif
|
||||
|
||||
// Launch a thread to transfer a patch to the client
|
||||
class PatcherRunnable: public acore::Runnable
|
||||
class PatcherRunnable: public Acore::Runnable
|
||||
{
|
||||
public:
|
||||
PatcherRunnable(class AuthSocket*);
|
||||
|
|
@ -477,7 +477,7 @@ bool AuthSocket::_HandleLogonChallenge()
|
|||
_totpSecret = fields[9].GetBinary();
|
||||
if (auto const& secret = sSecretMgr->GetSecret(SECRET_TOTP_MASTER_KEY))
|
||||
{
|
||||
bool success = acore::Crypto::AEDecrypt<acore::Crypto::AES>(*_totpSecret, *secret);
|
||||
bool success = Acore::Crypto::AEDecrypt<Acore::Crypto::AES>(*_totpSecret, *secret);
|
||||
if (!success)
|
||||
{
|
||||
pkt << uint8(WOW_FAIL_DB_BUSY);
|
||||
|
|
@ -490,8 +490,8 @@ bool AuthSocket::_HandleLogonChallenge()
|
|||
|
||||
_srp6.emplace(
|
||||
_accountInfo.Login,
|
||||
fields[10].GetBinary<acore::Crypto::SRP6::SALT_LENGTH>(),
|
||||
fields[11].GetBinary<acore::Crypto::SRP6::VERIFIER_LENGTH>());
|
||||
fields[10].GetBinary<Acore::Crypto::SRP6::SALT_LENGTH>(),
|
||||
fields[11].GetBinary<Acore::Crypto::SRP6::VERIFIER_LENGTH>());
|
||||
|
||||
// Fill the response packet with the result
|
||||
if (!AuthHelper::IsAcceptedClientBuild(_build))
|
||||
|
|
@ -583,7 +583,7 @@ bool AuthSocket::_HandleLogonProof()
|
|||
unsigned int incomingToken = atoi(token);
|
||||
delete[] token;
|
||||
|
||||
tokenSuccess = acore::Crypto::TOTP::ValidateToken(*_totpSecret, incomingToken);
|
||||
tokenSuccess = Acore::Crypto::TOTP::ValidateToken(*_totpSecret, incomingToken);
|
||||
memset(_totpSecret->data(), 0, _totpSecret->size());
|
||||
}
|
||||
else if (!sentToken && !_totpSecret)
|
||||
|
|
@ -609,7 +609,7 @@ bool AuthSocket::_HandleLogonProof()
|
|||
LoginDatabase.DirectExecute(stmt);
|
||||
|
||||
// Finish SRP6 and send the final result to the client
|
||||
acore::Crypto::SHA1::Digest M2 = acore::Crypto::SRP6::GetSessionVerifier(lp.A, lp.clientM, _sessionKey);
|
||||
Acore::Crypto::SHA1::Digest M2 = Acore::Crypto::SRP6::GetSessionVerifier(lp.A, lp.clientM, _sessionKey);
|
||||
|
||||
if (_expversion & POST_BC_EXP_FLAG) // 2.x and 3.x clients
|
||||
{
|
||||
|
|
@ -765,7 +765,7 @@ bool AuthSocket::_HandleReconnectChallenge()
|
|||
std::reverse(_os.begin(), _os.end());
|
||||
|
||||
_sessionKey = fields[9].GetBinary<SESSION_KEY_LENGTH>();
|
||||
acore::Crypto::GetRandomBytes(_reconnectProof);
|
||||
Acore::Crypto::GetRandomBytes(_reconnectProof);
|
||||
|
||||
///- All good, await client's proof
|
||||
_status = STATUS_RECON_PROOF;
|
||||
|
|
@ -799,7 +799,7 @@ bool AuthSocket::_HandleReconnectProof()
|
|||
BigNumber t1;
|
||||
t1.SetBinary(lp.R1, 16);
|
||||
|
||||
acore::Crypto::SHA1 sha;
|
||||
Acore::Crypto::SHA1 sha;
|
||||
sha.UpdateData(_accountInfo.Login);
|
||||
sha.UpdateData(t1.ToByteArray<16>());
|
||||
sha.UpdateData(_reconnectProof);
|
||||
|
|
@ -1005,7 +1005,7 @@ bool AuthSocket::_HandleXferResume()
|
|||
socket().recv((char*)&start, sizeof(start));
|
||||
fseek(pPatch, long(start), 0);
|
||||
|
||||
acore::Thread u(new PatcherRunnable(this));
|
||||
Acore::Thread u(new PatcherRunnable(this));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1041,7 +1041,7 @@ bool AuthSocket::_HandleXferAccept()
|
|||
socket().recv_skip(1); // clear input buffer
|
||||
fseek(pPatch, 0, 0);
|
||||
|
||||
acore::Thread u(new PatcherRunnable(this));
|
||||
Acore::Thread u(new PatcherRunnable(this));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ private:
|
|||
RealmSocket& socket_;
|
||||
RealmSocket& socket() { return socket_; }
|
||||
|
||||
std::optional<acore::Crypto::SRP6> _srp6;
|
||||
std::optional<Acore::Crypto::SRP6> _srp6;
|
||||
SessionKey _sessionKey = {};
|
||||
std::array<uint8, 16> _reconnectProof = {};
|
||||
|
||||
|
|
|
|||
|
|
@ -63,10 +63,10 @@ public:
|
|||
template<typename Format, typename... Args>
|
||||
void PExecute(Format&& sql, Args&& ... args)
|
||||
{
|
||||
if (acore::IsFormatEmptyOrNull(sql))
|
||||
if (Acore::IsFormatEmptyOrNull(sql))
|
||||
return;
|
||||
|
||||
Execute(acore::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str());
|
||||
Execute(Acore::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str());
|
||||
}
|
||||
|
||||
//! Enqueues a one-way SQL operation in prepared statement format that will be executed asynchronously.
|
||||
|
|
@ -86,10 +86,10 @@ public:
|
|||
template<typename Format, typename... Args>
|
||||
void DirectPExecute(Format&& sql, Args&& ... args)
|
||||
{
|
||||
if (acore::IsFormatEmptyOrNull(sql))
|
||||
if (Acore::IsFormatEmptyOrNull(sql))
|
||||
return;
|
||||
|
||||
DirectExecute(acore::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str());
|
||||
DirectExecute(Acore::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str());
|
||||
}
|
||||
|
||||
//! Directly executes a one-way SQL operation in prepared statement format, that will block the calling thread until finished.
|
||||
|
|
@ -109,10 +109,10 @@ public:
|
|||
template<typename Format, typename... Args>
|
||||
QueryResult PQuery(Format&& sql, T* conn, Args&& ... args)
|
||||
{
|
||||
if (acore::IsFormatEmptyOrNull(sql))
|
||||
if (Acore::IsFormatEmptyOrNull(sql))
|
||||
return QueryResult(nullptr);
|
||||
|
||||
return Query(acore::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str(), conn);
|
||||
return Query(Acore::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str(), conn);
|
||||
}
|
||||
|
||||
//! Directly executes an SQL query in string format -with variable args- that will block the calling thread until finished.
|
||||
|
|
@ -120,10 +120,10 @@ public:
|
|||
template<typename Format, typename... Args>
|
||||
QueryResult PQuery(Format&& sql, Args&& ... args)
|
||||
{
|
||||
if (acore::IsFormatEmptyOrNull(sql))
|
||||
if (Acore::IsFormatEmptyOrNull(sql))
|
||||
return QueryResult(nullptr);
|
||||
|
||||
return Query(acore::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str());
|
||||
return Query(Acore::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str());
|
||||
}
|
||||
|
||||
//! Directly executes an SQL query in prepared format that will block the calling thread until finished.
|
||||
|
|
@ -144,10 +144,10 @@ public:
|
|||
template<typename Format, typename... Args>
|
||||
QueryResultFuture AsyncPQuery(Format&& sql, Args&& ... args)
|
||||
{
|
||||
if (acore::IsFormatEmptyOrNull(sql))
|
||||
if (Acore::IsFormatEmptyOrNull(sql))
|
||||
return QueryResult(nullptr);
|
||||
|
||||
return AsyncQuery(acore::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str());
|
||||
return AsyncQuery(Acore::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str());
|
||||
}
|
||||
|
||||
//! Enqueues a query in prepared format that will set the value of the PreparedQueryResultFuture return object as soon as the query is executed.
|
||||
|
|
|
|||
|
|
@ -71,8 +71,8 @@ void TotemAI::UpdateAI(uint32 /*diff*/)
|
|||
me->IsFriendlyTo(victim) || !me->CanSeeOrDetect(victim))
|
||||
{
|
||||
victim = nullptr;
|
||||
acore::NearestAttackableUnitInObjectRangeCheck u_check(me, me, max_range);
|
||||
acore::UnitLastSearcher<acore::NearestAttackableUnitInObjectRangeCheck> checker(me, victim, u_check);
|
||||
Acore::NearestAttackableUnitInObjectRangeCheck u_check(me, me, max_range);
|
||||
Acore::UnitLastSearcher<Acore::NearestAttackableUnitInObjectRangeCheck> checker(me, victim, u_check);
|
||||
me->VisitNearbyObject(max_range, checker);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ enum SelectAggroTarget
|
|||
};
|
||||
|
||||
// default predicate function to select target based on distance, player and/or aura criteria
|
||||
struct DefaultTargetSelector : public acore::unary_function<Unit*, bool>
|
||||
struct DefaultTargetSelector : public Acore::unary_function<Unit*, bool>
|
||||
{
|
||||
const Unit* me;
|
||||
float m_dist;
|
||||
|
|
@ -78,7 +78,7 @@ struct DefaultTargetSelector : public acore::unary_function<Unit*, bool>
|
|||
|
||||
// Target selector for spell casts checking range, auras and attributes
|
||||
// TODO: Add more checks from Spell::CheckCast
|
||||
struct SpellTargetSelector : public acore::unary_function<Unit*, bool>
|
||||
struct SpellTargetSelector : public Acore::unary_function<Unit*, bool>
|
||||
{
|
||||
public:
|
||||
SpellTargetSelector(Unit* caster, uint32 spellId);
|
||||
|
|
@ -92,7 +92,7 @@ private:
|
|||
// Very simple target selector, will just skip main target
|
||||
// NOTE: When passing to UnitAI::SelectTarget remember to use 0 as position for random selection
|
||||
// because tank will not be in the temporary list
|
||||
struct NonTankTargetSelector : public acore::unary_function<Unit*, bool>
|
||||
struct NonTankTargetSelector : public Acore::unary_function<Unit*, bool>
|
||||
{
|
||||
public:
|
||||
NonTankTargetSelector(Creature* source, bool playerOnly = true) : _source(source), _playerOnly(playerOnly) { }
|
||||
|
|
@ -104,7 +104,7 @@ private:
|
|||
};
|
||||
|
||||
// Simple selector for units using mana
|
||||
struct PowerUsersSelector : public acore::unary_function<Unit*, bool>
|
||||
struct PowerUsersSelector : public Acore::unary_function<Unit*, bool>
|
||||
{
|
||||
Unit const* _me;
|
||||
Powers const _power;
|
||||
|
|
@ -134,7 +134,7 @@ struct PowerUsersSelector : public acore::unary_function<Unit*, bool>
|
|||
}
|
||||
};
|
||||
|
||||
struct FarthestTargetSelector : public acore::unary_function<Unit*, bool>
|
||||
struct FarthestTargetSelector : public Acore::unary_function<Unit*, bool>
|
||||
{
|
||||
FarthestTargetSelector(Unit const* unit, float dist, bool playerOnly, bool inLos) : _me(unit), _dist(dist), _playerOnly(playerOnly), _inLos(inLos) {}
|
||||
|
||||
|
|
@ -190,7 +190,7 @@ public:
|
|||
|
||||
Unit* SelectTarget(SelectAggroTarget targetType, uint32 position = 0, float dist = 0.0f, bool playerOnly = false, int32 aura = 0);
|
||||
// Select the targets satifying the predicate.
|
||||
// predicate shall extend acore::unary_function<Unit*, bool>
|
||||
// predicate shall extend Acore::unary_function<Unit*, bool>
|
||||
template <class PREDICATE> Unit* SelectTarget(SelectAggroTarget targetType, uint32 position, PREDICATE const& predicate)
|
||||
{
|
||||
ThreatContainer::StorageType const& threatlist = me->getThreatManager().getThreatList();
|
||||
|
|
@ -206,7 +206,7 @@ public:
|
|||
return nullptr;
|
||||
|
||||
if (targetType == SELECT_TARGET_NEAREST || targetType == SELECT_TARGET_FARTHEST)
|
||||
targetList.sort(acore::ObjectDistanceOrderPred(me));
|
||||
targetList.sort(Acore::ObjectDistanceOrderPred(me));
|
||||
|
||||
switch (targetType)
|
||||
{
|
||||
|
|
@ -240,7 +240,7 @@ public:
|
|||
void SelectTargetList(std::list<Unit*>& targetList, uint32 num, SelectAggroTarget targetType, float dist = 0.0f, bool playerOnly = false, int32 aura = 0);
|
||||
|
||||
// Select the targets satifying the predicate.
|
||||
// predicate shall extend acore::unary_function<Unit*, bool>
|
||||
// predicate shall extend Acore::unary_function<Unit*, bool>
|
||||
template <class PREDICATE> void SelectTargetList(std::list<Unit*>& targetList, PREDICATE const& predicate, uint32 maxTargets, SelectAggroTarget targetType)
|
||||
{
|
||||
ThreatContainer::StorageType const& threatlist = me->getThreatManager().getThreatList();
|
||||
|
|
@ -255,13 +255,13 @@ public:
|
|||
return;
|
||||
|
||||
if (targetType == SELECT_TARGET_NEAREST || targetType == SELECT_TARGET_FARTHEST)
|
||||
targetList.sort(acore::ObjectDistanceOrderPred(me));
|
||||
targetList.sort(Acore::ObjectDistanceOrderPred(me));
|
||||
|
||||
if (targetType == SELECT_TARGET_FARTHEST || targetType == SELECT_TARGET_BOTTOMAGGRO)
|
||||
targetList.reverse();
|
||||
|
||||
if (targetType == SELECT_TARGET_RANDOM)
|
||||
acore::Containers::RandomResize(targetList, maxTargets);
|
||||
Acore::Containers::RandomResize(targetList, maxTargets);
|
||||
else
|
||||
targetList.resize(maxTargets);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -379,8 +379,8 @@ void ScriptedAI::DoTeleportAll(float x, float y, float z, float o)
|
|||
Unit* ScriptedAI::DoSelectLowestHpFriendly(float range, uint32 minHPDiff)
|
||||
{
|
||||
Unit* unit = nullptr;
|
||||
acore::MostHPMissingInRange u_check(me, range, minHPDiff);
|
||||
acore::UnitLastSearcher<acore::MostHPMissingInRange> searcher(me, unit, u_check);
|
||||
Acore::MostHPMissingInRange u_check(me, range, minHPDiff);
|
||||
Acore::UnitLastSearcher<Acore::MostHPMissingInRange> searcher(me, unit, u_check);
|
||||
me->VisitNearbyObject(range, searcher);
|
||||
|
||||
return unit;
|
||||
|
|
@ -389,8 +389,8 @@ Unit* ScriptedAI::DoSelectLowestHpFriendly(float range, uint32 minHPDiff)
|
|||
std::list<Creature*> ScriptedAI::DoFindFriendlyCC(float range)
|
||||
{
|
||||
std::list<Creature*> list;
|
||||
acore::FriendlyCCedInRange u_check(me, range);
|
||||
acore::CreatureListSearcher<acore::FriendlyCCedInRange> searcher(me, list, u_check);
|
||||
Acore::FriendlyCCedInRange u_check(me, range);
|
||||
Acore::CreatureListSearcher<Acore::FriendlyCCedInRange> searcher(me, list, u_check);
|
||||
me->VisitNearbyObject(range, searcher);
|
||||
return list;
|
||||
}
|
||||
|
|
@ -398,8 +398,8 @@ std::list<Creature*> ScriptedAI::DoFindFriendlyCC(float range)
|
|||
std::list<Creature*> ScriptedAI::DoFindFriendlyMissingBuff(float range, uint32 uiSpellid)
|
||||
{
|
||||
std::list<Creature*> list;
|
||||
acore::FriendlyMissingBuffInRange u_check(me, range, uiSpellid);
|
||||
acore::CreatureListSearcher<acore::FriendlyMissingBuffInRange> searcher(me, list, u_check);
|
||||
Acore::FriendlyMissingBuffInRange u_check(me, range, uiSpellid);
|
||||
Acore::CreatureListSearcher<Acore::FriendlyMissingBuffInRange> searcher(me, list, u_check);
|
||||
me->VisitNearbyObject(range, searcher);
|
||||
return list;
|
||||
}
|
||||
|
|
@ -408,13 +408,13 @@ Player* ScriptedAI::GetPlayerAtMinimumRange(float minimumRange)
|
|||
{
|
||||
Player* player = nullptr;
|
||||
|
||||
CellCoord pair(acore::ComputeCellCoord(me->GetPositionX(), me->GetPositionY()));
|
||||
CellCoord pair(Acore::ComputeCellCoord(me->GetPositionX(), me->GetPositionY()));
|
||||
Cell cell(pair);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::PlayerAtMinimumRangeAway check(me, minimumRange);
|
||||
acore::PlayerSearcher<acore::PlayerAtMinimumRangeAway> searcher(me, player, check);
|
||||
TypeContainerVisitor<acore::PlayerSearcher<acore::PlayerAtMinimumRangeAway>, GridTypeMapContainer> visitor(searcher);
|
||||
Acore::PlayerAtMinimumRangeAway check(me, minimumRange);
|
||||
Acore::PlayerSearcher<Acore::PlayerAtMinimumRangeAway> searcher(me, player, check);
|
||||
TypeContainerVisitor<Acore::PlayerSearcher<Acore::PlayerAtMinimumRangeAway>, GridTypeMapContainer> visitor(searcher);
|
||||
|
||||
cell.Visit(pair, visitor, *me->GetMap(), *me, minimumRange);
|
||||
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ public:
|
|||
|
||||
// We need to use a copy of SummonList here, otherwise original SummonList would be modified
|
||||
StorageType listCopy = storage_;
|
||||
acore::Containers::RandomResize<StorageType, Predicate>(listCopy, std::forward<Predicate>(predicate), max);
|
||||
Acore::Containers::RandomResize<StorageType, Predicate>(listCopy, std::forward<Predicate>(predicate), max);
|
||||
|
||||
for (auto const& guid : listCopy)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -734,7 +734,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
caster = unit->SummonTrigger(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), unit->GetOrientation(), 5000);
|
||||
|
||||
if (e.action.cast.targetsLimit > 0 && targets->size() > e.action.cast.targetsLimit)
|
||||
acore::Containers::RandomResize(*targets, e.action.cast.targetsLimit);
|
||||
Acore::Containers::RandomResize(*targets, e.action.cast.targetsLimit);
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
{
|
||||
|
|
@ -793,7 +793,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
break;
|
||||
|
||||
if (e.action.cast.targetsLimit > 0 && targets->size() > e.action.cast.targetsLimit)
|
||||
acore::Containers::RandomResize(*targets, e.action.cast.targetsLimit);
|
||||
Acore::Containers::RandomResize(*targets, e.action.cast.targetsLimit);
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
{
|
||||
|
|
@ -1527,7 +1527,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
break;
|
||||
|
||||
// xinef: attack random target
|
||||
if (Unit* target = acore::Containers::SelectRandomContainerElement(*targets)->ToUnit())
|
||||
if (Unit* target = Acore::Containers::SelectRandomContainerElement(*targets)->ToUnit())
|
||||
me->AI()->AttackStart(target);
|
||||
|
||||
delete targets;
|
||||
|
|
@ -1944,7 +1944,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
if (ObjectList* targets = GetTargets(e, unit))
|
||||
{
|
||||
// xinef: we want to move to random element
|
||||
target = acore::Containers::SelectRandomContainerElement(*targets);
|
||||
target = Acore::Containers::SelectRandomContainerElement(*targets);
|
||||
delete targets;
|
||||
}
|
||||
}
|
||||
|
|
@ -2515,7 +2515,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
// xinef: my implementation
|
||||
if (e.action.jump.selfJump)
|
||||
{
|
||||
if (WorldObject* target = acore::Containers::SelectRandomContainerElement(*targets))
|
||||
if (WorldObject* target = Acore::Containers::SelectRandomContainerElement(*targets))
|
||||
if (me)
|
||||
me->GetMotionMaster()->MoveJump(target->GetPositionX() + e.target.x, target->GetPositionY() + e.target.y, target->GetPositionZ() + e.target.z, (float)e.action.jump.speedxy, (float)e.action.jump.speedz);
|
||||
}
|
||||
|
|
@ -3680,7 +3680,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
|||
l->push_back(*itr);
|
||||
|
||||
if (e.target.playerRange.maxCount > 0)
|
||||
acore::Containers::RandomResize(*l, e.target.playerRange.maxCount);
|
||||
Acore::Containers::RandomResize(*l, e.target.playerRange.maxCount);
|
||||
}
|
||||
|
||||
delete units;
|
||||
|
|
@ -3800,7 +3800,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
|||
l->push_back(*itr);
|
||||
|
||||
if (e.target.o > 0)
|
||||
acore::Containers::RandomResize(*l, e.target.o);
|
||||
Acore::Containers::RandomResize(*l, e.target.o);
|
||||
|
||||
delete units;
|
||||
break;
|
||||
|
|
@ -3842,7 +3842,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
|||
}
|
||||
|
||||
if (e.target.roleSelection.resize > 0)
|
||||
acore::Containers::RandomResize(*l, e.target.roleSelection.resize);
|
||||
Acore::Containers::RandomResize(*l, e.target.roleSelection.resize);
|
||||
|
||||
delete units;
|
||||
break;
|
||||
|
|
@ -3879,8 +3879,8 @@ ObjectList* SmartScript::GetWorldObjectsInDist(float dist)
|
|||
WorldObject* obj = GetBaseObject();
|
||||
if (obj)
|
||||
{
|
||||
acore::AllWorldObjectsInRange u_check(obj, dist);
|
||||
acore::WorldObjectListSearcher<acore::AllWorldObjectsInRange> searcher(obj, *targets, u_check);
|
||||
Acore::AllWorldObjectsInRange u_check(obj, dist);
|
||||
Acore::WorldObjectListSearcher<Acore::AllWorldObjectsInRange> searcher(obj, *targets, u_check);
|
||||
obj->VisitNearbyObject(dist, searcher);
|
||||
}
|
||||
return targets;
|
||||
|
|
@ -4010,7 +4010,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
|||
RecalcTimer(e, 1000, 3000);
|
||||
return;
|
||||
}
|
||||
ProcessTimedAction(e, e.event.friendlyCC.repeatMin, e.event.friendlyCC.repeatMax, acore::Containers::SelectRandomContainerElement(pList));
|
||||
ProcessTimedAction(e, e.event.friendlyCC.repeatMin, e.event.friendlyCC.repeatMax, Acore::Containers::SelectRandomContainerElement(pList));
|
||||
break;
|
||||
}
|
||||
case SMART_EVENT_FRIENDLY_MISSING_BUFF:
|
||||
|
|
@ -4021,7 +4021,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
|||
if (pList.empty())
|
||||
return;
|
||||
|
||||
ProcessTimedAction(e, e.event.missingBuff.repeatMin, e.event.missingBuff.repeatMax, acore::Containers::SelectRandomContainerElement(pList));
|
||||
ProcessTimedAction(e, e.event.missingBuff.repeatMin, e.event.missingBuff.repeatMax, Acore::Containers::SelectRandomContainerElement(pList));
|
||||
break;
|
||||
}
|
||||
case SMART_EVENT_HAS_AURA:
|
||||
|
|
@ -4862,8 +4862,8 @@ Unit* SmartScript::DoSelectLowestHpFriendly(float range, uint32 MinHPDiff)
|
|||
|
||||
Unit* unit = nullptr;
|
||||
|
||||
acore::MostHPMissingInRange u_check(me, range, MinHPDiff);
|
||||
acore::UnitLastSearcher<acore::MostHPMissingInRange> searcher(me, unit, u_check);
|
||||
Acore::MostHPMissingInRange u_check(me, range, MinHPDiff);
|
||||
Acore::UnitLastSearcher<Acore::MostHPMissingInRange> searcher(me, unit, u_check);
|
||||
me->VisitNearbyObject(range, searcher);
|
||||
return unit;
|
||||
}
|
||||
|
|
@ -4873,8 +4873,8 @@ void SmartScript::DoFindFriendlyCC(std::list<Creature*>& _list, float range)
|
|||
if (!me)
|
||||
return;
|
||||
|
||||
acore::FriendlyCCedInRange u_check(me, range);
|
||||
acore::CreatureListSearcher<acore::FriendlyCCedInRange> searcher(me, _list, u_check);
|
||||
Acore::FriendlyCCedInRange u_check(me, range);
|
||||
Acore::CreatureListSearcher<Acore::FriendlyCCedInRange> searcher(me, _list, u_check);
|
||||
me->VisitNearbyObject(range, searcher);
|
||||
}
|
||||
|
||||
|
|
@ -4883,8 +4883,8 @@ void SmartScript::DoFindFriendlyMissingBuff(std::list<Creature*>& list, float ra
|
|||
if (!me)
|
||||
return;
|
||||
|
||||
acore::FriendlyMissingBuffInRange u_check(me, range, spellid);
|
||||
acore::CreatureListSearcher<acore::FriendlyMissingBuffInRange> searcher(me, list, u_check);
|
||||
Acore::FriendlyMissingBuffInRange u_check(me, range, spellid);
|
||||
Acore::CreatureListSearcher<Acore::FriendlyMissingBuffInRange> searcher(me, list, u_check);
|
||||
me->VisitNearbyObject(range, searcher);
|
||||
}
|
||||
|
||||
|
|
@ -4894,8 +4894,8 @@ Unit* SmartScript::DoFindClosestFriendlyInRange(float range, bool playerOnly)
|
|||
return nullptr;
|
||||
|
||||
Unit* unit = nullptr;
|
||||
acore::AnyFriendlyNotSelfUnitInObjectRangeCheck u_check(me, me, range, playerOnly);
|
||||
acore::UnitLastSearcher<acore::AnyFriendlyNotSelfUnitInObjectRangeCheck> searcher(me, unit, u_check);
|
||||
Acore::AnyFriendlyNotSelfUnitInObjectRangeCheck u_check(me, me, range, playerOnly);
|
||||
Acore::UnitLastSearcher<Acore::AnyFriendlyNotSelfUnitInObjectRangeCheck> searcher(me, unit, u_check);
|
||||
me->VisitNearbyObject(range, searcher);
|
||||
return unit;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1120,7 +1120,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
|||
}
|
||||
case SMART_ACTION_LOAD_GRID:
|
||||
{
|
||||
if (!acore::IsValidMapCoord(e.target.x, e.target.y))
|
||||
if (!Acore::IsValidMapCoord(e.target.x, e.target.y))
|
||||
{
|
||||
LOG_ERROR("server", "SmartScript: SMART_ACTION_LOAD_GRID uses invalid map coords: %u, skipped.", e.entryOrGuid);
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ namespace AccountMgr
|
|||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT);
|
||||
|
||||
stmt->setString(0, username);
|
||||
auto [salt, verifier] = acore::Crypto::SRP6::MakeRegistrationData(username, password);
|
||||
auto [salt, verifier] = Acore::Crypto::SRP6::MakeRegistrationData(username, password);
|
||||
stmt->setBinary(1, salt);
|
||||
stmt->setBinary(2, verifier);
|
||||
stmt->setInt8(3, uint8(sWorld->getIntConfig(CONFIG_EXPANSION)));
|
||||
|
|
@ -147,7 +147,7 @@ namespace AccountMgr
|
|||
stmt->setUInt32(1, accountId);
|
||||
LoginDatabase.Execute(stmt);
|
||||
|
||||
auto [salt, verifier] = acore::Crypto::SRP6::MakeRegistrationData(newUsername, newPassword);
|
||||
auto [salt, verifier] = Acore::Crypto::SRP6::MakeRegistrationData(newUsername, newPassword);
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_LOGON);
|
||||
stmt->setBinary(0, salt);
|
||||
stmt->setBinary(1, verifier);
|
||||
|
|
@ -176,7 +176,7 @@ namespace AccountMgr
|
|||
Utf8ToUpperOnlyLatin(username);
|
||||
Utf8ToUpperOnlyLatin(newPassword);
|
||||
|
||||
auto [salt, verifier] = acore::Crypto::SRP6::MakeRegistrationData(username, newPassword);
|
||||
auto [salt, verifier] = Acore::Crypto::SRP6::MakeRegistrationData(username, newPassword);
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_LOGON);
|
||||
stmt->setBinary(0, salt);
|
||||
|
|
@ -245,9 +245,9 @@ namespace AccountMgr
|
|||
stmt->setUInt32(0, accountId);
|
||||
if (PreparedQueryResult result = LoginDatabase.Query(stmt))
|
||||
{
|
||||
acore::Crypto::SRP6::Salt salt = (*result)[0].GetBinary<acore::Crypto::SRP6::SALT_LENGTH>();
|
||||
acore::Crypto::SRP6::Verifier verifier = (*result)[1].GetBinary<acore::Crypto::SRP6::VERIFIER_LENGTH>();
|
||||
if (acore::Crypto::SRP6::CheckLogin(username, password, salt, verifier))
|
||||
Acore::Crypto::SRP6::Salt salt = (*result)[0].GetBinary<Acore::Crypto::SRP6::SALT_LENGTH>();
|
||||
Acore::Crypto::SRP6::Verifier verifier = (*result)[1].GetBinary<Acore::Crypto::SRP6::VERIFIER_LENGTH>();
|
||||
if (Acore::Crypto::SRP6::CheckLogin(username, password, salt, verifier))
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
class AchievementChatBuilder
|
||||
{
|
||||
|
|
@ -52,7 +52,7 @@ namespace acore
|
|||
int32 i_textId;
|
||||
uint32 i_achievementId;
|
||||
};
|
||||
} // namespace acore
|
||||
} // namespace Acore
|
||||
|
||||
bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
|
||||
{
|
||||
|
|
@ -668,8 +668,8 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
|
|||
Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildId());
|
||||
if (guild)
|
||||
{
|
||||
acore::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_GUILD_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED, achievement->ID);
|
||||
acore::LocalizedPacketDo<acore::AchievementChatBuilder> say_do(say_builder);
|
||||
Acore::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_GUILD_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED, achievement->ID);
|
||||
Acore::LocalizedPacketDo<Acore::AchievementChatBuilder> say_do(say_builder);
|
||||
guild->BroadcastWorker(say_do, GetPlayer());
|
||||
}
|
||||
|
||||
|
|
@ -706,15 +706,15 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
|
|||
// if player is in world he can tell his friends about new achievement
|
||||
else if (GetPlayer()->IsInWorld())
|
||||
{
|
||||
CellCoord p = acore::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY());
|
||||
CellCoord p = Acore::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED, achievement->ID);
|
||||
acore::LocalizedPacketDo<acore::AchievementChatBuilder> say_do(say_builder);
|
||||
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::AchievementChatBuilder> > say_worker(GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
|
||||
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::AchievementChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
Acore::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED, achievement->ID);
|
||||
Acore::LocalizedPacketDo<Acore::AchievementChatBuilder> say_do(say_builder);
|
||||
Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::AchievementChatBuilder> > say_worker(GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
|
||||
TypeContainerVisitor<Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::AchievementChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1003,8 +1003,8 @@ bool BfCapturePoint::Update(uint32 diff)
|
|||
}
|
||||
|
||||
std::list<Player*> players;
|
||||
acore::AnyPlayerInObjectRangeCheck checker(capturePoint, radius);
|
||||
acore::PlayerListSearcher<acore::AnyPlayerInObjectRangeCheck> searcher(capturePoint, players, checker);
|
||||
Acore::AnyPlayerInObjectRangeCheck checker(capturePoint, radius);
|
||||
Acore::PlayerListSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(capturePoint, players, checker);
|
||||
capturePoint->VisitNearbyWorldObject(radius, searcher);
|
||||
|
||||
for (std::list<Player*>::iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
class BattlegroundChatBuilder
|
||||
{
|
||||
|
|
@ -101,7 +101,7 @@ namespace acore
|
|||
uint32 _arg1;
|
||||
uint32 _arg2;
|
||||
};
|
||||
} // namespace acore
|
||||
} // namespace Acore
|
||||
|
||||
template<class Do>
|
||||
void Battleground::BroadcastWorker(Do& _do)
|
||||
|
|
@ -1067,7 +1067,7 @@ uint32 Battleground::GetBonusHonorFromKill(uint32 kills) const
|
|||
{
|
||||
//variable kills means how many honorable kills you scored (so we need kills * honor_for_one_kill)
|
||||
uint32 maxLevel = std::min<uint32>(GetMaxLevel(), 80U);
|
||||
return acore::Honor::hk_honor_at_level(maxLevel, float(kills));
|
||||
return Acore::Honor::hk_honor_at_level(maxLevel, float(kills));
|
||||
}
|
||||
|
||||
void Battleground::BlockMovement(Player* player)
|
||||
|
|
@ -1749,8 +1749,8 @@ void Battleground::SendMessageToAll(uint32 entry, ChatMsg type, Player const* so
|
|||
if (!entry)
|
||||
return;
|
||||
|
||||
acore::BattlegroundChatBuilder bg_builder(type, entry, source);
|
||||
acore::LocalizedPacketDo<acore::BattlegroundChatBuilder> bg_do(bg_builder);
|
||||
Acore::BattlegroundChatBuilder bg_builder(type, entry, source);
|
||||
Acore::LocalizedPacketDo<Acore::BattlegroundChatBuilder> bg_do(bg_builder);
|
||||
BroadcastWorker(bg_do);
|
||||
}
|
||||
|
||||
|
|
@ -1762,8 +1762,8 @@ void Battleground::PSendMessageToAll(uint32 entry, ChatMsg type, Player const* s
|
|||
va_list ap;
|
||||
va_start(ap, source);
|
||||
|
||||
acore::BattlegroundChatBuilder bg_builder(type, entry, source, &ap);
|
||||
acore::LocalizedPacketDo<acore::BattlegroundChatBuilder> bg_do(bg_builder);
|
||||
Acore::BattlegroundChatBuilder bg_builder(type, entry, source, &ap);
|
||||
Acore::LocalizedPacketDo<Acore::BattlegroundChatBuilder> bg_do(bg_builder);
|
||||
BroadcastWorker(bg_do);
|
||||
|
||||
va_end(ap);
|
||||
|
|
@ -1796,8 +1796,8 @@ void Battleground::SendWarningToAll(uint32 entry, ...)
|
|||
|
||||
void Battleground::SendMessage2ToAll(uint32 entry, ChatMsg type, Player const* source, uint32 arg1, uint32 arg2)
|
||||
{
|
||||
acore::Battleground2ChatBuilder bg_builder(type, entry, source, arg1, arg2);
|
||||
acore::LocalizedPacketDo<acore::Battleground2ChatBuilder> bg_do(bg_builder);
|
||||
Acore::Battleground2ChatBuilder bg_builder(type, entry, source, arg1, arg2);
|
||||
Acore::LocalizedPacketDo<Acore::Battleground2ChatBuilder> bg_do(bg_builder);
|
||||
BroadcastWorker(bg_do);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -655,8 +655,8 @@ void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket* data, ObjectGuid
|
|||
uint32 winner_arena = player->GetRandomWinner() ? sWorld->getIntConfig(CONFIG_BG_REWARD_WINNER_ARENA_LAST) : sWorld->getIntConfig(CONFIG_BG_REWARD_WINNER_ARENA_FIRST);
|
||||
uint32 loser_kills = player->GetRandomWinner() ? sWorld->getIntConfig(CONFIG_BG_REWARD_LOSER_HONOR_LAST) : sWorld->getIntConfig(CONFIG_BG_REWARD_LOSER_HONOR_FIRST);
|
||||
|
||||
winner_kills = acore::Honor::hk_honor_at_level(player->getLevel(), float(winner_kills));
|
||||
loser_kills = acore::Honor::hk_honor_at_level(player->getLevel(), float(loser_kills));
|
||||
winner_kills = Acore::Honor::hk_honor_at_level(player->getLevel(), float(winner_kills));
|
||||
loser_kills = Acore::Honor::hk_honor_at_level(player->getLevel(), float(loser_kills));
|
||||
|
||||
data->Initialize(SMSG_BATTLEFIELD_LIST);
|
||||
*data << guid; // battlemaster guid
|
||||
|
|
@ -971,7 +971,7 @@ BattlegroundTypeId BattlegroundMgr::GetRandomBG(BattlegroundTypeId bgTypeId)
|
|||
}
|
||||
}
|
||||
|
||||
return *acore::Containers::SelectRandomWeightedContainerElement(ids, weights);
|
||||
return *Acore::Containers::SelectRandomWeightedContainerElement(ids, weights);
|
||||
}
|
||||
|
||||
return BATTLEGROUND_TYPE_NONE;
|
||||
|
|
|
|||
|
|
@ -886,8 +886,8 @@ GameObject* ChatHandler::GetNearbyGameObject()
|
|||
|
||||
Player* pl = m_session->GetPlayer();
|
||||
GameObject* obj = nullptr;
|
||||
acore::NearestGameObjectCheck check(*pl);
|
||||
acore::GameObjectLastSearcher<acore::NearestGameObjectCheck> searcher(pl, obj, check);
|
||||
Acore::NearestGameObjectCheck check(*pl);
|
||||
Acore::GameObjectLastSearcher<Acore::NearestGameObjectCheck> searcher(pl, obj, check);
|
||||
pl->VisitNearbyGridObject(SIZE_OF_GRIDS, searcher);
|
||||
return obj;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ void ThreatContainer::modifyThreatPercent(Unit* victim, int32 percent)
|
|||
void ThreatContainer::update()
|
||||
{
|
||||
if (iDirty && iThreatList.size() > 1)
|
||||
iThreatList.sort(acore::ThreatOrderPred());
|
||||
iThreatList.sort(Acore::ThreatOrderPred());
|
||||
|
||||
iDirty = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@ private:
|
|||
|
||||
//=================================================
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
// Binary predicate for sorting HostileReferences based on threat value
|
||||
class ThreatOrderPred
|
||||
|
|
|
|||
|
|
@ -413,7 +413,7 @@ namespace lfg
|
|||
proposal.cancelTime = time(nullptr) + LFG_TIME_PROPOSAL;
|
||||
proposal.state = LFG_PROPOSAL_INITIATING;
|
||||
proposal.leader.Clear();
|
||||
proposal.dungeonId = acore::Containers::SelectRandomContainerElement(proposalDungeons);
|
||||
proposal.dungeonId = Acore::Containers::SelectRandomContainerElement(proposalDungeons);
|
||||
|
||||
bool leader = false;
|
||||
for (LfgRolesMap::const_iterator itRoles = proposalRoles.begin(); itRoles != proposalRoles.end(); ++itRoles)
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ bool Corpse::Create(ObjectGuid::LowType guidlow, Player* owner)
|
|||
SetObjectScale(1);
|
||||
SetGuidValue(CORPSE_FIELD_OWNER, owner->GetGUID());
|
||||
|
||||
_cellCoord = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
_cellCoord = Acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -162,7 +162,7 @@ bool Corpse::LoadCorpseFromDB(ObjectGuid::LowType guid, Field* fields)
|
|||
return false;
|
||||
}
|
||||
|
||||
_cellCoord = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
_cellCoord = Acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -254,7 +254,7 @@ void Creature::RemoveFromWorld()
|
|||
Unit::RemoveFromWorld();
|
||||
|
||||
if (m_spawnId)
|
||||
acore::Containers::MultimapErasePair(GetMap()->GetCreatureBySpawnIdStore(), m_spawnId, this);
|
||||
Acore::Containers::MultimapErasePair(GetMap()->GetCreatureBySpawnIdStore(), m_spawnId, this);
|
||||
|
||||
GetMap()->GetObjectsStore().Remove<Creature>(GetGUID());
|
||||
}
|
||||
|
|
@ -888,13 +888,13 @@ void Creature::DoFleeToGetAssistance()
|
|||
{
|
||||
Creature* creature = nullptr;
|
||||
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(Acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
acore::NearestAssistCreatureInCreatureRangeCheck u_check(this, GetVictim(), radius);
|
||||
acore::CreatureLastSearcher<acore::NearestAssistCreatureInCreatureRangeCheck> searcher(this, creature, u_check);
|
||||
Acore::NearestAssistCreatureInCreatureRangeCheck u_check(this, GetVictim(), radius);
|
||||
Acore::CreatureLastSearcher<Acore::NearestAssistCreatureInCreatureRangeCheck> searcher(this, creature, u_check);
|
||||
|
||||
TypeContainerVisitor<acore::CreatureLastSearcher<acore::NearestAssistCreatureInCreatureRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
|
||||
TypeContainerVisitor<Acore::CreatureLastSearcher<Acore::NearestAssistCreatureInCreatureRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
|
||||
|
||||
cell.Visit(p, grid_creature_searcher, *GetMap(), *this, radius);
|
||||
|
||||
|
|
@ -1545,7 +1545,7 @@ bool Creature::LoadCreatureFromDB(ObjectGuid::LowType spawnId, Map* map, bool ad
|
|||
if (CanFly())
|
||||
{
|
||||
float tz = map->GetHeight(GetPhaseMask(), data->posX, data->posY, data->posZ, true, MAX_FALL_DISTANCE);
|
||||
if (data->posZ - tz > 0.1f && acore::IsValidMapCoord(tz))
|
||||
if (data->posZ - tz > 0.1f && Acore::IsValidMapCoord(tz))
|
||||
{
|
||||
Relocate(data->posX, data->posY, tz);
|
||||
}
|
||||
|
|
@ -2077,7 +2077,7 @@ SpellInfo const* Creature::reachWithSpellCure(Unit* victim)
|
|||
// select nearest hostile unit within the given distance (regardless of threat list).
|
||||
Unit* Creature::SelectNearestTarget(float dist, bool playerOnly /* = false */) const
|
||||
{
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(Acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
|
|
@ -2087,11 +2087,11 @@ Unit* Creature::SelectNearestTarget(float dist, bool playerOnly /* = false */) c
|
|||
if (dist == 0.0f)
|
||||
dist = MAX_SEARCHER_DISTANCE;
|
||||
|
||||
acore::NearestHostileUnitCheck u_check(this, dist, playerOnly);
|
||||
acore::UnitLastSearcher<acore::NearestHostileUnitCheck> searcher(this, target, u_check);
|
||||
Acore::NearestHostileUnitCheck u_check(this, dist, playerOnly);
|
||||
Acore::UnitLastSearcher<Acore::NearestHostileUnitCheck> searcher(this, target, u_check);
|
||||
|
||||
TypeContainerVisitor<acore::UnitLastSearcher<acore::NearestHostileUnitCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
|
||||
TypeContainerVisitor<acore::UnitLastSearcher<acore::NearestHostileUnitCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
|
||||
TypeContainerVisitor<Acore::UnitLastSearcher<Acore::NearestHostileUnitCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
|
||||
TypeContainerVisitor<Acore::UnitLastSearcher<Acore::NearestHostileUnitCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
|
||||
|
||||
cell.Visit(p, world_unit_searcher, *GetMap(), *this, dist);
|
||||
cell.Visit(p, grid_unit_searcher, *GetMap(), *this, dist);
|
||||
|
|
@ -2103,7 +2103,7 @@ Unit* Creature::SelectNearestTarget(float dist, bool playerOnly /* = false */) c
|
|||
// select nearest hostile unit within the given attack distance (i.e. distance is ignored if > than ATTACK_DISTANCE), regardless of threat list.
|
||||
Unit* Creature::SelectNearestTargetInAttackDistance(float dist) const
|
||||
{
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(Acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
|
|
@ -2115,11 +2115,11 @@ Unit* Creature::SelectNearestTargetInAttackDistance(float dist) const
|
|||
dist = MAX_SEARCHER_DISTANCE;
|
||||
|
||||
{
|
||||
acore::NearestHostileUnitInAttackDistanceCheck u_check(this, dist);
|
||||
acore::UnitLastSearcher<acore::NearestHostileUnitInAttackDistanceCheck> searcher(this, target, u_check);
|
||||
Acore::NearestHostileUnitInAttackDistanceCheck u_check(this, dist);
|
||||
Acore::UnitLastSearcher<Acore::NearestHostileUnitInAttackDistanceCheck> searcher(this, target, u_check);
|
||||
|
||||
TypeContainerVisitor<acore::UnitLastSearcher<acore::NearestHostileUnitInAttackDistanceCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
|
||||
TypeContainerVisitor<acore::UnitLastSearcher<acore::NearestHostileUnitInAttackDistanceCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
|
||||
TypeContainerVisitor<Acore::UnitLastSearcher<Acore::NearestHostileUnitInAttackDistanceCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
|
||||
TypeContainerVisitor<Acore::UnitLastSearcher<Acore::NearestHostileUnitInAttackDistanceCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
|
||||
|
||||
cell.Visit(p, world_unit_searcher, *GetMap(), *this, dist);
|
||||
cell.Visit(p, grid_unit_searcher, *GetMap(), *this, dist);
|
||||
|
|
@ -2155,14 +2155,14 @@ void Creature::CallAssistance()
|
|||
std::list<Creature*> assistList;
|
||||
|
||||
{
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(Acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::AnyAssistCreatureInRangeCheck u_check(this, GetVictim(), radius);
|
||||
acore::CreatureListSearcher<acore::AnyAssistCreatureInRangeCheck> searcher(this, assistList, u_check);
|
||||
Acore::AnyAssistCreatureInRangeCheck u_check(this, GetVictim(), radius);
|
||||
Acore::CreatureListSearcher<Acore::AnyAssistCreatureInRangeCheck> searcher(this, assistList, u_check);
|
||||
|
||||
TypeContainerVisitor<acore::CreatureListSearcher<acore::AnyAssistCreatureInRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
|
||||
TypeContainerVisitor<Acore::CreatureListSearcher<Acore::AnyAssistCreatureInRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
|
||||
|
||||
cell.Visit(p, grid_creature_searcher, *GetMap(), *this, radius);
|
||||
}
|
||||
|
|
@ -2187,14 +2187,14 @@ void Creature::CallForHelp(float radius)
|
|||
if (radius <= 0.0f || !GetVictim() || IsPet() || IsCharmed())
|
||||
return;
|
||||
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(Acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::CallOfHelpCreatureInRangeDo u_do(this, GetVictim(), radius);
|
||||
acore::CreatureWorker<acore::CallOfHelpCreatureInRangeDo> worker(this, u_do);
|
||||
Acore::CallOfHelpCreatureInRangeDo u_do(this, GetVictim(), radius);
|
||||
Acore::CreatureWorker<Acore::CallOfHelpCreatureInRangeDo> worker(this, u_do);
|
||||
|
||||
TypeContainerVisitor<acore::CreatureWorker<acore::CallOfHelpCreatureInRangeDo>, GridTypeMapContainer > grid_creature_searcher(worker);
|
||||
TypeContainerVisitor<Acore::CreatureWorker<Acore::CallOfHelpCreatureInRangeDo>, GridTypeMapContainer > grid_creature_searcher(worker);
|
||||
|
||||
cell.Visit(p, grid_creature_searcher, *GetMap(), *this, radius);
|
||||
}
|
||||
|
|
@ -2828,7 +2828,7 @@ std::string const& Creature::GetNameForLocaleIdx(LocaleConstant loc_idx) const
|
|||
|
||||
void Creature::SetPosition(float x, float y, float z, float o)
|
||||
{
|
||||
if (!acore::IsValidMapCoord(x, y, z, o))
|
||||
if (!Acore::IsValidMapCoord(x, y, z, o))
|
||||
return;
|
||||
|
||||
GetMap()->CreatureRelocation(this, x, y, z, o);
|
||||
|
|
|
|||
|
|
@ -262,8 +262,8 @@ void CreatureGroup::LeaderMoveTo(float x, float y, float z, bool run)
|
|||
float dy = y + sin(followAngle + pathAngle) * followDist;
|
||||
float dz = z;
|
||||
|
||||
acore::NormalizeMapCoord(dx);
|
||||
acore::NormalizeMapCoord(dy);
|
||||
Acore::NormalizeMapCoord(dx);
|
||||
Acore::NormalizeMapCoord(dy);
|
||||
|
||||
member->UpdateGroundPositionZ(dx, dy, dz);
|
||||
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ void GameObject::RemoveFromWorld()
|
|||
WorldObject::RemoveFromWorld();
|
||||
|
||||
if (m_spawnId)
|
||||
acore::Containers::MultimapErasePair(GetMap()->GetGameObjectBySpawnIdStore(), m_spawnId, this);
|
||||
Acore::Containers::MultimapErasePair(GetMap()->GetGameObjectBySpawnIdStore(), m_spawnId, this);
|
||||
GetMap()->GetObjectsStore().Remove<GameObject>(GetGUID());
|
||||
}
|
||||
}
|
||||
|
|
@ -459,7 +459,7 @@ void GameObject::Update(uint32 diff)
|
|||
if (info->summoningRitual.casterTargetSpell && info->summoningRitual.casterTargetSpell != 1) // No idea why this field is a bool in some cases
|
||||
for (uint32 i = 0; i < info->summoningRitual.casterTargetSpellTargets; i++)
|
||||
// m_unique_users can contain only player GUIDs
|
||||
if (Player* target = ObjectAccessor::GetPlayer(*this, acore::Containers::SelectRandomContainerElement(m_unique_users)))
|
||||
if (Player* target = ObjectAccessor::GetPlayer(*this, Acore::Containers::SelectRandomContainerElement(m_unique_users)))
|
||||
spellCaster->CastSpell(target, info->summoningRitual.casterTargetSpell, true);
|
||||
|
||||
// finish owners spell
|
||||
|
|
@ -608,8 +608,8 @@ void GameObject::Update(uint32 diff)
|
|||
// search unfriendly creature
|
||||
if (owner) // hunter trap
|
||||
{
|
||||
acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck checker(this, owner, radius);
|
||||
acore::UnitSearcher<acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> searcher(this, target, checker);
|
||||
Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck checker(this, owner, radius);
|
||||
Acore::UnitSearcher<Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> searcher(this, target, checker);
|
||||
VisitNearbyGridObject(radius, searcher);
|
||||
if (!target)
|
||||
VisitNearbyWorldObject(radius, searcher);
|
||||
|
|
@ -619,8 +619,8 @@ void GameObject::Update(uint32 diff)
|
|||
// environmental damage spells already have around enemies targeting but this not help in case not existed GO casting support
|
||||
// affect only players
|
||||
Player* player = nullptr;
|
||||
acore::AnyPlayerInObjectRangeCheck checker(this, radius, true, true);
|
||||
acore::PlayerSearcher<acore::AnyPlayerInObjectRangeCheck> searcher(this, player, checker);
|
||||
Acore::AnyPlayerInObjectRangeCheck checker(this, radius, true, true);
|
||||
Acore::PlayerSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(this, player, checker);
|
||||
VisitNearbyWorldObject(radius, searcher);
|
||||
target = player;
|
||||
}
|
||||
|
|
@ -1189,13 +1189,13 @@ void GameObject::TriggeringLinkedGameObject(uint32 trapEntry, Unit* target)
|
|||
GameObject* trapGO = nullptr;
|
||||
{
|
||||
// using original GO distance
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(Acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
|
||||
acore::NearestGameObjectEntryInObjectRangeCheck go_check(*target, trapEntry, range);
|
||||
acore::GameObjectLastSearcher<acore::NearestGameObjectEntryInObjectRangeCheck> checker(this, trapGO, go_check);
|
||||
Acore::NearestGameObjectEntryInObjectRangeCheck go_check(*target, trapEntry, range);
|
||||
Acore::GameObjectLastSearcher<Acore::NearestGameObjectEntryInObjectRangeCheck> checker(this, trapGO, go_check);
|
||||
|
||||
TypeContainerVisitor<acore::GameObjectLastSearcher<acore::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer > object_checker(checker);
|
||||
TypeContainerVisitor<Acore::GameObjectLastSearcher<Acore::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer > object_checker(checker);
|
||||
cell.Visit(p, object_checker, *GetMap(), *target, range);
|
||||
}
|
||||
|
||||
|
|
@ -1209,12 +1209,12 @@ GameObject* GameObject::LookupFishingHoleAround(float range)
|
|||
{
|
||||
GameObject* ok = nullptr;
|
||||
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(Acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
acore::NearestGameObjectFishingHole u_check(*this, range);
|
||||
acore::GameObjectSearcher<acore::NearestGameObjectFishingHole> checker(this, ok, u_check);
|
||||
Acore::NearestGameObjectFishingHole u_check(*this, range);
|
||||
Acore::GameObjectSearcher<Acore::NearestGameObjectFishingHole> checker(this, ok, u_check);
|
||||
|
||||
TypeContainerVisitor<acore::GameObjectSearcher<acore::NearestGameObjectFishingHole>, GridTypeMapContainer > grid_object_checker(checker);
|
||||
TypeContainerVisitor<Acore::GameObjectSearcher<Acore::NearestGameObjectFishingHole>, GridTypeMapContainer > grid_object_checker(checker);
|
||||
cell.Visit(p, grid_object_checker, *GetMap(), *this, range);
|
||||
|
||||
return ok;
|
||||
|
|
@ -1977,7 +1977,7 @@ void GameObject::SendMessageToSetInRange(WorldPacket* data, float dist, bool /*s
|
|||
dist += GetObjectSize();
|
||||
if (includeMargin)
|
||||
dist += VISIBILITY_COMPENSATION * 2.0f; // pussywizard: to ensure everyone receives all important packets
|
||||
acore::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
|
||||
Acore::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
|
||||
VisitNearbyWorldObject(dist, notifier);
|
||||
}
|
||||
|
||||
|
|
@ -2481,7 +2481,7 @@ void GameObject::SetPosition(float x, float y, float z, float o)
|
|||
{
|
||||
// pussywizard: do not call for MotionTransport and other gobjects not in grid
|
||||
|
||||
if (!acore::IsValidMapCoord(x, y, z, o))
|
||||
if (!Acore::IsValidMapCoord(x, y, z, o))
|
||||
return;
|
||||
|
||||
GetMap()->GameObjectRelocation(this, x, y, z, o);
|
||||
|
|
|
|||
|
|
@ -1410,8 +1410,8 @@ void WorldObject::GetRandomPoint(const Position& pos, float distance, float& ran
|
|||
rand_y = pos.m_positionY + new_dist * sin(angle);
|
||||
rand_z = pos.m_positionZ;
|
||||
|
||||
acore::NormalizeMapCoord(rand_x);
|
||||
acore::NormalizeMapCoord(rand_y);
|
||||
Acore::NormalizeMapCoord(rand_x);
|
||||
Acore::NormalizeMapCoord(rand_y);
|
||||
UpdateGroundPositionZ(rand_x, rand_y, rand_z); // update to LOS height if available
|
||||
}
|
||||
|
||||
|
|
@ -1510,7 +1510,7 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float& z, float* grou
|
|||
|
||||
bool Position::IsPositionValid() const
|
||||
{
|
||||
return acore::IsValidMapCoord(m_positionX, m_positionY, m_positionZ, m_orientation);
|
||||
return Acore::IsValidMapCoord(m_positionX, m_positionY, m_positionZ, m_orientation);
|
||||
}
|
||||
|
||||
float WorldObject::GetGridActivationRange() const
|
||||
|
|
@ -1900,7 +1900,7 @@ void Object::ForceValuesUpdateAtIndex(uint32 i)
|
|||
AddToObjectUpdateIfNeeded();
|
||||
}
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
class MonsterChatBuilder
|
||||
{
|
||||
|
|
@ -1948,61 +1948,61 @@ namespace acore
|
|||
Language i_language;
|
||||
WorldObject const* i_target;
|
||||
};
|
||||
} // namespace acore
|
||||
} // namespace Acore
|
||||
|
||||
void WorldObject::MonsterSay(const char* text, uint32 language, WorldObject const* target)
|
||||
{
|
||||
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
CellCoord p = Acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, text, language, target);
|
||||
acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> say_do(say_build);
|
||||
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
|
||||
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
Acore::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, text, language, target);
|
||||
Acore::LocalizedPacketDo<Acore::MonsterCustomChatBuilder> say_do(say_build);
|
||||
Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterCustomChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
|
||||
TypeContainerVisitor<Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterCustomChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
|
||||
}
|
||||
|
||||
void WorldObject::MonsterSay(int32 textId, uint32 language, WorldObject const* target)
|
||||
{
|
||||
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
CellCoord p = Acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, textId, language, target);
|
||||
acore::LocalizedPacketDo<acore::MonsterChatBuilder> say_do(say_build);
|
||||
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
|
||||
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
Acore::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, textId, language, target);
|
||||
Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> say_do(say_build);
|
||||
Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
|
||||
TypeContainerVisitor<Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
|
||||
}
|
||||
|
||||
void WorldObject::MonsterYell(const char* text, uint32 language, WorldObject const* target)
|
||||
{
|
||||
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
CellCoord p = Acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, text, language, target);
|
||||
acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> say_do(say_build);
|
||||
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do);
|
||||
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
Acore::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, text, language, target);
|
||||
Acore::LocalizedPacketDo<Acore::MonsterCustomChatBuilder> say_do(say_build);
|
||||
Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterCustomChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do);
|
||||
TypeContainerVisitor<Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterCustomChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL));
|
||||
}
|
||||
|
||||
void WorldObject::MonsterYell(int32 textId, uint32 language, WorldObject const* target)
|
||||
{
|
||||
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
CellCoord p = Acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, textId, language, target);
|
||||
acore::LocalizedPacketDo<acore::MonsterChatBuilder> say_do(say_build);
|
||||
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do);
|
||||
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
Acore::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, textId, language, target);
|
||||
Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> say_do(say_build);
|
||||
Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do);
|
||||
TypeContainerVisitor<Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL));
|
||||
}
|
||||
|
||||
|
|
@ -2016,15 +2016,15 @@ void WorldObject::MonsterTextEmote(const char* text, WorldObject const* target,
|
|||
|
||||
void WorldObject::MonsterTextEmote(int32 textId, WorldObject const* target, bool IsBossEmote)
|
||||
{
|
||||
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
CellCoord p = Acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::MonsterChatBuilder say_build(this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId, LANG_UNIVERSAL, target);
|
||||
acore::LocalizedPacketDo<acore::MonsterChatBuilder> say_do(say_build);
|
||||
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> > say_worker(this, (IsBossEmote ? 200.0f : sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)), say_do);
|
||||
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
Acore::MonsterChatBuilder say_build(this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId, LANG_UNIVERSAL, target);
|
||||
Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> say_do(say_build);
|
||||
Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> > say_worker(this, (IsBossEmote ? 200.0f : sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)), say_do);
|
||||
TypeContainerVisitor<Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetMap(), *this, (IsBossEmote ? 200.0f : sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)));
|
||||
}
|
||||
|
||||
|
|
@ -2072,7 +2072,7 @@ void WorldObject::SendMessageToSetInRange(WorldPacket* data, float dist, bool /*
|
|||
dist += GetObjectSize();
|
||||
if (includeMargin)
|
||||
dist += VISIBILITY_COMPENSATION; // pussywizard: to ensure everyone receives all important packets
|
||||
acore::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
|
||||
Acore::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
|
||||
VisitNearbyWorldObject(dist, notifier);
|
||||
}
|
||||
|
||||
|
|
@ -2404,8 +2404,8 @@ void WorldObject::SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list
|
|||
Creature* WorldObject::FindNearestCreature(uint32 entry, float range, bool alive) const
|
||||
{
|
||||
Creature* creature = nullptr;
|
||||
acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck checker(*this, entry, alive, range);
|
||||
acore::CreatureLastSearcher<acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(this, creature, checker);
|
||||
Acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck checker(*this, entry, alive, range);
|
||||
Acore::CreatureLastSearcher<Acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(this, creature, checker);
|
||||
VisitNearbyObject(range, searcher);
|
||||
return creature;
|
||||
}
|
||||
|
|
@ -2413,8 +2413,8 @@ Creature* WorldObject::FindNearestCreature(uint32 entry, float range, bool alive
|
|||
GameObject* WorldObject::FindNearestGameObject(uint32 entry, float range) const
|
||||
{
|
||||
GameObject* go = nullptr;
|
||||
acore::NearestGameObjectEntryInObjectRangeCheck checker(*this, entry, range);
|
||||
acore::GameObjectLastSearcher<acore::NearestGameObjectEntryInObjectRangeCheck> searcher(this, go, checker);
|
||||
Acore::NearestGameObjectEntryInObjectRangeCheck checker(*this, entry, range);
|
||||
Acore::GameObjectLastSearcher<Acore::NearestGameObjectEntryInObjectRangeCheck> searcher(this, go, checker);
|
||||
VisitNearbyGridObject(range, searcher);
|
||||
return go;
|
||||
}
|
||||
|
|
@ -2422,8 +2422,8 @@ GameObject* WorldObject::FindNearestGameObject(uint32 entry, float range) const
|
|||
GameObject* WorldObject::FindNearestGameObjectOfType(GameobjectTypes type, float range) const
|
||||
{
|
||||
GameObject* go = nullptr;
|
||||
acore::NearestGameObjectTypeInObjectRangeCheck checker(*this, type, range);
|
||||
acore::GameObjectLastSearcher<acore::NearestGameObjectTypeInObjectRangeCheck> searcher(this, go, checker);
|
||||
Acore::NearestGameObjectTypeInObjectRangeCheck checker(*this, type, range);
|
||||
Acore::GameObjectLastSearcher<Acore::NearestGameObjectTypeInObjectRangeCheck> searcher(this, go, checker);
|
||||
VisitNearbyGridObject(range, searcher);
|
||||
return go;
|
||||
}
|
||||
|
|
@ -2432,8 +2432,8 @@ Player* WorldObject::SelectNearestPlayer(float distance) const
|
|||
{
|
||||
Player* target = nullptr;
|
||||
|
||||
acore::NearestPlayerInObjectRangeCheck checker(this, distance);
|
||||
acore::PlayerLastSearcher<acore::NearestPlayerInObjectRangeCheck> searcher(this, target, checker);
|
||||
Acore::NearestPlayerInObjectRangeCheck checker(this, distance);
|
||||
Acore::PlayerLastSearcher<Acore::NearestPlayerInObjectRangeCheck> searcher(this, target, checker);
|
||||
VisitNearbyObject(distance, searcher);
|
||||
|
||||
return target;
|
||||
|
|
@ -2441,32 +2441,32 @@ Player* WorldObject::SelectNearestPlayer(float distance) const
|
|||
|
||||
void WorldObject::GetGameObjectListWithEntryInGrid(std::list<GameObject*>& gameobjectList, uint32 entry, float maxSearchRange) const
|
||||
{
|
||||
CellCoord pair(acore::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
CellCoord pair(Acore::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
Cell cell(pair);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::AllGameObjectsWithEntryInRange check(this, entry, maxSearchRange);
|
||||
acore::GameObjectListSearcher<acore::AllGameObjectsWithEntryInRange> searcher(this, gameobjectList, check);
|
||||
TypeContainerVisitor<acore::GameObjectListSearcher<acore::AllGameObjectsWithEntryInRange>, GridTypeMapContainer> visitor(searcher);
|
||||
Acore::AllGameObjectsWithEntryInRange check(this, entry, maxSearchRange);
|
||||
Acore::GameObjectListSearcher<Acore::AllGameObjectsWithEntryInRange> searcher(this, gameobjectList, check);
|
||||
TypeContainerVisitor<Acore::GameObjectListSearcher<Acore::AllGameObjectsWithEntryInRange>, GridTypeMapContainer> visitor(searcher);
|
||||
|
||||
cell.Visit(pair, visitor, *(this->GetMap()), *this, maxSearchRange);
|
||||
}
|
||||
|
||||
void WorldObject::GetCreatureListWithEntryInGrid(std::list<Creature*>& creatureList, uint32 entry, float maxSearchRange) const
|
||||
{
|
||||
CellCoord pair(acore::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
CellCoord pair(Acore::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
Cell cell(pair);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::AllCreaturesOfEntryInRange check(this, entry, maxSearchRange);
|
||||
acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
|
||||
TypeContainerVisitor<acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange>, GridTypeMapContainer> visitor(searcher);
|
||||
Acore::AllCreaturesOfEntryInRange check(this, entry, maxSearchRange);
|
||||
Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
|
||||
TypeContainerVisitor<Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange>, GridTypeMapContainer> visitor(searcher);
|
||||
|
||||
cell.Visit(pair, visitor, *(this->GetMap()), *this, maxSearchRange);
|
||||
}
|
||||
|
||||
/*
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
class NearUsedPosDo
|
||||
{
|
||||
|
|
@ -2535,7 +2535,7 @@ namespace acore
|
|||
float i_angle;
|
||||
ObjectPosSelector& i_selector;
|
||||
};
|
||||
} // namespace acore
|
||||
} // namespace Acore
|
||||
*/
|
||||
|
||||
//===================================================================================================
|
||||
|
|
@ -2565,8 +2565,8 @@ void WorldObject::GetNearPoint2D(WorldObject const* searcher, float& x, float& y
|
|||
x = GetPositionX() + (effectiveReach + distance2d) * std::cos(absAngle);
|
||||
y = GetPositionY() + (effectiveReach + distance2d) * std::sin(absAngle);
|
||||
|
||||
acore::NormalizeMapCoord(x);
|
||||
acore::NormalizeMapCoord(y);
|
||||
Acore::NormalizeMapCoord(x);
|
||||
Acore::NormalizeMapCoord(y);
|
||||
}
|
||||
|
||||
void WorldObject::GetNearPoint2D(float& x, float& y, float distance2d, float absAngle) const
|
||||
|
|
@ -2702,7 +2702,7 @@ void WorldObject::MovePosition(Position& pos, float dist, float angle)
|
|||
desty = pos.m_positionY + dist * sin(angle);
|
||||
|
||||
// Prevent invalid coordinates here, position is unchanged
|
||||
if (!acore::IsValidMapCoord(destx, desty))
|
||||
if (!Acore::IsValidMapCoord(destx, desty))
|
||||
{
|
||||
LOG_FATAL("server", "WorldObject::MovePosition invalid coordinates X: %f and Y: %f were passed!", destx, desty);
|
||||
return;
|
||||
|
|
@ -2733,8 +2733,8 @@ void WorldObject::MovePosition(Position& pos, float dist, float angle)
|
|||
}
|
||||
}
|
||||
|
||||
acore::NormalizeMapCoord(pos.m_positionX);
|
||||
acore::NormalizeMapCoord(pos.m_positionY);
|
||||
Acore::NormalizeMapCoord(pos.m_positionX);
|
||||
Acore::NormalizeMapCoord(pos.m_positionY);
|
||||
UpdateGroundPositionZ(pos.m_positionX, pos.m_positionY, pos.m_positionZ);
|
||||
pos.m_orientation = m_orientation;
|
||||
}
|
||||
|
|
@ -2841,8 +2841,8 @@ void WorldObject::DestroyForNearbyPlayers()
|
|||
return;
|
||||
|
||||
std::list<Player*> targets;
|
||||
acore::AnyPlayerInObjectRangeCheck check(this, GetVisibilityRange() + VISIBILITY_COMPENSATION, false);
|
||||
acore::PlayerListSearcherWithSharedVision<acore::AnyPlayerInObjectRangeCheck> searcher(this, targets, check);
|
||||
Acore::AnyPlayerInObjectRangeCheck check(this, GetVisibilityRange() + VISIBILITY_COMPENSATION, false);
|
||||
Acore::PlayerListSearcherWithSharedVision<Acore::AnyPlayerInObjectRangeCheck> searcher(this, targets, check);
|
||||
VisitNearbyWorldObject(GetVisibilityRange() + VISIBILITY_COMPENSATION, searcher);
|
||||
for (std::list<Player*>::const_iterator iter = targets.begin(); iter != targets.end(); ++iter)
|
||||
{
|
||||
|
|
@ -2865,7 +2865,7 @@ void WorldObject::DestroyForNearbyPlayers()
|
|||
void WorldObject::UpdateObjectVisibility(bool /*forced*/, bool /*fromUpdate*/)
|
||||
{
|
||||
//updates object's visibility for nearby players
|
||||
acore::VisibleChangesNotifier notifier(*this);
|
||||
Acore::VisibleChangesNotifier notifier(*this);
|
||||
VisitNearbyWorldObject(GetVisibilityRange() + VISIBILITY_COMPENSATION, notifier);
|
||||
}
|
||||
|
||||
|
|
@ -2970,7 +2970,7 @@ struct WorldObjectChangeAccumulator
|
|||
|
||||
void WorldObject::BuildUpdate(UpdateDataMapType& data_map, UpdatePlayerSet& player_set)
|
||||
{
|
||||
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
CellCoord p = Acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
WorldObjectChangeAccumulator notifier(*this, data_map, player_set);
|
||||
|
|
@ -2984,17 +2984,17 @@ void WorldObject::BuildUpdate(UpdateDataMapType& data_map, UpdatePlayerSet& play
|
|||
|
||||
void WorldObject::GetCreaturesWithEntryInRange(std::list<Creature*>& creatureList, float radius, uint32 entry)
|
||||
{
|
||||
CellCoord pair(acore::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
CellCoord pair(Acore::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
Cell cell(pair);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::AllCreaturesOfEntryInRange check(this, entry, radius);
|
||||
acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
|
||||
Acore::AllCreaturesOfEntryInRange check(this, entry, radius);
|
||||
Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
|
||||
|
||||
TypeContainerVisitor<acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange>, WorldTypeMapContainer> world_visitor(searcher);
|
||||
TypeContainerVisitor<Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange>, WorldTypeMapContainer> world_visitor(searcher);
|
||||
cell.Visit(pair, world_visitor, *(this->GetMap()), *this, radius);
|
||||
|
||||
TypeContainerVisitor<acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange>, GridTypeMapContainer> grid_visitor(searcher);
|
||||
TypeContainerVisitor<Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange>, GridTypeMapContainer> grid_visitor(searcher);
|
||||
cell.Visit(pair, grid_visitor, *(this->GetMap()), *this, radius);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1095,7 +1095,7 @@ private:
|
|||
bool CanDetectStealthOf(WorldObject const* obj, bool checkAlert = false) const;
|
||||
};
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
// Binary predicate to sort WorldObjects based on the distance to a reference WorldObject
|
||||
class ObjectDistanceOrderPred
|
||||
|
|
|
|||
|
|
@ -517,7 +517,7 @@ inline void KillRewarder::_InitGroupData()
|
|||
}
|
||||
// 2.4. _maxNotGrayMember - maximum level of alive group member within reward distance,
|
||||
// for whom victim is not gray;
|
||||
uint32 grayLevel = acore::XP::GetGrayLevel(lvl);
|
||||
uint32 grayLevel = Acore::XP::GetGrayLevel(lvl);
|
||||
if (_victim->getLevel() > grayLevel && (!_maxNotGrayMember || _maxNotGrayMember->getLevel() < lvl))
|
||||
{
|
||||
_maxNotGrayMember = member;
|
||||
|
|
@ -542,7 +542,7 @@ inline void KillRewarder::_InitXP(Player* player)
|
|||
// * otherwise, not in PvP;
|
||||
// * not if killer is on vehicle.
|
||||
if (_victim && (_isBattleGround || (!_isPvP && !_killer->GetVehicle())))
|
||||
_xp = acore::XP::Gain(player, _victim, _isBattleGround);
|
||||
_xp = Acore::XP::Gain(player, _victim, _isBattleGround);
|
||||
|
||||
if (_xp && !_isBattleGround && _victim) // pussywizard: npcs with relatively low hp give lower exp
|
||||
if (_victim->GetTypeId() == TYPEID_UNIT)
|
||||
|
|
@ -658,7 +658,7 @@ void KillRewarder::_RewardGroup()
|
|||
{
|
||||
// 3.1.2. Alter group rate if group is in raid (not for battlegrounds).
|
||||
const bool isRaid = !_isPvP && sMapStore.LookupEntry(_killer->GetMapId())->IsRaid() && _group->isRaidGroup();
|
||||
_groupRate = acore::XP::xp_in_group_rate(_count, isRaid);
|
||||
_groupRate = Acore::XP::xp_in_group_rate(_count, isRaid);
|
||||
}
|
||||
|
||||
// 3.1.3. Reward each group member (even dead or corpse) within reward distance.
|
||||
|
|
@ -6564,7 +6564,7 @@ void Player::UpdateWeaponSkill(Unit* victim, WeaponAttackType attType)
|
|||
void Player::UpdateCombatSkills(Unit* victim, WeaponAttackType attType, bool defence)
|
||||
{
|
||||
uint8 plevel = getLevel(); // if defense than victim == attacker
|
||||
uint8 greylevel = acore::XP::GetGrayLevel(plevel);
|
||||
uint8 greylevel = Acore::XP::GetGrayLevel(plevel);
|
||||
uint8 moblevel = victim->getLevelForTarget(this);
|
||||
/*if (moblevel < greylevel)
|
||||
return;*/ // Patch 3.0.8 (2009-01-20): You can no longer skill up weapons on mobs that are immune to damage.
|
||||
|
|
@ -7065,7 +7065,7 @@ void Player::SendMessageToSetInRange(WorldPacket* data, float dist, bool self, b
|
|||
dist += GetObjectSize();
|
||||
if (includeMargin)
|
||||
dist += VISIBILITY_COMPENSATION; // pussywizard: to ensure everyone receives all important packets
|
||||
acore::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
|
||||
Acore::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
|
||||
VisitNearbyWorldObject(dist, notifier);
|
||||
}
|
||||
|
||||
|
|
@ -7075,7 +7075,7 @@ void Player::SendMessageToSetInRange_OwnTeam(WorldPacket* data, float dist, bool
|
|||
if (self)
|
||||
GetSession()->SendPacket(data);
|
||||
|
||||
acore::MessageDistDeliverer notifier(this, data, dist, true);
|
||||
Acore::MessageDistDeliverer notifier(this, data, dist, true);
|
||||
VisitNearbyWorldObject(dist, notifier);
|
||||
}
|
||||
|
||||
|
|
@ -7258,7 +7258,7 @@ int32 Player::CalculateReputationGain(ReputationSource source, uint32 creatureOr
|
|||
break;
|
||||
}
|
||||
|
||||
if (rate != 1.0f && creatureOrQuestLevel <= acore::XP::GetGrayLevel(getLevel()))
|
||||
if (rate != 1.0f && creatureOrQuestLevel <= Acore::XP::GetGrayLevel(getLevel()))
|
||||
percent *= rate;
|
||||
|
||||
if (percent <= 0.0f)
|
||||
|
|
@ -7498,7 +7498,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool awar
|
|||
return false;
|
||||
|
||||
uint8 k_level = getLevel();
|
||||
uint8 k_grey = acore::XP::GetGrayLevel(k_level);
|
||||
uint8 k_grey = Acore::XP::GetGrayLevel(k_level);
|
||||
uint8 v_level = victim->getLevel();
|
||||
|
||||
if (v_level <= k_grey)
|
||||
|
|
@ -7527,7 +7527,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool awar
|
|||
else
|
||||
victim_guid.Clear(); // Don't show HK: <rank> message, only log.
|
||||
|
||||
honor_f = ceil(acore::Honor::hk_honor_at_level_f(k_level) * (v_level - k_grey) / (k_level - k_grey));
|
||||
honor_f = ceil(Acore::Honor::hk_honor_at_level_f(k_level) * (v_level - k_grey) / (k_level - k_grey));
|
||||
|
||||
// count the number of playerkills in one day
|
||||
ApplyModUInt32Value(PLAYER_FIELD_KILLS, 1, true);
|
||||
|
|
@ -18335,7 +18335,7 @@ bool Player::LoadFromDB(ObjectGuid playerGuid, SQLQueryHolder* holder)
|
|||
m_movementInfo.transport.pos.Relocate(x, y, z, o);
|
||||
m_transport->CalculatePassengerPosition(x, y, z, &o);
|
||||
|
||||
if (!acore::IsValidMapCoord(x, y, z, o) || std::fabs(m_movementInfo.transport.pos.GetPositionX()) > 75.0f || std::fabs(m_movementInfo.transport.pos.GetPositionY()) > 75.0f || std::fabs(m_movementInfo.transport.pos.GetPositionZ()) > 75.0f)
|
||||
if (!Acore::IsValidMapCoord(x, y, z, o) || std::fabs(m_movementInfo.transport.pos.GetPositionX()) > 75.0f || std::fabs(m_movementInfo.transport.pos.GetPositionY()) > 75.0f || std::fabs(m_movementInfo.transport.pos.GetPositionZ()) > 75.0f)
|
||||
{
|
||||
m_transport = nullptr;
|
||||
m_movementInfo.transport.Reset();
|
||||
|
|
@ -21526,8 +21526,8 @@ void Player::TextEmote(const std::string& text)
|
|||
|
||||
WorldPacket data;
|
||||
std::list<Player*> players;
|
||||
acore::AnyPlayerInObjectRangeCheck checker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
|
||||
acore::PlayerListSearcher<acore::AnyPlayerInObjectRangeCheck> searcher(this, players, checker);
|
||||
Acore::AnyPlayerInObjectRangeCheck checker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
|
||||
Acore::PlayerListSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(this, players, checker);
|
||||
this->VisitNearbyWorldObject(sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), searcher);
|
||||
|
||||
for (auto const& itr : players)
|
||||
|
|
@ -23680,10 +23680,10 @@ void Player::UpdateObjectVisibility(bool forced, bool fromUpdate)
|
|||
|
||||
void Player::UpdateVisibilityForPlayer(bool mapChange)
|
||||
{
|
||||
acore::VisibleNotifier notifierNoLarge(*this, mapChange, false); // visit only objects which are not large; default distance
|
||||
Acore::VisibleNotifier notifierNoLarge(*this, mapChange, false); // visit only objects which are not large; default distance
|
||||
m_seer->VisitNearbyObject(GetSightRange() + VISIBILITY_INC_FOR_GOBJECTS, notifierNoLarge);
|
||||
notifierNoLarge.SendToSelf();
|
||||
acore::VisibleNotifier notifierLarge(*this, mapChange, true); // visit only large objects; maximum distance
|
||||
Acore::VisibleNotifier notifierLarge(*this, mapChange, true); // visit only large objects; maximum distance
|
||||
m_seer->VisitNearbyObject(MAX_VISIBILITY_DISTANCE, notifierLarge);
|
||||
notifierLarge.SendToSelf();
|
||||
|
||||
|
|
@ -24753,7 +24753,7 @@ uint32 Player::GetResurrectionSpellId()
|
|||
bool Player::isHonorOrXPTarget(Unit* victim) const
|
||||
{
|
||||
uint8 v_level = victim->getLevel();
|
||||
uint8 k_grey = acore::XP::GetGrayLevel(getLevel());
|
||||
uint8 k_grey = Acore::XP::GetGrayLevel(getLevel());
|
||||
|
||||
// Victim level less gray level
|
||||
if (v_level <= k_grey)
|
||||
|
|
|
|||
|
|
@ -609,7 +609,7 @@ void MotionTransport::UpdatePassengerPositions(PassengerSet& passengers)
|
|||
CalculatePassengerPosition(x, y, z, &o);
|
||||
|
||||
// check if position is valid
|
||||
if (!acore::IsValidMapCoord(x, y, z))
|
||||
if (!Acore::IsValidMapCoord(x, y, z))
|
||||
continue;
|
||||
|
||||
switch (passenger->GetTypeId())
|
||||
|
|
@ -875,7 +875,7 @@ void StaticTransport::RelocateToProgress(uint32 progress)
|
|||
float oriRotAngle = oriRotAngleCurr + percRot * (oriRotAngleNext - oriRotAngleCurr);
|
||||
|
||||
// check if position is valid
|
||||
if (!acore::IsValidMapCoord(pos.x, pos.y, pos.z))
|
||||
if (!Acore::IsValidMapCoord(pos.x, pos.y, pos.z))
|
||||
return;
|
||||
|
||||
// update position to new one
|
||||
|
|
@ -910,7 +910,7 @@ void StaticTransport::UpdatePassengerPositions()
|
|||
CalculatePassengerPosition(x, y, z, &o);
|
||||
|
||||
// check if position is valid
|
||||
if (!acore::IsValidMapCoord(x, y, z))
|
||||
if (!Acore::IsValidMapCoord(x, y, z))
|
||||
continue;
|
||||
|
||||
switch (passenger->GetTypeId())
|
||||
|
|
|
|||
|
|
@ -1893,7 +1893,7 @@ void Unit::CalcAbsorbResist(Unit* attacker, Unit* victim, SpellSchoolMask school
|
|||
// We're going to call functions which can modify content of the list during iteration over it's elements
|
||||
// Let's copy the list so we can prevent iterator invalidation
|
||||
AuraEffectList vSchoolAbsorbCopy(victim->GetAuraEffectsByType(SPELL_AURA_SCHOOL_ABSORB));
|
||||
vSchoolAbsorbCopy.sort(acore::AbsorbAuraOrderPred());
|
||||
vSchoolAbsorbCopy.sort(Acore::AbsorbAuraOrderPred());
|
||||
|
||||
// absorb without mana cost
|
||||
for (AuraEffectList::iterator itr = vSchoolAbsorbCopy.begin(); (itr != vSchoolAbsorbCopy.end()) && (dmgInfo.GetDamage() > 0); ++itr)
|
||||
|
|
@ -16294,8 +16294,8 @@ void Unit::UpdateReactives(uint32 p_time)
|
|||
Unit* Unit::SelectNearbyTarget(Unit* exclude, float dist) const
|
||||
{
|
||||
std::list<Unit*> targets;
|
||||
acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, this, dist);
|
||||
acore::UnitListSearcher<acore::AnyUnfriendlyUnitInObjectRangeCheck> searcher(this, targets, u_check);
|
||||
Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, this, dist);
|
||||
Acore::UnitListSearcher<Acore::AnyUnfriendlyUnitInObjectRangeCheck> searcher(this, targets, u_check);
|
||||
VisitNearbyObject(dist, searcher);
|
||||
|
||||
// remove current target
|
||||
|
|
@ -16323,14 +16323,14 @@ Unit* Unit::SelectNearbyTarget(Unit* exclude, float dist) const
|
|||
return nullptr;
|
||||
|
||||
// select random
|
||||
return acore::Containers::SelectRandomContainerElement(targets);
|
||||
return Acore::Containers::SelectRandomContainerElement(targets);
|
||||
}
|
||||
|
||||
Unit* Unit::SelectNearbyNoTotemTarget(Unit* exclude, float dist) const
|
||||
{
|
||||
std::list<Unit*> targets;
|
||||
acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck u_check(this, this, dist);
|
||||
acore::UnitListSearcher<acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> searcher(this, targets, u_check);
|
||||
Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck u_check(this, this, dist);
|
||||
Acore::UnitListSearcher<Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> searcher(this, targets, u_check);
|
||||
VisitNearbyObject(dist, searcher);
|
||||
|
||||
// remove current target
|
||||
|
|
@ -16358,7 +16358,7 @@ Unit* Unit::SelectNearbyNoTotemTarget(Unit* exclude, float dist) const
|
|||
return nullptr;
|
||||
|
||||
// select random
|
||||
return acore::Containers::SelectRandomContainerElement(targets);
|
||||
return Acore::Containers::SelectRandomContainerElement(targets);
|
||||
}
|
||||
|
||||
void Unit::ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply)
|
||||
|
|
@ -16893,7 +16893,7 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue(AuraEffect* triggeredByAura)
|
|||
|
||||
if (!nearMembers.empty())
|
||||
{
|
||||
nearMembers.sort(acore::HealthPctOrderPred());
|
||||
nearMembers.sort(Acore::HealthPctOrderPred());
|
||||
if (Unit* target = nearMembers.front())
|
||||
{
|
||||
CastSpell(target, 41637 /*Dummy visual effect triggered by main spell cast*/, true);
|
||||
|
|
@ -18369,7 +18369,7 @@ void Unit::UpdateObjectVisibility(bool forced, bool /*fromUpdate*/)
|
|||
// pussywizard: generally this is not needed here, delayed notifier will handle this, call only for pets
|
||||
if ((IsGuardian() || IsPet()) && GetOwnerGUID().IsPlayer())
|
||||
{
|
||||
acore::AIRelocationNotifier notifier(*this);
|
||||
Acore::AIRelocationNotifier notifier(*this);
|
||||
float radius = 60.0f;
|
||||
VisitNearbyObject(radius, notifier);
|
||||
}
|
||||
|
|
@ -19220,7 +19220,7 @@ void Unit::SendTeleportPacket(Position& pos)
|
|||
|
||||
bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool teleport)
|
||||
{
|
||||
if (!acore::IsValidMapCoord(x, y, z, orientation))
|
||||
if (!Acore::IsValidMapCoord(x, y, z, orientation))
|
||||
return false;
|
||||
|
||||
float old_orientation = GetOrientation();
|
||||
|
|
@ -19743,10 +19743,10 @@ void Unit::ExecuteDelayedUnitRelocationEvent()
|
|||
//active->m_last_notify_position.Relocate(active->GetPositionX(), active->GetPositionY(), active->GetPositionZ());
|
||||
}
|
||||
|
||||
acore::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
|
||||
Acore::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
|
||||
viewPoint->VisitNearbyObject(player->GetSightRange() + VISIBILITY_INC_FOR_GOBJECTS, relocateNoLarge);
|
||||
relocateNoLarge.SendToSelf();
|
||||
acore::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
|
||||
Acore::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
|
||||
viewPoint->VisitNearbyObject(MAX_VISIBILITY_DISTANCE, relocateLarge);
|
||||
relocateLarge.SendToSelf();
|
||||
}
|
||||
|
|
@ -19777,10 +19777,10 @@ void Unit::ExecuteDelayedUnitRelocationEvent()
|
|||
active->m_last_notify_position.Relocate(active->GetPositionX(), active->GetPositionY(), active->GetPositionZ());
|
||||
}
|
||||
|
||||
acore::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
|
||||
Acore::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
|
||||
viewPoint->VisitNearbyObject(player->GetSightRange() + VISIBILITY_INC_FOR_GOBJECTS, relocateNoLarge);
|
||||
relocateNoLarge.SendToSelf();
|
||||
acore::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
|
||||
Acore::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
|
||||
viewPoint->VisitNearbyObject(MAX_VISIBILITY_DISTANCE, relocateLarge);
|
||||
relocateLarge.SendToSelf();
|
||||
|
||||
|
|
@ -19801,7 +19801,7 @@ void Unit::ExecuteDelayedUnitRelocationEvent()
|
|||
|
||||
unit->m_last_notify_position.Relocate(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ());
|
||||
|
||||
acore::CreatureRelocationNotifier relocate(*unit);
|
||||
Acore::CreatureRelocationNotifier relocate(*unit);
|
||||
unit->VisitNearbyObject(unit->GetVisibilityRange() + VISIBILITY_COMPENSATION, relocate);
|
||||
|
||||
this->AddToNotify(NOTIFY_AI_RELOCATION);
|
||||
|
|
@ -19814,7 +19814,7 @@ void Unit::ExecuteDelayedUnitAINotifyEvent()
|
|||
if (!this->IsInWorld() || this->IsDuringRemoveFromWorld())
|
||||
return;
|
||||
|
||||
acore::AIRelocationNotifier notifier(*this);
|
||||
Acore::AIRelocationNotifier notifier(*this);
|
||||
float radius = 60.0f;
|
||||
this->VisitNearbyObject(radius, notifier);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2627,7 +2627,7 @@ private:
|
|||
float processDummyAuras(float TakenTotalMod) const;
|
||||
};
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
// Binary predicate for sorting Units based on percent value of a power
|
||||
class PowerPctOrderPred
|
||||
|
|
|
|||
|
|
@ -1985,7 +1985,7 @@ void ObjectMgr::AddCreatureToGrid(ObjectGuid::LowType guid, CreatureData const*
|
|||
{
|
||||
if (mask & 1)
|
||||
{
|
||||
CellCoord cellCoord = acore::ComputeCellCoord(data->posX, data->posY);
|
||||
CellCoord cellCoord = Acore::ComputeCellCoord(data->posX, data->posY);
|
||||
CellObjectGuids& cell_guids = _mapObjectGuidsStore[MAKE_PAIR32(data->mapid, i)][cellCoord.GetId()];
|
||||
cell_guids.creatures.insert(guid);
|
||||
}
|
||||
|
|
@ -1999,7 +1999,7 @@ void ObjectMgr::RemoveCreatureFromGrid(ObjectGuid::LowType guid, CreatureData co
|
|||
{
|
||||
if (mask & 1)
|
||||
{
|
||||
CellCoord cellCoord = acore::ComputeCellCoord(data->posX, data->posY);
|
||||
CellCoord cellCoord = Acore::ComputeCellCoord(data->posX, data->posY);
|
||||
CellObjectGuids& cell_guids = _mapObjectGuidsStore[MAKE_PAIR32(data->mapid, i)][cellCoord.GetId()];
|
||||
cell_guids.creatures.erase(guid);
|
||||
}
|
||||
|
|
@ -2286,7 +2286,7 @@ void ObjectMgr::AddGameobjectToGrid(ObjectGuid::LowType guid, GameObjectData con
|
|||
{
|
||||
if (mask & 1)
|
||||
{
|
||||
CellCoord cellCoord = acore::ComputeCellCoord(data->posX, data->posY);
|
||||
CellCoord cellCoord = Acore::ComputeCellCoord(data->posX, data->posY);
|
||||
CellObjectGuids& cell_guids = _mapObjectGuidsStore[MAKE_PAIR32(data->mapid, i)][cellCoord.GetId()];
|
||||
cell_guids.gameobjects.insert(guid);
|
||||
}
|
||||
|
|
@ -2300,7 +2300,7 @@ void ObjectMgr::RemoveGameobjectFromGrid(ObjectGuid::LowType guid, GameObjectDat
|
|||
{
|
||||
if (mask & 1)
|
||||
{
|
||||
CellCoord cellCoord = acore::ComputeCellCoord(data->posX, data->posY);
|
||||
CellCoord cellCoord = Acore::ComputeCellCoord(data->posX, data->posY);
|
||||
CellObjectGuids& cell_guids = _mapObjectGuidsStore[MAKE_PAIR32(data->mapid, i)][cellCoord.GetId()];
|
||||
cell_guids.gameobjects.erase(guid);
|
||||
}
|
||||
|
|
@ -4833,7 +4833,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!acore::IsValidMapCoord(tmp.TeleportTo.DestX, tmp.TeleportTo.DestY, tmp.TeleportTo.DestZ, tmp.TeleportTo.Orientation))
|
||||
if (!Acore::IsValidMapCoord(tmp.TeleportTo.DestX, tmp.TeleportTo.DestY, tmp.TeleportTo.DestZ, tmp.TeleportTo.Orientation))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Table `%s` has invalid coordinates (X: %f Y: %f Z: %f O: %f) in SCRIPT_COMMAND_TELEPORT_TO for script id %u",
|
||||
tableName.c_str(), tmp.TeleportTo.DestX, tmp.TeleportTo.DestY, tmp.TeleportTo.DestZ, tmp.TeleportTo.Orientation, tmp.id);
|
||||
|
|
@ -4931,7 +4931,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
|
|||
|
||||
case SCRIPT_COMMAND_TEMP_SUMMON_CREATURE:
|
||||
{
|
||||
if (!acore::IsValidMapCoord(tmp.TempSummonCreature.PosX, tmp.TempSummonCreature.PosY, tmp.TempSummonCreature.PosZ, tmp.TempSummonCreature.Orientation))
|
||||
if (!Acore::IsValidMapCoord(tmp.TempSummonCreature.PosX, tmp.TempSummonCreature.PosY, tmp.TempSummonCreature.PosZ, tmp.TempSummonCreature.Orientation))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Table `%s` has invalid coordinates (X: %f Y: %f Z: %f O: %f) in SCRIPT_COMMAND_TEMP_SUMMON_CREATURE for script id %u",
|
||||
tableName.c_str(), tmp.TempSummonCreature.PosX, tmp.TempSummonCreature.PosY, tmp.TempSummonCreature.PosZ, tmp.TempSummonCreature.Orientation, tmp.id);
|
||||
|
|
@ -7221,7 +7221,7 @@ void ObjectMgr::LoadPointsOfInterest()
|
|||
POI.Importance = fields[5].GetUInt32();
|
||||
POI.Name = fields[6].GetString();
|
||||
|
||||
if (!acore::IsValidMapCoord(POI.PositionX, POI.PositionY))
|
||||
if (!Acore::IsValidMapCoord(POI.PositionX, POI.PositionY))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Table `points_of_interest` (ID: %u) have invalid coordinates (X: %f Y: %f), ignored.", point_id, POI.PositionX, POI.PositionY);
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ inline Cell::Cell(CellCoord const& p)
|
|||
|
||||
inline Cell::Cell(float x, float y)
|
||||
{
|
||||
CellCoord p = acore::ComputeCellCoord(x, y);
|
||||
CellCoord p = Acore::ComputeCellCoord(x, y);
|
||||
data.Part.grid_x = p.x_coord / MAX_NUMBER_OF_CELLS;
|
||||
data.Part.grid_y = p.y_coord / MAX_NUMBER_OF_CELLS;
|
||||
data.Part.cell_x = p.x_coord % MAX_NUMBER_OF_CELLS;
|
||||
|
|
@ -37,12 +37,12 @@ inline CellArea Cell::CalculateCellArea(float x, float y, float radius)
|
|||
{
|
||||
if (radius <= 0.0f)
|
||||
{
|
||||
CellCoord center = acore::ComputeCellCoord(x, y).normalize();
|
||||
CellCoord center = Acore::ComputeCellCoord(x, y).normalize();
|
||||
return CellArea(center, center);
|
||||
}
|
||||
|
||||
CellCoord centerX = acore::ComputeCellCoord(x - radius, y - radius).normalize();
|
||||
CellCoord centerY = acore::ComputeCellCoord(x + radius, y + radius).normalize();
|
||||
CellCoord centerX = Acore::ComputeCellCoord(x - radius, y - radius).normalize();
|
||||
CellCoord centerY = Acore::ComputeCellCoord(x + radius, y + radius).normalize();
|
||||
|
||||
return CellArea(centerX, centerY);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ bool operator!=(const CoordPair<LIMIT>& p1, const CoordPair<LIMIT>& p2)
|
|||
typedef CoordPair<MAX_NUMBER_OF_GRIDS> GridCoord;
|
||||
typedef CoordPair<TOTAL_NUMBER_OF_CELLS_PER_MAP> CellCoord;
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
template<class RET_TYPE, int CENTER_VAL>
|
||||
inline RET_TYPE Compute(float x, float y, float center_offset, float size)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
using namespace acore;
|
||||
using namespace Acore;
|
||||
|
||||
void VisibleNotifier::Visit(GameObjectMapType& m)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
class Player;
|
||||
//class Map;
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
struct VisibleNotifier
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
#include "WorldPacket.h"
|
||||
|
||||
template<class T>
|
||||
inline void acore::VisibleNotifier::Visit(GridRefManager<T>& m)
|
||||
inline void Acore::VisibleNotifier::Visit(GridRefManager<T>& m)
|
||||
{
|
||||
// Xinef: Update gameobjects only
|
||||
if (i_gobjOnly)
|
||||
|
|
@ -37,7 +37,7 @@ inline void acore::VisibleNotifier::Visit(GridRefManager<T>& m)
|
|||
// WorldObject searchers & workers
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectSearcher<Check>::Visit(GameObjectMapType& m)
|
||||
void Acore::WorldObjectSearcher<Check>::Visit(GameObjectMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_GAMEOBJECT))
|
||||
return;
|
||||
|
|
@ -60,7 +60,7 @@ void acore::WorldObjectSearcher<Check>::Visit(GameObjectMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectSearcher<Check>::Visit(PlayerMapType& m)
|
||||
void Acore::WorldObjectSearcher<Check>::Visit(PlayerMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_PLAYER))
|
||||
return;
|
||||
|
|
@ -83,7 +83,7 @@ void acore::WorldObjectSearcher<Check>::Visit(PlayerMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectSearcher<Check>::Visit(CreatureMapType& m)
|
||||
void Acore::WorldObjectSearcher<Check>::Visit(CreatureMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CREATURE))
|
||||
return;
|
||||
|
|
@ -106,7 +106,7 @@ void acore::WorldObjectSearcher<Check>::Visit(CreatureMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectSearcher<Check>::Visit(CorpseMapType& m)
|
||||
void Acore::WorldObjectSearcher<Check>::Visit(CorpseMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CORPSE))
|
||||
return;
|
||||
|
|
@ -129,7 +129,7 @@ void acore::WorldObjectSearcher<Check>::Visit(CorpseMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectSearcher<Check>::Visit(DynamicObjectMapType& m)
|
||||
void Acore::WorldObjectSearcher<Check>::Visit(DynamicObjectMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_DYNAMICOBJECT))
|
||||
return;
|
||||
|
|
@ -152,7 +152,7 @@ void acore::WorldObjectSearcher<Check>::Visit(DynamicObjectMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectLastSearcher<Check>::Visit(GameObjectMapType& m)
|
||||
void Acore::WorldObjectLastSearcher<Check>::Visit(GameObjectMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_GAMEOBJECT))
|
||||
return;
|
||||
|
|
@ -168,7 +168,7 @@ void acore::WorldObjectLastSearcher<Check>::Visit(GameObjectMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectLastSearcher<Check>::Visit(PlayerMapType& m)
|
||||
void Acore::WorldObjectLastSearcher<Check>::Visit(PlayerMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_PLAYER))
|
||||
return;
|
||||
|
|
@ -184,7 +184,7 @@ void acore::WorldObjectLastSearcher<Check>::Visit(PlayerMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectLastSearcher<Check>::Visit(CreatureMapType& m)
|
||||
void Acore::WorldObjectLastSearcher<Check>::Visit(CreatureMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CREATURE))
|
||||
return;
|
||||
|
|
@ -200,7 +200,7 @@ void acore::WorldObjectLastSearcher<Check>::Visit(CreatureMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectLastSearcher<Check>::Visit(CorpseMapType& m)
|
||||
void Acore::WorldObjectLastSearcher<Check>::Visit(CorpseMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CORPSE))
|
||||
return;
|
||||
|
|
@ -216,7 +216,7 @@ void acore::WorldObjectLastSearcher<Check>::Visit(CorpseMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectLastSearcher<Check>::Visit(DynamicObjectMapType& m)
|
||||
void Acore::WorldObjectLastSearcher<Check>::Visit(DynamicObjectMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_DYNAMICOBJECT))
|
||||
return;
|
||||
|
|
@ -232,7 +232,7 @@ void acore::WorldObjectLastSearcher<Check>::Visit(DynamicObjectMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectListSearcher<Check>::Visit(PlayerMapType& m)
|
||||
void Acore::WorldObjectListSearcher<Check>::Visit(PlayerMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_PLAYER))
|
||||
return;
|
||||
|
|
@ -243,7 +243,7 @@ void acore::WorldObjectListSearcher<Check>::Visit(PlayerMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectListSearcher<Check>::Visit(CreatureMapType& m)
|
||||
void Acore::WorldObjectListSearcher<Check>::Visit(CreatureMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CREATURE))
|
||||
return;
|
||||
|
|
@ -254,7 +254,7 @@ void acore::WorldObjectListSearcher<Check>::Visit(CreatureMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectListSearcher<Check>::Visit(CorpseMapType& m)
|
||||
void Acore::WorldObjectListSearcher<Check>::Visit(CorpseMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CORPSE))
|
||||
return;
|
||||
|
|
@ -265,7 +265,7 @@ void acore::WorldObjectListSearcher<Check>::Visit(CorpseMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectListSearcher<Check>::Visit(GameObjectMapType& m)
|
||||
void Acore::WorldObjectListSearcher<Check>::Visit(GameObjectMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_GAMEOBJECT))
|
||||
return;
|
||||
|
|
@ -276,7 +276,7 @@ void acore::WorldObjectListSearcher<Check>::Visit(GameObjectMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectListSearcher<Check>::Visit(DynamicObjectMapType& m)
|
||||
void Acore::WorldObjectListSearcher<Check>::Visit(DynamicObjectMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_DYNAMICOBJECT))
|
||||
return;
|
||||
|
|
@ -289,7 +289,7 @@ void acore::WorldObjectListSearcher<Check>::Visit(DynamicObjectMapType& m)
|
|||
// Gameobject searchers
|
||||
|
||||
template<class Check>
|
||||
void acore::GameObjectSearcher<Check>::Visit(GameObjectMapType& m)
|
||||
void Acore::GameObjectSearcher<Check>::Visit(GameObjectMapType& m)
|
||||
{
|
||||
// already found
|
||||
if (i_object)
|
||||
|
|
@ -309,7 +309,7 @@ void acore::GameObjectSearcher<Check>::Visit(GameObjectMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::GameObjectLastSearcher<Check>::Visit(GameObjectMapType& m)
|
||||
void Acore::GameObjectLastSearcher<Check>::Visit(GameObjectMapType& m)
|
||||
{
|
||||
for (GameObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
|
|
@ -322,7 +322,7 @@ void acore::GameObjectLastSearcher<Check>::Visit(GameObjectMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::GameObjectListSearcher<Check>::Visit(GameObjectMapType& m)
|
||||
void Acore::GameObjectListSearcher<Check>::Visit(GameObjectMapType& m)
|
||||
{
|
||||
for (GameObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
|
|
@ -333,7 +333,7 @@ void acore::GameObjectListSearcher<Check>::Visit(GameObjectMapType& m)
|
|||
// Unit searchers
|
||||
|
||||
template<class Check>
|
||||
void acore::UnitSearcher<Check>::Visit(CreatureMapType& m)
|
||||
void Acore::UnitSearcher<Check>::Visit(CreatureMapType& m)
|
||||
{
|
||||
// already found
|
||||
if (i_object)
|
||||
|
|
@ -353,7 +353,7 @@ void acore::UnitSearcher<Check>::Visit(CreatureMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::UnitSearcher<Check>::Visit(PlayerMapType& m)
|
||||
void Acore::UnitSearcher<Check>::Visit(PlayerMapType& m)
|
||||
{
|
||||
// already found
|
||||
if (i_object)
|
||||
|
|
@ -373,7 +373,7 @@ void acore::UnitSearcher<Check>::Visit(PlayerMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::UnitLastSearcher<Check>::Visit(CreatureMapType& m)
|
||||
void Acore::UnitLastSearcher<Check>::Visit(CreatureMapType& m)
|
||||
{
|
||||
for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
|
|
@ -386,7 +386,7 @@ void acore::UnitLastSearcher<Check>::Visit(CreatureMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::UnitLastSearcher<Check>::Visit(PlayerMapType& m)
|
||||
void Acore::UnitLastSearcher<Check>::Visit(PlayerMapType& m)
|
||||
{
|
||||
for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
|
|
@ -399,7 +399,7 @@ void acore::UnitLastSearcher<Check>::Visit(PlayerMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::UnitListSearcher<Check>::Visit(PlayerMapType& m)
|
||||
void Acore::UnitListSearcher<Check>::Visit(PlayerMapType& m)
|
||||
{
|
||||
for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
|
|
@ -408,7 +408,7 @@ void acore::UnitListSearcher<Check>::Visit(PlayerMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::UnitListSearcher<Check>::Visit(CreatureMapType& m)
|
||||
void Acore::UnitListSearcher<Check>::Visit(CreatureMapType& m)
|
||||
{
|
||||
for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
|
|
@ -419,7 +419,7 @@ void acore::UnitListSearcher<Check>::Visit(CreatureMapType& m)
|
|||
// Creature searchers
|
||||
|
||||
template<class Check>
|
||||
void acore::CreatureSearcher<Check>::Visit(CreatureMapType& m)
|
||||
void Acore::CreatureSearcher<Check>::Visit(CreatureMapType& m)
|
||||
{
|
||||
// already found
|
||||
if (i_object)
|
||||
|
|
@ -439,7 +439,7 @@ void acore::CreatureSearcher<Check>::Visit(CreatureMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::CreatureLastSearcher<Check>::Visit(CreatureMapType& m)
|
||||
void Acore::CreatureLastSearcher<Check>::Visit(CreatureMapType& m)
|
||||
{
|
||||
for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
|
|
@ -452,7 +452,7 @@ void acore::CreatureLastSearcher<Check>::Visit(CreatureMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::CreatureListSearcher<Check>::Visit(CreatureMapType& m)
|
||||
void Acore::CreatureListSearcher<Check>::Visit(CreatureMapType& m)
|
||||
{
|
||||
for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
|
|
@ -461,7 +461,7 @@ void acore::CreatureListSearcher<Check>::Visit(CreatureMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::PlayerListSearcher<Check>::Visit(PlayerMapType& m)
|
||||
void Acore::PlayerListSearcher<Check>::Visit(PlayerMapType& m)
|
||||
{
|
||||
for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
|
|
@ -470,7 +470,7 @@ void acore::PlayerListSearcher<Check>::Visit(PlayerMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::PlayerListSearcherWithSharedVision<Check>::Visit(PlayerMapType& m)
|
||||
void Acore::PlayerListSearcherWithSharedVision<Check>::Visit(PlayerMapType& m)
|
||||
{
|
||||
for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
|
|
@ -479,7 +479,7 @@ void acore::PlayerListSearcherWithSharedVision<Check>::Visit(PlayerMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::PlayerListSearcherWithSharedVision<Check>::Visit(CreatureMapType& m)
|
||||
void Acore::PlayerListSearcherWithSharedVision<Check>::Visit(CreatureMapType& m)
|
||||
{
|
||||
for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask) && itr->GetSource()->HasSharedVision())
|
||||
|
|
@ -489,7 +489,7 @@ void acore::PlayerListSearcherWithSharedVision<Check>::Visit(CreatureMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::PlayerSearcher<Check>::Visit(PlayerMapType& m)
|
||||
void Acore::PlayerSearcher<Check>::Visit(PlayerMapType& m)
|
||||
{
|
||||
// already found
|
||||
if (i_object)
|
||||
|
|
@ -509,7 +509,7 @@ void acore::PlayerSearcher<Check>::Visit(PlayerMapType& m)
|
|||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::PlayerLastSearcher<Check>::Visit(PlayerMapType& m)
|
||||
void Acore::PlayerLastSearcher<Check>::Visit(PlayerMapType& m)
|
||||
{
|
||||
for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
|
|
@ -522,7 +522,7 @@ void acore::PlayerLastSearcher<Check>::Visit(PlayerMapType& m)
|
|||
}
|
||||
|
||||
template<class Builder>
|
||||
void acore::LocalizedPacketDo<Builder>::operator()(Player* p)
|
||||
void Acore::LocalizedPacketDo<Builder>::operator()(Player* p)
|
||||
{
|
||||
LocaleConstant loc_idx = p->GetSession()->GetSessionDbLocaleIndex();
|
||||
uint32 cache_idx = loc_idx + 1;
|
||||
|
|
@ -547,7 +547,7 @@ void acore::LocalizedPacketDo<Builder>::operator()(Player* p)
|
|||
}
|
||||
|
||||
template<class Builder>
|
||||
void acore::LocalizedPacketListDo<Builder>::operator()(Player* p)
|
||||
void Acore::LocalizedPacketListDo<Builder>::operator()(Player* p)
|
||||
{
|
||||
LocaleConstant loc_idx = p->GetSession()->GetSessionDbLocaleIndex();
|
||||
uint32 cache_idx = loc_idx + 1;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue