From 91e082e4e93347ed0af93c7d4693a5e38bcfcf8c Mon Sep 17 00:00:00 2001
From: zkldi <20380519+zkldi@users.noreply.github.com>
Date: Tue, 28 Feb 2023 01:14:54 +0000
Subject: [PATCH] fix: make ferv csv stuff more obvious
---
.../pages/dashboard/import/FervidexPage.tsx | 13 +++++++++++++
.../pages/dashboard/import/IIDXEamCSVPage.tsx | 19 +++++++++++++++++++
.../users/FervidexIntegrationPage.tsx | 2 +-
.../users/KsHookSV6CIntegrationPage.tsx | 2 +-
4 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/client/src/app/pages/dashboard/import/FervidexPage.tsx b/client/src/app/pages/dashboard/import/FervidexPage.tsx
index 12239bc9e..02b83fe3a 100644
--- a/client/src/app/pages/dashboard/import/FervidexPage.tsx
+++ b/client/src/app/pages/dashboard/import/FervidexPage.tsx
@@ -3,6 +3,8 @@ import Divider from "components/util/Divider";
import ExternalLink from "components/util/ExternalLink";
import { TachiConfig } from "lib/config";
import React from "react";
+import { Alert } from "react-bootstrap";
+import { Link } from "react-router-dom";
export default function FervidexPage() {
useSetSubheader(["Import Scores", "Fervidex"]);
@@ -52,6 +54,17 @@ export default function FervidexPage() {
That's it! Your scores should now automatically submit to the server.
+
+ Looking to import existing scores? Import from your network first. If that's not
+ possible, enable "Sync Existing Scores" in{" "}
+
+ your settings.
+
+
);
}
diff --git a/client/src/app/pages/dashboard/import/IIDXEamCSVPage.tsx b/client/src/app/pages/dashboard/import/IIDXEamCSVPage.tsx
index 8e6b7df70..85f30be38 100644
--- a/client/src/app/pages/dashboard/import/IIDXEamCSVPage.tsx
+++ b/client/src/app/pages/dashboard/import/IIDXEamCSVPage.tsx
@@ -103,6 +103,25 @@ function ParseFunction(data: string) {
throw new Error(`This CSV has no scores? Only found headers.`);
}
+ // check for nonsense non-zero EX stuff with zero judgements
+
+ for (const line of lines) {
+ const cells = line.split(",");
+ for (let i = 0; i < 5; i++) {
+ const di = 5 + i * 7;
+
+ const exscore = cells[di + 1]!;
+ const pgreat = cells[di + 2]!;
+ const great = cells[di + 3]!;
+
+ if (Number(exscore) && Number(pgreat) === 0 && Number(great) === 0) {
+ throw new Error(
+ `Invalid CSV. This CSV does not have PGREAT/GREAT information, which we use to sanity check scores. If this is from Fervidex you can enable "Sync Existing Scores" and boot the game instead.`
+ );
+ }
+ }
+ }
+
const linesWithScores = lines.filter((e) => e !== "");
return {
diff --git a/client/src/app/pages/dashboard/users/FervidexIntegrationPage.tsx b/client/src/app/pages/dashboard/users/FervidexIntegrationPage.tsx
index e4f119355..52a631209 100644
--- a/client/src/app/pages/dashboard/users/FervidexIntegrationPage.tsx
+++ b/client/src/app/pages/dashboard/users/FervidexIntegrationPage.tsx
@@ -91,7 +91,7 @@ function FervidexForm({
onChange={(e) => {
setFormSettings({ ...formSettings, forceStaticImport: e.target.checked });
}}
- label="Force Static Imports"
+ label="Sync Existing Scores"
/>
Import existing scores on game load for non-INFINITAS IIDX versions.
diff --git a/client/src/app/pages/dashboard/users/KsHookSV6CIntegrationPage.tsx b/client/src/app/pages/dashboard/users/KsHookSV6CIntegrationPage.tsx
index 3b41beece..e8916b583 100644
--- a/client/src/app/pages/dashboard/users/KsHookSV6CIntegrationPage.tsx
+++ b/client/src/app/pages/dashboard/users/KsHookSV6CIntegrationPage.tsx
@@ -81,7 +81,7 @@ function KsHookSV6CForm({
onChange={(e) => {
setFormSettings({ ...formSettings, forceStaticImport: e.target.checked });
}}
- label="Force Static Imports"
+ label="Sync Existing Scores"
/>
Import existing scores on game load.