Crossfire Server, Trunk
metaserver2.h
Go to the documentation of this file.
1
9
#ifndef METASERVER2_H
10
#define METASERVER2_H
11
12
/*
13
* The current implementation of crossfire is not very thread
14
* friendly/safe - in fact, metaserver2 is the first part to
15
* use an extra thread.
16
* As such, it would be a lot of work to add the necessary
17
* locks in the rest of the code for the metaserver2 to be able
18
* to get the data it needs. So instead, we use this
19
* MS2UpdateInfo structure to get the data from the main thread
20
* to the metaserver thread - basically, the main thread
21
* gets a lock on the mutex, updates the fields in this structure
22
* and releases the lock. The metaserver2 thread will
23
* get a lock when it needs to get this information, copy
24
* it to the post form, then unlock the structure.
25
* In that way, neither side holds the lock very long, which is especially
26
* important because the metaserver2 thread could take quite a while
27
* to do its updates.
28
*/
29
31
struct
MetaServer2_UpdateInfo
{
32
int
num_players
;
33
int
in_bytes
;
34
int
out_bytes
;
35
time_t
uptime
;
36
};
37
38
extern
MetaServer2_UpdateInfo
metaserver2_updateinfo
;
39
40
#endif
/* METASERVER2_H */
MetaServer2_UpdateInfo::num_players
int num_players
Definition:
metaserver2.h:32
MetaServer2_UpdateInfo::out_bytes
int out_bytes
Definition:
metaserver2.h:34
MetaServer2_UpdateInfo::uptime
time_t uptime
Definition:
metaserver2.h:35
MetaServer2_UpdateInfo
Definition:
metaserver2.h:31
metaserver2_updateinfo
MetaServer2_UpdateInfo metaserver2_updateinfo
Definition:
metaserver.cpp:139
MetaServer2_UpdateInfo::in_bytes
int in_bytes
Definition:
metaserver2.h:33
crossfire-crossfire-server
include
metaserver2.h
Generated by
1.8.17