@rbxts/tether 1.3.10 → 1.3.11
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/README.md +11 -9
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
A message-based networking solution for Roblox with automatic binary serialization and type validation.
|
|
4
4
|
|
|
5
|
+
This package uses [Serio](https://www.npmjs.com/package/@rbxts/serio) for binary serialization, so to find more info on schemas, check it out!
|
|
6
|
+
|
|
5
7
|
> [!CAUTION]
|
|
6
8
|
> Depends on `rbxts-transformer-flamework`!
|
|
7
9
|
|
|
@@ -11,7 +13,7 @@ A message-based networking solution for Roblox with automatic binary serializati
|
|
|
11
13
|
|
|
12
14
|
```ts
|
|
13
15
|
import { MessageEmitter } from "@rbxts/tether";
|
|
14
|
-
import type {
|
|
16
|
+
import type { Packed, u8 } from "@rbxts/serio";
|
|
15
17
|
|
|
16
18
|
export const messaging = MessageEmitter.create<MessageData>();
|
|
17
19
|
|
|
@@ -23,9 +25,9 @@ export const enum Message {
|
|
|
23
25
|
export interface MessageData {
|
|
24
26
|
[Message.Test]: {
|
|
25
27
|
readonly foo: string;
|
|
26
|
-
readonly n:
|
|
28
|
+
readonly n: u8;
|
|
27
29
|
};
|
|
28
|
-
[Message.Packed]:
|
|
30
|
+
[Message.Packed]: Packed<{
|
|
29
31
|
readonly boolean1: boolean;
|
|
30
32
|
readonly boolean2: boolean;
|
|
31
33
|
readonly boolean3: boolean;
|
|
@@ -72,7 +74,7 @@ For each function you will need two messages. One to invoke the function, and on
|
|
|
72
74
|
|
|
73
75
|
```ts
|
|
74
76
|
import { MessageEmitter } from "@rbxts/tether";
|
|
75
|
-
import type {
|
|
77
|
+
import type { u8 } from "@rbxts/serio";
|
|
76
78
|
|
|
77
79
|
export const messaging = MessageEmitter.create<MessageData>();
|
|
78
80
|
|
|
@@ -82,8 +84,8 @@ export const enum Message {
|
|
|
82
84
|
}
|
|
83
85
|
|
|
84
86
|
export interface MessageData {
|
|
85
|
-
[Message.Increment]:
|
|
86
|
-
[Message.IncrementReturn]:
|
|
87
|
+
[Message.Increment]: u8;
|
|
88
|
+
[Message.IncrementReturn]: u8;
|
|
87
89
|
}
|
|
88
90
|
```
|
|
89
91
|
|
|
@@ -188,7 +190,7 @@ export function incrementNumberData(): ServerMiddleware<number> {
|
|
|
188
190
|
|
|
189
191
|
```ts
|
|
190
192
|
import { MessageEmitter, BuiltinMiddlewares } from "@rbxts/tether";
|
|
191
|
-
import type {
|
|
193
|
+
import type { Packed, u8 } from "@rbxts/serio";
|
|
192
194
|
|
|
193
195
|
export const messaging = MessageEmitter.create<MessageData>();
|
|
194
196
|
messaging.middleware
|
|
@@ -212,9 +214,9 @@ export const enum Message {
|
|
|
212
214
|
export interface MessageData {
|
|
213
215
|
[Message.Test]: {
|
|
214
216
|
readonly foo: string;
|
|
215
|
-
readonly n:
|
|
217
|
+
readonly n: u8;
|
|
216
218
|
};
|
|
217
|
-
[Message.Packed]:
|
|
219
|
+
[Message.Packed]: Packed<{
|
|
218
220
|
readonly boolean1: boolean;
|
|
219
221
|
readonly boolean2: boolean;
|
|
220
222
|
readonly boolean3: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rbxts/tether",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.11",
|
|
4
4
|
"main": "out/init.lua",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "rbxtsc",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@rbxts/flamework-meta-utils": "^1.0.6",
|
|
44
44
|
"@rbxts/object-utils": "^1.0.4",
|
|
45
45
|
"@rbxts/repr": "^1.0.1",
|
|
46
|
-
"@rbxts/serio": "^1.0.
|
|
46
|
+
"@rbxts/serio": "^1.0.16",
|
|
47
47
|
"@rbxts/services": "^1.5.5",
|
|
48
48
|
"ts-toolbelt": "^9.6.0"
|
|
49
49
|
}
|