public void ParseServerData(COMDT_SELFDEFINE_CHATINFO chatInfo) { if (chatInfo == null) { return; } bool flag = false; this.totalCount = chatInfo.bMsgCnt; for (int i = 0; i < (int)chatInfo.bMsgCnt; i++) { COMDT_SELFDEFINE_DETAIL_CHATINFO cOMDT_SELFDEFINE_DETAIL_CHATINFO = chatInfo.astChatMsg[i]; if (cOMDT_SELFDEFINE_DETAIL_CHATINFO.bChatType == 4) { flag = true; break; } if (cOMDT_SELFDEFINE_DETAIL_CHATINFO.bChatType == 1 && cOMDT_SELFDEFINE_DETAIL_CHATINFO.stChatInfo.get_stSignalID().dwTextID > 0u) { flag = true; break; } } if (!flag) { this.UseDefaultShortcut(); return; } for (int j = 0; j < (int)chatInfo.bMsgCnt; j++) { COMDT_SELFDEFINE_DETAIL_CHATINFO cOMDT_SELFDEFINE_DETAIL_CHATINFO2 = chatInfo.astChatMsg[j]; if (cOMDT_SELFDEFINE_DETAIL_CHATINFO2.bChatType == 1) { uint dwTextID = cOMDT_SELFDEFINE_DETAIL_CHATINFO2.stChatInfo.get_stSignalID().dwTextID; TabElement tabElement = new TabElement(dwTextID, string.Empty); tabElement.cfgId = dwTextID; if (dwTextID > 0u) { ResInBatMsgCfg cfgData = this.GetCfgData(tabElement.cfgId); DebugHelper.Assert(cfgData != null, "custom shortcut ParseServerData cfgdata is null, cfgID:" + tabElement.cfgId); if (cfgData != null) { tabElement.configContent = cfgData.szContent; } } this.menuEntList.Add(tabElement); } else if (cOMDT_SELFDEFINE_DETAIL_CHATINFO2.bChatType == 1) { string text = StringHelper.BytesToString(cOMDT_SELFDEFINE_DETAIL_CHATINFO2.stChatInfo.get_stSelfDefineStr().szContent); if (!string.IsNullOrEmpty(text)) { TabElement tabElement2 = new TabElement(string.Empty); this.menuEntList.Add(tabElement2); } } } this.SyncData(this.menuEntList, this.lastMenuEntList); this.Print(this.menuEntList, "服务器解析出来的自定义数据"); }
public void Print(ListView <TabElement> list, string name) { string text = string.Concat(new object[] { "---shortCut list:", name, ",count:", list.get_Count(), ", " }); for (int i = 0; i < list.get_Count(); i++) { TabElement tabElement = list.get_Item(i); if (tabElement != null) { string text2 = text; text = string.Concat(new object[] { text2, " ,i:", i, ",id:", tabElement.cfgId }); } } Debug.Log(text); }
public void ParseServerData(COMDT_SELFDEFINE_CHATINFO chatInfo) { if (chatInfo != null) { bool flag = false; this.totalCount = chatInfo.bMsgCnt; for (int i = 0; i < chatInfo.bMsgCnt; i++) { COMDT_SELFDEFINE_DETAIL_CHATINFO comdt_selfdefine_detail_chatinfo = chatInfo.astChatMsg[i]; if (comdt_selfdefine_detail_chatinfo.bChatType == 4) { flag = true; break; } if ((comdt_selfdefine_detail_chatinfo.bChatType == 1) && (comdt_selfdefine_detail_chatinfo.stChatInfo.stSignalID.dwTextID > 0)) { flag = true; break; } } if (!flag) { this.UseDefaultShortcut(); } else { for (int j = 0; j < chatInfo.bMsgCnt; j++) { COMDT_SELFDEFINE_DETAIL_CHATINFO comdt_selfdefine_detail_chatinfo2 = chatInfo.astChatMsg[j]; if (comdt_selfdefine_detail_chatinfo2.bChatType == 1) { uint dwTextID = comdt_selfdefine_detail_chatinfo2.stChatInfo.stSignalID.dwTextID; TabElement item = new TabElement(dwTextID, string.Empty) { cfgId = dwTextID }; if (dwTextID > 0) { ResInBatMsgCfg cfgData = this.GetCfgData(item.cfgId); DebugHelper.Assert(cfgData != null, "custom shortcut ParseServerData cfgdata is null, cfgID:" + item.cfgId); if (cfgData != null) { item.configContent = cfgData.szContent; } } this.menuEntList.Add(item); } else if ((comdt_selfdefine_detail_chatinfo2.bChatType == 1) && !string.IsNullOrEmpty(StringHelper.BytesToString(comdt_selfdefine_detail_chatinfo2.stChatInfo.stSelfDefineStr.szContent))) { TabElement element2 = new TabElement(string.Empty); this.menuEntList.Add(element2); } } this.SyncData(this.menuEntList, this.lastMenuEntList); this.Print(this.menuEntList, "服务器解析出来的自定义数据"); } } }
public void SetMenuItem(int index, uint configID) { if ((index >= 0) && (index < this.menuEntList.Count)) { TabElement element = this.menuEntList[index]; if (element != null) { element.cfgId = configID; } } }
public void SetMenuItem(int index, uint configID) { if (index >= 0 && index < this.menuEntList.get_Count()) { TabElement tabElement = this.menuEntList.get_Item(index); if (tabElement != null) { tabElement.cfgId = configID; } } }
public void BuildInBatEnt() { this.inbatEntList.Clear(); for (int i = 0; i < this.menuEntList.Count; i++) { TabElement item = this.menuEntList[i]; if ((item != null) && (item.cfgId != 0)) { this.inbatEntList.Add(item); } } }
public void BuildInBatEnt() { this.inbatEntList.Clear(); for (int i = 0; i < this.menuEntList.get_Count(); i++) { TabElement tabElement = this.menuEntList.get_Item(i); if (tabElement != null && tabElement.cfgId != 0u) { this.inbatEntList.Add(tabElement); } } }
public void SyncData(ListView <TabElement> src, ListView <TabElement> dest) { if (dest != null) { dest.Clear(); } for (int i = 0; i < src.Count; i++) { TabElement element = src[i]; if (element != null) { dest.Add(element.Clone()); } } }
public void SyncData(ListView <TabElement> src, ListView <TabElement> dest) { if (dest != null) { dest.Clear(); } for (int i = 0; i < src.get_Count(); i++) { TabElement tabElement = src.get_Item(i); if (tabElement != null) { dest.Add(tabElement.Clone()); } } }
public void Print(ListView <TabElement> list, string name) { object[] objArray1 = new object[] { "---shortCut list:", name, ",count:", list.Count, ", " }; string message = string.Concat(objArray1); for (int i = 0; i < list.Count; i++) { TabElement element = list[i]; if (element != null) { string str2 = message; object[] objArray2 = new object[] { str2, " ,i:", i, ",id:", element.cfgId }; message = string.Concat(objArray2); } } Debug.Log(message); }
public static void SendShortCut_Config(ListView <TabElement> list) { CSPkg msg = NetworkModule.CreateDefaultCSPKG(0x1468); for (int i = 0; i < Singleton <InBattleMsgMgr> .instance.totalCount; i++) { if (i < list.Count) { TabElement element = list[i]; if (element != null) { COMDT_SELFDEFINE_DETAIL_CHATINFO comdt_selfdefine_detail_chatinfo = msg.stPkgData.stSelfDefineChatInfoChgReq.stChatInfo.astChatMsg[i]; comdt_selfdefine_detail_chatinfo.bChatType = 1; comdt_selfdefine_detail_chatinfo.stChatInfo.select(1L); comdt_selfdefine_detail_chatinfo.stChatInfo.stSignalID.dwTextID = element.cfgId; } } } msg.stPkgData.stSelfDefineChatInfoChgReq.stChatInfo.bMsgCnt = Singleton <InBattleMsgMgr> .instance.totalCount; Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref msg, true); }
public static void SendShortCut_Config(ListView <TabElement> list) { CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(5224u); for (int i = 0; i < (int)Singleton <InBattleMsgMgr> .instance.totalCount; i++) { if (i < list.Count) { TabElement tabElement = list[i]; if (tabElement != null) { COMDT_SELFDEFINE_DETAIL_CHATINFO cOMDT_SELFDEFINE_DETAIL_CHATINFO = cSPkg.stPkgData.stSelfDefineChatInfoChgReq.stChatInfo.astChatMsg[i]; cOMDT_SELFDEFINE_DETAIL_CHATINFO.bChatType = 1; cOMDT_SELFDEFINE_DETAIL_CHATINFO.stChatInfo.select(1L); cOMDT_SELFDEFINE_DETAIL_CHATINFO.stChatInfo.stSignalID.dwTextID = tabElement.cfgId; } } } cSPkg.stPkgData.stSelfDefineChatInfoChgReq.stChatInfo.bMsgCnt = Singleton <InBattleMsgMgr> .instance.totalCount; Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref cSPkg, true); }
public void ParseCfgData() { Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.InBatShortcut_OpenForm, new CUIEventManager.OnUIEventHandler(this.On_InBatMenu_OpenForm)); if (!int.TryParse(Singleton <CTextManager> .instance.GetText("InBat_Bubble_CDTime"), out InBattleShortcut.InBat_Bubble_CDTime)) { DebugHelper.Assert(false, "---InBatMsg 教练你配的 InBat_Bubble_CDTime 好像不是整数哦, check out"); } ListView <TabElement> view = null; Dictionary <long, object> .Enumerator enumerator = GameDataMgr.inBattleMsgDatabin.GetEnumerator(); while (enumerator.MoveNext()) { view = null; KeyValuePair <long, object> current = enumerator.Current; ResInBatMsgCfg cfg = (ResInBatMsgCfg)current.Value; if (cfg != null) { string szChannelTitle = cfg.szChannelTitle; this.tabElements.TryGetValue(szChannelTitle, out view); if (view == null) { view = new ListView <TabElement>(); this.tabElements.Add(szChannelTitle, view); this.title_list.Add(szChannelTitle); } TabElement item = new TabElement(cfg.dwID, cfg.szContent) { camp = cfg.bCampVisible }; view.Add(item); } } Dictionary <long, object> .Enumerator enumerator2 = GameDataMgr.inBattleHeroActDatabin.GetEnumerator(); while (enumerator2.MoveNext()) { KeyValuePair <long, object> pair2 = enumerator2.Current; ResInBatMsgHeroActCfg cfg2 = (ResInBatMsgHeroActCfg)pair2.Value; if (cfg2 != null) { DictionaryView <uint, ResInBatMsgHeroActCfg> view2 = null; this.heroActData.TryGetValue(cfg2.dwHeroID, out view2); if (view2 == null) { view2 = new DictionaryView <uint, ResInBatMsgHeroActCfg>(); this.heroActData.Add(cfg2.dwHeroID, view2); } if (!view2.ContainsKey(cfg2.dwActionID)) { view2.Add(cfg2.dwActionID, cfg2); } } } GameDataMgr.inBattleHeroActDatabin.Unload(); Dictionary <long, object> .Enumerator enumerator3 = GameDataMgr.inBattleDefaultDatabin.GetEnumerator(); while (enumerator3.MoveNext()) { KeyValuePair <long, object> pair3 = enumerator3.Current; ResShortcutDefault default2 = (ResShortcutDefault)pair3.Value; if (default2 != null) { DebugHelper.Assert(GameDataMgr.inBattleMsgDatabin.GetDataByKey(default2.dwConfigID) != null, "---jason 检查下 局内交流配置表中的默认配置sheet, 配置id:" + default2.dwConfigID); } } }
public void ParseCfgData() { Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.InBatShortcut_OpenForm, new CUIEventManager.OnUIEventHandler(this.On_InBatMenu_OpenForm)); if (!int.TryParse(Singleton <CTextManager> .get_instance().GetText("InBat_Bubble_CDTime"), ref InBattleShortcut.InBat_Bubble_CDTime)) { DebugHelper.Assert(false, "---InBatMsg 教练你配的 InBat_Bubble_CDTime 好像不是整数哦, check out"); } ListView <TabElement> listView = null; Dictionary <long, object> .Enumerator enumerator = GameDataMgr.inBattleMsgDatabin.GetEnumerator(); while (enumerator.MoveNext()) { listView = null; KeyValuePair <long, object> current = enumerator.get_Current(); ResInBatMsgCfg resInBatMsgCfg = (ResInBatMsgCfg)current.get_Value(); if (resInBatMsgCfg != null) { string szChannelTitle = resInBatMsgCfg.szChannelTitle; this.tabElements.TryGetValue(szChannelTitle, ref listView); if (listView == null) { listView = new ListView <TabElement>(); this.tabElements.Add(szChannelTitle, listView); this.title_list.Add(szChannelTitle); } TabElement tabElement = new TabElement(resInBatMsgCfg.dwID, resInBatMsgCfg.szContent); tabElement.camp = resInBatMsgCfg.bCampVisible; listView.Add(tabElement); } } Dictionary <long, object> .Enumerator enumerator2 = GameDataMgr.inBattleHeroActDatabin.GetEnumerator(); while (enumerator2.MoveNext()) { KeyValuePair <long, object> current2 = enumerator2.get_Current(); ResInBatMsgHeroActCfg resInBatMsgHeroActCfg = (ResInBatMsgHeroActCfg)current2.get_Value(); if (resInBatMsgHeroActCfg != null) { DictionaryView <uint, ResInBatMsgHeroActCfg> dictionaryView = null; this.heroActData.TryGetValue(resInBatMsgHeroActCfg.dwHeroID, ref dictionaryView); if (dictionaryView == null) { dictionaryView = new DictionaryView <uint, ResInBatMsgHeroActCfg>(); this.heroActData.Add(resInBatMsgHeroActCfg.dwHeroID, dictionaryView); } if (!dictionaryView.ContainsKey(resInBatMsgHeroActCfg.dwActionID)) { dictionaryView.Add(resInBatMsgHeroActCfg.dwActionID, resInBatMsgHeroActCfg); } } } GameDataMgr.inBattleHeroActDatabin.Unload(); Dictionary <long, object> .Enumerator enumerator3 = GameDataMgr.inBattleDefaultDatabin.GetEnumerator(); while (enumerator3.MoveNext()) { KeyValuePair <long, object> current3 = enumerator3.get_Current(); ResShortcutDefault resShortcutDefault = (ResShortcutDefault)current3.get_Value(); if (resShortcutDefault != null) { ResInBatMsgCfg dataByKey = GameDataMgr.inBattleMsgDatabin.GetDataByKey(resShortcutDefault.dwConfigID); DebugHelper.Assert(dataByKey != null, "---jason 检查下 局内交流配置表中的默认配置sheet, 配置id:" + resShortcutDefault.dwConfigID); } } }