Exemplo n.º 1
0
 public void WriteToPacket(PacketStream packet)
 {
     packet.WriteInt16(m_H.h);
     packet.WriteInt16(m_H.l);
     packet.WriteInt16(m_L.h);
     packet.WriteInt16(m_L.l);
 }
Exemplo n.º 2
0
 public static void PacketSend(char src, string name, PacketStream data, string str = "")
 {
     if (IsPaused) return;
     Form1.Instance.Invoke(new MethodInvoker(delegate
     {
         int i = Form1.Instance.packets.Rows.Add();
         Form1.Instance.packets.Rows[i].DefaultCellStyle.BackColor = Color.LightBlue;
         Form1.Instance.packets.Rows[i].Cells[0].Value = String.Format("({0}) send", src);
         Form1.Instance.packets.Rows[i].Cells[1].Value = "0x" + data.GetId().ToString("X4");
         Form1.Instance.packets.Rows[i].Cells[2].Value = name;
         Form1.Instance.packets.Rows[i].Cells[3].Value = data.ToArray().Length;
         Form1.Instance.packets.Rows[i].Cells[4].Value = data;
         Form1.Instance.packets.Rows[i].Cells[5].Value = str;
     }));
 }
Exemplo n.º 3
0
        // Redirector --> Server
        public void SendServer(PacketStream data)
        {
            byte[] byteData = data.GetPacket().ToArray();
            //ConsoleUtils.HexDump(byteData, "Sending Packet");

            // Begin sending the data to the remote device.
            Server.ClSocket.BeginSend(
                Server.Encoder.DoCipher(ref byteData),
                0,
                byteData.Length,
                0,
                new AsyncCallback(SendServerCallback),
                Server
            );
        }
