Ejemplo n.º 1
0
        // Token: 0x060011BD RID: 4541 RVA: 0x0001D230 File Offset: 0x0001B430
        public static Coroutine BuyItem(int itemId, string authToken, UberStrikeCurrencyType currencyType, BuyingDurationType durationType, 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 <UberStrikeCurrencyType> .Serialize(memoryStream, currencyType);

                EnumProxy <BuyingDurationType> .Serialize(memoryStream, durationType);

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

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

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

                result = MonoInstance.Mono.StartCoroutine(SoapClient.MakeRequest("IShopWebServiceContract", "ShopWebService", "BuyItem", memoryStream.ToArray(), delegate(byte[] data)
                {
                    if (callback != null)
                    {
                        callback(Int32Proxy.Deserialize(new MemoryStream(data)));
                    }
                }, handler));
            }
            return(result);
        }
Ejemplo n.º 2
0
 // Token: 0x060010DD RID: 4317 RVA: 0x00067A0C File Offset: 0x00065C0C
 public ShopItemView(UberStrikeCurrencyType currency, int price)
 {
     if (currency != UberStrikeCurrencyType.Credits)
     {
         if (currency != UberStrikeCurrencyType.Points)
         {
             this.UnityItem = null;
             this.Points    = 0;
             this.Credits   = 0;
         }
         else
         {
             this.UnityItem = new PointsUnityItem(price);
             this.Credits   = 0;
             this.Points    = price;
         }
     }
     else
     {
         this.UnityItem = new CreditsUnityItem(price);
         this.Points    = 0;
         this.Credits   = price;
     }
     this.ItemId   = 0;
     this.Duration = BuyingDurationType.None;
 }
Ejemplo n.º 3
0
 // Token: 0x06000C1F RID: 3103 RVA: 0x00050D38 File Offset: 0x0004EF38
 public static Texture2D CurrencyIcon(UberStrikeCurrencyType currency)
 {
     if (currency == UberStrikeCurrencyType.Credits)
     {
         return(ShopIcons.IconCredits20x20);
     }
     if (currency != UberStrikeCurrencyType.Points)
     {
         return(null);
     }
     return(ShopIcons.IconPoints20x20);
 }
Ejemplo n.º 4
0
    // Token: 0x06001C7B RID: 7291 RVA: 0x00090130 File Offset: 0x0008E330
    public static GUIContent PriceTag(this ItemPrice price, bool printCurrency = false, string tooltip = "")
    {
        UberStrikeCurrencyType currency = price.Currency;

        if (currency == UberStrikeCurrencyType.Credits)
        {
            return(new GUIContent(price.Price.ToString("N0") + ((!printCurrency) ? string.Empty : "Credits"), ShopIcons.IconCredits20x20, tooltip));
        }
        if (currency != UberStrikeCurrencyType.Points)
        {
            return(new GUIContent("N/A"));
        }
        return(new GUIContent(price.Price.ToString("N0") + ((!printCurrency) ? string.Empty : "Points"), ShopIcons.IconPoints20x20, tooltip));
    }
Ejemplo n.º 5
0
    // Token: 0x06000C1D RID: 3101 RVA: 0x00050C0C File Offset: 0x0004EE0C
    public static ItemPrice GetLowestPrice(IUnityItem item, UberStrikeCurrencyType currency = UberStrikeCurrencyType.None)
    {
        ItemPrice itemPrice = null;

        if (item != null && item.View != null && item.View.Prices != null)
        {
            foreach (ItemPrice itemPrice2 in item.View.Prices)
            {
                if ((currency == UberStrikeCurrencyType.None || itemPrice2.Currency == currency) && (itemPrice == null || itemPrice.Price > itemPrice2.Price))
                {
                    itemPrice = itemPrice2;
                }
            }
        }
        return(itemPrice);
    }
Ejemplo n.º 6
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);
        }
Ejemplo n.º 7
0
 public abstract BuyItemResult OnBuyItem(int itemId, string authToken, UberStrikeCurrencyType currencyType, BuyingDurationType durationType, UberStrikeItemType itemType, BuyingLocationType marketLocation, BuyingRecommendationType recommendationType);