Exemplo n.º 1
0
        private static void CheckDtt()
        {
            Calc = new Calculator(NunitSettings.CalcLocation);
            Thread.Sleep(DelayRunCalc);
            Calc.ClickOnButton("1");
            Thread.Sleep(DelayHotKey);
            Calc.ClickOnButton("-");
            //Call help window
            UserInputs.PressF1();
            Thread.Sleep(DelayHotKey);
            //Call search in help window
            UserInputs.PressAltS();
            Thread.Sleep(DelayHotKey);
            //Close Help window
            UserInputs.PressAltF4();
            Thread.Sleep(DelayRecording);
            Calc.ClickOnButton("2");
            Calc.ClickOnButton("3");
            Calc.ClickOnButton("+");

            Thread.Sleep(DelayRecording);
            try
            {
                Calc.Close();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            Thread.Sleep(DelayRunCalc);
        }
Exemplo n.º 2
0
        public void IdleTimeinterruptByFocusIn()
        {
            Console.WriteLine("Clean machine.");
            BehaviorsRegression.CleanMachine();

            Console.WriteLine("Install AT.");
            InstallATCheckService();

            Console.WriteLine("Emulate idle time.");
            Thread.Sleep(delay * 25);
            Program.ExecuteCommandCmd("calc.exe");
            Thread.Sleep(60000);
            UserInputs.PressF1();
            Thread.Sleep(60000);
            UserInputs.PressAltF4();
            Thread.Sleep(60000);
            UserInputs.PressAltF4();
            StopAllServices();

            Console.WriteLine("Decrypt packet and check Idle time.");
            var focusInStore = PacketParser.GetAllIdleTime(DecryptPacket());

            Assert.IsTrue(focusInStore.Count >= 6, "Check idele time in decrypted packet.:" + focusInStore.Count);

            Console.WriteLine("Clean machine.");
            BehaviorsRegression.CleanMachine();
        }
Exemplo n.º 3
0
        public void FocusInQuickSwitching()
        {
            Console.WriteLine("Clean machine.");
            BehaviorsRegression.CleanMachine();

            Console.WriteLine("Install AT.");
            InstallATCheckService();

            Console.WriteLine("Run calc and switch between them.");
            Program.ExecuteCommandCmd("calc.exe");
            UserInputs.PressHotKey((int)VirtualKeys.Menu, (int)VirtualKeys.Tab);
            Program.ExecuteCommandCmd("msiexec");
            UserInputs.PressHotKey((int)VirtualKeys.Menu, (int)VirtualKeys.Tab);
            UserInputs.PressHotKey((int)VirtualKeys.Menu, (int)VirtualKeys.Tab);
            UserInputs.PressHotKey((int)VirtualKeys.Menu, (int)VirtualKeys.Tab);
            StopAllServices();
            CloseApplication("msiexec");
            CloseApplication("calc");

            Console.WriteLine("Decrypt packet.");
            var focusInStore = PacketParser.GetAllFocusInBehaviour(DecryptPacket());

            Assert.IsTrue(focusInStore.Count >= 5, "Check focus in Behavior in packet.:" + focusInStore.Count);

            Console.WriteLine("Clean machine.");
            BehaviorsRegression.CleanMachine();
        }
Exemplo n.º 4
0
        public static void MainMenuExit()
        {
exit:
            Console.Clear();
            Console.WriteLine("Are you sure you want to exit.\r\nType YES to exit, type NO to stay in the not game.");
            string exit = Console.ReadLine().ToLower();

            switch (exit)
            {
            case "yes":
            {
                Environment.Exit(0);
                break;
            }

            case "no":
            {
                UserInputs.BackToCurrentRoom();
                break;
            }

            default:
            {
                goto exit;
            }
            }
        }
Exemplo n.º 5
0
        public static void Room4()
        {
            if (!BlnRoom4Story)
            {
                //story
                //story
                Console.Clear();
                SpeakFile("Rooms/Room4/Room4.txt");
                Thread.Sleep(1000);
                Console.Clear();
                BlnRoom4Story = true;
            }

            CurrentRoom = StrRoom4;
            Console.Clear();
            if (!BlnRoom4Story)
            {
                //story
                BlnRoom4Story = true;
            }
            BackGroundPosition();
            Console.WriteLine(File.ReadAllText("files/Rooms/Room4/Room4.txt"));
            UserInputs.UserInput();
            Errors.ErrorOutOfBounds();
        }
Exemplo n.º 6
0
        public void FocusInXmlStructureInBrowser()
        {
            Console.WriteLine("Clean machine.");
            BehaviorsRegression.CleanMachine();

            Console.WriteLine("Install AT.");
            InstallATCheckService();
            Thread.Sleep(delay * 3);

            Console.WriteLine("Open link in browser.");
            OpenAndKillDefaultBrowser();
            UserInputs.PressHotKey((int)VirtualKeys.Menu, (int)VirtualKeys.Tab);
            OpenAndKillDefaultBrowser();
            UserInputs.PressHotKey((int)VirtualKeys.Menu, (int)VirtualKeys.Tab);
            CloseApplication("iexplore");
            StopAllServices();

            Console.WriteLine("Decrypt packet.");
            var focusInStore = PacketParser.GetAllFocusInBehaviour(DecryptPacket());
            var countAppId   = 0;

            foreach (var focusIn in focusInStore)
            {
                if (focusIn.ApplicationId.Contains(url1) || focusIn.ApplicationId.Contains(url2))
                {
                    countAppId = countAppId + 1;
                }
            }
            Assert.IsTrue(countAppId >= 2, "Check applicationId in foucIn Behavior." + countAppId);

            Console.WriteLine("Clean machine.");
            BehaviorsRegression.CleanMachine();
        }
Exemplo n.º 7
0
        public void FocusInDifferentNameOfApp()
        {
            Console.WriteLine("Clean machine.");
            BehaviorsRegression.CleanMachine();

            Console.WriteLine("Install AT.");
            InstallATCheckService();
            OpenCalculator();
            UserInputs.PressHotKey((int)VirtualKeys.LeftWindows, (int)VirtualKeys.M);
            OpenCalculator();
            UserInputs.PressHotKey((int)VirtualKeys.LeftWindows, (int)VirtualKeys.D);
            OpenAndKillDefaultBrowser();
            CloseApplication("calc");
            CloseApplication("iexplorer");
            ExtensionRegression.StopAllServices();

            var focusInStore = PacketParser.GetAllFocusInBehaviour(DecryptPacket());

            Assert.IsTrue(focusInStore.Count >= 6, "Check focus in Behavior in packet.:" + focusInStore.Count);
            var countAppId = 0;

            foreach (var focusIn in focusInStore)
            {
                if (focusIn.ApplicationId.Contains("calc.exe") || focusIn.ApplicationId.Contains("Explorer.EXE") || focusIn.ApplicationId.Contains(url1) || focusIn.ApplicationId.Contains(ie) || focusIn.ApplicationId.Contains(url2))
                {
                    countAppId = countAppId + 1;
                }
            }
            Assert.IsTrue(countAppId >= 6, "Check applicationId in foucIn Behavior.");

            Console.WriteLine("Clean machine.");
            BehaviorsRegression.CleanMachine();
        }
Exemplo n.º 8
0
        public void HotkeyOffMode()
        {
            Console.WriteLine("Clean machine.");
            BehaviorsRegression.CleanMachine();
            using (var systemSettings = new SystemSettings())
            {
                systemSettings.enableHotkeysBehavior = false;
            }

            Console.WriteLine("Install AT.");
            InstallATCheckService();

            Console.WriteLine("Run calc and switch between them.");
            Program.ExecuteCommandCmd("calc.exe");
            Thread.Sleep(delay);
            UserInputs.PressF1();
            UserInputs.PressAltF4();
            Thread.Sleep(delay);
            StopAllServices();
            CloseApplication("calc");

            Console.WriteLine("Decrypt packet and check FocusIn.");
            var focusInStore = PacketParser.GetAllHotKey(DecryptPacket());

            Assert.IsTrue(focusInStore.Count == 0);

            Console.WriteLine("Clean machine.");
            BehaviorsRegression.CleanMachine();
        }
Exemplo n.º 9
0
        public void EnableButtonBehaviors()
        {
            retry.onClick.RemoveAllListeners();
            replay.onClick.RemoveAllListeners();

            levels.onClick.RemoveAllListeners();
            levelsConfirm.onClick.RemoveAllListeners();
            levelsDeny.onClick.RemoveAllListeners();
            levelsNext.onClick.RemoveAllListeners();

            bool showNextLevelButton = (GameManager.Instance.currentLevelReferenceObject.completionRank > 0);

            levelsNext.gameObject.SetActive(showNextLevelButton);

            exit.onClick.RemoveAllListeners();
            exitConfirm.onClick.RemoveAllListeners();
            exitDeny.onClick.RemoveAllListeners();

            retry.onClick.AddListener(() => { userInput = UserInputs.retry; ClosePanel(); });
            replay.onClick.AddListener(() => { userInput = UserInputs.replay; ClosePanel(); });
            levels.onClick.AddListener(() => { userInput = UserInputs.levels; OpenLevelsConfirmationScreen(); });
            levelsConfirm.onClick.AddListener(() => { ClosePanel(); });
            levelsDeny.onClick.AddListener(() => OpenRootScreen());

            levelsNext.onClick.AddListener(() => { userInput = UserInputs.levelsNext; /*GameManager.Instance.TriggerAdvanceToNextLevel();*/ ClosePanel(); });

            exit.onClick.AddListener(() => { userInput = UserInputs.exit; OpenExitConfirmationScreen(); });
            exitConfirm.onClick.AddListener(() => { GameManager.Instance.SetGamePhase(GameManager.GamePhases.CloseGame); /* /*ClosePanel();*/ });
            exitDeny.onClick.AddListener(() => OpenRootScreen());
        }
Exemplo n.º 10
0
        public void IdleTimeTurnOffAction()
        {
            Console.WriteLine("Clean machine.");
            BehaviorsRegression.CleanMachine();
            using (var systemSettings = new SystemSettings())
            {
                systemSettings.enableIdleTimeBehavior = false;
            }

            Console.WriteLine("Install AT.");
            InstallATCheckService();

            Console.WriteLine("Emulate idle time.");
            Thread.Sleep(delay * 5);
            UserInputs.MoveMouse(2000, 300);
            Thread.Sleep(delay * 5);
            UserInputs.MoveMouse(2000, 300);
            Thread.Sleep(delay * 5);
            StopAllServices();

            Console.WriteLine("Decrypt packet and check Idle time.");
            var focusInStore = PacketParser.GetAllIdleTime(DecryptPacket());

            Assert.IsTrue(focusInStore.Count == 0);

            Console.WriteLine("Clean machine.");
            BehaviorsRegression.CleanMachine();
        }
Exemplo n.º 11
0
        public void FocusInXmlStructureInWindowsApp()
        {
            Console.WriteLine("Clean machine.");
            BehaviorsRegression.CleanMachine();

            Console.WriteLine("Install AT.");
            InstallATCheckService();

            Console.WriteLine("Run calc and switch between them.");
            Program.ExecuteCommandCmd("calc.exe");
            UserInputs.PressHotKey((int)VirtualKeys.Menu, (int)VirtualKeys.Tab);
            Program.ExecuteCommandCmd("msiexec");
            UserInputs.PressHotKey((int)VirtualKeys.Menu, (int)VirtualKeys.Tab);
            StopAllServices();
            CloseApplication("msiexec");
            CloseApplication("calc");

            Console.WriteLine("Decrypt packet.");
            var focusInStore = PacketParser.GetAllFocusInBehaviour(DecryptPacket());
            var countAppId   = 0;

            foreach (var focusIn in focusInStore)
            {
                if (focusIn.ApplicationId.Contains("calc.exe") || focusIn.ApplicationId.Contains("msiexec") || focusIn.ApplicationId.Contains(@"C:\Windows\Explorer.EXE"))
                {
                    countAppId = countAppId + 1;
                }
            }
            Assert.IsTrue(countAppId >= 3, "Check applicationId in foucIn Behavior." + countAppId);

            Console.WriteLine("Clean machine.");
            BehaviorsRegression.CleanMachine();
        }
Exemplo n.º 12
0
        public static void MainMenuOptions()
        {
            do
            {
                Console.Clear();
                Console.WriteLine("Press Esc to go back to Main Menu\r\n");
                Console.WriteLine("1.)\tToggle BGM(BackGroundMusic)");
                Cki = Console.ReadKey();
                string strCki = Cki.Key.ToString();
                switch (strCki)
                {
                case "NumPad1":
                case "D1":
                {
                    BlnPlayMusic = !BlnPlayMusic;
                    break;
                }

                case "Escape":
                {
                    UserInputs.BackToCurrentRoom();
                    break;
                }
                }
            } while (Cki.Key.ToString() != "Escape");
        }
Exemplo n.º 13
0
        public static void Run()
        {
            Console.WriteLine("Launch Corkboard");
            Program.ExecuteCommandCmd("\"C:\\Program Files\\SastMacros\\CORKBOARD_PRD\\CorkBoard.exe\"");
            Thread.Sleep(25000);

            var items = Desktop.Instance.GetMultiple(SearchCriteria.All);

            foreach (var item in items)
            {
                if (item.Name.Contains("Corkboard is unable"))
                {
                    Console.WriteLine("Close Corkboard modal Window");
                    item.Click();
                    Thread.Sleep(2000);
                    UserInputs.PressKey((int)KeyboardInput.SpecialKeys.RETURN);
                    Thread.Sleep(1000);
                    return;
                }
            }

            //Desktop.Instance.Get<Button>(SearchCriteria.ByText("OK")).Click();
            //Window dialog = getWindow("CorkBoard");
            //dialog.Get<Button>(SearchCriteria.ByText("OK")).Click();
            Thread.Sleep(10000);
        }
Exemplo n.º 14
0
        public void FocusInDesktopApp()
        {
            Console.WriteLine("Clean machine.");
            BehaviorsRegression.CleanMachine();

            Console.WriteLine("Install AT.");
            InstallATCheckService();

            Console.WriteLine("Open calculator and emulate hot key.");
            OpenCalculator();
            UserInputs.PressHotKey((int)VirtualKeys.LeftWindows, (int)VirtualKeys.M);
            OpenCalculator();
            UserInputs.PressHotKey((int)VirtualKeys.LeftWindows, (int)VirtualKeys.D);
            CloseApplication("calc");
            ExtensionRegression.StopAllServices();

            Console.WriteLine("Decrypt packets and Check Focus In.");
            var focusInStore = PacketParser.GetAllFocusInBehaviour(DecryptPacket());

            Assert.IsTrue(focusInStore.Count >= 4, "Check focus in Behavior in packet.");
            var countAppId = 0;

            foreach (var focusIn in focusInStore)
            {
                if (focusIn.ApplicationId.Contains("calc.exe") || focusIn.ApplicationId.Contains("Explorer.EXE"))
                {
                    countAppId = countAppId + 1;
                }
            }
            Assert.IsTrue(countAppId >= 4, "Check applicationId in foucIn Behavior.");

            Console.WriteLine("Clean machine.");
            BehaviorsRegression.CleanMachine();
        }
Exemplo n.º 15
0
        static void Main(string[] args)
        {
            //to limit any possibility to run injection in EXE
            if (args.Length != 0)
            {
                throw new ArgumentException("Invalid Arguments set, there is to many arguments... \n\nThis program does not require Arguments to run!");
            }

            Rover carRover = UserInputs.StartUp();
            do
            {
                Console.Write("Command Input: ");
                var command = Console.ReadLine()?.ToUpper();

                if (command.ValidateCommandInput())
                {
                    var finalStatus = carRover.ExecuteCommand(command);
                    Console.WriteLine($"{finalStatus.IsCommandValid}, {(char)finalStatus.FinalOrientation}, ({finalStatus.FinalPosition.XPosition},{finalStatus.FinalPosition.YPosition})");
                    Environment.Exit(0);
                }
                else
                {
                    Console.WriteLine("Command not valid, try again....\n");
                }


            } while (true);

            


        }
Exemplo n.º 16
0
 public void AddUserInput(string userInputText)
 {
     if (UserInputs == null)
     {
         UserInputs = new List <string>();
     }
     UserInputs.Add(userInputText);
 }
Exemplo n.º 17
0
    private void Update()
    {
        LockstepFactory.Update();
        UserInputs userInputs = LockstepUtility.GetUserInputs();

        byte[] dataBytes = MessagePackUtility.Serialize(userInputs);
        NetworkSystem.Publish(RequestCode.Input, dataBytes);
    }
Exemplo n.º 18
0
 public override void Initialize()
 {
     base.Initialize();
     NGUITools.SetActive(SetKeyWindow, false);
     _pendingInput           = UserInputs.None;
     SaveButton.isEnabled    = true;
     RestoreButton.isEnabled = true;
 }
Exemplo n.º 19
0
 public static void Hall12()
 {
     CurrentRoom = StrHall12;
     Console.Clear();
     BackGroundPosition();
     Console.WriteLine(File.ReadAllText("files/Halls/Hall12.txt"));
     UserInputs.UserInput();
     Errors.ErrorOutOfBounds();
 }
Exemplo n.º 20
0
 public static void Hall3()
 {
     CurrentRoom = StrHall3;
     Console.Clear();
     BackGroundPosition();
     Console.WriteLine(File.ReadAllText("files/Halls/Hall3.txt"));
     UserInputs.UserInput();
     Errors.ErrorNotYetCreated();
 }
Exemplo n.º 21
0
    public static LockstepInputs CreateLockstepInputs(UserInputs userInputs)
    {
        LockstepInputs lockstepInputs = new LockstepInputs();

        lockstepInputs.UserInputs = new UserInputs[1][] { new UserInputs[] { userInputs } };
        lockstepInputs.TickId     = userInputs.TickId;
        lockstepInputs.DeltaTime  = (Fix64)0.02f;
        return(lockstepInputs);
    }
Exemplo n.º 22
0
        /// <summary>
        /// Setups template
        /// </summary>
        public void Init()
        {
            foreach (var i in Inputs)
            {
                UserInputs.Add(i.Key, i.Value.Default);
            }

            FinalObject = Activator.CreateInstance(TypeResolver.Resolve(Type, null, this));
        }
Exemplo n.º 23
0
 /// <summary>
 /// Private methods
 /// </summary>
 private void RunCalcMsiExec()
 {
     Program.ExecuteCommandCmd("calc.exe");
     Thread.Sleep(delay);
     UserInputs.PressAltF4();
     Program.ExecuteCommandCmd("msiexec");
     Thread.Sleep(delay);
     UserInputs.PressEnter();
 }
Exemplo n.º 24
0
        //END OF HUD
        //BEGIN OF ROOMS
        public static void Room1()
        {
            CurrentRoom = StrRoom1;
            Console.Clear();
            if (!BlnRoom1Story)
            {
                //story
                string   strFilename = StrTxtLocation + "Rooms/Room1/Room1.txt";
                string[] introText   = File.ReadAllLines(strFilename);
                for (int i = 0; i < introText.Length; i++)
                {
                    switch (i)
                    {
                    case 1:
                    case 3:
                    case 5:
                    case 7:
                    case 9:
                    case 13:
                        Ss.SpeakAsync(introText[i]);
                        break;

                    case 17:
                        Player.SoundLocation = StrTtsLocation + "ROOM1/room1-7.wav";
                        Player.Play();
                        break;

                    case 12:
                    case 15:
                        Console.Beep();
                        Console.Beep();
                        Console.Beep();
                        break;
                    }
                    string strIntroText = introText[i];
                    foreach (char cha in strIntroText)
                    {
                        Console.Write(cha);
                        if (cha == ',' || cha == '.' || cha == '?')
                        {
                            Thread.Sleep(IntSleep400); //400
                        }
                        Thread.Sleep(40);              //40
                    }
                    Console.Write("\r\n");
                    Thread.Sleep(IntSleep400); //400
                }
                Thread.Sleep(1000);
                Console.Clear();
                BlnRoom1Story = true;
            }
            BackGroundPosition();
            Console.WriteLine(File.ReadAllText("files/Rooms/Room1/Room1.txt"));
            UserInputs.UserInput();
            Errors.ErrorOutOfBounds();
        }
Exemplo n.º 25
0
        public static void InGameMap()
        {
            Console.Clear();
            GetRandomConsoleColor();
            string strFilename = "files/menu/map/map2.txt";

            Console.WriteLine(File.ReadAllText(strFilename));
            Console.ForegroundColor = ConsoleColor.White;
            Console.ReadKey();
            UserInputs.BackToCurrentRoom();
        }
Exemplo n.º 26
0
 private void Awake()
 {
     if (ReferenceEquals(Instance, null))
     {
         Instance = this;
     }
     else
     {
         throw new UnityException("A single entity of UserInputs can exists at any time.");
     }
 }
Exemplo n.º 27
0
 // Rotate just the "Overworld" game object
 private void rotatePlayer()
 {
     if (this.player != null)
     {
         int angle = PlayerMovementServices.computeRotation(UserInputs.goUp(), UserInputs.goRight(), UserInputs.goDown(), UserInputs.goLeft(),
                                                            this.useSemiCardinalMovements);
         if (angle >= 0)
         {
             this.player.transform.eulerAngles = new Vector3(0, angle, 0);
         }
     }
 }
Exemplo n.º 28
0
    public Dictionary <UserInputs, KeyInput> GetKeyBindings(bool isDefault)
    {
        Dictionary <UserInputs, KeyInput> keyBindings = new Dictionary <UserInputs, KeyInput>();
        string filename = "";

        if (isDefault)
        {
            filename = "KeyBindingsDefault.txt";
        }
        else
        {
            filename = "KeyBindings.txt";
        }
        string [] rawFile = File.ReadAllLines(this.Path + filename);


        Dictionary <string, object> data = DataHandlerBase.ParseLines(rawFile);

        foreach (KeyValuePair <string, object> kv in data)
        {
            string    value  = kv.Value.ToString();
            string [] tokens = value.Split('+');
            KeyInput  input  = new KeyInput();
            if (tokens.Length > 1)
            {
                input.FnKey = (KeyCode)Enum.Parse(typeof(KeyCode), tokens[0]);
                input.Key   = (KeyCode)Enum.Parse(typeof(KeyCode), tokens[1]);
            }
            else
            {
                input.FnKey = KeyCode.None;
                input.Key   = (KeyCode)Enum.Parse(typeof(KeyCode), tokens[0]);
            }
            UserInputs key = (UserInputs)Enum.Parse(typeof(UserInputs), kv.Key);

            keyBindings.Add(key, input);
            //Debug.Log(key + " " + keyBindings[key].IsFnSet + ", " + keyBindings[key].Key);
        }

        //check for similar inputs
        foreach (KeyValuePair <UserInputs, KeyInput> keyBinding in keyBindings)
        {
            foreach (KeyValuePair <UserInputs, KeyInput> target in keyBindings)
            {
                if (keyBinding.Value.Key == target.Value.Key && keyBinding.Value.FnKey != target.Value.FnKey)
                {
                    keyBinding.Value.SimilarInput = target.Value;
                }
            }
        }

        return(keyBindings);
    }
Exemplo n.º 29
0
        private static void EntryPointNewSession()
        {
            IWoWRepository repository = UserInputs.SelectRepository();
            ManifestFile   manifest   = ManifestFile.FromRepository(repository);
            string         locale     = UserInputs.SelectLocale(manifest);
            string         os         = UserInputs.SelectOs();

            CurrentSession = new Session(repository.GetMFilName(), locale, os);
            CurrentSession.SaveSession();

            StartProcess(manifest);
        }
Exemplo n.º 30
0
        public static void EnterNumberInSession(string Number)
        {
            var NumberArray = Number.ToCharArray();
            int input;

            foreach (char Key in NumberArray)
            {
                input = Convert.ToInt32(Key);
                UserInputs.PressKey((byte)input);
                Console.WriteLine("Pressed key: " + input);
                Thread.Sleep(50);
            }
        }