mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-12 16:58:39 +00:00
Fix serialization of std::time_t by casting to u64 first (#8353)
Fixes #8332
This commit is contained in:
parent
bf4deb0ce6
commit
d8ece2e3e9
4 changed files with 4 additions and 22 deletions
|
@ -281,12 +281,6 @@ NetworkPacket& NetworkPacket::operator<<(u64 src)
|
|||
return *this;
|
||||
}
|
||||
|
||||
NetworkPacket& NetworkPacket::operator<<(std::time_t src)
|
||||
{
|
||||
*this << (u64) src;
|
||||
return *this;
|
||||
}
|
||||
|
||||
NetworkPacket& NetworkPacket::operator<<(float src)
|
||||
{
|
||||
checkDataSize(4);
|
||||
|
@ -372,16 +366,6 @@ NetworkPacket& NetworkPacket::operator>>(u64& dst)
|
|||
return *this;
|
||||
}
|
||||
|
||||
NetworkPacket& NetworkPacket::operator>>(std::time_t& dst)
|
||||
{
|
||||
checkReadOffset(m_read_offset, 8);
|
||||
|
||||
dst = readU64(&m_data[m_read_offset]);
|
||||
|
||||
m_read_offset += 8;
|
||||
return *this;
|
||||
}
|
||||
|
||||
NetworkPacket& NetworkPacket::operator>>(float& dst)
|
||||
{
|
||||
checkReadOffset(m_read_offset, 4);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue