diff options
author | sfan5 <sfan5@live.de> | 2019-11-14 17:38:15 +0100 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2019-11-19 20:27:20 +0100 |
commit | c10952b5742ba4364ac7e6fc9f9f2b44c73357b5 (patch) | |
tree | 19912e424ec01f59c01cadc23788ad160fae0118 /src/network/connection.h | |
parent | 97764600e27f8872768a28ac4a379d1d82f86952 (diff) | |
download | minetest-c10952b5742ba4364ac7e6fc9f9f2b44c73357b5.tar.gz minetest-c10952b5742ba4364ac7e6fc9f9f2b44c73357b5.tar.bz2 minetest-c10952b5742ba4364ac7e6fc9f9f2b44c73357b5.zip |
Rework packet receiving in ServerThread
Notably it tries to receive all queued packets
between server steps, not just one.
Diffstat (limited to 'src/network/connection.h')
-rw-r--r-- | src/network/connection.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/network/connection.h b/src/network/connection.h index 057bd39f6..d7f1e0fe8 100644 --- a/src/network/connection.h +++ b/src/network/connection.h @@ -771,6 +771,7 @@ public: bool Connected(); void Disconnect(); void Receive(NetworkPacket* pkt); + bool TryReceive(NetworkPacket *pkt); void Send(session_t peer_id, u8 channelnum, NetworkPacket *pkt, bool reliable); session_t GetPeerID() const { return m_peer_id; } Address GetPeerAddress(session_t peer_id); @@ -803,6 +804,8 @@ protected: UDPSocket m_udpSocket; MutexedQueue<ConnectionCommand> m_command_queue; + bool Receive(NetworkPacket *pkt, u32 timeout); + void putEvent(ConnectionEvent &e); void TriggerSend(); |