mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-26 18:21:04 +00:00
Clean up and compress some pre-join packets (#15881)
This commit is contained in:
parent
287880aa27
commit
afb15978d9
12 changed files with 260 additions and 102 deletions
|
@ -69,6 +69,18 @@ void NetworkPacket::putRawString(const char* src, u32 len)
|
|||
m_read_offset += len;
|
||||
}
|
||||
|
||||
void NetworkPacket::readRawString(char *dst, u32 len)
|
||||
{
|
||||
checkReadOffset(m_read_offset, len);
|
||||
|
||||
if (len == 0)
|
||||
return;
|
||||
|
||||
memcpy(dst, &m_data[m_read_offset], len);
|
||||
m_read_offset += len;
|
||||
}
|
||||
|
||||
|
||||
NetworkPacket& NetworkPacket::operator>>(std::string& dst)
|
||||
{
|
||||
checkReadOffset(m_read_offset, 2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue