30 Commits

Author SHA1 Message Date
Dylan K. Taylor
0537c66849 populate missing array value types in scheduler namespace 2020-01-30 21:19:15 +00:00
Dylan K. Taylor
f624871b3f strip extra blank lines (php-cs-fixer) 2020-01-22 14:50:29 +00:00
Dylan K. Taylor
c4793241f5 Mass removal of useless @param/@return PHPDoc annotations, pass 1 2020-01-21 15:10:18 +00:00
Dylan K. Taylor
1eedac87b2 added missing @var property types (reported by phpstan) 2020-01-09 14:13:54 +00:00
Dylan K. Taylor
4b9a142a5d Import global functions and constants for enhanced performance
This is better for performance because these then don't need to be reevaluated every time they are called.

When encountering an unqualified function or constant reference, PHP will first try to locate a symbol in the current namespace by that name, and then fall back to the global namespace.
This short-circuits the check, which has substantial performance effects in some cases - in particular, ord(), chr() and strlen() show ~1500x faster calls when they are fully qualified.

However, this doesn't mean that PM is getting a massive amount faster. In real world terms, this translates to about 10-15% performance improvement.
But before anyone gets excited, you should know that the CodeOptimizer in the PreProcessor repo has been applying fully-qualified symbol optimizations to Jenkins builds for years, which is one of the reasons why Jenkins builds have better performance than home-built or source installations.
We're choosing to do this for the sake of future SafePHP integration and also to be able to get rid of the buggy CodeOptimizer, so that phar and source are more consistent.
2019-01-04 20:43:15 +00:00
Dylan K. Taylor
046c39b02e Remove some Throwable abuse in AsyncTasks 2018-11-04 22:15:06 +00: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
80daaf09b2 SendUsageTask: fixed oops x2 (thanks PhpStorm)
looks like this file was somehow missed during the refactor.
2018-06-18 12:08:55 +01:00
Dylan K. Taylor
da6439e3f4 SendUsageTask: fixed oops 2018-06-17 16:13:05 +01:00
Dylan K. Taylor
74b074753f Bulk addition of constant visibilities
thanks PhpStorm inspections plugin for annoying the shit out of me until
I did this.
2017-11-21 14:44:10 +00:00
Dylan K. Taylor
8fc1501e89 Moar typehints 2017-07-14 08:52:27 +01:00
Dylan K. Taylor
e18a3ac933 Fixed UUID-related issues 2017-06-07 13:11:03 +01:00
Dylan K. Taylor
51b0673b4b Bite the bullet and enable strict types on everything 2017-06-07 12:53:16 +01:00
Dylan K. Taylor
56990eb28b MCPE protocol gets its own namespace 2017-03-08 20:28:39 +00:00
SOFe
58ff381557 PhpStorm automated formatting (#11)
* PhpStorm reformatting

* Tuned PhpStorm reformatting

* Improved ItemIds and BlockIds formatting

* Tuned more PhpStorm reformatting

* Improved string concatenation
2016-10-03 19:05:48 +08:00
Shoghi Cervantes
0bcf639a98 Changed how exceptions work and are logged, throw proper exceptions on tasks 2015-09-18 12:03:24 +02:00
Shoghi Cervantes
8768b7fdbd Merge remote-tracking branch 'origin/mcpe-0.12' into php7 2015-09-17 12:25:05 +02:00
Shoghi Cervantes
ed559fdf98 Fixed not sending UUIDs properly 2015-09-15 12:23:15 +02:00
Shoghi Cervantes
3ffdb8e552 Removed @deprecated classes, methods and properties, added some type hints 2015-09-12 17:10:11 +02:00
Shoghi Cervantes
e137ac4c56 Base PHP7 work to make it "run" - READ NEXT LINES!
All plugins will need to bump the API if they want to use this.
NOTE THAT THIS IS NOT THE FINAL API 2.0.0 AND THAT THERE WILL BE MORE CHANGES.
To start updating, you might also want to read https://secure.php.net/manual/en/migration70.php and specifically https://secure.php.net/manual/en/migration70.incompatible.php

To compile PHP7 with some of the required dependencies, use https://gist.github.com/shoghicp/166ab26ce5cc7a390f45
ONLY LINUX IS TESTED, DO NOT ASK FOR OTHER PLATFORMS!

----- THIS VERSION IS NOT SUPPORTED -----

This version WILL crash randomly in unexpected places due to PHP7, pthreads, PocketMine or cosmic rays.

Handle with care, and store under direct sunlight for the best performance.
2015-09-10 21:29:29 +02:00
Shoghi Cervantes
5621ab0c49 Updated some packets for 0.12, UUIDs, other stuff! 2015-08-02 01:22:36 +02:00
Shoghi Cervantes
33e312c7d0
Added extra memory reportings (heap, stack), stop tasks faster, added extra timeouts fro ServerKiller 2015-06-13 15:37:02 +02:00
Shoghi Cervantes
cfe5ca91b2
Updated endpoint 2015-05-21 16:31:42 +02:00
Shoghi Cervantes
46f20d36b3
Improved unique id generation for server 2015-05-21 12:59:33 +02:00
Shoghi Cervantes
cde2d39029
New statistics system 2015-05-21 11:41:11 +02:00
Shoghi Cervantes
074c8b876d
Cleaned up code 2015-01-03 16:07:49 +01:00
Shoghi Cervantes
692045d714
Improved threading and resource usage, new defaults 2015-01-02 18:46:39 +01:00
Shoghi Cervantes
873e35f416 Fixed SendUsageTask 2014-06-25 13:06:44 +02:00
Shoghi Cervantes
80f9093875 Added /reload command (does not reload source code) 2014-04-03 15:49:00 +02:00
Shoghi Cervantes
0f42cd9243 Added Asynchronous tasks, usage sending 2014-04-02 20:20:14 +02:00