- Home /
Creating servers properly?
So I discovered the "player" that creates a server (in a lobby for example). Is not actually counted as a client connection and neither gets listed in Network.connections
. So how does one deal with this? I am trying to get a simple turn based game started. I am looking for a way to retrieve a list, like NetworkPlayer from the server. Then compare the clients vs the NetworkPlayer that has to act. Now that I discovered the server is not even counted as a NetworkPlayer I have another heap of question marks around my head.
So how should I properly create servers using the unity MasterServer
, or "rooms" like you see in some games where you can join in on the action with other players?
Can I let this player create a server and immediately connect to it as a client? How would the server side code run since we need it for sending messages etc?
Let the player act as the server? Which creates a mess in the code since I have to work out this functionality differently then a clients point of view. And I cannot put this "player" inside a
NetworkPlayer[]
for example.Create a "server creation" version that always runs on some computer or server somewhere. This program creates servers that can be polled by potential clients when there are no free servers left to join.
Let all the client do the above (3) work under the hood. Constantly check for servers to connect to and create these. While these players might join other servers. What happens when players quit, does the server vanish?
Or am I completely wondering in the wrong direction here?
Your answer
![](https://koobas.hobune.stream/wayback/20220613180818im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unity networking tutorial? 6 Answers
Port not opening? 3 Answers
Remote database for leaderboard 2 Answers
Netcode [Command] Issues .. no errors, just not working. 1 Answer
Unity 3D Networking questions (About master servers) 1 Answer