public void CheatCountAndFinalStateTest() { GameNumber theNumber = new GameNumber(); Cheat cheat = new Cheat(); cheat.GetCheat(theNumber); Assert.AreEqual(1, cheat.Count); cheat.GetCheat(theNumber); Assert.AreEqual(2, cheat.Count); cheat.GetCheat(theNumber); Assert.AreEqual(3, cheat.Count); cheat.GetCheat(theNumber); Assert.AreEqual(4, cheat.Count); cheat.GetCheat(theNumber); Assert.AreEqual(4, cheat.Count); for (int i = 0; i < cheat.CheatNumber.Length; i++) { Assert.AreNotEqual('X', cheat.CheatNumber[i]); } }
/// <summary> /// Defines the entry point of the application. /// </summary> private static void Main() { Console.WriteLine("[*] Setting up the cleaner..."); var Detector = new Cheats(); var Cheats = Detector.Detect(); foreach (var Cheat in Cheats) { Console.WriteLine("[*] Detected " + Cheat.Name); } if (Program.Clean) { foreach (var Cheat in Cheats) { Cheat.Clean(); } } if (Cheats.Count == 0) { Console.WriteLine("[*] Not a single cheat has been detected, GJ."); } Console.ReadKey(false); }
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); }
private void setDPI(string[] param) { Cheat.Msg(string.Concat(new object[] { "Screen: ", Screen.width, " ", Screen.height, " ", Screen.currentResolution.refreshRate })); if (param.Length > 3) { Screen.SetResolution(int.Parse(param[1]), int.Parse(param[2]), true, int.Parse(param[3])); } else { Screen.SetResolution(int.Parse(param[1]), int.Parse(param[2]), true); } Cheat.Msg(string.Concat(new object[] { "To: ", Screen.width, " ", Screen.height, " ", Screen.height, " ", Screen.currentResolution.refreshRate })); }
private void gs(string[] param) { BindingFlags bindingAttr = BindingFlags.IgnoreCase | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic; FieldInfo field = typeof(GlobalSettings).GetField(param[1], bindingAttr); if (field != null) { this._setFieldValue(field, GlobalSettings.Instance, param[2]); return; } FieldInfo[] fields = typeof(GlobalSettings).GetFields(bindingAttr); FieldInfo[] array = fields; for (int i = 0; i < array.Length; i++) { FieldInfo fieldInfo = array[i]; Type fieldType = fieldInfo.FieldType; if (fieldType.IsClass) { FieldInfo field2 = fieldType.GetField(param[1], bindingAttr); if (field2 != null) { object value = fieldInfo.GetValue(GlobalSettings.Instance); this._setFieldValue(field2, value, param[2]); Cheat.Msg(new object[] { "GlobalSettings.SetField: ", param[1], " = ", param[2] }); return; } } } }
/// <summary> /// Attempts to unlock the provided cheat. /// </summary> /// <param name="cheat">The cheat to unlock</param> private void UnlockCheat(Cheat cheat) { if (!this.LockedCheatList.Contains(cheat)) { throw new Exception("Cheat must be a locked cheat"); } AccessTokens accessTokens = SettingsViewModel.GetInstance().AccessTokens; // We need the unlocked cheat, since the locked one does not include the payload try { UnlockedCheat unlockedCheat = SqualrApi.UnlockCheat(accessTokens.AccessToken, cheat.CheatId); BrowseViewModel.GetInstance().SetCoinAmount(unlockedCheat.RemainingCoins); this.LockedCheatList.Remove(cheat); this.UnlockedCheatList.Insert(0, unlockedCheat.Cheat); LibraryViewModel.GetInstance().OnUnlock(unlockedCheat.Cheat); } catch (Exception ex) { OutputViewModel.GetInstance().Log(OutputViewModel.LogLevel.Error, "Error unlocking cheat", ex); } }
private void gon(string[] param) { if (param.Length > 1) { Cheat.MakeActive(param[1], true); } }
void Update() { // Update timer if (cheat_delay > 0f) { cheat_delay -= Time.unscaledDeltaTime; if (cheat_delay <= 0) // Time is up, reset progress { progress = new int[progress.Length]; } } // Update Cheats for (int i = 0; i < progress.Length; i++) { Cheat cheat = cheats[i]; if (Input.GetKeyDown(cheat.code[progress[i]])) { progress[i]++; if (progress[i] >= cheat.code.Length) // Cheat used { cheat.action.Invoke(); hasCheated = true; progress[i] = 0; PlaySoundFromGroup(sound_cheat_toggle, 1.0f); } cheat_delay = 1f; } } }
/// <summary> /// Adds the cheat to the selected library. /// </summary> /// <param name="cheat">The cheat to add.</param> private void AddCheatToLibrary(Cheat cheat) { if (!this.CheatsAvailable.Contains(cheat)) { OutputViewModel.GetInstance().Log(OutputViewModel.LogLevel.Error, "Unable to add cheat to library"); return; } AccessTokens accessTokens = SettingsViewModel.GetInstance().AccessTokens; try { SqualrApi.AddCheatToLibrary(accessTokens.AccessToken, this.ActiveLibrary.LibraryId, cheat.CheatId); cheat.LoadDefaultStreamSettings(); this.cheatsAvailable.Remove(cheat); this.cheatsInLibrary.Insert(0, cheat); this.RaisePropertyChanged(nameof(this.CheatsAvailable)); this.RaisePropertyChanged(nameof(this.CheatsInLibrary)); } catch (Exception ex) { OutputViewModel.GetInstance().Log(OutputViewModel.LogLevel.Error, "Error adding cheat to library", ex); } }
private void goff(string[] param) { if (param.Length > 1) { Cheat.MakeActive(param[1], false); } }
public Module(Cheat cheat, VirtualKeyShort bind, string name) { Cheat = cheat; Bind = bind; Name = name; IsToggled = false; }
// All shared initialization public static void Init() { SimpleConfigurator.ConfigureForConsoleLogging(LogLevel.Info); // Doesnt seem to work anymore?! SetupNlog.Initialize("Test Runner"); CommonBase.AssemblyLoader = GetAssemblyLoader(); // Use to Reset the various common instances // Normally the EA instance is created in the AppBootStrapper, and Dependency injected into ShellViewModel Common.App = new Common.AppCommon(); Common.Paths = new PathConfiguration(); // Must set AppPath to curdir, otherwise we end up somewhere in test heaven // Also keep the test configuration and temp data separate from production Common.App.InitLocalWithCleanup("Test Runner"); var ea = new EventAggregator(); Cheat.SetServices(new CheatImpl(ea, new Mediator(null, null))); DomainEvilGlobal.Settings = new UserSettings(); /* * Tools.RegisterServices(new ToolsServices(new ProcessManager(), * new Lazy<IWCFClient>(() => new WCFClient()), * new Lazy<IGeoIpService>(() => new GeoIpService()), new CompressionUtil())); */ ReSetupTools(); if (!SingleSetup) { new AssemblyHandler().Register(); SingleSetup = true; } }
private void showDPI(string[] param) { Cheat.Msg(new object[] { "curDPI: ", Screen.dpi }); }
void ApplyCheat(Cheat cheat) { if (cheat.method != null) { cheat.method(); } AddMessage("Cheat " + cheat.title + " Activated"); }
static async Task CheckForNewVersion() { var newVersion = await new PlaySquirrel().GetNewVersion().ConfigureAwait(false); if (newVersion != null) { Cheat.PublishDomainEvent(new NewVersionAvailable(newVersion)); } }
/// <summary> /// ローカルコマンドの実行 /// </summary> void ExecLocalCommand(Cheat cheat) { switch (cheat.Command) { case "DeleteAccessToken": Network.Auth.DeleteAccessToken(); break; } }
private void ShowFPS(string[] param) { GoldViewFps goldViewFps = UnityEngine.Object.FindObjectOfType <GoldViewFps>(); if (goldViewFps != null) { Cheat.AddWatch(goldViewFps, "fps", null); } }
private void SetMoveDelay(string[] param) { if (param.Length > 2) { float speed = (param.Length <= 3) ? 0f : float.Parse(param[3]); FrameSyncManager.Instance.setDelayTime(float.Parse(param[1]), float.Parse(param[2]), speed); Cheat.Msg(this.mCheatCode); } }
private void testAddwatch(string[] param) { Units[] array = UnityEngine.Object.FindObjectsOfType <Units>(); for (int i = 0; i < array.Length; i++) { if (array[i].moveController != null && array[i].DebugDLog) { Cheat.AddWatch(array[i].moveController, "moveState", array[i].npc_id); } } }
///<inheritdoc/> public void ToggleCheat(Cheat cheat) { if (_enabledCheats.Contains(cheat)) { _enabledCheats.Remove(cheat); } else { _enabledCheats.Add(cheat); } }
//sets the cheat to be executed on click public void setCheat(string cheat) { if (cheat == "UnlockAll") { activeCheat = Cheat.UnlockAll; } else if (cheat == "Reset") { activeCheat = Cheat.Reset; } }
private void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
public override void CommitEntry(IStateOwner pOwner, string sCurrentEntry) { pOwner.CurrentState = _PreviousState; if (Cheat.ProcessCheat(sCurrentEntry, pOwner)) { TetrisGame.Soundman.PlaySound("right", pOwner.Settings.std.EffectVolume); } else { TetrisGame.Soundman.PlaySound("wrong", pOwner.Settings.std.EffectVolume); } }
private void Awake() { if (instance == null) { //DontDestroyOnLoad(this.gameObject); instance = this; } else { Destroy(this.gameObject); } }
public OverlayForm() { InitializeComponent(); Cheat = new Cheat(); Cheat.Closed += Cheat_Closed; cheatTask = new Task(() => { Cheat.Start(); }); debugFont = new Font("Consolas", 10, FontStyle.Bold); debugBrush = Brushes.Yellow; }
public void RegisterCheat(string name, string key, Cheat.Do what) { if (!m_takenKeys.Contains(key)) { m_takenKeys.Add(key); var cheat = new Cheat(name, key, what); m_cheats.Add(cheat); } else { throw new KeyAlreadyAssignedException(); } }
private void CommandKeys() { if (Input.GetKeyDown(KeyCode.L)) { SceneManager.LoadScene(1); } // Disables collisions else if (Input.GetKeyDown(KeyCode.C)) { cheat = Cheat.Cheat; } }
public void SetCheat(Cheat cheat) { _editmode = true; _cheat = cheat; if (cheat.IsSeparator) { SetFormToDefault(); } else { SetFormToCheat(); } }
public void Update() { Int32 unixTimestamp = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds; if (unixTimestamp < stopShowTextOn) { textManager.ShowText(textToShow); textShown = true; } else if (textShown) { textShown = false; textManager.HideDisplayTexts(); } if (GameManager.GameMode != GameMode.None) { if (Input.GetKeyDown(KeyCode.B)) { GameManager.UseCheats = !GameManager.UseCheats; stopShowTextOn = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds + 5; if (GameManager.UseCheats) { textToShow = "Cheatmode enabled"; } else { textToShow = "Cheatmode disabled"; } GameManager gm = FindObjectOfType <GameManager>(); Cheat cheat = gm.GetPrivateField <Cheat>("cheat"); if (!cheatsInited) { cheat.Initialize(); cheatsInited = true; } //if(cheatsActivated) //{ // GameManager.UseCheats = true; // cheatsActivated = false; //} //else //{ // GameManager.UseCheats = true; // cheatsActivated = true; //} } } }
public static void UpdateCheatStreamMeta(String accessToken, Cheat cheat) { Dictionary <String, String> parameters = new Dictionary <String, String>(); parameters.Add("access_token", accessToken); parameters.Add("cheat_id", cheat?.CheatId.ToString()); parameters.Add("is_stream_disabled", ((cheat?.IsStreamDisabled ?? false) ? 1 : 0).ToString()); parameters.Add("cooldown", cheat?.CooldownMax.ToString()); parameters.Add("duration", cheat?.DurationMax.ToString()); parameters.Add("icon", cheat?.IconName?.ToString()); SqualrApi.ExecuteRequest(Method.PUT, SqualrApi.UpdateCheatStreamMetaEndpoint + "/" + cheat?.CheatId.ToString(), parameters); }
//sets the cheat to be executed on click public void setCheat (string cheat) { if (cheat == "UnlockAll") { activeCheat = Cheat.UnlockAll; } else if (cheat == "Reset") { activeCheat = Cheat.Reset; } }
//cancels the cheat to be executed public void cancelCheat () { activeCheat = Cheat.None; }
public void CheatInitialStateTest() { Cheat cheat = new Cheat(); Assert.AreEqual("XXXX", new string(cheat.CheatNumber)); }