feat: v1.2.0 房间详情/聊天/踢人 + 速率限制 + WebSocket增强
Server: - API速率限制中间件 (120 req/min per IP, X-RateLimit headers) - 房间聊天API: POST /rooms/:id/chat - 认证中间件放行公开GET路由和房间join - WebSocket: 房间订阅/取消订阅 (subscribe/unsubscribe) - WebSocket: 房间聊天广播 (chat -> broadcastToRoom) - WebSocket: 房间事件通知 (roomCreated/Deleted/playerJoined/Left) Client: - 房间详情弹窗: 点击房间卡片打开 - 房间信息网格 (房间号/房主/版本/人数) - 在线玩家列表 (5秒自动刷新) - 踢出玩家 (确认对话框) - 房间聊天 (实时发送/显示) - 加入房间 / 删除房间按钮 - 连接状态指示器动画 (online/offline/connecting) - 房间卡片hover效果 - 版本更新到 v1.2.0 - ApiClient: 新增 getRoomDetail/kickPlayer/sendChat - Preload: 新增对应IPC方法 - Main: 新增 rooms:detail/kick/chat handlers
This commit is contained in:
@@ -57,7 +57,7 @@
|
||||
<span class="nav-icon">ℹ️</span> 关于
|
||||
</li>
|
||||
</ul>
|
||||
<div class="sidebar-footer">v1.0.0</div>
|
||||
<div class="sidebar-footer">v1.2.0</div>
|
||||
</nav>
|
||||
|
||||
<!-- Content -->
|
||||
@@ -233,7 +233,7 @@
|
||||
<div class="about-header">
|
||||
<div class="about-logo">F</div>
|
||||
<div>
|
||||
<h3>FunConnect v1.0.0</h3>
|
||||
<h3>FunConnect v1.2.0</h3>
|
||||
<p>Minecraft 联机客户端</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -273,6 +273,35 @@
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<!-- Room Detail Modal -->
|
||||
<div class="modal-overlay hidden" id="modal-overlay">
|
||||
<div class="modal" id="room-detail-modal">
|
||||
<div class="modal-header">
|
||||
<h3 id="modal-room-name">房间详情</h3>
|
||||
<button class="modal-close" id="modal-close">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="modal-info" id="modal-room-info"></div>
|
||||
<div class="modal-section">
|
||||
<h4>在线玩家 <span id="modal-player-count"></span></h4>
|
||||
<div id="modal-player-list" class="player-list"></div>
|
||||
</div>
|
||||
<div class="modal-section">
|
||||
<h4>房间聊天</h4>
|
||||
<div id="modal-chat-messages" class="chat-messages"></div>
|
||||
<div class="chat-input-row">
|
||||
<input type="text" id="modal-chat-input" class="input" placeholder="输入消息...">
|
||||
<button class="btn btn-primary btn-sm" id="modal-chat-send">发送</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-secondary" id="modal-join-btn">加入此房间</button>
|
||||
<button class="btn btn-danger" id="modal-delete-btn">删除房间</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user