Remove legacy SRB2Updater tool

Also unsupported and nonfunctional
This commit is contained in:
Eidolon 2022-07-17 19:40:53 -05:00
parent 23833997ee
commit 120293a840
34 changed files with 0 additions and 4316 deletions

View file

@ -1,53 +0,0 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace SRB2Updater
{
public class Bunny
{
List<Keys> Keys = new List<Keys>{System.Windows.Forms.Keys.Up, System.Windows.Forms.Keys.Up,
System.Windows.Forms.Keys.Down, System.Windows.Forms.Keys.Down,
System.Windows.Forms.Keys.Left, System.Windows.Forms.Keys.Right,
System.Windows.Forms.Keys.Left, System.Windows.Forms.Keys.Right,
System.Windows.Forms.Keys.B, System.Windows.Forms.Keys.A};
private int mPosition = -1;
public int Position
{
get { return mPosition; }
private set { mPosition = value; }
}
public bool IsCompletedBy(Keys key)
{
if (Keys[Position + 1] == key)
{
// move to next
Position++;
}
else if (Position == 1 && key == System.Windows.Forms.Keys.Up)
{
// stay where we are
}
else if (Keys[0] == key)
{
// restart at 1st
Position = 0;
}
else
{
// no match in sequence
Position = -1;
}
if (Position == Keys.Count - 1)
{
Position = -1;
return true;
}
return false;
}
}
}

View file

@ -1,266 +0,0 @@
namespace SRB2Updater
{
partial class Debug
{
/// <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()
{
this.lblOverallPercentage = new System.Windows.Forms.Label();
this.lblPercent = new System.Windows.Forms.Label();
this.lblOverall = new System.Windows.Forms.Label();
this.lblCurrent = new System.Windows.Forms.Label();
this.lblTotal = new System.Windows.Forms.Label();
this.lblRead = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.lblKonami = new System.Windows.Forms.Label();
this.lblRandom = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// lblOverallPercentage
//
this.lblOverallPercentage.AutoSize = true;
this.lblOverallPercentage.Location = new System.Drawing.Point(176, 150);
this.lblOverallPercentage.Name = "lblOverallPercentage";
this.lblOverallPercentage.Size = new System.Drawing.Size(21, 13);
this.lblOverallPercentage.TabIndex = 26;
this.lblOverallPercentage.Text = "0%";
//
// lblPercent
//
this.lblPercent.AutoSize = true;
this.lblPercent.Location = new System.Drawing.Point(176, 90);
this.lblPercent.Name = "lblPercent";
this.lblPercent.Size = new System.Drawing.Size(21, 13);
this.lblPercent.TabIndex = 25;
this.lblPercent.Text = "0%";
//
// lblOverall
//
this.lblOverall.AutoSize = true;
this.lblOverall.Location = new System.Drawing.Point(176, 120);
this.lblOverall.Name = "lblOverall";
this.lblOverall.Size = new System.Drawing.Size(41, 13);
this.lblOverall.TabIndex = 24;
this.lblOverall.Text = "0 bytes";
//
// lblCurrent
//
this.lblCurrent.AutoSize = true;
this.lblCurrent.Location = new System.Drawing.Point(176, 60);
this.lblCurrent.Name = "lblCurrent";
this.lblCurrent.Size = new System.Drawing.Size(41, 13);
this.lblCurrent.TabIndex = 23;
this.lblCurrent.Text = "0 bytes";
//
// lblTotal
//
this.lblTotal.AutoSize = true;
this.lblTotal.Location = new System.Drawing.Point(176, 0);
this.lblTotal.Name = "lblTotal";
this.lblTotal.Size = new System.Drawing.Size(41, 13);
this.lblTotal.TabIndex = 21;
this.lblTotal.Text = "0 bytes";
//
// lblRead
//
this.lblRead.AutoSize = true;
this.lblRead.Location = new System.Drawing.Point(176, 30);
this.lblRead.Name = "lblRead";
this.lblRead.Size = new System.Drawing.Size(41, 13);
this.lblRead.TabIndex = 22;
this.lblRead.Text = "0 bytes";
this.lblRead.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(3, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(105, 13);
this.label1.TabIndex = 27;
this.label1.Text = "Total Download Size";
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 2;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 66.66666F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel1.Controls.Add(this.label6, 0, 5);
this.tableLayoutPanel1.Controls.Add(this.label5, 0, 4);
this.tableLayoutPanel1.Controls.Add(this.label4, 0, 3);
this.tableLayoutPanel1.Controls.Add(this.label3, 0, 2);
this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.lblOverallPercentage, 1, 5);
this.tableLayoutPanel1.Controls.Add(this.lblTotal, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.lblOverall, 1, 4);
this.tableLayoutPanel1.Controls.Add(this.lblPercent, 1, 3);
this.tableLayoutPanel1.Controls.Add(this.lblRead, 1, 1);
this.tableLayoutPanel1.Controls.Add(this.lblCurrent, 1, 2);
this.tableLayoutPanel1.Controls.Add(this.label7, 0, 6);
this.tableLayoutPanel1.Controls.Add(this.lblKonami, 1, 6);
this.tableLayoutPanel1.Controls.Add(this.lblRandom, 1, 7);
this.tableLayoutPanel1.Controls.Add(this.label9, 0, 7);
this.tableLayoutPanel1.Location = new System.Drawing.Point(12, 12);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 9;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(260, 355);
this.tableLayoutPanel1.TabIndex = 28;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(3, 150);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(98, 13);
this.label6.TabIndex = 32;
this.label6.Text = "Overall Percentage";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(3, 120);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(132, 13);
this.label5.TabIndex = 31;
this.label5.Text = "Bytes Downloaded Overall";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(3, 90);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(118, 13);
this.label4.TabIndex = 30;
this.label4.Text = "Current File Percentage";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(3, 60);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(146, 13);
this.label3.TabIndex = 29;
this.label3.Text = "Downloaded from Current File";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(3, 30);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(62, 13);
this.label2.TabIndex = 28;
this.label2.Text = "Bytes Read";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(3, 180);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(42, 13);
this.label7.TabIndex = 33;
this.label7.Text = "Konami";
//
// lblKonami
//
this.lblKonami.AutoSize = true;
this.lblKonami.Location = new System.Drawing.Point(176, 180);
this.lblKonami.Name = "lblKonami";
this.lblKonami.Size = new System.Drawing.Size(16, 13);
this.lblKonami.TabIndex = 34;
this.lblKonami.Text = "-1";
//
// lblRandom
//
this.lblRandom.AutoSize = true;
this.lblRandom.Location = new System.Drawing.Point(176, 210);
this.lblRandom.Name = "lblRandom";
this.lblRandom.Size = new System.Drawing.Size(13, 13);
this.lblRandom.TabIndex = 37;
this.lblRandom.Text = "0";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(3, 210);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(47, 13);
this.label9.TabIndex = 38;
this.label9.Text = "Random";
//
// Debug
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 379);
this.Controls.Add(this.tableLayoutPanel1);
this.Name = "Debug";
this.Text = "Debug";
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label lblOverallPercentage;
private System.Windows.Forms.Label lblPercent;
private System.Windows.Forms.Label lblOverall;
private System.Windows.Forms.Label lblCurrent;
private System.Windows.Forms.Label lblTotal;
private System.Windows.Forms.Label lblRead;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label lblKonami;
private System.Windows.Forms.Label lblRandom;
private System.Windows.Forms.Label label9;
}
}

View file

@ -1,66 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace SRB2Updater
{
public partial class Debug : Form
{
public Debug()
{
InitializeComponent();
}
public String strOverall
{
get { return this.lblOverall.Text; }
set { this.lblOverall.Text = value; }
}
public String strKonami
{
get { return this.lblKonami.Text; }
set { this.lblKonami.Text = value; }
}
public String strRandom
{
get { return this.lblRandom.Text; }
set { this.lblRandom.Text = value; }
}
public String strOverallPercentage
{
get { return this.lblOverallPercentage.Text; }
set { this.lblOverallPercentage.Text = value; }
}
public String strCurrent
{
get { return this.lblCurrent.Text; }
set { this.lblCurrent.Text = value; }
}
public String strPercent
{
get { return this.lblPercent.Text; }
set { this.lblPercent.Text = value; }
}
public String strRead
{
get { return this.lblRead.Text; }
set { this.lblRead.Text = value; }
}
public String strTotal
{
get { return this.lblTotal.Text; }
set { this.lblTotal.Text = value; }
}
}
}

View file

