feat(Core/Misc): includes cleanup (#5953)

This commit is contained in:
Kargatum
2021-05-26 19:00:08 +07:00
committed by GitHub
parent 7d3129a737
commit 78e1719c80
46 changed files with 132 additions and 191 deletions
@@ -6,6 +6,7 @@
#include "MMapFactory.h" #include "MMapFactory.h"
#include <set> #include <set>
#include <cstring>
namespace MMAP namespace MMAP
{ {
@@ -13,6 +13,7 @@
#include "DetourExtended.h" #include "DetourExtended.h"
#include <unordered_map> #include <unordered_map>
#include <shared_mutex> #include <shared_mutex>
#include <vector>
// memory management // memory management
inline void* dtCustomAlloc(size_t size, dtAllocHint /*hint*/) inline void* dtCustomAlloc(size_t size, dtAllocHint /*hint*/)
+1 -3
View File
@@ -5,7 +5,6 @@
*/ */
#include "MapTree.h" #include "MapTree.h"
#include "Common.h"
#include "ModelInstance.h" #include "ModelInstance.h"
#include "VMapManager2.h" #include "VMapManager2.h"
#include "VMapDefinitions.h" #include "VMapDefinitions.h"
@@ -20,7 +19,6 @@ using G3D::Vector3;
namespace VMAP namespace VMAP
{ {
class MapRayCallback class MapRayCallback
{ {
public: public:
@@ -144,7 +142,7 @@ namespace VMAP
{ {
float maxDist = (pos2 - pos1).magnitude(); float maxDist = (pos2 - pos1).magnitude();
// return false if distance is over max float, in case of cheater teleporting to the end of the universe // return false if distance is over max float, in case of cheater teleporting to the end of the universe
if (maxDist == std::numeric_limits<float>::max() || !myisfinite(maxDist)) if (maxDist == std::numeric_limits<float>::max() || !std::isfinite(maxDist))
return false; return false;
// valid map coords should *never ever* produce float overflow, but this would produce NaNs too // valid map coords should *never ever* produce float overflow, but this would produce NaNs too
+15 -100
View File
@@ -7,86 +7,19 @@
#ifndef AZEROTHCORE_COMMON_H #ifndef AZEROTHCORE_COMMON_H
#define AZEROTHCORE_COMMON_H #define AZEROTHCORE_COMMON_H
// config.h needs to be included 1st
/// @todo this thingy looks like hack, but its not, need to
// make separate header however, because It makes mess here.
#ifdef HAVE_CONFIG_H
// Remove Some things that we will define
// This is in case including another config.h
// before trinity config.h
#ifdef PACKAGE
#undef PACKAGE
#endif //PACKAGE
#ifdef PACKAGE_BUGREPORT
#undef PACKAGE_BUGREPORT
#endif //PACKAGE_BUGREPORT
#ifdef PACKAGE_NAME
#undef PACKAGE_NAME
#endif //PACKAGE_NAME
#ifdef PACKAGE_STRING
#undef PACKAGE_STRING
#endif //PACKAGE_STRING
#ifdef PACKAGE_TARNAME
#undef PACKAGE_TARNAME
#endif //PACKAGE_TARNAME
#ifdef PACKAGE_VERSION
#undef PACKAGE_VERSION
#endif //PACKAGE_VERSION
#ifdef VERSION
#undef VERSION
#endif //VERSION
# include "Config.h"
#undef PACKAGE
#undef PACKAGE_BUGREPORT
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
#undef VERSION
#endif //HAVE_CONFIG_H
#include "Define.h" #include "Define.h"
#include <array>
#include <cassert> #include <memory>
#include <cerrno>
#include <cmath>
#include <csignal>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <unordered_map>
#include <unordered_set>
#if AC_PLATFORM == AC_PLATFORM_WINDOWS
#define STRCASECMP stricmp
#else
#define STRCASECMP strcasecmp
#endif
#include <set>
#include <list>
#include <string> #include <string>
#include <map> #include <utility>
#include <queue>
#include <sstream>
#include <fstream>
#include <algorithm>
#include <vector>
#include "Threading/LockedQueue.h"
#include "Threading/Threading.h"
#include <ace/Stack_Trace.h>
#if AC_PLATFORM == AC_PLATFORM_WINDOWS #if AC_PLATFORM == AC_PLATFORM_WINDOWS
# include <ace/config-all.h>
// XP winver - needed to compile with standard leak check in MemoryLeaks.h
// uncomment later if needed
//#define _WIN32_WINNT 0x0501
#include <ws2tcpip.h> #include <ws2tcpip.h>
//#undef WIN32_WINNT #if AC_COMPILER == AC_COMPILER_INTEL
# if !defined(BOOST_ASIO_HAS_MOVE)
# define BOOST_ASIO_HAS_MOVE
# endif // !defined(BOOST_ASIO_HAS_MOVE)
# endif // if WARHEAD_COMPILER == WARHEAD_COMPILER_INTEL
#else #else
#include <sys/types.h> #include <sys/types.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
@@ -94,33 +27,16 @@
#include <netinet/in.h> #include <netinet/in.h>
#include <unistd.h> #include <unistd.h>
#include <netdb.h> #include <netdb.h>
#include <cstdlib>
#endif #endif
#if AC_COMPILER == AC_COMPILER_MICROSOFT #if AC_COMPILER == AC_COMPILER_MICROSOFT
#include <float.h>
#define I32FMT "%08I32X"
#define I64FMT "%016I64X"
#define atoll _atoi64 #define atoll _atoi64
#define vsnprintf _vsnprintf
#define llabs _abs64 #define llabs _abs64
#else #else
#define stricmp strcasecmp #define stricmp strcasecmp
#define strnicmp strncasecmp
#define I32FMT "%08X"
#define I64FMT "%016llX"
#endif #endif
using namespace std;
inline float finiteAlways(float f) { return isfinite(f) ? f : 0.0f; }
inline bool myisfinite(float f) { return isfinite(f) && !isnan(f); }
#define STRINGIZE(a) #a #define STRINGIZE(a) #a
#define MAX_NETCLIENT_PACKET_SIZE (32767 - 1) // Client hardcap: int16 with trailing zero space otherwise crash on memory free #define MAX_NETCLIENT_PACKET_SIZE (32767 - 1) // Client hardcap: int16 with trailing zero space otherwise crash on memory free
@@ -155,21 +71,20 @@ enum LocaleConstant
LOCALE_zhTW = 5, LOCALE_zhTW = 5,
LOCALE_esES = 6, LOCALE_esES = 6,
LOCALE_esMX = 7, LOCALE_esMX = 7,
LOCALE_ruRU = 8 LOCALE_ruRU = 8,
TOTAL_LOCALES
}; };
const uint8 TOTAL_LOCALES = 9;
#define DEFAULT_LOCALE LOCALE_enUS #define DEFAULT_LOCALE LOCALE_enUS
#define MAX_LOCALES 8 #define MAX_LOCALES 8
#define MAX_ACCOUNT_TUTORIAL_VALUES 8 #define MAX_ACCOUNT_TUTORIAL_VALUES 8
extern char const* localeNames[TOTAL_LOCALES]; AC_COMMON_API extern char const* localeNames[TOTAL_LOCALES];
LocaleConstant GetLocaleByName(const std::string& name); AC_COMMON_API LocaleConstant GetLocaleByName(const std::string& name);
void CleanStringForMysqlQuery(std::string& str); AC_COMMON_API void CleanStringForMysqlQuery(std::string& str);
typedef std::vector<std::string> StringVector;
// we always use stdlibc++ std::max/std::min, undefine some not C++ standard defines (Win API and some other platforms) // we always use stdlibc++ std::max/std::min, undefine some not C++ standard defines (Win API and some other platforms)
#ifdef max #ifdef max
+1 -8
View File
@@ -7,17 +7,10 @@
#ifndef ACORE_DEFINE_H #ifndef ACORE_DEFINE_H
#define ACORE_DEFINE_H #define ACORE_DEFINE_H
#include "CompilerDefs.h"
#include <cstddef> #include <cstddef>
#include <cstdint>
#include <cinttypes> #include <cinttypes>
#include <climits> #include <climits>
#include <cstring>
#include <sys/types.h>
#include "CompilerDefs.h"
#if defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__BORLANDC__)
#define OS_WIN
#endif
#define ACORE_LITTLEENDIAN 0 #define ACORE_LITTLEENDIAN 0
#define ACORE_BIGENDIAN 1 #define ACORE_BIGENDIAN 1
+2 -3
View File
@@ -11,11 +11,10 @@
#ifndef _ACORE_GEOMETRY_H #ifndef _ACORE_GEOMETRY_H
#define _ACORE_GEOMETRY_H #define _ACORE_GEOMETRY_H
#include <cmath> #include "Define.h"
#include <iostream> #include <iostream>
#include <cstdlib> #include <cstdlib>
#include <math.h>
using namespace std;
[[nodiscard]] inline float getAngle(float startX, float startY, float destX, float destY) [[nodiscard]] inline float getAngle(float startX, float startY, float destX, float destY)
{ {
+1
View File
@@ -8,6 +8,7 @@
#include "Common.h" #include "Common.h"
#include <string_view> #include <string_view>
#include <vector>
namespace acore namespace acore
{ {
+11 -7
View File
@@ -6,14 +6,18 @@
#include "Util.h" #include "Util.h"
#include "Common.h" #include "Common.h"
#include "utf8.h" #include "Containers.h"
#include "Log.h" // #include "IpAddress.h"
#include "Errors.h" #include "StringConvert.h"
#include "TypeList.h" #include "StringFormat.h"
#include "Errors.h" // for ASSERT #include <utf8.h>
#include <array> #include <algorithm>
#include <cwchar> #include <iomanip>
#include <sstream>
#include <string> #include <string>
#include <cctype>
#include <cstdarg>
#include <ctime>
#include <ace/Default_Constants.h> #include <ace/Default_Constants.h>
Tokenizer::Tokenizer(const std::string& src, const char sep, uint32 vectorReserve) Tokenizer::Tokenizer(const std::string& src, const char sep, uint32 vectorReserve)
+9 -7
View File
@@ -4,23 +4,25 @@
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*/ */
#include "AuthSocket.h"
#include "AES.h" #include "AES.h"
#include "Common.h" #include "AuthCodes.h"
#include "CryptoGenerics.h"
#include "CryptoRandom.h"
#include "CryptoHash.h"
#include "DatabaseEnv.h"
#include "ByteBuffer.h" #include "ByteBuffer.h"
#include "Common.h"
#include "Config.h" #include "Config.h"
#include "CryptoGenerics.h"
#include "CryptoHash.h"
#include "CryptoRandom.h"
#include "DatabaseEnv.h"
#include "Log.h" #include "Log.h"
#include "RealmList.h" #include "RealmList.h"
#include "AuthSocket.h"
#include "AuthCodes.h"
#include "SecretMgr.h" #include "SecretMgr.h"
#include "TOTP.h" #include "TOTP.h"
#include "Threading.h"
#include <algorithm> #include <algorithm>
#include <openssl/crypto.h> #include <openssl/crypto.h>
#include <openssl/md5.h> #include <openssl/md5.h>
#include <sstream>
#define ChunkSize 2048 #define ChunkSize 2048
+2 -1
View File
@@ -12,9 +12,10 @@
#include "Optional.h" #include "Optional.h"
#include "RealmSocket.h" #include "RealmSocket.h"
#include "SRP6.h" #include "SRP6.h"
#include <mutex>
class ACE_INET_Addr; class ACE_INET_Addr;
class Fields; class Field;
struct Realm; struct Realm;
enum eStatus enum eStatus
@@ -10,6 +10,7 @@
#include "Duration.h" #include "Duration.h"
#include <mysqld_error.h> #include <mysqld_error.h>
#include <errmsg.h> #include <errmsg.h>
#include <thread>
template <class T> template <class T>
DatabaseLoader& DatabaseLoader::AddDatabase(DatabaseWorkerPool<T>& pool, std::string const& name) DatabaseLoader& DatabaseLoader::AddDatabase(DatabaseWorkerPool<T>& pool, std::string const& name)
@@ -7,6 +7,7 @@
#include "PreparedStatement.h" #include "PreparedStatement.h"
#include "MySQLConnection.h" #include "MySQLConnection.h"
#include "Log.h" #include "Log.h"
#include <sstream>
PreparedStatement::PreparedStatement(uint32 index) : PreparedStatement::PreparedStatement(uint32 index) :
m_stmt(nullptr), m_stmt(nullptr),
@@ -161,4 +161,5 @@ protected:
bool m_has_result; bool m_has_result;
PreparedQueryResultFuture m_result; PreparedQueryResultFuture m_result;
}; };
#endif #endif
+2 -2
View File
@@ -7,9 +7,9 @@
#ifndef _TRANSACTION_H #ifndef _TRANSACTION_H
#define _TRANSACTION_H #define _TRANSACTION_H
#include <utility>
#include "SQLOperation.h" #include "SQLOperation.h"
#include <list>
#include <utility>
//- Forward declare (don't include header to prevent circular includes) //- Forward declare (don't include header to prevent circular includes)
class PreparedStatement; class PreparedStatement;
+2 -2
View File
@@ -98,9 +98,9 @@ namespace FactorySelector
/* if (mv_factory == nullptr) /* if (mv_factory == nullptr)
{ {
int best_val = -1; int best_val = -1;
StringVector l; std::vector<std::string> l;
mv_registry.GetRegisteredItems(l); mv_registry.GetRegisteredItems(l);
for (StringVector::iterator iter = l.begin(); iter != l.end(); ++iter) for (std::vector<std::string>::iterator iter = l.begin(); iter != l.end(); ++iter)
{ {
const MovementGeneratorCreator *factory = mv_registry.GetRegistryItem((*iter).c_str()); const MovementGeneratorCreator *factory = mv_registry.GetRegistryItem((*iter).c_str());
const SelectableMovement *p = dynamic_cast<const SelectableMovement *>(factory); const SelectableMovement *p = dynamic_cast<const SelectableMovement *>(factory);
@@ -233,8 +233,8 @@ typedef std::map<uint32, AchievementReward> AchievementRewards;
struct AchievementRewardLocale struct AchievementRewardLocale
{ {
StringVector Subject; std::vector<std::string> Subject;
StringVector Text; std::vector<std::string> Text;
}; };
typedef std::map<uint32, AchievementRewardLocale> AchievementRewardLocales; typedef std::map<uint32, AchievementRewardLocale> AchievementRewardLocales;
+1
View File
@@ -8,6 +8,7 @@
#define AZEROTHCORE_CHATLINK_H #define AZEROTHCORE_CHATLINK_H
#include "SharedDefines.h" #include "SharedDefines.h"
#include <cstring>
#include <list> #include <list>
#include <sstream> #include <sstream>
+1
View File
@@ -11,6 +11,7 @@
#include "DBCStore.h" #include "DBCStore.h"
#include "DBCStructure.h" #include "DBCStructure.h"
#include <list> #include <list>
#include <unordered_map>
typedef std::list<uint32> SimpleFactionsList; typedef std::list<uint32> SimpleFactionsList;
typedef std::vector<FlyByCamera> FlyByCameraCollection; typedef std::vector<FlyByCamera> FlyByCameraCollection;
+2 -1
View File
@@ -12,8 +12,9 @@
#include "ObjectGuid.h" #include "ObjectGuid.h"
#include "SharedDefines.h" #include "SharedDefines.h"
#include "WorldPacket.h" #include "WorldPacket.h"
#include <array> #include <array>
#include <map>
#include <sstream>
namespace lfg namespace lfg
{ {
@@ -224,19 +224,19 @@ typedef std::unordered_map<uint16, CreatureBaseStats> CreatureBaseStatsContainer
struct CreatureLocale struct CreatureLocale
{ {
StringVector Name; std::vector<std::string> Name;
StringVector Title; std::vector<std::string> Title;
}; };
struct GossipMenuItemsLocale struct GossipMenuItemsLocale
{ {
StringVector OptionText; std::vector<std::string> OptionText;
StringVector BoxText; std::vector<std::string> BoxText;
}; };
struct PointOfInterestLocale struct PointOfInterestLocale
{ {
StringVector Name; std::vector<std::string> Name;
}; };
struct EquipmentInfo struct EquipmentInfo
@@ -662,8 +662,8 @@ union GameObjectValue
struct GameObjectLocale struct GameObjectLocale
{ {
StringVector Name; std::vector<std::string> Name;
StringVector CastBarCaption; std::vector<std::string> CastBarCaption;
}; };
// `gameobject_addon` table // `gameobject_addon` table
+3 -3
View File
@@ -824,8 +824,8 @@ typedef std::unordered_map<uint32, ItemTemplate> ItemTemplateContainer;
struct ItemLocale struct ItemLocale
{ {
StringVector Name; std::vector<std::string> Name;
StringVector Description; std::vector<std::string> Description;
}; };
struct ItemSetNameEntry struct ItemSetNameEntry
@@ -836,7 +836,7 @@ struct ItemSetNameEntry
struct ItemSetNameLocale struct ItemSetNameLocale
{ {
StringVector Name; std::vector<std::string> Name;
}; };
#endif #endif
@@ -7,8 +7,8 @@
#ifndef _OBJECT_POS_SELECTOR_H #ifndef _OBJECT_POS_SELECTOR_H
#define _OBJECT_POS_SELECTOR_H #define _OBJECT_POS_SELECTOR_H
#include<Common.h> #include "Define.h"
#include <math.h>
#include <map> #include <map>
enum UsedPosType { USED_POS_PLUS, USED_POS_MINUS }; enum UsedPosType { USED_POS_PLUS, USED_POS_MINUS };
@@ -27001,6 +27001,8 @@ void Player::_SaveCharacter(bool create, SQLTransaction& trans)
PreparedStatement* stmt = nullptr; PreparedStatement* stmt = nullptr;
uint8 index = 0; uint8 index = 0;
auto finiteAlways = [](float f) { return std::isfinite(f) ? f : 0.0f; };
if (create) if (create)
{ {
//! Insert query //! Insert query
-5
View File
@@ -3924,9 +3924,6 @@ void Unit::HandleSafeUnitPointersOnDelete(Unit* thisUnit)
for (std::set<SafeUnitPointer*>::iterator itr = thisUnit->SafeUnitPointerSet.begin(); itr != thisUnit->SafeUnitPointerSet.end(); ++itr) for (std::set<SafeUnitPointer*>::iterator itr = thisUnit->SafeUnitPointerSet.begin(); itr != thisUnit->SafeUnitPointerSet.end(); ++itr)
(*itr)->UnitDeleted(); (*itr)->UnitDeleted();
thisUnit->SafeUnitPointerSet.clear(); thisUnit->SafeUnitPointerSet.clear();
ACE_Stack_Trace trace(0, 50);
LOG_INFO("misc", "Unit::HandleSafeUnitPointersOnDelete CALL STACK (1):\n%s\n", trace.c_str());
} }
bool Unit::IsInWater(bool allowAbove) const bool Unit::IsInWater(bool allowAbove) const
@@ -17604,8 +17601,6 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
if (!charmer->IsInWorld() || charmer->IsDuringRemoveFromWorld()) if (!charmer->IsInWorld() || charmer->IsDuringRemoveFromWorld())
{ {
ACE_Stack_Trace trace(0, 50);
LOG_INFO("misc", "Unit::SetCharmedBy CALL STACK (1):\n%s\n", trace.c_str());
return false; return false;
} }
+1
View File
@@ -10,6 +10,7 @@
#include "Common.h" #include "Common.h"
#include "ObjectGuid.h" #include "ObjectGuid.h"
#include "SharedDefines.h" #include "SharedDefines.h"
#include <map>
#define max_ge_check_delay DAY // 1 day in seconds #define max_ge_check_delay DAY // 1 day in seconds
+3 -3
View File
@@ -361,7 +361,7 @@ ObjectMgr* ObjectMgr::instance()
return &instance; return &instance;
} }
void ObjectMgr::AddLocaleString(std::string&& s, LocaleConstant locale, StringVector& data) void ObjectMgr::AddLocaleString(std::string&& s, LocaleConstant locale, std::vector<std::string>& data)
{ {
if (!s.empty()) if (!s.empty())
{ {
@@ -6893,8 +6893,8 @@ void ObjectMgr::LoadPetNumber()
std::string ObjectMgr::GeneratePetName(uint32 entry) std::string ObjectMgr::GeneratePetName(uint32 entry)
{ {
StringVector& list0 = _petHalfName0[entry]; std::vector<std::string>& list0 = _petHalfName0[entry];
StringVector& list1 = _petHalfName1[entry]; std::vector<std::string>& list1 = _petHalfName1[entry];
if (list0.empty() || list1.empty()) if (list0.empty() || list1.empty())
{ {
+6 -6
View File
@@ -429,8 +429,8 @@ struct BroadcastText
uint32 Id{0}; uint32 Id{0};
uint32 Language{0}; uint32 Language{0};
StringVector MaleText; std::vector<std::string> MaleText;
StringVector FemaleText; std::vector<std::string> FemaleText;
uint32 EmoteId0{0}; uint32 EmoteId0{0};
uint32 EmoteId1{0}; uint32 EmoteId1{0};
uint32 EmoteId2{0}; uint32 EmoteId2{0};
@@ -483,7 +483,7 @@ typedef std::unordered_map<uint32/*(mapid, spawnMode) pair*/, CellObjectGuidsMap
struct AcoreString struct AcoreString
{ {
StringVector Content; std::vector<std::string> Content;
}; };
typedef std::map<ObjectGuid, ObjectGuid> LinkedRespawnContainer; typedef std::map<ObjectGuid, ObjectGuid> LinkedRespawnContainer;
@@ -1326,8 +1326,8 @@ public:
return _gossipMenuItemsStore.equal_range(uiMenuId); return _gossipMenuItemsStore.equal_range(uiMenuId);
} }
static void AddLocaleString(std::string&& s, LocaleConstant locale, StringVector& data); static void AddLocaleString(std::string&& s, LocaleConstant locale, std::vector<std::string>& data);
static inline void GetLocaleString(const StringVector& data, int loc_idx, std::string& value) static inline void GetLocaleString(const std::vector<std::string>& data, int loc_idx, std::string& value)
{ {
if (data.size() > size_t(loc_idx) && !data[loc_idx].empty()) if (data.size() > size_t(loc_idx) && !data[loc_idx].empty())
value = data[loc_idx]; value = data[loc_idx];
@@ -1451,7 +1451,7 @@ private:
typedef std::map<uint32, int32> FishingBaseSkillContainer; // [areaId][base skill level] typedef std::map<uint32, int32> FishingBaseSkillContainer; // [areaId][base skill level]
FishingBaseSkillContainer _fishingBaseForAreaStore; FishingBaseSkillContainer _fishingBaseForAreaStore;
typedef std::map<uint32, StringVector> HalfNameContainer; typedef std::map<uint32, std::vector<std::string>> HalfNameContainer;
HalfNameContainer _petHalfName0; HalfNameContainer _petHalfName0;
HalfNameContainer _petHalfName1; HalfNameContainer _petHalfName1;
+2 -2
View File
@@ -204,7 +204,7 @@ namespace acore
inline bool IsValidMapCoord(float c) inline bool IsValidMapCoord(float c)
{ {
return isfinite(c) && (std::fabs(c) <= MAP_HALFSIZE - 0.5f); return std::isfinite(c) && (std::fabs(c) <= MAP_HALFSIZE - 0.5f);
} }
inline bool IsValidMapCoord(float x, float y) inline bool IsValidMapCoord(float x, float y)
@@ -219,7 +219,7 @@ namespace acore
inline bool IsValidMapCoord(float x, float y, float z, float o) inline bool IsValidMapCoord(float x, float y, float z, float o)
{ {
return IsValidMapCoord(x, y, z) && isfinite(o); return IsValidMapCoord(x, y, z) && std::isfinite(o);
} }
} }
#endif #endif
+6 -3
View File
@@ -7,6 +7,9 @@
#ifndef __NPCHANDLER_H #ifndef __NPCHANDLER_H
#define __NPCHANDLER_H #define __NPCHANDLER_H
#include "Define.h"
#include <vector>
struct QEmote struct QEmote
{ {
uint32 _Emote; uint32 _Emote;
@@ -34,14 +37,14 @@ struct GossipText
struct PageTextLocale struct PageTextLocale
{ {
StringVector Text; std::vector<std::string> Text;
}; };
struct NpcTextLocale struct NpcTextLocale
{ {
NpcTextLocale() { Text_0.resize(8); Text_1.resize(8); } NpcTextLocale() { Text_0.resize(8); Text_1.resize(8); }
std::vector<StringVector> Text_0; std::vector<std::vector<std::string>> Text_0;
std::vector<StringVector> Text_1; std::vector<std::vector<std::string>> Text_1;
}; };
#endif #endif
+1
View File
@@ -15,6 +15,7 @@
#include "SharedDefines.h" #include "SharedDefines.h"
#include <list> #include <list>
#include <map> #include <map>
#include <unordered_map>
#include <vector> #include <vector>
enum RollType enum RollType
@@ -5,6 +5,7 @@
#include "EventProcessor.h" #include "EventProcessor.h"
#include "WorldPacket.h" #include "WorldPacket.h"
#include "ObjectGuid.h" #include "ObjectGuid.h"
#include <mutex>
class AuctionListOwnerItemsDelayEvent : public BasicEvent class AuctionListOwnerItemsDelayEvent : public BasicEvent
{ {
+1
View File
@@ -2,6 +2,7 @@
#define __AVGDIFFTRACKER_H #define __AVGDIFFTRACKER_H
#include "Common.h" #include "Common.h"
#include <cstring>
#define AVG_DIFF_COUNT 500 #define AVG_DIFF_COUNT 500
+2
View File
@@ -3,6 +3,8 @@
#include "Common.h" #include "Common.h"
#include "SharedDefines.h" #include "SharedDefines.h"
#include <map>
#include <unordered_map>
struct GraveyardStruct struct GraveyardStruct
{ {
+2
View File
@@ -2,6 +2,8 @@
#define __SAVINGSYSTEM_H #define __SAVINGSYSTEM_H
#include "Common.h" #include "Common.h"
#include <list>
#include <mutex>
// to evenly distribute saving players to db // to evenly distribute saving players to db
+8 -8
View File
@@ -165,14 +165,14 @@ struct QuestLocale
{ {
QuestLocale() { ObjectiveText.resize(QUEST_OBJECTIVES_COUNT); } QuestLocale() { ObjectiveText.resize(QUEST_OBJECTIVES_COUNT); }
StringVector Title; std::vector<std::string> Title;
StringVector Details; std::vector<std::string> Details;
StringVector Objectives; std::vector<std::string> Objectives;
StringVector OfferRewardText; std::vector<std::string> OfferRewardText;
StringVector RequestItemsText; std::vector<std::string> RequestItemsText;
StringVector AreaDescription; std::vector<std::string> AreaDescription;
StringVector CompletedText; std::vector<std::string> CompletedText;
std::vector< StringVector > ObjectiveText; std::vector< std::vector<std::string> > ObjectiveText;
}; };
struct QuestRequestItemsLocale struct QuestRequestItemsLocale
+1 -1
View File
@@ -40,7 +40,7 @@ struct CreatureTextEntry
struct CreatureTextLocale struct CreatureTextLocale
{ {
StringVector Text; std::vector<std::string> Text;
}; };
struct CreatureTextId struct CreatureTextId
+1
View File
@@ -14,6 +14,7 @@
#include "Callback.h" #include "Callback.h"
#include "Common.h" #include "Common.h"
#include "IWorld.h" #include "IWorld.h"
#include "LockedQueue.h"
#include "ObjectGuid.h" #include "ObjectGuid.h"
#include "QueryResult.h" #include "QueryResult.h"
#include "SharedDefines.h" #include "SharedDefines.h"
@@ -7,6 +7,7 @@
#include "blackrock_depths.h" #include "blackrock_depths.h"
#include "ScriptedCreature.h" #include "ScriptedCreature.h"
#include "ScriptMgr.h" #include "ScriptMgr.h"
#include <vector>
enum Spells enum Spells
{ {
@@ -38,7 +39,7 @@ const Position SummonPositions[7] =
{1012.252747f, -206.696487f, -61.980618f, 3.617599f}, {1012.252747f, -206.696487f, -61.980618f, 3.617599f},
}; };
vector<int> gobjectDwarfRunesEntry { 170578, 170579, 170580, 170581, 170582, 170583, 170584 }; std::vector<int> gobjectDwarfRunesEntry { 170578, 170579, 170580, 170581, 170582, 170583, 170584 };
class boss_ambassador_flamelash : public CreatureScript class boss_ambassador_flamelash : public CreatureScript
{ {
@@ -60,7 +61,7 @@ public:
SummonList summons; SummonList summons;
// This will allow to find a valid position to spawn them // This will allow to find a valid position to spawn them
vector<int> validPosition; std::vector<int> validPosition;
bool foundValidPosition = false; bool foundValidPosition = false;
void JustSummoned(Creature* cr) override { summons.Summon(cr); } void JustSummoned(Creature* cr) override { summons.Summon(cr); }
@@ -131,7 +131,7 @@ public:
} }
} }
counter = 0; counter = 0;
list<Unit*, std::allocator<Unit*>>::iterator itr; std::list<Unit*, std::allocator<Unit*>>::iterator itr;
for (itr = meleeRangeTargets.begin(); itr != meleeRangeTargets.end(); ++itr, ++counter) for (itr = meleeRangeTargets.begin(); itr != meleeRangeTargets.end(); ++itr, ++counter)
{ {
// if there is only one target available // if there is only one target available
+1
View File
@@ -12,6 +12,7 @@
#include "Errors.h" #include "Errors.h"
#include <G3D/AABox.h> #include <G3D/AABox.h>
#include <G3D/Vector3.h> #include <G3D/Vector3.h>
#include <cstring>
#include <vector> #include <vector>
// Structures for M4 file. Source: https://wowdev.wiki // Structures for M4 file. Source: https://wowdev.wiki
+3 -2
View File
@@ -7,11 +7,12 @@
#ifndef ACORE_DBCSTRUCTURE_H #ifndef ACORE_DBCSTRUCTURE_H
#define ACORE_DBCSTRUCTURE_H #define ACORE_DBCSTRUCTURE_H
#include "Common.h"
#include "DBCEnums.h"
#include "Define.h" #include "Define.h"
#include "DBCEnums.h"
#include "SharedDefines.h" #include "SharedDefines.h"
#include "Util.h" #include "Util.h"
#include <set>
#include <map>
// Structures using to access raw DBC data and required packing to portability // Structures using to access raw DBC data and required packing to portability
@@ -11,6 +11,8 @@
#ifndef __CLIRUNNABLE_H #ifndef __CLIRUNNABLE_H
#define __CLIRUNNABLE_H #define __CLIRUNNABLE_H
#include "Threading.h"
/// Command Line Interface handling thread /// Command Line Interface handling thread
class CliRunnable : public acore::Runnable class CliRunnable : public acore::Runnable
{ {
@@ -12,6 +12,7 @@
#define _ACORE_RARUNNABLE_H_ #define _ACORE_RARUNNABLE_H_
#include "Common.h" #include "Common.h"
#include "Threading.h"
#include <ace/Reactor.h> #include <ace/Reactor.h>
class RARunnable : public acore::Runnable class RARunnable : public acore::Runnable
@@ -11,6 +11,8 @@
#ifndef __WORLDRUNNABLE_H #ifndef __WORLDRUNNABLE_H
#define __WORLDRUNNABLE_H #define __WORLDRUNNABLE_H
#include "Threading.h"
/// Heartbeat thread for the World /// Heartbeat thread for the World
class WorldRunnable : public acore::Runnable class WorldRunnable : public acore::Runnable
{ {
+5 -2
View File
@@ -13,11 +13,14 @@
#ifndef _WIN32 #ifndef _WIN32
#include <cstddef> #include <cstddef>
#include <cstring>
#include <dirent.h> #include <dirent.h>
#else
#include <Windows.h>
#endif #endif
#ifdef __linux__ #ifndef _WIN32
#include <errno.h> #include <cerrno>
#endif #endif
namespace MMAP namespace MMAP