コード例 #1
0
    public void RemoveRcoveryItemData(NIAPPurchase ConsumeItem)
    {
        if (this.m_RecoveryItem == null)
        {
            return;
        }
        this.m_bRecovery = false;
        if (this.m_RecoveryItem != null)
        {
            this.m_RecoveryItem = null;
        }
        this.m_PurchaseList.Remove(ConsumeItem.getProductCode());
        if (NrTSingleton <GameGuideManager> .Instance.ExecuteGuide)
        {
            GameGuideDlg gameGuideDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.GAMEGUIDE_DLG) as GameGuideDlg;

            if (gameGuideDlg != null)
            {
                if (NrTSingleton <GameGuideManager> .Instance.ContinueCheck(GameGuideType.PURCHASE_RESTORE))
                {
                    gameGuideDlg.SetTalkText();
                }
                else
                {
                    gameGuideDlg.ClickClose(null);
                }
            }
        }
        else
        {
            NrTSingleton <GameGuideManager> .Instance.RemoveGuide(GameGuideType.PURCHASE_RESTORE);
        }
    }
コード例 #2
0
    public void Consume()
    {
        NIAPPurchase pItem = null;

        if (this.m_bRecovery)
        {
            pItem = this.m_RecoveryItem;
        }
        else
        {
            pItem = this.m_pResult;
        }
        if (pItem != null)
        {
            if (pItem.getOriginalPurchaseAsJsonText() != null && pItem.getSignature() != null)
            {
                NIAPNativeExtension.Instance.requestConsume(pItem.getOriginalPurchaseAsJsonText(), pItem.getSignature(), delegate(NIAPResult niapResult)
                {
                    this.RemoveRcoveryItemData(pItem);
                }, delegate(NIAPResultError error)
                {
                    Debug.Log("consumePurchaseFailedEvent: " + error);
                    BillingManager_NStore component = BillingManager_NStore.Instance.GetComponent <BillingManager_NStore>();
                    if (component != null && component.m_RecoveryItem != null)
                    {
                        GS_BILLING_ITEM_RECODE_REQ gS_BILLING_ITEM_RECODE_REQ = new GS_BILLING_ITEM_RECODE_REQ();
                        gS_BILLING_ITEM_RECODE_REQ.i8Type           = 2;
                        gS_BILLING_ITEM_RECODE_REQ.i8Result         = 1;
                        gS_BILLING_ITEM_RECODE_REQ.i64ItemMallIndex = NrTSingleton <ItemMallItemManager> .Instance.GetItemIndex(pItem.getProductCode());
                        NrTSingleton <ItemMallItemManager> .Instance.RecodeErrorMessage(ref gS_BILLING_ITEM_RECODE_REQ, string.Format("requestConsume error code : {0} , error message : {1}", error.getCode(), error.getMessage()));
                        SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_BILLING_ITEM_RECODE_REQ, gS_BILLING_ITEM_RECODE_REQ);
                    }
                    this.RemoveRcoveryItemData(pItem);
                    if (!this.m_ConsumeFailedList.Contains(pItem))
                    {
                        this.m_ConsumeFailedList.Add(pItem);
                    }
                });
            }
        }
        else if (pItem == null)
        {
            TsLog.LogError("pItem == NULL", new object[0]);
        }
    }