| 1 |
/*
|
| 2 |
* Copyright (C) 1999 Mark Baysinger (mbaysing@ucsd.edu)
|
| 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 |
/*
|
| 22 |
*
|
| 23 |
* Here's how this works:
|
| 24 |
*
|
| 25 |
* Bnetd sends a UDP ClientPacket to each track server port on a regular basis.
|
| 26 |
* Simple.
|
| 27 |
*
|
| 28 |
*/
|
| 29 |
|
| 30 |
#ifdef TRACKER_INTERNAL_ACCESS
|
| 31 |
typedef struct
|
| 32 |
{
|
| 33 |
unsigned short packet_version; /* set to TRACK_VERSION, network byte order */
|
| 34 |
unsigned short port; /* port server is listening on, network byte order */
|
| 35 |
unsigned long flags; /* see below, network byte order */
|
| 36 |
char software[32]; /* example: Bnetd, NUL terminated */
|
| 37 |
char version[16]; /* example: 0.4, NUL terminated */
|
| 38 |
char platform[32]; /* Windows, Linux, etc., NUL terminated */
|
| 39 |
char server_desc[64]; /* description, NUL terminated */
|
| 40 |
char server_location[64]; /* geographical location, NUL terminated */
|
| 41 |
char server_url[96]; /* web address: http://..., NUL terminated */
|
| 42 |
char contact_name[64]; /* name of operator, NUL terminated */
|
| 43 |
char contact_email[64]; /* e-mail address of operator, NUL terminated */
|
| 44 |
unsigned long users; /* current number of users, network byte order */
|
| 45 |
unsigned long channels; /* current number of channels, network byte order */
|
| 46 |
unsigned long games; /* current number of games, network byte order */
|
| 47 |
unsigned long uptime; /* daemon uptime in seconds, network byte order */
|
| 48 |
unsigned long total_games; /* total number of games served */
|
| 49 |
unsigned long total_logins; /* total number of client logins */
|
| 50 |
|
| 51 |
/* new versions will add fields to end of packet */
|
| 52 |
} t_trackpacket;
|
| 53 |
|
| 54 |
/* packet_version */
|
| 55 |
#define TRACK_VERSION 2
|
| 56 |
|
| 57 |
/* flags */
|
| 58 |
#define TF_SHUTDOWN 0x1 /* send packet with this flag set when
|
| 59 |
* shutting down (Currently ignored) */
|
| 60 |
#define TF_PRIVATE 0x2 /* server is private and should not be
|
| 61 |
* listed (Currently ignored) */
|
| 62 |
#endif
|
| 63 |
|
| 64 |
#endif
|
| 65 |
|
| 66 |
|
| 67 |
/*****/
|
| 68 |
#ifndef JUST_NEED_TYPES
|
| 69 |
#ifndef INCLUDED_TRACKER_PROTOS
|
| 70 |
#define INCLUDED_TRACKER_PROTOS
|
| 71 |
|
| 72 |
#define JUST_NEED_TYPES
|
| 73 |
#include "addr.h"
|
| 74 |
#undef JUST_NEED_TYPES
|
| 75 |
|
| 76 |
extern int tracker_set_servers(char const * servers);
|
| 77 |
extern int tracker_send_report(t_addrlist const * addrs);
|
| 78 |
|
| 79 |
#endif
|
| 80 |
#endif
|