openrtc-netcode-node 3.0.0 → 3.0.2

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/README.md CHANGED
@@ -14,9 +14,16 @@ const room = await rtc.rooms.join('match-123', {
14
14
  access: 'capability',
15
15
  membership: 'ephemeral',
16
16
  });
17
- const netcode = createNodeNetcode({ room });
17
+ const netcode = createNodeNetcode({ room, authority: { mode: 'host', hostId: localAuthorityId } });
18
+ await netcode.joinLobby(room.id);
18
19
  ```
19
20
 
20
21
  The helper exposes Node transport preferences and delegates all lobby, mesh,
21
22
  message, and replicated-state behavior to `openrtc-netcode`. It never creates
22
23
  an OpenRTC client or activates a second avenue.
24
+
25
+ The package re-exports the browser-neutral simulation, interpolation, prediction,
26
+ replication and action APIs. Supply the same admitted host ID to clients and
27
+ validate action payloads in your authoritative game code. `nodeTransports`
28
+ expresses requested transports, not availability. Rust host capability reports
29
+ determine what is compiled and enabled; JavaScript globals cannot prove that.
package/dist/index.d.ts CHANGED
@@ -5,4 +5,4 @@ export type NodeNetcodeOptions = NetcodeOptions;
5
5
  export declare function createNodeNetcode(options: NodeNetcodeOptions): NetcodeClient;
6
6
  /** Use this when constructing OpenRTC; netcode itself never owns transport lifecycle. */
7
7
  export declare function nodeTransports(profile: NodeTransportProfile): Transports;
8
- export type { CreateLobbyOptions, JoinLobbyOptions, NetVar, NetVarOptions, NetcodeClient, NetcodeEventHandler, NetcodeEventName, NetcodeEvents, NetcodeLobby, NetcodeMessage, MessageHandler, NetcodeOptions, NetcodePeer, NetcodeState, SendOptions, } from 'openrtc-netcode';
8
+ export * from 'openrtc-netcode';
package/dist/index.js CHANGED
@@ -4,19 +4,21 @@ export function createNodeNetcode(options) {
4
4
  }
5
5
  /** Use this when constructing OpenRTC; netcode itself never owns transport lifecycle. */
6
6
  export function nodeTransports(profile) {
7
- const hasWebRtc = typeof globalThis.RTCPeerConnection === 'function';
8
- const hasWebTransport = typeof globalThis.WebTransport === 'function';
7
+ // These are requested transports, not capability assertions. The active
8
+ // Rust host reports its compiled/enabled capability; JS globals cannot.
9
9
  switch (profile) {
10
10
  case 'iroh':
11
11
  return { iroh: true, webrtc: false, moq: false };
12
12
  case 'webrtc':
13
- return { iroh: false, webrtc: hasWebRtc, moq: false };
13
+ return { iroh: false, webrtc: true, moq: false };
14
14
  case 'moq':
15
- return { iroh: false, webrtc: false, moq: hasWebTransport };
15
+ return { iroh: false, webrtc: false, moq: true };
16
16
  case 'all':
17
- return { iroh: true, webrtc: hasWebRtc, moq: hasWebTransport };
17
+ return { iroh: true, webrtc: true, moq: true };
18
18
  case 'auto':
19
19
  default:
20
- return { iroh: true, webrtc: hasWebRtc, moq: hasWebTransport };
20
+ return { iroh: true, webrtc: true, moq: true };
21
21
  }
22
22
  }
23
+ // Node hosts expose the same simulation, replication and action API as browsers.
24
+ export * from 'openrtc-netcode';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openrtc-netcode-node",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -40,8 +40,8 @@
40
40
  "test:watch": "vitest"
41
41
  },
42
42
  "dependencies": {
43
- "openrtc": "^3.0.0",
44
- "openrtc-netcode": "^3.0.0"
43
+ "openrtc": "^3.0.2",
44
+ "openrtc-netcode": "^3.0.2"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/node": "^24.10.1",