public static void UpdateNetworkInfo(Blaze.Packet p, PlayerInfo pi, NetworkStream ns) { List <Blaze.Tdf> input = Blaze.ReadPacketContent(p); Blaze.TdfUnion addr = (Blaze.TdfUnion)input[0]; Blaze.TdfStruct valu = (Blaze.TdfStruct)addr.UnionContent; Blaze.TdfStruct inip = (Blaze.TdfStruct)valu.Values[1]; pi.inIp = (uint)((Blaze.TdfInteger)inip.Values[0]).Value; pi.exPort = pi.inPort = (uint)((Blaze.TdfInteger)inip.Values[1]).Value; byte[] buff = Blaze.CreatePacket(p.Component, p.Command, 0, 0x1000, p.ID, new List <Blaze.Tdf>()); ns.Write(buff, 0, buff.Length); ns.Flush(); LookupUserInformation(p, pi, ns); }
public static byte[] CreateRedirectorPacket() { List <Blaze.Tdf> Result = new List <Blaze.Tdf>(); List <Blaze.Tdf> VALU = new List <Blaze.Tdf>(); VALU.Add(Blaze.TdfString.Create("HOST", "localhost")); VALU.Add(Blaze.TdfInteger.Create("IP\0\0", Blaze.GetIPfromString("127.0.0.1"))); VALU.Add(Blaze.TdfInteger.Create("PORT", targetPort)); Blaze.TdfUnion ADDR = Blaze.TdfUnion.Create("ADDR", 0, Blaze.TdfStruct.Create("VALU", VALU)); Result.Add(ADDR); Result.Add(Blaze.TdfInteger.Create("SECU", 0)); Result.Add(Blaze.TdfInteger.Create("XDNS", 0)); return(Blaze.CreatePacket(5, 1, 0, 0x1000, 0, Result)); }
public static void UpdateNetworkInfo(Blaze.Packet p, PlayerInfo pi, NetworkStream ns) { List <Blaze.Tdf> input = Blaze.ReadPacketContent(p); Blaze.TdfUnion addr = (Blaze.TdfUnion)input[0]; Blaze.TdfStruct valu = (Blaze.TdfStruct)addr.UnionContent; Blaze.TdfStruct exip = (Blaze.TdfStruct)valu.Values[0]; Blaze.TdfStruct inip = (Blaze.TdfStruct)valu.Values[1]; pi.inIp = ((Blaze.TdfInteger)inip.Values[0]).Value; pi.exIp = ((Blaze.TdfInteger)exip.Values[0]).Value; pi.exPort = pi.inPort = (uint)((Blaze.TdfInteger)inip.Values[1]).Value; Blaze.TdfStruct nqos = (Blaze.TdfStruct)input[2]; pi.nat = ((Blaze.TdfInteger)nqos.Values[1]).Value; byte[] buff = Blaze.CreatePacket(p.Component, p.Command, 0, 0x1000, p.ID, new List <Blaze.Tdf>()); ns.Write(buff, 0, buff.Length); ns.Flush(); AsyncUserSessions.UserSessionExtendedDataUpdateNotification(pi, p, pi, ns); }
private TreeNode TdfToTree(Blaze.Tdf tdf) { TreeNode t, t2, t3; switch (tdf.Type) { case 3: t = tdf.ToTree(); Blaze.TdfStruct str = (Blaze.TdfStruct)tdf; if (str.startswith2) { t.Text += " (Starts with 2)"; } foreach (Blaze.Tdf td in str.Values) { t.Nodes.Add(TdfToTree(td)); } t.Name = (inlistcount++).ToString(); inlist.Add(tdf); return(t); case 4: t = tdf.ToTree(); Blaze.TdfList l = (Blaze.TdfList)tdf; if (l.SubType == 3) { List <Blaze.TdfStruct> l2 = (List <Blaze.TdfStruct>)l.List; for (int i = 0; i < l2.Count; i++) { t2 = new TreeNode("Entry #" + i); if (l2[i].startswith2) { t2.Text += " (Starts with 2)"; } List <Blaze.Tdf> l3 = l2[i].Values; for (int j = 0; j < l3.Count; j++) { t2.Nodes.Add(TdfToTree(l3[j])); } t.Nodes.Add(t2); } } t.Name = (inlistcount++).ToString(); inlist.Add(tdf); return(t); case 5: t = tdf.ToTree(); Blaze.TdfDoubleList ll = (Blaze.TdfDoubleList)tdf; t2 = new TreeNode("List 1"); if (ll.SubType1 == 3) { List <Blaze.TdfStruct> l2 = (List <Blaze.TdfStruct>)ll.List1; for (int i = 0; i < l2.Count; i++) { t3 = new TreeNode("Entry #" + i); if (l2[i].startswith2) { t2.Text += " (Starts with 2)"; } List <Blaze.Tdf> l3 = l2[i].Values; for (int j = 0; j < l3.Count; j++) { t3.Nodes.Add(TdfToTree(l3[j])); } t2.Nodes.Add(t3); } t.Nodes.Add(t2); } t2 = new TreeNode("List 2"); if (ll.SubType2 == 3) { List <Blaze.TdfStruct> l2 = (List <Blaze.TdfStruct>)ll.List2; for (int i = 0; i < l2.Count; i++) { t3 = new TreeNode("Entry #" + i); if (l2[i].startswith2) { t2.Text += " (Starts with 2)"; } List <Blaze.Tdf> l3 = l2[i].Values; for (int j = 0; j < l3.Count; j++) { t3.Nodes.Add(TdfToTree(l3[j])); } t2.Nodes.Add(t3); } t.Nodes.Add(t2); } t.Name = (inlistcount++).ToString(); inlist.Add(tdf); return(t); case 6: t = tdf.ToTree(); Blaze.TdfUnion tu = (Blaze.TdfUnion)tdf; if (tu.UnionType != 0x7F) { t.Nodes.Add(TdfToTree(tu.UnionContent)); } t.Name = (inlistcount++).ToString(); inlist.Add(tdf); return(t); default: t = tdf.ToTree(); t.Name = (inlistcount++).ToString(); inlist.Add(tdf); return(t); } }