@antha/multiplayer-p2p-authoritative-host 0.0.3 → 0.0.4

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.
@@ -1,6 +1,6 @@
1
1
  import { type ApiAndRoomConnectionState, type ClientId, ControllerClientEvent, ControllerConnectionEvent, ControllerRoomListEvent, type ControllerRoomListListener, type MultiplayerInitParams, type MultiplayerRoomConnection, MultiplayerRoomController, type RoomInput, RoomRejectionError } from '@antha/multiplayer-core';
2
2
  import { type JsonCompatibleValue, type MaybePromise, type PartialWithUndefined } from '@augment-vir/common';
3
- import { ListenTarget, type TypedCustomEventInit } from 'typed-event-target';
3
+ import { ListenTarget, type RemoveListenerCallback, type TypedCustomEventInit } from 'typed-event-target';
4
4
  /**
5
5
  * Message type for {@link P2pAuthoritativeHostMessage}.
6
6
  *
@@ -152,7 +152,9 @@ export declare class P2pAuthoritativeHostMultiplayerController<Input extends Jso
152
152
  *
153
153
  * If a callback is provided, it is called each time the room list is updated.
154
154
  */
155
- startRoomUpdates(callback?: ControllerRoomListListener | undefined): import("typed-event-target").RemoveListenerCallback;
155
+ startRoomUpdates(callback: ControllerRoomListListener): RemoveListenerCallback;
156
+ startRoomUpdates(callback?: undefined): undefined;
157
+ startRoomUpdates(callback?: ControllerRoomListListener | undefined): RemoveListenerCallback | undefined;
156
158
  /** Turn off room list updates and remove callbacks added via `startRoomUpdates`. */
157
159
  stopRoomUpdates(): void;
158
160
  /** Currently joined room id. If a room has not been joined yet, this will be empty. */
@@ -1,5 +1,5 @@
1
1
  import { ControllerClientEvent, ControllerConnectionEvent, ControllerMessageEvent, ControllerRoomListEvent, createMultiplayerId, emptyApiAndRoomConnectionState, MultiplayerConnectionState, MultiplayerRoomController, RoomRejectionError, } from '@antha/multiplayer-core';
2
- import { defineTypedCustomEvent, ListenTarget } from 'typed-event-target';
2
+ import { defineTypedCustomEvent, ListenTarget, } from 'typed-event-target';
3
3
  /**
4
4
  * Message type for {@link P2pAuthoritativeHostMessage}.
5
5
  *
@@ -66,11 +66,6 @@ export class P2pAuthoritativeHostMultiplayerController extends ListenTarget {
66
66
  get clientId() {
67
67
  return this.roomConnection?.clientId || this.localClientId;
68
68
  }
69
- /**
70
- * Listen for room list updates, including while connected to a room.
71
- *
72
- * If a callback is provided, it is called each time the room list is updated.
73
- */
74
69
  startRoomUpdates(callback) {
75
70
  return this.roomController.startRoomUpdates(callback);
76
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antha/multiplayer-p2p-authoritative-host",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "P2P authoritative-host multiplayer strategy for the Antha engine.",
5
5
  "keywords": [
6
6
  "vir",
@@ -48,7 +48,7 @@
48
48
  "istanbul-smart-text-reporter": "^1.1.5"
49
49
  },
50
50
  "peerDependencies": {
51
- "@antha/multiplayer-core": "^0.0.3"
51
+ "@antha/multiplayer-core": "^0.0.4"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=22"