public bool rentGame() { #region Bước 1: Kiểm tra //Kiểm tra xem đăng nhập chưa //Kiểm tra xem có đang thuê game không //Kiểm tra đủ lvl thuê game không //Kiểm tra ví tiền còn không //Gửi thông tin cho server - server response thông tin để đăng nhập #endregion #region Bước 2: Kill Platform //Kill Game Platform AppHandler.killPlatform(platform); #endregion #region Bước 2: Đăng nhập Game switch (platform) { #region Login Steam case "Steam": string LoginSteam; LoginSteam = @"/c cd " + folderSteam + " && start steam.exe -login " + steamUsername + " " + steamPassword; Process p = new Process(); p.StartInfo.FileName = "CMD.exe"; p.StartInfo.Arguments = LoginSteam; p.StartInfo.UseShellExecute = false; p.StartInfo.CreateNoWindow = true; p.StartInfo.RedirectStandardError = true; p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; p.Start(); string error = p.StandardError.ReadToEnd(); string errors = error + "Xem tại mục hướng dẫn để khắc phục lỗi này."; p.WaitForExit(); // Handle result if (error == "") { //Hiện Dock Đang thuê game //ShowDockThueGame(); //Code Tính giờ //Code Active Application_Exit //Code Kill Game if lose connect to server //Code kill Game if log out return(true); } else { MessageBox.Show(errors, "Lỗi"); return(false); } #endregion //Login Epic case "Epic": return(true); //Login Uplay case "Uplay": // C:\Users\Sky\AppData\Local\Ubisoft Game Launcher return(true); //Login Battle case "Battle": return(true); //Login Origin case "Origin": return(true); default: return(true); } #endregion }