Add Client::SendColoredText(uint32 color, std::string message)

This will send a message (arbitrary size limit of 512) to the client
of the provided color. The MT colors should work here.
This commit is contained in:
Michael Cook (mackal) 2014-09-24 13:14:20 -04:00
parent a445d7e39f
commit 34496c49b4
2 changed files with 16 additions and 0 deletions

View File

@ -8313,3 +8313,18 @@ float Client::GetQuiverHaste()
quiver_haste = 1.0f / (1.0f + static_cast<float>(quiver_haste) / 100.0f);
return quiver_haste;
}
void Client::SendColoredText(uint32 color, std::string message)
{
// arbitrary size limit
if (message.size() > 512) // live does send this with empty strings sometimes ...
return;
EQApplicationPacket *outapp = new EQApplicationPacket(OP_ColoredText,
sizeof(ColoredText_Struct) + message.size());
ColoredText_Struct *cts = (ColoredText_Struct *)outapp->pBuffer;
cts->color = color;
strcpy(cts->msg, message.c_str());
QueuePacket(outapp);
safe_delete(outapp);
}

View File

@ -255,6 +255,7 @@ public:
const char *message7 = nullptr, const char *message8 = nullptr,
const char *message9 = nullptr);
void Tell_StringID(uint32 string_id, const char *who, const char *message);
void SendColoredText(uint32 color, std::string message);
void SendBazaarResults(uint32 trader_id,uint32 class_,uint32 race,uint32 stat,uint32 slot,uint32 type,char name[64],uint32 minprice,uint32 maxprice);
void SendTraderItem(uint32 item_id,uint16 quantity);
uint16 FindTraderItem(int32 SerialNumber,uint16 Quantity);