feat: Добавлен отдельный метод исполнения Sq кода

This commit is contained in:
AURUMVORXX
2025-11-08 00:25:00 +05:00
parent 4b03e6fac8
commit 304c44ba04
3 changed files with 25 additions and 2 deletions

View File

@@ -54,6 +54,7 @@ class PyG2O
if (!_silent)
print("[PyG2O] Successfully connected to " + url);
_send({"event": "register_server"});
_send({"event": "init_temp_tokens", "token": _clientTokens});
}
@@ -73,7 +74,7 @@ class PyG2O
{
local request = JSON.parse_ansi(message);
if (!("uuid" in request) ||
!("data" in request))
!("code" in request))
return;
_message_call.bindenv(this)(request);

View File

@@ -1,7 +1,7 @@
function _message_call(data)
{
local compile_string = "try { " + data["data"] + " } catch(id) { print(\"[PyG2O] Error white executing the code: \" + id); return null; }";
local compile_string = "try { " + data["code"] + " } catch(id) { print(\"[PyG2O] Error white executing the code: \" + id); return null; }";
local result = compilestring(compile_string)();
_send({"event": "sq_response", "uuid": data["uuid"], "data": result});
}