diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-09 23:09:53 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-09 23:09:53 +0100 |
commit | 4d4fcd0a6f9ae92c93be7a0e8eab9a22aaea31d3 (patch) | |
tree | 35634ad4a4677116a4474a163318ca926eacd434 | |
parent | 45b8f3e74a8bb0cef6e8737ad542bfd4131ae530 (diff) | |
parent | d123b01e8697e3bf8a8d66df4df8d88f21c65cf0 (diff) |
Merge pull request #70721 from Faless/mp/4.x_fix_relay_option
[MP] Fix server_relay being unsettable.
-rw-r--r-- | modules/multiplayer/doc_classes/SceneMultiplayer.xml | 1 | ||||
-rw-r--r-- | modules/multiplayer/scene_multiplayer.cpp | 1 |
2 files changed, 1 insertions, 1 deletions
diff --git a/modules/multiplayer/doc_classes/SceneMultiplayer.xml b/modules/multiplayer/doc_classes/SceneMultiplayer.xml index e4e2b4f631..a688c5fd79 100644 --- a/modules/multiplayer/doc_classes/SceneMultiplayer.xml +++ b/modules/multiplayer/doc_classes/SceneMultiplayer.xml @@ -79,6 +79,7 @@ </member> <member name="server_relay" type="bool" setter="set_server_relay_enabled" getter="is_server_relay_enabled" default="true"> Enable or disable the server feature that notifies clients of other peers' connection/disconnection, and relays messages between them. When this option is [code]false[/code], clients won't be automatically notified of other peers and won't be able to send them packets through the server. + [b]Note:[/b] Changing this option while other peers are connected may lead to unexpected behaviors. [b]Note:[/b] Support for this feature may depend on the current [MultiplayerPeer] configuration. See [method MultiplayerPeer.is_server_relay_supported]. </member> </members> diff --git a/modules/multiplayer/scene_multiplayer.cpp b/modules/multiplayer/scene_multiplayer.cpp index 0a580f782f..01fc1b5275 100644 --- a/modules/multiplayer/scene_multiplayer.cpp +++ b/modules/multiplayer/scene_multiplayer.cpp @@ -610,7 +610,6 @@ Error SceneMultiplayer::object_configuration_remove(Object *p_obj, Variant p_con } void SceneMultiplayer::set_server_relay_enabled(bool p_enabled) { - ERR_FAIL_COND_MSG(multiplayer_peer.is_valid() && multiplayer_peer->get_connection_status() != MultiplayerPeer::CONNECTION_DISCONNECTED, "Cannot change the server relay option while the multiplayer peer is active."); server_relay = p_enabled; } |