protected void OnTransfer(EB.Sparx.Response result) { if (result.sucessful) { CleanMainLandData(); DataLookupsCache.Instance.CacheData(result.hashtable); if (result.hashtable == null) { EB.Debug.LogError("mainland session data in DB is null."); } else { if (!result.hashtable.Contains("mainlands")) { EB.Debug.LogError("Wrong mainland session data format in response to campaign start request."); return; } Hashtable mainland = result.hashtable["mainlands"] as Hashtable; OnSceneEnter(mainland); } } else if (result.fatal) { SparxHub.Instance.FatalError(result.localizedError); } else { MessageDialog.Show(EB.Localizer.GetString("ID_MESSAGE_TITLE_STR"), result.localizedError, EB.Localizer.GetString("ID_MESSAGE_BUTTON_STR"), null, false, true, true, delegate(int ret) { UIStack.Instance.HideLoadingScreen(); }, NGUIText.Alignment.Center); } }
public virtual bool ProcessError(EB.Sparx.Response response, EB.Sparx.eResponseCode errCode) { if (ErrorHandler != null) { var dels = ErrorHandler.GetInvocationList(); foreach (var del in dels) { var func = del as System.Func <EB.Sparx.Response, EB.Sparx.eResponseCode, bool>; if (func(response, errCode)) { EB.Debug.Log("SparxAPI.ProcessError: process error {0} success", errCode); return(true); } } } if (GlobalErrorHandler != null) { var dels = GlobalErrorHandler.GetInvocationList(); foreach (var del in dels) { var func = del as System.Func <EB.Sparx.Response, EB.Sparx.eResponseCode, bool>; if (func(response, errCode)) { EB.Debug.Log("SparxAPI.ProcessError: process error {0} success", errCode); return(true); } } } EB.Debug.LogError("SparxAPI.ProcessError: request {0} failed, {1}:{2}", response.request.uri, errCode, response.error); return(false); }
public void OnRefresh(EB.Sparx.Response res) { LoadingSpinner.Hide(); if (res.sucessful) { //界面刷新由datalookup if (m_RefreshCostId == "hc") { FusionTelemetry.PostBuy(((int)FusionTelemetry.UseHC.hc_resetstore).ToString(), 1, refreshBlueCostCache); } ShowRefreshPrice(); StartCoroutine(RefreshFxPlay()); } else if (res.fatal) { SparxHub.Instance.FatalError(res.localizedError); } else { MessageTemplateManager.ShowMessage(901018, null, delegate(int result) { if (result == 0) { m_RefreshRequest.SendRequest(); LoadingSpinner.Show(); } }); } isRefresh = false; }
private void ProcessResult(EB.Sparx.Response response, System.Action <Hashtable> dataHandler) { if (!string.IsNullOrEmpty(response.error)) { if (response.error.Equals("timeout")) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_LTDrawCardAPI_3009")); dataHandler(null); } else { UIStack.Instance.ShowLoadingScreen(delegate { LoadingSpinner.Hide(); LTHotfixManager.GetManager <SceneManager>().RequestPlayState(); }, false, true); } return; } dataHandler = dataHandler ?? new System.Action <Hashtable>(DefaultDataHandler); if (ProcessResponse(response)) { dataHandler(response.hashtable); } else { dataHandler(null); } }
private bool FuncProcess(EB.Sparx.Response response) { if (response.error == null) { return(false); } string error = response.error.ToString(); if (error == "noChanges") { MessageTemplateManager.ShowMessage(eMessageUIType.MessageDialogue_1, EB.Localizer.GetString("ID_codefont_in_LegionNameEditView_3771")); return(true); } if (error == "name_min_len" || error == "need top set name or notice") { MessageTemplateManager.ShowMessage(eMessageUIType.MessageDialogue_1, EB.Localizer.GetString("ID_codefont_in_LegionLogic_11096")); return(true); } if (error.Equals("ID_ERROR_NAME_EXIST")) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_ERROR_NAME_EXIST")); return(true); } if (error.Equals("allianceWarService Exit")) { MessageTemplateManager.ShowMessage(eMessageUIType.MessageDialogue_1, EB.Localizer.GetString("ID_codefont_in_LegionNameEditView_4415")); return(true); } return(false); }
public override void OnFetchData(EB.Sparx.Response response, int reqInstanceID) { if (mDMono.gameObject == null || !mDMono.gameObject.activeInHierarchy) { //防止收到消息的时候,该物品已经被销毁或者隐藏了 return; } if (response.sucessful) { if (response.hashtable != null) { DataLookupsCache.Instance.CacheData(response.hashtable); } isRolling = true; StartCoroutine(ScrollDide()); } else if (response.fatal) { SparxHub.Instance.FatalError(response.localizedError); } else { EB.Debug.Log("worldboss/buyChallengeTimes——response =>{0}", response.hashtable.ToString()); } }
private void ProcessResult(EB.Sparx.Response response, System.Action <Hashtable> dataHandler) { dataHandler = dataHandler ?? new System.Action <Hashtable>(DefaultDataHandler); if (ExceptionFun != null && response.error != null) //处理Lostemp的异常 { string error = response.error.ToString(); if (ExceptionFun(error)) { ExceptionFun = null; return; } } ExceptionFun = null; if (ProcessResponse(response)) { dataHandler(response.hashtable); } else { dataHandler(null); } }
public override void OnFetchData(EB.Sparx.Response res, int id) { LoadingSpinner.Hide(); if (res.sucessful) { List <Hotfix_LT.Data.TimeLimitActivityStageTemplate> stageTmps = Hotfix_LT.Data.EventTemplateManager.Instance.GetTimeLimitActivityStages(ActivityId); if (LTHotfixManager.GetManager <TaskManager>().CurrentIndex < stageTmps.Count - 1) { LTHotfixManager.GetManager <TaskManager>().CurrentIndex++; } string cachePath; cachePath = "user_prize_data.taskacm_reward." + m_Chest.StageData.Id; DataLookupsCache.Instance.CacheData(cachePath, true); //上传友盟获得钻石,任务 int hcCount = 0; List <LTShowItemData> mlist = m_Chest.StageData.Awards; for (int i = 0; i < mlist.Count; i++) { if (mlist[i].id == "hc") { hcCount += mlist[i].count; } } FusionTelemetry.PostBonus(hcCount, Umeng.GA.BonusSource.Source2); GlobalMenuManager.Instance.Open("LTShowRewardView", m_Chest.StageData.Awards); UpdateChest(); } else { res.CheckAndShowModal(); //SparxHub.Instance.FatalError(res.localizedError); } }
public void OnCompleteTask(EB.Sparx.Response result) { InputBlockerManager.Instance.UnBlock(InputBlockReason.FUSION_BLOCK_UI_INTERACTION); if (result.sucessful) { if (result.hashtable != null) { DataLookupsCache.Instance.CacheData(result.hashtable); } List <LTShowItemData> mlist = TaskStaticData.GetItemRewardList(taskId); FusionTelemetry.ItemsUmengCurrency(mlist, "任务获得"); Hotfix_LT.Data.TaskTemplate taskTpl = Hotfix_LT.Data.TaskTemplateManager.Instance.GetTask(taskId); FusionTelemetry.TaskData.PostEvent(taskId, taskTpl.task_name, taskTpl.task_type.ToString()); if (mlist.Count > 0) { var ht = Johny.HashtablePool.Claim(); ht.Add("reward", mlist); GlobalMenuManager.Instance.Open("LTShowRewardView", ht); } } else { result.CheckAndShowModal(); } }
public override void OnFetchData(EB.Sparx.Response res, int reqInstanceID) { LoadingSpinner.Hide(); if (res.sucessful) { string key = mTaskType == eTaskType.Normal?"user_prize_data.taskliveness_reward.":"user_prize_data.taskliveness_week_reward."; string cachePath = key + m_CurrReceiveChest.StageData.Id; DataLookupsCache.Instance.CacheData(cachePath, true); //上传友盟获得钻石,任务 int hcCount = 0; List <LTShowItemData> mlist = m_CurrReceiveChest.StageData.Awards; for (int i = 0; i < mlist.Count; i++) { if (mlist[i].id == "hc") { hcCount += mlist[i].count; } } FusionTelemetry.PostBonus(hcCount, Umeng.GA.BonusSource.Source2); GlobalMenuManager.Instance.Open("LTShowRewardView", m_CurrReceiveChest.StageData.Awards); } else { res.CheckAndShowModal(); } }
public void GlobalApiResultSyncHandler(EB.Sparx.Response response) { if (response.async != null) { HandleResult(response.async); response.async = null; } }
public void EndPointPostAsyncHandler(EB.Sparx.Response response) { if (response.async != null) { HandleResult(response.async); response.async = null; } }
public void OnReject(EB.Sparx.Response result) { EB.Debug.Log("OnReject: {0}", result.text); if (result.sucessful) { } else { MessageTemplateManager.ShowMessage(902069); } }
private void ProcessResult(EB.Sparx.Response response, System.Action <Hashtable> dataHandler) { dataHandler = dataHandler ?? new System.Action <Hashtable>(DefaultDataHandler); if (ProcessResponse(response)) { dataHandler(response.hashtable); } else { dataHandler(null); } }
public void OnAccept(EB.Sparx.Response result) { EB.Debug.Log("OnAccept: {0}", result.text); if (result.sucessful) { DataLookupsCache.Instance.CacheData(result.hashtable); } else { MessageTemplateManager.ShowMessage(902069); } }
public void OnResponse(EB.Sparx.Response res) { LoadingSpinner.Hide(); if (res.sucessful) { ShowAward(res.hashtable); } else if (res.fatal) { SparxHub.Instance.FatalError(res.localizedError); } }
public void OnTaskResult(EB.Sparx.Response result) { if (result.sucessful) { DataLookupsCache.Instance.CacheData(result.hashtable); Messenger.Raise(Hotfix_LT.EventName.BountyTask_Select); } else { EB.Debug.LogError("SparxHub.Instance.GetManager<EB.Sparx.TaskManager>().RequestSetBountyHero => error = {0}", result.error); } }
protected virtual bool ProcessResult(EB.Sparx.Response response) { if (ResultHandler != null) { ResultHandler(response); } if (GlobalResultHandler != null) { GlobalResultHandler(response); } return(true); }
public override bool ProcessResponse(EB.Sparx.Response response) { if (!response.sucessful && response.fatal) { EB.Debug.LogError("SparxAPI.ProcessResponse: error {0} occur when request {1}", response.error, response.request.uri); ProcessError(response, CheckError(response.error.ToString())); return(false); } if (!response.sucessful) { string errStr = response.error.ToString(); if (errStr != null && errStr.Equals("ID_FIELD_HAVE_FULL")) { GlobalMenuManager.Instance.RemoveCache("AllianceHudUI"); GlobalMenuManager.Instance.RemoveCache("AllianceBattleResultUI"); GlobalMenuManager.Instance.CloseMenu("AllianceBattleResultUI"); AlliancesManager.Instance.BattleInfo.IsFieldFull = true; } else if (errStr != null && errStr.Equals("ID_FIELD_CONDITION_NOT_MEET")) { MessageTemplateManager.ShowMessage(902187, null, delegate(int result) { if (result == 0) { GlobalMenuManager.Instance.RemoveCache("AllianceHudUI"); GlobalMenuManager.Instance.RemoveCache("AllianceBattleResultUI"); GlobalMenuManager.Instance.CloseMenu("AllianceBattleResultUI"); } }); return(false); } else if (errStr != null && (errStr.Equals("ID_ALLIANCE_NOT_IN_TRANSFER") || errStr.Equals("ID_ALLIANCE_ROBED"))) { AlliancesManager.Instance.GetRobInfo(); } EB.Sparx.eResponseCode errCode = CheckError(response.error.ToString()); if (errCode != EB.Sparx.eResponseCode.Success && !ProcessError(response, errCode)) { EB.Debug.LogError("SparxAPI.ProcessResponse: request {0} failed, {1}", response.request.uri, response.error); return(false); } } return(ProcessResult(response)); }
public void OnInvitePK(EB.Sparx.Response result) { EB.Debug.Log("OnInvitePK: {0}", result.text); if (!result.sucessful) { MessageDialog.Show(EB.Localizer.GetString("ID_DIALOG_TITLE_TIPS"), result.localizedError, EB.Localizer.GetString("ID_DIALOG_TITLE_CONFIRM"), null, false, true, true, null, NGUIText.Alignment.Center); } controller.Close(); if (result.hashtable != null) { int errCode = EB.Dot.Integer("errCode", result.hashtable, -1); switch ((PkErrCode)errCode) { case PkErrCode.Busying: MessageTemplateManager.ShowMessage(902069); return; case PkErrCode.NotReceivePkRequest: EB.Debug.Log("receivePkRequest = false"); MessageTemplateManager.ShowMessage(902069); return; default: break; } } if (curType == OtherPlayerInfoViewType.FROM_CHAT) { var ht = Johny.HashtablePool.Claim(); ht.Add("name", curPlayerName); ht.Add("uid", m_Uid); GlobalMenuManager.Instance.Open("PkSendRequestUI", ht); var ht2 = Johny.HashtablePool.Claim(); ht2.Add("0", curPlayerName); MessageTemplateManager.ShowMessage(902145, ht2, null); Johny.HashtablePool.Release(ht2); } else { var ht = Johny.HashtablePool.Claim(); ht.Add("name", GetNameByUid(m_Uid)); ht.Add("uid", m_Uid); GlobalMenuManager.Instance.Open("PkSendRequestUI", ht); var ht2 = Johny.HashtablePool.Claim(); ht2.Add("0", GetNameByUid(m_Uid)); MessageTemplateManager.ShowMessage(902145, ht2, null); Johny.HashtablePool.Release(ht2); } }
static StackObject *get_error_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); EB.Sparx.Response instance_of_this_method = (EB.Sparx.Response) typeof(EB.Sparx.Response).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); var result_of_this_method = instance_of_this_method.error; return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method)); }
public override void OnFetchData(EB.Sparx.Response res, int reqInstanceID) { if (res.sucessful) { VictoryAnimNode.CustomSetActive(true); FusionAudio.PostEvent("MUS/CombatView/Stinger/Victory", controller.gameObject, true); LTBountyTaskHudController.DeleteMonster(mNpcLocator); GameDataSparxManager.Instance.ProcessIncomingData(res.result, true); } else { res.CheckAndShowModal(); BtnClickLimit = false; } }
public override void OnFetchData(EB.Sparx.Response res, int reqInstanceID) { LoadingSpinner.Hide(); if (res.sucessful) { UIInventoryBagLogic.Instance.FirstItem = null; ShowAward(res.hashtable); DataLookupsCache.Instance.CacheData(res.hashtable); UIInventoryBagLogic.Instance.RefeshBag(CurType); } else if (res.fatal) { SparxHub.Instance.FatalError(res.localizedError); } }
static StackObject *get_empty_13(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); EB.Sparx.Response instance_of_this_method = (EB.Sparx.Response) typeof(EB.Sparx.Response).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); var result_of_this_method = instance_of_this_method.empty; __ret->ObjectType = ObjectTypes.Integer; __ret->Value = result_of_this_method ? 1 : 0; return(__ret + 1); }
static StackObject *set_sucessful_12(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Boolean @value = ptr_of_this_method->Value == 1; ptr_of_this_method = ILIntepreter.Minus(__esp, 2); EB.Sparx.Response instance_of_this_method = (EB.Sparx.Response) typeof(EB.Sparx.Response).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); instance_of_this_method.sucessful = value; return(__ret); }
public override void OnFetchData(EB.Sparx.Response res, int reqInstanceID) { base.OnFetchData(res, reqInstanceID); if (reqInstanceID == GetInfoRequest.GetInstanceID()) { OnGetInfoResponse(res); } if (reqInstanceID == BuyTimesRequest.GetInstanceID()) { OnBuyResponse(res); } if (reqInstanceID == RollRequest.GetInstanceID()) { OnInitRollDiceInfoResponse(res); } }
private void ProcessResult(EB.Sparx.Response response, System.Action <Hashtable> dataHandler) { dataHandler = dataHandler ?? new System.Action <Hashtable>(DefaultDataHandler); if (response.error != null) { EB.Debug.LogError(response.error); } if (blockErrorFunc != null) { if (!blockErrorFunc(response)) { if (ProcessResponse(response)) { dataHandler(response.hashtable); } else { dataHandler(null); } } else { if (response.sucessful) { dataHandler(response.hashtable); } else { dataHandler(null); } } blockErrorFunc = null; } else { if (ProcessResponse(response)) { dataHandler(response.hashtable); } else { dataHandler(null); } } }
static StackObject *CheckAndShowModal_1(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); EB.Sparx.Response @response = (EB.Sparx.Response) typeof(EB.Sparx.Response).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); var result_of_this_method = global::eResponseCodeUIExtensions.CheckAndShowModal(@response); __ret->ObjectType = ObjectTypes.Integer; __ret->Value = result_of_this_method ? 1 : 0; return(__ret + 1); }
private void ProcessError(EB.Sparx.Response response) { if (response.fatal) { EB.Debug.LogError("LTHeroBattleAPI.ProcessError: error {0} occur when request {1}", response.error, response.request.uri); ProcessError(response, CheckError(response.error.ToString())); } else { EB.Sparx.eResponseCode errCode = CheckError(response.error.ToString()); if (errCode != EB.Sparx.eResponseCode.Success && !ProcessError(response, errCode)) { EB.Debug.LogError("LTHeroBattleAPI.ProcessError: request {0} failed, {1}", response.request.uri, response.error); } } }
static StackObject *set_hashtable_8(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Collections.Hashtable @value = (System.Collections.Hashtable) typeof(System.Collections.Hashtable).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); EB.Sparx.Response instance_of_this_method = (EB.Sparx.Response) typeof(EB.Sparx.Response).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); instance_of_this_method.hashtable = value; return(__ret); }