summaryrefslogtreecommitdiff
path: root/src/network/core
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-10-17 17:43:01 +0000
committerrubidium <rubidium@openttd.org>2010-10-17 17:43:01 +0000
commita5d414a73490d290965f714ccc3ab556ffa4bc7e (patch)
tree76cd7149e81bbd4af5f1693458d7268e6fd66795 /src/network/core
parentad12a91cdae152aff87404dce7718706b91d5cb4 (diff)
downloadopenttd-a5d414a73490d290965f714ccc3ab556ffa4bc7e.tar.xz
(svn r20975) -Add: logging of console output for 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.h9
2 files changed, 11 insertions, 0 deletions
diff --git a/src/network/core/tcp_admin.cpp b/src/network/core/tcp_admin.cpp
index 9de27d183..e3235eebe 100644
--- a/src/network/core/tcp_admin.cpp
+++ b/src/network/core/tcp_admin.cpp
@@ -79,6 +79,7 @@ NetworkRecvStatus NetworkAdminSocketHandler::HandlePacket(Packet *p)
ADMIN_COMMAND(ADMIN_PACKET_SERVER_COMPANY_STATS)
ADMIN_COMMAND(ADMIN_PACKET_SERVER_CHAT)
ADMIN_COMMAND(ADMIN_PACKET_SERVER_RCON)
+ ADMIN_COMMAND(ADMIN_PACKET_SERVER_CONSOLE)
default:
if (this->HasClientQuit()) {
@@ -153,5 +154,6 @@ DEFINE_UNAVAILABLE_ADMIN_RECEIVE_COMMAND(ADMIN_PACKET_SERVER_COMPANY_ECONOMY)
DEFINE_UNAVAILABLE_ADMIN_RECEIVE_COMMAND(ADMIN_PACKET_SERVER_COMPANY_STATS)
DEFINE_UNAVAILABLE_ADMIN_RECEIVE_COMMAND(ADMIN_PACKET_SERVER_CHAT)
DEFINE_UNAVAILABLE_ADMIN_RECEIVE_COMMAND(ADMIN_PACKET_SERVER_RCON)
+DEFINE_UNAVAILABLE_ADMIN_RECEIVE_COMMAND(ADMIN_PACKET_SERVER_CONSOLE)
#endif /* ENABLE_NETWORK */
diff --git a/src/network/core/tcp_admin.h b/src/network/core/tcp_admin.h
index d4b0d746c..6c66d8d05 100644
--- a/src/network/core/tcp_admin.h
+++ b/src/network/core/tcp_admin.h
@@ -55,6 +55,7 @@ enum PacketAdminType {
ADMIN_PACKET_SERVER_COMPANY_STATS, ///< The server gives the admin some statistics about a company.
ADMIN_PACKET_SERVER_CHAT, ///< The server received a chat message and relays it.
ADMIN_PACKET_SERVER_RCON, ///< The server's reply to a remove console command.
+ ADMIN_PACKET_SERVER_CONSOLE, ///< The server gives the admin the data that got printed to its console.
INVALID_ADMIN_PACKET = 0xFF, ///< An invalid marker for admin packets.
};
@@ -74,6 +75,7 @@ enum AdminUpdateType {
ADMIN_UPDATE_COMPANY_ECONOMY, ///< Updates about the economy of companies.
ADMIN_UPDATE_COMPANY_STATS, ///< Updates about the statistics of companies.
ADMIN_UPDATE_CHAT, ///< The admin would like to have chat messages.
+ ADMIN_UPDATE_CONSOLE, ///< The admin would like to have console messages.
ADMIN_UPDATE_END ///< Must ALWAYS be on the end of this list!! (period)
};
@@ -331,6 +333,13 @@ protected:
*/
DECLARE_ADMIN_RECEIVE_COMMAND(ADMIN_PACKET_SERVER_RCON);
+ /**
+ * Send what would be printed on the server's console also into the admin network.
+ * string The origin of the text, e.g. "console" for console, or "net" for network related (debug) messages.
+ * string Text as found on the console of the server.
+ */
+ DECLARE_ADMIN_RECEIVE_COMMAND(ADMIN_PACKET_SERVER_CONSOLE);
+
NetworkRecvStatus HandlePacket(Packet *p);
public:
NetworkRecvStatus CloseConnection(bool error = true);