mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-27 17:28:41 +00:00
Fix ordering issue with new server peers
This commit is contained in:
parent
7afa78ec82
commit
1380bf9b88
4 changed files with 9 additions and 62 deletions
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue