Skip to content

OnlyWorlds Unity SDK 0.58.0

Choose a tag to compare

@tmoosting tmoosting released this 27 Nov 12:11
· 58 commits to main since this release

The package makes a written promise about what a release may change, checked on every push, and takes the names
the TypeScript SDK keeps in its 5.0: GroupOf, GroupOrder, ColorOfGroup, OWGroupColor and ResolveCalendar,
with the old names marked to leave in 1.0. Parity with the TypeScript SDK 4.212.0 to 4.213.0 on calendar bounds,
too-deep world files and a press of Cancel, and every pack now refuses a name its own reader refuses. A minor release
because it adds public API (below).

Added

  • The names the TypeScript SDK keeps in its 5.0: groupOf, GROUP_ORDER, GROUP_COLORS and resolveCalendar.
    OWPresentation.GroupOf(type) answers a type's colour group, its word (blue for a Character);
    OWPresentation.GroupOrder the four words in the sidecar's order; OWPresentation.ColorOfGroup(word) a group's two
    colours as the new struct OWGroupColor (Light, Dark, For(darkSurface)). OWCalendarLens.ResolveCalendar(elements, activeId) resolves a chosen calendar and OWCalendarLens.ResolveCalendarNeverChosen(elements, fallbackToOnly) one
    never chosen. Each answers exactly as the name it replaces, which now calls it (see Deprecated). The family names
    always answered the colour words, as groupOf does; the TypeScript SDK's own familyOf answers its words from
    before 4.102.0 (agents, world, abstract, temporal), so the group names are the true twins.

  • The package's written promise, held on every change. A patch release fixes and a minor release adds; neither
    removes nor renames a public name, and the package keeps to this while it is 0.x. A name that will go is marked first,
    saying since which release, what to use instead and the release it leaves in, and goes no sooner than six months
    later, in 1.0. The README's Versions line says so and links the docs' Stability page. The mark is [Obsolete("Since X.Y.Z. Leaves in 1.0. Use Y.")], a warning. tools/verify_promise.py holds the package's public names, listed in
    tools/public-names.json, and their marks to the promise in a new workflow on every push and pull request, which
    needs no Unity install: Roslyn's parser reads the names from the source (tools/PublicNames).
    tools/mutants_promise.py watches it fail once for each rule. No release so far has removed or renamed a public name.

  • Parity with the TypeScript SDK 4.213.0: a press of Cancel is cancelled. keel's consent page answers Cancel by
    returning to the registered address with error=access_denied, the sign-in's state and no code.
    OWClient.CompleteSignInAsync refused that return as state_mismatch, which says the page was not reached from this
    sign-in. It now throws OWSignInError with the new reason OWSignInReason.Cancelled ("cancelled"): nothing is
    sent and the sign-in has ended, so a game can put the player back where they were. A return with another error and
    no code is failed, that error as Code. A Cancel with another state, or at another page, is still
    state_mismatch. The TypeScript SDK's error also hands back the resume its storage kept; here the caller holds the
    pending sign-in and whatever it kept beside it, so there is nothing to hand back.

