summaryrefslogtreecommitdiffstats
path: root/src/Net/Packets
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2008-09-29 22:37:25 +0200
committerMatthias Schiffer <matthias@gamezock.de>2008-09-29 22:37:25 +0200
commitd90eb49281efcf2db039fbaacccebd4acdc15f7f (patch)
treeed589a44f7b3190ef4bdc0a77047a51dd7dba9e6 /src/Net/Packets
parent2919e527e3e2c0bbdd35afe28c7da4b041ca25f1 (diff)
downloadmad-d90eb49281efcf2db039fbaacccebd4acdc15f7f.tar
mad-d90eb49281efcf2db039fbaacccebd4acdc15f7f.zip
Einige Fehler am RemoteLogger behoben
Diffstat (limited to 'src/Net/Packets')
-rw-r--r--src/Net/Packets/LogPacket.cpp3
-rw-r--r--src/Net/Packets/LogPacket.h4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/Net/Packets/LogPacket.cpp b/src/Net/Packets/LogPacket.cpp
index fbe59cd..1d6ee88 100644
--- a/src/Net/Packets/LogPacket.cpp
+++ b/src/Net/Packets/LogPacket.cpp
@@ -18,7 +18,6 @@
*/
#include "LogPacket.h"
-#include <ctime>
namespace Mad {
namespace Net {
@@ -32,7 +31,7 @@ LogPacket::LogPacket(Type type, uint16_t requestId, Common::Logger::MessageCateg
logData->category = htons(category);
logData->level = htons(level);
- logData->messageTimestamp = htons(messageTimestamp);
+ logData->messageTimestamp = htonl(messageTimestamp);
std::memcpy(logData->message, message.c_str(), message.length());
}
diff --git a/src/Net/Packets/LogPacket.h b/src/Net/Packets/LogPacket.h
index dd406b4..040f21a 100644
--- a/src/Net/Packets/LogPacket.h
+++ b/src/Net/Packets/LogPacket.h
@@ -69,6 +69,10 @@ class LogPacket : public Packet {
return (Common::Logger::MessageLevel)ntohs(logData->level);
}
+ time_t getTimestamp() const {
+ return (time_t)ntohl(logData->messageTimestamp);
+ }
+
std::string getMessage() const {
return std::string((char*)logData->message, getLength()-sizeof(LogData));
}