Exemplo n.º 1
0
        private void DoCheckServerStatus(HostConfigurationElement host)
        {
            string hostName = host.Hostname;
            int    port     = 3809; //check the proxy listener, not SSL anymore.

            DoCheckServerStatus(hostName, port);
        }
Exemplo n.º 2
0
        private bool TryGetSelectedServer(out HostConfigurationElement host)
        {
            ServerConfigurationElement emulator;

            if (TryGetSelectedEmulator(out emulator) == false)
            {
                host = null;
                return(false);
            }
            else if (c_ComboBox_Servers.SelectedIndex == -1 && m_LastSelectedServer == null)
            {
                host = null;
                return(false);
            }
            else if (c_ComboBox_Servers.SelectedIndex == -1 && m_LastSelectedServer != null)
            {
                host = m_LastSelectedServer;
                return(true);
            }

            string serverName = c_ComboBox_Servers.SelectedItem.ToString();

            host = emulator.Hosts.GetByHostName(serverName);
            return(true);
        }
Exemplo n.º 3
0
        private void DoDisplayServerStatus()
        {
            try
            {
                ServerConfigurationElement server;
                HostConfigurationElement   host;
                if (TryGetSelectedServer(out server, out host) == false)
                {
                    c_ServerStatus.Text = String.Empty;
                    return;
                }

                if (host.SupportsSecureAuthentication)
                {
                    c_CheckBox_SecureAuthentication.Enabled = true;
                    c_CheckBox_SecureAuthentication.Checked = true;
                    c_TextBox_Port.Text = host.SecureAuthenticationPort.ToString();
                }
                else
                {
                    c_CheckBox_SecureAuthentication.Enabled = false;
                    c_CheckBox_SecureAuthentication.Checked = false;
                    c_TextBox_Port.Text = host.AuthenticationPort.ToString();
                }

                if (server.IsSinglePlayer)
                {
                    c_ServerStatus.Text    = "READY";
                    c_Button_Check.Enabled = false;
                }
                else
                {
                    c_ServerStatus.Text    = "CHECKING";
                    c_Button_Check.Enabled = true;
                    DoCheckServerStatus(host);
                }

                m_LastSelectedServer = host;
            }
            catch (Exception e)
            {
                Program.LogException(e);
                DisplayErrorMessage("Could not retrieve server status.", e);
                c_ServerStatus.Text = String.Empty;
            }
        }