@dcl/protocol 1.0.0-33408122230.commit-0e30273 → 1.0.0-33413306233.commit-16d337c
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/out-js/decentraland/kernel/comms/rfc4/comms.gen.d.ts +21 -0
- package/out-js/decentraland/kernel/comms/rfc4/comms.gen.js +124 -4
- package/out-js/decentraland/kernel/comms/rfc4/comms.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/avatar_nametag.gen.d.ts +54 -0
- package/out-js/decentraland/sdk/components/avatar_nametag.gen.js +117 -0
- package/out-js/decentraland/sdk/components/avatar_nametag.gen.js.map +1 -0
- package/out-js/decentraland/sdk/components/avatar_shape.gen.d.ts +8 -0
- package/out-js/decentraland/sdk/components/avatar_shape.gen.js +35 -1
- package/out-js/decentraland/sdk/components/avatar_shape.gen.js.map +1 -1
- package/out-ts/decentraland/kernel/comms/rfc4/comms.gen.ts +166 -2
- package/out-ts/decentraland/sdk/components/avatar_nametag.gen.ts +158 -0
- package/out-ts/decentraland/sdk/components/avatar_shape.gen.ts +34 -0
- package/package.json +3 -3
- package/proto/decentraland/kernel/comms/rfc4/comms.proto +11 -0
- package/proto/decentraland/pulse/pulse_client.proto +8 -27
- package/proto/decentraland/sdk/components/avatar_nametag.proto +31 -0
- package/proto/decentraland/sdk/components/avatar_shape.proto +5 -0
- package/proto/decentraland/sdk/components/light_source.proto +1 -1
- package/public/sdk-components.proto +1 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import _m0 from "protobufjs/minimal";
|
|
3
|
+
import { Color3 } from "../../common/colors.gen";
|
|
4
|
+
|
|
5
|
+
export const protobufPackage = "decentraland.sdk.components";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The AvatarNametag component adds a plate with scene-provided text above an avatar's nametag,
|
|
9
|
+
* for example to show a rank or a role that the scene assigns to that player.
|
|
10
|
+
*
|
|
11
|
+
* Valid only on an avatar-bearing entity:
|
|
12
|
+
* - the local player: `engine.PlayerEntity`
|
|
13
|
+
* - another player in the scene: that player's entity
|
|
14
|
+
* - an NPC: any entity with an AvatarShape
|
|
15
|
+
* Writes to any other entity are ignored.
|
|
16
|
+
*
|
|
17
|
+
* Player entity ids are not stable across disconnects: a write to a stale entity lands on
|
|
18
|
+
* whoever holds that id next. Resolve the entity from the user id on every write, and remove
|
|
19
|
+
* the component when the player leaves the scene.
|
|
20
|
+
*
|
|
21
|
+
* The plate is local to the client that renders it; it is never relayed to other players.
|
|
22
|
+
*/
|
|
23
|
+
export interface PBAvatarNametag {
|
|
24
|
+
/** The plate text: a single line, for example "Club Owner". Empty draws the plate without text. */
|
|
25
|
+
label: string;
|
|
26
|
+
/** (default: the client's native nametag text color) */
|
|
27
|
+
labelColor?:
|
|
28
|
+
| Color3
|
|
29
|
+
| undefined;
|
|
30
|
+
/** (default: the client's native nametag background color) */
|
|
31
|
+
backgroundColor?:
|
|
32
|
+
| Color3
|
|
33
|
+
| undefined;
|
|
34
|
+
/** (default: background_color, so the plate carries no visible border) */
|
|
35
|
+
borderColor?: Color3 | undefined;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function createBasePBAvatarNametag(): PBAvatarNametag {
|
|
39
|
+
return { label: "", labelColor: undefined, backgroundColor: undefined, borderColor: undefined };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export namespace PBAvatarNametag {
|
|
43
|
+
export function encode(message: PBAvatarNametag, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
44
|
+
if (message.label !== "") {
|
|
45
|
+
writer.uint32(10).string(message.label);
|
|
46
|
+
}
|
|
47
|
+
if (message.labelColor !== undefined) {
|
|
48
|
+
Color3.encode(message.labelColor, writer.uint32(18).fork()).ldelim();
|
|
49
|
+
}
|
|
50
|
+
if (message.backgroundColor !== undefined) {
|
|
51
|
+
Color3.encode(message.backgroundColor, writer.uint32(26).fork()).ldelim();
|
|
52
|
+
}
|
|
53
|
+
if (message.borderColor !== undefined) {
|
|
54
|
+
Color3.encode(message.borderColor, writer.uint32(34).fork()).ldelim();
|
|
55
|
+
}
|
|
56
|
+
return writer;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBAvatarNametag {
|
|
60
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
61
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
62
|
+
const message = createBasePBAvatarNametag();
|
|
63
|
+
while (reader.pos < end) {
|
|
64
|
+
const tag = reader.uint32();
|
|
65
|
+
switch (tag >>> 3) {
|
|
66
|
+
case 1:
|
|
67
|
+
if (tag !== 10) {
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
message.label = reader.string();
|
|
72
|
+
continue;
|
|
73
|
+
case 2:
|
|
74
|
+
if (tag !== 18) {
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
message.labelColor = Color3.decode(reader, reader.uint32());
|
|
79
|
+
continue;
|
|
80
|
+
case 3:
|
|
81
|
+
if (tag !== 26) {
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
message.backgroundColor = Color3.decode(reader, reader.uint32());
|
|
86
|
+
continue;
|
|
87
|
+
case 4:
|
|
88
|
+
if (tag !== 34) {
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
message.borderColor = Color3.decode(reader, reader.uint32());
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
reader.skipType(tag & 7);
|
|
99
|
+
}
|
|
100
|
+
return message;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function fromJSON(object: any): PBAvatarNametag {
|
|
104
|
+
return {
|
|
105
|
+
label: isSet(object.label) ? String(object.label) : "",
|
|
106
|
+
labelColor: isSet(object.labelColor) ? Color3.fromJSON(object.labelColor) : undefined,
|
|
107
|
+
backgroundColor: isSet(object.backgroundColor) ? Color3.fromJSON(object.backgroundColor) : undefined,
|
|
108
|
+
borderColor: isSet(object.borderColor) ? Color3.fromJSON(object.borderColor) : undefined,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function toJSON(message: PBAvatarNametag): unknown {
|
|
113
|
+
const obj: any = {};
|
|
114
|
+
message.label !== undefined && (obj.label = message.label);
|
|
115
|
+
message.labelColor !== undefined &&
|
|
116
|
+
(obj.labelColor = message.labelColor ? Color3.toJSON(message.labelColor) : undefined);
|
|
117
|
+
message.backgroundColor !== undefined &&
|
|
118
|
+
(obj.backgroundColor = message.backgroundColor ? Color3.toJSON(message.backgroundColor) : undefined);
|
|
119
|
+
message.borderColor !== undefined &&
|
|
120
|
+
(obj.borderColor = message.borderColor ? Color3.toJSON(message.borderColor) : undefined);
|
|
121
|
+
return obj;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function create<I extends Exact<DeepPartial<PBAvatarNametag>, I>>(base?: I): PBAvatarNametag {
|
|
125
|
+
return PBAvatarNametag.fromPartial(base ?? {});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function fromPartial<I extends Exact<DeepPartial<PBAvatarNametag>, I>>(object: I): PBAvatarNametag {
|
|
129
|
+
const message = createBasePBAvatarNametag();
|
|
130
|
+
message.label = object.label ?? "";
|
|
131
|
+
message.labelColor = (object.labelColor !== undefined && object.labelColor !== null)
|
|
132
|
+
? Color3.fromPartial(object.labelColor)
|
|
133
|
+
: undefined;
|
|
134
|
+
message.backgroundColor = (object.backgroundColor !== undefined && object.backgroundColor !== null)
|
|
135
|
+
? Color3.fromPartial(object.backgroundColor)
|
|
136
|
+
: undefined;
|
|
137
|
+
message.borderColor = (object.borderColor !== undefined && object.borderColor !== null)
|
|
138
|
+
? Color3.fromPartial(object.borderColor)
|
|
139
|
+
: undefined;
|
|
140
|
+
return message;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
145
|
+
|
|
146
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
147
|
+
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
148
|
+
: T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
|
|
149
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
150
|
+
: Partial<T>;
|
|
151
|
+
|
|
152
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
153
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
154
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
155
|
+
|
|
156
|
+
function isSet(value: any): boolean {
|
|
157
|
+
return value !== null && value !== undefined;
|
|
158
|
+
}
|
|
@@ -5,6 +5,40 @@ import { Color3 } from "../../common/colors.gen";
|
|
|
5
5
|
|
|
6
6
|
export const protobufPackage = "decentraland.sdk.components";
|
|
7
7
|
|
|
8
|
+
/** Mask for which bones an animation applies to. */
|
|
9
|
+
export enum AvatarEmoteMask {
|
|
10
|
+
AEM_FULL_BODY = 0,
|
|
11
|
+
AEM_UPPER_BODY = 1,
|
|
12
|
+
UNRECOGNIZED = -1,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function avatarEmoteMaskFromJSON(object: any): AvatarEmoteMask {
|
|
16
|
+
switch (object) {
|
|
17
|
+
case 0:
|
|
18
|
+
case "AEM_FULL_BODY":
|
|
19
|
+
return AvatarEmoteMask.AEM_FULL_BODY;
|
|
20
|
+
case 1:
|
|
21
|
+
case "AEM_UPPER_BODY":
|
|
22
|
+
return AvatarEmoteMask.AEM_UPPER_BODY;
|
|
23
|
+
case -1:
|
|
24
|
+
case "UNRECOGNIZED":
|
|
25
|
+
default:
|
|
26
|
+
return AvatarEmoteMask.UNRECOGNIZED;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function avatarEmoteMaskToJSON(object: AvatarEmoteMask): string {
|
|
31
|
+
switch (object) {
|
|
32
|
+
case AvatarEmoteMask.AEM_FULL_BODY:
|
|
33
|
+
return "AEM_FULL_BODY";
|
|
34
|
+
case AvatarEmoteMask.AEM_UPPER_BODY:
|
|
35
|
+
return "AEM_UPPER_BODY";
|
|
36
|
+
case AvatarEmoteMask.UNRECOGNIZED:
|
|
37
|
+
default:
|
|
38
|
+
return "UNRECOGNIZED";
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
8
42
|
/**
|
|
9
43
|
* The AvatarShape component contains the information required to draw and animate avatar, acting as
|
|
10
44
|
* a simplified GLTF container for this specific case.
|
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-33413306233.commit-16d337c",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"gen:test": "node protoc-gen-bitwise/test/generator.test.js"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@protobuf-ts/protoc": "^2.
|
|
20
|
+
"@protobuf-ts/protoc": "^2.11.0",
|
|
21
21
|
"proto-compatibility-tool": "^1.1.2-20220925163655.commit-25bd040",
|
|
22
22
|
"typescript": "^5.0.4"
|
|
23
23
|
},
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"protoc-gen-bitwise/*.js",
|
|
37
37
|
"protoc-gen-bitwise/runtime"
|
|
38
38
|
],
|
|
39
|
-
"commit": "
|
|
39
|
+
"commit": "16d337cd30ab02bace13c90ca3823da27c79597e"
|
|
40
40
|
}
|
|
@@ -94,6 +94,14 @@ message PlayerEmote {
|
|
|
94
94
|
uint32 incremental_id = 1;
|
|
95
95
|
string urn = 2;
|
|
96
96
|
float timestamp = 3;
|
|
97
|
+
optional bool is_stopping = 4; // true means the emote has been stopped in the sender's client
|
|
98
|
+
optional bool is_repeating = 5; // true when it is not the first time the looping animation plays
|
|
99
|
+
optional int32 interaction_id = 6; // identifies an interaction univocaly, established when the start animation is triggered
|
|
100
|
+
optional int32 social_emote_outcome = 7; // -1 means it does not use an outcome animation
|
|
101
|
+
optional bool is_reacting = 8; // to a social emote started by other user
|
|
102
|
+
optional string social_emote_initiator = 9; // wallet address of the user that initiated social emote
|
|
103
|
+
optional string target_avatar = 10; // wallet address of the user whose avatar is the target of a directed emote
|
|
104
|
+
optional uint32 mask = 11; // mask for which bones an animation applies to.
|
|
97
105
|
}
|
|
98
106
|
|
|
99
107
|
message SceneEmote {
|
|
@@ -126,6 +134,9 @@ message ProfileResponse {
|
|
|
126
134
|
message Chat {
|
|
127
135
|
string message = 1;
|
|
128
136
|
double timestamp = 2;
|
|
137
|
+
// Extension: optional forwarded_from to identify the original sender when
|
|
138
|
+
// messages are forwarded through an SFU
|
|
139
|
+
optional string forwarded_from = 3;
|
|
129
140
|
}
|
|
130
141
|
|
|
131
142
|
message Scene {
|
|
@@ -74,35 +74,17 @@ message ParcelRect {
|
|
|
74
74
|
sint32 max_z = 4;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
//
|
|
78
|
-
//
|
|
79
|
-
// observes several realms, as an authoritative server cohosting scenes from several worlds
|
|
80
|
-
// does, announces one of these per realm rather than one realm for the whole connection.
|
|
81
|
-
message SceneListenerAoi {
|
|
82
|
-
// Non-empty realm identifier — same rules as TeleportRequest.realm.
|
|
83
|
-
string realm = 1;
|
|
84
|
-
// This realm's parcels as inclusive rects. The sum of rect areas across every announced
|
|
85
|
-
// realm is capped server-side (SceneListener:MaxParcels) — overlaps count per rect, so
|
|
86
|
-
// announce disjoint rects.
|
|
87
|
-
repeated ParcelRect parcel_rects = 2;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// Scene-listener connect: same signed-fetch auth chain as HandshakeRequest, plus a
|
|
91
|
-
// parcel-set area of interest per realm. No initial state — a listener is never a subject.
|
|
77
|
+
// Scene-listener connect: same signed-fetch auth chain as HandshakeRequest, plus an
|
|
78
|
+
// immutable parcel-set area of interest. No initial state — a listener is never a subject.
|
|
92
79
|
message SceneListenerHandshakeRequest {
|
|
93
80
|
// Signed-fetch headers JSON — identical shape to HandshakeRequest.auth_chain.
|
|
94
81
|
bytes auth_chain = 1;
|
|
95
|
-
//
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
//
|
|
100
|
-
|
|
101
|
-
// authenticated with SceneListenerHandshakeRequest.
|
|
102
|
-
message SceneListenerUpdate {
|
|
103
|
-
// The new AoI, replacing (not extending) the current one — realms absent from it are no
|
|
104
|
-
// longer observed. Same rules and SceneListener:MaxParcels budget as the handshake's.
|
|
105
|
-
repeated SceneListenerAoi aoi = 1;
|
|
82
|
+
// AoI realm partition — same rules as TeleportRequest.realm.
|
|
83
|
+
string realm = 2;
|
|
84
|
+
// Announced AoI as inclusive parcel-coordinate rects; fixed for the connection
|
|
85
|
+
// lifetime. The sum of rect areas is capped server-side (SceneListener:MaxParcels) —
|
|
86
|
+
// overlaps count per rect, so announce disjoint rects.
|
|
87
|
+
repeated ParcelRect parcel_rects = 3;
|
|
106
88
|
}
|
|
107
89
|
|
|
108
90
|
message ClientMessage {
|
|
@@ -115,6 +97,5 @@ message ClientMessage {
|
|
|
115
97
|
EmoteStop emote_stop = 6;
|
|
116
98
|
TeleportRequest teleport = 7;
|
|
117
99
|
SceneListenerHandshakeRequest scene_listener_handshake = 8;
|
|
118
|
-
SceneListenerUpdate scene_listener_update = 9;
|
|
119
100
|
}
|
|
120
101
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package decentraland.sdk.components;
|
|
4
|
+
|
|
5
|
+
import "decentraland/common/colors.proto";
|
|
6
|
+
import "decentraland/sdk/components/common/id.proto";
|
|
7
|
+
|
|
8
|
+
option (common.ecs_component_id) = 1221;
|
|
9
|
+
|
|
10
|
+
// The AvatarNametag component adds a plate with scene-provided text above an avatar's nametag,
|
|
11
|
+
// for example to show a rank or a role that the scene assigns to that player.
|
|
12
|
+
//
|
|
13
|
+
// Valid only on an avatar-bearing entity:
|
|
14
|
+
// - the local player: `engine.PlayerEntity`
|
|
15
|
+
// - another player in the scene: that player's entity
|
|
16
|
+
// - an NPC: any entity with an AvatarShape
|
|
17
|
+
// Writes to any other entity are ignored.
|
|
18
|
+
//
|
|
19
|
+
// Player entity ids are not stable across disconnects: a write to a stale entity lands on
|
|
20
|
+
// whoever holds that id next. Resolve the entity from the user id on every write, and remove
|
|
21
|
+
// the component when the player leaves the scene.
|
|
22
|
+
//
|
|
23
|
+
// The plate is local to the client that renders it; it is never relayed to other players.
|
|
24
|
+
message PBAvatarNametag {
|
|
25
|
+
// The plate text: a single line, for example "Club Owner". Empty draws the plate without text.
|
|
26
|
+
string label = 1;
|
|
27
|
+
|
|
28
|
+
optional decentraland.common.Color3 label_color = 2; // (default: the client's native nametag text color)
|
|
29
|
+
optional decentraland.common.Color3 background_color = 3; // (default: the client's native nametag background color)
|
|
30
|
+
optional decentraland.common.Color3 border_color = 4; // (default: background_color, so the plate carries no visible border)
|
|
31
|
+
}
|
|
@@ -25,4 +25,4 @@ message PBLightSource {
|
|
|
25
25
|
optional float inner_angle = 9; // default = 21.8. Inner angle can't be higher than outer angle, otherwise will default to same value. Min value is 0. Max value is 179.
|
|
26
26
|
optional float outer_angle = 10; // default = 30. Outer angle can't be lower than inner angle, otherwise will inner angle will be set to same value. Max value is 179.
|
|
27
27
|
}
|
|
28
|
-
}
|
|
28
|
+
}
|
|
@@ -9,6 +9,7 @@ import public "decentraland/sdk/components/avatar_base.proto";
|
|
|
9
9
|
import public "decentraland/sdk/components/avatar_emote_command.proto";
|
|
10
10
|
import public "decentraland/sdk/components/avatar_equipped_data.proto";
|
|
11
11
|
import public "decentraland/sdk/components/avatar_modifier_area.proto";
|
|
12
|
+
import public "decentraland/sdk/components/avatar_nametag.proto";
|
|
12
13
|
import public "decentraland/sdk/components/avatar_shape.proto";
|
|
13
14
|
import public "decentraland/sdk/components/billboard.proto";
|
|
14
15
|
import public "decentraland/sdk/components/camera_mode_area.proto";
|