zhaoyang hace 2 años
padre
commit
7223117de8

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

@@ -50,7 +50,7 @@ namespace GFGGame
                 UpdateFriendList(true);
             }
         }
-        public void ChangeFriendInfo(RoleInfoData roleInfo)
+        public void ChangeFriendInfo(OtherRoleInfoData roleInfo)
         {
             if (_friendDic.ContainsKey(roleInfo.roleId))
             {
@@ -98,15 +98,15 @@ namespace GFGGame
         }
 
 
-        private List<RoleInfoData> _recommendDatas = new List<RoleInfoData>();//推荐列表
-        public List<RoleInfoData> RecommendDatas
+        private List<OtherRoleInfoData> _recommendDatas = new List<OtherRoleInfoData>();//推荐列表
+        public List<OtherRoleInfoData> RecommendDatas
         {
             get
             {
                 return _recommendDatas;
             }
         }
-        public void AddRecommendData(RoleInfoData recommendData)
+        public void AddRecommendData(OtherRoleInfoData recommendData)
         {
             _recommendDatas.Add(recommendData);
         }
@@ -116,15 +116,15 @@ namespace GFGGame
         }
 
 
-        private List<RoleInfoData> _searchDatas = new List<RoleInfoData>();//搜索列表
-        public List<RoleInfoData> SearchDatas
+        private List<OtherRoleInfoData> _searchDatas = new List<OtherRoleInfoData>();//搜索列表
+        public List<OtherRoleInfoData> SearchDatas
         {
             get
             {
                 return _searchDatas;
             }
         }
-        public void AddSearchData(RoleInfoData searchData)
+        public void AddSearchData(OtherRoleInfoData searchData)
         {
             _searchDatas.Add(searchData);
         }

+ 5 - 14
GameClient/Assets/Game/HotUpdate/Data/RoleDataManager.cs

@@ -17,20 +17,11 @@ namespace GFGGame
             }
         }
         public static string slogan = "";
