Commit Graph

20 Commits

Author SHA1 Message Date
Spottedleaf
66c77fb573 Add more thread checks to API
Most of the World methods, and for updating captured TEs
2023-03-25 16:26:54 -07:00
Spottedleaf
6fe75ab068 Erase mob target in getTarget if it is not in the current region
This will prevent access to the target's position or data.
2023-03-12 15:36:05 -07:00
Spottedleaf
0a11f6aa1f Do not execute infinite radius task in parallel when pushing tasks
By definition, it should not execute in parallel with anything.
2023-03-12 00:17:44 -08:00
Spottedleaf
f6d776697b Fix kicking player when they die on a vehicle with instant respawn
The respawn logic apparently can fire before the death is broadcasted
2023-03-10 20:11:08 -08:00
Spottedleaf
bbee4310fe Fix fishing rods throwing exceptions
Need to move setOwner after the position update, as the thread-check
will fall back to position
2023-03-09 20:45:32 -08:00
Spottedleaf
5cbf898ca1 Stream mode
Disable chat and /msg and /me for non-ops so that the server is
safe to stream
2023-03-09 20:45:32 -08:00
Spottedleaf
68b20e0acc Add API for checking ownership of region by position/entity
This may be useful for plugins which want to perform operations
over large areas outside of the buffer zone provided by the
regionaliser, as it is not guaranteed that anything outside
of the buffer zone is owned. Then, the plugins may use
the schedulers depending on the result of the ownership
check.
2023-03-07 14:44:37 -08:00
Spottedleaf
71a4219ab6 Make sure /tps includes global region in total util percent
While we expect the util from the global region to be around 0.0,
it doesn't mean it always will be. So, include it.
2023-03-07 12:51:23 -08:00
Spottedleaf
2802e2b360 Add paragraph explaing plugin.yml requirenments to new rules section 2023-03-06 15:33:01 -08:00
Spottedleaf
282ded3b44 Add some scheduling API 2023-03-04 13:13:23 -08:00
Spottedleaf
147df3c14c Delay scheduler improvements
It turns out, the scheduler is good enough right now - the main
bottlenecks to scaling chunk workers is actually the chunk
system locking behavior (mostly schedule lock, but ticket lock
is there too)
2023-03-03 00:21:34 -08:00
Spottedleaf
093b1e5394 Fix several issues, mostly saving pending teleporting entities
The place/portal async function now track entities that have been
removed from the world but have not teleported. When the server
shuts down, these entities will have their passenger tree restored
and re-added to the entity slices at the location they were teleporting to,
or in the case of portals that did not run placeAsync yet,
the location they entered the portal on. This should ensure that
for regular teleports that the entity is placed at its correct
target location, and for portalling to ensure that either
the entity is placed at the portal entrace location (where
they entered) or the portal destination. In any case,
the entity is preserved in a location and will survive
the shutdown.

Additionally, move player saving until after the worlds save. This
is to ensure that the save logic is performed only after
all teleportations have completed.

Fix some other misc issues as well:
 - Fix double nether portal creation by checking if a portal exists again
   before creating it, fixing a race condition where two entites would portal
   and neither would see that the other created a portal.
 - Make all remove ticket add an unknown ticket.
   In general this behavior is better since it means that unloads will only
   ever occur at the next tick, rather than during the tick logic. Thus,
   there will be no cases where a chunk is unloaded unexpectedly.
 - Do not use fastFloor for calculating chunk position from block position
   It is not going to return a good value outside of [-1024, 1024]
 - Always perform mid tick update for ticking regionised player chunk loader
   If no entities were loaded, no chunks were loaded, and nothing else -
   the logic would not have otherwise ran. This fixed some rare cases of
   chunks never loading for players after logging in.
2023-03-01 19:12:31 -08:00
Spottedleaf
36675a1b9f Make map data thread-safe to access
We can just synchronise on all of the map data accesses, but
this means we need to be careful about ensuring that no
sync loads occur, otherwise we could block other threads for
long periods of time.
2023-02-27 08:37:47 -08:00
Spottedleaf
19fd3efaa6 Increase parallelism for neighbour writing chunk statuses
Namely, everything after FEATURES. By creating a dependency
chain indicating what chunks are in use, we can safely
schedule completely independent tasks in parallel. This
will allow the chunk system to scale beyond 10 threads
per world.

Currently this patch needs some more testing.
2023-02-26 23:45:21 -08:00
Spottedleaf
b772012778 Make the StructureCheck class MT-Safe
This is so that it may be accessed concurrently
from many regions.

Additionally, make sure it does not leak memory by limiting
the number of entries it will cache.
2023-02-23 23:35:30 -08:00
Spottedleaf
6d922d4b48 Implement player sleep status / night skip
Now, all of the sleep status changes are pushed to the global
tick thread. Had to modify the wake up all players routine
to use the task scheduler to ensure the player is woken up
on the right region context.

Fix erroring while crashing on the global tick thread due to
region field being null.
2023-02-23 20:48:49 -08:00
Spottedleaf
f7e2fe2267 Force disable timings
Need a new profiler system with region threading
2023-02-23 20:13:44 -08:00
Spottedleaf
2474482685 Remove the remains of per-player mob spawns
Now, the spawning should be running Vanilla logic; except
that it is calculated per region (which is what per player
was effectively achieving anyways).
2023-02-23 20:07:56 -08:00
Spottedleaf
256f68d149 Regionise skip hopper event fields 2023-02-23 19:34:00 -08:00
Spottedleaf
fd7901d0f1 Implement TPA system for test server
Will be removed later once this is all public.

Fixed many issues with teleporting players on vehicles
while in the same region.

Additionaly, make sure dead players are dismounted - as
this logic was previously done by remove.

Re-add regiontodo.txt
2023-02-23 18:42:20 -08:00