예제 #1
0
 // Token: 0x06000C95 RID: 3221 RVA: 0x00054E1C File Offset: 0x0005301C
 public static void BuyItem(IUnityItem item, ItemPrice price, BuyingLocationType buyingLocation = BuyingLocationType.Shop, BuyingRecommendationType recommendation = BuyingRecommendationType.Manual, bool autoEquip = false)
 {
     if (item.View.IsConsumable)
     {
         int id = item.View.ID;
         ShopWebServiceClient.BuyPack(id, PlayerDataManager.AuthToken, price.PackType, price.Currency, item.View.ItemType, buyingLocation, recommendation, delegate(int result)
         {
             BuyPanelGUI.HandleBuyItem(item, (BuyItemResult)result, autoEquip);
         }, delegate(Exception ex)
         {
             BuyPanelGUI._isBuyingItem = false;
             PanelManager.Instance.ClosePanel(PanelType.BuyItem);
         });
     }
     else
     {
         int id2 = item.View.ID;
         ShopWebServiceClient.BuyItem(id2, PlayerDataManager.AuthToken, price.Currency, price.Duration, item.View.ItemType, buyingLocation, recommendation, delegate(int result)
         {
             BuyPanelGUI.HandleBuyItem(item, (BuyItemResult)result, autoEquip);
         }, delegate(Exception ex)
         {
             BuyPanelGUI._isBuyingItem = false;
             PanelManager.Instance.ClosePanel(PanelType.BuyItem);
         });
     }
 }
예제 #2
0
 // Token: 0x06000DF4 RID: 3572 RVA: 0x000602C4 File Offset: 0x0005E4C4
 public BaseItemGUI(IUnityItem item, BuyingLocationType location, BuyingRecommendationType recommendation)
 {
     this._location       = location;
     this._recommendation = recommendation;
     if (item != null)
     {
         this.Item = item;
         if (this.Item.View.ItemType == UberstrikeItemType.Weapon)
         {
             this.DetailGUI = new WeaponItemDetailGUI(item.View as UberStrikeItemWeaponView);
         }
         else if (this.Item.View.ItemClass == UberstrikeItemClass.GearUpperBody || this.Item.View.ItemClass == UberstrikeItemClass.GearLowerBody)
         {
             UberStrikeItemGearView uberStrikeItemGearView = item.View as UberStrikeItemGearView;
             this._armorPoints = uberStrikeItemGearView.ArmorPoints;
             this.DetailGUI    = new ArmorItemDetailGUI(uberStrikeItemGearView, ShopIcons.ItemarmorpointsIcon);
         }
         if (this.Item.View != null && !string.IsNullOrEmpty(this.Item.View.Description))
         {
             this._description = this.Item.View.Description;
         }
     }
     else
     {
         this.Item = new BaseItemGUI.NullItem();
         Debug.LogError("BaseItemGUI creation failed because item is NULL");
     }
 }
예제 #3
0
 // Token: 0x06000C98 RID: 3224 RVA: 0x000551E0 File Offset: 0x000533E0
 public void SetItem(IUnityItem item, BuyingLocationType location, BuyingRecommendationType recommendation, bool autoEquip = false)
 {
     this._autoEquip            = autoEquip;
     this._item                 = item;
     this._buyingLocation       = location;
     this._buyingRecommendation = recommendation;
     BuyPanelGUI._isBuyingItem  = false;
     if (item != null && item.View.Prices.Count > 0)
     {
         if (item.View.IsConsumable)
         {
             this._price = new PackItemPriceGUI(item, new Action <ItemPrice>(this.OnPriceOptionSelected));
         }
         else
         {
             this._price = new RentItemPriceGUI(item, new Action <ItemPrice>(this.OnPriceOptionSelected));
         }
     }
     else
     {
         Debug.LogError("Item is null or not for sale");
     }
 }
예제 #4
0
        public override BuyItemResult OnBuyItem(int itemId, string authToken, UberStrikeCurrencyType currencyType, BuyingDurationType durationType, UberStrikeItemType itemType, BuyingLocationType marketLocation, BuyingRecommendationType recommendationType)
        {
            var member = Context.Users.GetMember(authToken);

            if (member == null)
            {
                Log.Error("An unidentified AuthToken was passed.");
                return(BuyItemResult.InvalidData);
            }

            var cmid      = member.PublicProfile.Cmid;
            var inventory = Context.Users.Db.Inventories.Load(member.PublicProfile.Cmid);

            inventory.Add(new ItemInventoryView(itemId, null, -1, cmid));

            Context.Users.Db.Inventories.Save(cmid, inventory);
            return(BuyItemResult.OK);
        }
예제 #5
0
        // Token: 0x060011BE RID: 4542 RVA: 0x0001D2E0 File Offset: 0x0001B4E0
        public static Coroutine BuyPack(int itemId, string authToken, PackType packType, UberStrikeCurrencyType currencyType, UberstrikeItemType itemType, BuyingLocationType marketLocation, BuyingRecommendationType recommendationType, Action <int> callback, Action <Exception> handler)
        {
            Coroutine result;

            using (MemoryStream memoryStream = new MemoryStream())
            {
                Int32Proxy.Serialize(memoryStream, itemId);
                StringProxy.Serialize(memoryStream, authToken);
                EnumProxy <PackType> .Serialize(memoryStream, packType);

                EnumProxy <UberStrikeCurrencyType> .Serialize(memoryStream, currencyType);

                EnumProxy <UberstrikeItemType> .Serialize(memoryStream, itemType);

                EnumProxy <BuyingLocationType> .Serialize(memoryStream, marketLocation);

                EnumProxy <BuyingRecommendationType> .Serialize(memoryStream, recommendationType);

                result = MonoInstance.Mono.StartCoroutine(SoapClient.MakeRequest("IShopWebServiceContract", "ShopWebService", "BuyPack", memoryStream.ToArray(), delegate(byte[] data)
                {
                    if (callback != null)
                    {
                        callback(Int32Proxy.Deserialize(new MemoryStream(data)));
                    }
                }, handler));
            }
            return(result);
        }
 // Token: 0x06000E1B RID: 3611 RVA: 0x0000A4DC File Offset: 0x000086DC
 public InventoryItemGUI(InventoryItem item, BuyingLocationType location) : base(item.Item, location, BuyingRecommendationType.None)
 {
     this.InventoryItem = item;
 }
예제 #7
0
 // Token: 0x06000E2B RID: 3627 RVA: 0x0000A57F File Offset: 0x0000877F
 public ShopItemGUI(IUnityItem item, BuyingLocationType location) : base(item, location, BuyingRecommendationType.None)
 {
     this._pointsPrice  = ShopUtils.GetLowestPrice(item, UberStrikeCurrencyType.Points);
     this._creditsPrice = ShopUtils.GetLowestPrice(item, UberStrikeCurrencyType.Credits);
 }
예제 #8
0
 public abstract BuyItemResult OnBuyItem(int itemId, string authToken, UberStrikeCurrencyType currencyType, BuyingDurationType durationType, UberStrikeItemType itemType, BuyingLocationType marketLocation, BuyingRecommendationType recommendationType);