Exemple #1
0
        private void StartPhoton()
        {
            string str;

            if (this.IsPhotonRunningAsApp())
            {
                str = Program.ResourceManager.GetString("launcherPhotonAlreadyRunningText");
            }
            else
            {
                this.startStopButton.Text = Program.ResourceManager.GetString("launcherWaitButtonText");
                PhotonHandler.StartPhotonApplication("Simple", this.photonWorkingDirectory, out str);
            }
            if (!string.IsNullOrEmpty(str))
            {
                MessageBox.Show(str);
                this.SetEnabledMenuItems();
            }
        }
Exemple #2
0
        protected override void OnShown(EventArgs e)
        {
            string str;
            string str2;

            if (!FrameworkVersionChecker.CheckRequiredFrameworkVersion(requiredFrameworkVersion, out str))
            {
                MessageBox.Show(str);
            }
            LauncherStartupDialogForm form = new LauncherStartupDialogForm();

            if (form.localIps.Length > 1)
            {
                form.StartPosition = FormStartPosition.CenterParent;
                if (form.ShowDialog(this) != DialogResult.OK)
                {
                    base.Close();
                    return;
                }
            }
            this.gsConfiguredIp = form.SelectedIp;
            GameServerConfigChanger.EditConfigFiles(@"..\LoadBalancing\GameServer1\bin\Photon.LoadBalancing.dll.config;..\LoadBalancing\GameServer2\bin\Photon.LoadBalancing.dll.config", this.gsConfiguredIp, out str2);
            if (!string.IsNullOrEmpty(str2))
            {
                MessageBox.Show(str2);
                this.label1.Text             = Program.ResourceManager.GetString("launcherFailedToSetIpText");
                this.startStopButton.Enabled = false;
                this.startStopButton.Visible = false;
                this.startStopButton.Text    = null;
            }
            else
            {
                PhotonHandler.StartPhotonApplication("Simple", this.photonWorkingDirectory, out str2);
                if (!string.IsNullOrEmpty(str2))
                {
                    MessageBox.Show(str2);
                    this.label1.Text          = Program.ResourceManager.GetString("launcherFailedToStartText");
                    this.startStopButton.Text = Program.ResourceManager.GetString("launcherStartButtonText");
                }
            }
        }