public static CChatEntity Build_4_SelectHero(COMDT_CHAT_MSG_BATTLE data) { CChatEntity cChatEntity = new CChatEntity(); cChatEntity.ullUid = data.stFrom.ullUid; cChatEntity.iLogicWorldID = (uint)data.stFrom.iLogicWorldID; if (cChatEntity.ullUid == Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID) { cChatEntity.type = EChaterType.Self; } else { cChatEntity.type = EChaterType.Strenger; } if (data.bChatType == 1) { CChatModel.HeroChatTemplateInfo heroChatTemplateInfo = Singleton <CChatController> .instance.model.Get_HeroSelect_ChatTemplate((int)data.stChatInfo.stContentID.dwTextID); if (heroChatTemplateInfo.isValid()) { cChatEntity.text = heroChatTemplateInfo.templateString; } } if (data.bChatType == 2) { cChatEntity.text = UT.Bytes2String(data.stChatInfo.stContentStr.szContent); } CChatUT.GetUser(cChatEntity.type, cChatEntity.ullUid, cChatEntity.iLogicWorldID, out cChatEntity.name, out cChatEntity.openId, out cChatEntity.level, out cChatEntity.head_url, out cChatEntity.stGameVip); return(cChatEntity); }
public static void FakeSendChat(string content) { try { RoomInfo roomInfo = Singleton <CRoomSystem> .GetInstance().roomInfo; DebugHelper.Assert(roomInfo != null); CChatEntity cChatEntity = new CChatEntity(); cChatEntity.ullUid = roomInfo.selfInfo.ullUid; cChatEntity.iLogicWorldID = (uint)roomInfo.selfInfo.iLogicWorldId; cChatEntity.type = EChaterType.Self; cChatEntity.text = content; CChatUT.GetUser(cChatEntity.type, cChatEntity.ullUid, cChatEntity.iLogicWorldID, out cChatEntity.name, out cChatEntity.level, out cChatEntity.head_url, out cChatEntity.stGameVip); Singleton <CChatController> .get_instance().model.channelMgr.Add_ChatEntity(cChatEntity, EChatChannel.Select_Hero, 0uL, 0u); Singleton <EventRouter> .get_instance().BroadCastEvent("Chat_HeorSelectChatData_Change"); } catch (Exception ex) { DebugHelper.Assert(false, "Fake Send Chat, {0}", new object[] { ex.get_Message() }); } }
public void ShowLoudSpeaker(COMDT_CHAT_MSG_HORN data) { this.m_loudSpeakerCount = 0; this.m_timerLoudSpeaker = Singleton <CTimerManager> .instance.AddTimer(0x3e8, 0, new CTimer.OnTimeUpHandler(this.OnTimerLoudSpeaker)); if (Singleton <BattleLogic> .instance.isRuning) { this.loudSpeakerList.Clear(); } else { CUIFormScript form = Singleton <CUIManager> .instance.GetForm(LobbyForm.FORM_PATH); if (form != null) { CUIAutoScroller component = form.GetWidget(5).GetComponent <CUIAutoScroller>(); if (component != null) { GameObject widget = form.GetWidget(6); if (widget != null) { string rawText = UT.Bytes2String(data.szContent); string str = CChatUT.Build_4_LoudSpeaker_EntryString(data.stFrom.ullUid, (uint)data.stFrom.iLogicWorldID, rawText); component.SetText(CUIUtility.RemoveEmoji(str)); component.gameObject.CustomSetActive(true); widget.CustomSetActive(true); component.StopAutoScroll(); component.StartAutoScroll(true); } } } } }
public void Add_ChatEntity(CChatEntity chatEnt, EChatChannel type, ulong ullUid = 0uL, uint dwLogicWorldId = 0u) { CChatChannel cChatChannel = this._getChannel(type, ullUid, dwLogicWorldId); if (cChatChannel == null) { cChatChannel = this.CreateChannel(type, ullUid, dwLogicWorldId); } if (chatEnt.type != EChaterType.System || chatEnt.type != EChaterType.OfflineInfo) { if (Singleton <CChatController> .get_instance().view.ChatParser != null) { Singleton <CChatController> .get_instance().view.ChatParser.bProc_ChatEntry = false; Singleton <CChatController> .get_instance().view.ChatParser.maxWidth = CChatParser.chat_list_max_width; Singleton <CChatController> .get_instance().view.ChatParser.Parse(chatEnt.text, CChatParser.start_x, chatEnt); } else { DebugHelper.Assert(false, "CChatController.instance.view.ChatParser = null! StackTrace = " + new StackTrace().ToString()); } } CChatEntity last = cChatChannel.GetLast(); if (last != null && last.time != 0 && chatEnt.time - last.time > 60) { cChatChannel.Add(CChatUT.Build_4_Time()); } cChatChannel.Add(chatEnt); }
public static CChatEntity Build_4_Offline_Friend(COMDT_OFFLINE_CHAT_MSG data) { CChatEntity cChatEntity = new CChatEntity(); cChatEntity.ullUid = data.stChatMsg.stFrom.ullUid; cChatEntity.iLogicWorldID = (uint)data.stChatMsg.stFrom.iLogicWorldID; cChatEntity.text = UT.Bytes2String(data.stChatMsg.szContent); cChatEntity.type = EChaterType.Friend; CChatUT.GetUser(cChatEntity.type, cChatEntity.ullUid, cChatEntity.iLogicWorldID, out cChatEntity.name, out cChatEntity.openId, out cChatEntity.level, out cChatEntity.head_url, out cChatEntity.stGameVip); return(cChatEntity); }
public void ShowSpeaker(COMDT_CHAT_MSG_HORN data) { this.m_speakerCount = 0; string a = CChatUT.Build_4_Speaker_EntryString(data.stFrom.ullUid, (uint)data.stFrom.iLogicWorldID, UT.Bytes2String(data.szContent)); this.m_timerSpeaker = Singleton <CTimerManager> .instance.AddTimer(0x3e8, 0, new CTimer.OnTimeUpHandler(this.OnTimerSpeaker)); Singleton <CChatController> .instance.model.sysData.Add_NewContent_Entry_Speaker(a); Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_ChatEntry_Change"); }
public static CChatEntity Build_4_Room(COMDT_CHAT_MSG_ROOM data) { CChatEntity cChatEntity = new CChatEntity(); cChatEntity.ullUid = data.stFrom.ullUid; cChatEntity.iLogicWorldID = (uint)data.stFrom.iLogicWorldID; cChatEntity.text = UT.Bytes2String(data.szContent); cChatEntity.type = EChaterType.Strenger; CChatUT.GetUser(cChatEntity.type, cChatEntity.ullUid, cChatEntity.iLogicWorldID, out cChatEntity.name, out cChatEntity.openId, out cChatEntity.level, out cChatEntity.head_url, out cChatEntity.stGameVip); return(cChatEntity); }
public static CChatEntity Build_4_Friend(COMDT_CHAT_MSG_PRIVATE data) { CChatEntity cChatEntity = new CChatEntity(); cChatEntity.ullUid = data.stFrom.ullUid; cChatEntity.iLogicWorldID = (uint)data.stFrom.iLogicWorldID; cChatEntity.text = UT.Bytes2String(data.szContent); cChatEntity.type = EChaterType.Friend; CChatUT.GetUser(cChatEntity.type, cChatEntity.ullUid, cChatEntity.iLogicWorldID, out cChatEntity.name, out cChatEntity.level, out cChatEntity.head_url, out cChatEntity.stGameVip); cChatEntity.time = CRoleInfo.GetCurrentUTCTime(); return(cChatEntity); }
public static CChatEntity Build_4_GuildMatchTeam(COMDT_CHAT_MSG_GUILD_TEAM data) { CChatEntity cChatEntity = new CChatEntity(); cChatEntity.ullUid = data.stFrom.ullUid; cChatEntity.iLogicWorldID = (uint)data.stFrom.iLogicWorldID; cChatEntity.text = UT.Bytes2String(data.szContent); cChatEntity.type = EChaterType.Strenger; CChatUT.GetUser(cChatEntity.type, cChatEntity.ullUid, cChatEntity.iLogicWorldID, out cChatEntity.name, out cChatEntity.openId, out cChatEntity.level, out cChatEntity.head_url, out cChatEntity.stGameVip); cChatEntity.time = CRoleInfo.GetCurrentUTCTime(); return(cChatEntity); }
public static CChatEntity Build_4_Self(string content) { CChatEntity cChatEntity = new CChatEntity(); cChatEntity.ullUid = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID; cChatEntity.iLogicWorldID = 0u; cChatEntity.text = content; cChatEntity.type = EChaterType.Self; CChatUT.GetUser(cChatEntity.type, cChatEntity.ullUid, cChatEntity.iLogicWorldID, out cChatEntity.name, out cChatEntity.openId, out cChatEntity.level, out cChatEntity.head_url, out cChatEntity.stGameVip); cChatEntity.time = CRoleInfo.GetCurrentUTCTime(); return(cChatEntity); }
public void ShowSpeaker(COMDT_CHAT_MSG_HORN data) { string a = CChatUT.Build_4_Speaker_EntryString(data.stFrom.ullUid, (uint)data.stFrom.iLogicWorldID, UT.Bytes2String(data.szContent)); this.m_timerSpeaker = Singleton <CTimerManager> .get_instance().AddTimer(1000, 0, new CTimer.OnTimeUpHandler(this.OnTimerSpeaker)); if (Singleton <CChatController> .get_instance().model.channelMgr.ChatTab == CChatChannelMgr.EChatTab.Normal) { Singleton <CChatController> .get_instance().model.sysData.Add_NewContent_Entry_Speaker(a); Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_ChatEntry_Change"); } }
public void AddSpeakerArray(CS_HORN_TYPE type, COMDT_CHAT_MSG_HORN[] astMsgInfo, uint len) { ListView <COMDT_CHAT_MSG_HORN> listView = this.GetSpeakerList(type); int lastSpeakerBeginSec = (int)this.GetLastSpeakerBeginSec(type); int num = 0; while ((long)num < (long)((ulong)len)) { if (lastSpeakerBeginSec < (int)astMsgInfo[num].dwBeginShowSec) { listView.Add(astMsgInfo[num]); Singleton <CChatController> .get_instance().model.Add_Palyer_Info(astMsgInfo[num].stFrom); if (type == null) { bool flag = astMsgInfo[num].stFrom.ullUid == Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID; if (Singleton <CChatController> .get_instance().view != null) { Singleton <CChatController> .get_instance().view.bRefreshNew = (!Singleton <CChatController> .get_instance().view.IsCheckHistory() || flag); } CChatEntity chatEnt = CChatUT.Build_4_Speaker(astMsgInfo[num]); Singleton <CChatController> .get_instance().model.channelMgr.Add_ChatEntity(chatEnt, EChatChannel.Lobby, 0uL, 0u); this.m_lastSpeakerBeginSec = Math.Max(astMsgInfo[num].dwBeginShowSec, this.m_lastSpeakerBeginSec); } else { this.m_lastLoudSpeakerBeginSec = Math.Max(astMsgInfo[num].dwBeginShowSec, this.m_lastLoudSpeakerBeginSec); } } num++; } if (len > 0u) { COMDT_CHAT_MSG_HORN cOMDT_CHAT_MSG_HORN = astMsgInfo[0]; if (type == null) { this.OnSpeakerNodeOpen(); } else if (type == 1) { this.OnLoudSpeakerTipsOpen(); } } }
public static void FakeSendChat(string content) { Assets.Scripts.GameSystem.RoomInfo roomInfo = Singleton <CRoomSystem> .GetInstance().roomInfo; DebugHelper.Assert(roomInfo != null); CChatEntity chatEnt = new CChatEntity { ullUid = roomInfo.selfInfo.ullUid, iLogicWorldID = (uint)roomInfo.selfInfo.iLogicWorldId, type = EChaterType.Self, text = content }; CChatUT.GetUser(chatEnt.type, chatEnt.ullUid, chatEnt.iLogicWorldID, out chatEnt.name, out chatEnt.level, out chatEnt.head_url, out chatEnt.stGameVip); Singleton <CChatController> .instance.model.channelMgr.Add_ChatEntity(chatEnt, EChatChannel.Select_Hero, 0L, 0); Singleton <EventRouter> .instance.BroadCastEvent("Chat_HeorSelectChatData_Change"); }
public void AddSpeakerArray(CS_HORN_TYPE type, COMDT_CHAT_MSG_HORN[] astMsgInfo, uint len) { ListView <COMDT_CHAT_MSG_HORN> speakerList = this.GetSpeakerList(type); int lastSpeakerBeginSec = (int)this.GetLastSpeakerBeginSec(type); for (int i = 0; i < len; i++) { if (lastSpeakerBeginSec < astMsgInfo[i].dwBeginShowSec) { speakerList.Add(astMsgInfo[i]); Singleton <CChatController> .instance.model.Add_Palyer_Info(astMsgInfo[i].stFrom); if (type == CS_HORN_TYPE.CS_HORNTYPE_SMALL) { bool flag = astMsgInfo[i].stFrom.ullUid == Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID; if (Singleton <CChatController> .instance.view != null) { Singleton <CChatController> .instance.view.bRefreshNew = !Singleton <CChatController> .instance.view.IsCheckHistory() || flag; } CChatEntity chatEnt = CChatUT.Build_4_Speaker(astMsgInfo[i]); Singleton <CChatController> .instance.model.channelMgr.Add_ChatEntity(chatEnt, EChatChannel.Lobby, 0L, 0); this.m_lastSpeakerBeginSec = Math.Max(astMsgInfo[i].dwBeginShowSec, this.m_lastSpeakerBeginSec); } else { this.m_lastLoudSpeakerBeginSec = Math.Max(astMsgInfo[i].dwBeginShowSec, this.m_lastLoudSpeakerBeginSec); } } } if (len > 0) { COMDT_CHAT_MSG_HORN comdt_chat_msg_horn = astMsgInfo[0]; if (type == CS_HORN_TYPE.CS_HORNTYPE_SMALL) { this.OnSpeakerNodeOpen(); } else if (type == CS_HORN_TYPE.CS_HORNTYPE_BIGER) { this.OnLoudSpeakerTipsOpen(); } } }
public CChatChannel CreateChannel(EChatChannel type, ulong ullUid = 0, uint dwLogicWorldId = 0) { CChatChannel item = this._getChannel(type, ullUid, dwLogicWorldId); if (item == null) { if (type != EChatChannel.Friend) { item = new CChatChannel(type, 0, 0L, 0); this.NormalChannelList.Add(item); return(item); } item = new CChatChannel(type, 0x1b58, ullUid, dwLogicWorldId); item.list.Add(CChatUT.Build_4_System(Singleton <CTextManager> .instance.GetText("Chat_Common_Tips_4"))); item.ReadAll(); this.FriendChannelList.Add(item); } return(item); }
public static void Send_GetChat_Req(EChatChannel channel) { if (Singleton <NetworkModule> .GetInstance().lobbySvr.connected) { CSPkg msg = NetworkModule.CreateDefaultCSPKG(0x515); msg.stPkgData.stGetChatMsgReq.bChatType = (byte)CChatUT.Convert_Channel_ChatMsgType(channel); if (channel == EChatChannel.Lobby) { if (Singleton <CChatController> .GetInstance().model.sysData.lastTimeStamp != 0) { msg.stPkgData.stGetChatMsgReq.dwLastTimeStamp = Singleton <CChatController> .GetInstance().model.sysData.lastTimeStamp; Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref msg, false); } } else { Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref msg, false); } } }
public CChatChannel CreateChannel(EChatChannel type, ulong ullUid = 0uL, uint dwLogicWorldId = 0u) { CChatChannel cChatChannel = this._getChannel(type, ullUid, dwLogicWorldId); if (cChatChannel != null) { return(cChatChannel); } if (type != EChatChannel.Friend) { cChatChannel = new CChatChannel(type, 0u, 0uL, 0u); this.NormalChannelList.Add(cChatChannel); } else { cChatChannel = new CChatChannel(type, 7000u, ullUid, dwLogicWorldId); cChatChannel.list.Add(CChatUT.Build_4_System(Singleton <CTextManager> .instance.GetText("Chat_Common_Tips_4"))); cChatChannel.ReadAll(); this.FriendChannelList.Add(cChatChannel); } return(cChatChannel); }
public void Add_ChatEntity(CChatEntity chatEnt, EChatChannel type, ulong ullUid = 0, uint dwLogicWorldId = 0) { CChatChannel channel = this._getChannel(type, ullUid, dwLogicWorldId); if (channel == null) { channel = this.CreateChannel(type, ullUid, dwLogicWorldId); } if (chatEnt.type != EChaterType.System) { Singleton <CChatController> .instance.view.ChatParser.bProc_ChatEntry = false; Singleton <CChatController> .instance.view.ChatParser.maxWidth = CChatParser.chat_list_max_width; Singleton <CChatController> .instance.view.ChatParser.Parse(chatEnt.text, CChatParser.start_x, chatEnt); } CChatEntity last = channel.GetLast(); if (((last != null) && (last.time != 0)) && ((chatEnt.time - last.time) > 60)) { channel.Add(CChatUT.Build_4_Time()); } channel.Add(chatEnt); }
public void AddSpeakerArray(CS_HORN_TYPE type, COMDT_CHAT_MSG_HORN[] astMsgInfo, uint len) { ListView <COMDT_CHAT_MSG_HORN> speakerList = this.GetSpeakerList(type); int lastSpeakerIndex = (int)this.GetLastSpeakerIndex(type); if (lastSpeakerIndex == 0) { lastSpeakerIndex = -1; } for (int i = 0; i < len; i++) { if (lastSpeakerIndex < astMsgInfo[i].dwMsgIdx) { speakerList.Add(astMsgInfo[i]); Singleton <CChatController> .instance.model.Add_Palyer_Info(astMsgInfo[i].stFrom); CChatEntity chatEnt = (type != CS_HORN_TYPE.CS_HORNTYPE_SMALL) ? CChatUT.Build_4_LoudSpeaker(astMsgInfo[i]) : CChatUT.Build_4_Speaker(astMsgInfo[i]); Singleton <CChatController> .instance.model.channelMgr.Add_ChatEntity(chatEnt, EChatChannel.Lobby, 0L, 0); if (type == CS_HORN_TYPE.CS_HORNTYPE_SMALL) { this.m_speakerIndex = astMsgInfo[i].dwMsgIdx; } else { this.m_loudSpeakerIndex = astMsgInfo[i].dwMsgIdx; } } } if ((type == CS_HORN_TYPE.CS_HORNTYPE_SMALL) && (len > 0)) { this.OnSpeakerNodeOpen(); } if ((type == CS_HORN_TYPE.CS_HORNTYPE_BIGER) && (len > 0)) { this.OnLoudSpeakerTipsOpen(null); } }
public static void Send_GetChat_Req(EChatChannel channel) { if (!Singleton <NetworkModule> .GetInstance().lobbySvr.connected) { return; } CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(1301u); cSPkg.stPkgData.get_stGetChatMsgReq().bChatType = CChatUT.Convert_Channel_ChatMsgType(channel); if (channel == EChatChannel.Lobby) { if (Singleton <CChatController> .GetInstance().model.sysData.lastTimeStamp != 0u) { cSPkg.stPkgData.get_stGetChatMsgReq().dwLastTimeStamp = Singleton <CChatController> .GetInstance().model.sysData.lastTimeStamp; Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref cSPkg, false); } } else { Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref cSPkg, false); } }
public static void FakeSendChat(string content) { try { RoomInfo roomInfo = Singleton <CRoomSystem> .GetInstance().roomInfo; DebugHelper.Assert(roomInfo != null); CChatEntity chatEnt = new CChatEntity { ullUid = roomInfo.selfInfo.ullUid, iLogicWorldID = (uint)roomInfo.selfInfo.iLogicWorldId, type = EChaterType.Self, text = content }; CChatUT.GetUser(chatEnt.type, chatEnt.ullUid, chatEnt.iLogicWorldID, out chatEnt.name, out chatEnt.level, out chatEnt.head_url, out chatEnt.stGameVip); Singleton <CChatController> .instance.model.channelMgr.Add_ChatEntity(chatEnt, EChatChannel.Select_Hero, 0L, 0); Singleton <EventRouter> .instance.BroadCastEvent("Chat_HeorSelectChatData_Change"); } catch (Exception exception) { object[] inParameters = new object[] { exception.Message }; DebugHelper.Assert(false, "Fake Send Chat, {0}", inParameters); } }
public static string Build_4_ChatEntry(bool bFriend, CChatEntity ent) { string text = bFriend ? Singleton <CTextManager> .instance.GetText("chat_title_friend") : Singleton <CTextManager> .instance.GetText("chat_title_total"); if (bFriend) { COMDT_FRIEND_INFO gameOrSnsFriend = Singleton <CFriendContoller> .GetInstance().model.GetGameOrSnsFriend(ent.ullUid, ent.iLogicWorldID); if (gameOrSnsFriend != null) { text = text + CChatUT.ColorString(0u, UT.Bytes2String(gameOrSnsFriend.szUserName)) + ":" + ent.text; } } else { COMDT_CHAT_PLAYER_INFO cOMDT_CHAT_PLAYER_INFO = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ent.ullUid, ent.iLogicWorldID); if (text != null && cOMDT_CHAT_PLAYER_INFO != null) { text = text + CChatUT.ColorString(0u, UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO.szName)) + ":" + ent.text; } } return(text); }
private void On_Rolling_SystemChatInfoReceived(string content) { CChatEntity chatEnt = CChatUT.Build_4_System(content); this.model.channelMgr.Add_ChatEntity(chatEnt, EChatChannel.Lobby, 0L, 0); }
private void On_Chat_GetMsg_NTF(CSPkg msg) { SCPKG_CMD_CHAT_NTF stChatNtf = msg.stPkgData.stChatNtf; if (stChatNtf.dwTimeStamp != 0) { Singleton <CChatController> .GetInstance().model.SetTimeStamp(EChatChannel.Lobby, stChatNtf.dwTimeStamp); } Singleton <CChatController> .GetInstance().model.SetRestFreeCnt(EChatChannel.Lobby, stChatNtf.dwRestChatFreeCnt); int num = Mathf.Min(stChatNtf.astChatMsg.Length, stChatNtf.bMsgCnt); if (num == 0) { this.cur_chatTimer_totalTime += step_time; if (this.cur_chatTimer_totalTime >= max_ChatTime) { this.cur_chatTimer_totalTime = max_ChatTime; } Singleton <CTimerManager> .instance.ResetTimerTotalTime(this.chatTimer, this.cur_chatTimer_totalTime * 0x3e8); } else { this.cur_chatTimer_totalTime = init_chatTime; Singleton <CTimerManager> .instance.ResetTimerTotalTime(this.chatTimer, this.cur_chatTimer_totalTime * 0x3e8); bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; for (int i = num - 1; i >= 0; i--) { COMDT_CHAT_MSG comdt_chat_msg = stChatNtf.astChatMsg[i]; if (CChatUT.Convert_ChatMsgType_Channel(comdt_chat_msg.bType) == EChatChannel.Friend) { COMDT_CHAT_PLAYER_INFO stFrom = comdt_chat_msg.stContent.stPrivate.stFrom; CChatEntity chatEnt = null; if (stFrom.ullUid == Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID) { string content = UT.Bytes2String(comdt_chat_msg.stContent.stPrivate.szContent); chatEnt = CChatUT.Build_4_Self(content); this.model.channelMgr.Add_CurChatFriend(chatEnt); string a = string.Format(fmt, Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().Name, content); this.model.sysData.Add_NewContent_Entry(a, EChatChannel.Friend); Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_FriendChatData_Change"); Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_ChatEntry_Change"); flag = true; } else { string rawText = UT.Bytes2String(comdt_chat_msg.stContent.stPrivate.szContent); chatEnt = CChatUT.Build_4_Friend(comdt_chat_msg.stContent.stPrivate); this.model.channelMgr.Add_ChatEntity(chatEnt, EChatChannel.Friend, stFrom.ullUid, (uint)stFrom.iLogicWorldID); string str4 = CChatUT.Build_4_EntryString(EChatChannel.Friend, stFrom.ullUid, (uint)stFrom.iLogicWorldID, rawText); this.model.sysData.Add_NewContent_Entry(str4, EChatChannel.Friend); this.model.sysData.LastChannel = EChatChannel.Friend; flag = true; } } else if (CChatUT.Convert_ChatMsgType_Channel(comdt_chat_msg.bType) == EChatChannel.Lobby) { if (this.view != null) { this.view.bRefreshNew = !this.view.IsCheckHistory(); } COMDT_CHAT_PLAYER_INFO comdt_chat_player_info2 = comdt_chat_msg.stContent.stLogicWord.stFrom; this.model.Add_Palyer_Info(comdt_chat_msg.stContent.stLogicWord.stFrom); CChatEntity entity2 = CChatUT.Build_4_Lobby(comdt_chat_msg.stContent.stLogicWord); if (comdt_chat_player_info2.ullUid == Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID) { entity2.type = EChaterType.Self; } this.model.channelMgr.Add_ChatEntity(entity2, EChatChannel.Lobby, 0L, 0); string str5 = UT.Bytes2String(comdt_chat_msg.stContent.stLogicWord.szContent); string str6 = CChatUT.Build_4_EntryString(EChatChannel.Lobby, comdt_chat_player_info2.ullUid, (uint)comdt_chat_player_info2.iLogicWorldID, str5); this.model.sysData.Add_NewContent_Entry(str6, EChatChannel.Lobby); this.model.sysData.LastChannel = EChatChannel.Lobby; flag2 = true; } else if (CChatUT.Convert_ChatMsgType_Channel(comdt_chat_msg.bType) == EChatChannel.Guild) { COMDT_CHAT_PLAYER_INFO comdt_chat_player_info3 = comdt_chat_msg.stContent.stGuild.stFrom; this.model.Add_Palyer_Info(comdt_chat_msg.stContent.stGuild.stFrom); CChatEntity entity3 = CChatUT.Build_4_Guild(comdt_chat_msg.stContent.stGuild); if (comdt_chat_player_info3.ullUid == Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID) { entity3.type = EChaterType.Self; } this.model.channelMgr.Add_ChatEntity(entity3, EChatChannel.Guild, 0L, 0); string str7 = UT.Bytes2String(comdt_chat_msg.stContent.stGuild.szContent); string str8 = CChatUT.Build_4_EntryString(EChatChannel.Guild, comdt_chat_player_info3.ullUid, (uint)comdt_chat_player_info3.iLogicWorldID, str7); this.model.sysData.Add_NewContent_Entry(str8, EChatChannel.Guild); this.model.sysData.LastChannel = EChatChannel.Guild; flag4 = true; } else if (CChatUT.Convert_ChatMsgType_Channel(comdt_chat_msg.bType) == EChatChannel.Room) { COMDT_CHAT_PLAYER_INFO info = comdt_chat_msg.stContent.stRoom.stFrom; this.model.Add_Palyer_Info(info); CChatEntity entity4 = CChatUT.Build_4_Room(comdt_chat_msg.stContent.stRoom); if (info.ullUid == Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID) { entity4.type = EChaterType.Self; } this.model.channelMgr.Add_ChatEntity(entity4, EChatChannel.Room, 0L, 0); string str9 = UT.Bytes2String(comdt_chat_msg.stContent.stRoom.szContent); string str10 = CChatUT.Build_4_EntryString(EChatChannel.Room, info.ullUid, (uint)info.iLogicWorldID, str9); this.model.sysData.Add_NewContent_Entry(str10, EChatChannel.Room); flag3 = true; Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_RoomChatData_Change"); } else if (CChatUT.Convert_ChatMsgType_Channel(comdt_chat_msg.bType) == EChatChannel.Select_Hero) { COMDT_CHAT_PLAYER_INFO comdt_chat_player_info5 = comdt_chat_msg.stContent.stBattle.stFrom; this.model.Add_Palyer_Info(comdt_chat_msg.stContent.stBattle.stFrom); CChatEntity entity5 = CChatUT.Build_4_SelectHero(comdt_chat_msg.stContent.stBattle); this.model.channelMgr.Add_ChatEntity(entity5, EChatChannel.Select_Hero, 0L, 0); Singleton <EventRouter> .instance.BroadCastEvent("Chat_HeorSelectChatData_Change"); } else if (CChatUT.Convert_ChatMsgType_Channel(comdt_chat_msg.bType) == EChatChannel.Team) { COMDT_CHAT_PLAYER_INFO comdt_chat_player_info6 = comdt_chat_msg.stContent.stTeam.stFrom; this.model.Add_Palyer_Info(comdt_chat_msg.stContent.stTeam.stFrom); CChatEntity entity6 = CChatUT.Build_4_Team(comdt_chat_msg.stContent.stTeam); if (comdt_chat_player_info6.ullUid == Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID) { entity6.type = EChaterType.Self; } this.model.channelMgr.Add_ChatEntity(entity6, EChatChannel.Team, 0L, 0); string str11 = UT.Bytes2String(comdt_chat_msg.stContent.stTeam.szContent); string str12 = CChatUT.Build_4_EntryString(EChatChannel.Team, comdt_chat_player_info6.ullUid, (uint)comdt_chat_player_info6.iLogicWorldID, str11); this.model.sysData.Add_NewContent_Entry(str12, EChatChannel.Team); this.model.sysData.LastChannel = EChatChannel.Team; flag5 = true; Singleton <EventRouter> .instance.BroadCastEvent("Chat_TeamChat_Change"); } else if (comdt_chat_msg.bType == 7) { Singleton <InBattleMsgMgr> .instance.Handle_InBattleMsg_Ntf(comdt_chat_msg.stContent.stInBattle); } } if (flag2) { Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_LobbyChatData_Change"); } if (flag) { Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_FriendChatData_Change"); } if (flag4) { Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_GuildChatData_Change"); } if (((flag2 || flag) || flag4) && (this.model.channelMgr.ChatTab == CChatChannelMgr.EChatTab.Normal)) { Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_ChatEntry_Change"); } if (flag3 && (this.model.channelMgr.ChatTab == CChatChannelMgr.EChatTab.Room)) { Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_ChatEntry_Change"); } if (((flag2 || flag) || flag5) && (this.model.channelMgr.ChatTab == CChatChannelMgr.EChatTab.Team)) { Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_ChatEntry_Change"); } } }
public static EChatChannel Convert_ChatMsgType_Channel(byte v) { return(CChatUT.Convert_ChatMsgType_Channel((COM_CHAT_MSG_TYPE)v)); }
public static EChatChannel Convert_ChatMsgType_Channel(byte v) { return(CChatUT.Convert_ChatMsgType_Channel(v)); }