From 182b5231ba13a0a5865a1b7dcb4731c3009d4c57 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Mon, 3 Jan 2005 16:13:12 +0000 Subject: Some indent, comment and const parameter changes. --- src/net/protocol.h | 53 +++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 10 deletions(-) (limited to 'src/net/protocol.h') diff --git a/src/net/protocol.h b/src/net/protocol.h index 374024e3..3a46e91f 100644 --- a/src/net/protocol.h +++ b/src/net/protocol.h @@ -17,14 +17,16 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id$ */ +#ifndef _TMW_PROTOCOL_H +#define _TMW_PROTOCOL_H + #ifdef WIN32 #pragma warning (disable:4312) #endif - -#ifndef _TMW_PROTOCOL_H -#define _TMW_PROTOCOL_H #include "../main.h" #include "../being.h" @@ -38,21 +40,52 @@ #endif +/** Packet length by id */ short get_length(short id); -unsigned short get_x(char *data); -unsigned short get_y(char *data); -unsigned char get_direction(char *data); -unsigned short get_src_x(char *data); -unsigned short get_src_y(char *data); + +/** Decodes x coord */ +unsigned short get_x(const char *data); + +/** Decodes y coord */ +unsigned short get_y(const char *data); + +/** Decodes direction */ +unsigned char get_direction(const char *data); + +/** Decodes src x coord */ +unsigned short get_src_x(const char *data); + +/** Decodes src y coord */ +unsigned short get_src_y(const char *data); + +/** Decodes src direction */ unsigned char get_src_direction(char data); -unsigned short get_dest_x(char *data); -unsigned short get_dest_y(char *data); + +/** Decodes dest x coord */ +unsigned short get_dest_x(const char *data); + +/** Decodes dest y coord */ +unsigned short get_dest_y(const char *data); + +/** Decodes dest direction */ unsigned char get_dest_direction(char data); + +/** Encodes coords and direction in 3 bytes data */ void set_coordinates(char *data, unsigned short x, unsigned short y, unsigned char direction); + +/** Initialize connection with map server */ void map_start(); + +/** Requests to walk */ void walk(unsigned short x, unsigned short y, unsigned char direction); + +/** Request to speak */ void speak(char *speech); + +/** Request to attack */ void attack(unsigned short x, unsigned short y, unsigned char direction); + +/** Request action */ void action(char type, int id); #endif -- cgit v1.2.3-60-g2f50