beyond-all-reason / teiserver

Middleware server for online gaming
https://www.beyondallreason.info/
MIT License
57 stars 53 forks source link

Boss blocks applied only on custom preset #372

Closed jauggy closed 2 months ago

jauggy commented 2 months ago

Context

Initial PR here: https://github.com/beyond-all-reason/teiserver/pull/364 This PR is based on feedback by Lexon

Improvements

Boss blocks are only applied when you have custom preset

Other changes

When there is an avoid check, either raw count or percentage is checked. The default raw count for avoid to trigger used to be 4. This is very low for the custom big battle events. This has been raised to 8 but is still overridable by Admin.

When there is a block check, the default percentage has been reduced from 66 to 50 since you're less likely to get blocked now. Can be overrided by admin. So far nobody has even triggered this.

Equality checks use >= instead of > to match what is written in the Admin Config portal. For example the Admin config has config that says: "The raw number of players who would need to avoid someone to prevent them becoming a player". If you set the number to 4 you expect you need 4 or more to trigger not greater than 4.

If avoided, a Coordinator message will appear.

Test Steps

Boss yourself and do $status. It should show you as boss. Change to custom preset and run $status it will say that no votes are allowed next to your boss status.

Login as a second user, have them try and enter your lobby. It should work.

Have the boss user block the second user. The second user should not be allowed to play. If the second user leaves then joins they will be blocked.

Have the boss change from custom preset to something else. Now have the second user try to join. They will not receive the boss blocked message. They may receive a different boss block message since 100% of people in the lobby are blocking them.

Go to Admin > Site Config and change the blocking and avoiding thresholds to 0 for percentage. The second user should now be able to enter.