{"action":"created","issue":{"url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/3422","repository_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge","labels_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/3422/labels{/name}","comments_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/3422/comments","events_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/3422/events","html_url":"https://github.com/MinecraftForge/MinecraftForge/issues/3422","id":190525637,"number":3422,"title":"[1.11 - 2153] Sending FMLProxyPacket from Forge server to vanilla client causes DC","user":{"login":"chylex","id":3685160,"avatar_url":"https://avatars.githubusercontent.com/u/3685160?v=3","gravatar_id":"","url":"https://api.github.com/users/chylex","html_url":"https://github.com/chylex","followers_url":"https://api.github.com/users/chylex/followers","following_url":"https://api.github.com/users/chylex/following{/other_user}","gists_url":"https://api.github.com/users/chylex/gists{/gist_id}","starred_url":"https://api.github.com/users/chylex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chylex/subscriptions","organizations_url":"https://api.github.com/users/chylex/orgs","repos_url":"https://api.github.com/users/chylex/repos","events_url":"https://api.github.com/users/chylex/events{/privacy}","received_events_url":"https://api.github.com/users/chylex/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-19T22:47:03Z","updated_at":"2016-11-20T03:19:10Z","closed_at":null,"body":"Ran into this issue porting 1.10.2 code (where this worked fine) to 1.11. The mod works on either client or server separately and is not required to have installed in both, but it does attempt to communicate with the other side at several points.\r\n\r\nUsing `FMLEventChannel` to [send packet to all players or a specific player](https://github.com/chylex/Better-Sprinting/blob/1.10.2/src/main/java/chylex/bettersprinting/system/PacketPipeline.java#L54) causes a server error if the client is vanilla, which makes the client disconnect.\r\n\r\nHere is an except from the [server log](https://gist.github.com/chylex/18ea1603c46f8f3896d856e95b4cbc8c) that shows an error in `NettyNetworkEncoder`, where it could not determine FMLProxyPacket's packet id and threw a \"Can't serialize unregistered packet\" exception. In this case, the packet is sent immediately after the client joins, but the client gets disconnected even when sending it later (for ex. after running a command).\r\n\r\n```\r\n[23:03:31 INFO]: Connection received without FML marker, assuming vanilla.\r\n[23:03:31 INFO]: [Server thread] Server side vanilla connection established\r\n(...)\r\n[23:03:31 INFO]: §e§r§echylex§r§e joined the game§r\r\n(...)\r\n[23:03:31 DEBUG]: OUT: [PLAY:null] net.minecraftforge.fml.common.network.internal.FMLProxyPacket\r\n[23:03:31 DEBUG]: io.netty.handler.codec.EncoderException: java.io.IOException: Can't serialize unregistered packet\r\n[23:03:31 INFO]: chylex lost connection: TranslatableComponent{key='disconnect.genericReason', args=[Internal Exception: io.netty.handler.codec.EncoderException: java.io.IOException: Can't serialize unregistered packet], siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}\r\n```\r\n\r\nIf I understand this, FMLProxyPacket should be converted to custom payload packets, which is not happening in this particular case. This is mainly a problem when trying to send a packet to all players on the server, where some of them have Forge installed and some don't, which would cause all vanilla clients to DC.\r\n\r\nThis is not an issue if either:\r\n- both client and server are modded (of course), the client does not need to have the mod installed\r\n- client is modded, server is vanilla, and client sends a modded packet to the server\r\n- in previous versions of Minecraft, between 1.10.2 all the way back to 1.7.10, where the same code has been used\r\n\r\n(Note: I have modified the mod to check for mod presence on all clients before sending them the packets, but I can upload an older 1.11 build that causes the issue)"},"comment":{"url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/comments/261755745","html_url":"https://github.com/MinecraftForge/MinecraftForge/issues/3422#issuecomment-261755745","issue_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/3422","id":261755745,"user":{"login":"chylex","id":3685160,"avatar_url":"https://avatars.githubusercontent.com/u/3685160?v=3","gravatar_id":"","url":"https://api.github.com/users/chylex","html_url":"https://github.com/chylex","followers_url":"https://api.github.com/users/chylex/followers","following_url":"https://api.github.com/users/chylex/following{/other_user}","gists_url":"https://api.github.com/users/chylex/gists{/gist_id}","starred_url":"https://api.github.com/users/chylex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chylex/subscriptions","organizations_url":"https://api.github.com/users/chylex/orgs","repos_url":"https://api.github.com/users/chylex/repos","events_url":"https://api.github.com/users/chylex/events{/privacy}","received_events_url":"https://api.github.com/users/chylex/received_events","type":"User","site_admin":false},"created_at":"2016-11-20T03:19:10Z","updated_at":"2016-11-20T03:19:10Z","body":"https://www.dropbox.com/s/aw6vsemb8f5ha5s/ForgeNetworkTestMod.zip?dl=1\r\n\r\nContains both compiled .jar that works in 1.11 and 1.10.2, and the source code. Tested it and confirmed that a vanilla client joining a Forge server with this mod will get kicked only in 1.11."}}
{"actor":{"display_login":"chylex"}}