Beispiel #1
0
 private void DealError(EB.Sparx.Response result)
 {
     if (result.error.ToString() == "ID_ERROR_NOT_IN_BATTLE")
     {
         LoadingSpinner.Hide();
         if (!LTCombatEventReceiver.Instance.IsBattleOver)
         {
             EB.Sparx.Request request2 = endPoint.Get("/playstate/getPlayState");
             endPoint.Service(request2, (result2) => {
                 if (result != null)
                 {
                     DataLookupsCache.Instance.CacheData(result2.hashtable);
                     LTCombatHudController.Instance.ShowBattleResultScreen(SceneLogic.BattleType, MainLandLogic.GetInstance().m_CombatOutCome, false);
                 }
             });
         }
     }
     else if (result.error.ToString().Contains("user is in another battle, combat_id = "))
     {
         BattleResultScreenController.DirectExitCombat();
     }
     else if (result.error.ToString().Contains("EndWrite failure") || result.error.ToString().Contains("ID_SPARX_ERROR_NOT_CONNECTED"))
     {
         SparxHub.Instance.Disconnect(false);
         MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_SPARX_ERROR_NOT_CONNECTED"));
     }
     else if (result.error.ToString().Contains("socket hang up") || result.error.ToString().Contains("connection timed out"))
     {
         EB.Debug.LogError(result.error);
         SparxHub.Instance.Disconnect(false);
         MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_SPARX_ERROR_NOT_CONNECTED"));
     }
     else
     {
         EB.Debug.LogError(result.error);
     }
 }
Beispiel #2
0
 public override void Dispose()
 {
     Hotfix_LT.Messenger.RemoveListener <int, System.Action <EB.Sparx.Response> >(Hotfix_LT.EventName.CombatCleanUp, RequestExitCombat);
     Hotfix_LT.Messenger.RemoveListener(Hotfix_LT.EventName.DirectExitCombat, delegate() { BattleResultScreenController.DirectExitCombat(); });
     Hotfix_LT.Messenger.RemoveListener <string, Hashtable>(Hotfix_LT.EventName.DoDebugAction, DoDebugAction);
 }
Beispiel #3
0
        public override void Initialize(EB.Sparx.Config config)
        {
            s_endpoint = SparxHub.Instance.ApiEndPoint;
            Hotfix_LT.Messenger.AddListener <int, System.Action <EB.Sparx.Response> >(Hotfix_LT.EventName.CombatCleanUp, RequestExitCombat);
            Hotfix_LT.Messenger.AddListener(Hotfix_LT.EventName.DirectExitCombat, delegate() { BattleResultScreenController.DirectExitCombat(); });
            Hotfix_LT.Messenger.AddListener <string, Hashtable>(Hotfix_LT.EventName.DoDebugAction, DoDebugAction);

            LT.MainMessenger.AddListener <int, Action <Response> >("CombatEditorRequestExitCombat", RequestExitCombat);
        }