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

Method HandleAllRunningProcesses

src/render_panel/network/http_handler.cpp:126–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124 }
125
126 void HttpHandler::HandleAllRunningProcesses(http::web_request &req, http::web_response &rep) {
127 auto rgm = context_->GetRunGameManager();
128 auto rps = rgm->GetRunningProcesses();
129 json obj = json::array();
130 for (const std::shared_ptr<ProcessInfo>& rp : rps) {
131 json item;
132 item["pid"] = rp->pid_;
133 auto exe_path = rp->exe_full_path_;
134 StringUtil::Replace(exe_path, "\\", "/");
135 item["exe_path"] = exe_path;
136 item["icon"] = rp->icon_name_;
137 obj.push_back(item);
138 }
139 auto resp = WrapBasicInfo(200, "ok", obj);
140 rep.fill_json(resp);
141 }
142
143 void HttpHandler::HandleKillProcess(http::web_request &req, http::web_response &rep) {
144 int pid = 0;

Callers 1

StartMethod · 0.80

Calls 2

GetRunGameManagerMethod · 0.80
GetRunningProcessesMethod · 0.80

Tested by

no test coverage detected