Skip to content

Commit

Permalink
Merge pull request #70721 from Faless/mp/4.x_fix_relay_option
Browse files Browse the repository at this point in the history
[MP] Fix server_relay being unsettable.
  • Loading branch information
akien-mga committed Jan 9, 2023
2 parents 45b8f3e + d123b01 commit 4d4fcd0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions modules/multiplayer/doc_classes/SceneMultiplayer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 0 additions & 1 deletion modules/multiplayer/scene_multiplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 4d4fcd0

Please sign in to comment.