summaryrefslogtreecommitdiff
path: root/Persister-(.world-etc.)-format.md
diff options
context:
space:
mode:
authorSgeo <[email protected]>2017-06-12 22:40:25 -0400
committerSgeo <[email protected]>2017-06-12 22:40:25 -0400
commit1f90f2592d0b74a5013e6b0f0bac988fb3c9effa (patch)
treea68e0f3e923069364962de442caa795d76d0c9b3 /Persister-(.world-etc.)-format.md
parentUpdated Persister (.world etc.) format (markdown) (diff)
downloadlibreworlds-wiki-1f90f2592d0b74a5013e6b0f0bac988fb3c9effa.tar.xz
libreworlds-wiki-1f90f2592d0b74a5013e6b0f0bac988fb3c9effa.zip
Updated Persister (.world etc.) format (markdown)
Diffstat (limited to 'Persister-(.world-etc.)-format.md')
-rw-r--r--Persister-(.world-etc.)-format.md8
1 files changed, 6 insertions, 2 deletions
diff --git a/Persister-(.world-etc.)-format.md b/Persister-(.world-etc.)-format.md
index ac41543..a36284a 100644
--- a/Persister-(.world-etc.)-format.md
+++ b/Persister-(.world-etc.)-format.md
@@ -1,6 +1,6 @@
Data in Persister format does not mark itself to indicate their types, the types are assumed by the deserialization code. That is, a Portal being read in knows when to expect a boolean, a string, and an integer, for example. Without knowing what a Portal wants to read, it is not possible to determine where the next item begins.
-During reading or writing, WorldsPlayer maintains 3 tables: Object table, Class table, Cookie table (for versions). These serve as a caching mechanism,
+During reading or writing, WorldsPlayer maintains 3 tables: Object table, Class table, Cookie table (for versions). These serve as a caching mechanism, so that objects can be reused and class names do not need to be repeated.
# Primitive data types
@@ -9,6 +9,10 @@ Worlds generally uses the format described by [Java's DataInput](https://docs.or
* String: Starts with a byte, where 0x01 means the string is null (and the next byte is for the next item) and 0x00 means non-null. If non-null, next 2 bytes are the length in number of bytes (big-endian). Following is the actual string data, in modified UTF-8. (The bytes after the non-null indicator are merely read by DataInput).
* Boolean: 1 byte, 0x00 for false 0x01 for true.
* Byte, Double, Long, Int, Float, Short: Self-explanatory
+* Arrays, vectors, maybenulls: Explained below
# Objects
-Obj \ No newline at end of file
+
+Assuming empty class and object table, an object consists of an object ID (integer), a class ID (integer), class name (String), and then data as determined by the specific class.
+
+## Example from GroundZero \ No newline at end of file