mirror of
https://github.com/godotengine/godot.git
synced 2025-10-26 19:24:18 +00:00
[MP] Fix auth not waiting for confirmation in some cases
The auth implementation was treating any received packet as a remote
confirmation after the peer was confirmed locally.
It now correctly awaits for the remote confirmation packet before
admitting new peers.
(cherry picked from commit 754036f82f)
This commit is contained in:
parent
15ac760e4a
commit
bc0c61a30b
1 changed files with 20 additions and 26 deletions
|
|
@ -96,11 +96,6 @@ Error SceneMultiplayer::poll() {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (pending_peers.has(sender)) {
|
if (pending_peers.has(sender)) {
|
||||||
if (pending_peers[sender].local) {
|
|
||||||
// If the auth is over, admit the peer at the first packet.
|
|
||||||
pending_peers.erase(sender);
|
|
||||||
_admit_peer(sender);
|
|
||||||
} else {
|
|
||||||
ERR_CONTINUE(len < 2 || (packet[0] & CMD_MASK) != NETWORK_COMMAND_SYS || packet[1] != SYS_COMMAND_AUTH);
|
ERR_CONTINUE(len < 2 || (packet[0] & CMD_MASK) != NETWORK_COMMAND_SYS || packet[1] != SYS_COMMAND_AUTH);
|
||||||
// Auth message.
|
// Auth message.
|
||||||
PackedByteArray pba;
|
PackedByteArray pba;
|
||||||
|
|
@ -125,7 +120,6 @@ Error SceneMultiplayer::poll() {
|
||||||
}
|
}
|
||||||
continue; // Auth in progress.
|
continue; // Auth in progress.
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ERR_CONTINUE(!connected_peers.has(sender));
|
ERR_CONTINUE(!connected_peers.has(sender));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue