Closed Naman-sopho closed 6 years ago
Unless your replication/persistence system uses Gson for serialization, MovingBlocks/Terasology#3403 will not solve your problem. Since these queues are being used in a Component
which uses default Terasology replication and persistence, you will have to create a custom TypeHandler
for Queue
and make sure TypeSerializationLibrary.getHandlerFor
returns an instance of that type handler when a Queue
type is passed to it.
Since Queue
is a Collection
, the QueueTypeHandler
implementation will be more or less equivalent to existing Collection
type handlers like SetTypeHandler
or ListTypeHandler
.
Note that a ListTypeHandler
already exists in the engine, so List<EntityRef>
instances should be correctly serialized.
Due to the absence of implemented
TypeHandlers
for data types likeQueue<EntityRef>
,List<EntityRef>
etc. the replication of various fields does not take place over the network and thus many crucial systems in MOO do not work as intended in multiplayer. Another side effect of this is no persistence of these across saved game, so all addedavailableTasks
(a Queue) would not be carried forward if you open a saved game. This engine PR addresses this issue . Known component fields with issue :Queue<EntityRef> availableTasks
List<EntityRef> assignedAreas
List<EntityRef> constructedBuildings