@dcl/protocol 1.0.0-2569677750.commit-6ce832a → 1.0.0-2611857113.commit-45ed75b

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 (43) hide show
  1. package/ecs/components/Animator.proto +18 -0
  2. package/ecs/components/AudioSource.proto +13 -0
  3. package/ecs/components/AudioStream.proto +10 -0
  4. package/ecs/components/AvatarModifierArea.proto +15 -0
  5. package/ecs/components/BoxShape.proto +11 -0
  6. package/ecs/components/CameraModeArea.proto +14 -0
  7. package/ecs/components/CylinderShape.proto +12 -0
  8. package/ecs/components/GLTFShape.proto +11 -0
  9. package/ecs/components/NFTShape.proto +16 -0
  10. package/ecs/components/OnPointerDown.proto +11 -0
  11. package/ecs/components/OnPointerDownResult.proto +16 -0
  12. package/ecs/components/OnPointerUp.proto +11 -0
  13. package/ecs/components/OnPointerUpResult.proto +16 -0
  14. package/ecs/components/PlaneShape.proto +11 -0
  15. package/ecs/components/README.md +32 -0
  16. package/ecs/components/SphereShape.proto +10 -0
  17. package/ecs/components/TextShape.proto +33 -0
  18. package/ecs/components/Transform.md +25 -0
  19. package/ecs/components/UiTransform.proto +159 -0
  20. package/ecs/components/common/Color3.proto +8 -0
  21. package/ecs/components/common/Vector3.proto +7 -0
  22. package/ecs/components/common/id.md +2 -0
  23. package/ecs/components/common/id.proto +7 -0
  24. package/kernel/apis/CommunicationsController.proto +11 -0
  25. package/kernel/apis/DevTools.proto +12 -0
  26. package/kernel/apis/EngineAPI.proto +184 -0
  27. package/kernel/apis/EnvironmentAPI.proto +68 -0
  28. package/kernel/apis/EthereumController.proto +53 -0
  29. package/kernel/apis/ExperimentalAPI.proto +16 -0
  30. package/kernel/apis/ParcelIdentity.proto +42 -0
  31. package/kernel/apis/Permissions.proto +30 -0
  32. package/kernel/apis/Players.proto +28 -0
  33. package/kernel/apis/PortableExperiences.proto +40 -0
  34. package/kernel/apis/RestrictedActions.proto +25 -0
  35. package/kernel/apis/SceneStateStorageController.proto +114 -0
  36. package/kernel/apis/SignedFetch.proto +24 -0
  37. package/kernel/apis/SocialController.proto +15 -0
  38. package/kernel/apis/UserActionModule.proto +11 -0
  39. package/kernel/apis/UserIdentity.proto +41 -0
  40. package/kernel/comms/v1/broker.proto +114 -0
  41. package/kernel/comms/v1/comms.proto +68 -0
  42. package/kernel/comms/v2/comms.proto +59 -0
  43. package/package.json +4 -4
