public void Shutdown() { Log.Information("Server socket closing..."); NetworkSocket?.Shutdown("Server going down for quit"); NetworkSocket = null; NetworkPipe = null; NetConfiguration = null; }
public override void Start() { Log.Information("Started logging NetworkServer."); NetConfiguration = new NetPeerConfiguration("unity") { MaximumConnections = MaxPlayers, Port = 27015 }; NetConfiguration.EnableMessageType(NetIncomingMessageType.NatIntroductionSuccess); if (NetworkDiscovery) { NetConfiguration.EnableUPnP = true; } NetworkSocket = new NetServer(this.NetConfiguration); NetworkPipe = new ServerMessagePipe(this.NetworkSocket); NetworkSocket.Start(); }