From 8180d35cc56050156bc95ad999c2518a2623d5f8 Mon Sep 17 00:00:00 2001 From: kitt Date: Sat, 1 Jul 2023 00:22:36 -0400 Subject: [PATCH] more jank --- src/exporters/splashcat.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/exporters/splashcat.ts b/src/exporters/splashcat.ts index 7bee74b..ad12021 100644 --- a/src/exporters/splashcat.ts +++ b/src/exporters/splashcat.ts @@ -121,11 +121,17 @@ export class SplashcatExporter implements GameExporter { } } } - static getGameId(id: string) { // very similar to the file exporter + static getGameIdOld(id: string) { // very similar to the file exporter const { uid, timestamp } = parseHistoryDetailId(id); return `${uid}_${timestamp}Z`; } + + static getGameId(id: string) { + const plainText = new TextDecoder().decode(base64.decode(id)); + + return plainText.split(':').at(-1); + } async notExported( { type, list }: { list: string[]; type: Game["type"] }, ): Promise { @@ -135,10 +141,11 @@ export class SplashcatExporter implements GameExporter { const out: string[] = []; for (const id of list) { + const oldGameId = SplashcatExporter.getGameIdOld(id); const gameId = SplashcatExporter.getGameId(id); if ( - !uuid.includes(gameId) + !uuid.includes(oldGameId) && !uuid.includes(gameId) ) { out.push(id); } @@ -160,7 +167,7 @@ export class SplashcatExporter implements GameExporter { isMe: player.isMyself, name: player.name, nameId: player.nameId ?? "", - nplnId: player.id.substring(0,50), // NOT CORRECT, FIX LATER + nplnId: new TextDecoder().decode(base64.decode(player.id)).split(":").at(-1), // NOT CORRECT, FIX LATER paint: player.paint, species: player.species, weaponId: Number(new TextDecoder().decode(base64.decode(player.weapon.id)).split("-")[1]),