more jank

dumb-splashcat-thing
Rosalina 2023-07-01 00:22:36 -04:00
parent edda191f56
commit 8180d35cc5
No known key found for this signature in database
1 changed files with 10 additions and 3 deletions

View File

@ -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<string[]> {
@ -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]),