-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update oc_core.lsl for wearer setting of safeword and device name #999
Conversation
We need you to look at this again Medea. It's doing about half of what we expected. |
"prefix safeword-enable/safeword-disable" in oc-api handles safeword enabling and disabling. So doing "prefix safeword off" in oc_core is not necessary, and we can let oc_core manage only the setting of new safewords and leave the enable/disable functionality to oc_api. oc_api doesnt fully read and save the global_safeworddisable and as seen in oc_core (around line 797) the way used to reenable safeword is to send llMessageLinked(LINK_SET, CMD_OWNER, "safeword-enable",""); This section should further be removed so setting safeword to RED does not reenable the safeword. If we want prefix safeword off to still work (duplicating prefix safeword-enable) it can simply call llMessageLinked(LINK_SET, CMD_OWNER, "safeword-enable",""); So questions for the usage are:
|
@NikkiLacrima I've got a fix already handed to Ping inworld for testing which simply rejects setting a new safeword by non-owner authed wearer when safeworddisable is on, which strikes me as the simple fix. the safeword-disable and safeword-enable commands handled in oc_api are triggered by oc_core if the global_safeword setting is RED as a way to reset, but there are problems with this method. oc_api doesn't store changes by safeword-disable to settings, and it doesn't clear the safeword setting itself, so help/about will show your safeword with no indication that it's non-functional, while (prefix) safeword off will set the global_safeworddisable setting and change the safeword to "off" so that Help/About shows "Safeword: off" I'm not sure if the safeword-enable function is used in any other way, but I don't think so. I can't find any other instance of safeword-enable LMs, and no instances of safeword-disable. I think if we change the safeword-enable trigger in oc_core when global_safeword is RED to deleting the global_safeworddissable setting we'll get the same effect, avoid the incorrect display of safeword, avoid oc_api getting out of sync with global settings, and save a few lines in oc_api. Though maybe we shouldn't have the safeword disable setting changed unless it's explicitly changed by owner, and should instead enforce safeword to "off" when safewworddisable is true. Thoughts? |
In short remove the command strings "safeword-disable" and "safeword-enable" and instead handle the global_safeworddissable setting both when set and removed, that sounds like the best option, and more consistent with how we manage state using settings. Using safeword off to set the safeword to "off" or "(off)" and global_safeworddissable = TRUE seems good. One more thing, found while working on the runaway stuff: on oc_core line about 220 ``
`` |
As tested, with Medea's update the Safeword problem shown above is solved. Once the Safeword is disabled by the collar Owner, the collar Wearer can no longer turn the Safeword function back on by simply assigning a new Safeword. When the Wearer attempts this they get a notice "Only Owners can set a safeword when disabled!" |
Through various testing scenarios we have uncovered a problem with the latest oc_core update. |
So, it looks like OC_API does not set g_iSafewordDisable to 0 when the global_safeworddisable setting is removed, only the reverse. Which is an odd behaviour honestly. I've added a safeword-enable link message when a new safeword is set, which should clear the issue @Pingout discovered up. A more rational arrangement can be done of this kind of situation where a variable is shared by two scripts when we move it over to LSD. The updated version of the script already has the #1054 changes merged into it for ease of testing. Assuming this one is good we won't need to do the separate merge for #1054 |
In-world testing provided by Kristina Hearts: *Wearer should now be able to change safeword and device name, as well as owner.changed safeword to "blue" changed back to "red" successfully added myself as owner of my collar successfully changed devise name successfully, notes below . [11:17] 7.2024 oc_core beta testing: OpenCollar Settings: ran command removed owner added owner ================================================================================
|
fixes for observations from KristinaHearts' testing
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the problem with Safeword, and also fixes the problem with Name.
When the collar owner sets the safeword to "off" the safeword is disabled. When the owner sets a new safeword, for example "Blue" the safeword becomes "Blue" and active.
The naming problem now works as expected. Setting the collar name to "Newname" now returns the message "The wearer's name is now set to Newname (if this is the old name, please type '/1 (prefix) name' to confirm the change went through, we may just have lagged)"
Fixes for #986 and #987. This version of oc_core allows wearer to change own safeword and device name when not owner. Fix includes improvements to notifications to avoid silent authorization failures.
REQUIRES IN-WORLD TESTING before merge:
Wearer should now be able to change safeword and device name, as well as owner.
Wearer should not be able to disable safeword, only owner.
Wearer should now be notified if safeword is disabled or if device name or safeword is changed.
"(prefix) safeword" should inform wearer or owner of current safeword.
"(prefix) device name" should inform wearer or owner of current device name.
User who is neither wearer nor owner should get clear no access notification for safeword or device commands rather than silent failure.
Notes:
Refactor of safeword function in usercommand. 'Safeword off' now no longer sets safeword to 'off' before disabling, resulting in confusing "Safeword is now set to 'off'" message. Instead safeword off is clearly notified. Wearer can now set their own safeword, but only owners can disable it still. See issue # 986. Attempting to access safeword without permission now gives no access response.
Provide no access notification for device name, and allow non-owner wearer to name. Notify wearer as well when another person changes device name. See issue # 987