/// <summary> /// This function reports a missing packet handler to the console. It writes the length and type of the /// packet, then a packet dump to the console. /// </summary> /// <param name="packet">The packet buffer being reported.</param> public static void Report(byte[] packet) { ushort length = BitConverter.ToUInt16(packet, 0); ushort identity = BitConverter.ToUInt16(packet, 2); // Print the packet and the packet header: Program.Log.WriteToFile($"Missing Packet Handler: {identity} (Length: {length})", "missing_packet"); Program.Log.WriteToFile(PacketDump.Hex(packet), "missing_packet"); }
static void Main(string[] args) { MsgRequestInfo msg = new MsgRequestInfo(); msg.Create(AutoUpdateRequestType.CheckForGameUpdates); Console.WriteLine(PacketDump.Hex(msg)); MsgRequestInfo decode = new MsgRequestInfo(msg); Console.WriteLine(PacketDump.Hex(msg)); StringPacker packer = new StringPacker("Testando", "Aurelio", "Felipe", "Teste", "StringPacker", "FTW! Masters"); Console.WriteLine(PacketDump.Hex(packer.ToArray())); packer = new StringPacker(packer.ToArray()); foreach (var str in packer.GetStrings()) { Console.WriteLine(str); } Console.WriteLine("Hello World!"); Console.ReadLine(); }