Ejemplo n.º 1
0
 private void Form1_FormClosed(object sender, FormClosedEventArgs e)
 {
     if (WebSocketsWrapper.IsConnected())
     {
         WebSocketsWrapper.Disconnect();
     }
 }
Ejemplo n.º 2
0
 public static void UpdatePlayers()
 {
     while (WebSocketsWrapper.IsConnected())
     {
         WebSocketsWrapper.SendCommand("playerlist");
         Thread.Sleep(TimeSpan.FromSeconds(10));
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Formats the string for the status text
        /// </summary>
        /// <param name="text"></param>
        /// <returns></returns>
        private static string FormatStatus(string text)
        {
            var connected = WebSocketsWrapper.IsConnected() ? "Connected" : "Disconnected";

            return($"{text} ({connected})");
        }