Topic was automatically imported from the old Question2Answer platform.
Asked By
Bush2Tree
Hey all,
If I have the following code:
var peer = NetworkedMultiplayerENet.new()
peer.create_client(SERVER_IP, SERVER_PORT)
get_tree().network_peer = peer
How would I go about getting the network ID of the server I just connected to for the purposes of using rpc_id()? Or, alternatively, does using rpc() from a client only send to the server?
Wouldn’t this also trigger whenever another client connects to the server?
Also, upon further reading, it seems as if the server ID is always 1.
Bush2Tree | 2020-09-28 21:52
network_peer_connected signal is triggered for both clients and servers, but here I connected it in initialize_client function and to a specific function “_on_peer_connected_client” (this is why I added _client suffix to function name).