Browse Source

随机名字

zhaoyang 3 years ago
parent
commit
aac5bb9d42

+ 6 - 13
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Login/LoginHelper.cs

@@ -415,33 +415,26 @@ namespace ET
 
             return true;
         }
-        public static async ETTask<bool> ReqRandomRoleName()
+        public static async ETTask<string> ReqRandomRoleName()
         {
-            A2C_GetLatestNotice response = null;
+            A2C_GetRandomRoleName response = null;
             try
             {
-                response = (A2C_GetLatestNotice)await GameGlobal.zoneScene.GetComponent<SessionComponent>().AccountSession?.Call(new C2A_GetLatestNotice());
+                response = (A2C_GetRandomRoleName)await GameGlobal.zoneScene.GetComponent<SessionComponent>().AccountSession?.Call(new C2A_GetRandomRoleName());
             }
             catch (Exception e)
             {
                 Log.Error(e.ToString());
-                return false;
+                return "";
             }
 
             if (response.Error != ErrorCode.ERR_Success)
             {
                 Log.Error(response.Error.ToString());
-                return false;
+                return "";
             }
-            NoticeInfo noticeInfo = new NoticeInfo();
-            noticeInfo.noticeId = response.NoticeId;
-            noticeInfo.title = response.Title;
-            noticeInfo.time = response.TimeSec;
-            noticeInfo.content = response.Content;
 
-            NoticeDataManager.Instance.LastNoticeInfo = noticeInfo;
-
-            return true;
+            return response.Name;
         }
     }
 }