feat(game): 添加房间管理和游戏启动功能

- 添加 setActiveRoom 导入和房间状态管理功能
- 实现房间所有者判断逻辑和玩家准备状态检查
- 添加游戏启动按钮和相关权限控制
- 实现房间信息请求和响应处理机制
- 添加 WebSocket 消息规范化处理函数
- 集成 tile 数据标准化和验证逻辑
- 更新 CSS 样式以支持新的界面元素
- 修复 Vite 配置以支持外部访问
- 优化 UI 组件布局和交互反馈机制
This commit is contained in:
2026-03-26 23:37:00 +08:00
parent 0fa3c4f1df
commit 921f47d916
5 changed files with 525 additions and 20 deletions

View File

@@ -19,8 +19,8 @@ function normalizeRoom(input: ActiveRoomSelectionInput): ActiveRoomState {
createdAt: input.createdAt ?? '',
updatedAt: input.updatedAt ?? '',
players: input.players ?? [],
myHand: [],
game: {
myHand: input.myHand ?? [],
game: input.game ?? {
state: {
wall: [],
scores: {},
@@ -42,4 +42,4 @@ export function setActiveRoom(input: ActiveRoomSelectionInput) {
// 使用房间状态
export function useActiveRoomState() {
return activeRoom
}
}