feat: Добавлен отдельный метод исполнения Sq кода
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user