Пример #1
0
 /// <summary>
 /// UnRegisters a packetHandler for UDP. 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 UDP_UnRegisterPacketHandler <T>(object obj) where T : Packet
 {
     if (IsAlive_UDP)
     {
         udpConnection.UnRegisterPacketHandler <T>(obj);
     }
     else
     {
         udpUnPacketHandlerBuffer.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 UDP_UnRegisterPacketHandler(Type packetType)
 {
     udpConnection.UnRegisterPacketHandler(packetType);
     udpPacketHandlerBuffer.Remove(udpPacketHandlerBuffer.Where(t => t.Item1.Equals(packetType)).ToArray()[0]);
 }