Exemplo n.º 1
0
 public override void receiveMessages()
 {
     if (server != null)
     {
         server.Receive(onReceiveConnection, onReceiveMessage, onReceiveDisconnect, onReceiveError);
         server.Heartbeat(server.LobbyMembers());
         foreach (GalaxyID client in server.Connections)
         {
             if (server.GetPingWith(client) > 30000)
             {
                 server.Kick(client);
             }
         }
         if (bandwidthLogger != null)
         {
             bandwidthLogger.Update();
         }
     }
 }
Exemplo n.º 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();
         }
     }
 }