实现 issue #85,调整 replay world-data 与分发处理#116
实现 issue #85,调整 replay world-data 与分发处理#116Wind-DeterMination-backup wants to merge 4 commits intoTinyLake:mainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a major overhaul to the replay system, shifting from a packet-centric recording approach to one that captures full world states at key moments. This foundational change enables advanced replay functionalities such as observer mode and the ability to jump back to specific game checkpoints, significantly enhancing the utility and detail of recorded sessions. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request significantly enhances the replay functionality by introducing a new recording pipeline based on world data boundaries instead of just packet streams. It adds support for checkpoints and rewinding during playback, which is a major feature. The replay file format has been updated to a more flexible container format to support these new features. The changes are extensive and well-structured, using reflection to bridge core game logic with mod features, and introducing new classes to manage recording sessions and replay data. I've found one critical issue that would prevent compilation and one suggestion for improvement. Overall, this is a great improvement to the replay system.
There was a problem hiding this comment.
Code Review
This pull request introduces a significant improvement to the replay recording system, shifting from packet-based recording to a more robust world-data-based approach. This enables features like observer-style playback and checkpoint rewinding. The changes are extensive, introducing a new replay file format, session management classes, and a complex ReplayController to handle the new logic. The use of reflection via ReplayBridge to decouple the mod from core game logic is noted. While the overall implementation is of high quality, I've identified a few critical and high-severity issues that should be addressed. Specifically, there's a potentially missing method that could cause compilation errors, a risky silent exception catch, and a non-robust stream reading implementation.
patches/client/0074-HC-ReplayController-world-data-bridge.patch
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Code Review
This pull request significantly enhances the replay recording system by introducing a new container-based replay format, enabling recording from world data boundaries, and adding support for playback checkpoints and rewinding. The changes are extensive, touching networking hooks, data serialization, and the replay controller logic. The implementation is robust, with good handling of concurrency and backward compatibility for the old replay format. My review found one critical issue in the client patch where an incorrect this reference is used, which would lead to a runtime error. I've also provided a suggestion to simplify stream reading logic for better clarity and robustness.
There was a problem hiding this comment.
Code Review
This pull request introduces a significant improvement to the replay recording and playback system. It refactors the replay data format to be more extensible, allowing for world data and other metadata to be stored alongside packets. It also adds a major new feature: checkpointing and rewinding during playback. The implementation is comprehensive and well-structured, using reflection to create a bridge to the core game code, which is a good approach for modding. I've found a couple of areas for improvement regarding I/O robustness and thread safety that could prevent potential replay corruption. Overall, this is an excellent contribution.
patches/client/0074-HC-ReplayController-world-data-bridge.patch
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Code Review
This pull request introduces a significant improvement to the replay recording system. It moves from a packet-only stream to a more robust model based on world-data boundaries, and adds support for observer-style playback with checkpoint and rewind functionality. The implementation is well-structured, introducing a new container format for replay files and using a ReplayBridge with reflection for loose coupling with the core game code, which is a solid approach for modding. The new concurrency controls and data models for replays are well thought out. I have one suggestion to simplify the code for reading stream data.
|
已根据 Gemini 历史审查意见完成以下调整,并已重新核对:
当前 Gemini 已无 critical / high 级别结论残留。 仍有 1 条 medium 建议未采纳:将流读取进一步改成 |
概要
关联 issue: #85
分支:
betterreplayDraft PR: #116
本 PR 仍处于 Draft 状态。
本次实现
当前已完成并复核的改动包括:
ReplayController中调整 replay playback 的 world-data begin 调用路径。ArcNetProvider的 replay notify 路径中显式写为(NetConnection)this。ByteArrayOutputStream。replayServerDispatchPacket从静态Packet改为ThreadLocal<Packet>,并处理send/sendExcept周围的保存与恢复。兼容性说明
--release 8约束。readAllBytes()简化流读取”建议,本 PR 未采纳,因为该 API 不属于 Java 8 可用范围。验证
已完成编译验证:
.\\gradlew.bat :core:compileJava成功通过。Gemini 审查状态
readAllBytes()。--release 8)。后续仍可继续补充更完整的运行期验证结果;当前 PR 仍保持 Draft。