HaoYueTunnel/ServerCore/Manager/ServerManager.cs

38 lines
1.5 KiB
C#
Raw Normal View History

2023-05-25 18:30:22 +08:00
using ServerCore.Event;
using ServerCore.NetWork;
using System.Net;
2023-05-23 17:57:24 +08:00
2023-05-25 18:30:22 +08:00
namespace ServerCore.Manager
2023-05-23 17:57:24 +08:00
{
public static class ServerManager
{
public static ClientManager g_ClientMgr;
public static LogManager g_Log;
public static LoginManager g_Login;
2023-05-25 13:24:51 +08:00
public static ChatManager g_Chat;
2023-06-15 15:45:58 +08:00
public static UserManager g_UserMgr;
public static TcpTunnelClientManager g_TcpTunnelMgr;
2023-05-23 17:57:24 +08:00
public static IOCPNetWork g_SocketMgr;
public static IOCPNetWork g_SocketTcpTunnelMgr;
2023-05-23 17:57:24 +08:00
public static void InitServer(int port, int tcptunnelport)
2023-05-23 17:57:24 +08:00
{
g_ClientMgr = new ClientManager();
2023-06-15 15:45:58 +08:00
//g_ClientMgr.Init(10000, 10000);
2023-05-23 17:57:24 +08:00
g_Log = new LogManager();
g_Login = new LoginManager();
2023-05-25 13:24:51 +08:00
g_Chat = new ChatManager();
2023-06-15 15:45:58 +08:00
g_UserMgr = new UserManager();
g_TcpTunnelMgr = new TcpTunnelClientManager();
2023-06-15 15:45:58 +08:00
g_SocketMgr = new IOCPNetWork(1024, 1024,Common.Enum.ServerType.MainServer);
2023-05-23 17:57:24 +08:00
g_SocketMgr.Init();
Console.WriteLine("监听:" + port);
g_SocketMgr.Start(new IPEndPoint(IPAddress.Any.Address, port));
2023-06-15 15:45:58 +08:00
g_SocketTcpTunnelMgr = new IOCPNetWork(1024, 1024, Common.Enum.ServerType.TcpTunnelServer);
g_SocketTcpTunnelMgr.Init();
g_SocketTcpTunnelMgr.Start(new IPEndPoint(IPAddress.Any.Address, tcptunnelport));
Console.WriteLine("监听:" + tcptunnelport);
2023-05-23 17:57:24 +08:00
Console.WriteLine("Succeed!");
}
}
}