Kill off the unused update window code.

This commit is contained in:
UnknownShadow200 2016-04-13 18:58:54 +10:00
parent 0e9a2da153
commit a3e73add6e
5 changed files with 1 additions and 1495 deletions

View File

@ -26,7 +26,7 @@ namespace MCGalaxy.Commands
public override bool museumUsable { get { return true; } } public override bool museumUsable { get { return true; } }
public override LevelPermission defaultRank { get { return LevelPermission.Banned; } } public override LevelPermission defaultRank { get { return LevelPermission.Banned; } }
public override CommandAlias[] Aliases { public override CommandAlias[] Aliases {
get { return new[] { new CommandAlias("cmdhelp"), new CommandAlias("ranks", "ranks"), , get { return new[] { new CommandAlias("cmdhelp"), new CommandAlias("ranks", "ranks"),
new CommandAlias("cmdlist", "commands"), new CommandAlias("commands", "commands") }; } new CommandAlias("cmdlist", "commands"), new CommandAlias("commands", "commands") }; }
} }
public CmdHelp() { } public CmdHelp() { }

View File

@ -1,197 +0,0 @@
namespace MCGalaxy.Gui
{
partial class UpdateWindow
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UpdateWindow));
this.panel1 = new System.Windows.Forms.Panel();
this.cmdUpdate = new System.Windows.Forms.Button();
this.listRevisions = new System.Windows.Forms.ListBox();
this.chkAutoUpdate = new System.Windows.Forms.CheckBox();
this.cmdDiscard = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.panel2 = new System.Windows.Forms.Panel();
this.revisions_downloading = new System.Windows.Forms.Label();
this.txtCountdown = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.chkNotify = new System.Windows.Forms.CheckBox();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.Controls.Add(this.cmdUpdate);
this.panel1.Controls.Add(this.listRevisions);
this.panel1.Location = new System.Drawing.Point(8, 7);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(148, 173);
this.panel1.TabIndex = 0;
//
// cmdUpdate
//
this.cmdUpdate.Font = new System.Drawing.Font("Calibri", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cmdUpdate.Location = new System.Drawing.Point(4, 70);
this.cmdUpdate.Name = "cmdUpdate";
this.cmdUpdate.Size = new System.Drawing.Size(82, 23);
this.cmdUpdate.TabIndex = 2;
this.cmdUpdate.Text = "Update";
this.cmdUpdate.UseVisualStyleBackColor = true;
this.cmdUpdate.Click += new System.EventHandler(this.cmdUpdate_Click);
//
// listRevisions
//
this.listRevisions.Font = new System.Drawing.Font("Calibri", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.listRevisions.FormattingEnabled = true;
this.listRevisions.Location = new System.Drawing.Point(89, 10);
this.listRevisions.Name = "listRevisions";
this.listRevisions.Size = new System.Drawing.Size(53, 147);
this.listRevisions.TabIndex = 0;
this.listRevisions.SelectedValueChanged += new System.EventHandler(this.listRevisions_SelectedValueChanged);
//
// chkAutoUpdate
//
this.chkAutoUpdate.AutoSize = true;
this.chkAutoUpdate.Font = new System.Drawing.Font("Calibri", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.chkAutoUpdate.Location = new System.Drawing.Point(28, 4);
this.chkAutoUpdate.Name = "chkAutoUpdate";
this.chkAutoUpdate.Size = new System.Drawing.Size(133, 17);
this.chkAutoUpdate.TabIndex = 1;
this.chkAutoUpdate.Text = "Auto update to newest";
this.chkAutoUpdate.UseVisualStyleBackColor = true;
//
// cmdDiscard
//
this.cmdDiscard.Font = new System.Drawing.Font("Calibri", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cmdDiscard.Location = new System.Drawing.Point(111, 280);
this.cmdDiscard.Name = "cmdDiscard";
this.cmdDiscard.Size = new System.Drawing.Size(59, 23);
this.cmdDiscard.TabIndex = 2;
this.cmdDiscard.Text = "Discard";
this.cmdDiscard.UseVisualStyleBackColor = true;
this.cmdDiscard.Click += new System.EventHandler(this.cmdDiscard_Click);
//
// button1
//
this.button1.Font = new System.Drawing.Font("Calibri", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button1.Location = new System.Drawing.Point(35, 279);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(59, 23);
this.button1.TabIndex = 3;
this.button1.Text = "Save";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// panel2
//
this.panel2.Controls.Add(this.revisions_downloading);
this.panel2.Controls.Add(this.txtCountdown);
this.panel2.Controls.Add(this.label1);
this.panel2.Controls.Add(this.chkNotify);
this.panel2.Controls.Add(this.chkAutoUpdate);
this.panel2.Location = new System.Drawing.Point(8, 189);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(209, 82);
this.panel2.TabIndex = 4;
//
// revisions_downloading
//
this.revisions_downloading.AutoSize = true;
this.revisions_downloading.BackColor = System.Drawing.Color.Transparent;
this.revisions_downloading.ForeColor = System.Drawing.Color.Red;
this.revisions_downloading.Location = new System.Drawing.Point(-3, 68);
this.revisions_downloading.Name = "revisions_downloading";
this.revisions_downloading.Size = new System.Drawing.Size(216, 13);
this.revisions_downloading.TabIndex = 5;
this.revisions_downloading.Text = "Please Wait while downloading revisions list.";
//
// txtCountdown
//
this.txtCountdown.Location = new System.Drawing.Point(161, 45);
this.txtCountdown.Name = "txtCountdown";
this.txtCountdown.Size = new System.Drawing.Size(42, 20);
this.txtCountdown.TabIndex = 4;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Calibri", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(2, 49);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(158, 13);
this.label1.TabIndex = 3;
this.label1.Text = "Time (in seconds) to countdown:";
//
// chkNotify
//
this.chkNotify.AutoSize = true;
this.chkNotify.Font = new System.Drawing.Font("Calibri", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.chkNotify.Location = new System.Drawing.Point(28, 23);
this.chkNotify.Name = "chkNotify";
this.chkNotify.Size = new System.Drawing.Size(139, 17);
this.chkNotify.TabIndex = 2;
this.chkNotify.Text = "Notify in-game of restart";
this.chkNotify.UseVisualStyleBackColor = true;
//
// UpdateWindow
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(223, 318);
this.Controls.Add(this.panel2);
this.Controls.Add(this.button1);
this.Controls.Add(this.cmdDiscard);
this.Controls.Add(this.panel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.Name = "UpdateWindow";
this.Text = "Update";
this.Load += new System.EventHandler(this.UpdateWindow_Load);
this.panel1.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button cmdUpdate;
private System.Windows.Forms.ListBox listRevisions;
private System.Windows.Forms.CheckBox chkAutoUpdate;
private System.Windows.Forms.Button cmdDiscard;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.CheckBox chkNotify;
private System.Windows.Forms.TextBox txtCountdown;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label revisions_downloading;
}
}

View File

@ -1,137 +0,0 @@
/*
Copyright 2010 MCSharp team (Modified for use with MCZall/MCLawl/MCGalaxy)
Dual-licensed under the Educational Community License, Version 2.0 and
the GNU General Public License, Version 3 (the "Licenses"); you may
not use this file except in compliance with the Licenses. You may
obtain a copy of the Licenses at
http://www.opensource.org/licenses/ecl2.php
http://www.gnu.org/licenses/gpl-3.0.html
Unless required by applicable law or agreed to in writing,
software distributed under the Licenses are distributed on an "AS IS"
BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied. See the Licenses for the specific language governing
permissions and limitations under the Licenses.
*/
using System;
using System.ComponentModel;
using System.IO;
using System.Net;
using System.Windows.Forms;
namespace MCGalaxy.Gui
{
public partial class UpdateWindow : Form
{
public UpdateWindow()
{
InitializeComponent();
}
private void UpdateWindow_Load(object sender, EventArgs e)
{
UpdLoadProp("properties/update.properties");
using (WebClient client = new WebClient())
{
//client.DownloadFile(ServerSettings.RevisionList, "text/revs.txt");
//client.DownloadFileAsync(ServerSettings.RevisionList, "text/revs.txt");
Uri uri = new Uri(ServerSettings.RevisionList);
client.DownloadFileCompleted += Downloaded;
client.DownloadFileAsync(uri, "text/revs.txt");
}
}
private void Downloaded(object sender, AsyncCompletedEventArgs e)
{
revisions_downloading.Visible = false;
if (File.Exists("text/revs.txt"))
{
listRevisions.Items.Clear();
FileInfo file = new FileInfo("text/revs.txt");
StreamReader stRead = file.OpenText();
if (File.Exists("text/revs.txt"))
while (!stRead.EndOfStream)
listRevisions.Items.Add(stRead.ReadLine());
stRead.Close();
stRead.Dispose();
file.Delete();
}
else MessageBox.Show("Error downloading revisions list");
}
public void UpdSave(string givenPath)
{
File.Create(givenPath).Dispose();
using (StreamWriter SW = File.CreateText(givenPath))
{
SW.WriteLine("#This file manages the update process");
SW.WriteLine("#Toggle AutoUpdate to true for the server to automatically update");
SW.WriteLine("#Notify notifies players in-game of impending restart");
SW.WriteLine("#Restart Countdown is how long in seconds the server will count before restarting and updating");
SW.WriteLine();
SW.WriteLine("autoupdate= " + chkAutoUpdate.Checked);
SW.WriteLine("notify = " + chkNotify.Checked);
SW.WriteLine("restartcountdown = " + txtCountdown.Text);
}
Close();
}
public void UpdLoadProp(string givenPath) {
PropertiesFile.Read(givenPath, LineProcessor);
}
void LineProcessor(string key, string value) {
switch (key.ToLower()) {
case "autoupdate":
chkAutoUpdate.Checked = value.ToLower() == "true"; break;
case "notify":
chkNotify.Checked = value.ToLower() == "true"; break;
case "restartcountdown":
txtCountdown.Text = value; break;
}
}
private void button1_Click(object sender, EventArgs e)
{
string chkNum = txtCountdown.Text.Trim();
double Num;
bool isNum = double.TryParse(chkNum, out Num);
if (!isNum || txtCountdown.Text == "")
{
MessageBox.Show("You must enter a number for the countdown");
}
else
{
UpdSave("properties/update.properties");
Server.autoupdate = chkAutoUpdate.Checked;
}
}
private void cmdDiscard_Click(object sender, EventArgs e)
{
UpdLoadProp("properties/update.properties");
Close();
}
private void cmdUpdate_Click(object sender, EventArgs e)
{
MCGalaxy_.Gui.Program.PerformUpdate();
/* if (!Program.CurrentUpdate)
Program.UpdateCheck();
else
{
Thread messageThread = new Thread(new ThreadStart(delegate
{
MessageBox.Show("Already checking for updates.");
})); messageThread.Start();
} */
}
private void listRevisions_SelectedValueChanged(object sender, EventArgs e)
{
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -596,12 +596,6 @@
<Compile Include="GUI\PropertyWindow.Designer.cs"> <Compile Include="GUI\PropertyWindow.Designer.cs">
<DependentUpon>PropertyWindow.cs</DependentUpon> <DependentUpon>PropertyWindow.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="GUI\UpdateWindow.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="GUI\UpdateWindow.Designer.cs">
<DependentUpon>UpdateWindow.cs</DependentUpon>
</Compile>
<Compile Include="Network\IBeat.cs" /> <Compile Include="Network\IBeat.cs" />
<Compile Include="Levels\Level.cs" /> <Compile Include="Levels\Level.cs" />
<Compile Include="Database\MySQL.cs" /> <Compile Include="Database\MySQL.cs" />
@ -652,10 +646,6 @@
<DependentUpon>PropertyWindow.cs</DependentUpon> <DependentUpon>PropertyWindow.cs</DependentUpon>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="GUI\UpdateWindow.resx">
<DependentUpon>UpdateWindow.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="GUI\Window.resx"> <EmbeddedResource Include="GUI\Window.resx">
<DependentUpon>Window.cs</DependentUpon> <DependentUpon>Window.cs</DependentUpon>
<SubType>Designer</SubType> <SubType>Designer</SubType>