@dcl/ecs 7.23.2-25521226778.commit-1828100 → 7.23.2-25802088407.commit-15e8697

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/components/index.d.ts +0 -5
  2. package/dist/components/index.js +2 -5
  3. package/dist/components/manual/Transform.d.ts +0 -9
  4. package/dist/components/manual/Transform.js +3 -3
  5. package/dist/components/types.d.ts +0 -1
  6. package/dist/engine/component.d.ts +1 -52
  7. package/dist/engine/grow-only-value-set-component-definition.js +2 -45
  8. package/dist/engine/lww-element-set-component-definition.d.ts +1 -3
  9. package/dist/engine/lww-element-set-component-definition.js +12 -64
  10. package/dist/index.d.ts +1 -2
  11. package/dist/index.js +0 -1
  12. package/dist/serialization/crdt/index.d.ts +0 -1
  13. package/dist/serialization/crdt/index.js +0 -1
  14. package/dist/serialization/crdt/network/utils.d.ts +9 -0
  15. package/dist/serialization/crdt/network/utils.js +60 -0
  16. package/dist/serialization/crdt/types.d.ts +3 -25
  17. package/dist/serialization/crdt/types.js +1 -3
  18. package/dist/systems/crdt/index.d.ts +1 -0
  19. package/dist/systems/crdt/index.js +146 -55
  20. package/dist/systems/triggerArea.d.ts +5 -0
  21. package/dist/systems/triggerArea.js +129 -42
  22. package/dist-cjs/components/index.d.ts +0 -5
  23. package/dist-cjs/components/index.js +3 -7
  24. package/dist-cjs/components/manual/Transform.d.ts +0 -9
  25. package/dist-cjs/components/manual/Transform.js +3 -3
  26. package/dist-cjs/components/types.d.ts +0 -1
  27. package/dist-cjs/engine/component.d.ts +1 -52
  28. package/dist-cjs/engine/grow-only-value-set-component-definition.js +1 -44
  29. package/dist-cjs/engine/lww-element-set-component-definition.d.ts +1 -3
  30. package/dist-cjs/engine/lww-element-set-component-definition.js +13 -67
  31. package/dist-cjs/index.d.ts +1 -2
  32. package/dist-cjs/index.js +1 -2
  33. package/dist-cjs/serialization/crdt/index.d.ts +0 -1
  34. package/dist-cjs/serialization/crdt/index.js +0 -1
  35. package/dist-cjs/serialization/crdt/network/utils.d.ts +9 -0
  36. package/dist-cjs/serialization/crdt/network/utils.js +67 -0
  37. package/dist-cjs/serialization/crdt/types.d.ts +3 -25
  38. package/dist-cjs/serialization/crdt/types.js +1 -3
  39. package/dist-cjs/systems/crdt/index.d.ts +1 -0
  40. package/dist-cjs/systems/crdt/index.js +169 -55
  41. package/dist-cjs/systems/triggerArea.d.ts +5 -0
  42. package/dist-cjs/systems/triggerArea.js +129 -42
  43. package/package.json +2 -2
  44. package/dist/components/manual/CreatedBy.d.ts +0 -9
  45. package/dist/components/manual/CreatedBy.js +0 -8
  46. package/dist/serialization/crdt/authoritativePutComponent.d.ts +0 -15
  47. package/dist/serialization/crdt/authoritativePutComponent.js +0 -47
  48. package/dist-cjs/components/manual/CreatedBy.d.ts +0 -9
  49. package/dist-cjs/components/manual/CreatedBy.js +0 -10
  50. package/dist-cjs/serialization/crdt/authoritativePutComponent.d.ts +0 -15
  51. package/dist-cjs/serialization/crdt/authoritativePutComponent.js +0 -50
