public void UnregisterSubSerializer(TType packetType, INetworkPacketSubSerializer <TData> subSubSerializer)
    {
        byte key = (byte)((object)packetType);

        this._subSerializerRegistry.Remove(subSubSerializer);
        this._messsageHandlers.Remove(key);
    }
        public void UnregisterSerializer(INetworkPacketSubSerializer <IConnectedPlayer> subSerializer)
        {
            if (!_serializers.Contains(subSerializer))
            {
                throw new InvalidOperationException();
            }
            byte packetType = (byte)_serializers.IndexOf(subSerializer);

            base.RegisterSubSerializer(packetType, subSerializer);
        }
        public void RegisterSerializer(INetworkPacketSubSerializer <IConnectedPlayer> subSerializer)
        {
            if (!_serializers.Contains(subSerializer))
            {
                _serializers.Register(subSerializer);
            }
            byte packetType = (byte)_serializers.IndexOf(subSerializer);

            base.RegisterSubSerializer(packetType, subSerializer);
        }
    public void RegisterSubSerializer(TType packetType, INetworkPacketSubSerializer <TData> subSubSerializer)
    {
        byte b = (byte)((object)packetType);

        this._subSerializerRegistry[subSubSerializer] = b;
        this._messsageHandlers[b] = delegate(NetDataReader reader, int size, TData data)
        {
            subSubSerializer.Deserialize(reader, size, data);
        };
    }
 private bool TryGetPacketType(Type type, out byte packetType, out INetworkPacketSubSerializer <TData> subSubSerializer)
 {
     subSubSerializer = null;
     if (this._typeRegistry.TryGetValue(type, out packetType))
     {
         return(true);
     }
     foreach (KeyValuePair <INetworkPacketSubSerializer <TData>, byte> keyValuePair in this._subSerializerRegistry)
     {
         if (keyValuePair.Key.HandlesType(type))
         {
             subSubSerializer = keyValuePair.Key;
             packetType       = keyValuePair.Value;
             return(true);
         }
     }
     return(false);
 }
 public void RegisterSerializer(ExtendedSessionManager.MessageType serializerType, INetworkPacketSubSerializer <IConnectedPlayer> subSerializer)
 {
     _packetSerializer.RegisterSubSerializer(serializerType, subSerializer);
 }