User Tools

Site Tools


ientitypacketcollectionloadingservice

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ientitypacketcollectionloadingservice [2026/04/25 17:20] – created divinerientitypacketcollectionloadingservice [2026/04/25 17:26] (current) diviner
Line 2: Line 2:
 ===== IEntityPacketCollectionLoadingService ===== ===== IEntityPacketCollectionLoadingService =====
  
-This service's primary responsibility is to load serialized [[Entity|Entities]] from an [[EntityPacketCollection]] into a specified [[Chunk]]. It creates entity instances from valid packet static data, deserializes their saved packet data, destroys entities that fail to deserialize, and broadcasts entity creation once loading is complete. Loading is performed through a coroutine so large collections can be processed over multiple frames.+This service's primary responsibility is to load serialized [[Entity|Entities]] from an [[EntityPacketCollection]] into a specified [[Chunk]]. Loading is performed through a coroutine so large collections can be processed over multiple frames.
  
-Broadcasts Events: [[EntityPacketCollectionLoadingStartedTopic]], [[EntityPacketCollectionLoadingProgressTopic]], [[EntityPacketCollectionLoadingCompleteTopic]]+**Broadcasts Events:** [[EntityPacketCollectionLoadingStartedTopic]], [[EntityPacketCollectionLoadingProgressTopic]], [[EntityPacketCollectionLoadingCompleteTopic]]
  
 === Methods === === Methods ===
-^Method | Task LoadEntityPacketCollection([[Chunk]] chunk, [[EntityPacketCollection]] entityPacketCollection, bool containsEncodedPackets, CancellationToken cancellationToken) | +^Method | Task **LoadEntityPacketCollection**([[Chunk]] chunk, [[EntityPacketCollection]] entityPacketCollection, bool containsEncodedPackets, CancellationToken cancellationToken) | 
-^Description | Loads all valid serialized [[Entity|Entities]] from the supplied [[EntityPacketCollection]] into the specified [[Chunk]]. The method starts a coroutine that performs loading in three passes: filtering and creating entity instances, deserializing entity packet data, and broadcasting entity creation for valid entities. Packets with missing static data IDs or unresolved static data are skipped. Entities that are created but fail packet deserialization are destroyed. Progress is broadcast during loading according to the configured loading frequency. The containsEncodedPackets boolean is used to instruct how the entity packets deserialize. Packet encoding reduces save file size by storing a packet's type as an integer instead of serializing its Type as a string value, but adding new packets can break the indexing and corrupt the save file. An [[EntityPacketCollection]] must deserialize with the same encoding setting it was serialized with. |+^Description | Loads all valid serialized [[Entity|Entities]] from the supplied [[EntityPacketCollection]] into the specified [[Chunk]]. Progress is broadcast during loading according to the configured loading frequency. The containsEncodedPackets boolean is used to instruct how the [[Entity]] packets deserialize. Packet encoding reduces save file size by storing a packet's type as an integer instead of serializing its Type as a string value, but adding new packets can break the indexing and corrupt the save file. An [[EntityPacketCollection]] must deserialize with the same encoding setting it was serialized with. |
ientitypacketcollectionloadingservice.1777137611.txt.gz · Last modified: by diviner

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki