Skip to content
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

Allow smoother restarts with third party integration #1484

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Pugzy
Copy link
Contributor

@Pugzy Pugzy commented Jan 20, 2025

Updates to the PGM restart logic and ability for third-party integrations to modify restart behaviour.

This PR moves some heavy-lifting logic out of the RestartListener and in to the RestartManager. The last set of changes in #155 to the restart logic took things in a weird direction and muddled things up a bit.

RestartListener

  • Now only listens to events and doesn't actually control logic of restarting.
  • Holds a deferral if restarted whilst a match is playing and releases once complete.

RestartManager

  • Becomes singleton hub of restarting, removes and replaces static function calls.
  • Holds data on restart requests and starts the countdowns when required.
  • Stores a list of referrals that come from the event.

RequestRestartEvent

  • Deferring via this now adds to the RestartManager list of deferral.
  • When removing a deferral via the event if no other deferrals exist a restart will be started.
  • The event allows for a custom countdown to be used in the place of the regular restart one.

VotingPool

  • Stores current poll and includes a PGM config option on if polls are allowed when a restart is queued.

SmoothRestartModule

  • Can be ignored whilst PR is a draft, will be removed once ready.
  • Using this to simulate how another plugin could interact with these changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant