| 124 | } |
| 125 | |
| 126 | Response<bool, std::string> GrRunGameManager::StartNormalGame(const std::string& game_path, const std::vector<std::string>& args) { |
| 127 | auto resp = Response<bool, std::string>::Make(false, ""); |
| 128 | if (!std::filesystem::exists(StringUtil::ToWString(game_path))) { |
| 129 | resp.value_ = std::format("Exe not exists: {}", game_path); |
| 130 | LOGE(resp.value_); |
| 131 | return resp; |
| 132 | } |
| 133 | |
| 134 | if (game_process_) { |
| 135 | game_process_->kill(); |
| 136 | } |
| 137 | game_process_ = new QProcess(); |
| 138 | game_process_->start(game_path.c_str()); |
| 139 | game_process_->waitForStarted(); |
| 140 | auto pid = game_process_->processId(); |
| 141 | resp.ok_ = pid > 0; |
| 142 | resp.value_ = "Start success"; |
| 143 | resp.msg_ = std::to_string(pid); |
| 144 | return resp; |
| 145 | } |
| 146 | |
| 147 | std::shared_ptr<SteamApp> GrRunGameManager::FindInSteamManager(const std::string& game_path) { |
| 148 | if (!SteamManager::IsSteamPath(game_path)) { |