Skip to content
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

Regression bug in commit af33a2ab41199f7c564a5ca9f919e91822532cf4 #2601

Closed
1 task done
nickuc opened this issue Nov 1, 2023 · 3 comments
Closed
1 task done

Regression bug in commit af33a2ab41199f7c564a5ca9f919e91822532cf4 #2601

nickuc opened this issue Nov 1, 2023 · 3 comments

Comments

@nickuc
Copy link
Contributor

nickuc commented Nov 1, 2023

  • This issue is not solved in a development build

Describe the bug
When registering an event that listens for the handshake packet (SET_PROTOCOL), an "Incompatible version!" will appear in motd. This bug was introduced in build #670 (most likely by commit af33a2a). Build #669 does not have the same problem.

To Reproduce
Steps to reproduce the behavior:

  1. Download and install latest build.
  2. Intercept the SET_PROTOCOL packet as the following example:
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(this, PacketType.Handshake.Client.SET_PROTOCOL) {
      @Override
      public void onPacketReceiving(PacketEvent event) {
            // packet received
      }
});
  1. See error

Expected behavior
Have the same behavior as build #669.

Screenshots
#669

#670

Version Info
Provide your ProtocolLib install info with /protocol dump through pastebin.

Additional context
No additional context.

@nickuc
Copy link
Contributor Author

nickuc commented Nov 1, 2023

#2593 seems to be the same problem

@Dymeth
Copy link

Dymeth commented Nov 2, 2023

The problem is PacketType.Handshake.Client.SET_PROTOCOL packet changes client protocol before calling NetworkManagerInjector.onPacketReceiving(). So in NetworkManagerInjector.onPacketReceiving() ProtocolLib tries to get PacketType by PacketType.Protocol.STATUS or PacketType.Protocol.LOGIN protocols, but not PacketType.Protocol.HANDSHAKING which is actually stored in PacketRegistry.REGISTER.protocolClassToType.
That is why PacketRegistry.getPacketType(PacketType.Protocol, Class<?>) returns null and tries to create PacketContainer with null PacketType.

UPD: There are high amount of issues coming in right now due to:

  • Many people are using the ProtocolLib release from SpigotMC (v5.1.0)
  • Many people are using 1.20 or 1.20.1 server software instead of 1.20.2
  • Those using the latest development build are getting the issue described here

In addition, most issues lack the necessary technical information. Therefore, I would recommend to fix this issue ASAP and public it on SpigotMC. Below is a long list of issues that can be related with described situation

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 a pull request may close this issue.

2 participants