public IAsyncResult BeginRestore(CharacterBaseRequest request, string acctname, string name, AsyncCallback callback, object asyncState) { CharacterResponse response = null; Account account = Account.Login(acctname, request.Login.Password); if (account != null) { response = Character.Restore(account, name); } else { response = new CharacterResponse("Error: Bad username or password.", null); } return(new CompletedAsyncResult <CharacterResponse>(response)); }
public IAsyncResult BeginDelete(CharacterBaseRequest request, string acctname, string name, AsyncCallback callback, object asyncState) { CharacterResponse response = null; Account account = Account.Login(acctname, request.Login.Password); if (account != null) { response = Character.Load(acctname, name); if (response.Success) { string message = response.Character.Delete(); response = new CharacterResponse(message, response.Character); } } else { response = new CharacterResponse("Error: Bad username or password.", null); } return(new CompletedAsyncResult <CharacterResponse>(response)); }