Exemplo n.º 1
0
 public ServerSync(ServerProfile server, AccountProfile account, ShardProfile shard)
 {
     this.m_Server = server;
     this.m_Account = account;
     this.m_Shard = shard;
     this.m_Buffer = new byte[0x800];
     this.m_CryptoProvider = new LoginCrypto((uint) Network.ClientIP);
     Dns.BeginResolve(server.Address, new AsyncCallback(this.OnResolve), null);
 }
Exemplo n.º 2
0
 public ServerSync(ServerProfile server, AccountProfile account, ShardProfile shard)
 {
     this.m_Server         = server;
     this.m_Account        = account;
     this.m_Shard          = shard;
     this.m_Buffer         = new byte[0x800];
     this.m_CryptoProvider = new LoginCrypto((uint)Network.ClientIP);
     Dns.BeginResolve(server.Address, new AsyncCallback(this.OnResolve), null);
 }
Exemplo n.º 3
0
 public ShardSync(ServerProfile server, AccountProfile account, ShardProfile shard)
 {
     this.m_Server         = server;
     this.m_Account        = account;
     this.m_Shard          = shard;
     this.m_Compressed     = new byte[0x800];
     this.m_Buffer         = new byte[0x800];
     this.m_CryptoProvider = new GameCrypto((uint)shard.Auth);
     this.Connect(new IPEndPoint(shard.Address, shard.Port));
 }
Exemplo n.º 4
0
 public ShardSync(ServerProfile server, AccountProfile account, ShardProfile shard)
 {
     this.m_Server = server;
     this.m_Account = account;
     this.m_Shard = shard;
     this.m_Compressed = new byte[0x800];
     this.m_Buffer = new byte[0x800];
     this.m_CryptoProvider = new GameCrypto((uint) shard.Auth);
     this.Connect(new IPEndPoint(shard.Address, shard.Port));
 }
Exemplo n.º 5
0
 public void AddAccount(AccountProfile account)
 {
     AccountProfile[] accounts = this.m_Accounts;
     this.m_Accounts = new AccountProfile[accounts.Length + 1];
     for (int i = 0; i < accounts.Length; i++)
     {
         this.m_Accounts[i] = accounts[i];
     }
     this.m_Accounts[accounts.Length] = account;
 }
Exemplo n.º 6
0
 private void Okay_OnClick(Gump g)
 {
     string title = this.m_Title.String;
     string username = this.m_Username.String;
     string password = this.m_Password.String;
     AccountProfile account = new AccountProfile(this.m_Server, title, username, password);
     this.m_Server.AddAccount(account);
     new ServerSync(this.m_Server, account, null);
     Profiles.Save();
     Engine.UpdateSmartLoginMenu();
     this.Close();
 }
Exemplo n.º 7
0
 public ShardProfile(AccountProfile account, IPAddress address, int port, int index, int timeZone, int percentFull, int auth, string name)
 {
     this.m_Account     = account;
     this.m_Address     = address;
     this.m_Port        = port;
     this.m_Index       = index;
     this.m_TimeZone    = timeZone;
     this.m_PercentFull = percentFull;
     this.m_Auth        = auth;
     this.m_Name        = name;
     this.m_Characters  = new CharacterProfile[0];
 }
Exemplo n.º 8
0
 public ShardProfile(AccountProfile account, IPAddress address, int port, int index, int timeZone, int percentFull, int auth, string name)
 {
     this.m_Account = account;
     this.m_Address = address;
     this.m_Port = port;
     this.m_Index = index;
     this.m_TimeZone = timeZone;
     this.m_PercentFull = percentFull;
     this.m_Auth = auth;
     this.m_Name = name;
     this.m_Characters = new CharacterProfile[0];
 }
