OpenShock/WebUI

Each shocker's settings should have a Max Shock and Max Vibe slider

Opened this issue · 3 comments

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

So what you really want is, API Tokens to have a limit? Im not a fan of lerping those values+ this is not related to WebUi.

What can be done is a limit on a shocker globally, but that is also more so related to backend

@LucHeart

Well any input to have a limit, but the main target is the API, yes.

I would like to keep some lerping, as if I have someone who has a limit of 20%, I then need to adjust my set-up to scale from 0-20%, not from 0-100% as it would hit 20% very quickly.

Being able to keep it generic, maybe optionally instead, would be very helpful.

We can transfer the issue to the API, but this also requires a UI option, so I just put it here for now.