mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 18:36:31 +01:00
Core/Network: Change SocketMgr.StartNetwork to take the thread count by arg instead of config
AuthSocketMgr doesn't need "Network.Threads" config Fixes "Missing name Network.Threads in config file authserver.conf" Ref #16859
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
#define SocketMgr_h__
|
||||
|
||||
#include "AsyncAcceptor.h"
|
||||
#include "Config.h"
|
||||
#include "Errors.h"
|
||||
#include "NetworkThread.h"
|
||||
#include <boost/asio/ip/tcp.hpp>
|
||||
@@ -36,15 +35,9 @@ public:
|
||||
ASSERT(!_threads && !_acceptor && !_threadCount, "StopNetwork must be called prior to SocketMgr destruction");
|
||||
}
|
||||
|
||||
virtual bool StartNetwork(boost::asio::io_service& service, std::string const& bindIp, uint16 port)
|
||||
virtual bool StartNetwork(boost::asio::io_service& service, std::string const& bindIp, uint16 port, int threadCount)
|
||||
{
|
||||
_threadCount = sConfigMgr->GetIntDefault("Network.Threads", 1);
|
||||
|
||||
if (_threadCount <= 0)
|
||||
{
|
||||
TC_LOG_ERROR("misc", "Network.Threads is wrong in your config file");
|
||||
return false;
|
||||
}
|
||||
ASSERT(threadCount > 0);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -56,6 +49,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
_threadCount = threadCount;
|
||||
_threads = CreateThreads();
|
||||
|
||||
ASSERT(_threads);
|
||||
|
||||
Reference in New Issue
Block a user