|
@@ -12,10 +12,10 @@ namespace GFGGame
|
|
|
ViewManager.Show<LoginView>();
|
|
|
}
|
|
|
|
|
|
- public static async ET.ETTask LoginTest(string account)
|
|
|
+ public static async ET.ETTask LoginTest(string account, bool cancelDelete = false)
|
|
|
{
|
|
|
ViewManager.Show<ModalStatusView>("登录中...");
|
|
|
- int errorCode = await ET.LoginHelper.LoginTest(GameGlobal.zoneScene, GameConfig.LoginAddress, account);
|
|
|
+ (int errorCode, long deleteTime) = await ET.LoginHelper.LoginTest(GameGlobal.zoneScene, GameConfig.LoginAddress, account, cancelDelete);
|
|
|
|
|
|
if (errorCode == ET.ErrorCode.ERR_Success)
|
|
|
{
|
|
@@ -42,15 +42,15 @@ namespace GFGGame
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- OnLoginFail(errorCode, account);
|
|
|
+ OnLoginFail(errorCode, account, deleteTime, null, false);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
- public static async ET.ETTask Login(string account, string password, bool isMD5 = false)
|
|
|
+ public static async ET.ETTask Login(string account, string password, bool isMD5 = false, bool cancelDelete = false)
|
|
|
{
|
|
|
ViewManager.Show<ModalStatusView>("登录中...");
|
|
|
- int errorCode = await ET.LoginHelper.Login(GameGlobal.zoneScene, GameConfig.LoginAddress, account, password, isMD5);
|
|
|
+ (int errorCode, long deleteTime) = await ET.LoginHelper.Login(GameGlobal.zoneScene, GameConfig.LoginAddress, account, password, isMD5, cancelDelete);
|
|
|
|
|
|
if (errorCode == ET.ErrorCode.ERR_Success)
|
|
|
{
|
|
@@ -82,7 +82,7 @@ namespace GFGGame
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- OnLoginFail(errorCode, account);
|
|
|
+ OnLoginFail(errorCode, account, deleteTime, password, isMD5);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -101,6 +101,38 @@ namespace GFGGame
|
|
|
|
|
|
ViewManager.Hide<ModalStatusView>();
|
|
|
}
|
|
|
+ private static void OnLoginFail(int errorCode, string account, long deleteTime, string password, bool isMD5)
|
|
|
+ {
|
|
|
+ ViewManager.Hide<ModalStatusView>();
|
|
|
+ if(errorCode == ErrorCode.ERR_LoginIsLimit && deleteTime > 0)
|
|
|
+ {
|
|
|
+ //删除账号提示
|
|
|
+ AlertSystem.Show("账号注销处理中,若确定登录将取消账号注销,是否确定登录游戏?")
|
|
|
+ .SetLeftButton(true, "取消", (o)=>
|
|
|
+ {
|
|
|
+ GameController.QuitToLoginView(true);
|
|
|
+ EventAgent.DispatchEvent(ConstMessage.LOGIN_FAIL, account);
|
|
|
+ })
|
|
|
+ .SetRightButton(true, "确定", (o)=>
|
|
|
+ {
|
|
|
+ if(string.IsNullOrEmpty(password))
|
|
|
+ {
|
|
|
+ LoginTest(account, true).Coroutine();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Login(account, password, isMD5, true).Coroutine();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (ErrorCodeController.Handler(errorCode))
|
|
|
+ {
|
|
|
+ GameController.QuitToLoginView(true);
|
|
|
+ }
|
|
|
+ EventAgent.DispatchEvent(ConstMessage.LOGIN_FAIL, account);
|
|
|
+ }
|
|
|
+
|
|
|
private static async ETTask ReqNoticeInfo()
|
|
|
{
|
|
|
int result = await LoginHelper.ReqGetLatestNotice();
|
|
@@ -124,16 +156,6 @@ namespace GFGGame
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- private static void OnLoginFail(int errorCode, string account)
|
|
|
- {
|
|
|
- ViewManager.Hide<ModalStatusView>();
|
|
|
- if (ErrorCodeController.Handler(errorCode))
|
|
|
- {
|
|
|
- GameController.QuitToLoginView(true);
|
|
|
- }
|
|
|
- EventAgent.DispatchEvent(ConstMessage.LOGIN_FAIL, account);
|
|
|
- }
|
|
|
-
|
|
|
public static async ETTask Register(string account, string password, string name, string identityNum, string code)
|
|
|
{
|
|
|
ViewManager.Show<ModalStatusView>("注册中...");
|