EOSERV Bug Tracker > Bug #424: Too many bytes in Map::Msg(NPC *from, std::string message)

Bug #424: Too many bytes in Map::Msg(NPC *from, std::string message)

Too many bytes in Map::Msg(NPC *from, std::string message)
ID #424
Submitter insomniac
Product EOSERV
Severity Trivial
Status OPEN, CONFIRMED
Submitted 8th Aug 2016
Updated 6th Nov 2016
insomniac Submitter 7 years, 38 weeks ago

builder.AddShort(from->index); needs to be switched to builder.AddChar(from->index);

from

void Map::Msg(NPC *from, std::string message)

{

message = util::text_cap(message, static_cast<int>(this->world->config["ChatMaxWidth"]) - util::text_width(util::ucfirst(from->ENF().name) + " "));

PacketBuilder builder(PACKET_NPC, PACKET_PLAYER, 4 + message.length());

builder.AddByte(255);

builder.AddByte(255);

builder.AddShort(from->index);

builder.AddChar(message.length());

builder.AddString(message);

UTIL_FOREACH(this->characters, character)

{

character->Send(builder);

}

}

to

void Map::Msg(NPC *from, std::string message)

{

message = util::text_cap(message, static_cast<int>(this->world->config["ChatMaxWidth"]) - util::text_width(util::ucfirst(from->ENF().name) + " "));

PacketBuilder builder(PACKET_NPC, PACKET_PLAYER, 4 + message.length());

builder.AddByte(255);

builder.AddByte(255);

builder.AddChar(from->index);

builder.AddChar(message.length());

builder.AddString(message);

UTIL_FOREACH(this->characters, character)

{

character->Send(builder);

}

}

Comments

Sausage Developer 7 years, 27 weeks ago

This code doesn't even exist in EOSERV.

Updated Status to CLOSED, INVALID

insomniac Submitter 7 years, 25 weeks ago

Yes it does http://svn.eoserv.net/eoserv/trunk/src/map.cpp on line 843

Sausage Developer 7 years, 25 weeks ago

Oops, it exists, it's just not used anywhere.

Add Comment

Please don't post unless you have something relevant to the bug to say.
Do not comment to say "thanks" or "fix this please".

Please log in to add comments. EOSERV Bug Tracker > Bug #424: Too many bytes in Map::Msg(NPC *from, std::string message)