-
Notifications
You must be signed in to change notification settings - Fork 4
Description
While this functionality does currently exist with Share Links, there is no such protection when using a script, game mod, or other API control methods.
As such, there should be a setting for each individual shocker that lets you set a maximum that the backend will under no circumstance send a value above.
When I implemented this into Legacy OpenShock, I also started to scale any input given by that maximum value so scripts and other control methods don't need to be aware of that limit, and can send 100% expecting it to reach 100% of my maximum.
In addition to that, I added a bool to say if I'm sending an absolute value, to avoid the scaling but still get capped by the maximum.
This helps a lot with people who are extremely sensitive and want the peace of mind that a script mishap or bad sharelink won't ruin their night.
Examples:
Maximum Shock: 100%
Sent Value: 50%
Hub Received Value: 50%
Maximum Shock: 50%
Sent Value: 50%
Hub Received Value: 25%
Maximum Shock: 50%
Sent Value: 55% (Absolute)
Hub Received Value: 50%
My Legacy implementation:
https://github.com/nullstalgia/OpenShock-ESP-Legacy/blob/main/src/shockertasks.h#L16