summaryrefslogtreecommitdiff
path: root/include/net_multiplayer.h
blob: 561a1a33821a5db47a10ac8a77bd018030bc3fee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

#ifndef NET_MULTIPLAYER_H

#define NET_MULTIPLAYER_H

#include "tux.h"
#include "item.h"
#include "buffer.h"
#include "arena.h"

#define NET_GAME_TYPE_NONE	0
#define NET_GAME_TYPE_SERVER	1
#define NET_GAME_TYPE_CLIENT	2

#define NET_STATUS_OK		0
#define NET_STATUS_ZOMBIE	1

#define  LIMIT_BUFFER 10240

typedef struct client_struct
{
	int socket;
	int status;

	tux_t *tux;
	buffer_t *buffer;
} client_t;

extern int initServer(int port);
extern int initClient(int port, char *ip);
extern void netSetArena(arena_t *p);
extern int getNetTypeGame();
extern void proto_send_settux(tux_t *p);
extern void proto_send_shottux(tux_t *p);
extern void proto_send_switchgun(tux_t *p);
extern void proto_send_additem(item_t *item);
extern void eventNetMultiplayer();
extern void quitNetMultiplayer();

#endif