Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 02-19-2015, 11:18 AM
Nibiuno
Hill Giant
 
Join Date: Mar 2010
Posts: 101
Default Crash in RoF2 codetrain for garbled messages

Im getting crashes when people dont have language skills or something on occasion. I get a message about an iterator error on my zone.exe file, and the zone crashes. Here is the crash info and the section of code.

Quote:
[02-19-2015 :: 10:20:17] [Crash] f:\dd\vctools\crt_bld\self_x86\crt\src\isctype.c (56): _chvalidator
[02-19-2015 :: 10:20:17] [Crash] f:\dd\vctools\crt_bld\self_x86\crt\src\_ctype.c (69): isalpha
[02-19-2015 :: 10:20:17] [Crash] c:\eq\sourcerof2\zone\client.cpp (7429): Client::GarbleMessage
[02-19-2015 :: 10:20:17] [Crash] c:\eq\sourcerof2\zone\client.cpp (1103): Client::ChannelMessageSend
[02-19-2015 :: 10:20:17] [Crash] c:\eq\sourcerof2\zone\entity.cpp (1107): EntityList::ChannelMessage
[02-19-2015 :: 10:20:17] [Crash] c:\eq\sourcerof2\zone\client.cpp (976): Client::ChannelMessageReceived
[02-19-2015 :: 10:20:17] [Crash] c:\eq\sourcerof2\zone\client_packet.cpp (4153): Client::Handle_OP_ChannelMessage
[02-19-2015 :: 10:20:17] [Crash] c:\eq\sourcerof2\zone\client_packet.cpp (46: Client::HandlePacket
[02-19-2015 :: 10:20:17] [Crash] c:\eq\sourcerof2\zone\client_process.cpp (683): Client::Process
[02-19-2015 :: 10:20:17] [Crash] c:\eq\sourcerof2\zone\entity.cpp (472): EntityList::MobProcess
Quote:
void Client::GarbleMessage(char *message, uint8 variance)
{
// Garble message by variance%
const char alpha_list[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvw xyz"; // 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 = (uintzone->random.Int(0, 115); // variation just over worst possible scrambling
if (isalpha(message[i]) && (chance <= variance)) {
uint8 rand_char = (uintzone->random.Int(0,51); // choose a random character from the alpha list
message[i] = alpha_list[rand_char];
}
}
}
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 05:31 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3