1
0
mirror of https://github.com/minetest/minetest.git synced 2025-07-04 08:50:22 +02:00

Fix ordering issue with new server peers

This commit is contained in:
sfan5
2024-08-21 22:13:03 +02:00
parent 7afa78ec82
commit 1380bf9b88
4 changed files with 9 additions and 62 deletions

View File

@ -30,9 +30,10 @@ class PeerHandler
{
public:
PeerHandler() = default;
virtual ~PeerHandler() = default;
// Note: all functions are called from within a Receive() call on the same thread.
/*
This is called after the Peer has been inserted into the
Connection's peer container.
@ -46,22 +47,4 @@ public:
virtual void deletingPeer(IPeer *peer, bool timeout) = 0;
};
enum PeerChangeType : u8
{
PEER_ADDED,
PEER_REMOVED
};
struct PeerChange
{
PeerChange(PeerChangeType t, session_t _peer_id, bool _timeout) :
type(t), peer_id(_peer_id), timeout(_timeout)
{
}
PeerChange() = delete;
PeerChangeType type;
session_t peer_id;
bool timeout;
};
}