public async Task <RegisterAccountResponse> RequestRegisterAccount(RegisterAccountData data) { try { if (await accountService.UsernameExists(data.Username)) { return(new RegisterAccountResponse() { response = RegisterAccountResponseType.UserNameAlreadyExists }); } if (await accountService.PlayerNameExists(data.Username)) { return(new RegisterAccountResponse() { response = RegisterAccountResponseType.PlayerNameAlreadyExists }); } await accountService.RegisterAccount(data.Username, data.Password, data.PlayerName); return(new RegisterAccountResponse() { response = RegisterAccountResponseType.Success }); } catch (Exception e) { logService.Log(e); return(null); } }
public RegisterAccountData CreateRegisterAccountData(string username, string password, string playerName) { RegisterAccountData data = new RegisterAccountData(username, password, playerName); return(data); }
public async Task <RegisterAccountResponse> RequestRegister(RegisterAccountData data) { return(await hubProxy.Invoke <RegisterAccountResponse>(NetworkConstants.Request_RegisterAccount, data)); }