-
Notifications
You must be signed in to change notification settings - Fork 26
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
Merge Integration->Main #186
base: main
Are you sure you want to change the base?
Conversation
Add loser picks balance algo
This patch allows the `!help` command to show documentation for the following commands: - `!setAllAiBonus` - `!unboss` - `!setratinglevels` The help entries for the first two of these was missing because the permissions configuration was placed in the global `commands.conf` file, instead of the plugin-specific `BarManagerCmd.conf` file. The help entry for the last command was missing because of a copy-paste error (`!resetratinglevels` had two help entries, while `!setratinglevels` had none).
Fix missing `!help` entries for several BarManager commands.
Currently, `getNumUsersInMyBattle()` throws an error if it is called when the battle is closed. One way this can happen is in the `sendTachyonBattle()` timer callback, if the lobby was disconnected between when the timer was started and when the callback runs.
Currently, `sendTachyonBattle()` is called as a timer callback, to provide a form of rate-limiting. The timer is only started when a battle is open, but it is possible that the lobby will disconnect before `sendTachyonBattle()` runs. This patch makes `sendTachyonBattle()` return early if the lobby is no longer connected at the time that it runs.
Currently, the following lobby command handlers log an error if they are called for a user that is not currently known: - hLEFT_pre - hLEFTBATTLE_pre - hREMOVEUSER_pre - hCLIENTSTATUS_pre - hJOINEDBATTLE_pre When it is logged, the current error message states "hXXX_pre cannot be exectuted <...>". This message does not clearly explain what went wrong or what else may be impacted as a result of the error. This patch changes the error message to state "hXXX_pre was called for an unknown user, skipping <...>". This makes it much more clear what went wrong (missing a user), and what may be impacted (anything involving that specific user).
Counterintuitively, SPADS calls the `onLobbyConnected` callback *after* the `onLobbyLogin` callback. By registering all lobby command handlers in `onLobbyLogin`, we ensure that we don't miss any commands that would have been sent before `onLobbyConnected` is run.
Miscellaneous cleanups/fixes
Currently, there is not a reliable way to determine whether a host is running the latest BarManager code. This is particularly annoying when making changes to the Integration server, as for subtle changes it is not easy to tell whether the latest code has been fetched yet. This patch adds a new `selfFileHash` variable (set on plugin init), which calculates a 6-character hash of the currently-running python file. That variable is also added to the output of `!barmanagerprintstate`, so that it is easy to look up.
Add `selfFileHash`, and print it in `!barmanagerprintstate`
Follow-up for #170. Once the `!unboss` command is deployed, and Chobby has been updated to use it, this patch can be used to disable `!boss` (without parameters) so that users are not surprised by its behavior.
Converting back to draft, so we can merge another PR and test before this is deployed |
e3df4f9
to
1057598
Compare
The Perl code which is currently used to implement the `!unboss` command handler is only valid when the name of the target is alphanumeric. This patch updates that Perl code, so that it also works when the target's name contains whitelisted symbols.
5778af0
to
fa9d61a
Compare
Currently, if an arbitrary player runs the command `!joinas USER`, a vote is called among all players in the lobby. As a result, even if the target player does not want someone to be able to control their units, the rest of the lobby can overrule them. This patch makes the following changes, active during any ongoing `!joinas USERNAME` vote: - When a non-target submits a vote, the vote state is checked for whether USERNAME has voted already. If so, the non-target's vote is counted as normal; if not, the non-target's vote is deferred. - If USERNAME submits a "no" vote, then the ongoing vote is immediately ended (as if by `!endVote`) and all deferred votes are discarded. - When USERNAME submits a "yes" or "blank" vote, all deferred votes are counted. This has the practical effect of requiring approval from the `!joinas` target, in order for the vote to succeed; the vote will fail if the target does not explicitly vote "yes" or "blank".
Make `!joinas` require approval from its target player.
What's the status of this @DeviousNull ? |
…ires-target-approval Revert "Make `!joinas` require approval from its target player."
Its been lingering, since I've not had access to my main computer/dev environment for the past couple of weeks; all but one of the changes are ready though, so I've reverted the patch that still needs more work. @Beherith, with that revert done, this PR is ready to merge whenever you like. |
@DeviousNull are you able to merge this yourself? It's been 2 months now. |
We have a fair number of changes this week. User-visible changes:
!balancealgorithm
to allowloser_picks
as an option (Add loser picks balance algo #179 @jauggy)!help
entries forunboss
,setAllAiBonus
, andsetratinglevels
(Fix missing!help
entries for several BarManager commands. #181 @DeviousNull)!unboss USERNAME
not working whenUSERNAME
contained symbols (Fix!unboss
silently failing for usernames containing symbols #184 @DeviousNull)!boss
without any parameters, and direct users to run!unboss
instead (Disable!boss
command (without parameters). #171 @DeviousNull)Make(removed from PR for adjustments)!joinas USERNAME
require approval from the specific player who someone would be joining (Make!joinas
require approval exclusively from its target player. #185 @DeviousNull)respect_avoids
balance algorithm, and removeauto
(which is now the default) (Add respect_avoids balance algo #187 @jauggy)Cleanups / minor fixes:
getNumUsersInMyBattle()
no longer throws an error when the battle is closed. (Miscellaneous cleanups/fixes #182 @DeviousNull)sendTachyonBattle()
now aborts early if the battle is closed, instead of attempting to send an update anyway (Miscellaneous cleanups/fixes #182 @DeviousNull)onLobbyConnected
SPADS callback withonLobbyLogin
, so we are guaranteed to receive all events (Miscellaneous cleanups/fixes #182 @DeviousNull)barmanager.py
's contents to!barmanagerprintstate
, which helps quickly identify whether a host is running the latest code (AddselfFileHash
, and print it in!barmanagerprintstate
#183 @DeviousNull)