Abstract Schema with no fields #610
Unanswered
mackereldev
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hi @mackereldev, Inheritance with no fields on the base class is supported, just added a test scenario for this here and it's passing: colyseus/schema@5526c8e Could you provide a test case like this one that fails? Cheers |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've discovered an error that occurs when synchronising a Schema with clients. This class is abstract, and does not contain any fields, and so never uses the "type" decorator to declare state fields. The class structure appears as follows:
I've tried making
QuestRoom
non-abstract and instantiating it directly, however this does not work. The exact error has something to do with decoding the schema on the client side:The problem appears to lie with
QuestRoom
not having any fields, and surely enough when adding any valid field (I added a booleandummy
field in my case) it resolves the error. Is this behaviour intended? Is it possible to have a Schema with no fields for the purpose of inheritance?Beta Was this translation helpful? Give feedback.
All reactions