Exemplo n.º 1
0
 public void Server(TMain main)
 {
     do
     {
         try
         {
             using (NamedPipeServerStream pipeServer =
                        new NamedPipeServerStream("CheckRunApp", PipeDirection.Out))
             {
                 pipeServer.WaitForConnection();
                 try
                 {
                     System.Windows.Application.Current.Dispatcher.BeginInvoke(new Action(() => { main.Show(); }));
                 }
                 // Catch the IOException that is raised if the pipe is broken
                 // or disconnected.
                 catch (IOException e)
                 {
                 }
             }
         }
         catch (Exception ex) {
             if (ex.HResult == -2147024665)
             {
                 Thread.Sleep(1000);
             }
             continue;
         }
     } while (true);
 }
 public void ConnectToBridge(TMain tMain)
 {
     try
     {
         while (true)
         {
             Trace.WriteLine("B4 deviceListAndOpen");
             bool ret = HIOStaticValues.BaS.deviceListAndOpen();
             Trace.WriteLine($"After deviceListAndOpen: {ret}");
             if (ret == true)
             {
                 HIOStaticValues.CONNECTIONBRIDGE = true;
                 bool res = HIOStaticValues.BaS.CheckSwitchEvents(tMain);
             }
             else
             {
                 //HIOStaticValues.EventCheckDevice.Reset();
                 HIOStaticValues.CONNECTIONBRIDGE = false;
             }
             Trace.WriteLine("Wait for listening device.");
             HIOStaticValues.EventCheckDevice.Reset();       //wait for event
             HIOStaticValues.EventCheckDevice.WaitOne(3000); //wait for event
                                                             //Thread.Sleep(500);
                                                             //   HIOStaticValues.EventCheckDevice.Reset();  //wait for event
             Trace.WriteLine("Open signal");
         }
     }
     catch (Exception ex)
     {
     }
 }
Exemplo n.º 3
0
        internal static void InitializeNotifyIcon(TMain tm)
        {
            tmain = tm;



            System.ComponentModel.Container  components   = new System.ComponentModel.Container();
            System.Windows.Forms.ContextMenu contextMenu1 = new System.Windows.Forms.ContextMenu();

            contextMenu1.MenuItems.AddRange(
                new System.Windows.Forms.MenuItem[] { menuItem1, menuItem2, menuItem3 });



            // Initialize Disconnect
            menuItem1.Index  = 0;
            menuItem1.Text   = "&Disconnect";
            menuItem1.Click += new System.EventHandler(Disconnect_Click);
            // Initialize About
            menuItem2.Index       = 1;
            menuItem2.Text        = "&About us";
            menuItem2.Click      += new System.EventHandler(About_Click);
            menuItem3.Index       = 2;
            menuItem3.Text        = "Dash&board";
            menuItem3.Click      += new System.EventHandler(Manage_Click);
            CTicon                = new System.Windows.Forms.NotifyIcon(components);
            CTicon.ContextMenu    = contextMenu1;
            CTicon.Visible        = true;
            CTicon.Text           = "HIO";
            CTicon.Visible        = true;
            CTicon.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info;
            CTicon.MouseClick    += CTicon_MouseClick;
        }
Exemplo n.º 4
0
        public void Save2DB(FctTest fctTest)
        {
            TMain main = new TMain();
            main.Key = fctTest.Key;
            main.Start = fctTest.StartTime;
            main.RunningTime = fctTest.RunningTime;
            main.Tester = fctTest.Tester;
            main.TestType = TEST_TYPE_FCT;
            main.IsPass = fctTest.IsPass() ? TEST_RESULT_PASS : TEST_RESULT_FAIL;
            main.Note = fctTest.FinishReason;
            mainADO.Insert(main);

            Dictionary<Board, List<ComponentType>> dicts = fctTest.Cabinet.GetFctTestedComponentTypesDicts();
            foreach (var b in dicts.Keys)
            {
                TBoard board = new TBoard();
                board.Id = Summer.System.Util.DbHelper.GenerateKey();
                board.Key = fctTest.Key;
                board.Name = b.EqName;
                board.Type = b.BoardType;
                board.Component = "";
                List<ComponentType> list = dicts[b];
                foreach (var ct in list)
                {
                    board.Component += ct.EqName + " ";
                }
                board.Sn = b.FctTestSN;
                board.IsPass = b.IsFctTestPassed() ? TEST_RESULT_PASS : TEST_RESULT_FAIL;
                boardADO.Insert(board);
            }
        }