@@ -1,9 +0,0 @@
1
- import { IEngine, LastWriteWinElementSetComponentDefinition } from '../../engine/types';
2
- export interface ICreatedByType {
3
- address: string;
4
- }
5
- export type ICreatedBy = LastWriteWinElementSetComponentDefinition<ICreatedByType>;
6
- declare function defineCreatedBy(engine: Pick<IEngine, 'defineComponent'>): import("../../engine/types").MapComponentDefinition<import("../..").MapResult<{
7
- address: import("../../schemas").ISchema<string>;
8
- }>>;
9
- export default defineCreatedBy;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const schemas_1 = require("../../schemas");
4
- function defineCreatedBy(engine) {
5
- const CreatedBy = engine.defineComponent('core-schema::Created-By', {
6
- address: schemas_1.Schemas.String
7
- });
8
- return CreatedBy;
9
- }
10
- exports.default = defineCreatedBy;
@@ -1,15 +0,0 @@
1
- import { Entity } from '../../engine/entity';
2
- import { ByteBuffer } from '../ByteBuffer';
3
- import { AuthoritativePutComponentMessage } from './types';
4
- /**
5
- * @public
6
- */
7
- export declare namespace AuthoritativePutComponentOperation {
8
- const MESSAGE_HEADER_LENGTH = 16;
9
- /**
10
- * Call this function for an optimal writing data passing the ByteBuffer
11
- * already allocated
12
- */
13
- function write(entity: Entity, timestamp: number, componentId: number, data: Uint8Array, buf: ByteBuffer): void;
14
- function read(buf: ByteBuffer): AuthoritativePutComponentMessage | null;
15
- }
@@ -1,50 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AuthoritativePutComponentOperation = void 0;
4
- const crdtMessageProtocol_1 = require("./crdtMessageProtocol");
5
- const types_1 = require("./types");
6
- /**
7
- * @public
8
- */
9
- var AuthoritativePutComponentOperation;
10
- (function (AuthoritativePutComponentOperation) {
11
- AuthoritativePutComponentOperation.MESSAGE_HEADER_LENGTH = 16;
12
- /**
13
- * Call this function for an optimal writing data passing the ByteBuffer
14
- * already allocated
15
- */
16
- function write(entity, timestamp, componentId, data, buf) {
17
- // reserve the beginning
18
- const startMessageOffset = buf.incrementWriteOffset(types_1.CRDT_MESSAGE_HEADER_LENGTH + AuthoritativePutComponentOperation.MESSAGE_HEADER_LENGTH);
19
- // write body
20
- buf.writeBuffer(data, false);
21
- const messageLength = buf.currentWriteOffset() - startMessageOffset;
22
- // Write CrdtMessage header
23
- buf.setUint32(startMessageOffset, messageLength);
24
- buf.setUint32(startMessageOffset + 4, types_1.CrdtMessageType.AUTHORITATIVE_PUT_COMPONENT);
25
- // Write ComponentOperation header
26
- buf.setUint32(startMessageOffset + 8, entity);
27
- buf.setUint32(startMessageOffset + 12, componentId);
28
- buf.setUint32(startMessageOffset + 16, timestamp);
29
- const newLocal = messageLength - AuthoritativePutComponentOperation.MESSAGE_HEADER_LENGTH - types_1.CRDT_MESSAGE_HEADER_LENGTH;
30
- buf.setUint32(startMessageOffset + 20, newLocal);
31
- }
32
- AuthoritativePutComponentOperation.write = write;
33
- function read(buf) {
34
- const header = crdtMessageProtocol_1.CrdtMessageProtocol.readHeader(buf);
35
- if (!header) {
36
- return null;
37
- }
38
- if (header.type !== types_1.CrdtMessageType.AUTHORITATIVE_PUT_COMPONENT) {
39
- throw new Error('AuthoritativePutComponentOperation tried to read another message type.');
40
- }
41
- return {
42
- ...header,
43
- entityId: buf.readUint32(),
44
- componentId: buf.readUint32(),
45
- timestamp: buf.readUint32(),
46
- data: buf.readBuffer()
47
- };
48
- }
49
- AuthoritativePutComponentOperation.read = read;
50
- })(AuthoritativePutComponentOperation = exports.AuthoritativePutComponentOperation || (exports.AuthoritativePutComponentOperation = {}));