From 0552220f00988c55e4f43a78af31603b485b4a88 Mon Sep 17 00:00:00 2001 From: Uleat Date: Wed, 7 Jan 2015 11:13:48 -0500 Subject: [PATCH] Excluded text link body from message scrambling in Client::GarbleMessage() --- changelog.txt | 3 +++ zone/client.cpp | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/changelog.txt b/changelog.txt index 1b5483e73..42fe19a31 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 01/07/2015 == +Uleat: Excluded text link body from message scrambling in Client::GarbleMessage() + == 01/06/2015 == Trevius: Changed the pet command #defines to be based on RoF2 list of pet commands and added decodes to Titanium, SoF and SoD. Trevius: (RoF+) The /pet focus on/off and /pet hold on/off commands are now functional. diff --git a/zone/client.cpp b/zone/client.cpp index 8b82f77cf..aae809f60 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -7470,8 +7470,17 @@ void Client::GarbleMessage(char *message, uint8 variance) { // Garble message by variance% const char alpha_list[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; // only change alpha characters for now + const char delimiter = 0x12; + int delimiter_count = 0; for (size_t i = 0; i < strlen(message); i++) { + // Client expects hex values inside of a text link body + if (message[i] == delimiter) { + if (!(delimiter_count & 1)) { i += EmuConstants::TEXT_LINK_BODY_LENGTH; } + ++delimiter_count; + continue; + } + uint8 chance = (uint8)zone->random.Int(0, 115); // variation just over worst possible scrambling if (isalpha(message[i]) && (chance <= variance)) { uint8 rand_char = (uint8)zone->random.Int(0,51); // choose a random character from the alpha list