@nativewrappers/common 0.0.53 → 0.0.54
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/net/NetworkedMap.d.ts +1 -0
- package/net/NetworkedMap.js +3 -0
- package/package.json +1 -1
package/net/NetworkedMap.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare class NetworkedMap<K, V> extends Map<K, V> {
|
|
|
8
8
|
private onPlayerDropped;
|
|
9
9
|
addSubscriber(sub: number): void;
|
|
10
10
|
removeSubscriber(sub: number): boolean;
|
|
11
|
+
hasSubscriber(sub: number): boolean;
|
|
11
12
|
listenForChange(key: K, fn: ChangeListener<V>): void;
|
|
12
13
|
set(key: K, value: V): this;
|
|
13
14
|
clear(): void;
|
package/net/NetworkedMap.js
CHANGED
|
@@ -57,6 +57,9 @@ export class NetworkedMap extends Map {
|
|
|
57
57
|
removeSubscriber(sub) {
|
|
58
58
|
return this.#subscribers.delete(sub);
|
|
59
59
|
}
|
|
60
|
+
hasSubscriber(sub) {
|
|
61
|
+
return this.#subscribers.has(sub);
|
|
62
|
+
}
|
|
60
63
|
#handleSync(msgpack_data) {
|
|
61
64
|
const data = msgpack_unpack(msgpack_data);
|
|
62
65
|
for (const change_data of data) {
|