From 739a7b6f7542bc330ea5b1054684df03644e43b7 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Mon, 6 Apr 2015 21:46:37 -0400 Subject: [PATCH] Add decoder for OP_Animation for RoF/RoF2 --- common/patches/rof.cpp | 34 +++++++++++++++++++++++----------- common/patches/rof2.cpp | 12 ++++++++++++ common/patches/rof2_ops.h | 1 + common/patches/rof_ops.h | 1 + 4 files changed, 37 insertions(+), 11 deletions(-) diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 1c9cf3fd6..7bb64735b 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -479,7 +479,7 @@ namespace RoF eq->slot = 13; else OUT(slot); - + OUT(spell_id); eq->inventoryslot = ServerToRoFSlot(emu->inventoryslot); //OUT(inventoryslot); @@ -702,7 +702,7 @@ namespace RoF { SETUP_VAR_ENCODE(ExpeditionCompass_Struct); ALLOC_VAR_ENCODE(structs::ExpeditionCompass_Struct, sizeof(structs::ExpeditionInfo_Struct) + sizeof(structs::ExpeditionCompassEntry_Struct) * emu->count); - + OUT(count); for (uint32 i = 0; i < emu->count; ++i) @@ -1249,7 +1249,7 @@ namespace RoF switch (emu_e->rank) { case 0: { e->rank = htonl(5); break; } // GUILD_MEMBER 0 case 1: { e->rank = htonl(3); break; } // GUILD_OFFICER 1 - case 2: { e->rank = htonl(1); break; } // GUILD_LEADER 2 + case 2: { e->rank = htonl(1); break; } // GUILD_LEADER 2 default: { e->rank = htonl(emu_e->rank); break; } // GUILD_NONE } @@ -2989,7 +2989,7 @@ namespace RoF eq_cse->Enabled = emu_cse->Enabled; eq_cse->LastLogin = emu_cse->LastLogin; eq_cse->Unknown2 = emu_cse->Unknown2; - + emu_ptr += sizeof(CharacterSelectEntry_Struct); eq_ptr += sizeof(structs::CharacterSelectEntry_Struct); } @@ -3046,7 +3046,7 @@ namespace RoF switch (emu->Rank) { case 0: { eq->Rank = 5; break; } // GUILD_MEMBER 0 case 1: { eq->Rank = 3; break; } // GUILD_OFFICER 1 - case 2: { eq->Rank = 1; break; } // GUILD_LEADER 2 + case 2: { eq->Rank = 1; break; } // GUILD_LEADER 2 default: { eq->Rank = emu->Rank; break; } } @@ -3313,7 +3313,7 @@ namespace RoF delete[] __emu_buffer; dest->FastQueuePacket(&in, ack_req); - + #if 0 // original code EQApplicationPacket *in = *p; *p = nullptr; @@ -3777,7 +3777,7 @@ namespace RoF } ENCODE(OP_ZoneEntry) { ENCODE_FORWARD(OP_ZoneSpawns); } - + ENCODE(OP_ZonePlayerToBind) { SETUP_VAR_ENCODE(ZonePlayerToBind_Struct); @@ -3968,8 +3968,8 @@ namespace RoF switch (emu->guildrank) { case 0: { VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 5); break; } // GUILD_MEMBER 0 case 1: { VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 3); break; } // GUILD_OFFICER 1 - case 2: { VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 1); break; } // GUILD_LEADER 2 - default: { VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->guildrank); break; } // + case 2: { VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 1); break; } // GUILD_LEADER 2 + default: { VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->guildrank); break; } // } } @@ -4118,6 +4118,18 @@ namespace RoF FINISH_DIRECT_DECODE(); } + DECODE(OP_Animation) + { + DECODE_LENGTH_EXACT(structs::Animation_Struct); + SETUP_DIRECT_DECODE(Animation_Struct, structs::Animation_Struct); + + IN(spawnid); + IN(action); + IN(speed); + + FINISH_DIRECT_DECODE(); + } + DECODE(OP_ApplyPoison) { DECODE_LENGTH_EXACT(structs::ApplyPoison_Struct); @@ -4230,7 +4242,7 @@ namespace RoF emu->slot = 10; else IN(slot); - + IN(spell_id); emu->inventoryslot = RoFToServerSlot(eq->inventoryslot); //IN(inventoryslot); @@ -5105,7 +5117,7 @@ namespace RoF hdrf.ItemClass = item->ItemClass; ss.write((const char*)&hdrf, sizeof(RoF::structs::ItemSerializationHeaderFinish)); - + if (strlen(item->Name) > 0) { ss.write(item->Name, strlen(item->Name)); diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 681bef783..06c524053 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -4269,6 +4269,18 @@ namespace RoF2 FINISH_DIRECT_DECODE(); } + DECODE(OP_Animation) + { + DECODE_LENGTH_EXACT(structs::Animation_Struct); + SETUP_DIRECT_DECODE(Animation_Struct, structs::Animation_Struct); + + IN(spawnid); + IN(action); + IN(speed); + + FINISH_DIRECT_DECODE(); + } + DECODE(OP_ApplyPoison) { DECODE_LENGTH_EXACT(structs::ApplyPoison_Struct); diff --git a/common/patches/rof2_ops.h b/common/patches/rof2_ops.h index 4e4400cdf..3bb69af5e 100644 --- a/common/patches/rof2_ops.h +++ b/common/patches/rof2_ops.h @@ -124,6 +124,7 @@ E(OP_ZoneSpawns) D(OP_AdventureMerchantSell) D(OP_AltCurrencySell) D(OP_AltCurrencySellSelection) +D(OP_Animation) D(OP_ApplyPoison) D(OP_AugmentInfo) D(OP_AugmentItem) diff --git a/common/patches/rof_ops.h b/common/patches/rof_ops.h index 08e8647f3..8e9adfdc9 100644 --- a/common/patches/rof_ops.h +++ b/common/patches/rof_ops.h @@ -109,6 +109,7 @@ E(OP_ZoneSpawns) D(OP_AdventureMerchantSell) D(OP_AltCurrencySell) D(OP_AltCurrencySellSelection) +D(OP_Animation) D(OP_ApplyPoison) D(OP_AugmentInfo) D(OP_AugmentItem)