From 29c25c74feda81a81820e824f8f782cca9f72a4f Mon Sep 17 00:00:00 2001 From: ppc Date: Sun, 25 Aug 2024 20:07:40 +0100 Subject: [PATCH] update shared api --- amnet-shared/src/api.ts | 5 +++-- amnet-shared/src/gameIds.ts | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 amnet-shared/src/gameIds.ts diff --git a/amnet-shared/src/api.ts b/amnet-shared/src/api.ts index da09671..ef819f8 100644 --- a/amnet-shared/src/api.ts +++ b/amnet-shared/src/api.ts @@ -11,6 +11,7 @@ export interface AMServerInfoResponse { serverAddress: string; serverName: string; apiVersion: number; + gameId: string; } /** @@ -21,7 +22,7 @@ export interface AMServerInfoResponse { */ export async function performCardIn(serverAddress: string, request: AMCardInRequest, signal: AbortSignal) { try { - const response = await fetch(`${serverAddress}/card`, { + const response = await fetch(`${new URL(serverAddress).origin}/amnet/signin`, { method: "POST", headers: { "Content-Type": "application/json" @@ -43,7 +44,7 @@ export async function performCardIn(serverAddress: string, request: AMCardInRequ */ export async function fetchServerInfo(serverAddress: string, abort: AbortSignal): Promise { try { - const response = await fetch(serverAddress, { + const response = await fetch(`${new URL(serverAddress).origin}/amnet/info`, { signal: abort }); diff --git a/amnet-shared/src/gameIds.ts b/amnet-shared/src/gameIds.ts new file mode 100644 index 0000000..999b50f --- /dev/null +++ b/amnet-shared/src/gameIds.ts @@ -0,0 +1,20 @@ +export enum GameIds { + /** + * Initial D The Arcade + */ + IDAC = "SDGT", + + /** + * Chunithm (Paradise Lost) + */ + Chuni = "SDBT", + + /** + * Chunithm NEW onwards + */ + Chusan = "SDHD", + + ONGEKI = "SDDT", + maimaiDX = "SDEZ", + DivaFT = "SBZV" +} \ No newline at end of file