refactor(Core): rename namespaces and macros to acore (#2454)

This commit is contained in:
Viste
2019-12-01 15:13:31 +03:00
committed by Francesco Borzì
parent e19e95e5d0
commit e22d78ecd6
278 changed files with 1292 additions and 1309 deletions

View File

@@ -34,7 +34,7 @@ add_executable(worldserver
if(NOT WIN32)
set_target_properties(worldserver PROPERTIES
COMPILE_DEFINITIONS _TRINITY_CORE_CONFIG="${CONF_DIR}/worldserver.conf")
COMPILE_DEFINITIONS _ACORE_CORE_CONFIG="${CONF_DIR}/worldserver.conf")
endif()
add_dependencies(worldserver revision.h)

View File

@@ -12,7 +12,7 @@
#define __CLIRUNNABLE_H
/// Command Line Interface handling thread
class CliRunnable : public ACORE::Runnable
class CliRunnable : public acore::Runnable
{
public:
void run();

View File

@@ -19,8 +19,8 @@
#include "Log.h"
#include "Master.h"
#ifndef _TRINITY_CORE_CONFIG
# define _TRINITY_CORE_CONFIG "worldserver.conf"
#ifndef _ACORE_CORE_CONFIG
# define _ACORE_CORE_CONFIG "worldserver.conf"
#endif
#ifdef _WIN32
@@ -61,7 +61,7 @@ void usage(const char* prog)
extern int main(int argc, char** argv)
{
///- Command line parsing to get the configuration file name
char const* cfg_file = _TRINITY_CORE_CONFIG;
char const* cfg_file = _ACORE_CORE_CONFIG;
int c = 1;
while (c < argc)
{
@@ -118,7 +118,7 @@ extern int main(int argc, char** argv)
++c;
}
std::string cfg_def_file=_TRINITY_CORE_CONFIG;
std::string cfg_def_file=_ACORE_CORE_CONFIG;
cfg_def_file += ".dist";
if (!sConfigMgr->LoadInitial(cfg_def_file.c_str())) {

View File

@@ -46,7 +46,7 @@ extern int m_ServiceStatus;
#endif
/// Handle worldservers's termination signals
class WorldServerSignalHandler : public Trinity::SignalHandler
class WorldServerSignalHandler : public acore::SignalHandler
{
public:
virtual void HandleSignal(int sigNum)
@@ -71,7 +71,7 @@ class WorldServerSignalHandler : public Trinity::SignalHandler
}
};
class FreezeDetectorRunnable : public ACORE::Runnable
class FreezeDetectorRunnable : public acore::Runnable
{
private:
uint32 _loops;
@@ -101,7 +101,7 @@ public:
ABORT();
}
ACORE::Thread::Sleep(1000);
acore::Thread::Sleep(1000);
}
sLog->outString("Anti-freeze thread exiting without problems.");
}
@@ -176,10 +176,10 @@ int Master::Run()
//handle.register_handler(SIGSEGV, &signalSEGV);
///- 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 = NULL;
acore::Thread* cliThread = NULL;
#ifdef _WIN32
if (sConfigMgr->GetBoolDefault("Console.Enable", true) && (m_ServiceStatus == -1)/* need disable console in service mode*/)
@@ -188,14 +188,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__)
@@ -267,21 +267,21 @@ int Master::Run()
#endif
// Start soap serving thread
ACORE::Thread* soapThread = NULL;
acore::Thread* soapThread = NULL;
if (sConfigMgr->GetBoolDefault("SOAP.Enabled", false))
{
TCSoapRunnable* runnable = new TCSoapRunnable();
runnable->SetListenArguments(sConfigMgr->GetStringDefault("SOAP.IP", "127.0.0.1"), uint16(sConfigMgr->GetIntDefault("SOAP.Port", 7878)));
soapThread = new ACORE::Thread(runnable);
soapThread = new acore::Thread(runnable);
}
// Start up freeze catcher thread
ACORE::Thread* freezeThread = NULL;
acore::Thread* freezeThread = NULL;
if (uint32 freezeDelay = sConfigMgr->GetIntDefault("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

View File

@@ -8,14 +8,14 @@
/// @{
/// \file
#ifndef _TRINITY_RARUNNABLE_H_
#define _TRINITY_RARUNNABLE_H_
#ifndef _ACORE_RARUNNABLE_H_
#define _ACORE_RARUNNABLE_H_
#include "Common.h"
#include <ace/Reactor.h>
class RARunnable : public ACORE::Runnable
class RARunnable : public acore::Runnable
{
public:
RARunnable();
@@ -27,6 +27,6 @@ private:
};
#endif /* _TRINITY_RARUNNABLE_H_ */
#endif /* _ACORE_RARUNNABLE_H_ */
/// @}

View File

@@ -14,7 +14,7 @@
#include <ace/Task.h>
#include <Threading.h>
class TCSoapRunnable : public ACORE::Runnable
class TCSoapRunnable : public acore::Runnable
{
public:
TCSoapRunnable() : _port(0) { }

View File

@@ -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)
@@ -97,10 +97,10 @@ void AuctionListingRunnable::run()
if (AsyncAuctionListingMgr::GetTempList().size() || AsyncAuctionListingMgr::GetList().size())
{
TRINITY_GUARD(ACE_Thread_Mutex, AsyncAuctionListingMgr::GetLock());
ACORE_GUARD(ACE_Thread_Mutex, AsyncAuctionListingMgr::GetLock());
{
TRINITY_GUARD(ACE_Thread_Mutex, AsyncAuctionListingMgr::GetTempLock());
ACORE_GUARD(ACE_Thread_Mutex, AsyncAuctionListingMgr::GetTempLock());
for (std::list<AuctionListItemsDelayEvent>::iterator itr = AsyncAuctionListingMgr::GetTempList().begin(); itr != AsyncAuctionListingMgr::GetTempList().end(); ++itr)
AsyncAuctionListingMgr::GetList().push_back( (*itr) );
AsyncAuctionListingMgr::GetTempList().clear();
@@ -123,7 +123,7 @@ void AuctionListingRunnable::run()
}
}
}
ACORE::Thread::Sleep(1);
acore::Thread::Sleep(1);
}
sLog->outString("Auction House Listing thread exiting without problems.");
}

View File

@@ -12,13 +12,13 @@
#define __WORLDRUNNABLE_H
/// Heartbeat thread for the World
class WorldRunnable : public ACORE::Runnable
class WorldRunnable : public acore::Runnable
{
public:
void run();
};
class AuctionListingRunnable : public ACORE::Runnable
class AuctionListingRunnable : public acore::Runnable
{
public:
void run();