mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-07 16:48:40 +00:00
Rework packet receiving in ServerThread
Notably it tries to receive all queued packets between server steps, not just one.
This commit is contained in:
parent
57409ef382
commit
1c61fe5ed9
5 changed files with 86 additions and 24 deletions
|
@ -66,6 +66,15 @@ void NetworkPacket::putRawPacket(u8 *data, u32 datasize, session_t peer_id)
|
|||
memcpy(m_data.data(), &data[2], m_datasize);
|
||||
}
|
||||
|
||||
void NetworkPacket::clear()
|
||||
{
|
||||
m_data.clear();
|
||||
m_datasize = 0;
|
||||
m_read_offset = 0;
|
||||
m_command = 0;
|
||||
m_peer_id = 0;
|
||||
}
|
||||
|
||||
const char* NetworkPacket::getString(u32 from_offset)
|
||||
{
|
||||
checkReadOffset(from_offset, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue