]> git.lizzy.rs Git - dragonblocks_alpha.git/blob - src/network.h
4ae343d624362876b665804948906c97d0fe1af0
[dragonblocks_alpha.git] / src / network.h
1 #ifndef _NETWORK_H_
2 #define _NETWORK_H_
3
4 #include <stdbool.h>
5 #define PLAYER_NAME_MAX 64
6
7 typedef enum
8 {
9         CS_CREATED = 0x01,
10         CS_AUTH = 0x02,
11         CS_ACTIVE = 0x04,
12         CS_DISCONNECTED = 0x08,
13 } ClientState;
14
15 struct Client;
16
17 typedef struct {
18         bool (*func)(struct Client *client, bool good);
19         const char *name;
20         int state_flags;
21 } CommandHandler;
22
23 extern CommandHandler command_handlers[];
24
25 bool send_command(struct Client *client, RemoteCommand cmd);
26
27 #endif