mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-12 22:50:36 -06:00
No longer send the script source of shortcuts via the topic. Don't scripts into the log that are binary blobs
This commit is contained in:
@@ -58,7 +58,6 @@ std::vector<nlohmann::json> ShortcutTopic::shortcutsJson() const {
|
||||
const nlohmann::json shortcutJson = {
|
||||
{ "identifier", action.identifier },
|
||||
{ "name", action.name },
|
||||
{ "script", action.command },
|
||||
{ "synchronization", static_cast<bool>(!action.isLocal) },
|
||||
{ "documentation", action.documentation },
|
||||
{ "guiPath", action.guiPath },
|
||||
@@ -121,7 +120,6 @@ nlohmann::json ShortcutTopic::shortcutJson(const std::string& identifier) const
|
||||
json.push_back({
|
||||
{ "identifier", action.identifier },
|
||||
{ "name", action.name },
|
||||
{ "script", action.command },
|
||||
{ "synchronization", static_cast<bool>(!action.isLocal) },
|
||||
{ "documentation", action.documentation },
|
||||
{ "guiPath", action.guiPath },
|
||||
|
||||
@@ -170,8 +170,9 @@ bool ScriptEngine::runScript(const std::string& script, const ScriptCallback& ca
|
||||
|
||||
ghoul_assert(!script.empty(), "Script must not be empty");
|
||||
|
||||
if (_logScripts) {
|
||||
// Write command to log before it's executed
|
||||
if (_logScripts && script[0] != '\x1b') {
|
||||
// \x1b = A byte in the beginning that Lua uses to represent whether a string is
|
||||
// an ASCII or a binary blob. We don't want to print binary blobs into the log
|
||||
writeLog(script);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user