MCPcopy Create free account
hub / github.com/axmolengine/axmol / on_message

Method on_message

core/ui/UIWebView/UIWebViewImpl-win32.cpp:267–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265 }
266
267 void on_message(std::string_view msg)
268 {
269 const auto seq = jsonParse(msg, "id", 0);
270 const auto name = jsonParse(msg, "method", 0);
271 const auto args = jsonParse(msg, "params", 0);
272 if (bindings.find(name) == bindings.end())
273 {
274 return;
275 }
276 const auto fn = bindings[name];
277 (*fn->first)(seq, args, fn->second);
278 }
279
280 using binding_t = std::function<void(std::string, std::string, void*)>;
281 using binding_ctx_t = std::pair<binding_t*, void*>;

Callers

nothing calls this directly

Calls 3

jsonParseFunction · 0.85
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected