diff options
author | rubenwardy <rw@rubenwardy.com> | 2019-03-10 18:53:02 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-10 18:53:02 +0000 |
commit | 3b25b807f33bff885bd840ec0dc9e2d95b392f81 (patch) | |
tree | 699acec74f7fcc070666a2e4cb1ddc572ccc3834 /src/network/clientpackethandler.cpp | |
parent | 77961aa73d1947a2eabaa832319b7d73db6d13c2 (diff) | |
download | minetest-3b25b807f33bff885bd840ec0dc9e2d95b392f81.tar.gz minetest-3b25b807f33bff885bd840ec0dc9e2d95b392f81.tar.bz2 minetest-3b25b807f33bff885bd840ec0dc9e2d95b392f81.zip |
Fix serialization of std::time_t by casting to u64 first (#8353)
Fixes #8332
Diffstat (limited to 'src/network/clientpackethandler.cpp')
-rw-r--r-- | src/network/clientpackethandler.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/network/clientpackethandler.cpp b/src/network/clientpackethandler.cpp index 889002a82..2f5deae2a 100644 --- a/src/network/clientpackethandler.cpp +++ b/src/network/clientpackethandler.cpp @@ -408,7 +408,9 @@ void Client::handleCommand_ChatMessage(NetworkPacket *pkt) return; } - *pkt >> chatMessage->sender >> chatMessage->message >> chatMessage->timestamp; + u64 timestamp; + *pkt >> chatMessage->sender >> chatMessage->message >> timestamp; + chatMessage->timestamp = static_cast<std::time_t>(timestamp); chatMessage->type = (ChatMessageType) message_type; |