Returns timestamp of current chunk snapshot. Store this timestamp to use in removeSnapshotUser
Used on client to clear modified chunks instead of saving them.
called at the end of tick
returned value isNull if chunk is not loaded/added If uncompress is Yes then tries to convert snapshot to uncompressed. If has users, then compressed snapshot is returned.
Returns writeable copy of current chunk snapshot. This buffer is valid until commit. After commit this buffer becomes next immutable snapshot. Returns null if chunk is not added and/or not loaded. If write buffer was not yet created then it is created based on policy. BUG: returned pointer points inside hash table. If new write buffer is added hash table can reallocate. Do not use more than one write buffer at a time. Reallocation can prevent changes to buffers obtained earlier than reallocation to be invisible.
Internal. Called by code which loads chunks from storage. LoadedChunk is a type that has following memeber: ChunkHeaderItem getHeader() ChunkLayerItem getLayer()
Internal. Called by code which saves chunks to storage. SavedChunk is a type that has following memeber: ChunkHeaderItem getHeader() ChunkLayerTimestampItem getLayerTimestamp()
Generic removal of snapshot user. Removes chunk if numUsers == 0. Use this to remove added snapshot user. Use timestamp returned from addCurrentSnapshotUser.
Performs save of all modified chunks. Modified chunks are those that were committed. Perform save right after commit.
Sets number of users of chunk at cwp. If total chunk users if greater than zero, then chunk is loaded, if equal to zero, chunk will be unloaded.
Set to true on client to cancel load on unload