feat(Core/Config): rework config and delete ACE inherited (#4608)

This commit is contained in:
Kargatum
2021-02-28 20:37:03 +07:00
committed by GitHub
parent c2f274e06d
commit dbefa17a53
36 changed files with 1340 additions and 816 deletions

View File

@@ -36,11 +36,6 @@ add_executable(authserver
add_dependencies(authserver revision.h)
if(NOT WIN32)
set_target_properties(authserver PROPERTIES
COMPILE_DEFINITIONS _ACORE_REALM_CONFIG="${CONF_DIR}/authserver.conf")
endif()
target_link_libraries(authserver
PUBLIC
shared)
@@ -62,28 +57,15 @@ set_target_properties(authserver
FOLDER
"server")
if( WIN32 )
if ( MSVC )
add_custom_command(TARGET authserver
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/authserver.conf.dist ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/
)
elseif ( MINGW )
add_custom_command(TARGET authserver
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/authserver.conf.dist ${CMAKE_BINARY_DIR}/bin/
)
endif()
endif()
# Install config
CopyDefaultConfig(authserver)
if( UNIX )
if ( UNIX )
install(TARGETS authserver DESTINATION bin)
elseif( WIN32 )
elseif ( WIN32 )
install(TARGETS authserver DESTINATION "${CMAKE_INSTALL_PREFIX}")
endif()
install(FILES authserver.conf.dist DESTINATION ${CONF_DIR})
# Generate precompiled header
if (USE_COREPCH)
add_cxx_pch(authserver ${PRIVATE_PCH_HEADER})

View File

@@ -74,7 +74,7 @@ void usage(const char* prog)
extern int main(int argc, char** argv)
{
// Command line parsing to get the configuration file name
char const* configFile = _ACORE_REALM_CONFIG;
std::string configFile = sConfigMgr->GetConfigPath() + std::string(_ACORE_REALM_CONFIG);
int count = 1;
while (count < argc)
{
@@ -92,9 +92,10 @@ extern int main(int argc, char** argv)
++count;
}
sConfigMgr->SetConfigList(std::string(configFile));
// Add file and args in config
sConfigMgr->Configure(configFile, std::vector<std::string>(argv, argv + argc));
if (!sConfigMgr->LoadAppConfigs("authserver"))
if (!sConfigMgr->LoadAppConfigs())
return 1;
sLog->outString("%s (authserver)", GitRevision::GetFullVersion());
@@ -115,7 +116,7 @@ extern int main(int argc, char** argv)
sLog->outString(" AzerothCore 3.3.5a - www.azerothcore.org\n");
sLog->outString("Using configuration file %s.", configFile);
sLog->outString("Using configuration file %s.", configFile.c_str());
sLog->outDetail("%s (Library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
@@ -128,7 +129,7 @@ extern int main(int argc, char** argv)
sLog->outBasic("Max allowed open files is %d", ACE::max_handles());
// authserver PID file creation
std::string pidFile = sConfigMgr->GetStringDefault("PidFile", "");
std::string pidFile = sConfigMgr->GetOption<std::string>("PidFile", "");
if (!pidFile.empty())
{
if (uint32 pid = CreatePIDFile(pidFile))
@@ -149,7 +150,7 @@ extern int main(int argc, char** argv)
sLog->SetRealmID(0); // ensure we've set realm to 0 (authserver realmid)
// Get the list of realms for the server
sRealmList->Initialize(sConfigMgr->GetIntDefault("RealmsStateUpdateDelay", 20));
sRealmList->Initialize(sConfigMgr->GetOption<int32>("RealmsStateUpdateDelay", 20));
if (sRealmList->size() == 0)
{
sLog->outError("No valid realms specified.");
@@ -159,14 +160,14 @@ extern int main(int argc, char** argv)
// Launch the listening network socket
RealmAcceptor acceptor;
int32 rmport = sConfigMgr->GetIntDefault("RealmServerPort", 3724);
int32 rmport = sConfigMgr->GetOption<int32>("RealmServerPort", 3724);
if (rmport < 0 || rmport > 0xFFFF)
{
sLog->outError("The specified RealmServerPort (%d) is out of the allowed range (1-65535)", rmport);
return 1;
}
std::string bind_ip = sConfigMgr->GetStringDefault("BindIP", "0.0.0.0");
std::string bind_ip = sConfigMgr->GetOption<std::string>("BindIP", "0.0.0.0");
ACE_INET_Addr bind_addr(uint16(rmport), bind_ip.c_str());
@@ -189,8 +190,8 @@ extern int main(int argc, char** argv)
#if defined(_WIN32) || defined(__linux__)
///- Handle affinity for multiple processors and process priority
uint32 affinity = sConfigMgr->GetIntDefault("UseProcessors", 0);
bool highPriority = sConfigMgr->GetBoolDefault("ProcessPriority", false);
uint32 affinity = sConfigMgr->GetOption<int32>("UseProcessors", 0);
bool highPriority = sConfigMgr->GetOption<bool>("ProcessPriority", false);
#ifdef _WIN32 // Windows
@@ -255,11 +256,11 @@ extern int main(int argc, char** argv)
#endif
// maximum counter for next ping
uint32 numLoops = (sConfigMgr->GetIntDefault("MaxPingTime", 30) * (MINUTE * 1000000 / 100000));
uint32 numLoops = (sConfigMgr->GetOption<int32>("MaxPingTime", 30) * (MINUTE * 1000000 / 100000));
uint32 loopCounter = 0;
// possibly enable db logging; avoid massive startup spam by doing it here.
if (sConfigMgr->GetBoolDefault("EnableLogDB", false))
if (sConfigMgr->GetOption<bool>("EnableLogDB", false))
{
sLog->outString("Enabling database logging...");
sLog->SetLogDB(true);
@@ -294,21 +295,21 @@ bool StartDB()
{
MySQL::Library_Init();
std::string dbstring = sConfigMgr->GetStringDefault("LoginDatabaseInfo", "");
std::string dbstring = sConfigMgr->GetOption<std::string>("LoginDatabaseInfo", "");
if (dbstring.empty())
{
sLog->outError("Database not specified");
return false;
}
int32 worker_threads = sConfigMgr->GetIntDefault("LoginDatabase.WorkerThreads", 1);
int32 worker_threads = sConfigMgr->GetOption<int32>("LoginDatabase.WorkerThreads", 1);
if (worker_threads < 1 || worker_threads > 32)
{
sLog->outError("Improper value specified for LoginDatabase.WorkerThreads, defaulting to 1.");
worker_threads = 1;
}
int32 synch_threads = sConfigMgr->GetIntDefault("LoginDatabase.SynchThreads", 1);
int32 synch_threads = sConfigMgr->GetOption<int32>("LoginDatabase.SynchThreads", 1);
if (synch_threads < 1 || synch_threads > 32)
{
sLog->outError("Improper value specified for LoginDatabase.SynchThreads, defaulting to 1.");

View File

@@ -776,10 +776,10 @@ bool AuthSocket::_HandleLogonProof()
sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] account %s tried to login with invalid password!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str());
#endif
uint32 MaxWrongPassCount = sConfigMgr->GetIntDefault("WrongPass.MaxCount", 0);
uint32 MaxWrongPassCount = sConfigMgr->GetOption<int32>("WrongPass.MaxCount", 0);
// We can not include the failed account login hook. However, this is a workaround to still log this.
if (sConfigMgr->GetBoolDefault("WrongPass.Logging", false))
if (sConfigMgr->GetOption<bool>("WrongPass.Logging", false))
{
PreparedStatement* logstmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_FALP_IP_LOGGING);
logstmt->setString(0, _login);
@@ -805,8 +805,8 @@ bool AuthSocket::_HandleLogonProof()
if (failed_logins >= MaxWrongPassCount)
{
uint32 WrongPassBanTime = sConfigMgr->GetIntDefault("WrongPass.BanTime", 600);
bool WrongPassBanType = sConfigMgr->GetBoolDefault("WrongPass.BanType", false);
uint32 WrongPassBanTime = sConfigMgr->GetOption<int32>("WrongPass.BanTime", 600);
bool WrongPassBanType = sConfigMgr->GetOption<bool>("WrongPass.BanType", false);
if (WrongPassBanType)
{

View File

@@ -336,7 +336,6 @@ void PetAI::UpdateAI(uint32 diff)
delete itr->second;
}
// Update speed as needed to prevent dropping too far behind and despawning
me->UpdateSpeed(MOVE_RUN, true);
me->UpdateSpeed(MOVE_WALK, true);

View File

@@ -1839,7 +1839,6 @@ void Creature::LoadSpellTemplateImmunity()
}
}
bool Creature::IsImmunedToSpell(SpellInfo const* spellInfo)
{
if (!spellInfo)

View File

@@ -897,7 +897,6 @@ bool Object::PrintIndexError(uint32 index, bool set) const
return false;
}
bool Position::operator==(Position const& a)
{
return (G3D::fuzzyEq(a.m_positionX, m_positionX) &&

View File

@@ -2140,7 +2140,7 @@ bool Guild::Validate()
_SetLeaderGUID(pLeader);
// Check config if multiple guildmasters are allowed
if (!sConfigMgr->GetBoolDefault("Guild.AllowMultipleGuildMaster", 0))
if (!sConfigMgr->GetOption<bool>("Guild.AllowMultipleGuildMaster", 0))
for (Members::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
if (itr->second->GetRankId() == GR_GUILDMASTER && !itr->second->IsSamePlayer(m_leaderGuid))
itr->second->ChangeRank(GR_OFFICER);

View File

@@ -2303,7 +2303,6 @@ bool Map::HasEnoughWater(WorldObject const* searcher, LiquidData liquidData) con
return liquidData.level > INVALID_HEIGHT && liquidData.level > liquidData.depth_level && liquidData.level - liquidData.depth_level >= minHeightInWater;
}
char const* Map::GetMapName() const
{
return i_mapEntry ? i_mapEntry->name[sWorld->GetDefaultDbcLocale()] : "UNNAMEDMAP\x0";

View File

@@ -1131,7 +1131,6 @@ bool PathGenerator::IsSwimmableSegment(float const* v1, float const* v2, bool ch
return IsSwimmableSegment(v1[2], v1[0], v1[1], v2[2], v2[0], v2[1], checkSwim);
}
/**
* @brief predict if a certain segment is underwater and the unit can swim
* Must only be used for very short segments since this check doesn't work on

View File

@@ -65,7 +65,6 @@ bool ChaseMovementGenerator<T>::DoUpdate(T* owner, uint32 time_diff)
(owner->CanFly())
; // closes "bool forceDest", that way it is more appropriate, so we can comment out crap whenever we need to
Unit* target = i_target.getTarget();
bool const mutualChase = IsMutualChase(owner, target);
@@ -272,7 +271,6 @@ bool FollowMovementGenerator<T>::DoUpdate(T* owner, uint32 time_diff)
(i_target->GetTypeId() == TYPEID_PLAYER && i_target->ToPlayer()->IsGameMaster()) // for .npc follow
; // closes "bool forceDest", that way it is more appropriate, so we can comment out crap whenever we need to
i_recheckDistance.Update(time_diff);
if (i_recheckDistance.Passed())
{

View File

@@ -23,7 +23,6 @@ protected:
FollowerReference i_target;
};
template<class T>
class ChaseMovementGenerator : public MovementGeneratorMedium<T, ChaseMovementGenerator<T>>, public TargetedMovementGeneratorBase
{

View File

@@ -30,13 +30,13 @@ PacketLog* PacketLog::instance()
void PacketLog::Initialize()
{
std::string logsDir = sConfigMgr->GetStringDefault("LogsDir", "");
std::string logsDir = sConfigMgr->GetOption<std::string>("LogsDir", "");
if (!logsDir.empty())
if ((logsDir.at(logsDir.length() - 1) != '/') && (logsDir.at(logsDir.length() - 1) != '\\'))
logsDir.push_back('/');
std::string logname = sConfigMgr->GetStringDefault("PacketLogFile", "");
std::string logname = sConfigMgr->GetOption<std::string>("PacketLogFile", "");
if (!logname.empty())
_file = fopen((logsDir + logname).c_str(), "wb");
}

View File

@@ -222,9 +222,9 @@ WorldSocketMgr* WorldSocketMgr::instance()
int
WorldSocketMgr::StartReactiveIO (uint16 port, const char* address)
{
m_UseNoDelay = sConfigMgr->GetBoolDefault ("Network.TcpNodelay", true);
m_UseNoDelay = sConfigMgr->GetOption<bool> ("Network.TcpNodelay", true);
int num_threads = sConfigMgr->GetIntDefault ("Network.Threads", 1);
int num_threads = sConfigMgr->GetOption<int32> ("Network.Threads", 1);
if (num_threads <= 0)
{
@@ -239,9 +239,9 @@ WorldSocketMgr::StartReactiveIO (uint16 port, const char* address)
sLog->outBasic ("Max allowed socket connections %d", ACE::max_handles());
// -1 means use default
m_SockOutKBuff = sConfigMgr->GetIntDefault ("Network.OutKBuff", -1);
m_SockOutKBuff = sConfigMgr->GetOption<int32> ("Network.OutKBuff", -1);
m_SockOutUBuff = sConfigMgr->GetIntDefault ("Network.OutUBuff", 65536);
m_SockOutUBuff = sConfigMgr->GetOption<int32> ("Network.OutUBuff", 65536);
if (m_SockOutUBuff <= 0)
{

View File

@@ -238,4 +238,3 @@ WardenCheckResult const* WardenCheckMgr::GetWardenResultById(uint16 Id)
return nullptr;
}

File diff suppressed because it is too large Load Diff

View File

@@ -32,11 +32,6 @@ GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
add_executable(worldserver
${PRIVATE_SOURCES})
if(NOT WIN32)
set_target_properties(worldserver PROPERTIES
COMPILE_DEFINITIONS _ACORE_CORE_CONFIG="${CONF_DIR}/worldserver.conf")
endif()
add_dependencies(worldserver revision.h)
if(UNIX AND NOT NOJEM)
@@ -73,19 +68,9 @@ set_target_properties(worldserver
FOLDER
"server")
if( WIN32 )
if ( MSVC )
add_custom_command(TARGET worldserver
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/worldserver.conf.dist ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/
)
elseif ( MINGW )
add_custom_command(TARGET worldserver
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/worldserver.conf.dist ${CMAKE_BINARY_DIR}/bin/
)
endif()
endif()
# Install config
CopyDefaultConfig(worldserver)
CollectModulesConfig()
if( UNIX )
install(TARGETS worldserver DESTINATION bin)
@@ -93,38 +78,9 @@ elseif( WIN32 )
install(TARGETS worldserver DESTINATION "${CMAKE_INSTALL_PREFIX}")
endif()
install(FILES worldserver.conf.dist DESTINATION ${CONF_DIR})
# Generate precompiled header
if( USE_COREPCH )
add_cxx_pch(worldserver ${PRIVATE_PCH_HEADER})
endif()
# handle config file
CU_GET_GLOBAL("MODULE_CONFIG_FILE_LIST")
FOREACH(configFile ${MODULE_CONFIG_FILE_LIST})
if( WIN32 )
if ( MSVC )
add_custom_command(TARGET worldserver
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${configFile}" ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/
)
elseif ( MINGW )
add_custom_command(TARGET worldserver
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${configFile}" ${CMAKE_BINARY_DIR}/bin/
)
endif()
endif()
install(FILES "${configFile}" DESTINATION ${CONF_DIR})
ENDFOREACH()
CU_GET_GLOBAL("MODULE_CONFIG_FILE_LIST")
FOREACH(configFile ${MODULE_CONFIG_FILE_LIST})
get_filename_component(file_name ${configFile} NAME_WE)
set(CONFIG_LIST ${CONFIG_LIST}${file_name},)
ENDFOREACH()
add_definitions(-DCONFIG_FILE_LIST=$<1:"${CONFIG_LIST}">)
# end handle config file
CU_RUN_HOOK("AFTER_WORLDSERVER_CMAKE")

View File

@@ -126,7 +126,7 @@ void CliRunnable::run()
rl_event_hook = cli_hook_func;
#endif
if (sConfigMgr->GetBoolDefault("BeepAtStart", true))
if (sConfigMgr->GetOption<bool>("BeepAtStart", true))
printf("\a"); // \a = Alert
// print this here the first time

View File

@@ -59,7 +59,7 @@ void usage(const char* prog)
extern int main(int argc, char** argv)
{
///- Command line parsing to get the configuration file name
char const* configFile = _ACORE_CORE_CONFIG;
std::string configFile = sConfigMgr->GetConfigPath() + std::string(_ACORE_CORE_CONFIG);
int c = 1;
while (c < argc)
{
@@ -116,12 +116,13 @@ extern int main(int argc, char** argv)
++c;
}
sConfigMgr->SetConfigList(std::string(configFile), std::string(CONFIG_FILE_LIST));
// Add file and args in config
sConfigMgr->Configure(configFile, std::vector<std::string>(argv, argv + argc), CONFIG_FILE_LIST);
if (!sConfigMgr->LoadAppConfigs())
return 1;
sLog->outString("Using configuration file %s.", configFile);
sLog->outString("Using configuration file %s.", configFile.c_str());
sLog->outString("Using SSL version: %s (library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
sLog->outString("Using ACE version: %s", ACE_VERSION);

View File

@@ -136,7 +136,7 @@ int Master::Run()
sLog->outString(" AzerothCore 3.3.5a - www.azerothcore.org\n");
/// worldserver PID file creation
std::string pidFile = sConfigMgr->GetStringDefault("PidFile", "");
std::string pidFile = sConfigMgr->GetOption<std::string>("PidFile", "");
if (!pidFile.empty())
{
if (uint32 pid = CreatePIDFile(pidFile))
@@ -185,9 +185,9 @@ int Master::Run()
acore::Thread* cliThread = nullptr;
#ifdef _WIN32
if (sConfigMgr->GetBoolDefault("Console.Enable", true) && (m_ServiceStatus == -1)/* need disable console in service mode*/)
if (sConfigMgr->GetOption<bool>("Console.Enable", true) && (m_ServiceStatus == -1)/* need disable console in service mode*/)
#else
if (sConfigMgr->GetBoolDefault("Console.Enable", true))
if (sConfigMgr->GetOption<bool>("Console.Enable", true))
#endif
{
///- Launch CliRunnable thread
@@ -203,8 +203,8 @@ int Master::Run()
#if defined(_WIN32) || defined(__linux__)
///- Handle affinity for multiple processors and process priority
uint32 affinity = sConfigMgr->GetIntDefault("UseProcessors", 0);
bool highPriority = sConfigMgr->GetBoolDefault("ProcessPriority", false);
uint32 affinity = sConfigMgr->GetOption<int32>("UseProcessors", 0);
bool highPriority = sConfigMgr->GetOption<bool>("ProcessPriority", false);
#ifdef _WIN32 // Windows
@@ -270,16 +270,16 @@ int Master::Run()
// Start soap serving thread
acore::Thread* soapThread = nullptr;
if (sConfigMgr->GetBoolDefault("SOAP.Enabled", false))
if (sConfigMgr->GetOption<bool>("SOAP.Enabled", false))
{
ACSoapRunnable* runnable = new ACSoapRunnable();
runnable->SetListenArguments(sConfigMgr->GetStringDefault("SOAP.IP", "127.0.0.1"), uint16(sConfigMgr->GetIntDefault("SOAP.Port", 7878)));
runnable->SetListenArguments(sConfigMgr->GetOption<std::string>("SOAP.IP", "127.0.0.1"), uint16(sConfigMgr->GetOption<int32>("SOAP.Port", 7878)));
soapThread = new acore::Thread(runnable);
}
// Start up freeze catcher thread
acore::Thread* freezeThread = nullptr;
if (uint32 freezeDelay = sConfigMgr->GetIntDefault("MaxCoreStuckTime", 0))
if (uint32 freezeDelay = sConfigMgr->GetOption<int32>("MaxCoreStuckTime", 0))
{
FreezeDetectorRunnable* runnable = new FreezeDetectorRunnable(freezeDelay * 1000);
freezeThread = new acore::Thread(runnable);
@@ -288,7 +288,7 @@ int Master::Run()
///- Launch the world listener socket
uint16 worldPort = uint16(sWorld->getIntConfig(CONFIG_PORT_WORLD));
std::string bindIp = sConfigMgr->GetStringDefault("BindIP", "0.0.0.0");
std::string bindIp = sConfigMgr->GetOption<std::string>("BindIP", "0.0.0.0");
if (sWorldSocketMgr->StartNetwork(worldPort, bindIp.c_str()) == -1)
{
sLog->outError("Failed to start network");
@@ -398,14 +398,14 @@ bool Master::_StartDB()
std::string dbstring;
uint8 async_threads, synch_threads;
dbstring = sConfigMgr->GetStringDefault("WorldDatabaseInfo", "");
dbstring = sConfigMgr->GetOption<std::string>("WorldDatabaseInfo", "");
if (dbstring.empty())
{
sLog->outError("World database not specified in configuration file");
return false;
}
async_threads = uint8(sConfigMgr->GetIntDefault("WorldDatabase.WorkerThreads", 1));
async_threads = uint8(sConfigMgr->GetOption<int32>("WorldDatabase.WorkerThreads", 1));
if (async_threads < 1 || async_threads > 32)
{
sLog->outError("World database: invalid number of worker threads specified. "
@@ -413,7 +413,7 @@ bool Master::_StartDB()
return false;
}
synch_threads = uint8(sConfigMgr->GetIntDefault("WorldDatabase.SynchThreads", 1));
synch_threads = uint8(sConfigMgr->GetOption<int32>("WorldDatabase.SynchThreads", 1));
///- Initialise the world database
if (!WorldDatabase.Open(dbstring, async_threads, synch_threads))
{
@@ -422,14 +422,14 @@ bool Master::_StartDB()
}
///- Get character database info from configuration file
dbstring = sConfigMgr->GetStringDefault("CharacterDatabaseInfo", "");
dbstring = sConfigMgr->GetOption<std::string>("CharacterDatabaseInfo", "");
if (dbstring.empty())
{
sLog->outError("Character database not specified in configuration file");
return false;
}
async_threads = uint8(sConfigMgr->GetIntDefault("CharacterDatabase.WorkerThreads", 1));
async_threads = uint8(sConfigMgr->GetOption<int32>("CharacterDatabase.WorkerThreads", 1));
if (async_threads < 1 || async_threads > 32)
{
sLog->outError("Character database: invalid number of worker threads specified. "
@@ -437,7 +437,7 @@ bool Master::_StartDB()
return false;
}
synch_threads = uint8(sConfigMgr->GetIntDefault("CharacterDatabase.SynchThreads", 2));
synch_threads = uint8(sConfigMgr->GetOption<int32>("CharacterDatabase.SynchThreads", 2));
///- Initialise the Character database
if (!CharacterDatabase.Open(dbstring, async_threads, synch_threads))
@@ -447,14 +447,14 @@ bool Master::_StartDB()
}
///- Get login database info from configuration file
dbstring = sConfigMgr->GetStringDefault("LoginDatabaseInfo", "");
dbstring = sConfigMgr->GetOption<std::string>("LoginDatabaseInfo", "");
if (dbstring.empty())
{
sLog->outError("Login database not specified in configuration file");
return false;
}
async_threads = uint8(sConfigMgr->GetIntDefault("LoginDatabase.WorkerThreads", 1));
async_threads = uint8(sConfigMgr->GetOption<int32>("LoginDatabase.WorkerThreads", 1));
if (async_threads < 1 || async_threads > 32)
{
sLog->outError("Login database: invalid number of worker threads specified. "
@@ -462,7 +462,7 @@ bool Master::_StartDB()
return false;
}
synch_threads = uint8(sConfigMgr->GetIntDefault("LoginDatabase.SynchThreads", 1));
synch_threads = uint8(sConfigMgr->GetOption<int32>("LoginDatabase.SynchThreads", 1));
///- Initialise the login database
if (!LoginDatabase.Open(dbstring, async_threads, synch_threads))
{
@@ -471,7 +471,7 @@ bool Master::_StartDB()
}
///- Get the realm Id from the configuration file
realmID = sConfigMgr->GetIntDefault("RealmID", 0);
realmID = sConfigMgr->GetOption<int32>("RealmID", 0);
if (!realmID)
{
sLog->outError("Realm ID not defined in configuration file");

View File

@@ -43,13 +43,13 @@ RARunnable::~RARunnable()
void RARunnable::run()
{
if (!sConfigMgr->GetBoolDefault("Ra.Enable", false))
if (!sConfigMgr->GetOption<bool>("Ra.Enable", false))
return;
ACE_Acceptor<RASocket, ACE_SOCK_ACCEPTOR> acceptor;
uint16 raPort = uint16(sConfigMgr->GetIntDefault("Ra.Port", 3443));
std::string stringIp = sConfigMgr->GetStringDefault("Ra.IP", "0.0.0.0");
uint16 raPort = uint16(sConfigMgr->GetOption<int32>("Ra.Port", 3443));
std::string stringIp = sConfigMgr->GetOption<std::string>("Ra.IP", "0.0.0.0");
ACE_INET_Addr listenAddress(raPort, stringIp.c_str());
if (acceptor.open(listenAddress, m_Reactor) == -1)

View File

@@ -23,7 +23,7 @@
RASocket::RASocket()
{
_minLevel = uint8(sConfigMgr->GetIntDefault("RA.MinLevel", 3));
_minLevel = uint8(sConfigMgr->GetOption<int32>("RA.MinLevel", 3));
_commandExecuting = false;
}

View File

@@ -1967,7 +1967,6 @@ NpcEvadeIfTargetIsUnreachable = 5
NpcRegenHPIfTargetIsUnreachable = 1
# NpcRegenHPTimeIfTargetIsUnreachable
# Description: Specifies the time (in seconds) that a creature whom target
# is unreachable in raid to end up regenerate health.
@@ -2768,16 +2767,16 @@ Battleground.QueueAnnouncer.PlayerOnly = 0
# Default: 300000 - (Enabled, 5 minutes)
# 0 - (Disabled, Not recommended)
BattleGround.PrematureFinishTimer = 300000
Battleground.PrematureFinishTimer = 300000
#
# BattleGround.PremadeGroupWaitForMatch
# Battleground.PremadeGroupWaitForMatch
# Description: Time (in milliseconds) a pre-made group has to wait for matching group of the
# other faction.
# Default: 1800000 - (Enabled, 30 minutes)
# 0 - (Disabled, Not recommended)
BattleGround.PremadeGroupWaitForMatch = 1800000
Battleground.PremadeGroupWaitForMatch = 1800000
#
# Battleground.GiveXPForKills