Exemplo n.º 4
0
        internal static void parse_WearChange(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	UInt32 item_handle = " + stream.ReadUInt32());
            str.AppendLine("	Int16 wear_type = " + stream.ReadInt16());
            str.AppendLine("	UInt32 player_handle = " + stream.ReadUInt32());
            str.AppendLine("	Byte item_enhance = " + stream.ReadByte());
            str.AppendLine("	2B Unknown = " + stream.ReadInt16());
            str.AppendLine("	2B Unknown = " + stream.ReadInt16());
            str.AppendLine("	2B Unknown = " + stream.ReadInt16());
            str.AppendLine("	2B Unknown = " + stream.ReadInt16());
            str.AppendLine("}");

            Form1.PacketSend('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Exemplo n.º 5
0
        internal static void parse_UseSkill(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	UInt16 skill_id = " + stream.ReadUInt16());
            str.AppendLine("	UInt32 handle = " + stream.ReadUInt32());
            str.AppendLine("	UInt32 handle = " + stream.ReadUInt32());
            str.AppendLine("	4B unknown = " + stream.ReadInt32());
            str.AppendLine("	4B unknown = " + stream.ReadInt32());
            str.AppendLine("	4B unknown = " + stream.ReadInt32());
            str.AppendLine("	1B unknown = " + stream.ReadByte());
            str.AppendLine("	Byte level = " + stream.ReadByte());
            str.AppendLine("}");

            Form1.PacketSend('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Exemplo n.º 6
0
        internal static void parse_ClientVersion(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	String(20) Version = " + stream.ReadString(0, 20));
            str.AppendLine("}");

            Form1.PacketSend('G', GetPacketName(stream.GetId()), stream);
        }
Exemplo n.º 7
0
        internal static void parse_DialOpt(ref PacketStream stream)
        {
            short size = stream.ReadInt16();
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	Int16 size = " + size);
            str.AppendLine("	String(size) Function = " + stream.ReadString(0, size));
            str.AppendLine("}");

            Form1.PacketSend('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Exemplo n.º 8
0
        internal static void send_Dialog(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	Int32 dialog_type = " + stream.ReadInt32());
            str.AppendLine("	UInt32 npc_handle = " + stream.ReadUInt32());
            short titleLen = stream.ReadInt16();
            short textLen = stream.ReadInt16();
            short menuLen = stream.ReadInt16();
            str.AppendLine("	Int16 TitleLen = " + titleLen);
            str.AppendLine("	Int16 TextLen = " + textLen);
            str.AppendLine("	Int16 MenuLen = " + menuLen);
            str.AppendLine("	String(TitleLen) Title = " + stream.ReadString(0, titleLen));
            str.AppendLine("	String(TextLen) Text = " + stream.ReadString(0, textLen));
            str.AppendLine("	struct menu_option[MenuLen]");
            str.AppendLine("	{");
            str.AppendLine("		{");
            // TODO
            str.AppendLine("		}");
            str.AppendLine("	}");
            str.AppendLine("}");

            Form1.PacketRecv('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Exemplo n.º 9
0
        internal static void send_CharView(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	Int32 player_handle = " + stream.ReadInt32());
            str.AppendLine("	Int32 weapon_id = " + stream.ReadInt32());
            str.AppendLine("	Int32 shield_id = " + stream.ReadInt32());
            str.AppendLine("	Int32 armor_id = " + stream.ReadInt32());
            str.AppendLine("	Int32 cap_id = " + stream.ReadInt32());
            str.AppendLine("	Int32 hand_id = " + stream.ReadInt32());
            str.AppendLine("	Int32 feet_id = " + stream.ReadInt32());
            str.AppendLine("	Int32 belt_id = " + stream.ReadInt32());
            str.AppendLine("	Int32 cape_id = " + stream.ReadInt32());
            str.AppendLine("	Int32 necklace_id = " + stream.ReadInt32());
            str.AppendLine("	Int32 ring1 = " + stream.ReadInt32());
            str.AppendLine("	Int32 ring2 = " + stream.ReadInt32());
            str.AppendLine("	Int32 earring = " + stream.ReadInt32());
            str.AppendLine("	Int32 mask_id = " + stream.ReadInt32());
            str.AppendLine("	Int32 unknown = " + stream.ReadInt32());
            str.AppendLine("	Int32 unknown = " + stream.ReadInt32());
            str.AppendLine("	Int32 deco_shield_id = " + stream.ReadInt32());
            str.AppendLine("	Int32 deco_costume_id = " + stream.ReadInt32());
            str.AppendLine("	Int32 deco_head_id = " + stream.ReadInt32());
            str.AppendLine("	Int32 deco_gloves_id = " + stream.ReadInt32());
            str.AppendLine("	Int32 deco_shoes_id = " + stream.ReadInt32());
            str.AppendLine("	Int32 deco_cloak_id = " + stream.ReadInt32());
            str.AppendLine("	Int32 deco_bag_id = " + stream.ReadInt32());
            str.AppendLine("	Int32 mount_id = " + stream.ReadInt32());
            str.AppendLine("	Int32 bag_id = " + stream.ReadInt32());
            for (int i = 0; i < 312; i += 4)
            {
                str.Append("	4B Unknown = " + stream.ReadInt32());
            }
            str.AppendLine("}");

            Form1.PacketRecv('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Exemplo n.º 10
0
        internal static void send_BeltSlotInfo(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	UInt32 slot0_handle = " + stream.ReadUInt32());
            str.AppendLine("	UInt32 slot1_handle = " + stream.ReadUInt32());
            str.AppendLine("	UInt32 slot2_handle = " + stream.ReadUInt32());
            str.AppendLine("	UInt32 slot3_handle = " + stream.ReadUInt32());
            str.AppendLine("	UInt32 slot4_handle = " + stream.ReadUInt32());
            str.AppendLine("	UInt32 slot5_handle = " + stream.ReadUInt32());
            str.AppendLine("}");

            Form1.PacketRecv('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Exemplo n.º 11
0
        internal static void parse_Scripts(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	String(21) msg_type = " + stream.ReadString(0, 21));
            short size = stream.ReadInt16();
            str.AppendLine("	Int16 size = " + size);
            str.AppendLine("	String(size) = " + stream.ReadString(0, size));
            str.AppendLine("}");

            Form1.PacketRecv('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Exemplo n.º 12
0
        internal static void parse_ReqCharList(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	String(60) userId = " + stream.ReadString(0, 60));
            str.AppendLine("	Byte Unknown = " + stream.ReadByte());
            str.AppendLine("}");

            Form1.PacketSend('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Exemplo n.º 13
0
        internal static void parse_PCMoveUpdt(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	Int32 update_time = " + stream.ReadInt32());
            str.AppendLine("	Single current_x = " + stream.ReadFloat());
            str.AppendLine("	Single current_y = " + stream.ReadFloat());
            str.AppendLine("	Single current_z = " + stream.ReadFloat());
            str.AppendLine("	Byte stop = " + stream.ReadByte());
            str.AppendLine("}");

            Form1.PacketSend('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Exemplo n.º 14
0
        internal static void parse_PCMoveReq(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	UInt32 player_handle = " + stream.ReadUInt32());
            str.AppendLine("	Single from_x = " + stream.ReadFloat());
            str.AppendLine("	Single from_y = " + stream.ReadFloat());
            str.AppendLine("	UInt32 move_time = " + stream.ReadUInt32());
            str.AppendLine("	Byte speed_sync = " + stream.ReadByte());
            short c = stream.ReadInt16();
            str.AppendLine("	Int16 move_count = " + c);
            str.AppendLine("	struct move_positions[move_count]");
            str.AppendLine("	{");
            for (int i = 0; i < c; i++)
            {
                str.AppendLine("		{");
                str.AppendLine("			Single to_x = " + stream.ReadFloat());
                str.AppendLine("			Single to_y = " + stream.ReadFloat());
                str.AppendLine("		}");
            }
            str.AppendLine("	}");
            str.AppendLine("}");

            Form1.PacketSend('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Exemplo n.º 15
0
        internal static void parse_LogoutToCharCheck(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("}");

            Form1.PacketSend('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Exemplo n.º 16
0
        internal static void parse_LoginToken(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	String(60) = " + stream.ReadString(0, 60));
            str.AppendLine("	Byte Unknown = " + stream.ReadByte());
            str.Append("	Byte[8] Token = ");
            for (int i = 0; i < 8; i++)
                str.Append(stream.ReadByte() + " ");
            str.Append("\r\n");
            str.AppendLine("}");

            Form1.PacketSend('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Exemplo n.º 17
0
        internal static void parse_JoinGame(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	String(19) CharName = " + stream.ReadString(0, 19));
            str.AppendLine("}");

            Form1.PacketSend('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Exemplo n.º 18
0
        internal static void send_A(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	UInt32 unknown = " + stream.ReadUInt32());

            str.AppendLine("}");

            Form1.PacketRecv('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Exemplo n.º 19
0
        internal static void send_Attack(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	uint src_handle = " + stream.ReadUInt32());
            str.AppendLine("	uint dst_handle = " + stream.ReadUInt32());
            str.AppendLine("	ushort attack_speed = " + stream.ReadInt16());
            str.AppendLine("	ushort attack_delay = " + stream.ReadInt16());
            str.AppendLine("	byte attack_action = " + stream.ReadByte());
            str.AppendLine("	byte attack_flag = " + stream.ReadByte());
            int count = stream.ReadByte();
            str.AppendLine("	byte count = " + count);
            for (int i = 0; i < count; i++)
            {
                str.AppendLine("	uint hp_damage = " + stream.ReadUInt32());
                str.AppendLine("	uint mp_damage = " + stream.ReadUInt32());
                str.AppendLine("	byte flag = " + stream.ReadByte());
                str.AppendLine("	uint unknown = " + stream.ReadUInt32());
                str.AppendLine("	uint unknown = " + stream.ReadUInt32());
                str.AppendLine("	uint unknown = " + stream.ReadUInt32());
                str.AppendLine("	uint unknown = " + stream.ReadUInt32());
                str.AppendLine("	uint unknown = " + stream.ReadUInt32());
                str.AppendLine("	uint unknown = " + stream.ReadUInt32());
                str.AppendLine("	uint unknown = " + stream.ReadUInt32());
                str.AppendLine("	uint new_dst_hp = " + stream.ReadUInt32());
                str.AppendLine("	uint new_dst_mp = " + stream.ReadUInt32());
                str.AppendLine("	uint unknown = " + stream.ReadUInt32());
                str.AppendLine("	uint unknown = " + stream.ReadUInt32());
                str.AppendLine("	uint new_src_hp = " + stream.ReadUInt32());
                str.AppendLine("	uint new_src_mp = " + stream.ReadUInt32());
            }
            str.AppendLine("}");

            Form1.PacketRecv('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Exemplo n.º 20
0
        internal static void parse_SetProperty(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	String(16) PropertyName = " + stream.ReadString(0, 16));
            str.AppendLine("	String(?S)  = " + stream.ReadString(0, stream.GetSize() - 23));
            str.AppendLine("}");

            Form1.PacketSend('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Exemplo n.º 21
0
        internal static void send_CharList(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	Int16 unknown = " + stream.ReadInt16());
            str.AppendLine("	Int32 unknown = " + stream.ReadInt32());
            short count = stream.ReadInt16();
            str.AppendLine("	Int16 char_count = " + count);	/* 6 */
            str.AppendLine("	struct character[char_count]");
            str.AppendLine("	{");
            for (int i = 0; i < count; i++)
            {
                str.AppendLine("		{");
                str.AppendLine("			Int32 sex = " + stream.ReadInt32());				/* 8 */
                str.AppendLine("			Int32 race = " + stream.ReadInt32());				/* 12 */
                str.AppendLine("			Int32 model00 = " + stream.ReadInt32());			/* 16 */
                str.AppendLine("			Int32 model01 = " + stream.ReadInt32());			/* 20 */
                str.AppendLine("			Int32 model02 = " + stream.ReadInt32());			/* 24 */
                str.AppendLine("			Int32 model03 = " + stream.ReadInt32());			/* 28 */
                str.AppendLine("			Int32 model04 = " + stream.ReadInt32());			/* 32 */
                str.AppendLine("			Int32 hair_color = " + stream.ReadInt32());		/* 36 */
                str.AppendLine("			Int32 unknown = " + stream.ReadInt32());		/* 40 */
                str.AppendLine("			Int32 unknown = " + stream.ReadInt32());		/* 44 */
                str.AppendLine("			Int32 unknown = " + stream.ReadInt32());		/* 48 */
                str.AppendLine("			Int32 right_hand = " + stream.ReadInt32());		/* 52 */
                str.AppendLine("			Int32 left_hand = " + stream.ReadInt32());		/* 54 */
                str.AppendLine("			Int32 armor_id = " + stream.ReadInt32());			/* 58 */
                str.AppendLine("			Int32 cap_id = " + stream.ReadInt32());			/* 62 */
                str.AppendLine("			Int32 hand_id = " + stream.ReadInt32()); 			/* 66 */
                str.AppendLine("			Int32 feet_id = " + stream.ReadInt32());			/* 70 */
                str.AppendLine("			Int32 belt_id = " + stream.ReadInt32());			/* 74 */
                str.AppendLine("			Int32 cape_id = " + stream.ReadInt32());			/* 78 */
                str.AppendLine("			Int32 necklace_id = " + stream.ReadInt32());		/* 82 */
                str.AppendLine("			Int32 ring1 = " + stream.ReadInt32());			/* 86 */
                str.AppendLine("			Int32 ring2 = " + stream.ReadInt32());			/* 90 */
                str.AppendLine("			Int32 earring = " + stream.ReadInt32());			/* 94 */
                str.AppendLine("			Int32 mask_id = " + stream.ReadInt32());			/* 98 */
                str.AppendLine("			Int32 unknown = " + stream.ReadInt32());			/* 102 */
                str.AppendLine("			Int32 unknown = " + stream.ReadInt32());			/* 106 */
                str.AppendLine("			Int32 deco_shield_id = " + stream.ReadInt32());	/* 110 */
                str.AppendLine("			Int32 deco_costume_id = " + stream.ReadInt32());	/* 114 */
                str.AppendLine("			Int32 deco_head_id = " + stream.ReadInt32());		/* 118 */
                str.AppendLine("			Int32 deco_gloves_id = " + stream.ReadInt32());	/* 122 */
                str.AppendLine("			Int32 deco_shoes_id = " + stream.ReadInt32());	/* 126 */
                str.AppendLine("			Int32 deco_cloak_id = " + stream.ReadInt32());	/* 130 */
                str.AppendLine("			Int32 deco_bag_id = " + stream.ReadInt32());		/* 134 */
                str.AppendLine("			Int32 mount_id = " + stream.ReadInt32());			/* 138 */
                str.AppendLine("			Int32 bag_id = " + stream.ReadInt32());			/* 142 */
                str.AppendLine("			Int32 level = " + stream.ReadInt32());			/* 146 */
                str.AppendLine("			Int32 job = " + stream.ReadInt32());				/* 150 */
                str.AppendLine("			Int32 job_level = " + stream.ReadInt32());		/* 154 */
                str.AppendLine("			Int32 unknown = " + stream.ReadInt32());
                str.AppendLine("			Int32 unknown = " + stream.ReadInt32());
                str.AppendLine("			Int32 unknown = " + stream.ReadInt32());
                str.AppendLine("			Int32 unknown = " + stream.ReadInt32());
                str.AppendLine("			Byte unknown = " + stream.ReadByte());
                str.AppendLine("			String(19) char_name = " + stream.ReadString(0, 19));	/* 175 */
                str.AppendLine("			Int32 skin_color = " + stream.ReadInt32());		/* 194 */
                str.AppendLine("			String(30) create_date = " + stream.ReadString(0, 30));	/* 198 */
                str.AppendLine("			String(30) delete_date = " + stream.ReadString(0, 30));
                for (int j = 0; j < 312; j += 4)
                    str.AppendLine("			Int32 unknown = " + stream.ReadInt32());
                str.AppendLine("		}");
            }
            str.AppendLine("	}");
            str.AppendLine("}");

            Form1.PacketRecv('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Exemplo n.º 22
0
        internal static void parse_SystemSpecs(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	String(86) Specs = " + stream.ReadString(0, 86));
            str.AppendLine("}");

            Form1.PacketSend('G', GetPacketName(stream.GetId()), stream);
        }
Exemplo n.º 23
0
        internal static void send_Chat(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	uint src_handle = " + stream.ReadUInt32());
            short size = stream.ReadInt16();
            str.AppendLine("	short size = " + size);
            str.AppendLine("	String(size) message = " + stream.ReadString(0, size));
            str.AppendLine("}");

            Form1.PacketRecv('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Exemplo n.º 24
0
 // Client --> Redirector
 private void PacketReceived(PacketStream data)
 {
     //bgWorker.ReportProgress(0, "Packet received from client");
     data = PacketFunc('C', data);
     SendServer(data);
 }
Exemplo n.º 25
0
        internal static void send_EntityAck(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            byte mainType = stream.ReadByte();
            str.Append("	Byte main_type = (" + mainType + ") ");
            switch (mainType)
            {
                case 0: str.Append("Player\r\n"); break;
                case 1: str.Append("NPC\r\n"); break;
                case 2: str.Append("Static Object\r\n"); break;
            }
            str.AppendLine("	UInt32 handle = " + stream.ReadUInt32());
            str.AppendLine("	Single x = " + stream.ReadFloat());
            str.AppendLine("	Single y = " + stream.ReadFloat());
            str.AppendLine("	Single z = " + stream.ReadFloat());
            str.AppendLine("	Byte layer = " + stream.ReadByte());
            byte subType = stream.ReadByte();
            str.Append("	Byte sub_type = (" + subType +") ");
            switch (subType)
            {
                case 0: str.Append("Player\r\n"); break;
                case 1: str.Append("NPC\r\n"); break;
                case 2: str.Append("Item\r\n"); break;
                case 3: str.Append("Mob\r\n"); break;
                case 4: str.Append("Summon\r\n"); break;
                case 5: str.Append("SkillProp\r\n"); break;
                case 6: str.Append("FieldProp\r\n"); break;
                case 7: str.Append("Pet\r\n"); break;
            }
            str.AppendLine("	");
            if (mainType == 0)
            { // Player
                str.AppendLine("	[Extra Info]");
            }
            else if (mainType == 1)
            { // NPC
                str.AppendLine("	uint status = " + stream.ReadUInt32());
                str.AppendLine("	float face_dir = " + stream.ReadFloat());
                str.AppendLine("	int hp = " + stream.ReadInt32());
                str.AppendLine("	int max_hp = " + stream.ReadInt32());
                str.AppendLine("	int mp = " + stream.ReadInt32());
                str.AppendLine("	int max_mp = " + stream.ReadInt32());
                str.AppendLine("	int level = " + stream.ReadInt32());

                str.AppendLine("	byte race = " + stream.ReadByte());
                str.AppendLine("	uint skin_color = " + stream.ReadUInt32());
                str.AppendLine("	bool is_first_enter = " + stream.ReadBool());
                str.AppendLine("	int energy = " + stream.ReadInt32());

                if (subType == 0)
                { // Player

                }
                else if (subType == 1)
                {// NPC
                    long encId = stream.ReadInt64();
                    str.AppendLine("	Int64 encrypted_id = (" + encId  + ") " + EncryptedInt.Revert(encId));
                }
                else if (subType == 3)
                {// Mob
                    long encId = stream.ReadInt64();
                    str.AppendLine("	Int64 encrypted_id = (" + encId + ") " + EncryptedInt.Revert(encId));
                }
                else if (subType == 4)
                {// Summon
                    str.AppendLine("	uint master_handle = " + stream.ReadUInt32());
                    long encId = stream.ReadInt64();
                    str.AppendLine("	Int64 encrypted_id = (" + encId + ") " + EncryptedInt.Revert(encId));
                    str.AppendLine("	char[19] name = " + stream.ReadString(0, 19));
                }
                else if (subType == 7)
                {// Pet
                    str.AppendLine("	uint master_handle = " + stream.ReadUInt32());
                    long encId = stream.ReadInt64();
                    str.AppendLine("	Int64 encrypted_id = (" + encId + ") " + EncryptedInt.Revert(encId));
                    str.AppendLine("	char[19] name = " + stream.ReadString(0, 19));
                }
                else
                {
                    str.AppendLine("	[Extra Info]");
                }
            }
            else if (mainType == 2)
            { // Static

                if (subType == 2)
                { // Item
                    long encId = stream.ReadInt64();
                    str.AppendLine("	Int64 encrypted_id = (" + encId + ") " + EncryptedInt.Revert(encId));
                    str.AppendLine("	Int64 count = " + stream.ReadInt64());
                    str.AppendLine("	uint drop_time = " + stream.ReadUInt32());
                    str.AppendLine("	uint player1 = " + stream.ReadUInt32());
                    str.AppendLine("	uint player2 = " + stream.ReadUInt32());
                    str.AppendLine("	uint player3 = " + stream.ReadUInt32());
                    str.AppendLine("	int party1 = " + stream.ReadInt32());
                    str.AppendLine("	int party2 = " + stream.ReadInt32());
                    str.AppendLine("	int party3 = " + stream.ReadInt32());
                }
                else if (subType == 5)
                { //SkillProp
                    str.AppendLine("	uint caster = " + stream.ReadUInt32());
                    str.AppendLine("	uint start_time = " + stream.ReadUInt32());
                    str.AppendLine("	int skill_id = " + stream.ReadInt32());
                }
                else if (subType == 6)
                { // FieldProp
                    str.AppendLine("	int prop_id = " + stream.ReadInt32());
                    str.AppendLine("	float fZOffset = " + stream.ReadFloat());
                    str.AppendLine("	float fRotateX = " + stream.ReadFloat());
                    str.AppendLine("	float fRotateY = " + stream.ReadFloat());
                    str.AppendLine("	float fRotateZ = " + stream.ReadFloat());
                    str.AppendLine("	float fScaleX = " + stream.ReadFloat());
                    str.AppendLine("	float fScaleY = " + stream.ReadFloat());
                    str.AppendLine("	float fScaleZ = " + stream.ReadFloat());
                    str.AppendLine("	bool bLockHeight = " + stream.ReadBool());
                    str.AppendLine("	float fLockHeight = " + stream.ReadFloat());
                }
                else
                {
                    str.AppendLine("	[Extra Info]");
                }
            }

            str.AppendLine("}");

            Form1.PacketRecv('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Exemplo n.º 26
0
        internal static void parse_CreateChar(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	Int32 sex = " + stream.ReadInt32());
            str.AppendLine("	Int32 race = " + stream.ReadInt32());
            str.AppendLine("	Int32 hair_id = " + stream.ReadInt32());
            str.AppendLine("	Int32 face_id = " + stream.ReadInt32());
            str.AppendLine("	Int32 body_id = " + stream.ReadInt32());
            str.AppendLine("	Int32 hands_id = " + stream.ReadInt32());
            str.AppendLine("	Int32 feet_id = " + stream.ReadInt32());
            str.AppendLine("	Int32 hair_color = " + stream.ReadInt32());

            // 32 ~ 39
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());

            str.AppendLine("	Int32 face_detail = " + stream.ReadInt32());

            // 44 ~ 51
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());

            str.AppendLine("	Int32 clothes_id = " + stream.ReadInt32());

            // 56 ~ 168
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());
            str.AppendLine("	4B Unknown = " + stream.ReadInt32());

            str.AppendLine("	String(19) name = " + stream.ReadString(0, 19));
            str.AppendLine("	Int32 skin_color = " + stream.ReadInt32());
            str.AppendLine("}");

            Form1.PacketSend('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Exemplo n.º 27
0
 // Server --> Redirector
 private void ServerPacketReceived(PacketStream data)
 {
     //bgWorker.ReportProgress(0, "Packet received from server");
     data = PacketFunc('S', data);
     Send(data);
 }
Exemplo n.º 28
0
        internal static void parse_Target(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	uint target = " + stream.ReadUInt32());
            str.AppendLine("}");

            Form1.PacketSend('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Exemplo n.º 29
0
        internal static void parse_Unequip(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	Int WearType = " + stream.ReadInt32());
            str.AppendLine("	Byte Unknown = " + stream.ReadByte());
            str.AppendLine("}");

            Form1.PacketSend('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Exemplo n.º 30
0
        internal static void parse_Chat(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	String(21) target = " + stream.ReadString(0, 21));
            str.AppendLine("	byte request_id = " + stream.ReadByte());
            byte size = stream.ReadByte();
            str.AppendLine("	byte len = " + size);
            str.AppendLine("	byte type = " + stream.ReadByte());
            str.AppendLine("	String(len) Command = " + stream.ReadString(0, size));
            str.AppendLine("}");

            Form1.PacketSend('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }