diff --git a/apps/EnumUtils/enumutils_describe.py b/apps/EnumUtils/enumutils_describe.py index e25d88962..4154fdaff 100644 --- a/apps/EnumUtils/enumutils_describe.py +++ b/apps/EnumUtils/enumutils_describe.py @@ -98,7 +98,7 @@ def processFile(path, filename): output.write('#include "SmartEnum.h"\n') output.write('#include \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)) diff --git a/src/common/Asio/AsioHacksFwd.h b/src/common/Asio/AsioHacksFwd.h index 05b796038..618899502 100644 --- a/src/common/Asio/AsioHacksFwd.h +++ b/src/common/Asio/AsioHacksFwd.h @@ -33,7 +33,7 @@ namespace boost::asio::ip typedef basic_endpoint tcp_endpoint; } -namespace acore::Asio +namespace Acore::Asio { class DeadlineTimer; class IoContext; diff --git a/src/common/Asio/DeadlineTimer.h b/src/common/Asio/DeadlineTimer.h index cf993ee7b..7f4d589dd 100644 --- a/src/common/Asio/DeadlineTimer.h +++ b/src/common/Asio/DeadlineTimer.h @@ -18,7 +18,7 @@ #define DeadlineTimerBase boost::asio::basic_deadline_timer BasicDeadlineTimerThirdTemplateArg> -namespace acore::Asio +namespace Acore::Asio { class DeadlineTimer : public DeadlineTimerBase { diff --git a/src/common/Asio/IoContext.h b/src/common/Asio/IoContext.h index e08ef97a5..2227f05ad 100644 --- a/src/common/Asio/IoContext.h +++ b/src/common/Asio/IoContext.h @@ -19,7 +19,7 @@ #define IoContextBase io_service #endif -namespace acore::Asio +namespace Acore::Asio { class IoContext { diff --git a/src/common/Asio/IpAddress.h b/src/common/Asio/IpAddress.h index 3545b48c6..0e938c8fb 100644 --- a/src/common/Asio/IpAddress.h +++ b/src/common/Asio/IpAddress.h @@ -9,7 +9,7 @@ #include "Define.h" #include -namespace acore::Net +namespace Acore::Net { #if BOOST_VERSION >= 106600 using boost::asio::ip::make_address; diff --git a/src/common/Asio/IpNetwork.h b/src/common/Asio/IpNetwork.h index 6c1ed9eac..354f802ed 100644 --- a/src/common/Asio/IpNetwork.h +++ b/src/common/Asio/IpNetwork.h @@ -15,7 +15,7 @@ #include #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) { diff --git a/src/common/Asio/Resolver.h b/src/common/Asio/Resolver.h index 459e6c750..c7c56e9bf 100644 --- a/src/common/Asio/Resolver.h +++ b/src/common/Asio/Resolver.h @@ -11,7 +11,7 @@ #include #include -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) diff --git a/src/common/Asio/Strand.h b/src/common/Asio/Strand.h index 351492d24..26b918b84 100644 --- a/src/common/Asio/Strand.h +++ b/src/common/Asio/Strand.h @@ -13,7 +13,7 @@ #include #endif -namespace acore::Asio +namespace Acore::Asio { /** Hack to make it possible to forward declare strand (which is a inner class) diff --git a/src/common/Banner.cpp b/src/common/Banner.cpp index 9ca9157a2..b2a951765 100644 --- a/src/common/Banner.cpp +++ b/src/common/Banner.cpp @@ -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(" to stop.\n"); log(" █████╗ ███████╗███████╗██████╗ ██████╗ ████████╗██╗ ██╗"); log(" ██╔══██╗╚══███╔╝██╔════╝██╔══██╗██╔═══██╗╚══██╔══╝██║ ██║"); diff --git a/src/common/Banner.h b/src/common/Banner.h index 44160e0d0..b8d99836a 100644 --- a/src/common/Banner.h +++ b/src/common/Banner.h @@ -7,7 +7,7 @@ #include "Define.h" -namespace acore +namespace Acore { namespace Banner { diff --git a/src/common/Collision/Management/MMapManager.cpp b/src/common/Collision/Management/MMapManager.cpp index 40fa34277..00f57fb02 100644 --- a/src/common/Collision/Management/MMapManager.cpp +++ b/src/common/Collision/Management/MMapManager.cpp @@ -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("DataDir", ".").c_str(), mapId); + std::string fileName = Acore::StringFormat(MAP_FILE_NAME_FORMAT, sConfigMgr->GetOption("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("DataDir", ".").c_str(), mapId, x, y); + std::string fileName = Acore::StringFormat(TILE_FILE_NAME_FORMAT, sConfigMgr->GetOption("DataDir", ".").c_str(), mapId, x, y); FILE* file = fopen(fileName.c_str(), "rb"); if (!file) { diff --git a/src/common/Common.h b/src/common/Common.h index 6acc2c729..0c932ca4d 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -98,7 +98,7 @@ AC_COMMON_API void CleanStringForMysqlQuery(std::string& str); #define MAX_QUERY_LEN 32*1024 -namespace acore +namespace Acore { template struct unary_function diff --git a/src/common/Configuration/Config.cpp b/src/common/Configuration/Config.cpp index a7aa1ccb7..6bfc88e25 100644 --- a/src/common/Configuration/Config.cpp +++ b/src/common/Configuration/Config.cpp @@ -41,7 +41,7 @@ namespace template inline void PrintError(std::string_view filename, Format&& fmt, Args&& ... args) { - std::string message = acore::StringFormat(std::forward(fmt), std::forward(args)...); + std::string message = Acore::StringFormat(std::forward(fmt), std::forward(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(itr->second); + auto value = Acore::StringTo(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(std::string const& name, bool const& def, bool s { std::string val = GetValueDefault(name, std::string(def ? "1" : "0"), showLogs); - auto boolVal = acore::StringTo(val); + auto boolVal = Acore::StringTo(val); if (!boolVal) { if (showLogs) diff --git a/src/common/Cryptography/AES.cpp b/src/common/Cryptography/AES.cpp index 461434232..dec5e0e4c 100644 --- a/src/common/Cryptography/AES.cpp +++ b/src/common/Cryptography/AES.cpp @@ -7,25 +7,25 @@ #include "Errors.h" #include -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(std::numeric_limits::max())); int len = static_cast(length); diff --git a/src/common/Cryptography/AES.h b/src/common/Cryptography/AES.h index 13fd42fd7..dffd893ea 100644 --- a/src/common/Cryptography/AES.h +++ b/src/common/Cryptography/AES.h @@ -10,7 +10,7 @@ #include #include -namespace acore::Crypto +namespace Acore::Crypto { class AC_COMMON_API AES { diff --git a/src/common/Cryptography/ARC4.cpp b/src/common/Cryptography/ARC4.cpp index 0eb2b7175..e0dc4b4ba 100644 --- a/src/common/Cryptography/ARC4.cpp +++ b/src/common/Cryptography/ARC4.cpp @@ -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); diff --git a/src/common/Cryptography/ARC4.h b/src/common/Cryptography/ARC4.h index f5add8855..d0fa1de9c 100644 --- a/src/common/Cryptography/ARC4.h +++ b/src/common/Cryptography/ARC4.h @@ -11,7 +11,7 @@ #include #include -namespace acore::Crypto +namespace Acore::Crypto { class ARC4 { diff --git a/src/common/Cryptography/Argon2.cpp b/src/common/Cryptography/Argon2.cpp index 4e9e2d6ae..c8002809d 100644 --- a/src/common/Cryptography/Argon2.cpp +++ b/src/common/Cryptography/Argon2.cpp @@ -6,7 +6,7 @@ #include "Argon2.h" #include -/*static*/ Optional acore::Crypto::Argon2::Hash(std::string const& password, BigNumber const& salt, uint32 nIterations, uint32 kibMemoryCost) +/*static*/ Optional Acore::Crypto::Argon2::Hash(std::string const& password, BigNumber const& salt, uint32 nIterations, uint32 kibMemoryCost) { char buf[ENCODED_HASH_LEN]; std::vector 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); diff --git a/src/common/Cryptography/Argon2.h b/src/common/Cryptography/Argon2.h index 73be1d5ff..4a3bcf239 100644 --- a/src/common/Cryptography/Argon2.h +++ b/src/common/Cryptography/Argon2.h @@ -11,7 +11,7 @@ #include "Optional.h" #include -namespace acore::Crypto +namespace Acore::Crypto { struct AC_COMMON_API Argon2 { diff --git a/src/common/Cryptography/Authentication/AuthCrypt.cpp b/src/common/Cryptography/Authentication/AuthCrypt.cpp index 5bf8d43cb..c1c7db2d6 100644 --- a/src/common/Cryptography/Authentication/AuthCrypt.cpp +++ b/src/common/Cryptography/Authentication/AuthCrypt.cpp @@ -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 syncBuf; diff --git a/src/common/Cryptography/Authentication/AuthCrypt.h b/src/common/Cryptography/Authentication/AuthCrypt.h index b8b5ef2e0..24c0048fd 100644 --- a/src/common/Cryptography/Authentication/AuthCrypt.h +++ b/src/common/Cryptography/Authentication/AuthCrypt.h @@ -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 diff --git a/src/common/Cryptography/Authentication/SRP6.cpp b/src/common/Cryptography/Authentication/SRP6.cpp index d66e3aa96..e1a1553cf 100644 --- a/src/common/Cryptography/Authentication/SRP6.cpp +++ b/src/common/Cryptography/Authentication/SRP6.cpp @@ -9,8 +9,8 @@ #include #include -using SHA1 = acore::Crypto::SHA1; -using SRP6 = acore::Crypto::SRP6; +using SHA1 = Acore::Crypto::SHA1; +using SRP6 = Acore::Crypto::SRP6; /*static*/ std::array const SRP6::g = { 7 }; /*static*/ std::array const SRP6::N = HexStrToByteArray<32>("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7", true); diff --git a/src/common/Cryptography/Authentication/SRP6.h b/src/common/Cryptography/Authentication/SRP6.h index 9621cf8cc..c101c3625 100644 --- a/src/common/Cryptography/Authentication/SRP6.h +++ b/src/common/Cryptography/Authentication/SRP6.h @@ -14,7 +14,7 @@ #include #include -namespace acore::Crypto +namespace Acore::Crypto { class SRP6 { diff --git a/src/common/Cryptography/CryptoConstants.h b/src/common/Cryptography/CryptoConstants.h index b0c530bcc..298e4d4f4 100644 --- a/src/common/Cryptography/CryptoConstants.h +++ b/src/common/Cryptography/CryptoConstants.h @@ -8,7 +8,7 @@ #include "Define.h" -namespace acore::Crypto +namespace Acore::Crypto { struct Constants { diff --git a/src/common/Cryptography/CryptoGenerics.h b/src/common/Cryptography/CryptoGenerics.h index 103026512..54e02446c 100644 --- a/src/common/Cryptography/CryptoGenerics.h +++ b/src/common/Cryptography/CryptoGenerics.h @@ -13,7 +13,7 @@ #include #include -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 void AEEncryptWithRandomIV(std::vector& 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(); + IV iv = Acore::Impl::CryptoGenericsImpl::GenerateRandomIV(); 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 @@ -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); diff --git a/src/common/Cryptography/CryptoHash.h b/src/common/Cryptography/CryptoHash.h index cdc325883..aa4c85b8f 100644 --- a/src/common/Cryptography/CryptoHash.h +++ b/src/common/Cryptography/CryptoHash.h @@ -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; - using SHA256 = acore::Impl::GenericHash; + using SHA1 = Acore::Impl::GenericHash; + using SHA256 = Acore::Impl::GenericHash; } #endif diff --git a/src/common/Cryptography/CryptoRandom.cpp b/src/common/Cryptography/CryptoRandom.cpp index 29496819c..86b04c657 100644 --- a/src/common/Cryptography/CryptoRandom.cpp +++ b/src/common/Cryptography/CryptoRandom.cpp @@ -7,7 +7,7 @@ #include "Errors.h" #include -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); diff --git a/src/common/Cryptography/CryptoRandom.h b/src/common/Cryptography/CryptoRandom.h index e5de60300..be00b80f4 100644 --- a/src/common/Cryptography/CryptoRandom.h +++ b/src/common/Cryptography/CryptoRandom.h @@ -9,7 +9,7 @@ #include "Define.h" #include -namespace acore::Crypto +namespace Acore::Crypto { void GetRandomBytes(uint8* buf, size_t len); diff --git a/src/common/Cryptography/HMAC.h b/src/common/Cryptography/HMAC.h index 696539ef4..2ca35dfb9 100644 --- a/src/common/Cryptography/HMAC.h +++ b/src/common/Cryptography/HMAC.h @@ -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; - using HMAC_SHA256 = acore::Impl::GenericHMAC; + using HMAC_SHA1 = Acore::Impl::GenericHMAC; + using HMAC_SHA256 = Acore::Impl::GenericHMAC; } #endif diff --git a/src/common/Cryptography/TOTP.cpp b/src/common/Cryptography/TOTP.cpp index 87546a0eb..1bfcf07c0 100644 --- a/src/common/Cryptography/TOTP.cpp +++ b/src/common/Cryptography/TOTP.cpp @@ -8,11 +8,11 @@ #include #include -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 ( diff --git a/src/common/Cryptography/TOTP.h b/src/common/Cryptography/TOTP.h index ee14a6d8a..6a0e78294 100644 --- a/src/common/Cryptography/TOTP.h +++ b/src/common/Cryptography/TOTP.h @@ -10,7 +10,7 @@ #include #include -namespace acore::Crypto +namespace Acore::Crypto { struct AC_COMMON_API TOTP { diff --git a/src/common/Debugging/Errors.cpp b/src/common/Debugging/Errors.cpp index be076c140..d2dbe569d 100644 --- a/src/common/Debugging/Errors.cpp +++ b/src/common/Debugging/Errors.cpp @@ -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() { diff --git a/src/common/Debugging/Errors.h b/src/common/Debugging/Errors.h index 6e40202f4..8173d4d6d 100644 --- a/src/common/Debugging/Errors.h +++ b/src/common/Debugging/Errors.h @@ -10,7 +10,7 @@ #include "Define.h" #include -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) diff --git a/src/common/Dynamic/TypeContainer.h b/src/common/Dynamic/TypeContainer.h index 581076a7c..8e8fc12eb 100644 --- a/src/common/Dynamic/TypeContainer.h +++ b/src/common/Dynamic/TypeContainer.h @@ -91,13 +91,13 @@ template class TypeMapContainer { public: - template [[nodiscard]] size_t Count() const { return acore::Count(i_elements, (SPECIFIC_TYPE*)nullptr); } + template [[nodiscard]] size_t Count() const { return Acore::Count(i_elements, (SPECIFIC_TYPE*)nullptr); } /// inserts a specific object into the container template 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 // 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 bool Insert(KEY_TYPE const& handle, SPECIFIC_TYPE* obj) { - return acore::Insert(_elements, handle, obj); + return Acore::Insert(_elements, handle, obj); } template bool Remove(KEY_TYPE const& handle) { - return acore::Remove(_elements, handle, (SPECIFIC_TYPE*)nullptr); + return Acore::Remove(_elements, handle, (SPECIFIC_TYPE*)nullptr); } template SPECIFIC_TYPE* Find(KEY_TYPE const& handle) { - return acore::Find(_elements, handle, (SPECIFIC_TYPE*)nullptr); + return Acore::Find(_elements, handle, (SPECIFIC_TYPE*)nullptr); } ContainerUnorderedMap& GetElements() { return _elements; } diff --git a/src/common/Dynamic/TypeContainerFunctions.h b/src/common/Dynamic/TypeContainerFunctions.h index cb5b18da9..96e2f8ed6 100644 --- a/src/common/Dynamic/TypeContainerFunctions.h +++ b/src/common/Dynamic/TypeContainerFunctions.h @@ -18,7 +18,7 @@ #include #include -namespace acore +namespace Acore { // Helpers // Insert helpers diff --git a/src/common/Dynamic/TypeContainerFunctionsPtr.h b/src/common/Dynamic/TypeContainerFunctionsPtr.h index 938c6b0aa..3988a7b40 100644 --- a/src/common/Dynamic/TypeContainerFunctionsPtr.h +++ b/src/common/Dynamic/TypeContainerFunctionsPtr.h @@ -17,7 +17,7 @@ #include "Utilities/TypeList.h" #include -namespace acore +namespace Acore { /* ContainerMapList Helpers */ // count functions diff --git a/src/common/Encoding/Base32.cpp b/src/common/Encoding/Base32.cpp index 9eaab724d..3ebd5c400 100644 --- a/src/common/Encoding/Base32.cpp +++ b/src/common/Encoding/Base32.cpp @@ -32,12 +32,12 @@ struct B32Impl } }; -/*static*/ std::string acore::Encoding::Base32::Encode(std::vector const& data) +/*static*/ std::string Acore::Encoding::Base32::Encode(std::vector const& data) { - return acore::Impl::GenericBaseEncoding::Encode(data); + return Acore::Impl::GenericBaseEncoding::Encode(data); } -/*static*/ Optional> acore::Encoding::Base32::Decode(std::string const& data) +/*static*/ Optional> Acore::Encoding::Base32::Decode(std::string const& data) { - return acore::Impl::GenericBaseEncoding::Decode(data); + return Acore::Impl::GenericBaseEncoding::Decode(data); } diff --git a/src/common/Encoding/Base32.h b/src/common/Encoding/Base32.h index d6d1e86d2..68c8be463 100644 --- a/src/common/Encoding/Base32.h +++ b/src/common/Encoding/Base32.h @@ -11,7 +11,7 @@ #include #include -namespace acore::Encoding +namespace Acore::Encoding { struct AC_COMMON_API Base32 { diff --git a/src/common/Encoding/Base64.cpp b/src/common/Encoding/Base64.cpp index 14f147652..b0eb3997c 100644 --- a/src/common/Encoding/Base64.cpp +++ b/src/common/Encoding/Base64.cpp @@ -34,12 +34,12 @@ struct B64Impl } }; -/*static*/ std::string acore::Encoding::Base64::Encode(std::vector const& data) +/*static*/ std::string Acore::Encoding::Base64::Encode(std::vector const& data) { - return acore::Impl::GenericBaseEncoding::Encode(data); + return Acore::Impl::GenericBaseEncoding::Encode(data); } -/*static*/ Optional> acore::Encoding::Base64::Decode(std::string const& data) +/*static*/ Optional> Acore::Encoding::Base64::Decode(std::string const& data) { - return acore::Impl::GenericBaseEncoding::Decode(data); + return Acore::Impl::GenericBaseEncoding::Decode(data); } diff --git a/src/common/Encoding/Base64.h b/src/common/Encoding/Base64.h index 64bba5f5e..8fe7cf0d5 100644 --- a/src/common/Encoding/Base64.h +++ b/src/common/Encoding/Base64.h @@ -11,7 +11,7 @@ #include #include -namespace acore::Encoding +namespace Acore::Encoding { struct AC_COMMON_API Base64 { diff --git a/src/common/Encoding/BaseEncoding.h b/src/common/Encoding/BaseEncoding.h index e02ccfd61..9d0084351 100644 --- a/src/common/Encoding/BaseEncoding.h +++ b/src/common/Encoding/BaseEncoding.h @@ -12,7 +12,7 @@ #include #include -namespace acore::Impl +namespace Acore::Impl { template struct GenericBaseEncoding diff --git a/src/common/Logging/Appender.cpp b/src/common/Logging/Appender.cpp index 660283f85..765b0e2b7 100644 --- a/src/common/Logging/Appender.cpp +++ b/src/common/Logging/Appender.cpp @@ -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 << "] "; diff --git a/src/common/Logging/AppenderConsole.cpp b/src/common/Logging/AppenderConsole.cpp index ab5f778f5..7a9bdfd7a 100644 --- a/src/common/Logging/AppenderConsole.cpp +++ b/src/common/Logging/AppenderConsole.cpp @@ -34,20 +34,20 @@ void AppenderConsole::InitColors(std::string const& name, std::string_view str) return; } - std::vector colorStrs = acore::Tokenize(str, ' ', false); + std::vector 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 color = acore::StringTo(colorStrs[i]); color && EnumUtils::IsValid(*color)) + if (Optional color = Acore::StringTo(colorStrs[i]); color && EnumUtils::IsValid(*color)) _colors[i] = static_cast(*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(i)), name.c_str())); } } diff --git a/src/common/Logging/AppenderFile.cpp b/src/common/Logging/AppenderFile.cpp index 5f7bdb634..c3854ffc9 100644 --- a/src/common/Logging/AppenderFile.cpp +++ b/src/common/Logging/AppenderFile.cpp @@ -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 size = acore::StringTo(args[5])) + if (Optional size = Acore::StringTo(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"); diff --git a/src/common/Logging/Log.cpp b/src/common/Logging/Log.cpp index 00d6418c3..5d80fdae3 100644 --- a/src/common/Logging/Log.cpp +++ b/src/common/Logging/Log.cpp @@ -54,7 +54,7 @@ void Log::CreateAppenderFromConfig(std::string const& appenderName) // if type = Console. optional1 = Color std::string options = sConfigMgr->GetStringDefault(appenderName, ""); - std::vector tokens = acore::Tokenize(options, ',', true); + std::vector 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(tokens[0]).value_or(APPENDER_INVALID)); - LogLevel level = LogLevel(acore::StringTo(tokens[1]).value_or(LOG_LEVEL_INVALID)); + AppenderType type = AppenderType(Acore::StringTo(tokens[0]).value_or(APPENDER_INVALID)); + LogLevel level = LogLevel(Acore::StringTo(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 flagsVal = acore::StringTo(tokens[2])) + if (Optional flagsVal = Acore::StringTo(tokens[2])) flags = AppenderFlags(*flagsVal); else { @@ -120,7 +120,7 @@ void Log::CreateLoggerFromConfig(std::string const& appenderName) return; } - std::vector tokens = acore::Tokenize(options, ',', true); + std::vector 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(tokens[0]).value_or(LOG_LEVEL_INVALID)); + level = LogLevel(Acore::StringTo(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(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); } diff --git a/src/common/Logging/Log.h b/src/common/Logging/Log.h index f75069ca6..f6e362da1 100644 --- a/src/common/Logging/Log.h +++ b/src/common/Logging/Log.h @@ -52,7 +52,7 @@ public: template inline void outMessage(std::string const& filter, LogLevel const level, Format&& fmt, Args&&... args) { - outMessage(filter, level, acore::StringFormat(std::forward(fmt), std::forward(args)...)); + outMessage(filter, level, Acore::StringFormat(std::forward(fmt), std::forward(args)...)); } template @@ -61,7 +61,7 @@ public: if (!ShouldLog("commands.gm", LOG_LEVEL_INFO)) return; - outCommand(acore::StringFormat(std::forward(fmt), std::forward(args)...), std::to_string(account)); + outCommand(Acore::StringFormat(std::forward(fmt), std::forward(args)...), std::to_string(account)); } void outCharDump(char const* str, uint32 account_id, uint64 guid, char const* name); @@ -81,7 +81,7 @@ public: template inline void outString(Format&& fmt, Args&& ... args) { - outMessage("server", LOG_LEVEL_INFO, acore::StringFormat(std::forward(fmt), std::forward(args)...)); + outMessage("server", LOG_LEVEL_INFO, Acore::StringFormat(std::forward(fmt), std::forward(args)...)); } inline void outString() @@ -92,7 +92,7 @@ public: template inline void outError(Format&& fmt, Args&& ... args) { - outMessage("server", LOG_LEVEL_ERROR, acore::StringFormat(std::forward(fmt), std::forward(args)...)); + outMessage("server", LOG_LEVEL_ERROR, Acore::StringFormat(std::forward(fmt), std::forward(args)...)); } template @@ -101,19 +101,19 @@ public: if (!ShouldLog("sql.sql", LOG_LEVEL_ERROR)) return; - outMessage("sql.sql", LOG_LEVEL_ERROR, acore::StringFormat(std::forward(fmt), std::forward(args)...)); + outMessage("sql.sql", LOG_LEVEL_ERROR, Acore::StringFormat(std::forward(fmt), std::forward(args)...)); } template inline void outBasic(Format&& fmt, Args&& ... args) { - outMessage("server", LOG_LEVEL_INFO, acore::StringFormat(std::forward(fmt), std::forward(args)...)); + outMessage("server", LOG_LEVEL_INFO, Acore::StringFormat(std::forward(fmt), std::forward(args)...)); } template inline void outDetail(Format&& fmt, Args&& ... args) { - outMessage("server", LOG_LEVEL_INFO, acore::StringFormat(std::forward(fmt), std::forward(args)...)); + outMessage("server", LOG_LEVEL_INFO, Acore::StringFormat(std::forward(fmt), std::forward(args)...)); } template @@ -122,7 +122,7 @@ public: if (!ShouldLog("sql.dev", LOG_LEVEL_INFO)) return; - outMessage("sql.dev", LOG_LEVEL_INFO, acore::StringFormat(std::forward(fmt), std::forward(args)...)); + outMessage("sql.dev", LOG_LEVEL_INFO, Acore::StringFormat(std::forward(fmt), std::forward(args)...)); } template @@ -131,13 +131,13 @@ public: if (!ShouldLog("sql.driver", LOG_LEVEL_INFO)) return; - outMessage("sql.driver", LOG_LEVEL_INFO, acore::StringFormat(std::forward(fmt), std::forward(args)...)); + outMessage("sql.driver", LOG_LEVEL_INFO, Acore::StringFormat(std::forward(fmt), std::forward(args)...)); } template inline void outMisc(Format&& fmt, Args&& ... args) { - outMessage("server", LOG_LEVEL_INFO, acore::StringFormat(std::forward(fmt), std::forward(args)...)); + outMessage("server", LOG_LEVEL_INFO, Acore::StringFormat(std::forward(fmt), std::forward(args)...)); } template @@ -149,7 +149,7 @@ public: if (!ShouldLog("server", LOG_LEVEL_DEBUG)) return; - outMessage("server", LOG_LEVEL_DEBUG, acore::StringFormat(std::forward(fmt), std::forward(args)...)); + outMessage("server", LOG_LEVEL_DEBUG, Acore::StringFormat(std::forward(fmt), std::forward(args)...)); } private: diff --git a/src/common/Logging/LogMessage.cpp b/src/common/Logging/LogMessage.cpp index ef5175d55..2b0df081f 100644 --- a/src/common/Logging/LogMessage.cpp +++ b/src/common/Logging/LogMessage.cpp @@ -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 diff --git a/src/common/Logging/enuminfo_AppenderConsole.cpp b/src/common/Logging/enuminfo_AppenderConsole.cpp index b98673635..dd5c42e31 100644 --- a/src/common/Logging/enuminfo_AppenderConsole.cpp +++ b/src/common/Logging/enuminfo_AppenderConsole.cpp @@ -9,7 +9,7 @@ #include "SmartEnum.h" #include -namespace acore::Impl::EnumUtilsImpl +namespace Acore::Impl::EnumUtilsImpl { /********************************************************************\ diff --git a/src/common/Logging/enuminfo_LogCommon.cpp b/src/common/Logging/enuminfo_LogCommon.cpp index 4d0f18cc6..8b4f3bfd6 100644 --- a/src/common/Logging/enuminfo_LogCommon.cpp +++ b/src/common/Logging/enuminfo_LogCommon.cpp @@ -9,7 +9,7 @@ #include "SmartEnum.h" #include -namespace acore::Impl::EnumUtilsImpl +namespace Acore::Impl::EnumUtilsImpl { /************************************************************\ diff --git a/src/common/Threading/Threading.cpp b/src/common/Threading/Threading.cpp index 504e54679..4b5706ad6 100644 --- a/src/common/Threading/Threading.cpp +++ b/src/common/Threading/Threading.cpp @@ -13,7 +13,7 @@ #ifdef WIN32 #include #endif // WIN32 -using namespace acore; +using namespace Acore; Thread::Thread() : m_task(nullptr), m_iThreadId(), m_ThreadImp() { diff --git a/src/common/Threading/Threading.h b/src/common/Threading/Threading.h index 448c1cc66..e2e0922aa 100644 --- a/src/common/Threading/Threading.h +++ b/src/common/Threading/Threading.h @@ -10,7 +10,7 @@ #include #include -namespace acore +namespace Acore { class Runnable { diff --git a/src/common/Threading/ThreadingModel.h b/src/common/Threading/ThreadingModel.h index 39afbb8fc..f86aa9b62 100644 --- a/src/common/Threading/ThreadingModel.h +++ b/src/common/Threading/ThreadingModel.h @@ -14,7 +14,7 @@ #include "Define.h" -namespace acore +namespace Acore { template class GeneralLock @@ -126,9 +126,9 @@ namespace acore }; } -template MUTEX acore::ClassLevelLockable::si_mtx; +template MUTEX Acore::ClassLevelLockable::si_mtx; #define INSTANTIATE_CLASS_MUTEX(CTYPE, MUTEX) \ - template class acore::ClassLevelLockable + template class Acore::ClassLevelLockable #endif diff --git a/src/common/Utilities/Containers.h b/src/common/Utilities/Containers.h index 89eb0ccbe..97cfb2203 100644 --- a/src/common/Utilities/Containers.h +++ b/src/common/Utilities/Containers.h @@ -16,7 +16,7 @@ #include #include -namespace acore +namespace Acore { template constexpr inline T* AddressOrSelf(T* ptr) @@ -60,14 +60,14 @@ namespace acore }; } -namespace acore::Containers +namespace Acore::Containers { // resizes to have at most elements // if it has more than elements, the elements to keep are selected randomly template void RandomResize(C& container, std::size_t requestedSize) { - static_assert(std::is_base_of::iterator_category>::value, "Invalid container passed to acore::Containers::RandomResize"); + static_assert(std::is_base_of::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. * diff --git a/src/common/Utilities/IteratorPair.h b/src/common/Utilities/IteratorPair.h index 9b11f82bb..a49517798 100644 --- a/src/common/Utilities/IteratorPair.h +++ b/src/common/Utilities/IteratorPair.h @@ -9,7 +9,7 @@ #include "Define.h" #include -namespace acore +namespace Acore { /** * @class IteratorPair @@ -41,6 +41,6 @@ namespace acore } //! namespace Containers } -//! namespace acore +//! namespace Acore #endif // IteratorPair_h__ diff --git a/src/common/Utilities/SignalHandler.h b/src/common/Utilities/SignalHandler.h index 2ddfb810d..1fb4cd479 100644 --- a/src/common/Utilities/SignalHandler.h +++ b/src/common/Utilities/SignalHandler.h @@ -11,7 +11,7 @@ #include #include -namespace acore +namespace Acore { /// Handle termination signals class SignalHandler diff --git a/src/common/Utilities/SmartEnum.h b/src/common/Utilities/SmartEnum.h index 6115af968..c8bc9964b 100644 --- a/src/common/Utilities/SmartEnum.h +++ b/src/common/Utilities/SmartEnum.h @@ -20,7 +20,7 @@ struct EnumText char const* const Description; }; -namespace acore::Impl::EnumUtilsImpl +namespace Acore::Impl::EnumUtilsImpl { template struct EnumUtils @@ -36,20 +36,20 @@ class EnumUtils { public: template - static size_t Count() { return acore::Impl::EnumUtilsImpl::EnumUtils::Count(); } + static size_t Count() { return Acore::Impl::EnumUtilsImpl::EnumUtils::Count(); } template - static EnumText ToString(Enum value) { return acore::Impl::EnumUtilsImpl::EnumUtils::ToString(value); } + static EnumText ToString(Enum value) { return Acore::Impl::EnumUtilsImpl::EnumUtils::ToString(value); } template - static Enum FromIndex(size_t index) { return acore::Impl::EnumUtilsImpl::EnumUtils::FromIndex(index); } + static Enum FromIndex(size_t index) { return Acore::Impl::EnumUtilsImpl::EnumUtils::FromIndex(index); } template - static uint32 ToIndex(Enum value) { return acore::Impl::EnumUtilsImpl::EnumUtils::ToIndex(value);} + static uint32 ToIndex(Enum value) { return Acore::Impl::EnumUtilsImpl::EnumUtils::ToIndex(value);} template static bool IsValid(Enum value) { try { - acore::Impl::EnumUtilsImpl::EnumUtils::ToIndex(value); + Acore::Impl::EnumUtilsImpl::EnumUtils::ToIndex(value); return true; } catch (...) { @@ -105,7 +105,7 @@ class EnumUtils static Iterator End() { return Iterator(); } template - static acore::IteratorPair> Iterate() { return { Begin(), End() }; } + static Acore::IteratorPair> Iterate() { return { Begin(), End() }; } template static char const* ToConstant(Enum value) { return ToString(value).Constant; } diff --git a/src/common/Utilities/StringConvert.h b/src/common/Utilities/StringConvert.h index 66eaaf7a4..ac650897b 100644 --- a/src/common/Utilities/StringConvert.h +++ b/src/common/Utilities/StringConvert.h @@ -16,11 +16,11 @@ #include #include -namespace acore::Impl::StringConvertImpl +namespace Acore::Impl::StringConvertImpl { template struct For { - static_assert(acore::dependant_false_v, "Unsupported type used for ToString or StringTo"); + static_assert(Acore::dependant_false_v, "Unsupported type used for ToString or StringTo"); }; template @@ -241,18 +241,18 @@ namespace acore::Impl::StringConvertImpl #endif } -namespace acore +namespace Acore { template Optional StringTo(std::string_view str, Params&&... params) { - return acore::Impl::StringConvertImpl::For::FromString(str, std::forward(params)...); + return Acore::Impl::StringConvertImpl::For::FromString(str, std::forward(params)...); } template std::string ToString(Type&& val, Params&&... params) { - return acore::Impl::StringConvertImpl::For>::ToString(std::forward(val), std::forward(params)...); + return Acore::Impl::StringConvertImpl::For>::ToString(std::forward(val), std::forward(params)...); } } diff --git a/src/common/Utilities/StringFormat.cpp b/src/common/Utilities/StringFormat.cpp index 47537e732..2304921bd 100644 --- a/src/common/Utilities/StringFormat.cpp +++ b/src/common/Utilities/StringFormat.cpp @@ -7,7 +7,7 @@ #include template -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(const std::string& s, const std::locale& loc /*= std::locale()*/); +template std::string Acore::String::Trim(const std::string& s, const std::locale& loc /*= std::locale()*/); diff --git a/src/common/Utilities/StringFormat.h b/src/common/Utilities/StringFormat.h index 11cd91b0d..a5bf59f2a 100644 --- a/src/common/Utilities/StringFormat.h +++ b/src/common/Utilities/StringFormat.h @@ -10,7 +10,7 @@ #include -namespace acore +namespace Acore { /// Default AC string format function. template @@ -40,7 +40,7 @@ namespace acore } } -namespace acore::String +namespace Acore::String { template Str Trim(const Str& s, const std::locale& loc = std::locale()); diff --git a/src/common/Utilities/Tokenize.cpp b/src/common/Utilities/Tokenize.cpp index 96906927e..cb21aad24 100644 --- a/src/common/Utilities/Tokenize.cpp +++ b/src/common/Utilities/Tokenize.cpp @@ -5,7 +5,7 @@ #include "Tokenize.h" -std::vector acore::Tokenize(std::string_view str, char sep, bool keepEmpty) +std::vector Acore::Tokenize(std::string_view str, char sep, bool keepEmpty) { std::vector tokens; diff --git a/src/common/Utilities/Tokenize.h b/src/common/Utilities/Tokenize.h index a1eb0b616..fbb784741 100644 --- a/src/common/Utilities/Tokenize.h +++ b/src/common/Utilities/Tokenize.h @@ -10,7 +10,7 @@ #include #include -namespace acore +namespace Acore { std::vector Tokenize(std::string_view str, char sep, bool keepEmpty); diff --git a/src/common/Utilities/Tuples.h b/src/common/Utilities/Tuples.h index 0663c17f3..e0d9f8855 100644 --- a/src/common/Utilities/Tuples.h +++ b/src/common/Utilities/Tuples.h @@ -8,7 +8,7 @@ #include -namespace acore +namespace Acore { template struct has_type; diff --git a/src/common/Utilities/Types.h b/src/common/Utilities/Types.h index 622809376..f0f908071 100644 --- a/src/common/Utilities/Types.h +++ b/src/common/Utilities/Types.h @@ -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 struct Example { - using TupleArg = acore::find_type_if_t; + using TupleArg = Acore::find_type_if_t; bool HasTuple() { - return !std::is_same_v; + return !std::is_same_v; } }; @@ -47,7 +47,7 @@ namespace acore example.HasTuple() == true; // TupleArg is std::tuple Example example2; - example2.HasTuple() == false; // TupleArg is acore::find_type_end + example2.HasTuple() == false; // TupleArg is Acore::find_type_end */ template typename Check, typename... Ts> diff --git a/src/common/Utilities/Util.cpp b/src/common/Utilities/Util.cpp index f2b05454f..7a4d2d8f2 100644 --- a/src/common/Utilities/Util.cpp +++ b/src/common/Utilities/Util.cpp @@ -343,7 +343,7 @@ bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize) { try { - acore::CheckedBufferOutputIterator out(wstr, wsize); + Acore::CheckedBufferOutputIterator 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)); diff --git a/src/common/Utilities/Util.h b/src/common/Utilities/Util.h index d9c32a497..e0e92f232 100644 --- a/src/common/Utilities/Util.h +++ b/src/common/Utilities/Util.h @@ -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 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 void HexStrToByteArray(std::string const& str, std::array& buf, bool reverse = false) { - acore::Impl::HexStrToByteArray(str, buf.data(), Size, reverse); + Acore::Impl::HexStrToByteArray(str, buf.data(), Size, reverse); } template std::array HexStrToByteArray(std::string const& str, bool reverse = false) diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp index 155236288..620a13512 100644 --- a/src/server/authserver/Main.cpp +++ b/src/server/authserver/Main.cpp @@ -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(); 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 diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp index c8c6eb0d7..bb4dff905 100644 --- a/src/server/authserver/Server/AuthSocket.cpp +++ b/src/server/authserver/Server/AuthSocket.cpp @@ -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(*_totpSecret, *secret); + bool success = Acore::Crypto::AEDecrypt(*_totpSecret, *secret); if (!success) { pkt << uint8(WOW_FAIL_DB_BUSY); @@ -490,8 +490,8 @@ bool AuthSocket::_HandleLogonChallenge() _srp6.emplace( _accountInfo.Login, - fields[10].GetBinary(), - fields[11].GetBinary()); + fields[10].GetBinary(), + fields[11].GetBinary()); // 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(); - 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; } diff --git a/src/server/authserver/Server/AuthSocket.h b/src/server/authserver/Server/AuthSocket.h index 1d19be203..9d04cb530 100644 --- a/src/server/authserver/Server/AuthSocket.h +++ b/src/server/authserver/Server/AuthSocket.h @@ -76,7 +76,7 @@ private: RealmSocket& socket_; RealmSocket& socket() { return socket_; } - std::optional _srp6; + std::optional _srp6; SessionKey _sessionKey = {}; std::array _reconnectProof = {}; diff --git a/src/server/database/Database/DatabaseWorkerPool.h b/src/server/database/Database/DatabaseWorkerPool.h index 81728828f..e50fd17c8 100644 --- a/src/server/database/Database/DatabaseWorkerPool.h +++ b/src/server/database/Database/DatabaseWorkerPool.h @@ -63,10 +63,10 @@ public: template void PExecute(Format&& sql, Args&& ... args) { - if (acore::IsFormatEmptyOrNull(sql)) + if (Acore::IsFormatEmptyOrNull(sql)) return; - Execute(acore::StringFormat(std::forward(sql), std::forward(args)...).c_str()); + Execute(Acore::StringFormat(std::forward(sql), std::forward(args)...).c_str()); } //! Enqueues a one-way SQL operation in prepared statement format that will be executed asynchronously. @@ -86,10 +86,10 @@ public: template void DirectPExecute(Format&& sql, Args&& ... args) { - if (acore::IsFormatEmptyOrNull(sql)) + if (Acore::IsFormatEmptyOrNull(sql)) return; - DirectExecute(acore::StringFormat(std::forward(sql), std::forward(args)...).c_str()); + DirectExecute(Acore::StringFormat(std::forward(sql), std::forward(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 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(sql), std::forward(args)...).c_str(), conn); + return Query(Acore::StringFormat(std::forward(sql), std::forward(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 QueryResult PQuery(Format&& sql, Args&& ... args) { - if (acore::IsFormatEmptyOrNull(sql)) + if (Acore::IsFormatEmptyOrNull(sql)) return QueryResult(nullptr); - return Query(acore::StringFormat(std::forward(sql), std::forward(args)...).c_str()); + return Query(Acore::StringFormat(std::forward(sql), std::forward(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 QueryResultFuture AsyncPQuery(Format&& sql, Args&& ... args) { - if (acore::IsFormatEmptyOrNull(sql)) + if (Acore::IsFormatEmptyOrNull(sql)) return QueryResult(nullptr); - return AsyncQuery(acore::StringFormat(std::forward(sql), std::forward(args)...).c_str()); + return AsyncQuery(Acore::StringFormat(std::forward(sql), std::forward(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. diff --git a/src/server/game/AI/CoreAI/TotemAI.cpp b/src/server/game/AI/CoreAI/TotemAI.cpp index c9f975b73..7beb5f2c6 100644 --- a/src/server/game/AI/CoreAI/TotemAI.cpp +++ b/src/server/game/AI/CoreAI/TotemAI.cpp @@ -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 checker(me, victim, u_check); + Acore::NearestAttackableUnitInObjectRangeCheck u_check(me, me, max_range); + Acore::UnitLastSearcher checker(me, victim, u_check); me->VisitNearbyObject(max_range, checker); } diff --git a/src/server/game/AI/CoreAI/UnitAI.h b/src/server/game/AI/CoreAI/UnitAI.h index 7cb3bda61..107c2a87a 100644 --- a/src/server/game/AI/CoreAI/UnitAI.h +++ b/src/server/game/AI/CoreAI/UnitAI.h @@ -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 +struct DefaultTargetSelector : public Acore::unary_function { const Unit* me; float m_dist; @@ -78,7 +78,7 @@ struct DefaultTargetSelector : public acore::unary_function // Target selector for spell casts checking range, auras and attributes // TODO: Add more checks from Spell::CheckCast -struct SpellTargetSelector : public acore::unary_function +struct SpellTargetSelector : public Acore::unary_function { 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 +struct NonTankTargetSelector : public Acore::unary_function { 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 +struct PowerUsersSelector : public Acore::unary_function { Unit const* _me; Powers const _power; @@ -134,7 +134,7 @@ struct PowerUsersSelector : public acore::unary_function } }; -struct FarthestTargetSelector : public acore::unary_function +struct FarthestTargetSelector : public Acore::unary_function { 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 + // predicate shall extend Acore::unary_function template 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& 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 + // predicate shall extend Acore::unary_function template void SelectTargetList(std::list& 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); } diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 5b0c8ccd6..f6ce77958 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -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 searcher(me, unit, u_check); + Acore::MostHPMissingInRange u_check(me, range, minHPDiff); + Acore::UnitLastSearcher searcher(me, unit, u_check); me->VisitNearbyObject(range, searcher); return unit; @@ -389,8 +389,8 @@ Unit* ScriptedAI::DoSelectLowestHpFriendly(float range, uint32 minHPDiff) std::list ScriptedAI::DoFindFriendlyCC(float range) { std::list list; - acore::FriendlyCCedInRange u_check(me, range); - acore::CreatureListSearcher searcher(me, list, u_check); + Acore::FriendlyCCedInRange u_check(me, range); + Acore::CreatureListSearcher searcher(me, list, u_check); me->VisitNearbyObject(range, searcher); return list; } @@ -398,8 +398,8 @@ std::list ScriptedAI::DoFindFriendlyCC(float range) std::list ScriptedAI::DoFindFriendlyMissingBuff(float range, uint32 uiSpellid) { std::list list; - acore::FriendlyMissingBuffInRange u_check(me, range, uiSpellid); - acore::CreatureListSearcher searcher(me, list, u_check); + Acore::FriendlyMissingBuffInRange u_check(me, range, uiSpellid); + Acore::CreatureListSearcher 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 searcher(me, player, check); - TypeContainerVisitor, GridTypeMapContainer> visitor(searcher); + Acore::PlayerAtMinimumRangeAway check(me, minimumRange); + Acore::PlayerSearcher searcher(me, player, check); + TypeContainerVisitor, GridTypeMapContainer> visitor(searcher); cell.Visit(pair, visitor, *me->GetMap(), *me, minimumRange); diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index 3ed64690a..7521bed16 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -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(listCopy, std::forward(predicate), max); + Acore::Containers::RandomResize(listCopy, std::forward(predicate), max); for (auto const& guid : listCopy) { diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 6743862d8..bc62fc955 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -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 searcher(obj, *targets, u_check); + Acore::AllWorldObjectsInRange u_check(obj, dist); + Acore::WorldObjectListSearcher 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 searcher(me, unit, u_check); + Acore::MostHPMissingInRange u_check(me, range, MinHPDiff); + Acore::UnitLastSearcher searcher(me, unit, u_check); me->VisitNearbyObject(range, searcher); return unit; } @@ -4873,8 +4873,8 @@ void SmartScript::DoFindFriendlyCC(std::list& _list, float range) if (!me) return; - acore::FriendlyCCedInRange u_check(me, range); - acore::CreatureListSearcher searcher(me, _list, u_check); + Acore::FriendlyCCedInRange u_check(me, range); + Acore::CreatureListSearcher searcher(me, _list, u_check); me->VisitNearbyObject(range, searcher); } @@ -4883,8 +4883,8 @@ void SmartScript::DoFindFriendlyMissingBuff(std::list& list, float ra if (!me) return; - acore::FriendlyMissingBuffInRange u_check(me, range, spellid); - acore::CreatureListSearcher searcher(me, list, u_check); + Acore::FriendlyMissingBuffInRange u_check(me, range, spellid); + Acore::CreatureListSearcher 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 searcher(me, unit, u_check); + Acore::AnyFriendlyNotSelfUnitInObjectRangeCheck u_check(me, me, range, playerOnly); + Acore::UnitLastSearcher searcher(me, unit, u_check); me->VisitNearbyObject(range, searcher); return unit; } diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 8cca8d5bb..bdad79b76 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -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; diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index 9801aecba..e7faf99e7 100644 --- a/src/server/game/Accounts/AccountMgr.cpp +++ b/src/server/game/Accounts/AccountMgr.cpp @@ -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::Verifier verifier = (*result)[1].GetBinary(); - if (acore::Crypto::SRP6::CheckLogin(username, password, salt, verifier)) + Acore::Crypto::SRP6::Salt salt = (*result)[0].GetBinary(); + Acore::Crypto::SRP6::Verifier verifier = (*result)[1].GetBinary(); + if (Acore::Crypto::SRP6::CheckLogin(username, password, salt, verifier)) return true; } diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 8fcb5b724..a5007d5c5 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -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 say_do(say_builder); + Acore::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_GUILD_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED, achievement->ID); + Acore::LocalizedPacketDo 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 say_do(say_builder); - acore::PlayerDistWorker > say_worker(GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do); - TypeContainerVisitor >, WorldTypeMapContainer > message(say_worker); + Acore::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED, achievement->ID); + Acore::LocalizedPacketDo say_do(say_builder); + Acore::PlayerDistWorker > say_worker(GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do); + TypeContainerVisitor >, WorldTypeMapContainer > message(say_worker); cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY)); } diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp index f92b5bade..6f54807b3 100644 --- a/src/server/game/Battlefield/Battlefield.cpp +++ b/src/server/game/Battlefield/Battlefield.cpp @@ -1003,8 +1003,8 @@ bool BfCapturePoint::Update(uint32 diff) } std::list players; - acore::AnyPlayerInObjectRangeCheck checker(capturePoint, radius); - acore::PlayerListSearcher searcher(capturePoint, players, checker); + Acore::AnyPlayerInObjectRangeCheck checker(capturePoint, radius); + Acore::PlayerListSearcher searcher(capturePoint, players, checker); capturePoint->VisitNearbyWorldObject(radius, searcher); for (std::list::iterator itr = players.begin(); itr != players.end(); ++itr) diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 00ddf56c5..2a919eb22 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -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 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(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 bg_do(bg_builder); + Acore::BattlegroundChatBuilder bg_builder(type, entry, source); + Acore::LocalizedPacketDo 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 bg_do(bg_builder); + Acore::BattlegroundChatBuilder bg_builder(type, entry, source, &ap); + Acore::LocalizedPacketDo 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 bg_do(bg_builder); + Acore::Battleground2ChatBuilder bg_builder(type, entry, source, arg1, arg2); + Acore::LocalizedPacketDo bg_do(bg_builder); BroadcastWorker(bg_do); } diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index e03e6e1b1..f159146ab 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -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; diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index aa1eb2ee3..9b52eff90 100644 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -886,8 +886,8 @@ GameObject* ChatHandler::GetNearbyGameObject() Player* pl = m_session->GetPlayer(); GameObject* obj = nullptr; - acore::NearestGameObjectCheck check(*pl); - acore::GameObjectLastSearcher searcher(pl, obj, check); + Acore::NearestGameObjectCheck check(*pl); + Acore::GameObjectLastSearcher searcher(pl, obj, check); pl->VisitNearbyGridObject(SIZE_OF_GRIDS, searcher); return obj; } diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index f6ff3cc58..42558a43e 100644 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -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; } diff --git a/src/server/game/Combat/ThreatManager.h b/src/server/game/Combat/ThreatManager.h index 70a2ab832..44f578688 100644 --- a/src/server/game/Combat/ThreatManager.h +++ b/src/server/game/Combat/ThreatManager.h @@ -256,7 +256,7 @@ private: //================================================= -namespace acore +namespace Acore { // Binary predicate for sorting HostileReferences based on threat value class ThreatOrderPred diff --git a/src/server/game/DungeonFinding/LFGQueue.cpp b/src/server/game/DungeonFinding/LFGQueue.cpp index 86ead49f6..ac201d434 100644 --- a/src/server/game/DungeonFinding/LFGQueue.cpp +++ b/src/server/game/DungeonFinding/LFGQueue.cpp @@ -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) diff --git a/src/server/game/Entities/Corpse/Corpse.cpp b/src/server/game/Entities/Corpse/Corpse.cpp index db9a33a01..c50f1a077 100644 --- a/src/server/game/Entities/Corpse/Corpse.cpp +++ b/src/server/game/Entities/Corpse/Corpse.cpp @@ -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; } diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index ce7ff3e12..4a0dc9de5 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -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(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 searcher(this, creature, u_check); + Acore::NearestAssistCreatureInCreatureRangeCheck u_check(this, GetVictim(), radius); + Acore::CreatureLastSearcher searcher(this, creature, u_check); - TypeContainerVisitor, GridTypeMapContainer > grid_creature_searcher(searcher); + TypeContainerVisitor, 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 searcher(this, target, u_check); + Acore::NearestHostileUnitCheck u_check(this, dist, playerOnly); + Acore::UnitLastSearcher searcher(this, target, u_check); - TypeContainerVisitor, WorldTypeMapContainer > world_unit_searcher(searcher); - TypeContainerVisitor, GridTypeMapContainer > grid_unit_searcher(searcher); + TypeContainerVisitor, WorldTypeMapContainer > world_unit_searcher(searcher); + TypeContainerVisitor, 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 searcher(this, target, u_check); + Acore::NearestHostileUnitInAttackDistanceCheck u_check(this, dist); + Acore::UnitLastSearcher searcher(this, target, u_check); - TypeContainerVisitor, WorldTypeMapContainer > world_unit_searcher(searcher); - TypeContainerVisitor, GridTypeMapContainer > grid_unit_searcher(searcher); + TypeContainerVisitor, WorldTypeMapContainer > world_unit_searcher(searcher); + TypeContainerVisitor, 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 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 searcher(this, assistList, u_check); + Acore::AnyAssistCreatureInRangeCheck u_check(this, GetVictim(), radius); + Acore::CreatureListSearcher searcher(this, assistList, u_check); - TypeContainerVisitor, GridTypeMapContainer > grid_creature_searcher(searcher); + TypeContainerVisitor, 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 worker(this, u_do); + Acore::CallOfHelpCreatureInRangeDo u_do(this, GetVictim(), radius); + Acore::CreatureWorker worker(this, u_do); - TypeContainerVisitor, GridTypeMapContainer > grid_creature_searcher(worker); + TypeContainerVisitor, 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); diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp index e2ff76d1b..09c035428 100644 --- a/src/server/game/Entities/Creature/CreatureGroups.cpp +++ b/src/server/game/Entities/Creature/CreatureGroups.cpp @@ -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); diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 62121bdc9..18386a186 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -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(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 searcher(this, target, checker); + Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck checker(this, owner, radius); + Acore::UnitSearcher 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 searcher(this, player, checker); + Acore::AnyPlayerInObjectRangeCheck checker(this, radius, true, true); + Acore::PlayerSearcher 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 checker(this, trapGO, go_check); + Acore::NearestGameObjectEntryInObjectRangeCheck go_check(*target, trapEntry, range); + Acore::GameObjectLastSearcher checker(this, trapGO, go_check); - TypeContainerVisitor, GridTypeMapContainer > object_checker(checker); + TypeContainerVisitor, 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 checker(this, ok, u_check); + Acore::NearestGameObjectFishingHole u_check(*this, range); + Acore::GameObjectSearcher checker(this, ok, u_check); - TypeContainerVisitor, GridTypeMapContainer > grid_object_checker(checker); + TypeContainerVisitor, 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); diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 44d5db6ad..c9cdcb8e7 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -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 say_do(say_build); - acore::PlayerDistWorker > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do); - TypeContainerVisitor >, WorldTypeMapContainer > message(say_worker); + Acore::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, text, language, target); + Acore::LocalizedPacketDo say_do(say_build); + Acore::PlayerDistWorker > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do); + TypeContainerVisitor >, 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 say_do(say_build); - acore::PlayerDistWorker > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do); - TypeContainerVisitor >, WorldTypeMapContainer > message(say_worker); + Acore::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, textId, language, target); + Acore::LocalizedPacketDo say_do(say_build); + Acore::PlayerDistWorker > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do); + TypeContainerVisitor >, 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 say_do(say_build); - acore::PlayerDistWorker > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do); - TypeContainerVisitor >, WorldTypeMapContainer > message(say_worker); + Acore::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, text, language, target); + Acore::LocalizedPacketDo say_do(say_build); + Acore::PlayerDistWorker > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do); + TypeContainerVisitor >, 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 say_do(say_build); - acore::PlayerDistWorker > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do); - TypeContainerVisitor >, WorldTypeMapContainer > message(say_worker); + Acore::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, textId, language, target); + Acore::LocalizedPacketDo say_do(say_build); + Acore::PlayerDistWorker > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do); + TypeContainerVisitor >, 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 say_do(say_build); - acore::PlayerDistWorker > say_worker(this, (IsBossEmote ? 200.0f : sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)), say_do); - TypeContainerVisitor >, 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 say_do(say_build); + Acore::PlayerDistWorker > say_worker(this, (IsBossEmote ? 200.0f : sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)), say_do); + TypeContainerVisitor >, 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* list Creature* WorldObject::FindNearestCreature(uint32 entry, float range, bool alive) const { Creature* creature = nullptr; - acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck checker(*this, entry, alive, range); - acore::CreatureLastSearcher searcher(this, creature, checker); + Acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck checker(*this, entry, alive, range); + Acore::CreatureLastSearcher 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 searcher(this, go, checker); + Acore::NearestGameObjectEntryInObjectRangeCheck checker(*this, entry, range); + Acore::GameObjectLastSearcher 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 searcher(this, go, checker); + Acore::NearestGameObjectTypeInObjectRangeCheck checker(*this, type, range); + Acore::GameObjectLastSearcher 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 searcher(this, target, checker); + Acore::NearestPlayerInObjectRangeCheck checker(this, distance); + Acore::PlayerLastSearcher searcher(this, target, checker); VisitNearbyObject(distance, searcher); return target; @@ -2441,32 +2441,32 @@ Player* WorldObject::SelectNearestPlayer(float distance) const void WorldObject::GetGameObjectListWithEntryInGrid(std::list& 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 searcher(this, gameobjectList, check); - TypeContainerVisitor, GridTypeMapContainer> visitor(searcher); + Acore::AllGameObjectsWithEntryInRange check(this, entry, maxSearchRange); + Acore::GameObjectListSearcher searcher(this, gameobjectList, check); + TypeContainerVisitor, GridTypeMapContainer> visitor(searcher); cell.Visit(pair, visitor, *(this->GetMap()), *this, maxSearchRange); } void WorldObject::GetCreatureListWithEntryInGrid(std::list& 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 searcher(this, creatureList, check); - TypeContainerVisitor, GridTypeMapContainer> visitor(searcher); + Acore::AllCreaturesOfEntryInRange check(this, entry, maxSearchRange); + Acore::CreatureListSearcher searcher(this, creatureList, check); + TypeContainerVisitor, 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 targets; - acore::AnyPlayerInObjectRangeCheck check(this, GetVisibilityRange() + VISIBILITY_COMPENSATION, false); - acore::PlayerListSearcherWithSharedVision searcher(this, targets, check); + Acore::AnyPlayerInObjectRangeCheck check(this, GetVisibilityRange() + VISIBILITY_COMPENSATION, false); + Acore::PlayerListSearcherWithSharedVision searcher(this, targets, check); VisitNearbyWorldObject(GetVisibilityRange() + VISIBILITY_COMPENSATION, searcher); for (std::list::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& 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 searcher(this, creatureList, check); + Acore::AllCreaturesOfEntryInRange check(this, entry, radius); + Acore::CreatureListSearcher searcher(this, creatureList, check); - TypeContainerVisitor, WorldTypeMapContainer> world_visitor(searcher); + TypeContainerVisitor, WorldTypeMapContainer> world_visitor(searcher); cell.Visit(pair, world_visitor, *(this->GetMap()), *this, radius); - TypeContainerVisitor, GridTypeMapContainer> grid_visitor(searcher); + TypeContainerVisitor, GridTypeMapContainer> grid_visitor(searcher); cell.Visit(pair, grid_visitor, *(this->GetMap()), *this, radius); } diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 55c8a130e..a4fadafbd 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -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 diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 3545ad19f..da21caab9 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -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: 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 players; - acore::AnyPlayerInObjectRangeCheck checker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)); - acore::PlayerListSearcher searcher(this, players, checker); + Acore::AnyPlayerInObjectRangeCheck checker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)); + Acore::PlayerListSearcher 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) diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 002906ab2..f60aa5edf 100644 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -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()) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 2a827fb48..3bcb7ee58 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -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 targets; - acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, this, dist); - acore::UnitListSearcher searcher(this, targets, u_check); + Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, this, dist); + Acore::UnitListSearcher 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 targets; - acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck u_check(this, this, dist); - acore::UnitListSearcher searcher(this, targets, u_check); + Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck u_check(this, this, dist); + Acore::UnitListSearcher 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); } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index c0d5f5ab1..5149baf2c 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -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 diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 5bdb3a3f6..9a2d28fc1 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -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; diff --git a/src/server/game/Grids/Cells/CellImpl.h b/src/server/game/Grids/Cells/CellImpl.h index a6d23c4b7..0c9f0e10d 100644 --- a/src/server/game/Grids/Cells/CellImpl.h +++ b/src/server/game/Grids/Cells/CellImpl.h @@ -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); } diff --git a/src/server/game/Grids/GridDefines.h b/src/server/game/Grids/GridDefines.h index b6ae348a0..1a01b1c1c 100644 --- a/src/server/game/Grids/GridDefines.h +++ b/src/server/game/Grids/GridDefines.h @@ -158,7 +158,7 @@ bool operator!=(const CoordPair& p1, const CoordPair& p2) typedef CoordPair GridCoord; typedef CoordPair CellCoord; -namespace acore +namespace Acore { template inline RET_TYPE Compute(float x, float y, float center_offset, float size) diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.cpp b/src/server/game/Grids/Notifiers/GridNotifiers.cpp index b6eb5efb8..42a28a9c7 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.cpp +++ b/src/server/game/Grids/Notifiers/GridNotifiers.cpp @@ -16,7 +16,7 @@ #include "WorldPacket.h" #include "WorldSession.h" -using namespace acore; +using namespace Acore; void VisibleNotifier::Visit(GameObjectMapType& m) { diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index 1b97b7fe0..9d681b696 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -23,7 +23,7 @@ class Player; //class Map; -namespace acore +namespace Acore { struct VisibleNotifier { diff --git a/src/server/game/Grids/Notifiers/GridNotifiersImpl.h b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h index d6adc6e29..b116a629f 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiersImpl.h +++ b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h @@ -17,7 +17,7 @@ #include "WorldPacket.h" template -inline void acore::VisibleNotifier::Visit(GridRefManager& m) +inline void Acore::VisibleNotifier::Visit(GridRefManager& m) { // Xinef: Update gameobjects only if (i_gobjOnly) @@ -37,7 +37,7 @@ inline void acore::VisibleNotifier::Visit(GridRefManager& m) // WorldObject searchers & workers template -void acore::WorldObjectSearcher::Visit(GameObjectMapType& m) +void Acore::WorldObjectSearcher::Visit(GameObjectMapType& m) { if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_GAMEOBJECT)) return; @@ -60,7 +60,7 @@ void acore::WorldObjectSearcher::Visit(GameObjectMapType& m) } template -void acore::WorldObjectSearcher::Visit(PlayerMapType& m) +void Acore::WorldObjectSearcher::Visit(PlayerMapType& m) { if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_PLAYER)) return; @@ -83,7 +83,7 @@ void acore::WorldObjectSearcher::Visit(PlayerMapType& m) } template -void acore::WorldObjectSearcher::Visit(CreatureMapType& m) +void Acore::WorldObjectSearcher::Visit(CreatureMapType& m) { if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CREATURE)) return; @@ -106,7 +106,7 @@ void acore::WorldObjectSearcher::Visit(CreatureMapType& m) } template -void acore::WorldObjectSearcher::Visit(CorpseMapType& m) +void Acore::WorldObjectSearcher::Visit(CorpseMapType& m) { if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CORPSE)) return; @@ -129,7 +129,7 @@ void acore::WorldObjectSearcher::Visit(CorpseMapType& m) } template -void acore::WorldObjectSearcher::Visit(DynamicObjectMapType& m) +void Acore::WorldObjectSearcher::Visit(DynamicObjectMapType& m) { if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_DYNAMICOBJECT)) return; @@ -152,7 +152,7 @@ void acore::WorldObjectSearcher::Visit(DynamicObjectMapType& m) } template -void acore::WorldObjectLastSearcher::Visit(GameObjectMapType& m) +void Acore::WorldObjectLastSearcher::Visit(GameObjectMapType& m) { if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_GAMEOBJECT)) return; @@ -168,7 +168,7 @@ void acore::WorldObjectLastSearcher::Visit(GameObjectMapType& m) } template -void acore::WorldObjectLastSearcher::Visit(PlayerMapType& m) +void Acore::WorldObjectLastSearcher::Visit(PlayerMapType& m) { if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_PLAYER)) return; @@ -184,7 +184,7 @@ void acore::WorldObjectLastSearcher::Visit(PlayerMapType& m) } template -void acore::WorldObjectLastSearcher::Visit(CreatureMapType& m) +void Acore::WorldObjectLastSearcher::Visit(CreatureMapType& m) { if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CREATURE)) return; @@ -200,7 +200,7 @@ void acore::WorldObjectLastSearcher::Visit(CreatureMapType& m) } template -void acore::WorldObjectLastSearcher::Visit(CorpseMapType& m) +void Acore::WorldObjectLastSearcher::Visit(CorpseMapType& m) { if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CORPSE)) return; @@ -216,7 +216,7 @@ void acore::WorldObjectLastSearcher::Visit(CorpseMapType& m) } template -void acore::WorldObjectLastSearcher::Visit(DynamicObjectMapType& m) +void Acore::WorldObjectLastSearcher::Visit(DynamicObjectMapType& m) { if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_DYNAMICOBJECT)) return; @@ -232,7 +232,7 @@ void acore::WorldObjectLastSearcher::Visit(DynamicObjectMapType& m) } template -void acore::WorldObjectListSearcher::Visit(PlayerMapType& m) +void Acore::WorldObjectListSearcher::Visit(PlayerMapType& m) { if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_PLAYER)) return; @@ -243,7 +243,7 @@ void acore::WorldObjectListSearcher::Visit(PlayerMapType& m) } template -void acore::WorldObjectListSearcher::Visit(CreatureMapType& m) +void Acore::WorldObjectListSearcher::Visit(CreatureMapType& m) { if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CREATURE)) return; @@ -254,7 +254,7 @@ void acore::WorldObjectListSearcher::Visit(CreatureMapType& m) } template -void acore::WorldObjectListSearcher::Visit(CorpseMapType& m) +void Acore::WorldObjectListSearcher::Visit(CorpseMapType& m) { if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CORPSE)) return; @@ -265,7 +265,7 @@ void acore::WorldObjectListSearcher::Visit(CorpseMapType& m) } template -void acore::WorldObjectListSearcher::Visit(GameObjectMapType& m) +void Acore::WorldObjectListSearcher::Visit(GameObjectMapType& m) { if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_GAMEOBJECT)) return; @@ -276,7 +276,7 @@ void acore::WorldObjectListSearcher::Visit(GameObjectMapType& m) } template -void acore::WorldObjectListSearcher::Visit(DynamicObjectMapType& m) +void Acore::WorldObjectListSearcher::Visit(DynamicObjectMapType& m) { if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_DYNAMICOBJECT)) return; @@ -289,7 +289,7 @@ void acore::WorldObjectListSearcher::Visit(DynamicObjectMapType& m) // Gameobject searchers template -void acore::GameObjectSearcher::Visit(GameObjectMapType& m) +void Acore::GameObjectSearcher::Visit(GameObjectMapType& m) { // already found if (i_object) @@ -309,7 +309,7 @@ void acore::GameObjectSearcher::Visit(GameObjectMapType& m) } template -void acore::GameObjectLastSearcher::Visit(GameObjectMapType& m) +void Acore::GameObjectLastSearcher::Visit(GameObjectMapType& m) { for (GameObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr) { @@ -322,7 +322,7 @@ void acore::GameObjectLastSearcher::Visit(GameObjectMapType& m) } template -void acore::GameObjectListSearcher::Visit(GameObjectMapType& m) +void Acore::GameObjectListSearcher::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::Visit(GameObjectMapType& m) // Unit searchers template -void acore::UnitSearcher::Visit(CreatureMapType& m) +void Acore::UnitSearcher::Visit(CreatureMapType& m) { // already found if (i_object) @@ -353,7 +353,7 @@ void acore::UnitSearcher::Visit(CreatureMapType& m) } template -void acore::UnitSearcher::Visit(PlayerMapType& m) +void Acore::UnitSearcher::Visit(PlayerMapType& m) { // already found if (i_object) @@ -373,7 +373,7 @@ void acore::UnitSearcher::Visit(PlayerMapType& m) } template -void acore::UnitLastSearcher::Visit(CreatureMapType& m) +void Acore::UnitLastSearcher::Visit(CreatureMapType& m) { for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr) { @@ -386,7 +386,7 @@ void acore::UnitLastSearcher::Visit(CreatureMapType& m) } template -void acore::UnitLastSearcher::Visit(PlayerMapType& m) +void Acore::UnitLastSearcher::Visit(PlayerMapType& m) { for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr) { @@ -399,7 +399,7 @@ void acore::UnitLastSearcher::Visit(PlayerMapType& m) } template -void acore::UnitListSearcher::Visit(PlayerMapType& m) +void Acore::UnitListSearcher::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::Visit(PlayerMapType& m) } template -void acore::UnitListSearcher::Visit(CreatureMapType& m) +void Acore::UnitListSearcher::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::Visit(CreatureMapType& m) // Creature searchers template -void acore::CreatureSearcher::Visit(CreatureMapType& m) +void Acore::CreatureSearcher::Visit(CreatureMapType& m) { // already found if (i_object) @@ -439,7 +439,7 @@ void acore::CreatureSearcher::Visit(CreatureMapType& m) } template -void acore::CreatureLastSearcher::Visit(CreatureMapType& m) +void Acore::CreatureLastSearcher::Visit(CreatureMapType& m) { for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr) { @@ -452,7 +452,7 @@ void acore::CreatureLastSearcher::Visit(CreatureMapType& m) } template -void acore::CreatureListSearcher::Visit(CreatureMapType& m) +void Acore::CreatureListSearcher::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::Visit(CreatureMapType& m) } template -void acore::PlayerListSearcher::Visit(PlayerMapType& m) +void Acore::PlayerListSearcher::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::Visit(PlayerMapType& m) } template -void acore::PlayerListSearcherWithSharedVision::Visit(PlayerMapType& m) +void Acore::PlayerListSearcherWithSharedVision::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::Visit(PlayerMapType& m) } template -void acore::PlayerListSearcherWithSharedVision::Visit(CreatureMapType& m) +void Acore::PlayerListSearcherWithSharedVision::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::Visit(CreatureMapType& m) } template -void acore::PlayerSearcher::Visit(PlayerMapType& m) +void Acore::PlayerSearcher::Visit(PlayerMapType& m) { // already found if (i_object) @@ -509,7 +509,7 @@ void acore::PlayerSearcher::Visit(PlayerMapType& m) } template -void acore::PlayerLastSearcher::Visit(PlayerMapType& m) +void Acore::PlayerLastSearcher::Visit(PlayerMapType& m) { for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr) { @@ -522,7 +522,7 @@ void acore::PlayerLastSearcher::Visit(PlayerMapType& m) } template -void acore::LocalizedPacketDo::operator()(Player* p) +void Acore::LocalizedPacketDo::operator()(Player* p) { LocaleConstant loc_idx = p->GetSession()->GetSessionDbLocaleIndex(); uint32 cache_idx = loc_idx + 1; @@ -547,7 +547,7 @@ void acore::LocalizedPacketDo::operator()(Player* p) } template -void acore::LocalizedPacketListDo::operator()(Player* p) +void Acore::LocalizedPacketListDo::operator()(Player* p) { LocaleConstant loc_idx = p->GetSession()->GetSessionDbLocaleIndex(); uint32 cache_idx = loc_idx + 1; diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 5022cc61f..83b4d4b8d 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1740,7 +1740,7 @@ void Guild::HandleMemberDepositMoney(WorldSession* session, uint32 amount) CharacterDatabase.CommitTransaction(trans); - std::string aux = acore::Impl::ByteArrayToHexStr(reinterpret_cast(&m_bankMoney), 8, true); + std::string aux = Acore::Impl::ByteArrayToHexStr(reinterpret_cast(&m_bankMoney), 8, true); _BroadcastEvent(GE_BANK_MONEY_SET, ObjectGuid::Empty, aux.c_str()); if (amount > 10 * GOLD) @@ -1791,7 +1791,7 @@ bool Guild::HandleMemberWithdrawMoney(WorldSession* session, uint32 amount, bool CharacterDatabase.PExecute("INSERT INTO log_money VALUES(%u, %u, \"%s\", \"%s\", %u, \"%s\", %u, \" %s (guild id: %u, members: %u, new amount: %u, leader guid low: %u, char level: %u)\", NOW())", session->GetAccountId(), player->GetGUID().GetCounter(), player->GetName().c_str(), session->GetRemoteAddress().c_str(), 0, "", amount, GetName().c_str(), GetId(), GetMemberCount(), GetTotalBankMoney(), GetLeaderGUID().GetCounter(), player->getLevel()); - std::string aux = acore::Impl::ByteArrayToHexStr(reinterpret_cast(&m_bankMoney), 8, true); + std::string aux = Acore::Impl::ByteArrayToHexStr(reinterpret_cast(&m_bankMoney), 8, true); _BroadcastEvent(GE_BANK_MONEY_SET, ObjectGuid::Empty, aux.c_str()); return true; } diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 3f3e6c19b..8e7f3bfad 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -693,7 +693,7 @@ void WorldSession::HandleEmoteOpcode(WorldPacket& recvData) GetPlayer()->HandleEmoteCommand(emote); } -namespace acore +namespace Acore { class EmoteChatBuilder { @@ -723,7 +723,7 @@ namespace acore uint32 i_emote_num; Unit const* i_target; }; -} // namespace acore +} // namespace Acore void WorldSession::HandleTextEmoteOpcode(WorldPacket& recvData) { @@ -774,15 +774,15 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket& recvData) Unit* unit = ObjectAccessor::GetUnit(*_player, guid); - CellCoord p = acore::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY()); + CellCoord p = Acore::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY()); Cell cell(p); cell.SetNoCreate(); - acore::EmoteChatBuilder emote_builder(*GetPlayer(), text_emote, emoteNum, unit); - acore::LocalizedPacketDo emote_do(emote_builder); - acore::PlayerDistWorker > emote_worker(GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), emote_do); - TypeContainerVisitor >, WorldTypeMapContainer> message(emote_worker); + Acore::EmoteChatBuilder emote_builder(*GetPlayer(), text_emote, emoteNum, unit); + Acore::LocalizedPacketDo emote_do(emote_builder); + Acore::PlayerDistWorker > emote_worker(GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), emote_do); + TypeContainerVisitor >, WorldTypeMapContainer> message(emote_worker); cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)); GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE, text_emote, 0, unit); diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index e83745d52..6d54409ad 100644 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -120,7 +120,7 @@ void WorldSession::HandleMoveWorldportAck() if (!_player->getHostileRefManager().isEmpty()) _player->getHostileRefManager().deleteReferences(); // pussywizard: multithreading crashfix - CellCoord pair(acore::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY())); + CellCoord pair(Acore::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY())); Cell cell(pair); if (!GridCoord(cell.GridX(), cell.GridY()).IsCoordValid()) { @@ -168,7 +168,7 @@ void WorldSession::HandleMoveWorldportAck() } // xinef: do this again, player can be teleported inside bg->AddPlayer(_player)!!!! - CellCoord pair2(acore::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY())); + CellCoord pair2(Acore::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY())); Cell cell2(pair2); if (!GridCoord(cell2.GridX(), cell2.GridY()).IsCoordValid()) { @@ -408,7 +408,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvData) return; } - if (!acore::IsValidMapCoord(movementInfo.pos.GetPositionX() + movementInfo.transport.pos.GetPositionX(), movementInfo.pos.GetPositionY() + movementInfo.transport.pos.GetPositionY(), + if (!Acore::IsValidMapCoord(movementInfo.pos.GetPositionX() + movementInfo.transport.pos.GetPositionX(), movementInfo.pos.GetPositionY() + movementInfo.transport.pos.GetPositionY(), movementInfo.pos.GetPositionZ() + movementInfo.transport.pos.GetPositionZ(), movementInfo.pos.GetOrientation() + movementInfo.transport.pos.GetOrientation())) { if (plrMover) diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index d5d5f30fd..35d845991 100644 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -42,7 +42,7 @@ LootStore LootTemplates_Skinning("skinning_loot_template", "creature s LootStore LootTemplates_Spell("spell_loot_template", "spell id (random item creating)", false); // Selects invalid loot items to be removed from group possible entries (before rolling) -struct LootGroupInvalidSelector : public acore::unary_function +struct LootGroupInvalidSelector : public Acore::unary_function { explicit LootGroupInvalidSelector(Loot const& loot, uint16 lootMode) : _loot(loot), _lootMode(lootMode) { } @@ -1219,7 +1219,7 @@ LootStoreItem const* LootTemplate::LootGroup::Roll(Loot& loot, Player const* pla possibleLoot = EqualChanced; possibleLoot.remove_if(LootGroupInvalidSelector(loot, lootMode)); if (!possibleLoot.empty()) // If nothing selected yet - an item is taken from equal-chanced part - return acore::Containers::SelectRandomContainerElement(possibleLoot); + return Acore::Containers::SelectRandomContainerElement(possibleLoot); return nullptr; // Empty drop from the group } diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 641f18e2d..bc7e7342e 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -330,7 +330,7 @@ template<> void Map::SwitchGridContainers(Creature* obj, bool on) { ASSERT(!obj->IsPermanentWorldObject()); - CellCoord p = acore::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY()); + CellCoord p = Acore::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY()); if (!p.IsCoordValid()) { LOG_ERROR("server", "Map::SwitchGridContainers: Object %s has invalid coordinates X:%f Y:%f grid cell [%u:%u]", @@ -370,7 +370,7 @@ template<> void Map::SwitchGridContainers(GameObject* obj, bool on) { ASSERT(!obj->IsPermanentWorldObject()); - CellCoord p = acore::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY()); + CellCoord p = Acore::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY()); if (!p.IsCoordValid()) { LOG_ERROR("server", "Map::SwitchGridContainers: Object %s has invalid coordinates X:%f Y:%f grid cell [%u:%u]", @@ -494,7 +494,7 @@ void Map::LoadAllCells() bool Map::AddPlayerToMap(Player* player) { - CellCoord cellCoord = acore::ComputeCellCoord(player->GetPositionX(), player->GetPositionY()); + CellCoord cellCoord = Acore::ComputeCellCoord(player->GetPositionX(), player->GetPositionY()); if (!cellCoord.IsCoordValid()) { LOG_ERROR("server", "Map::Add: Player (%s) has invalid coordinates X:%f Y:%f grid cell [%u:%u]", @@ -553,7 +553,7 @@ bool Map::AddToMap(T* obj, bool checkTransport) return true; } - CellCoord cellCoord = acore::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY()); + CellCoord cellCoord = Acore::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY()); //It will create many problems (including crashes) if an object is not added to grid after creation //The correct way to fix it is to make AddToMap return false and delete the object if it is not added to grid //But now AddToMap is used in too many places, I will just see how many ASSERT failures it will cause @@ -606,7 +606,7 @@ bool Map::AddToMap(MotionTransport* obj, bool /*checkTransport*/) if (obj->IsInWorld()) return true; - CellCoord cellCoord = acore::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY()); + CellCoord cellCoord = Acore::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY()); if (!cellCoord.IsCoordValid()) { LOG_ERROR("server", "Map::Add: Object %s has invalid coordinates X:%f Y:%f grid cell [%u:%u]", @@ -649,10 +649,10 @@ bool Map::IsGridLoaded(const GridCoord& p) const return (getNGrid(p.x_coord, p.y_coord) && isGridObjectDataLoaded(p.x_coord, p.y_coord)); } -void Map::VisitNearbyCellsOfPlayer(Player* player, TypeContainerVisitor& gridVisitor, - TypeContainerVisitor& worldVisitor, - TypeContainerVisitor& largeGridVisitor, - TypeContainerVisitor& largeWorldVisitor) +void Map::VisitNearbyCellsOfPlayer(Player* player, TypeContainerVisitor& gridVisitor, + TypeContainerVisitor& worldVisitor, + TypeContainerVisitor& largeGridVisitor, + TypeContainerVisitor& largeWorldVisitor) { // check for valid position if (!player->IsPositionValid()) @@ -684,10 +684,10 @@ void Map::VisitNearbyCellsOfPlayer(Player* player, TypeContainerVisitor& gridVisitor, - TypeContainerVisitor& worldVisitor, - TypeContainerVisitor& largeGridVisitor, - TypeContainerVisitor& largeWorldVisitor) +void Map::VisitNearbyCellsOf(WorldObject* obj, TypeContainerVisitor& gridVisitor, + TypeContainerVisitor& worldVisitor, + TypeContainerVisitor& largeGridVisitor, + TypeContainerVisitor& largeWorldVisitor) { // Check for valid position if (!obj->IsPositionValid()) @@ -766,17 +766,17 @@ void Map::Update(const uint32 t_diff, const uint32 s_diff, bool /*thread*/) resetMarkedCells(); resetMarkedCellsLarge(); - acore::ObjectUpdater updater(t_diff, false); + Acore::ObjectUpdater updater(t_diff, false); // for creature - TypeContainerVisitor grid_object_update(updater); + TypeContainerVisitor grid_object_update(updater); // for pets - TypeContainerVisitor world_object_update(updater); + TypeContainerVisitor world_object_update(updater); // for large creatures - acore::ObjectUpdater largeObjectUpdater(t_diff, true); - TypeContainerVisitor grid_large_object_update(largeObjectUpdater); - TypeContainerVisitor world_large_object_update(largeObjectUpdater); + Acore::ObjectUpdater largeObjectUpdater(t_diff, true); + TypeContainerVisitor grid_large_object_update(largeObjectUpdater); + TypeContainerVisitor world_large_object_update(largeObjectUpdater); // pussywizard: container for far creatures in combat with players std::vector updateList; @@ -2347,18 +2347,18 @@ char const* Map::GetMapName() const void Map::UpdateObjectVisibility(WorldObject* obj, Cell cell, CellCoord cellpair) { cell.SetNoCreate(); - acore::VisibleChangesNotifier notifier(*obj); - TypeContainerVisitor player_notifier(notifier); + Acore::VisibleChangesNotifier notifier(*obj); + TypeContainerVisitor player_notifier(notifier); cell.Visit(cellpair, player_notifier, *this, *obj, obj->GetVisibilityRange()); } void Map::UpdateObjectsVisibilityFor(Player* player, Cell cell, CellCoord cellpair) { - acore::VisibleNotifier notifier(*player, false, false); + Acore::VisibleNotifier notifier(*player, false, false); cell.SetNoCreate(); - TypeContainerVisitor world_notifier(notifier); - TypeContainerVisitor grid_notifier(notifier); + TypeContainerVisitor world_notifier(notifier); + TypeContainerVisitor grid_notifier(notifier); cell.Visit(cellpair, world_notifier, *this, *player->m_seer, player->GetSightRange()); cell.Visit(cellpair, grid_notifier, *this, *player->m_seer, player->GetSightRange()); @@ -3715,7 +3715,7 @@ bool Map::CanReachPositionAndGetValidCoords(const WorldObject* source, float sta bool Map::CheckCollisionAndGetValidCoords(const WorldObject* source, float startX, float startY, float startZ, float &destX, float &destY, float &destZ, bool failOnCollision) const { // Prevent invalid coordinates here, position is unchanged - if (!acore::IsValidMapCoord(startX, startY, startZ) || !acore::IsValidMapCoord(destX, destY, destZ)) + if (!Acore::IsValidMapCoord(startX, startY, startZ) || !Acore::IsValidMapCoord(destX, destY, destZ)) { LOG_FATAL("server", "Map::CheckCollisionAndGetValidCoords invalid coordinates startX: %f, startY: %f, startZ: %f, destX: %f, destY: %f, destZ: %f", startX, startY, startZ, destX, destY, destZ); return false; diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index f60d32071..ede8d6bff 100644 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -48,7 +48,7 @@ class Transport; class StaticTransport; class MotionTransport; class PathGenerator; -namespace acore +namespace Acore { struct ObjectUpdater; struct LargeObjectUpdater; @@ -293,14 +293,14 @@ public: template bool AddToMap(T*, bool checkTransport = false); template void RemoveFromMap(T*, bool); - void VisitNearbyCellsOf(WorldObject* obj, TypeContainerVisitor& gridVisitor, - TypeContainerVisitor& worldVisitor, - TypeContainerVisitor& largeGridVisitor, - TypeContainerVisitor& largeWorldVisitor); - void VisitNearbyCellsOfPlayer(Player* player, TypeContainerVisitor& gridVisitor, - TypeContainerVisitor& worldVisitor, - TypeContainerVisitor& largeGridVisitor, - TypeContainerVisitor& largeWorldVisitor); + void VisitNearbyCellsOf(WorldObject* obj, TypeContainerVisitor& gridVisitor, + TypeContainerVisitor& worldVisitor, + TypeContainerVisitor& largeGridVisitor, + TypeContainerVisitor& largeWorldVisitor); + void VisitNearbyCellsOfPlayer(Player* player, TypeContainerVisitor& gridVisitor, + TypeContainerVisitor& worldVisitor, + TypeContainerVisitor& largeGridVisitor, + TypeContainerVisitor& largeWorldVisitor); virtual void Update(const uint32, const uint32, bool thread = true); @@ -318,13 +318,13 @@ public: [[nodiscard]] bool IsRemovalGrid(float x, float y) const { - GridCoord p = acore::ComputeGridCoord(x, y); + GridCoord p = Acore::ComputeGridCoord(x, y); return !getNGrid(p.x_coord, p.y_coord); } [[nodiscard]] bool IsGridLoaded(float x, float y) const { - return IsGridLoaded(acore::ComputeGridCoord(x, y)); + return IsGridLoaded(Acore::ComputeGridCoord(x, y)); } void LoadGrid(float x, float y); @@ -815,7 +815,7 @@ inline void Map::Visit(Cell const& cell, TypeContainerVisitor& vis template inline void Map::VisitAll(float const& x, float const& y, float radius, NOTIFIER& notifier) { - CellCoord p(acore::ComputeCellCoord(x, y)); + CellCoord p(Acore::ComputeCellCoord(x, y)); Cell cell(p); cell.SetNoCreate(); @@ -829,7 +829,7 @@ inline void Map::VisitAll(float const& x, float const& y, float radius, NOTIFIER template inline void Map::VisitFirstFound(const float& x, const float& y, float radius, NOTIFIER& notifier) { - CellCoord p(acore::ComputeCellCoord(x, y)); + CellCoord p(Acore::ComputeCellCoord(x, y)); Cell cell(p); cell.SetNoCreate(); @@ -845,7 +845,7 @@ inline void Map::VisitFirstFound(const float& x, const float& y, float radius, N template inline void Map::VisitWorld(const float& x, const float& y, float radius, NOTIFIER& notifier) { - CellCoord p(acore::ComputeCellCoord(x, y)); + CellCoord p(Acore::ComputeCellCoord(x, y)); Cell cell(p); cell.SetNoCreate(); @@ -856,7 +856,7 @@ inline void Map::VisitWorld(const float& x, const float& y, float radius, NOTIFI template inline void Map::VisitGrid(const float& x, const float& y, float radius, NOTIFIER& notifier) { - CellCoord p(acore::ComputeCellCoord(x, y)); + CellCoord p(Acore::ComputeCellCoord(x, y)); Cell cell(p); cell.SetNoCreate(); diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp index 63dda6853..eef6285f3 100644 --- a/src/server/game/Maps/MapManager.cpp +++ b/src/server/game/Maps/MapManager.cpp @@ -306,7 +306,7 @@ void MapManager::DoDelayedMovesAndRemoves() bool MapManager::ExistMapAndVMap(uint32 mapid, float x, float y) { - GridCoord p = acore::ComputeGridCoord(x, y); + GridCoord p = Acore::ComputeGridCoord(x, y); int gx = 63 - p.x_coord; int gy = 63 - p.y_coord; diff --git a/src/server/game/Maps/MapManager.h b/src/server/game/Maps/MapManager.h index e8d3e52d0..ec9da8870 100644 --- a/src/server/game/Maps/MapManager.h +++ b/src/server/game/Maps/MapManager.h @@ -73,17 +73,17 @@ public: static bool IsValidMapCoord(uint32 mapid, float x, float y) { - return IsValidMAP(mapid, false) && acore::IsValidMapCoord(x, y); + return IsValidMAP(mapid, false) && Acore::IsValidMapCoord(x, y); } static bool IsValidMapCoord(uint32 mapid, float x, float y, float z) { - return IsValidMAP(mapid, false) && acore::IsValidMapCoord(x, y, z); + return IsValidMAP(mapid, false) && Acore::IsValidMapCoord(x, y, z); } static bool IsValidMapCoord(uint32 mapid, float x, float y, float z, float o) { - return IsValidMAP(mapid, false) && acore::IsValidMapCoord(x, y, z, o); + return IsValidMAP(mapid, false) && Acore::IsValidMapCoord(x, y, z, o); } static bool IsValidMapCoord(WorldLocation const& loc) diff --git a/src/server/game/Miscellaneous/Formulas.cpp b/src/server/game/Miscellaneous/Formulas.cpp index 5f4532596..fd60a692d 100644 --- a/src/server/game/Miscellaneous/Formulas.cpp +++ b/src/server/game/Miscellaneous/Formulas.cpp @@ -10,7 +10,7 @@ #include "Player.h" #include "World.h" -uint32 acore::XP::BaseGain(uint8 pl_level, uint8 mob_level, ContentLevels content) +uint32 Acore::XP::BaseGain(uint8 pl_level, uint8 mob_level, ContentLevels content) { uint32 baseGain; uint32 nBaseExp; @@ -56,7 +56,7 @@ uint32 acore::XP::BaseGain(uint8 pl_level, uint8 mob_level, ContentLevels conten return baseGain; } -uint32 acore::XP::Gain(Player* player, Unit* unit, bool isBattleGround /*= false*/) +uint32 Acore::XP::Gain(Player* player, Unit* unit, bool isBattleGround /*= false*/) { Creature* creature = unit->ToCreature(); uint32 gain = 0; diff --git a/src/server/game/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h index ebd3ba562..4e35610f4 100644 --- a/src/server/game/Miscellaneous/Formulas.h +++ b/src/server/game/Miscellaneous/Formulas.h @@ -10,7 +10,7 @@ #include "ScriptMgr.h" #include "SharedDefines.h" -namespace acore::Honor +namespace Acore::Honor { inline float hk_honor_at_level_f(uint8 level, float multiplier = 1.0f) { @@ -25,7 +25,7 @@ namespace acore::Honor } } -namespace acore::XP +namespace Acore::XP { inline uint8 GetGrayLevel(uint8 pl_level) { diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp index 9774afde3..1f081ae1c 100644 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp @@ -37,8 +37,8 @@ void ConfusedMovementGenerator::DoInitialize(T* unit) float wanderY = y + (wander_distance * (float)rand_norm() - wander_distance / 2); // prevent invalid coordinates generation - acore::NormalizeMapCoord(wanderX); - acore::NormalizeMapCoord(wanderY); + Acore::NormalizeMapCoord(wanderX); + Acore::NormalizeMapCoord(wanderY); float new_z = unit->GetMapHeight(wanderX, wanderY, z); if (new_z <= INVALID_HEIGHT || fabs(z - new_z) > 3.0f) // pussywizard diff --git a/src/server/game/Movement/MovementGenerators/PathGenerator.cpp b/src/server/game/Movement/MovementGenerators/PathGenerator.cpp index 5e5636c59..30f3eff0c 100644 --- a/src/server/game/Movement/MovementGenerators/PathGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/PathGenerator.cpp @@ -48,7 +48,7 @@ bool PathGenerator::CalculatePath(float destX, float destY, float destZ, bool fo bool PathGenerator::CalculatePath(float x, float y, float z, float destX, float destY, float destZ, bool forceDest) { - if (!acore::IsValidMapCoord(destX, destY, destZ) || !acore::IsValidMapCoord(x, y, z)) + if (!Acore::IsValidMapCoord(destX, destY, destZ) || !Acore::IsValidMapCoord(x, y, z)) return false; G3D::Vector3 dest(destX, destY, destZ); diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp index a106f0a42..b7f595ad4 100644 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp @@ -63,7 +63,7 @@ void RandomMovementGenerator::_setRandomLocation(Creature* creature) Map* map = creature->GetMap(); float x = _destinationPoints[newPoint].x, y = _destinationPoints[newPoint].y, z = _destinationPoints[newPoint].z; // invalid coordinates - if (!acore::IsValidMapCoord(x, y)) + if (!Acore::IsValidMapCoord(x, y)) { _validPointsVector[_currentPoint].erase(randomIter); _preComputedPaths.erase(pathIdx); diff --git a/src/server/game/Movement/Waypoints/WaypointManager.cpp b/src/server/game/Movement/Waypoints/WaypointManager.cpp index f7dff41df..456e8cfdf 100644 --- a/src/server/game/Movement/Waypoints/WaypointManager.cpp +++ b/src/server/game/Movement/Waypoints/WaypointManager.cpp @@ -62,8 +62,8 @@ void WaypointMgr::Load() float z = fields[4].GetFloat(); float o = fields[5].GetFloat(); - acore::NormalizeMapCoord(x); - acore::NormalizeMapCoord(y); + Acore::NormalizeMapCoord(x); + Acore::NormalizeMapCoord(y); wp->id = fields[1].GetUInt32(); wp->x = x; @@ -123,8 +123,8 @@ void WaypointMgr::ReloadPath(uint32 id) float z = fields[3].GetFloat(); float o = fields[4].GetFloat(); - acore::NormalizeMapCoord(x); - acore::NormalizeMapCoord(y); + Acore::NormalizeMapCoord(x); + Acore::NormalizeMapCoord(y); wp->id = fields[0].GetUInt32(); wp->x = x; diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.cpp b/src/server/game/OutdoorPvP/OutdoorPvP.cpp index f9f98c9de..8248803f7 100644 --- a/src/server/game/OutdoorPvP/OutdoorPvP.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvP.cpp @@ -302,8 +302,8 @@ bool OPvPCapturePoint::Update(uint32 diff) } std::list players; - acore::AnyPlayerInObjectRangeCheck checker(m_capturePoint, radius); - acore::PlayerListSearcher searcher(m_capturePoint, players, checker); + Acore::AnyPlayerInObjectRangeCheck checker(m_capturePoint, radius); + Acore::PlayerListSearcher searcher(m_capturePoint, players, checker); m_capturePoint->VisitNearbyWorldObject(radius, searcher); for (std::list::iterator itr = players.begin(); itr != players.end(); ++itr) diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp index ed2dbdad0..d674d5cda 100644 --- a/src/server/game/Pools/PoolMgr.cpp +++ b/src/server/game/Pools/PoolMgr.cpp @@ -334,7 +334,7 @@ void PoolGroup::SpawnObject(ActivePoolData& spawns, uint32 limit, uint32 trig return /*object.guid == triggerFrom ||*/ !spawns.IsActiveObject(object.guid); }); - acore::Containers::RandomResize(rolledObjects, count); + Acore::Containers::RandomResize(rolledObjects, count); } // try to spawn rolled objects @@ -495,7 +495,7 @@ void PoolGroup::SpawnObject(ActivePoolData& spawns, uint32 limit, uint32 { do { - uint32 questId = acore::Containers::SelectRandomContainerElement(currentQuests); + uint32 questId = Acore::Containers::SelectRandomContainerElement(currentQuests); newQuests.insert(questId); currentQuests.erase(questId); } while (newQuests.size() < limit && !currentQuests.empty()); // failsafe @@ -507,7 +507,7 @@ void PoolGroup::SpawnObject(ActivePoolData& spawns, uint32 limit, uint32 // activate random quests do { - uint32 questId = acore::Containers::SelectRandomContainerElement(newQuests); + uint32 questId = Acore::Containers::SelectRandomContainerElement(newQuests); spawns.ActivateObject(questId, poolId); PoolObject tempObj(questId, 0.0f); Spawn1Object(&tempObj); diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index ff241abe9..a4c7fd9b0 100644 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -270,7 +270,7 @@ uint32 Quest::CalculateHonorGain(uint8 level) const honor = uint32(tc->value * GetRewHonorMultiplier() * 0.1000000014901161); // Xinef: exactly this is calculated above, however with higher precision... - //honor += acore::Honor::hk_honor_at_level(level, GetRewHonorMultiplier()); + //honor += Acore::Honor::hk_honor_at_level(level, GetRewHonorMultiplier()); honor += GetRewHonorAddition(); } diff --git a/src/server/game/Server/Packets/PacketUtilities.h b/src/server/game/Server/Packets/PacketUtilities.h index 5b2b152c6..57c41b7fc 100644 --- a/src/server/game/Server/Packets/PacketUtilities.h +++ b/src/server/game/Server/Packets/PacketUtilities.h @@ -57,7 +57,7 @@ namespace WorldPackets template class String { - using ValidatorList = std::conditional_t>::value, + using ValidatorList = std::conditional_t>::value, std::tuple, Strings::Utf8, Validators...>, std::tuple, Validators...>>; diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index f7e6d1f12..93dcef7e4 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -148,7 +148,7 @@ WorldSocket::WorldSocket(void): WorldHandler(), m_RecvWPct(0), m_RecvPct(), m_Header(sizeof (ClientPktHeader)), m_OutBuffer(0), m_OutBufferSize(65536), m_OutActive(false) { - acore::Crypto::GetRandomBytes(m_Seed); + Acore::Crypto::GetRandomBytes(m_Seed); reference_counting_policy().value (ACE_Event_Handler::Reference_Counting_Policy::ENABLED); @@ -293,7 +293,7 @@ int WorldSocket::open(void* a) WorldPacket packet (SMSG_AUTH_CHALLENGE, 24); packet << uint32(1); // 1...31 packet.append(m_Seed); - packet.append(acore::Crypto::GetRandomBytes<32>()); // new encryption seeds + packet.append(Acore::Crypto::GetRandomBytes<32>()); // new encryption seeds if (SendPacket(packet) == -1) return -1; @@ -798,7 +798,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) std::string accountName; WorldPacket packet, SendAddonPacked; std::array clientSeed; - acore::Crypto::SHA1::Digest digest; + Acore::Crypto::SHA1::Digest digest; if (sWorld->IsClosed()) { @@ -902,7 +902,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) // Check that Key and account name are the same on client and server uint8 t[4] = { 0x00, 0x00, 0x00, 0x00 }; - acore::Crypto::SHA1 sha; + Acore::Crypto::SHA1 sha; sha.UpdateData(accountName); sha.UpdateData(t); sha.UpdateData(clientSeed); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 157e7967c..50ad2e330 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2397,8 +2397,8 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo */ UnitList targets; - acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(target, target, target->GetVisibilityRange()); // no VISIBILITY_COMPENSATION, distance is enough - acore::UnitListSearcher searcher(target, targets, u_check); + Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(target, target, target->GetVisibilityRange()); // no VISIBILITY_COMPENSATION, distance is enough + Acore::UnitListSearcher searcher(target, targets, u_check); target->VisitNearbyObject(target->GetVisibilityRange(), searcher); // no VISIBILITY_COMPENSATION, distance is enough for (UnitList::iterator iter = targets.begin(); iter != targets.end(); ++iter) { @@ -5204,8 +5204,8 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool return; Player* player = nullptr; - acore::AnyPlayerInObjectRangeCheck checker(target, 10.0f); - acore::PlayerSearcher searcher(target, player, checker); + Acore::AnyPlayerInObjectRangeCheck checker(target, 10.0f); + Acore::PlayerSearcher searcher(target, player, checker); target->VisitNearbyWorldObject(10.0f, searcher); if( player && player->GetGUID() != target->GetGUID() ) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index 12557f282..b46bbb13c 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -320,7 +320,7 @@ public: void HandleRaidProcFromChargeWithValueAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo); }; -namespace acore +namespace Acore { // Binary predicate for sorting the priority of absorption aura effects class AbsorbAuraOrderPred diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 30db61029..34e84f8df 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -2650,23 +2650,23 @@ void UnitAura::FillTargetMap(std::map& targets, Unit* caster) case SPELL_EFFECT_APPLY_AREA_AURA_RAID: { targetList.push_back(GetUnitOwner()); - acore::AnyGroupedUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius, GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_APPLY_AREA_AURA_RAID); - acore::UnitListSearcher searcher(GetUnitOwner(), targetList, u_check); + Acore::AnyGroupedUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius, GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_APPLY_AREA_AURA_RAID); + Acore::UnitListSearcher searcher(GetUnitOwner(), targetList, u_check); GetUnitOwner()->VisitNearbyObject(radius, searcher); break; } case SPELL_EFFECT_APPLY_AREA_AURA_FRIEND: { targetList.push_back(GetUnitOwner()); - acore::AnyFriendlyUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius); - acore::UnitListSearcher searcher(GetUnitOwner(), targetList, u_check); + Acore::AnyFriendlyUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius); + Acore::UnitListSearcher searcher(GetUnitOwner(), targetList, u_check); GetUnitOwner()->VisitNearbyObject(radius, searcher); break; } case SPELL_EFFECT_APPLY_AREA_AURA_ENEMY: { - acore::AnyAoETargetUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius); // No GetCharmer in searcher - acore::UnitListSearcher searcher(GetUnitOwner(), targetList, u_check); + Acore::AnyAoETargetUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius); // No GetCharmer in searcher + Acore::UnitListSearcher searcher(GetUnitOwner(), targetList, u_check); GetUnitOwner()->VisitNearbyObject(radius, searcher); break; } @@ -2726,22 +2726,22 @@ void DynObjAura::FillTargetMap(std::map& targets, Unit* /*caster*/ if (GetSpellInfo()->Effects[effIndex].TargetB.GetTarget() == TARGET_DEST_DYNOBJ_ALLY || GetSpellInfo()->Effects[effIndex].TargetB.GetTarget() == TARGET_UNIT_DEST_AREA_ALLY) { - acore::AnyFriendlyUnitInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius); - acore::UnitListSearcher searcher(GetDynobjOwner(), targetList, u_check); + Acore::AnyFriendlyUnitInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius); + Acore::UnitListSearcher searcher(GetDynobjOwner(), targetList, u_check); GetDynobjOwner()->VisitNearbyObject(radius, searcher); } // pussywizard: TARGET_DEST_DYNOBJ_NONE is supposed to search for both friendly and unfriendly targets, so for any unit // what about EffectImplicitTargetA? else if (GetSpellInfo()->Effects[effIndex].TargetB.GetTarget() == TARGET_DEST_DYNOBJ_NONE) { - acore::AnyAttackableUnitExceptForOriginalCasterInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius); - acore::UnitListSearcher searcher(GetDynobjOwner(), targetList, u_check); + Acore::AnyAttackableUnitExceptForOriginalCasterInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius); + Acore::UnitListSearcher searcher(GetDynobjOwner(), targetList, u_check); GetDynobjOwner()->VisitNearbyObject(radius, searcher); } else { - acore::AnyAoETargetUnitInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius); - acore::UnitListSearcher searcher(GetDynobjOwner(), targetList, u_check); + Acore::AnyAoETargetUnitInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius); + Acore::UnitListSearcher searcher(GetDynobjOwner(), targetList, u_check); GetDynobjOwner()->VisitNearbyObject(radius, searcher); } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index fce58c165..3b5eabcef 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1181,9 +1181,9 @@ void Spell::SelectImplicitConeTargets(SpellEffIndex effIndex, SpellImplicitTarge if (uint32 containerTypeMask = GetSearcherTypeMask(objectType, condList)) { - acore::WorldObjectSpellConeTargetCheck check(coneAngle, radius, m_caster, m_spellInfo, selectionType, condList); - acore::WorldObjectListSearcher searcher(m_caster, targets, check, containerTypeMask); - SearchTargets >(searcher, containerTypeMask, m_caster, m_caster, radius); + Acore::WorldObjectSpellConeTargetCheck check(coneAngle, radius, m_caster, m_spellInfo, selectionType, condList); + Acore::WorldObjectListSearcher searcher(m_caster, targets, check, containerTypeMask); + SearchTargets >(searcher, containerTypeMask, m_caster, m_caster, radius); CallScriptObjectAreaTargetSelectHandlers(targets, effIndex, targetType); @@ -1197,7 +1197,7 @@ void Spell::SelectImplicitConeTargets(SpellEffIndex effIndex, SpellImplicitTarge if ((*j)->IsAffectedOnSpell(m_spellInfo)) maxTargets += (*j)->GetAmount(); - acore::Containers::RandomResize(targets, maxTargets); + Acore::Containers::RandomResize(targets, maxTargets); } for (std::list::iterator itr = targets.begin(); itr != targets.end(); ++itr) @@ -1280,7 +1280,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge if ((*j)->IsAffectedOnSpell(m_spellInfo)) maxTargets += (*j)->GetAmount(); - acore::Containers::RandomResize(targets, maxTargets); + Acore::Containers::RandomResize(targets, maxTargets); } for (std::list::iterator itr = targets.begin(); itr != targets.end(); ++itr) @@ -1617,13 +1617,13 @@ void Spell::SelectImplicitTrajTargets(SpellEffIndex effIndex, SpellImplicitTarge // xinef: supply correct target type, DEST_DEST and similar are ALWAYS undefined // xinef: correct target is stored in TRIGGERED SPELL, however as far as i noticed, all checks are ENTRY, ENEMY std::list targets; - acore::WorldObjectSpellTrajTargetCheck check(dist2d, m_targets.GetSrcPos(), m_caster, m_spellInfo, TARGET_CHECK_ENEMY /*targetCheckType*/, m_spellInfo->Effects[effIndex].ImplicitTargetConditions); - acore::WorldObjectListSearcher searcher(m_caster, targets, check, GRID_MAP_TYPE_MASK_ALL); - SearchTargets > (searcher, GRID_MAP_TYPE_MASK_ALL, m_caster, m_targets.GetSrcPos(), dist2d); + Acore::WorldObjectSpellTrajTargetCheck check(dist2d, m_targets.GetSrcPos(), m_caster, m_spellInfo, TARGET_CHECK_ENEMY /*targetCheckType*/, m_spellInfo->Effects[effIndex].ImplicitTargetConditions); + Acore::WorldObjectListSearcher searcher(m_caster, targets, check, GRID_MAP_TYPE_MASK_ALL); + SearchTargets > (searcher, GRID_MAP_TYPE_MASK_ALL, m_caster, m_targets.GetSrcPos(), dist2d); if (targets.empty()) return; - targets.sort(acore::ObjectDistanceOrderPred(m_caster)); + targets.sort(Acore::ObjectDistanceOrderPred(m_caster)); float b = tangent(m_targets.GetElevation()); float a = (srcToDestDelta - dist2d * b) / (dist2d * dist2d); @@ -1892,7 +1892,7 @@ void Spell::SearchTargets(SEARCHER& searcher, uint32 containerMask, Unit* refere x = pos->GetPositionX(); y = pos->GetPositionY(); - CellCoord p(acore::ComputeCellCoord(x, y)); + CellCoord p(Acore::ComputeCellCoord(x, y)); Cell cell(p); cell.SetNoCreate(); @@ -1917,9 +1917,9 @@ WorldObject* Spell::SearchNearbyTarget(float range, SpellTargetObjectTypes objec uint32 containerTypeMask = GetSearcherTypeMask(objectType, condList); if (!containerTypeMask) return nullptr; - acore::WorldObjectSpellNearbyTargetCheck check(range, m_caster, m_spellInfo, selectionType, condList); - acore::WorldObjectLastSearcher searcher(m_caster, target, check, containerTypeMask); - SearchTargets > (searcher, containerTypeMask, m_caster, m_caster, range); + Acore::WorldObjectSpellNearbyTargetCheck check(range, m_caster, m_spellInfo, selectionType, condList); + Acore::WorldObjectLastSearcher searcher(m_caster, target, check, containerTypeMask); + SearchTargets > (searcher, containerTypeMask, m_caster, m_caster, range); return target; } @@ -1928,9 +1928,9 @@ void Spell::SearchAreaTargets(std::list& targets, float range, Pos uint32 containerTypeMask = GetSearcherTypeMask(objectType, condList); if (!containerTypeMask) return; - acore::WorldObjectSpellAreaTargetCheck check(range, position, m_caster, referer, m_spellInfo, selectionType, condList); - acore::WorldObjectListSearcher searcher(m_caster, targets, check, containerTypeMask); - SearchTargets > (searcher, containerTypeMask, m_caster, position, range); + Acore::WorldObjectSpellAreaTargetCheck check(range, position, m_caster, referer, m_spellInfo, selectionType, condList); + Acore::WorldObjectListSearcher searcher(m_caster, targets, check, containerTypeMask); + SearchTargets > (searcher, containerTypeMask, m_caster, position, range); } void Spell::SearchChainTargets(std::list& targets, uint32 chainTargets, WorldObject* target, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectType, SpellTargetSelectionCategories /*selectCategory*/, ConditionList* condList, bool isChainHeal) @@ -7090,14 +7090,14 @@ SpellCastResult Spell::CheckSpellFocus() // check spell focus object if (m_spellInfo->RequiresSpellFocus) { - CellCoord p(acore::ComputeCellCoord(m_caster->GetPositionX(), m_caster->GetPositionY())); + CellCoord p(Acore::ComputeCellCoord(m_caster->GetPositionX(), m_caster->GetPositionY())); Cell cell(p); GameObject* ok = nullptr; - acore::GameObjectFocusCheck go_check(m_caster, m_spellInfo->RequiresSpellFocus); - acore::GameObjectSearcher checker(m_caster, ok, go_check); + Acore::GameObjectFocusCheck go_check(m_caster, m_spellInfo->RequiresSpellFocus); + Acore::GameObjectSearcher checker(m_caster, ok, go_check); - TypeContainerVisitor, GridTypeMapContainer > object_checker(checker); + TypeContainerVisitor, GridTypeMapContainer > object_checker(checker); Map& map = *m_caster->GetMap(); cell.Visit(p, object_checker, map, *m_caster, m_caster->GetVisibilityRange()); @@ -8246,7 +8246,7 @@ void Spell::OnSpellLaunch() } } -namespace acore +namespace Acore { WorldObjectSpellTargetCheck::WorldObjectSpellTargetCheck(Unit* caster, Unit* referer, SpellInfo const* spellInfo, @@ -8405,4 +8405,4 @@ namespace acore return WorldObjectSpellAreaTargetCheck::operator ()(target); } -} //namespace acore +} //namespace Acore diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 6abacefe5..c7fa13743 100644 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -733,7 +733,7 @@ protected: #endif }; -namespace acore +namespace Acore { struct WorldObjectSpellTargetCheck { diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 1eac37094..2dcf44482 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1135,7 +1135,7 @@ void Spell::EffectJumpDest(SpellEffIndex effIndex) float x, y, z; destTarget->GetPosition(x, y, z); // xinef: this can happen if MovePositionToFirstCollision detects that X, Y cords are invalid and returns prematurely - if (!acore::IsValidMapCoord(x, y, z) || z <= INVALID_HEIGHT) + if (!Acore::IsValidMapCoord(x, y, z) || z <= INVALID_HEIGHT) return; float speedXY, speedZ; @@ -2007,7 +2007,7 @@ void Spell::EffectEnergize(SpellEffIndex effIndex) if (!availableElixirs.empty()) { // cast random elixir on target - m_caster->CastSpell(unitTarget, acore::Containers::SelectRandomContainerElement(availableElixirs), true, m_CastItem); + m_caster->CastSpell(unitTarget, Acore::Containers::SelectRandomContainerElement(availableElixirs), true, m_CastItem); } } } @@ -2832,7 +2832,7 @@ void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/) // do not allow to add too many honor for player (50 * 21) = 1040 at level 70, or (50 * 31) = 1550 at level 80 if (damage <= 50) { - uint32 honor_reward = acore::Honor::hk_honor_at_level(unitTarget->getLevel(), float(damage)); + uint32 honor_reward = Acore::Honor::hk_honor_at_level(unitTarget->getLevel(), float(damage)); unitTarget->ToPlayer()->RewardHonor(nullptr, 1, honor_reward, false); #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) LOG_DEBUG("spells.aura", "SpellEffect::AddHonor (spell_id %u) rewards %u honor points (scale) to player: %s", @@ -4295,8 +4295,8 @@ void Spell::EffectSanctuary(SpellEffIndex /*effIndex*/) } UnitList targets; - acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(unitTarget, unitTarget, unitTarget->GetVisibilityRange()); // no VISIBILITY_COMPENSATION, distance is enough - acore::UnitListSearcher searcher(unitTarget, targets, u_check); + Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(unitTarget, unitTarget, unitTarget->GetVisibilityRange()); // no VISIBILITY_COMPENSATION, distance is enough + Acore::UnitListSearcher searcher(unitTarget, targets, u_check); unitTarget->VisitNearbyObject(unitTarget->GetVisibilityRange(), searcher); // no VISIBILITY_COMPENSATION, distance is enough for (UnitList::iterator iter = targets.begin(); iter != targets.end(); ++iter) { @@ -4942,7 +4942,7 @@ void Spell::EffectForceDeselect(SpellEffIndex /*effIndex*/) data << m_caster->GetGUID(); float dist = m_caster->GetVisibilityRange() + VISIBILITY_COMPENSATION; - acore::MessageDistDelivererToHostile notifier(m_caster, &data, dist); + Acore::MessageDistDelivererToHostile notifier(m_caster, &data, dist); m_caster->VisitNearbyWorldObject(dist, notifier); // xinef: we should also force pets to remove us from current target @@ -4966,8 +4966,8 @@ void Spell::EffectForceDeselect(SpellEffIndex /*effIndex*/) return; UnitList targets; - acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(m_caster, m_caster, m_caster->GetVisibilityRange()); // no VISIBILITY_COMPENSATION, distance is enough - acore::UnitListSearcher searcher(m_caster, targets, u_check); + Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(m_caster, m_caster, m_caster->GetVisibilityRange()); // no VISIBILITY_COMPENSATION, distance is enough + Acore::UnitListSearcher searcher(m_caster, targets, u_check); m_caster->VisitNearbyObject(m_caster->GetVisibilityRange(), searcher); // no VISIBILITY_COMPENSATION, distance is enough for (UnitList::iterator iter = targets.begin(); iter != targets.end(); ++iter) { diff --git a/src/server/game/Texts/CreatureTextMgr.h b/src/server/game/Texts/CreatureTextMgr.h index 535d06f03..9f1d2feb3 100644 --- a/src/server/game/Texts/CreatureTextMgr.h +++ b/src/server/game/Texts/CreatureTextMgr.h @@ -238,7 +238,7 @@ void CreatureTextMgr::SendChatPacket(WorldObject* source, Builder const& builder if (msgType == CHAT_MSG_RAID_BOSS_EMOTE && source->GetMap()->IsDungeon()) dist = 250.0f; - acore::PlayerDistWorker > worker(source, dist, localizer); + Acore::PlayerDistWorker > worker(source, dist, localizer); source->VisitNearbyWorldObject(dist, worker); } diff --git a/src/server/game/Warden/Warden.cpp b/src/server/game/Warden/Warden.cpp index d7c1cd1ee..cbfffa2bf 100644 --- a/src/server/game/Warden/Warden.cpp +++ b/src/server/game/Warden/Warden.cpp @@ -249,14 +249,14 @@ void Warden::ApplyPenalty(uint16 checkId, std::string const& reason) if (Player const* plr = _session->GetPlayer()) { std::string const reportFormat = "Player %s (guid %u, account id: %u) failed warden %u check (%s). Action: %s"; - reportMsg = acore::StringFormat(reportFormat, plr->GetName().c_str(), plr->GetGUID().GetCounter(), _session->GetAccountId(), + reportMsg = Acore::StringFormat(reportFormat, plr->GetName().c_str(), plr->GetGUID().GetCounter(), _session->GetAccountId(), checkId, ((checkData && !checkData->Comment.empty()) ? checkData->Comment.c_str() : ""), GetWardenActionStr(action).c_str()); } else { std::string const reportFormat = "Account id: %u failed warden %u check. Action: %s"; - reportMsg = acore::StringFormat(reportFormat, _session->GetAccountId(), checkId, GetWardenActionStr(action).c_str()); + reportMsg = Acore::StringFormat(reportFormat, _session->GetAccountId(), checkId, GetWardenActionStr(action).c_str()); } } else @@ -264,12 +264,12 @@ void Warden::ApplyPenalty(uint16 checkId, std::string const& reason) if (Player const* plr = _session->GetPlayer()) { std::string const reportFormat = "Player %s (guid %u, account id: %u) triggered warden penalty by reason: %s. Action: %s"; - reportMsg = acore::StringFormat(reportFormat, plr->GetName().c_str(), plr->GetGUID().GetCounter(), _session->GetAccountId(), causeMsg.c_str(), GetWardenActionStr(action).c_str()); + reportMsg = Acore::StringFormat(reportFormat, plr->GetName().c_str(), plr->GetGUID().GetCounter(), _session->GetAccountId(), causeMsg.c_str(), GetWardenActionStr(action).c_str()); } else { std::string const reportFormat = "Account id: %u failed warden %u check. Action: %s"; - reportMsg = acore::StringFormat(reportFormat, _session->GetAccountId(), causeMsg.c_str(), GetWardenActionStr(action).c_str()); + reportMsg = Acore::StringFormat(reportFormat, _session->GetAccountId(), causeMsg.c_str(), GetWardenActionStr(action).c_str()); } } diff --git a/src/server/game/Warden/Warden.h b/src/server/game/Warden/Warden.h index bad486f4d..6530f3767 100644 --- a/src/server/game/Warden/Warden.h +++ b/src/server/game/Warden/Warden.h @@ -123,8 +123,8 @@ private: uint8 _inputKey[16]; uint8 _outputKey[16]; uint8 _seed[16]; - acore::Crypto::ARC4 _inputCrypto; - acore::Crypto::ARC4 _outputCrypto; + Acore::Crypto::ARC4 _inputCrypto; + Acore::Crypto::ARC4 _outputCrypto; uint32 _checkTimer; // Timer for sending check requests uint32 _clientResponseTimer; // Timer for client response delay bool _dataSent; diff --git a/src/server/game/Warden/WardenMac.cpp b/src/server/game/Warden/WardenMac.cpp index 97c24f90b..f8f20ddc4 100644 --- a/src/server/game/Warden/WardenMac.cpp +++ b/src/server/game/Warden/WardenMac.cpp @@ -30,7 +30,7 @@ void WardenMac::Init(WorldSession* pClient, SessionKey const& K) { _session = pClient; // Generate Warden Key - SessionKeyGenerator WK(K); + SessionKeyGenerator WK(K); WK.Generate(_inputKey, 16); WK.Generate(_outputKey, 16); /* @@ -49,17 +49,17 @@ void WardenMac::Init(WorldSession* pClient, SessionKey const& K) #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) LOG_DEBUG("warden", "Server side warden for client %u initializing...", pClient->GetAccountId()); - LOG_DEBUG("warden", "C->S Key: %s", acore::Impl::ByteArrayToHexStr(_inputKey, 16).c_str()); - LOG_DEBUG("warden", "S->C Key: %s", acore::Impl::ByteArrayToHexStr(_outputKey, 16 ).c_str()); - LOG_DEBUG("warden", " Seed: %s", acore::Impl::ByteArrayToHexStr(_seed, 16).c_str()); + LOG_DEBUG("warden", "C->S Key: %s", Acore::Impl::ByteArrayToHexStr(_inputKey, 16).c_str()); + LOG_DEBUG("warden", "S->C Key: %s", Acore::Impl::ByteArrayToHexStr(_outputKey, 16 ).c_str()); + LOG_DEBUG("warden", " Seed: %s", Acore::Impl::ByteArrayToHexStr(_seed, 16).c_str()); LOG_DEBUG("warden", "Loading Module..."); #endif _module = GetModuleForClient(); #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) - LOG_DEBUG("warden", "Module Key: %s", acore::Impl::ByteArrayToHexStr(_module->Key, 16).c_str()); - LOG_DEBUG("warden", "Module ID: %s", acore::Impl::ByteArrayToHexStr(_module->Id, 16).c_str()); + LOG_DEBUG("warden", "Module Key: %s", Acore::Impl::ByteArrayToHexStr(_module->Key, 16).c_str()); + LOG_DEBUG("warden", "Module ID: %s", Acore::Impl::ByteArrayToHexStr(_module->Id, 16).c_str()); #endif RequestModule(); } @@ -155,7 +155,7 @@ void WardenMac::HandleHashResult(ByteBuffer& buff) buff.rpos(buff.wpos()); - acore::Crypto::SHA1 sha1; + Acore::Crypto::SHA1 sha1; sha1.UpdateData((uint8*)keyIn, 16); sha1.Finalize(); @@ -243,13 +243,13 @@ void WardenMac::HandleData(ByteBuffer& buff) std::string str = "Test string!"; - acore::Crypto::SHA1 sha1; + Acore::Crypto::SHA1 sha1; sha1.UpdateData(str); uint32 magic = 0xFEEDFACE; // unsure sha1.UpdateData((uint8*)&magic, 4); sha1.Finalize(); - std::array sha1Hash; + std::array sha1Hash; buff.read(sha1Hash.data(), sha1Hash.size()); if (sha1Hash != sha1.GetDigest()) diff --git a/src/server/game/Warden/WardenWin.cpp b/src/server/game/Warden/WardenWin.cpp index d6f3a6c69..775390190 100644 --- a/src/server/game/Warden/WardenWin.cpp +++ b/src/server/game/Warden/WardenWin.cpp @@ -39,7 +39,7 @@ static constexpr uint8 GetCheckPacketBaseSize(uint8 type) case LUA_EVAL_CHECK: return 1 + sizeof(_luaEvalPrefix) - 1 + sizeof(_luaEvalMidfix) - 1 + 4 + sizeof(_luaEvalPostfix) - 1; case PAGE_CHECK_A: return (4 + 1); case PAGE_CHECK_B: return (4 + 1); - case MODULE_CHECK: return (4 + acore::Crypto::Constants::SHA1_DIGEST_LENGTH_BYTES); + case MODULE_CHECK: return (4 + Acore::Crypto::Constants::SHA1_DIGEST_LENGTH_BYTES); case MEM_CHECK: return (1 + 4 + 1); default: return 0; } @@ -95,7 +95,7 @@ void WardenWin::Init(WorldSession* session, SessionKey const& k) { _session = session; // Generate Warden Key - SessionKeyGenerator WK(k); + SessionKeyGenerator WK(k); WK.Generate(_inputKey, 16); WK.Generate(_outputKey, 16); @@ -105,17 +105,17 @@ void WardenWin::Init(WorldSession* session, SessionKey const& k) _outputCrypto.Init(_outputKey); #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) LOG_DEBUG("warden", "Server side warden for client %u initializing...", session->GetAccountId()); - LOG_DEBUG("warden", "C->S Key: %s", acore::Impl::ByteArrayToHexStr(_inputKey, 16).c_str()); - LOG_DEBUG("warden", "S->C Key: %s", acore::Impl::ByteArrayToHexStr(_outputKey,16).c_str()); - LOG_DEBUG("warden", " Seed: %s", acore::Impl::ByteArrayToHexStr(_seed, 16).c_str()); + LOG_DEBUG("warden", "C->S Key: %s", Acore::Impl::ByteArrayToHexStr(_inputKey, 16).c_str()); + LOG_DEBUG("warden", "S->C Key: %s", Acore::Impl::ByteArrayToHexStr(_outputKey,16).c_str()); + LOG_DEBUG("warden", " Seed: %s", Acore::Impl::ByteArrayToHexStr(_seed, 16).c_str()); LOG_DEBUG("warden", "Loading Module..."); #endif _module = GetModuleForClient(); #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) - LOG_DEBUG("warden", "Module Key: %s", acore::Impl::ByteArrayToHexStr(_module->Key, 16).c_str()); - LOG_DEBUG("warden", "Module ID: %s", acore::Impl::ByteArrayToHexStr(_module->Id, 16).c_str()); + LOG_DEBUG("warden", "Module Key: %s", Acore::Impl::ByteArrayToHexStr(_module->Key, 16).c_str()); + LOG_DEBUG("warden", "Module ID: %s", Acore::Impl::ByteArrayToHexStr(_module->Id, 16).c_str()); #endif RequestModule(); } @@ -159,7 +159,7 @@ void WardenWin::InitializeModule() Request.Function1[1] = 0x000218C0; // 0x00400000 + 0x000218C0 SFileGetFileSize Request.Function1[2] = 0x00022530; // 0x00400000 + 0x00022530 SFileReadFile Request.Function1[3] = 0x00022910; // 0x00400000 + 0x00022910 SFileCloseFile - Request.CheckSumm1 = BuildChecksum(&Request.Unk1, acore::Crypto::Constants::SHA1_DIGEST_LENGTH_BYTES); + Request.CheckSumm1 = BuildChecksum(&Request.Unk1, Acore::Crypto::Constants::SHA1_DIGEST_LENGTH_BYTES); Request.Command2 = WARDEN_SMSG_MODULE_INITIALIZE; Request.Size2 = 8; @@ -224,7 +224,7 @@ void WardenWin::HandleHashResult(ByteBuffer& buff) buff.rpos(buff.wpos()); // Verify key - if (memcmp(buff.contents() + 1, Module.ClientKeySeedHash, acore::Crypto::Constants::SHA1_DIGEST_LENGTH_BYTES) != 0) + if (memcmp(buff.contents() + 1, Module.ClientKeySeedHash, Acore::Crypto::Constants::SHA1_DIGEST_LENGTH_BYTES) != 0) { #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) LOG_DEBUG("warden", "Request hash reply: failed"); @@ -331,7 +331,7 @@ void WardenWin::RequestChecks() // Filtered checks will get passed in next checks uint16 expectedSize = 4; _PendingChecks.clear(); - acore::Containers::EraseIf(_CurrentChecks, + Acore::Containers::EraseIf(_CurrentChecks, [this, &expectedSize](uint16 id) { uint16 const thisSize = GetCheckPacketSize(sWardenCheckMgr->GetWardenDataById(id)); @@ -418,9 +418,9 @@ void WardenWin::RequestChecks() } case MODULE_CHECK: { - std::array seed = acore::Crypto::GetRandomBytes<4>(); + std::array seed = Acore::Crypto::GetRandomBytes<4>(); buff.append(seed); - buff.append(acore::Crypto::HMAC_SHA1::GetDigestOf(seed, check->Str)); + buff.append(Acore::Crypto::HMAC_SHA1::GetDigestOf(seed, check->Str)); break; } /*case PROC_CHECK: @@ -621,17 +621,17 @@ void WardenWin::HandleData(ByteBuffer& buff) } WardenCheckResult const* rs = sWardenCheckMgr->GetWardenResultById(checkId); - if (memcmp(buff.contents() + buff.rpos(), rs->Result.ToByteArray<20>(false).data(), acore::Crypto::Constants::SHA1_DIGEST_LENGTH_BYTES) != 0) // SHA1 + if (memcmp(buff.contents() + buff.rpos(), rs->Result.ToByteArray<20>(false).data(), Acore::Crypto::Constants::SHA1_DIGEST_LENGTH_BYTES) != 0) // SHA1 { #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) LOG_DEBUG("warden", "RESULT MPQ_CHECK fail, CheckId %u account Id %u", checkId, _session->GetAccountId()); #endif checkFailed = checkId; - buff.rpos(buff.rpos() + acore::Crypto::Constants::SHA1_DIGEST_LENGTH_BYTES); // 20 bytes SHA1 + buff.rpos(buff.rpos() + Acore::Crypto::Constants::SHA1_DIGEST_LENGTH_BYTES); // 20 bytes SHA1 continue; } - buff.rpos(buff.rpos() + acore::Crypto::Constants::SHA1_DIGEST_LENGTH_BYTES); // 20 bytes SHA1 + buff.rpos(buff.rpos() + Acore::Crypto::Constants::SHA1_DIGEST_LENGTH_BYTES); // 20 bytes SHA1 #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) LOG_DEBUG("warden", "RESULT MPQ_CHECK passed, CheckId %u account Id %u", checkId, _session->GetAccountId()); #endif diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 69392bc29..4fc81e328 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -2411,7 +2411,7 @@ void World::SendGlobalGMMessage(WorldPacket* packet, WorldSession* self, TeamId } } -namespace acore +namespace Acore { class WorldWorldTextBuilder { @@ -2453,7 +2453,7 @@ namespace acore uint32 i_textId; va_list* i_args; }; -} // namespace acore +} // namespace Acore /// Send a System Message to all players (except self if mentioned) void World::SendWorldText(uint32 string_id, ...) @@ -2461,8 +2461,8 @@ void World::SendWorldText(uint32 string_id, ...) va_list ap; va_start(ap, string_id); - acore::WorldWorldTextBuilder wt_builder(string_id, &ap); - acore::LocalizedPacketListDo wt_do(wt_builder); + Acore::WorldWorldTextBuilder wt_builder(string_id, &ap); + Acore::LocalizedPacketListDo wt_do(wt_builder); for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr) { if (!itr->second || !itr->second->GetPlayer() || !itr->second->GetPlayer()->IsInWorld()) @@ -2480,8 +2480,8 @@ void World::SendGMText(uint32 string_id, ...) va_list ap; va_start(ap, string_id); - acore::WorldWorldTextBuilder wt_builder(string_id, &ap); - acore::LocalizedPacketListDo wt_do(wt_builder); + Acore::WorldWorldTextBuilder wt_builder(string_id, &ap); + Acore::LocalizedPacketListDo wt_do(wt_builder); for (SessionMap::iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr) { if (!itr->second || !itr->second->GetPlayer() || !itr->second->GetPlayer()->IsInWorld()) diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index f5385b417..6444a06d3 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -83,7 +83,7 @@ public: return false; } - auto token = acore::StringTo(args); + auto token = Acore::StringTo(args); auto const& masterKey = sSecretMgr->GetSecret(SECRET_TOTP_MASTER_KEY); if (!masterKey.IsAvailable()) @@ -117,18 +117,18 @@ public: } // store random suggested secrets - static std::unordered_map suggestions; - auto pair = suggestions.emplace(std::piecewise_construct, std::make_tuple(accountId), std::make_tuple(acore::Crypto::TOTP::RECOMMENDED_SECRET_LENGTH)); // std::vector 1-argument size_t constructor invokes resize + static std::unordered_map suggestions; + auto pair = suggestions.emplace(std::piecewise_construct, std::make_tuple(accountId), std::make_tuple(Acore::Crypto::TOTP::RECOMMENDED_SECRET_LENGTH)); // std::vector 1-argument size_t constructor invokes resize if (pair.second) // no suggestion yet, generate random secret - acore::Crypto::GetRandomBytes(pair.first->second); + Acore::Crypto::GetRandomBytes(pair.first->second); if (!pair.second && token) // suggestion already existed and token specified - validate { - if (acore::Crypto::TOTP::ValidateToken(pair.first->second, *token)) + if (Acore::Crypto::TOTP::ValidateToken(pair.first->second, *token)) { if (masterKey) - acore::Crypto::AEEncryptWithRandomIV(pair.first->second, *masterKey); + Acore::Crypto::AEEncryptWithRandomIV(pair.first->second, *masterKey); auto* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_TOTP_SECRET); stmt->setBinary(0, pair.first->second); @@ -144,7 +144,7 @@ public: } // new suggestion, or no token specified, output TOTP parameters - handler->PSendSysMessage(LANG_2FA_SECRET_SUGGESTION, acore::Encoding::Base32::Encode(pair.first->second).c_str()); + handler->PSendSysMessage(LANG_2FA_SECRET_SUGGESTION, Acore::Encoding::Base32::Encode(pair.first->second).c_str()); handler->SetSentErrorMessage(true); return false; } @@ -158,7 +158,7 @@ public: return false; } - auto token = acore::StringTo(args); + auto token = Acore::StringTo(args); auto const& masterKey = sSecretMgr->GetSecret(SECRET_TOTP_MASTER_KEY); if (!masterKey.IsAvailable()) @@ -169,7 +169,7 @@ public: } uint32 const accountId = handler->GetSession()->GetAccountId(); - acore::Crypto::TOTP::Secret secret; + Acore::Crypto::TOTP::Secret secret; { // get current TOTP secret auto* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_TOTP_SECRET); stmt->setUInt32(0, accountId); @@ -198,7 +198,7 @@ public: { if (masterKey) { - bool success = acore::Crypto::AEDecrypt(secret, *masterKey); + bool success = Acore::Crypto::AEDecrypt(secret, *masterKey); if (!success) { LOG_ERROR("misc", "Account %u has invalid ciphertext in TOTP token.", accountId); @@ -208,7 +208,7 @@ public: } } - if (acore::Crypto::TOTP::ValidateToken(secret, *token)) + if (Acore::Crypto::TOTP::ValidateToken(secret, *token)) { auto* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_TOTP_SECRET); stmt->setNull(0); @@ -616,7 +616,7 @@ public: return false; } - Optional> decoded = acore::Encoding::Base32::Decode(secret); + Optional> decoded = Acore::Encoding::Base32::Decode(secret); if (!decoded) { handler->SendSysMessage(LANG_2FA_SECRET_INVALID); @@ -624,7 +624,7 @@ public: return false; } - if (128 < (decoded->size() + acore::Crypto::AES::IV_SIZE_BYTES + acore::Crypto::AES::TAG_SIZE_BYTES)) + if (128 < (decoded->size() + Acore::Crypto::AES::IV_SIZE_BYTES + Acore::Crypto::AES::TAG_SIZE_BYTES)) { handler->SendSysMessage(LANG_2FA_SECRET_TOO_LONG); handler->SetSentErrorMessage(true); @@ -632,7 +632,7 @@ public: } if (masterKey) - acore::Crypto::AEEncryptWithRandomIV(*decoded, *masterKey); + Acore::Crypto::AEEncryptWithRandomIV(*decoded, *masterKey); auto* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_TOTP_SECRET); stmt->setBinary(0, *decoded); diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 07101fe66..7f136b2cd 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -916,8 +916,8 @@ public: else { Creature* passenger = nullptr; - acore::AllCreaturesOfEntryInRange check(handler->GetSession()->GetPlayer(), entry, 20.0f); - acore::CreatureSearcher searcher(handler->GetSession()->GetPlayer(), passenger, check); + Acore::AllCreaturesOfEntryInRange check(handler->GetSession()->GetPlayer(), entry, 20.0f); + Acore::CreatureSearcher searcher(handler->GetSession()->GetPlayer(), passenger, check); handler->GetSession()->GetPlayer()->VisitNearbyObject(30.0f, searcher); if (!passenger || passenger == target) return false; diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index bf1b93be0..ab3c67100 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -171,7 +171,7 @@ public: } } ASSERT(!allowedArenas.empty()); - BattlegroundTypeId randomizedArenaBgTypeId = acore::Containers::SelectRandomContainerElement(allowedArenas); + BattlegroundTypeId randomizedArenaBgTypeId = Acore::Containers::SelectRandomContainerElement(allowedArenas); uint8 count = 0; if (i != tokens.end()) @@ -424,7 +424,7 @@ public: } } - CellCoord cellCoord = acore::ComputeCellCoord(object->GetPositionX(), object->GetPositionY()); + CellCoord cellCoord = Acore::ComputeCellCoord(object->GetPositionX(), object->GetPositionY()); Cell cell(cellCoord); uint32 zoneId, areaId; @@ -443,7 +443,7 @@ public: float groundZ = map->GetHeight(object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), MAX_HEIGHT); float floorZ = map->GetHeight(object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), object->GetPositionZ()); - GridCoord gridCoord = acore::ComputeGridCoord(object->GetPositionX(), object->GetPositionY()); + GridCoord gridCoord = Acore::ComputeGridCoord(object->GetPositionX(), object->GetPositionY()); // 63? WHY? int gridX = 63 - gridCoord.x_coord; @@ -2227,14 +2227,14 @@ public: return true; } - CellCoord p(acore::ComputeCellCoord(player->GetPositionX(), player->GetPositionY())); + CellCoord p(Acore::ComputeCellCoord(player->GetPositionX(), player->GetPositionY())); Cell cell(p); cell.SetNoCreate(); - acore::RespawnDo u_do; - acore::WorldObjectWorker worker(player, u_do); + Acore::RespawnDo u_do; + Acore::WorldObjectWorker worker(player, u_do); - TypeContainerVisitor, GridTypeMapContainer > obj_worker(worker); + TypeContainerVisitor, GridTypeMapContainer > obj_worker(worker); cell.Visit(p, obj_worker, *player->GetMap(), *player, player->GetGridActivationRange()); return true; diff --git a/src/server/scripts/Commands/cs_mmaps.cpp b/src/server/scripts/Commands/cs_mmaps.cpp index fd01e213b..fec8d14cf 100644 --- a/src/server/scripts/Commands/cs_mmaps.cpp +++ b/src/server/scripts/Commands/cs_mmaps.cpp @@ -263,15 +263,15 @@ public: float radius = 40.0f; WorldObject* object = handler->GetSession()->GetPlayer(); - CellCoord pair(acore::ComputeCellCoord(object->GetPositionX(), object->GetPositionY())); + CellCoord pair(Acore::ComputeCellCoord(object->GetPositionX(), object->GetPositionY())); Cell cell(pair); cell.SetNoCreate(); std::list creatureList; - acore::AnyUnitInObjectRangeCheck go_check(object, radius); - acore::CreatureListSearcher go_search(object, creatureList, go_check); - TypeContainerVisitor, GridTypeMapContainer> go_visit(go_search); + Acore::AnyUnitInObjectRangeCheck go_check(object, radius); + Acore::CreatureListSearcher go_search(object, creatureList, go_check); + TypeContainerVisitor, GridTypeMapContainer> go_visit(go_search); // Get Creatures cell.Visit(pair, go_visit, *(object->GetMap()), *object, radius); diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp index d02b7b660..50dea79c5 100644 --- a/src/server/scripts/Commands/cs_server.cpp +++ b/src/server/scripts/Commands/cs_server.cpp @@ -443,7 +443,7 @@ public: if (!type || !name || !level || *name == '\0' || *level == '\0' || (*type != 'a' && *type != 'l')) return false; - sLog->SetLogLevel(name, *acore::StringTo(level), *type == 'l'); + sLog->SetLogLevel(name, *Acore::StringTo(level), *type == 'l'); return true; } diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_shazzrah.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_shazzrah.cpp index dcd7a31c1..eb1c14d72 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_shazzrah.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_shazzrah.cpp @@ -125,7 +125,7 @@ public: if (targets.empty()) return; - WorldObject* target = acore::Containers::SelectRandomContainerElement(targets); + WorldObject* target = Acore::Containers::SelectRandomContainerElement(targets); targets.clear(); targets.push_back(target); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_sulfuron_harbinger.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_sulfuron_harbinger.cpp index e14476a7d..da03238fb 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_sulfuron_harbinger.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_sulfuron_harbinger.cpp @@ -91,7 +91,7 @@ public: { std::list healers = DoFindFriendlyMissingBuff(45.0f, SPELL_INSPIRE); if (!healers.empty()) - DoCast(acore::Containers::SelectRandomContainerElement(healers), SPELL_INSPIRE); + DoCast(Acore::Containers::SelectRandomContainerElement(healers), SPELL_INSPIRE); DoCast(me, SPELL_INSPIRE); events.ScheduleEvent(EVENT_INSPIRE, urand(20000, 26000)); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp index a2efe95f1..2a0908ced 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp @@ -165,7 +165,7 @@ public: if (Creature* summon = ObjectAccessor::GetCreature(*me, *i)) guestList.push_back(summon); - return acore::Containers::SelectRandomContainerElement(guestList); + return Acore::Containers::SelectRandomContainerElement(guestList); } void UpdateAI(uint32 diff) override diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp index 36fefed08..5a022b66d 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -294,7 +294,7 @@ public: } else { - point = acore::Containers::SelectRandomContainerElement(positions); + point = Acore::Containers::SelectRandomContainerElement(positions); pos.Relocate(point->x, point->y, INFERNAL_Z, frand(0.0f, float(M_PI * 2))); } diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp index 5ae91604f..b00416452 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp @@ -104,7 +104,7 @@ public: std::list helpersList; for (uint8 i = 0; i < MAX_HELPERS_COUNT; ++i) helpersList.push_back(helpersEntries[i]); - acore::Containers::RandomResize(helpersList, MAX_ACTIVE_HELPERS); + Acore::Containers::RandomResize(helpersList, MAX_ACTIVE_HELPERS); uint8 j = 0; for (std::list::const_iterator itr = helpersList.begin(); itr != helpersList.end(); ++itr, ++j) @@ -199,7 +199,7 @@ public: case EVENT_SPELL_PW_SHIELD: { std::list cList = DoFindFriendlyMissingBuff(40.0f, DUNGEON_MODE(SPELL_POWER_WORD_SHIELD_N, SPELL_POWER_WORD_SHIELD_H)); - if (Unit* target = acore::Containers::SelectRandomContainerElement(cList)) + if (Unit* target = Acore::Containers::SelectRandomContainerElement(cList)) me->CastSpell(target, DUNGEON_MODE(SPELL_POWER_WORD_SHIELD_N, SPELL_POWER_WORD_SHIELD_H), false); events.ScheduleEvent(EVENT_SPELL_PW_SHIELD, 10000); break; @@ -216,7 +216,7 @@ public: target = me; break; case 2: - target = ObjectAccessor::GetCreature(*me, acore::Containers::SelectRandomContainerElement(summons)); + target = ObjectAccessor::GetCreature(*me, Acore::Containers::SelectRandomContainerElement(summons)); break; } diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index cdde5b4de..85aa33f1a 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -626,7 +626,7 @@ public: void FilterTargets(std::list& targets) { targets.remove_if(SpectralBlastCheck(GetCaster()->GetVictim())); - acore::Containers::RandomResize(targets, 1); + Acore::Containers::RandomResize(targets, 1); } void HandleDummy(SpellEffIndex effIndex) diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index ee2fe1274..f3a3f33d1 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -1052,7 +1052,7 @@ public: void FilterTargets(std::list& targets) { - targets.remove_if(acore::UnitAuraCheck(true, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT)); + targets.remove_if(Acore::UnitAuraCheck(true, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT)); } void HandleScriptEffect(SpellEffIndex effIndex) @@ -1089,7 +1089,7 @@ public: void FilterTargets(std::list& targets) { - targets.sort(acore::ObjectDistanceOrderPred(GetCaster())); + targets.sort(Acore::ObjectDistanceOrderPred(GetCaster())); WorldObject* target = targets.front(); targets.clear(); @@ -1299,7 +1299,7 @@ public: void FilterTargets(std::list& targets) { - targets.remove_if(acore::UnitAuraCheck(true, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT)); + targets.remove_if(Acore::UnitAuraCheck(true, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT)); } void Register() override diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp index e54690886..ee1b58e25 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp @@ -394,7 +394,7 @@ public: void FilterTargets(std::list& targets) { - acore::Containers::RandomResize(targets, GetCaster()->GetAI()->GetData(DATA_NEGATIVE_ENERGY_TARGETS)); + Acore::Containers::RandomResize(targets, GetCaster()->GetAI()->GetData(DATA_NEGATIVE_ENERGY_TARGETS)); } void HandleScriptEffect(SpellEffIndex effIndex) diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index 5ad0263b5..7062ea71d 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -149,18 +149,18 @@ public: for (uint8 i = 2; i < StormCount; ++i) bp0 *= 2; - CellCoord p(acore::ComputeCellCoord(me->GetPositionX(), me->GetPositionY())); + CellCoord p(Acore::ComputeCellCoord(me->GetPositionX(), me->GetPositionY())); Cell cell(p); cell.SetNoCreate(); std::list tempUnitMap; { - acore::AnyAoETargetUnitInObjectRangeCheck u_check(me, me, SIZE_OF_GRIDS); - acore::UnitListSearcher searcher(me, tempUnitMap, u_check); + Acore::AnyAoETargetUnitInObjectRangeCheck u_check(me, me, SIZE_OF_GRIDS); + Acore::UnitListSearcher searcher(me, tempUnitMap, u_check); - TypeContainerVisitor, WorldTypeMapContainer > world_unit_searcher(searcher); - TypeContainerVisitor, GridTypeMapContainer > grid_unit_searcher(searcher); + TypeContainerVisitor, WorldTypeMapContainer > world_unit_searcher(searcher); + TypeContainerVisitor, GridTypeMapContainer > grid_unit_searcher(searcher); cell.Visit(p, world_unit_searcher, *me->GetMap(), *me, SIZE_OF_GRIDS); cell.Visit(p, grid_unit_searcher, *me->GetMap(), *me, SIZE_OF_GRIDS); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp index 86747102e..ab5087464 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp @@ -224,14 +224,14 @@ public: me->GetPosition(x, y, z); { - CellCoord pair(acore::ComputeCellCoord(x, y)); + CellCoord pair(Acore::ComputeCellCoord(x, y)); Cell cell(pair); cell.SetNoCreate(); - acore::AllCreaturesOfEntryInRange check(me, NPC_EGG, 100); - acore::CreatureListSearcher searcher(me, templist, check); + Acore::AllCreaturesOfEntryInRange check(me, NPC_EGG, 100); + Acore::CreatureListSearcher searcher(me, templist, check); - TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); + TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); cell.Visit(pair, cSearcher, *me->GetMap(), *me, me->GetGridActivationRange()); } @@ -257,14 +257,14 @@ public: me->GetPosition(x, y, z); { - CellCoord pair(acore::ComputeCellCoord(x, y)); + CellCoord pair(Acore::ComputeCellCoord(x, y)); Cell cell(pair); cell.SetNoCreate(); - acore::AllCreaturesOfEntryInRange check(me, NPC_FIRE_BOMB, 100); - acore::CreatureListSearcher searcher(me, templist, check); + Acore::AllCreaturesOfEntryInRange check(me, NPC_FIRE_BOMB, 100); + Acore::CreatureListSearcher searcher(me, templist, check); - TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); + TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); cell.Visit(pair, cSearcher, *me->GetMap(), *me, me->GetGridActivationRange()); } @@ -518,14 +518,14 @@ public: me->GetPosition(x, y, z); { - CellCoord pair(acore::ComputeCellCoord(x, y)); + CellCoord pair(Acore::ComputeCellCoord(x, y)); Cell cell(pair); cell.SetNoCreate(); - acore::AllCreaturesOfEntryInRange check(me, 23817, 50); - acore::CreatureListSearcher searcher(me, templist, check); + Acore::AllCreaturesOfEntryInRange check(me, 23817, 50); + Acore::CreatureListSearcher searcher(me, templist, check); - TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); + TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); cell.Visit(pair, cSearcher, *(me->GetMap()), *me, me->GetGridActivationRange()); } diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp index 4eebcfa8d..db3314b37 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp @@ -141,14 +141,14 @@ public: me->GetPosition(x, y, z); { - CellCoord pair(acore::ComputeCellCoord(x, y)); + CellCoord pair(Acore::ComputeCellCoord(x, y)); Cell cell(pair); cell.SetNoCreate(); - acore::AllFriendlyCreaturesInGrid check(me); - acore::CreatureListSearcher searcher(me, templist, check); + Acore::AllFriendlyCreaturesInGrid check(me); + Acore::CreatureListSearcher searcher(me, templist, check); - TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); + TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); cell.Visit(pair, cSearcher, *(me->GetMap()), *me, me->GetGridActivationRange()); } @@ -168,14 +168,14 @@ public: me->GetPosition(x, y, z); { - CellCoord pair(acore::ComputeCellCoord(x, y)); + CellCoord pair(Acore::ComputeCellCoord(x, y)); Cell cell(pair); cell.SetNoCreate(); - acore::AllFriendlyCreaturesInGrid check(me); - acore::CreatureListSearcher searcher(me, templist, check); + Acore::AllFriendlyCreaturesInGrid check(me); + Acore::CreatureListSearcher searcher(me, templist, check); - TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); + TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); cell.Visit(pair, cSearcher, *(me->GetMap()), *me, me->GetGridActivationRange()); } diff --git a/src/server/scripts/Events/brewfest.cpp b/src/server/scripts/Events/brewfest.cpp index 2f4a092c9..fbc4cfdc0 100644 --- a/src/server/scripts/Events/brewfest.cpp +++ b/src/server/scripts/Events/brewfest.cpp @@ -1107,8 +1107,8 @@ public: { timer = 0; Player* player = nullptr; - acore::AnyPlayerInObjectRangeCheck checker(me, 2.0f); - acore::PlayerSearcher searcher(me, player, checker); + Acore::AnyPlayerInObjectRangeCheck checker(me, 2.0f); + Acore::PlayerSearcher searcher(me, player, checker); me->VisitNearbyWorldObject(2.0f, searcher); if (player) { diff --git a/src/server/scripts/Events/hallows_end.cpp b/src/server/scripts/Events/hallows_end.cpp index ffe2f1b03..ac976f7d3 100644 --- a/src/server/scripts/Events/hallows_end.cpp +++ b/src/server/scripts/Events/hallows_end.cpp @@ -810,8 +810,8 @@ public: { float radius = 100.0f; std::list players; - acore::AnyPlayerInObjectRangeCheck checker(me, radius); - acore::PlayerListSearcher searcher(me, players, checker); + Acore::AnyPlayerInObjectRangeCheck checker(me, radius); + Acore::PlayerListSearcher searcher(me, players, checker); me->VisitNearbyWorldObject(radius, searcher); for (std::list::const_iterator itr = players.begin(); itr != players.end(); ++itr) diff --git a/src/server/scripts/Events/love_in_air.cpp b/src/server/scripts/Events/love_in_air.cpp index 8456d455a..2bc4ffc0d 100644 --- a/src/server/scripts/Events/love_in_air.cpp +++ b/src/server/scripts/Events/love_in_air.cpp @@ -725,8 +725,8 @@ public: // For nearby players, check if they have the same aura. If so, cast Romantic Picnic (45123) // required by achievement and "hearts" visual std::list playerList; - acore::AnyPlayerInObjectRangeCheck checker(target, INTERACTION_DISTANCE * 2); - acore::PlayerListSearcher searcher(target, playerList, checker); + Acore::AnyPlayerInObjectRangeCheck checker(target, INTERACTION_DISTANCE * 2); + Acore::PlayerListSearcher searcher(target, playerList, checker); target->VisitNearbyWorldObject(INTERACTION_DISTANCE * 2, searcher); for (std::list::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr) { diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp index 1dbecc951..78fe8f4dc 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp @@ -165,7 +165,7 @@ public: void FilterTargets(std::list& targets) { - targets.remove_if(acore::PowerCheck(POWER_MANA, false)); + targets.remove_if(Acore::PowerCheck(POWER_MANA, false)); } void Register() override diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index d9affeb28..bb38d2872 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -888,16 +888,16 @@ void hyjalAI::JustDied(Unit* /*killer*/) void hyjalAI::HideNearPos(float x, float y) { - CellCoord pair(acore::ComputeCellCoord(x, y)); + CellCoord pair(Acore::ComputeCellCoord(x, y)); Cell cell(pair); cell.SetNoCreate(); // First get all creatures. std::list creatures; - acore::AllFriendlyCreaturesInGrid creature_check(me); - acore::CreatureListSearcher creature_searcher(me, creatures, creature_check); + Acore::AllFriendlyCreaturesInGrid creature_check(me); + Acore::CreatureListSearcher creature_searcher(me, creatures, creature_check); - TypeContainerVisitor , GridTypeMapContainer> creature_visitor(creature_searcher); + TypeContainerVisitor , GridTypeMapContainer> creature_visitor(creature_searcher); cell.Visit(pair, creature_visitor, *(me->GetMap()), *me, me->GetGridActivationRange()); if (!creatures.empty()) @@ -912,13 +912,13 @@ void hyjalAI::HideNearPos(float x, float y) void hyjalAI::RespawnNearPos(float x, float y) { - CellCoord p(acore::ComputeCellCoord(x, y)); + CellCoord p(Acore::ComputeCellCoord(x, y)); Cell cell(p); cell.SetNoCreate(); - acore::RespawnDo u_do; - acore::WorldObjectWorker worker(me, u_do); - TypeContainerVisitor, GridTypeMapContainer > obj_worker(worker); + Acore::RespawnDo u_do; + Acore::WorldObjectWorker worker(me, u_do); + TypeContainerVisitor, GridTypeMapContainer > obj_worker(worker); cell.Visit(p, obj_worker, *me->GetMap(), *me, me->GetGridActivationRange()); } @@ -943,16 +943,16 @@ void hyjalAI::WaypointReached(uint32 waypointId) } //do some talking //all alive guards walk near here - CellCoord pair(acore::ComputeCellCoord(me->GetPositionX(), me->GetPositionY())); + CellCoord pair(Acore::ComputeCellCoord(me->GetPositionX(), me->GetPositionY())); Cell cell(pair); cell.SetNoCreate(); // First get all creatures. std::list creatures; - acore::AllFriendlyCreaturesInGrid creature_check(me); - acore::CreatureListSearcher creature_searcher(me, creatures, creature_check); + Acore::AllFriendlyCreaturesInGrid creature_check(me); + Acore::CreatureListSearcher creature_searcher(me, creatures, creature_check); TypeContainerVisitor - , + , GridTypeMapContainer> creature_visitor(creature_searcher); cell.Visit(pair, creature_visitor, *(me->GetMap()), *me, me->GetGridActivationRange()); @@ -984,15 +984,15 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) { if (TeleportTimer <= diff) { - CellCoord pair(acore::ComputeCellCoord(me->GetPositionX(), me->GetPositionY())); + CellCoord pair(Acore::ComputeCellCoord(me->GetPositionX(), me->GetPositionY())); Cell cell(pair); cell.SetNoCreate(); std::list creatures; - acore::AllFriendlyCreaturesInGrid creature_check(me); - acore::CreatureListSearcher creature_searcher(me, creatures, creature_check); + Acore::AllFriendlyCreaturesInGrid creature_check(me); + Acore::CreatureListSearcher creature_searcher(me, creatures, creature_check); TypeContainerVisitor - , + , GridTypeMapContainer> creature_visitor(creature_searcher); cell.Visit(pair, creature_visitor, *(me->GetMap()), *me, me->GetGridActivationRange()); diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp index 130a7cf0d..d0490c019 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp @@ -180,8 +180,8 @@ public: DoCast(me, SPELL_IDOM_ROOM_CAMERA_SHAKE); me->SummonGameObject(GO_BELNISTRASZS_BRAZIER, 2577.196f, 947.0781f, 53.16757f, 2.356195f, 0, 0, 0.9238796f, 0.3826832f, 3600); std::list ClusterList; - acore::AllWorldObjectsInRange objects(me, 50.0f); - acore::WorldObjectListSearcher searcher(me, ClusterList, objects); + Acore::AllWorldObjectsInRange objects(me, 50.0f); + Acore::WorldObjectListSearcher searcher(me, ClusterList, objects); me->VisitNearbyObject(50.0f, searcher); for (std::list::const_iterator itr = ClusterList.begin(); itr != ClusterList.end(); ++itr) { diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp index cca91fb30..e4afd02e2 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp @@ -137,7 +137,7 @@ public: targetList.push_back((*itr)->getTarget()); } - acore::Containers::RandomResize(targetList, 5); + Acore::Containers::RandomResize(targetList, 5); for (std::list::iterator itr = targetList.begin(); itr != targetList.end(); ++itr) DoCast(*itr, SPELL_DRAIN_MANA); diff --git a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp index 891ca463f..ab8800ddf 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp @@ -139,8 +139,8 @@ public: { GameObject* cage = GetHitGObj(); std::list cagesList; - acore::AllWorldObjectsInRange objects(GetCaster(), 15.0f); - acore::WorldObjectListSearcher searcher(GetCaster(), cagesList, objects); + Acore::AllWorldObjectsInRange objects(GetCaster(), 15.0f); + Acore::WorldObjectListSearcher searcher(GetCaster(), cagesList, objects); GetCaster()->VisitNearbyObject(15.0f, searcher); for (std::list::const_iterator itr = cagesList.begin(); itr != cagesList.end(); ++itr) { diff --git a/src/server/scripts/Kalimdor/zone_moonglade.cpp b/src/server/scripts/Kalimdor/zone_moonglade.cpp index 189ce1340..96d3b2b6c 100644 --- a/src/server/scripts/Kalimdor/zone_moonglade.cpp +++ b/src/server/scripts/Kalimdor/zone_moonglade.cpp @@ -311,8 +311,8 @@ public: void IsSummonedBy(Unit* /*summoner*/) override { std::list playerOnQuestList; - acore::AnyPlayerInObjectRangeCheck checker(me, 5.0f); - acore::PlayerListSearcher searcher(me, playerOnQuestList, checker); + Acore::AnyPlayerInObjectRangeCheck checker(me, 5.0f); + Acore::PlayerListSearcher searcher(me, playerOnQuestList, checker); me->VisitNearbyWorldObject(5.0f, searcher); for (std::list::const_iterator itr = playerOnQuestList.begin(); itr != playerOnQuestList.end(); ++itr) { diff --git a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/instance_ahnkahet.cpp b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/instance_ahnkahet.cpp index 186072377..b720d5506 100644 --- a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/instance_ahnkahet.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/instance_ahnkahet.cpp @@ -273,7 +273,7 @@ public: PlayerList.push_back(player); if (!PlayerList.empty()) - caster->CastSpell(acore::Containers::SelectRandomContainerElement(PlayerList), caster->GetMap()->IsHeroic() ? SPELL_SHADOW_SICKLE_H : SPELL_SHADOW_SICKLE, true); + caster->CastSpell(Acore::Containers::SelectRandomContainerElement(PlayerList), caster->GetMap()->IsHeroic() ? SPELL_SHADOW_SICKLE_H : SPELL_SHADOW_SICKLE, true); } } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp index 700a267a6..cbd138623 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp @@ -474,12 +474,12 @@ public: void FilterTargets(std::list& targets) { // get a list of players with mana - targets.remove_if(acore::ObjectTypeIdCheck(TYPEID_PLAYER, false)); - targets.remove_if(acore::PowerCheck(POWER_MANA, false)); + targets.remove_if(Acore::ObjectTypeIdCheck(TYPEID_PLAYER, false)); + targets.remove_if(Acore::PowerCheck(POWER_MANA, false)); if (targets.empty()) return; - WorldObject* target = acore::Containers::SelectRandomContainerElement(targets); + WorldObject* target = Acore::Containers::SelectRandomContainerElement(targets); targets.clear(); targets.push_back(target); } diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp index 63b9af608..070bf8c69 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp @@ -367,7 +367,7 @@ public: void FilterTargets(std::list& targets) { - targets.remove_if(acore::AllWorldObjectsInExactRange(GetCaster(), 10.0f, false)); + targets.remove_if(Acore::AllWorldObjectsInExactRange(GetCaster(), 10.0f, false)); } void Register() override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index 1783525cb..7b2c7605d 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp @@ -352,7 +352,7 @@ public: myList.push_back(p); if (!myList.empty()) { - myList.sort(acore::ObjectDistanceOrderPred(me->GetVictim())); + myList.sort(Acore::ObjectDistanceOrderPred(me->GetVictim())); Player* target = myList.front(); if (me->GetVictim()->GetGUID() != _tankGUID || target->GetGUID() != _offtankGUID) { @@ -420,7 +420,7 @@ public: if (Player* p = itr->GetSource()) if (p->IsAlive() && p != me->GetVictim() && p->GetGUID() != _offtankGUID && !p->IsGameMaster() && p->GetDistance(me) < 100.0f && !p->HasAura(SPELL_UNCONTROLLABLE_FRENZY)) myList.push_back(p); - acore::Containers::RandomResize(myList, Is25ManRaid() ? 3 : 2); + Acore::Containers::RandomResize(myList, Is25ManRaid() ? 3 : 2); if (myList.size() > 1) { Talk(SAY_PACT_OF_THE_DARKFALLEN); @@ -446,7 +446,7 @@ public: if (!myList.empty()) { - acore::Containers::RandomResize(myList, 1); + Acore::Containers::RandomResize(myList, 1); Player* target = myList.front(); Talk(EMOTE_SWARMING_SHADOWS, target); Talk(SAY_SWARMING_SHADOWS); @@ -468,7 +468,7 @@ public: if (p->IsAlive() && p != me->GetVictim() && p->GetGUID() != _offtankGUID && !p->IsGameMaster() && !p->HasAura(SPELL_PACT_OF_THE_DARKFALLEN) && !p->HasAura(SPELL_UNCONTROLLABLE_FRENZY)) myList.push_back(p); - acore::Containers::RandomResize(myList, uint32(Is25ManRaid() ? 4 : 2)); + Acore::Containers::RandomResize(myList, uint32(Is25ManRaid() ? 4 : 2)); for (std::list::iterator itr = myList.begin(); itr != myList.end(); ++itr) me->CastSpell(*itr, SPELL_TWILIGHT_BLOODBOLT, false); me->CastSpell(me, SPELL_TWILIGHT_BLOODBOLT_TARGET, false); @@ -625,7 +625,7 @@ public: void FilterTargets(std::list& targets) { - targets.remove_if(acore::UnitAuraCheck(false, SPELL_PACT_OF_THE_DARKFALLEN)); + targets.remove_if(Acore::UnitAuraCheck(false, SPELL_PACT_OF_THE_DARKFALLEN)); bool remove = true; std::list::const_iterator itr, itr2, itrEnd = targets.end(); @@ -670,7 +670,7 @@ public: void FilterTargets(std::list& unitList) { - unitList.remove_if(acore::UnitAuraCheck(true, SPELL_PACT_OF_THE_DARKFALLEN)); + unitList.remove_if(Acore::UnitAuraCheck(true, SPELL_PACT_OF_THE_DARKFALLEN)); unitList.push_back(GetCaster()); } @@ -723,7 +723,7 @@ public: { uint32 targetCount = (targets.size() + 2) / 3; targets.remove_if(BloodboltHitCheck(static_cast(GetCaster()->GetAI()))); - acore::Containers::RandomResize(targets, targetCount); + Acore::Containers::RandomResize(targets, targetCount); // mark targets now, effect hook has missile travel time delay (might cast next in that time) for (std::list::const_iterator itr = targets.begin(); itr != targets.end(); ++itr) GetCaster()->GetAI()->SetGUID((*itr)->GetGUID(), GUID_BLOODBOLT); @@ -921,7 +921,7 @@ public: void FilterTargets(std::list& targets) { - targets.remove_if(acore::AllWorldObjectsInExactRange(GetCaster(), GetSpellInfo()->Effects[0].CalcRadius(), true)); + targets.remove_if(Acore::AllWorldObjectsInExactRange(GetCaster(), GetSpellInfo()->Effects[0].CalcRadius(), true)); } void Register() override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 0217c75c0..f147aa2ad 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -539,7 +539,7 @@ public: if (_guardList.empty()) { GetCreatureListWithEntryInGrid(_guardList, me, NPC_SE_KOR_KRON_REAVER, 20.0f); - _guardList.sort(acore::ObjectDistanceOrderPred(me)); + _guardList.sort(Acore::ObjectDistanceOrderPred(me)); } uint32 x = 1; for (std::list::iterator itr = _guardList.begin(); itr != _guardList.end(); ++itr) @@ -800,7 +800,7 @@ public: if (_guardList.empty()) { GetCreatureListWithEntryInGrid(_guardList, me, NPC_SE_SKYBREAKER_MARINE, 20.0f); - _guardList.sort(acore::ObjectDistanceOrderPred(me)); + _guardList.sort(Acore::ObjectDistanceOrderPred(me)); } uint32 x = 1; for (std::list::iterator itr = _guardList.begin(); itr != _guardList.end(); ++itr) @@ -1242,7 +1242,7 @@ public: // select one random target, with preference of ranged targets uint32 targetsAtRange = 0; uint32 const minTargets = uint32(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 10 : 4); - targets.sort(acore::ObjectDistanceOrderPred(GetCaster(), false)); + targets.sort(Acore::ObjectDistanceOrderPred(GetCaster(), false)); // get target count at range for (std::list::iterator itr = targets.begin(); itr != targets.end(); ++itr, ++targetsAtRange) @@ -1310,12 +1310,12 @@ public: if (GetSpellInfo()->Id == 72385 || GetSpellInfo()->Id == 72442) // 10n, 10h { - WorldObject* target = acore::Containers::SelectRandomContainerElement(targets); + WorldObject* target = Acore::Containers::SelectRandomContainerElement(targets); targets.clear(); targets.push_back(target); } else - acore::Containers::RandomResize(targets, 3); + Acore::Containers::RandomResize(targets, 3); } void Register() override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp index 3608986a8..a9de8ebcf 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp @@ -2208,7 +2208,7 @@ public: void SelectTarget(std::list& targets) { targets.remove_if(IgbExplosionCheck(GetCaster())); - acore::Containers::RandomResize(targets, 1); + Acore::Containers::RandomResize(targets, 1); } void Register() override @@ -2477,7 +2477,7 @@ public: targets.remove_if(BurningPitchFilterCheck(teamId == TEAM_HORDE ? GO_ORGRIMS_HAMMER_H : GO_THE_SKYBREAKER_A)); if (!targets.empty()) { - WorldObject* target = acore::Containers::SelectRandomContainerElement(targets); + WorldObject* target = Acore::Containers::SelectRandomContainerElement(targets); targets.clear(); targets.push_back(target); } @@ -2563,7 +2563,7 @@ public: if (!targets.empty()) { - WorldObject* target = acore::Containers::SelectRandomContainerElement(targets); + WorldObject* target = Acore::Containers::SelectRandomContainerElement(targets); targets.clear(); targets.push_back(target); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp index 6b7629eb4..d8482b59a 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp @@ -618,7 +618,7 @@ public: return; // select random cultist - Creature* cultist = acore::Containers::SelectRandomContainerElement(temp); + Creature* cultist = Acore::Containers::SelectRandomContainerElement(temp); if (!cultist) return; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp index d2e132af6..fbcbf6f82 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp @@ -58,7 +58,7 @@ enum Events uint32 const boneSpikeSummonId[3] = {69062, 72669, 72670}; -struct BoneStormMoveTargetSelector : public acore::unary_function +struct BoneStormMoveTargetSelector : public Acore::unary_function { public: BoneStormMoveTargetSelector(Creature* source) : _source(source) { } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index d5340ab1c..77f68346b 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -188,7 +188,7 @@ private: }; // xinef: malleable goo selector, check for target validity -struct MalleableGooSelector : public acore::unary_function +struct MalleableGooSelector : public Acore::unary_function { const Unit* me; MalleableGooSelector(Unit const* unit) : me(unit) {} @@ -874,7 +874,7 @@ public: void ScaleRange(std::list& targets) { - targets.remove_if(acore::AllWorldObjectsInExactRange(GetCaster(), 2.5f * GetCaster()->GetFloatValue(OBJECT_FIELD_SCALE_X), true)); + targets.remove_if(Acore::AllWorldObjectsInExactRange(GetCaster(), 2.5f * GetCaster()->GetFloatValue(OBJECT_FIELD_SCALE_X), true)); } // big hax to unlock Abomination Eat Ooze ability, requires caster aura spell from difficulty X, but unlocks clientside when got base aura @@ -1024,10 +1024,10 @@ public: void FilterTargets(std::list& targets) { // vanish rank 1-3, mage invisibility - targets.remove_if(acore::UnitAuraCheck(true, 11327)); - targets.remove_if(acore::UnitAuraCheck(true, 11329)); - targets.remove_if(acore::UnitAuraCheck(true, 26888)); - targets.remove_if(acore::UnitAuraCheck(true, 32612)); + targets.remove_if(Acore::UnitAuraCheck(true, 11327)); + targets.remove_if(Acore::UnitAuraCheck(true, 11329)); + targets.remove_if(Acore::UnitAuraCheck(true, 26888)); + targets.remove_if(Acore::UnitAuraCheck(true, 32612)); } void Register() override @@ -1098,8 +1098,8 @@ public: void SelectTarget(std::list& targets) { // dbc has only 1 field for excluding, this will prevent anyone from getting both at the same time - targets.remove_if(acore::UnitAuraCheck(true, SPELL_VOLATILE_OOZE_PROTECTION)); - targets.remove_if(acore::UnitAuraCheck(true, SPELL_GASEOUS_BLOAT_PROTECTION)); + targets.remove_if(Acore::UnitAuraCheck(true, SPELL_VOLATILE_OOZE_PROTECTION)); + targets.remove_if(Acore::UnitAuraCheck(true, SPELL_GASEOUS_BLOAT_PROTECTION)); if (targets.empty()) { @@ -1108,7 +1108,7 @@ public: return; } - WorldObject* target = acore::Containers::SelectRandomContainerElement(targets); + WorldObject* target = Acore::Containers::SelectRandomContainerElement(targets); targets.clear(); targets.push_back(target); _target = target; @@ -1256,8 +1256,8 @@ public: } } - targets.remove_if(acore::UnitAuraCheck(true, sSpellMgr->GetSpellIdForDifficulty(SPELL_UNBOUND_PLAGUE, GetCaster()))); - acore::Containers::RandomResize(targets, 1); + targets.remove_if(Acore::UnitAuraCheck(true, sSpellMgr->GetSpellIdForDifficulty(SPELL_UNBOUND_PLAGUE, GetCaster()))); + Acore::Containers::RandomResize(targets, 1); } void HandleScript(SpellEffIndex /*effIndex*/) @@ -1627,7 +1627,7 @@ public: if (targets.empty()) return; - targets.sort(acore::ObjectDistanceOrderPred(GetCaster())); + targets.sort(Acore::ObjectDistanceOrderPred(GetCaster())); WorldObject* target = targets.front(); targets.clear(); targets.push_back(target); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp index e88355658..e5f48d793 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp @@ -510,12 +510,12 @@ public: { // remove targets with this aura already // tank is not on this list - targets.remove_if(acore::UnitAuraCheck(true, GetSpellInfo()->Id)); + targets.remove_if(Acore::UnitAuraCheck(true, GetSpellInfo()->Id)); targets.remove(GetCaster()->GetVictim()); if (targets.empty()) return; - WorldObject* target = acore::Containers::SelectRandomContainerElement(targets); + WorldObject* target = Acore::Containers::SelectRandomContainerElement(targets); targets.clear(); targets.push_back(target); _target = target; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 97c9eb3ba..081a83a2b 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -225,7 +225,7 @@ private: ObjectGuid _sindragosaGUID; }; -struct LastPhaseIceTombTargetSelector : public acore::unary_function +struct LastPhaseIceTombTargetSelector : public Acore::unary_function { public: LastPhaseIceTombTargetSelector(Creature* source) : _source(source) { } @@ -908,10 +908,10 @@ public: uint32 maxSize = uint32(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 3 : 1); healList.remove_if(UnchainedMagicTargetSelector(false)); if (healList.size() > maxSize) - acore::Containers::RandomResize(healList, maxSize); + Acore::Containers::RandomResize(healList, maxSize); dpsList.remove_if(UnchainedMagicTargetSelector(true)); if (dpsList.size() > maxSize) - acore::Containers::RandomResize(dpsList, maxSize); + Acore::Containers::RandomResize(dpsList, maxSize); unitList.splice(unitList.begin(), healList); unitList.splice(unitList.begin(), dpsList); } @@ -1202,7 +1202,7 @@ public: void FilterTargets(std::list& unitList) { - unitList.remove_if(acore::UnitAuraCheck(true, GetSpellInfo()->Id)); + unitList.remove_if(Acore::UnitAuraCheck(true, GetSpellInfo()->Id)); targetList.clear(); targetList = unitList; } @@ -1906,11 +1906,11 @@ public: void FilterTargets(std::list& targets) { - targets.remove_if(acore::ObjectTypeIdCheck(TYPEID_PLAYER, false)); + targets.remove_if(Acore::ObjectTypeIdCheck(TYPEID_PLAYER, false)); if (targets.empty()) return; - WorldObject* target = acore::Containers::SelectRandomContainerElement(targets); + WorldObject* target = Acore::Containers::SelectRandomContainerElement(targets); targets.clear(); targets.push_back(target); } @@ -1927,7 +1927,7 @@ public: if (unitList.empty()) return; - acore::Containers::SelectRandomContainerElement(unitList)->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true); + Acore::Containers::SelectRandomContainerElement(unitList)->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true); } void Register() override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index a0e28e75e..2076d3f7c 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -357,7 +357,7 @@ void SendPacketToPlayers(WorldPacket const* data, Unit* source) player->GetSession()->SendPacket(data); } -struct ShadowTrapLKTargetSelector : public acore::unary_function +struct ShadowTrapLKTargetSelector : public Acore::unary_function { public: ShadowTrapLKTargetSelector(Creature* source, bool playerOnly = true, bool reqLOS = false, float maxDist = 0.0f) : _source(source), _playerOnly(playerOnly), _reqLOS(reqLOS), _maxDist(maxDist) { } @@ -383,7 +383,7 @@ private: float _maxDist; }; -struct NonTankLKTargetSelector : public acore::unary_function +struct NonTankLKTargetSelector : public Acore::unary_function { public: NonTankLKTargetSelector(Creature* source, bool playerOnly = true, bool reqLOS = false, float maxDist = 0.0f, uint32 exclude1 = 0, uint32 exclude2 = 0) : _source(source), _playerOnly(playerOnly), _reqLOS(reqLOS), _maxDist(maxDist), _exclude1(exclude1), _exclude2(exclude2) { } @@ -417,7 +417,7 @@ private: uint32 _exclude2; }; -struct DefileTargetSelector : public acore::unary_function +struct DefileTargetSelector : public Acore::unary_function { public: DefileTargetSelector(Creature* source) : _source(source) { } @@ -574,7 +574,7 @@ private: Creature& _owner; }; -class NecroticPlagueTargetCheck : public acore::unary_function +class NecroticPlagueTargetCheck : public Acore::unary_function { public: NecroticPlagueTargetCheck(Unit const* obj, uint32 notAura1, uint32 notAura2) : _sourceObj(obj), _notAura1(notAura1), _notAura2(notAura2) {} @@ -686,7 +686,7 @@ public: // Reset The Frozen Throne gameobjects FrozenThroneResetWorker reset; - acore::GameObjectWorker worker(me, reset); + Acore::GameObjectWorker worker(me, reset); me->VisitNearbyGridObject(333.0f, worker); me->AddAura(SPELL_EMOTE_SIT_NO_SHEATH, me); @@ -1966,7 +1966,7 @@ public: void FilterTargets(std::list& targets) { - targets.sort(acore::ObjectDistanceOrderPred(GetCaster())); + targets.sort(Acore::ObjectDistanceOrderPred(GetCaster())); if (targets.size() <= 1) return; @@ -2431,9 +2431,9 @@ public: void CorrectRange(std::list& targets) { targets.remove_if(VehicleCheck()); - targets.remove_if(acore::AllWorldObjectsInExactRange(GetCaster(), 10.0f * GetCaster()->GetFloatValue(OBJECT_FIELD_SCALE_X), true)); + targets.remove_if(Acore::AllWorldObjectsInExactRange(GetCaster(), 10.0f * GetCaster()->GetFloatValue(OBJECT_FIELD_SCALE_X), true)); uint32 strangulatedAura[4] = {68980, 74325, 74296, 74297}; - targets.remove_if(acore::UnitAuraCheck(true, strangulatedAura[GetCaster()->GetMap()->GetDifficulty()])); + targets.remove_if(Acore::UnitAuraCheck(true, strangulatedAura[GetCaster()->GetMap()->GetDifficulty()])); } void ChangeDamageAndGrow() @@ -2573,7 +2573,7 @@ public: if (!triggers.empty()) { valid = true; - triggers.sort(acore::ObjectDistanceOrderPred(me)); + triggers.sort(Acore::ObjectDistanceOrderPred(me)); target->GetMotionMaster()->Clear(); target->UpdatePosition(*me, true); @@ -2800,9 +2800,9 @@ public: targets.clear(); return; } - targets.remove_if(acore::UnitAuraCheck(true, GetSpellInfo()->Id)); - targets.remove_if(acore::UnitAuraCheck(true, SPELL_BOSS_HITTIN_YA_AURA)); // done in dbc, but just to be sure xd - targets.remove_if(acore::UnitAuraCheck(true, SPELL_HARVEST_SOUL_VALKYR)); + targets.remove_if(Acore::UnitAuraCheck(true, GetSpellInfo()->Id)); + targets.remove_if(Acore::UnitAuraCheck(true, SPELL_BOSS_HITTIN_YA_AURA)); // done in dbc, but just to be sure xd + targets.remove_if(Acore::UnitAuraCheck(true, SPELL_HARVEST_SOUL_VALKYR)); if (InstanceScript* _instance = caster->GetInstanceScript()) if (Creature* lichKing = ObjectAccessor::GetCreature(*caster, _instance->GetGuidData(DATA_THE_LICH_KING))) if (Spell* s = lichKing->GetCurrentSpell(CURRENT_GENERIC_SPELL)) @@ -2812,7 +2812,7 @@ public: if (targets.empty()) return; - _target = acore::Containers::SelectRandomContainerElement(targets); + _target = Acore::Containers::SelectRandomContainerElement(targets); targets.clear(); targets.push_back(_target); if (Creature* caster = GetCaster()->ToCreature()) @@ -2989,7 +2989,7 @@ public: if (targets.empty()) return; - _target = acore::Containers::SelectRandomContainerElement(targets); + _target = Acore::Containers::SelectRandomContainerElement(targets); } void HandleScript(SpellEffIndex effIndex) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp index 9a96c94a9..67887ff95 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp @@ -144,7 +144,7 @@ public: } }; -struct ManaVoidSelector : public acore::unary_function +struct ManaVoidSelector : public Acore::unary_function { explicit ManaVoidSelector(WorldObject const* source) : _source(source) { } @@ -205,7 +205,7 @@ public: bool Execute(uint64 /*currTime*/, uint32 /*diff*/) override { - acore::CreatureWorker worker(_creature, *this); + Acore::CreatureWorker worker(_creature, *this); _creature->VisitNearbyGridObject(333.0f, worker); _creature->AI()->Reset(); _creature->setActive(false); @@ -525,7 +525,7 @@ public: std::list archmages; RisenArchmageCheck check; - acore::CreatureListSearcher searcher(me, archmages, check); + Acore::CreatureListSearcher searcher(me, archmages, check); me->VisitNearbyGridObject(100.0f, searcher); for (std::list::iterator itr = archmages.begin(); itr != archmages.end(); ++itr) (*itr)->AI()->DoAction(ACTION_ENTER_COMBAT); @@ -1305,9 +1305,9 @@ public: void FilterTargets(std::list& targets) { - targets.remove_if(acore::AllWorldObjectsInExactRange(GetCaster(), 250.0f, true)); + targets.remove_if(Acore::AllWorldObjectsInExactRange(GetCaster(), 250.0f, true)); std::list list_copy = targets; - targets.remove_if(acore::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED)); + targets.remove_if(Acore::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED)); if (targets.empty()) { if (list_copy.empty()) @@ -1315,7 +1315,7 @@ public: targets = list_copy; } - WorldObject* target = acore::Containers::SelectRandomContainerElement(targets); + WorldObject* target = Acore::Containers::SelectRandomContainerElement(targets); targets.clear(); targets.push_back(target); } @@ -1361,14 +1361,14 @@ public: std::list summoners; caster->GetCreaturesWithEntryInRange(summoners, 200.0f, NPC_WORLD_TRIGGER); std::list list_copy = summoners; - summoners.remove_if(acore::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED)); + summoners.remove_if(Acore::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED)); if (summoners.empty()) { if (list_copy.empty()) return; summoners = list_copy; } - acore::Containers::RandomResize(summoners, 2); + Acore::Containers::RandomResize(summoners, 2); for (uint32 i = 0; i < 3; ++i) caster->CastSpell(summoners.front(), SPELL_SUMMON_SUPPRESSER, true); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index 0df32853e..b72d788a5 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -840,7 +840,7 @@ public: // get all nearby vrykul std::list temp; FrostwingVrykulSearcher check(me, 150.0f); - acore::CreatureListSearcher searcher(me, temp, check); + Acore::CreatureListSearcher searcher(me, temp, check); me->VisitNearbyGridObject(150.0f, searcher); _aliveTrash.clear(); @@ -884,15 +884,15 @@ public: _wipeCheckTimer = 3000; Player* player = nullptr; - acore::AnyPlayerInObjectRangeCheck check(me, 140.0f); - acore::PlayerSearcher searcher(me, player, check); + Acore::AnyPlayerInObjectRangeCheck check(me, 140.0f); + Acore::PlayerSearcher searcher(me, player, check); me->VisitNearbyWorldObject(140.0f, searcher); // wipe if (!player || me->GetExactDist(4357.0f, 2606.0f, 350.0f) > 125.0f) { //Talk(SAY_CROK_DEATH); FrostwingGauntletRespawner respawner; - acore::CreatureWorker worker(me, respawner); + Acore::CreatureWorker worker(me, respawner); me->VisitNearbyGridObject(333.0f, worker); return; } @@ -1337,7 +1337,7 @@ public: { std::list targets = DoFindFriendlyMissingBuff(40.0f, SPELL_POWER_WORD_SHIELD); if (!targets.empty()) - DoCast(acore::Containers::SelectRandomContainerElement(targets), SPELL_POWER_WORD_SHIELD); + DoCast(Acore::Containers::SelectRandomContainerElement(targets), SPELL_POWER_WORD_SHIELD); Events.ScheduleEvent(EVENT_ARNATH_PW_SHIELD, urand(15000, 20000)); break; } @@ -1361,8 +1361,8 @@ public: Creature* FindFriendlyCreature() const { Creature* target = nullptr; - acore::MostHPMissingInRange u_check(me, 60.0f, 0); - acore::CreatureLastSearcher searcher(me, target, u_check); + Acore::MostHPMissingInRange u_check(me, 60.0f, 0); + Acore::CreatureLastSearcher searcher(me, target, u_check); me->VisitNearbyGridObject(60.0f, searcher); return target; } @@ -1969,7 +1969,7 @@ public: std::list wards; GetCaster()->GetCreatureListWithEntryInGrid(wards, NPC_DEATHBOUND_WARD, 150.0f); - wards.sort(acore::ObjectDistanceOrderPred(GetCaster())); + wards.sort(Acore::ObjectDistanceOrderPred(GetCaster())); for (std::list::iterator itr = wards.begin(); itr != wards.end(); ++itr) { if ((*itr)->IsAlive() && (*itr)->HasAura(SPELL_STONEFORM)) @@ -2065,8 +2065,8 @@ public: // First effect void CountTargets(std::list& targets) { - targets.remove_if(acore::ObjectTypeIdCheck(TYPEID_PLAYER, false)); - targets.remove_if(acore::ObjectGUIDCheck(GetCaster()->GetGUID(), true)); + targets.remove_if(Acore::ObjectTypeIdCheck(TYPEID_PLAYER, false)); + targets.remove_if(Acore::ObjectGUIDCheck(GetCaster()->GetGUID(), true)); bool kill = true; for (std::list::const_iterator itr = targets.begin(); itr != targets.end(); ++itr) @@ -2159,7 +2159,7 @@ public: void RemoveAliveTarget(std::list& targets) { targets.remove_if(AliveCheck()); - acore::Containers::RandomResize(targets, 2); + Acore::Containers::RandomResize(targets, 2); } void Land(SpellEffIndex /*effIndex*/) @@ -2274,7 +2274,7 @@ public: instance->SetData(DATA_COLDFLAME_JETS, IN_PROGRESS); std::list traps; GetCreatureListWithEntryInGrid(traps, player, NPC_FROST_FREEZE_TRAP, 120.0f); - traps.sort(acore::ObjectDistanceOrderPred(player)); + traps.sort(Acore::ObjectDistanceOrderPred(player)); bool instant = false; for (std::list::iterator itr = traps.begin(); itr != traps.end(); ++itr) { @@ -2332,7 +2332,7 @@ public: if (!crok->IsAlive()) { FrostwingGauntletRespawner respawner; - acore::CreatureWorker worker(crok, respawner); + Acore::CreatureWorker worker(crok, respawner); crok->VisitNearbyGridObject(333.0f, worker); return true; } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp index 6323ac1d6..32c2c66b5 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp @@ -1541,7 +1541,7 @@ public: if (stalkers.empty()) return; - stalkers.sort(acore::ObjectDistanceOrderPred(teleporter)); + stalkers.sort(Acore::ObjectDistanceOrderPred(teleporter)); stalkers.front()->CastSpell((Unit*)nullptr, SPELL_ARTHAS_TELEPORTER_CEREMONY, false); stalkers.pop_front(); for (std::list::iterator itr = stalkers.begin(); itr != stalkers.end(); ++itr) @@ -1774,7 +1774,7 @@ public: GetCreatureListWithEntryInGrid(triggers, terenas, NPC_WORLD_TRIGGER_INFINITE_AOI, 100.0f); if (!triggers.empty()) { - triggers.sort(acore::ObjectDistanceOrderPred(terenas, false)); + triggers.sort(Acore::ObjectDistanceOrderPred(terenas, false)); Unit* visual = triggers.front(); visual->CastSpell(visual, SPELL_FROSTMOURNE_TELEPORT_VISUAL, true); } @@ -1845,7 +1845,7 @@ public: return; } - go->Relocate(acore::Containers::SelectRandomContainerElement(trapPositions)); + go->Relocate(Acore::Containers::SelectRandomContainerElement(trapPositions)); } protected: diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp index 58f50340f..5b9a48845 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp @@ -160,7 +160,7 @@ const Position PosPlatform = {2640.5f, -3360.6f, 285.26f, 0.0f}; #define IN_LIVE_SIDE(who) (who->GetPositionY() < POS_Y_GATE) // Predicate function to check that the r efzr unit is NOT on the same side as the source. -struct NotOnSameSide : public acore::unary_function +struct NotOnSameSide : public Acore::unary_function { bool m_inLiveSide; explicit NotOnSameSide(Unit* pSource) : m_inLiveSide(IN_LIVE_SIDE(pSource)) {} @@ -677,7 +677,7 @@ public: void FilterTargets(std::list& targets) { - targets.remove_if(acore::UnitAuraCheck(false, SPELL_SHADOW_MARK)); + targets.remove_if(Acore::UnitAuraCheck(false, SPELL_SHADOW_MARK)); } void Register() override diff --git a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp index 3666e9c2f..c50c310fa 100644 --- a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp +++ b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp @@ -1196,8 +1196,8 @@ public: else if (me->GetEntry() == NPC_LIVING_POISON) { Unit* target = nullptr; - acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(me, me, 0.5f); - acore::UnitLastSearcher searcher(me, target, u_check); + Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(me, me, 0.5f); + Acore::UnitLastSearcher searcher(me, target, u_check); me->VisitNearbyObject(1.5f, searcher); if (target) { diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp index 000f7f88c..826775abb 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp @@ -271,7 +271,7 @@ public: void SelectTarget(std::list& targets) { - targets.remove_if(acore::RandomCheck(50)); + targets.remove_if(Acore::RandomCheck(50)); } void HandlePull(SpellEffIndex effIndex) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 9ead51cf9..75543d884 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -1660,7 +1660,7 @@ public: else { //! In the end, only one target should be selected - WorldObject* _target = acore::Containers::SelectRandomContainerElement(targets); + WorldObject* _target = Acore::Containers::SelectRandomContainerElement(targets); targets.clear(); if (_target) targets.push_back(_target); @@ -1709,8 +1709,8 @@ public: { // use 99 because it is 3d search std::list targetList; - acore::WorldObjectSpellAreaTargetCheck check(99, GetExplTargetDest(), GetCaster(), GetCaster(), GetSpellInfo(), TARGET_CHECK_DEFAULT, nullptr); - acore::WorldObjectListSearcher searcher(GetCaster(), targetList, check); + Acore::WorldObjectSpellAreaTargetCheck check(99, GetExplTargetDest(), GetCaster(), GetCaster(), GetSpellInfo(), TARGET_CHECK_DEFAULT, nullptr); + Acore::WorldObjectListSearcher searcher(GetCaster(), targetList, check); GetCaster()->GetMap()->VisitAll(GetCaster()->m_positionX, GetCaster()->m_positionY, 99, searcher); float minDist = 99 * 99; Unit* target = nullptr; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp index 045ead234..173403dd9 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp @@ -424,9 +424,9 @@ public: Map::PlayerList const& pl = me->GetMap()->GetPlayers(); for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr) targets.push_back(itr->GetSource()); - targets.remove_if(acore::ObjectTypeIdCheck(TYPEID_PLAYER, false)); - targets.remove_if(acore::UnitAuraCheck(true, SPELL_FLASH_FREEZE_TRAPPED_PLAYER)); - acore::Containers::RandomResize(targets, (RAID_MODE(2,3))); + targets.remove_if(Acore::ObjectTypeIdCheck(TYPEID_PLAYER, false)); + targets.remove_if(Acore::UnitAuraCheck(true, SPELL_FLASH_FREEZE_TRAPPED_PLAYER)); + Acore::Containers::RandomResize(targets, (RAID_MODE(2,3))); for (std::list::const_iterator itr = targets.begin(); itr != targets.end(); ++itr) { float prevZ = (*itr)->GetPositionZ(); @@ -1271,9 +1271,9 @@ public: void FilterTargets(std::list& targets) { - targets.remove_if(acore::ObjectTypeIdCheck(TYPEID_PLAYER, false)); - targets.remove_if(acore::UnitAuraCheck(true, SPELL_FLASH_FREEZE_TRAPPED_PLAYER)); - acore::Containers::RandomResize(targets, 1); + targets.remove_if(Acore::ObjectTypeIdCheck(TYPEID_PLAYER, false)); + targets.remove_if(Acore::UnitAuraCheck(true, SPELL_FLASH_FREEZE_TRAPPED_PLAYER)); + Acore::Containers::RandomResize(targets, 1); } void Register() override diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp index 691670372..da0331903 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp @@ -635,7 +635,7 @@ public: }; // predicate function to select non main tank target -class StoneGripTargetSelector : public acore::unary_function +class StoneGripTargetSelector : public Acore::unary_function { public: StoneGripTargetSelector(Creature* me, Unit const* victim) : _me(me), _victim(victim) {} diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp index 015f78192..f92e3446f 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp @@ -941,7 +941,7 @@ public: void SelectTarget(std::list& targets) { if (Unit* victim = GetCaster()->GetVictim()) - targets.remove_if(acore::ObjectGUIDCheck(victim->GetGUID(), true)); + targets.remove_if(Acore::ObjectGUIDCheck(victim->GetGUID(), true)); } void Register() override @@ -1023,7 +1023,7 @@ public: void SelectTarget(std::list& targets) { if (Unit* victim = GetCaster()->GetVictim()) - targets.remove_if(acore::ObjectGUIDCheck(victim->GetGUID(), true)); + targets.remove_if(Acore::ObjectGUIDCheck(victim->GetGUID(), true)); } void Register() override diff --git a/src/server/scripts/Northrend/zone_dalaran.cpp b/src/server/scripts/Northrend/zone_dalaran.cpp index 540b8012f..d97c87347 100644 --- a/src/server/scripts/Northrend/zone_dalaran.cpp +++ b/src/server/scripts/Northrend/zone_dalaran.cpp @@ -540,7 +540,7 @@ public: if (PlayerInDalaranList.empty()) return nullptr; - return acore::Containers::SelectRandomContainerElement(PlayerInDalaranList); + return Acore::Containers::SelectRandomContainerElement(PlayerInDalaranList); } void SendMailToPlayer(Player* player) diff --git a/src/server/scripts/Northrend/zone_dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp index 4aded7794..f1c282bd6 100644 --- a/src/server/scripts/Northrend/zone_dragonblight.cpp +++ b/src/server/scripts/Northrend/zone_dragonblight.cpp @@ -773,7 +773,7 @@ public: if (GameObject* go = me->FindNearestGameObject(GO_SAC_LIGHTS_VENGEANCE_2, 150.0f)) go->Delete(); WretchedGhoulCleaner cleaner; - acore::CreatureWorker worker(me, cleaner); + Acore::CreatureWorker worker(me, cleaner); me->VisitNearbyGridObject(150.0f, worker); } @@ -987,7 +987,7 @@ public: case 17: // kill vegard { WretchedGhoulCleaner cleaner; - acore::CreatureWorker worker(me, cleaner); + Acore::CreatureWorker worker(me, cleaner); me->VisitNearbyGridObject(150.0f, worker); if (Creature* c = me->FindNearestCreature(NPC_SAC_LIGHTS_VENGEANCE, 150.0f, true)) @@ -1193,7 +1193,7 @@ public: void FilterTargets(std::list& targets) { targets.remove_if(GhoulTargetCheck(GetSpellInfo()->Id == 70790)); - acore::Containers::RandomResize(targets, 2); + Acore::Containers::RandomResize(targets, 2); } void HandleScript(SpellEffIndex effIndex) diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp index b2e2b564c..96ea055db 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp @@ -192,8 +192,8 @@ public: void SelectTarget(std::list& targets) { - targets.remove_if(acore::AllWorldObjectsInExactRange(GetCaster(), 100.0f, true)); - targets.remove_if(acore::AllWorldObjectsInExactRange(GetCaster(), 25.0f, false)); + targets.remove_if(Acore::AllWorldObjectsInExactRange(GetCaster(), 100.0f, true)); + targets.remove_if(Acore::AllWorldObjectsInExactRange(GetCaster(), 25.0f, false)); } void Register() override diff --git a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp index 6812b22a2..14f200bc4 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp @@ -199,7 +199,7 @@ public: if (targets.empty()) return; - targets.sort(acore::ObjectDistanceOrderPred(GetCaster(), false)); + targets.sort(Acore::ObjectDistanceOrderPred(GetCaster(), false)); if (targets.size() > GetSpellValue()->MaxAffectedTargets) { std::list::iterator itr = targets.begin(); diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp index 7b888c825..74ec17438 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp @@ -258,7 +258,7 @@ public: void FilterTargets(std::list& targets) { - targets.remove_if(acore::UnitAuraCheck(true, SPELL_SABER_LASH_IMMUNITY)); + targets.remove_if(Acore::UnitAuraCheck(true, SPELL_SABER_LASH_IMMUNITY)); if (targets.size() <= 1) FinishCast(SPELL_FAILED_DONT_REPORT); } diff --git a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp index f6b314dcf..94196885f 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp @@ -613,7 +613,7 @@ public: if (targets.empty()) return; - targets.sort(acore::ObjectDistanceOrderPred(GetCaster())); + targets.sort(Acore::ObjectDistanceOrderPred(GetCaster())); WorldObject* target = targets.front(); targets.clear(); targets.push_back(target); diff --git a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp index c3a25b4b8..f85c6a9d9 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp @@ -49,7 +49,7 @@ enum Misc EVENT_TALK_KILL = 10 }; -struct ShadowOfDeathSelector : public acore::unary_function +struct ShadowOfDeathSelector : public Acore::unary_function { bool operator()(Unit const* target) const { diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp index 3b831447c..9d16fa8c8 100644 --- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp +++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp @@ -86,7 +86,7 @@ enum Misc EVENT_KILL_TALK = 100 }; -struct HammerOfJusticeSelector : public acore::unary_function +struct HammerOfJusticeSelector : public Acore::unary_function { Unit const* _me; HammerOfJusticeSelector(Unit* me) : _me(me) { } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp index b58ced165..4a336ce34 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp @@ -401,7 +401,7 @@ public: void FilterTargets(std::list& unitList) { if (Unit* victim = GetCaster()->GetVictim()) - unitList.remove_if(acore::ObjectGUIDCheck(victim->GetGUID(), true)); + unitList.remove_if(Acore::ObjectGUIDCheck(victim->GetGUID(), true)); } void Register() override diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp index 3dc008723..866fec801 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp @@ -199,7 +199,7 @@ public: void FilterTargets(std::list& unitList) { - acore::Containers::RandomResize(unitList, 1); + Acore::Containers::RandomResize(unitList, 1); } void HandleDummy(SpellEffIndex effIndex) diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp index 3f69d9310..244669a04 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp @@ -291,7 +291,7 @@ public: playerList.push_back(player); if (!playerList.empty()) - target = acore::Containers::SelectRandomContainerElement(playerList); + target = Acore::Containers::SelectRandomContainerElement(playerList); } } diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp index 311fb14c9..3dd52ea44 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp @@ -241,7 +241,7 @@ public: void FilterTargets(std::list& unitList) { - acore::Containers::RandomResize(unitList, 1); + Acore::Containers::RandomResize(unitList, 1); } void HandleScriptEffect(SpellEffIndex effIndex) diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index deb43a992..82beb381a 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -833,7 +833,7 @@ public: void SelectTarget(std::list& targets) { if (Unit* victim = GetCaster()->GetVictim()) - targets.remove_if(acore::ObjectGUIDCheck(victim->GetGUID(), true)); + targets.remove_if(Acore::ObjectGUIDCheck(victim->GetGUID(), true)); } void Register() override @@ -993,7 +993,7 @@ public: targetList.push_back(target); } - acore::Containers::RandomResize(targetList, 5); + Acore::Containers::RandomResize(targetList, 5); for (std::list::const_iterator itr = targetList.begin(); itr != targetList.end(); ++itr) GetCaster()->CastSpell(*itr, SPELL_NETHER_BEAM_DAMAGE, true); } diff --git a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp index 077cf1a29..ed28fcbd9 100644 --- a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp @@ -697,8 +697,8 @@ public: me->SetObjectScale(large ? 2.0f : 1.0f); std::list ClusterList; - acore::AllWorldObjectsInRange objects(me, searchDistance); - acore::WorldObjectListSearcher searcher(me, ClusterList, objects); + Acore::AllWorldObjectsInRange objects(me, searchDistance); + Acore::WorldObjectListSearcher searcher(me, ClusterList, objects); me->VisitNearbyObject(searchDistance, searcher); for (std::list::const_iterator i = ClusterList.begin(); i != ClusterList.end(); ++i) diff --git a/src/server/scripts/Outland/zone_netherstorm.cpp b/src/server/scripts/Outland/zone_netherstorm.cpp index 430c319a3..140cf88b0 100644 --- a/src/server/scripts/Outland/zone_netherstorm.cpp +++ b/src/server/scripts/Outland/zone_netherstorm.cpp @@ -1757,7 +1757,7 @@ public: } if (!UnitsWithMana.empty()) { - DoCast(acore::Containers::SelectRandomContainerElement(UnitsWithMana), SPELL_MANA_BURN); + DoCast(Acore::Containers::SelectRandomContainerElement(UnitsWithMana), SPELL_MANA_BURN); ManaBurnTimer = 8000 + (rand() % 10 * 1000); // 8-18 sec cd } else diff --git a/src/server/scripts/Pet/pet_dk.cpp b/src/server/scripts/Pet/pet_dk.cpp index 3c2b8adee..15516e30a 100644 --- a/src/server/scripts/Pet/pet_dk.cpp +++ b/src/server/scripts/Pet/pet_dk.cpp @@ -155,8 +155,8 @@ public: _initialSelection = false; // Find victim of Summon Gargoyle spell std::list targets; - acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(me, me, 50); - acore::UnitListSearcher searcher(me, targets, u_check); + Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(me, me, 50); + Acore::UnitListSearcher searcher(me, targets, u_check); me->VisitNearbyObject(50, searcher); for (std::list::const_iterator iter = targets.begin(); iter != targets.end(); ++iter) if ((*iter)->GetAura(SPELL_DK_SUMMON_GARGOYLE_1, me->GetOwnerGUID())) diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 0516bef41..f5b28e7ef 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -1359,7 +1359,7 @@ public: FinishCast(SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW); return; } - target = acore::Containers::SelectRandomContainerElement(targets); + target = Acore::Containers::SelectRandomContainerElement(targets); targets.clear(); targets.push_back(target); } @@ -2240,7 +2240,7 @@ public: return; } - WorldObject* target = acore::Containers::SelectRandomContainerElement(targets); + WorldObject* target = Acore::Containers::SelectRandomContainerElement(targets); targets.clear(); targets.push_back(target); _corpse = true; diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index be9925ad5..88ae90d78 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -1050,7 +1050,7 @@ public: void FilterTargets(std::list& targets) { - acore::Containers::RandomResize(targets, 2); + Acore::Containers::RandomResize(targets, 2); } void HandleDummy(SpellEffIndex /*effIndex*/) @@ -1276,7 +1276,7 @@ public: return; } - tempTargets.sort(acore::HealthPctOrderPred()); + tempTargets.sort(Acore::HealthPctOrderPred()); targets.clear(); targets.push_back(tempTargets.front()); } @@ -1313,13 +1313,13 @@ public: void FilterTargets(std::list& targets) { - targets.remove_if(acore::RaidCheck(GetCaster(), false)); + targets.remove_if(Acore::RaidCheck(GetCaster(), false)); uint32 const maxTargets = GetCaster()->HasAura(SPELL_DRUID_GLYPH_OF_WILD_GROWTH) ? 6 : 5; if (targets.size() > maxTargets) { - targets.sort(acore::HealthPctOrderPred()); + targets.sort(Acore::HealthPctOrderPred()); targets.resize(maxTargets); } diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index b02c2deee..e801ecaa8 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -768,7 +768,7 @@ public: void FilterTargets(std::list& targets) { targets.remove(GetCaster()); - acore::Containers::RandomResize(targets, _count); + Acore::Containers::RandomResize(targets, _count); } void Register() override @@ -1719,8 +1719,8 @@ public: float max_range = GetSpellInfo()->GetMaxRange(false); WorldObject* result = nullptr; // search for nearby enemy corpse in range - acore::AnyDeadUnitSpellTargetInRangeCheck check(caster, max_range, GetSpellInfo(), TARGET_CHECK_CORPSE); - acore::WorldObjectSearcher searcher(caster, result, check); + Acore::AnyDeadUnitSpellTargetInRangeCheck check(caster, max_range, GetSpellInfo(), TARGET_CHECK_CORPSE); + Acore::WorldObjectSearcher searcher(caster, result, check); caster->GetMap()->VisitFirstFound(caster->m_positionX, caster->m_positionY, max_range, searcher); if (!result) return SPELL_FAILED_NO_EDIBLE_CORPSES; @@ -4812,13 +4812,13 @@ public: } } - targets.remove_if(acore::PowerCheck(POWER_MANA, false)); + targets.remove_if(Acore::PowerCheck(POWER_MANA, false)); uint8 const maxTargets = 10; if (targets.size() > maxTargets) { - targets.sort(acore::PowerPctOrderPred(POWER_MANA)); + targets.sort(Acore::PowerPctOrderPred(POWER_MANA)); targets.resize(maxTargets); } } diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 9653cfe85..86e502c18 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -977,8 +977,8 @@ public: float max_range = GetSpellInfo()->GetMaxRange(false); WorldObject* result = nullptr; // search for nearby enemy corpse in range - acore::AnyDeadUnitSpellTargetInRangeCheck check(caster, max_range, GetSpellInfo(), TARGET_CHECK_ENEMY); - acore::WorldObjectSearcher searcher(caster, result, check); + Acore::AnyDeadUnitSpellTargetInRangeCheck check(caster, max_range, GetSpellInfo(), TARGET_CHECK_ENEMY); + Acore::WorldObjectSearcher searcher(caster, result, check); caster->GetMap()->VisitFirstFound(caster->m_positionX, caster->m_positionY, max_range, searcher); if (!result) return SPELL_FAILED_NO_EDIBLE_CORPSES; diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 7e19c5d9b..9f685e435 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1998,7 +1998,7 @@ public: if (targets.size() < 2) return; - targets.sort(acore::HealthPctOrderPred()); + targets.sort(Acore::HealthPctOrderPred()); WorldObject* target = targets.front(); targets.clear(); diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 3b2f352be..16546916e 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -652,7 +652,7 @@ public: void CountTargets(std::list& targetList) { - acore::Containers::RandomResize(targetList, GetSpellValue()->MaxAffectedTargets); + Acore::Containers::RandomResize(targetList, GetSpellValue()->MaxAffectedTargets); _targetCount = targetList.size(); } @@ -767,7 +767,7 @@ public: if (targets.size() > maxTargets) { - targets.sort(acore::HealthPctOrderPred()); + targets.sort(Acore::HealthPctOrderPred()); targets.resize(maxTargets); } } diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 7818bb573..2ea8928c6 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -152,13 +152,13 @@ public: void FilterTargets(std::list& targets) { - targets.remove_if(acore::RaidCheck(GetCaster(), false)); + targets.remove_if(Acore::RaidCheck(GetCaster(), false)); uint32 const maxTargets = GetCaster()->HasAura(SPELL_PRIEST_GLYPH_OF_CIRCLE_OF_HEALING) ? 6 : 5; // Glyph of Circle of Healing if (targets.size() > maxTargets) { - targets.sort(acore::HealthPctOrderPred()); + targets.sort(Acore::HealthPctOrderPred()); targets.resize(maxTargets); } } @@ -235,13 +235,13 @@ public: void FilterTargets(std::list& targets) { - targets.remove_if(acore::RaidCheck(GetCaster(), false)); + targets.remove_if(Acore::RaidCheck(GetCaster(), false)); uint32 const maxTargets = 3; if (targets.size() > maxTargets) { - targets.sort(acore::HealthPctOrderPred()); + targets.sort(Acore::HealthPctOrderPred()); targets.resize(maxTargets); } } @@ -361,14 +361,14 @@ public: void FilterTargets(std::list& targets) { - targets.remove_if(acore::PowerCheck(POWER_MANA, false)); - targets.remove_if(acore::RaidCheck(GetCaster(), false)); + targets.remove_if(Acore::PowerCheck(POWER_MANA, false)); + targets.remove_if(Acore::RaidCheck(GetCaster(), false)); uint32 const maxTargets = 3; if (targets.size() > maxTargets) { - targets.sort(acore::PowerPctOrderPred(POWER_MANA)); + targets.sort(Acore::PowerPctOrderPred(POWER_MANA)); targets.resize(maxTargets); } } @@ -549,7 +549,7 @@ public: void FilterTargets(std::list& unitList) { - unitList.remove_if(acore::ObjectGUIDCheck(GetCaster()->GetGuidValue(UNIT_FIELD_CHANNEL_OBJECT), true)); + unitList.remove_if(Acore::ObjectGUIDCheck(GetCaster()->GetGuidValue(UNIT_FIELD_CHANNEL_OBJECT), true)); } void Register() override diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 0be38a08d..f9b2ab9e8 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -2426,8 +2426,8 @@ public: Unit* caster = GetCaster(); // Check for player that is in 65 y range std::list playerList; - acore::AnyPlayerInObjectRangeCheck checker(caster, 65.0f); - acore::PlayerListSearcher searcher(caster, playerList, checker); + Acore::AnyPlayerInObjectRangeCheck checker(caster, 65.0f); + Acore::PlayerListSearcher searcher(caster, playerList, checker); caster->VisitNearbyWorldObject(65.0f, searcher); for (std::list::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr) // Check if found player target is on fly mount or using flying form diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index e021b4b26..f1a38c46a 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -395,7 +395,7 @@ public: { while (!_targets.empty()) { - ObjectGuid guid = acore::Containers::SelectRandomContainerElement(_targets); + ObjectGuid guid = Acore::Containers::SelectRandomContainerElement(_targets); if (Unit* target = ObjectAccessor::GetUnit(*GetTarget(), guid)) { // xinef: target may be no longer valid diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 08a62c8ba..b201b0f82 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -424,7 +424,7 @@ public: if (targets.size() < 2) return; - targets.sort(acore::HealthPctOrderPred()); + targets.sort(Acore::HealthPctOrderPred()); WorldObject* target = targets.front(); targets.clear(); @@ -512,8 +512,8 @@ public: void RemoveInvalidTargets(std::list& targets) { - targets.remove_if(acore::UnitAuraCheck(true, SPELL_SHAMAN_SATED)); - targets.remove_if(acore::UnitAuraCheck(true, SPELL_SHAMAN_EXHAUSTION)); + targets.remove_if(Acore::UnitAuraCheck(true, SPELL_SHAMAN_SATED)); + targets.remove_if(Acore::UnitAuraCheck(true, SPELL_SHAMAN_EXHAUSTION)); } void ApplyDebuff() @@ -999,8 +999,8 @@ public: void RemoveInvalidTargets(std::list& targets) { - targets.remove_if(acore::UnitAuraCheck(true, SPELL_SHAMAN_EXHAUSTION)); - targets.remove_if(acore::UnitAuraCheck(true, SPELL_SHAMAN_SATED)); + targets.remove_if(Acore::UnitAuraCheck(true, SPELL_SHAMAN_EXHAUSTION)); + targets.remove_if(Acore::UnitAuraCheck(true, SPELL_SHAMAN_SATED)); } void ApplyDebuff() diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index d331e28dc..af838fd4b 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -168,7 +168,7 @@ public: void FilterTargets(std::list& unitList) { GetCaster()->RemoveAurasDueToSpell(SPELL_WARRIOR_SPELL_REFLECTION); - unitList.sort(acore::ObjectDistanceOrderPred(GetCaster())); + unitList.sort(Acore::ObjectDistanceOrderPred(GetCaster())); while (unitList.size() > GetSpellValue()->MaxAffectedTargets) unitList.pop_back(); } diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp index 1bdf04a0e..60eef68df 100644 --- a/src/server/scripts/World/boss_emerald_dragons.cpp +++ b/src/server/scripts/World/boss_emerald_dragons.cpp @@ -671,7 +671,7 @@ public: void FilterTargets(std::list& targets) { - targets.remove_if(acore::UnitAuraCheck(true, SPELL_SLEEP)); + targets.remove_if(Acore::UnitAuraCheck(true, SPELL_SLEEP)); } void Register() override diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 65a6d23cd..c0e03ac6e 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -349,8 +349,8 @@ public: { timer = 0; std::list players; - acore::AnyPlayerExactPositionInGameObjectRangeCheck checker(go, 0.3f); - acore::PlayerListSearcher searcher(go, players, checker); + Acore::AnyPlayerExactPositionInGameObjectRangeCheck checker(go, 0.3f); + Acore::PlayerListSearcher searcher(go, players, checker); go->VisitNearbyWorldObject(0.3f, searcher); if (players.size() > 0) @@ -396,8 +396,8 @@ public: { timer = 0; std::list players; - acore::AnyPlayerExactPositionInGameObjectRangeCheck checker(go, 0.3f); - acore::PlayerListSearcher searcher(go, players, checker); + Acore::AnyPlayerExactPositionInGameObjectRangeCheck checker(go, 0.3f); + Acore::PlayerListSearcher searcher(go, players, checker); go->VisitNearbyWorldObject(0.3f, searcher); if (players.size() > 0) diff --git a/src/server/shared/DataStores/DBCDatabaseLoader.cpp b/src/server/shared/DataStores/DBCDatabaseLoader.cpp index 2bbba5e23..7894c7835 100644 --- a/src/server/shared/DataStores/DBCDatabaseLoader.cpp +++ b/src/server/shared/DataStores/DBCDatabaseLoader.cpp @@ -28,7 +28,7 @@ DBCDatabaseLoader::DBCDatabaseLoader(char const* tableName, char const* dbcForma char* DBCDatabaseLoader::Load(uint32& records, char**& indexTable) { - std::string query = acore::StringFormat("SELECT * FROM `%s` ORDER BY `ID` DESC", _sqlTableName); + std::string query = Acore::StringFormat("SELECT * FROM `%s` ORDER BY `ID` DESC", _sqlTableName); // no error if empty set QueryResult result = WorldDatabase.Query(query.c_str()); diff --git a/src/server/shared/Network/AsyncAcceptor.h b/src/server/shared/Network/AsyncAcceptor.h index c618fb9e9..5b218bf22 100644 --- a/src/server/shared/Network/AsyncAcceptor.h +++ b/src/server/shared/Network/AsyncAcceptor.h @@ -26,8 +26,8 @@ class AsyncAcceptor public: typedef void(*AcceptCallback)(tcp::socket&& newSocket, uint32 threadIndex); - AsyncAcceptor(acore::Asio::IoContext& ioContext, std::string const& bindIp, uint16 port) : - _acceptor(ioContext), _endpoint(acore::Net::make_address(bindIp), port), + AsyncAcceptor(Acore::Asio::IoContext& ioContext, std::string const& bindIp, uint16 port) : + _acceptor(ioContext), _endpoint(Acore::Net::make_address(bindIp), port), _socket(ioContext), _closed(false), _socketFactory(std::bind(&AsyncAcceptor::DefeaultSocketFactory, this)) { } diff --git a/src/server/shared/Network/NetworkThread.h b/src/server/shared/Network/NetworkThread.h index 48c6b9f16..cb282e3f0 100644 --- a/src/server/shared/Network/NetworkThread.h +++ b/src/server/shared/Network/NetworkThread.h @@ -158,9 +158,9 @@ private: std::mutex _newSocketsLock; SocketContainer _newSockets; - acore::Asio::IoContext _ioContext; + Acore::Asio::IoContext _ioContext; tcp::socket _acceptSocket; - acore::Asio::DeadlineTimer _updateTimer; + Acore::Asio::DeadlineTimer _updateTimer; }; #endif // NetworkThread_h__ diff --git a/src/server/shared/Network/SocketMgr.h b/src/server/shared/Network/SocketMgr.h index 11b1a2f72..8c0ce5156 100644 --- a/src/server/shared/Network/SocketMgr.h +++ b/src/server/shared/Network/SocketMgr.h @@ -23,7 +23,7 @@ public: ASSERT(!_threads && !_acceptor && !_threadCount, "StopNetwork must be called prior to SocketMgr destruction"); } - virtual bool StartNetwork(acore::Asio::IoContext& ioContext, std::string const& bindIp, uint16 port, int threadCount) + virtual bool StartNetwork(Acore::Asio::IoContext& ioContext, std::string const& bindIp, uint16 port, int threadCount) { ASSERT(threadCount > 0); diff --git a/src/server/shared/Packets/ByteBuffer.cpp b/src/server/shared/Packets/ByteBuffer.cpp index 0db7c804b..11b5f3ad5 100644 --- a/src/server/shared/Packets/ByteBuffer.cpp +++ b/src/server/shared/Packets/ByteBuffer.cpp @@ -40,7 +40,7 @@ ByteBufferSourceException::ByteBufferSourceException(size_t pos, size_t size, si ByteBufferInvalidValueException::ByteBufferInvalidValueException(char const* type, char const* value) { - message().assign(acore::StringFormat("Invalid %s value (%s) found in ByteBuffer", type, value)); + message().assign(Acore::StringFormat("Invalid %s value (%s) found in ByteBuffer", type, value)); } ByteBuffer& ByteBuffer::operator>>(float& value) diff --git a/src/server/shared/Secrets/SecretMgr.cpp b/src/server/shared/Secrets/SecretMgr.cpp index 29785af01..4082da366 100644 --- a/src/server/shared/Secrets/SecretMgr.cpp +++ b/src/server/shared/Secrets/SecretMgr.cpp @@ -111,7 +111,7 @@ void SecretMgr::AttemptLoad(Secrets i, LogLevel errorLevel, std::unique_lockAsHexStr(), *oldDigest)) // there is an old digest, and the current secret does not match it + (oldDigest && !Acore::Crypto::Argon2::Verify(currentValue->AsHexStr(), *oldDigest)) // there is an old digest, and the current secret does not match it ) { if (info.owner != THIS_SERVER_PROCESS) @@ -128,7 +128,7 @@ void SecretMgr::AttemptLoad(Secrets i, LogLevel errorLevel, std::unique_lockAsHexStr(), *oldDigest)) + if (oldSecret && !Acore::Crypto::Argon2::Verify(oldSecret->AsHexStr(), *oldDigest)) { LOG_MESSAGE_BODY("server.loading", errorLevel, "Invalid value for '%s' specified - this is not actually the secret previously used in your auth DB.", info.oldKey); _secrets[i].state = Secret::LOAD_FAILED; @@ -178,15 +178,15 @@ Optional SecretMgr::AttemptTransition(Secrets i, Optional(totpSecret, oldSecret->ToByteArray()); + bool success = Acore::Crypto::AEDecrypt(totpSecret, oldSecret->ToByteArray()); if (!success) - return acore::StringFormat("Cannot decrypt old TOTP tokens - value of '%s' is incorrect for some users!", secret_info[i].oldKey); + return Acore::StringFormat("Cannot decrypt old TOTP tokens - value of '%s' is incorrect for some users!", secret_info[i].oldKey); } if (newSecret) - acore::Crypto::AEEncryptWithRandomIV(totpSecret, newSecret->ToByteArray()); + Acore::Crypto::AEEncryptWithRandomIV(totpSecret, newSecret->ToByteArray()); auto* updateStmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_TOTP_SECRET); updateStmt->setBinary(0, totpSecret); @@ -211,7 +211,7 @@ Optional SecretMgr::AttemptTransition(Secrets i, Optional hash = acore::Crypto::Argon2::Hash(newSecret->AsHexStr(), salt); + Optional hash = Acore::Crypto::Argon2::Hash(newSecret->AsHexStr(), salt); if (!hash) return std::string("Failed to hash new secret"); diff --git a/src/server/shared/SharedDefines.cpp b/src/server/shared/SharedDefines.cpp index d8556bf1a..2ac3cb003 100644 --- a/src/server/shared/SharedDefines.cpp +++ b/src/server/shared/SharedDefines.cpp @@ -5,4 +5,4 @@ #include "SharedDefines.h" -ServerProcessTypes acore::Impl::CurrentServerProcessHolder::_type = NUM_SERVER_PROCESS_TYPES; +ServerProcessTypes Acore::Impl::CurrentServerProcessHolder::_type = NUM_SERVER_PROCESS_TYPES; diff --git a/src/server/shared/SharedDefines.h b/src/server/shared/SharedDefines.h index 76f7d40d7..6a11a35a6 100644 --- a/src/server/shared/SharedDefines.h +++ b/src/server/shared/SharedDefines.h @@ -3575,7 +3575,7 @@ enum ServerProcessTypes NUM_SERVER_PROCESS_TYPES }; -namespace acore::Impl +namespace Acore::Impl { struct AC_SHARED_API CurrentServerProcessHolder { @@ -3584,6 +3584,6 @@ namespace acore::Impl }; } -#define THIS_SERVER_PROCESS (acore::Impl::CurrentServerProcessHolder::type()) +#define THIS_SERVER_PROCESS (Acore::Impl::CurrentServerProcessHolder::type()) #endif diff --git a/src/server/worldserver/CommandLine/CliRunnable.h b/src/server/worldserver/CommandLine/CliRunnable.h index 03daa8b1e..47b424b75 100644 --- a/src/server/worldserver/CommandLine/CliRunnable.h +++ b/src/server/worldserver/CommandLine/CliRunnable.h @@ -14,7 +14,7 @@ #include "Threading.h" /// Command Line Interface handling thread -class CliRunnable : public acore::Runnable +class CliRunnable : public Acore::Runnable { public: void run() override; diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp index 0567be32f..a931d7884 100644 --- a/src/server/worldserver/Main.cpp +++ b/src/server/worldserver/Main.cpp @@ -56,7 +56,7 @@ void usage(const char* prog) /// Launch the Trinity server extern int main(int argc, char** argv) { - acore::Impl::CurrentServerProcessHolder::_type = SERVER_PROCESS_WORLDSERVER; + Acore::Impl::CurrentServerProcessHolder::_type = SERVER_PROCESS_WORLDSERVER; ///- Command line parsing to get the configuration file name std::string configFile = sConfigMgr->GetConfigPath() + std::string(_ACORE_CORE_CONFIG); @@ -125,7 +125,7 @@ extern int main(int argc, char** argv) sLog->RegisterAppender(); sLog->Initialize(); - acore::Banner::Show("worldserver-daemon", + Acore::Banner::Show("worldserver-daemon", [](char const* text) { LOG_INFO("server.worldserver", "%s", text); diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index fd2a7e2e3..3dcb7a1e8 100644 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -65,7 +65,7 @@ void HandleSignal(int sigNum) } } -class FreezeDetectorRunnable : public acore::Runnable +class FreezeDetectorRunnable : public Acore::Runnable { private: uint32 _loops; @@ -95,7 +95,7 @@ public: ABORT(); } - acore::Thread::Sleep(1000); + Acore::Thread::Sleep(1000); } LOG_INFO("server", "Anti-freeze thread exiting without problems."); } @@ -148,7 +148,7 @@ int Master::Run() sScriptMgr->OnStartup(); ///- Initialize the signal handlers - acore::SignalHandler signalHandler; + Acore::SignalHandler signalHandler; signalHandler.handle_signal(SIGINT, &HandleSignal); signalHandler.handle_signal(SIGTERM, &HandleSignal); @@ -158,10 +158,10 @@ int Master::Run() #endif ///- Launch WorldRunnable thread - acore::Thread worldThread(new WorldRunnable); - worldThread.setPriority(acore::Priority_Highest); + Acore::Thread worldThread(new WorldRunnable); + worldThread.setPriority(Acore::Priority_Highest); - acore::Thread* cliThread = nullptr; + Acore::Thread* cliThread = nullptr; #ifdef _WIN32 if (sConfigMgr->GetOption("Console.Enable", true) && (m_ServiceStatus == -1)/* need disable console in service mode*/) @@ -170,14 +170,14 @@ int Master::Run() #endif { ///- Launch CliRunnable thread - cliThread = new acore::Thread(new CliRunnable); + cliThread = new Acore::Thread(new CliRunnable); } - acore::Thread rarThread(new RARunnable); + Acore::Thread rarThread(new RARunnable); // pussywizard: - acore::Thread auctionLising_thread(new AuctionListingRunnable); - auctionLising_thread.setPriority(acore::Priority_High); + Acore::Thread auctionLising_thread(new AuctionListingRunnable); + auctionLising_thread.setPriority(Acore::Priority_High); #if defined(_WIN32) || defined(__linux__) @@ -260,12 +260,12 @@ int Master::Run() } // Start up freeze catcher thread - acore::Thread* freezeThread = nullptr; + Acore::Thread* freezeThread = nullptr; if (uint32 freezeDelay = sConfigMgr->GetOption("MaxCoreStuckTime", 0)) { FreezeDetectorRunnable* runnable = new FreezeDetectorRunnable(freezeDelay * 1000); - freezeThread = new acore::Thread(runnable); - freezeThread->setPriority(acore::Priority_Highest); + freezeThread = new Acore::Thread(runnable); + freezeThread->setPriority(Acore::Priority_Highest); } ///- Launch the world listener socket diff --git a/src/server/worldserver/RemoteAccess/RARunnable.h b/src/server/worldserver/RemoteAccess/RARunnable.h index 7f6c4fb04..4c84915cd 100644 --- a/src/server/worldserver/RemoteAccess/RARunnable.h +++ b/src/server/worldserver/RemoteAccess/RARunnable.h @@ -15,7 +15,7 @@ #include "Threading.h" #include -class RARunnable : public acore::Runnable +class RARunnable : public Acore::Runnable { public: RARunnable(); diff --git a/src/server/worldserver/RemoteAccess/RASocket.cpp b/src/server/worldserver/RemoteAccess/RASocket.cpp index 3f73801e7..4b2c58282 100644 --- a/src/server/worldserver/RemoteAccess/RASocket.cpp +++ b/src/server/worldserver/RemoteAccess/RASocket.cpp @@ -218,10 +218,10 @@ int RASocket::check_password(const std::string& user, const std::string& pass) if (PreparedQueryResult result = LoginDatabase.Query(stmt)) { - acore::Crypto::SRP6::Salt salt = (*result)[0].GetBinary(); - acore::Crypto::SRP6::Verifier verifier = (*result)[1].GetBinary(); + Acore::Crypto::SRP6::Salt salt = (*result)[0].GetBinary(); + Acore::Crypto::SRP6::Verifier verifier = (*result)[1].GetBinary(); - if (acore::Crypto::SRP6::CheckLogin(safe_user, safe_pass, salt, verifier)) + if (Acore::Crypto::SRP6::CheckLogin(safe_user, safe_pass, salt, verifier)) return 0; } diff --git a/src/server/worldserver/WorldThread/WorldRunnable.cpp b/src/server/worldserver/WorldThread/WorldRunnable.cpp index 0eecaf592..24ca2a28d 100644 --- a/src/server/worldserver/WorldThread/WorldRunnable.cpp +++ b/src/server/worldserver/WorldThread/WorldRunnable.cpp @@ -53,7 +53,7 @@ void WorldRunnable::run() avgDiffTracker.Update(executionTimeDiff > WORLD_SLEEP_CONST ? executionTimeDiff : WORLD_SLEEP_CONST); if (executionTimeDiff < WORLD_SLEEP_CONST) - acore::Thread::Sleep(WORLD_SLEEP_CONST - executionTimeDiff); + Acore::Thread::Sleep(WORLD_SLEEP_CONST - executionTimeDiff); #ifdef _WIN32 if (m_ServiceStatus == 0) @@ -120,7 +120,7 @@ void AuctionListingRunnable::run() } } } - acore::Thread::Sleep(1); + Acore::Thread::Sleep(1); } LOG_INFO("server", "Auction House Listing thread exiting without problems."); } diff --git a/src/server/worldserver/WorldThread/WorldRunnable.h b/src/server/worldserver/WorldThread/WorldRunnable.h index c57bf8342..742ec0261 100644 --- a/src/server/worldserver/WorldThread/WorldRunnable.h +++ b/src/server/worldserver/WorldThread/WorldRunnable.h @@ -14,13 +14,13 @@ #include "Threading.h" /// Heartbeat thread for the World -class WorldRunnable : public acore::Runnable +class WorldRunnable : public Acore::Runnable { public: void run() override; }; -class AuctionListingRunnable : public acore::Runnable +class AuctionListingRunnable : public Acore::Runnable { public: void run() override; diff --git a/src/test/server/game/Miscellaneous/FormulasTest.cpp b/src/test/server/game/Miscellaneous/FormulasTest.cpp index 42bf181af..6046cf42c 100644 --- a/src/test/server/game/Miscellaneous/FormulasTest.cpp +++ b/src/test/server/game/Miscellaneous/FormulasTest.cpp @@ -6,8 +6,8 @@ #include "gtest/gtest.h" #include "WorldMock.h" -using namespace acore::Honor; -using namespace acore::XP; +using namespace Acore::Honor; +using namespace Acore::XP; TEST(FormulasTest, hk_honor_at_level) { diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 389ad6a1d..0ce52635e 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -980,7 +980,7 @@ void ExtractMapsFromMpq(uint32 build) { printf("Extract %s (%d/%u) \n", map_ids[z].name, z + 1, map_count); // Loadup map grid data - mpqMapName = acore::StringFormat(R"(World\Maps\%s\%s.wdt)", map_ids[z].name, map_ids[z].name); + mpqMapName = Acore::StringFormat(R"(World\Maps\%s\%s.wdt)", map_ids[z].name, map_ids[z].name); WDT_file wdt; if (!wdt.loadFile(mpqMapName, false)) { @@ -994,8 +994,8 @@ void ExtractMapsFromMpq(uint32 build) { if (!wdt.main->adt_list[y][x].exist) continue; - mpqFileName = acore::StringFormat(R"(World\Maps\%s\%s_%u_%u.adt)", map_ids[z].name, map_ids[z].name, x, y); - outputFileName = acore::StringFormat("%s/maps/%03u%02u%02u.map", output_path, map_ids[z].id, y, x); + mpqFileName = Acore::StringFormat(R"(World\Maps\%s\%s_%u_%u.adt)", map_ids[z].name, map_ids[z].name, x, y); + outputFileName = Acore::StringFormat("%s/maps/%03u%02u%02u.map", output_path, map_ids[z].id, y, x); ConvertADT(mpqFileName, outputFileName, y, x, build); } // draw progress bar