| 2266 | } |
| 2267 | |
| 2268 | bool AgentClient::handle_controller_wait(const json::value& j) |
| 2269 | { |
| 2270 | if (!j.is<ControllerWaitReverseRequest>()) { |
| 2271 | return false; |
| 2272 | } |
| 2273 | const ControllerWaitReverseRequest& req = j.as<ControllerWaitReverseRequest>(); |
| 2274 | LogFunc << VAR(req) << VAR(ipc_addr_); |
| 2275 | MaaController* controller = query_controller(req.controller_id); |
| 2276 | if (!controller) { |
| 2277 | LogError << "controller not found" << VAR(req.controller_id); |
| 2278 | return false; |
| 2279 | } |
| 2280 | MaaStatus status = controller->wait(req.ctrl_id); |
| 2281 | ControllerWaitReverseResponse resp { |
| 2282 | .status = status, |
| 2283 | }; |
| 2284 | send(resp); |
| 2285 | return true; |
| 2286 | } |
| 2287 | |
| 2288 | bool AgentClient::handle_controller_connected(const json::value& j) |
| 2289 | { |