47 Commits

Author SHA1 Message Date
Dylan K. Taylor
ae497a828f Merge branch 'release/3.5' 2018-12-30 17:33:31 +00:00
Dylan K. Taylor
daf56e990b Get rid of some network-layer asserts
NEVER assert on user data. 🤦
2018-12-30 12:42:52 +00:00
Dylan K. Taylor
e92aac847c Merge branch 'release/3.5' 2018-12-13 09:56:54 +00:00
Dylan K. Taylor
1d71f5edb3 DataPacket: more detail in error messages for undefined fields 2018-12-13 09:55:50 +00:00
Dylan K. Taylor
1a6db1c7ce DataPacket: add missing field
this must have been missing for how many years now? thanks @shoghicp

this is why we don't do releases on friday night... in my defence my device had the beta installed...
2018-12-01 09:29:53 +00:00
Dylan K. Taylor
c46475ac4a Merge branch 'release/3.4' 2018-11-30 19:28:06 +00:00
Dylan K. Taylor
4c08a05fae Barf on trying to read/write nonexisting fields of packets
this should make it easier to debug problems when content of packets changes during protocol updates.
2018-11-30 18:36:28 +00:00
Dylan K. Taylor
f830eddd59 Merge branch 'mcpe-1.6' into mcpe-1.6-master 2018-08-21 17:55:48 +01:00
Dylan K. Taylor
986077e03c Protocol changes for 1.6.0.1 2018-08-21 17:14:53 +01:00
Dylan K. Taylor
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
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
Dylan K. Taylor
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
Dylan K. Taylor
e56e363dcc DataPacket: rename split-screen bytes 2018-01-31 12:07:26 +00:00
Dylan K. Taylor
2eb6e075ae
Refactored entity metadata handling into its own class, with type-safe methods (#1876)
This includes several other changes, including:
- SLOT data properties now accept items directly
- POS data properties now accept floored Vector3s (in future this will be block positions) or null for 0,0,0
- VECTOR3F data properties now accept Vector3s or null for 0,0,0
2018-01-20 10:52:14 +00:00
Dylan K. Taylor
e6bd12dc2f Consolidated MCPE network binary handling methods into one class, remove protocol-specific methods from BinaryStream
Remove MCPE-network specific stuff from BinaryStream, added NetworkBinaryStream
This removes dependencies of BinaryStream on core code, while providing some consolidation of network handling code.
2018-01-11 12:28:56 +00:00
Dylan K. Taylor
1fd9994056 Merge branch 'master' into mcpe-1.2.5 2017-11-21 16:48:18 +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
8d07f833fc updated CommandRequestPacket 2017-11-01 20:11:31 +00:00
Dylan K. Taylor
bd2cb85861 changed type of EntityLink unknown field and added a constructor 2017-10-25 18:50:07 +01:00
Dylan K. Taylor
eccc7bf7b3 Moved EntityLink to its own type 2017-10-09 19:15:53 +01:00
Dylan K. Taylor
ccbdb77618 Cleaned up LoginPacket handling, don't nuke the buffer 2017-09-26 09:49:35 +01:00
Dylan K. Taylor
445a67954d Merge changes from master 2017-08-22 14:13:31 +01:00
Dylan K. Taylor
876659cc73 Item factory refactor and added capability to register custom items 2017-08-21 17:49:26 +01:00
Dylan K. Taylor
9be1b929a5 Added PhpDoc for packet field types and changed float x,y,z to Vector3 2017-08-13 20:02:07 +01:00
Dylan K. Taylor
7958fffa07 Move some code around to fix block placing, breaking, and throwing snowballs 2017-08-07 12:28:07 +01:00
Dylan K. Taylor
d9da9accbc Fix packet buffers when encoding twice 2017-08-06 17:21:52 +01:00
Dylan K. Taylor
7886918140 Cleaned up some bad code in DataPacket, added encode/decodeHeader and made encode/decodePayload protected 2017-08-06 17:21:51 +01:00
Dylan K. Taylor
63d2b341b9 Day 2 2017-08-06 17:21:51 +01:00
Dylan K. Taylor
77cd8e7799 More broken mess to spawn 1.2 2017-08-06 17:21:51 +01:00
Dylan K. Taylor
8a02dbb15a fix crash when var_dumping packets 2017-08-03 08:47:10 +01:00
Dylan K. Taylor
3a214b7ce6 Cleaned up isEncoded mess 2017-07-13 12:21:26 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
ecfcf49984 Added basic encode/decode for gamerules data and added GameRulesChangedPacket
needed it for tests

Squashed:

oops

PhpStorm you asshole
2017-06-25 15:43:08 +01:00
Dylan K. Taylor
c0377fc63a more typehints, removed more 32-bit leftovers 2017-06-25 11:40:12 +01:00
Dylan K. Taylor
78c09267e5 Typehinted things in BinaryStream, sorted some methods and related bugfixes 2017-06-07 13:53:10 +01:00
Dylan K. Taylor
2b02fcfe2c fixed #992 2017-06-04 16:54:35 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
e4e4ef5f2a Fixed preprocessor issues with signed bytes and floats, close #967 2017-06-02 12:50:48 +01:00
Dylan K. Taylor
57379b93ce Fixed a mistake in metadata decoder 2017-05-27 14:18:40 +01:00
Dylan K. Taylor
c51c8ae700 Standardised attributes encoding 2017-05-10 10:48:53 +01:00
Dylan K. Taylor
84ec944b6b Use short class names for unhandled packet logging, added some documentation 2017-04-27 12:16:24 +01:00
Dylan K. Taylor
07f32765ba Merge branch 'api3/network_mcpe-1.0.5' into api3/network 2017-03-26 18:52:30 +01:00
Dylan K. Taylor
788bd6fc20 Fixed resource packs/login sequence fail, added basic safety restrictions for packet sending before clients are logged in
close #452
2017-03-26 14:42:23 +01:00
Dylan K. Taylor
6f1b12b021 Added new 1.0.5 packets 2017-03-11 19:58:32 +00:00
Dylan K. Taylor
295d9bc80b Cleaned up muddled varint/varlong mess, added separate methods for entity unique and runtime ids, moved some MCPE-protocol-specific methods out of BinaryStream 2017-03-08 20:29:24 +00:00
Dylan K. Taylor
ea0f291cb5 Added class method DataPacket->canBeBatched() 2017-03-08 20:28:40 +00:00
Dylan K. Taylor
56990eb28b MCPE protocol gets its own namespace 2017-03-08 20:28:39 +00:00