Skip to content

OnlyWorlds Unity SDK 0.53.0

Choose a tag to compare

@tmoosting tmoosting released this 25 Nov 06:02
· 106 commits to main since this release

A world file now leaves out who wrote each element unless asked. A world folder's fixed names (world.json,
elements/, spatial/) are read as written, and one held only in another case is refused with the name to fix,
never read as an empty world. An element's declared type counts only when it is one of the 22 type slugs exactly,
and the writer refuses a type that is not one, which closes a write outside elements/. Pinned to schema-dist
serial 146. A minor release because it adds public API (below).

Added

  • OWWorldArchivePackOptions.IncludeAuthorFields and AuthorFieldsLeftOut. Pass IncludeAuthorFields = true
    for a byte copy of your own folder, author fields included; AuthorFieldsLeftOut, when given, receives the paths
    of the files written without them (forward slashes, code point order), as HiddenLeftOut does for hidden ones.
  • OWWorldArchiveReason.NameCase ("name_case"). The cause of a refusal when a folder or a world file holds
    world.json, elements/ or spatial/ in another case and not as written (below).

Changed

  • Schema pin to v0.34.1-dist.146 (7f29ae4); canonical 00.34.01 unchanged (OWSchemaPin.DistSerial 146). The
    generated files moved in their stamp only. The address fixture gains one prose case (219 in all) and the calendar
    fixture one calendar (79 cases), each copied byte for byte under Tests/Editor/Fixtures/ and answered with no
    change. The .owworld set's new cases (a fixed name held only in another case, spatial/'s four types, a
    dot-folder inside a world, what a share may carry) each get the set's verdict.

  • world.json, elements/ and spatial/ are read as written, and one held in another case is refused, never
    read as an empty world
    (folder spec §4.8, ruled 2026-11-25). A folder holding Elements/, World.JSON or
    Spatial/ and not the name itself is refused by OWFolderReader.Read with Reason name_case, the message naming
    both spellings, whether or not the legacy layout is read. Before, on Windows and macOS the folder was read as if the
    name were right, and on Linux it read with no elements: one folder, two worlds. Every other door asks the same
    question of a listing, never of the file system: OWFolderReader.ReadEntries, OWWorldArchive.Read and
    FindWorldRoot (a world file holding abbey/Elements/ or abbey/World.JSON alone was accepted as empty, or refused
    as not_a_world), OWWorldArchive.Pack and DefaultArchiveName (a pack on Windows wrote Elements/ into the
    archive as elements/), and OWFolderWriter.WriteElement, Write, WriteWorld and DeleteElement (on Windows a
    write landed inside Elements/, where no reader looks). Nothing is written when they refuse. Names are compared by
    the archive's one fold (NFC, then simple case folding, Unicode 15.1), so ſpatial/ is spatial/ in another case. A
    folder holding both spellings (only a case-sensitive disk can) reads the name as written and leaves the other
    unread. The fixture set's fail-OW-18-folder-case-alone and fail-OW-18-world-case-alone pass; under spatial/
    only map, pin, zone and marker were already read, as pass-OW-24-spatial-untyped and -type-case ask.

  • A body's type counts only when it is one of the 22 type slugs, exactly (folder spec §4.1, ruled 2026-11-22).
    OWFolderReader.Read and ReadEntries (so an .owworld too) and OWEnvelopeReader used to serve any string in
    type as the element's type, and a number, true, a list or an object as its text: a file in
    elements/character/ saying "type": "Location" was served as a Location, and one saying "type": 7 as a 7.
    Now anything but one of the 22 as written (another case, a space around it, an unknown word, a plural, a number, a
    list) declares nothing: the type comes from the directory, or the export's list, and TypeInferred is true. One of
    the 22 still wins over the directory, as before. The body is served as written. The cases are the Python package's
    and the TypeScript SDK's shared declared-type.cases.json, vendored with its sha256.

  • A world file leaves out who wrote each element. OWWorldArchive.Pack now removes the five author fields
    (created_by, changed_by, changed_via, changed_client, doors: which member and which tool wrote an element,
    a membership id and a door, nothing to someone the world is handed to) from every file under elements/ and the
    legacy spatial/ that is one JSON object, whatever its name, extension or depth, and whether or not it is read as
    an element. Every overload does, the Editor's Pack World Folder... menu included: a .owworld is a file handed
    on (folder spec §4.2). Only top-level keys go (an x_ value that holds one of the names stays), and a key present
    with null goes too. Such a file is rewritten in the folder's own form (OWFolderWriter.Serialize: two-space
    indent, LF, a trailing newline, the other keys in their order, numbers and strings as JSON.stringify writes them,
    no byte order mark); a file holding none of the five, a file that is no JSON object (an array, a write cut short,
    not UTF-8), and world.json, media/ and records/ keep their bytes. In a share (IncludeHidden = false) only the
    files it carries are counted. Parity with the TypeScript SDK 4.203.2 (and 4.109.0): author-fields.fixture.json
    (8 cases, the same bytes as the TypeScript SDK's and the Python package's) is vendored byte for byte with its
    sha256 held, and every case passes, each entry compared byte for byte, with the count.

    "One JSON object" is read as the TypeScript SDK reads a file it did not write: strict UTF-8 (a byte order mark read
    past), one value by JSON's grammar and nothing after it, every number one a double holds. So a file Newtonsoft reads
    but JSON.parse does not (a comment, single quotes, a bare name, a trailing comma, NaN, a leading zero, a raw tab
    inside a string) keeps its bytes. Where the two packages' readers differ, a file keeps its bytes, which is the safe
    side for every reader:
    a rewrite here never writes a value the file does not hold, nor one the TypeScript SDK
    would write differently. A file holding an integer past 2^53 that JavaScript reads rounded (12345678901234567891,
    9007199254740993) keeps its bytes, as in the TypeScript SDK since 4.203.2, the author fields included, as a
    number no double holds (1e400) does in both. So does a file holding the escape of a lone surrogate ("\ud800",
    which Newtonsoft reads as U+FFFD), and one nested more than 64 deep, past Newtonsoft's reader (the TypeScript SDK
    reads to 200). An integer-like key ("0", "12") keeps its place in the object, where JSON.stringify would put
    it first.

