Commit Graph

13217 Commits

Author SHA1 Message Date
Dylan K. Taylor
66622defae PacketSerializer: fix merge error 2021-04-11 16:49:57 +01:00
Dylan K. Taylor
74d103a56f Merge remote-tracking branch 'origin/stable' 2021-04-11 16:36:39 +01:00
dependabot-preview[bot]
f74ff1fcd4 Bump adhocore/json-comment from 1.1.0 to 1.1.2 (#4158)
Bumps [adhocore/json-comment](https://github.com/adhocore/php-json-comment) from 1.1.0 to 1.1.2.
- [Release notes](https://github.com/adhocore/php-json-comment/releases)
- [Changelog](https://github.com/adhocore/php-json-comment/blob/main/CHANGELOG.md)
- [Commits](https://github.com/adhocore/php-json-comment/compare/1.1.0...1.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-04-11 16:03:41 +01:00
Dylan K. Taylor
6c351357ab NetworkBinaryStream: bail if finding unexpected trailing data on item extradata
this may help to discover additional bugs and/or missing data on items that we don't know about yet.
2021-04-11 16:02:41 +01:00
Dylan K. Taylor
0312b62c8a DataPacket no longer keeps its own serializer
since a while ago, we're anyway just discarding the internal buffer anyway when the packet is repeatedly encoded, so this doesn't serve any advantage anymore.
We do need a system to be able to reuse encoded packet buffers, but right now we're not reusing them anyway.
2021-04-09 15:37:58 +01:00
Dylan K. Taylor
19f536d68a ... 2021-04-07 21:54:21 +01:00
Dylan K. Taylor
1e6d97a157 Merge branch 'stable' 2021-04-07 21:25:39 +01:00
Dylan K. Taylor
540dadbda0 Merge commit 'e22b6ff5667534c6cdeef55913e46f973772663f' 2021-04-07 20:25:24 +01:00
Dylan K. Taylor
7aa336f5e4 Remove dead baseline 2021-04-07 19:44:00 +01:00
Dylan K. Taylor
7578bca006 Merge tag '3.18.2' 2021-04-07 19:41:57 +01:00
Dylan K. Taylor
3433406cff 3.19.1 is next 2021-04-07 19:03:36 +01:00
Dylan K. Taylor
b307cd0aa1 Release 3.19.0 3.19.0 2021-04-07 19:03:36 +01:00
Dylan K. Taylor
c9b83d7276 Protocol changes for 1.16.220 2021-04-07 18:59:01 +01:00
Dylan K. Taylor
e22b6ff566 Revert "Revert "Backport InventoryTransactionPacket impl from PM4""
This reverts commit c7cdaeae85.
2021-04-07 18:42:07 +01:00
Dylan K. Taylor
af88f49a21 3.18.3 is next 2021-04-07 18:32:14 +01:00
Dylan K. Taylor
599d5253db Release 3.18.2 3.18.2 2021-04-07 18:32:10 +01:00
Dylan K. Taylor
54cb5ee0fa ItemTranslator: ensure that the correct meta value is returned after translation
-1 is a PM-specific thing. Right now there is a hack in the NetworkBinaryStream which prevents this from becoming a problem, but that might not be the case in future.
2021-04-07 13:10:29 +01:00
Jitendra Adhikari
cdae8b42eb Bump adhocore/json-comment to ^1.1.0, new version strips trailing comma as well (#4146) 2021-04-06 11:58:23 +01:00
Ali
a45a4a91ae Call InventoryCloseEvent in Player::removeWindow() (#4142)
closes #4130
2021-04-04 01:07:58 +01:00
Dylan K. Taylor
21378b7f27 Regenerate PHPStan baselines
this should be the last time we get baselines randomly rearranging themselves on changes ...
2021-04-03 22:36:15 +01:00
Dylan K. Taylor
502aed41b0 phpstan 0.12.83 2021-04-03 22:34:48 +01:00
Dylan K. Taylor
1898d4b42c Fixed corner case with player spawning in ungenerated terrain
we can't get the safe spawn location of a set of coordinates if the coordinates are in an ungenerated chunk. This can happen if doing /setworldspawn <somewhere ungenerated> and then having a new player join the server.
2021-04-03 22:20:19 +01:00
Dylan K. Taylor
125837324f Player: don't dump cursor contents on mouseover interaction
this can fire while the player has the inventory window open, because it also gets sent when the player swaps their held itemstack for something new.

We already had a special-case for mouseover with entity ID 0, but since
this isn't just a zero problem, a more general fix suits better
(particularly since we might need to handle the 0 case anyway).

closes #4140
closes #4141
2021-04-02 21:35:38 +01:00
Ali
609dff1aae Player: Revert invalid attempts to toggle flight, instead of kicking (#4139)
If allowFlight was toggled by the server (e.g. due to gamemode change), a race could occur due to network latency where the client could try to enable flight, and then get kicked for cheating.

Since this can happen in legitimate, non-cheating cases, we can't make any assumptions about whether a player is cheating, so instead we just revert it, like we do with every other bad input.
2021-04-01 17:57:26 +01:00
Dylan K. Taylor
4eaa600f35 actions: clone submodules in PHPUnit job 2021-03-31 21:54:27 +01:00
Dylan K. Taylor
cd71fec53d fucking phpstorm 2020.3 and its broken autocomplete 2021-03-31 21:41:50 +01:00
Dylan K. Taylor
5e8078f3dd PacketSerializer: Improved performance of item serialize/deserialize 2021-03-31 21:39:55 +01:00
Dylan K. Taylor
b7a6c9dc17 Renamed BadPacketException -> PacketHandlingException
this better describes the intent, instead of just vaguely describing a packet as 'bad'.
2021-03-30 01:15:28 +01:00
Dylan K. Taylor
b03212053c 3.18.2 is next 2021-03-28 21:24:07 +01:00
Dylan K. Taylor
fd4ac885bb Release 3.18.1 3.18.1 2021-03-28 21:24:03 +01:00
Dylan K. Taylor
f35886f18a Updated composer dependencies 2021-03-28 21:14:02 +01:00
Dylan K. Taylor
25998720ce Fixed server crash on invalid gamemode in SetPlayerGameTypePacket
this really ought to be detected at the decode layer, but right now that's a bit difficult ...
2021-03-28 21:11:07 +01:00
Dylan K. Taylor
7fe6815f7c Merge branch 'stable' 2021-03-28 20:39:59 +01:00
Dylan K. Taylor
a9eaa55427 actions: added a php-cs-fixer run 2021-03-28 20:38:56 +01:00
Dylan K. Taylor
b032d49722 Merge branch 'stable' 2021-03-28 19:41:23 +01:00
Dylan K. Taylor
5c41f79be4 Added php-cs-fixer configuration
this is by no means a complete code style guide, but it fixes a lot of common issues that show up, particularly in PRs.
2021-03-28 19:21:41 +01:00
Dylan K. Taylor
34c2b62ffe Remove unused import 2021-03-28 19:12:18 +01:00
Dylan K. Taylor
e42a691da9 Strip trailing whitespace 2021-03-28 19:02:51 +01:00
Ali
3b3fb5e662 fix ItemFrames (#4101)
removing items from item frames was broken due to behavioural changes in 1.16.210.
2021-03-28 18:53:46 +01:00
Dylan K. Taylor
01ffe8bf57 Updated build/php submodule to pmmp/php-build-scripts@c64baa0f1c 2021-03-28 18:14:40 +01:00
Dylan K. Taylor
7139eccfbe Merge branch 'stable' 2021-03-28 18:11:53 +01:00
Dylan K. Taylor
4abf4aecad MainLogger: fixed potential deadlock during syncFlushBuffer()
the notify() to flush the buffer might arrive in between the writeLogStream() and synchronized() calls in the thread body, resulting in a deadlock if the logger thread managed to call wait() before the main thread did.
2021-03-28 18:10:23 +01:00
Dylan K. Taylor
d5549b72de ... 2021-03-27 00:08:23 +00:00
Dylan K. Taylor
9137666952 Fixed build 2021-03-26 22:57:21 +00:00
Dylan K. Taylor
06f20234f7 Scrub unused imports 2021-03-26 22:56:09 +00:00
Dylan K. Taylor
adbc58f326 TickingChunkLoader: use native return types 2021-03-26 22:55:48 +00:00
Dylan K. Taylor
cdeedbad8b Player: extract some entity spawning logic into a separate function 2021-03-26 22:51:56 +00:00
Dylan K. Taylor
de49a361c0 NetworkSession: Remove parameters from startUsingChunk() callback
these can easily be use()d into the closure (which also has slightly better performance, because no type checks - not that anyone will notice).
2021-03-26 22:45:36 +00:00
Dylan K. Taylor
49cf009017 Remove unused variable 2021-03-26 22:43:21 +00:00
Dylan K. Taylor
a223d1cbf3 NetworkSession: allow Player to handle its own business in chunk sending
these checks should appear consistently in all of these async callbacks.
2021-03-26 22:00:42 +00:00