diff options
Diffstat (limited to 'src/Net/Packets')
-rw-r--r-- | src/Net/Packets/LogPacket.cpp | 4 | ||||
-rw-r--r-- | src/Net/Packets/LogPacket.h | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/Net/Packets/LogPacket.cpp b/src/Net/Packets/LogPacket.cpp index 97994b0..fbe59cd 100644 --- a/src/Net/Packets/LogPacket.cpp +++ b/src/Net/Packets/LogPacket.cpp @@ -18,12 +18,13 @@ */ #include "LogPacket.h" +#include <ctime> namespace Mad { namespace Net { namespace Packets { -LogPacket::LogPacket(Type type, uint16_t requestId, Common::Logger::MessageCategory category, Common::Logger::MessageLevel level, const std::string &message) +LogPacket::LogPacket(Type type, uint16_t requestId, Common::Logger::MessageCategory category, Common::Logger::MessageLevel level, time_t messageTimestamp, const std::string &message) : Packet(type, requestId) { setLength(sizeof(LogData) + message.length()); @@ -31,6 +32,7 @@ LogPacket::LogPacket(Type type, uint16_t requestId, Common::Logger::MessageCateg logData->category = htons(category); logData->level = htons(level); + logData->messageTimestamp = htons(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 814ea28..2c541ae 100644 --- a/src/Net/Packets/LogPacket.h +++ b/src/Net/Packets/LogPacket.h @@ -24,6 +24,7 @@ #include <Common/Logger.h> #include <string> +#include <ctime> namespace Mad { namespace Net { @@ -34,13 +35,14 @@ class LogPacket : public Packet { struct LogData { uint16_t category; uint16_t level; + uint16_t messageTimestamp; uint8_t message[0]; }; LogData *logData; public: - LogPacket(Type type, uint16_t requestId, Common::Logger::MessageCategory category, Common::Logger::MessageLevel level, const std::string &message); + LogPacket(Type type, uint16_t requestId, Common::Logger::MessageCategory category, Common::Logger::MessageLevel level, time_t messageTimestamp, const std::string &message); LogPacket(const Packet &p) : Packet(p) { if(getLength() < sizeof(LogData)) |