@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -1,766 +0,0 @@
namespace SRB2Updater
{
partial class Launcher
{
/// <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.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Launcher));
this.panel1 = new System.Windows.Forms.Panel();
this.panel3 = new System.Windows.Forms.Panel();
this.btnOptions = new System.Windows.Forms.Button();
this.btnCheckFiles = new System.Windows.Forms.Button();
this.btnStartSRB2 = new System.Windows.Forms.Button();
this.panel2 = new System.Windows.Forms.Panel();
this.lblProgress = new System.Windows.Forms.Label();
this.update_optional = new System.Windows.Forms.CheckBox();
this.progress_overall = new System.Windows.Forms.ProgressBar();
this.progress_currentFile = new System.Windows.Forms.ProgressBar();
this.tab_web = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.panel10 = new System.Windows.Forms.Panel();
this.webBrowser3 = new System.Windows.Forms.WebBrowser();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.panel9 = new System.Windows.Forms.Panel();
this.webBrowser1 = new System.Windows.Forms.WebBrowser();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.panel8 = new System.Windows.Forms.Panel();
this.fileList = new System.Windows.Forms.DataGridView();
this.name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.filename = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.status = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.localmd5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.md5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.optional = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.calculated = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.serverTab = new System.Windows.Forms.TabPage();
this.panel6 = new System.Windows.Forms.Panel();
this.listViewServers = new System.Windows.Forms.ListView();
this.colhdrName = new System.Windows.Forms.ColumnHeader("(none)");
this.colhdrGametype = new System.Windows.Forms.ColumnHeader();
this.colhdrPing = new System.Windows.Forms.ColumnHeader();
this.colhdrPlayers = new System.Windows.Forms.ColumnHeader();
this.colhdrVersion = new System.Windows.Forms.ColumnHeader();
this.panel4 = new System.Windows.Forms.Panel();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.btnConnect = new System.Windows.Forms.Button();
this.panel5 = new System.Windows.Forms.Panel();
this.bannerRandom = new System.Windows.Forms.Panel();
this.backgroundWorkerQueryServers = new System.ComponentModel.BackgroundWorker();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.webBrowser2 = new System.Windows.Forms.WebBrowser();
this.panel1.SuspendLayout();
this.panel3.SuspendLayout();
this.panel2.SuspendLayout();
this.tab_web.SuspendLayout();
this.tabPage1.SuspendLayout();
this.panel10.SuspendLayout();
this.tabPage2.SuspendLayout();
this.panel9.SuspendLayout();
this.tabPage3.SuspendLayout();
this.panel8.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.fileList)).BeginInit();
this.serverTab.SuspendLayout();
this.panel6.SuspendLayout();
this.panel4.SuspendLayout();
this.groupBox1.SuspendLayout();
this.panel5.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(204)))), ((int)(((byte)(187)))));
this.panel1.Controls.Add(this.panel3);
this.panel1.Controls.Add(this.panel2);
this.panel1.Location = new System.Drawing.Point(12, 415);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(772, 125);
this.panel1.TabIndex = 0;
//
// panel3
//
this.panel3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(230)))), ((int)(((byte)(217)))));
this.panel3.Controls.Add(this.btnOptions);
this.panel3.Controls.Add(this.btnCheckFiles);
this.panel3.Controls.Add(this.btnStartSRB2);
this.panel3.Location = new System.Drawing.Point(557, 10);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(204, 104);
this.panel3.TabIndex = 1;
//
// btnOptions
//
this.btnOptions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.btnOptions.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnOptions.Location = new System.Drawing.Point(105, 72);
this.btnOptions.Name = "btnOptions";
this.btnOptions.Size = new System.Drawing.Size(96, 29);
this.btnOptions.TabIndex = 2;
this.btnOptions.Text = "Options";
this.btnOptions.UseVisualStyleBackColor = true;
this.btnOptions.Click += new System.EventHandler(this.btnOptions_Click);
//
// btnCheckFiles
//
this.btnCheckFiles.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.btnCheckFiles.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnCheckFiles.Location = new System.Drawing.Point(4, 72);
this.btnCheckFiles.Name = "btnCheckFiles";
this.btnCheckFiles.Size = new System.Drawing.Size(96, 29);
this.btnCheckFiles.TabIndex = 1;
this.btnCheckFiles.Text = "Check Files";
this.btnCheckFiles.UseVisualStyleBackColor = true;
this.btnCheckFiles.Click += new System.EventHandler(this.update_Load);
//
// btnStartSRB2
//
this.btnStartSRB2.BackColor = System.Drawing.Color.Transparent;
this.btnStartSRB2.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnStartSRB2.Location = new System.Drawing.Point(4, 4);
this.btnStartSRB2.Name = "btnStartSRB2";
this.btnStartSRB2.Size = new System.Drawing.Size(197, 62);
this.btnStartSRB2.TabIndex = 0;
this.btnStartSRB2.Text = "Start";
this.btnStartSRB2.UseVisualStyleBackColor = false;
this.btnStartSRB2.Click += new System.EventHandler(this.btnStartSRB2_Click);
//
// panel2
//
this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.panel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(230)))), ((int)(((byte)(217)))));
this.panel2.Controls.Add(this.lblProgress);
this.panel2.Controls.Add(this.update_optional);
this.panel2.Controls.Add(this.progress_overall);
this.panel2.Controls.Add(this.progress_currentFile);
this.panel2.Location = new System.Drawing.Point(10, 10);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(541, 105);
this.panel2.TabIndex = 0;
//
// lblProgress
//
this.lblProgress.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.lblProgress.AutoSize = true;
this.lblProgress.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblProgress.ForeColor = System.Drawing.Color.Black;
this.lblProgress.Location = new System.Drawing.Point(6, 68);
this.lblProgress.Name = "lblProgress";
this.lblProgress.Size = new System.Drawing.Size(299, 14);
this.lblProgress.TabIndex = 14;
this.lblProgress.Text = "Click \'Check Files\' to check for and apply updates.";
//
// update_optional
//
this.update_optional.AutoSize = true;
this.update_optional.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.update_optional.Location = new System.Drawing.Point(372, 68);
this.update_optional.Name = "update_optional";
this.update_optional.Size = new System.Drawing.Size(160, 18);
this.update_optional.TabIndex = 13;
this.update_optional.Text = "Download Optional Updates";
this.update_optional.UseVisualStyleBackColor = true;
//
// progress_overall
//
this.progress_overall.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.progress_overall.Location = new System.Drawing.Point(9, 36);
this.progress_overall.Name = "progress_overall";
this.progress_overall.Size = new System.Drawing.Size(522, 26);
this.progress_overall.TabIndex = 1;
//
// progress_currentFile
//
this.progress_currentFile.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.progress_currentFile.Location = new System.Drawing.Point(9, 4);
this.progress_currentFile.Name = "progress_currentFile";
this.progress_currentFile.Size = new System.Drawing.Size(522, 26);
this.progress_currentFile.TabIndex = 0;
//
// tab_web
//
this.tab_web.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tab_web.Controls.Add(this.tabPage1);
this.tab_web.Controls.Add(this.tabPage2);
this.tab_web.Controls.Add(this.tabPage3);
this.tab_web.Controls.Add(this.serverTab);
this.tab_web.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9F);
this.tab_web.Location = new System.Drawing.Point(0, 138);
this.tab_web.Name = "tab_web";
this.tab_web.SelectedIndex = 0;
this.tab_web.Size = new System.Drawing.Size(770, 256);
this.tab_web.TabIndex = 1;
//
// tabPage1
//
this.tabPage1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(204)))), ((int)(((byte)(187)))));
this.tabPage1.Controls.Add(this.panel10);
this.tabPage1.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tabPage1.Location = new System.Drawing.Point(4, 23);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(762, 229);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "News & Updates";
//
// panel10
//
this.panel10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(230)))), ((int)(((byte)(217)))));
this.panel10.Controls.Add(this.webBrowser3);
this.panel10.Location = new System.Drawing.Point(4, 6);
this.panel10.Name = "panel10";
this.panel10.Padding = new System.Windows.Forms.Padding(5);
this.panel10.Size = new System.Drawing.Size(748, 217);
this.panel10.TabIndex = 14;
//
// webBrowser3
//
this.webBrowser3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.webBrowser3.Location = new System.Drawing.Point(8, 8);
this.webBrowser3.MinimumSize = new System.Drawing.Size(20, 20);
this.webBrowser3.Name = "webBrowser3";
this.webBrowser3.Size = new System.Drawing.Size(732, 201);
this.webBrowser3.TabIndex = 0;
this.webBrowser3.Url = new System.Uri("http://update.srb2.org/files_beta/files_beta.xml", System.UriKind.Absolute);
//
// tabPage2
//
this.tabPage2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(204)))), ((int)(((byte)(187)))));
this.tabPage2.Controls.Add(this.panel9);
this.tabPage2.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9F);
this.tabPage2.Location = new System.Drawing.Point(4, 23);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(762, 229);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Change Log";
//
// panel9
//
this.panel9.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(230)))), ((int)(((byte)(217)))));
this.panel9.Controls.Add(this.webBrowser1);
this.panel9.Location = new System.Drawing.Point(4, 6);
this.panel9.Name = "panel9";
this.panel9.Padding = new System.Windows.Forms.Padding(5);
this.panel9.Size = new System.Drawing.Size(748, 217);
this.panel9.TabIndex = 13;
//
// webBrowser1
//
this.webBrowser1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.webBrowser1.Location = new System.Drawing.Point(8, 8);
this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20);
this.webBrowser1.Name = "webBrowser1";
this.webBrowser1.Size = new System.Drawing.Size(732, 201);
this.webBrowser1.TabIndex = 0;
this.webBrowser1.Url = new System.Uri("http://update.srb2.org/files_beta/changelog.html", System.UriKind.Absolute);
//
// tabPage3
//
this.tabPage3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(204)))), ((int)(((byte)(187)))));
this.tabPage3.Controls.Add(this.panel8);
this.tabPage3.Location = new System.Drawing.Point(4, 23);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
this.tabPage3.Size = new System.Drawing.Size(762, 229);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "Download List";
//
// panel8
//
this.panel8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(230)))), ((int)(((byte)(217)))));
this.panel8.Controls.Add(this.fileList);
this.panel8.Location = new System.Drawing.Point(4, 6);
this.panel8.Name = "panel8";
this.panel8.Padding = new System.Windows.Forms.Padding(5);
this.panel8.Size = new System.Drawing.Size(748, 217);
this.panel8.TabIndex = 12;
//
// fileList
//
this.fileList.AllowUserToAddRows = false;
this.fileList.AllowUserToDeleteRows = false;
this.fileList.AllowUserToResizeRows = false;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(204)))), ((int)(((byte)(187)))));
dataGridViewCellStyle1.Font = new System.Drawing.Font("Arial Rounded MT Bold", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle1.ForeColor = System.Drawing.Color.Black;
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(204)))), ((int)(((byte)(187)))));
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.Black;
this.fileList.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.fileList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.fileList.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.fileList.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(224)))), ((int)(((byte)(206)))));
this.fileList.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(204)))), ((int)(((byte)(187)))));
dataGridViewCellStyle2.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9F);
dataGridViewCellStyle2.ForeColor = System.Drawing.Color.Black;
dataGridViewCellStyle2.Padding = new System.Windows.Forms.Padding(2);
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(204)))), ((int)(((byte)(187)))));
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.Black;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.fileList.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.fileList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.fileList.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.name,
this.filename,
this.status,
this.localmd5,
this.md5,
this.optional,
this.calculated});
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(224)))), ((int)(((byte)(206)))));
dataGridViewCellStyle4.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9F);
dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(224)))), ((int)(((byte)(206)))));
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.Color.Black;
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.fileList.DefaultCellStyle = dataGridViewCellStyle4;
this.fileList.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(204)))), ((int)(((byte)(187)))));
this.fileList.Location = new System.Drawing.Point(8, 8);
this.fileList.MultiSelect = false;
this.fileList.Name = "fileList";
this.fileList.ReadOnly = true;
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(224)))), ((int)(((byte)(206)))));
dataGridViewCellStyle5.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9F);
dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(224)))), ((int)(((byte)(206)))));
dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.Black;
dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.fileList.RowHeadersDefaultCellStyle = dataGridViewCellStyle5;
this.fileList.RowHeadersVisible = false;
dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(224)))), ((int)(((byte)(206)))));
dataGridViewCellStyle6.ForeColor = System.Drawing.Color.Black;
dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(224)))), ((int)(((byte)(206)))));
dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.Black;
this.fileList.RowsDefaultCellStyle = dataGridViewCellStyle6;
this.fileList.RowTemplate.DefaultCellStyle.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(224)))), ((int)(((byte)(206)))));
this.fileList.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.fileList.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(224)))), ((int)(((byte)(206)))));
this.fileList.RowTemplate.DefaultCellStyle.SelectionForeColor = System.Drawing.Color.Black;
this.fileList.RowTemplate.ReadOnly = true;
this.fileList.Size = new System.Drawing.Size(732, 201);
this.fileList.TabIndex = 11;
//
// name
//
this.name.DataPropertyName = "name";
dataGridViewCellStyle3.BackColor = System.Drawing.Color.White;
this.name.DefaultCellStyle = dataGridViewCellStyle3;
this.name.FillWeight = 128.7982F;
this.name.HeaderText = "Name";
this.name.Name = "name";
this.name.ReadOnly = true;
//
// filename
//
this.filename.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
this.filename.DataPropertyName = "filename";
this.filename.HeaderText = "File";
this.filename.Name = "filename";
this.filename.ReadOnly = true;
this.filename.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.filename.Width = 150;
//
// status
//
this.status.DataPropertyName = "status";
this.status.FillWeight = 128.7982F;
this.status.HeaderText = "Status";
this.status.Name = "status";
this.status.ReadOnly = true;
//
// localmd5
//
this.localmd5.DataPropertyName = "localmd5";
this.localmd5.FillWeight = 13.60544F;
this.localmd5.HeaderText = "localmd5";
this.localmd5.Name = "localmd5";
this.localmd5.ReadOnly = true;
this.localmd5.Visible = false;
//
// md5
//
this.md5.DataPropertyName = "md5";
this.md5.FillWeight = 128.7982F;
this.md5.HeaderText = "md5";
this.md5.Name = "md5";
this.md5.ReadOnly = true;
this.md5.Visible = false;
//
// optional
//
this.optional.DataPropertyName = "optional";
this.optional.HeaderText = "optional";
this.optional.Name = "optional";
this.optional.ReadOnly = true;
this.optional.Visible = false;
//
// calculated
//
this.calculated.DataPropertyName = "calculated";
this.calculated.HeaderText = "calculated";
this.calculated.Name = "calculated";
this.calculated.ReadOnly = true;
this.calculated.Visible = false;
//
// serverTab
//
this.serverTab.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(204)))), ((int)(((byte)(187)))));
this.serverTab.Controls.Add(this.panel6);
this.serverTab.Controls.Add(this.panel4);
this.serverTab.Location = new System.Drawing.Point(4, 23);
this.serverTab.Name = "serverTab";
this.serverTab.Padding = new System.Windows.Forms.Padding(3);
this.serverTab.Size = new System.Drawing.Size(762, 229);
this.serverTab.TabIndex = 3;
this.serverTab.Text = "Master Server";
//
// panel6
//
this.panel6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(230)))), ((int)(((byte)(217)))));
this.panel6.Controls.Add(this.listViewServers);
this.panel6.Location = new System.Drawing.Point(4, 6);
this.panel6.Name = "panel6";
this.panel6.Padding = new System.Windows.Forms.Padding(5);
this.panel6.Size = new System.Drawing.Size(603, 217);
this.panel6.TabIndex = 6;
//
// listViewServers
//
this.listViewServers.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listViewServers.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(224)))), ((int)(((byte)(206)))));
this.listViewServers.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.listViewServers.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.colhdrName,
this.colhdrGametype,
this.colhdrPing,
this.colhdrPlayers,
this.colhdrVersion});
this.listViewServers.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.listViewServers.FullRowSelect = true;
this.listViewServers.HideSelection = false;
this.listViewServers.Location = new System.Drawing.Point(9, 8);
this.listViewServers.Name = "listViewServers";
this.listViewServers.ShowItemToolTips = true;
this.listViewServers.Size = new System.Drawing.Size(586, 201);
this.listViewServers.TabIndex = 1;
this.listViewServers.UseCompatibleStateImageBehavior = false;
this.listViewServers.View = System.Windows.Forms.View.Details;
this.listViewServers.ItemActivate += new System.EventHandler(this.listViewServers_ItemActivate);
this.listViewServers.SelectedIndexChanged += new System.EventHandler(this.listViewServers_SelectedIndexChanged);
this.listViewServers.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listViewServers_ColumnClick);
//
// colhdrName
//
this.colhdrName.Tag = "";
this.colhdrName.Text = "Server Name";
this.colhdrName.Width = 231;
//
// colhdrGametype
//
this.colhdrGametype.Text = "Gametype";
this.colhdrGametype.Width = 92;
//
// colhdrPing
//
this.colhdrPing.Text = "Ping (ms)";
this.colhdrPing.Width = 87;
//
// colhdrPlayers
//
this.colhdrPlayers.Text = "Players";
this.colhdrPlayers.Width = 88;
//
// colhdrVersion
//
this.colhdrVersion.Text = "Version";
this.colhdrVersion.Width = 87;
//
// panel4
//
this.panel4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(230)))), ((int)(((byte)(217)))));
this.panel4.Controls.Add(this.groupBox1);
this.panel4.Controls.Add(this.button1);
this.panel4.Controls.Add(this.button3);
this.panel4.Controls.Add(this.btnConnect);
this.panel4.Location = new System.Drawing.Point(613, 6);
this.panel4.Name = "panel4";
this.panel4.Padding = new System.Windows.Forms.Padding(5);
this.panel4.Size = new System.Drawing.Size(139, 217);
this.panel4.TabIndex = 5;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Location = new System.Drawing.Point(9, 114);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(122, 95);
this.groupBox1.TabIndex = 5;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Key";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label4.ForeColor = System.Drawing.Color.Black;
this.label4.Location = new System.Drawing.Point(6, 77);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(87, 14);
this.label4.TabIndex = 3;
this.label4.Text = "Normal Game";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label3.ForeColor = System.Drawing.Color.DimGray;
this.label3.Location = new System.Drawing.Point(6, 57);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(78, 14);
this.label3.TabIndex = 2;
this.label3.Text = "Game is Full";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.ForeColor = System.Drawing.Color.Green;
this.label2.Location = new System.Drawing.Point(6, 37);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(99, 14);
this.label2.TabIndex = 1;
this.label2.Text = "Cheats Enabled";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.ForeColor = System.Drawing.Color.Red;
this.label1.Location = new System.Drawing.Point(6, 17);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(57, 14);
this.label1.TabIndex = 0;
this.label1.Text = "Modified";
//
// button1
//
this.button1.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9.75F);
this.button1.Location = new System.Drawing.Point(8, 8);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(123, 29);
this.button1.TabIndex = 2;
this.button1.Text = "Refresh List";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.btnRefresh_Click);
//
// button3
//
this.button3.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9.75F);
this.button3.Location = new System.Drawing.Point(8, 78);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(123, 29);
this.button3.TabIndex = 4;
this.button3.Text = "Join Game (IP)";
this.button3.UseVisualStyleBackColor = true;
//
// btnConnect
//
this.btnConnect.Enabled = false;
this.btnConnect.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9.75F);
this.btnConnect.Location = new System.Drawing.Point(8, 43);
this.btnConnect.Name = "btnConnect";
this.btnConnect.Size = new System.Drawing.Size(123, 29);
this.btnConnect.TabIndex = 3;
this.btnConnect.Text = "Join Game (List)";
this.btnConnect.UseVisualStyleBackColor = true;
this.btnConnect.Click += new System.EventHandler(this.btnConnect_Click);
//
// panel5
//
this.panel5.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel5.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.panel5.Controls.Add(this.tab_web);
this.panel5.Controls.Add(this.bannerRandom);
this.panel5.Location = new System.Drawing.Point(12, 13);
this.panel5.Name = "panel5";
this.panel5.Size = new System.Drawing.Size(772, 396);
this.panel5.TabIndex = 1;
//
// bannerRandom
//
this.bannerRandom.BackgroundImage = global::SRB2Updater.Properties.Resources.Banner4;
this.bannerRandom.Location = new System.Drawing.Point(0, -2);
this.bannerRandom.Name = "bannerRandom";
this.bannerRandom.Size = new System.Drawing.Size(768, 123);
this.bannerRandom.TabIndex = 3;
//
// backgroundWorkerQueryServers
//
this.backgroundWorkerQueryServers.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorkerQueryServers_DoWork);
//
// openFileDialog1
//
this.openFileDialog1.DefaultExt = "exe";
this.openFileDialog1.Filter = "Executables files|*.exe|All files|*.*";
//
// webBrowser2
//
this.webBrowser2.Location = new System.Drawing.Point(8, 8);
this.webBrowser2.MinimumSize = new System.Drawing.Size(20, 20);
this.webBrowser2.Name = "webBrowser2";
this.webBrowser2.Size = new System.Drawing.Size(567, 201);
this.webBrowser2.TabIndex = 0;
this.webBrowser2.Url = new System.Uri("http://update.srb2.org/files_beta/changelog.html", System.UriKind.Absolute);
//
// Launcher
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(230)))), ((int)(((byte)(217)))));
this.ClientSize = new System.Drawing.Size(796, 552);
this.Controls.Add(this.panel5);
this.Controls.Add(this.panel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.KeyPreview = true;
this.Name = "Launcher";
this.Text = "Launcher";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Launcher_FormClosed);
this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.Launcher_KeyUp);
this.panel1.ResumeLayout(false);
this.panel3.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
this.tab_web.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.panel10.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.panel9.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
this.panel8.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.fileList)).EndInit();
this.serverTab.ResumeLayout(false);
this.panel6.ResumeLayout(false);
this.panel4.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.panel5.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.Button btnOptions;
private System.Windows.Forms.Button btnCheckFiles;
private System.Windows.Forms.Button btnStartSRB2;
private System.Windows.Forms.TabControl tab_web;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.Panel panel5;
private System.Windows.Forms.WebBrowser webBrowser1;
private System.Windows.Forms.Panel bannerRandom;
private System.Windows.Forms.ProgressBar progress_overall;
private System.Windows.Forms.ProgressBar progress_currentFile;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.DataGridView fileList;
private System.Windows.Forms.CheckBox update_optional;
private System.Windows.Forms.Label lblProgress;
private System.Windows.Forms.DataGridViewTextBoxColumn name;
private System.Windows.Forms.DataGridViewTextBoxColumn filename;
private System.Windows.Forms.DataGridViewTextBoxColumn status;
private System.Windows.Forms.DataGridViewTextBoxColumn localmd5;
private System.Windows.Forms.DataGridViewTextBoxColumn md5;
private System.Windows.Forms.DataGridViewTextBoxColumn optional;
private System.Windows.Forms.DataGridViewTextBoxColumn calculated;
private System.Windows.Forms.TabPage serverTab;
private System.Windows.Forms.ListView listViewServers;
private System.Windows.Forms.ColumnHeader colhdrName;
private System.Windows.Forms.ColumnHeader colhdrGametype;
private System.Windows.Forms.ColumnHeader colhdrPing;
private System.Windows.Forms.ColumnHeader colhdrPlayers;
private System.Windows.Forms.ColumnHeader colhdrVersion;
private System.ComponentModel.BackgroundWorker backgroundWorkerQueryServers;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button btnConnect;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.Panel panel6;
private System.Windows.Forms.Panel panel8;
private System.Windows.Forms.Panel panel9;
private System.Windows.Forms.Panel panel10;
private System.Windows.Forms.WebBrowser webBrowser3;
private System.Windows.Forms.WebBrowser webBrowser2;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label4;
}
}

