Ejemplo n.º 1
0
void ChatHandler::SendSysMessage(const char *str)
{
    WorldPackets::Chat::Chat packet;

    // need copy to prevent corruption by strtok call in LineFromMessage original string
    char* buf = strdup(str);
    char* pos = buf;

    while (char* line = LineFromMessage(pos))
    {
        packet.Initalize(CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
        m_session->SendPacket(packet.Write());
    }

    free(buf);
}