コード例 #1
0
 private void DoTunnelPinged(int index)
 {
     if (TunnelPinged != null)
     {
         wm.AddCallback(TunnelPinged, index);
     }
 }
コード例 #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}");
                }
            }
        }
コード例 #3
0
 private void SharedUILogic_GameProcessExited()
 {
     WindowManager.AddCallback(new Action(HandleGameProcessExited), null);
 }
コード例 #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);
 }
コード例 #5
0
 /// <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);
 }
コード例 #6
0
 /// <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);
 }
コード例 #7
0
 private void GameProcessExited_Callback()
 {
     WindowManager.AddCallback(new Action(GameProcessExited), null);
 }
コード例 #8
0
 private void CUpdater_FileIdentifiersUpdated()
 {
     WindowManager.AddCallback(new Action(HandleFileIdentifierUpdate), null);
 }
コード例 #9
0
 private void CUpdater_Restart(object sender, EventArgs e) =>
 WindowManager.AddCallback(new Action(ExitClient), null);
コード例 #10
0
 private void DoTunnelPinged(int tunnelIndex, int pingInMs)
 {
     wm.AddCallback(new Action <int, int>(HandleTunnelPinged), tunnelIndex, pingInMs);
 }
コード例 #11
0
 /// <summary>
 /// Reloads Keyboard.ini when the game process has exited.
 /// </summary>
 private void GameProcessLogic_GameProcessExited()
 {
     WindowManager.AddCallback(new Action(LoadKeyboardINI), null);
 }
コード例 #12
0
 private void CUpdater_Restart(object sender, EventArgs e)
 {
     WindowManager.AddCallback(new Action(WindowManager.CloseGame), null);
 }