I want to build a simple server for chat. Problem is how will people connect to it? I found tuts for server client using a lan but what about wan? Meaning connecting to our servers? Anyone have a simple tutorial for building dedicated server that clients send data too?
Been doing research on this, does unity support building a dedicated server to connect to using Unet? Or do I need to build my server in Visual Studio as a console app and use unity client to connect to it that way? So far not been able to find a dedicated server tut that uses Unity building a dedicated server that clients connect too. Trying to build a simple dedicated server for text chat so players in game can talk to each other.
Quickly googling “unet server tutorial” the first result yielded a very promising tutorial: https://noobtuts.com/unity/unet-server-hosting
It explains how you can set up a headless server using Unity and UNet.
As for the difference between a LAN and a WAN, there’s no difference in how you code it. The client simply connects to an IP address. If the server doesn’t have a public IP address, but rather a local address like 10.x.x.x or 192.168.x.x, then you just have to set up port forwarding on the router (or it may already be set up if you’re using a rented server).
I’m sure that your research has turned this up already, so just to make sure you are not disappointed:
UNet is deprecated and slated to go the way of the Dodo within the next 12 Months…
Ooh everything g I found on unet was only 2 years old and replaced photon. Whats the replacement thanks for sharing btw
It looks like going forward Unity will have two integrated networking solutions: MLAPI for the object-oriented approach, and DOTS-NetCode for the data-oriented approach. Of course you can always use one of the many 3rd party solutions as well, like Photon PUN2, Mirror, SmartFoxServer, SocketClass, LiteNetLib, DarkRift Networking 2, or TNet.
I found a series
LLAPI. Not sure if that’s the most current but looks promising. I’m a .Net dev so I try to, suggestions?
I’d suggest not learning the Unet LLAPI, since it was deprecated a long time ago.