View file

@ -1,658 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
//using System.Data.OleDb;
using System.Xml;
//using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.IO;
using System.Threading;
using System.Security.Cryptography;
//using System.Runtime.InteropServices;
using System.Diagnostics;
using System.Drawing;
using System.Media;
namespace SRB2Updater
{
public partial class Launcher : Form
{
private Settings settings = new Settings();
private Debug debug = new Debug();
// The thread inside which the download happens
private Thread thrDownload;
private Thread thrTotal;
// The stream of data retrieved from the web server
private Stream strResponse;
// The stream of data that we write to the harddrive
private Stream strLocal;
// The request to the web server for file information
private HttpWebRequest webRequest;
// The response from the web server containing information about the file
private HttpWebResponse webResponse;
// The progress of the download in percentage
private static int PercentProgress;
private static int OverallPercentProgress;
// Overall progress as a percentage
private static Int64 OverallProgress;
// Progress stored, for calculating overall
private static Int64 CurrentProgress;
// Total File Size of entire update
private static Int64 TotalSize;
// The delegate which we will call from the thread to update the form
private delegate void UpdateProgessCallback(Int64 BytesRead, Int64 TotalBytes);
private delegate void OverallProgessCallback(Int64 BytesRead);
// When to pause
bool goPause = false;
// Download Details
string downFile;
// Updating
bool filesGot = false;
bool downloadStatus = false;
bool doneCalculate = false;
string formTitle = "Sonic Robo Blast 2 Launcher";
bool loadedBat = false;
ProcessStartInfo startinfo = new ProcessStartInfo();
private ServerQuerier sq;
private string MSFail;
public Launcher(string[] args)
{
InitializeComponent();
settings.GetSettings();
sq = new ServerQuerier();
ServerInfoListViewAdder silva = new ServerInfoListViewAdder(sq, this);
try
{
sq.SetMasterServer(settings.msAddress, Convert.ToUInt16(settings.msPort));
}
catch (Exception exception)
{
MSFail = exception.Message;
}
sq.StartListening(silva);
backgroundWorkerQueryServers.RunWorkerAsync();
foreach (string arg in args)
{
if (arg == "-debug")
{
debug.Show();
break;
}
}
RandomBanner();
}
public string getMD5(string filename)
{
StringBuilder sb = new StringBuilder();
FileInfo f = new FileInfo(filename);
FileStream fs = f.OpenRead();
MD5 md5 = new MD5CryptoServiceProvider();
byte[] hash = md5.ComputeHash(fs);
fs.Close();
foreach (byte hex in hash)
sb.Append(hex.ToString("x2"));
string md5sum = sb.ToString();
return md5sum;
}
public void PlayIt()
{
SoundPlayer player = new SoundPlayer(Properties.Resources.Kotaku);
player.Play();
}
public void RandomBanner()
{
Random random = new Random();
int rand = random.Next(0, 4);
//this.bannerRandom.BackgroundImage = global::SRB2Updater.Properties.Resources.Banner;
switch (rand)
{
case 0:
bannerRandom.BackgroundImage = global::SRB2Updater.Properties.Resources.Banner;
break;
case 1:
bannerRandom.BackgroundImage = global::SRB2Updater.Properties.Resources.Banner2;
break;
case 2:
bannerRandom.BackgroundImage = global::SRB2Updater.Properties.Resources.Banner3;
break;
case 3:
bannerRandom.BackgroundImage = global::SRB2Updater.Properties.Resources.Banner4;
break;
default:
bannerRandom.BackgroundImage = global::SRB2Updater.Properties.Resources.Banner;
break;
}
debug.strRandom = Convert.ToString(rand);
}
private void updateList(bool doCalculate)
{
if (filesGot == false)
{
XmlDataDocument xmlDatadoc = new XmlDataDocument();
xmlDatadoc.DataSet.ReadXml("http://update.srb2.org/files_beta/files_beta.xml");
DataSet ds = new DataSet("Files DataSet");
ds = xmlDatadoc.DataSet;
fileList.DataSource = ds.DefaultViewManager;
fileList.DataMember = "File";
filesGot = true;
}
if (downloadStatus == false)
{
foreach (DataGridViewRow fileRow in fileList.Rows)
{
if (!File.Exists(fileRow.Cells["filename"].Value.ToString()) && fileRow.Cells["filename"].Value.ToString() != "srb2update.update")
{
// fileRow.DefaultCellStyle.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
fileRow.Cells["localmd5"].Value = "not_found";
} else {
if (fileRow.Cells["filename"].Value.ToString() == "srb2update.update")
fileRow.Cells["localmd5"].Value = getMD5("srb2update.exe");
else
fileRow.Cells["localmd5"].Value = getMD5(fileRow.Cells["filename"].Value.ToString());
}
if (fileRow.Cells["localmd5"].Value.ToString() != fileRow.Cells["md5"].Value.ToString())
{
// if (fileRow.Cells["localmd5"].Value.ToString() != "not_found")
// fileRow.DefaultCellStyle.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(224)))), ((int)(((byte)(206)))));
fileRow.Cells["status"].Value = "Queued";
}
else
{
fileRow.Cells["status"].Value = "Up to date";
}
}
if (doCalculate)
{
thrTotal = new Thread(new ParameterizedThreadStart(CalculateTotalSize));
thrTotal.Start(0);
}
if (doneCalculate)
{
foreach (DataGridViewRow fileRow in fileList.Rows)
{
if (fileRow.Cells["localmd5"].Value.ToString() != fileRow.Cells["md5"].Value.ToString())
{
if (fileRow.Cells["optional"].Value.ToString() == "1" && !update_optional.Checked)
fileRow.Cells["Status"].Value = "Skipped (Optional)";
else
{
downFile = fileRow.Cells["filename"].Value.ToString();
thrDownload = new Thread(new ParameterizedThreadStart(Download));
thrDownload.Start(0);
fileRow.Cells["Status"].Value = "Downloading...";
downloadStatus = true;
break;
}
}
else
{
fileRow.Cells["Status"].Value = "Up to date";
}
CurrentProgress = 0;
}
}
}
}
private void UpdateProgress(Int64 BytesRead, Int64 TotalBytes)
{
// Calculate the download progress in percentages
PercentProgress = Convert.ToInt32((BytesRead * 100) / TotalBytes);
// Make progress on the progress bar
progress_currentFile.Value = PercentProgress;
// Display the current progress on the form
lblProgress.Text = downFile + " - " + (BytesRead / 1024) + "KB of " + (TotalBytes / 1024) + "KB (" + PercentProgress + "%)";
this.Text = formTitle + " :: Downloading " + downFile + " (" + PercentProgress + "%)";
debug.strPercent = PercentProgress.ToString() + "%";
if (BytesRead >= TotalBytes - 1)
updateList(false);
}
private void UpdateOverallProgress(Int64 BytesRead)
{
// Calculate progress change and add to OverallProgress...
OverallProgress += BytesRead - CurrentProgress;
// Calculate the download progress in percentages
if (TotalSize < 1)
TotalSize = 1;
OverallPercentProgress = Convert.ToInt32((OverallProgress * 100) / TotalSize);
// Make progress on the progress bar
if (OverallPercentProgress > 100)
OverallPercentProgress = 100;
progress_overall.Value = OverallPercentProgress;
if (OverallProgress >= TotalSize)
{
lblProgress.Text = "Done";
btnCheckFiles.Enabled = true;
}
CurrentProgress = BytesRead;
debug.strCurrent = Convert.ToString(CurrentProgress) + " bytes";
debug.strOverall = Convert.ToString(OverallProgress) + " bytes";
debug.strOverallPercentage = Convert.ToString(OverallPercentProgress) + "%";
debug.strRead = Convert.ToString(BytesRead) + " bytes";
debug.strTotal = Convert.ToString(TotalSize) + " bytes";
}
private void CalculateTotalSize(object startpoint)
{
foreach (DataGridViewRow fileRow in fileList.Rows)
{
if ((fileRow.Cells["optional"].Value.ToString() == "0" || update_optional.Checked) && fileRow.Cells["localmd5"].Value.ToString() != fileRow.Cells["md5"].Value.ToString())
{
try
{
// Create a request to the file we are downloading
webRequest = (HttpWebRequest)WebRequest.Create("http://update.srb2.org/files_beta/" + fileRow.Cells["filename"].Value.ToString());
// Set the starting point of the request
webRequest.AddRange(0);
// Set default authentication for retrieving the file
webRequest.Credentials = CredentialCache.DefaultCredentials;
// Retrieve the response from the server
webResponse = (HttpWebResponse)webRequest.GetResponse();
// Ask the server for the file size and store it
Int64 fileSize = webResponse.ContentLength;
TotalSize = TotalSize + fileSize;
}
finally
{
// When the above code has ended, close the streams
webResponse.Close();
}
}
}
doneCalculate = true;
updateList(false);
}
private void Download(object startpoint)
{
try
{
string filename = Convert.ToString(startpoint);
// Create a request to the file we are downloading
webRequest = (HttpWebRequest)WebRequest.Create("http://update.srb2.org/files_beta/" + downFile);
// Set the starting point of the request
webRequest.AddRange(0);
// Set default authentication for retrieving the file
webRequest.Credentials = CredentialCache.DefaultCredentials;
// Retrieve the response from the server
webResponse = (HttpWebResponse)webRequest.GetResponse();
// Ask the server for the file size and store it
Int64 fileSize = webResponse.ContentLength;
// Open the URL for download
strResponse = webResponse.GetResponseStream();
// Create a new file stream where we will be saving the data (local drive)
strLocal = new FileStream(downFile, FileMode.Create, FileAccess.Write, FileShare.None);
// It will store the current number of bytes we retrieved from the server
int bytesSize = 0;
// A buffer for storing and writing the data retrieved from the server
byte[] downBuffer = new byte[2048];
// Loop through the buffer until the buffer is empty
while ((bytesSize = strResponse.Read(downBuffer, 0, downBuffer.Length)) > 0)
{
// Write the data from the buffer to the local hard drive
strLocal.Write(downBuffer, 0, bytesSize);
// Invoke the method that updates the form's label and progress bar
this.Invoke(new UpdateProgessCallback(this.UpdateProgress), new object[] { strLocal.Length, fileSize });
this.Invoke(new OverallProgessCallback(this.UpdateOverallProgress), new object[] { strLocal.Length });
if (goPause == true)
{
break;
}
}
}
finally
{
// When the above code has ended, close the streams
strResponse.Close();
strLocal.Close();
// And update the row!
downloadStatus = false;
if (downFile == "srb2update.update" && loadedBat != true)
{
MessageBox.Show("The updater will now restart to apply a patch.", "Self Update", MessageBoxButtons.OK);
CreateUpdaterBat();
startinfo.WindowStyle = ProcessWindowStyle.Hidden;
startinfo.FileName = "srb2update.bat";
System.Diagnostics.Process.Start(startinfo);
downloadStatus = false;
Environment.Exit(0);
} else
updateList(false);
}
}
private void CreateUpdaterBat()
{
File.WriteAllText("srb2update.bat", "ping 127.0.0.1\ncopy srb2update.update srb2update.exe\ndel srb2update.update\nsrb2update.exe\nexit");
}
private void update_Load(object sender, EventArgs e)
{
lblProgress.Text = "Getting File List...";
if (File.Exists("srb2update.bat"))
File.Delete("srb2update.bat");
TotalSize = 0;
CurrentProgress = 0;
OverallPercentProgress = 0;
OverallProgress = 0;
btnCheckFiles.Enabled = false;
updateList(true);
}
private void btnOptions_Click(object sender, EventArgs e)
{
new Options(settings).ShowDialog();
}
private class ServerInfoListViewAdder : ServerQuerier.ServerInfoReceiveHandler
{
private delegate ListViewItem AddToListCallback(ListViewItem lvi);
private Launcher form1;
private Dictionary<byte, string> dicGametypes = new Dictionary<byte, string>();
private static Dictionary<ServerQuerier.ServerInfoVer, List<String>> dicDefaultFiles =
new Dictionary<ServerQuerier.ServerInfoVer, List<String>>();
static ServerInfoListViewAdder()
{
dicDefaultFiles.Add(
ServerQuerier.ServerInfoVer.SIV_PREME,
new List<String>(
new string[] {
"srb2.srb", "sonic.plr", "tails.plr", "knux.plr",
"auto.wpn", "bomb.wpn", "home.wpn", "rail.wpn", "infn.wpn",
"drill.dta", "soar.dta", "music.dta"
})
);
dicDefaultFiles.Add(
ServerQuerier.ServerInfoVer.SIV_ME,
new List<String>(
new string[] {
"srb2.wad", "sonic.plr", "tails.plr", "knux.plr",
"rings.wpn", "drill.dta", "soar.dta", "music.dta"
})
);
}
public ServerInfoListViewAdder(ServerQuerier sq, Launcher form1)
: base(sq)
{
this.form1 = form1;
// Gametypes.
dicGametypes.Add(0, "Co-op");
dicGametypes.Add(1, "Match");
dicGametypes.Add(2, "Race");
dicGametypes.Add(3, "Tag");
dicGametypes.Add(4, "CTF");
dicGametypes.Add(5, "Chaos");
// Don't think these are actually used.
dicGametypes.Add(42, "Team Match");
dicGametypes.Add(43, "Time-Only Race");
}
public override void ProcessServerInfo(ServerQuerier.SRB2ServerInfo srb2si)
{
ListView lv = form1.listViewServers;
// Build a list item.
ListViewItem lvi = new ListViewItem(srb2si.strName);
// So we can get address and whatever else we might need.
lvi.Tag = srb2si;
// Gametype string, or number if not recognised.
if (dicGametypes.ContainsKey(srb2si.byGametype))
lvi.SubItems.Add(dicGametypes[srb2si.byGametype]);
else
lvi.SubItems.Add(Convert.ToString(srb2si.byGametype));
lvi.SubItems.Add(Convert.ToString(srb2si.uiTime));
lvi.SubItems.Add(srb2si.byPlayers + "/" + srb2si.byMaxplayers);
lvi.SubItems.Add(srb2si.strVersion);
// Make the tooltip.
BuildTooltip(lvi, form1.settings.ShowDefaultWads);
// Is the game full?
if (srb2si.byPlayers >= srb2si.byMaxplayers)
lvi.ForeColor = Color.DimGray;
// Modified?
else if (srb2si.bModified)
lvi.ForeColor = Color.Red;
// Thread-safe goodness.
if (lv.InvokeRequired)
{
// Call ourselves in the context of the form's thread.
AddToListCallback addtolistcallback = new AddToListCallback(lv.Items.Add);
lv.Invoke(addtolistcallback, new object[] { lvi });
}
else
{
// Add it!
lv.Items.Add(lvi);
}
}
public override void HandleException(Exception e)
{
}
public static void BuildTooltip(ListViewItem lvi, bool bShowDefaultWads)
{
string strWads = String.Empty;
ServerQuerier.SRB2ServerInfo srb2si = (ServerQuerier.SRB2ServerInfo)lvi.Tag;
foreach (ServerQuerier.AddedWad aw in srb2si.listFiles)
{
List<string> listDefaultFiles = dicDefaultFiles[srb2si.siv];
if (bShowDefaultWads || !listDefaultFiles.Contains(aw.strFilename))
{
strWads += String.Format("\n{0} ({1:f1} KB)", aw.strFilename, Convert.ToSingle(aw.uiSize) / 1024);
if (aw.bImportant)
{
if (aw.downloadtype == ServerQuerier.DownloadTypes.DT_TOOBIG)
strWads += " (too big to download)";
else if (aw.downloadtype == ServerQuerier.DownloadTypes.DT_DISABLED)
strWads += " (downloading disabled)";
}
else strWads += " (unimportant)";
}
}
lvi.ToolTipText = "Current map: " + srb2si.strMapName + "\n";
if (strWads != String.Empty)
lvi.ToolTipText += "Wads added:" + strWads;
else lvi.ToolTipText += "No wads added";
}
}
private void backgroundWorkerQueryServers_DoWork(object sender, DoWorkEventArgs e)
{
MSClient msclient = new MSClient();
try
{
List<MSServerEntry> listServers = msclient.GetServerList(settings.msAddress, Convert.ToUInt16(settings.msPort));
// Query each of the individual servers asynchronously.
foreach (MSServerEntry msse in listServers)
{
sq.Query(msse.strAddress, msse.unPort);
}
}
catch (System.Net.Sockets.SocketException sockexception)
{
MSFail = sockexception.Message;
}
catch (Exception exception)
{
MSFail = exception.Message;
}
}
private void btnRefresh_Click(object sender, EventArgs e)
{
if (!backgroundWorkerQueryServers.IsBusy)
{
// Clear the server list.
listViewServers.Items.Clear();
// Disable the Connect button.
btnConnect.Enabled = false;
// Query the MS and the individual servers in another thread.
backgroundWorkerQueryServers.RunWorkerAsync();
}
}
private void btnConnect_Click(object sender, EventArgs e)
{
if (listViewServers.SelectedItems.Count > 0)
{
ConnectToServerFromListItem(listViewServers.SelectedItems[0]);
}
}
private void ConnectToServerFromListItem(ListViewItem lvi)
{
ServerQuerier.SRB2ServerInfo srb2si = (ServerQuerier.SRB2ServerInfo)lvi.Tag;
// Prompt to get a binary if we need one.
if (!settings.HasBinaryForVersion(srb2si.strVersion) &&
MessageBox.Show("To join this game, you must register an executable file for version " + srb2si.strVersion + ". Would you like to do so?", Text, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes &&
openFileDialog1.ShowDialog() == DialogResult.OK)
{
settings.SetBinary(srb2si.strVersion, openFileDialog1.FileName);
settings.SaveSettings();
}
// Go!
ConnectToServer(srb2si.strAddress, srb2si.unPort, srb2si.strVersion);
}
private void ConnectToServer(string strAddress, ushort unPort, string strVersion)
{
// Make sure we now have a binary.
if (settings.HasBinaryForVersion(strVersion))
{
try
{
string strBinary = settings.GetBinary(strVersion);
string strDirectory = System.IO.Path.GetDirectoryName(strBinary);
if (strDirectory != String.Empty)
System.IO.Directory.SetCurrentDirectory(strDirectory);
System.Diagnostics.Process.Start(strBinary, System.String.Format("-connect {0}:{1} {2}", strAddress, unPort, settings.Params)).Close();
if (settings.CloseOnStart)
Environment.Exit(0);
}
catch (Exception exception)
{
MessageBox.Show("Unable to start SRB2: " + exception.Message + ".", "SRB2 MS Launcher", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
private class ListViewSorter : System.Collections.IComparer
{
private int iColumn;
public int Column { get { return iColumn; } }
public SortOrder so;
public ListViewSorter(int iColumn)
{
this.iColumn = iColumn;
so = SortOrder.Ascending;
}
public int Compare(object x, object y)
{
ListViewItem lviX = (ListViewItem)x;
ListViewItem lviY = (ListViewItem)y;
return ((so == SortOrder.Ascending) ? 1 : -1) * String.Compare(lviX.SubItems[iColumn].Text, lviY.SubItems[iColumn].Text);
}
public void ToggleSortOrder()
{
if (so != SortOrder.Ascending)
so = SortOrder.Ascending;
else
so = SortOrder.Descending;
}
}
private void listViewServers_ColumnClick(object sender, ColumnClickEventArgs e)
{
if (listViewServers.ListViewItemSorter != null &&
((ListViewSorter)listViewServers.ListViewItemSorter).Column == e.Column)
{
((ListViewSorter)listViewServers.ListViewItemSorter).ToggleSortOrder();
listViewServers.Sort();
}
else
{
listViewServers.ListViewItemSorter = new ListViewSorter(e.Column);
}
}
private void listViewServers_SelectedIndexChanged(object sender, EventArgs e)
{
btnConnect.Enabled = (listViewServers.SelectedItems.Count > 0);
}
private void listViewServers_ItemActivate(object sender, EventArgs e)
{
ConnectToServerFromListItem(listViewServers.SelectedItems[0]);
}
private void Launcher_FormClosed(object sender, FormClosedEventArgs e)
{
Environment.Exit(0);
}
private Bunny sequence = new Bunny();
private void Launcher_KeyUp(object sender, KeyEventArgs e)
{
if (sequence.IsCompletedBy(e.KeyCode))
{
PlayIt();
}
debug.strKonami = Convert.ToString(sequence.Position);
}
private void btnStartSRB2_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("srb2win.exe", System.String.Format("{0}", settings.Params)).Close();
if(settings.CloseOnStart)
Environment.Exit(0);
}
}
}

View file

@ -1,190 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="name.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="filename.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="status.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="localmd5.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="md5.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="optional.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="calculated.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="backgroundWorkerQueryServers.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>585, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAEACACoCAAAFgAAACgAAAAgAAAAQAAAAAEACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAADg4OAIAAAABQABkAlgAAALkAAABQGQAAcwAlAJYAMQBzJQAAuQA9AJYxAACWAGIAMjIyALk9
AAD/JSUAPj4+AFZWVgD/SEgAYmJiAABilgBubm4Aenp6AP9rawCAgIAAhoaGAJKSkgD/jo4Anp6eAKSg
oAD/jqsAqqqqAGuP/wC2trYAwMDAAI6r/wDCwsIAa8b/AM7OzgCO1P8A2traAObm5gDy8vIA////AAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAGgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFQ8PHQAAAAAAAAAAAAAAACMgJSUlJSUZ
AAAAABMNBgoPDw8AAAAAAAAAAAAAACInJycnJycnJyclFgYGBggPDw8PDwAAAAAAAAAAAAAjJycnJycn
JycnGScnFQkGCA8PDw8AAAAAAAAAAAAAISMnJycjIyMjJycnJycVDwYGDw8PDwAAAAAAAAAAAAAQAAEj
HygqKSkkHyMnJwoPDwYJDw8PAAAAAAAAAAAAACkTHxwrKysrKysrGhkMDw8PCwYJDw8AAAAAAAAAACkp
JA0pACkrKysrKyspDw8PDw8PAwYIAAAAAAAAAAAAACsiARwAISsrKysrKysSDw8PDw8PAwYAAAAAAAAA
AAAAKyIAEAAfKysrKysrKxcPDw8PDw8PDwgIABYAABcSCAArKAMPACIrKysrKysrGw8PDw8PDw8PDw8P
Dw8PDw8RACsoBA8EISsrKysrKyseDw8PDw8PDw8PDw8PDw8PDwAAKx8PDw8VKSsrKysrKxcPDw8PDw8P
Dw8PDw8PDw8AACooFQ8PDw8aKCsrKysmDw8PDw8PDw8PDw8PDw8PFQAAAAAKDw8PDw8VIigoIgoPDw8P
Dw8PDw8PDw8PDxEAAAAAAAoPDw8PDw8XFxcXEhIPDwUPDw8PDw8PDw8YAAAAAAAACA8PDw8SFxcXFxcX
FxcPFQ8PDw8PDw8KAAAAAAAAAAAACg8PEhcXFxcXFxcXFxkjBRISEhISGAAAAAAAAAAAIRcXCA8XFxcX
FxcXFxcaJyMFDwoLEQAAAAAAAAAAAAAAFxcSDxIXFxcXFxcSEyAlIwILCwsIAAAAAAAAAAAAABcXEg8A
EhIXFxcXEgoPDBUUBwsLCwsLAAAAAAAAAAAAFxcAAAAAFxIXFxcXFxIKDw8ICwsLDg4LAAAAAAAAAAAA
AAAAAAAAABISFxcXFw8PDw8PDw8PDwAAAAAAAAAAAAAAAAAAAAAAAAASEhcSDw8PDw8PDxIAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAFwoSDw8SFwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAP///////////////////3////w//APAf/AAAH/gAAD/wAAA/8AAAP/AAAD/AAAB/4AA
Af+AAABYgAAAAIAAAAGAAAADAAAAA8AAAAfAAAAPwAAAP+AAAH+AAAH/wAAB/4QAAP+eAAB//4AA///g
Af//+A//////////////////
</value>
</data>
</root>

View file

@ -1,121 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Net.Sockets;
using System.Net;
using System.IO;
namespace SRB2Updater
{
class MSClient
{
private Socket socket;
/// <summary>
/// Constructs an MS client object.
/// </summary>
public MSClient()
{
socket = new Socket(
AddressFamily.InterNetwork,
SocketType.Stream,
ProtocolType.IP);
}
/// <summary>
/// Gets list of servers reported by the MS.
/// </summary>
/// <param name="strAddress">Hostname or IP address of MS.</param>
/// <param name="unPort">Port of MS.</param>
/// <returns>List of running servers.</returns>
public List<MSServerEntry> GetServerList(string strAddress, ushort unPort)
{
// Resolve the address if necessary.
IPHostEntry iphe = Dns.GetHostEntry(strAddress);
int iIPIndex = 0;
while (iIPIndex < iphe.AddressList.Length &&
iphe.AddressList[iIPIndex].AddressFamily != socket.AddressFamily)
{
iIPIndex++;
}
// No addresses from our family?
if (iIPIndex >= iphe.AddressList.Length)
throw new SocketException((int)SocketError.HostNotFound);
socket.Connect(iphe.AddressList[iIPIndex], unPort);
// Send a request for the short server list.
byte[] byPacket = new byte[12];
BinaryWriter bw = new BinaryWriter(new MemoryStream(byPacket));
bw.Write((uint)0); // Unused
bw.Write((uint)IPAddress.HostToNetworkOrder(205)); // GET_SHORT_SERVER_MSG
bw.Write((uint)0); // Length of tail.
socket.Send(byPacket);
List<MSServerEntry> listServers = new List<MSServerEntry>();
// Don't sit and wait for ever.
socket.ReceiveTimeout = 10000;
// Keep reading packets. We break if we receive the sentinel end-packet.
byte[] byServer = new byte[12 + 80];
while (true)
{
int iLen = socket.Receive(byServer);
BinaryReader br = new BinaryReader(new MemoryStream(byServer));
// Ignore the first eight bytes.
br.ReadInt64();
// Is that the list finished?
int iTailLen = IPAddress.NetworkToHostOrder(br.ReadInt32());
if (iTailLen == 0)
break;
else if (iTailLen != iLen - 12)
{
// MS is in a bad mood.
//throw new Exception("Bad packet.");
break;
}
// Otherwise, add the server to the list.
MSServerEntry msse = new MSServerEntry();
br.ReadBytes(16); // Skip.
msse.strAddress = Encoding.ASCII.GetString(br.ReadBytes(16));
string str = Encoding.ASCII.GetString(br.ReadBytes(8));
int iPos = str.IndexOf("\0");
if (iPos >= 0)
str = str.Remove(iPos);
msse.unPort = Convert.ToUInt16(str);
msse.strName = Encoding.ASCII.GetString(br.ReadBytes(32));
iPos = msse.strName.IndexOf("\0");
if (iPos >= 0)
msse.strName = msse.strName.Remove(iPos);
msse.strVersion = Encoding.ASCII.GetString(br.ReadBytes(8));
iPos = msse.strVersion.IndexOf("\0");
if (iPos >= 0)
msse.strVersion = msse.strVersion.Remove(iPos);
listServers.Add(msse);
}
return listServers;
}
}
public struct MSServerEntry
{
public string strAddress;
public ushort unPort;
public string strName;
public string strVersion;
public bool bPermanent;
}
}

View file

@ -1,628 +0,0 @@
namespace SRB2Updater
{
partial class Options
{
/// <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(Options));
this.groupDisplay = new System.Windows.Forms.GroupBox();
this.label2 = new System.Windows.Forms.Label();
this.txtHeight = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.txtWidth = new System.Windows.Forms.TextBox();
this.chkCustomResolution = new System.Windows.Forms.CheckBox();
this.chkDisplayWindowed = new System.Windows.Forms.CheckBox();
this.panel1 = new System.Windows.Forms.Panel();
this.btnCancel = new System.Windows.Forms.Button();
this.btnSave = new System.Windows.Forms.Button();
this.panel2 = new System.Windows.Forms.Panel();
this.groupMS = new System.Windows.Forms.GroupBox();
this.label4 = new System.Windows.Forms.Label();
this.txtMSPort = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.txtMSAddress = new System.Windows.Forms.TextBox();
this.panel3 = new System.Windows.Forms.Panel();
this.panel7 = new System.Windows.Forms.Panel();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.txtParams = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.panel4 = new System.Windows.Forms.Panel();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.listviewBinaries = new System.Windows.Forms.ListView();
this.colhdrVersion = new System.Windows.Forms.ColumnHeader();
this.colhdrBinary = new System.Windows.Forms.ColumnHeader();
this.textboxBinary = new System.Windows.Forms.TextBox();
this.btnAdd = new System.Windows.Forms.Button();
this.btnDel = new System.Windows.Forms.Button();
this.label5 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.btnBrowse = new System.Windows.Forms.Button();
this.textboxVersion = new System.Windows.Forms.TextBox();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.panel5 = new System.Windows.Forms.Panel();
this.panel6 = new System.Windows.Forms.Panel();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.chkShowDefaultWads = new System.Windows.Forms.CheckBox();
this.chkCloseOnStart = new System.Windows.Forms.CheckBox();
this.groupDisplay.SuspendLayout();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
this.groupMS.SuspendLayout();
this.panel3.SuspendLayout();
this.panel7.SuspendLayout();
this.groupBox3.SuspendLayout();
this.panel4.SuspendLayout();
this.groupBox1.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.panel5.SuspendLayout();
this.panel6.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// groupDisplay
//
this.groupDisplay.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupDisplay.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(230)))), ((int)(((byte)(217)))));
this.groupDisplay.Controls.Add(this.label2);
this.groupDisplay.Controls.Add(this.txtHeight);
this.groupDisplay.Controls.Add(this.label1);
this.groupDisplay.Controls.Add(this.txtWidth);
this.groupDisplay.Controls.Add(this.chkCustomResolution);
this.groupDisplay.Controls.Add(this.chkDisplayWindowed);
this.groupDisplay.Location = new System.Drawing.Point(8, 8);
this.groupDisplay.Name = "groupDisplay";
this.groupDisplay.Size = new System.Drawing.Size(268, 102);
this.groupDisplay.TabIndex = 1;
this.groupDisplay.TabStop = false;
this.groupDisplay.Text = "Display Settings";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(128, 74);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(46, 15);
this.label2.TabIndex = 5;
this.label2.Text = "Height:";
//
// txtHeight
//
this.txtHeight.Location = new System.Drawing.Point(175, 71);
this.txtHeight.MaxLength = 4;
this.txtHeight.Name = "txtHeight";
this.txtHeight.Size = new System.Drawing.Size(46, 21);
this.txtHeight.TabIndex = 4;
this.txtHeight.Text = "768";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(19, 74);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 15);
this.label1.TabIndex = 3;
this.label1.Text = "Width:";
//
// txtWidth
//
this.txtWidth.Location = new System.Drawing.Point(66, 71);
this.txtWidth.MaxLength = 4;
this.txtWidth.Name = "txtWidth";
this.txtWidth.Size = new System.Drawing.Size(46, 21);
this.txtWidth.TabIndex = 2;
this.txtWidth.Text = "1024";
//
// chkCustomResolution
//
this.chkCustomResolution.AutoSize = true;
this.chkCustomResolution.Location = new System.Drawing.Point(6, 46);
this.chkCustomResolution.Name = "chkCustomResolution";
this.chkCustomResolution.Size = new System.Drawing.Size(159, 19);
this.chkCustomResolution.TabIndex = 1;
this.chkCustomResolution.Text = "Use Custom Resolution";
this.chkCustomResolution.UseVisualStyleBackColor = true;
this.chkCustomResolution.CheckedChanged += new System.EventHandler(this.chkCustomResolution_CheckedChanged);
//
// chkDisplayWindowed
//
this.chkDisplayWindowed.AutoSize = true;
this.chkDisplayWindowed.Location = new System.Drawing.Point(6, 20);
this.chkDisplayWindowed.Name = "chkDisplayWindowed";
this.chkDisplayWindowed.Size = new System.Drawing.Size(117, 19);
this.chkDisplayWindowed.TabIndex = 0;
this.chkDisplayWindowed.Text = "Windowed Mode";
this.chkDisplayWindowed.UseVisualStyleBackColor = true;
//
// panel1
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(230)))), ((int)(((byte)(217)))));
this.panel1.Controls.Add(this.groupDisplay);
this.panel1.Location = new System.Drawing.Point(14, 13);
this.panel1.Name = "panel1";
this.panel1.Padding = new System.Windows.Forms.Padding(5);
this.panel1.Size = new System.Drawing.Size(284, 118);
this.panel1.TabIndex = 2;
//
// btnCancel
//
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnCancel.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnCancel.Location = new System.Drawing.Point(260, 525);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 3;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnSave
//
this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnSave.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnSave.Location = new System.Drawing.Point(174, 525);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(75, 23);
this.btnSave.TabIndex = 4;
this.btnSave.Text = "Ok";
this.btnSave.UseVisualStyleBackColor = true;
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// panel2
//
this.panel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(230)))), ((int)(((byte)(217)))));
this.panel2.Controls.Add(this.groupMS);
this.panel2.Location = new System.Drawing.Point(13, 13);
this.panel2.Name = "panel2";
this.panel2.Padding = new System.Windows.Forms.Padding(5);
this.panel2.Size = new System.Drawing.Size(286, 95);
this.panel2.TabIndex = 5;
//
// groupMS
//
this.groupMS.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupMS.Controls.Add(this.label4);
this.groupMS.Controls.Add(this.txtMSPort);
this.groupMS.Controls.Add(this.label3);
this.groupMS.Controls.Add(this.txtMSAddress);
this.groupMS.Location = new System.Drawing.Point(9, 8);
this.groupMS.Name = "groupMS";
this.groupMS.Size = new System.Drawing.Size(269, 79);
this.groupMS.TabIndex = 0;
this.groupMS.TabStop = false;
this.groupMS.Text = "Connection";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(41, 51);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(32, 15);
this.label4.TabIndex = 3;
this.label4.Text = "Port:";
//
// txtMSPort
//
this.txtMSPort.Location = new System.Drawing.Point(79, 48);
this.txtMSPort.Name = "txtMSPort";
this.txtMSPort.Size = new System.Drawing.Size(86, 21);
this.txtMSPort.TabIndex = 2;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(17, 23);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(56, 15);
this.label3.TabIndex = 1;
this.label3.Text = "Address:";
//
// txtMSAddress
//
this.txtMSAddress.Location = new System.Drawing.Point(79, 20);
this.txtMSAddress.Name = "txtMSAddress";
this.txtMSAddress.Size = new System.Drawing.Size(184, 21);
this.txtMSAddress.TabIndex = 0;
//
// panel3
//
this.panel3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(204)))), ((int)(((byte)(187)))));
this.panel3.Controls.Add(this.panel7);
this.panel3.Controls.Add(this.panel4);
this.panel3.Controls.Add(this.panel1);
this.panel3.Location = new System.Drawing.Point(6, 6);
this.panel3.Name = "panel3";
this.panel3.Padding = new System.Windows.Forms.Padding(10);
this.panel3.Size = new System.Drawing.Size(312, 467);
this.panel3.TabIndex = 6;
//
// panel7
//
this.panel7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(230)))), ((int)(((byte)(217)))));
this.panel7.Controls.Add(this.groupBox3);
this.panel7.Location = new System.Drawing.Point(15, 350);
this.panel7.Name = "panel7";
this.panel7.Padding = new System.Windows.Forms.Padding(5);
this.panel7.Size = new System.Drawing.Size(283, 106);
this.panel7.TabIndex = 7;
//
// groupBox3
//
this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox3.Controls.Add(this.chkCloseOnStart);
this.groupBox3.Controls.Add(this.txtParams);
this.groupBox3.Controls.Add(this.label9);
this.groupBox3.Location = new System.Drawing.Point(13, 8);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(258, 83);
this.groupBox3.TabIndex = 12;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Command Line";
//
// txtParams
//
this.txtParams.Location = new System.Drawing.Point(83, 20);
this.txtParams.Name = "txtParams";
this.txtParams.Size = new System.Drawing.Size(167, 21);
this.txtParams.TabIndex = 6;
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(5, 23);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(75, 15);
this.label9.TabIndex = 7;
this.label9.Text = "Parameters:";
//
// panel4
//
this.panel4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(230)))), ((int)(((byte)(217)))));
this.panel4.Controls.Add(this.groupBox1);
this.panel4.Location = new System.Drawing.Point(15, 137);
this.panel4.Name = "panel4";
this.panel4.Padding = new System.Windows.Forms.Padding(5);
this.panel4.Size = new System.Drawing.Size(284, 207);
this.panel4.TabIndex = 6;
//
// groupBox1
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.listviewBinaries);
this.groupBox1.Controls.Add(this.textboxBinary);
this.groupBox1.Controls.Add(this.btnAdd);
this.groupBox1.Controls.Add(this.btnDel);
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.label7);
this.groupBox1.Controls.Add(this.btnBrowse);
this.groupBox1.Controls.Add(this.textboxVersion);
this.groupBox1.Location = new System.Drawing.Point(13, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(259, 191);
this.groupBox1.TabIndex = 12;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Executables";
//
// listviewBinaries
//
this.listviewBinaries.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listviewBinaries.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.colhdrVersion,
this.colhdrBinary});
this.listviewBinaries.FullRowSelect = true;
this.listviewBinaries.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.listviewBinaries.HideSelection = false;
this.listviewBinaries.Location = new System.Drawing.Point(6, 19);
this.listviewBinaries.Name = "listviewBinaries";
this.listviewBinaries.Size = new System.Drawing.Size(245, 83);
this.listviewBinaries.TabIndex = 0;
this.listviewBinaries.UseCompatibleStateImageBehavior = false;
this.listviewBinaries.View = System.Windows.Forms.View.Details;
this.listviewBinaries.SelectedIndexChanged += new System.EventHandler(this.listviewBinaries_SelectedIndexChanged);
//
// colhdrVersion
//
this.colhdrVersion.Text = "Version";
//
// colhdrBinary
//
this.colhdrBinary.Text = "Binary";
this.colhdrBinary.Width = 198;
//
// textboxBinary
//
this.textboxBinary.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textboxBinary.Enabled = false;
this.textboxBinary.Location = new System.Drawing.Point(84, 161);
this.textboxBinary.Name = "textboxBinary";
this.textboxBinary.Size = new System.Drawing.Size(93, 21);
this.textboxBinary.TabIndex = 4;
this.textboxBinary.TextChanged += new System.EventHandler(this.textboxBinary_TextChanged);
//
// btnAdd
//
this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.btnAdd.Location = new System.Drawing.Point(51, 104);
this.btnAdd.Name = "btnAdd";
this.btnAdd.Size = new System.Drawing.Size(98, 25);
this.btnAdd.TabIndex = 1;
this.btnAdd.Text = "&Add";
this.btnAdd.UseVisualStyleBackColor = true;
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
//
// btnDel
//
this.btnDel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.btnDel.Enabled = false;
this.btnDel.Location = new System.Drawing.Point(155, 104);
this.btnDel.Name = "btnDel";
this.btnDel.Size = new System.Drawing.Size(98, 25);
this.btnDel.TabIndex = 2;
this.btnDel.Text = "&Delete";
this.btnDel.UseVisualStyleBackColor = true;
this.btnDel.Click += new System.EventHandler(this.btnDel_Click);
//
// label5
//
this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(6, 138);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(51, 15);
this.label5.TabIndex = 2;
this.label5.Text = "Version:";
//
// label7
//
this.label7.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(6, 164);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(44, 15);
this.label7.TabIndex = 3;
this.label7.Text = "Binary:";
//
// btnBrowse
//
this.btnBrowse.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.btnBrowse.Enabled = false;
this.btnBrowse.Location = new System.Drawing.Point(183, 161);
this.btnBrowse.Name = "btnBrowse";
this.btnBrowse.Size = new System.Drawing.Size(68, 21);
this.btnBrowse.TabIndex = 5;
this.btnBrowse.Text = "&Browse...";
this.btnBrowse.UseVisualStyleBackColor = true;
this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click);
//
// textboxVersion
//
this.textboxVersion.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textboxVersion.Enabled = false;
this.textboxVersion.Location = new System.Drawing.Point(84, 135);
this.textboxVersion.Name = "textboxVersion";
this.textboxVersion.Size = new System.Drawing.Size(167, 21);
this.textboxVersion.TabIndex = 3;
this.textboxVersion.TextChanged += new System.EventHandler(this.textboxVersion_TextChanged);
//
// openFileDialog1
//
this.openFileDialog1.DefaultExt = "exe";
this.openFileDialog1.Filter = "Executable files|*.exe|All files|*.*";
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Location = new System.Drawing.Point(12, 12);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(332, 507);
this.tabControl1.TabIndex = 7;
//
// tabPage1
//
this.tabPage1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(204)))), ((int)(((byte)(187)))));
this.tabPage1.Controls.Add(this.panel3);
this.tabPage1.Location = new System.Drawing.Point(4, 24);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(324, 479);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "SRB2";
//
// tabPage2
//
this.tabPage2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(204)))), ((int)(((byte)(187)))));
this.tabPage2.Controls.Add(this.panel5);
this.tabPage2.Location = new System.Drawing.Point(4, 24);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(324, 479);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Master Server";
//
// panel5
//
this.panel5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(204)))), ((int)(((byte)(187)))));
this.panel5.Controls.Add(this.panel6);
this.panel5.Controls.Add(this.panel2);
this.panel5.Location = new System.Drawing.Point(6, 6);
this.panel5.Name = "panel5";
this.panel5.Padding = new System.Windows.Forms.Padding(10);
this.panel5.Size = new System.Drawing.Size(312, 507);
this.panel5.TabIndex = 7;
//
// panel6
//
this.panel6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(230)))), ((int)(((byte)(217)))));
this.panel6.Controls.Add(this.groupBox2);
this.panel6.Location = new System.Drawing.Point(13, 114);
this.panel6.Name = "panel6";
this.panel6.Padding = new System.Windows.Forms.Padding(5);
this.panel6.Size = new System.Drawing.Size(286, 61);
this.panel6.TabIndex = 6;
//
// groupBox2
//
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox2.Controls.Add(this.chkShowDefaultWads);
this.groupBox2.Location = new System.Drawing.Point(9, 8);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(269, 45);
this.groupBox2.TabIndex = 0;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "List Settings";
//
// chkShowDefaultWads
//
this.chkShowDefaultWads.AutoSize = true;
this.chkShowDefaultWads.Location = new System.Drawing.Point(6, 20);
this.chkShowDefaultWads.Name = "chkShowDefaultWads";
this.chkShowDefaultWads.Size = new System.Drawing.Size(201, 19);
this.chkShowDefaultWads.TabIndex = 8;
this.chkShowDefaultWads.Text = "Show default files in list of wads";
this.chkShowDefaultWads.UseVisualStyleBackColor = true;
//
// chkCloseOnStart
//
this.chkCloseOnStart.AutoSize = true;
this.chkCloseOnStart.Location = new System.Drawing.Point(9, 47);
this.chkCloseOnStart.Name = "chkCloseOnStart";
this.chkCloseOnStart.Size = new System.Drawing.Size(216, 19);
this.chkCloseOnStart.TabIndex = 9;
this.chkCloseOnStart.Text = "Close Launcher when SRB2 starts";
this.chkCloseOnStart.UseVisualStyleBackColor = true;
//
// Options
//
this.AcceptButton = this.btnSave;
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(230)))), ((int)(((byte)(217)))));
this.ClientSize = new System.Drawing.Size(356, 560);
this.Controls.Add(this.tabControl1);
this.Controls.Add(this.btnSave);
this.Controls.Add(this.btnCancel);
this.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "Options";
this.Text = "Options";
this.groupDisplay.ResumeLayout(false);
this.groupDisplay.PerformLayout();
this.panel1.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.groupMS.ResumeLayout(false);
this.groupMS.PerformLayout();
this.panel3.ResumeLayout(false);
this.panel7.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.panel4.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.panel5.ResumeLayout(false);
this.panel6.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupDisplay;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.CheckBox chkDisplayWindowed;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtWidth;
private System.Windows.Forms.CheckBox chkCustomResolution;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtHeight;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnSave;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.GroupBox groupMS;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtMSAddress;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtMSPort;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.ListView listviewBinaries;
private System.Windows.Forms.ColumnHeader colhdrVersion;
private System.Windows.Forms.ColumnHeader colhdrBinary;
private System.Windows.Forms.TextBox textboxBinary;
private System.Windows.Forms.Button btnAdd;
private System.Windows.Forms.Button btnDel;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Button btnBrowse;
private System.Windows.Forms.TextBox textboxVersion;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.Panel panel5;
private System.Windows.Forms.Panel panel6;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.CheckBox chkShowDefaultWads;
private System.Windows.Forms.Panel panel7;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.TextBox txtParams;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.CheckBox chkCloseOnStart;
}
}

