/// <summary> /// 任职新的军团长 /// </summary> /// <param name="aid"></param> /// <param name="uid"></param> /// <param name="dataHandler"></param> public void AllianceOwnerTransfer(int aid, long uid, System.Action <Hashtable> dataHandler) { EB.Sparx.Request request = endPoint.Post("/alliances/member/transfer"); request.AddData("aid", aid); request.AddData("uid", uid); BlockService(request, dataHandler); }
private void SendHeroWishReq(int infoId, System.Action <int> callback) { EB.Sparx.Request request = LTHotfixApi.GetInstance().Post("/specialactivity/ssrPartnerWish"); request.AddData("activityId", ssrWishActivityId); request.AddData("itemId", infoId + 1); LTHotfixApi.GetInstance().ExceptionFunc = (EB.Sparx.Response response) => { if (response.error != null) { string strObjects = (string)response.error; string[] strObject = strObjects.Split(",".ToCharArray(), 2); switch (strObject[0]) { case "event is not running": { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_LTHeroBattleMatchHudController_10973")); TimerManager.instance.AddTimer(300, 1, timeSeq => GlobalMenuManager.Instance.CloseMenu("LTSSRWishPartnerHud")); return(true); } } } return(false); }; LTHotfixApi.GetInstance().BlockService(request, (Hashtable data) => { DataLookupsCache.Instance.CacheData(string.Format("tl_acs.{0}.current", ssrWishActivityId), infoId + 1); callback?.Invoke(infoId); TimerManager.instance.AddTimer(300, 1, timeSeq => GlobalMenuManager.Instance.CloseMenu("LTSSRWishPartnerHud")); }); }
public void StartBattle(int levelId, int battleType, Action <Hashtable> dataHandler) { EB.Sparx.Request request = endPoint.Post("/specialactivity/startChallenge"); request.AddData("type", battleType); request.AddData("id", levelId); BlockService(request, dataHandler); }
public void UnLockCardPosition(int type, int position, System.Action <Hashtable> dataHandler) { EB.Sparx.Request request = endPoint.Post("/buddy_mannual/unlock"); request.AddData("type", type); request.AddData("position", position); BlockService(request, dataHandler); }
public void Reject(int aid, string inviteId, System.Action <Hashtable> dataHandler) { EB.Sparx.Request request = endPoint.Post("/escortAndRob/reject"); request.AddData("aid", aid); request.AddData("inviteId", inviteId); BlockService(request, dataHandler); }
public void SetAllianceMarcenary(int heroId, int br, Action <Hashtable> callback) { EB.Sparx.Request request = endPoint.Post("/mercenary/setAllianceMercenary"); request.AddData("heroId", heroId); request.AddData("br", br); BlockService(request, callback); }
public void Complete(int aid, string id, System.Action <Hashtable> dataHandler) { EB.Sparx.Request request = endPoint.Post("/escortAndRob/complete"); request.AddData("aid", aid); request.AddData("id", id); BlockService(request, dataHandler); }
public void ApplyHelp(int aid, long uid, System.Action <Hashtable> dataHandler) { EB.Sparx.Request request = endPoint.Post("/escortAndRob/applyHelp"); request.AddData("aid", aid); request.AddData("uid", uid); BlockService(request, dataHandler); }
public void SendAllianceMail(string mailTitle, string mailText, Action <Hashtable> dataHandler) { EB.Sparx.Request request = endPoint.Post("/mailbox/sendAllianceMail"); request.AddData("mailTitle", mailTitle); request.AddData("mailText", mailText); BlockService(request, dataHandler); }
public void GetTransferInfo(int aid, long uid, System.Action <Hashtable> dataHandler) { EB.Sparx.Request request = endPoint.Post("/escortAndRob/getTransferInfo"); request.AddData("aid", aid); request.AddData("uid", uid); Service(request, dataHandler); }
public void StartCombat(List <int> data, int index, Func <EB.Sparx.Response, bool> responseFunc) { EB.Sparx.Request request = endPoint.Post("/clashofheroes/startCombatNewbie"); request.AddData("index", index); request.AddData("data", data); BlockService(request, responseFunc); }
public void SendUserMail(long receiverId, string mailTitle, string mailText, Action <Hashtable> dataHandler) { EB.Sparx.Request request = endPoint.Post("/mailbox/sendUserMail"); request.AddData("receiverId", receiverId); request.AddData("mailTitle", mailTitle); request.AddData("mailText", mailText); ArrayList giftArr = Johny.ArrayListPool.Claim(); IDictionary dic = new Dictionary <object, object> { { "type", "headframe" }, { "data", "8061" }, { "quantity", 1 } }; IDictionary dic1 = new Dictionary <object, object> { { "type", "headframe" }, { "data", "8051" }, { "quantity", 1 } }; IDictionary dic2 = new Dictionary <object, object> { { "type", "headframe" }, { "data", "8021" }, { "quantity", 1 } }; IDictionary dic3 = new Dictionary <object, object> { { "type", "res" }, { "data", "gold" }, { "quantity", 100 } }; giftArr.Add(dic); giftArr.Add(dic1); giftArr.Add(dic2); giftArr.Add(dic3); request.AddData("gift", giftArr); BlockService(request, dataHandler); }
public void UnUseAllianceMercenary(int heroId, int position, Action <Hashtable> dataHandler) { EB.Sparx.Request request = endPoint.Post("/mercenary/unUseAllianceMercenary"); request.AddData("heroId", heroId); request.AddData("position", position); BlockService(request, dataHandler); }
/// <summary> /// 移除 /// </summary> /// <param name="heroId"></param> /// <param name="teamName"></param> /// <param name="dataHandler"></param> public void RemoveHeroFromFormation(int heroId, string teamName, System.Action <Hashtable> dataHandler) { EB.Sparx.Request request = endPoint.Post("/team/removeHeroFromFormation"); request.AddData("heroId", heroId); request.AddData("teamName", teamName); BlockService(request, dataHandler); }
protected EventDelegate.Callback GetReward(int stage, System.Action refresh, System.Action err = null) { return(delegate() { LTHotfixApi.GetInstance().ExceptionFunc = (EB.Sparx.Response response) => { if (response.error != null) { string strObjects = (string)response.error; string[] strObject = strObjects.Split(",".ToCharArray(), 2); switch (strObject[0]) { case "insufficient num": { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_ACTIVITY_REALM_CHALLENGE_ERROR")); LTMainHudManager.Instance.UpdateActivityLoginData(err); return true; } } } return false; }; EB.Sparx.Request request = LTHotfixApi.GetInstance().Post("/specialactivity/gotReward"); request.AddData("activityId", activity_id); request.AddData("stageId", stage); LTHotfixApi.GetInstance().BlockService(request, delegate(Hashtable data) { DataLookupsCache.Instance.CacheData(data); refresh(); title.UpdateRedPoint(); List <LTShowItemData> awardDatas = GameUtils.ParseAwardArr(Hotfix_LT.EBCore.Dot.Array("reward", data, null)); GlobalMenuManager.Instance.Open("LTShowRewardView", awardDatas); }); }); }
public void GetSkillList(long uid, int aid, System.Action <Hashtable> dataHandler) { EB.Sparx.Request request = endPoint.Post("/alliances/getSkillList"); request.AddData("aid", aid); request.AddData("uid", uid); Service(request, dataHandler); }
/// <summary> /// 修改军团名称和图标的核心方法 /// </summary> private void OnClickChangeLegionName() { FusionAudio.PostEvent("UI/General/ButtonClick"); if (BtInput.value.Length <= 1) { MessageTemplateManager.ShowMessage(eMessageUIType.MessageDialogue_1, EB.Localizer.GetString("ID_codefont_in_LegionLogic_11096")); return; } if (iconID == data.legionIconID && BtInput.value == data.legionName) { MessageTemplateManager.ShowMessage(eMessageUIType.MessageDialogue_1, EB.Localizer.GetString("ID_codefont_in_LegionNameEditView_2604")); mDMono.gameObject.SetActive(false); return; } if (!EB.ProfanityFilter.Test(BtInput.value)) { MessageTemplateManager.ShowMessage(eMessageUIType.MessageDialogue_1, EB.Localizer.GetString("ID_codefont_in_LegionLogic_10580")); return; } if (BalanceResourceUtil.GetUserDiamond() < AlliancesManager.Instance.Config.RenameCost) { BalanceResourceUtil.HcLessMessage(); return; } LTHotfixApi.GetInstance().ExceptionFunc = FuncProcess;//截取异常进行处理 EB.Sparx.Request request = LTHotfixApi.GetInstance().Post("/alliances/rename"); request.AddData("aid", LegionModel.GetInstance().legionData.legionID); request.AddData("name", BtInput.value); request.AddData("iconID", iconID); LTHotfixApi.GetInstance().BlockService(request, ResProcess /* (Hashtable resData) => { }*/);//向服务器发送请求上传修改后的信息 //AlliancesManager.Instance.Detail.IconID = iconID;//容错步骤,如果发0给服务器,服务器不会下发该数据,这里先存储,如果服务器不下发就用这里设置的,服务器下发了用服务器的 mDMono.gameObject.SetActive(false); }
public void GiveMonthCard(int aid, long uid, System.Action <Hashtable> dataHandler) { EB.Sparx.Request request = endPoint.Post("/alliances/giveMonthCard"); request.AddData("aid", aid); request.AddData("uid", uid); BlockService(request, dataHandler); }
/// <summary> /// 创建军团 /// </summary> /// <param name="name"></param> /// <param name="iconID"></param> /// <param name="dataHandler"></param> public void CreateAlliance(string name, int iconID, System.Action <Hashtable> dataHandler) { EB.Sparx.Request request = endPoint.Post("/alliances/create"); request.AddData("name", name); request.AddData("iconID", iconID); BlockService(request, dataHandler); }
public void RefreshTransferList(int aid, long uid, System.Action <Hashtable> dataHandler) { EB.Sparx.Request request = endPoint.Post("/escortAndRob/refreshTransferList"); request.AddData("aid", aid); request.AddData("uid", uid); BlockService(request, dataHandler); }
/// <summary> /// 会长同意入会请求 /// </summary> /// <param name="aid"></param> /// <param name="uid"></param> /// <param name="dataHandler"></param> public void AcceptAllianceApplyRequest(int aid, long uid, System.Action <Hashtable> dataHandler) { EB.Sparx.Request request = endPoint.Post("/alliances/apply/accept"); request.AddData("aid", aid); request.AddData("uid", uid); Service(request, dataHandler); }
public void RobFight(long uid, string id, System.Action <Hashtable> dataHandler) { EB.Sparx.Request request = endPoint.Post("/escortAndRob/robfight"); request.AddData("uid", uid); request.AddData("id", id); BlockService(request, dataHandler); }
/// <summary> /// 军团获取事件信息 /// </summary> /// <param name="aid"></param> /// <param name="lastTime"></param> /// <param name="dataHandler"></param> public void AllianceGetMessages(int aid, double lastTime, System.Action <Hashtable> dataHandler) { EB.Sparx.Request request = endPoint.Post("/alliances/getAllianceLogs"); request.AddData("aid", aid); request.AddData("lastTime", lastTime); BlockService(request, dataHandler); }
//追加下注 public void RequestAddBet(int group, System.Action <int, bool> act) { #region local var gd = _groupDatas[group - 1]; gd.CurAddBetCount++; gd.CurBetAmount += GetOnceBetAmount(group); #endregion #region Send int pid = gd.OrderedPids[gd.CurBetPlayerNum - 1]; EB.Sparx.Request request = LTHotfixApi.GetInstance().Post("/buddyrun/supportBuddy"); request.AddData("groupId", group); request.AddData("playerId", pid); LTHotfixApi.GetInstance().BlockService(request, delegate(Hashtable data) { var strJson = EB.JSON.Stringify(data); EB.Debug.LogError(strJson); if (data.ContainsKey("buddyRun")) { HandleBetResponse(group, data, act); } else { act?.Invoke(group, false); } }); #endregion }
/// <summary> /// LSTP 军团使用的新捐献方法 /// </summary> /// <param name="aid"></param> /// <param name="type"></param> /// <param name="dataHandler"></param> public void AllianceDonate(int aid, string type, System.Action <Hashtable> dataHandler) { EB.Sparx.Request request = endPoint.Post("/alliances/detail/donate"); request.AddData("aid", aid); request.AddData("type", type); BlockService(request, dataHandler); }
public void GetAllianceDonateChest(int aid, int index, System.Action <Hashtable> dataHandler) { EB.Sparx.Request request = endPoint.Post("/alliances/getDonateChest"); request.AddData("aid", aid); request.AddData("chestId", index); BlockService(request, dataHandler); }
public void AdminNotice(int aid, string notice, System.Action <Hashtable> dataHandler) { EB.Sparx.Request request = endPoint.Post("/alliances/notice"); request.AddData("aid", aid); request.AddData("notice", notice); BlockService(request, dataHandler); }
private void OnClickURDrawCardBtn(int times) { if (!isCouldClick) { return; } isCouldClick = false; LTHotfixApi.GetInstance().ExceptionFunc = (EB.Sparx.Response response) => { if (response.error != null) { string strObjects = (string)response.error; string[] strObject = strObjects.Split(",".ToCharArray(), 2); switch (strObject[0]) { case "event is not running": { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_uifont_in_LTLegionWarQualify_End_4")); //活动已结束 return(true); } case "nsf": { MessageTemplateManager.ShowMessage(eMessageUIType.MessageDialogue_4, EB.Localizer.GetString("ID_codefont_in_NationBattleSelectTeamController_8317"), delegate(int result) { if (result == 0) { InputBlockerManager.Instance.Block(InputBlockReason.FUSION_BLOCK_UI_INTERACTION, 0.5f); GlobalMenuManager.Instance.Open("LTChargeStoreHud", null); } }); return(true); } } } return(false); }; EB.Sparx.Request request = LTHotfixApi.GetInstance().Post("/specialactivity/urbuddylottery"); request.AddData("activityId", activityId); request.AddData("times", times); LTHotfixApi.GetInstance().BlockService(request, delegate(Hashtable data) { DataLookupsCache.Instance.CacheData(data); DrawCardrp10.CustomSetActive(BalanceResourceUtil.GetUserDiamond() >= tenDrawcardcost);//跳过抽卡动画时,不会走setdata(),需要此处刷新 SetDiamondCostLabel(); if (scoreredtimer == 0) { scoreredtimer = ILRTimerManager.instance.AddTimer(1000, 1, SetScoreRewardRPState); } if (freedrawtimer == 0) { AddCountDownTimer(); } LTDrawCardDataManager.Instance.InitAllDrawPartner(data); object[] i = { (int)DrawCardType.ur, 1, "" }; GlobalMenuManager.Instance.Open("LTGetItemUI", i); isCouldClick = true; }); }
public void RequestDice(string diceType, int index, bool isBuy, System.Action <Hashtable> dataHandler) { EB.Sparx.Request request = SparxHub.Instance.ApiEndPoint.Post("/monopoly/rollDice"); request.AddData("diceType", diceType); request.AddData("index", index); request.AddData("isBuy", isBuy); BlockService(request, dataHandler); }
public void Agree(int aid, string inviteId, System.Action <Hashtable> dataHandler) { EB.Sparx.Request request = endPoint.Post("/escortAndRob/agree"); request.AddData("aid", aid); request.AddData("requesterId", AllianceUtil.GetLocalUid()); request.AddData("inviteId", inviteId); BlockService(request, dataHandler); }