fix: Antiban Breaks with different signatures #111
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Because of discrepancy between the documentation and the signature of TAntiban.AddBreak, certain issues popped up when either updating breaks in the form or reading them from the file with the interval and length being swapped.
As evidenced by running the examples\antiban_form.simba twice, once with defaults, once after loading presets:
{INTERVAL = 1800000, LENGTH = 120000, LOGOUTCHANCE = 0.01, STDVAR = 0.33, NEXT = 2153742.42903776, PREVIOUS = 0} {INTERVAL = 120000, LENGTH = 1800000, LOGOUTCHANCE = 0.01, STDVAR = 0.33, NEXT = 121432.544598551, PREVIOUS = 0}By switching the parameters in TAntiban.AddBreak so it's in line with the documentation, this is resolved.
The json values used in TAntibanFormHelper.LoadBreaks also refer to the names instead of indexes now, so it's easier to indentify which value is being passed. This brings it in line with TAntibanFormHelper.LoadSleep.