Commit Graph

34 Commits

Author SHA1 Message Date
2e5ef4ba03 Merge remote-tracking branch 'origin/3.7' 2019-03-20 21:35:13 +00:00
cce99b07af 1.10.0 updates 2019-03-20 19:17:41 +00:00
cc78c9ef18 Merge branch '3.6' 2019-03-18 08:58:59 +00:00
1a8b33dafe AvailableCommandsPacket: Updated the ARG_TYPE constants
closes #2817
2019-03-18 08:58:07 +00:00
76f1ee1827 Add restrictions on packet send directions with interfaces
This prevents plugins sending wrong packets at the compiler level (or would, if we had a compiler). It's more robust than a getter for client/server and throwing an exception since a static analysis tool can detect faults created by sending wrong packets from the server. This is also used to deny service to dodgy clients which send wrong packets to the server to attack it.
2019-01-17 12:51:24 +00:00
fc98f4c42b Address more error cases, some minor cleanup 2019-01-16 21:30:31 +00:00
23269da1a6 Fixed the disaster of packet receive error handling 2019-01-16 19:53:48 +00:00
9c16caf27b Fixed an edge-case in AvailableCommandsPacket decoding 2019-01-07 22:23:51 +00:00
adc1069ed2 Merge branch '3.5' 2019-01-04 23:28:44 +00:00
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
90482e79bc Merge branch 'release/3.4' 2018-10-21 18:23:54 +01:00
45c9caa38c Fixup some formatting issues 2018-10-21 18:15:25 +01:00
f830eddd59 Merge branch 'mcpe-1.6' into mcpe-1.6-master 2018-08-21 17:55:48 +01:00
566f3c6262 AvailableCommandsPacket: stricter decode and handling 2018-08-21 17:14:54 +01:00
0d05dcec08 AvailableCommandsPacket: deal with dynamic enums
somehow I missed this, thanks @NiclasOlofsson for pointing it out
2018-08-21 17:14:53 +01:00
64ecc373be Split up session base logic and packet handling
this will allow for mutable packet handlers which can be used to cleanly implement multi-stage game sessions.
2018-07-20 12:36:44 +01:00
2bba3a0805 Apply typehints to pocketmine\network\mcpe\protocol namespace
this is pulled from network-nuke in order to reduce the size of the diff.
2018-07-05 13:19:15 +01:00
05af87e1d4 Strip empty lines at the end of classes 2018-06-11 13:19:23 +01:00
c7544c1d25 AvailableCommandsPacket: update arg types 2018-05-02 12:03:29 +01:00
4f8e4f0522 Add EOF newlines where missing (bulk) (#1836)
This should solve issues with people making GitHub PRs and having the web editor messing things up. GitHub Web Editor sucks :(
2017-12-20 11:56:36 +00:00
f477cfa1bf Fixed a mistake in AvailableCommandsPacket 2017-11-25 11:15:20 +00:00
1fd9994056 Merge branch 'master' into mcpe-1.2.5 2017-11-21 16:48:18 +00:00
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
784ecef805 Remove unnecessary count() 2017-11-08 19:44:10 +00:00
41f363d0c1 Added encode for AvailableCommandsPacket, bring back command lists (no arguments yet) 2017-11-08 11:52:06 +00:00
8d0b881762 fixed command arg types 2017-09-10 13:56:34 +01:00
0eb866bf25 Updated AvailableCommandsPacket 2017-09-09 14:23:19 +01:00
1576a79644 more packets 2017-08-13 17:43:33 +01:00
7886918140 Cleaned up some bad code in DataPacket, added encode/decodeHeader and made encode/decodePayload protected 2017-08-06 17:21:51 +01:00
2726f2a011 Solved packet encode/decode boilerplate code issue
Something as simple as forgetting the reset() when encoding would cause lots of problems which could go unnoticed. This should be fully backwards-compatible but needs more tests.
2017-07-07 13:59:09 +01:00
51b0673b4b Bite the bullet and enable strict types on everything 2017-06-07 12:53:16 +01:00
22ba017965 Binary strict types (#969)
* Some Binary cleanup, type-hints and strict types
yes, I know this is very crashy... that's good, because it highlights unexpected behaviour

* added some default values
2017-06-03 09:39:45 +01:00
0a4d62b405 Added encode and decode methods for more packets 2017-05-15 15:56:59 +01:00
56990eb28b MCPE protocol gets its own namespace 2017-03-08 20:28:39 +00:00