namespace VaioxOnline
{
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.Drawing;
    using System.Net;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;
    using VaioxOnline.My;

    [DesignerGenerated]
    public class Login : Form
    {
        [CompilerGenerated, DebuggerBrowsable(DebuggerBrowsableState.Never), AccessedThroughProperty("downloader")]
        private WebClient _downloader;
        [CompilerGenerated, DebuggerBrowsable(DebuggerBrowsableState.Never), AccessedThroughProperty("FlatClose1")]
        private FlatClose _FlatClose1;
        [CompilerGenerated, DebuggerBrowsable(DebuggerBrowsableState.Never), AccessedThroughProperty("FlatMini1")]
        private FlatMini _FlatMini1;
        [CompilerGenerated, DebuggerBrowsable(DebuggerBrowsableState.Never), AccessedThroughProperty("Label1")]
        private Label _Label1;
        [CompilerGenerated, DebuggerBrowsable(DebuggerBrowsableState.Never), AccessedThroughProperty("LinkLabel1")]
        private LinkLabel _LinkLabel1;
        [CompilerGenerated, DebuggerBrowsable(DebuggerBrowsableState.Never), AccessedThroughProperty("passwordtxtbx")]
        private TextBox _passwordtxtbx;
        [CompilerGenerated, DebuggerBrowsable(DebuggerBrowsableState.Never), AccessedThroughProperty("PictureBox1")]
        private PictureBox _PictureBox1;
        [CompilerGenerated, DebuggerBrowsable(DebuggerBrowsableState.Never), AccessedThroughProperty("usernametxtbx")]
        private TextBox _usernametxtbx;
        private string CashShopAddress;
        private string[] ClientConfigFile;
        private string ClientExe;
        private IContainer components;
        private int cpx;
        private int cpy;
        private string ForumAddress;
        private string GameWebsite;
        private string Guide;
        private string LoginAddress;
        private VaioxOnline.MyFunction MyFunction;
        private string News;
        private string[] PatchList;
        private string ServerIP;
        private WebClient wc;

        public Login()
        {
            base.Load += new EventHandler(this.Login_Load);
            base.MouseDown += new MouseEventHandler(this.Login_MouseDown);
            base.MouseMove += new MouseEventHandler(this.Login_MouseMove);
            this.ServerIP = "91.121.222.174";
            this.ClientExe = "Vaiox.exe";
            this.LoginAddress = "http://91.121.222.174:81/";
            this.GameWebsite = "http://vaiox.net/";
            this.CashShopAddress = "http://vaiox.net/mall/";
            this.Guide = "http://vaiox.net/guide/";
            this.ForumAddress = "http://vaiox.net/forum/";
            this.News = "http://vaiox.net/";
            this.downloader = new WebClient();
            this.wc = new WebClient();
            this.MyFunction = new VaioxOnline.MyFunction();
            this.ClientConfigFile = null;
            this.PatchList = null;
            this.InitializeComponent();
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing && (this.components > null))
                {
                    this.components.Dispose();
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }

        private void FlatButton1_Click(object sender, EventArgs e)
        {
            MyProject.Forms.VotePlay.Show();
        }

        private void FlatClose1_Click(object sender, EventArgs e)
        {
            Environment.Exit(1);
        }