Exemplo n.º 9
0
        private void Okay_OnClick(Gump g)
        {
            string         title    = this.m_Title.String;
            string         username = this.m_Username.String;
            string         password = this.m_Password.String;
            AccountProfile account  = new AccountProfile(this.m_Server, title, username, password);

            this.m_Server.AddAccount(account);
            new ServerSync(this.m_Server, account, null);
            Profiles.Save();
            Engine.UpdateSmartLoginMenu();
            this.Close();
        }
Exemplo n.º 10
0
 public GEditAccount(AccountProfile account) : base(0, 0, 320, 110)
 {
     this.m_Account  = account;
     Gumps.Focus     = this;
     base.Text       = "Edit Account";
     this.m_Title    = this.AddTextBox("Title:", 0, account.Title, '\0');
     this.m_Username = this.AddTextBox("Username:"******"Password:"******"Remove", 0, new OnClick(this.Remove_OnClick));
     this.AddButton("Okay", 1, new OnClick(this.Okay_OnClick));
     this.AddButton("Cancel", 2, new OnClick(this.Cancel_OnClick));
     this.Center();
 }
Exemplo n.º 11
0
 public GEditAccount(AccountProfile account)
     : base(0, 0, 320, 110)
 {
     this.m_Account = account;
     Gumps.Focus = this;
     base.Text = "Edit Account";
     this.m_Title = this.AddTextBox("Title:", 0, account.Title, '\0');
     this.m_Username = this.AddTextBox("Username:"******"Password:"******"Remove", 0, new OnClick(this.Remove_OnClick));
     this.AddButton("Okay", 1, new OnClick(this.Okay_OnClick));
     this.AddButton("Cancel", 2, new OnClick(this.Cancel_OnClick));
     this.Center();
 }
Exemplo n.º 12
0
        private static ServerProfile[] Load()
        {
            if (!File.Exists(Engine.FileManager.BasePath("Data/Profiles.xml")))
            {
                return(new ServerProfile[0]);
            }
            XmlDocument document = new XmlDocument();

            document.Load(Engine.FileManager.BasePath("Data/Profiles.xml"));
            ArrayList list = new ArrayList();

            foreach (XmlElement element in document.GetElementsByTagName("server"))
            {
                string        attribute = element.GetAttribute("title");
                string        address   = element.GetAttribute("address");
                string        s         = element.GetAttribute("port");
                ServerProfile server    = new ServerProfile(attribute, address, XmlConvert.ToInt32(s));
                foreach (XmlElement element2 in element.GetElementsByTagName("account"))
                {
                    string         title    = element2.GetAttribute("title");
                    string         username = element2.GetAttribute("username");
                    string         password = element2.GetAttribute("password");
                    AccountProfile account  = new AccountProfile(server, title, username, password);
                    foreach (XmlElement element3 in element2.GetElementsByTagName("shard"))
                    {
                        string       name     = element3.GetAttribute("name");
                        string       ipString = element3.GetAttribute("address");
                        string       str10    = element3.GetAttribute("port");
                        string       str11    = element3.GetAttribute("index");
                        string       str12    = element3.GetAttribute("timeZone");
                        string       str13    = element3.GetAttribute("percentFull");
                        string       str14    = element3.GetAttribute("auth");
                        ShardProfile shard    = new ShardProfile(account, IPAddress.Parse(ipString), XmlConvert.ToInt32(str10), XmlConvert.ToInt32(str11), XmlConvert.ToInt32(str12), XmlConvert.ToInt32(str13), XmlConvert.ToInt32(str14), name);
                        foreach (XmlElement element4 in element3.GetElementsByTagName("character"))
                        {
                            string str15 = element4.GetAttribute("index");
                            string str16 = element4.GetAttribute("name");
                            shard.AddCharacter(new CharacterProfile(shard, str16, XmlConvert.ToInt32(str15)));
                        }
                        account.AddShard(shard);
                    }
                    server.AddAccount(account);
                }
                list.Add(server);
            }
            return((ServerProfile[])list.ToArray(typeof(ServerProfile)));
        }
