CobbleSword / NachoSpigot

NachoSpigot is a fork of TacoSpigot 1.8.9 that offers several enhancements to performance as well as bug fixes.
GNU General Public License v3.0
237 stars 86 forks source link

add disableDisconnectSpam config #359

Closed crafter23456 closed 2 years ago

crafter23456 commented 2 years ago

Description

Adds the option to disable that players can get kicked because of disconnect.spam. Mostly because of higher clients. The option doesnt include the line 1217 of exactly that file because I guess thats the real spam preventer and the other code which kicks for disconnect.spam in line 2132 which can be deactivated, is the detector of the chat how fast a user can type.

How has this been tested?

i tested it whith typing and check if it triggers or not

Checklist:

Sculas commented 2 years ago

This implementation is flawed. Enabling the option would disable tab-completion looking at the diff, which is not what we're trying to achieve here.

crafter23456 commented 2 years ago

I wanted to archive that. That tab check is for 1.13+ player a mess. even if I'm in the chat and hold my finger on a button, after a bit I get kicked. that PR prevents it if its activated. normally it doesnt change anything. the normal disconnect.spam with spamming the chat should be keept so I only did the tab thing which causes it.

ghost commented 2 years ago

https://github.com/CobbleSword/NachoSpigot/pull/359/commits/80c426e8069f0bff0286f708153251545098c163#diff-6ef3cc74793f80be4e7a7987b130f887b43c901c7e01d785ecab39de3c0587aeR2136

Also use ! instead of using == false

crafter23456 commented 2 years ago

80c426e#diff-6ef3cc74793f80be4e7a7987b130f887b43c901c7e01d785ecab39de3c0587aeR2136

Also use ! instead of using == false

i changed it to !, is there a performance reason behind it or only better to look?

Sculas commented 2 years ago

is there a performance reason behind it or only better to look?

There's no performance reason behind it, just a convention.

That tab check is for 1.13+ player a mess.

Then shouldn't we fix it instead of disabling it for everyone?

crafter23456 commented 2 years ago

Then shouldn't we fix it instead of disabling it for everyone?

I mean it shouldnt be a loss that player get kicked falsely because of typing too fast (not sending!). the other reason for disconnect.spam is still present, if player spam (with sending!). That should be.

ghost commented 2 years ago

Your check should be done in the chatSpamField verification, not in the whole handler

Sculas commented 2 years ago

Thank you for this PR!