EMERGENCY FIX: Remove dangerous script deletion

- Remove llRemoveInventory() calls that delete user scripts
- Switch to safe mode: only ADD new scripts, never delete
- User can manually copy content from new auto-generated scripts
- Prevents data loss from failed automatic replacement
This commit is contained in:
RebeccaNod1 2025-10-02 13:08:33 -05:00
parent 79040c66f3
commit 066680bc55
2 changed files with 8 additions and 23 deletions

View file

@ -130,26 +130,21 @@ downloadNextScript() {
currentHttpRequest = llHTTPRequest(url, [HTTP_METHOD, "GET"], "");
}
// Install downloaded script - commercial updater approach
// EMERGENCY SAFE MODE - Only add new scripts, don't delete anything
installScript(string scriptContent, string scriptName, integer linkNumber) {
llOwnerSay("📥 Installing " + scriptName + " (" + (string)llStringLength(scriptContent) + " chars)");
llOwnerSay("🎯 Target: " + (string)targetGameKey + " | PIN: " + (string)updatePin);
llOwnerSay("🆘 SAFE MODE: Adding " + scriptName + " as new script");
llOwnerSay("📊 Size: " + (string)llStringLength(scriptContent) + " characters");
// Step 1: Tell target to remove old script (if it exists)
llRegionSayTo(targetGameKey, UPDATER_CHANNEL, "REMOVE_SCRIPT|" + scriptName);
// Step 2: Install new script content with llRemoteLoadScriptPin
// The script will be created with an auto-generated name like "New Script"
// Only create new script - DO NOT DELETE ANYTHING
// This creates a script with auto-generated name containing the new content
llRemoteLoadScriptPin(targetGameKey, scriptContent, updatePin, TRUE, 0);
// Step 3: Tell target to rename the new script to correct name
llRegionSayTo(targetGameKey, UPDATER_CHANNEL, "RENAME_SCRIPT|" + scriptName);
llOwnerSay("✅ Sent " + scriptName + " to target game");
llOwnerSay("✅ Added new script with updated content");
llOwnerSay("📝 You can now copy content from the new script to replace your old " + scriptName);
// Move to next script
currentScriptIndex++;
llSetTimerEvent(3.0); // Longer pause for script processing
llSetTimerEvent(2.0);
}
// Complete the update process

View file

@ -299,16 +299,6 @@ default {
else if (command == "UPDATE_BUSY") {
llOwnerSay("⏳ Updater is busy with another installation");
}
else if (command == "REMOVE_SCRIPT") {
string scriptToRemove = llList2String(parts, 1);
llOwnerSay("🗑️ Removing old script: " + scriptToRemove);
llRemoveInventory(scriptToRemove);
}
else if (command == "RENAME_SCRIPT") {
string targetName = llList2String(parts, 1);
llOwnerSay("🏷️ Looking for new script to rename to: " + targetName);
// Note: LSL doesn't have direct script renaming, this is for future enhancement
}
}
}