Dylan K. Taylor
a4f2b99ed5
InGamePacketHandler: queue slots for syncing if they appear in requestChangedSlots
...
this is essentially a prediction without the actual predicted item. We have to sync these regardless of what happens.
fixes #5708
2023-04-24 14:06:29 +01:00
Dylan K. Taylor
3ecc980bc4
ÂInventoryManagerEntry: fixed incorrect PHPDoc type
2023-04-24 13:42:11 +01:00
Dylan K. Taylor
107b56154b
ItemStackRequestExecutor: fixed stonecutter recipes
...
this uses the same dodgy hack used by CraftingTransaction, which assumes that getResultsFor() does not care about the crafting inputs.
While this is currently OK, since none of the currently-implemented recipes care about inputs anyway, it will become a problem when we implement shulker box recipes, so this needs to be addressed.
However, it can't be addressed without BC breaks, so this will have to be dealt with in PM5.
closes #5715
2023-04-24 13:35:00 +01:00
Dylan K. Taylor
c878bd8289
Merge remote-tracking branch 'origin/minor-next' into major-next
2023-04-20 00:18:19 +01:00
Dylan K. Taylor
a77fc8109f
TypeConverter: avoid repeated calls to getId() and getMeta()
2023-04-18 15:02:52 +01:00
Dylan K. Taylor
6102740ee3
TypeConverter: use a less slow hack to restore meta values on items sent by the client
...
this isn't even really needed anymore, since we don't decode items from the client since 4.18.
However, this may still be useful for tools.
2023-04-18 15:00:34 +01:00
Dylan K. Taylor
40168a457e
TypeConverter: fixed coreItemStackToNet() causing item NBT to be prepared twice
...
hasNamedTag() calls getNamedTag(), which calls serializeCompoundTag(), which writes the item's properties into the given NBT tag.
2023-04-18 14:43:25 +01:00
Dylan K. Taylor
d07acd0013
RakLibInterface: split error ID into 4-character chunks
...
this makes it easier to read, since the error ID can't be copy-pasted from the disconnection screen on the client.
2023-04-17 14:05:46 +01:00
Dylan K. Taylor
499b29b53a
Merge branch 'minor-next' into major-next
2023-04-12 21:04:08 +01:00
Dylan K. Taylor
18b528f72d
ItemStackRequestExecutor: fixed borked taking of created items
...
closes #5695
2023-04-12 21:01:46 +01:00
Dylan K. Taylor
a0dadc6e37
Merge branch 'minor-next' into major-next
2023-04-10 14:38:23 +01:00
Dylan K. Taylor
9e9b4db00f
Merge branch 'stable' into minor-next
2023-04-10 14:32:33 +01:00
Dylan K. Taylor
017fcde6aa
always the CS...
2023-04-10 13:56:53 +01:00
Dylan K. Taylor
24374297e7
NetworkSession: extract rate limiting functionality into its own unit, and apply a separate rate limit to game packets
2023-04-10 13:53:22 +01:00
Dylan K. Taylor
7b55c984bf
InGamePacketHandler: reduce debug noise on outdated movements
2023-04-07 21:40:46 +01:00
Dylan K. Taylor
61b0ad3e7f
PreSpawnPacketHandler: added dedicated timer for the humongous amount of crap that has to be sent pre-spawn
2023-04-05 20:58:49 +01:00
Dylan K. Taylor
7e1467f3f7
Merge branch 'minor-next' into major-next
2023-04-05 20:14:59 +01:00
Dylan K. Taylor
2936726bf8
Fixed packets sent by EntityEventBroadcaster not firing DataPacketSendEvent
...
closes #5670
I'm not super happy with this fix, since it can still be broken if StandardPacketBroadcaster is replaced by something else. However, fixing that problem is probably going to require internal BC breaks, which are not suitable for a patch release.
2023-04-03 22:46:14 +01:00
Dylan K. Taylor
9cd07f6721
NetworkBroadcastUtils: remove dead code
...
we don't allow changing the target list anymore, since it increases internal complexity, so this code is redundant.
2023-04-03 22:37:22 +01:00
Dylan K. Taylor
4bb8daa1a5
ItemStackRequestExecutor: allow any action to take from the created output slot
...
fixes #5679
2023-04-03 22:24:40 +01:00
Dylan K. Taylor
d731f5485a
Merge branch 'minor-next' into major-next
2023-03-31 21:29:42 +01:00
Dylan K. Taylor
a862cf5144
Workaround ItemStackRequest offhand incorrect slot bug
...
closes #5667
this appears to be a client bug specific to ItemStackRequest.
2023-03-31 17:27:11 +01:00
Dylan K. Taylor
09bff60b04
Merge branch 'minor-next' into major-next
2023-03-29 23:57:19 +01:00
Dylan K. Taylor
c3a16d9b1f
ItemStackResponseBuilder: fixed durability appearing to reset when moving durables around the inventory
...
closes #5656
2023-03-29 23:31:46 +01:00
Dylan K. Taylor
10f3145af2
Merge branch 'minor-next' into major-next
2023-03-29 23:22:02 +01:00
Dylan K. Taylor
af385668c2
InventoryManager: give more detailed information on failure to get info for held item
2023-03-27 17:55:39 +01:00
Dylan K. Taylor
3ee62d8440
InGamePacketHandler: increase max ItemStackRequest actions to 60
...
due to implementation quirks + some unforeseen ways these actions can behave, there can be as many as 53 actions in a single crafting request. This is an edge case, but it has to be catered for.
2023-03-27 15:44:42 +01:00
Dylan K. Taylor
811639f2cd
InGamePacketHandler: relax errors on normal transactions to fix book editing
...
for some reason book edits generate a transaction in addition to BookEditPacket. PM has never used the transaction, and it doesn't pass anyway because CreateItemAction can't be used in survival mode.
However, since the strict validation introduced since ItemStackRequest, this dud transaction now causes the player to get kicked without these changes.
2023-03-27 13:26:26 +01:00
Dylan K. Taylor
58974765a6
InGamePacketHandler: fixed crash when attempting to drop more of an item than is available
2023-03-27 13:26:26 +01:00
Dylan K. Taylor
006cdaf6ea
RakLibInterface: log the name of the session which triggered an unhandled exception
...
this makes it easier to identify what sequence of events led up to the crash.
2023-03-26 18:56:24 +01:00
Dylan K. Taylor
0220a30780
Merge branch 'minor-next' into major-next
2023-03-25 20:26:59 +00:00
Dylan K. Taylor
58d5126ada
InventoryManager: fixed crashes when setting contents or slots of inventories during InventoryCloseEvent (and other similar logic)
2023-03-24 13:31:30 +00:00
Dylan K. Taylor
3b11191043
Merge remote-tracking branch 'origin/minor-next' into major-next
2023-03-22 22:49:22 +00:00
Dylan K. Taylor
f978c1e9a0
Merge remote-tracking branch 'origin/stable' into minor-next
2023-03-22 22:45:41 +00:00
Dylan K. Taylor
b11457d605
Fixed uncaught exception when retrieving a packet from the pool
2023-03-22 22:24:25 +00:00
Dylan K. Taylor
ea386c42d3
InGamePacketHandler: fixed dropping items from unselected hotbar slots
2023-03-21 14:45:18 +00:00
Dylan K. Taylor
1a9322c00a
ItemStackRequestExecutor: added some missing @throws
2023-03-21 00:23:31 +00:00
Dylan K. Taylor
c8d9477da1
ItemStackRequestExecutor: make non-final, and make some stuff protected
...
this allows for plugin extension, for example to implement anvils.
2023-03-21 00:22:21 +00:00
Dylan K. Taylor
08e8ef275f
remove comment
2023-03-21 00:17:24 +00:00
Dylan K. Taylor
e57fbff28c
ItemStackRequestExecutor: added a sanity check for recipe repetitions
2023-03-21 00:16:03 +00:00
Dylan K. Taylor
f90315c4a2
ItemStackRequestExecutor: harden against invalid item counts
...
these cases should all be impossible, but that's assuming that the core code doesn't start using them for a different purpose in the future.
2023-03-21 00:13:21 +00:00
Dylan K. Taylor
955f7944bb
ItemStackRequestExecutor: fixed another possible crash condition
2023-03-21 00:06:33 +00:00
Dylan K. Taylor
ccd288d7fa
Avoid repeated calls to getItemInHand() in drop item handler
2023-03-21 00:04:29 +00:00
Dylan K. Taylor
097632902a
InGamePacketHandler: fixed crash condition in drop item handler
2023-03-21 00:02:32 +00:00
Dylan K. Taylor
a4d34be6df
Merge branch 'minor-next' into major-next
2023-03-20 23:42:40 +00:00
Dylan K. Taylor
e7771d76f2
Cover buffered inventory sync in timings
2023-03-20 23:29:02 +00:00
Dylan K. Taylor
ecc830a689
InventoryManager: avoid calling TypeConverter::getInstance() in a loop
2023-03-20 23:24:52 +00:00
Dylan K. Taylor
ee72e80fbb
ItemStackResponseBuilder: removed incorrect code
...
the client expects that all itemstacks must be acked by ItemStackResponse, regardless of whether the server changed them to some other item.
We'll overwrite the item to the correct thing at the end of the tick anyway.
2023-03-20 23:21:24 +00:00
Dylan K. Taylor
63310cf764
Do not cache ItemStacks for every item
...
this is very memory inefficient, and only provides a performance advantage in cold code anyway.
2023-03-20 23:18:43 +00:00
Dylan K. Taylor
1992d3b6db
InventoryManager: avoid useless work in trackItemStack()
...
this attempts to accommodate slots being set to themselves, which is a rare enough occurrence (only plugins will cause it) that it doesn't make sense to penalize every inventory update this way.
attempting to avoid changing the itemstackID in this way is detrimental to performance, and it doesn't actually matter if we set a new itemstackID anyway.
2023-03-20 23:08:17 +00:00