@onlyworlds/sdk 4.42.1 → 4.42.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.js +6 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,20 @@ earlier history lives in git log only.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.42.3] - 2026-10-21
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **`parseDate` reads a down era's dates back to the step they were written from, with a mid-year pivot too.** 4.42.2 moved the display count to the year holding the step before the pivot, and the parse kept the old count, so with a mid-year pivot every date before it parsed back one year early ("6 Frost, 4 BG" read 20 steps early on a 20-step year). Year-boundary pivots were never affected. Found by Quillon porting 4.42.2 to the Unity SDK and confirmed on this kernel by Temper (OW Council h58 #8962, #9111); a round-trip test now holds every step on both sides of the pivot.
|
|
12
|
+
- `redeemJoin`'s doc names a full world's refusal as 422 `world_full` (`isWorldFull`), as keel answers since the party link; it said `invalid_request` (Quillon, OW Keel h29 #9038).
|
|
13
|
+
|
|
14
|
+
## [4.42.2] - 2026-10-20
|
|
15
|
+
|
|
16
|
+
Two calendar reading fixes, found writing the `atlas_calendar` profile's conformance fixture (OW Council h58 #8943, #8946).
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
- **A down era has no year zero, even when its pivot falls mid-year.** Its year is now counted from the year holding the step just before the pivot, which reads `year_base` (1 by default). With the pivot mid-year, the earlier steps of the pivot's own year read year 0 ("0 BG") and every year before it one lower; with the pivot on a year's first step, nothing changes. The mirror of an up era, whose first partial year is year 1.
|
|
20
|
+
- **Equal-start eras resolve by a stated rule:** an up era over a down one, then the later era in the list. The comparator returned `-1` for any pair led by an up era, so two eras of one direction came out in the sort's order rather than the list's.
|
|
21
|
+
|
|
8
22
|
## [4.42.1] - 2026-10-20
|
|
9
23
|
|
|
10
24
|
The calendar reader refuses what the `atlas_calendar` profile refuses (schema-dist `profiles/calendar.md`; Quillon's Unity read, OW Council h58 #8917).
|
package/dist/index.d.ts
CHANGED
|
@@ -3278,7 +3278,7 @@ declare class OwV2Client {
|
|
|
3278
3278
|
* deleted since, or none sent, is 422 `invalid_request`, param `character`
|
|
3279
3279
|
* (`err.isCharacterInvalid`; read the preview again). With no list
|
|
3280
3280
|
* (`name_required`), send `name` and no `character`: the player's fresh Character takes the
|
|
3281
|
-
* name (missing: 422, param `name`). A world with its 50 players is 422 `
|
|
3281
|
+
* name (missing: 422, param `name`). A world with its 50 players is 422 `world_full` (`err.isWorldFull`);
|
|
3282
3282
|
* the last place taken by someone else first is the one 404. A refusal spends nothing. A link
|
|
3283
3283
|
* for one ignores `character`.
|
|
3284
3284
|
*/
|
|
@@ -3999,7 +3999,12 @@ interface EraDomain {
|
|
|
3999
3999
|
hi: number;
|
|
4000
4000
|
}
|
|
4001
4001
|
declare function resolveEraDomains(eras: CalendarEra[]): EraDomain[];
|
|
4002
|
-
/**
|
|
4002
|
+
/**
|
|
4003
|
+
* The era owning a step: domain containment; overlaps resolve to the latest start, then an
|
|
4004
|
+
* up era over a down one, then the later era in the list (the profile, calendar.md). The
|
|
4005
|
+
* comparator was `up ? -1 : 1` before 4.42.2: inconsistent for two eras of one direction,
|
|
4006
|
+
* so their order was the sort's, not the list's.
|
|
4007
|
+
*/
|
|
4003
4008
|
declare function eraForStep(cfg: CalendarConfig, step: number): CalendarEra | null;
|
|
4004
4009
|
/** The display year for a step under an era (or the absolute year without one). */
|
|
4005
4010
|
declare function displayYear(cfg: CalendarConfig, step: number, era: CalendarEra | null): number;
|
package/dist/index.js
CHANGED
|
@@ -843,7 +843,7 @@ var OwV2Client = class {
|
|
|
843
843
|
* deleted since, or none sent, is 422 `invalid_request`, param `character`
|
|
844
844
|
* (`err.isCharacterInvalid`; read the preview again). With no list
|
|
845
845
|
* (`name_required`), send `name` and no `character`: the player's fresh Character takes the
|
|
846
|
-
* name (missing: 422, param `name`). A world with its 50 players is 422 `
|
|
846
|
+
* name (missing: 422, param `name`). A world with its 50 players is 422 `world_full` (`err.isWorldFull`);
|
|
847
847
|
* the last place taken by someone else first is the one 404. A refusal spends nothing. A link
|
|
848
848
|
* for one ignores `character`.
|
|
849
849
|
*/
|
|
@@ -3078,7 +3078,9 @@ function eraForStep(cfg, step) {
|
|
|
3078
3078
|
if (eras.length === 0) return null;
|
|
3079
3079
|
const holding = resolveEraDomains(eras).filter((d) => step >= d.lo && step < d.hi);
|
|
3080
3080
|
if (holding.length === 0) return null;
|
|
3081
|
-
|
|
3081
|
+
const place = new Map(eras.map((e, i) => [e, i]));
|
|
3082
|
+
const down = (e) => (e.direction ?? "up") === "down" ? 1 : 0;
|
|
3083
|
+
holding.sort((a, b) => b.era.start - a.era.start || down(a.era) - down(b.era) || (place.get(b.era) ?? 0) - (place.get(a.era) ?? 0));
|
|
3082
3084
|
return holding[0].era;
|
|
3083
3085
|
}
|
|
3084
3086
|
function displayYear(cfg, step, era) {
|
|
@@ -3086,7 +3088,7 @@ function displayYear(cfg, step, era) {
|
|
|
3086
3088
|
if (!era || era.restart === false) return abs;
|
|
3087
3089
|
const base = era.year_base ?? 1;
|
|
3088
3090
|
if ((era.direction ?? "up") === "down") {
|
|
3089
|
-
return absoluteYear(cfg, era.start) - abs + base
|
|
3091
|
+
return absoluteYear(cfg, era.start - 1) - abs + base;
|
|
3090
3092
|
}
|
|
3091
3093
|
return abs - absoluteYear(cfg, era.start) + base;
|
|
3092
3094
|
}
|
|
@@ -3236,7 +3238,7 @@ function formatMidLabel(cfg, step) {
|
|
|
3236
3238
|
function absYearForEraYear(cfg, era, Y) {
|
|
3237
3239
|
if (era.restart === false) return Y;
|
|
3238
3240
|
const base = era.year_base ?? 1;
|
|
3239
|
-
if ((era.direction ?? "up") === "down") return absoluteYear(cfg, era.start) - (Y - base
|
|
3241
|
+
if ((era.direction ?? "up") === "down") return absoluteYear(cfg, era.start - 1) - (Y - base);
|
|
3240
3242
|
return absoluteYear(cfg, era.start) + (Y - base);
|
|
3241
3243
|
}
|
|
3242
3244
|
function defaultEra(cfg, now) {
|