-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Type 'core::time::Duration' does not support ReflectValue serialization #3277
Comments
This is a very reasonable requirement. If you're comfortable with it, this should be a fairly straightforward PR. |
If you can point me to the relevant file(s), I'm happy to do it myself. |
Usually, we'd just use a Similarly, we can't put this in I would probably start a new file ( The other examples in that folder should provide a nice guide, but feel free to reach out here or on your PR if you run into difficulties. |
Duration is an |
I opened a PR that solves this issue. @shelbyd, I hope you don't mind that I didn't let you solve it yourself. I just stumbled into this problem too. And since the problem is pretty annoying, yet easy to fix, I just couldn't help but open a PR. |
# Objective Resolves bevyengine#3277 Currenty if we try to serialize a scene that contains a `Duration` (which is very common, since `Timer` contains one), we get an error saying: > Type 'core::time::Duration' does not support ReflectValue serialization ## Solution Let `Duration` implement `SerializeValue`. Co-authored-by: Jonathan Cornaz <[email protected]>
What problem does this solve or what need does it fill?
I'm building a general purpose plugin for doing rollback networking for bevy and a game using that. To support clients reconnecting after disconnect, I need to serialize relevant state and transmit it to reconnecting clients. It's common for
Timer
s to be relevant for gameplay logic, and those require serializingDuration
s.What solution would you like?
Implement
ReflectValue
serialization forDuration
and othercore
types.What alternative(s) have you considered?
To unblock myself, I can reimplement
Timer
andDuration
with a customMyDuration
type that derivesReflect
. Doing that is not ideal for a myriad of reasons, but probably necessary to continue progress on my project.The text was updated successfully, but these errors were encountered: