mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
Core/Misc: Warning fixes
This commit is contained in:
@@ -141,10 +141,16 @@ extern int main(int argc, char **argv)
|
||||
// Launch the listening network socket
|
||||
RealmAcceptor acceptor;
|
||||
|
||||
uint16 rmport = ConfigMgr::GetIntDefault("RealmServerPort", 3724);
|
||||
int32 rmport = ConfigMgr::GetIntDefault("RealmServerPort", 3724);
|
||||
if (rmport < 0 || rmport > 0xFFFF)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_AUTHSERVER, "Specified port out of allowed range (1-65535)");
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::string bind_ip = ConfigMgr::GetStringDefault("BindIP", "0.0.0.0");
|
||||
|
||||
ACE_INET_Addr bind_addr(rmport, bind_ip.c_str());
|
||||
ACE_INET_Addr bind_addr(uint16(rmport), bind_ip.c_str());
|
||||
|
||||
if (acceptor.open(bind_addr, ACE_Reactor::instance(), ACE_NONBLOCK) == -1)
|
||||
{
|
||||
@@ -238,14 +244,14 @@ bool StartDB()
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8 worker_threads = ConfigMgr::GetIntDefault("LoginDatabase.WorkerThreads", 1);
|
||||
int32 worker_threads = ConfigMgr::GetIntDefault("LoginDatabase.WorkerThreads", 1);
|
||||
if (worker_threads < 1 || worker_threads > 32)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_AUTHSERVER, "Improper value specified for LoginDatabase.WorkerThreads, defaulting to 1.");
|
||||
worker_threads = 1;
|
||||
}
|
||||
|
||||
uint8 synch_threads = ConfigMgr::GetIntDefault("LoginDatabase.SynchThreads", 1);
|
||||
int32 synch_threads = ConfigMgr::GetIntDefault("LoginDatabase.SynchThreads", 1);
|
||||
if (synch_threads < 1 || synch_threads > 32)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_AUTHSERVER, "Improper value specified for LoginDatabase.SynchThreads, defaulting to 1.");
|
||||
@@ -253,7 +259,7 @@ bool StartDB()
|
||||
}
|
||||
|
||||
// NOTE: While authserver is singlethreaded you should keep synch_threads == 1. Increasing it is just silly since only 1 will be used ever.
|
||||
if (!LoginDatabase.Open(dbstring.c_str(), worker_threads, synch_threads))
|
||||
if (!LoginDatabase.Open(dbstring.c_str(), uint8(worker_threads), uint8(synch_threads)))
|
||||
{
|
||||
sLog->outError(LOG_FILTER_AUTHSERVER, "Cannot connect to database");
|
||||
return false;
|
||||
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
|
||||
// check item starting quest (it can work incorrectly if added without item in inventory)
|
||||
ItemTemplateContainer const* itc = sObjectMgr->GetItemTemplateStore();
|
||||
ItemTemplateContainer::const_iterator result = find_if (itc->begin(), itc->end(), Finder<uint32, ItemTemplate>(entry, &ItemTemplate::StartQuest));
|
||||
ItemTemplateContainer::const_iterator result = find_if(itc->begin(), itc->end(), Finder<uint32, ItemTemplate>(entry, &ItemTemplate::StartQuest));
|
||||
|
||||
if (result != itc->end())
|
||||
{
|
||||
|
||||
@@ -240,7 +240,7 @@ int Master::Run()
|
||||
if (ConfigMgr::GetBoolDefault("SOAP.Enabled", false))
|
||||
{
|
||||
TCSoapRunnable* runnable = new TCSoapRunnable();
|
||||
runnable->setListenArguments(ConfigMgr::GetStringDefault("SOAP.IP", "127.0.0.1"), ConfigMgr::GetIntDefault("SOAP.Port", 7878));
|
||||
runnable->setListenArguments(ConfigMgr::GetStringDefault("SOAP.IP", "127.0.0.1"), uint16(ConfigMgr::GetIntDefault("SOAP.Port", 7878)));
|
||||
soap_thread = new ACE_Based::Thread(runnable);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user