author | rubidium |
Wed, 07 Mar 2007 12:11:48 +0000 | |
changeset 6248 | e4a2ed7e5613 |
parent 6121 | 2aae24b0881f |
child 8140 | 0d0d8c94f84b |
permissions | -rw-r--r-- |
5469
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
1 |
/* $Id$ */ |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
2 |
|
6121
2aae24b0881f
(svn r8857) -Documentation: Added some doxygen @file tags, repaired others (the @file tag MUST be found before any line of code, that includes preprocessor directives).
celestar
parents:
5799
diff
changeset
|
3 |
/** |
2aae24b0881f
(svn r8857) -Documentation: Added some doxygen @file tags, repaired others (the @file tag MUST be found before any line of code, that includes preprocessor directives).
celestar
parents:
5799
diff
changeset
|
4 |
* @file game.h Information about a game that is sent between a |
2aae24b0881f
(svn r8857) -Documentation: Added some doxygen @file tags, repaired others (the @file tag MUST be found before any line of code, that includes preprocessor directives).
celestar
parents:
5799
diff
changeset
|
5 |
* game server, game client and masterserver. |
2aae24b0881f
(svn r8857) -Documentation: Added some doxygen @file tags, repaired others (the @file tag MUST be found before any line of code, that includes preprocessor directives).
celestar
parents:
5799
diff
changeset
|
6 |
*/ |
2aae24b0881f
(svn r8857) -Documentation: Added some doxygen @file tags, repaired others (the @file tag MUST be found before any line of code, that includes preprocessor directives).
celestar
parents:
5799
diff
changeset
|
7 |
|
5469
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
8 |
#ifndef NETWORK_CORE_GAME_H |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
9 |
#define NETWORK_CORE_GAME_H |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
10 |
|
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
11 |
#ifdef ENABLE_NETWORK |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
12 |
|
5527
7a624281971a
(svn r7834) -Codechange: cleanup the includes of network/core a little; include headers in headers when the header needs types/constants defined in them.
rubidium
parents:
5475
diff
changeset
|
13 |
#include "config.h" |
7a624281971a
(svn r7834) -Codechange: cleanup the includes of network/core a little; include headers in headers when the header needs types/constants defined in them.
rubidium
parents:
5475
diff
changeset
|
14 |
#include "../../date.h" |
7a624281971a
(svn r7834) -Codechange: cleanup the includes of network/core a little; include headers in headers when the header needs types/constants defined in them.
rubidium
parents:
5475
diff
changeset
|
15 |
#include "../../newgrf_config.h" |
7a624281971a
(svn r7834) -Codechange: cleanup the includes of network/core a little; include headers in headers when the header needs types/constants defined in them.
rubidium
parents:
5475
diff
changeset
|
16 |
|
5469
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
17 |
/** |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
18 |
* This is the struct used by both client and server |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
19 |
* some fields will be empty on the client (like game_password) by default |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
20 |
* and only filled with data a player enters. |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
21 |
*/ |
6248
e4a2ed7e5613
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents:
6121
diff
changeset
|
22 |
struct NetworkGameInfo { |
5469
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
23 |
byte game_info_version; ///< Version of the game info |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
24 |
char server_name[NETWORK_NAME_LENGTH]; ///< Server name |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
25 |
char hostname[NETWORK_HOSTNAME_LENGTH]; ///< Hostname of the server (if any) |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
26 |
char server_revision[NETWORK_REVISION_LENGTH]; ///< The version number the server is using (e.g.: 'r304' or 0.5.0) |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
27 |
bool version_compatible; ///< Can we connect to this server or not? (based on server_revision) |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
28 |
bool compatible; ///< Can we connect to this server or not? (based on server_revision _and_ grf_match |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
29 |
byte server_lang; ///< Language of the server (we should make a nice table for this) |
5799
29f786132792
(svn r8361) -Codechange: make sure the range of the dates coming from the network are valid in OpenTTD
rubidium
parents:
5527
diff
changeset
|
30 |
bool use_password; ///< Is this server passworded? |
5469
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
31 |
char server_password[NETWORK_PASSWORD_LENGTH]; ///< On the server: the game password, on the client: != "" if server has password |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
32 |
byte clients_max; ///< Max clients allowed on server |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
33 |
byte clients_on; ///< Current count of clients on server |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
34 |
byte companies_max; ///< Max companies allowed on server |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
35 |
byte companies_on; ///< How many started companies do we have |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
36 |
byte spectators_max; ///< Max spectators allowed on server |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
37 |
byte spectators_on; ///< How many spectators do we have? |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
38 |
Date game_date; ///< Current date |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
39 |
Date start_date; ///< When the game started |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
40 |
char map_name[NETWORK_NAME_LENGTH]; ///< Map which is played ["random" for a randomized map] |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
41 |
uint16 map_width; ///< Map width |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
42 |
uint16 map_height; ///< Map height |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
43 |
byte map_set; ///< Graphical set |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
44 |
bool dedicated; ///< Is this a dedicated server? |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
45 |
char rcon_password[NETWORK_PASSWORD_LENGTH]; ///< RCon password for the server. "" if rcon is disabled |
6248
e4a2ed7e5613
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents:
6121
diff
changeset
|
46 |
GRFConfig *grfconfig; ///< List of NewGRF files used |
e4a2ed7e5613
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents:
6121
diff
changeset
|
47 |
}; |
5469
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
48 |
|
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
49 |
#endif /* ENABLE_NETWORK */ |
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
50 |
|
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff
changeset
|
51 |
#endif /* NETWORK_CORE_GAME_H */ |