-
Notifications
You must be signed in to change notification settings - Fork 111
fix: X-Verse Username #179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
审阅者指南对 XVerse API 数据应用版本检查,仅对低于 2.40 版本的用户名进行有选择的解码,而对于更新版本则保留原始用户名。 文件级别更改
提示和命令与 Sourcery 交互
自定义你的体验访问你的 仪表板 以:
获取帮助Original review guide in EnglishReviewer's GuideApply a version check on XVerse API data to selectively decode usernames only for versions below 2.40, preserving original usernames for newer versions. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你好 - 我已审阅你的更改 - 以下是一些反馈意见:
- 版本解析和比较逻辑在两个代码块中重复,请将其提取到一个辅助函数中以避免重复。
- 使用
toDoubleOrNull
进行版本比较可能无法正确处理“2.4.1”等语义化版本格式;请考虑使用一个合适的语义化版本比较库。 - 版本 ≥ 2.40 的分支执行了空操作赋值(例如
selectUserName = selectUserName
);这些可以简化或完全删除。
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The version parsing and comparison logic is duplicated in both blocks – extract it into a single helper function to avoid repetition.
- Using toDoubleOrNull for version comparison may break on semantic formats like “2.4.1”; consider using a proper semantic version comparator library.
- The branches for version ≥ 2.40 perform no-op assignments (e.g. selectUserName = selectUserName); these can be simplified or removed entirely.
## Individual Comments
### Comment 1
<location> `src/main/java/icu/samnyan/aqua/sega/chusan/handler/ChusanUpsertApis.kt:105-107` </location>
<code_context>
+ // 版本 >= 2.40 时不需要转换用户名编码,直接使用原始用户名
+ val version = data["version"] as? String ?: "0.00"
+ val versionNumber = version.toDoubleOrNull() ?: 0.0
+ if (versionNumber >= 2.40) {
+ // 2.40及以上版本直接使用原始用户名
+ selectUserName = selectUserName
+ opponentUserName1 = opponentUserName1
+ opponentUserName2 = opponentUserName2
</code_context>
<issue_to_address>
**nitpick:** Redundant assignment of variable to itself.
These assignments can be removed to improve code clarity, as they do not change the variable values.
</issue_to_address>
Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Original comment in English
Hey there - I've reviewed your changes - here's some feedback:
- The version parsing and comparison logic is duplicated in both blocks – extract it into a single helper function to avoid repetition.
- Using toDoubleOrNull for version comparison may break on semantic formats like “2.4.1”; consider using a proper semantic version comparator library.
- The branches for version ≥ 2.40 perform no-op assignments (e.g. selectUserName = selectUserName); these can be simplified or removed entirely.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The version parsing and comparison logic is duplicated in both blocks – extract it into a single helper function to avoid repetition.
- Using toDoubleOrNull for version comparison may break on semantic formats like “2.4.1”; consider using a proper semantic version comparator library.
- The branches for version ≥ 2.40 perform no-op assignments (e.g. selectUserName = selectUserName); these can be simplified or removed entirely.
## Individual Comments
### Comment 1
<location> `src/main/java/icu/samnyan/aqua/sega/chusan/handler/ChusanUpsertApis.kt:105-107` </location>
<code_context>
+ // 版本 >= 2.40 时不需要转换用户名编码,直接使用原始用户名
+ val version = data["version"] as? String ?: "0.00"
+ val versionNumber = version.toDoubleOrNull() ?: 0.0
+ if (versionNumber >= 2.40) {
+ // 2.40及以上版本直接使用原始用户名
+ selectUserName = selectUserName
+ opponentUserName1 = opponentUserName1
+ opponentUserName2 = opponentUserName2
</code_context>
<issue_to_address>
**nitpick:** Redundant assignment of variable to itself.
These assignments can be removed to improve code clarity, as they do not change the variable values.
</issue_to_address>
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
中二 XVerse 似乎修改了用户名的编码,导致打完 1PC 之后用户名变成 ????
然后,还有一种修复方式是不允许覆盖现有的用户名,但是这样的话第一 PC 也会炸
所以现在是进行了版本号的对比。要是 ICF 什么的有问题的话,那就自求多福吧
Sourcery 总结
Bug 修复:
Original summary in English
Summary by Sourcery
Bug Fixes: