private static void WantCheckFirewall(UdpItem item, UdpListener udp, ulong time) { UdpPacketReader packet = new UdpPacketReader(item.Data); ushort port = packet; FirewallTest fw = udp.TestRemoteFirewall; if (fw != null) { fw.Cookie = AccountManager.NextCookie; fw.EndPoint = item.EndPoint; fw.Time = time; udp.SendDatagram(new UdpItem { Data = UdpOutbound.ReadyCheckFirewall(fw), EndPoint = item.EndPoint, Msg = UdpMsg.OP_SERVERLIST_READYTOCHECKFIREWALL }); } else { udp.SendDatagram(new UdpItem { Data = UdpOutbound.CheckFirewallBusy(((IPEndPoint)item.EndPoint).Address, time), EndPoint = item.EndPoint, Msg = UdpMsg.OP_SERVERLIST_CHECKFIREWALLBUSY }); } }
public static byte[] ReadyCheckFirewall(FirewallTest fw) { UdpPacketWriter packet = new UdpPacketWriter(); packet.WriteUInt32(fw.Cookie); packet.WriteIP(((IPEndPoint)fw.EndPoint).Address); return(packet.ToAresPacket(UdpMsg.OP_SERVERLIST_READYTOCHECKFIREWALL)); }