Hi.
I’ve never worked with networking before, so I’m pretty much in the learning phase.
I was getting trough the M2H tutorial, everything is clear as daylight, but there was too confusing :
if (Network.peerType == NetworkPeerType.Connecting){
GUILayout.Label("Connection status: Connecting");
} else if (Network.peerType == NetworkPeerType.Client){
GUILayout.Label("Connection status: Client!");
GUILayout.Label("Ping to server: "+Network.GetAveragePing( Network.connections[0] ) );
} else if (Network.peerType == NetworkPeerType.Server){
GUILayout.Label("Connection status: Server!");
GUILayout.Label("Connections: "+Network.connections.length);
if(Network.connections.length>=1){
GUILayout.Label("Ping to first player: "+Network.GetAveragePing( Network.connections[0] ) );
}
}
This comes from the connect script included in the tutorial.
Anyway - I find it rather confusing - how come both Ping to Server AND Ping to first Player, work with Network.GetAveragePing(Network.connections[0]) ?
-Jedy