Fixed

  • The writer refuses a type that is not one of the 22 type slugs, exactly, and so can no longer write outside
    elements/.
    OWFolderWriter.WriteElement and Write take the type folder from the body's type, and took any
    text there: "Character" wrote elements/Character/ and 7 wrote elements/7/, folders no reader reads, and
    "../escape" wrote the file beside elements/, "../../x" outside the world folder. Now a type other than the 22
    as written is refused, the message naming it and the 22, and nothing is written (a batch none of its bodies), as
    the TypeScript SDK's and the Python package's folder writers refuse it. A list or an object in type used to fail
    as an ArgumentException about the path; it is this refusal now.

  • A write into a type folder spelled in another case is refused, the folder named. OWFolderWriter.WriteElement
    and Write, given a Character for a folder whose elements/ holds Character/ and no character/, wrote the file
    inside Character/ on Windows and macOS, where no reader reads it (a type folder is read as written, folder spec
    §4.8, ruled 2026-11-23). They now refuse with Reason name_case, the message naming the folder's path, and write
    nothing (a batch writes none of its bodies). A folder that holds both spellings writes into the one as written. And
    an element whose id sits in the legacy spatial/Pin/ (no pin folder) is written to elements/pin/, never into
    spatial/Pin/: the legacy layout is found by its listed name, as the reader finds it.

  • A tool's world.json under a dot-folder inside the world no longer refuses a world file (folder spec §4.7,
    OW-5, ruled 2026-11-24). OWWorldArchive.Read refused abbey/.atlas/world.json as a second world
    (more_than_one); a dot-folder is never a world, wherever it sits (..atlas/, elements/character/.trash/ too), so
    the second-world check no longer looks under one, as the folder reader never reads one. Every other check still
    reads those entries. The fixture set's pass-OW-5-dot-folder-inside passes.