// Token: 0x0600128E RID: 4750 RVA: 0x0006E744 File Offset: 0x0006C944
 private void OnMicroTxnCallback(MicroTxnAuthorizationResponse_t param)
 {
     Debug.Log("Steam MicroTxnParams: " + param);
     if (param.m_bAuthorized > 0)
     {
         ShopWebServiceClient.FinishBuyBundleSteam(param.m_ulOrderID.ToString(), delegate(bool success)
         {
             if (success)
             {
                 PopupSystem.ClearAll();
                 PopupSystem.ShowMessage("Purchase Successful", "Thank you, your purchase was successful.", PopupSystem.AlertType.OK, delegate()
                 {
                     ApplicationDataManager.RefreshWallet();
                 });
             }
             else
             {
                 Debug.Log("Managed error from WebServices");
                 PopupSystem.ClearAll();
                 PopupSystem.ShowMessage("Purchase Failed", "Sorry, there was a problem processing your payment. Please visit support.uberstrike.com for help.", PopupSystem.AlertType.OK);
             }
         }, delegate(Exception ex)
         {
             Debug.Log(ex.Message);
             PopupSystem.ClearAll();
             PopupSystem.ShowMessage("Purchase Failed", "Sorry, there was a problem processing your payment. Please visit support.uberstrike.com for help.", PopupSystem.AlertType.OK);
         });
     }
     else
     {
         Debug.Log("Purchase canceled");
         PopupSystem.ClearAll();
     }
 }
 // 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);
         });
     }
 }
Example #3
0
 // Token: 0x0600108F RID: 4239 RVA: 0x00066978 File Offset: 0x00064B78
 private void UseConsumableItem(InventoryItem inventoryItem)
 {
     if (this.IsConsumptionEnabled)
     {
         ShopWebServiceClient.UseConsumableItem(PlayerDataManager.AuthToken, inventoryItem.Item.View.ID, null, null);
         inventoryItem.AmountRemaining--;
         if (inventoryItem.AmountRemaining == 0)
         {
             UnityRuntime.StartRoutine(Singleton <ItemManager> .Instance.StartGetInventory(false));
         }
     }
 }
    // Token: 0x06001292 RID: 4754 RVA: 0x0006E840 File Offset: 0x0006CA40
    public void Initialize()
    {
        this.MicroTxnCallback = Callback <MicroTxnAuthorizationResponse_t> .Create(new Callback <MicroTxnAuthorizationResponse_t> .DispatchDelegate(this.OnMicroTxnCallback));

        ShopWebServiceClient.GetBundles(ApplicationDataManager.Channel, delegate(List <BundleView> bundles)
        {
            this.SetBundles(bundles);
        }, delegate(Exception exception)
        {
            Debug.LogError("Error getting " + ApplicationDataManager.Channel + " bundles from the server.");
        });
    }
Example #5
0
    // Token: 0x0600140C RID: 5132 RVA: 0x00073F38 File Offset: 0x00072138
    public IEnumerator StartGetShop()
    {
        yield return(ShopWebServiceClient.GetShop(delegate(UberStrikeItemShopClientView shop)
        {
            if (shop != null)
            {
                this.UpdateShopItems(shop);
                WeaponConfigurationHelper.UpdateWeaponStatistics(shop);
            }
            else
            {
                Debug.LogError("ShopWebServiceClient.GetShop returned with NULL");
            }
        }, delegate(Exception ex)
        {
            Debug.LogError(ex);
        }));

        yield break;
    }
    // Token: 0x06001295 RID: 4757 RVA: 0x0006E9EC File Offset: 0x0006CBEC
    public void BuyBundle(BundleUnityView bundle)
    {
        Debug.Log("Trying to buy bundle with id id: " + bundle.BundleView.Id.ToString());
        int    id        = bundle.BundleView.Id;
        string steamId   = PlayerDataManager.SteamId;
        string authToken = PlayerDataManager.AuthToken;

        ShopWebServiceClient.BuyBundleSteam(id, steamId, authToken, delegate(bool success)
        {
            if (!success)
            {
                Debug.Log("Starting steam payment failed! (Handled WS Error)");
                PopupSystem.ClearAll();
                PopupSystem.ShowMessage("Purchase Failed", "Sorry, there was a problem processing your payment. Please visit support.uberstrike.com for help.", PopupSystem.AlertType.OK);
            }
        }, delegate(Exception ex)
        {
            Debug.Log(ex.Message);
            PopupSystem.ClearAll();
            PopupSystem.ShowMessage("Purchase Failed", "Sorry, there was a problem processing your payment. Please visit support.uberstrike.com for help.", PopupSystem.AlertType.OK);
        });
        this._appStorePopup = (PopupSystem.ShowMessage("In App Purchase", "Purchasing, please wait...", PopupSystem.AlertType.None) as BasePopupDialog);
        UnityRuntime.StartRoutine(this.StartCancelDialogTimer());
    }
Example #7
0
        public void Load(string authToken)
        {
            if (authToken == null)
            {
                throw new ArgumentNullException(nameof(authToken));
            }

            //TODO: Provide some base class for this kind of server-server communications.
            var bytes = Convert.FromBase64String(authToken);
            var data  = Encoding.UTF8.GetString(bytes);

            var webServer = data.Substring(0, data.IndexOf("#####"));

            // Retrieve loadout data from the web server.
            var client   = new ShopWebServiceClient(webServer);
            var shopView = client.GetShop();

            _functionalItems = LoadDictionary(shopView.FunctionalItems);
            _gearItems       = LoadDictionary(shopView.GearItems);
            _quickItems      = LoadDictionary(shopView.QuickItems);
            _weaponItems     = LoadDictionary(shopView.WeaponItems);

            _isLoaded = true;
        }