View file

@ -1,134 +0,0 @@
using System;
using System.Collections.Generic;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace SRB2Updater
{
public partial class Options : Form
{
private Settings settings;
public Options(Settings settings)
{
InitializeComponent();
this.settings = settings;
SetOptions();
}
private void SetOptions()
{
chkDisplayWindowed.Checked = settings.displayWindowed;
chkCustomResolution.Checked = settings.displayCustom;
txtHeight.Text = settings.displayHeight.ToString();
txtWidth.Text = settings.displayWidth.ToString();
txtMSPort.Text = settings.msPort.ToString();
settings.AddBinariesToListView(listviewBinaries);
txtMSAddress.Text = settings.msAddress.ToString();
txtParams.Text = settings.Params.ToString();
chkCloseOnStart.Checked = settings.CloseOnStart;
chkShowDefaultWads.Checked = settings.ShowDefaultWads;
if (settings.displayCustom)
{
txtHeight.Enabled = true;
txtWidth.Enabled = true;
}
else
{
txtHeight.Enabled = false;
txtWidth.Enabled = false;
}
}
private void chkCustomResolution_CheckedChanged(object sender, EventArgs e)
{
if (chkCustomResolution.Checked)
{
txtHeight.Enabled = true;
txtWidth.Enabled = true;
}
else
{
txtHeight.Enabled = false;
txtWidth.Enabled = false;
}
}
private void btnSave_Click(object sender, EventArgs e)
{
settings.displayCustom = chkCustomResolution.Checked;
settings.displayHeight = Convert.ToInt32(txtHeight.Text);
settings.displayWidth = Convert.ToInt32(txtWidth.Text);
settings.displayWindowed = chkDisplayWindowed.Checked;
settings.msAddress = txtMSAddress.Text;
settings.ShowDefaultWads = chkShowDefaultWads.Checked;
settings.Params = txtParams.Text;
settings.msPort = Convert.ToInt32(txtMSPort.Text);
settings.CloseOnStart = chkCloseOnStart.Checked;
settings.SaveSettings();
settings.SetBinariesFromListView(listviewBinaries);
Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
Close();
}
private void btnAdd_Click(object sender, EventArgs e)
{
listviewBinaries.Items.Add(new ListViewItem(new string[] { "[New Version]", "" }));
}
private void btnDel_Click(object sender, EventArgs e)
{
if (listviewBinaries.SelectedItems.Count > 0)
listviewBinaries.Items.Remove(listviewBinaries.SelectedItems[0]);
}
private void btnBrowse_Click(object sender, EventArgs e)
{
if (listviewBinaries.SelectedItems.Count > 0 &&
openFileDialog1.ShowDialog() == DialogResult.OK)
textboxBinary.Text = openFileDialog1.FileName;
}
private void textboxVersion_TextChanged(object sender, EventArgs e)
{
if (listviewBinaries.SelectedItems.Count > 0)
listviewBinaries.SelectedItems[0].Text = textboxVersion.Text;
}
private void textboxBinary_TextChanged(object sender, EventArgs e)
{
if (listviewBinaries.SelectedItems.Count > 0)
listviewBinaries.SelectedItems[0].SubItems[1].Text = textboxBinary.Text;
}
private void listviewBinaries_SelectedIndexChanged(object sender, EventArgs e)
{
if (listviewBinaries.SelectedItems.Count > 0)
{
btnDel.Enabled = true;
btnBrowse.Enabled = true;
textboxVersion.Text = listviewBinaries.SelectedItems[0].Text;
textboxBinary.Text = listviewBinaries.SelectedItems[0].SubItems[1].Text;
textboxVersion.Enabled = true;
textboxBinary.Enabled = true;
}
else
{
btnDel.Enabled = false;
btnBrowse.Enabled = false;
textboxVersion.Text = "";
textboxBinary.Text = "";
textboxVersion.Enabled = false;
textboxBinary.Enabled = false;
}
}
}
}

