From 617451d42732ca402e3b7a4ca9b1afe1f5cc987f Mon Sep 17 00:00:00 2001 From: Juan Molteni Date: Fri, 9 Dec 2022 10:23:24 -0300 Subject: [PATCH 1/7] Dividing wearable list --- packages/unity-interface/UnityInterface.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/unity-interface/UnityInterface.ts b/packages/unity-interface/UnityInterface.ts index bc514a82c..c9f6ad7e9 100644 --- a/packages/unity-interface/UnityInterface.ts +++ b/packages/unity-interface/UnityInterface.ts @@ -277,7 +277,15 @@ export class UnityInterface implements IUnityInterface { } public AddWearablesToCatalog(wearables: WearableV2[], context?: string) { - this.SendMessageToUnity('Main', 'AddWearablesToCatalog', JSON.stringify({ wearables, context })) + if (wearables.length > 10) { + const clone = wearables.slice() + while (clone.length) { + wearables = clone.splice(0, 10) + this.SendMessageToUnity('Main', 'AddWearablesToCatalog', JSON.stringify({ wearables, context })) + } + } else { + this.SendMessageToUnity('Main', 'AddWearablesToCatalog', JSON.stringify({ wearables, context })) + } } public AddEmotesToCatalog(emotes: Emote[], context?: string) { From 115971b0fd5f9ee2a61596464315f6950abda614 Mon Sep 17 00:00:00 2001 From: Juan Molteni Date: Fri, 9 Dec 2022 11:01:46 -0300 Subject: [PATCH 2/7] Added message limit --- packages/unity-interface/UnityInterface.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/unity-interface/UnityInterface.ts b/packages/unity-interface/UnityInterface.ts index c9f6ad7e9..f0b0bbd19 100644 --- a/packages/unity-interface/UnityInterface.ts +++ b/packages/unity-interface/UnityInterface.ts @@ -277,10 +277,11 @@ export class UnityInterface implements IUnityInterface { } public AddWearablesToCatalog(wearables: WearableV2[], context?: string) { - if (wearables.length > 10) { + const messageLimit = 50; + if (wearables.length > messageLimit) { const clone = wearables.slice() while (clone.length) { - wearables = clone.splice(0, 10) + wearables = clone.splice(0, messageLimit) this.SendMessageToUnity('Main', 'AddWearablesToCatalog', JSON.stringify({ wearables, context })) } } else { From 148eab84dbfba5da92b625ecfdf168e8f6914d1c Mon Sep 17 00:00:00 2001 From: Juan Molteni Date: Fri, 9 Dec 2022 11:10:01 -0300 Subject: [PATCH 3/7] Lint fix --- packages/unity-interface/UnityInterface.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/unity-interface/UnityInterface.ts b/packages/unity-interface/UnityInterface.ts index f0b0bbd19..47c796c3d 100644 --- a/packages/unity-interface/UnityInterface.ts +++ b/packages/unity-interface/UnityInterface.ts @@ -277,7 +277,7 @@ export class UnityInterface implements IUnityInterface { } public AddWearablesToCatalog(wearables: WearableV2[], context?: string) { - const messageLimit = 50; + const messageLimit = 50 if (wearables.length > messageLimit) { const clone = wearables.slice() while (clone.length) { From d7e2bcd4fb0307748293b3835786e6c87f2e53c4 Mon Sep 17 00:00:00 2001 From: Juan Molteni Date: Fri, 9 Dec 2022 11:28:11 -0300 Subject: [PATCH 4/7] Setting limit to 1 for testing --- packages/unity-interface/UnityInterface.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/unity-interface/UnityInterface.ts b/packages/unity-interface/UnityInterface.ts index 47c796c3d..8bc208808 100644 --- a/packages/unity-interface/UnityInterface.ts +++ b/packages/unity-interface/UnityInterface.ts @@ -277,7 +277,7 @@ export class UnityInterface implements IUnityInterface { } public AddWearablesToCatalog(wearables: WearableV2[], context?: string) { - const messageLimit = 50 + const messageLimit = 1 if (wearables.length > messageLimit) { const clone = wearables.slice() while (clone.length) { From 0807d49f4651c6eaf578d67a45b3dc7de9779c8b Mon Sep 17 00:00:00 2001 From: Juan Molteni Date: Sat, 10 Dec 2022 00:07:36 -0300 Subject: [PATCH 5/7] Splitting string --- packages/unity-interface/UnityInterface.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/unity-interface/UnityInterface.ts b/packages/unity-interface/UnityInterface.ts index 8bc208808..99b2ee29d 100644 --- a/packages/unity-interface/UnityInterface.ts +++ b/packages/unity-interface/UnityInterface.ts @@ -277,15 +277,10 @@ export class UnityInterface implements IUnityInterface { } public AddWearablesToCatalog(wearables: WearableV2[], context?: string) { - const messageLimit = 1 - if (wearables.length > messageLimit) { - const clone = wearables.slice() - while (clone.length) { - wearables = clone.splice(0, messageLimit) - this.SendMessageToUnity('Main', 'AddWearablesToCatalog', JSON.stringify({ wearables, context })) - } - } else { - this.SendMessageToUnity('Main', 'AddWearablesToCatalog', JSON.stringify({ wearables, context })) + const jsonString = JSON.stringify({ wearables, context }) + const result = jsonString.match(/.{1,500000}/g) || [] + for(var i = 0;i Date: Sun, 11 Dec 2022 23:46:36 -0300 Subject: [PATCH 6/7] Setting string limit --- packages/unity-interface/UnityInterface.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/unity-interface/UnityInterface.ts b/packages/unity-interface/UnityInterface.ts index 99b2ee29d..0ae7ab70b 100644 --- a/packages/unity-interface/UnityInterface.ts +++ b/packages/unity-interface/UnityInterface.ts @@ -278,7 +278,7 @@ export class UnityInterface implements IUnityInterface { public AddWearablesToCatalog(wearables: WearableV2[], context?: string) { const jsonString = JSON.stringify({ wearables, context }) - const result = jsonString.match(/.{1,500000}/g) || [] + const result = jsonString.match(/.{1,1306299}/g) || [] for(var i = 0;i Date: Sun, 11 Dec 2022 23:58:51 -0300 Subject: [PATCH 7/7] Lint fix --- packages/unity-interface/UnityInterface.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/unity-interface/UnityInterface.ts b/packages/unity-interface/UnityInterface.ts index 0ae7ab70b..aab754a4f 100644 --- a/packages/unity-interface/UnityInterface.ts +++ b/packages/unity-interface/UnityInterface.ts @@ -279,7 +279,7 @@ export class UnityInterface implements IUnityInterface { public AddWearablesToCatalog(wearables: WearableV2[], context?: string) { const jsonString = JSON.stringify({ wearables, context }) const result = jsonString.match(/.{1,1306299}/g) || [] - for(var i = 0;i