| 2306 | } |
| 2307 | |
| 2308 | bool AgentClient::handle_controller_running(const json::value& j) |
| 2309 | { |
| 2310 | if (!j.is<ControllerRunningReverseRequest>()) { |
| 2311 | return false; |
| 2312 | } |
| 2313 | const ControllerRunningReverseRequest& req = j.as<ControllerRunningReverseRequest>(); |
| 2314 | LogFunc << VAR(req) << VAR(ipc_addr_); |
| 2315 | MaaController* controller = query_controller(req.controller_id); |
| 2316 | if (!controller) { |
| 2317 | LogError << "controller not found" << VAR(req.controller_id); |
| 2318 | return false; |
| 2319 | } |
| 2320 | bool running = controller->running(); |
| 2321 | ControllerRunningReverseResponse resp { |
| 2322 | .ret = running, |
| 2323 | }; |
| 2324 | send(resp); |
| 2325 | return true; |
| 2326 | } |
| 2327 | |
| 2328 | bool AgentClient::handle_controller_cached_image(const json::value& j) |
| 2329 | { |