Add OnServerHibernationUpdate forward (closes #1483)#2151
Add OnServerHibernationUpdate forward (closes #1483)#2151psychonic merged 4 commits intoalliedmodders:masterfrom
Conversation
|
Test script: here's the output: |
Headline
left a comment
There was a problem hiding this comment.
Thanks! - I just have some dev-user clarifications from me
plugins/include/clients.inc
Outdated
| * This is your last chance to do anything in the plugin before | ||
| * hibernation occurs, as SV_Frame will no longer be called. | ||
| * | ||
| * @param state The new hibernation state. |
There was a problem hiding this comment.
new state? we should mention what true means here so it's clear we have begun hibernating, does false mean we have just awakened? Name it isHibernating
There was a problem hiding this comment.
added a bit to explain this
plugins/include/clients.inc
Outdated
| * | ||
| * @param state The new hibernation state. | ||
| */ | ||
| forward void OnServerHibernationUpdate(bool state); |
There was a problem hiding this comment.
OnHibernationChanged? Update implies to me we're getting this every frame, but this could just be me..
There was a problem hiding this comment.
in general there's not a better way to do this: the function name "ServerHibernationUpdate" is well known, and the proper nomenclature used both in the engine and in everywhere i've seen it (like master server comms) is "hibernation state" unfortunately
There was a problem hiding this comment.
Perhaps having two forwards instead could help
- OnServerEnterHibernation
- OnServerExitHibernation
Would make it more clear and be less confusing than bool
Adds the OnServerHibernationUpdate forward. OnServerHibernationUpdate_Post() isn't possible to implement because there would be no place for it to be called from after SV_Frame stops executing.
Link to Discord discussion:
https://discord.com/channels/335290997317697536/335290997317697536/1236880595448233995