Commit graph

2923 commits

Author SHA1 Message Date
Minecrell
5336a6b6bb Add extended PaperServerListPingEvent (#980)
* Drop original implementation for old player sample API

* Add extended PaperServerListPingEvent

Add a new event that extends the original ServerListPingEvent
and allows full control of the response sent to the client.

* Implement deprecated player sample API
2018-03-23 04:19:59 +01:00
Aikar
855f21c54e More improvements to PlayerProfile code
.equals() was wrong
clean up createPlayerProfile code
don't set profile to null if the complete call fails
2018-03-22 21:56:18 -04:00
Aikar
1b8ea6f3bb Fix Profile Textures and expand PlayerProfile .complete() API
I mistakenly thought .complete() also checked for textures, which was not the case

So the logic was not working as desired.

Also some undesired logic paths lead to textures of the logging in player being dropped, forcing
us to always load the textures immediately again on login, leading to rate limits.

Everythings now good

the .complete() api now will default specify to also complete textures, but you may
pass false to it to skip loading textures.
2018-03-22 21:40:57 -04:00
Aikar
e92baf5367 getPlayerUniqueId API
Gets the unique ID of the player currently known as the specified player name
In Offline Mode, will return an Offline UUID

This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer
2018-03-22 01:41:44 -04:00
Aikar
3341a93c7f Check Profile Cache for PlayerProfile API
This ensures we look up the name for ID only Profiles

If the profile is in the UserCache, we can get those details quickly

This should avoid some unnecessary round trips.

Additionally, handle profiles for offline mode to use offline UUID's
2018-03-22 01:28:22 -04:00
Aikar
feaa8460b1 Fix Dragon Server Crashes
If the dragon tries to find "ground" and hits a hole, or off edge,
it will infinitely keep looking for non air and eventually crash.
2018-03-21 20:51:12 -04:00
Aikar
2f9a09cda5 Configurable Unrestricted Signs - Resolves #1054
Bukkit restricts command execution of signs to test if the sender
has permission to run the specified command. This breaks vanilla
maps that use signs to intentionally run as elevated permission.

Bukkit provides an unrestricted advancements setting, so this setting
compliments that one and allows for unrestricted signs.

We still filter sign update packets to strip out commands at edit phase,
however there is no sanity in ever expecting creative mode to not be
able to create signs with any command.

Creative servers should absolutely never enable this.
Non creative servers, enable at own risk!!!
2018-03-21 19:59:54 -04:00
Aikar
6b6373a077 Only complete incomplete profiles - Resolves #1053 2018-03-21 19:12:02 -04:00
MiniDigger | Martin
ace8e99e04 Call PortalCreateEvent for exit portals (#1047) 2018-03-20 19:56:44 +01:00
Brokkonaut
7f21066ba1 Add missing registerPlayer in CraftPlayer.showPlayer0 (#1051) 2018-03-20 17:27:00 +01:00
Aikar
71d64fa4f2 Remove the immediate dispatch optimization and adjust thread executors
hopefully will resolve #1049
2018-03-18 20:09:12 -04:00
Aikar
9e2678f71a Update javadoc on setPlayerProfile 2018-03-18 13:28:01 -04:00
Aikar
aa8ad3124a Player.setPlayerProfile API
This can be useful for changing name or skins after a player has logged in.
2018-03-18 12:32:09 -04:00
Aikar
87dc694af9 Ability to change PlayerProfile in AsyncPreLoginEvent
This will allow you to change the players name or skin on login.
2018-03-18 11:46:14 -04:00
Aikar
0094c1669c Add PlayerProfile.complete() API to trigger skin lookup 2018-03-18 11:31:32 -04:00
Aikar
0d220393d1 Fix more issues with async scheduler and cancelling pending task
was a race condition, so do need to use the head/parsePending logic still
2018-03-17 14:59:03 -04:00
Aikar
700c900cc3 Fix isCurrentlyRunning for sync tasks
Not sure where this would of ever been used, but for correctness sake.
2018-03-17 13:14:44 -04:00
Aikar
7241626ffd check that a task is valid before executing incase it was cancelled elsewhere
also set runners in the short circuit path so we know of the pending task incase its long running
2018-03-17 12:58:27 -04:00
Aikar
fb8222874d Improved Async Task Scheduler
The Craft Scheduler still uses the primary thread for task scheduling.
This results in the main thread still having to do work as part of the
dispatching of async tasks.

If plugins make use of lots of async tasks, such as particle emitters
that want to keep the logic off the main thread, the main thread still
receives quite a bit of load from processing all of these queued tasks.

Additionally, resizing and managing the pending entries for all of
these asynchronous tasks takes up time on the main thread too.

This commit replaces the implementation of the scheduler when working
with asynchronous tasks, by forwarding calls to the new scheduler.

The Async Scheduler uses a single thread executor for "management" tasks.
The Management Thread is responsible for all adding and dispatching of
scheduled tasks.

The mainThreadHeartbeat will send a heartbeat task to the management thread
with the currentTick value, so that it can find which tasks to execute.

Scheduling of an async tasks also dispatches a management task, ensuring
that any Queue resizing operation occurs off of the main thread.

The async queue uses a complete separate PriorityQueue, ensuring that resize
operations are decoupled from the sync tasks queue.

Additionally, an optimization was made that if a plugin schedules
a single, non repeating, no delay task, that we immediately dispatch it
to the executor pool instead of scheduling it. This avoids an unnecessary
round trip through the queue, as well as will reduce the size growth of the
queue if a plugin schedules lots of asynchronous tasks.
2018-03-16 23:09:51 -04:00
Zach Brown
83d069ba65 [CI-SKIP] macOS filesystem dust made it past gitignore! 2018-03-13 18:43:13 -04:00
Y. Lin
d6a5844fe8 [CI-SKIP] Add vemacs to MIT list (#1043)
Somebody pinged me on Telegram and said I should do this
2018-03-11 14:16:52 -05:00
Aikar
2a34a59149 explicit, not implicit... oops 2018-03-11 14:21:03 -04:00
Aikar
9e35831323 Disable Implicit Network Manager Flushing
This seems completely pointless, as packet dispatch uses .writeAndFlush.

Things seem to work fine without implicit flushing, but incase issues arise,
provide a System property to re-enable it using improved logic of doing the
flushing on the netty event loop, so it won't do the flush on the main thread.

Renable flushing by passing -Dpaper.implicit-flush=true
2018-03-11 14:15:38 -04:00
Brokkonaut
3672d832d4 [CI-SKIP] Add Brokkonaut to MIT list (#1042) 2018-03-11 04:38:50 +01:00
Aikar
af506a11ee Prevent Frosted Ice from loading/holding chunks 2018-03-10 16:33:49 -05:00
Shane Freeder
d0ccbd3161 Return null instead of players location on EnderChests opened by plugins 2018-03-10 20:26:05 +00:00
Shane Freeder
d207b66009 Add OBFHELPER - InventoryEnderChest#getTileEntity 2018-03-10 17:11:51 +00:00
Shane Freeder
3af34bfe45 Fix NPE when getting location from players EnderChest (fixes #1041) 2018-03-10 13:07:40 +00:00
MiniDigger | Martin
12012ab589 Toggleable player crits, helps mitigate hacked clients. (#1040)
This is a port of https://github.com/PaperMC/Paper/blob/ver/1.8.8/Spigot-Server-Patches/0040-Toggleable-player-crits-helps-mitigate-hacked-client.patch
Also adds me to the MIT list.
2018-03-10 05:14:47 +01:00
BillyGalbreath
b36c43bc6b [CI-SKIP] Add BillyGalbreath to MIT list (#1037) 2018-03-09 11:00:48 -06:00
Techcable
d46a2b11b7 [CI-SKIP] Add Techcable to MIT list (#1038) 2018-03-09 09:59:59 -07:00
Shane Freeder
db23ad30cb Fix ItemStack.damage OBFHelper (fixes #1036) 2018-03-08 19:41:00 +00:00
Shane Freeder
ab5b167d08 Update CB/S 2018-03-08 19:36:35 +00:00
Minecrell
1894a7a608 [CI-SKIP] Add Minecrell to MIT list (#1035)
Change email address for some older patches to make it clear that
they are MIT licensed too.
2018-03-08 16:08:21 +01:00
chickeneer
bc19f55565 [CI-SKIP] Add me (chickeneer) to MIT list (#1034) 2018-03-07 21:56:00 -06:00
Aikar
b4c8581812 Fix ProfilePropertyIterator#remove() recursion bug 2018-03-07 21:03:01 -05:00
Jadon Fowler
cb8f0e5674 [CI-SKIP] Add myself to the MIT List (#1032)
I added https://github.com/PaperMC/Paper/blob/master/Spigot-Server-Patches/0141-Toggleable-Elytra-Wall-Damage.patch
a while ago and I'd like to license it under MIT in case someone ever wants to use it for anything.
2018-03-07 12:13:32 -08:00
Gabscap
3c4959439e [CI-SKIP] Add me (Gabscap) to MIT list
And change my used mail address in patch
2018-03-07 13:58:17 +01:00
Shane Freeder
11625293d1 [CI-SKIP] The power of MIT compells me 2018-03-07 12:15:43 +00:00
Shane Freeder
9488fd00fc [CI-SKIP] Merge 'Add me (Mystiflow) to MIT list' 2018-03-07 12:13:50 +00:00
Mark Vainomaa
e4df6ed2cb [CI-SKIP] I (mikroskeem) do MIT licensed contributions to Paper 2018-03-07 09:49:17 +02:00
Mystiflow
388808cc7e [CI-SKIP] Add me (Mystiflow) to MIT list 2018-03-07 04:30:52 +00:00
Black Hole
1cc8a6d8d9 [CI-SKIP] Add me (Black Hole) to MIT list (#1027) 2018-03-07 03:45:43 +01:00
Riley Park
b3a2532662 [ci skip] kashike wears MITtens too 2018-03-06 18:12:30 -08:00
Kyle Wood
a09cbf7989 [CI-SKIP] Add me (Kyle Wood) to MIT list 2018-03-06 19:47:50 -06:00
Daniel Ennis
5ead7691dd Add self to LICENSE as MIT 2018-03-06 20:46:25 -05:00
Zach Brown
8c988cacd7 [CI-SKIP] Clarify project licensing
* THIS IS NOT A RELICENSE *

This commit adds explicit clarification as to the state of this
project's licensing as it has always been. Nothing has changed here.

It also adds a note about how specific authors have chosen to release
their work under a more permissive license. Any past contributors who
want their name added to this list should submit a pull request here.

We will not be adding anyone's names to this list ourselves.
2018-03-06 20:41:03 -05:00
Aikar
66dd61702a Add max-player-auto-save-per-tick setting to spread out saves more
This will force the saves to spread over multiple ticks even when many
players auto save interval is aligned, avoiding spikes on large servers.

Closes #1021
2018-03-04 20:20:27 -05:00
Zach Brown
7c577df97d Update upstream B/CB 2018-03-04 18:32:38 -05:00
Kyle Wood
b2eb1e7f00 Use a more general method of aliasing md5sum
Rather than checking the platform or operating system, simply check if
the command exists. If the check fails, check if the md5 command exists.
If that fails as well, cancel the build script. Otherwise, assign the
alias as before.
2018-02-23 18:58:45 -06:00