feat: Instance grouping and user count

This commit is contained in:
2026-06-28 03:49:50 +07:00
parent 2dd6931425
commit 387fa18927
11 changed files with 281 additions and 25 deletions
+15
View File
@@ -0,0 +1,15 @@
export interface Instance {
id: string;
location: string;
worldId: string;
instanceId: string;
type: string;
region?: string;
ownerId?: string;
userCount: number;
capacity: number;
recommendedCapacity?: number;
full: boolean;
queueEnabled: boolean;
queueSize: number;
}
+2 -1
View File
@@ -17,6 +17,7 @@ export type Location = "offline" | "private" | "traveling" | "" | string;
export interface ParsedLocation {
worldId: string;
instanceId: string;
instance: string;
region?: string;
}
@@ -26,7 +27,7 @@ export function parseLocation(loc?: string): ParsedLocation | null {
if (!worldId?.startsWith("wrld_") || !rest) return null;
const instanceId = rest.split("~")[0];
const region = /~region\(([^)]+)\)/.exec(rest)?.[1];
return { worldId, instanceId, region };
return { worldId, instanceId, instance: rest, region };
}
export interface Badge {