Register on man please
namespace NT_Launcher
{
using NT_Launcher.Properties;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
public class Form1 : Form
{
private Button button1;
private IContainer components;
private PictureBox pictureBox1;
public Form1()
{
this.InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (!File.Exists(Application.StartupPath + "/NostaleX.dat"))
{
MessageBox.Show("Please move the Launcher into your Nostale Folder");
return;
}
string path = Application.StartupPath + "/config.ini";
bool flag = false;
bool flag2 = false;
bool flag3 = false;
if (File.Exists(path))
{
List<string> list = new List<string>();
using (StreamReader reader = new StreamReader(path))
{
string str2;
while ((str2 = reader.ReadLine()) != null)
{
list.Add(str2);
}
reader.Close();
}
if (list.Contains("Port=4001"))
{
flag2 = true;
}
if (list.Contains("IP=134.255.233.168"))
{
flag3 = true;
}
if (flag3 & flag2)
{
flag = true;
goto Label_0136;
}
File.Delete(path);
using (StreamWriter writer = File.CreateText(path))
{
writer.WriteLine("[NosTale_Network]");
writer.WriteLine("IP=134.255.233.168");
writer.WriteLine("Port=4001");
flag = true;
writer.Close();
goto Label_0136;
}
}
using (StreamWriter writer2 = File.CreateText(path))
{
writer2.WriteLine("[NosTale_Network]");
writer2.WriteLine("IP=134.255.233.168");
writer2.WriteLine("Port=4001");
flag = true;
writer2.Close();
}
Label_0136:
if (flag)
{
string str3 = Application.StartupPath + "/NostaleX.dat";
string str4 = "\"";
str4 = str4 + str3 + "\"";
string arguments = "/c START ";
arguments = ((arguments + "\"") + "\"" + " ") + str4 + " EntwellNostaleClientLoadFromIni";
Process process1 = new Process {
StartInfo = new ProcessStartInfo("cmd.exe", arguments)
};
process1.StartInfo.CreateNoWindow = true;
process1.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process1.Start();
Application.Exit();
}
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.pictureBox1 = new PictureBox();
this.button1 = new Button();
((ISupportInitialize) this.pictureBox1).BeginInit();
base.SuspendLayout();
this.pictureBox1.Dock = DockStyle.Fill;
this.pictureBox1.Image = Resources.AvkUb;
this.pictureBox1.Location = new Point(0, 0);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new Size(320, 0x81);
this.pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
this.pictureBox1.TabIndex = 1;
this.pictureBox1.TabStop = false;
this.button1.FlatStyle = FlatStyle.Popup;
this.button1.Location = new Point(12, 12);
this.button1.Name = "button1";
this.button1.Size = new Size(0x4b, 0x17);
this.button1.TabIndex = 2;
this.button1.Text = "Start";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new EventHandler(this.button1_Click);
base.AutoScaleDimensions = new SizeF(6f, 13f);
base.AutoScaleMode = AutoScaleMode.Font;
base.ClientSize = new Size(320, 0x81);
base.Controls.Add(this.button1);
base.Controls.Add(this.pictureBox1);
base.FormBorderStyle = FormBorderStyle.FixedToolWindow;
base.Name = "Form1";
this.Text = "NosTale4DE";
((ISupportInitialize) this.pictureBox1).EndInit();
base.ResumeLayout(false);
}
}
}