public object Unpack(Packer packer)
        {
            var type         = packer.GetMetaType(Int32Serializer.UnpackDirect(packer));
            var typeValue    = packer.GetMetaType(Int32Serializer.UnpackDirect(packer));
            var typeProvider = packer.GetMetaType(Int32Serializer.UnpackDirect(packer));

            var sentinelType = type.MakeGenericType(typeValue, typeProvider);

            var poolClassType = typeof(PoolClass <>).MakeGenericType(sentinelType);
            var spawnMethod   = poolClassType.GetMethod("Spawn", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
            var sentinel      = (IDisposeSentinel)spawnMethod.Invoke(null, null);

            sentinel.SetData(packer.UnpackInternal());
            sentinel.SetTick(Int64Serializer.UnpackDirect(packer));

            return(sentinel);
        }
        public object Unpack(Packer packer)
        {
            var pack = new ME.ECS.StatesHistory.HistoryEvent();

            pack.tick           = Int64Serializer.UnpackDirect(packer);
            pack.order          = Int32Serializer.UnpackDirect(packer);
            pack.rpcId          = Int32Serializer.UnpackDirect(packer);
            pack.localOrder     = Int32Serializer.UnpackDirect(packer);
            pack.objId          = Int32Serializer.UnpackDirect(packer);
            pack.groupId        = Int32Serializer.UnpackDirect(packer);
            pack.storeInHistory = BooleanSerializer.UnpackDirect(packer);

            var hasParams = packer.ReadByte();

            if (hasParams == 1)
            {
                var serializer = new ObjectArraySerializer();
                pack.parameters = (object[])serializer.Unpack(packer);
            }

            return(pack);
        }
Esempio n. 3
0
 public object Unpack(Packer packer)
 {
     return((Tick)Int64Serializer.UnpackDirect(packer));
 }
Esempio n. 4
0
 public static fp UnpackDirect(Packer packer)
 {
     return(new fp(Int64Serializer.UnpackDirect(packer)));
 }