Skip to content

OnlyWorlds Unity SDK 0.60.0

Choose a tag to compare

@tmoosting tmoosting released this 28 Nov 03:41
· 48 commits to main since this release

A standard field's value of the wrong kind is refused before sending (2.5, "7" or true in an integer field; a
non-string in a text field), where the server took it and stored another value. Parity with the TypeScript SDK
4.220.0. A minor release because it adds public API (below).

Added

  • OWElementTypes.IntegerFieldNames, IsIntegerField(slug, field) and IsTextField(slug, field): the kinds a write
    is checked against.
    Generated from the schema beside StringFieldNames: the integer fields per type, and whether
    a field is an integer or a text field of a type in the standard. IsTextField is IsStringField plus the pin's
    element_type, which the wire carries as text, and answers false for a type outside the standard (where
    IsStringField answers the base fields).

Fixed

  • A value the server would store as another is refused before sending. The server takes a value of the wrong
    kind with a 200 and changes it: an integer field stores 2.5 as 2, "7" as 7 and true as 1; a text field
    stores a list as "['a', 'b']" and 12 as "12". CreateAsync, UpsertAsync, PatchAsync, BulkAsync and
    ProposeAsync now throw ArgumentException: patch: character.height is an integer field; 2.5 would be stored as another value. Nothing was sent. (and ... is a text field; 12 is not a string), the value as JSON.stringify
    writes it (a NaN as null). An integer field takes a whole number (2.0 is one) or null, a text field a string
    or null; extensions, link fields and a type outside the standard are not checked. A typed model already holds
    its kinds. Parity with the TypeScript SDK 4.220.0, its test vector ported.