Page 1 of 1

Send (whisp)

Posted: 10 Jan 2007, 16:48
by KaTSuo
Hi !

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
    }
In protocol.h

Code: Select all

#define CMSG_PLAYER_SEND             0x0096 /**<Send>*/
#define SMSG_SEND_CHAT               0x0097 /**<Receive>*/
#define SMSG_SEND_CHAT_STAT          0x0098 /**<Status>*/
In chat.h

Code: Select all

#define IS_SEND             "/send "
#define IS_SEND_LENGTH      6
Packet_table.txt

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
Is anybody have an idea...? My problem is probably how to send the nick destination to the server (outMsg.writeString(msg, msg.length); //Send nick?). I'm not sure of that, especially since my server crashed when I tried to execute this command lol

Posted: 10 Jan 2007, 17:12
by Crush
You should consult the eAthena documentation for the private message protocol.

Posted: 10 Jan 2007, 17:44
by KaTSuo
Already did it.
Actually, my problem is that I don't know how to parse the nick destination for this command...

Should be like that

Code: Select all

/nick nickname_destination Hello ! How are U ?
And I want to send this to the server :

Code: Select all

outMsg.writeInt16(CMSG_PLAYER_SEND); //Packet number wich is 0x0096
        outMsg.writeInt16(msg.length() + 4); //Length of the command
        outMsg.writeString("nickname_destination", msg.length()); //Sending the nickname
        outMsg.writeString("Hello ! How are U ?", msg.length()); //Sending the text

Posted: 15 Jul 2007, 10:51
by †Link†
If you put a Private Messaging system in this game im gonna be really happy finnally a way to contact people

Posted: 15 Jul 2007, 16:31
by i
Private Messaging system should wait for new server. i dont like the eAthena solution.