mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 05:21:29 +00:00
Add sanity checks to GMSayHookCallBackProcess
This commit is contained in:
parent
4f4eee2b16
commit
5c729e65c9
@ -257,7 +257,14 @@ public:
|
|||||||
// random object that provides random values for the zone
|
// random object that provides random values for the zone
|
||||||
EQEmu::Random random;
|
EQEmu::Random random;
|
||||||
|
|
||||||
static void GMSayHookCallBackProcess(uint16 log_category, const std::string& message){
|
static void GMSayHookCallBackProcess(uint16 log_category, std::string message){
|
||||||
|
/* Cut messages down to 4000 max to prevent client crash */
|
||||||
|
if (!message.empty())
|
||||||
|
message = message.substr(0, 4000);
|
||||||
|
|
||||||
|
/* Replace Occurrences of % or MessageStatus will crash */
|
||||||
|
find_replace(message, std::string("%"), std::string("."));
|
||||||
|
|
||||||
if (message.find("\n") != std::string::npos){
|
if (message.find("\n") != std::string::npos){
|
||||||
auto message_split = SplitString(message, '\n');
|
auto message_split = SplitString(message, '\n');
|
||||||
entity_list.MessageStatus(0, 80, Log.GetGMSayColorFromCategory(log_category), "%s", message_split[0].c_str());
|
entity_list.MessageStatus(0, 80, Log.GetGMSayColorFromCategory(log_category), "%s", message_split[0].c_str());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user