refactor: replace llOwnerSay with dbg function for consistent logging across engine and controller scripts

This commit is contained in:
RebeccaNod1 2026-04-09 02:07:40 -06:00
parent d0b11ef474
commit b40afb7bec
3 changed files with 22 additions and 23 deletions

View file

@ -616,7 +616,7 @@ default {
state_entry() { state_entry() {
REPORT_MEMORY(); REPORT_MEMORY();
llOwnerSay("FURWARE text is starting..."); dbg("FURWARE text is starting...");
CHARS = llBase64ToString( CHARS = llBase64ToString(
"IGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6QUJDREVGR0hJSktMTU5PUFFS" + "IGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6QUJDREVGR0hJSktMTU5PUFFS" +
@ -674,7 +674,7 @@ default {
// Abort if not a single element was found. // Abort if not a single element was found.
if (!dataLength) { if (!dataLength) {
llOwnerSay("FW text: No text 2.x prims found."); dbg("FW text: No text 2.x prims found.");
return; return;
} }
@ -710,7 +710,7 @@ default {
if (faceCount) { if (faceCount) {
if (newFaceCount != faceCount) { if (newFaceCount != faceCount) {
llOwnerSay("FW text: All prims within a set need to have the same number of faces."); dbg("FW text: All prims within a set need to have the same number of faces.");
setCount = 0; setCount = 0;
return; return;
} }
@ -731,7 +731,7 @@ default {
if (colCount) { if (colCount) {
if (newColCount != colCount) { if (newColCount != colCount) {
llOwnerSay("FW text: All rows within a set need to have the same number of prims."); dbg("FW text: All rows within a set need to have the same number of prims.");
setCount = 0; setCount = 0;
return; return;
} }
@ -794,7 +794,7 @@ default {
first = llListFindList(boxNameList, [boxToken0]); first = llListFindList(boxNameList, [boxToken0]);
if (!~first) { if (!~first) {
llOwnerSay(token0 + ": Box \"" + boxToken0 + "\" not found."); dbg(token0 + ": Box \"" + boxToken0 + "\" not found.");
jump SkipBox; jump SkipBox;
} }
@ -806,7 +806,7 @@ default {
last = llListFindList(boxNameList, [boxToken1]); last = llListFindList(boxNameList, [boxToken1]);
if (!~last) { if (!~last) {
llOwnerSay(token0 + ": Box \"" + boxToken1 + "\" not found."); dbg(token0 + ": Box \"" + boxToken1 + "\" not found.");
jump SkipBox; jump SkipBox;
} }
@ -814,7 +814,7 @@ default {
integer secondSetIndex = (llList2Integer(boxDataList, last + BOX_STATUS) >> 4) & 0xFF; integer secondSetIndex = (llList2Integer(boxDataList, last + BOX_STATUS) >> 4) & 0xFF;
if (~setIndex && setIndex != secondSetIndex) { if (~setIndex && setIndex != secondSetIndex) {
llOwnerSay(token0 + ": Box sets must match when specifying a range."); dbg(token0 + ": Box Sets must match when specifying a range.");
jump SkipBox; jump SkipBox;
} }
@ -837,7 +837,7 @@ default {
if (lastAction && lastAction != ACTION_CONTENT) refresh(); if (lastAction && lastAction != ACTION_CONTENT) refresh();
if (token1 == "") { if (token1 == "") {
llOwnerSay("fw_var: No variable name given."); dbg("fw_var: No variable name given.");
return; return;
} }
@ -888,7 +888,7 @@ default {
if (token0 == "fw_addbox") { if (token0 == "fw_addbox") {
if (token1 == "") { if (token1 == "") {
llOwnerSay("fw_addbox: Box name cannot be empty."); dbg("fw_addbox: Box name cannot be empty.");
return; return;
} }
@ -897,14 +897,14 @@ default {
integer boxNameIndex = llListFindList(boxNameList, [token1]); integer boxNameIndex = llListFindList(boxNameList, [token1]);
if (~boxNameIndex) { if (~boxNameIndex) {
llOwnerSay("fw_addbox: Box \"" + token1 + "\" already exists."); dbg("fw_addbox: Box \"" + token1 + "\" already exists.");
return; return;
} }
integer parNameIndex = llListFindList(boxNameList, [token2]); integer parNameIndex = llListFindList(boxNameList, [token2]);
if (!~parNameIndex) { if (!~parNameIndex) {
llOwnerSay("fw_addbox: No parent box \"" + token2 + "\"."); dbg("fw_addbox: No parent box \"" + token2 + "\".");
return; return;
} }
@ -922,7 +922,7 @@ default {
} }
if (layersUsed == 0xFFFF) { if (layersUsed == 0xFFFF) {
llOwnerSay("fw_addbox: No layer available."); dbg("fw_addbox: No layer available.");
return; return;
} }
@ -941,7 +941,7 @@ default {
(boxGeom.x + boxGeom.z) > (setGeom.x * setGeom.z) || (boxGeom.x + boxGeom.z) > (setGeom.x * setGeom.z) ||
(boxGeom.y + boxGeom.s) > setGeom.y) (boxGeom.y + boxGeom.s) > setGeom.y)
{ {
llOwnerSay("fw_addbox: Invalid box geometry."); dbg("fw_addbox: Invalid box geometry.");
return; return;
} }
@ -965,7 +965,7 @@ default {
integer boxNameIndex = llListFindList(boxNameList, [boxName]); integer boxNameIndex = llListFindList(boxNameList, [boxName]);
if (!~boxNameIndex || (boxNameIndex < setCount)) { if (!~boxNameIndex || (boxNameIndex < setCount)) {
llOwnerSay("fw_delbox: Box \"" + boxName + "\" doesn't exist."); dbg("fw_delbox: Box \"" + boxName + "\" doesn't exist.");
jump SkipDelBox; jump SkipDelBox;
} }

View file

@ -38,7 +38,7 @@ reportMemoryUsage(string scriptName) {
integer total = used + free; integer total = used + free;
float percentUsed = ((float)used / (float)total) * 100.0; float percentUsed = ((float)used / (float)total) * 100.0;
llOwnerSay("🧠 [" + scriptName + "] Memory: " + dbg("🧠 [" + scriptName + "] Memory: " +
(string)used + " used, " + (string)used + " used, " +
(string)free + " free (" + (string)free + " free (" +
llGetSubString((string)percentUsed, 0, 4) + "% used)"); llGetSubString((string)percentUsed, 0, 4) + "% used)");
@ -820,7 +820,7 @@ default {
return; return;
} }
llMessageLinked(LINK_SET, MSG_RESET_LEADERBOARD, "WIPE", id); // Use LINK_SET llMessageLinked(LINK_SET, MSG_RESET_LEADERBOARD, "WIPE", id); // Use LINK_SET
llOwnerSay("🏆 GLOBAL LEADERBOARD WIPE confirmed and executed."); dbg("🏆 GLOBAL LEADERBOARD WIPE confirmed and executed.");
return; return;
} }
if (msg == "Reset All") { if (msg == "Reset All") {
@ -834,7 +834,7 @@ default {
} }
resetGame(); resetGame();
llMessageLinked(LINK_SET, MSG_RESET_LEADERBOARD, "WIPE", id); // Use LINK_SET llMessageLinked(LINK_SET, MSG_RESET_LEADERBOARD, "WIPE", id); // Use LINK_SET
llOwnerSay("🔄 FULL RESET confirmed and executed."); dbg("🔄 FULL RESET confirmed and executed.");
return; return;
} }
if (msg == "Memory Stats") { if (msg == "Memory Stats") {

View file

@ -146,12 +146,11 @@ key EXPERIENCE_ID = "06926390-26e6-11f1-a452-0242ac110003"; // Final Girlz I.N.C
#define SHOW_MEMORY 0 // Toggle this to 1 to see memory usage on rez/reset #define SHOW_MEMORY 0 // Toggle this to 1 to see memory usage on rez/reset
#define REPORT_MEMORY() { \ #define REPORT_MEMORY() { \
if (SHOW_MEMORY) { \
integer used = llGetUsedMemory(); \ integer used = llGetUsedMemory(); \
integer free = llGetFreeMemory(); \ integer free = llGetFreeMemory(); \
float percent = ((float)used / (float)(used + free)) * 100.0; \ integer total = used + free; \
llOwnerSay("🧠 [" + llGetScriptName() + "] Memory: " + (string)used + " used, " + (string)free + " free (" + llGetSubString((string)percent, 0, 4) + "% used)."); \ float percent = ((float)used / (float)total) * 100.0; \
} \ dbg("🧠 [" + llGetScriptName() + "] Memory: " + (string)used + " used, " + (string)free + " free (" + llGetSubString((string)percent, 0, 4) + "% used)."); \
} }
#define MSG_MEMORY_CHECK 6001 #define MSG_MEMORY_CHECK 6001