修复斗地主先手事件识别及座位状态覆盖问题#23
Conversation
|
Warning Review limit reached
Next review available in: 53 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. 📝 WalkthroughWalkthrough本次变更扩展牌堆消息处理和先手事件识别,并通过状态保护避免先手座位被冲突消息覆盖,同时新增重复设置场景测试。 Changes先手追踪与消息处理
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces updates to the game logic and tracker. It adds support for the decodeGameDealPileTopCardList message, updates first-hand seat tracking logic in MsgGameShowFigure and CGsRoleSpellOptRep (specifically for type 44), and implements a safeguard in TrackerController to ignore and warn about conflicting first-hand seat assignments. Unit tests have also been added to verify this behavior. The review feedback suggests adding defensive checks to ensure SeatID is defined before calling tracker.setTrackerFirstHand(SeatID) in both updated locations in src/logic.js to prevent passing undefined and correctly handle seat 0.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| // console.info('我的身份: ' + msg.Figure, msg.SeatID) | ||
| if (Game.myID === undefined) Game.setMyID(msg.SeatID) | ||
| // console.info('座位: ' + SeatID + '的身份: ' + msg.Figure) | ||
| if (msg.Figure === 1) tracker.setTrackerFirstHand(SeatID) |
There was a problem hiding this comment.
Defensive check: Ensure SeatID is defined before calling tracker.setTrackerFirstHand(SeatID). Since 0 is a valid seat ID, we should explicitly check SeatID !== undefined to avoid ignoring seat 0 while preventing passing undefined to the tracker.
| if (msg.Figure === 1) tracker.setTrackerFirstHand(SeatID) | |
| if (msg.Figure === 1 && SeatID !== undefined) tracker.setTrackerFirstHand(SeatID) |
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Summary by CodeRabbit