mirror of
https://gitea.tendokyu.moe/ppc/amnet.git
synced 2026-10-04 04:38:03 +03:00
update shared api
This commit is contained in:
@@ -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
|
||||
});
|
||||
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user