mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 03:51:37 +00:00
maybe don't make a mess?
This commit is contained in:
@@ -111,7 +111,6 @@ use pocketmine\promise\PromiseResolver;
|
|||||||
use pocketmine\Server;
|
use pocketmine\Server;
|
||||||
use pocketmine\timings\Timings;
|
use pocketmine\timings\Timings;
|
||||||
use pocketmine\utils\AssumptionFailedError;
|
use pocketmine\utils\AssumptionFailedError;
|
||||||
use pocketmine\utils\Binary;
|
|
||||||
use pocketmine\utils\BinaryDataException;
|
use pocketmine\utils\BinaryDataException;
|
||||||
use pocketmine\utils\BinaryStream;
|
use pocketmine\utils\BinaryStream;
|
||||||
use pocketmine\utils\ObjectSet;
|
use pocketmine\utils\ObjectSet;
|
||||||
@@ -497,6 +496,9 @@ class NetworkSession{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string $noisyPacketBuffer = "";
|
||||||
|
private int $noisyPacketsDropped = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws PacketHandlingException
|
* @throws PacketHandlingException
|
||||||
*/
|
*/
|
||||||
|
@@ -117,6 +117,7 @@ use function is_nan;
|
|||||||
use function json_decode;
|
use function json_decode;
|
||||||
use function max;
|
use function max;
|
||||||
use function mb_strlen;
|
use function mb_strlen;
|
||||||
|
use function microtime;
|
||||||
use function sprintf;
|
use function sprintf;
|
||||||
use function str_starts_with;
|
use function str_starts_with;
|
||||||
use function strlen;
|
use function strlen;
|
||||||
@@ -128,6 +129,9 @@ use const JSON_THROW_ON_ERROR;
|
|||||||
class InGamePacketHandler extends PacketHandler{
|
class InGamePacketHandler extends PacketHandler{
|
||||||
private const MAX_FORM_RESPONSE_DEPTH = 2; //modal/simple will be 1, custom forms 2 - they will never contain anything other than string|int|float|bool|null
|
private const MAX_FORM_RESPONSE_DEPTH = 2; //modal/simple will be 1, custom forms 2 - they will never contain anything other than string|int|float|bool|null
|
||||||
|
|
||||||
|
protected float $lastRightClickTime = 0.0;
|
||||||
|
protected ?UseItemTransactionData $lastRightClickData = null;
|
||||||
|
|
||||||
protected ?Vector3 $lastPlayerAuthInputPosition = null;
|
protected ?Vector3 $lastPlayerAuthInputPosition = null;
|
||||||
protected ?float $lastPlayerAuthInputYaw = null;
|
protected ?float $lastPlayerAuthInputYaw = null;
|
||||||
protected ?float $lastPlayerAuthInputPitch = null;
|
protected ?float $lastPlayerAuthInputPitch = null;
|
||||||
@@ -494,7 +498,7 @@ class InGamePacketHandler extends PacketHandler{
|
|||||||
|
|
||||||
$blockPos = $data->getBlockPosition();
|
$blockPos = $data->getBlockPosition();
|
||||||
$vBlockPos = new Vector3($blockPos->getX(), $blockPos->getY(), $blockPos->getZ());
|
$vBlockPos = new Vector3($blockPos->getX(), $blockPos->getY(), $blockPos->getZ());
|
||||||
$this->player->interactBlock($vBlockPos, $data->getFace(), $data->getClickPosition());
|
$this->player->interactBlock($vBlockPos, $data->getFace(), $clickPos);
|
||||||
//always sync this in case plugins caused a different result than the client expected
|
//always sync this in case plugins caused a different result than the client expected
|
||||||
//we *could* try to enhance detection of plugin-altered behaviour, but this would require propagating
|
//we *could* try to enhance detection of plugin-altered behaviour, but this would require propagating
|
||||||
//more information up the stack. For now I think this is good enough.
|
//more information up the stack. For now I think this is good enough.
|
||||||
|
Reference in New Issue
Block a user