diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2008-09-12 00:40:06 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2008-09-12 00:40:06 +0200 |
commit | b0ca04e1baf9a3405bfb50d7c3d95e8e425f4c3e (patch) | |
tree | adf91aa4677d508ffe3ad1a6500ec03e8bc8c11e /src/Core | |
parent | 668437afdfb8d8a6bdaaaba6225177295e49982a (diff) | |
download | mad-b0ca04e1baf9a3405bfb50d7c3d95e8e425f4c3e.tar mad-b0ca04e1baf9a3405bfb50d7c3d95e8e425f4c3e.zip |
Serverstatus zeigt die Speicherauslastung an
Diffstat (limited to 'src/Core')
-rw-r--r-- | src/Core/Makefile.in | 2 | ||||
-rw-r--r-- | src/Core/RequestHandler/CoreStatusRequestHandler.h | 8 | ||||
-rw-r--r-- | src/Core/RequestHandler/Makefile.in | 2 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/Core/Makefile.in b/src/Core/Makefile.in index 3590c7f..98a97e0 100644 --- a/src/Core/Makefile.in +++ b/src/Core/Makefile.in @@ -129,6 +129,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PCRECPP_CFLAGS = @PCRECPP_CFLAGS@ +PCRECPP_LIBS = @PCRECPP_LIBS@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = @SED@ diff --git a/src/Core/RequestHandler/CoreStatusRequestHandler.h b/src/Core/RequestHandler/CoreStatusRequestHandler.h index eec0154..ec94bb5 100644 --- a/src/Core/RequestHandler/CoreStatusRequestHandler.h +++ b/src/Core/RequestHandler/CoreStatusRequestHandler.h @@ -44,9 +44,13 @@ class CoreStatusRequestHandler : public Common::RequestHandler { if(packet.getType() != Net::Packet::TYPE_CORE_STATUS) return false; // TODO Logging - Common::SystemBackend::Uptime uptime = Common::SystemBackend::getBackend()->getUptime(); + // TODO Require authentication - if(!connection->send(Net::Packets::CoreStatusPacket(Net::Packet::TYPE_OK, packet.getRequestId(), uptime.uptime, uptime.idleTime))) + Common::SystemBackend::UptimeInfo uptimeInfo = Common::SystemBackend::getBackend()->getUptimeInfo(); + Common::SystemBackend::MemoryInfo memInfo = Common::SystemBackend::getBackend()->getMemoryInfo(); + + if(!connection->send(Net::Packets::CoreStatusPacket(Net::Packet::TYPE_OK, packet.getRequestId(), uptimeInfo.uptime, uptimeInfo.idleTime, + memInfo.totalMem, memInfo.freeMem, memInfo.totalSwap, memInfo.freeSwap))) return false; setFinished(); diff --git a/src/Core/RequestHandler/Makefile.in b/src/Core/RequestHandler/Makefile.in index bea3870..2d1cbee 100644 --- a/src/Core/RequestHandler/Makefile.in +++ b/src/Core/RequestHandler/Makefile.in @@ -102,6 +102,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PCRECPP_CFLAGS = @PCRECPP_CFLAGS@ +PCRECPP_LIBS = @PCRECPP_LIBS@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = @SED@ |