diff --git a/changelog.txt b/changelog.txt index 95204e643..51350d4a1 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 01/11/2015 == +Uleat: Added text link translators for OP_TaskDescription (Ti thru UF..RoF+ in-work) + == 01/10/2015 == Uleat: Added text link translators for OP_Emote diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 9b097bf49..03b47b2bc 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -3251,6 +3251,12 @@ namespace RoF // Set the Write pointer as we don't know what has been done with the packet before we get it. in->SetReadPosition(0); // Copy the header + // + // Server header struct is { uint32; uint32; uint32; uint32; uint8; } + // Yet, we're writing 5 uint32's... that's 17 vs 20 bytes... + // 3 Bytes difference..but, we only increase packet size by 1 byte..something wrong here? -U + // (Tying to add text link translators and can't figure out if '+1' size is a new RoF field or something else) + // for (int i = 0; i < 5; ++i) outapp->WriteUInt32(in->ReadUInt32()); diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index 74f150e59..5f9a1f0db 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -2177,6 +2177,49 @@ namespace SoD FINISH_ENCODE(); } + ENCODE(OP_TaskDescription) + { + EQApplicationPacket *in = *p; + *p = nullptr; + + unsigned char *__emu_buffer = in->pBuffer; + + char *InBuffer = (char *)in->pBuffer; + char *block_start = InBuffer; + + InBuffer += sizeof(TaskDescriptionHeader_Struct); + uint32 title_size = strlen(InBuffer) + 1; + InBuffer += title_size; + InBuffer += sizeof(TaskDescriptionData1_Struct); + uint32 description_size = strlen(InBuffer) + 1; + InBuffer += description_size; + InBuffer += sizeof(TaskDescriptionData2_Struct); + + std::string old_message = InBuffer; // start 'Reward' as string + std::string new_message; + ServerToSoDTextLink(new_message, old_message); + + in->size = sizeof(TaskDescriptionHeader_Struct)+sizeof(TaskDescriptionData1_Struct)+ + sizeof(TaskDescriptionData2_Struct)+sizeof(TaskDescriptionTrailer_Struct)+ + title_size + description_size + new_message.length() + 1; + + in->pBuffer = new unsigned char[in->size]; + + char *OutBuffer = (char *)in->pBuffer; + + memcpy(OutBuffer, (char *)__emu_buffer, (InBuffer - block_start)); + OutBuffer += (InBuffer - block_start); + + VARSTRUCT_ENCODE_STRING(OutBuffer, new_message.c_str()); + + InBuffer += strlen(InBuffer) + 1; + + memcpy(OutBuffer, InBuffer, sizeof(TaskDescriptionTrailer_Struct)); + + delete[] __emu_buffer; + dest->FastQueuePacket(&in, ack_req); + } + ENCODE(OP_Track) { EQApplicationPacket *in = *p; diff --git a/common/patches/sod_ops.h b/common/patches/sod_ops.h index 5a1d313a2..3ce2ac2cb 100644 --- a/common/patches/sod_ops.h +++ b/common/patches/sod_ops.h @@ -63,6 +63,7 @@ E(OP_SpawnDoor) E(OP_SpecialMesg) E(OP_Stun) E(OP_TargetBuffs) +E(OP_TaskDescription) E(OP_Track) E(OP_Trader) E(OP_TraderBuy) diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index 854953b32..dda929c74 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -1776,6 +1776,49 @@ namespace SoF FINISH_ENCODE(); } + ENCODE(OP_TaskDescription) + { + EQApplicationPacket *in = *p; + *p = nullptr; + + unsigned char *__emu_buffer = in->pBuffer; + + char *InBuffer = (char *)in->pBuffer; + char *block_start = InBuffer; + + InBuffer += sizeof(TaskDescriptionHeader_Struct); + uint32 title_size = strlen(InBuffer) + 1; + InBuffer += title_size; + InBuffer += sizeof(TaskDescriptionData1_Struct); + uint32 description_size = strlen(InBuffer) + 1; + InBuffer += description_size; + InBuffer += sizeof(TaskDescriptionData2_Struct); + + std::string old_message = InBuffer; // start 'Reward' as string + std::string new_message; + ServerToSoFTextLink(new_message, old_message); + + in->size = sizeof(TaskDescriptionHeader_Struct)+sizeof(TaskDescriptionData1_Struct)+ + sizeof(TaskDescriptionData2_Struct)+sizeof(TaskDescriptionTrailer_Struct)+ + title_size + description_size + new_message.length() + 1; + + in->pBuffer = new unsigned char[in->size]; + + char *OutBuffer = (char *)in->pBuffer; + + memcpy(OutBuffer, (char *)__emu_buffer, (InBuffer - block_start)); + OutBuffer += (InBuffer - block_start); + + VARSTRUCT_ENCODE_STRING(OutBuffer, new_message.c_str()); + + InBuffer += strlen(InBuffer) + 1; + + memcpy(OutBuffer, InBuffer, sizeof(TaskDescriptionTrailer_Struct)); + + delete[] __emu_buffer; + dest->FastQueuePacket(&in, ack_req); + } + ENCODE(OP_Track) { EQApplicationPacket *in = *p; diff --git a/common/patches/sof_ops.h b/common/patches/sof_ops.h index 08e30aeff..14ad69a8b 100644 --- a/common/patches/sof_ops.h +++ b/common/patches/sof_ops.h @@ -55,6 +55,7 @@ E(OP_SomeItemPacketMaybe) E(OP_SpawnDoor) E(OP_SpecialMesg) E(OP_Stun) +E(OP_TaskDescription) E(OP_Track) E(OP_Trader) E(OP_TraderBuy) diff --git a/common/patches/titanium.cpp b/common/patches/titanium.cpp index ac154a79d..e0e5f8528 100644 --- a/common/patches/titanium.cpp +++ b/common/patches/titanium.cpp @@ -1226,6 +1226,49 @@ namespace Titanium dest->FastQueuePacket(&in, ack_req); } + ENCODE(OP_TaskDescription) + { + EQApplicationPacket *in = *p; + *p = nullptr; + + unsigned char *__emu_buffer = in->pBuffer; + + char *InBuffer = (char *)in->pBuffer; + char *block_start = InBuffer; + + InBuffer += sizeof(TaskDescriptionHeader_Struct); + uint32 title_size = strlen(InBuffer) + 1; + InBuffer += title_size; + InBuffer += sizeof(TaskDescriptionData1_Struct); + uint32 description_size = strlen(InBuffer) + 1; + InBuffer += description_size; + InBuffer += sizeof(TaskDescriptionData2_Struct); + + std::string old_message = InBuffer; // start 'Reward' as string + std::string new_message; + ServerToTitaniumTextLink(new_message, old_message); + + in->size = sizeof(TaskDescriptionHeader_Struct) + sizeof(TaskDescriptionData1_Struct) + + sizeof(TaskDescriptionData2_Struct) + sizeof(TaskDescriptionTrailer_Struct) + + title_size + description_size + new_message.length() + 1; + + in->pBuffer = new unsigned char[in->size]; + + char *OutBuffer = (char *)in->pBuffer; + + memcpy(OutBuffer, (char *)__emu_buffer, (InBuffer - block_start)); + OutBuffer += (InBuffer - block_start); + + VARSTRUCT_ENCODE_STRING(OutBuffer, new_message.c_str()); + + InBuffer += strlen(InBuffer) + 1; + + memcpy(OutBuffer, InBuffer, sizeof(TaskDescriptionTrailer_Struct)); + + delete[] __emu_buffer; + dest->FastQueuePacket(&in, ack_req); + } + ENCODE(OP_Track) { EQApplicationPacket *in = *p; diff --git a/common/patches/titanium_ops.h b/common/patches/titanium_ops.h index 47d992b16..88c12e3ac 100644 --- a/common/patches/titanium_ops.h +++ b/common/patches/titanium_ops.h @@ -39,6 +39,7 @@ E(OP_SendCharInfo) E(OP_SendAATable) E(OP_ShopPlayerSell) E(OP_SpecialMesg) +E(OP_TaskDescription) E(OP_Track) E(OP_Trader) E(OP_TraderBuy) diff --git a/common/patches/underfoot.cpp b/common/patches/underfoot.cpp index fc20e6e4b..ba94084fb 100644 --- a/common/patches/underfoot.cpp +++ b/common/patches/underfoot.cpp @@ -2443,6 +2443,49 @@ namespace Underfoot ENCODE(OP_TargetBuffs) { ENCODE_FORWARD(OP_BuffCreate); } + ENCODE(OP_TaskDescription) + { + EQApplicationPacket *in = *p; + *p = nullptr; + + unsigned char *__emu_buffer = in->pBuffer; + + char *InBuffer = (char *)in->pBuffer; + char *block_start = InBuffer; + + InBuffer += sizeof(TaskDescriptionHeader_Struct); + uint32 title_size = strlen(InBuffer) + 1; + InBuffer += title_size; + InBuffer += sizeof(TaskDescriptionData1_Struct); + uint32 description_size = strlen(InBuffer) + 1; + InBuffer += description_size; + InBuffer += sizeof(TaskDescriptionData2_Struct); + + std::string old_message = InBuffer; // start 'Reward' as string + std::string new_message; + ServerToUnderfootTextLink(new_message, old_message); + + in->size = sizeof(TaskDescriptionHeader_Struct)+sizeof(TaskDescriptionData1_Struct)+ + sizeof(TaskDescriptionData2_Struct)+sizeof(TaskDescriptionTrailer_Struct)+ + title_size + description_size + new_message.length() + 1; + + in->pBuffer = new unsigned char[in->size]; + + char *OutBuffer = (char *)in->pBuffer; + + memcpy(OutBuffer, (char *)__emu_buffer, (InBuffer - block_start)); + OutBuffer += (InBuffer - block_start); + + VARSTRUCT_ENCODE_STRING(OutBuffer, new_message.c_str()); + + InBuffer += strlen(InBuffer) + 1; + + memcpy(OutBuffer, InBuffer, sizeof(TaskDescriptionTrailer_Struct)); + + delete[] __emu_buffer; + dest->FastQueuePacket(&in, ack_req); + } + ENCODE(OP_Track) { EQApplicationPacket *in = *p; diff --git a/common/patches/underfoot_ops.h b/common/patches/underfoot_ops.h index 4443425fb..188cf3d9e 100644 --- a/common/patches/underfoot_ops.h +++ b/common/patches/underfoot_ops.h @@ -70,6 +70,7 @@ E(OP_SpawnDoor) E(OP_SpecialMesg) E(OP_Stun) E(OP_TargetBuffs) +E(OP_TaskDescription) E(OP_Track) E(OP_Trader) E(OP_TraderBuy)