public string Checkin()
        {
            string baseURL     = ConfigurationManager.AppSettings["BaseURL"];
            string computerKey = ConfigurationManager.AppSettings["ComputerKey"];

            string URL = $"{baseURL}/game/checkin";

            gc.CheckinUser(URL, computerKey);
            LauncherInfo.StopGame();
            return("ok");
        }
Example #2
0
        private void game_start_timer_Tick(object sender, EventArgs e)
        {
            currStartDelay++;


            if (LauncherInfo.gameIsNew)
            {
                if (LauncherInfo.game.status == "ok")
                {
                    notifyIcon.BalloonTipTitle = "Game Started";
                    notifyIcon.BalloonTipText  = LauncherInfo.game.name;
                    notifyIcon.ShowBalloonTip(1000);
                }
                LauncherInfo.gameIsNew = false;
                currStartDelay         = 0;
                if (LauncherInfo.isInstall)
                {
                    currStartDelay         = -3600;
                    LauncherInfo.isInstall = false;
                }
                currEndDelay = 0;
                // set some kind of timeout
            }

            if (LauncherInfo.game != null)
            {
                if (!gc.isGameRunning(LauncherInfo.game.exe))
                {
                    if (currStartDelay > gameStartDelay)
                    {
                        currEndDelay++;
                    }
                }
                else
                {
                    currStartDelay = gameStartDelay;
                }

                if (currEndDelay > gameEndDelay)
                {
                    gc.CheckinUser($"{baseURL}/game/checkin", computerKey);
                    gc.StopSteam();
                    LauncherInfo.StopGame();
                    currEndDelay = 0;
                }
            }
        }
Example #3
0
        private void game_start_timer_Tick(object sender, EventArgs e)
        {
            currStartDelay++;


            if (LauncherInfo.gameIsNew)
            {
                if (LauncherInfo.game.status == "ok")
                {
                    notifyIcon.BalloonTipTitle = "Game Started";
                    notifyIcon.BalloonTipText  = LauncherInfo.game.name;
                    notifyIcon.ShowBalloonTip(1000);
                }
                LauncherInfo.gameIsNew = false;
                currStartDelay         = 0;
                currEndDelay           = 0;
                // set some kind of timeout
            }

            if (LauncherInfo.game != null)
            {
                string baseURL     = ConfigurationManager.AppSettings["BaseURL"];
                string computerKey = ConfigurationManager.AppSettings["ComputerKey"];

                if (currStartDelay > gameStartDelay)
                {
                    if (!gc.isGameRunning(LauncherInfo.game.exe))
                    {
                        currEndDelay++;
                    }
                }
                if (currEndDelay > gameEndDelay)
                {
                    gc.CheckinUser($"{baseURL}/game/checkin", computerKey);
                    gc.StopSteam();
                    LauncherInfo.StopGame();
                    currEndDelay = 0;
                }
            }
        }