| 2246 | } |
| 2247 | |
| 2248 | bool AgentClient::handle_controller_status(const json::value& j) |
| 2249 | { |
| 2250 | if (!j.is<ControllerStatusReverseRequest>()) { |
| 2251 | return false; |
| 2252 | } |
| 2253 | const ControllerStatusReverseRequest& req = j.as<ControllerStatusReverseRequest>(); |
| 2254 | LogFunc << VAR(req) << VAR(ipc_addr_); |
| 2255 | MaaController* controller = query_controller(req.controller_id); |
| 2256 | if (!controller) { |
| 2257 | LogError << "controller not found" << VAR(req.controller_id); |
| 2258 | return false; |
| 2259 | } |
| 2260 | MaaStatus status = controller->status(req.ctrl_id); |
| 2261 | ControllerStatusReverseResponse resp { |
| 2262 | .status = status, |
| 2263 | }; |
| 2264 | send(resp); |
| 2265 | return true; |
| 2266 | } |
| 2267 | |
| 2268 | bool AgentClient::handle_controller_wait(const json::value& j) |
| 2269 | { |