diff --git a/TGControlPanel/ByondPage.cs b/TGControlPanel/ByondPage.cs index 7592d4720e..62fccce395 100644 --- a/TGControlPanel/ByondPage.cs +++ b/TGControlPanel/ByondPage.cs @@ -42,7 +42,6 @@ namespace TGControlPanel catch { } UpdateBYONDButtons(); - BYONDTimer.Start(); } private void UpdateButton_Click(object sender, EventArgs e) { @@ -50,7 +49,11 @@ namespace TGControlPanel if (!Server.GetComponent().UpdateToVersion((int)MajorVersionNumeric.Value, (int)MinorVersionNumeric.Value)) MessageBox.Show("Unable to begin update, there is another operation in progress."); } - + + private void BYONDRefreshButton_Click(object sender, EventArgs e) + { + UpdateBYONDButtons(); + } void UpdateBYONDButtons() { var BYOND = Server.GetComponent(); @@ -63,61 +66,35 @@ namespace TGControlPanel { case TGByondStatus.Idle: case TGByondStatus.Starting: - UpdateProgressBar.Value = 0; StatusLabel.Text = "Idle"; UpdateButton.Enabled = true; - UpdateProgressBar.Style = ProgressBarStyle.Blocks; break; case TGByondStatus.Downloading: - UpdateProgressBar.Value = 50; StatusLabel.Text = "Downloading..."; UpdateButton.Enabled = false; - UpdateProgressBar.Style = ProgressBarStyle.Blocks; break; case TGByondStatus.Staging: - UpdateProgressBar.Value = 100; StatusLabel.Text = "Staging..."; UpdateButton.Enabled = false; - UpdateProgressBar.Style = ProgressBarStyle.Blocks; break; case TGByondStatus.Staged: StagedVersionTitle.Visible = true; StagedVersionLabel.Visible = true; StagedVersionLabel.Text = BYOND.GetVersion(TGByondVersion.Staged) ?? "Unknown"; - if (UpdateProgressBar.Style != ProgressBarStyle.Marquee || UpdateProgressBar.MarqueeAnimationSpeed != 50) - { - UpdateProgressBar.Style = ProgressBarStyle.Marquee; - UpdateProgressBar.MarqueeAnimationSpeed = 50; - } StatusLabel.Text = "Staged and waiting for BYOND to shutdown..."; UpdateButton.Enabled = true; break; case TGByondStatus.Updating: - UpdateProgressBar.Style = ProgressBarStyle.Marquee; - UpdateProgressBar.MarqueeAnimationSpeed = 200; StatusLabel.Text = "Applying update..."; UpdateButton.Enabled = false; break; } - } - - private void BYONDTimer_Tick(object sender, EventArgs e) - { - try + var error = Server.GetComponent().GetError(); + if (error != lastReadError) { - UpdateBYONDButtons(); - var error = Server.GetComponent().GetError(); - if (error != lastReadError) - { - lastReadError = error; - if (error != null) - MessageBox.Show("An error occurred: " + lastReadError); - } - } - catch (Exception ex) - { - BYONDTimer.Stop(); - Program.ServiceDisconnectException(ex); + lastReadError = error; + if (error != null) + MessageBox.Show("An error occurred: " + lastReadError); } } } diff --git a/TGControlPanel/Main.Designer.cs b/TGControlPanel/Main.Designer.cs index dd296d5ddc..acd77ebb86 100644 --- a/TGControlPanel/Main.Designer.cs +++ b/TGControlPanel/Main.Designer.cs @@ -28,13 +28,8 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Main)); this.RepoBGW = new System.ComponentModel.BackgroundWorker(); - this.BYONDTimer = new System.Windows.Forms.Timer(this.components); - this.ServerTimer = new System.Windows.Forms.Timer(this.components); - this.WorldStatusChecker = new System.ComponentModel.BackgroundWorker(); - this.WorldStatusTimer = new System.Windows.Forms.Timer(this.components); this.FullUpdateWorker = new System.ComponentModel.BackgroundWorker(); this.ServerStartBGW = new System.ComponentModel.BackgroundWorker(); this.ChatPanel = new System.Windows.Forms.TabPage(); @@ -75,6 +70,7 @@ this.AdminModeSpecial = new System.Windows.Forms.RadioButton(); this.AdminModeNormal = new System.Windows.Forms.RadioButton(); this.ServerPanel = new System.Windows.Forms.TabPage(); + this.ServerPageRefreshButton = new System.Windows.Forms.Button(); this.AutostartCheckbox = new System.Windows.Forms.CheckBox(); this.WebclientCheckBox = new System.Windows.Forms.CheckBox(); this.WorldAnnounceButton = new System.Windows.Forms.Button(); @@ -105,10 +101,10 @@ this.CompilerLabel = new System.Windows.Forms.Label(); this.compileButton = new System.Windows.Forms.Button(); this.initializeButton = new System.Windows.Forms.Button(); - this.compilerProgressBar = new System.Windows.Forms.ProgressBar(); this.ServerStatusLabel = new System.Windows.Forms.Label(); this.ServerStatusTitle = new System.Windows.Forms.Label(); this.BYONDPanel = new System.Windows.Forms.TabPage(); + this.BYONDRefreshButton = new System.Windows.Forms.Button(); this.LatestVersionLabel = new System.Windows.Forms.Label(); this.LatestVersionTitle = new System.Windows.Forms.Label(); this.StagedVersionLabel = new System.Windows.Forms.Label(); @@ -121,8 +117,8 @@ this.UpdateButton = new System.Windows.Forms.Button(); this.MinorVersionNumeric = new System.Windows.Forms.NumericUpDown(); this.MajorVersionNumeric = new System.Windows.Forms.NumericUpDown(); - this.UpdateProgressBar = new System.Windows.Forms.ProgressBar(); this.RepoPanel = new System.Windows.Forms.TabPage(); + this.TGSJsonUpdate = new System.Windows.Forms.Button(); this.RepoRefreshButton = new System.Windows.Forms.Button(); this.BackupTagsList = new System.Windows.Forms.ListBox(); this.ResetRemote = new System.Windows.Forms.Button(); @@ -158,7 +154,6 @@ this.StaticFileCreateButton = new System.Windows.Forms.Button(); this.label6 = new System.Windows.Forms.Label(); this.StaticFileListBox = new System.Windows.Forms.ListBox(); - this.TGSJsonUpdate = new System.Windows.Forms.Button(); this.ChatPanel.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.ChatPortSelector)).BeginInit(); this.ChatProviderSelectorPanel.SuspendLayout(); @@ -180,27 +175,6 @@ this.RepoBGW.WorkerReportsProgress = true; this.RepoBGW.WorkerSupportsCancellation = true; // - // BYONDTimer - // - this.BYONDTimer.Interval = 1000; - this.BYONDTimer.Tick += new System.EventHandler(this.BYONDTimer_Tick); - // - // ServerTimer - // - this.ServerTimer.Interval = 10000; - this.ServerTimer.Tick += new System.EventHandler(this.ServerTimer_Tick); - // - // WorldStatusChecker - // - this.WorldStatusChecker.WorkerReportsProgress = true; - this.WorldStatusChecker.WorkerSupportsCancellation = true; - this.WorldStatusChecker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.WorldStatusChecker_DoWork); - // - // WorldStatusTimer - // - this.WorldStatusTimer.Interval = 10000; - this.WorldStatusTimer.Tick += new System.EventHandler(this.WorldStatusTimer_Tick); - // // FullUpdateWorker // this.FullUpdateWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.FullUpdateWorker_DoWork); @@ -656,6 +630,7 @@ // ServerPanel // this.ServerPanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(40)))), ((int)(((byte)(34))))); + this.ServerPanel.Controls.Add(this.ServerPageRefreshButton); this.ServerPanel.Controls.Add(this.AutostartCheckbox); this.ServerPanel.Controls.Add(this.WebclientCheckBox); this.ServerPanel.Controls.Add(this.WorldAnnounceButton); @@ -686,7 +661,6 @@ this.ServerPanel.Controls.Add(this.CompilerLabel); this.ServerPanel.Controls.Add(this.compileButton); this.ServerPanel.Controls.Add(this.initializeButton); - this.ServerPanel.Controls.Add(this.compilerProgressBar); this.ServerPanel.Controls.Add(this.ServerStatusLabel); this.ServerPanel.Controls.Add(this.ServerStatusTitle); this.ServerPanel.Location = new System.Drawing.Point(4, 22); @@ -696,6 +670,17 @@ this.ServerPanel.TabIndex = 2; this.ServerPanel.Text = "Server"; // + // ServerPageRefreshButton + // + this.ServerPageRefreshButton.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.ServerPageRefreshButton.Location = new System.Drawing.Point(626, 13); + this.ServerPageRefreshButton.Name = "ServerPageRefreshButton"; + this.ServerPageRefreshButton.Size = new System.Drawing.Size(118, 28); + this.ServerPageRefreshButton.TabIndex = 43; + this.ServerPageRefreshButton.Text = "Refresh"; + this.ServerPageRefreshButton.UseVisualStyleBackColor = true; + this.ServerPageRefreshButton.Click += new System.EventHandler(this.ServerPageRefreshButton_Click); + // // AutostartCheckbox // this.AutostartCheckbox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -826,7 +811,7 @@ // this.CompileCancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.CompileCancelButton.Enabled = false; - this.CompileCancelButton.Location = new System.Drawing.Point(737, 302); + this.CompileCancelButton.Location = new System.Drawing.Point(382, 302); this.CompileCancelButton.Name = "CompileCancelButton"; this.CompileCancelButton.Size = new System.Drawing.Size(69, 31); this.CompileCancelButton.TabIndex = 31; @@ -1060,16 +1045,6 @@ this.initializeButton.UseVisualStyleBackColor = true; this.initializeButton.Click += new System.EventHandler(this.InitializeButton_Click); // - // compilerProgressBar - // - this.compilerProgressBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.compilerProgressBar.Location = new System.Drawing.Point(110, 302); - this.compilerProgressBar.MarqueeAnimationSpeed = 50; - this.compilerProgressBar.Name = "compilerProgressBar"; - this.compilerProgressBar.Size = new System.Drawing.Size(618, 31); - this.compilerProgressBar.TabIndex = 10; - // // ServerStatusLabel // this.ServerStatusLabel.AutoSize = true; @@ -1097,6 +1072,7 @@ // BYONDPanel // this.BYONDPanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(40)))), ((int)(((byte)(34))))); + this.BYONDPanel.Controls.Add(this.BYONDRefreshButton); this.BYONDPanel.Controls.Add(this.LatestVersionLabel); this.BYONDPanel.Controls.Add(this.LatestVersionTitle); this.BYONDPanel.Controls.Add(this.StagedVersionLabel); @@ -1109,13 +1085,22 @@ this.BYONDPanel.Controls.Add(this.UpdateButton); this.BYONDPanel.Controls.Add(this.MinorVersionNumeric); this.BYONDPanel.Controls.Add(this.MajorVersionNumeric); - this.BYONDPanel.Controls.Add(this.UpdateProgressBar); this.BYONDPanel.Location = new System.Drawing.Point(4, 22); this.BYONDPanel.Name = "BYONDPanel"; this.BYONDPanel.Size = new System.Drawing.Size(868, 366); this.BYONDPanel.TabIndex = 1; this.BYONDPanel.Text = "BYOND"; // + // BYONDRefreshButton + // + this.BYONDRefreshButton.Location = new System.Drawing.Point(462, 252); + this.BYONDRefreshButton.Name = "BYONDRefreshButton"; + this.BYONDRefreshButton.Size = new System.Drawing.Size(118, 28); + this.BYONDRefreshButton.TabIndex = 14; + this.BYONDRefreshButton.Text = "Refresh"; + this.BYONDRefreshButton.UseVisualStyleBackColor = true; + this.BYONDRefreshButton.Click += new System.EventHandler(this.BYONDRefreshButton_Click); + // // LatestVersionLabel // this.LatestVersionLabel.AutoSize = true; @@ -1227,7 +1212,7 @@ // // UpdateButton // - this.UpdateButton.Location = new System.Drawing.Point(372, 252); + this.UpdateButton.Location = new System.Drawing.Point(268, 252); this.UpdateButton.Name = "UpdateButton"; this.UpdateButton.Size = new System.Drawing.Size(118, 28); this.UpdateButton.TabIndex = 3; @@ -1268,14 +1253,6 @@ 0, 0, 0}); - // - // UpdateProgressBar - // - this.UpdateProgressBar.Location = new System.Drawing.Point(107, 286); - this.UpdateProgressBar.MarqueeAnimationSpeed = 50; - this.UpdateProgressBar.Name = "UpdateProgressBar"; - this.UpdateProgressBar.Size = new System.Drawing.Size(650, 31); - this.UpdateProgressBar.TabIndex = 0; // // RepoPanel // @@ -1312,6 +1289,18 @@ this.RepoPanel.TabIndex = 0; this.RepoPanel.Text = "Repository"; // + // TGSJsonUpdate + // + this.TGSJsonUpdate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.TGSJsonUpdate.Location = new System.Drawing.Point(722, 212); + this.TGSJsonUpdate.Name = "TGSJsonUpdate"; + this.TGSJsonUpdate.Size = new System.Drawing.Size(140, 29); + this.TGSJsonUpdate.TabIndex = 36; + this.TGSJsonUpdate.Text = "Update TGS3.json"; + this.TGSJsonUpdate.UseVisualStyleBackColor = true; + this.TGSJsonUpdate.Visible = false; + this.TGSJsonUpdate.Click += new System.EventHandler(this.TGSJsonUpdate_Click); + // // RepoRefreshButton // this.RepoRefreshButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); @@ -1736,18 +1725,6 @@ this.StaticFileListBox.TabIndex = 0; this.StaticFileListBox.SelectedIndexChanged += new System.EventHandler(this.StaticFileListBox_SelectedIndexChanged); // - // TGSJsonUpdate - // - this.TGSJsonUpdate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.TGSJsonUpdate.Location = new System.Drawing.Point(722, 212); - this.TGSJsonUpdate.Name = "TGSJsonUpdate"; - this.TGSJsonUpdate.Size = new System.Drawing.Size(140, 29); - this.TGSJsonUpdate.TabIndex = 36; - this.TGSJsonUpdate.Text = "Update TGS3.json"; - this.TGSJsonUpdate.UseVisualStyleBackColor = true; - this.TGSJsonUpdate.Visible = false; - this.TGSJsonUpdate.Click += new System.EventHandler(this.TGSJsonUpdate_Click); - // // Main // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1786,10 +1763,6 @@ #endregion private System.ComponentModel.BackgroundWorker RepoBGW; - private System.Windows.Forms.Timer BYONDTimer; - private System.Windows.Forms.Timer ServerTimer; - private System.ComponentModel.BackgroundWorker WorldStatusChecker; - private System.Windows.Forms.Timer WorldStatusTimer; private System.ComponentModel.BackgroundWorker FullUpdateWorker; private System.ComponentModel.BackgroundWorker ServerStartBGW; private System.Windows.Forms.TabPage ChatPanel; @@ -1860,7 +1833,6 @@ private System.Windows.Forms.Label CompilerLabel; private System.Windows.Forms.Button compileButton; private System.Windows.Forms.Button initializeButton; - private System.Windows.Forms.ProgressBar compilerProgressBar; private System.Windows.Forms.Label ServerStatusLabel; private System.Windows.Forms.Label ServerStatusTitle; private System.Windows.Forms.TabPage BYONDPanel; @@ -1876,7 +1848,6 @@ private System.Windows.Forms.Button UpdateButton; private System.Windows.Forms.NumericUpDown MinorVersionNumeric; private System.Windows.Forms.NumericUpDown MajorVersionNumeric; - private System.Windows.Forms.ProgressBar UpdateProgressBar; private System.Windows.Forms.TabPage RepoPanel; private System.Windows.Forms.Button RepoRefreshButton; private System.Windows.Forms.ListBox BackupTagsList; @@ -1914,5 +1885,7 @@ private System.Windows.Forms.Button StaticFilesRefreshButton; private System.Windows.Forms.Button StaticFileDownloadButton; private System.Windows.Forms.Button TGSJsonUpdate; + private System.Windows.Forms.Button BYONDRefreshButton; + private System.Windows.Forms.Button ServerPageRefreshButton; } } diff --git a/TGControlPanel/Main.cs b/TGControlPanel/Main.cs index b7db343f41..c464af6535 100644 --- a/TGControlPanel/Main.cs +++ b/TGControlPanel/Main.cs @@ -27,6 +27,18 @@ namespace TGControlPanel private void Panels_SelectedIndexChanged(object sender, EventArgs e) { + switch (Panels.SelectedIndex) + { + case 1: //byond + UpdateBYONDButtons(); + break; + case 2: //scp + LoadServerPage(); + break; + case 3: //chat + LoadChatPage(); + break; + } Properties.Settings.Default.LastPageIndex = Panels.SelectedIndex; } } diff --git a/TGControlPanel/Main.resx b/TGControlPanel/Main.resx index ddedfe418d..02c5de84c9 100644 --- a/TGControlPanel/Main.resx +++ b/TGControlPanel/Main.resx @@ -120,18 +120,6 @@ 17, 17 - - 244, 17 - - - 416, 18 - - - 532, 18 - - - 694, 18 - 843, 18 diff --git a/TGControlPanel/ServerPage.cs b/TGControlPanel/ServerPage.cs index fd7928595a..c4cf091de4 100644 --- a/TGControlPanel/ServerPage.cs +++ b/TGControlPanel/ServerPage.cs @@ -25,9 +25,6 @@ namespace TGControlPanel void InitServerPage() { LoadServerPage(); - ServerTimer.Start(); - WorldStatusChecker.RunWorkerAsync(); - WorldStatusChecker.RunWorkerCompleted += WorldStatusChecker_RunWorkerCompleted; FullUpdateWorker.RunWorkerCompleted += FullUpdateWorker_RunWorkerCompleted; ServerPathTextbox.LostFocus += ServerPathTextbox_LostFocus; ServerPathTextbox.KeyDown += ServerPathTextbox_KeyDown; @@ -63,14 +60,6 @@ namespace TGControlPanel TestmergeButton.Enabled = true; UpdateTestmergeButton.Enabled = true; LoadServerPage(); - ServerTimer.Start(); - } - - private void WorldStatusChecker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) - { - if (DDStatusString != "Topic recieve error!" || ServerStatusLabel.Text == "OFFLINE") - ServerStatusLabel.Text = DDStatusString; - WorldStatusTimer.Start(); } private void CompileCancelButton_Click(object sender, EventArgs e) @@ -110,7 +99,6 @@ namespace TGControlPanel WebclientCheckBox.Visible = RepoExists; PortSelector.Visible = RepoExists; projectNameText.Visible = RepoExists; - compilerProgressBar.Visible = RepoExists; CompilerStatusLabel.Visible = RepoExists; CompileCancelButton.Visible = RepoExists; CompilerLabel.Visible = RepoExists; @@ -171,35 +159,30 @@ namespace TGControlPanel { case TGCompilerStatus.Compiling: CompilerStatusLabel.Text = "Compiling..."; - compilerProgressBar.Style = ProgressBarStyle.Marquee; compileButton.Enabled = false; initializeButton.Enabled = false; CompileCancelButton.Enabled = true; break; case TGCompilerStatus.Initializing: CompilerStatusLabel.Text = "Initializing..."; - compilerProgressBar.Style = ProgressBarStyle.Marquee; compileButton.Enabled = false; initializeButton.Enabled = false; CompileCancelButton.Enabled = false; break; case TGCompilerStatus.Initialized: CompilerStatusLabel.Text = "Idle"; - compilerProgressBar.Style = ProgressBarStyle.Blocks; initializeButton.Enabled = true; compileButton.Enabled = true; CompileCancelButton.Enabled = false; break; case TGCompilerStatus.Uninitialized: CompilerStatusLabel.Text = "Uninitialized"; - compilerProgressBar.Style = ProgressBarStyle.Blocks; compileButton.Enabled = false; initializeButton.Enabled = true; CompileCancelButton.Enabled = false; break; default: CompilerStatusLabel.Text = "Unknown!"; - compilerProgressBar.Style = ProgressBarStyle.Blocks; initializeButton.Enabled = true; compileButton.Enabled = true; CompileCancelButton.Enabled = true; @@ -214,19 +197,7 @@ namespace TGControlPanel updatingFields = false; } } - - private void ServerTimer_Tick(object sender, System.EventArgs e) - { - try - { - LoadServerPage(); - } - catch (Exception ex) - { - ServerTimer.Stop(); - Program.ServiceDisconnectException(ex); - } - } + private void ProjectNameText_LostFocus(object sender, EventArgs e) { UpdateProjectName(); @@ -256,7 +227,6 @@ namespace TGControlPanel UpdateMergeButton.Enabled = false; TestmergeButton.Enabled = false; UpdateTestmergeButton.Enabled = false; - compilerProgressBar.Style = ProgressBarStyle.Marquee; switch (fuAction) { case FullUpdateAction.Testmerge: @@ -272,10 +242,14 @@ namespace TGControlPanel CompilerStatusLabel.Text = String.Format("Updating and testmerging pull request #{0}...", testmergePR); break; } - ServerTimer.Stop(); FullUpdateWorker.RunWorkerAsync(); } + private void ServerPageRefreshButton_Click(object sender, EventArgs e) + { + LoadServerPage(); + } + private void InitializeButton_Click(object sender, EventArgs e) { if (!Server.GetComponent().Initialize()) @@ -288,27 +262,6 @@ namespace TGControlPanel MessageBox.Show("Unable to start compilation!"); LoadServerPage(); } - //because of lol byond this can take some time... - private void WorldStatusChecker_DoWork(object sender, DoWorkEventArgs e) - { - try - { - if (!Server.GetComponent().Exists()) - DDStatusString = "NOT INSTALLED"; - else - DDStatusString = Server.GetComponent().StatusString(true); - } - catch - { - DDStatusString = "ERROR"; - } - } - - private void WorldStatusTimer_Tick(object sender, System.EventArgs e) - { - WorldStatusTimer.Stop(); - WorldStatusChecker.RunWorkerAsync(); - } private void AutostartCheckbox_CheckedChanged(object sender, System.EventArgs e) { @@ -375,61 +328,68 @@ namespace TGControlPanel private void FullUpdateWorker_DoWork(object sender, DoWorkEventArgs e) { - var Repo = Server.GetComponent(); - var DM = Server.GetComponent(); - switch (fuAction) + try { - case FullUpdateAction.Testmerge: - updateError = Repo.MergePullRequest(testmergePR); - if (updateError == null) - { - Repo.GenerateChangelog(out updateError); - updateError = DM.Compile(true) ? updateError : "Compilation failed!"; - } - break; - case FullUpdateAction.UpdateHard: - updateError = Repo.Update(true); - if (updateError == null) - { - Repo.GenerateChangelog(out updateError); - if (updateError == null) - updateError = Repo.PushChangelog(); - updateError = DM.Compile(true) ? updateError : "Compilation failed!"; - } - break; - case FullUpdateAction.UpdateHardTestmerge: - updateError = Repo.Update(true); - if (updateError == null) - { - Repo.GenerateChangelog(out updateError); - if (updateError == null) - updateError = Repo.PushChangelog(); + var Repo = Server.GetComponent(); + var DM = Server.GetComponent(); + switch (fuAction) + { + case FullUpdateAction.Testmerge: updateError = Repo.MergePullRequest(testmergePR); if (updateError == null) { Repo.GenerateChangelog(out updateError); updateError = DM.Compile(true) ? updateError : "Compilation failed!"; } - } - break; - case FullUpdateAction.UpdateMerge: - updateError = Repo.Update(false); - if (updateError == null) - { - Repo.GenerateChangelog(out updateError); + break; + case FullUpdateAction.UpdateHard: + updateError = Repo.Update(true); if (updateError == null) - Repo.PushChangelog(); //not an error 99% of the time if this fails, just a dirty tree - updateError = DM.Compile(true) ? updateError : "Compilation failed!"; - } - break; - case FullUpdateAction.Reset: - updateError = Repo.Reset(true); - if (updateError == null) - { - Repo.GenerateChangelog(out updateError); - updateError = DM.Compile(true) ? updateError : "Compilation failed!"; - } - break; + { + Repo.GenerateChangelog(out updateError); + if (updateError == null) + updateError = Repo.PushChangelog(); + updateError = DM.Compile(true) ? updateError : "Compilation failed!"; + } + break; + case FullUpdateAction.UpdateHardTestmerge: + updateError = Repo.Update(true); + if (updateError == null) + { + Repo.GenerateChangelog(out updateError); + if (updateError == null) + updateError = Repo.PushChangelog(); + updateError = Repo.MergePullRequest(testmergePR); + if (updateError == null) + { + Repo.GenerateChangelog(out updateError); + updateError = DM.Compile(true) ? updateError : "Compilation failed!"; + } + } + break; + case FullUpdateAction.UpdateMerge: + updateError = Repo.Update(false); + if (updateError == null) + { + Repo.GenerateChangelog(out updateError); + if (updateError == null) + Repo.PushChangelog(); //not an error 99% of the time if this fails, just a dirty tree + updateError = DM.Compile(true) ? updateError : "Compilation failed!"; + } + break; + case FullUpdateAction.Reset: + updateError = Repo.Reset(true); + if (updateError == null) + { + Repo.GenerateChangelog(out updateError); + updateError = DM.Compile(true) ? updateError : "Compilation failed!"; + } + break; + } + } + catch (Exception ex) + { + Program.ServiceDisconnectException(ex); } } private void ResetTestmerge_Click(object sender, EventArgs e)