- Add real-time multiplayer game server with Colyseus - Implement unique player naming system with auto-increment - Create lobby system with automatic matchmaking - Build 10-minute competitive clicking game rooms (max 2 players) - Add admin dashboard for game management (pause/resume/restart/kick) - Implement Vue 3 client with professional UI - Add WebSocket communication with state synchronization - Include TypeScript throughout with proper typing - Create REST API for admin operations - Add reconnection support and error handling
27 lines
484 B
TypeScript
27 lines
484 B
TypeScript
export interface PlayerInfo {
|
|
sessionId: string;
|
|
name: string;
|
|
clicks: number;
|
|
}
|
|
|
|
export interface RoomStats {
|
|
roomId: string;
|
|
players: PlayerInfo[];
|
|
gameStatus: GameStatus;
|
|
timeRemaining: number;
|
|
winner?: string;
|
|
createdAt: number;
|
|
}
|
|
|
|
export enum GameStatus {
|
|
WAITING = 'waiting',
|
|
PLAYING = 'playing',
|
|
PAUSED = 'paused',
|
|
FINISHED = 'finished'
|
|
}
|
|
|
|
export interface AdminAction {
|
|
action: 'pause' | 'restart' | 'kick';
|
|
roomId: string;
|
|
playerId?: string;
|
|
} |