I'm trying to add a whisp feature to TMW...
Here is my snippet to send a whisp :
In chat.ccp
Code: Select all
else if (msg.substr(0, IS_SEND_LENGTH) == IS_SEND)
{
msg.erase(0, IS_SEND_LENGTH);
MessageOut outMsg(mNetwork);
outMsg.writeInt16(CMSG_PLAYER_SEND);
outMsg.writeInt16(msg.length() + 4);
outMsg.writeString(msg, msg.length); //Send nick?
outMsg.writeString(msg, msg.length()); //Send text
}
Code: Select all
#define CMSG_PLAYER_SEND 0x0096 /**<Send>*/
#define SMSG_SEND_CHAT 0x0097 /**<Receive>*/
#define SMSG_SEND_CHAT_STAT 0x0098 /**<Status>*/
Code: Select all
#define IS_SEND "/send "
#define IS_SEND_LENGTH 6
Code: Select all
S 0096 <len>.w <nick>.24B <message>.?B
send wisper
R 0097 <len>.w <nick>.24B <message>.?B
receive wisper
R 0098 <type>.B
type=00 success to send wisper
type=01 target character is not loged in?
type=02 ignored by target