summaryrefslogtreecommitdiff
path: root/modules/multiplayer/scene_multiplayer.h
AgeCommit message (Collapse)Author
2022-11-20Merge pull request #68689 from Faless/mp/4.x_offline_is_serverRĂ©mi Verschelde
[MP] New default multiplayer_peer acting as server.
2022-11-20[MP] New default multiplayer_peer acting as server.Fabio Alessandrelli
Adds a OfflineMultiplayerPeer class which behaves like a server with no connected peers. Use OfflineMultiplayerPeer as default for SceneMultiplayer. This means that the SceneTree will act as the multiplayer authority by default. Calls to is_server will return true, and calls to get_unique_id will return TARGET_PEER_SERVER.
2022-11-20[MP] RPC visibility.Fabio Alessandrelli
Implemented using MultiplayerSynchronizers. If you didn't use the synchronizer visibility features, nothing changes. If you were using visibility, RPCs to broadcast should now behave as expected in most configurations (i.e. by sending the RPC to _visible_ peers). If you want to limit the visibility of RPCs for a node, add a synchronizer for it, and configure the visibility via "set_visibility_for" or by adding a visibility filter.
2022-11-17[MP] Improve network profiler.Fabio Alessandrelli
Fix RPC profiler and add average RPC size. Improve bandwidth debugger to account for all multiplayer traffic (excluding the lower level peer transformations).
2022-11-02[MP] Remove connection state signals from MultiplayerPeer.Fabio Alessandrelli
Now handled directly by the MultiplayerAPI implementation.
2022-11-02[MP] Add optional authentication to SceneMultiplayer.Fabio Alessandrelli
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`.
2022-10-27[MP] Let MultiplayerAPI handle packet relaying and peer signaling.Fabio Alessandrelli
MultiplayerPeer changes: - Adds is_server_relay_supported virtual method Informs the upper MultiplayerAPI layer if it can signal peers connected to the server to other clients, and perform packet relaying among them. - Adds get_packet_channel and get_packet_mode virtual methods Allows the MultiplayerAPI to retrieve the channel and transfer modes to use when relaying the last received packet. SceneMultiplayerPeer changes: - Implement peer signaling and packet relaying when the MultiplayerPeer advertise they are supported. ENet, WebRTC, WebSocket changes: - Removed custom code for relaying from WebSocket and ENet, and let it be handled by the upper layer. - Update WebRTC to split create_client, create_server, and create_mesh, with the latter behaving like the old initialize with "server_compatibility = false", and the first two supporting the upper layer relaying protocol.
2022-07-26[Net] Modularize multiplayer, expose MultiplayerAPI to extensions.Fabio Alessandrelli
- RPC configurations are now dictionaries. - Script.get_rpc_methods renamed to Script.get_rpc_config. - Node.rpc[_id] and Callable.rpc now return an Error. - Refactor MultiplayerAPI to allow extension. - New MultiplayerAPI.rpc method with Array argument (for scripts). - Move the default MultiplayerAPI implementation to a module.