update shared api

This commit is contained in:
ppc
2024-08-25 20:07:40 +01:00
parent 4ca0f04506
commit 29c25c74fe
2 changed files with 23 additions and 2 deletions
+3 -2
View File
@@ -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<AMServerInfoResponse | null> {
try {
const response = await fetch(serverAddress, {
const response = await fetch(`${new URL(serverAddress).origin}/amnet/info`, {
signal: abort
});
+20
View File
@@ -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"
}