少年修仙传客户端代码仓库
wuxijin999
2019-07-22 6eb02cd3de19bb36d8e3bdd1da4854d7d8069c54
4558 【主干】【2.0.300】客户端聊天记录缓存去除
2个文件已修改
35 ■■■■■ 已修改文件
System/Chat/ChatCenter.cs 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Chat/ChatCtrl.cs 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Chat/ChatCenter.cs
@@ -175,40 +175,6 @@
            return _recentlyChat;
        }
        public void SaveLocalRecentlyChat()
        {
            for (int i = 0; i < recentlyChats.Count; i++)
            {
                var localKey = StringUtility.Contact("RecentlyChat_", PlayerDatas.Instance.baseData.PlayerID, "_", i);
                LocalSave.SetString(localKey, recentlyChats[i].ToString());
            }
        }
        void GetLocalRecentlyChat()
        {
            recentlyChats.Clear();
            for (int i = 0; i < RecentlyChatNum; i++)
            {
                var localKey = StringUtility.Contact("RecentlyChat_", PlayerDatas.Instance.baseData.PlayerID, "_", i);
                if (LocalSave.HasKey(localKey))
                {
                    var json = LocalSave.GetString(localKey);
                    if (!string.IsNullOrEmpty(json))
                    {
                        RecentlyChat chat;
                        if (RecentlyChat.TryParse(json, out chat))
                        {
                            recentlyChats.Add(chat);
                        }
                    }
                }
            }
            if (RecentlyChatChangeEvent != null)
            {
                RecentlyChatChangeEvent();
            }
        }
        public void OnBeforePlayerDataInitialize()
        {
            recentlyChat = null;
System/Chat/ChatCtrl.cs
@@ -319,7 +319,6 @@
                     _recentlyChat = chatCenter.SaveRecentlyChat(result);
                 }
                 msg = CheckHasItem(result, _recentlyChat);
                 chatCenter.SaveLocalRecentlyChat();
                 chatCenter.recentlyChat = null;
                 if (chatCenter.IsChatBanned || chatCenter.IsClientBan(type))