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

Function TaskerSink

source/binding/NodeJS/src/apis/callback.cpp:53–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void TaskerSink(void* tasker, const char* message, const char* details_json, void* callback_arg)
54{
55 auto ctx = reinterpret_cast<maajs::CallbackContext*>(callback_arg);
56 ctx->Call<void>([=](maajs::FunctionType fn) {
57 auto tsk = TaskerImpl::locate_object(fn.Env(), reinterpret_cast<MaaTasker*>(tasker));
58 auto detail = maajs::JsonParse(fn.Env(), details_json).As<maajs::ObjectType>();
59 detail["msg"] = maajs::StringType::New(fn.Env(), RemovePrefix(message, "Tasker."));
60 return fn.Call(
61 {
62 tsk,
63 detail,
64 });
65 });
66}
67
68void ContextSink(void* context, const char* message, const char* details_json, void* callback_arg)
69{

Callers

nothing calls this directly

Calls 4

JsonParseFunction · 0.85
RemovePrefixFunction · 0.85
EnvMethod · 0.45
CallMethod · 0.45

Tested by

no test coverage detected