@nativewrappers/redm 0.0.163 → 0.0.164
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/Command.d.ts +3 -0
- package/common/Command.js +4 -3
- package/package.json +1 -1
package/common/Command.d.ts
CHANGED
|
@@ -6,6 +6,9 @@ export interface ParameterTypes extends ParameterTypeOverrides {
|
|
|
6
6
|
playerId: ParameterTypeOverrides extends {
|
|
7
7
|
playerId: infer T;
|
|
8
8
|
} ? T : number;
|
|
9
|
+
serverSource: ParameterTypeOverrides extends {
|
|
10
|
+
serverSource: infer T;
|
|
11
|
+
} ? T : number;
|
|
9
12
|
string: string;
|
|
10
13
|
longString: string;
|
|
11
14
|
}
|
package/common/Command.js
CHANGED
|
@@ -60,7 +60,7 @@ registerParameterType("string", (arg) => {
|
|
|
60
60
|
throw new TypeError(`could not parse argument into a valid playerId`);
|
|
61
61
|
}
|
|
62
62
|
if (GetPlayerFromServerId(target) === -1) {
|
|
63
|
-
|
|
63
|
+
return void 0;
|
|
64
64
|
}
|
|
65
65
|
return target;
|
|
66
66
|
});
|
|
@@ -76,7 +76,7 @@ registerParameterType("string", (arg) => {
|
|
|
76
76
|
throw new TypeError(`could not parse argument into a valid playerId`);
|
|
77
77
|
}
|
|
78
78
|
if (!DoesPlayerExist(target)) {
|
|
79
|
-
|
|
79
|
+
return void 0;
|
|
80
80
|
}
|
|
81
81
|
return target;
|
|
82
82
|
});
|
|
@@ -143,7 +143,8 @@ class Command {
|
|
|
143
143
|
raw
|
|
144
144
|
};
|
|
145
145
|
const parser = commandTypeParserRegistry.get("playerId");
|
|
146
|
-
const
|
|
146
|
+
const serverSourceParser = commandTypeParserRegistry.get("serverSource");
|
|
147
|
+
const parsedSource = source2 > 0 ? parser?.("me", defaultContextObject) ?? source2 : serverSourceParser?.(String(source2), defaultContextObject) ?? source2;
|
|
147
148
|
const mapped = {
|
|
148
149
|
source: parsedSource,
|
|
149
150
|
raw
|