Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Hi, i have a problem for sending a message ingame. I have 2 functions, one for construct the packet and one for sending to all players the packet, it's look like that :
- */
- SendMessageToBg(true, "The player %s join the battleground", pPlayer->GetName());
- void EasyBG::SendMessageToBg(bool isArea, const char *message, ...)
- {
- DistributePacketToAll((isArea) ? SendChatMessage(true, message) : SendChatMessage(false, message));
- }
- WorldPacket * EasyBG::SendChatMessage(bool isArea, const char *message)
- {
- char msg[500];
- va_list ap;
- va_start(ap, message);
- vsnprintf(msg, 500, message, ap); // Crash here
- va_end(ap);
- if(isArea)
- {
- /*WorldPacket *data = new WorldPacket(SMSG_AREA_TRIGGER_MESSAGE, 6 + strlen(msg));
- *data << (uint32)0 << msg << (uint8)0x00;
- return data;*/
- WorldPacket data(SMSG_AREA_TRIGGER_MESSAGE, 6 + strlen(msg));
- data << (uint32)0 << msg << (uint8)0x00;
- return &data;
- }
- else
- return sChatHandler.FillSystemMessageData(msg);
- }
- /*
- I created a crashdump and there is a problem for the player name :
- message : message 0x00be2a60 "The player %s join the battlground" const char *
- msg : msg 0x049ef79c "The player ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ9*Û¢ " char [500]
- So i think it crash because msg is over 500 character...
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement