Atrinik Client  4.0
main.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 MAIN_H
31 #define MAIN_H
32 
33 #define COLOR_BUF 7
34 
35 #define SDL_DEFAULT_REPEAT_INTERVAL 30
36 
37 /* For hash table (bmap, ...) */
38 #define MAXSTRING 20
39 
43 typedef struct server_cert_info {
44  char *name;
45  char *hostname;
46 
47  int port;
49 
50  char *ipv4_address;
51  char *ipv6_address;
52 
53  char *pubkey;
55 
57 typedef struct server_struct {
60 
63 
65  char *name;
66 
68  char *hostname;
69 
71  char *version;
72 
74  char *desc;
75 
77  int player;
78 
80  int port;
81 
84 
86  char *cert_pubkey;
87 
89  char *cert;
90 
95  unsigned char *cert_sig;
96 
100  size_t cert_sig_len;
101 
104 
106  bool is_meta:1;
107 } server_struct;
108 
119 #define METASERVER_GET_PUBKEY(server) \
120  ((server)->cert_info != NULL ? (server)->cert_info->pubkey : \
121  (server)->cert_pubkey)
122 
127 typedef struct msg_anim_struct {
129  char message[MAX_BUF];
130 
132  uint32_t tick;
133 
135  char color[COLOR_BUF];
137 
138 #define FILE_ATRINIK_P0 "data/atrinik.p0"
139 
140 /* Face requested from server - do it only one time */
141 #define FACE_REQUESTED 16
142 
143 typedef struct _face_struct {
144  /* Our face data. if != null, face is loaded */
145  struct sprite_struct *sprite;
146 
147  /* Our face name. if != null, face is requested */
148  char *name;
149 
150  /* Checksum of face */
151  uint32_t checksum;
152 
153  int flags;
154 } _face_struct;
155 
156 #define NUM_STATS 7
157 
158 typedef struct spell_entry_struct {
162  object *spell;
163 
167  uint16_t cost;
168 
172  uint32_t flags;
173 
177  uint32_t path;
178 
182  char msg[MAX_BUF];
184 
189 #define SPELL_PATH_NUM 21
190 
191 typedef struct skill_entry_struct {
192  object *skill;
193 
194  uint8_t level;
195 
196  int64_t exp;
197 
198  char msg[MAX_BUF];
200 
202 typedef struct _fire_mode {
204  int item;
205 
207  int amun;
208 
209  spell_entry_struct *spell;
210 
213 
215  char name[128];
216 } _fire_mode;
217 
221 typedef struct hfile_struct {
222  char *key;
223 
224  char *msg;
225 
226  size_t msg_len;
227 
228  uint8_t autocomplete;
229 
230  uint8_t autocomplete_wiz;
231 
232  UT_hash_handle hh;
233 } hfile_struct;
234 
238 typedef enum player_state_t {
243 
248 
253 
258 
263 
268 
273 
278 
283 
288 
293 
298 
303 
308 
313 
318 
323 
328 
334 
335 /* With this, we overrule bitmap loading params.
336  * For example, we need for fonts an attached palette, and not the native vid
337  * mode */
338 
341 #define SURFACE_FLAG_COLKEY_16M 2
342 #define SURFACE_FLAG_DISPLAYFORMAT 4
343 #define SURFACE_FLAG_DISPLAYFORMATALPHA 8
344 
345 /* For custom cursors */
346 enum {
347  MSCURSOR_MOVE = 1
348 };
349 
350 #define IS_ENTER(_keysym) ((_keysym) == SDLK_RETURN || (_keysym) == SDLK_KP_ENTER)
351 #define IS_NEXT(_keysym) ((_keysym) == SDLK_TAB || IS_ENTER((_keysym)))
352 
353 #endif
struct server_struct * next
Definition: main.h:59
struct _fire_mode _fire_mode
Definition: main.h:332
unsigned char * cert_sig
Definition: main.h:95
Definition: main.h:252
int item
Definition: main.h:204
char * hostname
Server hostname.
Definition: main.h:45
size_t cert_sig_len
Definition: main.h:100
struct hfile_struct hfile_struct
char * ipv4_address
IPv4 address. Can be NULL.
Definition: main.h:50
Definition: main.h:312
char * pubkey
Public key.
Definition: main.h:53
char * cert_pubkey
Definition: main.h:86
char msg[MAX_BUF]
Definition: main.h:182
uint32_t tick
Definition: main.h:132
int player
Definition: main.h:77
int amun
Definition: main.h:207
char message[MAX_BUF]
Definition: main.h:129
skill_entry_struct * skill
Definition: main.h:212
struct msg_anim_struct msg_anim_struct
char * name
Definition: main.h:65
char * version
Definition: main.h:71
Definition: main.h:158
char color[COLOR_BUF]
Definition: main.h:135
char * desc
Definition: main.h:74
struct server_struct server_struct
player_state_t
Definition: main.h:238
char * hostname
Definition: main.h:68
object * spell
Definition: main.h:162
struct server_struct * prev
Definition: main.h:62
Definition: main.h:242
char * cert
Definition: main.h:89
int port
Regular port.
Definition: main.h:47
uint32_t flags
Definition: main.h:172
server_cert_info_t * cert_info
Definition: main.h:103
char * ipv6_address
IPv6 address. Can be NULL.
Definition: main.h:51
Definition: main.h:247
uint32_t path
Definition: main.h:177
int port_crypto
Crypto port.
Definition: main.h:48
struct server_cert_info server_cert_info_t
int port
Definition: main.h:80
uint16_t cost
Definition: main.h:167
int port_crypto
Definition: main.h:83
Definition: main.h:191
char * name
Server name.
Definition: main.h:44
char name[128]
Definition: main.h:215
bool is_meta
Definition: main.h:106