diff --git a/bot/src/slashCommands/commands.ts b/bot/src/slashCommands/commands.ts index 338c85b67..073a71c9d 100644 --- a/bot/src/slashCommands/commands.ts +++ b/bot/src/slashCommands/commands.ts @@ -19,12 +19,12 @@ if (BotConfig.DISCORD.APPROVED_ROLE) { SLASH_COMMANDS.set("letmein", letmein); } -// ktchi or omni specific commands -if (ServerConfig.type !== "btchi") { +// kamaitachi or omni specific commands +if (ServerConfig.type !== "boku") { SLASH_COMMANDS.set("sync", sync); } -// btchi or omni specific commands -if (ServerConfig.type !== "ktchi") { +// bokutachi or omni specific commands +if (ServerConfig.type !== "kamai") { SLASH_COMMANDS.set("invite", invite); } diff --git a/bot/src/slashCommands/commands/faq.ts b/bot/src/slashCommands/commands/faq.ts index f227f3d78..c55b21860 100644 --- a/bot/src/slashCommands/commands/faq.ts +++ b/bot/src/slashCommands/commands/faq.ts @@ -108,7 +108,7 @@ Since I don't play a lot of the the games that ${ServerConfig.name} supports, we }; // Server specific FAQ stuff. -const KTCHI_FAQ_ENTRIES: Record = { +const KAMAI_FAQ_ENTRIES: Record = { kai_support: `Support for KAI based networks (FLO, EAG, MIN) is available, but we are waiting on APIs for more games on their end. At the moment, only IIDX and SDVX are supported.`, bokutachi: `Bokutachi is our public sister website for home games and simulators. Feel free to check out [the discord](${ Buffer.from("aHR0cHM6Ly9kaXNjb3JkLmdnL3N3VkJUanhtUFk=", "base64") // Note: obfuscating this for obvious reasons so we don't get garbage bot spam. @@ -118,7 +118,7 @@ const KTCHI_FAQ_ENTRIES: Record = { Your friend can then go to ${BotConfig.TACHI_SERVER_LOCATION} and sign up with the code! You can also invite them to the discord.`, }; -const BTCHI_FAQ_ENTRIES: Record = { +const BOKU_FAQ_ENTRIES: Record = { usc_hard_mode: `Hard Mode windows are not supported on ${ServerConfig.name}. Your scores **will be ignored** if they are played on non-standard windows.`, ir_login: `You **must** put your API Key in the password field for the Bokutachi IR, **NOT your real password!**. See instructions here: ${BotConfig.TACHI_SERVER_LOCATION}/import/beatoraja-ir. (This is because putting your real password in there is a security nightmare.)`, @@ -129,12 +129,12 @@ Beatoraja is actively developed and integrates properly with the Bokutachi IR, i let faqEntries = NEUTRAL_FAQ_ENTRIES; -if (ServerConfig.type !== "btchi") { - faqEntries = deepmerge(faqEntries, KTCHI_FAQ_ENTRIES); +if (ServerConfig.type !== "boku") { + faqEntries = deepmerge(faqEntries, KAMAI_FAQ_ENTRIES); } -if (ServerConfig.type !== "ktchi") { - faqEntries = deepmerge(faqEntries, BTCHI_FAQ_ENTRIES); +if (ServerConfig.type !== "kamai") { + faqEntries = deepmerge(faqEntries, BOKU_FAQ_ENTRIES); } const choiceMap = new Map(Object.entries(faqEntries)); diff --git a/bot/src/utils/embeds.ts b/bot/src/utils/embeds.ts index e42dd5979..d9b9c369c 100644 --- a/bot/src/utils/embeds.ts +++ b/bot/src/utils/embeds.ts @@ -6,7 +6,7 @@ import type { ImportDocument, UserDocument, integer } from "tachi-common"; export function CreateEmbed(userID?: integer) { const embed = new MessageEmbed() - .setColor(ServerConfig.type === "ktchi" ? "#e61c6e" : "#527acc") + .setColor(ServerConfig.type === "kamai" ? "#e61c6e" : "#527acc") .setTimestamp(); if (userID !== undefined) { @@ -24,7 +24,11 @@ export function CreateImportEmbed(importDoc: ImportDocument) { "score" )}!` ) - .addField("Created Sessions", importDoc.createdSessions.length.toString(), true) + .addField( + "Created Sessions", + importDoc.createdSessions.length.toString(), + true + ) .addField("Errors", importDoc.errors.length.toString(), true) .addField( "Your Profile", diff --git a/bot/src/utils/returnTypes.ts b/bot/src/utils/returnTypes.ts index 36e238fd4..93328389a 100644 --- a/bot/src/utils/returnTypes.ts +++ b/bot/src/utils/returnTypes.ts @@ -16,7 +16,7 @@ export interface ServerConfig { games: Array; importTypes: Array; name: string; - type: "btchi" | "ktchi" | "omni"; + type: "boku" | "kamai" | "omni"; } export interface ServerStatus { @@ -50,7 +50,10 @@ export interface UGPTStats { firstScore: ScoreDocument; mostRecentScore: ScoreDocument; totalScores: integer; - rankingData: Record; + rankingData: Record< + ProfileRatingAlgorithms[GPT], + { ranking: integer; outOf: integer } + >; } export interface ChartQueryReturns { diff --git a/client/README.md b/client/README.md index ffed5c713..e56e30aa9 100644 --- a/client/README.md +++ b/client/README.md @@ -40,7 +40,7 @@ VITE_MANDATE_LOGIN=true # What git repo to read from by default in the seeds viewer. VITE_GIT_REPO="" -# What client mode to use. Should be btchi, ktchi or omni. -# This affects some things, like what buttons should appear in certain places. +# What client mode to use. Should be boku, kamai or omni. +# This affects some things, like what buttons should appear in certain places and what colours the site should be. VITE_TCHIC_MODE="omni" ``` \ No newline at end of file diff --git a/client/src/app/pages/dashboard/import/ImportPage.tsx b/client/src/app/pages/dashboard/import/ImportPage.tsx index a09e5968d..8f15a29ca 100644 --- a/client/src/app/pages/dashboard/import/ImportPage.tsx +++ b/client/src/app/pages/dashboard/import/ImportPage.tsx @@ -217,9 +217,7 @@ function ImportInfoDisplayer({ game }: { game: Game }) { href="chunithm-myt-exporter" desc="Export your scores from MYT." moreInfo={ - <> - This is an userscript that exports scores from the MYT web interface. - + <>This is an userscript that exports scores from the MYT web interface. } key="MYT Exporter" />, diff --git a/client/src/app/pages/dashboard/users/UserIntegrationsPage.tsx b/client/src/app/pages/dashboard/users/UserIntegrationsPage.tsx index afe7f517c..88fb60771 100644 --- a/client/src/app/pages/dashboard/users/UserIntegrationsPage.tsx +++ b/client/src/app/pages/dashboard/users/UserIntegrationsPage.tsx @@ -11,7 +11,7 @@ import Loading from "components/util/Loading"; import Muted from "components/util/Muted"; import useApiQuery from "components/util/query/useApiQuery"; import SelectLinkButton from "components/util/SelectLinkButton"; -import { mode, TachiConfig } from "lib/config"; +import { TachiConfig } from "lib/config"; import React, { useEffect, useReducer, useState } from "react"; import { Alert, Button, Col, Form, Modal, Row } from "react-bootstrap"; import { Link, Route, Switch } from "react-router-dom"; @@ -42,7 +42,7 @@ export default function UserIntegrationsPage({ reqUser }: { reqUser: UserDocumen
- {mode !== "btchi" && ( + {TachiConfig.type !== "boku" && ( Service Configuration @@ -612,7 +612,7 @@ function EditClientModal({ } function ServicesPage({ reqUser }: { reqUser: UserDocument }) { - if (mode === "btchi") { + if (TachiConfig.type === "boku") { return ( Looks like there's no services available for integration. diff --git a/client/src/app/routes/ImportRoutes.tsx b/client/src/app/routes/ImportRoutes.tsx index dc36fbaa8..c2170970a 100644 --- a/client/src/app/routes/ImportRoutes.tsx +++ b/client/src/app/routes/ImportRoutes.tsx @@ -19,7 +19,7 @@ import WACCAMyPageScraperPage from "app/pages/dashboard/import/WACCAMyPageScrape import KAIIntegrationPage from "components/imports/KAIIntegrationPage"; import Divider from "components/util/Divider"; import { UserContext } from "context/UserContext"; -import { mode } from "lib/config"; +import { TachiConfig } from "lib/config"; import React, { useContext } from "react"; import { Link, Redirect, Route, Switch } from "react-router-dom"; import CGIntegrationPage from "components/imports/CGIntegrationPage"; @@ -53,7 +53,7 @@ export default function ImportRoutes() { - {mode !== "ktchi" && ( + {TachiConfig.type !== "kamai" && ( <> @@ -82,7 +82,7 @@ export default function ImportRoutes() { )} - {mode !== "btchi" && ( + {TachiConfig.type !== "boku" && ( <> = [ ]; // if kamaitachi or omnitachi -if (TachiConfig.TYPE !== "btchi") { +if (TachiConfig.TYPE !== "boku") { jobs.push({ name: "Update BPI", cronFormat: "2 0 * * *", @@ -48,7 +48,7 @@ if (TachiConfig.TYPE !== "btchi") { } // if bokutachi or omnitachi -if (TachiConfig.TYPE !== "ktchi") { +if (TachiConfig.TYPE !== "kamai") { jobs.push({ name: "Update AI Table", cronFormat: "2 0 * * *", diff --git a/server/src/lib/migration/migrations.ts b/server/src/lib/migration/migrations.ts index f645dc54e..9cb2036e5 100644 --- a/server/src/lib/migration/migrations.ts +++ b/server/src/lib/migration/migrations.ts @@ -55,7 +55,7 @@ const REGISTERED_MIGRATIONS: Array = // only apply type-specific migrations if we're not in testing if (Environment.nodeEnv !== "test") { // kamaitachi specific migrations - if (TachiConfig.TYPE !== "btchi") { + if (TachiConfig.TYPE !== "boku") { REGISTERED_MIGRATIONS.push( RemoveIIDXBeginners, UpdateJubeatPreferredTables, @@ -69,7 +69,7 @@ if (Environment.nodeEnv !== "test") { } // bokutachi specific migrations - if (TachiConfig.TYPE !== "ktchi") { + if (TachiConfig.TYPE !== "kamai") { REGISTERED_MIGRATIONS.push(NullLR2HookFailedBPs, FixUndefinedBMSData, RemoveRandom); } } diff --git a/server/src/lib/setup/config.ts b/server/src/lib/setup/config.ts index cbb8cee0a..f06195aea 100644 --- a/server/src/lib/setup/config.ts +++ b/server/src/lib/setup/config.ts @@ -25,7 +25,9 @@ let confFile; try { confFile = fs.readFileSync(confLocation, "utf-8"); } catch (err) { - logger.error("Error while trying to open conf.json5. Is one present?", { err }); + logger.error("Error while trying to open conf.json5. Is one present?", { + err, + }); process.exit(1); } @@ -112,7 +114,7 @@ export interface TachiServerConfig { }; TACHI_CONFIG: { NAME: string; - TYPE: "btchi" | "ktchi" | "omni"; + TYPE: "boku" | "kamai" | "omni"; GAMES: Array; IMPORT_TYPES: Array; }; @@ -214,7 +216,7 @@ const err = p(config, { }), TACHI_CONFIG: { NAME: "string", - TYPE: p.isIn("ktchi", "btchi", "omni"), + TYPE: p.isIn("kamai", "boku", "omni"), GAMES: [p.isIn(allSupportedGames)], IMPORT_TYPES: [p.isIn(allImportTypes)], }, diff --git a/server/src/scripts/sync-database.ts b/server/src/scripts/sync-database.ts index 11f38b708..9bc5e71d6 100644 --- a/server/src/scripts/sync-database.ts +++ b/server/src/scripts/sync-database.ts @@ -276,7 +276,7 @@ const syncInstructions: Array = [ collection: ICollection, logger ) => { - if (TachiConfig.TYPE === "ktchi") { + if (TachiConfig.TYPE === "kamai") { return; } diff --git a/server/src/server/middleware/type-require.ts b/server/src/server/middleware/type-require.ts index cbe9ce3c1..ea923127c 100644 --- a/server/src/server/middleware/type-require.ts +++ b/server/src/server/middleware/type-require.ts @@ -7,7 +7,7 @@ import type { RequestHandler } from "express-serve-static-core"; * this restriction is bypassed. */ export const RequireBokutachi: RequestHandler = (req, res, next) => { - if (TachiConfig.TYPE === "btchi" || TachiConfig.TYPE === "omni") { + if (TachiConfig.TYPE === "boku" || TachiConfig.TYPE === "omni") { next(); return; } @@ -24,7 +24,7 @@ export const RequireBokutachi: RequestHandler = (req, res, next) => { * this restriction is bypassed. */ export const RequireKamaitachi: RequestHandler = (req, res, next) => { - if (TachiConfig.TYPE === "ktchi" || TachiConfig.TYPE === "omni") { + if (TachiConfig.TYPE === "kamai" || TachiConfig.TYPE === "omni") { next(); return; }