Exemplo n.º 1
0
 private void buttonPlayers_Click(object sender, EventArgs e)
 {
     if (this.Width == _commanderListHiddenWidth)
     {
         this.Width            = _normalView.Width;
         _commanderListShowing = true;
         CommanderWatcher.Start($"http://{ServerAddress}:11938/DataCollator");
         UpdateAvailableCommanders();;
         CommanderWatcher.OnlineCountChanged += CommanderWatcher_OnlineCountChanged;
     }
     else
     {
         CommanderWatcher.Stop();
         this.Width            = _commanderListHiddenWidth;
         _commanderListShowing = false;
         CommanderWatcher.OnlineCountChanged -= CommanderWatcher_OnlineCountChanged;
     }
 }
Exemplo n.º 2
0
 private bool CreateUdpClient()
 {
     // Create the UDP client for sending tracking data
     CommanderWatcher.Start($"http://{ServerUrl()}:11938/DataCollator");  // Needed to check that the upload is working
     try
     {
         _uploadValidated = false;
         _uploadStartTime = DateTime.Now;
         _udpClient       = new UdpClient(ServerUrl(), (int)numericUpDownUdpUploadPort.Value);
         return(true);
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, $"Failed to create UDP upload client.\r\nTypical causes are firewall or security software.\r\nPlease resolve issue and try again.\r\n\r\nError:{ex.Message}", "Upload Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
         checkBoxUpload.Checked = false;
     }
     return(false);
 }