Excluded text link body from message scrambling in Client::GarbleMessage()

This commit is contained in:
Uleat 2015-01-07 11:13:48 -05:00
parent b27737bfcd
commit 0552220f00
2 changed files with 12 additions and 0 deletions

View File

@ -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.

View File

@ -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