Commit Graph

20 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
70ad51a80c
Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

My recent work on serialization is now in CraftBukkit so was able to drop the patch and Paper
is now consistent with upstream.

Bukkit Changes:
e2699636 Move API notes to more obvious location

CraftBukkit Changes:
1b2830a3 SPIGOT-4441: Fix serializing Components to and from Legacy
2020-06-02 01:29:18 -04:00
Aikar
4d38ee111f
Many fixes and improvements to chunk prioritization
I believe this brings us back to stable. A lot of complexity was
learned about juggling priorities.

We were essentially promoting more chunks to urgent than really
needed to be urgent.

So this commit adds a lot more logic to juggle neighbor priorities
and demote their priority once they meet the requirements needed of
them.

This greatly improves the performance of "urgent" chunks".

Fixes #3410
Fixes #3426
Fixes #3425
Fixes #3416
2020-05-22 01:03:42 -04:00
Spottedleaf
bb4002d82e
Handle CraftPlayer#setSpectatorTarget better
Use a proper teleport for teleporting to entities in different
worlds.

Validate that the target entity is valid and deny spectate
requests from frozen players.

Also, make sure the entity is spawned to the client before
sending the camera packet. If the entity isn't spawned clientside
when it receives the camera packet, then the client will not
spectate the target entity.
2020-05-14 18:05:00 -05:00
Aikar
4ae089597b
Fix collision checks on spawning hanging entities and null on async chunk loads
getCubes will now always load chunks
getChunk with gen false will now not throw error

Fixes #3368
Fixes #3364
2020-05-14 05:05:13 -04:00
Aikar
8e9459eadc
Fix missing flag pass for isUrgent 2020-05-11 00:19:40 -04:00
Aikar
a054aa6f02
Properly remove Entities from current chunk
We store a reference to the chunk the entity is currently in, so use it
to more accurately unregister it in chunkCheck

Should maybe fix some entity loss issues.
2020-05-10 05:52:31 -04:00
Aikar
e5f6489602
Add Urgent API for Async Chunks API and use it for Async Teleport
This also cleans up the implementation of Async Chunks to get rid of most
Consumer callbacks and instead return futures.

