Commit Graph
38 Commits
Author SHA1 Message Date
Shane Freeder 6fca06ec72 Don't load chunks for supporting block checks 2023-07-05 23:11:53 +01:00
Shane Freeder c060f3fae0 Prevent GameEvents being fired from unloaded chunks 2023-04-05 20:15:47 +01:00
Shane Freeder 16b8d46c1c Prevent causing expired keys from impacting new joins 2023-04-03 08:55:52 +01:00
Shane Freeder d0107cc0c0 Treat sequence violations like they should be 2023-03-30 03:13:58 +01:00
Shane Freeder 26fe3d0cff Fix premature player kicks on shutdown
When the server is stopping, the default execution handler method will throw a
RejectedExecutionException in order to prevent further execution, this causes
us to lose the actual kick reason. To mitigate this, we'll use a seperate marked
class in order to gracefully ignore these.
2024-04-11 16:37:44 +01:00
Shane Freeder 084e7e62ad Mitigate effects of WorldCreator#keepSpawnLoaded ret type change
TODO: Remove in 1.21?
2022-09-19 00:13:02 +01:00
Shane Freeder 60026267e3 Configurable chat thread limit
By default, spigot shifts chat over to an unbounded thread pool,
on a normal server, this really offers no gains, the creation of a thread
on submitting to the pool on these servers eats more time vs just running it in
the netty pipeline, however, on servers using plugins which do work in here, there
could be some overall benefits to moving this stuff outside of the pipeline.

In general, this patch does two things:
1) Exposes the core size for the pool, this allows for ensuring that a number of threads
sit around in the pool, mitigating the need for creating new threads; This IS however
caveated, the ThreadPoolExecutor will ONLY create core threads as they're needed, it
just won't allow for us to dip back under the # of core threads, this can potentially
be mitigated by calling prestartCoreThread, however, I'm not sure if there is much justification
for this
2) Exposes a max size for the pool, as stated, by default this is unbounded, for most
servers limiting the size of the pool is going to have 0 effects given how fast chat
is actually processed, this is honestly really just exposed for the misnomers or people
who just wanna ensure that this won't grow over a specific size if chat gets stupidly active
2022-09-18 06:33:17 +01:00
Shane Freeder 2bf4b6e53d WorldCreator#keepSpawnLoaded 2021-07-03 21:18:28 +01:00
Shane Freeder 30ccd487cf Buffer OOB setBlock calls
lets debug mode throw a trace in order to potentially see where
such calls are cascading from easier, but, generally, if you see one setBlock
call, you're gonna see more, and this just potentially causes a flood of logs
which can cause issues for slower terminals, etc.

We can limit the flood by just allowing one for a single gen region,
we'll also only gen a trace for the first one, I see no real pressing need
to generate more, given that that would *massively* negate this patch otherwise
2022-03-19 12:12:22 +00:00
Shane Freeder 0202f1788d Use a CHM for StructureTemplate.Pallete cache
fixes a CME due to this collection being shared across threads
2021-07-12 12:28:29 +01:00
Shane Freeder c472c71eca Prevent ContainerOpenersCounter openCount from going negative 2021-11-30 05:30:35 +00:00
Shane Freeder 04a78195ec Fix CocaoDecorator causing a crash when trying to generate without logs 2021-09-07 21:29:38 +01:00
Shane Freeder 6949e999eb Send empty commands if tab completion is disabled 2021-04-26 01:27:08 +01:00
Shane Freeder 635832cc39 Add bypass host check
Paper.bypassHostCheck

Seriously, fix your firewalls. -.-
2021-04-18 21:27:01 +01:00
Shane Freeder cabf9f914d Remove stale POIs 2021-01-09 14:17:07 +01:00
Shane Freeder 5b7474984b Fix crash from invalid ingredient lists in VillagerAcquireTradeEvent 2020-12-27 11:31:06 +00:00
Shane Freeder 1f21f3032b Limit recipe packets 2020-12-12 23:45:28 +00:00
Shane Freeder af1fabed04 Extend block drop capture to capture all items added to the world 2020-09-17 00:36:05 +01:00
Shane Freeder 5d139ca424 Buffer joins to world
This patch buffers the number of logins which will attempt to join
the world per tick, this attempts to reduce the impact that join floods
has on the server
2020-08-19 05:05:54 +01:00
Shane Freeder f5cfd89975 Prevent teleporting dead entities 2020-03-03 05:26:40 +00:00
Shane Freeder 35b7f788a9 misc debugging dumps 2021-02-18 20:23:28 +00:00
Shane Freeder 6b7013458d Prevent opening inventories when frozen 2020-04-13 07:31:44 +01:00
Shane Freeder 26067ca04b Validate tripwire hook placement before update 2020-03-07 00:07:51 +00:00
Shane Freeder 0664232c53 PlayerDeathEvent#shouldDropExperience 2019-12-24 00:35:42 +00:00
Shane Freeder 26c77784e5 Fix CB call to changed postToMainThread method 2019-05-10 18:38:19 +01:00
Shane Freeder 373c8ff0b2 force entity dismount during teleportation
Entities must be dismounted before teleportation in order to avoid
multiple issues in the server with regards to teleportation, shamefully,
too many plugins rely on the events firing, which means that not firing
these events caues more issues than it solves;

