Code:
// Type: WindowsFormsApplication1.Form1
// Assembly: EOS Rappelz Launcher, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// Assembly location: C:\Users\Administrator\Desktop\EOS Launcher\EOS Rappelz Launcher.exe
using Ionic.Zip;
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Windows.Forms;
using System.Xml.Linq;
namespace WindowsFormsApplication1
{
public class Form1 : Form
{
private IContainer components = (IContainer) null;
private ProgressBar progressBar1;
private Button button1;
private Button button2;
private BackgroundWorker backgroundWorker1;
private Label label1;
private Button button3;
private Label label2;
private Label label3;
private Label server;
private Label status;
private WebBrowser webBrowser1;
public Form1()
{
this.InitializeComponent();
this.backgroundWorker1.RunWorkerAsync();
this.backgroundWorker1.WorkerReportsProgress = true;
}
private static bool deleteFile(string f)
{
try
{
System.IO.File.Delete(f);
return true;
}
catch (IOException ex)
{
return false;
}
}
private void Form1_Load(object sender, EventArgs e)
{
this.label1.ForeColor = Color.Red;
this.label1.Text = "Client is up to date";
string str = System.IO.File.OpenText("version").ReadToEnd();
this.label2.ForeColor = Color.Green;
this.label2.Text = str;
try
{
using (Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
{
socket.Connect("74.91.124.250", 8841);
if (!socket.Connected)
return;
this.Invoke((Delegate) (() => this.server.Text = "ONLINE."));
this.server.ForeColor = Color.Green;
}
}
catch (Exception ex)
{
this.Invoke((Delegate) (() => this.server.Text = "OFFLINE."));
this.server.ForeColor = Color.OrangeRed;
}
}
private void button2_Click(object sender, EventArgs e)
{
this.webBrowser1.Url = new Uri("http://74.91.124.250/");
}
private void button1_Click(object sender, EventArgs e)
{
try
{
Process.Start("SFrame.exe", "/auth_ip:74.91.124.250 /auth_port:8841 /locale:ASCII /country:US /commercial_shop");
this.Close();
}
catch (SyntaxErrorException ex)
{
}
}
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
for (int percentProgress = 0; percentProgress <= 100; ++percentProgress)
{
string str1 = "http://teamhyperion.com/Updates/";
string baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
FileStream fileStream = (FileStream) null;
if (!System.IO.File.Exists("version"))
{
using (fileStream = System.IO.File.Create("version"))
;
using (StreamWriter streamWriter = new StreamWriter("version"))
streamWriter.Write("1.0");
}
string s1;
using (StreamReader streamReader = new StreamReader("version"))
s1 = streamReader.ReadLine();
Decimal num = Decimal.Parse(s1);
foreach (XElement xelement in XDocument.Load(str1 + "Updates.xml").Descendants((XName) "update"))
{
string s2 = xelement.Element((XName) "version").Value;
string str2 = xelement.Element((XName) "file").Value;
if (Decimal.Parse(s2) > num)
{
WebClient webClient = new WebClient();
string str3 = "http://teamhyperion.com/";
string fileName = str2 ?? "";
string uriString = str3 + fileName;
webClient.DownloadFileAsync(new Uri(uriString), fileName);
this.backgroundWorker1.ReportProgress(percentProgress);
}
}
}
}
private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
this.progressBar1.Value = e.ProgressPercentage;
this.label1.ForeColor = Color.Red;
this.label1.Text = "Installing Patch";
}
private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
string str1 = "http://teamhyperion.com/Updates/";
string baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
foreach (XElement xelement in XDocument.Load(str1 + "Updates.xml").Descendants((XName) "update"))
{
string str2 = xelement.Element((XName) "version").Value;
string str3 = xelement.Element((XName) "file").Value;
WebClient webClient = new WebClient();
string str4 = "http://teamhyperion.com/Updates/";
string fileName = "version";
string uriString = str4 + fileName;
webClient.DownloadFileAsync(new Uri(uriString), fileName);
this.label1.ForeColor = Color.Red;
this.label1.Text = "Client is up to date";
try
{
using (ZipFile zipFile = ZipFile.Read(str3))
{
foreach (ZipEntry zipEntry in zipFile)
zipEntry.Extract(baseDirectory + "\\Resource\\", true);
}
Form1.deleteFile(str3);
}
catch (Exception ex)
{
}
}
}
private void button3_Click(object sender, EventArgs e)
{
Process.Start("www.teamhyperion.com");
}
protected override void Dispose(bool disposing)
{
if (disposing && this.components != null)
this.components.Dispose();
base.Dispose(disposing);
}
private void InitializeComponent()
{
ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (Form1));
this.progressBar1 = new ProgressBar();
this.button1 = new Button();
this.button2 = new Button();
this.backgroundWorker1 = new BackgroundWorker();
this.label1 = new Label();
this.button3 = new Button();
this.label2 = new Label();
this.label3 = new Label();
this.server = new Label();
this.status = new Label();
this.webBrowser1 = new WebBrowser();
this.SuspendLayout();
this.progressBar1.Location = new Point(0, 322);
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new Size(229, 23);
this.progressBar1.TabIndex = 0;
this.button1.BackColor = Color.Red;
this.button1.FlatAppearance.BorderColor = Color.Red;
this.button1.FlatAppearance.BorderSize = 2;
this.button1.Location = new Point(593, 322);
this.button1.Name = "button1";
this.button1.Size = new Size(77, 23);
this.button1.TabIndex = 4;
this.button1.Text = "START GAME";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new EventHandler(this.button1_Click);
this.button2.BackColor = Color.Lime;
this.button2.FlatAppearance.BorderColor = Color.Lime;
this.button2.FlatAppearance.BorderSize = 2;
this.button2.Location = new Point(502, 322);
this.button2.Name = "button2";
this.button2.Size = new Size(85, 23);
this.button2.TabIndex = 5;
this.button2.Text = "REGISTER";
this.button2.UseVisualStyleBackColor = false;
this.button2.Click += new EventHandler(this.button2_Click);
this.backgroundWorker1.DoWork += new DoWorkEventHandler(this.backgroundWorker1_DoWork);
this.backgroundWorker1.ProgressChanged += new ProgressChangedEventHandler(this.backgroundWorker1_ProgressChanged);
this.backgroundWorker1.RunWorkerCompleted += new RunWorkerCompletedEventHandler(this.backgroundWorker1_RunWorkerCompleted);
this.label1.AutoSize = true;
this.label1.Location = new Point(248, 327);
this.label1.Name = "label1";
this.label1.Size = new Size(0, 13);
this.label1.TabIndex = 6;
this.button3.BackColor = Color.DodgerBlue;
this.button3.Location = new Point(412, 322);
this.button3.Name = "button3";
this.button3.Size = new Size(84, 23);
this.button3.TabIndex = 7;
this.button3.Text = "WEBSITE";
this.button3.UseVisualStyleBackColor = false;
this.button3.Click += new EventHandler(this.button3_Click);
this.label2.AutoSize = true;
this.label2.Location = new Point(371, 327);
this.label2.Name = "label2";
this.label2.Size = new Size(0, 13);
this.label2.TabIndex = 8;
this.label3.AutoSize = true;
this.label3.Location = new Point(348, 327);
this.label3.Name = "label3";
this.label3.Size = new Size(29, 13);
this.label3.TabIndex = 9;
this.label3.Text = "Ver :";
this.server.AutoSize = true;
this.server.Location = new Point(740, 327);
this.server.Name = "server";
this.server.Size = new Size(0, 13);
this.server.TabIndex = 10;
this.status.AutoSize = true;
this.status.Location = new Point(676, 327);
this.status.Name = "status";
this.status.Size = new Size(57, 13);
this.status.TabIndex = 11;
this.status.Text = "SERVER :";
this.webBrowser1.Location = new Point(0, 1);
this.webBrowser1.MinimumSize = new Size(20, 20);
this.webBrowser1.Name = "webBrowser1";
this.webBrowser1.Size = new Size(796, 315);
this.webBrowser1.TabIndex = 12;
this.webBrowser1.Url = new Uri("http://www.teamhyperion.com/images/img6.jpg", UriKind.Absolute);
this.AutoScaleDimensions = new SizeF(6f, 13f);
this.AutoScaleMode = AutoScaleMode.Font;
this.BackColor = SystemColors.GradientInactiveCaption;
this.ClientSize = new Size(797, 345);
this.Controls.Add((Control) this.webBrowser1);
this.Controls.Add((Control) this.status);
this.Controls.Add((Control) this.server);
this.Controls.Add((Control) this.label3);
this.Controls.Add((Control) this.label2);
this.Controls.Add((Control) this.button3);
this.Controls.Add((Control) this.label1);
this.Controls.Add((Control) this.button2);
this.Controls.Add((Control) this.button1);
this.Controls.Add((Control) this.progressBar1);
this.FormBorderStyle = FormBorderStyle.Fixed3D;
this.Icon = (Icon) componentResourceManager.GetObject("$this.Icon");
this.MaximizeBox = false;
this.Name = "Form1";
this.Text = "EOS Rappelz Launcher";
this.Load += new EventHandler(this.Form1_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
}
}