View file

@ -1,166 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAEACACoCAAAFgAAACgAAAAgAAAAQAAAAAEACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAADg4OAIAAAABQABkAlgAAALkAAABQGQAAcwAlAJYAMQBzJQAAuQA9AJYxAACWAGIAMjIyALk9
AAD/JSUAPj4+AFZWVgD/SEgAYmJiAABilgBubm4Aenp6AP9rawCAgIAAhoaGAJKSkgD/jo4Anp6eAKSg
oAD/jqsAqqqqAGuP/wC2trYAwMDAAI6r/wDCwsIAa8b/AM7OzgCO1P8A2traAObm5gDy8vIA////AAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAGgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFQ8PHQAAAAAAAAAAAAAAACMgJSUlJSUZ
AAAAABMNBgoPDw8AAAAAAAAAAAAAACInJycnJycnJyclFgYGBggPDw8PDwAAAAAAAAAAAAAjJycnJycn
JycnGScnFQkGCA8PDw8AAAAAAAAAAAAAISMnJycjIyMjJycnJycVDwYGDw8PDwAAAAAAAAAAAAAQAAEj
HygqKSkkHyMnJwoPDwYJDw8PAAAAAAAAAAAAACkTHxwrKysrKysrGhkMDw8PCwYJDw8AAAAAAAAAACkp
JA0pACkrKysrKyspDw8PDw8PAwYIAAAAAAAAAAAAACsiARwAISsrKysrKysSDw8PDw8PAwYAAAAAAAAA
AAAAKyIAEAAfKysrKysrKxcPDw8PDw8PDwgIABYAABcSCAArKAMPACIrKysrKysrGw8PDw8PDw8PDw8P
Dw8PDw8RACsoBA8EISsrKysrKyseDw8PDw8PDw8PDw8PDw8PDwAAKx8PDw8VKSsrKysrKxcPDw8PDw8P
Dw8PDw8PDw8AACooFQ8PDw8aKCsrKysmDw8PDw8PDw8PDw8PDw8PFQAAAAAKDw8PDw8VIigoIgoPDw8P
Dw8PDw8PDw8PDxEAAAAAAAoPDw8PDw8XFxcXEhIPDwUPDw8PDw8PDw8YAAAAAAAACA8PDw8SFxcXFxcX
FxcPFQ8PDw8PDw8KAAAAAAAAAAAACg8PEhcXFxcXFxcXFxkjBRISEhISGAAAAAAAAAAAIRcXCA8XFxcX
FxcXFxcaJyMFDwoLEQAAAAAAAAAAAAAAFxcSDxIXFxcXFxcSEyAlIwILCwsIAAAAAAAAAAAAABcXEg8A
EhIXFxcXEgoPDBUUBwsLCwsLAAAAAAAAAAAAFxcAAAAAFxIXFxcXFxIKDw8ICwsLDg4LAAAAAAAAAAAA
AAAAAAAAABISFxcXFw8PDw8PDw8PDwAAAAAAAAAAAAAAAAAAAAAAAAASEhcSDw8PDw8PDxIAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAFwoSDw8SFwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAP///////////////////3////w//APAf/AAAH/gAAD/wAAA/8AAAP/AAAD/AAAB/4AA
Af+AAABYgAAAAIAAAAGAAAADAAAAA8AAAAfAAAAPwAAAP+AAAH+AAAH/wAAB/4QAAP+eAAB//4AA///g
Af//+A//////////////////
</value>
</data>
</root>

