40 Commits

Author SHA1 Message Date
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
b42966f61b network: explicitly specify @return void 2020-01-18 19:35:01 +00:00
Dylan K. Taylor
622f93df45 remove usages of deprecated {} string access, closes #3035 2019-07-22 16:39:33 +01:00
Dylan K. Taylor
60b183b0d9 backport a753c1342: Clean up Query cache handling, remove useless timeouts
the timeout was entirely useless, because:
- when shorter than 25.6 seconds (512 ticks) it would cause caches to be needlessly destroyed and regenerated
- when longer than 25.6 seconds, just made outdated caches persist for longer, even after the query info was regenerated.

This now uses a mark-dirty model to deal with caches, which means that plugin modifications to the query data will be reflected immediately, regardless of when they are made. Previously, modifying the result of Server->getQueryInformation() would have inconsistent results.
2019-06-16 16:08:27 +01:00
Dylan K. Taylor
eb161f8e1c Use base64 instead of hex to display binary in some places
base64 takes less space than hex, which is beneficial for logging larger payloads.
2019-06-06 14:43:20 +01:00
Dylan K. Taylor
5da48f429f Fixed some remaining one-line field declarations, added type docs 2019-02-05 14:03:27 +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
65e44364e5 Added some debug for raw packets and Query handling 2018-07-13 10:07:11 +01:00
Dylan K. Taylor
05af87e1d4 Strip empty lines at the end of classes 2018-06-11 13:19:23 +01:00
Dylan K. Taylor
c4c6c58615 Added some missing typehints 2018-06-10 17:18:55 +01:00
Dylan K. Taylor
5e91c05424 Server::getIp() now returns 0.0.0.0 if the IP string is empty 2018-05-10 10:25:44 +01:00
Dylan K. Taylor
d6d47feda9 Query: Send responses to the source interface only, instead of all the things
who the fuck wrote this shitty code?
2018-02-27 13:23:01 +00: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
51b0673b4b Bite the bullet and enable strict types on everything 2017-06-07 12:53:16 +01:00
Dylan K. Taylor
9004417456 Fixed file headers (#255) 2017-01-13 16:57:05 +00:00
SOF3
e913b16804
Fixed some lines indented with 4 spaces rather than tabs 2016-10-03 00:58:34 +08:00
SOF3
6fc435da0e
Imports rearrangement 2016-10-03 00:43:46 +08:00
Tux
8e9a078ff9 Use built-in random_bytes functionality 2016-09-06 11:47:58 +01:00
Shoghi Cervantes
51062940c5
Implemented QueryRegenerateEvent as base for other interfaces 2015-05-26 01:17:34 +02:00
Shoghi Cervantes
3b6e10b759
More langs :D 2015-04-11 14:59:15 +02:00
Shoghi Cervantes
8601405a88 Fixed CPU leak 2014-10-31 21:07:00 +01:00
Shoghi Cervantes
350cee3d41 Added Event allocation pool, updated SPL with Class::onClassLoaded() 2014-10-28 10:47:40 +01:00
Shoghi Cervantes
34946faf94 Remove errors from Utils::getRandomBytes() 2014-10-19 13:44:38 +02:00
Shoghi Cervantes
0b79d74a2f Implemented QueryRegenerateEvent 2014-10-07 11:02:05 +02:00
Shoghi Cervantes
eab86f5f90 Replaced array() with [] 2014-08-28 17:04:22 +02:00
Shoghi Cervantes
60ea4d0e96 Removed hardcoded Server name from source 2014-08-22 18:31:17 +02:00
Shoghi Cervantes
db7222976e Code cleanup 2014-08-21 17:26:41 +02:00
Shoghi Cervantes
2f9494ed52 Fixed crash caused by a race condition on Query 2014-08-15 16:07:04 +02:00
Shoghi Cervantes
1fab6bd589 Added settings.query-plugins setting 2014-07-10 17:24:12 +02:00
Shoghi Cervantes
e6c510e7fd Fixed #1595 Undefined variable on QueryHandler 2014-07-10 13:15:24 +02:00
Shoghi Cervantes
892119f791 Updated RakLib version, Query works again 2014-07-06 01:19:09 +02:00
Shoghi Cervantes
f073a5b837 Fixed a few things 2014-06-17 18:46:16 +02:00
Shoghi Cervantes
fa50cbf4b3 Working Threaded Generation 2014-06-10 20:45:09 +02:00
Shoghi Cervantes
7bd6f2ed91 Added Logger interface, threaded MainLogger and updated PluginLogger 2014-05-28 23:46:56 +02:00
Shoghi Cervantes
53749483c3 Implemented new Inventory windows on Player, Chest and Furnace 2014-05-23 20:53:06 +02:00
Shoghi Cervantes
c0de004472 Moved binary methods from Utils to Binary 2014-04-07 13:52:01 +02:00
Shoghi Cervantes
502c27273d Moved Level methods to Server 2014-04-02 02:58:20 +02:00
Shoghi Cervantes
7e9304a0c9 Formatting 2014-04-01 19:48:28 +02:00
Shoghi Cervantes
b4cc3bbd43 Added /op, /deop, /kick, OfflinePlayer, moved player list to Server instead of static Player 2014-04-01 19:46:48 +02:00
Shoghi Cervantes
dd17652aca Fixed wrong paths 2014-04-01 05:06:12 +02:00