private void OnGetMsg_ModfiyNickName(MobaMessage msg) { if (msg == null) { return; } OperationResponse operationResponse = msg.Param as OperationResponse; if (operationResponse == null) { return; } MobaMessageManagerTools.EndWaiting_manual("SummonerRegister"); int num = (int)operationResponse.Parameters[1]; MobaErrorCode mobaErrorCode = (MobaErrorCode)num; if (mobaErrorCode != MobaErrorCode.Ok) { if (mobaErrorCode != MobaErrorCode.NickNameExist) { this.ClickChangeName(num, operationResponse.DebugMessage, string.Empty); } else { this.ClickChangeName(num, operationResponse.DebugMessage, string.Empty); } } else { this.ClickChangeName(num, operationResponse.DebugMessage, string.Empty); } }
private void OnGetMsg_ModfiyAvatar(MobaMessage msg) { if (msg == null) { return; } OperationResponse operationResponse = msg.Param as OperationResponse; if (operationResponse == null) { return; } MobaMessageManagerTools.EndWaiting_manual("SummonerRegister"); int num = (int)operationResponse.Parameters[1]; MobaErrorCode mobaErrorCode = (MobaErrorCode)num; if (mobaErrorCode != MobaErrorCode.Ok) { this.ClickHeroHeadCallBack(num, operationResponse.DebugMessage); } else { this.ClickHeroHeadCallBack(num, operationResponse.DebugMessage); } }
private void ClickAllDemount(GameObject obj) { if (null != obj) { MobaMessageManagerTools.SendClientMsg(ClientV2C.propviewDemountAll, null, false); } }
private void RunesExtension(GameObject obj) { if (null != obj) { bool isNeedRefresh = true; RunesItem tempRunesItem = obj.GetComponent <RunesItem>(); if (null != this.lastRune && this.lastRune.RunePosition == tempRunesItem.RunePosition) { isNeedRefresh = false; } int limitLock = (int)tempRunesItem.LimitLock; if (limitLock == 0) { Singleton <TipView> .Instance.ShowViewSetText("召唤师等级" + tempRunesItem.RankRune + "级可使用", 1f); } else if (limitLock == 1) { GridHelper.FillGrid <RunesItem>(this.gridRunes, this.runesItem, this.Num, delegate(int idx, RunesItem comp) { comp.ChangeState(tempRunesItem); }); RunesPara runesPara = default(RunesPara); this.lastRune = tempRunesItem; runesPara.isNeedRefresh = isNeedRefresh; runesPara.runesItem = this.lastRune; MobaMessageManagerTools.SendClientMsg(ClientV2C.runesviewClickRune, runesPara, false); } } }
private void OnClick_ownShop(GameObject obj) { this.handlingRItem = null; EBattleShopType nearestShopType = BattleEquipTools_op.GetNearestShopType(); MobaMessageManagerTools.BattleShop_openBattleShop(nearestShopType, EBattleShopOpenType.eFromButton); }
private void OnClick_bagItem(BattleEquip_PossessItem com) { if (com.Initiative) { MobaMessageManagerTools.SendClientMsg(ClientV2C.BattleShop_clickItemInBag, com.ItemData, false); } }
private void OnMsg_GetActivityTask(MobaMessage msg) { ActivityData activityData = base.Data as ActivityData; OperationResponse operationResponse = msg.Param as OperationResponse; if (operationResponse != null) { base.LastError = (int)operationResponse.Parameters[1]; if (base.LastError == 0) { byte[] buffer = operationResponse.Parameters[124] as byte[]; activityData.listTask = SerializeHelper.Deserialize <List <ActivityTaskData> >(buffer); buffer = (operationResponse.Parameters[125] as byte[]); activityData.listHasReadActivity = SerializeHelper.Deserialize <List <int> >(buffer); this.UpdateActivityNewState(); MobaMessageManagerTools.SendClientMsg(ClientC2V.Receive_GetActivityTask, activityData, false); } else { ClientLogger.Error("OnMsg_GetActivityTask:mobaOpKey=" + base.LastError); } } else { ClientLogger.Error("OnMsg_GetActivityTask:,msg.Param=错误数据"); } base.Valid = (base.LastError == 0 && null != activityData); }
public override void SetData() { List <HeroInfoData> heroinfoList = ModelManager.Instance.GetDrawData().heroinfoList; Dictionary <string, SysHeroMainVo> typeDicByType = BaseDataMgr.instance.GetTypeDicByType <SysHeroMainVo>(); string text = string.Empty; if (typeDicByType != null) { text = typeDicByType.Values.FirstOrDefault((SysHeroMainVo obj) => obj.hero_id == base.ItemCount).npc_id; } if (base.RepeatList.Exists((DropItemData x) => x.itemCount == base.ItemCount)) { MobaMessageManagerTools.GetItems_Exchange(ItemType.Hero, text, true); } else { MobaMessageManagerTools.GetItems_Hero(text); } if (heroinfoList != null && heroinfoList.Count != 0) { foreach (HeroInfoData current in ModelManager.Instance.Get_heroInfo_list_X()) { foreach (HeroInfoData current2 in heroinfoList) { if (current.HeroId != current2.HeroId) { ModelManager.Instance.Get_heroInfo_list_X().Add(current2); } } } } }
private void PurchaseExpBall(GameObject obj) { if (null != obj) { MobaMessageManagerTools.SendClientMsg(ClientV2C.bottleSystemAddExpBall, null, false); } }
private void OnMsg_runesviewInitToggle(MobaMessage msg) { if (msg.Param != null) { string value = string.Empty; value = (string)msg.Param; this.heroNpc = value; RunesFunctionType runesFunctionType; if (string.IsNullOrEmpty(value)) { runesFunctionType = RunesFunctionType.Storage; } else { runesFunctionType = RunesFunctionType.Inlay; } if (this.dicToggle != null && this.dicToggle.ContainsKey(runesFunctionType)) { this.currType = runesFunctionType; this.dicToggle[runesFunctionType].value = true; if (this.currType == RunesFunctionType.Storage) { this.toggleType = RunesOverView.RuneToggleState.DisableInlay; } else { this.toggleType = RunesOverView.RuneToggleState.EnableInlay; } } this.bottomAnchor.gameObject.SetActive(this.currType == RunesFunctionType.Storage); MobaMessageManagerTools.SendClientMsg(ClientV2C.runesviewChangeToggle, runesFunctionType, false); } }
private void OnEnd_RevertShop(RetaMsg ret) { this.StopWaitCoroutine(); if (ret != null && ret.retaCode == 0) { if (this.DealingShop != null) { if (this.DealingShop.RollbackStack.Count > 0) { RollbackInfo rollbackInfo = this.DealingShop.RollbackStack.Pop(); this.SetRollbackInfo(rollbackInfo); } this.DealingShop.DealCounter--; } } else { MobaMessageManagerTools.SendClientMsg(ClientC2C.BattleShop_err, "撤销失败,errCode=" + ret.retaCode, false); } if (this.DealingShop != null) { this.DealingShop.State = EBattleShopState.eIdle; this.DealingShop = null; } }
private void PurchaseExp(GameObject obj = null) { if (null != obj && BottleViewCtrl.GetInstance().drawState == DrawState.Nothing) { MobaMessageManagerTools.SendClientMsg(ClientV2C.bottleSystemAddExpBall, null, false); } }
private void OnMsg_DemountCollection(MobaMessage msg) { if (msg != null) { if (!this.isExchange) { EquipmentInfoData equipmentinfodata = (EquipmentInfoData)msg.Param; GridHelper.FillGrid <PropViewCollectionUnit>(this.grid, this.collectUnit, this.typeNum, delegate(int idx, PropViewCollectionUnit comp) { comp.RefreshData(); comp.RefreshUnit(equipmentinfodata, 2); }); MobaMessageManagerTools.SendClientMsg(ClientV2C.propviewClickCollectionItem, this.currEffectItem, false); } else { int[] param = new int[] { this.currEffectItem.ModelID, 1 }; MobaMessageManagerTools.SendClientMsg(ClientV2C.propviewUseEffectItem, param, false); this.isExchange = false; } } SacrificialCtrl.GetInstance().collectionState = CollectionState.Nothing; }
private void OnMsg_BattleShop_setInShopArea(MobaMessage msg) { ShopInfo shopInfo; bool flag; if (this.SetShopArea((Dictionary <EBattleShopType, bool>)msg.Param, out shopInfo, out flag)) { if (this.OpenShop != null && !this.OpenShop.InArea && shopInfo != null && shopInfo != this.OpenShop) { this.PreOpenShop = this.OpenShop; this.OpenShop = shopInfo; if (this.PreOpenShop != this.OpenShop) { this.Update_menu(this.CurMenu); SItemData curSItem = this.CurSItem; this.Update_curSItem(null); this.Update_sItems(); if (this.SItems != null && curSItem != null && this.SItems.ContainsKey(curSItem.Level) && this.SItems[curSItem.Level].ContainsKey(curSItem.ID)) { this.Update_curSItem(this.SItems[curSItem.Level][curSItem.ID]); } } } MobaMessageManagerTools.SendClientMsg(ClientC2V.BattleShop_inShopAreaChanged, flag, false); this.Update_brawlCanbuy(); } }
private void GoToActvityView(GameObject go) { int num = 0; int activity_typeID = 100; if (this.skipToActive.Length > 2) { num = int.Parse(this.skipToActive[1]); activity_typeID = int.Parse(this.skipToActive[2]); } if (!this.CanJumpToActive(num)) { Singleton <TipView> .Instance.ShowViewSetText("暂未开放", 1f); return; } CtrlManager.OpenWindow(WindowID.ActivityView, null); MsgData_Activity_setCurActivity param = new MsgData_Activity_setCurActivity { activity_typeID = activity_typeID, activity_id = num }; MobaMessageManagerTools.SendClientMsg(ClientV2V.Activity_setCurActivity, param, false); }
private void OnClickArrow(MobaMessage msg) { if (msg.Param != null) { bool flag = (bool)msg.Param; if (this.RecordPropertyHeroName.Length > 1) { int num = 0; string[] recordPropertyHeroName = this.RecordPropertyHeroName; for (int i = 0; i < recordPropertyHeroName.Length; i++) { if (recordPropertyHeroName[i] == this.heroNPC) { num = i; break; } } if (flag) { this.heroNPC = recordPropertyHeroName[(num + 1) % recordPropertyHeroName.Length]; } else { this.heroNPC = recordPropertyHeroName[((num - 1 >= 0) ? (num - 1) : (num - 1 + recordPropertyHeroName.Length)) % recordPropertyHeroName.Length]; } MobaMessageManagerTools.SendClientMsg(ClientV2C.sacriviewChangeHero, this.heroNPC, false); } } }
private void SwitchToOtherWindow(GameObject obj) { if (null != obj) { string text = this.strSwitch; switch (text) { case "2": MobaMessageManagerTools.SendClientMsg(ClientV2C.bottleSystemOpenView, null, false); break; case "3": CtrlManager.OpenWindow(WindowID.SignView, null); break; case "4": CtrlManager.OpenWindow(WindowID.TaskView, null); break; case "5": CtrlManager.OpenWindow(WindowID.RankView, null); break; case "6": CtrlManager.OpenWindow(WindowID.ArenaModeView, null); break; } } }
private void OnMsg_Chat_GetGlobleMsg(MobaMessage msg) { OperationResponse operationResponse = msg.Param as OperationResponse; byte[] buffer = (byte[])operationResponse.Parameters[100]; ChatMessagePullData chatMessagePullData = SerializeHelper.Deserialize <ChatMessagePullData>(buffer); if (chatMessagePullData != null && chatMessagePullData.messages != null) { foreach (ChatMessageNew current in chatMessagePullData.messages) { UserData userData = ModelManager.Instance.Get_userData_X(); if (Model_HomeChat.LastMsgId == current.MessageId) { break; } MobaMessageManagerTools.SendClientMsg(ClientC2V.ReceiveHallChatMessage, current, false); Model_HomeChat.LastMsgId = current.MessageId; Debug.Log(string.Concat(new object[] { "OnMsgChat_GetGlobleMsg mes:", current.Message, " id:", current.MessageId })); } } }
public override void HandleAfterOpenView() { base.HandleAfterOpenView(); MobaMessageManagerTools.SendClientMsg(ClientV2V.BattleShop_shopOpened, null, false); NewbieManager.Instance.TryTriggerBuyEquipHint(); NewbieManager.Instance.TryHandleOpenShop(); }
public void Send() { if (base.gameObject == null || base.transform.GetComponentInChildren <BarrageItem>() == null) { return; } if (base.gameObject.transform.FindChild("lockIcon") != null) { return; } string text = ModelManager.Instance.Get_BarrageCfgDataById_X(base.gameObject.name).format.ToString(); if (text == null) { text = "1"; } string msg = BarrageEmitterView.DataPacking(base.gameObject.transform.GetComponentInChildren <BarrageItem>().text, text); if (Singleton <BarrageEmitterView> .Instance.sceneType == BarrageSceneType.SelectHero || Singleton <BarrageEmitterView> .Instance.sceneType == BarrageSceneType.WatcherMode_SelectHero) { ModelManager.Instance.Send_C2PCaption_2GameServer(msg); } else { ModelManager.Instance.Send_C2PCaption(msg); } Singleton <BarrageEmitterView> .Instance.RecordEmitting(); AudioMgr.PlayUI("Play_Menu_click", null, false, false); MobaMessageManagerTools.SendClientMsg(ClientV2V.BattleController_Open, null, false); }
private void OnGetAppStoreCharge(MobaMessage msg = null) { MobaMessageManagerTools.EndWaiting_manual("IAPInBuy"); if (msg != null) { OperationResponse operationResponse = msg.Param as OperationResponse; int num = (int)operationResponse.Parameters[1]; MobaErrorCode mobaErrorCode = (MobaErrorCode)num; if (mobaErrorCode == MobaErrorCode.Ok) { InitSDK.instance.orderBack("0"); AnalyticsToolManager.SetChargeSuccess(ModelManager.Instance.Get_userData_X().UserId.ToString() + "_" + this.order); if (this.oldSaveDate == string.Empty) { PlayerPrefs.DeleteKey("ProductSaveData"); } else { PlayerPrefs.SetString("ProductSaveData", this.oldSaveDate); } PlayerPrefs.Save(); } this.order = string.Empty; } }
public void SwitchBtnEvent() { if (Singleton <PvpSelectHeroView> .Instance.IsOpen) { Singleton <TipView> .Instance.ShowViewSetText("选择英雄时不可前往!!!", 1f); return; } string text = this.strSwitch; switch (text) { case "2": MobaMessageManagerTools.SendClientMsg(ClientV2C.bottleSystemOpenView, null, false); break; case "3": CtrlManager.OpenWindow(WindowID.SignView, null); break; case "4": CtrlManager.OpenWindow(WindowID.AchievementView, null); break; case "5": CtrlManager.OpenWindow(WindowID.RankView, null); break; case "6": CtrlManager.OpenWindow(WindowID.ArenaModeView, null); break; } }
private void ShowLoadView() { CtrlManager.OpenWindow(WindowID.LoadView2, null); MobaMessageManagerTools.LoadView2_setText2("下载资源...", false); MobaMessageManagerTools.LoadView2_setProgress2(0, this.tNum, this.cNum, null, MsgData_LoadView2_setProgress.SetType.targetNum); base.DoAction(ELoginAction.eShowLoadView); }
private void Update() { if (Input.GetKeyDown(KeyCode.Backslash)) { if (null != Singleton <HomeChatview> .Instance.transform) { if (Singleton <HomeChatview> .Instance.gameObject.activeInHierarchy) { CtrlManager.CloseWindow(WindowID.HomeChatview); } else { CtrlManager.OpenWindow(WindowID.HomeChatview, null); MobaMessageManagerTools.SendClientMsg(ClientV2C.chatviewOpenView, ChitchatType.Hall, false); MobaMessageManagerTools.SendClientMsg(ClientV2C.chatviewFillChatHistory, false, false); } } else { CtrlManager.OpenWindow(WindowID.HomeChatview, null); MobaMessageManagerTools.SendClientMsg(ClientV2C.chatviewOpenView, ChitchatType.Hall, false); MobaMessageManagerTools.SendClientMsg(ClientV2C.chatviewFillChatHistory, true, false); } } }
private void OnEnd_BuyItem(P2CBuyItem ret) { this.StopWaitCoroutine(); if (ret != null && ret.retaCode == 0) { List <string> rItems = BattleEquipTools_config.GetRItems(this.RItems, this.CurHItem, this.PItems); if (BattleEquipTools_config.IsChanged(this.RItems, rItems)) { this.Update_rItems(rItems); this.Update_rItemsSub(); if (this.CurMenu == BattleEquipType.recommend) { this.Update_curSItem(null); this.Update_sItems(); } } if (this.DealingShop != null) { this.DealingShop.DealCounter++; this.DealingShop.RollbackStack.Push(this.data.CurRollbackInfo); this.data.CurRollbackInfo = null; } } else { MobaMessageManagerTools.SendClientMsg(ClientC2C.BattleShop_err, "购买失败,errCode=" + ret.retaCode, false); } if (this.DealingShop != null) { this.DealingShop.State = EBattleShopState.eIdle; this.DealingShop = null; } this.CurHItem = null; }
private void OnGetMsg_DischargeRune(OperationResponse res) { base.LastError = (int)res.Parameters[1]; List <EquipmentInfoData> list = (List <EquipmentInfoData>)base.Data; int num = (int)res.Parameters[109]; if (base.LastError == 0) { int num2 = num; if (num2 != 1) { if (num2 == 2) { List <EquipmentInfoData> listEquip = SerializeHelper.Deserialize <List <EquipmentInfoData> >(res.Parameters[84] as byte[]); if (list != null && listEquip.Count > 0) { int i; for (i = 0; i < listEquip.Count; i++) { EquipmentInfoData equipmentInfoData = list.Find((EquipmentInfoData obj) => obj.EquipmentId == listEquip[i].EquipmentId); if (equipmentInfoData != null) { equipmentInfoData.Count++; } else { list.Add(listEquip[i]); } } MobaMessageManagerTools.SendClientMsg(ClientC2V.RunesAllDemountEquip, null, false); } } } else { EquipmentInfoData equipmentInfoData2 = SerializeHelper.Deserialize <EquipmentInfoData>(res.Parameters[90] as byte[]); long eid = equipmentInfoData2.EquipmentId; EquipmentInfoData equipmentInfoData3 = list.Find((EquipmentInfoData obj) => obj.EquipmentId == eid); if (equipmentInfoData3 != null) { equipmentInfoData3.Count++; } else { list.Add(equipmentInfoData2); } MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)23041, equipmentInfoData2, 0f); MobaMessageManager.ExecuteMsg(message); base.DebugMessage = "====>OK " + res.OperationCode; } } else { Singleton <TipView> .Instance.ShowViewSetText("网络数据错误", 1f); base.DebugMessage = "====>Demount" + res.OperationCode; } base.Valid = (base.LastError == 0); }
private void ConfirmOpenCollect(bool sure) { AudioMgr.Play("Play_UI_OpenDCP", null, false, false); if (sure) { MobaMessageManagerTools.SendClientMsg(ClientV2C.bottleSystemOpenCollect, null, false); } }
public static void BattleShop_openBattleShop(EBattleShopType shopType, EBattleShopOpenType openType) { MobaMessageManagerTools.SendClientMsg(ClientV2C.BattleShop_openShop, new object[] { shopType, openType }, false); }
public override void CancelUpdateHandler() { MobaMessageManagerTools.RegistMsg(this, this.mgs, false, "OnMsg_"); Dictionary <byte, object> dictionary = new Dictionary <byte, object>(); dictionary.Add(102, null); NetWorkHelper.Instance.client.SendSessionChannelMessage(7, MobaChannel.Chat, dictionary); }
public override void RegisterMsgHandler() { this.mgs = new object[] { MobaGameCode.GetCurrencyCount }; MobaMessageManagerTools.RegistMsg(this, this.mgs, true, "OnMsg_"); }