From 459514afe4f550a08d98958745d6cd8311c53fdd Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 17 Oct 2010 17:38:41 +0000 Subject: (svn r20972) -Add: company statistics updates at intervals to remote admins (dihedral) --- src/network/core/tcp_admin.cpp | 2 ++ src/network/core/tcp_admin.h | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) (limited to 'src/network/core') diff --git a/src/network/core/tcp_admin.cpp b/src/network/core/tcp_admin.cpp index 7d5b37c2d..0d2d09fdd 100644 --- a/src/network/core/tcp_admin.cpp +++ b/src/network/core/tcp_admin.cpp @@ -74,6 +74,7 @@ NetworkRecvStatus NetworkAdminSocketHandler::HandlePacket(Packet *p) ADMIN_COMMAND(ADMIN_PACKET_SERVER_COMPANY_UPDATE) ADMIN_COMMAND(ADMIN_PACKET_SERVER_COMPANY_REMOVE) ADMIN_COMMAND(ADMIN_PACKET_SERVER_COMPANY_ECONOMY) + ADMIN_COMMAND(ADMIN_PACKET_SERVER_COMPANY_STATS) default: if (this->HasClientQuit()) { @@ -143,5 +144,6 @@ DEFINE_UNAVAILABLE_ADMIN_RECEIVE_COMMAND(ADMIN_PACKET_SERVER_COMPANY_INFO) DEFINE_UNAVAILABLE_ADMIN_RECEIVE_COMMAND(ADMIN_PACKET_SERVER_COMPANY_UPDATE) DEFINE_UNAVAILABLE_ADMIN_RECEIVE_COMMAND(ADMIN_PACKET_SERVER_COMPANY_REMOVE) DEFINE_UNAVAILABLE_ADMIN_RECEIVE_COMMAND(ADMIN_PACKET_SERVER_COMPANY_ECONOMY) +DEFINE_UNAVAILABLE_ADMIN_RECEIVE_COMMAND(ADMIN_PACKET_SERVER_COMPANY_STATS) #endif /* ENABLE_NETWORK */ diff --git a/src/network/core/tcp_admin.h b/src/network/core/tcp_admin.h index c13d37a1b..15f3ba0a7 100644 --- a/src/network/core/tcp_admin.h +++ b/src/network/core/tcp_admin.h @@ -50,6 +50,7 @@ enum PacketAdminType { ADMIN_PACKET_SERVER_COMPANY_UPDATE, ///< The server gives the admin an information update on a company. ADMIN_PACKET_SERVER_COMPANY_REMOVE, ///< The server tells the admin that a company was removed. ADMIN_PACKET_SERVER_COMPANY_ECONOMY, ///< The server gives the admin some economy related company information. + ADMIN_PACKET_SERVER_COMPANY_STATS, ///< The server gives the admin some statistics about a company. INVALID_ADMIN_PACKET = 0xFF, ///< An invalid marker for admin packets. }; @@ -67,6 +68,7 @@ enum AdminUpdateType { ADMIN_UPDATE_CLIENT_INFO, ///< Updates about the information of clients. ADMIN_UPDATE_COMPANY_INFO, ///< Updates about the generic information of companies. ADMIN_UPDATE_COMPANY_ECONOMY, ///< Updates about the economy of companies. + ADMIN_UPDATE_COMPANY_STATS, ///< Updates about the statistics of companies. ADMIN_UPDATE_END ///< Must ALWAYS be on the end of this list!! (period) }; @@ -276,6 +278,22 @@ protected: */ DECLARE_ADMIN_RECEIVE_COMMAND(ADMIN_PACKET_SERVER_COMPANY_ECONOMY); + /** + * Company statistics on stations and vehicles: + * uint8 ID of the company. + * uint16 Number of trains. + * uint16 Number of lorries. + * uint16 Number of busses. + * uint16 Number of planes. + * uint16 Number of ships. + * uint16 Number of train stations. + * uint16 Number of lorry stations. + * uint16 Number of bus stops. + * uint16 Number of airports and heliports. + * uint16 Number of harbours. + */ + DECLARE_ADMIN_RECEIVE_COMMAND(ADMIN_PACKET_SERVER_COMPANY_STATS); + NetworkRecvStatus HandlePacket(Packet *p); public: NetworkRecvStatus CloseConnection(bool error = true); -- cgit v1.2.3-70-g09d2