-
-
Notifications
You must be signed in to change notification settings - Fork 422
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
Add OnServerHibernationUpdate forward (closes #1483) #2151
Conversation
Test script:
here's the output:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OnHibernationChanged? Update implies to me we're getting this every frame, but this could just be me..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps having two forwards instead could help
- OnServerEnterHibernation
- OnServerExitHibernation
Would make it more clear and be less confusing than bool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
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