diff options
| author | DDuarte <dnpd.dd@gmail.com> | 2016-03-28 02:02:29 +0100 |
|---|---|---|
| committer | DDuarte <dnpd.dd@gmail.com> | 2016-03-28 02:36:58 +0100 |
| commit | 423bded9a61e3f1c51ba00327898126c4e3a3f53 (patch) | |
| tree | 6ba07fa8ba0dc2f63e06a5ebeb07b12a67d0f37d /src/server/shared | |
| parent | 06b3bca0d2bf6f049128da110681a5244d90225a (diff) | |
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
(cherry picked from commit 980f28d2ce099f524abdb6faed3fe59ce4c0963a)
# Conflicts:
# src/server/authserver/Server/AuthSocketMgr.h
# src/server/game/Server/WorldSocketMgr.cpp
Diffstat (limited to 'src/server/shared')
| -rw-r--r-- | src/server/shared/Networking/SocketMgr.h | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/server/shared/Networking/SocketMgr.h b/src/server/shared/Networking/SocketMgr.h index b14aac4ca47..e479cd2450d 100644 --- a/src/server/shared/Networking/SocketMgr.h +++ b/src/server/shared/Networking/SocketMgr.h @@ -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); |
