diff --git a/src/server/game/Server/WorldSocketMgr.cpp b/src/server/game/Server/WorldSocketMgr.cpp index 2b5b96e61..54a5643cc 100644 --- a/src/server/game/Server/WorldSocketMgr.cpp +++ b/src/server/game/Server/WorldSocketMgr.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include "Log.h" @@ -92,7 +93,7 @@ class ReactorRunnable : protected ACE_Task_Base long Connections() { - return static_cast (m_Connections); + return m_Connections; } int AddSocket (WorldSocket* sock) diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index adde6d044..1ed8956f3 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -83,7 +83,7 @@ #include "LuaEngine.h" #endif -ACE_Atomic_Op World::m_stopEvent = false; +std::atomic_long World::m_stopEvent = false; uint8 World::m_ExitCode = SHUTDOWN_EXIT_CODE; uint32 World::m_worldLoopCounter = 0; uint32 World::m_gameMSTime = 0; @@ -2616,7 +2616,7 @@ void World::ShutdownMsg(bool show, Player* player) void World::ShutdownCancel() { // nothing cancel or too later - if (!m_ShutdownTimer || m_stopEvent.value()) + if (!m_ShutdownTimer || m_stopEvent) return; ServerMessageType msgid = (m_ShutdownMask & SHUTDOWN_MASK_RESTART) ? SERVER_MSG_RESTART_CANCELLED : SERVER_MSG_SHUTDOWN_CANCELLED; diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index cad13d9b8..e8a09cd5e 100644 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -13,7 +13,6 @@ #include "Common.h" #include "Timer.h" -#include #include "SharedDefines.h" #include "QueryResult.h" #include "Callback.h" @@ -21,6 +20,7 @@ #include #include #include +#include class Object; class WorldPacket; @@ -395,7 +395,7 @@ enum Rates RATE_DROP_ITEM_LEGENDARY, RATE_DROP_ITEM_ARTIFACT, RATE_DROP_ITEM_REFERENCED, - + RATE_DROP_ITEM_REFERENCED_AMOUNT, RATE_SELLVALUE_ITEM_POOR, RATE_SELLVALUE_ITEM_NORMAL, @@ -723,7 +723,7 @@ class World void ShutdownMsg(bool show = false, Player* player = nullptr); static uint8 GetExitCode() { return m_ExitCode; } static void StopNow(uint8 exitcode) { m_stopEvent = true; m_ExitCode = exitcode; } - static bool IsStopped() { return m_stopEvent.value(); } + static bool IsStopped() { return m_stopEvent; } void Update(uint32 diff); @@ -856,7 +856,7 @@ class World void CalendarDeleteOldEvents(); void ResetGuildCap(); private: - static ACE_Atomic_Op m_stopEvent; + static std::atomic_long m_stopEvent; static uint8 m_ExitCode; uint32 m_ShutdownTimer; uint32 m_ShutdownMask; diff --git a/src/server/worldserver/RemoteAccess/RASocket.cpp b/src/server/worldserver/RemoteAccess/RASocket.cpp index fc9f86cfc..dd7f900fc 100644 --- a/src/server/worldserver/RemoteAccess/RASocket.cpp +++ b/src/server/worldserver/RemoteAccess/RASocket.cpp @@ -48,7 +48,7 @@ int RASocket::handle_close(ACE_HANDLE /*handle*/, ACE_Reactor_Mask /*mask*/) // While the above wait() will wait for the ::svc() to finish, it will not wait for the async event // RASocket::commandfinished to be completed. Calling destroy() before the latter function ends // will lead to using a freed pointer -> crash. - while (_commandExecuting.value()) + while (_commandExecuting) ACE_OS::sleep(1); destroy(); diff --git a/src/server/worldserver/RemoteAccess/RASocket.h b/src/server/worldserver/RemoteAccess/RASocket.h index 0284cddb3..2956fae0f 100644 --- a/src/server/worldserver/RemoteAccess/RASocket.h +++ b/src/server/worldserver/RemoteAccess/RASocket.h @@ -17,6 +17,7 @@ #include #include #include +#include /// Remote Administration socket class RASocket : public ACE_Svc_Handler @@ -44,7 +45,7 @@ class RASocket : public ACE_Svc_Handler private: uint8 _minLevel; ///< Minimum security level required to connect - ACE_Atomic_Op _commandExecuting; + std::atomic_long _commandExecuting; }; #endif