Changed

  • OWPresentation.ColorOfType returns OWGroupColor? (it returned OWFamilyColor?), the same two colours. The
    old struct converts from the new one, so OWFamilyColor? c = OWPresentation.ColorOfType(t) still compiles, with the
    old struct's deprecation warning. OWGraph's node Family is filled by GroupOf, the same word.
  • OWClient.AskAsync and OWClient.SortAsync say when they leave. Each [Obsolete] message now opens Since 0.37.0. Leaves in 1.0. before the call to use instead, AiAsync. Both are still a warning, never an error, and keep
    working, unchanged, until 1.0.
  • Parity with the TypeScript SDK 4.212.0: the validator names the size bounds. OWCalendar.ValidateValue and
    OWCalendar.Validate now say which of the calendar profile's size bounds a value is past, in the TypeScript SDK's
    words: "A calendar holds at most 256 eras", "A calendar holds at most 64 months", "A week holds at most 64 steps and
    64 names", "A calendar holds at most 16 festival days", "An except list holds at most 8 numbers" (version 2), "A name
    or template holds at most 256 characters" and "A year holds at most 2^53 - 1 steps". One message at most, the first
    bound in that order, after the era checks and before the overlaps. The reader already refused such a value; now the
    validator says why.
  • Parity with the TypeScript SDK 4.212.2: the year bound on a calendar with no months. OWCalendar.ValidateValue
    and OWCalendar.Validate now say "A year holds at most 2^53 - 1 steps" when a calendar with no months has a
    year.steps past 2^53 - 1, as the reader already refused it.
  • Parity with the TypeScript SDK 4.212.1: a whole count is worded exactly. OWCalendar.FormatDuration(CalendarConfig, double) showed a whole count past 2^53 / 100 rounded through n * 100, so 9007199254740990 steps read
    9007199254740989 days; a whole count is now shown as it is (the long overload already did). A step_name that is
    not a string already read as absent here; the TypeScript SDK now reads it the same way, so the two agree.
  • Parity with the TypeScript SDK 4.212.3: a world file refused for a world.json nested past 200 levels says it in
    words alone.
    The message of OWWorldArchive.Read's refusal no longer carries the too_deep: mark; it ends
    "world.json in '…' is nested more than 200 deep.", and the code is OWFolderFormatException.WorldFault, which a tool
    reads. The folder reader's refusal and a skipped file's reason keep too_deep in their text, as the TypeScript SDK's
    folder route and skip reasons do.
  • OWWorldArchive.Pack refuses a world.json nested past 200 levels in the same words, with Reason set to
    not_a_world and WorldFault to too_deep, as the TypeScript SDK's writeWorldFile refuses it, in a copy and in a
    share. It said "is not valid JSON." before, of a text that
    is valid JSON.
  • Pack already refused a folder holding Spatial/ (or spatial/ with a long s) beside elements/, as a copy and as
    a share, with the cause name_case and nothing written; the TypeScript SDK 4.212.3's writer now refuses it too, and
    a test holds the shape.

Deprecated

Each is marked [Obsolete("Since 0.58.0. Leaves in 1.0. ...")], a warning, never an error. Each keeps working,
unchanged, and leaves in 1.0, no sooner than six months after 0.58.0, as the TypeScript SDK drops them in its 5.0.

  • OWPresentation.FamilyOf, FamilyOrder and ColorOfFamily, in favour of GroupOf, GroupOrder and
    ColorOfGroup: the same words and colours.
  • The struct OWFamilyColor (and its Light, Dark and For), in favour of OWGroupColor, the same two colours.
  • OWCalendarLens.ResolveLens and ResolveLensNeverChosen, in favour of ResolveCalendar and
    ResolveCalendarNeverChosen: the same answers ("lens" now names a cut of a world, not a chosen calendar).
  • OWLayoutByKind.Version and OWLayoutAround.Version, with nothing in their place: the layout profile's mark
    carries no version key, and a method's word is its version, so read Method. OWLayoutByLinks3d.Version stays.

Fixed

  • OWWorldArchive.Pack refuses to write a world file its own reader would refuse for a name, as the folder
    format's writer rules ask (§4.7: OW-16, OW-18, OW-19, OW-22) and as the TypeScript SDK's writeWorldFile refuses
    it. Before a byte is written, every entry name goes through the reader's checks: a name some disk cannot hold (a
    Windows device name such as media/aux.png, a name ending in a dot or a space, a reserved or control character)
    is refused name; two names that are one after case folding are refused collision; a path that would be a file
    and a folder is refused unsafe_path, and so is a world folder named mimetype (the marker's name), while one
    named MimeType is refused collision. OWFolderFormatException.Reason carries the cause and nothing is written.
    Before, such a folder was packed into a file that OWWorldArchive.Read then refused.