예제 #1
0
 public override void updateState(Asset asset, byte[] state)
 {
     this.gunLargeTransform = base.transform.FindChildRecursive("Gun_Large");
     this.gunSmallTransform = base.transform.FindChildRecursive("Gun_Small");
     this.meleeTransform    = base.transform.FindChildRecursive("Melee");
     this.itemTransform     = base.transform.FindChildRecursive("Item");
     this.isLocked          = ((ItemBarricadeAsset)asset).isLocked;
     this._isDisplay        = ((ItemStorageAsset)asset).isDisplay;
     if (Provider.isServer)
     {
         SteamPacker.openRead(0, state);
         this._owner = (CSteamID)SteamPacker.read(Types.STEAM_ID_TYPE);
         this._group = (CSteamID)SteamPacker.read(Types.STEAM_ID_TYPE);
         this._items = new Items(PlayerInventory.STORAGE);
         this.items.resize(((ItemStorageAsset)asset).storage_x, ((ItemStorageAsset)asset).storage_y);
         byte b = (byte)SteamPacker.read(Types.BYTE_TYPE);
         for (byte b2 = 0; b2 < b; b2 += 1)
         {
             if (BarricadeManager.version > 7)
             {
                 object[]  array     = SteamPacker.read(Types.BYTE_TYPE, Types.BYTE_TYPE, Types.BYTE_TYPE, Types.UINT16_TYPE, Types.BYTE_TYPE, Types.BYTE_TYPE, Types.BYTE_ARRAY_TYPE);
                 ItemAsset itemAsset = (ItemAsset)Assets.find(EAssetType.ITEM, (ushort)array[3]);
                 if (itemAsset != null)
                 {
                     this.items.loadItem((byte)array[0], (byte)array[1], (byte)array[2], new Item((ushort)array[3], (byte)array[4], (byte)array[5], (byte[])array[6]));
                 }
             }
             else
             {
                 object[]  array2     = SteamPacker.read(Types.BYTE_TYPE, Types.BYTE_TYPE, Types.UINT16_TYPE, Types.BYTE_TYPE, Types.BYTE_TYPE, Types.BYTE_ARRAY_TYPE);
                 ItemAsset itemAsset2 = (ItemAsset)Assets.find(EAssetType.ITEM, (ushort)array2[2]);
                 if (itemAsset2 != null)
                 {
                     this.items.loadItem((byte)array2[0], (byte)array2[1], 0, new Item((ushort)array2[2], (byte)array2[3], (byte)array2[4], (byte[])array2[5]));
                 }
             }
         }
         if (this.isDisplay)
         {
             this.displaySkin   = (ushort)SteamPacker.read(Types.UINT16_TYPE);
             this.displayMythic = (ushort)SteamPacker.read(Types.UINT16_TYPE);
             if (BarricadeManager.version > 8)
             {
                 this.applyRotation((byte)SteamPacker.read(Types.BYTE_TYPE));
             }
             else
             {
                 this.applyRotation(0);
             }
         }
         this.items.onStateUpdated = new StateUpdated(this.onStateUpdated);
         SteamPacker.closeRead();
         if (this.isDisplay)
         {
             this.updateDisplay();
             this.refreshDisplay();
         }
     }
     else
     {
         Block block = new Block(state);
         this._owner = new CSteamID((ulong)block.read(Types.UINT64_TYPE));
         this._group = new CSteamID((ulong)block.read(Types.UINT64_TYPE));
         if (state.Length > 16)
         {
             object[] array3 = block.read(Types.UINT16_TYPE, Types.BYTE_TYPE, Types.BYTE_ARRAY_TYPE, Types.UINT16_TYPE, Types.UINT16_TYPE, Types.BYTE_TYPE);
             this.applyRotation((byte)array3[5]);
             this.setDisplay((ushort)array3[0], (byte)array3[1], (byte[])array3[2], (ushort)array3[3], (ushort)array3[4]);
         }
     }
 }
예제 #2
0
 public object[] read(Type type_0, Type type_1, Type type_2, Type type_3)
 {
     return(SteamPacker.read(type_0, type_1, type_2, type_3));
 }
예제 #3
0
 public object[] read(params Type[] types)
 {
     return(SteamPacker.read(types));
 }
예제 #4
0
 public object read(Type type)
 {
     return(SteamPacker.read(type));
 }
예제 #5
0
 public object[] read(Type type_0, Type type_1, Type type_2, Type type_3, Type type_4, Type type_5, Type type_6)
 {
     return(SteamPacker.read(type_0, type_1, type_2, type_3, type_4, type_5, type_6));
 }