@dcl/protocol 1.0.0-3524279049.commit-02b9080 → 1.0.0-3576463488.commit-bbfbde4
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
CHANGED
|
@@ -23,4 +23,35 @@ protoc \
|
|
|
23
23
|
1. All .proto files are snake_case.proto.
|
|
24
24
|
2. For pascal or camel case usage, please make a deterministic one from the snake case. Example: nft_shape will transform to NftShape.
|
|
25
25
|
3. See https://docs.buf.build/best-practices/style-guide. The most of other styles are taken from there, the Buf configuration is in proto/buf.yml.
|
|
26
|
-
4. Use public/ folder only for .proto with protocol exposing, that is only for files with `import public`. This folder is not processed by the linter.
|
|
26
|
+
4. Use public/ folder only for .proto with protocol exposing, that is only for files with `import public`. This folder is not processed by the linter.
|
|
27
|
+
|
|
28
|
+
# Dev with Decentraland Repositories
|
|
29
|
+
Many repositories depend on this protocol definition and that sometimes implies some merge order. We don't have to worry much about compatibility because the checks are running with each PR, if you break something, the CI will warn you. But, in some cases, it's desirable to merge the implementation in a specific order to avoid unexpected behavior in the corner cases (multiple repositories are waiting for the build at the same time).
|
|
30
|
+
|
|
31
|
+
Some dev-cases are described here:
|
|
32
|
+
## SDK: New component or component modification
|
|
33
|
+
Repositories: [unity-renderer](https://github.com/decentraland/unity-renderer/) and [js-sdk-toolchain](https://github.com/decentraland/js-sdk-toolchain/)
|
|
34
|
+
|
|
35
|
+
At the protocol level both operations shouldn't be a problem, but `js-sdk-toolchain` CI will fail if the component is not tested. This can happen if the PR **`A`** from the protocol is merged, and you update your PR **`B`** from `js-sdk-toolchain` with the changes before the PR **`A`** from `js-sdk-toolchain` is merged.
|
|
36
|
+
|
|
37
|
+
Some guidelines and testing before merge:
|
|
38
|
+
- The protocol package is uploaded to S3 while developing in a PR. This can be used in the target repositories
|
|
39
|
+
- Testing in the playground: Playground allows us to test by adding query parameters: `https://playground.decentraland.org/?&renderer-branch=**feat/my-new-component**&sdk-branch=**feat/new-component-approach**`
|
|
40
|
+
- Testing locally: you can write an example scene and install the package `@dcl/sdk` uploaded to S3 commented in the PR comments.
|
|
41
|
+
- Testing in the Unity Editor: if you need to test with the editor opened, write the `ws` query parameter in your local or playground test.
|
|
42
|
+
- Start merging when the three PRs are already to merge: first merge the Protocol one, then update the other two with the version @next and merge them at the same time.
|
|
43
|
+
|
|
44
|
+
## SDK: New APIs or APIs modifications
|
|
45
|
+
Repositories: [kernel](https://github.com/decentraland/kernel/), [js-sdk-toolchain](https://github.com/decentraland/js-sdk-toolchain/) and [scene-runtime](https://github.com/decentraland/scene-runtime/)
|
|
46
|
+
In this case, there is no problem with when each PR is merged. It's recommendable to merge first the rpc server-side (in this case, Kernel), second the `scene-runtime` (and this would require a second update from `kernel`) and last the `js-sdk-toolchain`.
|
|
47
|
+
|
|
48
|
+
## Renderer protocol (RPC)
|
|
49
|
+
Repositories: [kernel](https://github.com/decentraland/kernel/) and [unity-renderer](https://github.com/decentraland/unity-renderer/)
|
|
50
|
+
|
|
51
|
+
TODO
|
|
52
|
+
|
|
53
|
+
## BFF
|
|
54
|
+
TODO
|
|
55
|
+
|
|
56
|
+
## Comms
|
|
57
|
+
TODO
|
|
@@ -60,9 +60,11 @@ export interface WsIdentification {
|
|
|
60
60
|
/**
|
|
61
61
|
* This message is received by the peers when the same address logs in in a
|
|
62
62
|
* different session. It should signal that the client should be shut down and not
|
|
63
|
-
* retry any new comms connection.
|
|
63
|
+
* retry any new comms connection. It can also be used to reject new users joining when
|
|
64
|
+
* the room capacity has been reached.
|
|
64
65
|
*/
|
|
65
66
|
export interface WsKicked {
|
|
67
|
+
reason: string;
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
export interface WsPacket {
|
|
@@ -539,11 +541,14 @@ export const WsIdentification = {
|
|
|
539
541
|
};
|
|
540
542
|
|
|
541
543
|
function createBaseWsKicked(): WsKicked {
|
|
542
|
-
return {};
|
|
544
|
+
return { reason: "" };
|
|
543
545
|
}
|
|
544
546
|
|
|
545
547
|
export const WsKicked = {
|
|
546
|
-
encode(
|
|
548
|
+
encode(message: WsKicked, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
549
|
+
if (message.reason !== "") {
|
|
550
|
+
writer.uint32(10).string(message.reason);
|
|
551
|
+
}
|
|
547
552
|
return writer;
|
|
548
553
|
},
|
|
549
554
|
|
|
@@ -554,6 +559,9 @@ export const WsKicked = {
|
|
|
554
559
|
while (reader.pos < end) {
|
|
555
560
|
const tag = reader.uint32();
|
|
556
561
|
switch (tag >>> 3) {
|
|
562
|
+
case 1:
|
|
563
|
+
message.reason = reader.string();
|
|
564
|
+
break;
|
|
557
565
|
default:
|
|
558
566
|
reader.skipType(tag & 7);
|
|
559
567
|
break;
|
|
@@ -562,17 +570,19 @@ export const WsKicked = {
|
|
|
562
570
|
return message;
|
|
563
571
|
},
|
|
564
572
|
|
|
565
|
-
fromJSON(
|
|
566
|
-
return {};
|
|
573
|
+
fromJSON(object: any): WsKicked {
|
|
574
|
+
return { reason: isSet(object.reason) ? String(object.reason) : "" };
|
|
567
575
|
},
|
|
568
576
|
|
|
569
|
-
toJSON(
|
|
577
|
+
toJSON(message: WsKicked): unknown {
|
|
570
578
|
const obj: any = {};
|
|
579
|
+
message.reason !== undefined && (obj.reason = message.reason);
|
|
571
580
|
return obj;
|
|
572
581
|
},
|
|
573
582
|
|
|
574
|
-
fromPartial<I extends Exact<DeepPartial<WsKicked>, I>>(
|
|
583
|
+
fromPartial<I extends Exact<DeepPartial<WsKicked>, I>>(object: I): WsKicked {
|
|
575
584
|
const message = createBaseWsKicked();
|
|
585
|
+
message.reason = object.reason ?? "";
|
|
576
586
|
return message;
|
|
577
587
|
},
|
|
578
588
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/protocol",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-3576463488.commit-bbfbde4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"out-ts",
|
|
26
26
|
"public"
|
|
27
27
|
],
|
|
28
|
-
"commit": "
|
|
28
|
+
"commit": "bbfbde471eb830d5adab4ec50670e73e0a94951d"
|
|
29
29
|
}
|
|
@@ -68,9 +68,12 @@ message WsIdentification {
|
|
|
68
68
|
/**
|
|
69
69
|
* This message is received by the peers when the same address logs in in a
|
|
70
70
|
* different session. It should signal that the client should be shut down and not
|
|
71
|
-
* retry any new comms connection.
|
|
71
|
+
* retry any new comms connection. It can also be used to reject new users joining when
|
|
72
|
+
* the room capacity has been reached.
|
|
72
73
|
*/
|
|
73
|
-
message WsKicked {
|
|
74
|
+
message WsKicked {
|
|
75
|
+
string reason = 1;
|
|
76
|
+
}
|
|
74
77
|
|
|
75
78
|
message WsPacket {
|
|
76
79
|
oneof message {
|
|
@@ -98,4 +101,4 @@ message WsPacket {
|
|
|
98
101
|
// direction: server->client
|
|
99
102
|
WsKicked peer_kicked = 8;
|
|
100
103
|
}
|
|
101
|
-
}
|
|
104
|
+
}
|