diff options
Diffstat (limited to 'src/net/manaserv/manaserv_protocol.h')
-rw-r--r-- | src/net/manaserv/manaserv_protocol.h | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/src/net/manaserv/manaserv_protocol.h b/src/net/manaserv/manaserv_protocol.h index aa1976f1..5f94b726 100644 --- a/src/net/manaserv/manaserv_protocol.h +++ b/src/net/manaserv/manaserv_protocol.h @@ -26,7 +26,19 @@ namespace ManaServ { enum { PROTOCOL_VERSION = 1, - SUPPORTED_DB_VERSION = 19 + SUPPORTED_DB_VERSION = 21 +}; + +/** + * The type of a value in a message. Prepended before each value when the + * protocol is running in debug mode. + */ +enum ValueType { + Int8, + Int16, + Int32, + String, + Double }; /** @@ -43,7 +55,7 @@ enum { * Components: B byte, W word, D double word, S variable-size string * C tile-based coordinates (B*3) * - * Hosts: P (player's client), A (account server), C (char server), + * Hosts: P (player's client), A (account server), C (chat server), * G (game server) * * TODO - Document specific error codes for each packet @@ -127,8 +139,9 @@ enum { GPMSG_ITEMS = 0x0281, // { W item id, W*2 position }* PGMSG_ATTACK = 0x0290, // W being id GPMSG_BEING_ATTACK = 0x0291, // W being id, B direction, B attack Id - PGMSG_USE_SPECIAL = 0x0292, // B specialID + PGMSG_USE_SPECIAL_ON_BEING = 0x0292, // B specialID, W being id GPMSG_SPECIAL_STATUS = 0x0293, // { B specialID, D current, D max, D recharge } + PGMSG_USE_SPECIAL_ON_POINT = 0x0294, // B specialID, W*2 position PGMSG_SAY = 0x02A0, // S text GPMSG_SAY = 0x02A1, // W being id, S text GPMSG_NPC_CHOICE = 0x02B0, // W being id, { S text }* @@ -175,7 +188,7 @@ enum { CPMSG_GUILD_CREATE_RESPONSE = 0x0351, // B error, W guild, B rights, W channel PCMSG_GUILD_INVITE = 0x0352, // W id, S name CPMSG_GUILD_INVITE_RESPONSE = 0x0353, // B error - PCMSG_GUILD_ACCEPT = 0x0354, // W id + PCMSG_GUILD_ACCEPT = 0x0354, // W id, B accepted (0 if false, 1 if true) CPMSG_GUILD_ACCEPT_RESPONSE = 0x0355, // B error, W guild, B rights, W channel PCMSG_GUILD_GET_MEMBERS = 0x0356, // W id CPMSG_GUILD_GET_MEMBERS_RESPONSE = 0x0357, // S names, B online @@ -186,6 +199,7 @@ enum { CPMSG_GUILD_PROMOTE_MEMBER_RESPONSE = 0x0366, // B error PCMSG_GUILD_KICK_MEMBER = 0x0370, // W guild, S name CPMSG_GUILD_KICK_MEMBER_RESPONSE = 0x0371, // B error + CPMSG_GUILD_KICK_NOTIFICATION = 0x0372, // W guild, S player that kicked CPMSG_GUILD_INVITED = 0x0388, // S char name, S guild name, W id CPMSG_GUILD_REJOIN = 0x0389, // S name, W guild, W rights, W channel, S announce @@ -230,7 +244,7 @@ enum { // Inter-server GAMSG_REGISTER = 0x0500, // S address, W port, S password, D items db revision, { W map id }* - AGMSG_REGISTER_RESPONSE = 0x0501, // C item version, C password response, { S globalvar_key, S globalvar_value } + AGMSG_REGISTER_RESPONSE = 0x0501, // W item version, W password response, { S globalvar_key, S globalvar_value } AGMSG_ACTIVE_MAP = 0x0502, // W map id, W Number of mapvar_key mapvar_value sent, { S mapvar_key, S mapvar_value }, W Number of map items, { D item Id, W amount, W posX, W posY } AGMSG_PLAYER_ENTER = 0x0510, // B*32 token, D id, S name, serialised character data GAMSG_PLAYER_DATA = 0x0520, // D id, serialised character data @@ -250,7 +264,7 @@ enum { GAMSG_BAN_PLAYER = 0x0550, // D id, W duration GAMSG_CHANGE_PLAYER_LEVEL = 0x0555, // D id, W level GAMSG_CHANGE_ACCOUNT_LEVEL = 0x0556, // D id, W level - GAMSG_STATISTICS = 0x0560, // { W map id, W thing nb, W monster nb, W player nb, { D character id }* }* + GAMSG_STATISTICS = 0x0560, // { W map id, W entity nb, W monster nb, W player nb, { D character id }* }* CGMSG_CHANGED_PARTY = 0x0590, // D character id, D party id GCMSG_REQUEST_POST = 0x05A0, // D character id CGMSG_POST_RESPONSE = 0x05A1, // D receiver id, { S sender name, S letter, W num attachments { W attachment item id, W quantity } } @@ -261,7 +275,8 @@ enum { GAMSG_REMOVE_ITEM_ON_MAP = 0x0602, // D map id, D item id, W amount, W pos x, W pos y GAMSG_ANNOUNCE = 0x0603, // S text, W senderid, S sendername - XXMSG_INVALID = 0x7FFF + XXMSG_DEBUG_FLAG = 0x8000, // Message in debug mode + XXMSG_INVALID = 0x7FFF }; // Generic return values @@ -278,7 +293,8 @@ enum { ERRMSG_SERVER_FULL, // the server is overloaded ERRMSG_TIME_OUT, // data failed to arrive in due time ERRMSG_LIMIT_REACHED, // limit reached - ERRMSG_ADMINISTRATIVE_LOGOFF // kicked by server administrator + ERRMSG_ADMINISTRATIVE_LOGOFF, // kicked by server administrator + ERRMSG_ALREADY_MEMBER // is already member of guild/party }; // used in AGMSG_REGISTER_RESPONSE to show state of item db @@ -337,8 +353,8 @@ enum AttribmodResponseCode { ATTRIBMOD_DENIED }; -// Object type enumeration -enum ThingType +// Entity type enumeration +enum EntityType { // A simple item. OBJECT_ITEM = 0, |