Mercurial > hg > openttd
changeset 8789:3c4f7c030d5e draft
(svn r12499) -Codechange: some coding style tweaks for network_internal.h.
author | rubidium <rubidium@openttd.org> |
---|---|
date | Mon, 31 Mar 2008 07:11:18 +0000 |
parents | cb5ca4d081de |
children | 5ef0059ccfc0 |
files | projects/openttd_vs80.vcproj projects/openttd_vs90.vcproj source.list src/network/network_internal.h |
diffstat | 4 files changed, 76 insertions(+), 50 deletions(-) [+] |
line wrap: on
line diff
--- a/projects/openttd_vs80.vcproj +++ b/projects/openttd_vs80.vcproj @@ -932,7 +932,7 @@ > </File> <File - RelativePath=".\..\src\engine.h" + RelativePath=".\..\src\engine_func.h" > </File> <File @@ -1192,7 +1192,11 @@ > </File> <File - RelativePath=".\..\src\order.h" + RelativePath=".\..\src\order_base.h" + > + </File> + <File + RelativePath=".\..\src\order_func.h" > </File> <File @@ -1344,7 +1348,11 @@ > </File> <File - RelativePath=".\..\src\station.h" + RelativePath=".\..\src\station_base.h" + > + </File> + <File + RelativePath=".\..\src\station_func.h" > </File> <File
--- a/projects/openttd_vs90.vcproj +++ b/projects/openttd_vs90.vcproj @@ -929,7 +929,7 @@ > </File> <File - RelativePath=".\..\src\engine.h" + RelativePath=".\..\src\engine_func.h" > </File> <File @@ -1189,7 +1189,11 @@ > </File> <File - RelativePath=".\..\src\order.h" + RelativePath=".\..\src\order_base.h" + > + </File> + <File + RelativePath=".\..\src\order_func.h" > </File> <File @@ -1341,7 +1345,11 @@ > </File> <File - RelativePath=".\..\src\station.h" + RelativePath=".\..\src\station_base.h" + > + </File> + <File + RelativePath=".\..\src\station_func.h" > </File> <File
--- a/source.list +++ b/source.list @@ -141,7 +141,7 @@ economy_func.h economy_type.h core/endian_func.hpp -engine.h +engine_func.h engine_type.h core/enum_type.hpp fileio.h @@ -206,7 +206,8 @@ video/null_v.h oldpool.h openttd.h -order.h +order_base.h +order_func.h order_type.h core/overflowsafe_type.hpp pathfind.h @@ -244,7 +245,8 @@ sound_type.h sprite.h spritecache.h -station.h +station_base.h +station_func.h station_gui.h station_type.h stdafx.h
--- a/src/network/network_internal.h +++ b/src/network/network_internal.h @@ -10,58 +10,66 @@ #include "core/config.h" #include "core/game.h" -// If this line is enable, every frame will have a sync test -// this is not needed in normal games. Normal is like 1 sync in 100 -// frames. You can enable this if you have a lot of desyncs on a certain -// game. -// Remember: both client and server have to be compiled with this -// option enabled to make it to work. If one of the two has it disabled -// nothing will happen. +/** + * If this line is enable, every frame will have a sync test + * this is not needed in normal games. Normal is like 1 sync in 100 + * frames. You can enable this if you have a lot of desyncs on a certain + * game. + * Remember: both client and server have to be compiled with this + * option enabled to make it to work. If one of the two has it disabled + * nothing will happen. + */ //#define ENABLE_NETWORK_SYNC_EVERY_FRAME -// In theory sending 1 of the 2 seeds is enough to check for desyncs -// so in theory, this next define can be left off. +/** + * In theory sending 1 of the 2 seeds is enough to check for desyncs + * so in theory, this next define can be left off. + */ //#define NETWORK_SEND_DOUBLE_SEED -// How many clients can we have? Like.. MAX_PLAYERS - 1 is the amount of -// players that can really play.. so.. a max of 4 spectators.. gives us.. -// MAX_PLAYERS + 3 -#define MAX_CLIENTS (MAX_PLAYERS + 3) - -// Do not change this next line. It should _ALWAYS_ be MAX_CLIENTS + 1 -#define MAX_CLIENT_INFO (MAX_CLIENTS + 1) - -#define MAX_INTERFACES 9 +enum { + /** + * How many clients can we have? Like.. MAX_PLAYERS - 1 is the amount of + * players that can really play.. so.. a max of 4 spectators.. gives us.. + * MAX_PLAYERS + 3 + */ + MAX_CLIENTS = MAX_PLAYERS + 3, + /** Do not change this next line. It should _ALWAYS_ be MAX_CLIENTS + 1 */ + MAX_CLIENT_INFO = MAX_CLIENTS + 1, -// How many vehicle/station types we put over the network -#define NETWORK_VEHICLE_TYPES 5 -#define NETWORK_STATION_TYPES 5 + /** 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, +} struct NetworkPlayerInfo { - char company_name[NETWORK_NAME_LENGTH]; // Company name - char password[NETWORK_PASSWORD_LENGTH]; // The password for the player - Year inaugurated_year; // What year the company started in - Money company_value; // The company value - Money money; // The amount of money the company has - Money income; // How much did the company earned last year - uint16 performance; // What was his performance last month? - bool use_password; // Is there a password - uint16 num_vehicle[NETWORK_VEHICLE_TYPES]; // How many vehicles are there of this type? - uint16 num_station[NETWORK_STATION_TYPES]; // How many stations are there of this type? - char players[NETWORK_PLAYERS_LENGTH]; // The players that control this company (Name1, name2, ..) - uint16 months_empty; // How many months the company is empty + char company_name[NETWORK_NAME_LENGTH]; ///< Company name + char password[NETWORK_PASSWORD_LENGTH]; ///< The password for the player + Year inaugurated_year; ///< What year the company started in + Money company_value; ///< The company value + Money money; ///< The amount of money the company has + Money income; ///< How much did the company earned last year + uint16 performance; ///< What was his performance last month? + bool use_password; ///< Is there a password + uint16 num_vehicle[NETWORK_VEHICLE_TYPES]; ///< How many vehicles are there of this type? + uint16 num_station[NETWORK_STATION_TYPES]; ///< How many stations are there of this type? + char players[NETWORK_PLAYERS_LENGTH]; ///< The players that control this company (Name1, name2, ..) + uint16 months_empty; ///< How many months the company is empty }; struct NetworkClientInfo { - uint16 client_index; // Index of the client (same as ClientState->index) - char client_name[NETWORK_CLIENT_NAME_LENGTH]; // Name of the client - byte client_lang; // The language of the client - PlayerID client_playas; // As which player is this client playing (PlayerID) - uint32 client_ip; // IP-address of the client (so he can be banned) - Date join_date; // Gamedate the player has joined - char unique_id[NETWORK_UNIQUE_ID_LENGTH]; // Every play sends an unique id so we can indentify him + uint16 client_index; ///< Index of the client (same as ClientState->index) + char client_name[NETWORK_CLIENT_NAME_LENGTH]; ///< Name of the client + byte client_lang; ///< The language of the client + PlayerID client_playas; ///< As which player is this client playing (PlayerID) + uint32 client_ip; ///< IP-address of the client (so he can be banned) + Date join_date; ///< Gamedate the player has joined + char unique_id[NETWORK_UNIQUE_ID_LENGTH]; ///< Every play sends an unique id so we can indentify him }; enum NetworkJoinStatus { @@ -75,7 +83,7 @@ NETWORK_JOIN_STATUS_GETTING_COMPANY_INFO, }; -/* Language ids for server_lang and client_lang. Do NOT modify the order. */ +/** Language ids for server_lang and client_lang. Do NOT modify the order. */ enum NetworkLanguage { NETLANG_ANY = 0, NETLANG_ENGLISH,