mirror of
https://github.com/EQEmu/Server.git
synced 2026-02-25 13:32:26 +00:00
Excluded text link body from message scrambling in Client::GarbleMessage()
This commit is contained in:
parent
b27737bfcd
commit
0552220f00
@ -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.
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user