private void DoTunnelPinged(int index)
 {
     if (TunnelPinged != null)
     {
         wm.AddCallback(TunnelPinged, index);
     }
 }
Beispiel #2
0
        public void UpdatePing(WindowManager wm)
        {
            using (Ping p = new Ping())
            {
                try
                {
                    PingReply reply = p.Send(System.Net.IPAddress.Parse(IPAddress), LAN_PING_TIMEOUT);
                    if (reply.Status == IPStatus.Success)
                    {
                        Ping = Convert.ToInt32(reply.RoundtripTime);
                    }

                    wm.AddCallback(PlayerPinged, this, EventArgs.Empty);
                }
                catch (PingException ex)
                {
                    Logger.Log($"Caught an exception when pinging {Name} LAN player: {ex.Message}");
                }
            }
        }
 private void SharedUILogic_GameProcessExited()
 {
     WindowManager.AddCallback(new Action(HandleGameProcessExited), null);
 }
Beispiel #4
0
 public void OnAttemptedServerChanged(string serverName)
 {
     // AddCallback is necessary for thread-safety; OnAttemptedServerChanged
     // is called by the networking thread, and AddCallback schedules DoAttemptedServerChanged
     // to be executed on the main (UI) thread.
     wm.AddCallback(new Action <string>(DoAttemptedServerChanged), serverName);
 }
 /// <summary>
 /// Called whenever a custom component download is finished.
 /// </summary>
 /// <param name="c">The CustomComponent object.</param>
 /// <param name="success">True if the download succeeded, otherwise false.</param>
 private void cc_DownloadFinished(CustomComponent c, bool success)
 {
     WindowManager.AddCallback(new Action <CustomComponent, bool>(HandleDownloadFinished), c, success);
 }
 /// <summary>
 /// Called whenever a custom component download's progress is changed.
 /// </summary>
 /// <param name="c">The CustomComponent object.</param>
 /// <param name="percentage">The current download progress percentage.</param>
 private void cc_DownloadProgressChanged(CustomComponent c, int percentage)
 {
     WindowManager.AddCallback(new Action <CustomComponent, int>(HandleDownloadProgressChanged), c, percentage);
 }
 private void GameProcessExited_Callback()
 {
     WindowManager.AddCallback(new Action(GameProcessExited), null);
 }
 private void CUpdater_FileIdentifiersUpdated()
 {
     WindowManager.AddCallback(new Action(HandleFileIdentifierUpdate), null);
 }
 private void CUpdater_Restart(object sender, EventArgs e) =>
 WindowManager.AddCallback(new Action(ExitClient), null);
Beispiel #10
0
 private void DoTunnelPinged(int tunnelIndex, int pingInMs)
 {
     wm.AddCallback(new Action <int, int>(HandleTunnelPinged), tunnelIndex, pingInMs);
 }
 /// <summary>
 /// Reloads Keyboard.ini when the game process has exited.
 /// </summary>
 private void GameProcessLogic_GameProcessExited()
 {
     WindowManager.AddCallback(new Action(LoadKeyboardINI), null);
 }
Beispiel #12
0
 private void CUpdater_Restart(object sender, EventArgs e)
 {
     WindowManager.AddCallback(new Action(WindowManager.CloseGame), null);
 }