/// <summary> /// UnRegisters a packetHandler for TCP. If this connection will receive the given type, it will be ignored, /// because there is no handler to invoke anymore. /// </summary> /// <typeparam name="T">The type we dont want to receive anymore.</typeparam> /// <param name="obj">The object which wants to receive the packet.</param> /// <exception cref="System.NotImplementedException"></exception> public void TCP_UnRegisterPacketHandler <T>(object obj) where T : Packet { if (IsAlive_TCP) { tcpConnection.UnRegisterPacketHandler <T>(obj); } else { tcpUnPacketHandlerBuffer.Add(new Tuple <Type, object>(typeof(T), obj)); } }
/// <summary> /// UnRegisters a tcp packetHandler. If this connection will receive the given type, it will be ignored, /// because there is no handler to invoke anymore. /// </summary> /// <param name="type">The type.</param> public void TCP_UnRegisterPacketHandler(Type packetType) { tcpConnection.UnRegisterPacketHandler(packetType); tcpPacketHandlerBuffer.Remove(tcpPacketHandlerBuffer.Where(t => t.Item1.Equals(packetType)).ToArray()[0]); }