summaryrefslogtreecommitdiffstats
path: root/src/Net/Packets/CoreStatusPacket.cpp
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2008-09-12 00:40:06 +0200
committerMatthias Schiffer <matthias@gamezock.de>2008-09-12 00:40:06 +0200
commitb0ca04e1baf9a3405bfb50d7c3d95e8e425f4c3e (patch)
treeadf91aa4677d508ffe3ad1a6500ec03e8bc8c11e /src/Net/Packets/CoreStatusPacket.cpp
parent668437afdfb8d8a6bdaaaba6225177295e49982a (diff)
downloadmad-b0ca04e1baf9a3405bfb50d7c3d95e8e425f4c3e.tar
mad-b0ca04e1baf9a3405bfb50d7c3d95e8e425f4c3e.zip
Serverstatus zeigt die Speicherauslastung an
Diffstat (limited to 'src/Net/Packets/CoreStatusPacket.cpp')
-rw-r--r--src/Net/Packets/CoreStatusPacket.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Net/Packets/CoreStatusPacket.cpp b/src/Net/Packets/CoreStatusPacket.cpp
index 4397fa8..ad2a7fb 100644
--- a/src/Net/Packets/CoreStatusPacket.cpp
+++ b/src/Net/Packets/CoreStatusPacket.cpp
@@ -24,12 +24,20 @@ namespace Mad {
namespace Net {
namespace Packets {
-CoreStatusPacket::CoreStatusPacket(Type type, uint16_t requestId, uint32_t uptime, uint32_t idleTime) : Packet(type, requestId) {
+CoreStatusPacket::CoreStatusPacket(Type type, uint16_t requestId, uint32_t uptime, uint32_t idleTime,
+ uint32_t totalMem, uint32_t freeMem, uint32_t totalSwap, uint32_t freeSwap)
+: Packet(type, requestId)
+{
setLength(sizeof(CoreStatusData));
coreStatusData = (CoreStatusData*)&rawData->data;
coreStatusData->uptime = htonl(uptime);
coreStatusData->idleTime = htonl(idleTime);
+
+ coreStatusData->totalMem = htonl(totalMem);
+ coreStatusData->freeMem = htonl(freeMem);
+ coreStatusData->totalSwap = htonl(totalSwap);
+ coreStatusData->freeSwap = htonl(freeSwap);
}
CoreStatusPacket& CoreStatusPacket::operator=(const Packet &p) {