kernitus / BukkitOldCombatMechanics

Spigot plugin to configure combat mechanics for 1.9 onwards
https://www.spigotmc.org/resources/19510/
Mozilla Public License 2.0
171 stars 72 forks source link

My players are getting kicked when I'm using ProtocolSupport #355

Closed x9nico closed 4 years ago

x9nico commented 4 years ago

Info

Problem Description

Hi, when I'm using the plugin with ProtocolSupport on a 1.14.4 server, my players are getting kicked when they're doing a right click: didifaure lost connection: Internal Exception: java.lang.IllegalArgumentException: You must pass a 'Packet' object!

The developers of ProtocolSupport has told me of it wasn't an error from them.

x9nico commented 4 years ago

The players are getting that when they are < to 1.9

kernitus commented 4 years ago

Do you mean players running a 1.8 client?

x9nico commented 4 years ago

Yes.

x9nico commented 4 years ago

I think it can affect the most olders versions for 1.7, etc. I tested only for 1.8.x.

x9nico commented 4 years ago

I thinked by doing the test it was due to the usage of the shield ? It does only with the plugin. With ProtocolSupport without OldCombatMechanics, I don't have this error.

x9nico commented 4 years ago

Any solutions for this ?

kernitus commented 4 years ago

What version of OldCombatMechanics are you running?

x9nico commented 4 years ago

The latest

kernitus commented 4 years ago

That is completely meaningless. I would need the version printed when you run /ocm and, if it was downloaded from the Jenkins server, the build number. Otherwise, I will not know what to be testing for.

x9nico commented 4 years ago

It's the version 1.7.4. I downloaded it on Spigot.

x9nico commented 4 years ago

image

kernitus commented 4 years ago

We believe this is a bug in ProtocolSupport. Where did you get the information that it is an OldCombatMechanics bug?

x9nico commented 4 years ago

There: https://github.com/ProtocolSupport/ProtocolSupport/issues/1187

I-Al-Istannen commented 4 years ago

I can not reproduce it with: 1.14.4 server, latest OCM, latest ProtocolSupport one 1.14.4 client and one 1.8.8.

Can you post the exact reproduction steps?

grafik

x9nico commented 4 years ago

The 1.8 player have done a right click @I-Al-Istannen and the 1.8 player has been kicked. (sorry for my bad English)

I-Al-Istannen commented 4 years ago

I have done the same and nothing happened. The shield state was (nearly) properly synced.

What items did you hold in your hand? What did you right click with? What was your version? What was the exact 1.8 version? 1.8.8? What is your 1.14.4 server version (/version)? What your ProtocolSupport version?

x9nico commented 4 years ago

PaperSpigot 1.14.4 Latest protocolSupport dev build 1.8.9 I given in my plugins a shield into PlayerInventory (for all player versions), and when he's doing a right click, he's kicked with the Packet's object message (I have ProtocolSupportStuff to) A sword, with a shield into the off hand.

x9nico commented 4 years ago

I don't tested Players < to 1.8.9, but in 1.8.9, it affect.

I-Al-Istannen commented 4 years ago

I am on [11:01:33 INFO]: This server is running Paper version git-Paper-194 (MC: 1.14.4) Implementing API version 1.14.4-R0.1-SNAPSHOT).

I am on release 1.8.9.

I used replaceitem entity @p weapon.offhand minecraft:shield to get a shield in my offhand. I have a diamond sword in my hand. I right click the air, blocks, whatever.

I am using your OCM config file.

I am not being kicked and do not experience any issues.

Do you do anything differently?

x9nico commented 4 years ago

No, Maybe with the plugin ProtocolSupportStuff ?

I-Al-Istannen commented 4 years ago

I am using this plugin: grafik

Plugins (2): OldCombatMechanics, ProtocolSupport

x9nico commented 4 years ago

I have the version 4.29-dev of ProtocolSupport.

I-Al-Istannen commented 4 years ago

What is the build number?

x9nico commented 4 years ago

457

I-Al-Istannen commented 4 years ago

Nope, no changes. Looks like a weird issue on your side.

Can you try this build: OCM.zip

It will output a few @NICO lines. Those are the ones that I am interested in. They should be printed when a player joins and right before the player disconnects due to the crash.

x9nico commented 4 years ago

[11:19:09 INFO]: @NICO Got packet class: class com.comphenix.protocol.events.PacketContainer PacketContainer[type=BLOCK_PLACE[class=PacketPlayInBlockPlace, id=45], structureModifier=StructureModifier[fieldType=class java.lang.Object, data=[private net.minecraft.server.v1_14_R1.EnumHand net.minecraft.server.v1_14_R1.PacketPlayInBlockPlace.a, public long net.minecraft.server.v1_14_R1.PacketPlayInBlockPlace.timestamp]]] [11:19:09 INFO]: x9nico lost connection: Internal Exception: java.lang.IllegalArgumentException: You must pass a 'Packet' object! [11:19:10 INFO]: x9nico has left the server!

