@nativewrappers/server 0.0.168 → 0.0.170
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/common/net/Net.js +1 -1
- package/entities/Player.d.ts +1 -5
- package/entities/Player.js +4 -12
- package/package.json +1 -1
package/common/net/Net.js
CHANGED
|
@@ -38,7 +38,7 @@ class NetServer extends Net {
|
|
|
38
38
|
NetServer.broadcastRaw(sources, message.__proto_name__, encoded);
|
|
39
39
|
}
|
|
40
40
|
static broadcast(sources, eventName, ...args) {
|
|
41
|
-
const packed = msgpack_pack(
|
|
41
|
+
const packed = msgpack_pack(args);
|
|
42
42
|
for (const source of sources) {
|
|
43
43
|
TriggerClientEventInternal(eventName, source, packed, packed.length);
|
|
44
44
|
}
|
package/entities/Player.d.ts
CHANGED
|
@@ -31,11 +31,7 @@ export declare class Player {
|
|
|
31
31
|
*/
|
|
32
32
|
get Src(): string;
|
|
33
33
|
/**
|
|
34
|
-
* Gets the
|
|
35
|
-
* cached
|
|
36
|
-
*
|
|
37
|
-
* Due to the fact that the ped doesn't exist at `playerJoining` this can be
|
|
38
|
-
* `null`
|
|
34
|
+
* Gets the player ped
|
|
39
35
|
*/
|
|
40
36
|
get Ped(): Ped | null;
|
|
41
37
|
get Tokens(): string[];
|
package/entities/Player.js
CHANGED
|
@@ -59,20 +59,12 @@ class Player {
|
|
|
59
59
|
return this.source;
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
|
-
* Gets the
|
|
63
|
-
* cached
|
|
64
|
-
*
|
|
65
|
-
* Due to the fact that the ped doesn't exist at `playerJoining` this can be
|
|
66
|
-
* `null`
|
|
62
|
+
* Gets the player ped
|
|
67
63
|
*/
|
|
68
64
|
get Ped() {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
this.ped = new Ped(GetPlayerPed(this.source));
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return this.ped;
|
|
65
|
+
const ped = GetPlayerPed(this.source);
|
|
66
|
+
if (ped === 0) return null;
|
|
67
|
+
return new Ped(ped);
|
|
76
68
|
}
|
|
77
69
|
get Tokens() {
|
|
78
70
|
return getPlayerTokens(this.source);
|