Exemplo n.º 5
0
        public TSetupWizard(TMain parent)
        {
            Parent = parent;
            Pages.Add(new TSetupPage1(this, 0));
            Pages.Add(new TSetupPage2(this, 14));
            Pages.Add(new TSetupPage3(this, 28));
            Pages.Add(new TSetupPage3_2(this, 42));
            Pages.Add(new TSetupPage4(this, 56));
            Pages.Add(new TSetupPage5(this, 70));
            Pages.Add(new TSetupPage5_2(this, 85));
            Pages.Add(new TSetupPage6(this, 100));



            Pages.Add(new TNewDeviceAddingPage1(this, 0, parent.SettingManager)
            {
                ProgressAnimationDuration = 0
            });
            Pages.Add(new TNewDeviceAddingPage2(this, 17));
            Pages.Add(new TNewDeviceAddingPage3(this, 34));
            Pages.Add(new TNewDeviceAddingPage3_2(this, 43));
            Pages.Add(new TNewDeviceAddingPage4(this, 62, parent.AccountManager));
            //Pages.Add(new TPcLockerEditor(this, 69, Parent.MagicLockManager));
            Pages.Add(new TImport(this, 86, Parent.SettingManager));
            Pages.Add(new TSetupImportComplete(this, 100));
        }
    public bool HandleSingleTouchBegan(FTouch touch)
    {
        if (gameIsOver && !initiatedSceneSwitch)
        {
            FSoundManager.StopMusic();
            initiatedSceneSwitch = true;
            if (goalType == GoalType.GoalOne)
            {
                TMain.SwitchToScene(TMain.SceneType.PeopleSceneGoalOne);
            }
            else if (goalType == GoalType.GoalTwo)
            {
                TMain.SwitchToScene(TMain.SceneType.PeopleSceneGoalTwo);
            }
            else if (goalType == GoalType.GoalThree)
            {
                TMain.SwitchToScene(TMain.SceneType.PeopleSceneGoalThree);
            }
        }

        if (readyToStartOver && !initiatedSceneSwitch)
        {
            initiatedSceneSwitch = true;
            TMain.SwitchToScene(TMain.SceneType.PeopleSceneGoalOne);
        }

        return(true);
    }
Exemplo n.º 7
0
 public void DoneShowingLabels()
 {
     if (this.dreamSceneType == DreamSceneType.DreamSceneOne)
     {
         TMain.SwitchToScene(TMain.SceneType.MergeNamesScene);
     }
     else if (this.dreamSceneType == DreamSceneType.DreamSceneTwo)
     {
         TMain.SwitchToScene(TMain.SceneType.ClickHeartsScene);
     }
 }
