Browse Source

请求随机名字

zhaoyang 3 years ago
parent
commit
202de47146

+ 28 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Login/LoginHelper.cs

@@ -415,5 +415,33 @@ namespace ET
 
             return true;
         }
+        public static async ETTask<bool> ReqRandomRoleName()
+        {
+            A2C_GetLatestNotice response = null;
+            try
+            {
+                response = (A2C_GetLatestNotice)await GameGlobal.zoneScene.GetComponent<SessionComponent>().AccountSession?.Call(new C2A_GetLatestNotice());
+            }
+            catch (Exception e)
+            {
+                Log.Error(e.ToString());
+                return false;
+            }
+
+            if (response.Error != ErrorCode.ERR_Success)
+            {
+                Log.Error(response.Error.ToString());
+                return false;
+            }
+            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;
+        }
     }
 }

+ 2 - 0
GameClient/Assets/Game/HotUpdate/Views/CreateRole/CreateRoleView.cs

@@ -45,6 +45,8 @@ namespace GFGGame
             if (_ui.m_inputName.text.Length > 0)
             {
                 string roleName = _ui.m_inputName.text;
+
+                
                 LoginController.ReqCreateRole(roleName).Coroutine();
             }
         }