Exemplo n.º 1
0
        public static void ReadKeepAlive(Client client, PacketReader reader)
        {
            KeepAlivePacket ka = new KeepAlivePacket();
            ka.Read(reader);

            if (!reader.Failed)
                Client.HandlePacketKeepAlive(client, ka);
        }
Exemplo n.º 2
0
 private void OnKeepAlive(KeepAlivePacket p)
 {
     if (KeepAlive != null) KeepAlive.Invoke(this, new PacketEventArgs<KeepAlivePacket>(p));
 }
Exemplo n.º 3
0
 public static void HandlePacketKeepAlive(Client client, KeepAlivePacket packet)
 {
     client.LastClientResponse = DateTime.Now;
     if (client.LastKeepAliveId > 0 && packet.KeepAliveID == client.LastKeepAliveId)
     {
         client.Ping = (int)Math.Round((DateTime.Now - client.KeepAliveStart).TotalMilliseconds, MidpointRounding.AwayFromZero);
     }
 }
Exemplo n.º 4
0
 public static void HandlePacketKeepAlive(TestClient client, KeepAlivePacket ka)
 {
     client.SendPacket(new KeepAlivePacket());
 }