Repository navigation
OnlyWorlds Unity SDK 0.10.0
Known-of elements (folder format v0.3.10, §4.4): onlyworlds.com hands a guest or player key some elements as stubs
(known_of: true), an element its Character only knows of. An export now writes a stub as it is, a reader can tell a
stub from a whole element, and the client refuses to write one back. An export declares folder format 0.3.12, and a
typed calendar era refuses a date it does not hold. A minor release because it adds public API (below).
Added
- A stub is written as it is:
OWFolderExport.ExportAsyncandExportFileAsyncwrite a stub with the keys it
keeps (id,type,name,description,supertype,subtype,image_url,created_at,updated_at,
change_seq,OWFolderExport.KnownOfKeeps), every other field it was sent with a value (a Character's public
physicalityorheight), andknown_of: truelast. The unset fields the server sends ("",null,[]) are
left out: on disk they would read as a whole element with nothing filled in.0andfalseare values and are
kept. A whole element is written as served, and an element served as a stub and then whole (or the other way) is
written as it came last. The rule isOWFolderExport.KnownOfForDisk(body), a port of the Python package's
known_of_for_disk, checked against its bytes. - A reader can say "stub":
OWPayload.IsKnownOf(body)(true only forknown_of: true),OWElement.IsKnownOf
on every typed model,OWFolderElement.KnownOf,OWFolderReadResult.KnownOf(the ids of the stubs a folder holds,
sorted) andOWWorldCache.IsKnownOf(id). A stub's absent or empty fields are unknown, not empty: a typed model of
one reads"",[]or null for them exactly as a whole element with nothing filled in would, so check the flag.
IsKnownOfis read from the model's extension fields, never a modelled bool, so a whole element never sends
known_of: false. OWApiError.IsKnownOfNotWritable(422known_of_not_writable), matching the npm SDK's helper.
Changed
- A stub is never written back:
OWClient.CreateAsync,PatchAsyncand each item ofBulkAsyncthrow an
ArgumentExceptionfor a body (typed or raw) markedknown_of: truebefore anything is sent; the bulk message
names the item (bulk: items[1]: ...). Its empty fields are not the element's values, and writing it would blank
them.OWEdit.Beginrefuses a stub the same way. known_ofjoinsOWPayload.ReadOnlyFields(six fields now, as the npm SDK 4.42.3's list), so a body carrying
known_of: falsehas it stripped rather than refused by the server.- An export declares folder format
0.3.12(OWFolderExport.FormatVersion), as the Python package's 0.10.4 does.
0.3.11 (an element's id replaced) and 0.3.12 (therecords/RECORDS.jsonmanifest) need nothing more here: the SDK
never replaces an id, and it carriesrecords/byte for byte. Folders stamped0.3.9stay valid.
Fixed
OWCalendar.ParseDaterefuses a date its typed era does not hold ("not a date in Before Gate") instead of reading
the number as an absolute year that lands in another era ("10 Thaw, 1 BG" read as 10 Thaw, 2 AG). The absolute
reading stays for a step in no era, whereFormatStepprints the absolute year. Parity with the TypeScript SDK
4.42.4, its test vector ported.