- Home /
Do RPC calls get sent through Master Server or directly to the other client?
Ok, sorry to add to the heaps of questions on the topic of networking.
I require a bit of clarification on how the master servers speed might affect gameplay.
The master server is responsible for storing the host list and connecting clients (sometimes with the use of NAT), correct?
So after retrieving the host list and connecting to a game, will the connection between the two players be a direct one when sending information through RPC calls, or will all the data have to go though the unity server (or server you set up)?
So will the speed of the master server only affect connection times, or also the speed at which an RPC call can be sent to the other player?
From the two scenarios which one fits best?:
retrieve host list from master server -> connect to a host using master server(NAT) -> Game has started and master server is no longer needed for sending the RPC calls
OR
retrieve host list from master server -> connect to a host using master server(NAT) -> Game has started and RPC calls are sent to master server which sends it on to the other player(client)
When using the ip address and port to create a direct connection between two clients, the data sent (such as RPCs) doesn't go through any server does it?
So the connection is possible without a server, which is why I am wondering if the master server is only used to create/setup a direct connection, or if then all data (such as transforms & variables etc) needs to go through the server as well.
Player1 ------RPC data-------> Player2
Player1 ------RPC data-------> Server ------RPC data------> Player2
The first case would be excellent because the connection speed/lag wouldn't rely on a server being fast enough.
Hope I am making a bit of sense, thanks!
Answer by Hardynist · May 05, 2013 at 02:26 AM
The first case is true. The player who creates a room becomes the ultimate server and no RPC is sent through the master server. All RPCs go through that player's computer to any other players (master server is not involved in that. Master server is used to alleviate the hassle of connection establishing.,
Hi Hardynist, thanks for the reply!
However, since Cuddle$$anonymous$$onster stated the opposite I am now still not entirely sure which answer is correct..
Hmm, perhaps a third opinion would be good
Answer by CuddleMonster · May 04, 2013 at 05:43 PM
All network related things are sent through the server. The only "connection" that the client has is to the server directly. Only the server sees all players. Hope that helps.
Ah ok, so there is no way of sending data between two pc's without there being a server in the middle?
When connecting with the following code it will still connect automatically to the default unity server?
Network.Connect("the_ip_adress", 25000);
Hi Cuddle$$anonymous$$onster, Sorry to unaccept your answer for now.
Could someone confirm which of the two answers is correct?
Nothing goes through the $$anonymous$$aster Server after a network connection has been made between the players in a particular game. It's just a lobby.
Oh brilliant, that is indeed good news!
Thanks for clarifying that ;)
Your answer
Follow this Question
Related Questions
Unity networking tutorial? 6 Answers
Unity Master Server Connect to own Server won't work 0 Answers
Is the master server down? 0 Answers
How much connections may be handled NetworkServerSimple? 1 Answer