Add hooks for HKMP TimeScale changes#112
Conversation
Extremelyd1
left a comment
There was a problem hiding this comment.
Thanks for the PR, I have left a few comment about things I'd like to see changed. Let me know if you want to tackle this yourself, or if you want me to do it.
With Silksong released, I'm assuming there is no hurry with this.
| private readonly IClientManager.SetTimeScale _onSetTimeScale; | ||
|
|
||
| public PauseManager(NetClient netClient) { | ||
| public PauseManager(NetClient netClient, IClientManager.SetTimeScale onSetTimeScale) { |
There was a problem hiding this comment.
I think it makes more sense to expose the event for the time scale changing in this class instead. Now we are just juggling a delegate around just to be able to call the event in the ClientManager class.
There was a problem hiding this comment.
This would be a more invasive change, since PauseManager is an internal class and is not currently exposed at all through the public API. I can make this change if you prefer but I thought it was cleaner this way to stick to the existing API surface.
|
Superceded by #113 |
Korzer420/TheHuntIsOn#10 implements an addon to HKMP which facilitates coordinated server-wide pauses and unpauses, which modify the standard Unity timescale. Since HKMP also modifies the timescale for several reasons, some coordination is required to make this functionality work cleanly without stuttering or overwriting.
This PR funnels all HKMP timescale changes through a public event which can be listened to, allowing consumers to respond to these changes promptly and completely.