Host IP?

I am trying to make my own master server - Using my own code.

It uses a database, which contains information such as server port, and server IP.

However, trying to connect to other players has failed - I do not think that the server IP is accurate…

Basically, when someone starts a server, it uses regular networking to start a server. It then uses Network.player.ipAddress to record the IP. It sends the IP along with other information to the database.

My game reads the database, and displays buttons. If you click one such button, then the game tries to connect to the written IP.

However, as I said, the IPs are not working. How do I get the accurate host-connection IP?

Be aware that Network.player returns the player that runs the script (‘yourself’). If you want the IP of someone who connected to you, use the OnPlayerConnected(NetworkPlayer player) function. The passed player argument holds the information of the just connected player.

Hope that helps.