protected override void AfterSetup() { base.AfterSetup(); Cheat.SetServices(Container.GetInstance <ICheatImpl>()); CalculatedGameSettings.RaiseEvent = Cheat.PublishEvent; CalculatedGameSettings.NotifyEnMass = async(message) => { await Cheat.PublishDomainEvent((dynamic)message).ConfigureAwait(false); Cheat.PublishEvent(message); }; SetupSettings(); DomainEvilGlobal.SelectedGame = Container.GetInstance <EvilGlobalSelectedGame>(); var authProviderStorage = Container.GetInstance <IAuthProviderStorage>(); var authProvider = Container.GetInstance <IAuthProvider>(); PwsUriHandler.GetAuthInfoFromUri = authProvider.GetAuthInfoFromUri; PwsUriHandler.SetAuthInfo = authProviderStorage.SetAuthInfo; var gameContext = Container.GetInstance <IGameContext>(); var recentGameSet = DomainEvilGlobal.Settings.GameOptions.RecentGameSet; DomainEvilGlobal.SelectedGame.ActiveGame = recentGameSet == null ? FindFirstInstalledGameOrDefault(gameContext) : gameContext.Games.Find(recentGameSet.Id) ?? FindFirstInstalledGameOrDefault(gameContext); }
bool _initial = false; // pff state public async Task HandleLogin(AccessInfo info) { var localUserInfo = DomainEvilGlobal.SecretData.UserInfo; if (_initial && info.AccessToken == localUserInfo.AccessToken) { return; } localUserInfo.AccessToken = info.AccessToken; // TODO: cleanup vs ContactList //await ProcessLogin().ConfigureAwait(false); await DomainEvilGlobal.SecretData.Save().ConfigureAwait(false); Cheat.PublishEvent(new ApiKeyUpdated(localUserInfo.AccessToken)); _initial = true; //await new LoginChanged(localUserInfo).Raise().ConfigureAwait(false); }
async Task <RecoveryOptionResult> NotLoggedInDialog(NotLoggedInUserError notLoggedInUserError) { string action = null; // toDO; await _specialDialogManager.ShowPopup(new RequirementsPopupViewModel(UiTaskHandlerExtensions.ToCommand( () => Cheat.PublishEvent(new DoLogin()))) { DisplayName = "Action '" + action + "' requires login", Message = "Please login first to perform this action", CommandTitle = "Login" }); // TODO: Login and retry options return(RecoveryOptionResult.CancelOperation); }
static void ProcessPwsUri(Uri pwsUri) { Cheat.PublishEvent(new ProcessAppEvent(pwsUri.ToString())); }
void Logout() => Cheat.PublishEvent(new DoLogout());
public void Handle(RequestOpenLogin message) => Cheat.PublishEvent(new DoLogin());
Task InvokeCommand(IOwinContext context) { context.Response.ContentType = "text/plain"; Cheat.PublishEvent(new ProcessAppEvent("pws://" + context.Request.QueryString)); return(context.Response.WriteAsync("Command executed")); }