feat: 增加开房间 DEMO(桌游/组队类游戏)#59
Open
AlianBlank wants to merge 2 commits into
Open
Conversation
NotifyRoomChangedAsync 原先对任意变更都广播给所有在线玩家,游戏中高频事件 (Started/Settling/Settled/Reset) 会产生大量无关推送。 改为按受众分流: - 大厅可见变更(Created/Joined/Left/Closed/Disbanded)仍广播全服,刷新房间列表 - 房间内部玩法事件(Started/Settling/Settled/Reset)仅通知房间内成员
验证通用房间框架在 3+ 人组队场景的适用性: - GameType.DiceBattle 枚举 + RoomRule(最小3人/最大6人) - 协议 420 段:游戏信息/掷骰/再来一局/变更通知 - 服务器端生成骰子点数(1-6),防篡改 - 全员掷骰后进入结算,点数最大者获胜,并列时全部判胜 - 复用房间生命周期: Playing -> Settling -> Settled -> 重开
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
实现 #56:为桌游/组队类游戏提供开房间方式的 DEMO。
closes #56
通用房间框架
提供完整可复用的开房间能力,任意玩法只需注册
RoomRule并接入房间生命周期即可:Waiting → Ready → Playing → Settling → Settled → Closed/DisbandedGetRoom/EnterSettling/MarkSettled/RestartRoomGameDEMO 玩法
石头剪刀布(2 人)
验证基础房间闭环:提交手势 → 双方都提交进入结算 → 算胜负 → 房主重开。
掷骰子比大小(3-6 人)✨新增
验证 3+ 人组队场景下
MinPlayerCount/MaxPlayerCount的通用性:通知策略优化 ✨
NotifyRoomChangedAsync按受众分流,减少游戏内高频事件的全服广播:协议
400410420验证
dotnet build -c Release通过(0 警告 0 错误)