feat(core): begin to add the core script

Signed-off-by: zontreck <tarapiccari@gmail.com>
This commit is contained in:
zontreck 2024-10-05 12:15:34 -07:00
parent 77c1b3b3d8
commit e418d9d55f
4 changed files with 80 additions and 11 deletions

View file

@ -3,6 +3,26 @@ integer LINK_SIGNAL_REBOOT = 0904242;
integer LINK_SIGNAL_CALLBACKS = 0904243; integer LINK_SIGNAL_CALLBACKS = 0904243;
integer LINK_SIGNAL_UPDATE = 0905241; 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_WRITE = "1";
string OP_SETTINGS_READ = "2"; string OP_SETTINGS_READ = "2";
@ -45,6 +65,8 @@ integer g_iUpdateHasStarted;
key g_kSession; key g_kSession;
string g_sBOM; string g_sBOM;
integer g_iLocked;
string UPDATER_SHIM = "NuUpdate Shim [AC]"; string UPDATER_SHIM = "NuUpdate Shim [AC]";
// VERSION NUMBER // VERSION NUMBER
@ -63,17 +85,6 @@ string BETA = "b";
string SESSION_UPDATE = "A"; 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 = "<--"; string PREVIOUS_MENU = "<--";

View file

@ -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"

46
src/raw/core.lsl Normal file
View file

@ -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;
}
}
}
}
}