After a server is created the the player that owns the server joins the game and and the server stores this data on his side.
Later on another player joins the server that need the data that says [The server owner is in game].
It's easy to send that data when both players connected because the server can send it directly to another player.
what is the best way to do it?
Edit: Thats how I did that
get_tree().connect("network_peer_connected", self, "_player_connected")
get_tree().connect("network_peer_disconnected", self, "_player_disconnected")
players = 1
players[id] = id
remote func sync_func():
for peers in get_tree().get_network_connected_peers():
if peers != 1:
remote func sync_players(player_data):
players = player_data