@antha/multiplayer-p2p-lock-step 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,7 +1,7 @@
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
3
  import { type AnyDuration } from 'date-vir';
4
- import { ListenTarget, type TypedCustomEventInit } from 'typed-event-target';
4
+ import { ListenTarget, type RemoveListenerCallback, type TypedCustomEventInit } from 'typed-event-target';
5
5
  /**
6
6
  * Message type for {@link P2pLockStepMessage}.
7
7
  *
@@ -146,7 +146,9 @@ export declare class P2pLockStepMultiplayerController<MultiplayerPacket extends
146
146
  *
147
147
  * If a callback is provided, it is called each time the room list is updated.
148
148
  */
149
- startRoomUpdates(callback?: ControllerRoomListListener | undefined): import("typed-event-target").RemoveListenerCallback;
149
+ startRoomUpdates(callback: ControllerRoomListListener): RemoveListenerCallback;
150
+ startRoomUpdates(callback?: undefined): undefined;
151
+ startRoomUpdates(callback?: ControllerRoomListListener | undefined): RemoveListenerCallback | undefined;
150
152
  /** Turn off room list updates and remove callbacks added via `startRoomUpdates`. */
151
153
  stopRoomUpdates(): void;
152
154
  /** Currently joined room id. If a room has not been joined yet, this will be empty. */
@@ -1,7 +1,7 @@
1
1
  import { ControllerClientEvent, ControllerConnectionEvent, ControllerMessageEvent, ControllerRoomListEvent, createMultiplayerId, emptyApiAndRoomConnectionState, MultiplayerConnectionState, MultiplayerRoomController, RoomRejectionError, } from '@antha/multiplayer-core';
2
2
  import { ensureArray, log, makeWritable, } from '@augment-vir/common';
3
3
  import { convertDuration } from 'date-vir';
4
- import { defineTypedCustomEvent, ListenTarget } from 'typed-event-target';
4
+ import { defineTypedCustomEvent, ListenTarget, } from 'typed-event-target';
5
5
  /**
6
6
  * Message type for {@link P2pLockStepMessage}.
7
7
  *
@@ -85,11 +85,6 @@ export class P2pLockStepMultiplayerController extends ListenTarget {
85
85
  get clientId() {
86
86
  return this.roomConnection?.clientId || this.localClientId;
87
87
  }
88
- /**
89
- * Listen for room list updates, including while connected to a room.
90
- *
91
- * If a callback is provided, it is called each time the room list is updated.
92
- */
93
88
  startRoomUpdates(callback) {
94
89
  return this.roomController.startRoomUpdates(callback);
95
90
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antha/multiplayer-p2p-lock-step",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Multiplayer mod for the Antha engine.",
5
5
  "keywords": [
6
6
  "vir",
@@ -49,7 +49,7 @@
49
49
  "istanbul-smart-text-reporter": "^1.1.5"
50
50
  },
51
51
  "peerDependencies": {
52
- "@antha/multiplayer-core": "^0.0.3"
52
+ "@antha/multiplayer-core": "^0.0.4"
53
53
  },
54
54
  "engines": {
55
55
  "node": ">=22"