public unsafe bool HandlePacket(ENetPeer* peer, byte[] data, Game game) { var loadInfo = new PingLoadInfo(data); var peerInfo = game.getPeerInfo(peer); if (peerInfo == null) return false; var response = new PingLoadInfo(loadInfo, peerInfo.userId); //Logging->writeLine("loaded: %f, ping: %f, %f", loadInfo->loaded, loadInfo->ping, loadInfo->f3); return PacketHandlerManager.getInstace().broadcastPacket(response, Channel.CHL_LOW_PRIORITY, PacketFlags.None); }
public PingLoadInfo(PingLoadInfo loadInfo, long id) : base(PacketCmdS2C.PKT_S2C_Ping_Load_Info, loadInfo.netId) { buffer.Write((int)loadInfo.unk1); buffer.Write((long)id); buffer.Write((float)loadInfo.loaded); buffer.Write((float)loadInfo.ping); buffer.Write((short)loadInfo.unk2); buffer.Write((short)loadInfo.unk3); buffer.Write((byte)loadInfo.unk4); }