@dcl/protocol 1.0.0-28050011172.commit-c96236d → 1.0.0-28172947415.commit-c2f6832

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.
Files changed (51) hide show
  1. package/README.md +201 -0
  2. package/out-js/decentraland/kernel/apis/restricted_actions.gen.d.ts +21 -0
  3. package/out-js/decentraland/kernel/apis/restricted_actions.gen.js +85 -6
  4. package/out-js/decentraland/kernel/apis/restricted_actions.gen.js.map +1 -1
  5. package/out-js/decentraland/kernel/comms/rfc4/comms.gen.d.ts +21 -0
  6. package/out-js/decentraland/kernel/comms/rfc4/comms.gen.js +124 -4
  7. package/out-js/decentraland/kernel/comms/rfc4/comms.gen.js.map +1 -1
  8. package/out-js/decentraland/sdk/components/avatar_modifier_area.gen.d.ts +2 -0
  9. package/out-js/decentraland/sdk/components/avatar_modifier_area.gen.js +7 -0
  10. package/out-js/decentraland/sdk/components/avatar_modifier_area.gen.js.map +1 -1
  11. package/out-js/decentraland/sdk/components/avatar_shape.gen.d.ts +8 -0
  12. package/out-js/decentraland/sdk/components/avatar_shape.gen.js +35 -1
  13. package/out-js/decentraland/sdk/components/avatar_shape.gen.js.map +1 -1
  14. package/out-ts/decentraland/kernel/apis/restricted_actions.gen.ts +89 -3
  15. package/out-ts/decentraland/kernel/comms/rfc4/comms.gen.ts +166 -2
  16. package/out-ts/decentraland/sdk/components/avatar_modifier_area.gen.ts +7 -0
  17. package/out-ts/decentraland/sdk/components/avatar_shape.gen.ts +34 -0
  18. package/package.json +9 -6
  19. package/proto/decentraland/common/options.proto +30 -0
  20. package/proto/decentraland/common/quantization_example.proto +132 -0
  21. package/proto/decentraland/kernel/apis/restricted_actions.proto +7 -0
  22. package/proto/decentraland/kernel/comms/rfc4/comms.proto +11 -0
  23. package/proto/decentraland/pulse/pulse_client.proto +77 -0
  24. package/proto/decentraland/pulse/pulse_server.proto +138 -0
  25. package/proto/decentraland/pulse/pulse_shared.proto +48 -0
  26. package/proto/decentraland/sdk/components/avatar_modifier_area.proto +1 -0
  27. package/proto/decentraland/sdk/components/avatar_shape.proto +5 -0
  28. package/proto/decentraland/sdk/components/light_source.proto +1 -1
  29. package/proto/decentraland/sdk/components/virtual_camera.proto +2 -0
  30. package/protoc-gen-bitwise/generator_csharp.js +215 -0
  31. package/protoc-gen-bitwise/options.js +108 -0
  32. package/protoc-gen-bitwise/plugin.js +87 -0
  33. package/protoc-gen-bitwise/runtime/cs/BitReader.cs +112 -0
  34. package/protoc-gen-bitwise/runtime/cs/BitWriter.cs +117 -0
  35. package/protoc-gen-bitwise/runtime/cs/Quantize.cs +35 -0
  36. package/protoc-gen-bitwise/wire.js +239 -0
  37. package/proto/buf.yaml +0 -47
  38. package/proto/google/LICENSE +0 -27
  39. package/proto/google/README.md +0 -1
  40. package/proto/google/api/annotations.json +0 -83
  41. package/proto/google/api/annotations.proto +0 -11
  42. package/proto/google/api/http.json +0 -86
  43. package/proto/google/api/http.proto +0 -31
  44. package/proto/google/protobuf/api.json +0 -118
  45. package/proto/google/protobuf/api.proto +0 -34
  46. package/proto/google/protobuf/descriptor.json +0 -739
  47. package/proto/google/protobuf/descriptor.proto +0 -286
  48. package/proto/google/protobuf/source_context.json +0 -20
  49. package/proto/google/protobuf/source_context.proto +0 -7
  50. package/proto/google/protobuf/type.json +0 -202
  51. package/proto/google/protobuf/type.proto +0 -89
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcl/protocol",
3
- "version": "1.0.0-28050011172.commit-c96236d",
3
+ "version": "1.0.0-28172947415.commit-c2f6832",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,10 +13,11 @@
13
13
  "license": "Apache-2.0",
