zhaoyang 3 лет назад
Родитель
Сommit
f494810dd0

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

@@ -9,8 +9,8 @@ namespace GFGGame
     {
         public void Clear()
         {
-            _friendDic.Clear();
-            _list.Clear();
+
+            ClearAddFriend();
             ClearRecommendDatas();
             ClearSearchDatas();
             ClearApplyDatas();
@@ -33,7 +33,11 @@ namespace GFGGame
                 return _list;
             }
         }
-
+        public void ClearAddFriend()
+        {
+            _list.Clear();
+            _friendDic.Clear();
+        }
         public void AddFriend(FriendInfoData roleInfo)
         {
             _friendDic.Add(roleInfo.roleInfo.roleId, roleInfo);

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

@@ -3,6 +3,17 @@ using GFGGame;
 using ET;
 namespace ET
 {
+    //推送好友每日重置
+    public class NoticeFriendDailyReset : AMHandler<S2C_NoticeFriendDailyReset>
+    {
+        protected override async ETTask Run(Session session, S2C_NoticeFriendDailyReset message)
+        {
+
+            FriendSProxy.ReqAllFriendInfos().Coroutine();
+            await ETTask.CompletedTask;
+        }
+
+    }
     //推送其他玩家信息变化
     public class NoticeRoleInfoChanged : AMHandler<S2C_NoticeFriendInfo>
     {
@@ -122,6 +133,7 @@ namespace GFGGame
             {
                 if (response.Error == ErrorCode.ERR_Success)
                 {
+                    FriendDataManager.Instance.ClearAddFriend();
                     for (int i = 0; i < response.FriendList.Count; i++)
                     {