Exemplo n.º 8
0
 private void RunInput(object sender, EventArgs e)
 {
     TMain.Text = TMain.Text.Replace(" ", "");
     TMain.Select(TMain.Text.Length, 0);
     if (TMain.Text.Length < SearchAfterHowManyCharInputed)
     {
         LFileName.Text  = "";
         LPath.Text      = "";
         LArguments.Text = "";
         InputResult     = new List <string[]>();
         return;
     }
     try {
         string sql = $@"
             select * from (
                 select 
                     '[CMD]' || c.name as c0,
                     c.code as c1,
                     c.discrib as c2
                 from customizeCommand c
                 where c.name like '%{ TMain.Text }%'
                 union all
                 select
                     f.fileMainName as c0,
                     f.path as c1,
                     (select a.args from arguments a where a.fileMainName = f.fileMainName and a.path = f.path) as c2
                 from files f
                 where (
                         f.fileMainName like '%{ TMain.Text }%'
                         or f.fileDiscrib like '%{ TMain.Text }%'
                         or f.pinyin like '%{ TMain.Text }%'
                     )
                     and f.fileExtension like '%{ FileType }%'
             ) g
             order by (select count(l.runTime) from runLog l where l.fileMainName = g.c0 and l.path = g.c1 ) desc;
         ";
         InputResult = DBLinker.ExecuteToList(sql);
         if (InputResult.Count == 0)
         {
             LFileName.Text  = "NO FILE";
             LPath.Text      = ENABLE_WEB_SEARCH ? "Ctrl + Enter Search on Web." : "Try to reload the dictionary.";
             LArguments.Text = "";
             return;
         }
         LFileName.Text  = InputResult[0][0];
         LPath.Text      = InputResult[0][1];
         LArguments.Text = InputResult[0][2] == "" ? "(No Args)" : "(" + InputResult[0][2] + ")";
     } catch (Exception ex) {
         MessageBox.Show(ex.Message);
     }
 }
 public void HandleUpdate()
 {
     if (numTrebellaLettersInPlace == 8 && numNonTrebellaLettersLeft == 0 && !trebellaLettersHaveStartedSolidifying)
     {
         FSoundManager.PlaySound("success");
         trebellaLettersHaveStartedSolidifying = true;
     }
     else if (trebellaLettersHaveStartedSolidifying && !trebellaLettersDoneSolidifying)
     {
         UpdateSolidifyingTrebellaLetters();
     }
     else if (trebellaLettersDoneTurningIntoHearts)
     {
         timeSinceTrebellaLettersFinishedTurningIntoHearts += Time.deltaTime;
         if (timeSinceTrebellaLettersFinishedTurningIntoHearts > 1.0f && !initiatedSceneSwitch)
         {
             initiatedSceneSwitch = true;
             TMain.SwitchToScene(TMain.SceneType.PeopleSceneGoalTwo);
         }
     }
 }
    public bool HandleSingleTouchBegan(FTouch touch)
    {
        if (!gameHasStarted && gameReadyToStart)
        {
            StartGame();
            return(true);
        }
        if (gameIsOver && !gameFullyOver)
        {
            return(false);
        }
        if (gameFullyOver && !initiatedSceneSwitch)
        {
            if (score >= 1000000)
            {
                TMain.SwitchToScene(TMain.SceneType.PeopleSceneGoalThree);
            }
            else
            {
                TMain.SwitchToScene(TMain.SceneType.ClickHeartsScene);
            }
            initiatedSceneSwitch = true;
        }

        for (int i = hearts.Count - 1; i >= 0; i--)
        {
            FSprite heart = hearts[i];

            if (heart.localRect.Contains(heart.GlobalToLocal(touch.position)))
            {
                previousScore = score;
                FSoundManager.PlaySound("rise");
                score += 40000;
                KillHeart(heart);
                break;
            }
        }

        return(true);
    }
    public void UpdatePostGameOver()
    {
        endGameWaitTimer += Time.fixedDeltaTime;

        if (endGameWaitTimer > 1.0f && Input.anyKeyDown && !initiatedSceneSwitch)
        {
            FSoundManager.StopMusic();
            initiatedSceneSwitch = true;
            if (goalType == GoalType.GoalOne)
            {
                TMain.SwitchToScene(TMain.SceneType.PeopleSceneGoalOne);
            }
            else if (goalType == GoalType.GoalTwo)
            {
                TMain.SwitchToScene(TMain.SceneType.PeopleSceneGoalTwo);
            }
            else if (goalType == GoalType.GoalThree)
            {
                TMain.SwitchToScene(TMain.SceneType.PeopleSceneGoalThree);
            }
        }
    }
