Networking - get the current host

I can know that I’m connected to a host using Network.peerType or Network.isClient, but I couldn’t find a way to get the HostData, like Network.host, or HostData.current… does it exist?
If not, well, it should.

HostData objects are sent by the master server and thats separate from the Network Manager himself. You manually take the data from a HostData object, the IP and port, and use that in Network.Connect(). There is now way for Unity to know which HostData object from MasterServer.PollHostList you used when connecting.

If you want to keep around the HostData object you should store the one you are using yourself.

To get IP and port info on the current server the client is connected to you can use “Network.connections”. On clients the only connection in that list is the one with the server.

That makes sense, thank you :slight_smile: !