|
@@ -200,12 +200,31 @@ namespace GFGGame
|
|
|
{
|
|
|
GameGlobal.isFirstEntry = true;
|
|
|
ViewManager.Hide<ModalStatusView>();
|
|
|
- GameController.ShowCreateRole();
|
|
|
+ //GameController.ShowCreateRole();不显示创角界面,在剧情中改名
|
|
|
+ await ReqCreateRole();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static async ETTask ReqCreateRole(string roleName)
|
|
|
+ public static async ETTask<string> ReqRandomRoleName()
|
|
|
{
|
|
|
+ (int result, string name) = await LoginHelper.ReqRandomRoleName();
|
|
|
+ if (result == ErrorCode.ERR_Success)
|
|
|
+ {
|
|
|
+ return name;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ErrorCodeController.Handler(result);
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static async ETTask ReqCreateRole(string roleName = null)
|
|
|
+ {
|
|
|
+ if(string.IsNullOrEmpty(roleName))
|
|
|
+ {
|
|
|
+ roleName = await ReqRandomRoleName();
|
|
|
+ }
|
|
|
ViewManager.Show<ModalStatusView>("创建角色中...");
|
|
|
int errorCode = await ET.LoginHelper.CreateRole(GameGlobal.zoneScene, roleName);
|
|
|
if (errorCode != ErrorCode.ERR_Success)
|