Debian Codegraph @

src/common/tracker.h

raw symbols SCIP
1 /*
2 * Copyright (C) 1999 Mark Baysinger ([email protected])
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18 #ifndef INCLUDED_TRACKER_TYPES
19 #define INCLUDED_TRACKER_TYPES
20
21 #ifdef TRACKER_INTERNAL_ACCESS
22 #ifdef JUST_NEED_TYPES
23 #include "common/bn_type.h"
24 #else
25 #define JUST_NEED_TYPES
26 #include "common/bn_type.h"
27 #undef JUST_NEED_TYPES
28 #endif
29 #endif
30
31 namespace pvpgn
32 {
33
34 /*
35 *
36 * Here's how this works:
37 *
38 * Bnetd sends a UDP ClientPacket to each track server port on a regular basis.
39 * Simple.
40 *
41 */
42
43 #ifdef TRACKER_INTERNAL_ACCESS
44 typedef struct
45 {
46 bn_short packet_version; /* set to TRACK_VERSION, network byte order */
47 bn_short port; /* port server is listening on, network byte order */
48 bn_int flags; /* see below, network byte order */
49 bn_byte software[32]; /* example: Bnetd, NUL terminated */
50 bn_byte version[16]; /* example: 0.4, NUL terminated */
51 bn_byte platform[32]; /* Windows, Linux, etc., NUL terminated */
52 bn_byte server_desc[64]; /* description, NUL terminated */
53 bn_byte server_location[64]; /* geographical location, NUL terminated */
54 bn_byte server_url[96]; /* web address: http://..., NUL terminated */
55 bn_byte contact_name[64]; /* name of operator, NUL terminated */
56 bn_byte contact_email[64]; /* e-mail address of operator, NUL terminated */
57 bn_int users; /* current number of users, network byte order */
58 bn_int channels; /* current number of channels, network byte order */
59 bn_int games; /* current number of games, network byte order */
60 bn_int uptime; /* daemon uptime in seconds, network byte order */
61 bn_int total_games; /* total number of games served */
62 bn_int total_logins; /* total number of client logins */
63
64 /* new versions will add fields to end of packet */
65 } t_trackpacket;
66
67 /* packet_version */
68 #define TRACK_VERSION 2
69
70 /* flags */
71 #define TF_SHUTDOWN 0x1 /* send packet with this flag set when
72 * shutting down (Currently ignored) */
73 #define TF_PRIVATE 0x2 /* server is private and should not be
74 * listed (Currently ignored) */
75 #endif
76
77 }
78
79 #endif