summaryrefslogtreecommitdiff
path: root/src/network/core
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-10-17 17:38:41 +0000
committerrubidium <rubidium@openttd.org>2010-10-17 17:38:41 +0000
commit459514afe4f550a08d98958745d6cd8311c53fdd (patch)
treec66c0a60dff633ff91971112d417079527a44574 /src/network/core
parentca5d9f70024a513b4d5a6cfcddb3b250f591d630 (diff)
downloadopenttd-459514afe4f550a08d98958745d6cd8311c53fdd.tar.xz
(svn r20972) -Add: company statistics updates at intervals to remote admins (dihedral)
Diffstat (limited to 'src/network/core')
-rw-r--r--src/network/core/tcp_admin.cpp2
-rw-r--r--src/network/core/tcp_admin.h18
2 files changed, 20 insertions, 0 deletions
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);