@rbxts/tether 1.4.6 → 1.4.8
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.
|
@@ -234,7 +234,7 @@ do
|
|
|
234
234
|
if functions == nil then
|
|
235
235
|
return nil
|
|
236
236
|
end
|
|
237
|
-
local data = self:
|
|
237
|
+
local data = self.serdes:deserializePacket(message, serializedPacket)
|
|
238
238
|
for callback in functions do
|
|
239
239
|
self:executeClientCallback(callback, message, data)
|
|
240
240
|
end
|
|
@@ -246,7 +246,7 @@ do
|
|
|
246
246
|
if callbacks == nil then
|
|
247
247
|
return nil
|
|
248
248
|
end
|
|
249
|
-
local data = self:
|
|
249
|
+
local data = self.serdes:deserializePacket(message, serializedPacket)
|
|
250
250
|
for callback in callbacks do
|
|
251
251
|
if isServer then
|
|
252
252
|
local _arg0 = player ~= nil
|
|
@@ -275,11 +275,6 @@ do
|
|
|
275
275
|
end
|
|
276
276
|
callback(newData)
|
|
277
277
|
end
|
|
278
|
-
function MessageEmitter:deserializeAndValidate(message, serializedPacket)
|
|
279
|
-
local data = self.serdes:deserializePacket(message, serializedPacket)
|
|
280
|
-
self:validateData(message, data)
|
|
281
|
-
return data
|
|
282
|
-
end
|
|
283
278
|
end
|
|
284
279
|
return {
|
|
285
280
|
MessageEmitter = MessageEmitter,
|
package/out/structs.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Modding } from "@flamework/core";
|
|
2
|
-
import type { SerializerMetadata, SerializedData,
|
|
2
|
+
import type { SerializerMetadata, SerializedData, StripMeta } from "@rbxts/serio";
|
|
3
3
|
export type MessageCallback<T = unknown> = ServerMessageCallback<T> | ClientMessageCallback<T>;
|
|
4
4
|
export type FunctionMessageCallback<T = unknown, R = unknown> = ServerFunctionMessageCallback<T, R> | ClientFunctionMessageCallback<T, R>;
|
|
5
5
|
export type ClientMessageCallback<T = unknown> = (data: T) => void;
|
|
@@ -15,11 +15,11 @@ export interface SerializedPacket extends SerializedData {
|
|
|
15
15
|
readonly messageBuf: buffer;
|
|
16
16
|
}
|
|
17
17
|
export type MessageEvent = (...packets: SerializedPacket[]) => void;
|
|
18
|
-
export interface MessageMetadata<MessageData, Kind extends keyof MessageData> {
|
|
19
|
-
readonly guard: SchemaGuard<MessageData[Kind]>;
|
|
20
|
-
readonly serializerMetadata: MessageData[Kind] extends undefined ? undefined : Modding.Many<SerializerMetadata<MessageData[Kind]>>;
|
|
21
|
-
}
|
|
22
18
|
export type Guard<T = unknown> = (value: unknown) => value is T;
|
|
19
|
+
export interface MessageMetadata<T> {
|
|
20
|
+
readonly guard: Modding.Generic<StripMeta<T>, "guard">;
|
|
21
|
+
readonly serializerMetadata: T extends undefined ? undefined : SerializerMetadata<T>;
|
|
22
|
+
}
|
|
23
23
|
export type MessageEmitterMetadata<MessageData> = {
|
|
24
|
-
readonly [
|
|
24
|
+
readonly [K in keyof MessageData as K]: MessageMetadata<MessageData[K]>;
|
|
25
25
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rbxts/tether",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.8",
|
|
4
4
|
"main": "out/init.luau",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"setup-rokit": "rokit trust lune-org/lune && rokit trust rojo-rbx/rojo && rokit install",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"rbxts-transformer-flamework": "^1.3.2",
|
|
37
37
|
"roblox-ts": "^3.0.0",
|
|
38
38
|
"ts-toolbelt": "^9.6.0",
|
|
39
|
-
"typescript": "
|
|
39
|
+
"typescript": "=5.5.3"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@flamework/core": "^1.3.2",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@rbxts/flamework-meta-utils": "^1.0.7",
|
|
45
45
|
"@rbxts/object-utils": "^1.0.4",
|
|
46
46
|
"@rbxts/repr": "^1.0.3",
|
|
47
|
-
"@rbxts/serio": "^1.1.
|
|
47
|
+
"@rbxts/serio": "^1.1.3",
|
|
48
48
|
"@rbxts/services": "^1.6.0",
|
|
49
49
|
"@rbxts/trash": "^1.0.8"
|
|
50
50
|
}
|