From The Mana World
(Refer to being movement system article)
(Fixing discrepancies between the code and the wiki (and hence deprecating a note))
Line 38: Line 38:


<pre>
<pre>
1a. PCMSG_CHAT { channel, "username", "message" }
1a. PCMSG_CHAT { "message", channel }
1b. PCMSG_ANNOUNCE { "annoucement" }
1b. PCMSG_ANNOUNCE { "annoucement" }
1c. PCMSG_PRIVMSG { "username", "message" }
1c. PCMSG_PRIVMSG { "username", "message" }
2a. CPMSG_ERROR { "error" }
2a. CPMSG_ERROR { error }
2b. CPMSG_ANNOUNCEMENT { "annoucement" }
2b. CPMSG_ANNOUNCEMENT { "annoucement" }
2c. CPMSG_PRIVMSG { "username", "message" }
2c. CPMSG_PRIVMSG { "username", "message" }
Line 48: Line 48:


'''Notes'''
'''Notes'''
''Why send your own username?'' --[[User:Bjørn|Bjørn]] 12:44, 26 July 2006 (CEST)


''Maybe it would be nicer to have the annoucements and errors simply occur or special dedicated channels. This would make implementation easier. Also, I think it's fine to also send a username for these messages.'' --[[User:Bjørn|Bjørn]] 12:44, 26 July 2006 (CEST)
''Maybe it would be nicer to have the annoucements and errors simply occur or special dedicated channels. This would make implementation easier. Also, I think it's fine to also send a username for these messages.'' --[[User:Bjørn|Bjørn]] 12:44, 26 July 2006 (CEST)

Revision as of 18:44, 26 July 2006

Here be documented our own communication protocol. For the latest list of all messages and their contents, see defines.h.

Login sequence

1a. PAMSG_REGISTER { "version", "username", "password", "email" }
    APMSG_REGISTER_RESPONSE { 0 }

1b. PAMSG_LOGIN { "version", "username", "password" }
    APMSG_UNREGISTER_RESPONSE { 0 }

2a. PAMSG_UNREGISTER { }
    APMSG_UNREGISTER_RESPONSE { 0 }

2b. PAMSG_LOGOUT { }
    APMSG_LOGOUT_RESPONSE { 0 }

2c. PAMSG_CHAR_LIST { }
    APMSG_CHAR_LIST_RESPONSE B number, { B index, S name, B gender, B hair style, B hair color,
                                         B level, W money, W*6 stats, S mapname, W*2 position }

...

Notes

It has been decided that a separate request for the character list is not necessary. The list will be sent automatically after a succesful login.

We probably do not need the index byte for each character. The list can be assumed to be contiguous and characters can be referred to with the index they have in the list.

Why is the version a string? It's only for checking compatibility, right? --Bjørn 12:47, 26 July 2006 (CEST)

Movement and combat

Protocol in development, see article about the being movement system.

Chatting

1a. PCMSG_CHAT { "message", channel }
1b. PCMSG_ANNOUNCE { "annoucement" }
1c. PCMSG_PRIVMSG { "username", "message" }
2a. CPMSG_ERROR { error }
2b. CPMSG_ANNOUNCEMENT { "annoucement" }
2c. CPMSG_PRIVMSG { "username", "message" }
2d. CPMSG_PUBMSG { channel, "username", "message" }

Notes

Maybe it would be nicer to have the annoucements and errors simply occur or special dedicated channels. This would make implementation easier. Also, I think it's fine to also send a username for these messages. --Bjørn 12:44, 26 July 2006 (CEST)