        private void FlatMini1_Click(object sender, EventArgs e)
        {
            base.WindowState = FormWindowState.Minimized;
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Login));
            this.usernametxtbx = new TextBox();
            this.passwordtxtbx = new TextBox();
            this.PictureBox1 = new PictureBox();
            this.Label1 = new Label();
            this.LinkLabel1 = new LinkLabel();
            this.FlatMini1 = new FlatMini();
            this.FlatClose1 = new FlatClose();
            ((ISupportInitialize) this.PictureBox1).BeginInit();
            base.SuspendLayout();
            this.usernametxtbx.BackColor = SystemColors.Window;
            this.usernametxtbx.BorderStyle = BorderStyle.None;
            this.usernametxtbx.ForeColor = SystemColors.WindowText;
            this.usernametxtbx.Location = new Point(0x12, 0xc5);
            this.usernametxtbx.Name = "usernametxtbx";
            this.usernametxtbx.Size = new Size(0xbb, 13);
            this.usernametxtbx.TabIndex = 1;
            this.usernametxtbx.Text = "Username";
            this.passwordtxtbx.BorderStyle = BorderStyle.None;
            this.passwordtxtbx.Location = new Point(0x12, 0xdf);
            this.passwordtxtbx.Name = "passwordtxtbx";
            this.passwordtxtbx.PasswordChar = '*';
            this.passwordtxtbx.Size = new Size(0xbb, 13);
            this.passwordtxtbx.TabIndex = 2;
            this.passwordtxtbx.Text = "********";
            this.PictureBox1.BackColor = Color.Transparent;
            this.PictureBox1.Cursor = Cursors.Hand;
            this.PictureBox1.Location = new Point(0xf4, 0xbd);
            this.PictureBox1.Name = "PictureBox1";
            this.PictureBox1.Size = new Size(0x2e, 0x3b);
            this.PictureBox1.TabIndex = 0;
            this.PictureBox1.TabStop = false;
            this.Label1.AutoSize = true;
            this.Label1.BackColor = Color.Transparent;
            this.Label1.ForeColor = SystemColors.ButtonFace;
            this.Label1.Location = new Point(15, 0xac);
            this.Label1.Name = "Label1";
            this.Label1.Size = new Size(0x7b, 13);
            this.Label1.TabIndex = 6;
            this.Label1.Text = "Don't have an Account?";
            this.LinkLabel1.AutoSize = true;
            this.LinkLabel1.BackColor = Color.Transparent;
            this.LinkLabel1.LinkColor = Color.Maroon;
            this.LinkLabel1.Location = new Point(0x87, 0xac);
            this.LinkLabel1.Name = "LinkLabel1";
            this.LinkLabel1.Size = new Size(0x36, 13);
            this.LinkLabel1.TabIndex = 7;
            this.LinkLabel1.TabStop = true;
            this.LinkLabel1.Text = "Click here";
            this.FlatMini1.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.FlatMini1.BackColor = Color.White;
            this.FlatMini1.BaseColor = Color.FromArgb(0x2d, 0x2f, 0x31);
            this.FlatMini1.Font = new Font("Marlett", 12f);
            this.FlatMini1.Location = new Point(0xfc, 11);
            this.FlatMini1.Name = "FlatMini1";
            this.FlatMini1.Size = new Size(0x12, 0x12);
            this.FlatMini1.TabIndex = 9;
            this.FlatMini1.Text = "FlatMini1";
            this.FlatMini1.TextColor = Color.FromArgb(0xf3, 0xf3, 0xf3);
            this.FlatClose1.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.FlatClose1.BackColor = Color.White;
            this.FlatClose1.BaseColor = Color.FromArgb(0xa8, 0x23, 0x23);
            this.FlatClose1.Font = new Font("Marlett", 10f);
            this.FlatClose1.Location = new Point(0x110, 11);
            this.FlatClose1.Name = "FlatClose1";
            this.FlatClose1.Size = new Size(0x12, 0x12);
            this.FlatClose1.TabIndex = 8;
            this.FlatClose1.Text = "FlatClose1";
            this.FlatClose1.TextColor = Color.FromArgb(0xf3, 0xf3, 0xf3);
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            this.BackgroundImage = (Image) manager.GetObject("$this.BackgroundImage");
            base.ClientSize = new Size(0x129, 0x103);
            base.Controls.Add(this.FlatMini1);
            base.Controls.Add(this.FlatClose1);
            base.Controls.Add(this.LinkLabel1);
            base.Controls.Add(this.Label1);
            base.Controls.Add(this.passwordtxtbx);
            base.Controls.Add(this.usernametxtbx);
            base.Controls.Add(this.PictureBox1);
            base.FormBorderStyle = FormBorderStyle.None;
            base.Icon = (Icon) manager.GetObject("$this.Icon");
            base.MaximizeBox = false;
            base.Name = "Login";
            base.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "Vaiox Online | Login";
            base.TransparencyKey = Color.Lime;
            ((ISupportInitialize) this.PictureBox1).EndInit();
            base.ResumeLayout(false);
            base.PerformLayout();
        }

        private void LinkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            MyProject.Forms.Register.Show();
        }

        private void Login_Load(object sender, EventArgs e)
        {
            this.usernametxtbx.Text = MySettingsProperty.Settings.Username;
            this.passwordtxtbx.Text = MySettingsProperty.Settings.Password;
        }

        private void Login_MouseDown(object sender, MouseEventArgs e)
        {
            this.cpx = e.X;
            this.cpy = e.Y;
        }

        private void Login_MouseMove(object sender, MouseEventArgs e)
        {
        }

        private void PictureBox1_Click(object sender, EventArgs e)
        {
            MySettingsProperty.Settings.Username = this.usernametxtbx.Text;
            MySettingsProperty.Settings.Password = this.passwordtxtbx.Text;
            MySettingsProperty.Settings.Save();
            MySettingsProperty.Settings.Reload();
            try
            {
                string str = this.MyFunction.MD5StringHash(this.passwordtxtbx.Text);
                string str2 = new WebClient().DownloadString(this.LoginAddress + "Login.php?Username=" + this.usernametxtbx.Text + "&Password=" + str.ToLower());
                if (str2.Contains("OK"))
                {
                    MySettingsProperty.Settings.Skip = "True";
                    MySettingsProperty.Settings.Save();
                    base.Hide();
                    MyProject.Forms.Form1.Show();
                }
                else if (str2.Contains("Maintenance"))
                {
                    MessageBox.Show("Server is under Maintenance please try again Later!", "Maintenance :: Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                }
                else
                {
                    MessageBox.Show("Please check your Password!", "AccountLogin :: Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show("Server is Offline!\rPlease try again later!", "ServerLogin :: Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                ProjectData.ClearProjectError();
            }
        }

        private void PictureBox2_Click(object sender, EventArgs e)
        {
            base.Close();
        }

        private void PictureBox2_Click_1(object sender, EventArgs e)
        {
            Process.Start(this.GameWebsite);
        }

        private void PictureBox3_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Register.Show();
        }

        private void PictureBox3_Click_1(object sender, EventArgs e)
        {
            base.WindowState = FormWindowState.Minimized;
        }

        private void PictureBox4_Click(object sender, EventArgs e)
        {
            Environment.Exit(0);
        }

        private void TextBox2_TextChanged(object sender, EventArgs e)
        {
        }

        private void usernametxtbx_TextChanged(object sender, EventArgs e)
        {
        }

        internal virtual WebClient downloader
        {
            [CompilerGenerated]
            get => 
                this._downloader
            [MethodImpl(MethodImplOptions.Synchronized), CompilerGenerated]
            set
            {
                this._downloader = value;
            }
        }

        internal virtual FlatClose FlatClose1
        {
            [CompilerGenerated]
            get => 
                this._FlatClose1
            [MethodImpl(MethodImplOptions.Synchronized), CompilerGenerated]
            set
            {
                EventHandler handler = new EventHandler(this.FlatClose1_Click);
                FlatClose close = this._FlatClose1;
                if (close != null)
                {
                    close.Click -= handler;
                }
                this._FlatClose1 = value;
                close = this._FlatClose1;
                if (close != null)
                {
                    close.Click += handler;
                }
            }
        }

        internal virtual FlatMini FlatMini1
        {
            [CompilerGenerated]
            get => 
                this._FlatMini1
            [MethodImpl(MethodImplOptions.Synchronized), CompilerGenerated]
            set
            {
                EventHandler handler = new EventHandler(this.FlatMini1_Click);
                FlatMini mini = this._FlatMini1;
                if (mini != null)
                {
                    mini.Click -= handler;
                }
                this._FlatMini1 = value;
                mini = this._FlatMini1;
                if (mini != null)
                {
                    mini.Click += handler;
                }
            }
        }

        internal virtual Label Label1
        {
            [CompilerGenerated]
            get => 
                this._Label1
            [MethodImpl(MethodImplOptions.Synchronized), CompilerGenerated]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual LinkLabel LinkLabel1
        {
            [CompilerGenerated]
            get => 
                this._LinkLabel1
            [MethodImpl(MethodImplOptions.Synchronized), CompilerGenerated]
            set
            {
                LinkLabelLinkClickedEventHandler handler = new LinkLabelLinkClickedEventHandler(this.LinkLabel1_LinkClicked);
                LinkLabel label = this._LinkLabel1;
                if (label != null)
                {
                    label.LinkClicked -= handler;
                }
                this._LinkLabel1 = value;
                label = this._LinkLabel1;
                if (label != null)
                {
                    label.LinkClicked += handler;
                }
            }
        }

        internal virtual TextBox passwordtxtbx
        {
            [CompilerGenerated]
            get => 
                this._passwordtxtbx
            [MethodImpl(MethodImplOptions.Synchronized), CompilerGenerated]
            set
            {
                EventHandler handler = new EventHandler(this.TextBox2_TextChanged);
                TextBox box = this._passwordtxtbx;
                if (box != null)
                {
                    box.TextChanged -= handler;
                }
                this._passwordtxtbx = value;
                box = this._passwordtxtbx;
                if (box != null)
                {
                    box.TextChanged += handler;
                }
            }
        }

        internal virtual PictureBox PictureBox1
        {
            [CompilerGenerated]
            get => 
                this._PictureBox1
            [MethodImpl(MethodImplOptions.Synchronized), CompilerGenerated]
            set
            {
                EventHandler handler = new EventHandler(this.PictureBox1_Click);
                PictureBox box = this._PictureBox1;
                if (box != null)
                {
                    box.Click -= handler;
                }
                this._PictureBox1 = value;
                box = this._PictureBox1;
                if (box != null)
                {
                    box.Click += handler;
                }
            }
        }

        internal virtual TextBox usernametxtbx
        {
            [CompilerGenerated]
            get => 
                this._usernametxtbx
            [MethodImpl(MethodImplOptions.Synchronized), CompilerGenerated]
            set
            {
                EventHandler handler = new EventHandler(this.usernametxtbx_TextChanged);
                TextBox box = this._usernametxtbx;
                if (box != null)
                {
                    box.TextChanged -= handler;
                }
                this._usernametxtbx = value;
                box = this._usernametxtbx;
                if (box != null)
                {
                    box.TextChanged += handler;
                }
            }
        }
    }
}

