@dcl/ecs 7.29.1-36591934525.commit-48aa9b5 → 7.29.1-36624944101.commit-bb81ac6
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/dist/components/generated/component-names.gen.js +0 -1
- package/dist/components/generated/global.gen.d.ts +0 -2
- package/dist/components/generated/global.gen.js +0 -1
- package/dist/components/generated/index.gen.d.ts +0 -4
- package/dist/components/generated/index.gen.js +0 -7
- package/dist/components/generated/pb/decentraland/sdk/components/common/explorer_ui.gen.d.ts +2 -4
- package/dist/components/generated/pb/decentraland/sdk/components/common/explorer_ui.gen.js +1 -3
- package/dist/components/generated/pb/decentraland/sdk/components/explorer_ui_events_result.gen.d.ts +3 -8
- package/dist/components/generated/pb/decentraland/sdk/components/explorer_ui_events_result.gen.js +1 -10
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.js +5 -2
- package/dist/components/manual/CreatedBy.d.ts +9 -0
- package/dist/components/manual/CreatedBy.js +8 -0
- package/dist/components/manual/Transform.d.ts +9 -0
- package/dist/components/manual/Transform.js +3 -3
- package/dist/components/types.d.ts +1 -0
- package/dist/engine/component.d.ts +52 -1
- package/dist/engine/grow-only-value-set-component-definition.js +45 -2
- package/dist/engine/lww-element-set-component-definition.d.ts +3 -1
- package/dist/engine/lww-element-set-component-definition.js +68 -13
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/serialization/crdt/authoritativePutComponent.d.ts +15 -0
- package/dist/serialization/crdt/authoritativePutComponent.js +47 -0
- package/dist/serialization/crdt/index.d.ts +1 -0
- package/dist/serialization/crdt/index.js +1 -0
- package/dist/serialization/crdt/types.d.ts +25 -3
- package/dist/serialization/crdt/types.js +3 -1
- package/dist/systems/crdt/index.d.ts +0 -1
- package/dist/systems/crdt/index.js +76 -143
- package/dist/systems/crdt/types.d.ts +10 -0
- package/dist-cjs/components/generated/component-names.gen.js +0 -1
- package/dist-cjs/components/generated/global.gen.d.ts +0 -2
- package/dist-cjs/components/generated/global.gen.js +2 -3
- package/dist-cjs/components/generated/index.gen.d.ts +0 -4
- package/dist-cjs/components/generated/index.gen.js +2 -10
- package/dist-cjs/components/generated/pb/decentraland/sdk/components/common/explorer_ui.gen.d.ts +2 -4
- package/dist-cjs/components/generated/pb/decentraland/sdk/components/common/explorer_ui.gen.js +1 -3
- package/dist-cjs/components/generated/pb/decentraland/sdk/components/explorer_ui_events_result.gen.d.ts +3 -8
- package/dist-cjs/components/generated/pb/decentraland/sdk/components/explorer_ui_events_result.gen.js +1 -10
- package/dist-cjs/components/index.d.ts +5 -0
- package/dist-cjs/components/index.js +7 -3
- package/dist-cjs/components/manual/CreatedBy.d.ts +9 -0
- package/dist-cjs/components/manual/CreatedBy.js +10 -0
- package/dist-cjs/components/manual/Transform.d.ts +9 -0
- package/dist-cjs/components/manual/Transform.js +3 -3
- package/dist-cjs/components/types.d.ts +1 -0
- package/dist-cjs/engine/component.d.ts +52 -1
- package/dist-cjs/engine/grow-only-value-set-component-definition.js +44 -1
- package/dist-cjs/engine/lww-element-set-component-definition.d.ts +3 -1
- package/dist-cjs/engine/lww-element-set-component-definition.js +71 -14
- package/dist-cjs/index.d.ts +2 -1
- package/dist-cjs/index.js +2 -1
- package/dist-cjs/serialization/crdt/authoritativePutComponent.d.ts +15 -0
- package/dist-cjs/serialization/crdt/authoritativePutComponent.js +50 -0
- package/dist-cjs/serialization/crdt/index.d.ts +1 -0
- package/dist-cjs/serialization/crdt/index.js +1 -0
- package/dist-cjs/serialization/crdt/types.d.ts +25 -3
- package/dist-cjs/serialization/crdt/types.js +3 -1
- package/dist-cjs/systems/crdt/index.d.ts +0 -1
- package/dist-cjs/systems/crdt/index.js +76 -166
- package/dist-cjs/systems/crdt/types.d.ts +10 -0
- package/package.json +2 -2
- package/dist/components/generated/ExplorerItemPurchaseResult.gen.d.ts +0 -1
- package/dist/components/generated/ExplorerItemPurchaseResult.gen.js +0 -25
- package/dist/components/generated/pb/decentraland/sdk/components/explorer_item_purchase_result.gen.d.ts +0 -68
- package/dist/components/generated/pb/decentraland/sdk/components/explorer_item_purchase_result.gen.js +0 -184
- package/dist/serialization/crdt/network/utils.d.ts +0 -9
- package/dist/serialization/crdt/network/utils.js +0 -60
- package/dist-cjs/components/generated/ExplorerItemPurchaseResult.gen.d.ts +0 -1
- package/dist-cjs/components/generated/ExplorerItemPurchaseResult.gen.js +0 -28
- package/dist-cjs/components/generated/pb/decentraland/sdk/components/explorer_item_purchase_result.gen.d.ts +0 -68
- package/dist-cjs/components/generated/pb/decentraland/sdk/components/explorer_item_purchase_result.gen.js +0 -190
- package/dist-cjs/serialization/crdt/network/utils.d.ts +0 -9
- package/dist-cjs/serialization/crdt/network/utils.js +0 -67
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import _m0 from "protobufjs/minimal";
|
|
3
|
-
const protobufPackageSarasa = "decentraland.sdk.components";
|
|
4
|
-
function createBasePBExplorerItemPurchaseResult() {
|
|
5
|
-
return { urn: "", timestamp: 0, requestId: 0, status: undefined };
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export var PBExplorerItemPurchaseResult;
|
|
11
|
-
(function (PBExplorerItemPurchaseResult) {
|
|
12
|
-
function encode(message, writer = _m0.Writer.create()) {
|
|
13
|
-
if (message.urn !== "") {
|
|
14
|
-
writer.uint32(10).string(message.urn);
|
|
15
|
-
}
|
|
16
|
-
if (message.timestamp !== 0) {
|
|
17
|
-
writer.uint32(16).uint32(message.timestamp);
|
|
18
|
-
}
|
|
19
|
-
if (message.requestId !== 0) {
|
|
20
|
-
writer.uint32(24).uint32(message.requestId);
|
|
21
|
-
}
|
|
22
|
-
switch (message.status?.$case) {
|
|
23
|
-
case "purchased":
|
|
24
|
-
PBExplorerItemPurchaseResult_Purchased.encode(message.status.purchased, writer.uint32(82).fork()).ldelim();
|
|
25
|
-
break;
|
|
26
|
-
case "dismissed":
|
|
27
|
-
PBExplorerItemPurchaseResult_Dismissed.encode(message.status.dismissed, writer.uint32(90).fork()).ldelim();
|
|
28
|
-
break;
|
|
29
|
-
case "failed":
|
|
30
|
-
PBExplorerItemPurchaseResult_Failed.encode(message.status.failed, writer.uint32(98).fork()).ldelim();
|
|
31
|
-
break;
|
|
32
|
-
}
|
|
33
|
-
return writer;
|
|
34
|
-
}
|
|
35
|
-
PBExplorerItemPurchaseResult.encode = encode;
|
|
36
|
-
function decode(input, length) {
|
|
37
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
38
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
39
|
-
const message = createBasePBExplorerItemPurchaseResult();
|
|
40
|
-
while (reader.pos < end) {
|
|
41
|
-
const tag = reader.uint32();
|
|
42
|
-
switch (tag >>> 3) {
|
|
43
|
-
case 1:
|
|
44
|
-
if (tag !== 10) {
|
|
45
|
-
break;
|
|
46
|
-
}
|
|
47
|
-
message.urn = reader.string();
|
|
48
|
-
continue;
|
|
49
|
-
case 2:
|
|
50
|
-
if (tag !== 16) {
|
|
51
|
-
break;
|
|
52
|
-
}
|
|
53
|
-
message.timestamp = reader.uint32();
|
|
54
|
-
continue;
|
|
55
|
-
case 3:
|
|
56
|
-
if (tag !== 24) {
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
message.requestId = reader.uint32();
|
|
60
|
-
continue;
|
|
61
|
-
case 10:
|
|
62
|
-
if (tag !== 82) {
|
|
63
|
-
break;
|
|
64
|
-
}
|
|
65
|
-
message.status = {
|
|
66
|
-
$case: "purchased",
|
|
67
|
-
purchased: PBExplorerItemPurchaseResult_Purchased.decode(reader, reader.uint32()),
|
|
68
|
-
};
|
|
69
|
-
continue;
|
|
70
|
-
case 11:
|
|
71
|
-
if (tag !== 90) {
|
|
72
|
-
break;
|
|
73
|
-
}
|
|
74
|
-
message.status = {
|
|
75
|
-
$case: "dismissed",
|
|
76
|
-
dismissed: PBExplorerItemPurchaseResult_Dismissed.decode(reader, reader.uint32()),
|
|
77
|
-
};
|
|
78
|
-
continue;
|
|
79
|
-
case 12:
|
|
80
|
-
if (tag !== 98) {
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
83
|
-
message.status = {
|
|
84
|
-
$case: "failed",
|
|
85
|
-
failed: PBExplorerItemPurchaseResult_Failed.decode(reader, reader.uint32()),
|
|
86
|
-
};
|
|
87
|
-
continue;
|
|
88
|
-
}
|
|
89
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
90
|
-
break;
|
|
91
|
-
}
|
|
92
|
-
reader.skipType(tag & 7);
|
|
93
|
-
}
|
|
94
|
-
return message;
|
|
95
|
-
}
|
|
96
|
-
PBExplorerItemPurchaseResult.decode = decode;
|
|
97
|
-
})(PBExplorerItemPurchaseResult || (PBExplorerItemPurchaseResult = {}));
|
|
98
|
-
function createBasePBExplorerItemPurchaseResult_Purchased() {
|
|
99
|
-
return {};
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* @public
|
|
103
|
-
*/
|
|
104
|
-
export var PBExplorerItemPurchaseResult_Purchased;
|
|
105
|
-
(function (PBExplorerItemPurchaseResult_Purchased) {
|
|
106
|
-
function encode(_, writer = _m0.Writer.create()) {
|
|
107
|
-
return writer;
|
|
108
|
-
}
|
|
109
|
-
PBExplorerItemPurchaseResult_Purchased.encode = encode;
|
|
110
|
-
function decode(input, length) {
|
|
111
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
112
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
113
|
-
const message = createBasePBExplorerItemPurchaseResult_Purchased();
|
|
114
|
-
while (reader.pos < end) {
|
|
115
|
-
const tag = reader.uint32();
|
|
116
|
-
switch (tag >>> 3) {
|
|
117
|
-
}
|
|
118
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
119
|
-
break;
|
|
120
|
-
}
|
|
121
|
-
reader.skipType(tag & 7);
|
|
122
|
-
}
|
|
123
|
-
return message;
|
|
124
|
-
}
|
|
125
|
-
PBExplorerItemPurchaseResult_Purchased.decode = decode;
|
|
126
|
-
})(PBExplorerItemPurchaseResult_Purchased || (PBExplorerItemPurchaseResult_Purchased = {}));
|
|
127
|
-
function createBasePBExplorerItemPurchaseResult_Dismissed() {
|
|
128
|
-
return {};
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* @public
|
|
132
|
-
*/
|
|
133
|
-
export var PBExplorerItemPurchaseResult_Dismissed;
|
|
134
|
-
(function (PBExplorerItemPurchaseResult_Dismissed) {
|
|
135
|
-
function encode(_, writer = _m0.Writer.create()) {
|
|
136
|
-
return writer;
|
|
137
|
-
}
|
|
138
|
-
PBExplorerItemPurchaseResult_Dismissed.encode = encode;
|
|
139
|
-
function decode(input, length) {
|
|
140
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
141
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
142
|
-
const message = createBasePBExplorerItemPurchaseResult_Dismissed();
|
|
143
|
-
while (reader.pos < end) {
|
|
144
|
-
const tag = reader.uint32();
|
|
145
|
-
switch (tag >>> 3) {
|
|
146
|
-
}
|
|
147
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
148
|
-
break;
|
|
149
|
-
}
|
|
150
|
-
reader.skipType(tag & 7);
|
|
151
|
-
}
|
|
152
|
-
return message;
|
|
153
|
-
}
|
|
154
|
-
PBExplorerItemPurchaseResult_Dismissed.decode = decode;
|
|
155
|
-
})(PBExplorerItemPurchaseResult_Dismissed || (PBExplorerItemPurchaseResult_Dismissed = {}));
|
|
156
|
-
function createBasePBExplorerItemPurchaseResult_Failed() {
|
|
157
|
-
return {};
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* @public
|
|
161
|
-
*/
|
|
162
|
-
export var PBExplorerItemPurchaseResult_Failed;
|
|
163
|
-
(function (PBExplorerItemPurchaseResult_Failed) {
|
|
164
|
-
function encode(_, writer = _m0.Writer.create()) {
|
|
165
|
-
return writer;
|
|
166
|
-
}
|
|
167
|
-
PBExplorerItemPurchaseResult_Failed.encode = encode;
|
|
168
|
-
function decode(input, length) {
|
|
169
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
170
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
171
|
-
const message = createBasePBExplorerItemPurchaseResult_Failed();
|
|
172
|
-
while (reader.pos < end) {
|
|
173
|
-
const tag = reader.uint32();
|
|
174
|
-
switch (tag >>> 3) {
|
|
175
|
-
}
|
|
176
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
177
|
-
break;
|
|
178
|
-
}
|
|
179
|
-
reader.skipType(tag & 7);
|
|
180
|
-
}
|
|
181
|
-
return message;
|
|
182
|
-
}
|
|
183
|
-
PBExplorerItemPurchaseResult_Failed.decode = decode;
|
|
184
|
-
})(PBExplorerItemPurchaseResult_Failed || (PBExplorerItemPurchaseResult_Failed = {}));
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Entity } from '../../../engine';
|
|
2
|
-
import { ReceiveMessage, TransformType } from '../../../runtime/types';
|
|
3
|
-
import { ReceiveNetworkMessage } from '../../../systems/crdt/types';
|
|
4
|
-
import { ByteBuffer } from '../../ByteBuffer';
|
|
5
|
-
import { INetowrkEntityType } from '../../../components/types';
|
|
6
|
-
export declare function isNetworkMessage(message: ReceiveMessage): message is ReceiveNetworkMessage;
|
|
7
|
-
export declare function networkMessageToLocal(message: ReceiveNetworkMessage, localEntityId: Entity, buffer: ByteBuffer, destinationBuffer: ByteBuffer): void;
|
|
8
|
-
export declare function localMessageToNetwork(message: ReceiveMessage, network: INetowrkEntityType, buffer: ByteBuffer, destinationBuffer: ByteBuffer): void;
|
|
9
|
-
export declare function fixTransformParent(message: ReceiveMessage, transformValue?: TransformType, parent?: Entity): Uint8Array;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { ReadWriteByteBuffer } from '../../ByteBuffer';
|
|
2
|
-
import { PutComponentOperation } from '../putComponent';
|
|
3
|
-
import { CrdtMessageType } from '../types';
|
|
4
|
-
import { DeleteComponent } from '../deleteComponent';
|
|
5
|
-
import { DeleteEntity } from '../deleteEntity';
|
|
6
|
-
import { PutNetworkComponentOperation } from './putComponentNetwork';
|
|
7
|
-
import { DeleteComponentNetwork } from './deleteComponentNetwork';
|
|
8
|
-
import { DeleteEntityNetwork } from './deleteEntityNetwork';
|
|
9
|
-
import { TransformSchema } from '../../../components/manual/Transform';
|
|
10
|
-
/* istanbul ignore next */
|
|
11
|
-
export function isNetworkMessage(message) {
|
|
12
|
-
return [
|
|
13
|
-
CrdtMessageType.DELETE_COMPONENT_NETWORK,
|
|
14
|
-
CrdtMessageType.DELETE_ENTITY_NETWORK,
|
|
15
|
-
CrdtMessageType.PUT_COMPONENT_NETWORK
|
|
16
|
-
].includes(message.type);
|
|
17
|
-
}
|
|
18
|
-
/* istanbul ignore next */
|
|
19
|
-
export function networkMessageToLocal(message, localEntityId, buffer, destinationBuffer) {
|
|
20
|
-
const offset = buffer.currentWriteOffset();
|
|
21
|
-
if (message.type === CrdtMessageType.PUT_COMPONENT_NETWORK) {
|
|
22
|
-
PutComponentOperation.write(localEntityId, message.timestamp, message.componentId, message.data, buffer);
|
|
23
|
-
}
|
|
24
|
-
else if (message.type === CrdtMessageType.DELETE_COMPONENT_NETWORK) {
|
|
25
|
-
DeleteComponent.write(localEntityId, message.componentId, message.timestamp, buffer);
|
|
26
|
-
}
|
|
27
|
-
else if (message.type === CrdtMessageType.DELETE_ENTITY_NETWORK) {
|
|
28
|
-
DeleteEntity.write(localEntityId, buffer);
|
|
29
|
-
}
|
|
30
|
-
destinationBuffer.writeBuffer(buffer.buffer().subarray(offset, buffer.currentWriteOffset()), false);
|
|
31
|
-
}
|
|
32
|
-
/* istanbul ignore next */
|
|
33
|
-
export function localMessageToNetwork(message, network, buffer, destinationBuffer) {
|
|
34
|
-
const offset = buffer.currentWriteOffset();
|
|
35
|
-
if (message.type === CrdtMessageType.PUT_COMPONENT) {
|
|
36
|
-
PutNetworkComponentOperation.write(network.entityId, message.timestamp, message.componentId, network.networkId, message.data, buffer);
|
|
37
|
-
}
|
|
38
|
-
else if (message.type === CrdtMessageType.DELETE_COMPONENT) {
|
|
39
|
-
DeleteComponentNetwork.write(network.entityId, message.componentId, message.timestamp, network.networkId, buffer);
|
|
40
|
-
}
|
|
41
|
-
else if (message.type === CrdtMessageType.DELETE_ENTITY) {
|
|
42
|
-
DeleteEntityNetwork.write(network.entityId, network.networkId, buffer);
|
|
43
|
-
}
|
|
44
|
-
destinationBuffer.writeBuffer(buffer.buffer().subarray(offset, buffer.currentWriteOffset()), false);
|
|
45
|
-
}
|
|
46
|
-
const buffer = new ReadWriteByteBuffer();
|
|
47
|
-
/* istanbul ignore next */
|
|
48
|
-
export function fixTransformParent(message, transformValue, parent) {
|
|
49
|
-
buffer.resetBuffer();
|
|
50
|
-
let transform = transformValue;
|
|
51
|
-
if (!transform && 'data' in message) {
|
|
52
|
-
transform = TransformSchema.deserialize(new ReadWriteByteBuffer(message.data));
|
|
53
|
-
}
|
|
54
|
-
if (!transform)
|
|
55
|
-
throw new Error('Invalid parent transform');
|
|
56
|
-
// Generate new transform raw data with the parent
|
|
57
|
-
const newTransform = { ...transform, parent };
|
|
58
|
-
TransformSchema.serialize(newTransform, buffer);
|
|
59
|
-
return buffer.toBinary();
|
|
60
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ExplorerItemPurchaseResultSchema = void 0;
|
|
4
|
-
const explorer_item_purchase_result_gen_1 = require("./pb/decentraland/sdk/components/explorer_item_purchase_result.gen");
|
|
5
|
-
/**
|
|
6
|
-
* @internal
|
|
7
|
-
*/
|
|
8
|
-
exports.ExplorerItemPurchaseResultSchema = {
|
|
9
|
-
COMPONENT_ID: 1222,
|
|
10
|
-
serialize(value, builder) {
|
|
11
|
-
const writer = explorer_item_purchase_result_gen_1.PBExplorerItemPurchaseResult.encode(value);
|
|
12
|
-
const buffer = new Uint8Array(writer.finish(), 0, writer.len);
|
|
13
|
-
builder.writeBuffer(buffer, false);
|
|
14
|
-
},
|
|
15
|
-
deserialize(reader) {
|
|
16
|
-
return explorer_item_purchase_result_gen_1.PBExplorerItemPurchaseResult.decode(reader.buffer(), reader.remainingBytes());
|
|
17
|
-
},
|
|
18
|
-
create() {
|
|
19
|
-
// TODO: this is a hack.
|
|
20
|
-
return explorer_item_purchase_result_gen_1.PBExplorerItemPurchaseResult.decode(new Uint8Array());
|
|
21
|
-
},
|
|
22
|
-
jsonSchema: {
|
|
23
|
-
type: "object",
|
|
24
|
-
properties: {},
|
|
25
|
-
serializationType: "protocol-buffer",
|
|
26
|
-
protocolBuffer: "PBExplorerItemPurchaseResult"
|
|
27
|
-
}
|
|
28
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import _m0 from "protobufjs/minimal";
|
|
2
|
-
/**
|
|
3
|
-
* Grow-only value set appended to the scene root entity.
|
|
4
|
-
* Reports the outcome of an EU_ITEM_PURCHASE flow triggered via OpenExplorerUi.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
export interface PBExplorerItemPurchaseResult {
|
|
10
|
-
urn: string;
|
|
11
|
-
/** The scene tick when the event occurred */
|
|
12
|
-
timestamp: number;
|
|
13
|
-
/** The OpenExplorerUiRequest.request_id that caused this event; 0 when the request carried none */
|
|
14
|
-
requestId: number;
|
|
15
|
-
status?: {
|
|
16
|
-
$case: "purchased";
|
|
17
|
-
purchased: PBExplorerItemPurchaseResult_Purchased;
|
|
18
|
-
} | {
|
|
19
|
-
$case: "dismissed";
|
|
20
|
-
dismissed: PBExplorerItemPurchaseResult_Dismissed;
|
|
21
|
-
} | {
|
|
22
|
-
$case: "failed";
|
|
23
|
-
failed: PBExplorerItemPurchaseResult_Failed;
|
|
24
|
-
} | undefined;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* @public
|
|
28
|
-
*/
|
|
29
|
-
export interface PBExplorerItemPurchaseResult_Purchased {
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* @public
|
|
33
|
-
*/
|
|
34
|
-
export interface PBExplorerItemPurchaseResult_Dismissed {
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* @public
|
|
38
|
-
*/
|
|
39
|
-
export interface PBExplorerItemPurchaseResult_Failed {
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* @public
|
|
43
|
-
*/
|
|
44
|
-
export declare namespace PBExplorerItemPurchaseResult {
|
|
45
|
-
function encode(message: PBExplorerItemPurchaseResult, writer?: _m0.Writer): _m0.Writer;
|
|
46
|
-
function decode(input: _m0.Reader | Uint8Array, length?: number): PBExplorerItemPurchaseResult;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* @public
|
|
50
|
-
*/
|
|
51
|
-
export declare namespace PBExplorerItemPurchaseResult_Purchased {
|
|
52
|
-
function encode(_: PBExplorerItemPurchaseResult_Purchased, writer?: _m0.Writer): _m0.Writer;
|
|
53
|
-
function decode(input: _m0.Reader | Uint8Array, length?: number): PBExplorerItemPurchaseResult_Purchased;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* @public
|
|
57
|
-
*/
|
|
58
|
-
export declare namespace PBExplorerItemPurchaseResult_Dismissed {
|
|
59
|
-
function encode(_: PBExplorerItemPurchaseResult_Dismissed, writer?: _m0.Writer): _m0.Writer;
|
|
60
|
-
function decode(input: _m0.Reader | Uint8Array, length?: number): PBExplorerItemPurchaseResult_Dismissed;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* @public
|
|
64
|
-
*/
|
|
65
|
-
export declare namespace PBExplorerItemPurchaseResult_Failed {
|
|
66
|
-
function encode(_: PBExplorerItemPurchaseResult_Failed, writer?: _m0.Writer): _m0.Writer;
|
|
67
|
-
function decode(input: _m0.Reader | Uint8Array, length?: number): PBExplorerItemPurchaseResult_Failed;
|
|
68
|
-
}
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.PBExplorerItemPurchaseResult_Failed = exports.PBExplorerItemPurchaseResult_Dismissed = exports.PBExplorerItemPurchaseResult_Purchased = exports.PBExplorerItemPurchaseResult = void 0;
|
|
7
|
-
/* eslint-disable */
|
|
8
|
-
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
9
|
-
const protobufPackageSarasa = "decentraland.sdk.components";
|
|
10
|
-
function createBasePBExplorerItemPurchaseResult() {
|
|
11
|
-
return { urn: "", timestamp: 0, requestId: 0, status: undefined };
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
var PBExplorerItemPurchaseResult;
|
|
17
|
-
(function (PBExplorerItemPurchaseResult) {
|
|
18
|
-
function encode(message, writer = minimal_1.default.Writer.create()) {
|
|
19
|
-
if (message.urn !== "") {
|
|
20
|
-
writer.uint32(10).string(message.urn);
|
|
21
|
-
}
|
|
22
|
-
if (message.timestamp !== 0) {
|
|
23
|
-
writer.uint32(16).uint32(message.timestamp);
|
|
24
|
-
}
|
|
25
|
-
if (message.requestId !== 0) {
|
|
26
|
-
writer.uint32(24).uint32(message.requestId);
|
|
27
|
-
}
|
|
28
|
-
switch (message.status?.$case) {
|
|
29
|
-
case "purchased":
|
|
30
|
-
PBExplorerItemPurchaseResult_Purchased.encode(message.status.purchased, writer.uint32(82).fork()).ldelim();
|
|
31
|
-
break;
|
|
32
|
-
case "dismissed":
|
|
33
|
-
PBExplorerItemPurchaseResult_Dismissed.encode(message.status.dismissed, writer.uint32(90).fork()).ldelim();
|
|
34
|
-
break;
|
|
35
|
-
case "failed":
|
|
36
|
-
PBExplorerItemPurchaseResult_Failed.encode(message.status.failed, writer.uint32(98).fork()).ldelim();
|
|
37
|
-
break;
|
|
38
|
-
}
|
|
39
|
-
return writer;
|
|
40
|
-
}
|
|
41
|
-
PBExplorerItemPurchaseResult.encode = encode;
|
|
42
|
-
function decode(input, length) {
|
|
43
|
-
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
44
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
45
|
-
const message = createBasePBExplorerItemPurchaseResult();
|
|
46
|
-
while (reader.pos < end) {
|
|
47
|
-
const tag = reader.uint32();
|
|
48
|
-
switch (tag >>> 3) {
|
|
49
|
-
case 1:
|
|
50
|
-
if (tag !== 10) {
|
|
51
|
-
break;
|
|
52
|
-
}
|
|
53
|
-
message.urn = reader.string();
|
|
54
|
-
continue;
|
|
55
|
-
case 2:
|
|
56
|
-
if (tag !== 16) {
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
message.timestamp = reader.uint32();
|
|
60
|
-
continue;
|
|
61
|
-
case 3:
|
|
62
|
-
if (tag !== 24) {
|
|
63
|
-
break;
|
|
64
|
-
}
|
|
65
|
-
message.requestId = reader.uint32();
|
|
66
|
-
continue;
|
|
67
|
-
case 10:
|
|
68
|
-
if (tag !== 82) {
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
message.status = {
|
|
72
|
-
$case: "purchased",
|
|
73
|
-
purchased: PBExplorerItemPurchaseResult_Purchased.decode(reader, reader.uint32()),
|
|
74
|
-
};
|
|
75
|
-
continue;
|
|
76
|
-
case 11:
|
|
77
|
-
if (tag !== 90) {
|
|
78
|
-
break;
|
|
79
|
-
}
|
|
80
|
-
message.status = {
|
|
81
|
-
$case: "dismissed",
|
|
82
|
-
dismissed: PBExplorerItemPurchaseResult_Dismissed.decode(reader, reader.uint32()),
|
|
83
|
-
};
|
|
84
|
-
continue;
|
|
85
|
-
case 12:
|
|
86
|
-
if (tag !== 98) {
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
89
|
-
message.status = {
|
|
90
|
-
$case: "failed",
|
|
91
|
-
failed: PBExplorerItemPurchaseResult_Failed.decode(reader, reader.uint32()),
|
|
92
|
-
};
|
|
93
|
-
continue;
|
|
94
|
-
}
|
|
95
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
96
|
-
break;
|
|
97
|
-
}
|
|
98
|
-
reader.skipType(tag & 7);
|
|
99
|
-
}
|
|
100
|
-
return message;
|
|
101
|
-
}
|
|
102
|
-
PBExplorerItemPurchaseResult.decode = decode;
|
|
103
|
-
})(PBExplorerItemPurchaseResult = exports.PBExplorerItemPurchaseResult || (exports.PBExplorerItemPurchaseResult = {}));
|
|
104
|
-
function createBasePBExplorerItemPurchaseResult_Purchased() {
|
|
105
|
-
return {};
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* @public
|
|
109
|
-
*/
|
|
110
|
-
var PBExplorerItemPurchaseResult_Purchased;
|
|
111
|
-
(function (PBExplorerItemPurchaseResult_Purchased) {
|
|
112
|
-
function encode(_, writer = minimal_1.default.Writer.create()) {
|
|
113
|
-
return writer;
|
|
114
|
-
}
|
|
115
|
-
PBExplorerItemPurchaseResult_Purchased.encode = encode;
|
|
116
|
-
function decode(input, length) {
|
|
117
|
-
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
118
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
119
|
-
const message = createBasePBExplorerItemPurchaseResult_Purchased();
|
|
120
|
-
while (reader.pos < end) {
|
|
121
|
-
const tag = reader.uint32();
|
|
122
|
-
switch (tag >>> 3) {
|
|
123
|
-
}
|
|
124
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
125
|
-
break;
|
|
126
|
-
}
|
|
127
|
-
reader.skipType(tag & 7);
|
|
128
|
-
}
|
|
129
|
-
return message;
|
|
130
|
-
}
|
|
131
|
-
PBExplorerItemPurchaseResult_Purchased.decode = decode;
|
|
132
|
-
})(PBExplorerItemPurchaseResult_Purchased = exports.PBExplorerItemPurchaseResult_Purchased || (exports.PBExplorerItemPurchaseResult_Purchased = {}));
|
|
133
|
-
function createBasePBExplorerItemPurchaseResult_Dismissed() {
|
|
134
|
-
return {};
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* @public
|
|
138
|
-
*/
|
|
139
|
-
var PBExplorerItemPurchaseResult_Dismissed;
|
|
140
|
-
(function (PBExplorerItemPurchaseResult_Dismissed) {
|
|
141
|
-
function encode(_, writer = minimal_1.default.Writer.create()) {
|
|
142
|
-
return writer;
|
|
143
|
-
}
|
|
144
|
-
PBExplorerItemPurchaseResult_Dismissed.encode = encode;
|
|
145
|
-
function decode(input, length) {
|
|
146
|
-
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
147
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
148
|
-
const message = createBasePBExplorerItemPurchaseResult_Dismissed();
|
|
149
|
-
while (reader.pos < end) {
|
|
150
|
-
const tag = reader.uint32();
|
|
151
|
-
switch (tag >>> 3) {
|
|
152
|
-
}
|
|
153
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
154
|
-
break;
|
|
155
|
-
}
|
|
156
|
-
reader.skipType(tag & 7);
|
|
157
|
-
}
|
|
158
|
-
return message;
|
|
159
|
-
}
|
|
160
|
-
PBExplorerItemPurchaseResult_Dismissed.decode = decode;
|
|
161
|
-
})(PBExplorerItemPurchaseResult_Dismissed = exports.PBExplorerItemPurchaseResult_Dismissed || (exports.PBExplorerItemPurchaseResult_Dismissed = {}));
|
|
162
|
-
function createBasePBExplorerItemPurchaseResult_Failed() {
|
|
163
|
-
return {};
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* @public
|
|
167
|
-
*/
|
|
168
|
-
var PBExplorerItemPurchaseResult_Failed;
|
|
169
|
-
(function (PBExplorerItemPurchaseResult_Failed) {
|
|
170
|
-
function encode(_, writer = minimal_1.default.Writer.create()) {
|
|
171
|
-
return writer;
|
|
172
|
-
}
|
|
173
|
-
PBExplorerItemPurchaseResult_Failed.encode = encode;
|
|
174
|
-
function decode(input, length) {
|
|
175
|
-
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
176
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
177
|
-
const message = createBasePBExplorerItemPurchaseResult_Failed();
|
|
178
|
-
while (reader.pos < end) {
|
|
179
|
-
const tag = reader.uint32();
|
|
180
|
-
switch (tag >>> 3) {
|
|
181
|
-
}
|
|
182
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
183
|
-
break;
|
|
184
|
-
}
|
|
185
|
-
reader.skipType(tag & 7);
|
|
186
|
-
}
|
|
187
|
-
return message;
|
|
188
|
-
}
|
|
189
|
-
PBExplorerItemPurchaseResult_Failed.decode = decode;
|
|
190
|
-
})(PBExplorerItemPurchaseResult_Failed = exports.PBExplorerItemPurchaseResult_Failed || (exports.PBExplorerItemPurchaseResult_Failed = {}));
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Entity } from '../../../engine';
|
|
2
|
-
import { ReceiveMessage, TransformType } from '../../../runtime/types';
|
|
3
|
-
import { ReceiveNetworkMessage } from '../../../systems/crdt/types';
|
|
4
|
-
import { ByteBuffer } from '../../ByteBuffer';
|
|
5
|
-
import { INetowrkEntityType } from '../../../components/types';
|
|
6
|
-
export declare function isNetworkMessage(message: ReceiveMessage): message is ReceiveNetworkMessage;
|
|
7
|
-
export declare function networkMessageToLocal(message: ReceiveNetworkMessage, localEntityId: Entity, buffer: ByteBuffer, destinationBuffer: ByteBuffer): void;
|
|
8
|
-
export declare function localMessageToNetwork(message: ReceiveMessage, network: INetowrkEntityType, buffer: ByteBuffer, destinationBuffer: ByteBuffer): void;
|
|
9
|
-
export declare function fixTransformParent(message: ReceiveMessage, transformValue?: TransformType, parent?: Entity): Uint8Array;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fixTransformParent = exports.localMessageToNetwork = exports.networkMessageToLocal = exports.isNetworkMessage = void 0;
|
|
4
|
-
const ByteBuffer_1 = require("../../ByteBuffer");
|
|
5
|
-
const putComponent_1 = require("../putComponent");
|
|
6
|
-
const types_1 = require("../types");
|
|
7
|
-
const deleteComponent_1 = require("../deleteComponent");
|
|
8
|
-
const deleteEntity_1 = require("../deleteEntity");
|
|
9
|
-
const putComponentNetwork_1 = require("./putComponentNetwork");
|
|
10
|
-
const deleteComponentNetwork_1 = require("./deleteComponentNetwork");
|
|
11
|
-
const deleteEntityNetwork_1 = require("./deleteEntityNetwork");
|
|
12
|
-
const Transform_1 = require("../../../components/manual/Transform");
|
|
13
|
-
/* istanbul ignore next */
|
|
14
|
-
function isNetworkMessage(message) {
|
|
15
|
-
return [
|
|
16
|
-
types_1.CrdtMessageType.DELETE_COMPONENT_NETWORK,
|
|
17
|
-
types_1.CrdtMessageType.DELETE_ENTITY_NETWORK,
|
|
18
|
-
types_1.CrdtMessageType.PUT_COMPONENT_NETWORK
|
|
19
|
-
].includes(message.type);
|
|
20
|
-
}
|
|
21
|
-
exports.isNetworkMessage = isNetworkMessage;
|
|
22
|
-
/* istanbul ignore next */
|
|
23
|
-
function networkMessageToLocal(message, localEntityId, buffer, destinationBuffer) {
|
|
24
|
-
const offset = buffer.currentWriteOffset();
|
|
25
|
-
if (message.type === types_1.CrdtMessageType.PUT_COMPONENT_NETWORK) {
|
|
26
|
-
putComponent_1.PutComponentOperation.write(localEntityId, message.timestamp, message.componentId, message.data, buffer);
|
|
27
|
-
}
|
|
28
|
-
else if (message.type === types_1.CrdtMessageType.DELETE_COMPONENT_NETWORK) {
|
|
29
|
-
deleteComponent_1.DeleteComponent.write(localEntityId, message.componentId, message.timestamp, buffer);
|
|
30
|
-
}
|
|
31
|
-
else if (message.type === types_1.CrdtMessageType.DELETE_ENTITY_NETWORK) {
|
|
32
|
-
deleteEntity_1.DeleteEntity.write(localEntityId, buffer);
|
|
33
|
-
}
|
|
34
|
-
destinationBuffer.writeBuffer(buffer.buffer().subarray(offset, buffer.currentWriteOffset()), false);
|
|
35
|
-
}
|
|
36
|
-
exports.networkMessageToLocal = networkMessageToLocal;
|
|
37
|
-
/* istanbul ignore next */
|
|
38
|
-
function localMessageToNetwork(message, network, buffer, destinationBuffer) {
|
|
39
|
-
const offset = buffer.currentWriteOffset();
|
|
40
|
-
if (message.type === types_1.CrdtMessageType.PUT_COMPONENT) {
|
|
41
|
-
putComponentNetwork_1.PutNetworkComponentOperation.write(network.entityId, message.timestamp, message.componentId, network.networkId, message.data, buffer);
|
|
42
|
-
}
|
|
43
|
-
else if (message.type === types_1.CrdtMessageType.DELETE_COMPONENT) {
|
|
44
|
-
deleteComponentNetwork_1.DeleteComponentNetwork.write(network.entityId, message.componentId, message.timestamp, network.networkId, buffer);
|
|
45
|
-
}
|
|
46
|
-
else if (message.type === types_1.CrdtMessageType.DELETE_ENTITY) {
|
|
47
|
-
deleteEntityNetwork_1.DeleteEntityNetwork.write(network.entityId, network.networkId, buffer);
|
|
48
|
-
}
|
|
49
|
-
destinationBuffer.writeBuffer(buffer.buffer().subarray(offset, buffer.currentWriteOffset()), false);
|
|
50
|
-
}
|
|
51
|
-
exports.localMessageToNetwork = localMessageToNetwork;
|
|
52
|
-
const buffer = new ByteBuffer_1.ReadWriteByteBuffer();
|
|
53
|
-
/* istanbul ignore next */
|
|
54
|
-
function fixTransformParent(message, transformValue, parent) {
|
|
55
|
-
buffer.resetBuffer();
|
|
56
|
-
let transform = transformValue;
|
|
57
|
-
if (!transform && 'data' in message) {
|
|
58
|
-
transform = Transform_1.TransformSchema.deserialize(new ByteBuffer_1.ReadWriteByteBuffer(message.data));
|
|
59
|
-
}
|
|
60
|
-
if (!transform)
|
|
61
|
-
throw new Error('Invalid parent transform');
|
|
62
|
-
// Generate new transform raw data with the parent
|
|
63
|
-
const newTransform = { ...transform, parent };
|
|
64
|
-
Transform_1.TransformSchema.serialize(newTransform, buffer);
|
|
65
|
-
return buffer.toBinary();
|
|
66
|
-
}
|
|
67
|
-
exports.fixTransformParent = fixTransformParent;
|