I-Al-Istannen commented 4 years ago

Can you also post the ones when a player connects:

Channel handlers:
timeout
decrypt
splitter
decompress
ps_raw_capture_receive
ps_decoder_transformer
decoder
encrypt
prepender
compress
ps_raw_capture_send
ps_encoder_transformer
encoder
ps_logic
ocm_handler
packet_handler
x9nico commented 4 years ago

11:22:02 INFO: Channel handlers:

11:22:02 INFO: x9nico[/127.0.0.1:52482] logged in with entity id 12 at ([world]-296.0, 52.0, -140.0)

x9nico commented 4 years ago

But I think the error comes from Protocollib. PacketContainer are in Protocollib !

I-Al-Istannen commented 4 years ago

Yea, it sees a ProtocolLib structure instead of an NMS packet. That's a new one... Might be due to the position of the listener in the chain it printed.

What plugins you use require/use protocol lib?

x9nico commented 4 years ago

For AuthMe Reloaded.

x9nico commented 4 years ago

And the remove of ProtocolLib does error with ProtocolSupport.

I-Al-Istannen commented 4 years ago

Not sure what you mean with that. The only difference in the handler chain seems to be that I have a ps_decoder_transformer and a ps_encoder_transformer.

Your error sounds a bit weird. I will later try AuthMe Reloaded and see if I can reproduce the error. If not, you'd probably need to remove auth me, protocollib, via version and ProtocolSupport in that order and see when it starts working...

I will be away for a few hours, a christmas market is calling :) Enjoy your day and I will talk to you later :)

x9nico commented 4 years ago

I have a lots of error with ProtocolSupport when I don't have ProtocolLib.

I-Al-Istannen commented 4 years ago

I can not reproduce it. I also do not get any errors from ProtocolSupport without ProtcolLib.

Sounds like there is something else amiss in your configuration?

Can you try ProtocolSupport, ProtocolLib, ViaVersion and OCM on an otherwise fresh "install" of Paper 1.14.4 and see if the problem persists?

I am bit out of things I could do on my end, it looks like a configuration or other issue on your end at the moment.

x9nico commented 4 years ago

Hi, the problem persist.

I-Al-Istannen commented 4 years ago

Can you do what I suggested in the previous post?

Can you try ProtocolSupport, ProtocolLib, ViaVersion and OCM on an otherwise fresh "install" of Paper 1.14.4 and see if the problem persists?

There isn't much I can do at the moment, as I am unable to reproduce the problem.

x9nico commented 4 years ago

I tried, and the problem is solved. But I don't know where the bug come from. On another 1.14.4 Paper server, I don't have the problem.

x9nico commented 4 years ago

(I have still the problem on my 1.14.4 Paper Server)

I-Al-Istannen commented 4 years ago

I am sorry, but I can not debug what I can not reproduce at all. Based on your descriptions it sounds like an issue with the configuration / plugin selection on that specific 1.14.4 server.

Can you see whether you can reproduce it on the fresh server by copying over your plugins one by one (or copy half of them, see if the error occurs, copy the other half if not and so on)

If that does not work, you could zip/tar/whatever your server up (except for the world folders) and send it to us. Either by posting it here if it is not remotely sensitive or via a DM on Discord / per E-Mail. If I can reproduce the error with that zipped server, I might be able to effectively debug it.

x9nico commented 4 years ago

Hello, It's a Setup, I'm selling it on Mc-Market. If you have a Mc-Market account, I can give you a license for download it. Can I have your Mc-Market username please ?

I-Al-Istannen commented 4 years ago

With a heavy heart I created yet another account at some random website, I pray to god that the website isn't as trustworthy as it looks.

IAlIstannen

x9nico commented 4 years ago

I added you as Buyer. You can now download it => https://www.mc-market.org/resources/9784/ PS: I don't have added OCM into the Setup. You have to add it.

I-Al-Istannen commented 4 years ago

Thanks for that.

I found the error, but sadly it is in ProtocolSupportStuff. I will add a not ideal mitigation for the OCM crash, but ProtcolSupportStuff should fix the error on their side as well.

The commit will probably land in my fork this hour, then I will make a PR which will need to be reviewed and merged by Rayzr or kernitus and then a dev build will be available from the CI. So no ETA, but it shouldn't take too long.

x9nico commented 4 years ago

Thanks you :) Please send me a message when you have any news about this.

kernitus commented 4 years ago

@x9nico I have merged the Pull Request, but it is currently untested. If you wish to test on your configuration you can find the test build here. Do make sure you have a backup just in case.

x9nico commented 4 years ago

Thanks you, the problem has been resolved.