Commit graph

2954 commits

Author SHA1 Message Date
Riley Park
0abd56b79e [ci-skip] Revert "Add Turqmelon to MIT file (#1089)" (#1091)
This reverts commit 934f4f2156.
2018-04-17 11:20:03 -07:00
Devon T
934f4f2156 Add Turqmelon to MIT file (#1089) 2018-04-17 13:02:49 -04:00
stonar96
fb92e490ad [CI-SKIP] Add stonar96 to MIT list (#1086) 2018-04-17 00:28:52 +02:00
Kyle Wood
f1924ad247 Track previous version and report in command
It is often difficult to diagnose new issues server admins get when
upgrading to a new server version because the only information they are
able to tell us regarding the server version they are running is
"latest". This commit attempts to mitigate this by keeping track of the
previous version of Paper they were running, which is then reported by
the `/version` or `/paper version` command. This gives us a better idea
of the commits included in the upgrade, which may help diagnose new
issues easier.
2018-03-01 19:57:22 -06:00
Zach Brown
40edc359b7 Make version command use the direct link
It was using a redirect, but apparently a small portion of systems,
networks, some mess, are having problems with that redirect.

Just use the direct link and skip the hassle.
2018-04-09 16:13:08 -04:00
Zach Brown
a1f968c8a6 Update BD to allow building on Java 10 2018-04-08 16:19:44 -04:00
Zach Brown
e121df5775 Update upstream CB 2018-04-08 16:15:23 -04:00
Aikar
0c446a7dd3 Fix profile requests being made on offline mode servers
Closes #1076
2018-04-08 12:28:04 -04:00
Shane Freeder
72bd990d87 Allow logger instances to be used across reloads 2018-04-08 02:02:48 +01:00
Shane Freeder
0ed67b50a3 remove warning for custom entities in precreaturespawn (closes #1069)
There can be no survivors.
2018-04-08 01:44:14 +01:00
Shane Freeder
492ed12781 revert "Better reloading of pending unload chunks"
This change by spigot ensures that many interactins with chunks,
e.g. getting a list of TEs will cause the chunk to be marked for not
unloading and will block their unload. This is especially true for
servers using Timings (it needs to access the TE list of chunks), or
any plugins which need to access entity/TE lists periodically.
2018-04-08 01:26:37 +01:00
Zach Brown
8f4f4bdb16 Merge pull request #1070 from mikroskeem/feature/open-placed-sign
Add method to open already placed sign
2018-04-05 21:08:27 -04:00
Zach Brown
a080350652 Update upstream CB 2018-04-04 20:33:43 -04:00
Zach Brown
36e3e1cffb Update CB 2018-04-02 16:33:04 -04:00
Zach Brown
2caf69d5ab Silly rabbits, eggs are for chickens 2018-04-02 16:30:24 -04:00
Zach Brown
3229f3b8b8 > not even using java8 time API
Gotta get this rocketship up to speed I guess...
2018-03-31 23:30:19 -04:00
Zach Brown
3b99722641 Easter and April Fools fall on the same day
¯\_(ツ)_/¯
2018-03-31 22:50:11 -04:00
Mark Vainomaa
50f348988d Add method to open already placed sign 2018-04-01 02:30:41 +03:00
Zach Brown
9bafd0634e Stop explicitly blocking Vanilla Method Profiler
At the time this was re-added, there was concern around how the JIT
would handle the system property that enabled it.

This shouldn't be a problem, and as such we no longer need to block
access to it.

The Vanilla Method Profiler will not provide much to most users however
there is no harm in providing it as an option. For most users, the
recommended and supported method for determining performance issues with
Paper will continue to be Timings.
2018-03-31 14:51:21 -04:00
Shane Freeder
4502a946d7 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:07:09 +01:00
Shane Freeder
75a9b9e07d Delay initial ping sent to the client 2018-03-31 15:27:41 +01:00
Shane Freeder
1872a94c83 Update CB/S 2018-03-31 10:34:25 +01:00
Minecrell
99efa104db Call PaperServerListPingEvent for legacy pings (#1057)
* Make the legacy ping handler more reliable

The Minecraft server often fails to respond to old ("legacy") pings
from old Minecraft versions using the protocol used before the switch
to Netty in Minecraft 1.7.

Due to packet fragmentation[1], we might not have all needed bytes
available when the LegacyPingHandler is called. In this case, it will
run into an error, remove the handler and continue using the modern
protocol.

This is unlikely to happen for the first two revisions of the legacy
ping protocol (used in Minecraft 1.5.x and older) since the request
consists of only one or two bytes, but happens frequently for the
last/third revision introduced in Minecraft 1.6.

It has much larger, variable packet sizes due to the inclusion of
the virtual host (the hostname/port used to connect to the server).

The solution[2] is simple: If we find more than two matching bytes,
we buffer the remaining bytes until we have enough to fully read and
respond to the request.

[1]: https://netty.io/wiki/user-guide-for-4.x.html#wiki-h3-11
[2]: https://netty.io/wiki/user-guide-for-4.x.html#wiki-h4-13

* Add legacy ping support to PaperServerListPingEvent

Add a new method to StatusClient check if the client is a legacy
client that does not support all of the features provided in the
event.
2018-03-30 19:00:01 +02:00
Minecrell
c37016f476 Avoid negative server ping player sample counts. Fixes #1067 (#1068) 2018-03-30 18:53:15 +02:00
Mark Vainomaa
bfa2eab01f Make player data saving configurable (#1063) 2018-03-27 17:45:54 +03:00
Minecrell
f556e7652a Improve backward compatibility of deprecated player sample API (#1065)
Some plugins (e.g. older builds of EssentialsX) assume that
ServerListPingEvent.getSampleText() returns a mutable copy of
the player sample list. This was the case until it was refactored
on top of the new API introduced in #980.

As a result, they may run into an error when trying to modify the
returned list directly. Modify getSampleText() to return a mutable
copy (a plain ArrayList) to mimic the old behavior.
2018-03-26 23:45:18 +02:00
Aikar
31c3ae2bb4 Add Setters for ID/Name and add completeByCache for Profile API 2018-03-25 21:50:46 -04:00
Aikar
36f69d38bc Update upstream 2018-03-25 20:06:44 -04:00
Aikar
90d862413b Don't try to complete profile on creation from cache, only on complete()
For one, the wrong API was used that would trigger a network call.
2018-03-25 20:05:30 -04:00
Zach Brown
815161544f Update upstream B/CB 2018-03-22 23:58:50 -04:00
Aikar
3c6db79e46 Use copies for PlayerProfile in PaperServerList and SkullMeta
Don't want to risk mutating players properties in server list (unlikely, but lets be proper)

and Skull also has a setter API, so that should be used too.
2018-03-22 23:32:55 -04:00
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