mirror of
https://github.com/YuzuZensai/VRC-Circle.git
synced 2026-09-13 19:08:52 +00:00
✨ feat: Instance grouping and user count
This commit is contained in:
@@ -7,6 +7,7 @@ import type {
|
||||
} from "./types/auth";
|
||||
import type { SocialSnapshot, UserProfile, UserStatus } from "./types/user";
|
||||
import type { FavoriteWorldFolder, World, WorldSnapshot } from "./types/world";
|
||||
import type { Instance } from "./types/instance";
|
||||
import type { Avatar } from "./types/avatar";
|
||||
import type { RepoStats, StoredEntity } from "./types/repository";
|
||||
import type { AccountSettings, ContentFilterKey, Pending2Fa, RecoveryCode } from "./types/settings";
|
||||
@@ -46,6 +47,8 @@ export interface IpcRequests {
|
||||
"world:get": (worldId: string) => IpcResult<World>;
|
||||
"world:snapshot": () => IpcResult<WorldSnapshot>;
|
||||
|
||||
"instance:get": (location: { worldId: string; instanceId: string }) => IpcResult<Instance>;
|
||||
|
||||
"avatar:get": (avatarId: string) => IpcResult<Avatar>;
|
||||
"avatar:favorites": () => IpcResult<Avatar[]>;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user