private uint GetSpeakerEndTime(CS_HORN_TYPE type) { if (type == CS_HORN_TYPE.CS_HORNTYPE_SMALL) { if (this.speakerList.Count > 0) { return(this.speakerList[0].dwBeginShowSec); } if (this.CurSpekaer != null) { return(this.CurSpekaer.dwEndShowSec); } return(0u); } else { if (this.loudSpeakerList.Count > 0) { return(this.loudSpeakerList[0].dwBeginShowSec); } if (this.CurLoudSpeaker != null) { return(this.CurLoudSpeaker.dwEndShowSec); } return(0u); } }
private uint GetSpeakerEndTime(CS_HORN_TYPE type) { if (type == null) { if (this.speakerList.get_Count() > 0) { return(this.speakerList.get_Item(0).dwBeginShowSec); } if (this.CurSpekaer != null) { return(this.CurSpekaer.dwEndShowSec); } return(0u); } else { if (this.loudSpeakerList.get_Count() > 0) { return(this.loudSpeakerList.get_Item(0).dwBeginShowSec); } if (this.CurLoudSpeaker != null) { return(this.CurLoudSpeaker.dwEndShowSec); } return(0u); } }
private void GetSpeakerMsg(CS_HORN_TYPE type, uint beginSec) { CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(1305u); cSPkg.stPkgData.get_stGetHornMsgReq().bHornType = type; cSPkg.stPkgData.get_stGetHornMsgReq().dwBeginShowSec = beginSec; Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref cSPkg, false); }
private uint GetLastSpeakerBeginSec(CS_HORN_TYPE type) { if (type == null) { return(this.m_lastSpeakerBeginSec); } return(this.m_lastLoudSpeakerBeginSec); }
private ListView <COMDT_CHAT_MSG_HORN> GetSpeakerList(CS_HORN_TYPE type) { if (type == CS_HORN_TYPE.CS_HORNTYPE_SMALL) { return(this.speakerList); } return(this.loudSpeakerList); }
public static void OnGetSpeakerMsgRsp(CSPkg msg) { CS_HORN_TYPE bHornType = (CS_HORN_TYPE)msg.stPkgData.stGetHornMsgRsp.bHornType; Singleton <CLoudSpeakerSys> .instance.AddSpeakerArray(bHornType, msg.stPkgData.stGetHornMsgRsp.astMsgInfo, msg.stPkgData.stGetHornMsgRsp.wMsgCnt); Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_LobbyChatData_Change"); }
private void GetSpeakerMsg(CS_HORN_TYPE type, uint beginSec) { CSPkg msg = NetworkModule.CreateDefaultCSPKG(0x519); msg.stPkgData.stGetHornMsgReq.bHornType = (byte)type; msg.stPkgData.stGetHornMsgReq.dwBeginShowSec = beginSec; Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref msg, false); }
private uint GetLastSpeakerIndex(CS_HORN_TYPE type) { ListView <COMDT_CHAT_MSG_HORN> speakerList = this.GetSpeakerList(type); if (speakerList.Count > 0) { return(speakerList[speakerList.Count - 1].dwMsgIdx); } return(0); }
public static void OnGetSpeakerMsgRsp(CSPkg msg) { CS_HORN_TYPE bHornType = msg.stPkgData.get_stGetHornMsgRsp().bHornType; Singleton <CLoudSpeakerSys> .get_instance().AddSpeakerArray(bHornType, msg.stPkgData.get_stGetHornMsgRsp().astMsgInfo, (uint)msg.stPkgData.get_stGetHornMsgRsp().wMsgCnt); if (bHornType == null && msg.stPkgData.get_stGetHornMsgRsp().wMsgCnt > 0) { Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_LobbyChatData_Change"); } }
private COMDT_CHAT_MSG_HORN PopSpeakerList(CS_HORN_TYPE type) { COMDT_CHAT_MSG_HORN comdt_chat_msg_horn = null; ListView <COMDT_CHAT_MSG_HORN> speakerList = this.GetSpeakerList(type); if (speakerList.Count > 0) { comdt_chat_msg_horn = speakerList[0]; speakerList.RemoveAt(0); } return(comdt_chat_msg_horn); }
private void GetSpeakerMsg(CS_HORN_TYPE type, uint index) { if (index != 0) { index++; } CSPkg msg = NetworkModule.CreateDefaultCSPKG(0x519); msg.stPkgData.stGetHornMsgReq.bHornType = (byte)type; msg.stPkgData.stGetHornMsgReq.dwMsgIdx = index; Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref msg, false); }
private COMDT_CHAT_MSG_HORN PopSpeakerList(CS_HORN_TYPE type) { COMDT_CHAT_MSG_HORN result = null; ListView <COMDT_CHAT_MSG_HORN> listView = this.GetSpeakerList(type); if (listView.get_Count() > 0) { result = listView.get_Item(0); listView.RemoveAt(0); } return(result); }
private ListView <COMDT_CHAT_MSG_HORN> GetSpeakerList(CS_HORN_TYPE type) { ListView <COMDT_CHAT_MSG_HORN> result; if (type == null) { result = this.speakerList; } else { result = this.loudSpeakerList; } return(result); }
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 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 static uint GetSpeakerVaildTime(CS_HORN_TYPE type) { ResHornInfo dataByKey = null; ListView <COMDT_CHAT_MSG_HORN> speakerList = Singleton <CLoudSpeakerSys> .instance.GetSpeakerList(type); if (type == CS_HORN_TYPE.CS_HORNTYPE_SMALL) { dataByKey = GameDataMgr.speakerDatabin.GetDataByKey(0x2739); } else { dataByKey = GameDataMgr.speakerDatabin.GetDataByKey(0x273a); } if (speakerList.Count == 0) { return(dataByKey.dwMaxShowSec); } return(dataByKey.dwMinShowSec); }
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); } }