Atrinik Client  4.0
client.h
Go to the documentation of this file.
1 /*************************************************************************
2  * Atrinik, a Multiplayer Online Role Playing Game *
3  * *
4  * Copyright (C) 2009-2014 Alex Tokar and Atrinik Development Team *
5  * *
6  * Fork from Crossfire (Multiplayer game for X-windows). *
7  * *
8  * This program is free software; you can redistribute it and/or modify *
9  * it under the terms of the GNU General Public License as published by *
10  * the Free Software Foundation; either version 2 of the License, or *
11  * (at your option) any later version. *
12  * *
13  * This program is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16  * GNU General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU General Public License *
19  * along with this program; if not, write to the Free Software *
20  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
21  * *
22  * The author can be reached at admin@atrinik.org *
23  ************************************************************************/
24 
30 #ifndef CLIENT_H
31 #define CLIENT_H
32 
33 /* How many skill types server supports/client will get sent to it.
34  * If more skills are added to server, this needs to get increased. */
35 #define MAX_SKILL 6
36 
37 #define INPUT_MODE_NO 0
38 #define INPUT_MODE_CONSOLE 1
39 #define INPUT_MODE_NUMBER 2
40 
41 #define NUM_MODE_GET 1
42 #define NUM_MODE_DROP 2
43 
44 typedef struct Animations {
45  /* 0 = all fields are invalid, 1 = anim is loaded */
46  int loaded;
47 
48  /* Length of one a animation frame (num_anim / facings) */
49  int frame;
50  uint16_t *faces;
51 
52  /* Number of frames */
53  uint8_t facings;
54 
55  /* Number of animations. Value of 2 means
56  * only faces[0], [1] have meaningful values. */
57  uint8_t num_animations;
58  uint8_t flags;
59 } Animations;
60 
61 typedef struct _anim_table {
62  /* Length of anim_cmd data */
63  size_t len;
64 
65  /* Faked animation command */
66  uint8_t *anim_cmd;
67 } _anim_table;
68 
72 typedef struct command_buffer {
75 
78 
80  size_t len;
81 
83  uint8_t data[1];
85 
86 /* ClientSocket could probably hold more of the global values - it could
87  * probably hold most all socket/communication related values instead
88  * of globals. */
89 typedef struct client_socket {
90  socket_t *sc;
92 
94 #define SDL_color_copy(_color, _color2) \
95  { \
96  (_color)->r = (_color2)->r; \
97  (_color)->g = (_color2)->g; \
98  (_color)->b = (_color2)->b; \
99  }
100 
101 typedef struct socket_command_struct {
102  void (*handle_func)(uint8_t *data, size_t len, size_t pos);
104 
110 #define SPELL_DESC_TOWN 0x01
111 
112 #define SPELL_DESC_DIRECTION 0x02
113 
114 #define SPELL_DESC_SELF 0x04
115 
116 #define SPELL_DESC_FRIENDLY 0x08
117 
118 #define SPELL_DESC_ENEMY 0x10
119 
123  char **servers;
124 
125  size_t servers_num;
126 
127  char **metaservers;
128 
129  size_t metaservers_num;
130 
131  char *connect[4];
132 
133  char *game_news_url;
134 
135  uint8_t reconnect;
137 
138 #endif
uint8_t data[1]
Definition: client.h:83
size_t len
Definition: client.h:80
struct command_buffer command_buffer
struct command_buffer * next
Definition: client.h:74
struct command_buffer * prev
Definition: client.h:77