blob: d109224c0a3fe6ce0f3b4bcd9c68d4c4d22456c4 (
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
#ifndef MY_SERVER
#define MY_SERVER
#include <time.h>
#include "list.h"
#include "tux.h"
#include "myTimer.h"
#include "protect.h"
#include "buffer.h"
#ifndef PUBLIC_SERVER
#include "interface.h"
#endif
#include "udp.h"
#define SERVER_TIMEOUT 1000
#define SERVER_TIME_SYNC 1000
#define SERVER_TIME_PING 1000
#define SERVER_MAX_CLIENTS 100
#define SERVER_INDEX_ROOT_TUX 0
#define CLIENT_TYPE_UDP 1
#define CLIENT_TYPE_TCP 2
typedef struct client_struct
{
int type;
sock_udp_t *socket_udp;
buffer_t *recvBuffer;
buffer_t *sendBuffer;
int status;
tux_t *tux;
protect_t *protect;
list_t *listSendMsg;
list_t *listRecvMsg;
list_t *listSeesShot;
} client_t;
extern int initServer(char *ip4, int port4, char *ip6, int port6);
extern time_t getUpdateServer();
extern client_t* newAnyClient();
extern void destroyAnyClient(client_t *p);
extern list_t* getListServerClient();
extern int getServerMaxClients();
extern void setServerTimer();
extern void setServerMaxClients(int n);
extern void sendClient(client_t *p, char *msg);
extern void eventServer();
extern void quitServer();
#endif
|