Skip to content

fix(mod): 修复 FabricProxy-Lite 兼容模式下聊天消息丢失 - #18

Merged
zkhssb merged 1 commit into
easybot-team:developfrom
BaizhouziYou:fix/velocity-fabric-chat
Oct 2, 2026
Merged

zkhssb merged 1 commit into
easybot-team:developfrom
BaizhouziYou:fix/velocity-fabric-chat

Conversation

@BaizhouziYou

@BaizhouziYou BaizhouziYou commented Oct 2, 2026 •

Copy link
Copy Markdown

变更内容

  • 移除 Fabric 玩家聊天入口中的 isSystem() 过滤。
  • 补充注释,说明代理兼容模式下玩家聊天可能被标记为系统消息。

问题原因

FabricProxy-Lite 启用 hackMessageChain 后,会将玩家聊天转换为 PlayerChatMessage.system(...)
EasyBot 在 ServerGamePacketListenerImpl.broadcastChatMessage 入口过滤此类消息,导致普通聊天无法转发,而 /easybot say 仍能正常工作
该入口处理的是当前连接的玩家聊天,可以直接使用连接中的玩家身份进行同步

影响

  • 恢复上述兼容模式下的玩家聊天转发。
  • 保留聊天同步开关、Bridge 就绪检查和假人过滤。
  • 本次修改仅涉及 Fabric 聊天入口。

验证

  • 修复前复现普通聊天丢失、/easybot say 正常。
  • 修复后,Velocity modern 转发下 hackMessageChain 开启和关闭均正常。
  • 不安装代理模组、直接连接子服时聊天正常。
  • 关闭聊天同步后,普通聊天不转发,/easybot say 仍正常。
  • 消息仅转发一次,玩家名、UUID 和 use_command 标记正确。
  • 控制台 say 和 tellraw 系统消息没有被误转发。

测试说明

测试环境:

  • Minecraft 1.21.1
  • Fabric Loader 0.19.5
  • Fabric API 0.116.17+1.21.1
  • FabricProxy-Lite 2.10.1
  • Velocity 3.4.0-SNAPSHOT build 563

关联 issue

- 移除 Fabric 玩家聊天入口对系统消息标记的过滤
- 修复启用 hackMessageChain 后普通聊天无法转发的问题
Comment on lines +33 to +34
// 此入口只处理该连接的玩家聊天,FabricProxy-Lite 可能将其标记为系统消息。
com.springwater.easybot.platforms.fabric.features.MessageSyncFeature.onChatMessage(message, player);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要考虑测试系统消息是否会错误包裹

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

核对了下调用链,这里貌似是只处理玩家消息的

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

重新补测了

  • 玩家进入、退出通知
  • 玩家死亡通知
  • 进度达成通知
  • 控制台执行 say、tellraw
  • 玩家执行 /say、/tellraw
  • 普通玩家聊天
  • /easybot say 手动转发

都没问题

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

核对了下调用链,这里貌似是只处理玩家消息的

而且由于这个原因其实不会混进来系统消息

@BaizhouziYou
BaizhouziYou requested a review from Ftimever October 2, 2026 13:06
@zkhssb
zkhssb merged commit 4143ddb into easybot-team:develop Oct 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants