@idosgames/core 0.18.0 → 0.19.1
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 +35 -0
- package/dist/PlatformAdapter-DU_8HalI.d.cts +34 -0
- package/dist/PlatformAdapter-DU_8HalI.d.ts +34 -0
- package/dist/RealtimeSession-BjBq5iJG.d.ts +12469 -0
- package/dist/RealtimeSession-Cg-wm6i4.d.cts +12469 -0
- package/dist/chunk-76ZM4DUB.js +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +8 -11976
- package/dist/index.d.ts +8 -11976
- package/dist/index.js +2 -2
- package/dist/platform/index.d.cts +2 -33
- package/dist/platform/index.d.ts +2 -33
- package/dist/realtime/index.cjs +1 -0
- package/dist/realtime/index.d.cts +21 -0
- package/dist/realtime/index.d.ts +21 -0
- package/dist/realtime/index.js +1 -0
- package/package.json +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -14,6 +14,41 @@ and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.ht
|
|
|
14
14
|
|
|
15
15
|
## [Unreleased]
|
|
16
16
|
|
|
17
|
+
## [0.19.0] - 2026-09-27
|
|
18
|
+
|
|
19
|
+
Realtime multiplayer: a ready-made WebRTC transport on top of the engine's Multiplayer signaling,
|
|
20
|
+
plus the room actions it needs (host handover, kick/ban). First user: VoxelCraft co-op.
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- **`@idosgames/core/realtime`** — new subpath, `RealtimeSession.create()` / `.join()`:
|
|
25
|
+
- two DataChannels per link: `rel` (ordered, reliable, fragmented up to 16 KB frames) and `fast`
|
|
26
|
+
(unordered, no retransmits);
|
|
27
|
+
- `Host` (star) and `Mesh` topologies, glare-free offers;
|
|
28
|
+
- signaling through a single-flight, per-peer batched outbox; descriptions carry their ICE
|
|
29
|
+
candidates, so about one `SendSignal` per side per connection;
|
|
30
|
+
- adaptive polling: 1 s only while setting up, then 2.5 s for the host and 20 s for others;
|
|
31
|
+
- keepalive and RTT (`linkStats`), reconnect with back-off, standby links (`setExtraPeers`);
|
|
32
|
+
- host handover: `setSuccessor()` + `leave()`, a `keepalive` leave on `pagehide`, and
|
|
33
|
+
`claimHost()` when the host tab dies;
|
|
34
|
+
- `kick()` / `unban()`: the kicked player is told over its link and polls at once — the server
|
|
35
|
+
alone confirms the removal;
|
|
36
|
+
- TURN servers taken as is from the room snapshot.
|
|
37
|
+
- `client.multiplayer.claimHost()`, `kickMember(roomID, target, ban?)`, `unbanMember()`;
|
|
38
|
+
`leaveRoom(roomID, { successorUserID?, keepalive? })`.
|
|
39
|
+
- Models: `KickMemberResponse`, `UnbanMemberResponse`, `RoomSnapshotResponse.BannedUserIDs` (host
|
|
40
|
+
and owner only); request fields `SuccessorUserID`, `Ban`; actions `ClaimHost`, `KickMember`,
|
|
41
|
+
`UnbanMember`.
|
|
42
|
+
- Events: `multiplayer:hostClaimed`, `multiplayer:memberKicked`, `multiplayer:memberUnbanned`.
|
|
43
|
+
- Transport: `PostOptions.keepalive` (a request that outlives the page).
|
|
44
|
+
|
|
45
|
+
### Changed
|
|
46
|
+
|
|
47
|
+
- `sendSignal` is throttled per target (`Multiplayer:SendSignal:{target}`) instead of one shared
|
|
48
|
+
key: signals to different peers no longer drop each other.
|
|
49
|
+
- Build: `flatten-dts` now flattens every emitted `.d.ts` / `.d.cts`, including shared chunks. The
|
|
50
|
+
shared `ClientContext-*` chunk had grown to 3.4 MB of zod types.
|
|
51
|
+
|
|
17
52
|
## [0.18.0] - 2026-09-23
|
|
18
53
|
|
|
19
54
|
### Added
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
interface KeyValueStorage {
|
|
2
|
+
getString(key: string): string | null;
|
|
3
|
+
setString(key: string, value: string): void;
|
|
4
|
+
remove(key: string): void;
|
|
5
|
+
}
|
|
6
|
+
interface PlatformAdapter {
|
|
7
|
+
readonly storage: KeyValueStorage;
|
|
8
|
+
/** Platform id (e.g. Telegram `tdesktop`/`android`, or `Web`). */
|
|
9
|
+
getPlatform(): string;
|
|
10
|
+
/** Full launch URL — mirrors WebSDK.GetFullURL. */
|
|
11
|
+
getFullURL(): string;
|
|
12
|
+
/** Telegram `start_param` (referral/deeplink) if present. */
|
|
13
|
+
getStartParameter(): string | null;
|
|
14
|
+
/** Raw Telegram `initData` string for server-side auth (validated only on the server). */
|
|
15
|
+
getTelegramInitDataRaw(): string | null;
|
|
16
|
+
/** Stable per-device id (persisted) — replaces SystemInfo.deviceUniqueIdentifier. */
|
|
17
|
+
getDeviceID(): string;
|
|
18
|
+
/** Device/user-agent string — replaces SystemInfo.deviceModel. */
|
|
19
|
+
getDeviceModel(): string;
|
|
20
|
+
/**
|
|
21
|
+
* Referring page (`document.referrer`), when the host has one.
|
|
22
|
+
*
|
|
23
|
+
* Optional on purpose: adding a required member here would break every adapter written outside
|
|
24
|
+
* this repo, and an acquisition signal is not worth that. Absent referrer simply means one less
|
|
25
|
+
* field in the signal.
|
|
26
|
+
*/
|
|
27
|
+
getReferrer?(): string | null;
|
|
28
|
+
shareLink(url: string): void;
|
|
29
|
+
openInvoice(url: string): void;
|
|
30
|
+
showAd(blockId: string): Promise<void>;
|
|
31
|
+
copyToClipboard(text: string): Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type { KeyValueStorage as K, PlatformAdapter as P };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
interface KeyValueStorage {
|
|
2
|
+
getString(key: string): string | null;
|
|
3
|
+
setString(key: string, value: string): void;
|
|
4
|
+
remove(key: string): void;
|
|
5
|
+
}
|
|
6
|
+
interface PlatformAdapter {
|
|
7
|
+
readonly storage: KeyValueStorage;
|
|
8
|
+
/** Platform id (e.g. Telegram `tdesktop`/`android`, or `Web`). */
|
|
9
|
+
getPlatform(): string;
|
|
10
|
+
/** Full launch URL — mirrors WebSDK.GetFullURL. */
|
|
11
|
+
getFullURL(): string;
|
|
12
|
+
/** Telegram `start_param` (referral/deeplink) if present. */
|
|
13
|
+
getStartParameter(): string | null;
|
|
14
|
+
/** Raw Telegram `initData` string for server-side auth (validated only on the server). */
|
|
15
|
+
getTelegramInitDataRaw(): string | null;
|
|
16
|
+
/** Stable per-device id (persisted) — replaces SystemInfo.deviceUniqueIdentifier. */
|
|
17
|
+
getDeviceID(): string;
|
|
18
|
+
/** Device/user-agent string — replaces SystemInfo.deviceModel. */
|
|
19
|
+
getDeviceModel(): string;
|
|
20
|
+
/**
|
|
21
|
+
* Referring page (`document.referrer`), when the host has one.
|
|
22
|
+
*
|
|
23
|
+
* Optional on purpose: adding a required member here would break every adapter written outside
|
|
24
|
+
* this repo, and an acquisition signal is not worth that. Absent referrer simply means one less
|
|
25
|
+
* field in the signal.
|
|
26
|
+
*/
|
|
27
|
+
getReferrer?(): string | null;
|
|
28
|
+
shareLink(url: string): void;
|
|
29
|
+
openInvoice(url: string): void;
|
|
30
|
+
showAd(blockId: string): Promise<void>;
|
|
31
|
+
copyToClipboard(text: string): Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type { KeyValueStorage as K, PlatformAdapter as P };
|