示例#1
0
        private void InitializeVariables()
        {
            string str;

            this.iconRunning = (Icon)PhotonControl.Properties.Resources.ResourceManager.GetObject("Running");
            this.iconStopped = (Icon)PhotonControl.Properties.Resources.ResourceManager.GetObject("Stopped");
            if (string.IsNullOrEmpty(PhotonControlSettings.Default.PhotonWorkingDirectory))
            {
                this.photonWorkingDirectory = Path.GetDirectoryName(Application.ExecutablePath) + @"\";
            }
            else
            {
                this.photonWorkingDirectory = PhotonControlSettings.Default.PhotonWorkingDirectory;
            }
            this.gsConfiguredIp = GameServerConfigChanger.GetCurrentConfigIp(PhotonControlSettings.Default.GameServerConfigPaths, out str);
        }
示例#2
0
 private void FillMenu()
 {
     GameServerConfigChanger.GetLocalIPs(out this.localIps);
     this.SelectedIp = this.localIps[0];
     foreach (string str in this.localIps)
     {
         this.items.Add(new KeyValuePair <string, string>("Private: " + str, str));
     }
     this.items.Add(new KeyValuePair <string, string>("Public: still retrieving...", string.Empty));
     GameServerConfigChanger.GetPublicIpCompleted += new GameServerConfigChanger.GetPublicIpCompletedHandler(this.GetPublicIpCompleted);
     GameServerConfigChanger.GetPublicIPAsync();
     this.selectIps.DataSource    = this.items;
     this.selectIps.DisplayMember = "Key";
     this.selectIps.ValueMember   = "Value";
     this.selectIps.SelectedIndex = 0;
 }
示例#3
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");
                }
            }
        }