Commit Graph

3 Commits

Author SHA1 Message Date
stonar96
de6dfedfef
Make Anti-Xray multithreaded (#3520)
Obfuscate multiple chunks at a time over the server thread pool.

Will speed up chunk processing when anti xray is enabled.

Co-authored-by: Aikar <aikar@aikar.co>
2020-06-09 04:12:20 -04:00
Aikar
b2d81e21c5
Improve Chunk Prioritization and Internal Scheduler
In previous MC versions, we had a rather simple internal scheduler
for delayed tasks that would just keep pushing task back until desired
tick was reached.

The method it called to schedule the task changed behavior in 1.14, and now
this scheduler is not working nowhere near what it was supposed to be doing.

This was causing long delayed task to eat up CPU (In Oversleep for example)

Rewrite this to just use the CraftScheduler for scheduling delayed tasks.

Once this was fixed, it became quite clear the code that delayed ticket
additions for chunks based on distance was clearly not right, as it was
tested on the previous broken logic.

So the ticket delay process has been vastly revamped to be even smarter.
Chunks behind the player can load slower than the chunks in front of the player.
We also can delay ticket adding until one of its neighbors has loaded, as
this lets us get a smoother spiral out for the chunks (minus frustum intent).

Additionally on frustum previous commit inadvertently broke frustum trying to
fix an issue when the real fix lied elsewhere, so restore chunk priority so
it works again.
2020-06-09 03:17:25 -04:00
Aikar
f0409edcd7
Drop Close region files patch, doesn't add any value.
Upon further knowledge of the system, it is known that region files
are closing properly, as well as this didn't help native memory use anyways.

This patch also caused issues compiling on a newer JDK being able to
release the jar to java 8 users.
2020-06-08 17:07:23 -04:00