PapaCharlie9 / multi-balancer

BF3 & BF4 multiple mode balancer & unstacker, including SQDM.
9 stars 12 forks source link

REQUEST: Add temp disable method callable from other plugins #76

Closed ColColonCleaner closed 10 years ago

ColColonCleaner commented 10 years ago

This method would disable any restrictions on balancing for the specified duration. I'm noticing when i need to move a lot of people in a short period of time, either manually, or in extreme cases a swapnuke, it will not sense an admin is moving them and send them back. This seems to be a problem in general where a player is moved by admin and it sends them back to the previous team like it was just a player trying to move themselves, so a way to temporarily disable any restrictions would be nice.

PapaCharlie9 commented 10 years ago

Provide a console.log with events that shows the batch moves and MB's responses. MB is supposed to detect the difference between an admin move and a player move, though it could be that admin moves are even less deterministic than I had already discovered. Generally, the event that the player move has happened comes before the admin move command, making it quite tricky to detect the difference between a player originated move (no command) and an admin one (command follows).

In the mean time, you might try adding more time between each of your admin.movePlayer command sends. It's possible that there isn't enough time for MB to do its post-event logic. You also have to give Procon time to process events in between each admin.movePlayer. Two seconds should be enough time between commands. This is just a stop-gap suggestion until I can either improve MB to more reliably detect admin moves, or until I can add your external command to suspend unswitching.

ColColonCleaner commented 10 years ago

This should be solved if the new ticket is acted on.

PapaCharlie9 commented 10 years ago

I going to go ahead and add this, since it will be easier than Issue #78 to implement. I'll put the details in the release post, but basically there will be a new key DisableUnswitcher that can be sent to UpdatePluginData with a bool parameter. Defaults to false. If set to true, the Unswitcher will be disabled and you can move players to your heart's content. MB will still notice that the player moved and increment their move count. Since the plugin tries not to move players who have already been moved based on their move count, this should effectively protect them (barring some exceptions, like high rank dispersal). The downside is that the protection will last until the end of the round, they will effectively be immune from balancing. So if you swap nuke entire teams, only new players will be balanced until the end of the round.

Don't forget to send DisableUnswitcher with false to re-enable it again when you are done moving. It does reset at end of round, but best practice is to reset it yourself.

If you set Debug Level to 4, MB will log all actions related to this remote control. You can see the flag being set on or off, you can see players moving and the unswitcher ignoring the moves. Every conditional on the unswitcher disabled flag has a logging message at level 4.