예제 #1
0
        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);
            }
        }
예제 #2
0
        public RegisterAccountData CreateRegisterAccountData(string username, string password, string playerName)
        {
            RegisterAccountData data = new RegisterAccountData(username, password, playerName);

            return(data);
        }
예제 #3
0
 public async Task <RegisterAccountResponse> RequestRegister(RegisterAccountData data)
 {
     return(await hubProxy.Invoke <RegisterAccountResponse>(NetworkConstants.Request_RegisterAccount, data));
 }