In order to counteract this, Entity dismount/exit vehicle events have
been modified to supress cancellation (and has a method to allow plugins
to check if this has been set), noting that cancellation will be silently
surpressed given that plugins are not expecting this event to not be cancellable.

This is a far from ideal scenario, however: given the current state of this
event and other alternatives causing issues elsewhere, I believe that
this is going to be the best soultion all around.

Improvements/suggestions welcome!
2018-11-15 13:38:37 +00:00
Shane Freeder f944b0b8d6 Make the default permission message configurable 2018-11-18 19:49:56 +00:00
Shane Freeder 4da5176b89 Don't allow digging into unloaded chunks 2018-11-11 21:01:09 +00:00
Shane Freeder 52ea2a0cd9 Fix SpongeAbsortEvent handling
Only process drops when the block is actually going to be removed
2018-11-10 05:15:21 +00:00
Shane Freeder fed1922643 Configurable connection throttle kick message 2018-10-02 09:57:50 +01:00
Shane Freeder 88409ad861 Break up and make tab spam limits configurable
Due to the changes in 1.13, clients will send a tab completion request
for all bukkit commands in order to factor in the lack of support for
brigadier and provide backwards support in the API.

Craftbukkit, however; has moved the chat spam limiter to also interact
with the tab completion request, which while good for avoiding abuse,
causes 1.13 clients to easilly be kicked from a server in bukkit due
to this. Removing the spam limit could cause issues for servers, however,
there is no way for servers to manipulate this without blindly cancelling
kick events, which only causes additional complications. This also causes
issues in that the tab spam limit and chat share the same field but different
limits, meaning that a player having typed a long command may be kicked from
the server.

Splitting the field up and making it configurable allows for server owners
to take the burden of this into their own hand without having to rely on
plugins doing unsafe things.
2018-07-29 05:02:15 +01:00
Shane Freeder d6d2d75fe6 Add EntityTeleportEndGatewayEvent 2018-06-09 14:08:39 +02:00
Shane Freeder ce2c1367af Flag to disable the channel limit
In some enviroments, the channel limit set by spigot can cause issues,
e.g. servers which allow and support the usage of mod packs.

provide an optional flag to disable this check, at your own risk.
2018-03-31 17:04:26 +01:00
Shane Freeder 794fc9799b Extend Player Interact cancellation
GUIs are opened on the client, meaning that the server cannot block them from opening,
However, it is possible to close these GUIs from the server.

Flower pots are also not updated on the client when interaction is cancelled, this patch
also resolves this.
2018-02-11 10:43:46 +00:00
Shane Freeder 1d1c5a4493 use CB BlockState implementations for captured blocks
When modifying the world, CB will store a copy of the affected
blocks in order to restore their state in the case that the event
is cancelled. This change only modifies the collection of blocks
in the world by normal means, e.g. not during tree population,
as the potentially marginal overheads would serve no advantage.

CB was using a CraftBlockState for all blocks, which causes issues
should any block that uses information beyond a data ID would suffer
from missing information, e.g. Skulls.

By using CBs CraftBlock#getState(), we will maintain a proper copy of
the blockstate that will be valid for restoration, as opposed to dropping
information on restoration when the event is cancelled.
2017-11-16 12:12:41 +00:00
Shane Freeder 2c11c3e2bb revert serverside behavior of keepalives
This patch intends to bump up the time that a client has to reply to the
server back to 30 seconds as per pre 1.12.2, which allowed clients
more than enough time to reply potentially allowing them to be less
tempermental due to lag spikes on the network thread, e.g. that caused
by plugins that are interacting with netty.

We also add a system property to allow people to tweak how long the server
will wait for a reply. There is a compromise here between lower and higher
values, lower values will mean that dead connections can be closed sooner,
whereas higher values will make this less sensitive to issues such as spikes
from networking or during connections flood of chunk packets on slower clients,
 at the cost of dead connections being kept open for longer.
2017-10-15 00:29:07 +01:00
Shane Freeder 70e24c1b60 handle ServerboundKeepAlivePacket async
In 1.12.2, Mojang moved the processing of ServerboundKeepAlivePacket off the main
thread, while entirely correct for the server, this causes issues with
plugins which are expecting the PlayerQuitEvent on the main thread.

In order to counteract some bad behavior, we will post handling of the
disconnection to the main thread, but leave the actual processing of the packet
off the main thread.

also adding some additional logging in order to help work out what is causing
random disconnections for clients.
2017-10-05 01:54:07 +01:00
Shane Freeder 918da37691 provide a configurable option to disable creeper lingering effect spawns 2017-06-11 21:01:18 +01:00