rubidium@5469: /* $Id$ */ rubidium@5469: celestar@6121: /** celestar@6121: * @file game.h Information about a game that is sent between a celestar@6121: * game server, game client and masterserver. celestar@6121: */ celestar@6121: rubidium@5469: #ifndef NETWORK_CORE_GAME_H rubidium@5469: #define NETWORK_CORE_GAME_H rubidium@5469: rubidium@5469: #ifdef ENABLE_NETWORK rubidium@5469: rubidium@5527: #include "config.h" rubidium@5527: #include "../../date.h" rubidium@5527: #include "../../newgrf_config.h" rubidium@5527: rubidium@5469: /** rubidium@5469: * This is the struct used by both client and server rubidium@5469: * some fields will be empty on the client (like game_password) by default rubidium@5469: * and only filled with data a player enters. rubidium@5469: */ rubidium@6248: struct NetworkGameInfo { rubidium@5469: byte game_info_version; ///< Version of the game info rubidium@5469: char server_name[NETWORK_NAME_LENGTH]; ///< Server name rubidium@5469: char hostname[NETWORK_HOSTNAME_LENGTH]; ///< Hostname of the server (if any) rubidium@5469: char server_revision[NETWORK_REVISION_LENGTH]; ///< The version number the server is using (e.g.: 'r304' or 0.5.0) rubidium@5469: bool version_compatible; ///< Can we connect to this server or not? (based on server_revision) rubidium@5469: bool compatible; ///< Can we connect to this server or not? (based on server_revision _and_ grf_match rubidium@5469: byte server_lang; ///< Language of the server (we should make a nice table for this) rubidium@5799: bool use_password; ///< Is this server passworded? rubidium@5469: char server_password[NETWORK_PASSWORD_LENGTH]; ///< On the server: the game password, on the client: != "" if server has password rubidium@5469: byte clients_max; ///< Max clients allowed on server rubidium@5469: byte clients_on; ///< Current count of clients on server rubidium@5469: byte companies_max; ///< Max companies allowed on server rubidium@5469: byte companies_on; ///< How many started companies do we have rubidium@5469: byte spectators_max; ///< Max spectators allowed on server rubidium@5469: byte spectators_on; ///< How many spectators do we have? rubidium@5469: Date game_date; ///< Current date rubidium@5469: Date start_date; ///< When the game started rubidium@5469: char map_name[NETWORK_NAME_LENGTH]; ///< Map which is played ["random" for a randomized map] rubidium@5469: uint16 map_width; ///< Map width rubidium@5469: uint16 map_height; ///< Map height rubidium@5469: byte map_set; ///< Graphical set rubidium@5469: bool dedicated; ///< Is this a dedicated server? rubidium@5469: char rcon_password[NETWORK_PASSWORD_LENGTH]; ///< RCon password for the server. "" if rcon is disabled rubidium@6248: GRFConfig *grfconfig; ///< List of NewGRF files used rubidium@6248: }; rubidium@5469: rubidium@5469: #endif /* ENABLE_NETWORK */ rubidium@5469: rubidium@5469: #endif /* NETWORK_CORE_GAME_H */