Beispiel #1
0
 public static void Stop(string reason = "")
 {
     ListenerServer.Shutdown(string.IsNullOrEmpty(reason) ? "Server is shutting down..." : reason);
     Listen = false;
     WebSocketListener.Stop((reason == "ServerHub exception occured!" ? WebSocketSharp.CloseStatusCode.ServerError : WebSocketSharp.CloseStatusCode.Away), reason);
     hubClients.ForEach(x => x.KickClient(string.IsNullOrEmpty(reason) ? "Server is shutting down..." : reason));
     RadioController.StopRadio(string.IsNullOrEmpty(reason) ? "Server is shutting down..." : reason);
 }
Beispiel #2
0
 public static void Stop(string reason = "")
 {
     ListenerServer.Shutdown(string.IsNullOrEmpty(reason) ? "Server is shutting down..." : reason);
     Listen = false;
     WebSocketListener.Stop();
     hubClients.ForEach(x => x.KickClient(string.IsNullOrEmpty(reason) ? "Server is shutting down..." : reason));
     RadioController.StopRadio(string.IsNullOrEmpty(reason) ? "Server is shutting down..." : reason);
 }
Beispiel #3
0
 public static void Stop(string reason = "")
 {
     ListenerServer.Shutdown(string.IsNullOrEmpty(reason) ? "Server is shutting down..." : reason);
     Listen = false;
     WebSocketListener.Stop((reason == "ServerHub exception occured!" ? WebSocketSharp.CloseStatusCode.ServerError : WebSocketSharp.CloseStatusCode.Away), reason);
     for (int i = 0; i < hubClients.Count; i++)
     {
         if (hubClients.Count > i)
         {
             hubClients[i].KickClient(string.IsNullOrEmpty(reason) ? "Server is shutting down..." : reason);
         }
     }
     RadioController.StopRadio(string.IsNullOrEmpty(reason) ? "Server is shutting down..." : reason);
 }