public static string GetEChatChannel_Text(EChatChannel channel) { switch (channel) { case EChatChannel.Team: return(Singleton <CTextManager> .GetInstance().GetText("chat_title_team")); case EChatChannel.Room: return(Singleton <CTextManager> .instance.GetText("chat_title_room")); case EChatChannel.Lobby: return(Singleton <CTextManager> .instance.GetText("chat_title_total")); case EChatChannel.GuildMatchTeam: return(Singleton <CTextManager> .GetInstance().GetText("Chat_title_GuildMatchTeam")); case EChatChannel.Friend: return(Singleton <CTextManager> .instance.GetText("chat_title_friend")); case EChatChannel.Guild: return(Singleton <CTextManager> .GetInstance().GetText("chat_title_guild")); case EChatChannel.GuildRecruit: return(Singleton <CTextManager> .GetInstance().GetText("Guild_Guild_Recruit")); case EChatChannel.Settle: return(Singleton <CTextManager> .GetInstance().GetText("Chat_title_Settle")); } return("error"); }
public void Add_NewContent_Entry(string a, EChatChannel curChannel) { if (curChannel == EChatChannel.Lobby && Singleton <CLoudSpeakerSys> .get_instance().IsSpeakerShowing()) { return; } this.CurChannel = curChannel; if (this.entryEntity == null) { return; } this.entryEntity.Clear(); this.entryEntity.text = a; float x = CChatView.entrySizeLobby.x; if (Singleton <CChatController> .get_instance().model.channelMgr.ChatTab == CChatChannelMgr.EChatTab.Room) { x = CChatView.entrySizeRoom.x; } else if (Singleton <CChatController> .get_instance().model.channelMgr.ChatTab == CChatChannelMgr.EChatTab.Team) { x = CChatView.entrySizeTeam.x; } Singleton <CChatController> .get_instance().view.ChatParser.bProc_ChatEntry = true; Singleton <CChatController> .get_instance().view.ChatParser.maxWidth = (int)x - CChatParser.chat_entry_channel_img_width; Singleton <CChatController> .get_instance().view.ChatParser.Parse(this.entryEntity.text, CChatParser.start_x, this.entryEntity); }
public enCheckChatResult CheckSend(EChatChannel channel, string content = "", bool bContentCheck = false) { if (bContentCheck && string.IsNullOrEmpty(content)) { return(enCheckChatResult.EmptyLimit); } if ((channel == EChatChannel.Lobby) && !Singleton <CFunctionUnlockSys> .instance.FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_CHAT)) { return(enCheckChatResult.FunUnlockLimit); } DateTime banTime = MonoSingleton <IDIPSys> .GetInstance().GetBanTime(COM_ACNT_BANTIME_TYPE.COM_ACNT_BANTIME_DENYCHAT); DateTime time2 = Utility.ToUtcTime2Local((long)Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo().getCurrentTimeSinceLogin()); if (banTime > time2) { return(enCheckChatResult.BanLimit); } if (!this.model.channelMgr.GetChannel(this.view.CurTab).IsInputValid()) { return(enCheckChatResult.CdLimit); } if (((channel == EChatChannel.Lobby) && !CSysDynamicBlock.bChatPayBlock) && (Singleton <CChatController> .GetInstance().model.sysData.restChatFreeCnt <= 0)) { return(enCheckChatResult.FreeCntLimit); } return(enCheckChatResult.Success); }
public void Add_NewContent_Entry_ColorFlag(string a, EChatChannel curChannel) { if (curChannel == EChatChannel.Lobby && Singleton <CLoudSpeakerSys> .instance.IsSpeakerShowing()) { return; } this.CurChannel = curChannel; if (this.entryEntity == null) { return; } this.entryEntity.Clear(); this.entryEntity.text = a; float x = CChatView.entrySizeLobby.x; if (Singleton <CChatController> .instance.model.channelMgr.ChatTab == CChatChannelMgr.EChatTab.Room) { x = CChatView.entrySizeRoom.x; } else if (Singleton <CChatController> .instance.model.channelMgr.ChatTab == CChatChannelMgr.EChatTab.Team) { x = CChatView.entrySizeTeam.x; } Singleton <CChatController> .instance.view.ChatParser.bProc_ChatEntry = true; Singleton <CChatController> .instance.view.ChatParser.maxWidth = (int)x - CChatParser.chat_entry_channel_img_width; int lingWidth = (int)x - CChatParser.chat_entry_channel_img_width; int num = 0; List <string> list = Singleton <CChatController> .instance.ColorParser.Parse(lingWidth, this.entryEntity.text, Singleton <CChatController> .instance.view.ChatParser.viewFontSize, out num); if (list.get_Count() >= 1) { this.entryEntity.TextObjList.Add(new CTextImageNode(list.get_Item(0), CChatParser.InfoType.Text, (float)num, 0f, 0f, 0f)); } }
public static COM_CHAT_MSG_TYPE Convert_Channel_ChatMsgType(EChatChannel type) { switch (type) { case EChatChannel.Team: return(6); case EChatChannel.Room: return(3); case EChatChannel.Lobby: return(1); case EChatChannel.GuildMatchTeam: return(11); case EChatChannel.Friend: return(2); case EChatChannel.Guild: return(4); case EChatChannel.Settle: return(8); } return(100000); }
public CChatChannel(EChatChannel channelType, uint cdTime = 0u, ulong ullUid = 0uL, uint dwLogicWorldId = 0u) { this.ChannelType = channelType; this.cd_time = 0u; this.ullUid = ullUid; this.dwLogicWorldId = dwLogicWorldId; }
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 COM_CHAT_MSG_TYPE Convert_Channel_ChatMsgType(EChatChannel type) { switch (type) { case EChatChannel.Team: return(COM_CHAT_MSG_TYPE.COM_CHAT_MSG_TYPE_TEAM); case EChatChannel.Room: return(COM_CHAT_MSG_TYPE.COM_CHAT_MSG_TYPE_ROOM); case EChatChannel.Lobby: return(COM_CHAT_MSG_TYPE.COM_CHAT_MSG_TYPE_LOGIC_WORLD); case EChatChannel.GuildMatchTeam: return(COM_CHAT_MSG_TYPE.COM_CHAT_MSG_TYPE_GUILD_TEAM); case EChatChannel.Friend: return(COM_CHAT_MSG_TYPE.COM_CHAT_MSG_TYPE_PRIVATE); case EChatChannel.Guild: return(COM_CHAT_MSG_TYPE.COM_CHAT_MSG_TYPE_GUILD); case EChatChannel.Settle: return(COM_CHAT_MSG_TYPE.COM_CHAT_MSG_TYPE_SETTLE); } return((COM_CHAT_MSG_TYPE)100000); }
public void Clear(EChatChannel type, ulong ullUid = 0uL, uint dwLogicWorldId = 0u) { CChatChannel cChatChannel = this._getChannel(type, ullUid, dwLogicWorldId); if (cChatChannel != null) { cChatChannel.Clear(); } }
public static string Build_4_EntryString(EChatChannel type, ulong ullUid, uint iLogicWorldID, string rawText) { string str = string.Empty; if (type == EChatChannel.Friend) { COMDT_FRIEND_INFO gameOrSnsFriend = Singleton <CFriendContoller> .GetInstance().model.GetGameOrSnsFriend(ullUid, iLogicWorldID); if (gameOrSnsFriend != null) { str = string.Format(CChatController.fmt, UT.Bytes2String(gameOrSnsFriend.szUserName), rawText); } return(str); } if (type == EChatChannel.Lobby) { COMDT_CHAT_PLAYER_INFO comdt_chat_player_info = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID); if (comdt_chat_player_info != null) { str = string.Format(CChatController.fmt, UT.Bytes2String(comdt_chat_player_info.szName), rawText); } return(str); } if (type == EChatChannel.Guild) { COMDT_CHAT_PLAYER_INFO comdt_chat_player_info2 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID); if (comdt_chat_player_info2 != null) { str = string.Format(CChatController.fmt, UT.Bytes2String(comdt_chat_player_info2.szName), rawText); } return(str); } if (type == EChatChannel.Room) { COMDT_CHAT_PLAYER_INFO comdt_chat_player_info3 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID); if (comdt_chat_player_info3 != null) { str = string.Format(CChatController.fmt, UT.Bytes2String(comdt_chat_player_info3.szName), rawText); } return(str); } if (type == EChatChannel.Team) { COMDT_CHAT_PLAYER_INFO comdt_chat_player_info4 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID); if (comdt_chat_player_info4 != null) { str = string.Format(CChatController.fmt, UT.Bytes2String(comdt_chat_player_info4.szName), rawText); } return(str); } return("ERROR, in Build_4_EntryString"); }
public CChatChannel GetChannel(EChatChannel type) { CChatChannel cChatChannel = this._getChannel(type, 0uL, 0u); if (cChatChannel == null) { cChatChannel = this.CreateChannel(type, 0uL, 0u); } return(cChatChannel); }
public int GetUnreadCount(EChatChannel type, ulong ullUid = 0uL, uint dwLogicWorldId = 0u) { CChatChannel cChatChannel = this._getChannel(type, ullUid, dwLogicWorldId); if (cChatChannel == null) { cChatChannel = this.CreateChannel(type, ullUid, dwLogicWorldId); } return(cChatChannel.GetUnreadCount()); }
public void Clear() { this.ullUid = 0L; this.dwLogicWorldId = 0; this.lastTimeStamp = 0; this.LastChannel = EChatChannel.None; this.CurChannel = EChatChannel.None; this.restChatFreeCnt = 0; this.m_chatCostNum = 0; this.m_chatCostType = 0; this.entryEntity.Clear(); }
public void ClearEntryText() { this.CurChannel = EChatChannel.None; if (this.entryEntity != null) { this.entryEntity.Clear(); } Singleton <CChatController> .instance.view.SetEntryChannelImage(EChatChannel.None); Singleton <CChatController> .instance.view.Clear_EntryForm_Node(); Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_ChatEntry_Change"); }
public void Add_NewContent_Entry_Speaker(string a) { this.CurChannel = EChatChannel.Speaker; if (this.entryEntity != null) { this.entryEntity.Clear(); this.entryEntity.text = a; float x = CChatView.entrySizeLobby.x; Singleton <CChatController> .instance.view.ChatParser.bProc_ChatEntry = true; Singleton <CChatController> .instance.view.ChatParser.maxWidth = ((int)x) - CChatParser.chat_entry_channel_img_width; Singleton <CChatController> .instance.view.ChatParser.Parse(this.entryEntity.text, CChatParser.start_x, this.entryEntity); } }
public void Add_NewContent_Entry(string a, EChatChannel curChannel) { if (!Singleton <CLoudSpeakerSys> .instance.IsSpeakerShowing()) { this.CurChannel = curChannel; if (this.entryEntity != null) { this.entryEntity.Clear(); this.entryEntity.text = a; float num = (this.CurChannel != EChatChannel.Room) ? CChatView.entrySizeLobby.x : CChatView.entrySizeRoom.x; Singleton <CChatController> .instance.view.ChatParser.bProc_ChatEntry = true; Singleton <CChatController> .instance.view.ChatParser.maxWidth = ((int)num) - CChatParser.chat_entry_channel_img_width; Singleton <CChatController> .instance.view.ChatParser.Parse(this.entryEntity.text, CChatParser.start_x, this.entryEntity); } } }
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 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 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 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 CChatChannel _getChannel(EChatChannel type, ulong ullUid = 0uL, uint dwLogicWorldId = 0u) { if (type != EChatChannel.Friend) { for (int i = 0; i < this.NormalChannelList.Count; i++) { if (this.NormalChannelList[i] != null && this.NormalChannelList[i].ChannelType == type) { return(this.NormalChannelList[i]); } } } else { for (int j = 0; j < this.FriendChannelList.Count; j++) { if (this.FriendChannelList[j] != null && this.FriendChannelList[j].ullUid == ullUid && this.FriendChannelList[j].dwLogicWorldId == dwLogicWorldId) { return(this.FriendChannelList[j]); } } } return(null); }
public CChatChannel _getChannel(EChatChannel type, ulong ullUid = 0uL, uint dwLogicWorldId = 0u) { if (type != EChatChannel.Friend) { for (int i = 0; i < this.NormalChannelList.get_Count(); i++) { if (this.NormalChannelList.get_Item(i) != null && this.NormalChannelList.get_Item(i).ChannelType == type) { return(this.NormalChannelList.get_Item(i)); } } } else { for (int j = 0; j < this.FriendChannelList.get_Count(); j++) { if (this.FriendChannelList.get_Item(j) != null && this.FriendChannelList.get_Item(j).ullUid == ullUid && this.FriendChannelList.get_Item(j).dwLogicWorldId == dwLogicWorldId) { return(this.FriendChannelList.get_Item(j)); } } } return(null); }
public void SetRestFreeCnt(EChatChannel v, uint count) { this.sysData.restChatFreeCnt = count; }
public static string Build_4_EntryString(EChatChannel type, ulong ullUid, uint iLogicWorldID, string rawText) { string result = string.Empty; if (type == EChatChannel.Friend) { COMDT_FRIEND_INFO gameOrSnsFriend = Singleton <CFriendContoller> .GetInstance().model.GetGameOrSnsFriend(ullUid, iLogicWorldID); if (gameOrSnsFriend != null) { result = string.Format(CChatController.fmt, UT.Bytes2String(gameOrSnsFriend.szUserName), rawText); } } else if (type == EChatChannel.Lobby) { COMDT_CHAT_PLAYER_INFO cOMDT_CHAT_PLAYER_INFO = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID); if (cOMDT_CHAT_PLAYER_INFO != null) { result = string.Format(CChatController.fmt, UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO.szName), rawText); } } else if (type == EChatChannel.Guild) { COMDT_CHAT_PLAYER_INFO cOMDT_CHAT_PLAYER_INFO2 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID); if (cOMDT_CHAT_PLAYER_INFO2 != null) { result = string.Format(CChatController.fmt, UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO2.szName), rawText); } } else if (type == EChatChannel.GuildMatchTeam) { COMDT_CHAT_PLAYER_INFO cOMDT_CHAT_PLAYER_INFO3 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID); if (cOMDT_CHAT_PLAYER_INFO3 != null) { result = string.Format(CChatController.fmt, UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO3.szName), rawText); } } else if (type == EChatChannel.Room) { COMDT_CHAT_PLAYER_INFO cOMDT_CHAT_PLAYER_INFO4 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID); if (cOMDT_CHAT_PLAYER_INFO4 != null) { result = string.Format(CChatController.fmt, UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO4.szName), rawText); } } else if (type == EChatChannel.Team) { COMDT_CHAT_PLAYER_INFO cOMDT_CHAT_PLAYER_INFO5 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID); if (cOMDT_CHAT_PLAYER_INFO5 != null) { result = string.Format(CChatController.fmt, UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO5.szName), rawText); } } else if (type == EChatChannel.Settle) { COMDT_CHAT_PLAYER_INFO cOMDT_CHAT_PLAYER_INFO6 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID); if (cOMDT_CHAT_PLAYER_INFO6 != null) { result = string.Format(CChatController.fmt, UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO6.szName), rawText); } } else { result = "ERROR, in Build_4_EntryString"; } return(result); }
public void SetTimeStamp(EChatChannel v, uint time) { this.sysData.lastTimeStamp = time; }