From 56f493e6b19368ffc7e21415f57bfba448f3d3ec Mon Sep 17 00:00:00 2001 From: zontreck Date: Sat, 23 Jan 2021 19:45:16 -0700 Subject: [PATCH] New Version! 8.0 --- src/Apps/oc_outfits.RLV.lsl | 554 ------------------ src/Apps/oc_outfits.lsl | 4 +- src/ao/oc_ao.lsl | 13 +- src/collar/oc_core.lsl | 2 +- src/installer/BUNDLE_00-Core_REQUIRED | 9 +- src/installer/BUNDLE_10-Children_REQUIRED | 1 - src/installer/BUNDLE_20-Anims_REQUIRED | 3 +- .../BUNDLE_30-Other-Features_REQUIRED | 3 +- src/installer/BUNDLE_40-Apps_OPTIONAL | 8 +- src/installer/BUNDLE_99_DEPRECATED | 3 +- src/installer/oc_installer_bundles.lsl | 55 +- src/installer/oc_installer_sys.lsl | 2 +- src/installer/oc_update_shim.lsl | 5 +- src/remote/oc_remote.lsl | 52 ++ web/ao.txt | 1 + web/dev_version.txt | 2 +- web/remote.txt | 2 +- web/version.txt | 2 +- web/~ao | 1 - 19 files changed, 144 insertions(+), 578 deletions(-) delete mode 100644 src/Apps/oc_outfits.RLV.lsl create mode 100644 web/ao.txt delete mode 100644 web/~ao diff --git a/src/Apps/oc_outfits.RLV.lsl b/src/Apps/oc_outfits.RLV.lsl deleted file mode 100644 index 87494d1c8..000000000 --- a/src/Apps/oc_outfits.RLV.lsl +++ /dev/null @@ -1,554 +0,0 @@ -/* -oc_outfits.RLV -This file is a part of OpenCollar. -Copyright ©2020 - -: Contributors : - -Aria (Tashia Redrose) - * Dec 2019 - Rewrote Capture & Reset Script Version to 1.0 - * Jan 2020 - Added BrowseCore, and added in chat commands for Outfits - * Apr 2020 - Added chat commands, and a link message API to wear/remove - * Dec 2020 - Fix up change commands to be more obvious - * Jan 2021 - Fix browse core to have a remove button -Felkami (Caraway Ohmai) - * Jan 2021 - #461, Made menu call case insensitive -Lillith (Lillith Xue) - * Dec 2019 - Fixed bug: Outfits not working for non-wearer as menu user due to listen typo - -et al. - - -Licensed under the GPLv2. See LICENSE for full details. -https://github.com/OpenCollarTeam/OpenCollar -*/ - - -string g_sParentMenu = "Apps"; -string g_sSubMenu = "Outfits"; -string g_sAppVersion = "1.6"; -//string g_sScriptVersion = "8.0"; - - -//MESSAGE MAP -//integer CMD_ZERO = 0; -integer CMD_OWNER = 500; -integer CMD_TRUSTED = 501; -integer CMD_GROUP = 502; -integer CMD_WEARER = 503; -integer CMD_EVERYONE = 504; -//integer CMD_RLV_RELAY = 507; -//integer CMD_SAFEWORD = 510; -//integer CMD_RELAY_SAFEWORD = 511; - -integer NOTIFY = 1002; -string g_sLastOutfit; -integer REBOOT = -1000; - -integer LM_SETTING_SAVE = 2000;//scripts send messages on this channel to have settings saved -//str must be in form of "token=value" -integer LM_SETTING_REQUEST = 2001;//when startup, scripts send requests for settings on this channel -integer LM_SETTING_RESPONSE = 2002;//the settings script sends responses on this channel -integer LM_SETTING_DELETE = 2003;//delete token from settings -//integer LM_SETTING_EMPTY = 2004;//sent when a token has no value - -integer MENUNAME_REQUEST = 3000; -integer MENUNAME_RESPONSE = 3001; -//integer MENUNAME_REMOVE = 3003; - -integer OUTFITS_ADD = -999901; -integer OUTFITS_REM = -999902; - -//integer RLV_CMD = 6000; -//integer RLV_REFRESH = 6001;//RLV plugins should reinstate their restrictions upon receiving this message. - -//integer RLV_OFF = 6100; // send to inform plugins that RLV is disabled now, no message or key needed -//integer RLV_ON = 6101; // send to inform plugins that RLV is enabled now, no message or key needed - -integer DIALOG = -9000; -integer DIALOG_RESPONSE = -9001; -integer DIALOG_TIMEOUT = -9002; -string UPMENU = "BACK"; -//string ALL = "ALL"; - -integer bool(integer a){ - if(a)return TRUE; - else return FALSE; -} -list g_lCheckboxes=["▢", "▣"]; -string TickBox(integer iValue, string sLabel) { - return llList2String(g_lCheckboxes, bool(iValue))+" "+sLabel; -} - -integer g_iLockCore = FALSE; -Dialog(key kID, string sPrompt, list lChoices, list lUtilityButtons, integer iPage, integer iAuth, string sName) { - key kMenuID = llGenerateKey(); - - llMessageLinked(LINK_SET, DIALOG, (string)kID + "|" + sPrompt + "|" + (string)iPage + "|" + llDumpList2String(lChoices, "`") + "|" + llDumpList2String(lUtilityButtons, "`") + "|" + (string)iAuth, kMenuID); - - integer iIndex = llListFindList(g_lMenuIDs, [kID]); - if (~iIndex) g_lMenuIDs = llListReplaceList(g_lMenuIDs, [kID, kMenuID, sName], iIndex, iIndex + g_iMenuStride - 1); - else g_lMenuIDs += [kID, kMenuID, sName]; -} - -Menu(key kID, integer iAuth) { - string sPrompt = "\n[Outfits App "+g_sAppVersion+"]\n\nChat Commands: \n-> wear \n-> naked"; - list lButtons = [TickBox(g_iLockCore, "Lock Core"), "◌ Configure", "Browse", "BrowseCore", "Help" ]; - Dialog(kID, sPrompt, lButtons, [UPMENU], 0, iAuth, "Menu~Main"); -} -string TrueOrFalse(integer iCheck){ - if(iCheck)return "True"; - else return "False"; -} -integer Bool(integer iNumber){ // for one liners that need the integer to be a boolean - if(iNumber)return TRUE; - else return FALSE; -} - -string g_sPath; -integer g_iListenHandle; // Will be unset if no actions for 30 seconds -integer g_iListenChannel; // Will also be unset if no actions for 30 seconds -integer g_iListenTimeout; -key g_kListenTo; -integer g_iListenToAuth; - -DoBrowserPath(list Options, key kListenTo, integer iAuth){ - string sAppend; - list lAppend = []; - if(llSubStringIndex(g_sPath, ".core")!=-1){ - sAppend="\n\n* You are browsing core! This will change which items in your core folder are actively worn. This will work similarly to #Folders, to remove other core items, you will need to go to that folder and select >RemoveAll<, it will not be automatic here!"; - lAppend = [">REMOVE<"]; - } - Dialog(kListenTo, "[Outfit Browser]\n \nLast outfit worn: "+g_sLastOutfit+"\n \n* You are currently browsing: "+g_sPath+"\n \n*Note: >Wear< will wear the current outfit, removing any other worn outfit, Naked will remove all worn outfits. Aside from core", Options, [">Wear<", ">Naked<", UPMENU, "^"]+lAppend, 0, iAuth, "Browser"); -} - - -TickBrowser(){ - g_iListenTimeout = llGetUnixTime()+90; -} -integer TimedOut(){ - if(llGetUnixTime()>g_iListenTimeout)return TRUE; - else return FALSE; -} - -FolderBrowser (key kID, integer iAuth){ - g_sPath = "outfits"; - g_kListenTo = kID; - g_iListenToAuth=iAuth; - g_iListenChannel = llRound(llFrand(99999999)); - if(g_iListenHandle>0)llListenRemove(g_iListenHandle); - g_iListenHandle = llListen(g_iListenChannel, "", g_kWearer, ""); - TickBrowser(); - - llOwnerSay("@getinv:"+g_sPath+"="+(string)g_iListenChannel); - llSetTimerEvent(1); -} - -CoreBrowser(key kID, integer iAuth){ - g_sPath = "outfits/core"; - g_kListenTo = kID; - g_iListenToAuth = iAuth; - g_iListenChannel = llRound(llFrand(9999999)); - if(g_iListenHandle>0) llListenRemove(g_iListenHandle); - g_iListenHandle = llListen(g_iListenChannel, "", g_kWearer, ""); - TickBrowser(); - - llOwnerSay("@getinv:"+g_sPath+"="+(string)g_iListenChannel); - llSetTimerEvent(1); -} - -ConfigMenu(key kID, integer iAuth){ - integer iTrusted = Bool((g_iAccessBitSet&1)); - integer iPublic = Bool((g_iAccessBitSet&2)); - integer iGroup = Bool((g_iAccessBitSet&4)); - integer iWearer = Bool((g_iAccessBitSet&8)); - integer iJail = Bool((g_iAccessBitSet&16)); - integer iStripAll = Bool((g_iAccessBitSet&32)); - string sTrusted = TrueOrFalse(iTrusted); - string sPublic = TrueOrFalse(iPublic); - string sGroup = TrueOrFalse(iGroup); - string sWearer = TrueOrFalse(iWearer); - string sJail = TrueOrFalse(iJail); - string sStripAll = TrueOrFalse(iStripAll); - - Dialog(kID, "\n[Outfits App "+g_sAppVersion+"]\n \nConfigure Access\n * Owner: ALWAYS\n * Trusted: "+sTrusted+"\n * Public: "+sPublic+"\n * Group: "+sGroup+"\n * Wearer: "+sWearer+"\n * Jail: "+sJail+"\n * Strip All (even not in .outfits): "+sStripAll+"\n \n** WARNING: If you disable the jail, then outfits WILL be able to browse your entire #RLV folder, not just under #RLV/outfits", [TickBox(iTrusted, "Trusted"), TickBox(iPublic, "Public") ,TickBox(iGroup, "Group"), TickBox(iWearer, "Wearer"), TickBox(iJail, "Jail"), TickBox(iStripAll, "Strip All")], [UPMENU], 0, iAuth, "Menu~Configure"); -} - - -/* Guard method. Tests if the user is authorized - - Return: - FALSE == Allow access - 1 == Deny - 2 == Deny and notify -*/ -integer AuthDenied(integer iNum) { - integer deny = FALSE; - - if(iNum == 599) deny = 1;//No Access - // Verify access rights now - if(iNum > CMD_EVERYONE) deny = 1; - if(iNum == CMD_TRUSTED && !Bool((g_iAccessBitSet&1))) deny = 2; - if(iNum == CMD_EVERYONE && !Bool((g_iAccessBitSet&2))) deny = 2; - if(iNum == CMD_GROUP && !Bool((g_iAccessBitSet&4))) deny = 2; - if(iNum == CMD_WEARER && !Bool((g_iAccessBitSet&8))) deny = 2; - if (iNumCMD_EVERYONE) deny = 1; - - return deny; -} - -UserCommand(integer iNum, string sStr, key kID) { - - integer deny = AuthDenied(iNum); - if(deny == 2) { - //We have to validate against known commands for Outfits, or else we'll pop denied errors every time a public user sneezes - string sChangetype = llToLower(llList2String(llParseString2List(sStr, [" "], []),0)); - - if(sStr==g_sSubMenu || llToLower(sStr) == "menu "+ llToLower(g_sSubMenu) || sChangetype == "wear" || sChangetype == "naked") - llMessageLinked(LINK_SET,NOTIFY, "0%NOACCESS% to outifts", kID); - } - if(deny) return; - - //if (llSubStringIndex(sStr,llToLower(g_sSubMenu)) && sStr != "menu "+g_sSubMenu) return; - if (iNum == CMD_OWNER && sStr == "runaway") { - g_lOwner = g_lTrust = g_lBlock = []; - return; - } - if (sStr==g_sSubMenu || llToLower(sStr) == "menu "+ llToLower(g_sSubMenu)) Menu(kID, iNum); - //else if (iNum!=CMD_OWNER && iNum!=CMD_TRUSTED && kID!=g_kWearer) RelayNotify(kID,"Access denied!",0); - else { - //integer iWSuccess = 0; - list Params=llParseString2List(sStr, [" "], []); - - string sChangetype = llToLower(llList2String(Params,0)); - string sChangevalue = llDumpList2String(llList2List(Params,1,-1)," "); - //string sText; - - if(sChangetype == "wear" || sChangetype == "naked"){ - if(g_sPath!=sChangevalue){ - g_sPath="outfits/"+sChangevalue; - g_iListenTimeout=0; - } - - if(!g_iLocked){ - llOwnerSay("@detach=n"); - } - - ForceLockCore(); - TickBrowser(); - llSetTimerEvent(1); - if(!Bool((g_iAccessBitSet&32))){ - if(llSubStringIndex(g_sPath, "core")==-1) - llOwnerSay("@detachall:outfits=force"); - } - else{ - llOwnerSay("@detach=force"); - llOwnerSay("@remoutfit=force"); - } - llSleep(2); // incase of lag - if (g_sPath == "outfits/" || g_sPath == "outfits/core") g_sLastOutfit = "NONE"; - else g_sLastOutfit=g_sPath; - - RmCorelock(); - llSleep(1); - } - if(sChangetype == "wear"){ //This looks like dead code TODO: Verify for removal? - if (g_sPath != "" && g_sPath != ".") llOwnerSay("@attachallover:"+g_sPath+"=force"); - } - } -} - -key g_kWearer; -list g_lMenuIDs; -integer g_iMenuStride; -list g_lOwner; -list g_lTrust; -list g_lBlock; -integer g_iLocked=FALSE; -integer g_iAccessBitSet=25; // Default modes for outfits -integer g_iJail; -Commit(){ - if(g_iLockCore) - llMessageLinked(LINK_SET, LM_SETTING_SAVE, "outfits_lockcore="+(string)g_iLockCore, ""); - else - llMessageLinked(LINK_SET, LM_SETTING_DELETE, "outfits_lockcore",""); - - if(g_iAccessBitSet>0) - llMessageLinked(LINK_SET, LM_SETTING_SAVE, "outfits_accessflags="+(string)g_iAccessBitSet,""); - else llMessageLinked(LINK_SET, LM_SETTING_DELETE, "outfits_accessflags", ""); - - - Process(); -} - -Process(){ - g_iJail = Bool((g_iAccessBitSet&16)); - if(g_iLockCore){ - llOwnerSay("@detachallthis:outfits/core=n"); - } - else{ - llOwnerSay("@detachallthis:outfits/core=y"); - } -} - -ForceLockCore(){ - llOwnerSay("@detachallthis:outfits/core=y"); - llSleep(1); - llOwnerSay("@detachallthis:outfits/core=n"); - llSleep(0.5); -} - -RmCorelock(){ - llOwnerSay("@detachallthis:outfits/core=y"); -} - -integer ALIVE = -55; -integer READY = -56; -integer STARTUP = -57; -default -{ - on_rez(integer iNum){ - llResetScript(); - } - state_entry(){ - llMessageLinked(LINK_SET, ALIVE, llGetScriptName(),""); - llListen(999988, "", llGetOwner(), ""); - llOwnerSay("@version=999988"); - } - listen(integer iChan, string sName, key kID, string sMsg) - { - if(llSubStringIndex(sMsg, "RLVa")!=-1){ - llOwnerSay("You are using RLVa. The RLV variant of the outfit app is now uninstalled"); - llRemoveInventory(llGetScriptName()); - } - } - link_message(integer iSender, integer iNum, string sStr, key kID){ - if(iNum == REBOOT){ - if(sStr == "reboot"){ - llResetScript(); - } - } else if(iNum == READY){ - llMessageLinked(LINK_SET, ALIVE, llGetScriptName(), ""); - } else if(iNum == STARTUP){ - state active; - } - } -} -state active -{ - on_rez(integer t){ - llResetScript(); - } - state_entry() - { - if(llGetStartParameter()!=0)llResetScript(); - g_kWearer = llGetOwner(); - llMessageLinked(LINK_SET, LM_SETTING_REQUEST, "global_locked",""); - } - link_message(integer iSender,integer iNum,string sStr,key kID){ - if(iNum >= CMD_OWNER && iNum <= CMD_EVERYONE) UserCommand(iNum, sStr, kID); - else if(iNum == MENUNAME_REQUEST && sStr == g_sParentMenu) - llMessageLinked(iSender, MENUNAME_RESPONSE, g_sParentMenu+"|"+ g_sSubMenu,""); - else if(iNum == -99999){ - if(sStr=="update_active")llResetScript(); - - }else if (iNum == DIALOG_TIMEOUT) { - integer iMenuIndex = llListFindList(g_lMenuIDs, [kID]); - g_lMenuIDs = llDeleteSubList(g_lMenuIDs, iMenuIndex - 1, iMenuIndex +3); //remove stride from g_lMenuIDs - } - else if(iNum == DIALOG_RESPONSE){ - - list lMenuParams = llParseString2List(sStr, ["|"],[]); - integer iAuth = llList2Integer(lMenuParams,3); - - if(AuthDenied(iAuth)) { - //Test to see if this is a denied auth. If we're here and its denied, we respring. A CMD_* call is already sent out which will produce the NOTIFY - if(llSubStringIndex(sStr, g_sSubMenu) != -1) - llMessageLinked(LINK_SET, iAuth, "menu "+g_sParentMenu, llGetSubString(sStr, 0, 35)); - } - - integer iMenuIndex = llListFindList(g_lMenuIDs, [kID]); - if(iMenuIndex!=-1){ - string sMenu = llList2String(g_lMenuIDs, iMenuIndex+1); - g_lMenuIDs = llDeleteSubList(g_lMenuIDs, iMenuIndex-1, iMenuIndex-2+g_iMenuStride); - //list lMenuParams = llParseString2List(sStr, ["|"],[]); - key kAv = llList2Key(lMenuParams,0); - string sMsg = llList2String(lMenuParams,1); - //integer iAuth = llList2Integer(lMenuParams,3); - - integer iRespring=TRUE; - - //llSay(0, sMenu); - if(sMenu == "Menu~Main"){ - if(sMsg == UPMENU) { - iRespring=FALSE; - llMessageLinked(LINK_SET, iAuth, "menu "+g_sParentMenu, kAv); - } - else if(sMsg == TickBox(g_iLockCore, "Lock Core")){ - g_iLockCore=1-g_iLockCore; - llSetTimerEvent(120); - Commit(); - }else if(sMsg == "◌ Configure"){ - // Open the config menu to set access rights - if(iAuth == CMD_OWNER){ - iRespring=FALSE; - ConfigMenu(kAv, iAuth); - }else{ - llMessageLinked(LINK_SET, NOTIFY, "0%NOACCESS% to configuration settings", kAv); - } - - } else if(sMsg == "Browse"){ - FolderBrowser(kAv,iAuth); - iRespring=FALSE; - } else if(sMsg == "BrowseCore"){ - CoreBrowser(kAv, iAuth); - iRespring=FALSE; - } else if(sMsg == "Help"){ - llMessageLinked(LINK_SET,NOTIFY, "0 \n \n[Outfits Help]\n* This is the typical structure of a Outfits folder: \n#RLV\n-> outfits\n---> core\n-> My Outfit\n \nAnything placed in .core will never be removed during a outfit change using this script. If you enable 'Lock Core' then your core folder will stay locked for any changes made outside of this script, (for example: your relay)", kAv); - } - if(iRespring)Menu(kAv,iAuth); - } else if(sMenu == "Menu~Configure"){ - if(sMsg == UPMENU){ - iRespring=FALSE; - Menu(kAv, iAuth); - }else{ - // Check mode first - list ButtonFlags = llParseString2List(sMsg,[" "],[]); - string ButtonLabel = llDumpList2String(llList2List(ButtonFlags,1,-1), " "); - integer Enabled = llListFindList(g_lCheckboxes, [llList2String(ButtonFlags,0)]); - - if(Enabled){ - // Disable flag - if(ButtonLabel == "Trusted")g_iAccessBitSet -=1; - else if(ButtonLabel == "Public")g_iAccessBitSet-=2; - else if(ButtonLabel == "Group")g_iAccessBitSet-=4; - else if(ButtonLabel == "Wearer")g_iAccessBitSet-=8; - else if(ButtonLabel == "Jail")g_iAccessBitSet-=16; - else if(ButtonLabel == "Strip All")g_iAccessBitSet -= 32; - }else{ - if(ButtonLabel == "Trusted")g_iAccessBitSet+=1; - else if(ButtonLabel == "Public")g_iAccessBitSet+=2; - else if(ButtonLabel == "Group")g_iAccessBitSet+=4; - else if(ButtonLabel == "Wearer") g_iAccessBitSet+=8; - else if(ButtonLabel == "Jail")g_iAccessBitSet+=16; - else if(ButtonLabel == "Strip All")g_iAccessBitSet+=32; - } - - - Commit(); - } - if(iRespring)ConfigMenu(kAv,iAuth); - } else if(sMenu == "Browser"){ - // Process commands! - - ForceLockCore(); // unlocks/relocks - compatible with the Lock Core option. - // The above is a workaround for a viewer bug where any newly added items to .core will not be protected. - if(!g_iLocked){ - llOwnerSay("@detach=n"); - } - - if(sMsg == UPMENU){ - iRespring=FALSE; - Menu(kAv, iAuth); - g_iListenTimeout=0; - return; - } else if(sMsg == ">Wear<"){ - // add recursive. Adds subfolder contents too - UserCommand(iAuth, "wear "+g_sPath, kAv); - } else if(sMsg == ">Naked<"){ - UserCommand(iAuth, "naked", kAv); - } else if(sMsg == ">REMOVE<"){ - llOwnerSay("@detachallthis:outfits/core=y"); - llSleep(1); - llOwnerSay("@detachall:"+g_sPath+"=force"); - ForceLockCore(); - } else if(sMsg == "^"){ - // go up a path - list edit = llParseString2List(g_sPath,["/"],[]); - string sEdit = llDumpList2String(llDeleteSubList(edit,-1,-1), "/"); - if(llGetSubString(sEdit,-1,-1)=="/")sEdit = llGetSubString(sEdit,0,-2); - g_sPath=sEdit; - iRespring=FALSE; - if(g_iJail && g_sPath == "")g_sPath = "outfits"; - llOwnerSay("@getinv:"+g_sPath+"="+(string)g_iListenChannel); - } else { - g_sPath+="/"+sMsg; - iRespring=FALSE; - // attempt to enter folder: if empty will only display utility buttons. Which will still give the ability to add a folder - llOwnerSay("@getinv:"+g_sPath+"="+(string)g_iListenChannel); - } - TickBrowser(); - if(iRespring)llOwnerSay("@getinv:"+g_sPath+"="+(string)g_iListenChannel); - } - } - } else if(iNum == OUTFITS_ADD){ - UserCommand(CMD_OWNER, "wear "+sStr, kID); - } else if(iNum == OUTFITS_REM){ - UserCommand(CMD_OWNER, "naked", kID); - } else if(iNum == LM_SETTING_RESPONSE){ - // Detect here the Settings - list lSettings = llParseString2List(sStr, ["_","="],[]); - if(llList2String(lSettings,0)=="global"){ - if(llList2String(lSettings,1)=="locked"){ - g_iLocked=llList2Integer(lSettings,2); - } else if(llList2String(lSettings,1) == "checkboxes"){ - g_lCheckboxes = llCSV2List(llList2String(lSettings,2)); - } - } else if(llList2String(lSettings,0) == "outfits"){ - if(llList2String(lSettings,1) == "lockcore"){ - g_iLockCore=llList2Integer(lSettings,2); - } else if(llList2String(lSettings,1) == "accessflags"){ - //llSay(0, "ACCESS FLAGS: "+llList2String(lSettings,2)); - g_iAccessBitSet=llList2Integer(lSettings,2); - } - Process(); - } - } else if(iNum == LM_SETTING_DELETE){ - // This is recieved back from settings when a setting is deleted - list lSettings = llParseString2List(sStr, ["_"],[]); - if(llList2String(lSettings,0)=="global") - if(llList2String(lSettings,1) == "locked") g_iLocked=FALSE; - } else if(iNum == REBOOT)llResetScript(); - } - - timer(){ - if(TimedOut() && g_iListenTimeout!=-1){ - llSetTimerEvent(0); - if(g_iListenTimeout!=0) - llMessageLinked(LINK_SET,NOTIFY, "0Timed out.", g_kListenTo); - g_kListenTo=""; - llListenRemove(g_iListenHandle); - if(!g_iLocked)llOwnerSay("@detach=y"); - g_iListenHandle=0; - g_iListenChannel=0; - g_iListenTimeout=-1; - g_iListenToAuth=0; - if(!g_iLockCore)llOwnerSay("@detachallthis:outfits/core=y"); - - g_sPath = "outfits"; - if(g_iLockCore)llSetTimerEvent(120); - return; - } - - if(g_iListenTimeout==-1){ - if(g_iLockCore){ - ForceLockCore(); - }else { - llSetTimerEvent(0); - } - } - } - - listen(integer iChannel, string sName, key kID, string sMsg){ - TickBrowser(); - if(iChannel == g_iListenChannel){ - // Viewer reply! - // Delimiters : , - list Options = llParseString2List(sMsg,[","],[]); - DoBrowserPath(llListSort(Options,0,TRUE), g_kListenTo, g_iListenToAuth); - - } - - } - -} diff --git a/src/Apps/oc_outfits.lsl b/src/Apps/oc_outfits.lsl index 17fc58646..b725cfd00 100644 --- a/src/Apps/oc_outfits.lsl +++ b/src/Apps/oc_outfits.lsl @@ -204,7 +204,7 @@ UserCommand(integer iNum, string sStr, key kID) { //We have to validate against known commands for Outfits, or else we'll pop denied errors every time a public user sneezes string sChangetype = llToLower(llList2String(llParseString2List(sStr, [" "], []),0)); - if(sStr==g_sSubMenu || llToLower(sStr) == "menu "+ llToLower(g_sSubMenu) || sChangetype == "wear" || sChangetype == "naked") + if(llToLower(sStr)==llToLower(g_sSubMenu) || llToLower(sStr) == "menu "+ llToLower(g_sSubMenu) || sChangetype == "wear" || sChangetype == "naked") llMessageLinked(LINK_SET,NOTIFY, "0%NOACCESS% to outifts", kID); } if(deny) return; @@ -214,7 +214,7 @@ UserCommand(integer iNum, string sStr, key kID) { g_lOwner = g_lTrust = g_lBlock = []; return; } - if (sStr==g_sSubMenu || llToLower(sStr) == "menu "+ llToLower(g_sSubMenu)) Menu(kID, iNum); + if (llToLower(sStr)==llToLower(g_sSubMenu) || llToLower(sStr) == "menu "+ llToLower(g_sSubMenu)) Menu(kID, iNum); //else if (iNum!=CMD_OWNER && iNum!=CMD_TRUSTED && kID!=g_kWearer) RelayNotify(kID,"Access denied!",0); else { //integer iWSuccess = 0; diff --git a/src/ao/oc_ao.lsl b/src/ao/oc_ao.lsl index e8b821ba9..e4fd1e664 100644 --- a/src/ao/oc_ao.lsl +++ b/src/ao/oc_ao.lsl @@ -5,7 +5,7 @@ string g_sDevStage = "dev1"; -string g_sVersion = "2.0"; +string g_sVersion = "2.1"; integer g_iUpdateAvailable; key g_kWebLookup; @@ -505,12 +505,13 @@ PermsCheck() { } } - +integer API_CHANNEL; default { state_entry() { if (llGetInventoryType("oc_installer_sys")==INVENTORY_SCRIPT) return; g_kWearer = llGetOwner(); PermsCheck(); + API_CHANNEL = ((integer)("0x" + llGetSubString((string)llGetOwner(), 0, 8))) + 0xf6eb - 0xd2; g_iInterfaceChannel = -llAbs((integer)("0x" + llGetSubString(g_kWearer,30,-1))); llListen(g_iInterfaceChannel, "", "", ""); g_iHUDChannel = -llAbs((integer)("0x"+llGetSubString((string)llGetOwner(),-7,-1))); @@ -596,7 +597,13 @@ default { if (sMenuType == "AO") { if (sMessage == "Cancel") return; else if (sMessage == "-") MenuAO(kID); - else if (sMessage == "Collar Menu") llRegionSayTo(g_kWearer,g_iHUDChannel,(string)g_kWearer+":menu"); + else if (sMessage == "Collar Menu"){ + llRegionSayTo(g_kWearer, API_CHANNEL, llList2Json(JSON_OBJECT, ["pkt_type", "online", "kID", g_kWearer, "addon_name", "OC_Sub_AO", "optin", ""])); + llSleep(2); + llRegionSayTo(g_kWearer, API_CHANNEL, llList2Json(JSON_OBJECT, ["pkt_type", "from_addon", "kID", g_kWearer, "iNum", 0, "sMsg", "menu", "addon_name", "OC_Sub_AO"])); + llSleep(0.5); + llRegionSayTo(g_kWearer, API_CHANNEL, llList2Json(JSON_OBJECT, ["pkt_type", "offline", "addon_name", "OC_Sub_AO", "kID", g_kWearer])); + } else if (~llSubStringIndex(sMessage,"LOCK")) { Command(kID,llToLower(sMessage)); MenuAO(kID); diff --git a/src/collar/oc_core.lsl b/src/collar/oc_core.lsl index 268104c5e..578df7e53 100644 --- a/src/collar/oc_core.lsl +++ b/src/collar/oc_core.lsl @@ -22,7 +22,7 @@ integer NOTIFY_OWNERS=1003; //string g_sParentMenu = ""; string g_sSubMenu = "Main"; -string COLLAR_VERSION = "8.0.0000"; // Provide enough room +string COLLAR_VERSION = "8.0.1000"; // Provide enough room // LEGEND: Major.Minor.Build RC Beta Alpha integer UPDATE_AVAILABLE=FALSE; string NEW_VERSION = ""; diff --git a/src/installer/BUNDLE_00-Core_REQUIRED b/src/installer/BUNDLE_00-Core_REQUIRED index 89901836e..f44ef428b 100644 --- a/src/installer/BUNDLE_00-Core_REQUIRED +++ b/src/installer/BUNDLE_00-Core_REQUIRED @@ -1,5 +1,8 @@ -SCRIPT|oc_com -SCRIPT|oc_sys +SCRIPT|oc_themes SCRIPT|oc_rlvextension SCRIPT|oc_rlvsuite -SCRIPT|oc_states \ No newline at end of file +SCRIPT|oc_addons +SCRIPT|oc_states +SCRIPT|oc_core +SCRIPT|oc_auth +SCRIPT|oc_api \ No newline at end of file diff --git a/src/installer/BUNDLE_10-Children_REQUIRED b/src/installer/BUNDLE_10-Children_REQUIRED index 0b74c484b..3def1125b 100644 --- a/src/installer/BUNDLE_10-Children_REQUIRED +++ b/src/installer/BUNDLE_10-Children_REQUIRED @@ -1,4 +1,3 @@ -SCRIPT|oc_auth SCRIPT|oc_couples SCRIPT|oc_dialog SCRIPT|oc_rlvsys diff --git a/src/installer/BUNDLE_20-Anims_REQUIRED b/src/installer/BUNDLE_20-Anims_REQUIRED index 0669cbba3..262eaa025 100644 --- a/src/installer/BUNDLE_20-Anims_REQUIRED +++ b/src/installer/BUNDLE_20-Anims_REQUIRED @@ -1,8 +1,6 @@ ITEM|back -ITEM|beautystand ITEM|belly ITEM|booty -ITEM|bop ITEM|bracelets ITEM|cutie ITEM|display @@ -23,6 +21,7 @@ ITEM|~hug ITEM|~kiss ITEM|~leap ITEM|~footkiss +ITEM|~stiff ITEM|~pet ITEM|.couples SCRIPT|oc_anim \ No newline at end of file diff --git a/src/installer/BUNDLE_30-Other-Features_REQUIRED b/src/installer/BUNDLE_30-Other-Features_REQUIRED index 33fa407ae..1a23d94d7 100644 --- a/src/installer/BUNDLE_30-Other-Features_REQUIRED +++ b/src/installer/BUNDLE_30-Other-Features_REQUIRED @@ -8,9 +8,8 @@ SCRIPT|oc_detach SCRIPT|oc_outfits SCRIPT|oc_particle SCRIPT|oc_resizer -SCRIPT|oc_themes SCRIPT|oc_relay -ITEM|Turbo Safety RLV Relay +SCRIPT|oc_undress ITEM|.license ITEM|OpenCollar_Help ITEM|s&p_leashholder \ No newline at end of file diff --git a/src/installer/BUNDLE_40-Apps_OPTIONAL b/src/installer/BUNDLE_40-Apps_OPTIONAL index 3c6463ae2..bc86fd3a8 100644 --- a/src/installer/BUNDLE_40-Apps_OPTIONAL +++ b/src/installer/BUNDLE_40-Apps_OPTIONAL @@ -1,4 +1,10 @@ SCRIPT|oc_bookmarks SCRIPT|oc_capture SCRIPT|oc_presets -SCRIPT|oc_undress \ No newline at end of file +SCRIPT|oc_OwnerOnlineCheck +SCRIPT|oc_titler +SCRIPT|oc_undress +SCRIPT|oc_detach +SCRIPT|oc_outfits +SCRIPT|oc_bell +SCRIPT|oc_folders \ No newline at end of file diff --git a/src/installer/BUNDLE_99_DEPRECATED b/src/installer/BUNDLE_99_DEPRECATED index f12104207..294fa8b54 100644 --- a/src/installer/BUNDLE_99_DEPRECATED +++ b/src/installer/BUNDLE_99_DEPRECATED @@ -13,4 +13,5 @@ ITEM|bop ITEM|beautystand SCRIPT|oc_anticrash SCRIPT|oc_meshthemes -LIKE|S&P \ No newline at end of file +LIKE|S&P +SCRIPT|oc_outfits.RLV \ No newline at end of file diff --git a/src/installer/oc_installer_bundles.lsl b/src/installer/oc_installer_bundles.lsl index 030f6457b..d23fd0e1e 100644 --- a/src/installer/oc_installer_bundles.lsl +++ b/src/installer/oc_installer_bundles.lsl @@ -64,7 +64,10 @@ SetStatus() { } - +list g_lChannels; +list g_lListeners; +list g_lItems; +list g_lTypes; default { state_entry() { @@ -122,6 +125,38 @@ default } listen(integer iChannel, string sName, key kID, string sMsg) { + integer iIndexChannels = llListFindList(g_lChannels, [iChannel]); + if(iIndexChannels != -1){ + // -> // + integer iLstn = llList2Integer(g_lListeners,iIndexChannels); + string sItem = llList2String(g_lItems, iIndexChannels); + string sType = llList2String(g_lTypes, iIndexChannels); + g_lChannels = llDeleteSubList(g_lChannels, iIndexChannels, iIndexChannels); + g_lListeners = llDeleteSubList(g_lListeners, iIndexChannels, iIndexChannels); + g_lItems = llDeleteSubList(g_lItems, iIndexChannels, iIndexChannels); + g_lTypes = llDeleteSubList(g_lTypes, iIndexChannels, iIndexChannels); + + llListenRemove(iLstn); + if(sMsg == "Skip"){ + g_iLine++; + g_kLineID = llGetNotecardLine(g_sCard, g_iLine); + } else if(sMsg == "Install"){ + if (sType == "ITEM") { + llGiveInventory(g_kRCPT, sItem); + } else if (sType == "SCRIPT") { + llRemoteLoadScriptPin(g_kRCPT, sItem, g_iPin, TRUE, 1); + } else if (sType == "STOPPEDSCRIPT") { + llRemoteLoadScriptPin(g_kRCPT, sItem, g_iPin, FALSE, 1); + } + g_iLine++; + g_kLineID = llGetNotecardLine(g_sCard, g_iLine); + } else if(sMsg == "Remove"){ + llRegionSayTo(g_kRCPT, g_iTalkChannel, sType+"|"+sItem+"|"+(string)NULL_KEY+"|DEPRECATED"); + } + + return; + } + // let's live on the edge and assume that we only ever listen with a uuid filter so we know it's safe // look for msgs in the form || list lParts = llParseString2List(sMsg, ["|"], []); @@ -144,6 +179,24 @@ default } g_iLine++; g_kLineID = llGetNotecardLine(g_sCard, g_iLine); + } else if(sCmd == "PROMPT_INSTALL"){ + //Do prompt + g_lChannels += [llRound(llFrand(5437845))]; + g_lListeners += [llListen(llList2Integer(g_lChannels, -1), "", llGetOwner(), "")]; + g_lItems += [sItemName]; + g_lTypes += [sType]; + + + llDialog(llGetOwner(), "[OpenCollar Installer]\nCurrent Item: "+sItemName+"\n\n* Install\t\t- This optional item is not installed. If you wish to install, select this item\n* Skip\t\t- Skip and do not install this optional item", ["Install", "Skip"], llList2Integer(g_lChannels, -1)); + } else if(sCmd == "PROMPT_REMOVE"){ + + g_lChannels += [llRound(llFrand(5437845))]; + g_lListeners += [llListen(llList2Integer(g_lChannels, -1), "", llGetOwner(), "")]; + g_lItems += [sItemName]; + g_lTypes += [sType]; + + + llDialog(llGetOwner(), "[OpenCollar Installer]\nCurrent Item: "+sItemName+"\n\n* Remove\t\t- This optional item is currently installed. If you wish to uninstall, select this option\n* Skip\t\t- Skip and do not change this optional item", ["Remove", "Skip"], llList2Integer(g_lChannels, -1)); } } } diff --git a/src/installer/oc_installer_sys.lsl b/src/installer/oc_installer_sys.lsl index 29eed7418..75eaa362b 100644 --- a/src/installer/oc_installer_sys.lsl +++ b/src/installer/oc_installer_sys.lsl @@ -97,7 +97,7 @@ ReadName() { } SetFloatText() { - llSetText(g_sObjectType+"\n\n "+g_sName+"\nBuild Version: "+g_sBuildVersion, <1,1,1>, 1.0); + llSetText(g_sObjectType+"\n\n "+g_sName/*+"\nBuild Version: "+g_sBuildVersion*/, <1,1,1>, 1.0); } Particles(key kTarget) { diff --git a/src/installer/oc_update_shim.lsl b/src/installer/oc_update_shim.lsl index d2433d935..6a06d2ff0 100644 --- a/src/installer/oc_update_shim.lsl +++ b/src/installer/oc_update_shim.lsl @@ -141,6 +141,7 @@ default { listen(integer iChannel, string sWho, key kID, string sMsg) { if (llGetOwnerKey(kID) != llGetOwner()) return; + //llSay(0, "FROM UPDATER: "+sMsg); list lParts = llParseString2List(sMsg, ["|"], []); if (llGetListLength(lParts) == 4) { @@ -206,10 +207,10 @@ default { } else if (sMode == "OPTIONAL") { // only update if present but outdated. skip if absent. if (llGetInventoryType(sName) == INVENTORY_NONE) { - sCmd = "SKIP"; + sCmd = "PROMPT_INSTALL"; } else { if (llGetInventoryKey(sName) == kUUID && kUUID != NULL_KEY) { - sCmd = "SKIP"; + sCmd = "PROMPT_REMOVE"; } else { // we have it but it's the wrong version. delete and get new one. llRemoveInventory(sName); diff --git a/src/remote/oc_remote.lsl b/src/remote/oc_remote.lsl index 161021018..80c123045 100644 --- a/src/remote/oc_remote.lsl +++ b/src/remote/oc_remote.lsl @@ -24,7 +24,43 @@ string BTN_TEXTURE = "da46036f-7f4d-59e5-3fcf-a43d692e3ea7"; integer BTN_XS = 3; integer BTN_YS = 9; +integer UPDATE_AVAILABLE=FALSE; +integer g_iAmNewer=FALSE; +string NEW_VERSION = ""; +string HUD_VERSION = "8.0.1000"; + +key g_kUpdateCheck = NULL_KEY; +DoCheckUpdate(){ + g_kUpdateCheck = llHTTPRequest("https://raw.githubusercontent.com/OpenCollarTeam/OpenCollar/master/web/remote.txt",[],""); +} +Compare(string V1, string V2){ + NEW_VERSION=V2; + + if(V1==V2){ + UPDATE_AVAILABLE=FALSE; + return; + } + V1 = llDumpList2String(llParseString2List(V1, ["."],[]),""); + V2 = llDumpList2String(llParseString2List(V2, ["."],[]), ""); + integer iV1 = (integer)V1; + integer iV2 = (integer)V2; + + if(iV1 < iV2){ + UPDATE_AVAILABLE=TRUE; + g_iAmNewer=FALSE; + } else if(iV1 == iV2) return; + else if(iV1 > iV2){ + UPDATE_AVAILABLE=FALSE; + g_iAmNewer=TRUE; + + llSetText("", <1,0,0>,1); + } +} +string MajorMinor(){ + list lTmp = llParseString2List(HUD_VERSION,["."],[]); + return llList2String(lTmp,0)+"."+llList2String(lTmp,1); +} integer g_iVertical = TRUE; // can be vertical? integer g_iLayout = 1; // 0 - Horisontal, 1 - Vertical @@ -483,12 +519,14 @@ default llOwnerSay("HUD is ready with "+(string)llGetFreeMemory()+"b free memory"); g_lFavorites = [(string)llGetOwner()]; llMessageLinked(LINK_SET,-10,"",""); + DoCheckUpdate(); } attach(key id){ if(id!=NULL_KEY){ Recalc(); llOwnerSay("Ready"); + DoCheckUpdate(); } } @@ -502,6 +540,7 @@ default on_rez(integer iRez){ Recalc(); llOwnerSay("Ready"); + DoCheckUpdate(); } no_sensor() @@ -671,6 +710,19 @@ default g_kProfilePic=NULL_KEY; llOwnerSay("Error when retrieving profile picture"); } + } else if(kReq == g_kUpdateCheck){ + if(iStat==200){ + Compare(HUD_VERSION, sBody); + if(g_iAmNewer){ + llOwnerSay("Your current remote version is newer than the release version"); + } + + if(UPDATE_AVAILABLE){ + llOwnerSay("UPDATE AVAILABLE: A new remote update is available. Please obtain it from OpenCollar"); + } + }else{ + llOwnerSay("An error was detected while checking for an update. The server returned a invalid status code"); + } } } diff --git a/web/ao.txt b/web/ao.txt new file mode 100644 index 000000000..42f7d2336 --- /dev/null +++ b/web/ao.txt @@ -0,0 +1 @@ +2.1 \ No newline at end of file diff --git a/web/dev_version.txt b/web/dev_version.txt index b3b36a407..c86f8c966 100644 --- a/web/dev_version.txt +++ b/web/dev_version.txt @@ -1 +1 @@ -8.0.0400 \ No newline at end of file +8.0.1000 \ No newline at end of file diff --git a/web/remote.txt b/web/remote.txt index 810ee4e91..c86f8c966 100644 --- a/web/remote.txt +++ b/web/remote.txt @@ -1 +1 @@ -1.6 +8.0.1000 \ No newline at end of file diff --git a/web/version.txt b/web/version.txt index 9904c6614..c86f8c966 100644 --- a/web/version.txt +++ b/web/version.txt @@ -1 +1 @@ -7.4 \ No newline at end of file +8.0.1000 \ No newline at end of file diff --git a/web/~ao b/web/~ao deleted file mode 100644 index cad6e4a99..000000000 --- a/web/~ao +++ /dev/null @@ -1 +0,0 @@ -160924.1 \ No newline at end of file