public void PacketRead(NetworkingPlayer sender, Header payload, bool skipCompleteEvent = false) { lock (packetMutex) { if (sender == null) { return; } PacketList targetPacketList = GetPacketList(sender, payload); if (targetPacketList == null) { return; } if (!skipCompleteEvent && targetPacketList.ReceivePacket(payload)) { // TODO: Clear out older buffers if (packetListComplete != null) { packetListComplete(payload.updateId, payload.reliable, targetPacketList.FlushAllData()); } } } }
public bool HasReadPacket(NetworkingPlayer sender, Header payload) { lock (packetMutex) { if (sender == null) { return(false); } PacketList targetPacketList = GetPacketList(sender, payload); if (targetPacketList == null) { return(false); } return(targetPacketList.HasPacket(payload.packetOrderId)); } }