MCPcopy Create free account
hub / github.com/RGAA-Software/GoDesk / StartNormalGame

Method StartNormalGame

src/render_panel/gr_run_game_manager.cpp:126–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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)) {

Callers 1

StartGameMethod · 0.95

Calls 1

to_stringFunction · 0.85

Tested by

no test coverage detected