public static void CreateServer(string name, PType type, int maxClient) { if (SERVERS.ContainsKey(name)) { Logger.Warn($"Server [{name}] already exist"); return; } INetServer server = null; switch (type) { case PType.Tcp: server = new TCPServer(maxClient); break; case PType.Kcp: server = new KCPServer(maxClient); break; } SERVERS[name] = server; }
public void OnSpawn(TCPServer server, Socket conn, long connectTime) { this._server = server; this._activeDateTime = connectTime; this._conn = conn; }