@dcl/protocol 1.0.0-30361475985.commit-df8a4ff → 1.0.0-30376440685.commit-2726089
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 +217 -0
- package/out-js/decentraland/kernel/apis/restricted_actions.gen.d.ts +64 -0
- package/out-js/decentraland/kernel/apis/restricted_actions.gen.js +251 -1
- package/out-js/decentraland/kernel/apis/restricted_actions.gen.js.map +1 -1
- 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_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/apis/restricted_actions.gen.ts +263 -0
- package/out-ts/decentraland/kernel/comms/rfc4/comms.gen.ts +166 -2
- package/out-ts/decentraland/sdk/components/avatar_shape.gen.ts +34 -0
- package/package.json +9 -6
- package/proto/decentraland/common/options.proto +51 -0
- package/proto/decentraland/common/quantization_example.proto +164 -0
- package/proto/decentraland/kernel/apis/restricted_actions.proto +39 -0
- package/proto/decentraland/kernel/comms/rfc4/comms.proto +11 -0
- package/proto/decentraland/pulse/pulse_client.proto +79 -0
- package/proto/decentraland/pulse/pulse_server.proto +144 -0
- package/proto/decentraland/pulse/pulse_shared.proto +57 -0
- package/proto/decentraland/sdk/components/avatar_shape.proto +5 -0
- package/proto/decentraland/sdk/components/light_source.proto +1 -1
- package/protoc-gen-bitwise/generator_csharp.js +248 -0
- package/protoc-gen-bitwise/options.js +139 -0
- package/protoc-gen-bitwise/plugin.js +87 -0
- package/protoc-gen-bitwise/runtime/cs/Quantize.cs +70 -0
- package/protoc-gen-bitwise/wire.js +239 -0
- package/proto/buf.yaml +0 -47
- package/proto/google/LICENSE +0 -27
- package/proto/google/README.md +0 -1
- package/proto/google/api/annotations.json +0 -83
- package/proto/google/api/annotations.proto +0 -11
- package/proto/google/api/http.json +0 -86
- package/proto/google/api/http.proto +0 -31
- package/proto/google/protobuf/api.json +0 -118
- package/proto/google/protobuf/api.proto +0 -34
- package/proto/google/protobuf/descriptor.json +0 -739
- package/proto/google/protobuf/descriptor.proto +0 -286
- package/proto/google/protobuf/source_context.json +0 -20
- package/proto/google/protobuf/source_context.proto +0 -7
- package/proto/google/protobuf/type.json +0 -202
- package/proto/google/protobuf/type.proto +0 -89
package/README.md
CHANGED
|
@@ -67,3 +67,220 @@ In this case, there is no problem with when each PR is merged. It's recommendabl
|
|
|
67
67
|
## Comms
|
|
68
68
|
|
|
69
69
|
TODO
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
# Bitwise Serialization Plugin (`protoc-gen-bitwise`)
|
|
74
|
+
|
|
75
|
+
A custom protoc plugin that generates C# partial classes with typed float
|
|
76
|
+
accessors for quantized `uint32` fields in high-frequency MMO networking
|
|
77
|
+
messages (position deltas, player input, etc.). It runs alongside
|
|
78
|
+
`--csharp_out` in the same protoc invocation; the two output files coexist
|
|
79
|
+
via C# `partial class`.
|
|
80
|
+
|
|
81
|
+
## How it works
|
|
82
|
+
|
|
83
|
+
Protobuf encodes `uint32` values as varints, which are already compact for
|
|
84
|
+
small values: a value up to 2¹⁴−1 costs 2 bytes, up to 2²¹−1 costs 3 bytes.
|
|
85
|
+
Rather than a separate binary packing layer, the plugin leverages this:
|
|
86
|
+
|
|
87
|
+
1. Declare quantized fields as `uint32` in the `.proto` schema and annotate
|
|
88
|
+
them with `[(decentraland.common.quantized)]` to specify the float range
|
|
89
|
+
and bit resolution.
|
|
90
|
+
2. `--csharp_out` generates the standard protobuf class with the raw `uint32`
|
|
91
|
+
property (e.g. `PositionX`).
|
|
92
|
+
3. `--bitwise_out` (this plugin) generates a `partial class` extension with a
|
|
93
|
+
computed float accessor (e.g. `PositionXQuantized`) that encodes/decodes
|
|
94
|
+
transparently via `Quantize.Encode` / `Quantize.Decode` on every access —
|
|
95
|
+
the raw `uint32` property remains the single source of truth (no cache to
|
|
96
|
+
go stale when the raw field is mutated directly).
|
|
97
|
+
|
|
98
|
+
The wire representation is a standard protobuf message — any protobuf-capable
|
|
99
|
+
client can read it without knowledge of the plugin.
|
|
100
|
+
|
|
101
|
+
## Prerequisites
|
|
102
|
+
|
|
103
|
+
| Requirement | Version |
|
|
104
|
+
|---|---|
|
|
105
|
+
| Node.js | 16+ |
|
|
106
|
+
| `protoc` | 3.19+ |
|
|
107
|
+
|
|
108
|
+
The plugin is a dependency-free Node script — no `npm install` or extra
|
|
109
|
+
packages are required to run it.
|
|
110
|
+
|
|
111
|
+
## Step 1 — Annotate your `.proto` file
|
|
112
|
+
|
|
113
|
+
Declare quantized fields as `uint32` and import `options.proto`:
|
|
114
|
+
|
|
115
|
+
```protobuf
|
|
116
|
+
syntax = "proto3";
|
|
117
|
+
|
|
118
|
+
import "decentraland/common/options.proto";
|
|
119
|
+
|
|
120
|
+
package decentraland.kernel.comms.v3;
|
|
121
|
+
|
|
122
|
+
message PositionDelta {
|
|
123
|
+
// Float range [-100, 100] quantized to 16 bits ≈ 0.003-unit precision.
|
|
124
|
+
// Stored as uint32 on the wire; protobuf encodes it as a 3-byte varint.
|
|
125
|
+
uint32 dx = 1 [(decentraland.common.quantized) = { min: -100.0, max: 100.0, bits: 16 }];
|
|
126
|
+
uint32 dy = 2 [(decentraland.common.quantized) = { min: -100.0, max: 100.0, bits: 16 }];
|
|
127
|
+
uint32 dz = 3 [(decentraland.common.quantized) = { min: -100.0, max: 100.0, bits: 16 }];
|
|
128
|
+
|
|
129
|
+
// Unannotated uint32: protobuf varint encodes small values compactly by default.
|
|
130
|
+
uint32 entity_id = 4 [(decentraland.common.bit_packed) = { bits: 20 }];
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Annotation reference
|
|
135
|
+
|
|
136
|
+
| Annotation | Target type | Parameters | Effect |
|
|
137
|
+
|---|---|---|---|
|
|
138
|
+
| `[(decentraland.common.quantized)]` | `uint32` | `min`, `max`, `bits` | Plugin emits a `float {Name}Quantized` accessor and a `{Name}QuantizedStep` const |
|
|
139
|
+
| `[(decentraland.common.quantized_power)]` | `uint32` | `max`, `pow`, `bits` | Power-law quantizer over `[-max, max]`: `(bits-1)`-bit magnitude (high bits) + sign (LSB), decoded as `sign·max·u^pow`. Exact zero; `pow>1` gives fine resolution near zero, coarse near `±max`; sign in the LSB keeps small magnitudes one varint byte. `float {Name}Quantized` accessor (`Quantize.EncodePower`/`DecodePower`) |
|
|
140
|
+
| `[(decentraland.common.bit_packed)]` | `uint32` | `bits` | Documents the value range; protobuf handles varint compaction automatically |
|
|
141
|
+
|
|
142
|
+
### Wire cost at worst-case (all bits set)
|
|
143
|
+
|
|
144
|
+
| Quantization bits | Max value | Varint bytes | Tag (field ≤ 15) | Total per field |
|
|
145
|
+
|---|---|---|---|---|
|
|
146
|
+
| 8 | 255 | 2 | 1 | 3 B |
|
|
147
|
+
| 12 | 4 095 | 2 | 1 | 3 B |
|
|
148
|
+
| 14 | 16 383 | 2 | 1 | 3 B |
|
|
149
|
+
| 16 | 65 535 | 3 | 1 | 4 B |
|
|
150
|
+
| 20 | 1 048 575 | 3 | 1 | 4 B |
|
|
151
|
+
|
|
152
|
+
Proto3 omits fields equal to their default value (0), so average cost is lower.
|
|
153
|
+
|
|
154
|
+
## Step 2 — Run protoc
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
protoc \
|
|
158
|
+
--proto_path=proto \
|
|
159
|
+
--proto_path=/path/to/google/protobuf/include \
|
|
160
|
+
--csharp_out=generated/cs \
|
|
161
|
+
--plugin=protoc-gen-bitwise=protoc-gen-bitwise/plugin.js \
|
|
162
|
+
--bitwise_out=generated/cs \
|
|
163
|
+
proto/decentraland/kernel/comms/v3/comms.proto
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
> `plugin.js` carries a `#!/usr/bin/env node` shebang. On Windows, protoc
|
|
167
|
+
> cannot exec a `.js` directly, so point `--plugin` at a small `.cmd` wrapper
|
|
168
|
+
> that runs `node plugin.js`; on unix an equivalent shell script is used. Both
|
|
169
|
+
> consumer repos (Pulse, unity-explorer) generate this wrapper automatically.
|
|
170
|
+
|
|
171
|
+
The plugin emits one `*.Bitwise.cs` file (PascalCase, flat in the output
|
|
172
|
+
directory) for each `.proto` file that contains at least one `[(quantized)]`
|
|
173
|
+
field.
|
|
174
|
+
|
|
175
|
+
## Step 3 — Copy the runtime
|
|
176
|
+
|
|
177
|
+
Copy `Quantize.cs` into your project:
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
Assets/
|
|
181
|
+
└── Scripts/
|
|
182
|
+
└── Networking/
|
|
183
|
+
└── Bitwise/
|
|
184
|
+
└── Quantize.cs ← protoc-gen-bitwise/runtime/cs/Quantize.cs
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
`Quantize.cs` lives in the `Decentraland.Networking.Bitwise` namespace and
|
|
188
|
+
provides the static encode/decode methods used by the generated accessors:
|
|
189
|
+
|
|
190
|
+
```csharp
|
|
191
|
+
public static class Quantize
|
|
192
|
+
{
|
|
193
|
+
public static uint Encode(float value, float min, float max, int bits);
|
|
194
|
+
public static float Decode(uint encoded, float min, float max, int bits);
|
|
195
|
+
public static uint EncodePower(float value, float max, float pow, int bits);
|
|
196
|
+
public static float DecodePower(uint encoded, float max, float pow, int bits);
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Step 4 — Use the generated code
|
|
201
|
+
|
|
202
|
+
The plugin emits a `partial class` that adds float accessors on top of the
|
|
203
|
+
standard protobuf-generated `uint32` properties:
|
|
204
|
+
|
|
205
|
+
```csharp
|
|
206
|
+
using Decentraland.Kernel.Comms.V3;
|
|
207
|
+
|
|
208
|
+
// --- Build and send ---
|
|
209
|
+
var delta = new PositionDelta();
|
|
210
|
+
delta.DxQuantized = 3.14f; // encodes to uint32, stored in delta.Dx
|
|
211
|
+
delta.DyQuantized = 0f;
|
|
212
|
+
delta.DzQuantized = -7.5f;
|
|
213
|
+
delta.EntityId = 42u;
|
|
214
|
+
|
|
215
|
+
byte[] bytes = delta.ToByteArray(); // standard protobuf serialization
|
|
216
|
+
SendOnChannel1(bytes);
|
|
217
|
+
|
|
218
|
+
// --- Receive and read ---
|
|
219
|
+
var received = PositionDelta.Parser.ParseFrom(receivedBytes);
|
|
220
|
+
if (!received.AreQuantizedFieldsInRange()) return; // reject malformed/hostile codes
|
|
221
|
+
float x = received.DxQuantized; // decoded from the stored uint32 on each access
|
|
222
|
+
float y = received.DyQuantized;
|
|
223
|
+
float z = received.DzQuantized;
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
## Generated file example
|
|
227
|
+
|
|
228
|
+
For the `comms.proto` file above the plugin emits `Comms.Bitwise.cs` (one file
|
|
229
|
+
per `.proto`, named after the proto file). Each quantized field gets a
|
|
230
|
+
`{Name}QuantizedStep` const and a float accessor; each message gets an
|
|
231
|
+
`AreQuantizedFieldsInRange()` guard for validating inbound wire codes:
|
|
232
|
+
|
|
233
|
+
```csharp
|
|
234
|
+
// <auto-generated>
|
|
235
|
+
// Generated by protoc-gen-bitwise. DO NOT EDIT.
|
|
236
|
+
// Source: decentraland/kernel/comms/v3/comms.proto
|
|
237
|
+
// </auto-generated>
|
|
238
|
+
|
|
239
|
+
using Decentraland.Networking.Bitwise;
|
|
240
|
+
|
|
241
|
+
namespace Decentraland.Kernel.Comms.V3
|
|
242
|
+
{
|
|
243
|
+
public partial class PositionDelta
|
|
244
|
+
{
|
|
245
|
+
/// <summary>Coarsest quantization step of <see cref="DxQuantized"/>. Safe as an equality tolerance.</summary>
|
|
246
|
+
public const float DxQuantizedStep = 0.0030518044f;
|
|
247
|
+
/// <summary>Float accessor for <see cref="Dx"/>. Range [-100.0f, 100.0f], 16 bits, step ≈ 0.0030518.</summary>
|
|
248
|
+
public float DxQuantized
|
|
249
|
+
{
|
|
250
|
+
get => Quantize.Decode(Dx, -100.0f, 100.0f, 16);
|
|
251
|
+
set => Dx = Quantize.Encode(value, -100.0f, 100.0f, 16);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/// <summary>Coarsest quantization step of <see cref="DyQuantized"/>. Safe as an equality tolerance.</summary>
|
|
255
|
+
public const float DyQuantizedStep = 0.0030518044f;
|
|
256
|
+
/// <summary>Float accessor for <see cref="Dy"/>. Range [-100.0f, 100.0f], 16 bits, step ≈ 0.0030518.</summary>
|
|
257
|
+
public float DyQuantized
|
|
258
|
+
{
|
|
259
|
+
get => Quantize.Decode(Dy, -100.0f, 100.0f, 16);
|
|
260
|
+
set => Dy = Quantize.Encode(value, -100.0f, 100.0f, 16);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/// <summary>Coarsest quantization step of <see cref="DzQuantized"/>. Safe as an equality tolerance.</summary>
|
|
264
|
+
public const float DzQuantizedStep = 0.0030518044f;
|
|
265
|
+
/// <summary>Float accessor for <see cref="Dz"/>. Range [-100.0f, 100.0f], 16 bits, step ≈ 0.0030518.</summary>
|
|
266
|
+
public float DzQuantized
|
|
267
|
+
{
|
|
268
|
+
get => Quantize.Decode(Dz, -100.0f, 100.0f, 16);
|
|
269
|
+
set => Dz = Quantize.Encode(value, -100.0f, 100.0f, 16);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/// <summary>
|
|
273
|
+
/// True when every quantized field holds a wire code within its declared bit width
|
|
274
|
+
/// (<c>0 .. 2^bits-1</c>). The encoder never emits a code above this bound, so a larger
|
|
275
|
+
/// value is a malformed/hostile message: decoding it would land far outside the field's
|
|
276
|
+
/// <c>[min, max]</c> and, since the server relays raw codes verbatim, poison every observer.
|
|
277
|
+
/// Reject before storing or relaying. Pure integer comparison — no decode.
|
|
278
|
+
/// </summary>
|
|
279
|
+
public bool AreQuantizedFieldsInRange() =>
|
|
280
|
+
Dx <= 65535u
|
|
281
|
+
&& Dy <= 65535u
|
|
282
|
+
&& Dz <= 65535u;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
} // namespace Decentraland.Kernel.Comms.V3
|
|
286
|
+
```
|
|
@@ -2,6 +2,38 @@ import _m0 from "protobufjs/minimal";
|
|
|
2
2
|
import { Vector2, Vector3 } from "../../common/vectors.gen";
|
|
3
3
|
import { AvatarMask } from "../../sdk/components/common/avatar_mask.gen";
|
|
4
4
|
export declare const protobufPackage = "decentraland.kernel.apis";
|
|
5
|
+
/**
|
|
6
|
+
* Identifies which fullscreen explorer panel OpenExplorerUi targets.
|
|
7
|
+
* EU_SETTINGS holds 0 so an unset `ui` field defaults to the least-intrusive panel.
|
|
8
|
+
*/
|
|
9
|
+
export declare enum ExplorerUi {
|
|
10
|
+
EU_SETTINGS = 0,
|
|
11
|
+
EU_MAP = 1,
|
|
12
|
+
EU_BACKPACK = 2,
|
|
13
|
+
EU_CAMERA_REEL = 3,
|
|
14
|
+
EU_COMMUNITIES = 4,
|
|
15
|
+
EU_PLACES = 5,
|
|
16
|
+
EU_EVENTS = 6,
|
|
17
|
+
UNRECOGNIZED = -1
|
|
18
|
+
}
|
|
19
|
+
export declare function explorerUiFromJSON(object: any): ExplorerUi;
|
|
20
|
+
export declare function explorerUiToJSON(object: ExplorerUi): string;
|
|
21
|
+
/** Verdict of an OpenExplorerUi request (enum rather than a bool so new outcomes stay expressible). */
|
|
22
|
+
export declare enum OpenExplorerUiResult {
|
|
23
|
+
UNSPECIFIED = 0,
|
|
24
|
+
OPENED = 1,
|
|
25
|
+
/** WAS_ALREADY_OPEN - a fullscreen panel is already open */
|
|
26
|
+
WAS_ALREADY_OPEN = 2,
|
|
27
|
+
/** REJECTED_NOT_CURRENT_SCENE - the standard restricted-actions current-scene gate rejected the call */
|
|
28
|
+
REJECTED_NOT_CURRENT_SCENE = 3,
|
|
29
|
+
/** REJECTED_FEATURE_DISABLED - the requested section is hidden by feature flags or client doesn't have that feature */
|
|
30
|
+
REJECTED_FEATURE_DISABLED = 4,
|
|
31
|
+
/** REJECTED_NO_USER_GESTURE - rejected: the call did not originate from a user gesture */
|
|
32
|
+
REJECTED_NO_USER_GESTURE = 5,
|
|
33
|
+
UNRECOGNIZED = -1
|
|
34
|
+
}
|
|
35
|
+
export declare function openExplorerUiResultFromJSON(object: any): OpenExplorerUiResult;
|
|
36
|
+
export declare function openExplorerUiResultToJSON(object: OpenExplorerUiResult): string;
|
|
5
37
|
export interface MovePlayerToRequest {
|
|
6
38
|
newRelativePosition: Vector3 | undefined;
|
|
7
39
|
cameraTarget?: Vector3 | undefined;
|
|
@@ -53,6 +85,13 @@ export interface EmptyResponse {
|
|
|
53
85
|
}
|
|
54
86
|
export interface StopEmoteRequest {
|
|
55
87
|
}
|
|
88
|
+
export interface OpenExplorerUiRequest {
|
|
89
|
+
ui: ExplorerUi;
|
|
90
|
+
}
|
|
91
|
+
export interface OpenExplorerUiResponse {
|
|
92
|
+
/** Carries only the verdict of the open action. */
|
|
93
|
+
openResult: OpenExplorerUiResult;
|
|
94
|
+
}
|
|
56
95
|
export declare namespace MovePlayerToRequest {
|
|
57
96
|
function encode(message: MovePlayerToRequest, writer?: _m0.Writer): _m0.Writer;
|
|
58
97
|
function decode(input: _m0.Reader | Uint8Array, length?: number): MovePlayerToRequest;
|
|
@@ -181,6 +220,22 @@ export declare namespace StopEmoteRequest {
|
|
|
181
220
|
function create<I extends Exact<DeepPartial<StopEmoteRequest>, I>>(base?: I): StopEmoteRequest;
|
|
182
221
|
function fromPartial<I extends Exact<DeepPartial<StopEmoteRequest>, I>>(_: I): StopEmoteRequest;
|
|
183
222
|
}
|
|
223
|
+
export declare namespace OpenExplorerUiRequest {
|
|
224
|
+
function encode(message: OpenExplorerUiRequest, writer?: _m0.Writer): _m0.Writer;
|
|
225
|
+
function decode(input: _m0.Reader | Uint8Array, length?: number): OpenExplorerUiRequest;
|
|
226
|
+
function fromJSON(object: any): OpenExplorerUiRequest;
|
|
227
|
+
function toJSON(message: OpenExplorerUiRequest): unknown;
|
|
228
|
+
function create<I extends Exact<DeepPartial<OpenExplorerUiRequest>, I>>(base?: I): OpenExplorerUiRequest;
|
|
229
|
+
function fromPartial<I extends Exact<DeepPartial<OpenExplorerUiRequest>, I>>(object: I): OpenExplorerUiRequest;
|
|
230
|
+
}
|
|
231
|
+
export declare namespace OpenExplorerUiResponse {
|
|
232
|
+
function encode(message: OpenExplorerUiResponse, writer?: _m0.Writer): _m0.Writer;
|
|
233
|
+
function decode(input: _m0.Reader | Uint8Array, length?: number): OpenExplorerUiResponse;
|
|
234
|
+
function fromJSON(object: any): OpenExplorerUiResponse;
|
|
235
|
+
function toJSON(message: OpenExplorerUiResponse): unknown;
|
|
236
|
+
function create<I extends Exact<DeepPartial<OpenExplorerUiResponse>, I>>(base?: I): OpenExplorerUiResponse;
|
|
237
|
+
function fromPartial<I extends Exact<DeepPartial<OpenExplorerUiResponse>, I>>(object: I): OpenExplorerUiResponse;
|
|
238
|
+
}
|
|
184
239
|
export type RestrictedActionsServiceDefinition = typeof RestrictedActionsServiceDefinition;
|
|
185
240
|
export declare const RestrictedActionsServiceDefinition: {
|
|
186
241
|
readonly name: "RestrictedActionsService";
|
|
@@ -283,6 +338,15 @@ export declare const RestrictedActionsServiceDefinition: {
|
|
|
283
338
|
readonly responseStream: false;
|
|
284
339
|
readonly options: {};
|
|
285
340
|
};
|
|
341
|
+
/** OpenExplorerUi opens a specific fullscreen explorer panel and returns the open verdict. */
|
|
342
|
+
readonly openExplorerUi: {
|
|
343
|
+
readonly name: "OpenExplorerUi";
|
|
344
|
+
readonly requestType: typeof OpenExplorerUiRequest;
|
|
345
|
+
readonly requestStream: false;
|
|
346
|
+
readonly responseType: typeof OpenExplorerUiResponse;
|
|
347
|
+
readonly responseStream: false;
|
|
348
|
+
readonly options: {};
|
|
349
|
+
};
|
|
286
350
|
};
|
|
287
351
|
};
|
|
288
352
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
@@ -3,12 +3,141 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.RestrictedActionsServiceDefinition = exports.StopEmoteRequest = exports.EmptyResponse = exports.CopyToClipboardRequest = exports.TeleportToResponse = exports.MovePlayerToResponse = exports.TriggerEmoteResponse = exports.SuccessResponse = exports.TriggerSceneEmoteRequest = exports.CommsAdapterRequest = exports.UnblockPointerRequest = exports.OpenNftDialogRequest = exports.OpenExternalUrlRequest = exports.ChangeRealmRequest = exports.TriggerEmoteRequest = exports.TeleportToRequest = exports.MovePlayerToRequest = exports.protobufPackage = void 0;
|
|
6
|
+
exports.RestrictedActionsServiceDefinition = exports.OpenExplorerUiResponse = exports.OpenExplorerUiRequest = exports.StopEmoteRequest = exports.EmptyResponse = exports.CopyToClipboardRequest = exports.TeleportToResponse = exports.MovePlayerToResponse = exports.TriggerEmoteResponse = exports.SuccessResponse = exports.TriggerSceneEmoteRequest = exports.CommsAdapterRequest = exports.UnblockPointerRequest = exports.OpenNftDialogRequest = exports.OpenExternalUrlRequest = exports.ChangeRealmRequest = exports.TriggerEmoteRequest = exports.TeleportToRequest = exports.MovePlayerToRequest = exports.OpenExplorerUiResult = exports.ExplorerUi = exports.protobufPackage = void 0;
|
|
7
|
+
exports.explorerUiFromJSON = explorerUiFromJSON;
|
|
8
|
+
exports.explorerUiToJSON = explorerUiToJSON;
|
|
9
|
+
exports.openExplorerUiResultFromJSON = openExplorerUiResultFromJSON;
|
|
10
|
+
exports.openExplorerUiResultToJSON = openExplorerUiResultToJSON;
|
|
7
11
|
/* eslint-disable */
|
|
8
12
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
9
13
|
const vectors_gen_1 = require("../../common/vectors.gen");
|
|
10
14
|
const avatar_mask_gen_1 = require("../../sdk/components/common/avatar_mask.gen");
|
|
11
15
|
exports.protobufPackage = "decentraland.kernel.apis";
|
|
16
|
+
/**
|
|
17
|
+
* Identifies which fullscreen explorer panel OpenExplorerUi targets.
|
|
18
|
+
* EU_SETTINGS holds 0 so an unset `ui` field defaults to the least-intrusive panel.
|
|
19
|
+
*/
|
|
20
|
+
var ExplorerUi;
|
|
21
|
+
(function (ExplorerUi) {
|
|
22
|
+
ExplorerUi[ExplorerUi["EU_SETTINGS"] = 0] = "EU_SETTINGS";
|
|
23
|
+
ExplorerUi[ExplorerUi["EU_MAP"] = 1] = "EU_MAP";
|
|
24
|
+
ExplorerUi[ExplorerUi["EU_BACKPACK"] = 2] = "EU_BACKPACK";
|
|
25
|
+
ExplorerUi[ExplorerUi["EU_CAMERA_REEL"] = 3] = "EU_CAMERA_REEL";
|
|
26
|
+
ExplorerUi[ExplorerUi["EU_COMMUNITIES"] = 4] = "EU_COMMUNITIES";
|
|
27
|
+
ExplorerUi[ExplorerUi["EU_PLACES"] = 5] = "EU_PLACES";
|
|
28
|
+
ExplorerUi[ExplorerUi["EU_EVENTS"] = 6] = "EU_EVENTS";
|
|
29
|
+
ExplorerUi[ExplorerUi["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
30
|
+
})(ExplorerUi || (exports.ExplorerUi = ExplorerUi = {}));
|
|
31
|
+
function explorerUiFromJSON(object) {
|
|
32
|
+
switch (object) {
|
|
33
|
+
case 0:
|
|
34
|
+
case "EU_SETTINGS":
|
|
35
|
+
return ExplorerUi.EU_SETTINGS;
|
|
36
|
+
case 1:
|
|
37
|
+
case "EU_MAP":
|
|
38
|
+
return ExplorerUi.EU_MAP;
|
|
39
|
+
case 2:
|
|
40
|
+
case "EU_BACKPACK":
|
|
41
|
+
return ExplorerUi.EU_BACKPACK;
|
|
42
|
+
case 3:
|
|
43
|
+
case "EU_CAMERA_REEL":
|
|
44
|
+
return ExplorerUi.EU_CAMERA_REEL;
|
|
45
|
+
case 4:
|
|
46
|
+
case "EU_COMMUNITIES":
|
|
47
|
+
return ExplorerUi.EU_COMMUNITIES;
|
|
48
|
+
case 5:
|
|
49
|
+
case "EU_PLACES":
|
|
50
|
+
return ExplorerUi.EU_PLACES;
|
|
51
|
+
case 6:
|
|
52
|
+
case "EU_EVENTS":
|
|
53
|
+
return ExplorerUi.EU_EVENTS;
|
|
54
|
+
case -1:
|
|
55
|
+
case "UNRECOGNIZED":
|
|
56
|
+
default:
|
|
57
|
+
return ExplorerUi.UNRECOGNIZED;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function explorerUiToJSON(object) {
|
|
61
|
+
switch (object) {
|
|
62
|
+
case ExplorerUi.EU_SETTINGS:
|
|
63
|
+
return "EU_SETTINGS";
|
|
64
|
+
case ExplorerUi.EU_MAP:
|
|
65
|
+
return "EU_MAP";
|
|
66
|
+
case ExplorerUi.EU_BACKPACK:
|
|
67
|
+
return "EU_BACKPACK";
|
|
68
|
+
case ExplorerUi.EU_CAMERA_REEL:
|
|
69
|
+
return "EU_CAMERA_REEL";
|
|
70
|
+
case ExplorerUi.EU_COMMUNITIES:
|
|
71
|
+
return "EU_COMMUNITIES";
|
|
72
|
+
case ExplorerUi.EU_PLACES:
|
|
73
|
+
return "EU_PLACES";
|
|
74
|
+
case ExplorerUi.EU_EVENTS:
|
|
75
|
+
return "EU_EVENTS";
|
|
76
|
+
case ExplorerUi.UNRECOGNIZED:
|
|
77
|
+
default:
|
|
78
|
+
return "UNRECOGNIZED";
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/** Verdict of an OpenExplorerUi request (enum rather than a bool so new outcomes stay expressible). */
|
|
82
|
+
var OpenExplorerUiResult;
|
|
83
|
+
(function (OpenExplorerUiResult) {
|
|
84
|
+
OpenExplorerUiResult[OpenExplorerUiResult["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
85
|
+
OpenExplorerUiResult[OpenExplorerUiResult["OPENED"] = 1] = "OPENED";
|
|
86
|
+
/** WAS_ALREADY_OPEN - a fullscreen panel is already open */
|
|
87
|
+
OpenExplorerUiResult[OpenExplorerUiResult["WAS_ALREADY_OPEN"] = 2] = "WAS_ALREADY_OPEN";
|
|
88
|
+
/** REJECTED_NOT_CURRENT_SCENE - the standard restricted-actions current-scene gate rejected the call */
|
|
89
|
+
OpenExplorerUiResult[OpenExplorerUiResult["REJECTED_NOT_CURRENT_SCENE"] = 3] = "REJECTED_NOT_CURRENT_SCENE";
|
|
90
|
+
/** REJECTED_FEATURE_DISABLED - the requested section is hidden by feature flags or client doesn't have that feature */
|
|
91
|
+
OpenExplorerUiResult[OpenExplorerUiResult["REJECTED_FEATURE_DISABLED"] = 4] = "REJECTED_FEATURE_DISABLED";
|
|
92
|
+
/** REJECTED_NO_USER_GESTURE - rejected: the call did not originate from a user gesture */
|
|
93
|
+
OpenExplorerUiResult[OpenExplorerUiResult["REJECTED_NO_USER_GESTURE"] = 5] = "REJECTED_NO_USER_GESTURE";
|
|
94
|
+
OpenExplorerUiResult[OpenExplorerUiResult["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
95
|
+
})(OpenExplorerUiResult || (exports.OpenExplorerUiResult = OpenExplorerUiResult = {}));
|
|
96
|
+
function openExplorerUiResultFromJSON(object) {
|
|
97
|
+
switch (object) {
|
|
98
|
+
case 0:
|
|
99
|
+
case "UNSPECIFIED":
|
|
100
|
+
return OpenExplorerUiResult.UNSPECIFIED;
|
|
101
|
+
case 1:
|
|
102
|
+
case "OPENED":
|
|
103
|
+
return OpenExplorerUiResult.OPENED;
|
|
104
|
+
case 2:
|
|
105
|
+
case "WAS_ALREADY_OPEN":
|
|
106
|
+
return OpenExplorerUiResult.WAS_ALREADY_OPEN;
|
|
107
|
+
case 3:
|
|
108
|
+
case "REJECTED_NOT_CURRENT_SCENE":
|
|
109
|
+
return OpenExplorerUiResult.REJECTED_NOT_CURRENT_SCENE;
|
|
110
|
+
case 4:
|
|
111
|
+
case "REJECTED_FEATURE_DISABLED":
|
|
112
|
+
return OpenExplorerUiResult.REJECTED_FEATURE_DISABLED;
|
|
113
|
+
case 5:
|
|
114
|
+
case "REJECTED_NO_USER_GESTURE":
|
|
115
|
+
return OpenExplorerUiResult.REJECTED_NO_USER_GESTURE;
|
|
116
|
+
case -1:
|
|
117
|
+
case "UNRECOGNIZED":
|
|
118
|
+
default:
|
|
119
|
+
return OpenExplorerUiResult.UNRECOGNIZED;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function openExplorerUiResultToJSON(object) {
|
|
123
|
+
switch (object) {
|
|
124
|
+
case OpenExplorerUiResult.UNSPECIFIED:
|
|
125
|
+
return "UNSPECIFIED";
|
|
126
|
+
case OpenExplorerUiResult.OPENED:
|
|
127
|
+
return "OPENED";
|
|
128
|
+
case OpenExplorerUiResult.WAS_ALREADY_OPEN:
|
|
129
|
+
return "WAS_ALREADY_OPEN";
|
|
130
|
+
case OpenExplorerUiResult.REJECTED_NOT_CURRENT_SCENE:
|
|
131
|
+
return "REJECTED_NOT_CURRENT_SCENE";
|
|
132
|
+
case OpenExplorerUiResult.REJECTED_FEATURE_DISABLED:
|
|
133
|
+
return "REJECTED_FEATURE_DISABLED";
|
|
134
|
+
case OpenExplorerUiResult.REJECTED_NO_USER_GESTURE:
|
|
135
|
+
return "REJECTED_NO_USER_GESTURE";
|
|
136
|
+
case OpenExplorerUiResult.UNRECOGNIZED:
|
|
137
|
+
default:
|
|
138
|
+
return "UNRECOGNIZED";
|
|
139
|
+
}
|
|
140
|
+
}
|
|
12
141
|
function createBaseMovePlayerToRequest() {
|
|
13
142
|
return { newRelativePosition: undefined, cameraTarget: undefined, avatarTarget: undefined, duration: undefined };
|
|
14
143
|
}
|
|
@@ -948,6 +1077,118 @@ var StopEmoteRequest;
|
|
|
948
1077
|
}
|
|
949
1078
|
StopEmoteRequest.fromPartial = fromPartial;
|
|
950
1079
|
})(StopEmoteRequest || (exports.StopEmoteRequest = StopEmoteRequest = {}));
|
|
1080
|
+
function createBaseOpenExplorerUiRequest() {
|
|
1081
|
+
return { ui: 0 };
|
|
1082
|
+
}
|
|
1083
|
+
var OpenExplorerUiRequest;
|
|
1084
|
+
(function (OpenExplorerUiRequest) {
|
|
1085
|
+
function encode(message, writer = minimal_1.default.Writer.create()) {
|
|
1086
|
+
if (message.ui !== 0) {
|
|
1087
|
+
writer.uint32(8).int32(message.ui);
|
|
1088
|
+
}
|
|
1089
|
+
return writer;
|
|
1090
|
+
}
|
|
1091
|
+
OpenExplorerUiRequest.encode = encode;
|
|
1092
|
+
function decode(input, length) {
|
|
1093
|
+
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
1094
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1095
|
+
const message = createBaseOpenExplorerUiRequest();
|
|
1096
|
+
while (reader.pos < end) {
|
|
1097
|
+
const tag = reader.uint32();
|
|
1098
|
+
switch (tag >>> 3) {
|
|
1099
|
+
case 1:
|
|
1100
|
+
if (tag !== 8) {
|
|
1101
|
+
break;
|
|
1102
|
+
}
|
|
1103
|
+
message.ui = reader.int32();
|
|
1104
|
+
continue;
|
|
1105
|
+
}
|
|
1106
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1107
|
+
break;
|
|
1108
|
+
}
|
|
1109
|
+
reader.skipType(tag & 7);
|
|
1110
|
+
}
|
|
1111
|
+
return message;
|
|
1112
|
+
}
|
|
1113
|
+
OpenExplorerUiRequest.decode = decode;
|
|
1114
|
+
function fromJSON(object) {
|
|
1115
|
+
return { ui: isSet(object.ui) ? explorerUiFromJSON(object.ui) : 0 };
|
|
1116
|
+
}
|
|
1117
|
+
OpenExplorerUiRequest.fromJSON = fromJSON;
|
|
1118
|
+
function toJSON(message) {
|
|
1119
|
+
const obj = {};
|
|
1120
|
+
message.ui !== undefined && (obj.ui = explorerUiToJSON(message.ui));
|
|
1121
|
+
return obj;
|
|
1122
|
+
}
|
|
1123
|
+
OpenExplorerUiRequest.toJSON = toJSON;
|
|
1124
|
+
function create(base) {
|
|
1125
|
+
return OpenExplorerUiRequest.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1126
|
+
}
|
|
1127
|
+
OpenExplorerUiRequest.create = create;
|
|
1128
|
+
function fromPartial(object) {
|
|
1129
|
+
var _a;
|
|
1130
|
+
const message = createBaseOpenExplorerUiRequest();
|
|
1131
|
+
message.ui = (_a = object.ui) !== null && _a !== void 0 ? _a : 0;
|
|
1132
|
+
return message;
|
|
1133
|
+
}
|
|
1134
|
+
OpenExplorerUiRequest.fromPartial = fromPartial;
|
|
1135
|
+
})(OpenExplorerUiRequest || (exports.OpenExplorerUiRequest = OpenExplorerUiRequest = {}));
|
|
1136
|
+
function createBaseOpenExplorerUiResponse() {
|
|
1137
|
+
return { openResult: 0 };
|
|
1138
|
+
}
|
|
1139
|
+
var OpenExplorerUiResponse;
|
|
1140
|
+
(function (OpenExplorerUiResponse) {
|
|
1141
|
+
function encode(message, writer = minimal_1.default.Writer.create()) {
|
|
1142
|
+
if (message.openResult !== 0) {
|
|
1143
|
+
writer.uint32(8).int32(message.openResult);
|
|
1144
|
+
}
|
|
1145
|
+
return writer;
|
|
1146
|
+
}
|
|
1147
|
+
OpenExplorerUiResponse.encode = encode;
|
|
1148
|
+
function decode(input, length) {
|
|
1149
|
+
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
1150
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1151
|
+
const message = createBaseOpenExplorerUiResponse();
|
|
1152
|
+
while (reader.pos < end) {
|
|
1153
|
+
const tag = reader.uint32();
|
|
1154
|
+
switch (tag >>> 3) {
|
|
1155
|
+
case 1:
|
|
1156
|
+
if (tag !== 8) {
|
|
1157
|
+
break;
|
|
1158
|
+
}
|
|
1159
|
+
message.openResult = reader.int32();
|
|
1160
|
+
continue;
|
|
1161
|
+
}
|
|
1162
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1163
|
+
break;
|
|
1164
|
+
}
|
|
1165
|
+
reader.skipType(tag & 7);
|
|
1166
|
+
}
|
|
1167
|
+
return message;
|
|
1168
|
+
}
|
|
1169
|
+
OpenExplorerUiResponse.decode = decode;
|
|
1170
|
+
function fromJSON(object) {
|
|
1171
|
+
return { openResult: isSet(object.openResult) ? openExplorerUiResultFromJSON(object.openResult) : 0 };
|
|
1172
|
+
}
|
|
1173
|
+
OpenExplorerUiResponse.fromJSON = fromJSON;
|
|
1174
|
+
function toJSON(message) {
|
|
1175
|
+
const obj = {};
|
|
1176
|
+
message.openResult !== undefined && (obj.openResult = openExplorerUiResultToJSON(message.openResult));
|
|
1177
|
+
return obj;
|
|
1178
|
+
}
|
|
1179
|
+
OpenExplorerUiResponse.toJSON = toJSON;
|
|
1180
|
+
function create(base) {
|
|
1181
|
+
return OpenExplorerUiResponse.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1182
|
+
}
|
|
1183
|
+
OpenExplorerUiResponse.create = create;
|
|
1184
|
+
function fromPartial(object) {
|
|
1185
|
+
var _a;
|
|
1186
|
+
const message = createBaseOpenExplorerUiResponse();
|
|
1187
|
+
message.openResult = (_a = object.openResult) !== null && _a !== void 0 ? _a : 0;
|
|
1188
|
+
return message;
|
|
1189
|
+
}
|
|
1190
|
+
OpenExplorerUiResponse.fromPartial = fromPartial;
|
|
1191
|
+
})(OpenExplorerUiResponse || (exports.OpenExplorerUiResponse = OpenExplorerUiResponse = {}));
|
|
951
1192
|
exports.RestrictedActionsServiceDefinition = {
|
|
952
1193
|
name: "RestrictedActionsService",
|
|
953
1194
|
fullName: "decentraland.kernel.apis.RestrictedActionsService",
|
|
@@ -1049,6 +1290,15 @@ exports.RestrictedActionsServiceDefinition = {
|
|
|
1049
1290
|
responseStream: false,
|
|
1050
1291
|
options: {},
|
|
1051
1292
|
},
|
|
1293
|
+
/** OpenExplorerUi opens a specific fullscreen explorer panel and returns the open verdict. */
|
|
1294
|
+
openExplorerUi: {
|
|
1295
|
+
name: "OpenExplorerUi",
|
|
1296
|
+
requestType: OpenExplorerUiRequest,
|
|
1297
|
+
requestStream: false,
|
|
1298
|
+
responseType: OpenExplorerUiResponse,
|
|
1299
|
+
responseStream: false,
|
|
1300
|
+
options: {},
|
|
1301
|
+
},
|
|
1052
1302
|
},
|
|
1053
1303
|
};
|
|
1054
1304
|
function isSet(value) {
|