kitUIN / ChatImage

A Minecraft Mod Which Could Show Image In Chat Line
https://chatimage.kituin.fun
35 stars 5 forks source link

[Bug] 在服务器上使用导致玩家掉线 #8

Closed qq583044063qq closed 1 year ago

qq583044063qq commented 1 year ago

Bug 描述

多名玩家在服务器上 其中一名玩家直接拉取本地图片到聊天窗口发送 之后其他玩家一起掉线

复现问题的步骤

1.开启一个服务端
2.连接多名玩家
3.其中一个玩家直接发送本地图片

日志记录

暂无

Mod版本

mod版本1.1.6 mc 版本1.19.2 forge版本 43.2.13

电脑系统|JAVA版本

java17

截图

No response

备注

No response

kitUIN commented 1 year ago

日志有显示什么吗

kitUIN commented 1 year ago

已经复现,等待修复

qq583044063qq commented 1 year ago

当时服务器的日志信息 [036月2023 23:49:39.872] [Server thread/INFO] [net.minecraftforge.common.AdvancementLoadFix/]: Using new advancement loading for net.minecraft.server.PlayerAdvancements@5e37d44f [036月2023 23:49:39.879] [Server thread/INFO] [net.minecraft.server.players.PlayerList/]: muc_zhu[/218.79.248.242:60507] logged in with entity id 13296 at (-336.5, 96.0, 28.5) [036月2023 23:49:39.890] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: muc_zhu joined the game [036月2023 23:49:39.950] [Server thread/INFO] [Jade/]: Syncing config to muc_zhu (3c27b515-60de-4e56-b91f-1124c90d42dd) [036月2023 23:51:03.239] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: [[CICode,url=file:///C:\Users\Hinata\Pictures\Saved Pictures\QQ图片20230603234753.gif]] [036月2023 23:51:03.279] [Server thread/INFO] [net.minecraft.server.network.ServerGamePacketListenerImpl/]: muc_zhu lost connection: Illegal packet received, terminating connection [036月2023 23:51:03.280] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: muc_zhu left the game [036月2023 23:51:03.364] [Server thread/INFO] [github.kituin.chatimage.ChatImage/]: [FileChannel->Server]C:\Users\Hinata\Pictures\Saved Pictures\QQ图片20230603234753.gif [036月2023 23:51:10.088] [User Authenticator #4/INFO] [net.minecraft.server.network.ServerLoginPacketListenerImpl/]: UUID of player muc_zhu is 3c27b515-60de-4e56-b91f-1124c90d42dd [036月2023 23:51:12.572] [Server thread/INFO] [net.minecraftforge.common.AdvancementLoadFix/]: Using new advancement loading for net.minecraft.server.PlayerAdvancements@52e39e12 [036月2023 23:51:12.582] [Server thread/INFO] [net.minecraft.server.players.PlayerList/]: muc_zhu[/218.79.248.242:60542] logged in with entity id 13731 at (-340.0211089337486, 96.0, 34.06087941206464) [036月2023 23:51:12.592] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: muc_zhu joined the game [036月2023 23:51:12.649] [Server thread/INFO] [Jade/]: Syncing config to muc_zhu (3c27b515-60de-4e56-b91f-1124c90d42dd) [036月2023 23:51:37.633] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: [[CICode,url=file:///C:\Users\Hinata\Pictures\Saved Pictures\QQ图片20230603235128.jpg]] [036月2023 23:51:37.686] [Server thread/INFO] [net.minecraft.server.network.ServerGamePacketListenerImpl/]: muc_zhu lost connection: Illegal packet received, terminating connection [036月2023 23:51:37.686] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: muc_zhu left the game [036月2023 23:51:37.779] [Server thread/INFO] [github.kituin.chatimage.ChatImage/]: [FileChannel->Server]C:\Users\Hinata\Pictures\Saved Pictures\QQ图片20230603235128.jpg

kitUIN commented 1 year ago

请尝试在服务器将enforce-secure-profile=false

kitUIN commented 1 year ago

已经定位到问题代码,马上修复

kitUIN commented 1 year ago

这怎么可能.....我怎么看都觉得这一段不会出错 为什么报错呀......😭

qq583044063qq commented 1 year ago

我还没有改那个服务器的设置 等下回去改下试试

qq583044063qq commented 1 year ago

还是会掉线 这是掉线方客户端的日志 [056月2023 18:27:30.762] [Render thread/INFO] [journeymap/]: Loaded 1 waypoints from H:\Minecraft.minecraft\versions\1.19.2-Forge_43.2.13-OptiFine_H9\journeymap\data\mp\Minecraft~\waypoints [056月2023 18:27:30.795] [Render thread/INFO] [journeymap/]: Mapping started in H:\Minecraft.minecraft\versions\1.19.2-Forge_43.2.13-OptiFine_H9\journeymap\data\mp\Minecraft~\overworld. Memory: 5496MB total, 4269MB free [056月2023 18:27:35.669] [Render thread/WARN] [journeymap/]: Can't get entityTexture for aquaculture:textures/entity_icon/fishackfish.png [056月2023 18:27:35.670] [Render thread/WARN] [journeymap/]: Can't get entityTexture for aquaculture:textures/entity_icon/fish/atlantic_herring.png [056月2023 18:27:35.670] [Render thread/WARN] [journeymap/]: Can't get entityTexture for aquaculture:textures/entity_icon/fish/pink_salmon.png [056月2023 18:27:39.852] [Render thread/INFO] [github.kituin.chatimage.network.ChatImagePacket/]: [try get from server]C:\Users\Hinata\Pictures\Saved Pictures\QQ图片20230603235128.jpg [056月2023 18:27:39.852] [Render thread/INFO] [net.minecraft.client.gui.components.ChatComponent/]: [CHAT] [图片] [056月2023 18:27:39.899] [Render thread/INFO] [mezz.jei.forge.startup.StartEventObserver/]: JEI StartEventObserver received class net.minecraftforge.client.event.ClientPlayerNetworkEvent$LoggingOut [056月2023 18:27:39.899] [Render thread/INFO] [mezz.jei.forge.startup.StartEventObserver/]: JEI StartEventObserver transitioning state from JEI_STARTED to DISABLED [056月2023 18:27:39.899] [Render thread/INFO] [mezz.jei.library.startup.JeiStarter/]: Stopping JEI [056月2023 18:27:39.899] [Render thread/INFO] [mezz.jei.library.load.PluginCaller/]: Sending Runtime Unavailable: jei:minecraft ... [056月2023 18:27:39.899] [Render thread/INFO] [mezz.jei.library.load.PluginCaller/]: Sending Runtime Unavailable: jei:minecraft took 11.87 μs [056月2023 18:27:39.899] [Render thread/INFO] [mezz.jei.library.load.PluginCaller/]: Sending Runtime Unavailable: jade:main ... [056月2023 18:27:39.899] [Render thread/INFO] [mezz.jei.library.load.PluginCaller/]: Sending Runtime Unavailable: jade:main took 2.864 μs [056月2023 18:27:39.900] [Render thread/INFO] [mezz.jei.library.load.PluginCaller/]: Sending Runtime Unavailable: jei:gui ...

QQ截图20230605182943

kitUIN commented 1 year ago

很奇怪,我调了一下午了。

qq583044063qq commented 1 year ago

会不会是从客户端发送图片的时候 我是直接拖的文件进去发 模组的的url为本地文件路径 而接收方收文件的时候也用的这个路径?然后导致掉线?url是不是必须要用网络资源路径 image

kitUIN commented 1 year ago

之所以会掉线,是因为发送了错误的数据包,可是我检查了好几遍,我写的数据包跟之前是一个版本呀,应该是没有问题的

kitUIN commented 1 year ago

这俩天再调试一下,这个问题很神奇

kitUIN commented 1 year ago

Please use 1.1.8