-        public static int headId
-        {
-            get
-            {
-                return 5000001;
-            }
-        }
-        public static int headBorderId
-        {
-            get
-            {
-                return 5005001;
-            }
-        }
+
+        public static int headId = ConstItemID.HEADID;
+
+        public static int headBorderId = ConstItemID.BORDERID;
+
 
         public static int power
         {

+ 39 - 8
GameClient/Assets/Game/HotUpdate/Data/RoleInfoManager.cs

@@ -7,8 +7,13 @@ namespace GFGGame
 {
     public class RoleInfoManager : SingletonBase<RoleInfoManager>
     {
+        public void Clear()
+        {
+            _headDatas.Clear();
+            _headBorderDatas.Clear();
+        }
 
-        private List<int> _headDatas = new List<int>() { 5000001, 5000002, 5000003 };
+        private List<int> _headDatas = new List<int>();
         public List<int> headDatas
         {
             get
@@ -18,7 +23,7 @@ namespace GFGGame
             }
         }
 
-        private List<int> _headBorderDatas = new List<int>() { 5005001, 5005002, 5005003, 5005001, 5005002, 5005003, 5005001, 5005002, 5005003, 5005001, 5005002, 5005003 };
+        private List<int> _headBorderDatas = new List<int>();
         public List<int> headBorderDatas
         {
             get
@@ -41,11 +46,7 @@ namespace GFGGame
             }
         }
 
-        public void Clear()
-        {
-            _headDatas.Clear();
-            _headBorderDatas.Clear();
-        }
+
         public void Add(int itemId)
         {
             ItemCfg cfg = ItemCfgArray.Instance.GetCfg(itemId);
@@ -70,14 +71,44 @@ namespace GFGGame
             {
                 if (_headBorderDatas.IndexOf(itemId) >= 0) _headBorderDatas.Remove(itemId);
             }
-
         }
 
+        private List<int> _newHeadDatas = new List<int>();
+        private List<int> _newHeadBorderDatas = new List<int>();
+
+        public void AddNew(int itemId)
+        {
+            ItemCfg cfg = ItemCfgArray.Instance.GetCfg(itemId);
+            if (cfg.subType == 0)
+            {
+                if (_newHeadDatas.IndexOf(itemId) >= 0) _newHeadDatas.Add(itemId);
+            }
+            else if (cfg.subType == 1)
+            {
+                if (_newHeadBorderDatas.IndexOf(itemId) >= 0) _newHeadBorderDatas.Add(itemId);
+            }
+        }
+        public void RemoveNew(int itemId)
+        {
+            ItemCfg cfg = ItemCfgArray.Instance.GetCfg(itemId);
+            if (cfg.subType == 0)
+            {
+                if (_newHeadDatas.IndexOf(itemId) >= 0) _newHeadDatas.Remove(itemId);
+            }
+            else if (cfg.subType == 1)
+            {
+                if (_newHeadBorderDatas.IndexOf(itemId) >= 0) _newHeadBorderDatas.Remove(itemId);
+            }
+        }
 
         private void SortHeadDatas()
         {
             _headDatas.Sort((int a, int b) =>
             {
+                if (a == RoleDataManager.headId && b != RoleDataManager.headId) return a - b;
+                if (a != RoleDataManager.headId && b == RoleDataManager.headId) return b - a;
+                if (_newHeadDatas.IndexOf(a) >= 0 && _newHeadDatas.IndexOf(b) < 0) return a - b;
+                if (_newHeadDatas.IndexOf(a) < 0 && _newHeadDatas.IndexOf(b) >= 0) return b - a;
                 return b - a;
             });
         }

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Data/VO/FriendInfoData.cs

@@ -2,7 +2,7 @@ namespace GFGGame
 {
     public class FriendInfoData
     {
-        public RoleInfoData roleInfo;
+        public OtherRoleInfoData roleInfo;
         public int type;//好友关系类型,由FriendType枚举
         public int giveGiftState;//赠送状态,由ConstGiveGiftStatus枚举
         public int takeGiftState;//领取赠送状态,由ConstBonusStatus枚举

+ 8 - 2
GameClient/Assets/Game/HotUpdate/Data/VO/RoleInfoData.cs

@@ -1,18 +1,24 @@
+using System.Collections.Generic;
+
 namespace GFGGame
 {
-    public class RoleInfoData
+    public class OtherRoleInfoData//其他玩家摘要信息
     {
         public long roleId;
         public string roleName;
         public int roleLv;
+        public int roleHead;
+        public int roleHeadBorder;
         public long offlineTimeSec;//离线时间戳,单位秒,0表示在线
 
+
     }
 
-    public class RoleInfoDetailData
+    public class OtherRoleInfoDetailData//其他玩家详细信息
     {
         public string slogan;//个性签名
         public CustomSuitData customSuitData; //当前搭配套装
         public int RoleLvl = 1; //玩家等级
+        public List<long> showPhotoList = new List<long>();
     }
 }

+ 6 - 6
GameClient/Assets/Game/HotUpdate/ServerProxy/FriendSProxy.cs

@@ -19,7 +19,7 @@ namespace ET
     {
         protected override async ETTask Run(Session session, S2C_NoticeFriendInfo message)
         {
-            RoleInfoData roleInfo = new RoleInfoData();
+            OtherRoleInfoData roleInfo = new OtherRoleInfoData();
             roleInfo.roleId = message.RoleInfo.RoleId;
             roleInfo.roleLv = message.RoleInfo.RoleLvl;
             roleInfo.roleName = message.RoleInfo.RoleName;
@@ -49,7 +49,7 @@ namespace ET
             }
             if (isSame) return;
 
-            RoleInfoData roleInfo = new RoleInfoData();
+            OtherRoleInfoData roleInfo = new OtherRoleInfoData();
             roleInfo.roleId = message.FriendInfo.RoleInfo.RoleId;
             roleInfo.roleName = message.FriendInfo.RoleInfo.RoleName;
             roleInfo.roleLv = message.FriendInfo.RoleInfo.RoleLvl;
@@ -76,7 +76,7 @@ namespace ET
         {
             for (int i = 0; i < message.FriendList.Count; i++)
             {
-                RoleInfoData roleInfo = new RoleInfoData();
+                OtherRoleInfoData roleInfo = new OtherRoleInfoData();
                 roleInfo.roleId = message.FriendList[i].RoleInfo.RoleId;
                 roleInfo.roleName = message.FriendList[i].RoleInfo.RoleName;
                 roleInfo.roleLv = message.FriendList[i].RoleInfo.RoleLvl;
@@ -138,7 +138,7 @@ namespace GFGGame
                     for (int i = 0; i < response.FriendList.Count; i++)
                     {
 
-                        RoleInfoData roleInfo = new RoleInfoData();
+                        OtherRoleInfoData roleInfo = new OtherRoleInfoData();
                         roleInfo.roleId = response.FriendList[i].RoleInfo.RoleId;
                         roleInfo.roleName = response.FriendList[i].RoleInfo.RoleName;
                         roleInfo.roleLv = response.FriendList[i].RoleInfo.RoleLvl;
@@ -275,7 +275,7 @@ namespace GFGGame
                     for (int i = 0; i < response.RoleList.Count; i++)
                     {
 
-                        RoleInfoData roleInfo = new RoleInfoData();
+                        OtherRoleInfoData roleInfo = new OtherRoleInfoData();
                         roleInfo.roleId = response.RoleList[i].RoleId;
                         roleInfo.roleName = response.RoleList[i].RoleName;
                         roleInfo.roleLv = response.RoleList[i].RoleLvl;
@@ -300,7 +300,7 @@ namespace GFGGame
                     FriendDataManager.Instance.ClearRecommendDatas();
                     for (int i = 0; i < response.RoleList.Count; i++)
                     {
-                        RoleInfoData roleInfo = new RoleInfoData();
+                        OtherRoleInfoData roleInfo = new OtherRoleInfoData();
                         roleInfo.roleId = response.RoleList[i].RoleId;
                         roleInfo.roleName = response.RoleList[i].RoleName;
                         roleInfo.roleLv = response.RoleList[i].RoleLvl;

+ 5 - 2
GameClient/Assets/Game/HotUpdate/ServerProxy/RoleInfoSProxy.cs

@@ -15,13 +15,16 @@ namespace GFGGame
                 if (response.Error == ErrorCode.ERR_Success)
                 {
                     RoleDataManager.slogan = response.Signature;
+                    RoleDataManager.headId = response.HeadPortraitItemId;
+                    RoleDataManager.headBorderId = response.HeadPortraitBoxItemId;
+                    // RoleInfoManager.Instance.photoDatas=response.OpenAlbumList;
                     return true;
                 }
             }
             return false;
         }
         //请求其他玩家详细信息
-        public static async ETTask<RoleInfoDetailData> ReqOtherRoleDetailInfo(long friendId)
+        public static async ETTask<OtherRoleInfoDetailData> ReqOtherRoleDetailInfo(long friendId)
         {
             S2C_GetOtherRoleDetailInfo response = null;
             response = (S2C_GetOtherRoleDetailInfo)await MessageHelper.SendToServer(new C2S_GetOtherRoleDetailInfo() { RoleId = friendId });
@@ -29,7 +32,7 @@ namespace GFGGame
             {
                 if (response.Error == ErrorCode.ERR_Success)
                 {
-                    RoleInfoDetailData roleInfoDetail = new RoleInfoDetailData();
+                    OtherRoleInfoDetailData roleInfoDetail = new OtherRoleInfoDetailData();
                     roleInfoDetail.slogan = response.Signature;
                     roleInfoDetail.RoleLvl = response.RoleLvl;
                     if (response.CustomSuit != null)

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

@@ -9,7 +9,7 @@ namespace GFGGame
     {
         private UI_FriendAddUI _ui;
 
-        private List<RoleInfoData> _searchDatas = new List<RoleInfoData>();
+        private List<OtherRoleInfoData> _searchDatas = new List<OtherRoleInfoData>();
         public override void Dispose()
         {
             if (_ui != null)
@@ -82,7 +82,7 @@ namespace GFGGame
 
         private void RenderListSearchItem(int index, GObject obj)
         {
-            RoleInfoData roleInfoData = _searchDatas[index];
+            OtherRoleInfoData roleInfoData = _searchDatas[index];
 
             UI_ListSearchItem item = UI_ListSearchItem.Proxy(obj);
             item.m_txtName.text = roleInfoData.roleName;

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

@@ -236,7 +236,7 @@ namespace GFGGame
             if (index >= 0)
             {
                 long roleId = FriendDataManager.Instance.FriendDatas[index].roleInfo.roleId;
-                RoleInfoDetailData roleInfoDetail = await RoleInfoSProxy.ReqOtherRoleDetailInfo(roleId);
+                OtherRoleInfoDetailData roleInfoDetail = await RoleInfoSProxy.ReqOtherRoleDetailInfo(roleId);
                 if (roleInfoDetail != null)
                 {
                     UpdateScene(roleInfoDetail.customSuitData);

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/Poem/PoemGalleryPreviewView.cs

@@ -66,7 +66,7 @@ namespace GFGGame
             _ui.m_btnVote.title = _galleryData.VoteCount.ToString();
             _ui.m_btnAddFriend.visible = _galleryData.AuthorId != RoleDataManager.roleId && FriendDataManager.Instance.GetFriendDataById(_galleryData.AuthorId) == null;
 
-            RoleInfoDetailData roleInfo = await RoleInfoSProxy.ReqOtherRoleDetailInfo(_galleryData.AuthorId);
+            OtherRoleInfoDetailData roleInfo = await RoleInfoSProxy.ReqOtherRoleDetailInfo(_galleryData.AuthorId);
             if (roleInfo != null)
             {
                 _ui.m_comHead.m_txtLvl.text = roleInfo.RoleLvl.ToString();