Ejemplo n.º 1
0
 internal void Failed(SocketError failureReason)
 {
     DeliveryPending = false;
     DeliveryFailed  = true;
     TransactionTraceMessage?.Invoke(this, $"Transaction failed {failureReason} {this.TransactionFinalResponse?.ShortDescription}");
     TransactionFailed?.Invoke(this, failureReason);
     UpdateTransactionState(SIPTransactionStatesEnum.Terminated);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Marks a transaction as expired and prevents any more delivery attempts of outstanding
 /// requests of responses.
 /// </summary>
 internal void Expire(DateTime now)
 {
     DeliveryPending = false;
     DeliveryFailed  = true;
     TimedOutAt      = now;
     HasTimedOut     = true;
     TransactionTraceMessage?.Invoke(this, $"Transaction failed due to a timeout {this.TransactionFinalResponse?.ShortDescription}");
     TransactionFailed?.Invoke(this, SocketError.TimedOut);
     UpdateTransactionState(SIPTransactionStatesEnum.Terminated);
 }
        private async Task FailAsync(IMessageHandlerContext context)
        {
            await _ethereumTransactionService.FailAsync(Data.TransactionHash);

            var message = new TransactionFailed {
                TransactionHash = Data.TransactionHash
            };
            await context.Publish(message);

            MarkAsComplete();
        }
Ejemplo n.º 4
0
 public override void Begin()
 {
     try
     {
         base.Begin();
     }
     catch (TransactionException e)
     {
         this.Logger.TryLogFail(() => TransactionFailed.Fire(this, new TransactionFailedEventArgs(this, e)));
         throw;
     }
 }
Ejemplo n.º 5
0
 public override void Rollback()
 {
     try
     {
         base.Rollback();
         this.Logger.TryLogFail(() => TransactionRolledBack.Fire(this, new TransactionEventArgs(this)));
     }
     catch (TransactionException e)
     {
         this.Logger.TryLogFail(() => TransactionFailed.Fire(this, new TransactionFailedEventArgs(this, e)));
         throw;
     }
 }
Ejemplo n.º 6
0
 public override void Commit()
 {
     try
     {
         base.Commit();
         _Logger.TryLogFail(() => TransactionCompleted.Fire(this, new TransactionEventArgs(this)));
     }
     catch (TransactionException e)
     {
         _Logger.TryLogFail(() => TransactionFailed.Fire(this, new TransactionFailedEventArgs(this, e)));
         throw;
     }
 }
 private void FailedHandler(object sender, TransactionFailedEventArgs e)
 {
     TransactionFailed.Fire(this, e);
 }
Ejemplo n.º 8
0
 public Task Handle(TransactionFailed message, IMessageHandlerContext context)
 {
     MarkAsComplete();
     return(Task.CompletedTask);
 }
Ejemplo n.º 9
0
    private IEnumerator DQItemList()
    {
        string  url  = Link.url + "DQuest";
        WWWForm form = new WWWForm();

        form.AddField("MY_ID", PlayerPrefs.GetString(Link.ID));
        //form.AddField ("SHOP_JENIS", "SPECIAL");
        WWW www = new WWW(url, form);

        yield return(www);

        if (www.error == null)
        {
            Debug.Log(www.text);
            var jsonString = JSON.Parse(www.text);
            //PlayerPrefs.SetString (Link.FOR_CONVERTING, jsonString["ID_SHOP_SPECIAL"]);
            if (int.Parse(jsonString["code"]) == 1)
            {
                GameObject[] entry;
                entry = new GameObject[int.Parse(jsonString["count"])];

                for (int x = DQViewer.childCount - 1; x >= 0; x--)
                {
                    Destroy(DQViewer.GetChild(x).gameObject);
                }
                for (int x = 0; x < int.Parse(jsonString["count"]); x++)
                {
                    entry[x] = Instantiate(DQItem);
                    entry[x].GetComponent <questItem>().QM           = this.GetComponent <QuestManager>();
                    entry[x].GetComponent <questItem>().QuestID      = jsonString["data"][x]["ID"];
                    entry[x].GetComponent <questItem>().Type         = jsonString["data"][x]["Type"];
                    entry[x].GetComponent <questItem>().Mission.text = jsonString["data"][x]["Title"] + " " + jsonString["data"][x]["Quest_Times"] + " Times";
                    int lol    = 0;
                    var number = int.TryParse(jsonString["data"][x]["Quest_Done"], out lol);

                    if (number)
                    {
                        if (lol == 1)
                        {
                            entry[x].GetComponent <questItem>().Stats.text = "Finished";
                            string String = jsonString["data"][x]["Type"];
                            if (String == "Summon")
                            {
                                PlayerPrefs.SetString("SummonMissionStats", "FALSE");
                            }
                            if (String == "SingleMode")
                            {
                                PlayerPrefs.SetString("SoloMissionStats", "FALSE");
                            }
                            if (String == "Catch")
                            {
                                PlayerPrefs.SetString("CatchMissionStats", "FALSE");
                            }
                        }
                        else
                        {
                            string String = jsonString["data"][x]["Type"];
                            entry[x].GetComponent <questItem>().Stats.text = "Ongoing";
                            if (String == "Summon")
                            {
                                PlayerPrefs.SetString("SummonMissionStats", "TRUE");
                                PlayerPrefs.SetString("SummonMissionQD", jsonString["data"][x]["ID"]);
                            }
                            if (String == "SingleMode")
                            {
                                PlayerPrefs.SetString("SoloMissionStats", "TRUE");
                                PlayerPrefs.SetString("SoloMissionQD", jsonString["data"][x]["ID"]);
                            }
                            if (String == "Catch")
                            {
                                PlayerPrefs.SetString("CatchMissionStats", "TRUE");
                                PlayerPrefs.SetString("CatchMissionQD", jsonString["data"][x]["ID"]);
                            }
                        }
                        //     Debug.Log(PlayerPrefs.GetString("SoloMissionQD"));
                    }
                    else
                    {
                        entry[x].GetComponent <questItem>().Stats.text = "Ongoing";
                    }
                    int lal   = 0;
                    var namba = int.TryParse(jsonString["data"][x]["Quest_Redeem"], out lal);
                    if (namba)
                    {
                        if (lal == 1)
                        {
                            entry[x].GetComponent <questItem>().Redeemstats = "1";
                        }
                        else
                        {
                            entry[x].GetComponent <questItem>().Redeemstats = "0";
                        }
                    }
                    else
                    {
                        entry[x].GetComponent <questItem>().Redeemstats = "0";
                    }

                    entry[x].GetComponent <questItem>().RT = jsonString["data"][x]["Quest_RT"];
                    entry[x].GetComponent <questItem>().RQ = jsonString["data"][x]["Quest_RQ"];

                    PlayerPrefs.SetString(Link.FOR_CONVERTING, jsonString["data"][x]["ItemType"]);
                    entry[x].transform.SetParent(DQViewer, false);
                }
            }
            else
            {
                TransactionFailed.SetActive(true);
                Debug.Log("NoMission");
            }
        }
        else
        {
            Debug.Log(www.text);
            Debug.Log("NoMission");
        }
    }