14
14
  "main": "index.js",
15
15
  "scripts": {
16
- "test": "./scripts/check-proto-compabitility.sh"
16
+ "test": "./scripts/check-proto-compabitility.sh",
17
+ "gen:test": "node protoc-gen-bitwise/test/generator.test.js"
17
18
  },
18
19
  "devDependencies": {
19
- "@protobuf-ts/protoc": "^2.8.1",
20
+ "@protobuf-ts/protoc": "^2.11.0",
20
21
  "proto-compatibility-tool": "^1.1.2-20220925163655.commit-25bd040",
21
22
  "typescript": "^5.0.4"
22
23
  },
@@ -28,10 +29,12 @@
28
29
  "protobufjs": "7.2.4"
29
30
  },
30
31
  "files": [
31
- "proto",
32
+ "proto/decentraland",
32
33
  "out-ts",
33
34
  "out-js",
34
- "public"
35
+ "public",
36
+ "protoc-gen-bitwise/*.js",
37
+ "protoc-gen-bitwise/runtime"
35
38
  ],
36
- "commit": "c96236d758e1571b643cfe62e1513d43389dd394"
39
+ "commit": "c2f6832f0d96aa567c97c019fc4959aa23f7c0e1"
37
40
  }
@@ -0,0 +1,30 @@
1
+ syntax = "proto3";
2
+
3
+ package decentraland.common;
4
+
5
+ import "google/protobuf/descriptor.proto";
6
+
7
+ // Options for quantizing a float value stored as a uint32 field.
8
+ // The float is clamped to [min, max] and uniformly quantized to N bits;
9
+ // protobuf encodes the resulting uint32 as a varint on the wire.
10
+ // The generator emits a float {Name}Quantized accessor in the partial class.
11
+ message QuantizedFloatOptions {
12
+ float min = 1;
13
+ float max = 2;
14
+ uint32 bits = 3;
15
+ }
16
+
17
+ // Options for bit-packing an integer field into fewer than 32 bits.
18
+ message BitPackedOptions {
19
+ uint32 bits = 1;
20
+ }
21
+
22
+ extend google.protobuf.FieldOptions {
23
+ // Apply to uint32 fields to enable quantized float encoding.
24
+ // Example: uint32 dx = 1 [(decentraland.common.quantized) = { min: -100.0, max: 100.0, bits: 16 }];
25
+ QuantizedFloatOptions quantized = 50001;
26
+
27
+ // Apply to uint32 fields to pack into fewer bits.
28
+ // Example: uint32 entity_id = 4 [(decentraland.common.bit_packed) = { bits: 20 }];
29
+ BitPackedOptions bit_packed = 50002;
30
+ }
@@ -0,0 +1,132 @@
1
+ syntax = "proto3";
2
+
3
+ package decentraland.common;
4
+
5
+ import "decentraland/common/options.proto";
6
+
7
+ // High-frequency player state messages sent on Channel 1 (unreliable sequenced).
8
+ //
9
+ // Every message below uses the protoc-gen-bitwise annotations to minimise
10
+ // wire size. Wire costs are listed per-message so the trade-offs are clear.
11
+ //
12
+ // Annotation cheat-sheet:
13
+ // [(decentraland.common.quantized) = { min: F, max: F, bits: N }]
14
+ // → stores a float as a uint32 quantized to N bits over [min, max].
15
+ // → protobuf encodes the uint32 as a varint: values ≤ 2^14-1 cost 2 bytes,
16
+ // values ≤ 2^21-1 cost 3 bytes; the generated partial class adds a
17
+ // float {Name}Quantized accessor that encodes/decodes transparently.
18
+ // [(decentraland.common.bit_packed) = { bits: N }]
19
+ // → documents that this uint32 uses at most N bits; protobuf encodes it
20
+ // as a varint (same savings, no generated accessor needed).
21
+ // (no annotation)
22
+ // → standard protobuf encoding (bool/double/etc. at natural width).
23
+ //
24
+ // Varint byte costs at worst-case (all bits set):
25
+ // ≤ 7 bits → 1 byte (max 127)
26
+ // ≤ 14 bits → 2 bytes (max 16 383)
27
+ // ≤ 21 bits → 3 bytes (max 2 097 151)
28
+ // Proto3 omits fields equal to their default value (0), so average cost is lower.
29
+
30
+ // ---------------------------------------------------------------------------
31
+ // PositionDelta — Δ position relative to last acknowledged full snapshot.
32
+ //
33
+ // Sent every client tick (~10 Hz) on Channel 1.
34
+ //
35
+ // Field | Type | Range | Q bits | Wire worst-case
36
+ // ------------|--------|----------------|--------|-----------------------
37
+ // dx | uint32 | [-100, 100] | 16 | tag 1B + varint 3B = 4B
38
+ // dy | uint32 | [-100, 100] | 16 | tag 1B + varint 3B = 4B
39
+ // dz | uint32 | [-100, 100] | 16 | tag 1B + varint 3B = 4B
40
+ // entity_id | uint32 | [0, 1 048 575] | 20 | tag 1B + varint 3B = 4B
41
+ // sequence | uint32 | [0, 4 095] | 12 | tag 1B + varint 2B = 3B
42
+ // ---------------------------------------------------------------------------
43
+ // Worst-case: 19 B (vs. 20 B raw: 3×float + 2×uint32)
44
+ // Step: dx/dy/dz ≈ 0.003 units
45
+ // ---------------------------------------------------------------------------
46
+ message PositionDelta {
47
+ uint32 dx = 1 [(decentraland.common.quantized) = { min: -100.0, max: 100.0, bits: 16 }];
48
+ uint32 dy = 2 [(decentraland.common.quantized) = { min: -100.0, max: 100.0, bits: 16 }];
49
+ uint32 dz = 3 [(decentraland.common.quantized) = { min: -100.0, max: 100.0, bits: 16 }];
50
+ uint32 entity_id = 4 [(decentraland.common.bit_packed) = { bits: 20 }];
51
+ uint32 sequence = 5 [(decentraland.common.bit_packed) = { bits: 12 }];
52
+ }
53
+
54
+ // ---------------------------------------------------------------------------
55
+ // PlayerInput — client input snapshot for server-side reconciliation.
56
+ //
57
+ // Sent every client frame (~30 Hz) on Channel 1.
58
+ //
59
+ // Field | Type | Range | Q bits | Wire worst-case
60
+ // ------------|--------|----------------|--------|-----------------------
61
+ // move_x | uint32 | [-1, 1] | 8 | tag 1B + varint 2B = 3B
62
+ // move_z | uint32 | [-1, 1] | 8 | tag 1B + varint 2B = 3B
63
+ // yaw | uint32 | [-180, 180] | 12 | tag 1B + varint 2B = 3B
64
+ // buttons | uint32 | bitmask | 8 | tag 1B + varint 2B = 3B
65
+ // sequence | uint32 | [0, 4 095] | 12 | tag 1B + varint 2B = 3B
66
+ // ---------------------------------------------------------------------------
67
+ // Worst-case: 15 B (vs. 20 B raw: 3×float + 2×uint32)
68
+ // Step: move_x/move_z ≈ 0.008; yaw ≈ 0.088°
69
+ // ---------------------------------------------------------------------------
70
+ message PlayerInput {
71
+ // Normalised joystick axes in [-1, 1].
72
+ uint32 move_x = 1 [(decentraland.common.quantized) = { min: -1.0, max: 1.0, bits: 8 }];
73
+ uint32 move_z = 2 [(decentraland.common.quantized) = { min: -1.0, max: 1.0, bits: 8 }];
74
+
75
+ // Horizontal look direction in degrees.
76
+ uint32 yaw = 3 [(decentraland.common.quantized) = { min: -180.0, max: 180.0, bits: 12 }];
77
+
78
+ // Bitmask of active buttons (see ButtonFlags below).
79
+ uint32 buttons = 4 [(decentraland.common.bit_packed) = { bits: 8 }];
80
+
81
+ // Rolling input sequence number used by the server for reconciliation.
82
+ uint32 sequence = 5 [(decentraland.common.bit_packed) = { bits: 12 }];
83
+ }
84
+
85
+ // Bitmask values for PlayerInput.buttons.
86
+ enum ButtonFlags {
87
+ BF_NONE = 0;
88
+ BF_JUMP = 1; // bit 0
89
+ BF_SPRINT = 2; // bit 1
90
+ BF_INTERACT = 4; // bit 2
91
+ BF_EMOTE = 8; // bit 3
92
+ BF_CROUCH = 16; // bit 4
93
+ // bits 5-7 reserved
94
+ }
95
+
96
+ // ---------------------------------------------------------------------------
97
+ // AvatarStateSnapshot — full authoritative state, sent on Channel 0 (reliable)
98
+ // or on resync requests. Demonstrates wider ranges and mixed encodings.
99
+ //
100
+ // Field | Type | Range | Q bits | Wire worst-case
101
+ // -----------------|--------|------------------|--------|-----------------------
102
+ // x | uint32 | [-4096, 4096] | 16 | tag 1B + varint 3B = 4B
103
+ // y | uint32 | [-256, 256] | 14 | tag 1B + varint 2B = 3B
104
+ // z | uint32 | [-4096, 4096] | 16 | tag 1B + varint 3B = 4B
105
+ // pitch | uint32 | [-90, 90] | 10 | tag 1B + varint 2B = 3B
106
+ // yaw | uint32 | [-180, 180] | 12 | tag 1B + varint 2B = 3B
107
+ // entity_id | uint32 | [0, 1 048 575] | 20 | tag 1B + varint 3B = 4B
108
+ // animation_state | uint32 | [0, 63] | 6 | tag 1B + varint 1B = 2B
109
+ // is_grounded | bool | — | — | tag 1B + varint 1B = 2B
110
+ // timestamp | double | — | — | tag 1B + fixed64 8B = 9B
111
+ // ---------------------------------------------------------------------------
112
+ // Worst-case: 34 B (vs. 45 B raw: 5×float + 2×uint32 + bool + double)
113
+ // Step: x/z ≈ 0.125 units; y ≈ 0.031 units; pitch ≈ 0.176°; yaw ≈ 0.088°
114
+ // ---------------------------------------------------------------------------
115
+ message AvatarStateSnapshot {
116
+ // World-space position.
117
+ uint32 x = 1 [(decentraland.common.quantized) = { min: -4096.0, max: 4096.0, bits: 16 }];
118
+ uint32 y = 2 [(decentraland.common.quantized) = { min: -256.0, max: 256.0, bits: 14 }];
119
+ uint32 z = 3 [(decentraland.common.quantized) = { min: -4096.0, max: 4096.0, bits: 16 }];
120
+
121
+ // View angles.
122
+ uint32 pitch = 4 [(decentraland.common.quantized) = { min: -90.0, max: 90.0, bits: 10 }];
123
+ uint32 yaw = 5 [(decentraland.common.quantized) = { min: -180.0, max: 180.0, bits: 12 }];
124
+
125
+ // Identity and animation state.
126
+ uint32 entity_id = 6 [(decentraland.common.bit_packed) = { bits: 20 }];
127
+ uint32 animation_state = 7 [(decentraland.common.bit_packed) = { bits: 6 }];
128
+
129
+ // Un-annotated fields — encoded at their natural width.
130
+ bool is_grounded = 8;
131
+ double timestamp = 9; // server epoch milliseconds
132
+ }
@@ -16,6 +16,7 @@ message TeleportToRequest {
16
16
 
17
17
  message TriggerEmoteRequest {
18
18
  string predefined_emote = 1;
19
+ optional uint32 mask = 2;
19
20
  }
20
21
 
21
22
  message ChangeRealmRequest {
@@ -40,6 +41,7 @@ message CommsAdapterRequest {
40
41
  message TriggerSceneEmoteRequest {
41
42
  string src = 1;
42
43
  optional bool loop = 2;
44
+ optional uint32 mask = 3;
43
45
  }
44
46
 
45
47
  message SuccessResponse {
@@ -60,6 +62,8 @@ message CopyToClipboardRequest {
60
62
 
61
63
  message EmptyResponse { }
62
64
 
65
+ message StopEmoteRequest { }
66
+
63
67
  service RestrictedActionsService {
64
68
  // MovePlayerTo will move the player to a position relative to the current scene.
65
69
  // If 'duration' field is used in the request, the success response depends on the
@@ -90,4 +94,7 @@ service RestrictedActionsService {
90
94
 
91
95
  // CopyToClipboard copies the provided text into the clipboard
92
96
  rpc CopyToClipboard(CopyToClipboardRequest) returns (EmptyResponse) {}
97
+
98
+ // StopEmote will stop the current emote
99
+ rpc StopEmote(StopEmoteRequest) returns (SuccessResponse) {}
93
100
  }
@@ -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 {
@@ -0,0 +1,77 @@
1
+ syntax = "proto3";
2
+
3
+ package decentraland.pulse;
4
+
5
+ import "decentraland/common/vectors.proto";
6
+ import "decentraland/pulse/pulse_shared.proto";
7
+
8
+ message HandshakeRequest {
9
+ bytes auth_chain = 1;
10
+ int32 profile_version = 2;
11
+ optional PlayerInitialState initial_state = 3;
12
+ }
13
+
14
+ // Describes the initial state of the player if (re-)connected in the middle of the session
15
+ message PlayerInitialState {
16
+ PlayerState state = 1;
17
+ optional string emote_id = 2;
18
+ optional uint32 emote_duration_ms = 3;
19
+ // Indicates how many milliseconds ago the emote was started
20
+ optional uint32 emote_start_offset_ms = 4;
21
+ // Non-empty realm identifier. Rejected if empty.
22
+ string realm = 5;
23
+ optional int32 emote_mask = 6;
24
+ }
25
+
26
+ // Similarly to the LiveKit pipeline, a peer announces the version of its profile but
27
+ // it only does it when it's changed as it's sent reliably and stored on the server for other peers
28
+ message ProfileVersionAnnouncement {
29
+ int32 version = 1;
30
+ }
31
+
32
+ // Since the server doesn't simulate the scenes state, it trusts the values from the client
33
+ message PlayerStateInput {
34
+ PlayerState state = 1;
35
+ }
36
+
37
+ // Client sends resync request if it has a gap in the known sequences and, thus, can't apply a delta.
38
+ // It's sent reliably to prevent further desynchronization
39
+ message ResyncRequest {
40
+ uint32 subject_id = 1;
41
+ // highest seq the client actually has for this subject
42
+ uint32 known_seq = 2;
43
+ }
44
+
45
+ // Client → Server. Client requests to start an emote.
46
+ message EmoteStart {
47
+ string emote_id = 1;
48
+ optional uint32 duration_ms = 2;
49
+ PlayerState player_state = 3;
50
+ optional int32 mask = 4;
51
+ }
52
+
53
+ // Client → Server. Client requests to stop a looping emote.
54
+ // One-shot emotes are terminated by the server timer.
55
+ message EmoteStop {
56
+ }
57
+
58
+ // Client → Server. Also announces the peer's realm; peers in different realms never see each
59
+ // other. Must be the first gameplay message after handshake. Same-realm re-teleports are valid.
60
+ message TeleportRequest {
61
+ int32 parcel_index = 1;
62
+ decentraland.common.Vector3 position = 2;
63
+ // Non-empty realm identifier. Rejected if empty.
64
+ string realm = 3;
65
+ }
66
+
67
+ message ClientMessage {
68
+ oneof message {
69
+ HandshakeRequest handshake = 1;
70
+ PlayerStateInput input = 2;
71
+ ResyncRequest resync = 3;
72
+ ProfileVersionAnnouncement profile_announcement = 4;
73
+ EmoteStart emote_start = 5;
74
+ EmoteStop emote_stop = 6;
75
+ TeleportRequest teleport = 7;
76
+ }
77
+ }
@@ -0,0 +1,138 @@
1
+ syntax = "proto3";
2
+
3
+ package decentraland.pulse;
4
+
5
+ import "decentraland/common/options.proto";
6
+ import "decentraland/pulse/pulse_shared.proto";
7
+
8
+ message HandshakeResponse {
9
+ bool success = 1;
10
+ optional string error = 2;
11
+ }
12
+
13
+ message PlayerProfileVersionsAnnounced {
14
+ uint32 subject_id = 1;
15
+ int32 version = 2;
16
+ }
17
+
18
+ message PlayerStateDeltaTier0 {
19
+ uint32 subject_id = 1;
20
+
21
+ // Between two consecutive server simulation ticks, the subject may have sent multiple inputs, each incrementing Seq by 1. So
22
+ // the delta's NewSeq will naturally jump by more than 1 compared to the previous delta — even with zero packet loss.
23
+ // Without the "BaselineSeq" the client has no way to detect the package loss
24
+ uint32 baseline_seq = 2;
25
+ uint32 new_seq = 3;
26
+ uint32 server_tick = 4;
27
+
28
+ // While the player doesn't cross the parcel, this field is omitted from diff
29
+ optional int32 parcel_index = 5;
30
+
31
+ // X position inside the parcel
32
+ optional uint32 position_x = 6 [(decentraland.common.quantized) = { min: 0, max: 16, bits: 8 }];
33
+
34
+ // Y position
35
+ optional uint32 position_y = 7 [(decentraland.common.quantized) = { min: 0, max: 200, bits: 13 }];
36
+
37
+ // Z position inside the parcel
38
+ optional uint32 position_z = 8 [(decentraland.common.quantized) = { min: 0, max: 16, bits: 8 }];
39
+
40
+ optional uint32 velocity_x = 9 [(decentraland.common.quantized) = { min: -50, max: 50, bits: 8 }];
41
+ optional uint32 velocity_y = 10 [(decentraland.common.quantized) = { min: -50, max: 50, bits: 8 }];
42
+ optional uint32 velocity_z = 11 [(decentraland.common.quantized) = { min: -50, max: 50, bits: 8 }];
43
+
44
+ optional uint32 rotation_y = 12 [(decentraland.common.quantized) = { min: 0, max: 360.0, bits: 7 }];
45
+ optional uint32 movement_blend = 13 [(decentraland.common.quantized) = { min: 0, max: 3, bits: 5 }];
46
+ optional uint32 slide_blend = 14 [(decentraland.common.quantized) = { min: 0, max: 1, bits: 4 }];
47
+ optional uint32 head_yaw = 15 [(decentraland.common.quantized) = { min: 0, max: 360.0, bits: 7 }];
48
+ optional uint32 head_pitch = 16 [(decentraland.common.quantized) = { min: 0, max: 360.0, bits: 7 }];
49
+
50
+ optional uint32 state_flags = 17;
51
+ optional GlideState glide_state = 18;
52
+
53
+ optional int32 jump_count = 19;
54
+
55
+ // Absolute world hit position the player is pointing at.
56
+ // Only meaningful when POINTING_AT is set in `state_flags`.
57
+ //
58
+ // X/Z use 17 bits over the world span (~±3000m, covers GenesisCity + border +
59
+ // raycast cutoff) which yields ~0.046m steps — at least as fine as the player's
60
+ // own parcel_index + position_x/z combined precision (0.0625m), so no separate
61
+ // parcel index is needed for point-at.
62
+ //
63
+ // Y uses 7 bits over the player altitude range (matches position_y), step ~1.6m.
64
+ // Point At is not supposed to change frequently so the wire overhead should be minimal
65
+ optional uint32 point_at_x = 20 [(decentraland.common.quantized) = { min: -3000.0, max: 3000.0, bits: 17 }];
66
+ optional uint32 point_at_y = 21 [(decentraland.common.quantized) = { min: 0.0, max: 200.0, bits: 7 }];
67
+ optional uint32 point_at_z = 22 [(decentraland.common.quantized) = { min: -3000.0, max: 3000.0, bits: 17 }];
68
+ }
69
+
70
+ // Full State is sent to the client when it is out of sync, and can't recover with a diff only
71
+ message PlayerStateFull {
72
+ uint32 subject_id = 1;
73
+ uint32 sequence = 2;
74
+ uint32 server_tick = 3;
75
+ PlayerState state = 4;
76
+ }
77
+
78
+ // Notification to the client, that a peer has joined, it can mean connection or entering the area of interest, it's up to the server to decide
79
+ message PlayerJoined {
80
+ string user_id = 1;
81
+ int32 profile_version = 2;
82
+ PlayerStateFull state = 3;
83
+ }
84
+
85
+ // Notification to the client, that a peer has left, it can mean disconnection or leaving the area of interest
86
+ message PlayerLeft {
87
+ uint32 subject_id = 1;
88
+ }
89
+
90
+ enum EmoteStopReason {
91
+ COMPLETED = 0; // one-shot timer expired on the server
92
+ CANCELLED = 1; // client sent EmoteStop (looping emotes)
93
+ }
94
+
95
+ // Server → All Observers
96
+ // Full player state is piggybacked to ensure the emote is played in the right place.
97
+ // Observers use server_tick to scrub animation forward by transit latency.
98
+ message EmoteStarted {
99
+ uint32 subject_id = 1;
100
+ uint32 sequence = 2;
101
+ uint32 server_tick = 3;
102
+ string emote_id = 4;
103
+ PlayerState player_state = 5;
104
+ optional int32 mask = 6;
105
+ }
106
+
107
+ // Server → All Observers
108
+ // Client resumes MovementInput only after receiving this.
109
+ // Carries full PlayerState so the client can snap to the correct position on resume.
110
+ message EmoteStopped {
111
+ uint32 subject_id = 1;
112
+ uint32 server_tick = 2;
113
+ EmoteStopReason reason = 3;
114
+ uint32 sequence = 4;
115
+ PlayerState player_state = 5;
116
+ }
117
+
118
+ // Server → All Observers
119
+ message TeleportPerformed {
120
+ uint32 subject_id = 1;
121
+ uint32 sequence = 2;
122
+ uint32 server_tick = 3;
123
+ PlayerState state = 4;
124
+ }
125
+
126
+ message ServerMessage {
127
+ oneof message {
128
+ HandshakeResponse handshake = 1;
129
+ PlayerStateFull player_state_full = 2;
130
+ PlayerStateDeltaTier0 player_state_delta = 3;
131
+ PlayerJoined player_joined = 4;
132
+ PlayerLeft player_left = 5;
133
+ PlayerProfileVersionsAnnounced player_profile_version_announced = 6;
134
+ EmoteStarted emote_started = 7;
135
+ EmoteStopped emote_stopped = 8;
136
+ TeleportPerformed teleported = 9;
137
+ }
138
+ }
@@ -0,0 +1,48 @@
1
+ syntax = "proto3";
2
+
3
+ package decentraland.pulse;
4
+
5
+ import "decentraland/common/vectors.proto";
6
+
7
+ enum PlayerAnimationFlags {
8
+ NONE = 0;
9
+ GROUNDED = 1;
10
+ LONG_JUMP = 2;
11
+ LONG_FALL = 4;
12
+ FALLING = 8;
13
+ STUNNED = 16;
14
+ HEAD_YAW = 32;
15
+ HEAD_PITCH = 64;
16
+ POINTING_AT = 128;
17
+ }
18
+
19
+ enum GlideState {
20
+ PROP_CLOSED = 0;
21
+ OPENING_PROP = 1;
22
+ GLIDING = 2;
23
+ CLOSING_PROP = 3;
24
+ }
25
+
26
+ message PlayerState {
27
+ int32 parcel_index = 1;
28
+
29
+ decentraland.common.Vector3 position = 2;
30
+ decentraland.common.Vector3 velocity = 3;
31
+
32
+ float rotation_y = 4;
33
+
34
+ float movement_blend = 5;
35
+ float slide_blend = 6;
36
+
37
+ optional float head_yaw = 7;
38
+ optional float head_pitch = 8;
39
+
40
+ uint32 state_flags = 9;
41
+ GlideState glide_state = 10;
42
+
43
+ int32 jump_count = 11;
44
+
45
+ // Absolute world hit position the player is pointing at.
46
+ // Only meaningful when POINTING_AT is set in `state_flags`.
47
+ optional decentraland.common.Vector3 point_at = 12;
48
+ }
@@ -29,4 +29,5 @@ message PBAvatarModifierArea {
29
29
  enum AvatarModifierType {
30
30
  AMT_HIDE_AVATARS = 0; // avatars are invisible
31
31
  AMT_DISABLE_PASSPORTS = 1; // selecting (e.g. clicking) an avatar will not bring up their profile.
32
+ AMT_HIDE_NAMETAGS = 2; // the name tag displayed above an avatar is hidden.
32
33
  }
@@ -42,3 +42,8 @@ message PBAvatarShape {
42
42
  optional bool show_only_wearables = 12; // hides the skin + hair + facial features (default: false)
43
43
  }
44
44
 
45
+ // Mask for which bones an animation applies to.
46
+ enum AvatarEmoteMask {
47
+ AEM_FULL_BODY = 0;
48
+ AEM_UPPER_BODY = 1;
49
+ }
@@ -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
+ }
@@ -10,7 +10,9 @@ option (common.ecs_component_id) = 1076;
10
10
  // an 'instant' transition (like using speed/time = 0)
11
11
  // * The lookAtEntity defines to which entity the Camera has to look at constantly (independent from
12
12
  // the holding entity transform).
13
+ // * The fov defines the Field of View of the virtual camera
13
14
  message PBVirtualCamera {
14
15
  optional common.CameraTransition default_transition = 1;
15
16
  optional uint32 look_at_entity = 2;
17
+ optional float fov = 3; // default: 60
16
18
  }