mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
Added text link translators for OP_Emote
This commit is contained in:
@@ -586,6 +586,34 @@ namespace SoF
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
|
||||
ENCODE(OP_Emote)
|
||||
{
|
||||
EQApplicationPacket *in = *p;
|
||||
*p = nullptr;
|
||||
|
||||
Emote_Struct *emu = (Emote_Struct *)in->pBuffer;
|
||||
|
||||
unsigned char *__emu_buffer = in->pBuffer;
|
||||
|
||||
std::string old_message = emu->message;
|
||||
std::string new_message;
|
||||
ServerToSoFTextLink(new_message, old_message);
|
||||
|
||||
//if (new_message.length() > 512) // length restricted in packet building function due vari-length name size (no nullterm)
|
||||
// new_message = new_message.substr(0, 512);
|
||||
|
||||
in->size = new_message.length() + 5;
|
||||
in->pBuffer = new unsigned char[in->size];
|
||||
|
||||
char *OutBuffer = (char *)in->pBuffer;
|
||||
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, emu->unknown01);
|
||||
VARSTRUCT_ENCODE_STRING(OutBuffer, new_message.c_str());
|
||||
|
||||
delete[] __emu_buffer;
|
||||
dest->FastQueuePacket(&in, ack_req);
|
||||
}
|
||||
|
||||
ENCODE(OP_ExpansionInfo)
|
||||
{
|
||||
ENCODE_LENGTH_EXACT(ExpansionInfo_Struct);
|
||||
@@ -2370,6 +2398,27 @@ namespace SoF
|
||||
FINISH_DIRECT_DECODE();
|
||||
}
|
||||
|
||||
DECODE(OP_Emote)
|
||||
{
|
||||
unsigned char *__eq_buffer = __packet->pBuffer;
|
||||
|
||||
std::string old_message = (char *)&__eq_buffer[4]; // unknown01 offset
|
||||
std::string new_message;
|
||||
SoFToServerTextLink(new_message, old_message);
|
||||
|
||||
__packet->size = sizeof(Emote_Struct);
|
||||
__packet->pBuffer = new unsigned char[__packet->size];
|
||||
|
||||
char *InBuffer = (char *)__packet->pBuffer;
|
||||
|
||||
memcpy(InBuffer, __eq_buffer, 4);
|
||||
InBuffer += 4;
|
||||
strcpy(InBuffer, new_message.substr(0, 1023).c_str());
|
||||
InBuffer[1023] = '\0';
|
||||
|
||||
delete[] __eq_buffer;
|
||||
}
|
||||
|
||||
DECODE(OP_FaceChange)
|
||||
{
|
||||
DECODE_LENGTH_EXACT(structs::FaceChange_Struct);
|
||||
|
||||
Reference in New Issue
Block a user