Exemplo n.º 13
0
        public void RemoveAccount(AccountProfile account)
        {
            AccountProfile[] accounts = this.m_Accounts;
            int index = Array.IndexOf(accounts, account);

            if (index != -1)
            {
                this.m_Accounts = new AccountProfile[accounts.Length - 1];
                for (int i = 0; i < index; i++)
                {
                    this.m_Accounts[i] = accounts[i];
                }
                for (int j = index; j < this.m_Accounts.Length; j++)
                {
                    this.m_Accounts[j] = accounts[j + 1];
                }
            }
        }
Exemplo n.º 14
0
 public GAccountMenu(AccountProfile account) : base(account.Title)
 {
     this.m_Account = account;
 }
Exemplo n.º 15
0
 public GAccountMenu(AccountProfile account)
     : base(account.Title)
 {
     this.m_Account = account;
 }
Exemplo n.º 16
0
 public void RemoveAccount(AccountProfile account)
 {
     AccountProfile[] accounts = this.m_Accounts;
     int index = Array.IndexOf(accounts, account);
     if (index != -1)
     {
         this.m_Accounts = new AccountProfile[accounts.Length - 1];
         for (int i = 0; i < index; i++)
         {
             this.m_Accounts[i] = accounts[i];
         }
         for (int j = index; j < this.m_Accounts.Length; j++)
         {
             this.m_Accounts[j] = accounts[j + 1];
         }
     }
 }
Exemplo n.º 17
0
 private static ServerProfile[] Load()
 {
     if (!File.Exists(Engine.FileManager.BasePath("Data/Profiles.xml")))
     {
         return new ServerProfile[0];
     }
     XmlDocument document = new XmlDocument();
     document.Load(Engine.FileManager.BasePath("Data/Profiles.xml"));
     ArrayList list = new ArrayList();
     foreach (XmlElement element in document.GetElementsByTagName("server"))
     {
         string attribute = element.GetAttribute("title");
         string address = element.GetAttribute("address");
         string s = element.GetAttribute("port");
         ServerProfile server = new ServerProfile(attribute, address, XmlConvert.ToInt32(s));
         foreach (XmlElement element2 in element.GetElementsByTagName("account"))
         {
             string title = element2.GetAttribute("title");
             string username = element2.GetAttribute("username");
             string password = element2.GetAttribute("password");
             AccountProfile account = new AccountProfile(server, title, username, password);
             foreach (XmlElement element3 in element2.GetElementsByTagName("shard"))
             {
                 string name = element3.GetAttribute("name");
                 string ipString = element3.GetAttribute("address");
                 string str10 = element3.GetAttribute("port");
                 string str11 = element3.GetAttribute("index");
                 string str12 = element3.GetAttribute("timeZone");
                 string str13 = element3.GetAttribute("percentFull");
                 string str14 = element3.GetAttribute("auth");
                 ShardProfile shard = new ShardProfile(account, IPAddress.Parse(ipString), XmlConvert.ToInt32(str10), XmlConvert.ToInt32(str11), XmlConvert.ToInt32(str12), XmlConvert.ToInt32(str13), XmlConvert.ToInt32(str14), name);
                 foreach (XmlElement element4 in element3.GetElementsByTagName("character"))
                 {
                     string str15 = element4.GetAttribute("index");
                     string str16 = element4.GetAttribute("name");
                     shard.AddCharacter(new CharacterProfile(shard, str16, XmlConvert.ToInt32(str15)));
                 }
                 account.AddShard(shard);
             }
             server.AddAccount(account);
         }
         list.Add(server);
     }
     return (ServerProfile[]) list.ToArray(typeof(ServerProfile));
 }
Exemplo n.º 18
0
 public void AddAccount(AccountProfile account)
 {
     AccountProfile[] accounts = this.m_Accounts;
     this.m_Accounts = new AccountProfile[accounts.Length + 1];
     for (int i = 0; i < accounts.Length; i++)
     {
         this.m_Accounts[i] = accounts[i];
     }
     this.m_Accounts[accounts.Length] = account;
 }