Esempio n. 1
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());
        }
Esempio n. 2
0
        internal static void send_Property(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());
            bool as_int = stream.ReadBool();
            str.AppendLine("	Byte AsInt = " + as_int);
            str.AppendLine("	String(16) property_name = " + stream.ReadString(0, 16));
            str.AppendLine("	Int32 value = " + stream.ReadInt32());
            str.AppendLine("	Int32 unknown = " + stream.ReadInt32());
            if (!as_int)
                str.AppendLine("	String(?) value = " + stream.ReadString(0, stream.GetSize() - 28));
            str.AppendLine("}");

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