From c973e59f8689f7189b21c26a069744b95ac6514a Mon Sep 17 00:00:00 2001 From: pbosio Date: Wed, 25 Jan 2023 17:17:48 -0300 Subject: [PATCH] feat: add `crdtGetState` to `EngineApi` service (#840) --- package-lock.json | 28 +++++++++++++------------- package.json | 4 ++-- packages/shared/apis/host/EngineAPI.ts | 6 +++--- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1be3e9a2c..ef4368b52 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,9 +20,9 @@ "@dcl/hashing": "^1.1.2", "@dcl/kernel-interface": "^2.0.0-20210922153939.commit-017905d", "@dcl/legacy-ecs": "^6.11.8", - "@dcl/protocol": "^1.0.0-3939040004.commit-2c2721f", + "@dcl/protocol": "^1.0.0-4009547712.commit-472ea24", "@dcl/rpc": "^1.1.1", - "@dcl/scene-runtime": "^7.0.3-20230117120910.commit-a343f1e", + "@dcl/scene-runtime": "^7.0.3-20230125201152.commit-2ffd670", "@dcl/schemas": "^6.4.2", "@dcl/urn-resolver": "^2.0.3", "@redux-saga/simple-saga-monitor": "^1.1.3", @@ -277,9 +277,9 @@ "integrity": "sha512-Z0zpNr2HAxn2cLWUadWGlzaG48Z+N3hg2bI20UH+OT8NJtvCJnAwVBshAG83iAn4BTC+CsUsk4A394jrlv2ZIQ==" }, "node_modules/@dcl/protocol": { - "version": "1.0.0-3939040004.commit-2c2721f", - "resolved": "https://registry.npmjs.org/@dcl/protocol/-/protocol-1.0.0-3939040004.commit-2c2721f.tgz", - "integrity": "sha512-oy1pTCm4oCpfRW4QdsTm7VhV+VLGUrUToAICuGcPmhzSWz8BzM/nWbExJGQ9FB/0LFOM8Dl+oM4Y4u0mtcYPVQ==", + "version": "1.0.0-4009547712.commit-472ea24", + "resolved": "https://registry.npmjs.org/@dcl/protocol/-/protocol-1.0.0-4009547712.commit-472ea24.tgz", + "integrity": "sha512-sKYR8SdY49VTR8yhPuPmvZrCNqV3JSkKgjkGGnEnc2n64SXtkTkoCJHwgZogwBCZVzshW9Jf0Urxr8zZGHJhFw==", "dependencies": { "ts-proto": "^1.126.1" } @@ -294,9 +294,9 @@ } }, "node_modules/@dcl/scene-runtime": { - "version": "7.0.3-20230117120910.commit-a343f1e", - "resolved": "https://registry.npmjs.org/@dcl/scene-runtime/-/scene-runtime-7.0.3-20230117120910.commit-a343f1e.tgz", - "integrity": "sha512-pg8e6P8I0kndnO1OtoKMViuV+Ljy11xIwTEhSHcLSanqAA2vogMhSntcQeJVNeWyqsEg7u6RNXV4fuHqPjldEg==", + "version": "7.0.3-20230125201152.commit-2ffd670", + "resolved": "https://registry.npmjs.org/@dcl/scene-runtime/-/scene-runtime-7.0.3-20230125201152.commit-2ffd670.tgz", + "integrity": "sha512-vtvT/LuO2w3lUm/HEDqtg7yiHvOr8jmhWKeERst2tV9FYEkiLRArMxWI8wyGrCocMDcYFcMrGeHf9BIzBhky4w==", "dependencies": { "@types/ws": "^8.5.3", "fp-future": "^1.0.1", @@ -8302,9 +8302,9 @@ "integrity": "sha512-Z0zpNr2HAxn2cLWUadWGlzaG48Z+N3hg2bI20UH+OT8NJtvCJnAwVBshAG83iAn4BTC+CsUsk4A394jrlv2ZIQ==" }, "@dcl/protocol": { - "version": "1.0.0-3939040004.commit-2c2721f", - "resolved": "https://registry.npmjs.org/@dcl/protocol/-/protocol-1.0.0-3939040004.commit-2c2721f.tgz", - "integrity": "sha512-oy1pTCm4oCpfRW4QdsTm7VhV+VLGUrUToAICuGcPmhzSWz8BzM/nWbExJGQ9FB/0LFOM8Dl+oM4Y4u0mtcYPVQ==", + "version": "1.0.0-4009547712.commit-472ea24", + "resolved": "https://registry.npmjs.org/@dcl/protocol/-/protocol-1.0.0-4009547712.commit-472ea24.tgz", + "integrity": "sha512-sKYR8SdY49VTR8yhPuPmvZrCNqV3JSkKgjkGGnEnc2n64SXtkTkoCJHwgZogwBCZVzshW9Jf0Urxr8zZGHJhFw==", "requires": { "ts-proto": "^1.126.1" } @@ -8319,9 +8319,9 @@ } }, "@dcl/scene-runtime": { - "version": "7.0.3-20230117120910.commit-a343f1e", - "resolved": "https://registry.npmjs.org/@dcl/scene-runtime/-/scene-runtime-7.0.3-20230117120910.commit-a343f1e.tgz", - "integrity": "sha512-pg8e6P8I0kndnO1OtoKMViuV+Ljy11xIwTEhSHcLSanqAA2vogMhSntcQeJVNeWyqsEg7u6RNXV4fuHqPjldEg==", + "version": "7.0.3-20230125201152.commit-2ffd670", + "resolved": "https://registry.npmjs.org/@dcl/scene-runtime/-/scene-runtime-7.0.3-20230125201152.commit-2ffd670.tgz", + "integrity": "sha512-vtvT/LuO2w3lUm/HEDqtg7yiHvOr8jmhWKeERst2tV9FYEkiLRArMxWI8wyGrCocMDcYFcMrGeHf9BIzBhky4w==", "requires": { "@types/ws": "^8.5.3", "fp-future": "^1.0.1", diff --git a/package.json b/package.json index c939b1dff..6ef81b75d 100644 --- a/package.json +++ b/package.json @@ -65,9 +65,9 @@ "@dcl/hashing": "^1.1.2", "@dcl/kernel-interface": "^2.0.0-20210922153939.commit-017905d", "@dcl/legacy-ecs": "^6.11.8", - "@dcl/protocol": "^1.0.0-3939040004.commit-2c2721f", + "@dcl/protocol": "^1.0.0-4009547712.commit-472ea24", "@dcl/rpc": "^1.1.1", - "@dcl/scene-runtime": "^7.0.3-20230117120910.commit-a343f1e", + "@dcl/scene-runtime": "^7.0.3-20230125201152.commit-2ffd670", "@dcl/schemas": "^6.4.2", "@dcl/urn-resolver": "^2.0.3", "@redux-saga/simple-saga-monitor": "^1.1.3", diff --git a/packages/shared/apis/host/EngineAPI.ts b/packages/shared/apis/host/EngineAPI.ts index 2c1290328..9c54d8955 100644 --- a/packages/shared/apis/host/EngineAPI.ts +++ b/packages/shared/apis/host/EngineAPI.ts @@ -127,9 +127,9 @@ export function registerEngineApiServiceServerImplementation(port: RpcServerPort return { data: [response.payload] } }, - // TODO: implement - async crdtGetState() { - return { data: [] } + async crdtGetState(_, ctx) { + const response = await ctx.rpcSceneControllerService.getCurrentState({}) + return { hasEntities: response.hasOwnEntities, data: [response.payload] } } } }