zhaoyang il y a 3 ans
Parent
commit
8a024203dd

+ 8 - 7
GameClient/Assets/Game/HotUpdate/Data/FriendDataManager.cs

@@ -38,14 +38,14 @@ namespace GFGGame
         public void AddFriend(FriendInfoData roleInfo)
         {
             _friendDic.Add(roleInfo.roleInfo.roleId, roleInfo);
-            UpdateFriendList();
+            UpdateFriendList(true);
         }
         public void RemoveFriend(long roleId)
         {
             if (_friendDic.ContainsKey(roleId))
             {
                 _friendDic.Remove(roleId);
-                UpdateFriendList();
+                UpdateFriendList(true);
             }
         }
         public void ChangeFriendInfo(RoleInfoData roleInfo)
@@ -53,7 +53,7 @@ namespace GFGGame
             if (_friendDic.ContainsKey(roleInfo.roleId))
             {
                 _friendDic[roleInfo.roleId].roleInfo = roleInfo;
-                UpdateFriendList();
+                UpdateFriendList(false);
             }
         }
         public void ChangeGiveGiftStates(long roleId, int state)
@@ -61,7 +61,7 @@ namespace GFGGame
             if (_friendDic.ContainsKey(roleId))
             {
                 _friendDic[roleId].giveGiftState = state;
-                UpdateFriendList();
+                UpdateFriendList(false);
             }
         }
         public void ChangeTakeGiftStates(long roleId, int state)
@@ -69,7 +69,7 @@ namespace GFGGame
             if (_friendDic.ContainsKey(roleId))
             {
                 _friendDic[roleId].takeGiftState = state;
-                UpdateFriendList();
+                UpdateFriendList(false);
             }
         }
         public void ChangeGiveTakeGiftStates(long roleId, int state, int takeState)
@@ -78,12 +78,13 @@ namespace GFGGame
             {
                 _friendDic[roleId].giveGiftState = state;
                 _friendDic[roleId].takeGiftState = takeState;
-                UpdateFriendList();
+                UpdateFriendList(false);
             }
         }
-        private void UpdateFriendList()
+        private void UpdateFriendList(bool sort)
         {
             _list = _friendDic.Values.ToList<FriendInfoData>();
+            if (!sort) return;
             _list.Sort((FriendInfoData a, FriendInfoData b) =>
             {
                 long count = b.roleInfo.offlineTimeSec - a.roleInfo.offlineTimeSec;

+ 0 - 3
GameClient/Assets/Game/HotUpdate/ServerProxy/FriendSProxy.cs

@@ -81,8 +81,6 @@ namespace ET
             }
             EventAgent.DispatchEvent(ConstMessage.FRIEND_ADD);
             EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
-            ET.Log.Debug("好友添加推送");
-
             await ETTask.CompletedTask;
         }
     }
@@ -94,7 +92,6 @@ namespace ET
         {
             FriendDataManager.Instance.RemoveFriend(message.RoleId);
             EventAgent.DispatchEvent(ConstMessage.FRIEND_REMOVE);
-            ET.Log.Debug("好友删除推送");
             await ETTask.CompletedTask;
         }
     }

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/Friend/FriendAddView.cs

@@ -234,7 +234,7 @@ namespace GFGGame
 
         private void UpdaterRed()
         {
-            RedDotController.Instance.SetComRedDot(_ui.m_btnTabApply, RedDotDataManager.Instance.GetFriendGiftRed());
+            RedDotController.Instance.SetComRedDot(_ui.m_btnTabApply, RedDotDataManager.Instance.GetFriendApplyRed());
         }
     }
 }

+ 0 - 5
GameClient/Assets/Game/HotUpdate/Views/Friend/FriendView.cs

@@ -109,7 +109,6 @@ namespace GFGGame
 
         private void RefreshView()
         {
-            ET.Log.Debug("好友刷新");
             _ui.m_list.RefreshVirtualList();
             _ui.m_txtCount.text = string.Format("好友数:{0}/{1}", _ui.m_list.numItems, GlobalCfgArray.globalCfg.maxFriendCount);
             _ui.m_btnSendAll.text = RedDotDataManager.Instance.GetFriendGiftRed() ? "一键领取并赠送" : "一键赠送";
@@ -192,8 +191,6 @@ namespace GFGGame
 
         private void RefreshRemoveFriend()
         {
-            ET.Log.Debug("好友删除");
-
             int index = _ui.m_list.selectedIndex;
             _ui.m_list.numItems = FriendDataManager.Instance.FriendDatas.Count;
             if (FriendDataManager.Instance.FriendDatas.Count > 0)
@@ -215,8 +212,6 @@ namespace GFGGame
 
         private void RefreshAddFriend()
         {
-            ET.Log.Debug("好友添加");
-
             int selectedIndex = 0;
             if (_ui.m_list.numItems > 0)
             {