From e418d9d55f29308f5af7532cfe22c82cd23322dd Mon Sep 17 00:00:00 2001 From: zontreck Date: Sat, 5 Oct 2024 12:15:34 -0700 Subject: [PATCH] feat(core): begin to add the core script Signed-off-by: zontreck --- src/includes/Variables.lsl | 33 ++++++++----- src/preproc/NuCore [AC].lsl | 12 +++++ ...NuShim [AC].lsl => NuUpdate Shim [AC].lsl} | 0 src/raw/core.lsl | 46 +++++++++++++++++++ 4 files changed, 80 insertions(+), 11 deletions(-) create mode 100644 src/preproc/NuCore [AC].lsl rename src/preproc/Updater/{NuShim [AC].lsl => NuUpdate Shim [AC].lsl} (100%) create mode 100644 src/raw/core.lsl diff --git a/src/includes/Variables.lsl b/src/includes/Variables.lsl index 2babd86..f58cb86 100644 --- a/src/includes/Variables.lsl +++ b/src/includes/Variables.lsl @@ -3,6 +3,26 @@ integer LINK_SIGNAL_REBOOT = 0904242; integer LINK_SIGNAL_CALLBACKS = 0904243; integer LINK_SIGNAL_UPDATE = 0905241; +/* + Dialogs Signals +*/ +integer LINK_SIGNAL_GEN_CHANNEL = 0601241; +integer LINK_SIGNAL_CHANNEL_BACK = 0601242; +integer LINK_SIGNAL_SHOW_MENU = 0601243; +integer LINK_SIGNAL_MENU_TIMEOUT = 0601244; +integer LINK_SIGNAL_REREGISTER_MENUS= 0601245; +integer LINK_SIGNAL_QUERY_MENU = 0602241; +integer LINK_SIGNAL_REGISTER_MENU = 0602242; +integer LINK_SIGNAL_RESET = 0602243; +integer LINK_SIGNAL_MENU_DATA = 0602244; +integer LINK_SIGNAL_MENU_BACK = 0801241; +integer LINK_SIGNAL_REPLACE_BUTTON = 0804241; + + +/* + End Dialogs Signals +*/ + string OP_SETTINGS_WRITE = "1"; string OP_SETTINGS_READ = "2"; @@ -45,6 +65,8 @@ integer g_iUpdateHasStarted; key g_kSession; string g_sBOM; +integer g_iLocked; + string UPDATER_SHIM = "NuUpdate Shim [AC]"; // VERSION NUMBER @@ -63,17 +85,6 @@ string BETA = "b"; string SESSION_UPDATE = "A"; -integer LINK_SIGNAL_GEN_CHANNEL = 0601241; -integer LINK_SIGNAL_CHANNEL_BACK = 0601242; -integer LINK_SIGNAL_SHOW_MENU = 0601243; -integer LINK_SIGNAL_MENU_TIMEOUT = 0601244; -integer LINK_SIGNAL_REREGISTER_MENUS= 0601245; -integer LINK_SIGNAL_QUERY_MENU = 0602241; -integer LINK_SIGNAL_REGISTER_MENU = 0602242; -integer LINK_SIGNAL_RESET = 0602243; -integer LINK_SIGNAL_MENU_DATA = 0602244; -integer LINK_SIGNAL_MENU_BACK = 0801241; -integer LINK_SIGNAL_REPLACE_BUTTON = 0804241; string PREVIOUS_MENU = "<--"; diff --git a/src/preproc/NuCore [AC].lsl b/src/preproc/NuCore [AC].lsl new file mode 100644 index 0000000..eab2e9a --- /dev/null +++ b/src/preproc/NuCore [AC].lsl @@ -0,0 +1,12 @@ +/* + +This file is a part of NuSystem (https://git.zontreck.com/AriasCreations/NuSystem) + +NuSystem is licensed under the GPL. +Please see the Git Source Tree for structured information on changes to indivudual files + +Initial Author: Aria (aria@zontreck.com) + +*/ + +#include "../raw/core.lsl" \ No newline at end of file diff --git a/src/preproc/Updater/NuShim [AC].lsl b/src/preproc/Updater/NuUpdate Shim [AC].lsl similarity index 100% rename from src/preproc/Updater/NuShim [AC].lsl rename to src/preproc/Updater/NuUpdate Shim [AC].lsl diff --git a/src/raw/core.lsl b/src/raw/core.lsl new file mode 100644 index 0000000..b162934 --- /dev/null +++ b/src/raw/core.lsl @@ -0,0 +1,46 @@ +#include "Variables.lsl" +#include "Functions.lsl" +#include "Version.lsl" +#include "../external/AriasCreations/Common.lsl" +#include "../external/AriasCreations/Helpers.lsl" + +default +{ + state_entry() + { + LM(LINK_SIGNAL_CALLBACKS, OP_CALLBACK_CHECK_STATUS, EMPTY_JSON); + } + + link_message(integer iSender, integer iNum, string sMsg, key kID) + { + // Check if callbacks system is ready + string sOp = llJsonGetValue(sMsg, ["op"]); + + if(iNum == LINK_SIGNAL_CALLBACKS) { + switch(sOp) { + case OP_CALLBACK_READY: { + // System is online and ready + llOwnerSay("/!\\ NuSystem is ready for use /!\\\n[ Version " + VERSION + " ]"); + break; + } + } + } else if(iNum == LINK_SIGNAL_SETTINGS) { + switch(sOp) { + case OP_SETTINGS_RESPONSE: { + string sKey = llJsonGetValue(sMsg, ["key"]); + string sVal = llJsonGetValue(sMsg, ["value"]); + list lTmp = llParseString2List(sKey, ["_"],[]); + string sNamespace = llList2String(lTmp,0); + sKey = llList2String(lTmp,1); + + if(sNamespace == "global") { + if(sKey == "locked") { + g_iLocked = (integer)sVal; + } + } + break; + } + } + } + } +} \ No newline at end of file