@dcl/protocol 1.0.0-29276634715.commit-82dbfb0 → 1.0.0-29286492043.commit-0010e70
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 +0 -217
- package/out-js/decentraland/kernel/comms/rfc4/comms.gen.d.ts +0 -21
- package/out-js/decentraland/kernel/comms/rfc4/comms.gen.js +4 -124
- package/out-js/decentraland/kernel/comms/rfc4/comms.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/avatar_shape.gen.d.ts +0 -8
- package/out-js/decentraland/sdk/components/avatar_shape.gen.js +1 -35
- package/out-js/decentraland/sdk/components/avatar_shape.gen.js.map +1 -1
- package/out-ts/decentraland/kernel/comms/rfc4/comms.gen.ts +2 -166
- package/out-ts/decentraland/sdk/components/avatar_shape.gen.ts +0 -34
- package/package.json +6 -9
- package/proto/buf.yaml +47 -0
- package/proto/decentraland/kernel/comms/rfc4/comms.proto +0 -11
- package/proto/decentraland/sdk/components/avatar_shape.proto +0 -5
- package/proto/decentraland/sdk/components/light_source.proto +1 -1
- package/proto/decentraland/sdk/components/virtual_camera.proto +0 -2
- package/proto/google/LICENSE +27 -0
- package/proto/google/README.md +1 -0
- package/proto/google/api/annotations.json +83 -0
- package/proto/google/api/annotations.proto +11 -0
- package/proto/google/api/http.json +86 -0
- package/proto/google/api/http.proto +31 -0
- package/proto/google/protobuf/api.json +118 -0
- package/proto/google/protobuf/api.proto +34 -0
- package/proto/google/protobuf/descriptor.json +739 -0
- package/proto/google/protobuf/descriptor.proto +286 -0
- package/proto/google/protobuf/source_context.json +20 -0
- package/proto/google/protobuf/source_context.proto +7 -0
- package/proto/google/protobuf/type.json +202 -0
- package/proto/google/protobuf/type.proto +89 -0
- package/proto/decentraland/common/options.proto +0 -51
- package/proto/decentraland/common/quantization_example.proto +0 -164
- package/proto/decentraland/pulse/pulse_client.proto +0 -79
- package/proto/decentraland/pulse/pulse_server.proto +0 -144
- package/proto/decentraland/pulse/pulse_shared.proto +0 -57
- package/protoc-gen-bitwise/generator_csharp.js +0 -248
- package/protoc-gen-bitwise/options.js +0 -139
- package/protoc-gen-bitwise/plugin.js +0 -87
- package/protoc-gen-bitwise/runtime/cs/Quantize.cs +0 -70
- package/protoc-gen-bitwise/wire.js +0 -239
package/README.md
CHANGED
|
@@ -67,220 +67,3 @@ 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
|
-
```
|
|
@@ -120,22 +120,6 @@ export interface PlayerEmote {
|
|
|
120
120
|
incrementalId: number;
|
|
121
121
|
urn: string;
|
|
122
122
|
timestamp: number;
|
|
123
|
-
/** true means the emote has been stopped in the sender's client */
|
|
124
|
-
isStopping?: boolean | undefined;
|
|
125
|
-
/** true when it is not the first time the looping animation plays */
|
|
126
|
-
isRepeating?: boolean | undefined;
|
|
127
|
-
/** identifies an interaction univocaly, established when the start animation is triggered */
|
|
128
|
-
interactionId?: number | undefined;
|
|
129
|
-
/** -1 means it does not use an outcome animation */
|
|
130
|
-
socialEmoteOutcome?: number | undefined;
|
|
131
|
-
/** to a social emote started by other user */
|
|
132
|
-
isReacting?: boolean | undefined;
|
|
133
|
-
/** wallet address of the user that initiated social emote */
|
|
134
|
-
socialEmoteInitiator?: string | undefined;
|
|
135
|
-
/** wallet address of the user whose avatar is the target of a directed emote */
|
|
136
|
-
targetAvatar?: string | undefined;
|
|
137
|
-
/** mask for which bones an animation applies to. */
|
|
138
|
-
mask?: number | undefined;
|
|
139
123
|
}
|
|
140
124
|
export interface SceneEmote {
|
|
141
125
|
sceneEntityId: string;
|
|
@@ -155,11 +139,6 @@ export interface ProfileResponse {
|
|
|
155
139
|
export interface Chat {
|
|
156
140
|
message: string;
|
|
157
141
|
timestamp: number;
|
|
158
|
-
/**
|
|
159
|
-
* Extension: optional forwarded_from to identify the original sender when
|
|
160
|
-
* messages are forwarded through an SFU
|
|
161
|
-
*/
|
|
162
|
-
forwardedFrom?: string | undefined;
|
|
163
142
|
}
|
|
164
143
|
export interface Scene {
|
|
165
144
|
sceneId: string;
|
|
@@ -1073,19 +1073,7 @@ var MovementCompressed;
|
|
|
1073
1073
|
MovementCompressed.fromPartial = fromPartial;
|
|
1074
1074
|
})(MovementCompressed || (exports.MovementCompressed = MovementCompressed = {}));
|
|
1075
1075
|
function createBasePlayerEmote() {
|
|
1076
|
-
return {
|
|
1077
|
-
incrementalId: 0,
|
|
1078
|
-
urn: "",
|
|
1079
|
-
timestamp: 0,
|
|
1080
|
-
isStopping: undefined,
|
|
1081
|
-
isRepeating: undefined,
|
|
1082
|
-
interactionId: undefined,
|
|
1083
|
-
socialEmoteOutcome: undefined,
|
|
1084
|
-
isReacting: undefined,
|
|
1085
|
-
socialEmoteInitiator: undefined,
|
|
1086
|
-
targetAvatar: undefined,
|
|
1087
|
-
mask: undefined,
|
|
1088
|
-
};
|
|
1076
|
+
return { incrementalId: 0, urn: "", timestamp: 0 };
|
|
1089
1077
|
}
|
|
1090
1078
|
var PlayerEmote;
|
|
1091
1079
|
(function (PlayerEmote) {
|
|
@@ -1099,30 +1087,6 @@ var PlayerEmote;
|
|
|
1099
1087
|
if (message.timestamp !== 0) {
|
|
1100
1088
|
writer.uint32(29).float(message.timestamp);
|
|
1101
1089
|
}
|
|
1102
|
-
if (message.isStopping !== undefined) {
|
|
1103
|
-
writer.uint32(32).bool(message.isStopping);
|
|
1104
|
-
}
|
|
1105
|
-
if (message.isRepeating !== undefined) {
|
|
1106
|
-
writer.uint32(40).bool(message.isRepeating);
|
|
1107
|
-
}
|
|
1108
|
-
if (message.interactionId !== undefined) {
|
|
1109
|
-
writer.uint32(48).int32(message.interactionId);
|
|
1110
|
-
}
|
|
1111
|
-
if (message.socialEmoteOutcome !== undefined) {
|
|
1112
|
-
writer.uint32(56).int32(message.socialEmoteOutcome);
|
|
1113
|
-
}
|
|
1114
|
-
if (message.isReacting !== undefined) {
|
|
1115
|
-
writer.uint32(64).bool(message.isReacting);
|
|
1116
|
-
}
|
|
1117
|
-
if (message.socialEmoteInitiator !== undefined) {
|
|
1118
|
-
writer.uint32(74).string(message.socialEmoteInitiator);
|
|
1119
|
-
}
|
|
1120
|
-
if (message.targetAvatar !== undefined) {
|
|
1121
|
-
writer.uint32(82).string(message.targetAvatar);
|
|
1122
|
-
}
|
|
1123
|
-
if (message.mask !== undefined) {
|
|
1124
|
-
writer.uint32(88).uint32(message.mask);
|
|
1125
|
-
}
|
|
1126
1090
|
return writer;
|
|
1127
1091
|
}
|
|
1128
1092
|
PlayerEmote.encode = encode;
|
|
@@ -1151,54 +1115,6 @@ var PlayerEmote;
|
|
|
1151
1115
|
}
|
|
1152
1116
|
message.timestamp = reader.float();
|
|
1153
1117
|
continue;
|
|
1154
|
-
case 4:
|
|
1155
|
-
if (tag !== 32) {
|
|
1156
|
-
break;
|
|
1157
|
-
}
|
|
1158
|
-
message.isStopping = reader.bool();
|
|
1159
|
-
continue;
|
|
1160
|
-
case 5:
|
|
1161
|
-
if (tag !== 40) {
|
|
1162
|
-
break;
|
|
1163
|
-
}
|
|
1164
|
-
message.isRepeating = reader.bool();
|
|
1165
|
-
continue;
|
|
1166
|
-
case 6:
|
|
1167
|
-
if (tag !== 48) {
|
|
1168
|
-
break;
|
|
1169
|
-
}
|
|
1170
|
-
message.interactionId = reader.int32();
|
|
1171
|
-
continue;
|
|
1172
|
-
case 7:
|
|
1173
|
-
if (tag !== 56) {
|
|
1174
|
-
break;
|
|
1175
|
-
}
|
|
1176
|
-
message.socialEmoteOutcome = reader.int32();
|
|
1177
|
-
continue;
|
|
1178
|
-
case 8:
|
|
1179
|
-
if (tag !== 64) {
|
|
1180
|
-
break;
|
|
1181
|
-
}
|
|
1182
|
-
message.isReacting = reader.bool();
|
|
1183
|
-
continue;
|
|
1184
|
-
case 9:
|
|
1185
|
-
if (tag !== 74) {
|
|
1186
|
-
break;
|
|
1187
|
-
}
|
|
1188
|
-
message.socialEmoteInitiator = reader.string();
|
|
1189
|
-
continue;
|
|
1190
|
-
case 10:
|
|
1191
|
-
if (tag !== 82) {
|
|
1192
|
-
break;
|
|
1193
|
-
}
|
|
1194
|
-
message.targetAvatar = reader.string();
|
|
1195
|
-
continue;
|
|
1196
|
-
case 11:
|
|
1197
|
-
if (tag !== 88) {
|
|
1198
|
-
break;
|
|
1199
|
-
}
|
|
1200
|
-
message.mask = reader.uint32();
|
|
1201
|
-
continue;
|
|
1202
1118
|
}
|
|
1203
1119
|
if ((tag & 7) === 4 || tag === 0) {
|
|
1204
1120
|
break;
|
|
@@ -1213,14 +1129,6 @@ var PlayerEmote;
|
|
|
1213
1129
|
incrementalId: isSet(object.incrementalId) ? Number(object.incrementalId) : 0,
|
|
1214
1130
|
urn: isSet(object.urn) ? String(object.urn) : "",
|
|
1215
1131
|
timestamp: isSet(object.timestamp) ? Number(object.timestamp) : 0,
|
|
1216
|
-
isStopping: isSet(object.isStopping) ? Boolean(object.isStopping) : undefined,
|
|
1217
|
-
isRepeating: isSet(object.isRepeating) ? Boolean(object.isRepeating) : undefined,
|
|
1218
|
-
interactionId: isSet(object.interactionId) ? Number(object.interactionId) : undefined,
|
|
1219
|
-
socialEmoteOutcome: isSet(object.socialEmoteOutcome) ? Number(object.socialEmoteOutcome) : undefined,
|
|
1220
|
-
isReacting: isSet(object.isReacting) ? Boolean(object.isReacting) : undefined,
|
|
1221
|
-
socialEmoteInitiator: isSet(object.socialEmoteInitiator) ? String(object.socialEmoteInitiator) : undefined,
|
|
1222
|
-
targetAvatar: isSet(object.targetAvatar) ? String(object.targetAvatar) : undefined,
|
|
1223
|
-
mask: isSet(object.mask) ? Number(object.mask) : undefined,
|
|
1224
1132
|
};
|
|
1225
1133
|
}
|
|
1226
1134
|
PlayerEmote.fromJSON = fromJSON;
|
|
@@ -1229,14 +1137,6 @@ var PlayerEmote;
|
|
|
1229
1137
|
message.incrementalId !== undefined && (obj.incrementalId = Math.round(message.incrementalId));
|
|
1230
1138
|
message.urn !== undefined && (obj.urn = message.urn);
|
|
1231
1139
|
message.timestamp !== undefined && (obj.timestamp = message.timestamp);
|
|
1232
|
-
message.isStopping !== undefined && (obj.isStopping = message.isStopping);
|
|
1233
|
-
message.isRepeating !== undefined && (obj.isRepeating = message.isRepeating);
|
|
1234
|
-
message.interactionId !== undefined && (obj.interactionId = Math.round(message.interactionId));
|
|
1235
|
-
message.socialEmoteOutcome !== undefined && (obj.socialEmoteOutcome = Math.round(message.socialEmoteOutcome));
|
|
1236
|
-
message.isReacting !== undefined && (obj.isReacting = message.isReacting);
|
|
1237
|
-
message.socialEmoteInitiator !== undefined && (obj.socialEmoteInitiator = message.socialEmoteInitiator);
|
|
1238
|
-
message.targetAvatar !== undefined && (obj.targetAvatar = message.targetAvatar);
|
|
1239
|
-
message.mask !== undefined && (obj.mask = Math.round(message.mask));
|
|
1240
1140
|
return obj;
|
|
1241
1141
|
}
|
|
1242
1142
|
PlayerEmote.toJSON = toJSON;
|
|
@@ -1245,19 +1145,11 @@ var PlayerEmote;
|
|
|
1245
1145
|
}
|
|
1246
1146
|
PlayerEmote.create = create;
|
|
1247
1147
|
function fromPartial(object) {
|
|
1248
|
-
var _a, _b, _c
|
|
1148
|
+
var _a, _b, _c;
|
|
1249
1149
|
const message = createBasePlayerEmote();
|
|
1250
1150
|
message.incrementalId = (_a = object.incrementalId) !== null && _a !== void 0 ? _a : 0;
|
|
1251
1151
|
message.urn = (_b = object.urn) !== null && _b !== void 0 ? _b : "";
|
|
1252
1152
|
message.timestamp = (_c = object.timestamp) !== null && _c !== void 0 ? _c : 0;
|
|
1253
|
-
message.isStopping = (_d = object.isStopping) !== null && _d !== void 0 ? _d : undefined;
|
|
1254
|
-
message.isRepeating = (_e = object.isRepeating) !== null && _e !== void 0 ? _e : undefined;
|
|
1255
|
-
message.interactionId = (_f = object.interactionId) !== null && _f !== void 0 ? _f : undefined;
|
|
1256
|
-
message.socialEmoteOutcome = (_g = object.socialEmoteOutcome) !== null && _g !== void 0 ? _g : undefined;
|
|
1257
|
-
message.isReacting = (_h = object.isReacting) !== null && _h !== void 0 ? _h : undefined;
|
|
1258
|
-
message.socialEmoteInitiator = (_j = object.socialEmoteInitiator) !== null && _j !== void 0 ? _j : undefined;
|
|
1259
|
-
message.targetAvatar = (_k = object.targetAvatar) !== null && _k !== void 0 ? _k : undefined;
|
|
1260
|
-
message.mask = (_l = object.mask) !== null && _l !== void 0 ? _l : undefined;
|
|
1261
1153
|
return message;
|
|
1262
1154
|
}
|
|
1263
1155
|
PlayerEmote.fromPartial = fromPartial;
|
|
@@ -1529,7 +1421,7 @@ var ProfileResponse;
|
|
|
1529
1421
|
ProfileResponse.fromPartial = fromPartial;
|
|
1530
1422
|
})(ProfileResponse || (exports.ProfileResponse = ProfileResponse = {}));
|
|
1531
1423
|
function createBaseChat() {
|
|
1532
|
-
return { message: "", timestamp: 0
|
|
1424
|
+
return { message: "", timestamp: 0 };
|
|
1533
1425
|
}
|
|
1534
1426
|
var Chat;
|
|
1535
1427
|
(function (Chat) {
|
|
@@ -1540,9 +1432,6 @@ var Chat;
|
|
|
1540
1432
|
if (message.timestamp !== 0) {
|
|
1541
1433
|
writer.uint32(17).double(message.timestamp);
|
|
1542
1434
|
}
|
|
1543
|
-
if (message.forwardedFrom !== undefined) {
|
|
1544
|
-
writer.uint32(26).string(message.forwardedFrom);
|
|
1545
|
-
}
|
|
1546
1435
|
return writer;
|
|
1547
1436
|
}
|
|
1548
1437
|
Chat.encode = encode;
|
|
@@ -1565,12 +1454,6 @@ var Chat;
|
|
|
1565
1454
|
}
|
|
1566
1455
|
message.timestamp = reader.double();
|
|
1567
1456
|
continue;
|
|
1568
|
-
case 3:
|
|
1569
|
-
if (tag !== 26) {
|
|
1570
|
-
break;
|
|
1571
|
-
}
|
|
1572
|
-
message.forwardedFrom = reader.string();
|
|
1573
|
-
continue;
|
|
1574
1457
|
}
|
|
1575
1458
|
if ((tag & 7) === 4 || tag === 0) {
|
|
1576
1459
|
break;
|
|
@@ -1584,7 +1467,6 @@ var Chat;
|
|
|
1584
1467
|
return {
|
|
1585
1468
|
message: isSet(object.message) ? String(object.message) : "",
|
|
1586
1469
|
timestamp: isSet(object.timestamp) ? Number(object.timestamp) : 0,
|
|
1587
|
-
forwardedFrom: isSet(object.forwardedFrom) ? String(object.forwardedFrom) : undefined,
|
|
1588
1470
|
};
|
|
1589
1471
|
}
|
|
1590
1472
|
Chat.fromJSON = fromJSON;
|
|
@@ -1592,7 +1474,6 @@ var Chat;
|
|
|
1592
1474
|
const obj = {};
|
|
1593
1475
|
message.message !== undefined && (obj.message = message.message);
|
|
1594
1476
|
message.timestamp !== undefined && (obj.timestamp = message.timestamp);
|
|
1595
|
-
message.forwardedFrom !== undefined && (obj.forwardedFrom = message.forwardedFrom);
|
|
1596
1477
|
return obj;
|
|
1597
1478
|
}
|
|
1598
1479
|
Chat.toJSON = toJSON;
|
|
@@ -1601,11 +1482,10 @@ var Chat;
|
|
|
1601
1482
|
}
|
|
1602
1483
|
Chat.create = create;
|
|
1603
1484
|
function fromPartial(object) {
|
|
1604
|
-
var _a, _b
|
|
1485
|
+
var _a, _b;
|
|
1605
1486
|
const message = createBaseChat();
|
|
1606
1487
|
message.message = (_a = object.message) !== null && _a !== void 0 ? _a : "";
|
|
1607
1488
|
message.timestamp = (_b = object.timestamp) !== null && _b !== void 0 ? _b : 0;
|
|
1608
|
-
message.forwardedFrom = (_c = object.forwardedFrom) !== null && _c !== void 0 ? _c : undefined;
|
|
1609
1489
|
return message;
|
|
1610
1490
|
}
|
|
1611
1491
|
Chat.fromPartial = fromPartial;
|