Godot Version
Godot Engine v4.3.rc1.official.e343dbbcc
Question
Can confirm this problem still exists in Godot Engine v4.3.rc1.official.e343dbbcc
...
multiplayer.multiplayer_peer = server_peer
multiplayer.peer_connected.connect(_on_peer_connected)
multiplayer.peer_disconnected.connect(_on_peer_disconnected)
...
func _on_peer_disconnected(client_id: int) -> void:
print("[server:client:disconnected]", str(client_id))
if data["players"][str(client_id)]:
var players_node = get_parent().get_node("Players")
if players_node.has_node(str(client_id)):
var player_node = players_node.get_node(str(client_id))
player_node.queue_free()
data["players"].erase(str(client_id))
print("[server:client:disconnected:remove]", str(client_id))
rpc("on_remove_player", client_id)
This error only occurs when there are multiple players connected to the server; if the last player leaves the game, there are no errors.