diff --git a/package-lock.json b/package-lock.json index a375e3028..2887269dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "license": "Apache-2.0", "dependencies": { "@actions/core": "^1.10.0", - "@dcl/protocol": "https://sdk-team-cdn.decentraland.org/@dcl/protocol/branch//dcl-protocol-1.0.0-12754011500.commit-762ebe6.tgz", + "@dcl/protocol": "https://sdk-team-cdn.decentraland.org/@dcl/protocol/branch//dcl-protocol-1.0.0-12791463180.commit-127443e.tgz", "@dcl/quickjs-emscripten": "^0.21.0-3680274614.commit-1808aa1", "@dcl/ts-proto": "1.153.0", "@types/fs-extra": "^9.0.12", @@ -577,9 +577,9 @@ } }, "node_modules/@dcl/protocol": { - "version": "1.0.0-12754011500.commit-762ebe6", - "resolved": "https://sdk-team-cdn.decentraland.org/@dcl/protocol/branch//dcl-protocol-1.0.0-12754011500.commit-762ebe6.tgz", - "integrity": "sha512-0b3A6Nzezi8ebTf3fYQvZH2z3VdXQ9RQw/1M3nOKTYuy85QSkUS0PxqXgdiYgNzrSzGsV0AQdEwHRgO8ys0krA==", + "version": "1.0.0-12791463180.commit-127443e", + "resolved": "https://sdk-team-cdn.decentraland.org/@dcl/protocol/branch//dcl-protocol-1.0.0-12791463180.commit-127443e.tgz", + "integrity": "sha512-8hUkucA9k2J1vFGBQqEKn2JTSKtl0TY21tRIQ0SK64Z7amh3xLLoVHU8NJEpLTlXIjzZpkgNH4xrYm+YMUkR5w==", "license": "Apache-2.0", "dependencies": { "@dcl/ts-proto": "1.154.0" @@ -8394,8 +8394,8 @@ } }, "@dcl/protocol": { - "version": "https://sdk-team-cdn.decentraland.org/@dcl/protocol/branch//dcl-protocol-1.0.0-12754011500.commit-762ebe6.tgz", - "integrity": "sha512-0b3A6Nzezi8ebTf3fYQvZH2z3VdXQ9RQw/1M3nOKTYuy85QSkUS0PxqXgdiYgNzrSzGsV0AQdEwHRgO8ys0krA==", + "version": "https://sdk-team-cdn.decentraland.org/@dcl/protocol/branch//dcl-protocol-1.0.0-12791463180.commit-127443e.tgz", + "integrity": "sha512-8hUkucA9k2J1vFGBQqEKn2JTSKtl0TY21tRIQ0SK64Z7amh3xLLoVHU8NJEpLTlXIjzZpkgNH4xrYm+YMUkR5w==", "requires": { "@dcl/ts-proto": "1.154.0" }, diff --git a/package.json b/package.json index aa84d1c9e..d5330e6c8 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "bugs": "https://github.com/decentraland/js-sdk-toolchain/issues", "dependencies": { "@actions/core": "^1.10.0", - "@dcl/protocol": "https://sdk-team-cdn.decentraland.org/@dcl/protocol/branch//dcl-protocol-1.0.0-12754011500.commit-762ebe6.tgz", + "@dcl/protocol": "https://sdk-team-cdn.decentraland.org/@dcl/protocol/branch//dcl-protocol-1.0.0-12791463180.commit-127443e.tgz", "@dcl/quickjs-emscripten": "^0.21.0-3680274614.commit-1808aa1", "@dcl/ts-proto": "1.153.0", "@types/fs-extra": "^9.0.12", diff --git a/packages/@dcl/sdk/src/network/message-bus-sync.ts b/packages/@dcl/sdk/src/network/message-bus-sync.ts index 682deb44b..42a4c1ed9 100644 --- a/packages/@dcl/sdk/src/network/message-bus-sync.ts +++ b/packages/@dcl/sdk/src/network/message-bus-sync.ts @@ -32,20 +32,10 @@ export function addSyncTransport( pendingMessageBusMessagesToSend.push({ data: [data], address: address ?? [] }) }) - function getMessagesToSend(): [Uint8Array[], typeof pendingMessageBusMessagesToSend] { + function getMessagesToSend(): typeof pendingMessageBusMessagesToSend { const messages = [...pendingMessageBusMessagesToSend] pendingMessageBusMessagesToSend.length = 0 - const broadcastMessages: Uint8Array[] = [] - const peerMessages: typeof pendingMessageBusMessagesToSend = [] - - for (const message of messages) { - if (!message.address.length) { - broadcastMessages.push(...message.data) - } else { - peerMessages.push(message) - } - } - return [broadcastMessages, peerMessages] + return messages } const players = definePlayerHelper(engine) @@ -61,9 +51,9 @@ export function addSyncTransport( console.log(...Array.from(serializeCrdtMessages('[NetworkMessage sent]:', message, engine))) binaryMessageBus.emit(CommsMessage.CRDT, message) } - const [broadcastMessages, peerMessages] = getMessagesToSend() + const peerMessages = getMessagesToSend() - const response = await sendBinary({ data: broadcastMessages, peerData: peerMessages }) + const response = await sendBinary({ data: [], peerData: peerMessages }) binaryMessageBus.__processMessages(response.data) transportInitialzed = true },