summaryrefslogtreecommitdiff
path: root/servers/physics_3d
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2022-10-17 12:17:07 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2022-11-02 15:17:23 +0100
commit9773803e4eb5f986750eb4daa726b25bb41e96e8 (patch)
treef082de92c39075219f879bd241df08a9f337c448 /servers/physics_3d
parent0a0e99cadc6e250ff2ee27ef31760eb9c2e21040 (diff)
[MP] Add optional authentication to SceneMultiplayer.
Add few methods to allow peers to exchange authentication information. - `set_auth_callback(callback)`: Enable the authentication features. The callback is a `Callable` that accepts an `int` (the peer ID), and a `PackedByteArray` of data. - The `peer_authenticating(id)` signal will be emitted instead of `peer_connected` when a new peer connects. - Use `send_auth(id: int, data: PackedByteArray)` to exchange data. - Call `complete_auth(id: int)` when the authentication process is complete and you expect to start receiving game data. - The `peer_connected` signal will be emitted as soon as both parties complete the authentication. - Use `disconnect_peer(id)` to disconnect a connected peer. - If the `peer_connected` signal didn't fire for that peer (i.e. it was still in the authentication phase), the `peer_auth_failed` signal will be emitted instead of `peer_disconnected`.
Diffstat (limited to 'servers/physics_3d')
0 files changed, 0 insertions, 0 deletions