Crossfire Client, Branches
R11627
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
metaserver.h
Go to the documentation of this file.
1
/* char *rcsid_common_metaserver_h =
2
* "$Id: metaserver.h 6927 2007-08-15 07:07:19Z mwedel $";
3
*/
4
5
/*
6
Crossfire client, a client program for the crossfire program.
7
8
Copyright (C) 2005 Mark Wedel & Crossfire Development Team
9
10
This program is free software; you can redistribute it and/or modify
11
it under the terms of the GNU General Public License as published by
12
the Free Software Foundation; either version 2 of the License, or
13
(at your option) any later version.
14
15
This program is distributed in the hope that it will be useful,
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
GNU General Public License for more details.
19
20
You should have received a copy of the GNU General Public License
21
along with this program; if not, write to the Free Software
22
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23
24
The author can be reached via e-mail to crossfire-devel@real-time.com
25
*/
26
27
28
/* Arbitrary size. At some point, we would need to cut this off simply
29
* for display/selection reasons.
30
*/
31
#define MAX_METASERVER 100
32
33
/* Various constants we use in the structure */
34
#define MS_SMALL_BUF 60
35
#define MS_LARGE_BUF 512
36
46
typedef
struct
Meta_Info
{
47
char
ip_addr
[
MS_SMALL_BUF
];
/* MS1 */
48
char
hostname
[
MS_LARGE_BUF
];
/* MS1 & MS2 */
49
int
port
;
/* MS2 - port server is on */
50
char
html_comment
[
MS_LARGE_BUF
];
/* MS2 */
51
char
text_comment
[
MS_LARGE_BUF
];
/* MS1 & MS2 - for MS1, presumed */
52
/* all comments are text */
53
char
archbase
[
MS_SMALL_BUF
];
/* MS2 */
54
char
mapbase
[
MS_SMALL_BUF
];
/* MS2 */
55
char
codebase
[
MS_SMALL_BUF
];
/* MS2 */
56
char
flags
[
MS_SMALL_BUF
];
/* MS2 */
57
int
num_players
;
/* MS1 & MS2 */
58
uint32
in_bytes
;
/* MS2 */
59
uint32
out_bytes
;
/* MS2 */
60
int
idle_time
;
/* MS1 - for MS2, calculated from */
61
/* last_update value */
62
int
uptime
;
/* MS2 */
63
char
version
[
MS_SMALL_BUF
];
/* MS1 & MS2 */
64
int
sc_version
;
/* MS2 */
65
int
cs_version
;
/* MS2 */
66
}
Meta_Info
;
67
68
extern
Meta_Info
*
meta_servers
;
69
70
/* Before accessing the metaservers structure,
71
* a lock against this is needed
72
*/
73
extern
pthread_mutex_t
ms2_info_mutex
;
74
75
/* Needs to be here because gtk2 client needs to resort for example */
76
static
int
meta_sort
(
Meta_Info
*m1,
Meta_Info
*m2) {
return
strcasecmp(m1->
hostname
, m2->
hostname
); }
77
78
extern
int
meta_numservers
;
79
80
extern
int
cached_servers_num
;
81
82
#define CACHED_SERVERS_MAX 10
83
extern
char
*
cached_servers_name
[
CACHED_SERVERS_MAX
];
84
extern
char
*
cached_servers_ip
[
CACHED_SERVERS_MAX
];
85
extern
const
char
*
cached_server_file
;
MS_LARGE_BUF
#define MS_LARGE_BUF
Definition:
metaserver.h:35
Meta_Info::sc_version
int sc_version
Definition:
metaserver.h:64
cached_server_file
const char * cached_server_file
Definition:
metaserver.c:107
meta_numservers
int meta_numservers
Definition:
metaserver.c:57
Meta_Info::port
int port
Definition:
metaserver.h:49
Meta_Info::cs_version
int cs_version
Definition:
metaserver.h:65
Meta_Info::uptime
int uptime
Definition:
metaserver.h:62
Meta_Info::codebase
char codebase[MS_SMALL_BUF]
Definition:
metaserver.h:55
Meta_Info::hostname
char hostname[MS_LARGE_BUF]
Definition:
metaserver.h:48
CACHED_SERVERS_MAX
#define CACHED_SERVERS_MAX
Definition:
metaserver.h:82
Meta_Info::text_comment
char text_comment[MS_LARGE_BUF]
Definition:
metaserver.h:51
cached_servers_num
int cached_servers_num
Definition:
metaserver.c:103
cached_servers_ip
char * cached_servers_ip[CACHED_SERVERS_MAX]
Definition:
metaserver.c:105
Meta_Info
Definition:
metaserver.h:46
meta_servers
Meta_Info * meta_servers
Definition:
metaserver.c:55
Meta_Info::archbase
char archbase[MS_SMALL_BUF]
Definition:
metaserver.h:53
cached_servers_name
char * cached_servers_name[CACHED_SERVERS_MAX]
Definition:
metaserver.c:104
Meta_Info
struct Meta_Info Meta_Info
meta_sort
static int meta_sort(Meta_Info *m1, Meta_Info *m2)
Definition:
metaserver.h:76
Meta_Info::flags
char flags[MS_SMALL_BUF]
Definition:
metaserver.h:56
Meta_Info::ip_addr
char ip_addr[MS_SMALL_BUF]
Definition:
metaserver.h:47
Meta_Info::html_comment
char html_comment[MS_LARGE_BUF]
Definition:
metaserver.h:50
Meta_Info::num_players
int num_players
Definition:
metaserver.h:57
Meta_Info::out_bytes
uint32 out_bytes
Definition:
metaserver.h:59
uint32
unsigned int uint32
Definition:
client-types.h:77
Meta_Info::in_bytes
uint32 in_bytes
Definition:
metaserver.h:58
Meta_Info::mapbase
char mapbase[MS_SMALL_BUF]
Definition:
metaserver.h:54
MS_SMALL_BUF
#define MS_SMALL_BUF
Definition:
metaserver.h:34
Meta_Info::idle_time
int idle_time
Definition:
metaserver.h:60
Meta_Info::version
char version[MS_SMALL_BUF]
Definition:
metaserver.h:63
ms2_info_mutex
pthread_mutex_t ms2_info_mutex
Definition:
metaserver.c:171
crossfire-code
client
branches
1.12
common
metaserver.h
Generated on Fri Nov 16 2018 02:05:34 for Crossfire Client, Branches by
1.8.6