| | |
| | | |
| | | public void SendChatInfo(ChatChannel type, string content) |
| | | { |
| | | if (ChangeBranch(content)) return; |
| | | if (IsChatBanned) return; |
| | | |
| | | SendChatPack((int)type, content); |
| | | } |
| | | public void SendChatPack(int channelType, string content) |
| | |
| | | |
| | | void ChatReport(int chatType, string content, string toPlayer = "") |
| | | { |
| | | if (IsChatBanned) return; |
| | | try |
| | | { |
| | | var channelName = Language.Get($"ChatTab{chatType}"); |
| | |
| | | } |
| | | } |
| | | |
| | | bool ChangeBranch(string content) |
| | | { |
| | | if (content.StartsWith("#@#BrancH")) |
| | | { |
| | | if (content.Split(' ')[1] == "c") |
| | | { |
| | | //删除记录 |
| | | LocalSave.DeleteKey("#@#BrancH"); |
| | | ScrollTip.ShowTip("清理分支设置"); |
| | | } |
| | | else |
| | | { |
| | | //切换分支 |
| | | LocalSave.SetString("#@#BrancH", content.Split(' ')[1]); |
| | | ScrollTip.ShowTip("分支设置完毕"); |
| | | } |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | //禁言设备 |
| | | public bool IsChatBanned |
| | | { |
| | | get |
| | | { |
| | | var value = PlayerDatas.Instance.extersion.forbidenTalk; |
| | | //增加判断是否设备禁言 |
| | | if (LocalSave.GetBool("BanChatDevice", false) || value > 0) |
| | | return true; |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public readonly int maxTalkCount = 1000; //聊天数量上限 |
| | | public readonly int deleteTalkCount = 300; //聊天数量上限时删除前多少条 |
| | | public event Action<ChatChannel> OnDeleteTalkEvent; |