-
Notifications
You must be signed in to change notification settings - Fork 10
/
tracker.h
58 lines (48 loc) · 994 Bytes
/
tracker.h
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
#ifndef __TRACKER__
#define __TRACKER__
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#define TRACKERPORT (40000)
#define TRACKERIDENT ("XBOLOTRK")
#define TRACKERVERSION (0)
#define TRKPLYRNAMELEN (16)
#define TRKMAPNAMELEN (32)
/* tracker server msgs */
enum {
kTrackerVersionOK,
kTrackerVersionErr,
} ;
enum {
kTrackerTCPPortOK,
kTrackerTCPPortClosed,
} ;
enum {
kTrackerUDPPortOK,
kTrackerUDPPortClosed,
} ;
/* tracker client msgs */
enum {
kTrackerHost,
kTrackerList,
} ;
struct TRACKER_Preamble {
uint8_t ident[8]; /* "XBOLOTRK" */
uint8_t version; /* currently 0 */
} ;
struct TrackerHost {
uint8_t playername[TRKPLYRNAMELEN];
uint8_t mapname[TRKMAPNAMELEN];
uint16_t port;
uint8_t gametype;
uint32_t timelimit;
uint8_t passreq;
uint8_t nplayers;
uint8_t allowjoin;
uint8_t pause;
} ;
struct TrackerHostList {
struct in_addr addr;
struct TrackerHost game;
} ;
#endif /* __TRACKER__ */