- Home /
Player sets up server UNet.
I've been playing Unturned a lot lately and I want to know how to have a multiplayer system like that with UNet. In the menu you can click view servers and a bunch of servers hosted by people all over the world come up. Dedicated servers rented by youtubers or just a server hosted on a players computer. How to have something like this where the player sets up the server with UNet. None of that relay server or matchmaker.
You would need to write your own script that handles all of that. None of the built-in Unity UNet scripts have anything like that. Networking is complicated stuff! I wish you the best. Try looking up Udemy courses. Also, when in doubt, Google is your best friend.
Yes but there aren't many UNet tutorials out there :(
Basically I would think that a player that wants to host a server needs to start up their networking session with startHost() on the Network$$anonymous$$anager. They then need to send their information to some kind of master server that you are running.
A player that wants to join someone elses server first connects to your master server and sees the list of hosted servers available. They select one, and you send them the IP address of the hosted server they wish to join. Locally, their client will disconnect from your master server, then reconnect to the hosted server, using the IP your master server sent them.
So how do I set up a master server and send/get ip addresses from it in UNet? Also would the player who wants to set up a server have to forward ports and stuff like that?