Open dev-cyprium opened 3 months ago
The use case was in my actual project I have this logic:
func _ready():
GuiSignalManager.role_selected.connect(_on_role_selected)
GuiSignalManager.role_changed.connect(_on_role_changed)
margin_container_pane.hide()
Console.attach(self)
if multiplayer.is_server():
Console.write_line("WINDOW IS SERVER!! menu.gd:25")
host_options.visible = true
The host_options
are visible for both the server and the client, so I was wondering if this should be false initially?
This is intended behaviour. Default multiplayer peer is OfflineMultiplayerPeer
, which mimics server. You can set multiplayer.multiplayer_peer
to null to get error instead.
This is documented here but should probably be mentioned elsewhere as well
Tested versions
System information
Godot v4.2.2.stable - Windows 10.0.22631 - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 3070 (NVIDIA; 31.0.15.5244) - AMD Ryzen 7 3700X 8-Core Processor (16 Threads)
Issue description
multiplayer.is_server()
returnstrue
in a fresh project. It's not stated like that in the documentation.Steps to reproduce
_ready()
function simplyprint(multiplayer.is_server())
true
even though the peer is OfflineMinimal reproduction project (MRP)
TEst.zip TEst.zip