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
7b55c984bf
InGamePacketHandler: reduce debug noise on outdated movements
2023-04-07 21:40:46 +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
ea386c42d3
InGamePacketHandler: fixed dropping items from unselected hotbar slots
2023-03-21 14:45:18 +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
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
ca6d51498f
Buffer slot and content syncing until the end of the tick
...
we may receive multiple requests in one tick (e.g. crafting in a batch)
2023-03-20 19:16:00 +00:00
Dylan K. Taylor
c91168db66
...
2023-03-20 01:35:15 +00:00
Dylan K. Taylor
4e55433ed8
Fixed request rejecting
2023-03-20 01:35:03 +00:00
Dylan K. Taylor
eece6c4433
InGamePacketHandler: remove dead code
2023-03-20 01:28:18 +00:00
Dylan K. Taylor
804feedb67
Added some dumb limits
2023-03-20 00:54:33 +00:00
Dylan K. Taylor
7b0816e42f
Properly handle transaction building errors instead of kicking the player
2023-03-20 00:52:26 +00:00
Dylan K. Taylor
34ced382db
Eliminate final remaining usage of TypeConverter::netItemStackToCore()
...
instead, we can verify that the held items match by comparing the received ItemStack with the one cached in InventoryManager, which is more cost effective and closes off internal item deserializers to external attacks.
2023-03-14 22:56:11 +00:00
Dylan K. Taylor
a573a279fa
Merge branch 'minor-next' into item-stack-request
2023-03-14 22:25:49 +00:00
Dylan K. Taylor
475888b031
InGamePacketHandler: do not process repeated skin change requests for the same full skin ID
...
this fixes a feedback loop with persona skins in 1.19.60.
2023-02-08 20:16:41 +00:00
Dylan K. Taylor
40b90bb722
InGamePacketHandler: log a debug when processing skin change requests
2023-02-08 19:47:12 +00:00
Dylan K. Taylor
ad6a423d12
Merge branch 'stable' into next-minor
2023-01-16 18:30:13 +00:00
Dylan K. Taylor
7e16f9be8f
InGamePacketHandler: handle block actions before use item transactions
...
the START_BREAK and transaction to break the block may arrive in the same packet, causing events to be fired in the wrong order.
fixes #5490
2023-01-16 17:50:11 +00:00
Dylan K. Taylor
ece49f011c
Merge branch 'stable' into next-minor
2023-01-06 01:50:17 +00:00
Dylan K. Taylor
5d6dba96af
Merge branch 'stable' into item-stack-request
2023-01-06 01:47:27 +00:00
Dylan K. Taylor
3baa5ab712
InGamePacketHandler: removed obsolete workaround
2023-01-06 00:41:57 +00:00
Dylan K. Taylor
b24eb153f9
Constrain inventory transaction predictions
...
these are now only used for actions done with a closed inventory window. This means that they can only predict the slots of inventory, offhand and armor (total 41 slots) and perhaps include some DropItem actions.
2023-01-05 21:18:30 +00:00
Dylan K. Taylor
eedc943766
Confine legacy transaction handling to dropping items only
2023-01-05 17:23:50 +00:00
Dylan K. Taylor
5fdbb19852
Fixed a whole bunch of issues with legacy transactions
2023-01-04 00:13:51 +00:00
Dylan K. Taylor
d8d236842f
Fixed merge error
2023-01-03 19:54:41 +00:00
Dylan K. Taylor
f51717323b
Merge branch 'stable' into item-stack-request
2023-01-03 19:53:25 +00:00
Dylan K. Taylor
0e4b79ea77
InGamePacketHandler: fixed client-side predictions not getting rolled back for block placementÂ
2023-01-03 19:43:21 +00:00
Dylan K. Taylor
b312e93176
Limit list max size in transactions
...
this duct tape is to limit the impact of a security vulnerability being actively exploited.
2023-01-02 22:59:48 +00:00
Alexey
0d31b25fba
Use str_starts_with and str_contains instead of strpos ( #5482 )
2022-12-30 21:41:30 +00:00
Dylan K. Taylor
bf44edd179
Constify a bunch of NBT keys, pass 1
2022-12-18 22:12:15 +00:00
Dylan K. Taylor
1cefe24414
InGamePacketHandler: fixed transaction predictions not getting rolled back for failed use/release/interact transactions
...
this was caused by b5cfab497dc75ff884b5d91831d5a2f7a5016d99.
2022-12-10 21:16:08 +00:00
Dylan K. Taylor
b5cfab497d
Clean up inventory content syncing, fixes #5441
...
these remnants should have been cleaned up in 4.11, but I somehow managed to skip over them.
2022-12-04 23:05:30 +00:00
Dylan K. Taylor
0039af984d
Merge branch 'next-minor' into item-stack-request
2022-10-16 16:56:26 +01:00
Dylan K. Taylor
89e29448ee
Merge branch 'stable' into next-minor
2022-09-20 20:18:06 +01:00
Dylan K. Taylor
d459afaa54
fix CS
2022-09-20 20:00:40 +01:00
Dylan K. Taylor
db586233da
Changes for 1.19.30 support
2022-09-20 19:50:27 +01:00
Dylan K. Taylor
3235d128e5
Fixed handling of fake requests during block placement and other actions
2022-08-18 18:25:49 +01:00
Dylan K. Taylor
2b7510945a
First look at ItemStackRequest usage (very unstable)
2022-08-18 17:38:57 +01:00
Dylan K. Taylor
f7ab0a3b92
Merge branch 'stable' into next-minor
2022-08-14 18:37:56 +01:00
Dylan K. Taylor
df7a1fcba6
Changes for 1.19.20
2022-08-09 19:06:05 +01:00
Dylan K. Taylor
16ed16722a
Merge branch 'stable' into next-minor
2022-07-24 21:21:37 +01:00
Dylan K. Taylor
5d9f783037
InGamePacketHandler: do not update player rotation if it didn't change
...
setRotation() does an alarmingly large amount of work...
2022-07-24 21:07:35 +01:00
Dylan K. Taylor
01ca14c314
InGamePacketHandler: avoid processing movement if position is unchanged since last tick
2022-07-24 21:00:12 +01:00
Dylan K. Taylor
c26631d06d
InGamePacketHandler: avoid useless object allocations when forceMoveSync=false (99.9% of the time)
2022-07-24 20:44:27 +01:00
Dylan K. Taylor
b75bc61a64
InGamePacketHandler: don't bother checking for flag changes if the flag fields are identical
...
we don't need to check this on a bit by bit level if the integers are the same.
this saves 2-3 microseconds per packet on my machine, which doesn't sound like much, but it adds up when there are lots of players.
2022-07-24 20:35:49 +01:00
Dylan K. Taylor
3724479be3
InGamePacketHandler: improve performance of input flag resolving
2022-07-24 20:33:35 +01:00
Dylan K. Taylor
e00f8e3a32
Merge branch 'stable' into next-minor
2022-07-14 20:59:06 +01:00