Exemplo n.º 12
0
    private void Start()
    {
        instance = this;

        Go.defaultEaseType = EaseType.Linear;
        Go.duplicatePropertyRule = DuplicatePropertyRuleType.RemoveRunningProperty;

        //Screen.showCursor = false;

        //Time.timeScale = 0.1f;

        bool landscape = true;
        bool portrait = false;

        bool isIPad = SystemInfo.deviceModel.Contains("iPad");
        bool shouldSupportPortraitUpsideDown = isIPad && portrait; //only support portrait upside-down on iPad

        FutileParams fparams = new FutileParams(landscape, landscape, portrait, shouldSupportPortraitUpsideDown);

        fparams.backgroundColor = RXUtils.GetColorFromHex(0x000000); //light blue 0x94D7FF or 0x74CBFF

        //fparams.AddResolutionLevel(2560.0f,	2.0f,	2.0f,	""); //1280x720
        //fparams.AddResolutionLevel(1280.0f,	1.0f,	2.0f,	""); //1280x720
        fparams.AddResolutionLevel(1920.0f,	1.5f,	2.0f,	""); //1920x1080
        fparams.AddResolutionLevel(960.0f,	0.75f,	2.0f,	""); //960x540

        fparams.origin = new Vector2(0.5f,0.5f);

        Futile.instance.Init (fparams);

        Futile.atlasManager.LoadAtlas("Atlases/UIAtlas");
        Futile.atlasManager.LoadAtlas("Atlases/UIFonts");
        Futile.atlasManager.LoadAtlas("Atlases/BackgroundAtlas");
        Futile.atlasManager.LoadAtlas("Atlases/GameAtlas");

        FTextParams textParams;

        textParams = new FTextParams();
        textParams.lineHeightOffset = -8.0f;
        Futile.atlasManager.LoadFont("Franchise","FranchiseFont", "Atlases/FranchiseFont", -2.0f,-5.0f,textParams);

        textParams = new FTextParams();
        textParams.kerningOffset = -0.5f;
        textParams.lineHeightOffset = -8.0f;
        Futile.atlasManager.LoadFont("CubanoInnerShadow","Cubano_InnerShadow", "Atlases/CubanoInnerShadow", 0.0f,2.0f,textParams);

        textParams = new FTextParams();
        textParams.lineHeightOffset = -8.0f;
        textParams.kerningOffset = -0.5f;
        Futile.atlasManager.LoadFont("CubanoBig","Cubano136", "Atlases/Cubano136", 0.0f,2.0f,textParams);

        GamepadManager.Init();
        GameManager.Init();

        _stage = Futile.stage;

        _stage.AddChild(background = new Background());

        GoToPage(TPageType.PagePlayerSelect);

        _stage.ListenForUpdate (HandleUpdate);

        FSoundManager.isMuted = !GameConfig.IS_SOUND_ON;

        _stage.ListenForResize(HandleResize);
    }
Exemplo n.º 13
0
 public static void Error(string format, params object[] args)
 {
     TMain.NewText(string.Format(format, args), 255, 0, 0, true);
 }
Exemplo n.º 14
0
        public void Save2DB(GeneralTest generalTest)
        {
            TMain main = new TMain();
            main.Key = generalTest.Key;
            main.Start = generalTest.StartTime;
            main.RunningTime = generalTest.RunningTime;
            main.Tester = generalTest.Tester;
            main.TestType = TEST_TYPE_GENERAL;
            main.IsPass = generalTest.IsPass() ? TEST_RESULT_PASS : TEST_RESULT_FAIL;
            main.Note = generalTest.FinishReason;
            mainADO.Insert(main);

            List<Board> boards = generalTest.Cabinet.GetGeneralTestBoardsList();
            foreach (var b in boards)
            {
                TBoard board = new TBoard();
                board.Id = Summer.System.Util.DbHelper.GenerateKey();
                board.Key = generalTest.Key;
                board.Name = b.EqName;
                board.Type = b.BoardType;
                board.Component = ""; //综合测试没有组件,所以设置为空
                board.Sn = b.GeneralTestSN;
                board.IsPass = b.IsGeneralTestPassed ? TEST_RESULT_PASS : TEST_RESULT_FAIL;
                boardADO.Insert(board);
            }
        }
