-
Notifications
You must be signed in to change notification settings - Fork 113
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
Appearance Weakrefs #1815
base: master
Are you sure you want to change the base?
Appearance Weakrefs #1815
Conversation
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Fairly substantial rewrite of appearance handling.
There are now two appearance classes:
MutableIconAppearance
andImmutableIconAppearance
MutableIconAppearance
is the class you use for mutable appearance stuff. They are not sent to the client. To send them to the client, you must either useAtomManager.SetAppearance()
or if you have a really really good reason useServerAppearanceSystem.AddAppearance()
.ImmutableIconAppearance
is the class that is sent to the client. It cannot be edited. If you want to edit it, you need to create a mutable copy (which is aMutableIconAppearance
). These are held only as weakrefs in theServerAppearanceSystem
, and are removed from connected clients when they are garbage collected. This means that if you want to keep it alive you must have a hard ref to it somewhere. Any appearance (mutable or no) which has an overlay/underlay counts as a hard ref for that overlay/underlay.The client has copies of the
ImmutableIconAppearance
and can useToMutable()
to edit them locally for animations and such.Appearance ID is now just the
ImmutableIconAppearance
's hash as generated on the server and stored in theImmutableIconAppearance
.KNOWN BUG: /turf animations don't apply, it just sets the final state of the turf appearance. Turf animations can go in another PR.