public void RegAccount() { if (regAccountInput.text.Length == 0 || regAccountInput.text.Length > 6) { Debug.Log("账号错误"); return; } if (regPWInput.text.Length == 0 || regPWInput.text.Length > 6) { Debug.Log("密码错误"); return; } if (!regPWInput.text.Equals(regRepeatPW.text)) { Debug.Log("输入不一致"); return; } //验证通过,申请注册,并关闭注册面板 AccountInfoDTO dto = new AccountInfoDTO(); dto.account = regAccountInput.text.Trim(); dto.password = regPWInput.text.Trim(); NetIO.Instance.Write(Protocol.TYPE_LOGIN, 0, LoginProtocol.REG_CREQ, dto); RegCloseClick(); }
/// <summary> /// 处理注册 /// </summary> public void Reg(UserToken token, AccountInfoDTO value) { ExecutorPool.Instance.Execute( delegate() { int result = accountBIZ.Create(token, value.account, value.password); Write(token, LoginProtocol.REG_SRES, result); }); }
/// <summary> /// 登录按钮 /// </summary> public void LoginOnClick() { if (accountInput.text.Length == 0 || accountInput.text.Length > 6) { Debug.Log("账号错误"); WarningManager.errors.Add(new WarningModel("账号不合法")); return; } if (passwordInput.text.Length == 0 || passwordInput.text.Length > 6) { return; } //验证通过,申请登录 AccountInfoDTO dto = new AccountInfoDTO(); dto.account = accountInput.text.Trim(); dto.password = passwordInput.text.Trim(); NetIO.Instance.Write(GameProtocol.Protocol.TYPE_LOGIN, 0, LoginProtocol.LOGIN_CREQ, dto); loginBtn.interactable = false; //按钮是否可选 }