|
Atrinik Client 2.5
|
#include <global.h>Go to the source code of this file.
Data Structures | |
| struct | CmdMapping |
Typedefs | |
| typedef void(* | CmdProc )(unsigned char *, int len) |
Enumerations | |
| enum | { BINARY_CMD_COMC = 1, BINARY_CMD_MAP2, BINARY_CMD_DRAWINFO, BINARY_CMD_DRAWINFO2, BINARY_CMD_FILE_UPD, BINARY_CMD_ITEMX, BINARY_CMD_SOUND, BINARY_CMD_TARGET, BINARY_CMD_UPITEM, BINARY_CMD_DELITEM, BINARY_CMD_STATS, BINARY_CMD_IMAGE, BINARY_CMD_FACE1, BINARY_CMD_ANIM, BINARY_CMD_SKILLRDY, BINARY_CMD_PLAYER, BINARY_CMD_MAPSTATS, BINARY_CMD_SPELL_LIST, BINARY_CMD_SKILL_LIST, BINARY_CMD_CLEAR, BINARY_CMD_ADDME_SUC, BINARY_CMD_ADDME_FAIL, BINARY_CMD_VERSION, BINARY_CMD_BYE, BINARY_CMD_SETUP, BINARY_CMD_QUERY, BINARY_CMD_DATA, BINARY_CMD_NEW_CHAR, BINARY_CMD_ITEMY, BINARY_CMD_BOOK, BINARY_CMD_PARTY, BINARY_CMD_QUICKSLOT, BINARY_CMD_SHOP, BINARY_CMD_QLIST, BINARY_CMD_REGION_MAP, BINARY_CMD_READY, BINARY_CMD_KEEPALIVE, BINAR_CMD } |
Functions | |
| void | DoClient () |
| void | SockList_Init (SockList *sl) |
| void | SockList_AddChar (SockList *sl, char c) |
| void | SockList_AddShort (SockList *sl, uint16 data) |
| void | SockList_AddInt (SockList *sl, uint32 data) |
| void | SockList_AddString (SockList *sl, char *data) |
| void | SockList_AddStringTerminated (SockList *sl, char *data) |
| int | GetInt_String (const unsigned char *data) |
| sint64 | GetInt64_String (const unsigned char *data) |
| short | GetShort_String (const unsigned char *data) |
| char * | GetString_String (uint8 *data, int *pos, char *dest, size_t dest_size) |
| int | cs_write_string (char *buf, size_t len) |
| void | check_animation_status (int anum) |
Variables | |
| Client_Player | cpl |
| ClientSocket | csocket |
| struct CmdMapping | commands [] |
Client interface main routine.
This file sets up a few global variables, connects to the server, tells it what kind of pictures it wants, adds the client and enters the main event loop (event_loop()) checks the tcp socket for input and then polls for x events. This should be fixed since you can just block on both filedescriptors.
The DoClient function receives a message (an ArgList), unpacks it, and in a slow for loop dispatches the command to the right function through the commands table. ArgLists are essentially like RPC things, only they don't require going through RPCgen, and it's easy to get variable length lists. They are just lists of longs, strings, characters, and byte arrays that can be converted to a machine independent format.
Definition in file client.c.
| typedef void(* CmdProc)(unsigned char *, int len) |
| void check_animation_status | ( | int | anum | ) |
| int cs_write_string | ( | char * | buf, |
| size_t | len | ||
| ) |
| void DoClient | ( | ) |
| sint64 GetInt64_String | ( | const unsigned char * | data | ) |
| int GetInt_String | ( | const unsigned char * | data | ) |
| short GetShort_String | ( | const unsigned char * | data | ) |
| char* GetString_String | ( | uint8 * | data, |
| int * | pos, | ||
| char * | dest, | ||
| size_t | dest_size | ||
| ) |
| void SockList_AddChar | ( | SockList * | sl, |
| char | c | ||
| ) |
| void SockList_AddString | ( | SockList * | sl, |
| char * | data | ||
| ) |
| void SockList_AddStringTerminated | ( | SockList * | sl, |
| char * | data | ||
| ) |
| void SockList_Init | ( | SockList * | sl | ) |
| struct CmdMapping commands[] |
1.7.4