Ejemplo n.º 1
0
        public void sendPurchase(PurchaseNode node)
        {
            int num = LevelNodes.nodes.FindIndex((Node x) => x == node);

            base.channel.send("askPurchase", ESteamCall.SERVER, ESteamPacket.UPDATE_UNRELIABLE_BUFFER, new object[]
            {
                (byte)num
            });
        }
Ejemplo n.º 2
0
 // Token: 0x06002C0D RID: 11277 RVA: 0x00117E78 File Offset: 0x00116278
 private void onPurchaseUpdated(PurchaseNode node)
 {
     if (node == null)
     {
         PlayerInteract.purchaseAsset = null;
     }
     else
     {
         PlayerInteract.purchaseAsset = (ItemAsset)Assets.find(EAssetType.ITEM, node.id);
     }
 }
Ejemplo n.º 3
0
 public void askPurchase(CSteamID steamID, byte index)
 {
     if (base.channel.checkOwner(steamID) && Provider.isServer)
     {
         if (!base.player.tryToPerformRateLimitedAction())
         {
             return;
         }
         if ((int)index >= LevelNodes.nodes.Count)
         {
             return;
         }
         PurchaseNode purchaseNode = null;
         try
         {
             purchaseNode = (PurchaseNode)LevelNodes.nodes[(int)index];
         }
         catch
         {
             return;
         }
         if (this.experience >= purchaseNode.cost)
         {
             this._experience -= purchaseNode.cost;
             base.channel.send("tellExperience", ESteamCall.OWNER, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[]
             {
                 this.experience
             });
             ItemAsset itemAsset = (ItemAsset)Assets.find(EAssetType.ITEM, purchaseNode.id);
             if (itemAsset.type == EItemType.GUN && base.player.inventory.has(purchaseNode.id) != null)
             {
                 base.player.inventory.tryAddItem(new Item(((ItemGunAsset)itemAsset).getMagazineID(), EItemOrigin.ADMIN), true);
             }
             else
             {
                 base.player.inventory.tryAddItem(new Item(purchaseNode.id, EItemOrigin.ADMIN), true);
             }
         }
     }
 }