summaryrefslogtreecommitdiff
path: root/src/network/network_type.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-12-22 12:59:31 +0000
committerrubidium <rubidium@openttd.org>2008-12-22 12:59:31 +0000
commit782b80eff755afcf7d4b3c5f9237bc65457b4e16 (patch)
treebb6d8bbfd056eeed669e31e87f2c987bc038a42a /src/network/network_type.h
parent8431174e88f1996f5bedce8128d4f91fa20edcf3 (diff)
downloadopenttd-782b80eff755afcf7d4b3c5f9237bc65457b4e16.tar.xz
(svn r14709) -Codechange: make a clearer distinction between 'unique' client identification ids and the indices into the clients/client info arrays.
Diffstat (limited to 'src/network/network_type.h')
-rw-r--r--src/network/network_type.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/network/network_type.h b/src/network/network_type.h
index c26c84738..1f14607d8 100644
--- a/src/network/network_type.h
+++ b/src/network/network_type.h
@@ -20,18 +20,25 @@ enum {
*/
MAX_CLIENTS = MAX_COMPANIES + 3,
- /** Do not change this next line. It should _ALWAYS_ be MAX_CLIENTS + 1 */
- MAX_CLIENT_INFO = MAX_CLIENTS + 1,
-
/** Maximum number of internet interfaces supported. */
MAX_INTERFACES = 9,
/** How many vehicle/station types we put over the network */
NETWORK_VEHICLE_TYPES = 5,
NETWORK_STATION_TYPES = 5,
+};
- NETWORK_SERVER_INDEX = 1,
- NETWORK_EMPTY_INDEX = 0,
+/** 'Unique' identifier to be given to clients */
+enum ClientID {
+ INVALID_CLIENT_ID = 0, ///< Client is not part of anything
+ CLIENT_ID_SERVER = 1, ///< Servers always have this ID
+ CLIENT_ID_FIRST = 2, ///< The first client ID
+};
+
+/** Indices into the client tables */
+enum ClientIndex {
+ /** Do not change this next line. It should _ALWAYS_ be MAX_CLIENTS + 1 */
+ MAX_CLIENT_INFO = MAX_CLIENTS + 1,
};
struct NetworkCompanyInfo {
@@ -50,7 +57,7 @@ struct NetworkCompanyInfo {
};
struct NetworkClientInfo {
- uint16 client_index; ///< Index of the client (same as ClientState->index)
+ ClientID client_id; ///< Client identifier (same as ClientState->client_id)
char client_name[NETWORK_CLIENT_NAME_LENGTH]; ///< Name of the client
byte client_lang; ///< The language of the client
CompanyID client_playas; ///< As which company is this client playing (CompanyID)