@@ -0,0 +1,18 @@
1
+ syntax = "proto3";
2
+
3
+ import "common/id.proto";
4
+ option (ecs_component_id) = 1042;
5
+
6
+ message PBAnimator {
7
+ repeated PBAnimationState states = 1;
8
+ }
9
+
10
+ message PBAnimationState {
11
+ string name = 1;
12
+ string clip = 2;
13
+ bool playing = 3;
14
+ float weight = 4;
15
+ float speed = 5;
16
+ bool loop = 6;
17
+ bool should_reset = 7;
18
+ }
@@ -0,0 +1,13 @@
1
+ syntax = "proto3";
2
+
3
+ import "common/id.proto";
4
+ option (ecs_component_id) = 1020;
5
+
6
+ message PBAudioSource {
7
+ bool playing = 1;
8
+ float volume = 2;
9
+ bool loop = 3;
10
+ float pitch = 4;
11
+ int32 played_at_timestamp = 5;
12
+ string audio_clip_url = 6;
13
+ }
@@ -0,0 +1,10 @@
1
+ syntax = "proto3";
2
+
3
+ import "common/id.proto";
4
+ option (ecs_component_id) = 1021;
5
+
6
+ message PBAudioStream {
7
+ bool playing = 1;
8
+ float volume = 2;
9
+ string url = 3;
10
+ }
@@ -0,0 +1,15 @@
1
+ syntax = "proto3";
2
+
3
+ import "common/id.proto";
4
+ option (ecs_component_id) = 1070;
5
+ import "common/Vector3.proto";
6
+
7
+ message PBAvatarModifierArea {
8
+ Vector3 area = 1;
9
+ repeated string exclude_ids = 2;
10
+ repeated Modifier modifiers = 3;
11
+ enum Modifier {
12
+ HIDE_AVATARS = 0;
13
+ DISABLE_PASSPORTS = 1;
14
+ }
15
+ }
@@ -0,0 +1,11 @@
1
+ syntax = "proto3";
2
+
3
+ import "common/id.proto";
4
+ option (ecs_component_id) = 1013;
5
+
6
+ message PBBoxShape {
7
+ bool with_collisions = 1;
8
+ bool is_pointer_blocker = 2;
9
+ bool visible = 3;
10
+ repeated float uvs = 4;
11
+ }
@@ -0,0 +1,14 @@
1
+ syntax = "proto3";
2
+
3
+ import "common/id.proto";
4
+ option (ecs_component_id) = 1071;
5
+ import "common/Vector3.proto";
6
+
7
+ message PBCameraModeArea {
8
+ Vector3 area = 1;
9
+ CameraMode mode = 2;
10
+ enum CameraMode {
11
+ FIRST_PERSON = 0;
12
+ THIRD_PERSON = 1;
13
+ }
14
+ }
@@ -0,0 +1,12 @@
1
+ syntax = "proto3";
2
+
3
+ import "common/id.proto";
4
+ option (ecs_component_id) = 1016;
5
+
6
+ message PBCylinderShape {
7
+ bool with_collisions = 1;
8
+ bool is_pointer_blocker = 2;
9
+ bool visible = 3;
10
+ float radius_top = 4;
11
+ float radius_bottom = 5;
12
+ }
@@ -0,0 +1,11 @@
1
+ syntax = "proto3";
2
+
3
+ import "common/id.proto";
4
+ option (ecs_component_id) = 1041;
5
+
6
+ message PBGLTFShape {
7
+ bool with_collisions = 1;
8
+ bool is_pointer_blocker = 2;
9
+ bool visible = 3;
10
+ string src = 4;
11
+ }
@@ -0,0 +1,16 @@
1
+ syntax = "proto3";
2
+
3
+ import "common/id.proto";
4
+ option (ecs_component_id) = 1040;
5
+
6
+ import "common/Color3.proto";
7
+
8
+ message PBNFTShape {
9
+ bool with_collisions = 1;
10
+ bool is_pointer_blocker = 2;
11
+ bool visible = 3;
12
+ string src = 4;
13
+ string asset_id = 5;
14
+ int32 style = 6;
15
+ Color3 color = 7;
16
+ }
@@ -0,0 +1,11 @@
1
+ syntax = "proto3";
2
+
3
+ import "common/id.proto";
4
+ option (ecs_component_id) = 1060;
5
+
6
+ message PBOnPointerDown {
7
+ int32 button = 1;
8
+ string hover_text = 2;
9
+ float distance = 3;
10
+ bool show_feedback = 4;
11
+ }
@@ -0,0 +1,16 @@
1
+ syntax = "proto3";
2
+
3
+ import "common/id.proto";
4
+ option (ecs_component_id) = 1066;
5
+ import "common/Vector3.proto";
6
+
7
+ message PBOnPointerDownResult {
8
+ int32 button = 2;
9
+ string meshName = 3;
10
+ Vector3 origin = 4;
11
+ Vector3 direction = 5;
12
+ Vector3 point = 6;
13
+ Vector3 normal = 7;
14
+ float distance = 8;
15
+ int32 timestamp = 9;
16
+ }
@@ -0,0 +1,11 @@
1
+ syntax = "proto3";
2
+
3
+ import "common/id.proto";
4
+ option (ecs_component_id) = 1061;
5
+
6
+ message PBOnPointerUp {
7
+ int32 button = 1;
8
+ string hover_text = 2;
9
+ float distance = 3;
10
+ bool show_feedback = 4;
11
+ }
@@ -0,0 +1,16 @@
1
+ syntax = "proto3";
2
+
3
+ import "common/id.proto";
4
+ option (ecs_component_id) = 1065;
5
+ import "common/Vector3.proto";
6
+
7
+ message PBOnPointerUpResult {
8
+ int32 button = 2;
9
+ string meshName = 3;
10
+ Vector3 origin = 4;
11
+ Vector3 direction = 5;
12
+ Vector3 point = 6;
13
+ Vector3 normal = 7;
14
+ float distance = 8;
15
+ int32 timestamp = 9;
16
+ }
@@ -0,0 +1,11 @@
1
+ syntax = "proto3";
2
+
3
+ import "common/id.proto";
4
+ option (ecs_component_id) = 1014;
5
+
6
+ message PBPlaneShape {
7
+ bool with_collisions = 1;
8
+ bool is_pointer_blocker = 2;
9
+ bool visible = 3;
10
+ repeated float uvs = 4;
11
+ }
@@ -0,0 +1,32 @@
1
+ # How to add a new ECS Component with Protocol-Buffers
2
+
3
+ In this directory, we have all the components with the schema `ComponentName.proto`. `ComponentName` has to be PascalCase, and the `.proto` is the extension that is recognized as protocol-buffer schema.
4
+
5
+ Inside each proto, we need to have at least this template:
6
+ ```proto
7
+ syntax = "proto3";
8
+
9
+ import "common/id.proto";
10
+ option (ecs_component_id) = XXXX;
11
+
12
+ message PBComponentName {
13
+ float one_parameter = 1;
14
+ }
15
+
16
+ ```
17
+
18
+ Some points that must be well-defined:
19
+ - `XXXX` the component ID is a super important property of the component, and it has to be unique at least between proto, otherwise, the code generation will fail.
20
+ - `PBComponentName` the root message has to be the same as the file name with the prefix `PB`
21
+ - `one_parameter` each parameter name has to be snake_case.
22
+
23
+
24
+ ## Common directory
25
+ The common directory only has to have unambiguous structures like Vector3, Color3, Quaternion, etc. These messages will never change.
26
+
27
+ ## About specific options with other languages
28
+ The definition must be the minimal proto code, and it shouldn't have a specific option to compile on some platform. So if you have to add additional information to the proto, you will be able to run a post-process after the protocol schemas acquisition.
29
+ For example, in the unity-renderer repo, it'll be necessary to add the `csharp_namespace` option but it's the responsibility of this particular implementation. This code option doesn't define how the component is.
30
+
31
+ # Test component
32
+ If you write a proto and then push, CI will fail because the tests will fail. All the components need to be tested. `@dcl/ecs/test/components` has some examples!
@@ -0,0 +1,10 @@
1
+ syntax = "proto3";
2
+
3
+ import "common/id.proto";
4
+ option (ecs_component_id) = 1015;
5
+
6
+ message PBSphereShape {
7
+ bool with_collisions = 1;
8
+ bool is_pointer_blocker = 2;
9
+ bool visible = 3;
10
+ }
@@ -0,0 +1,33 @@
1
+ syntax = "proto3";
2
+
3
+ import "common/id.proto";
4
+ option (ecs_component_id) = 1030;
5
+
6
+ import "common/Color3.proto";
7
+
8
+ message PBTextShape {
9
+ string text = 1;
10
+ bool visible = 2;
11
+ string font = 3;
12
+ float opacity = 4;
13
+ float font_Size = 5;
14
+ bool font_autoSize = 6;
15
+ string h_text_align = 7;
16
+ string v_text_align = 8;
17
+ float width = 9;
18
+ float height = 10;
19
+ float padding_top = 11;
20
+ float padding_right = 12;
21
+ float padding_bottom = 13;
22
+ float padding_left = 14;
23
+ float line_spacing = 15;
24
+ int32 line_count = 16;
25
+ bool text_wrapping = 17;
26
+ float shadow_blur = 18;
27
+ float shadow_offsetX = 19;
28
+ float shadow_offsetY = 20;
29
+ float outline_width = 21;
30
+ Color3 shadow_color = 22;
31
+ Color3 outline_color = 23;
32
+ Color3 text_color = 24;
33
+ }
@@ -0,0 +1,25 @@
1
+
2
+ # Transform
3
+
4
+ Transform is not a protocol-buffer definition, because it uses the native byte-buffer to write directly on the wire. This allows the consumer to copy the message directly on memory and the component be serialized a little bit faster.
5
+
6
+ ```cpp
7
+ // Transform length = 44
8
+ struct Transform {
9
+ float positionX;
10
+ float positionY;
11
+ float positionZ;
12
+
13
+ float rotationX;
14
+ float rotationY;
15
+ float rotationZ;
16
+ float rotationW;
17
+
18
+ float scaleX;
19
+ float scaleY;
20
+ float scaleZ;
21
+
22
+ uint32_t parentEntity;
23
+ };
24
+ ```
25
+ - Serialized in big-endian
@@ -0,0 +1,159 @@
1
+ syntax = "proto3";
2
+
3
+ import "common/id.proto";
4
+ option (ecs_component_id) = 1050;
5
+
6
+ enum YGPositionType {
7
+ YGPositionTypeStatic = 0;
8
+ YGPositionTypeRelative = 1;
9
+ YGPositionTypeAbsolute = 2;
10
+ }
11
+
12
+ enum YGAlign {
13
+ YGAlignAuto = 0;
14
+ YGAlignFlexStart = 1;
15
+ YGAlignCenter = 2;
16
+ YGAlignFlexEnd = 3;
17
+ YGAlignStretch = 4;
18
+ YGAlignBaseline = 5;
19
+ YGAlignSpaceBetween = 6;
20
+ YGAlignSpaceAround = 7;
21
+ }
22
+
23
+ enum YGUnit {
24
+ YGUnitUndefined = 0;
25
+ YGUnitPoint = 1;
26
+ YGUnitPercent = 2;
27
+ YGUnitAuto = 3;
28
+ }
29
+
30
+ enum YGDirection {
31
+ YGDirectionInherit = 0;
32
+ YGDirectionLTR = 1;
33
+ YGDirectionRTL = 2;
34
+ }
35
+
36
+ enum YGFlexDirection {
37
+ YGFlexDirectionColumn = 0;
38
+ YGFlexDirectionColumnReverse = 1;
39
+ YGFlexDirectionRow = 2;
40
+ YGFlexDirectionRowReverse = 3;
41
+ }
42
+
43
+ enum YGWrap {
44
+ YGWrapNoWrap = 0;
45
+ YGWrapWrap = 1;
46
+ YGWrapWrapReverse = 2;
47
+ }
48
+
49
+ enum YGJustify {
50
+ YGJustifyFlexStart = 0;
51
+ YGJustifyCenter = 1;
52
+ YGJustifyFlexEnd = 2;
53
+ YGJustifySpaceBetween = 3;
54
+ YGJustifySpaceAround = 4;
55
+ YGJustifySpaceEvenly = 5;
56
+ }
57
+
58
+ enum YGOverflow {
59
+ YGOverflowVisible = 0;
60
+ YGOverflowHidden = 1;
61
+ YGOverflowScroll = 2;
62
+ }
63
+
64
+ enum YGDisplay {
65
+ YGDisplayFlex = 0;
66
+ YGDisplayNone = 1;
67
+ }
68
+
69
+ enum YGEdge {
70
+ YGEdgeLeft = 0;
71
+ YGEdgeTop = 1;
72
+ YGEdgeRight = 2;
73
+ YGEdgeBottom = 3;
74
+ YGEdgeStart = 4;
75
+ YGEdgeEnd = 5;
76
+ YGEdgeHorizontal = 6;
77
+ YGEdgeVertical = 7;
78
+ YGEdgeAll = 8;
79
+ }
80
+
81
+ message PBUiTransform {
82
+ YGPositionType position_type = 1;
83
+
84
+ YGAlign align_content = 2;
85
+ YGAlign align_items = 3;
86
+ YGAlign align_self = 4;
87
+ YGFlexDirection flex_direction = 5;
88
+ YGWrap flex_wrap = 6;
89
+ YGJustify justify_content = 7;
90
+
91
+ YGOverflow overflow = 8;
92
+ YGDisplay display = 9;
93
+ YGDirection direction = 10;
94
+
95
+ float flex = 11;
96
+
97
+ YGUnit flex_basis_unit = 13;
98
+ float flex_basis = 14;
99
+
100
+ float flex_grow = 15;
101
+ float flex_shrink = 16;
102
+
103
+ YGUnit width_unit = 17;
104
+ float width = 18;
105
+ YGUnit height_unit = 19;
106
+ float height = 20;
107
+
108
+ YGUnit min_width_unit = 21;
109
+ float min_width = 22;
110
+ YGUnit min_height_unit = 23;
111
+ float min_height = 24;
112
+
113
+ YGUnit max_width_unit = 31;
114
+ float max_width = 32;
115
+ YGUnit max_height_unit = 33;
116
+ float max_height = 34;
117
+
118
+ // non-standard
119
+ reserved 40; // float aspect_ratio = 40;
120
+
121
+ YGUnit position_left_unit = 41;
122
+ float position_left = 42;
123
+ YGUnit position_top_unit = 43;
124
+ float position_top = 44;
125
+ YGUnit position_right_unit = 45;
126
+ float position_right = 46;
127
+ YGUnit position_bottom_unit = 47;
128
+ float position_bottom = 48;
129
+
130
+ // margin
131
+ YGUnit margin_left_unit = 51;
132
+ float margin_left = 52;
133
+ YGUnit margin_top_unit = 53;
134
+ float margin_top = 54;
135
+ YGUnit margin_right_unit = 55;
136
+ float margin_right = 56;
137
+ YGUnit margin_bottom_unit = 57;
138
+ float margin_bottom = 58;
139
+
140
+ YGUnit padding_left_unit = 61;
141
+ float padding_left = 62;
142
+ YGUnit padding_top_unit = 63;
143
+ float padding_top = 64;
144
+ YGUnit padding_right_unit = 65;
145
+ float padding_right = 66;
146
+ YGUnit padding_bottom_unit = 67;
147
+ float padding_bottom = 68;
148
+
149
+ reserved 71; // YGUnit border_left_unit = 71;
150
+ float border_left = 72;
151
+ reserved 73; // YGUnit border_top_unit = 73;
152
+ float border_top = 74;
153
+ reserved 75; // YGUnit border_right_unit = 75;
154
+ float border_right = 76;
155
+ reserved 77; // YGUnit border_bottom_unit = 77;
156
+ float border_bottom = 78;
157
+ }
158
+
159
+
@@ -0,0 +1,8 @@
1
+ syntax = "proto3";
2
+
3
+ message Color3 {
4
+ float r = 1;
5
+ float g = 2;
6
+ float b = 3;
7
+ }
8
+
@@ -0,0 +1,7 @@
1
+ syntax = "proto3";
2
+
3
+ message Vector3 {
4
+ float x = 1;
5
+ float y = 2;
6
+ float z = 3;
7
+ }
@@ -0,0 +1,2 @@
1
+ # Why id as file option?
2
+ Extending this option in the component definition allows having the data of its ID in the protocol buffer code generator.
@@ -0,0 +1,7 @@
1
+ syntax = "proto3";
2
+
3
+ import "google/protobuf/descriptor.proto";
4
+
5
+ extend google.protobuf.FileOptions {
6
+ optional int32 ecs_component_id = 50000;
7
+ }
@@ -0,0 +1,11 @@
1
+ syntax = "proto3";
2
+
3
+ message RealSendRequest {
4
+ string message = 1;
5
+ }
6
+
7
+ message RealSendResponse {}
8
+
9
+ service CommunicationsControllerService {
10
+ rpc Send(RealSendRequest) returns (RealSendResponse) {}
11
+ }
@@ -0,0 +1,12 @@
1
+ syntax = "proto3";
2
+
3
+ message DevToolsBody {
4
+ string type = 1;
5
+ string json_payload = 2;
6
+ }
7
+
8
+ message EventResponse {}
9
+
10
+ service DevToolsService {
11
+ rpc Event(DevToolsBody) returns (EventResponse) {}
12
+ }