This lets us propogate errors correctly up the future chain
(barring one isn't lost even deeper in the chain...)

So exceptions can now bubble to plugins using getChunkAtAsync
2020-05-10 00:57:03 -04:00
Aikar
36f34f01c0
Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
da9ef3c5 #496: Add methods to get/set ItemStacks in EquipmentSlots
3abebc9f #492: Let Tameable extend Animals rather than Entity
941111a0 #495: Expose ItemStack and hand used in PlayerShearEntityEvent
4fe19cae #494: InventoryView - Add missing Brewing FUEL_TIME

CraftBukkit Changes:
933e9094 #664: Add methods to get/set ItemStacks in EquipmentSlots
18722312 #662: Expose ItemStack and hand used in PlayerShearEntityEvent
2020-05-06 06:05:22 -04:00
Aikar
f37381ea8a
Optimize Network Manager to not need synchronization
Removes synchronization from sending packets
Makes normal packet sends no longer need to be wrapped and queued like it use to work.
Adds more packet queue immunities on top of keep alive to let the following scenarios go out
without delay:
  - Keep Alive
  - Chat
  - Kick
  - All of the packets during the Player Joined World event

Hoping that latter one helps join timeout issues more too for slow connections.

Removes processing packet queue off of main thread
  - for the few cases where it is allowed, order is not necessary nor
    should it even be happening concurrently in first place (handshaking/login/status)

Ensures packets sent asynchronously are dispatched on main thread

This helps ensure safety for ProtocolLib as packet listeners
are commonly accessing world state. This will allow you to schedule
a packet to be sent async, but itll be dispatched sync for packet
listeners to process.

This should solve some deadlock risks

This may provide a decent performance improvement because thread synchronization incurs a cache reset
so by avoiding ever entering a synchronized block, we get to avoid that, and packet sending is a really
hot activity.
2020-05-06 05:28:47 -04:00
stonar96
8f9df2ed43
Anti Xray cleanup
Undo the accidental renaming of a method in 0aad8bf
Aikar wanted to rename DataPalette#getDataBits(T object) to getOrCreateIdFor
in 0aad8bf but he also accidentally renamed
ChunkPacketInfo#getDataBitsIndex(int chunkSectionIndex) to
getOrCreateIdForIndex.

Remove chunk-edge-mode and chunk loading entirely from Anti-Xray
The chunk-edge-mode is broken since several versions.
Loading chunk neighbors for chunk edge obfuscation isn't needed anymore.
Unlike in previous versions, these are under normal circumstances already loaded
at the time we need them (plugins for example can bypass this).

Use the modified methods and constructors everywhere
Anti-Xray provides support for the default nms methods and constructors,
which where modified by Anti-Xray to avoid breaking stuff (plugins)
which somehow uses these methods.
However, the modified versions of those methods and constructors should be used
where possible.
2020-05-06 04:35:20 -04:00
Spottedleaf
b4e629a283
Use distance map to optimise entity tracker / Misc Utils
Use the distance map to find candidate players for tracking.

This also ports a few utility changes from Tuinity
2020-05-06 03:47:24 -04:00
Aikar
57dd397155
Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
b999860d SPIGOT-2304: Add LootGenerateEvent

CraftBukkit Changes:
77fd87e4 SPIGOT-2304: Implement LootGenerateEvent
a1a705ee SPIGOT-5566: Doused campfires & fires should call EntityChangeBlockEvent
41712edd SPIGOT-5707: PersistentDataHolder not Persistent on API dropped Item
2020-05-01 18:03:57 -04:00
Aikar
842e040c19
Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
220bc594 #486: Add method to get player's attack cooldown
21853d39 SPIGOT-5681: Increase max plugin channel size
5b972adc Improve build process
b55e58d9 Note which custom generator is missing required method

CraftBukkit Changes:
893ad93b #650: Add method to get player's attack cooldown
ef706b06 #655: Added support for the VM tag jansi.passthrough when processing messages sent to a ColouredConsoleSender.
e0cfb347 SPIGOT-5689: Fireball.setDirection increases velocity too much
94cb030f SPIGOT-5673: swingHand API does not show to self
b331a055 SPIGOT-5680: isChunkGenerated creates empty region files
e1335932 Improve build process
a8ec1d60 Add a couple of method null checks to CraftWorld
ce66f693 Misc checkstyle fixes
8bd0e9ab SPIGOT-5669: Fix Beehive.isSedated

Spigot Changes:
2040c4c4 SPIGOT-5677, MC-114796: Fix portals generating outside world border
ab8f6b5a Rebuild patches
e7dc2f53 Rebuild patches
2020-04-27 03:34:45 -04:00
Aikar
ac4f6b5022
Clean up Timings and Async Chunk Configs
Renames a bunch of timings to be more appropriate for the new environment.

Many things dealt with sync loads which wasn't correct anymore.
adjusted timings to be a little bit more accurate here.

Also cleaned up old 1.13 async chunks configs so people won't keep
thinking they can change some of those configs when they can't.
2020-04-26 02:19:43 -04:00
Aikar
cb15cfa4f8
Improve Async Login so pending connections dont get exposed
We still keep vanilla process of waiting for existing session to be removed before logging in
by storing a separate map of pending.

also fire the callback using executor incase further recursion causes any trouble
2020-04-24 05:48:51 -04:00
Ytnoos
bf698865f7
Revert "Re-track players that dismount from other players" 2020-04-22 03:16:31 -04:00
Shane Freeder
b0dc983f21
More progression on patches 2019-12-12 21:01:16 +00:00
MiniDigger
d8a0622602 Compile fixes (#2732) 2019-12-12 18:45:00 +00:00
MiniDigger
44d032f1e9 Houston, we got a patch (#2731)
* Houston, we got a patch

* is this the end of the beginning or the beginning of the end
2019-12-12 16:20:43 +00:00