Updated Bnet Server.

Port From (https://github.com/TrinityCore/TrinityCore)
This commit is contained in:
hondacrx
2024-02-21 00:05:48 -05:00
parent 7960e7b192
commit 9e3a7df6a7
62 changed files with 2186 additions and 731 deletions
+9 -1
View File
@@ -10,7 +10,9 @@ namespace Game.Networking
{
public class WorldSocketManager : SocketManager<WorldSocket>
{
public override bool StartNetwork(string bindIp, int port, int threadCount)
public static WorldSocketManager Instance { get; } = new WorldSocketManager();
public override bool StartNetwork(string bindIp, int port, int threadCount = 1)
{
_tcpNoDelay = ConfigMgr.GetDefaultValue("Network.TcpNodelay", true);
@@ -29,6 +31,7 @@ namespace Game.Networking
return false;
}
Acceptor.AsyncAcceptSocket(OnSocketAccept);
_instanceAcceptor.AsyncAcceptSocket(OnSocketOpen);
return true;
@@ -62,6 +65,11 @@ namespace Game.Networking
base.OnSocketOpen(sock);
}
static void OnSocketAccept(Socket sock)
{
Global.WorldSocketMgr.OnSocketOpen(sock);
}
AsyncAcceptor _instanceAcceptor;
int _socketSendBufferSize;
bool _tcpNoDelay;