From 0b44f5851862697d3d7208567af5fbd5e7994067 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Mon, 17 Nov 2014 16:41:37 -0500 Subject: [PATCH] Correct OP_AugmentInfo reply This fixes the display issue for RoF SoF/SoD/UF still won't show the charm info on Adventurer's Stone, probably a client bug. --- changelog.txt | 4 ++++ common/eq_packet_structs.h | 4 ++-- common/patches/rof.cpp | 12 ++++++++++ common/patches/rof_ops.h | 1 + common/patches/rof_structs.h | 6 ++--- common/patches/sod.cpp | 12 ++++++++++ common/patches/sod_ops.h | 1 + common/patches/sod_structs.h | 6 ++--- common/patches/sof.cpp | 12 ++++++++++ common/patches/sof_ops.h | 1 + common/patches/sof_structs.h | 6 ++--- common/patches/underfoot.cpp | 12 ++++++++++ common/patches/underfoot_ops.h | 1 + common/patches/underfoot_structs.h | 6 ++--- zone/client_packet.cpp | 38 ++++++------------------------ 15 files changed, 77 insertions(+), 45 deletions(-) diff --git a/changelog.txt b/changelog.txt index da9906984..8bfd1e103 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,9 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 11/16/2014 == +demonstar55: Correct OP_AugmentInfo reply. This fixes RoF display issue with Adventurer's Stone + Still issues with UF/SoF/SoD though. + == 11/16/2014 == demonstar55: fix size issue with ControlBoat_Struct and exploit fix in OP_BoardBoat Akkadius: Implemented Automatic Database update and versioning system diff --git a/common/eq_packet_structs.h b/common/eq_packet_structs.h index c49283f18..7c663f18e 100644 --- a/common/eq_packet_structs.h +++ b/common/eq_packet_structs.h @@ -4389,8 +4389,8 @@ struct ControlBoat_Struct { struct AugmentInfo_Struct { /*000*/ uint32 itemid; // id of the solvent needed -/*004*/ uint8 window; // window to display the information in -/*005*/ uint8 unknown005[67]; // total packet length 72, all the rest were always 00 +/*004*/ uint32 window; // window to display the information in +/*008*/ char augment_info[64]; // the reply has the text here /*072*/ }; diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 95e0047e8..092101d7d 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -235,6 +235,18 @@ namespace RoF FINISH_ENCODE(); } + ENCODE(OP_AugmentInfo) + { + ENCODE_LENGTH_EXACT(AugmentInfo_Struct); + SETUP_DIRECT_ENCODE(AugmentInfo_Struct, structs::AugmentInfo_Struct); + + OUT(itemid); + OUT(window); + strn0cpy(eq->augment_info, emu->augment_info, 64); + + FINISH_ENCODE(); + } + ENCODE(OP_Barter) { EQApplicationPacket *in = *p; diff --git a/common/patches/rof_ops.h b/common/patches/rof_ops.h index 57ff1f91d..878870a81 100644 --- a/common/patches/rof_ops.h +++ b/common/patches/rof_ops.h @@ -5,6 +5,7 @@ E(OP_AltCurrency) E(OP_AltCurrencySell) E(OP_Animation) E(OP_ApplyPoison) +E(OP_AugmentInfo) E(OP_Barter) E(OP_BazaarSearch) E(OP_BeginCast) diff --git a/common/patches/rof_structs.h b/common/patches/rof_structs.h index f3a6209b8..0a62a90bf 100644 --- a/common/patches/rof_structs.h +++ b/common/patches/rof_structs.h @@ -4692,9 +4692,9 @@ struct ItemQuaternaryBodyStruct struct AugmentInfo_Struct { /*000*/ uint32 itemid; // id of the solvent needed -/*004*/ uint8 window; // window to display the information in -/*005*/ uint8 unknown005[71]; // total packet length 76, all the rest were always 00 -/*076*/ +/*004*/ uint32 window; // window to display the information in +/*008*/ char augment_info[64]; // total packet length 76, all the rest were always 00 +/*072*/ uint32 unknown072; }; struct VeteranRewardItem diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index 1d93ad721..54dd33841 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -174,6 +174,18 @@ namespace SoD FINISH_ENCODE(); } + ENCODE(OP_AugmentInfo) + { + ENCODE_LENGTH_EXACT(AugmentInfo_Struct); + SETUP_DIRECT_ENCODE(AugmentInfo_Struct, structs::AugmentInfo_Struct); + + OUT(itemid); + OUT(window); + strn0cpy(eq->augment_info, emu->augment_info, 64); + + FINISH_ENCODE(); + } + ENCODE(OP_Barter) { EQApplicationPacket *in = *p; diff --git a/common/patches/sod_ops.h b/common/patches/sod_ops.h index 792c9e5d3..038b42e08 100644 --- a/common/patches/sod_ops.h +++ b/common/patches/sod_ops.h @@ -3,6 +3,7 @@ E(OP_Action) E(OP_AdventureMerchantSell) E(OP_AltCurrencySell) E(OP_ApplyPoison) +E(OP_AugmentInfo) E(OP_Barter) E(OP_BazaarSearch) E(OP_Buff) diff --git a/common/patches/sod_structs.h b/common/patches/sod_structs.h index 15e0d5307..47b228cb7 100644 --- a/common/patches/sod_structs.h +++ b/common/patches/sod_structs.h @@ -4173,9 +4173,9 @@ struct ItemQuaternaryBodyStruct struct AugmentInfo_Struct { /*000*/ uint32 itemid; // id of the solvent needed -/*004*/ uint8 window; // window to display the information in -/*005*/ uint8 unknown005[71]; // total packet length 76, all the rest were always 00 -/*076*/ +/*004*/ uint32 window; // window to display the information in +/*008*/ char augment_info[64]; // total packet length 76, all the rest were always 00 +/*072*/ uint32 unknown072; }; struct VeteranRewardItem diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index a9b8d6e26..629395cd1 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -174,6 +174,18 @@ namespace SoF FINISH_ENCODE(); } + ENCODE(OP_AugmentInfo) + { + ENCODE_LENGTH_EXACT(AugmentInfo_Struct); + SETUP_DIRECT_ENCODE(AugmentInfo_Struct, structs::AugmentInfo_Struct); + + OUT(itemid); + OUT(window); + strn0cpy(eq->augment_info, emu->augment_info, 64); + + FINISH_ENCODE(); + } + ENCODE(OP_BazaarSearch) { if (((*p)->size == sizeof(BazaarReturnDone_Struct)) || ((*p)->size == sizeof(BazaarWelcome_Struct))) { diff --git a/common/patches/sof_ops.h b/common/patches/sof_ops.h index f039c2189..132e3dc77 100644 --- a/common/patches/sof_ops.h +++ b/common/patches/sof_ops.h @@ -3,6 +3,7 @@ E(OP_Action) E(OP_AdventureMerchantSell) E(OP_AltCurrencySell) E(OP_ApplyPoison) +E(OP_AugmentInfo) E(OP_BazaarSearch) E(OP_BecomeTrader) E(OP_Buff) diff --git a/common/patches/sof_structs.h b/common/patches/sof_structs.h index a49dc6f25..9c3238f73 100644 --- a/common/patches/sof_structs.h +++ b/common/patches/sof_structs.h @@ -4027,9 +4027,9 @@ struct ItemQuaternaryBodyStruct struct AugmentInfo_Struct { /*000*/ uint32 itemid; // id of the solvent needed -/*004*/ uint8 window; // window to display the information in -/*005*/ uint8 unknown005[71]; // total packet length 76, all the rest were always 00 -/*076*/ +/*004*/ uint32 window; // window to display the information in +/*008*/ char augment_info[64]; // total packet length 76, all the rest were always 00 +/*072*/ uint32 unknown072; }; struct VeteranRewardItem diff --git a/common/patches/underfoot.cpp b/common/patches/underfoot.cpp index a0cd76114..adc4ed6e3 100644 --- a/common/patches/underfoot.cpp +++ b/common/patches/underfoot.cpp @@ -226,6 +226,18 @@ namespace Underfoot FINISH_ENCODE(); } + ENCODE(OP_AugmentInfo) + { + ENCODE_LENGTH_EXACT(AugmentInfo_Struct); + SETUP_DIRECT_ENCODE(AugmentInfo_Struct, structs::AugmentInfo_Struct); + + OUT(itemid); + OUT(window); + strn0cpy(eq->augment_info, emu->augment_info, 64); + + FINISH_ENCODE(); + } + ENCODE(OP_Barter) { EQApplicationPacket *in = *p; diff --git a/common/patches/underfoot_ops.h b/common/patches/underfoot_ops.h index 38cfb79e3..cfb4d4fe9 100644 --- a/common/patches/underfoot_ops.h +++ b/common/patches/underfoot_ops.h @@ -4,6 +4,7 @@ E(OP_AdventureMerchantSell) E(OP_AltCurrency) E(OP_AltCurrencySell) E(OP_ApplyPoison) +E(OP_AugmentInfo) E(OP_Barter) E(OP_BazaarSearch) E(OP_Buff) diff --git a/common/patches/underfoot_structs.h b/common/patches/underfoot_structs.h index 86f712d24..45c47875d 100644 --- a/common/patches/underfoot_structs.h +++ b/common/patches/underfoot_structs.h @@ -4272,9 +4272,9 @@ struct ItemQuaternaryBodyStruct struct AugmentInfo_Struct { /*000*/ uint32 itemid; // id of the solvent needed -/*004*/ uint8 window; // window to display the information in -/*005*/ uint8 unknown005[71]; // total packet length 76, all the rest were always 00 -/*076*/ +/*004*/ uint32 window; // window to display the information in +/*008*/ char augment_info[64]; // total packet length 76, all the rest were always 00 +/*072*/ uint32 unknown072; }; struct VeteranRewardItem diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 0e35db1fa..51affb7dd 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -3034,47 +3034,23 @@ void Client::Handle_OP_AssistGroup(const EQApplicationPacket *app) void Client::Handle_OP_AugmentInfo(const EQApplicationPacket *app) { - // This packet is sent by the client when an Augment item information window is opened. - // We respond with an OP_ReadBook containing the type of distiller required to remove the augment. - // The OP_Augment packet includes a window parameter to determine which Item window in the UI the - // text is to be displayed in. out->type = 2 indicates the BookText_Struct contains item information. - // + // Some clients this seems to nuke the charm text (ex. Adventurer's Stone) - if (app->size != sizeof(AugmentInfo_Struct)) - { + if (app->size != sizeof(AugmentInfo_Struct)) { LogFile->write(EQEMuLog::Debug, "Size mismatch in OP_AugmentInfo expected %i got %i", sizeof(AugmentInfo_Struct), app->size); - DumpPacket(app); - return; } + AugmentInfo_Struct* AugInfo = (AugmentInfo_Struct*)app->pBuffer; - - char *outstring = nullptr; - const Item_Struct * item = database.GetItem(AugInfo->itemid); - if (item) - { - MakeAnyLenString(&outstring, "You must use the solvent %s to remove this augment safely.", item->Name); - - EQApplicationPacket* outapp = new EQApplicationPacket(OP_ReadBook, strlen(outstring) + sizeof(BookText_Struct)); - - BookText_Struct *out = (BookText_Struct *)outapp->pBuffer; - - out->window = AugInfo->window; - - out->type = 2; - - out->invslot = 0; - - strcpy(out->booktext, outstring); - - safe_delete_array(outstring); - - FastQueuePacket(&outapp); + if (item) { + strn0cpy(AugInfo->augment_info, item->Name, 64); + AugInfo->itemid = 0; + QueuePacket(app); } }