Exemplo n.º 15
0
        public static TBase Default()
        {
            var Base = new TBase
            {
                Version = 2
            };

            var Load = new TLoad
            {
                Base = new TForm {
                    BackColor = new TColor(255, 51, 51, 51), Image = new TImage(), TopMost = true, Opacity = 1d
                },
                BaseStrings =
                    new TInitStrings
                {
                    CheckingWhitelist   = "Checking whitelist...",
                    ChangingWhitelist   = "Changing whitelist...",
                    DownloadingData     = "Downloading data...",
                    CheckingData        = "Checking data...",
                    DownloadingDlls     = "Downloading DLLs...",
                    DownloadingMonaco   = "Downloading Monaco...",
                    DownloadingCefSharp = "Downloading CefSharp...",
                    DownloadingSQLite   = "Downloading SQLite...",
                    JoiningDiscord      = "Joining Discord...",
                    Ready = "Ready to launch!"
                },
                Logo = new TLogo {
                    Image = new TImage()
                },
                StatusBox = new TLabel
                {
                    Enabled = true, BackColor = new TColor(255, 51, 51, 51), Font = new TFont("Segoe UI", 14f), TextColor = new TColor(255, 255, 255, 255), Text = "Initializing..."
                },
                TitleBox = new TLabel
                {
                    Enabled = true, BackColor = new TColor(255, 60, 60, 60), Font = new TFont("Segoe UI", 12f), TextColor = new TColor(255, 255, 255, 255), Text = "Synapse X - Loader"
                },
                TopBox = new TSeperator {
                    Enabled = true, BackColor = new TColor(255, 60, 60, 60)
                }
            };

            Base.Load = Load;

            var Main = new TMain
            {
                Base = new TForm {
                    BackColor = new TColor(255, 51, 51, 51), Image = new TImage(), TopMost = true, Opacity = 1d
                },
                WebSocket = new TWebSocket {
                    Enabled = false, DebugMode = false
                },
                Editor = new TEditor {
                    Light = false, FixPixel = new TColor(255, 30, 30, 30)
                },
                BaseStrings =
                    new TAttachStrings
                {
                    FailedToFindRoblox      = " (failed to find roblox!)",
                    AlreadyInjected         = " (already injected!)",
                    NotInjected             = " (not injected! press attach)",
                    NotRunningLatestVersion = " (not running latest version! relaunch.)",
                    Checking          = " (checking...)",
                    Injecting         = " (injecting...)",
                    CheckingWhitelist = " (checking whitelist...)",
                    Scanning          = " (scanning...)",
                    Ready             = " (ready!)"
                },
                RightClickStrings =
                    new TRightClickStrings
                {
                    Execute      = "Execute",
                    LoadToEditor = "Load to Editor",
                    Refresh      = "Refresh"
                },
                Logo = new TLogo {
                    Image = new TImage()
                },
                TopBox = new TSeperator {
                    Enabled = true, BackColor = new TColor(255, 60, 60, 60)
                },
                TitleBox =
                    new TFormatLabel
                {
                    Enabled      = true,
                    BackColor    = new TColor(255, 60, 60, 60),
                    Font         = new TFont("Segoe UI", 12f),
                    FormatString = "Synapse X - {version}",
                    TextColor    = new TColor(255, 255, 255, 255)
                },
                ScriptBox =
                    new TListBox
                {
                    BackColor = new TColor(255, 60, 60, 60),
                    TextColor = new TColor(255, 255, 255, 255),
                    Font      = new TFont("Segoe UI", 12f)
                },
                MinimizeButton =
                    new TGlyphButton {
                    BackColor = new TColor(255, 60, 60, 60), GlyphColor = new TColor(255, 255, 255, 255)
                },
                ExitButton =
                    new TGlyphButton {
                    BackColor = new TColor(255, 60, 60, 60), GlyphColor = new TColor(255, 255, 255, 255)
                },
                ExecuteButton =
                    new TButton
                {
                    BackColor = new TColor(255, 60, 60, 60),
                    TextColor = new TColor(255, 255, 255, 255),
                    Font      = new TFont("Segoe UI", 14f),
                    Image     = new TImage(),
                    Text      = "Execute"
                },
                ClearButton =
                    new TButton
                {
                    BackColor = new TColor(255, 60, 60, 60),
                    TextColor = new TColor(255, 255, 255, 255),
                    Font      = new TFont("Segoe UI", 14f),
                    Image     = new TImage(),
                    Text      = "Clear"
                },
                OpenFileButton =
                    new TButton
                {
                    BackColor = new TColor(255, 60, 60, 60),
                    TextColor = new TColor(255, 255, 255, 255),
                    Font      = new TFont("Segoe UI", 14f),
                    Image     = new TImage(),
                    Text      = "Open File"
                },
                ExecuteFileButton =
                    new TButton
                {
                    BackColor = new TColor(255, 60, 60, 60),
                    TextColor = new TColor(255, 255, 255, 255),
                    Font      = new TFont("Segoe UI", 14f),
                    Image     = new TImage(),
                    Text      = "Execute File"
                },
                SaveFileButton =
                    new TButton
                {
                    BackColor = new TColor(255, 60, 60, 60),
                    TextColor = new TColor(255, 255, 255, 255),
                    Font      = new TFont("Segoe UI", 14f),
                    Image     = new TImage(),
                    Text      = "Save File"
                },
                OptionsButton =
                    new TButton
                {
                    BackColor = new TColor(255, 60, 60, 60),
                    TextColor = new TColor(255, 255, 255, 255),
                    Font      = new TFont("Segoe UI", 14f),
                    Image     = new TImage(),
                    Text      = "Options"
                },
                AttachButton =
                    new TButton
                {
                    BackColor = new TColor(255, 60, 60, 60),
                    TextColor = new TColor(255, 255, 255, 255),
                    Font      = new TFont("Segoe UI", 14f),
                    Image     = new TImage(),
                    Text      = "Attach"
                },
                ScriptHubButton = new TYieldButton
                {
                    BackColor  = new TColor(255, 60, 60, 60),
                    TextColor  = new TColor(255, 255, 255, 255),
                    Font       = new TFont("Segoe UI", 14f),
                    Image      = new TImage(),
                    TextNormal = "Script Hub",
                    TextYield  = "Starting..."
                }
            };

            Base.Main = Main;

            var ScriptHub = new TScriptHub
            {
                Base = new TForm {
                    BackColor = new TColor(255, 51, 51, 51), Image = new TImage(), TopMost = true, Opacity = 1d
                },
                Logo = new TLogo {
                    Image = new TImage()
                },
                TopBox = new TSeperator {
                    Enabled = true, BackColor = new TColor(255, 60, 60, 60)
                },
                TitleBox =
                    new TLabel
                {
                    Enabled = true, BackColor = new TColor(255, 60, 60, 60), Font = new TFont("Segoe UI", 12f), TextColor = new TColor(255, 255, 255, 255), Text = "Synapse X - Script Hub"
                },
                ScriptBox =
                    new TListBox
                {
                    BackColor = new TColor(255, 30, 30, 30),
                    TextColor = new TColor(255, 255, 255, 255),
                    Font      = new TFont("Segoe UI", 12f)
                },
                DescriptionBox =
                    new TListBox
                {
                    BackColor = new TColor(255, 30, 30, 30),
                    TextColor = new TColor(255, 255, 255, 255),
                    Font      = new TFont("Segoe UI", 12f)
                },
                MinimizeButton =
                    new TGlyphButton {
                    BackColor = new TColor(255, 60, 60, 60), GlyphColor = new TColor(255, 255, 255, 255)
                },
                ExecuteButton = new TYieldButton
                {
                    BackColor  = new TColor(255, 60, 60, 60),
                    TextColor  = new TColor(255, 255, 255, 255),
                    Font       = new TFont("Segoe UI", 12f),
                    Image      = new TImage(),
                    TextNormal = "Execute",
                    TextYield  = "Executing..."
                },
                CloseButton = new TButton
                {
                    BackColor = new TColor(255, 60, 60, 60),
                    TextColor = new TColor(255, 255, 255, 255),
                    Font      = new TFont("Segoe UI", 12f),
                    Image     = new TImage(),
                    Text      = "Close"
                }
            };

            Base.ScriptHub = ScriptHub;

            return(Base);
        }
    public void HandleUpdate()
    {
        if (readyToStartOver && !initiatedSceneSwitch)
        {
            if (Input.anyKeyDown)
            {
                initiatedSceneSwitch = true;
                TMain.SwitchToScene(TMain.SceneType.PeopleSceneGoalOne);
            }
        }

        if (gameIsOver)
        {
            UpdatePostGameOver();
            return;
        }

        if (foundEachother)
        {
            UpdatePostFoundEachOther();
            UpdateFinalNote();
            return;
        }

        if (Input.GetKeyDown(KeyCode.Space) && !whit.isJumping)
        {
            whit.Jump();
        }
        if (Input.GetKey(KeyCode.Space))
        {
            if (whit.isCrouched)
            {
                whit.decelAmt = 100f;
            }
            else
            {
                whit.decelAmt = 50f;
            }
        }
        else
        {
            whit.decelAmt = 250f;
        }
        if (Input.GetKey(KeyCode.DownArrow))
        {
            whit.StartCrouching();
        }
        if (Input.GetKeyUp(KeyCode.DownArrow))
        {
            whit.StopCrouching();
        }

        if (!tutorialIsDone)
        {
            UpdateTutorial();
        }

        else
        {
            UpdateUIElements();
            UpdateHeartTokens();
            UpdateHeartTokenCollisions();
            UpdateGoal();
        }
    }
        public void ChromeConnectionSend(TMain tMain)
        {
            try
            {
                do
                {
                    // Connect to the a queue on the local computer.
                    if (!MessageQueue.Exists(HIOStaticValues.PATHMSGREC))
                    {
                        MessageQueue.Create(HIOStaticValues.PATHMSGREC);
                    }
                    if (!MessageQueue.Exists(HIOStaticValues.PATHMSGCHROME))
                    {
                        MessageQueue.Create(HIOStaticValues.PATHMSGCHROME);
                    }
                    if (!MessageQueue.Exists(HIOStaticValues.PATHMSGFF))
                    {
                        MessageQueue.Create(HIOStaticValues.PATHMSGFF);
                    }
                    if (!MessageQueue.Exists(HIOStaticValues.PATHMSGEDGE))
                    {
                        MessageQueue.Create(HIOStaticValues.PATHMSGEDGE);
                    }
                    MessageQueue myQueue         = new MessageQueue(HIOStaticValues.PATHMSGREC);
                    MessageQueue QueueSendFF     = new MessageQueue(HIOStaticValues.PATHMSGFF);
                    MessageQueue QueueSendChrome = new MessageQueue(HIOStaticValues.PATHMSGCHROME);
                    MessageQueue QueueSendEdge   = new MessageQueue(HIOStaticValues.PATHMSGEDGE);
                    SendData     sentOrder       = new SendData();
                    sentOrder.label = "HIO"; //set header
                    sentOrder.data  = "true";
                    // Set the formatter to indicate body contains an Order.
                    myQueue.Formatter = new XmlMessageFormatter(new System.Type[] { typeof(SendData) });

                    while (true)
                    {
                        try
                        {
                            // Receive and format the message.
                            Message myMessage = myQueue.Receive();
                            myQueue.Purge();
                            SendData recData = (SendData)myMessage.Body;
                            if (recData.data == "true")
                            {
                                HIOStaticValues.checkRec = true;
                                HIOStaticValues._signalRec.Set();
                                continue;
                            }

                            // Display message information.
                            if (recData.label == "Chrome")
                            {
                                QueueSendChrome.Send(sentOrder);
                                HIOStaticValues.SOURCE = (int)Source.CHROME;
                                Task.Run(() =>
                                {
                                    Debug.WriteLine(recData.data);
                                    ProcessMessage pm = new ProcessMessage();
                                    pm.ProcessRecieveMessage(JsonConvert.DeserializeObject <JObject>(recData.data), Source.CHROME);
                                });
                            }
                            else if (recData.label == "Firefox")
                            {
                                QueueSendFF.Send(sentOrder);
                                HIOStaticValues.SOURCE = (int)Source.FIREFOX;
                                Task.Run(() =>
                                {
                                    Debug.WriteLine(recData.data);
                                    ProcessMessage pm = new ProcessMessage();
                                    pm.ProcessRecieveMessage(JsonConvert.DeserializeObject <JObject>(recData.data), Source.FIREFOX);
                                });
                            }
                            else if (recData.label == "Edge")
                            {
                                QueueSendEdge.Send(sentOrder);
                                HIOStaticValues.SOURCE = (int)Source.EDGE;
                                Task.Run(() =>
                                {
                                    Debug.WriteLine(recData.data);
                                    ProcessMessage pm = new ProcessMessage();
                                    pm.ProcessRecieveMessage(JsonConvert.DeserializeObject <JObject>(recData.data), Source.EDGE);
                                });
                            }
                        }
                        catch (Exception ex)
                        {
                        }
                    }
                } while (true);
            }
            catch (Exception ex)
            {
            }
        }
    public void UpdateGoal()
    {
        if (totalDistance < goalDistance - 1000f || initiatedSceneSwitch)
        {
            return;
        }

        if (goalType == GoalType.GoalOne)
        {
            if (faceCoin == null)
            {
                faceCoin   = new FSprite("danaHappy.png");
                faceCoin.x = Futile.screen.width + 100f;
                faceCoin.y = 250f;
                everythingContainer.AddChild(faceCoin);
                everythingContainer.AddChild(whit);                 // move him to top

                Tween tween1 = new Tween(faceCoin, 0.5f, new TweenConfig()
                                         .floatProp("scaleX", -1.0f)
                                         .setEaseType(EaseType.SineInOut));

                Tween tween2 = new Tween(faceCoin, 0.5f, new TweenConfig()
                                         .floatProp("scaleX", 1.0f)
                                         .setEaseType(EaseType.SineInOut));

                TweenChain chain = new TweenChain();
                chain.setIterations(-1);
                chain.append(tween1);
                chain.append(tween2);
                Go.addTween(chain);
                chain.play();
            }

            faceCoin.x += Time.fixedDeltaTime * universalVelocity;

            if (faceCoin.x < 100f)
            {
                initiatedSceneSwitch = true;
                FSoundManager.PlaySound("success");
                TMain.SwitchToScene(TMain.SceneType.DreamSceneOne);
            }
        }

        else if (goalType == GoalType.GoalTwo)
        {
            if (bigHeartCoin == null)
            {
                bigHeartCoin       = new FSprite("heart.psd");
                bigHeartCoin.scale = 2.0f;
                bigHeartCoin.x     = Futile.screen.width + 100f;
                bigHeartCoin.color = new Color(1.0f, 0.2f, 0.2f, 1.0f);
                bigHeartCoin.y     = 250f;
                everythingContainer.AddChild(bigHeartCoin);
                everythingContainer.AddChild(whit);                 // move to top

                Tween tween1 = new Tween(bigHeartCoin, 0.5f, new TweenConfig()
                                         .floatProp("scaleX", -1.0f)
                                         .setEaseType(EaseType.SineInOut));

                Tween tween2 = new Tween(bigHeartCoin, 0.5f, new TweenConfig()
                                         .floatProp("scaleX", 1.0f)
                                         .setEaseType(EaseType.SineInOut));

                TweenChain chain = new TweenChain();
                chain.setIterations(-1);
                chain.append(tween1);
                chain.append(tween2);
                Go.addTween(chain);
                chain.play();
            }

            bigHeartCoin.x += Time.fixedDeltaTime * universalVelocity;

            if (bigHeartCoin.x < 100f)
            {
                initiatedSceneSwitch = true;
                FSoundManager.StopMusic();
                FSoundManager.PlaySound("success");
                TMain.SwitchToScene(TMain.SceneType.DreamSceneTwo);
            }
        }

        else if (goalType == GoalType.GoalThree)
        {
            if (dana == null)
            {
                dana   = new TWalkingCharacter("danaHead.png");
                dana.x = Futile.screen.width + 100f;
                dana.y = 250f;
                everythingContainer.AddChild(dana);
                dana.StartWalking();
            }

            dana.x += Time.fixedDeltaTime * universalVelocity * 0.25f;

            if (dana.x < 350f)
            {
                start.isVisible = goal.isVisible = false;
                FSoundManager.PlayMusic("yay");
                foundEachother = true;
                dana.TurnAround();
                dana.StopWalking();
                whit.StopWalking();
                parallaxScene.StopUpdating();
                whit.StopCrouching();
                StartHeartShower();
            }
        }
    }