Exemple #1
0
        public override float getPingToClient(long farmerId)
        {
            if (!peers.ContainsLeft(farmerId))
            {
                return(-1f);
            }
            GalaxyID user = new GalaxyID(peers[farmerId]);

            return(server.GetPingWith(user));
        }
Exemple #2
0
 protected override void receiveMessagesImpl()
 {
     if (client == null || !client.Connected)
     {
         return;
     }
     if (client.Connected && serverId == null)
     {
         serverId = client.LobbyOwner;
     }
     client.Receive(onReceiveConnection, onReceiveMessage, onReceiveDisconnect, onReceiveError);
     if (client != null)
     {
         client.Heartbeat(Enumerable.Repeat(serverId, 1));
         lastPingMs = client.GetPingWith(serverId);
         if (lastPingMs > 30000f)
         {
             timedOut          = true;
             pendingDisconnect = Multiplayer.DisconnectType.GalaxyTimeout;
             disconnect();
         }
     }
 }