600 Commits

Author SHA1 Message Date
Dylan K. Taylor
050e972add Clean up default level provider management 2018-10-04 12:49:46 +01:00
Dylan K. Taylor
73f1480e10 Merge branch 'release/3.3' 2018-09-27 16:36:57 +01:00
Dylan K. Taylor
9d8898a4ed Server: added API method hasOfflinePlayerData() 2018-09-27 16:36:42 +01:00
Dylan K. Taylor
1f3c0524d9 Merge branch 'release/3.3' 2018-09-14 11:06:31 +01:00
Dylan K. Taylor
f33c19e77a Merge branch 'release/3.2' into release/3.3 2018-09-14 11:06:24 +01:00
Dylan K. Taylor
2ff4228fb7 Merge branch 'release/3.1' into release/3.2 2018-09-14 11:06:11 +01:00
Dylan K. Taylor
06c4f31db7 Server: Account for later levels being unloaded by earlier levels' ticking function in checkTickUpdates()
should fix #2434

This happens when a plugin causes a level to be unloaded during an event fired on level tick.
2018-09-14 11:05:51 +01:00
Dylan K. Taylor
ebc1524f9a Merge remote-tracking branch 'origin/release/3.3' 2018-09-12 10:39:49 +01:00
Dylan K. Taylor
a9fc67663c
Strip anti flight out of the core (#2428)
This may later be developed into a plugin if it is a desired feature, but having it in the core is unnecessary and a pain in the ass.
2018-09-12 10:06:57 +01:00
Dylan K. Taylor
d62e00cc74 AsyncPool: Remove Server dependency (API breaks included)
This brings two plugin-breaking changes: AsyncTask->onCompletion() and AsyncTask->onProgressUpdate() no longer accept Server parameters.

This now allows for the functionality of AsyncPool and AsyncTask to be tested outside of a Server.
2018-09-10 15:48:59 +01:00
Dylan K. Taylor
0d152a2139 Merge branch 'release/3.3' 2018-09-08 14:30:16 +01:00
Dylan K. Taylor
5af4dd20df Merge branch 'release/3.1' into release/3.2 2018-09-08 14:25:11 +01:00
Dylan K. Taylor
a3b78236eb Server: don't catch Throwable for level ticking
this usually causes the console to get spammed with errors. Additionally, in the case where doTick() throws any exception, it's usually because we're in a state we didn't want to be in, so we really should not carry on trying to keep ticking when something breaks here. Instead, this should generate a crashdump.
2018-09-08 14:13:28 +01:00
Dylan K. Taylor
5d1ec1ad49 Server: remove deprecated parameter from findEntity() 2018-08-25 18:38:10 +01:00
Dylan K. Taylor
3b62926721 Merge branch 'release/3.2' 2018-08-25 18:37:27 +01:00
Dylan K. Taylor
032b20f659 Server: remove premature optimization of findEntity() 2018-08-25 18:37:18 +01:00
Dylan K. Taylor
92aeab0d00 Merge branch 'release/3.2' 2018-08-19 16:03:04 +01:00
Dylan K. Taylor
2eda8cfad3 Merge branch 'release/3.1' into release/3.2 2018-08-19 16:01:47 +01:00
Dylan K. Taylor
5df601c817 Add @see docs so PhpStorm can see dynamic constructor usages
PhpStorm can't see constructor usages when the class name is dynamic. This causes maintenance problems because cross-referencing constructors called like this doesn't show up dynamic calls.
2018-08-19 16:00:15 +01:00
Dylan K. Taylor
475ec413e5 Removed deprecated ServerCommandEvent and RemoteServerCommandEvent
if you get rekt by these changes... USE A RELEASE like we've been telling you for so long!
2018-08-19 14:23:41 +01:00
Dylan K. Taylor
aa55cd9acf Merge branch 'release/3.2' 2018-08-19 13:01:54 +01:00
SOFe
ebffff0caa Added CommandEvent, deprecated (Remote)?ServerCommandEvent (#2376) 2018-08-19 12:59:16 +01:00
Dylan K. Taylor
2438d20971 Fixed zero-compression being ignored for small packets 2018-08-16 22:23:09 +01:00
Dylan K. Taylor
15bac8c58a
Implement send buffering and queuing for network sessions (#2358)
Async compression and broadcasts are now reliable and don't have race condition bugs.
This features improved performance and significantly reduced bandwidth wastage.

Reduce Level broadcast latency by ticking network after levels. This ensures that session buffers get flushed as soon as possible after level tick, if level broadcasts were done.
2018-08-13 14:37:18 +01:00
Dylan K. Taylor
10f14beb4b Fixed intermittent crash on player disconnect when async compression is enabled 2018-08-11 19:12:23 +01:00
Dylan K. Taylor
3fa9712a1e Merge branch 'release/3.2' 2018-08-07 14:32:47 +01:00
Dylan K. Taylor
f582b5a3db Merge branch 'release/3.1' into release/3.2 2018-08-07 14:32:38 +01:00
Fris
69c54e789a Clear the title bar when the server shutdown. 2018-08-07 14:31:39 +01:00
Dylan K. Taylor
10ba3d6359 Network: add ability to tick sessions
moved responsibility for login timeout checks to NetworkSession instead of Server
2018-08-02 17:39:09 +01:00
Dylan K. Taylor
e43496e7e4 Network: clean up ticking handling, RakLib only processes on Snooze notification 2018-08-02 17:14:21 +01:00
Dylan K. Taylor
7560880168 Added DataPacketBroadcastEvent, refactor broadcast handling, close #1521
batchPackets() is now considered internal and shouldn't be used by plugins.

Added Server->broadcastPackets(Player[], DataPacket[]) : bool
2018-08-02 15:54:30 +01:00
Dylan K. Taylor
c345e6f22c Merge branch 'release/3.2' 2018-08-02 14:43:59 +01:00
Dylan K. Taylor
6fcaef068f Merge branch 'release/3.1' into release/3.2 2018-08-02 14:43:51 +01:00
Dylan K. Taylor
9ece971a2b Server: remove useless check from exceptionHandler()
this cannot be null... @shoghicp y u litter the code with these useless checks ???
2018-08-02 14:41:28 +01:00
Dylan K. Taylor
5546c88f88 Server: Fixed parse errors getting reported to CA
this changed to throwing errors as of PHP 7
2018-08-02 14:40:36 +01:00
Dylan K. Taylor
488c03c200 Make timings for player network more detailed 2018-07-31 16:34:15 +01:00
Dylan K. Taylor
2bf6764112
Implemented network encryption (#2343)
For those who fuss about performance, you can disable the `network.enable-encryption` option to use sessions without encryption.
2018-07-31 15:54:18 +01:00
Dylan K. Taylor
0d9952d53e Rename BaseLang -> Language 2018-07-30 17:07:19 +01:00
Dylan K. Taylor
d26631d8e0 Clean up BaseLang error handling, throw exceptions instead 2018-07-30 17:00:52 +01:00
Dylan K. Taylor
bdd42d6a78 Added NetworkSession->sendEncoded(), clean up some code 2018-07-27 18:39:14 +01:00
Dylan K. Taylor
7e81a09409 Merge branch 'release/3.2' 2018-07-26 14:03:39 +01:00
Dylan K. Taylor
08be51dc23 Clear permissions on server reload 2018-07-26 10:40:28 +01:00
Dylan K. Taylor
e6cbdd090e Merge branch 'release/3.2' 2018-07-26 10:25:25 +01:00
Dylan K. Taylor
9a2845640b
Permissions management cleanup (#2332)
* Added a new PermissionManager, remove ridiculous cyclic dependencies of Permissions on Server

Aside from all the other ridiculous design problems with the permission system, the biggest problems are its API. This is, once again, a result of poor API design copied from Bukkit.

This pull request removes all permission-related functionality from `PluginManager` and moves it to the `pocketmine\permission\PermissionManager` class.

As can be observed from the removed code in the diff, the permissions system was previously entirely dependent on the Server, because it needed to get the PluginManager for registering permissions. This is utterly ridiculous. This refactor isolates _most_ permission-related functionality within the `permission` namespace.

As mentioned above, this stupid API is a direct result of copying from Bukkit. If you look at the API documentation for Bukkit for `PluginManager` you will see that the methods I'm deprecating here are also in there.

## Changes
- Added a new `PermissionManager` class. This can be accessed via its singleton `getInstance()` static method.
- Deprecated the following `PluginManager` methods - these will be removed no later than 4.0.0:
  - `getPermission()`
  - `addPermission()`
  - `removePermission()`
  - `getDefaultPermissions()`
  - `recalculatePermissionDefaults()`
  - `subscribeToPermission()`
  - `unsubscribeFromPermission()`
  - `getPermissionSubscriptions()`
  - `subscribeToDefaultPerms()`
  - `unsubscribeFromDefaultPerms()`
  - `getDefaultPermSubscriptions()`
  - `getPermissions()`
2018-07-26 10:21:41 +01:00
Dylan K. Taylor
98b34aaac8 Merge remote-tracking branch 'origin/release/3.2' 2018-07-25 15:51:39 +01:00
Dylan K. Taylor
706c620d04
Move Internet-related functions from Utils into their own class (#2324)
- Added `Internet::getIP()`, `Internet::getURL()`, `Internet::postURL()`, and `Internet::simpleCurl()`.
- Deprecated the corresponding functions in `Utils`. Updating to the new functions is as simple as replacing `Utils` with `Internet`, since this doesn't break backwards compatibility.

The deprecations should be catered for by plugin developers. These deprecated redirects will be removed no later than 4.0.0.
2018-07-25 15:51:18 +01:00
Dylan K. Taylor
c1843ac2d4 Player: remove dataPacket() and directDataPacket()
I considered renaming sendDataPacket() to dataPacket() to reduce the BC breaks, but the parameter set has changed, which might cause astonishing behaviour, so it's better to break it in a loud way. Also, this has a clearer name.
2018-07-22 12:04:53 +01:00
Dylan K. Taylor
85105ed066 Inseparable set of network changes - these all need each other to work
- Separated player handling and creation from network interfaces
- Rewire disconnects to make them not be recursive
- Batching now uses sessions instead of players
- Fixed DisconnectPacket getting sent to players who disconnect of their own accord
2018-07-21 20:03:05 +01:00
Dylan K. Taylor
3cd105ff33 Remove remnants of needACK functionality
this has been broken for a long time and hasn't been used for even longer.
2018-07-20 13:07:06 +01:00
Dylan K. Taylor
bdd9a7eb52 Kill BatchPacket, clean up batching related things
DataPacketSendEvent and DataPacketReceiveEvent will no longer capture BatchPackets
In most places strings are now used instead of DataPackets, to remove limitations on what data can be sent to a network interface
Removed CraftingManager's cyclic dependency on Server

There is a lot more work to do aside from this, but this commit is intended to clean up what is necessary to fix the handling of BatchPacket.
2018-07-20 12:36:44 +01:00