MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / handle_resource_status

Method handle_resource_status

source/MaaAgentClient/Client/AgentClient.cpp:1564–1582  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1562}
1563
1564bool AgentClient::handle_resource_status(const json::value& j)
1565{
1566 if (!j.is<ResourceStatusReverseRequest>()) {
1567 return false;
1568 }
1569 const ResourceStatusReverseRequest& req = j.as<ResourceStatusReverseRequest>();
1570 LogFunc << VAR(req) << VAR(ipc_addr_);
1571 MaaResource* resource = query_resource(req.resource_id);
1572 if (!resource) {
1573 LogError << "resource not found" << VAR(req.resource_id);
1574 return false;
1575 }
1576 MaaStatus status = resource->status(req.res_id);
1577 ResourceStatusReverseResponse resp {
1578 .status = status,
1579 };
1580 send(resp);
1581 return true;
1582}
1583
1584bool AgentClient::handle_resource_wait(const json::value& j)
1585{

Callers

nothing calls this directly

Calls 1

statusMethod · 0.65

Tested by

no test coverage detected