public static void HandleRealmlist(Realm[] rlist) { int x = 0; foreach (Realm rl in rlist) { Log.WriteLine(LogType.Normal, "[{0}] {1} - {2}", x + 1, rl.Name, rl.Address); x++; } }
public WorldServerClient(Realm rl, byte[] key) { mUsername = Config.Login.ToUpper(); objectMgr = new ObjectMgr(); movementMgr = new MovementMgr(this); combatMgr = new CombatMgr(this); terrainMgr = new TerrainMgr(); realm = rl; mKey = key; }
private void button1_Click(object sender, EventArgs e) { if (Status == ServiceType.None) { if (host.Text == "" || login.Text == "" || password.Text == "") { MessageBox.Show("Please insert your logon data", "Error!"); return; } cl = new LogonServerClient(host.Text, login.Text, password.Text); cl.Connect(); button1.Enabled = false; realmlist.Enabled = true; } else if (Status == ServiceType.Logon) { Realm rl = new Realm(); if (realmlist.SelectedItem != null) { rl = cl.Realmlist.First(s => s.Name == realmlist.SelectedItem.ToString()); } else { HandleDisconnect(); return; } wl = new WorldServerClient(login.Text, rl, cl.mKey); //cl.HardDisconnect(); wl.Connect(); button1.Enabled = false; charlist.Enabled = true; realmlist.Enabled = false; this.UseWaitCursor = true; } else if (Status == ServiceType.World) { Character rl = wl.Charlist.First(s => s.Name == charlist.SelectedItem.ToString()); if (rl.Name == null) return; wl.LoginPlayer(rl); this.Text = String.Format("[{0}][{1}] {2} - {3} on {4}:3724", rl.Race, rl.Class, rl.Name, wl.realm.Name, wl.realm.Address); button1.Enabled = false; charlist.Enabled = false; ChatTab cTab = new ChatTab("", ChatMsg.Say); AddTab(cTab); } }
public void HandleRealmlist(PacketIn packetIn) { //packetIn.ReadByte(); UInt16 Length = packetIn.ReadUInt16(); UInt32 Request = packetIn.ReadUInt32(); int realmscount = packetIn.ReadInt16(); //Console.Write(packetIn.ToHex()); Log.WriteLine(LogType.Success, "Got information about {0} realms.", realmscount); Realm[] realms = new Realm[realmscount]; try { for (int i = 0; i < realmscount; i++) { realms[i].Type = packetIn.ReadByte(); realms[i].Color = packetIn.ReadByte(); packetIn.ReadByte(); // unk realms[i].Name = packetIn.ReadString(); realms[i].Address = packetIn.ReadString(); realms[i].Population = packetIn.ReadFloat(); realms[i].NumChars = packetIn.ReadByte(); realms[i].Language = packetIn.ReadByte(); packetIn.ReadByte(); } Realmlist = realms; mCore.Event(new Event(EventType.EVENT_REALMLIST, "", new object[] { Realmlist })); } catch (Exception ex) { Log.WriteLine(LogType.Error, "Exception Occured"); Log.WriteLine(LogType.Error, "Message: {0}", ex.Message); Log.WriteLine(LogType.Error, "Stacktrace: {0}", ex.StackTrace); Disconnect(); } }
private void HandleRealmlist(Realm[] list) { foreach (Realm rl in list) { if (realmlist.Items.Contains(rl.Name)) return; this.realmlist.Items.Add(rl.Name); } button1.Text = "Connect to Realm Server"; button1.Enabled = true; Status = ServiceType.Logon; }