View file

@ -1,20 +0,0 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace SRB2Updater
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Launcher(args));
}
}
}

View file

@ -1,35 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Resources;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SRB2 Automatic Updater")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Sonic Team Junior")]
[assembly: AssemblyProduct("Sonic Robo Blast 2")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("94c164ce-02a9-4966-948f-004d35760ba1")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguageAttribute("en-US")]

View file

@ -1,132 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4927
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace SRB2Updater.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SRB2Updater.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
internal static System.Drawing.Bitmap Banner {
get {
object obj = ResourceManager.GetObject("Banner", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap Banner2 {
get {
object obj = ResourceManager.GetObject("Banner2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap Banner3 {
get {
object obj = ResourceManager.GetObject("Banner3", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap Banner4 {
get {
object obj = ResourceManager.GetObject("Banner4", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap CONSBACK {
get {
object obj = ResourceManager.GetObject("CONSBACK", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.IO.UnmanagedMemoryStream Kotaku {
get {
return ResourceManager.GetStream("Kotaku", resourceCulture);
}
}
internal static System.Drawing.Bitmap Sonic {
get {
object obj = ResourceManager.GetObject("Sonic", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap sonic_bottom {
get {
object obj = ResourceManager.GetObject("sonic_bottom", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap sonic_top {
get {
object obj = ResourceManager.GetObject("sonic_top", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap updaterbanner {
get {
object obj = ResourceManager.GetObject("updaterbanner", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View file

@ -1,151 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="CONSBACK" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\CONSBACK.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Sonic" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Sonic.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Banner" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Banner.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="sonic_bottom" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\sonic_bottom.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="sonic_top" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\sonic_top.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="updaterbanner" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\updaterbanner.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Banner2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Banner2.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Banner3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Banner3.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Banner4" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Banner4.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Kotaku" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Kotaku.wav;System.IO.MemoryStream, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

View file

@ -1,26 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.3506
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace SRB2Updater.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View file

@ -1,7 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View file

@ -1,173 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{2E2F67C6-8492-4034-A142-50872504D86D}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SRB2Updater</RootNamespace>
<AssemblyName>srb2update</AssemblyName>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>2.0</OldToolsVersion>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkSubset>
</TargetFrameworkSubset>
<IsWebBootstrapper>false</IsWebBootstrapper>
<ApplicationIcon>Srb2win.ico</ApplicationIcon>
<StartupObject>SRB2Updater.Program</StartupObject>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Bunny.cs" />
<Compile Include="Debug.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Debug.Designer.cs">
<DependentUpon>Debug.cs</DependentUpon>
</Compile>
<Compile Include="Launcher.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Launcher.Designer.cs">
<DependentUpon>Launcher.cs</DependentUpon>
</Compile>
<Compile Include="MSClient.cs" />
<Compile Include="Options.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Options.Designer.cs">
<DependentUpon>Options.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Debug.resx">
<DependentUpon>Debug.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Launcher.resx">
<DependentUpon>Launcher.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Options.resx">
<DependentUpon>Options.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="ServerQuerier.cs" />
<Compile Include="Settings.cs" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
<Visible>False</Visible>
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
<Visible>False</Visible>
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="Resources\CONSBACK.bmp" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\updaterbanner.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Sonic.png" />
<None Include="Resources\sonic_bottom.png" />
<None Include="Resources\sonic_top.png" />
<None Include="Resources\Banner.png" />
<None Include="Resources\Banner2.png" />
<None Include="Resources\Banner3.png" />
<None Include="Resources\Banner4.png" />
<Content Include="Resources\Kotaku.wav" />
<Content Include="Srb2win.ico" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -1,20 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SRB2Updater", "SRB2Updater.csproj", "{2E2F67C6-8492-4034-A142-50872504D86D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2E2F67C6-8492-4034-A142-50872504D86D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2E2F67C6-8492-4034-A142-50872504D86D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2E2F67C6-8492-4034-A142-50872504D86D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2E2F67C6-8492-4034-A142-50872504D86D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View file

@ -1,362 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.IO;
namespace SRB2Updater
{
class ServerQuerier
{
private UdpClient udpclient;
private IPEndPoint ipepMS;
private const int MS_HOLEPUNCH_SIZE = 0;
private const int PT_ASKINFO_SIZE = 16;
private const byte PT_ASKINFO = 12;
private const byte PT_SERVERINFO = 13;
private const int MAXSERVERNAME = 32;
private const int MAX_WADPATH = 128;
/// <summary>
/// Constructs a ServerQuerier object.
/// </summary>
public ServerQuerier()
{
udpclient = new UdpClient(0, AddressFamily.InterNetwork);
// Fix for WSAECONNRESET. Only affects Win2k and up. If I send a
// packet to a host which replies with an ICMP Port Unreachable,
// subsequent socket operations go doo-lally. So, we enable the
// older behaviour of ignoring these ICMP messages, since we don't
// care about them anyway.
if (Environment.OSVersion.Platform == PlatformID.Win32NT &&
Environment.OSVersion.Version.Major >= 5)
{
const uint IOC_IN = 0x80000000;
const uint IOC_VENDOR = 0x18000000;
const uint SIO_UDP_CONNRESET = IOC_IN | IOC_VENDOR | 12;
udpclient.Client.IOControl(unchecked((int)SIO_UDP_CONNRESET), new byte[] { Convert.ToByte(false) }, null);
}
}
public void StartListening(ServerInfoReceiveHandler sirh)
{
// Start listening.
udpclient.BeginReceive(new AsyncCallback(ServerInfoReceiveHandler.Receive), sirh);
}
/// <summary>
/// Sets the master server address. Necessary before querying via the MS.
/// </summary>
/// <param name="strAddress">IP address of hostname of MS.</param>
/// <param name="unPort">Port of MS.</param>
public void SetMasterServer(string strAddress, ushort unPort)
{
IPAddress address = Dns.GetHostEntry(strAddress).AddressList[0];
ipepMS = new IPEndPoint(address, unPort);
}
public void Query(string strAddress, ushort unPort)
{
// Build the packet.
byte[] byPacket = new byte[PT_ASKINFO_SIZE];
BinaryWriter bw = new BinaryWriter(new MemoryStream(byPacket));
bw.Seek(4, SeekOrigin.Begin); // Skip the checksum.
bw.Write((byte)0); // ack
bw.Write((byte)0); // ackreturn
bw.Write((byte)PT_ASKINFO); // Packet type.
bw.Write((byte)0); // Reserved.
bw.Write((byte)0); // Version. This is actually unnecessary -- the client will reply anyway. -MattW_CFI
bw.Write((byte)0); // Reserved.
bw.Write((byte)0); // Reserved.
bw.Write((byte)0); // Reserved.
// Time for ping calculation.
bw.Write(unchecked((uint)(DateTime.Now.Ticks / 10000)));
// Calculate the checksum.
bw.Seek(0, SeekOrigin.Begin);
bw.Write(SRB2Checksum(byPacket));
// Send the packet.
udpclient.Send(byPacket, byPacket.Length, strAddress, unPort);
}
/// <summary>
/// Calculates the checksum of an SRB2 packet.
/// </summary>
/// <param name="byPacket">Packet.</param>
/// <returns>Checksum.</returns>
private static uint SRB2Checksum(byte[] byPacket)
{
uint c = 0x1234567;
int i;
for (i = 4; i < byPacket.Length; i++)
unchecked
{
c += (uint)byPacket[i] * (uint)(i - 3);
}
return c;
}
private static string ReadFixedLengthStr(BinaryReader br, int iLen)
{
String str = Encoding.ASCII.GetString(br.ReadBytes(iLen));
int iPos = str.IndexOf("\0");
if (iPos >= 0)
str = str.Remove(iPos);
return str;
}
public abstract class ServerInfoReceiveHandler
{
UdpClient udpclient;
IPEndPoint ipepRemote;
/// <summary>
/// Called after a server info packet is received.
/// </summary>
/// <param name="srb2si">Server info.</param>
public abstract void ProcessServerInfo(SRB2ServerInfo srb2si);
public abstract void HandleException(Exception e);
public ServerInfoReceiveHandler(ServerQuerier sq)
{
ipepRemote = new IPEndPoint(IPAddress.Any, 0);
udpclient = sq.udpclient;
}
public static void Receive(IAsyncResult ar)
{
ServerInfoReceiveHandler sirh = (ServerInfoReceiveHandler)ar.AsyncState;
byte[] byPacket = sirh.udpclient.EndReceive(ar, ref sirh.ipepRemote);
// Analyse the packet.
BinaryReader br = new BinaryReader(new MemoryStream(byPacket));
// Get the checksum.
uint uiChecksum = br.ReadUInt32();
// Skip ack and ackreturn and get packet type.
br.ReadBytes(2);
byte byPacketType = br.ReadByte();
// Only interested in valid PT_SERVERINFO packets.
if (byPacketType == PT_SERVERINFO && uiChecksum == SRB2Checksum(byPacket))
{
bool bMalformed = true;
// Skip padding.
br.ReadByte();
// Remember where we are.
long iPacketStart = br.BaseStream.Position;
// Try to interpret the packet in each recognised format.
foreach (ServerInfoVer siv in Enum.GetValues(typeof(ServerInfoVer)))
{
SRB2ServerInfo srb2si;
byte byNumWads = 0;
srb2si.siv = siv;
br.BaseStream.Position = iPacketStart;
// Get address from socket.
srb2si.strAddress = sirh.ipepRemote.Address.ToString();
srb2si.unPort = unchecked((ushort)sirh.ipepRemote.Port);
// Get version.
byte byVersion = br.ReadByte();
if (siv == ServerInfoVer.SIV_PREME)
{
br.ReadBytes(3);
uint uiSubVersion = br.ReadUInt32();
// Format version.
// MattW_CFI: I hope you don't mind this exception, Oogaland, but 0.01.6 looks odd >_>
if (byVersion == 1 && uiSubVersion == 6)
srb2si.strVersion = "X.01.6";
else
srb2si.strVersion = byVersion.ToString();
//srb2si.strVersion = String.Format("{0}.{1:00}.{2}", byVersion / 100, byVersion % 100, uiSubVersion);
}
else
{
byte bySubVersion = br.ReadByte();
// Format version.
//srb2si.strVersion = String.Format("{0}.{1:00}.{2}", byVersion / 100, byVersion % 100, bySubVersion);
srb2si.strVersion = byVersion.ToString();
}
srb2si.byPlayers = br.ReadByte();
srb2si.byMaxplayers = br.ReadByte();
srb2si.byGametype = br.ReadByte();
srb2si.bModified = (br.ReadByte() != 0);
if (siv == ServerInfoVer.SIV_ME)
byNumWads = br.ReadByte();
srb2si.sbyAdminplayer = br.ReadSByte();
if (siv == ServerInfoVer.SIV_PREME)
br.ReadBytes(3);
// Calculate ping.
srb2si.uiTime = unchecked((uint)((long)(DateTime.Now.Ticks / 10000 - br.ReadUInt32()) % ((long)UInt32.MaxValue + 1)));
if (siv == ServerInfoVer.SIV_PREME)
br.ReadUInt32();
// Get and tidy map name.
if (siv == ServerInfoVer.SIV_PREME)
{
srb2si.strMapName = ReadFixedLengthStr(br, 8);
srb2si.strName = ReadFixedLengthStr(br, MAXSERVERNAME);
}
else
{
srb2si.strName = ReadFixedLengthStr(br, MAXSERVERNAME);
srb2si.strMapName = ReadFixedLengthStr(br, 8);
}
if (siv == ServerInfoVer.SIV_PREME)
byNumWads = br.ReadByte();
// Create new list of strings of initial size equal to number of wads.
srb2si.listFiles = new List<AddedWad>(byNumWads);
// Get the files info.
byte[] byFiles = br.ReadBytes(siv == ServerInfoVer.SIV_PREME ? 4096 : 936);
BinaryReader brFiles = new BinaryReader(new MemoryStream(byFiles));
// Extract the filenames.
try
{
for (int i = 0; i < byNumWads; i++)
{
bool bFullString = false;
AddedWad aw = new AddedWad();
if (siv == ServerInfoVer.SIV_PREME)
{
aw.bImportant = brFiles.ReadByte() != 0;
aw.downloadtype = (DownloadTypes)brFiles.ReadByte();
}
else
{
byte byFileStatus = brFiles.ReadByte();
aw.bImportant = (byFileStatus & 0xF) != 0;
aw.downloadtype = (DownloadTypes)(byFileStatus >> 4);
}
aw.uiSize = brFiles.ReadUInt32();
// Work out how long the string is.
int iStringPos = (int)brFiles.BaseStream.Position;
while (iStringPos < byFiles.Length && byFiles[iStringPos] != 0) iStringPos++;
// Make sure it's not longer than the max name length.
if (iStringPos - (int)brFiles.BaseStream.Position > MAX_WADPATH)
{
bFullString = true;
iStringPos = MAX_WADPATH + (int)brFiles.BaseStream.Position;
}
// Get the info and add it, if possible.
if (iStringPos > (int)brFiles.BaseStream.Position)
{
aw.strFilename = Encoding.ASCII.GetString(brFiles.ReadBytes(iStringPos - (int)brFiles.BaseStream.Position));
srb2si.listFiles.Add(aw);
}
// Skip nul.
if (!bFullString) brFiles.ReadByte();
// Skip the md5sum.
brFiles.ReadBytes(16);
}
// Okay, done! Do something useful with the server info.
sirh.ProcessServerInfo(srb2si);
// If we got this far without an exception, leave the foreach loop.
bMalformed = false;
break;
}
catch (EndOfStreamException)
{
// Packet doesn't match supposed type, so we swallow the exception
// and try remaining types.
}
catch (Exception e)
{
sirh.HandleException(e);
break;
}
}
if (bMalformed)
sirh.HandleException(new Exception("Received invalid PT_SERVERINFO packet from " + sirh.ipepRemote.Address + ":" + sirh.ipepRemote.Port + "."));
}
// Resume listening.
sirh.ipepRemote = new IPEndPoint(IPAddress.Any, 0);
sirh.udpclient.BeginReceive(new AsyncCallback(Receive), sirh);
}
}
public enum DownloadTypes
{
DT_TOOBIG = 0,
DT_OK = 1,
DT_DISABLED = 2
}
public struct AddedWad
{
public string strFilename;
public bool bImportant;
public uint uiSize;
public DownloadTypes downloadtype;
}
public enum ServerInfoVer
{
SIV_PREME,
SIV_ME
};
public struct SRB2ServerInfo
{
public string strAddress;
public ushort unPort;
public ServerInfoVer siv;
public string strVersion;
public byte byPlayers;
public byte byMaxplayers;
public byte byGametype;
public bool bModified;
public sbyte sbyAdminplayer;
public uint uiTime;
public string strMapName;
public string strName;
public List<AddedWad> listFiles;
}
}
}

View file

@ -1,219 +0,0 @@
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.Data;
using Microsoft.Win32;
using System.Windows.Forms;
using System.IO;
namespace SRB2Updater
{
public class Settings
{
// Global Settings
public bool boolDisplayWindowed;
public bool boolDisplayCustomResolution;
public bool boolCloseOnStart;
public int intDisplayWidth;
public int intDisplayHeight;
public string strMSAddress;
public int intMSPort;
public Array arrWadList;
public string strParams;
public string Params
{
get { return strParams; }
set { strParams = value; }
}
public Array wadList
{
get { return arrWadList; }
set { arrWadList = value; }
}
public bool CloseOnStart
{
get { return boolCloseOnStart; }
set { boolCloseOnStart = value; }
}
public string msAddress
{
get { return strMSAddress; }
set { strMSAddress = value; }
}
public int msPort
{
get { return intMSPort; }
set { intMSPort = value; }
}
public bool displayWindowed
{
get { return boolDisplayWindowed; }
set { boolDisplayWindowed = value; }
}
public bool displayCustom
{
get { return boolDisplayCustomResolution; }
set { boolDisplayCustomResolution = value; }
}
public int displayWidth
{
get { return intDisplayWidth; }
set { intDisplayWidth = value; }
}
public int displayHeight
{
get { return intDisplayHeight; }
set { intDisplayHeight = value; }
}
bool boolShowDefaultWads;
public bool ShowDefaultWads
{
get { return boolShowDefaultWads; }
set { boolShowDefaultWads = value; }
}
public void GetSettings()
{
RegistryKey rk = Registry.CurrentUser.CreateSubKey(@"Software\SonicTeamJunior\Launcher");
RegistryKey rkDisplay = Registry.CurrentUser.CreateSubKey(@"Software\SonicTeamJunior\Launcher\Display");
RegistryKey rkMS = Registry.CurrentUser.CreateSubKey(@"Software\SonicTeamJunior\Launcher\MasterServer");
RegistryKey rkBinaries = rk.CreateSubKey("Binaries");
rkBinaries.SetValue("2.0.4", Directory.GetCurrentDirectory() + "\\srb2win.exe");
try { boolDisplayCustomResolution = Convert.ToInt32(rkDisplay.GetValue("CustomResolution", 0)) != 0; }
catch { boolDisplayCustomResolution = false; }
try { boolDisplayWindowed = Convert.ToInt32(rkDisplay.GetValue("Windowed", 0)) != 0; }
catch { boolDisplayWindowed = false; }
try { boolShowDefaultWads = Convert.ToInt32(rkDisplay.GetValue("ShowDefaultWads", 0)) != 0; }
catch { boolShowDefaultWads = false; }
try { boolCloseOnStart = Convert.ToInt32(rkDisplay.GetValue("CloseOnStart", 0)) != 0; }
catch { boolCloseOnStart = false; }
intDisplayHeight = Convert.ToInt32(rkDisplay.GetValue("Height", "480"));
intDisplayWidth = Convert.ToInt32(rkDisplay.GetValue("Width", "640"));
intMSPort = Convert.ToInt32(rkMS.GetValue("Port", "28900"));
strMSAddress = Convert.ToString(rkMS.GetValue("Address", "ms.srb2.org"));
strParams = Convert.ToString(rk.GetValue("Params"));
dicBinaries.Clear();
foreach (string strName in rkBinaries.GetValueNames())
dicBinaries[strName] = (string)rkBinaries.GetValue(strName);
rk.Close();
rkDisplay.Close();
rkMS.Close();
rkBinaries.Close();
}
public void SaveSettings()
{
RegistryKey rk = Registry.CurrentUser.CreateSubKey(@"Software\SonicTeamJunior\Launcher");
RegistryKey rkDisplay = rk.CreateSubKey("Display");
RegistryKey rkMS = rk.CreateSubKey("MasterServer");
rkDisplay.SetValue("CustomResolution", boolDisplayCustomResolution);
rkDisplay.SetValue("Windowed", boolDisplayWindowed);
rkDisplay.SetValue("Height", intDisplayHeight);
rkDisplay.SetValue("Width", intDisplayWidth);
rkMS.SetValue("Port", intMSPort);
rkMS.SetValue("Address", strMSAddress);
rkMS.SetValue("ShowDefaultWads", boolShowDefaultWads);
rk.SetValue("Params", strParams);
rk.SetValue("CloseOnStart", boolCloseOnStart);
rk.DeleteSubKey("Binaries", false);
RegistryKey rkBinaries = rk.CreateSubKey("Binaries");
rkBinaries.SetValue("2.0.4", Directory.GetCurrentDirectory() + "\\srb2win.exe");
foreach (string strName in dicBinaries.Keys)
rkBinaries.SetValue(strName, dicBinaries[strName]);
rk.Close();
}
/* public void WriteToRegistry()
{
RegistryKey rk = Registry.CurrentUser.CreateSubKey(@"Software\SRB2MSLauncher");
rk.SetValue("Params", strParams);
rk.SetValue("Masterserver", strMSAddress);
rk.SetValue("MSPort", unMSPort, RegistryValueKind.DWord);
rk.SetValue("ShowDefaultWads", Convert.ToInt32(bShowDefaultWads), RegistryValueKind.DWord);
rk.DeleteSubKey("Binaries", false);
RegistryKey rkBinaries = rk.CreateSubKey("Binaries");
foreach (string strName in dicBinaries.Keys)
rkBinaries.SetValue(strName, dicBinaries[strName]);
rkBinaries.Close();
rk.Close();
}
public void LoadFromRegistry()
{
RegistryKey rk = Registry.CurrentUser.CreateSubKey(@"Software\SRB2MSLauncher");
RegistryKey rkBinaries = rk.CreateSubKey("Binaries");
strParams = (string)rk.GetValue("Params", "");
strMSAddress = (string)rk.GetValue("Masterserver", "ms.srb2.org");
try { unMSPort = Convert.ToUInt16(rk.GetValue("MSPort", MS_DEFAULT_PORT)); }
catch { unMSPort = MS_DEFAULT_PORT; }
try { bShowDefaultWads = Convert.ToInt32(rk.GetValue("ShowDefaultWads", 0)) != 0; }
catch { bShowDefaultWads = true; }
dicBinaries.Clear();
foreach (string strName in rkBinaries.GetValueNames())
dicBinaries[strName] = (string)rkBinaries.GetValue(strName);
rkBinaries.Close();
rk.Close();
}*/
public List<string> VersionStrings
{
get { return new List<string>(dicBinaries.Keys); }
}
public bool HasBinaryForVersion(string strVersion)
{
return dicBinaries.ContainsKey(strVersion) && dicBinaries[strVersion] != "";
}
public void AddBinariesToListView(ListView lv)
{
foreach (string strName in dicBinaries.Keys)
lv.Items.Add(new ListViewItem(new string[] { strName, dicBinaries[strName] }));
}
public void SetBinariesFromListView(ListView lv)
{
dicBinaries.Clear();
foreach (ListViewItem lvi in lv.Items)
dicBinaries[lvi.Text] = lvi.SubItems[1].Text;
}
Dictionary<string, string> dicBinaries = new Dictionary<string, string>();
public void SetBinary(string strVersion, string strBinary)
{
dicBinaries[strVersion] = strBinary;
}
public string GetBinary(string strVersion)
{
return dicBinaries[strVersion];
}
}
}

View file

@ -1,3 +0,0 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>