Phase3
This commit is contained in:
17
apps/web/src/lib/api/players.ts
Normal file
17
apps/web/src/lib/api/players.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { apiFetch } from "./auth";
|
||||
|
||||
export interface OnlinePlayer {
|
||||
name: string;
|
||||
uuid?: string;
|
||||
ping?: number;
|
||||
}
|
||||
|
||||
export interface PlayerListResponse {
|
||||
online: OnlinePlayer[];
|
||||
maxPlayers: number;
|
||||
whitelistCount: number;
|
||||
}
|
||||
|
||||
export async function getPlayers(serverId: string): Promise<PlayerListResponse> {
|
||||
return apiFetch<PlayerListResponse>(`/servers/${serverId}/players`);
|
||||
}
|
||||
Reference in New Issue
Block a user