mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 08:39:53 +00:00
Merge branch 'stable' into next-minor
This commit is contained in:
commit
ad6a423d12
8
.github/workflows/build-docker-image.yml
vendored
8
.github/workflows/build-docker-image.yml
vendored
@ -46,7 +46,7 @@ jobs:
|
|||||||
run: echo ::set-output name=NAME::$(echo "${GITHUB_REPOSITORY,,}")
|
run: echo ::set-output name=NAME::$(echo "${GITHUB_REPOSITORY,,}")
|
||||||
|
|
||||||
- name: Build image for tag
|
- name: Build image for tag
|
||||||
uses: docker/build-push-action@v3.2.0
|
uses: docker/build-push-action@v3.3.0
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
context: ./pocketmine-mp
|
context: ./pocketmine-mp
|
||||||
@ -59,7 +59,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build image for major tag
|
- name: Build image for major tag
|
||||||
if: steps.channel.outputs.CHANNEL == 'stable'
|
if: steps.channel.outputs.CHANNEL == 'stable'
|
||||||
uses: docker/build-push-action@v3.2.0
|
uses: docker/build-push-action@v3.3.0
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
context: ./pocketmine-mp
|
context: ./pocketmine-mp
|
||||||
@ -72,7 +72,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build image for minor tag
|
- name: Build image for minor tag
|
||||||
if: steps.channel.outputs.CHANNEL == 'stable'
|
if: steps.channel.outputs.CHANNEL == 'stable'
|
||||||
uses: docker/build-push-action@v3.2.0
|
uses: docker/build-push-action@v3.3.0
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
context: ./pocketmine-mp
|
context: ./pocketmine-mp
|
||||||
@ -85,7 +85,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build image for latest tag
|
- name: Build image for latest tag
|
||||||
if: steps.channel.outputs.CHANNEL == 'stable'
|
if: steps.channel.outputs.CHANNEL == 'stable'
|
||||||
uses: docker/build-push-action@v3.2.0
|
uses: docker/build-push-action@v3.3.0
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
context: ./pocketmine-mp
|
context: ./pocketmine-mp
|
||||||
|
@ -70,3 +70,26 @@ Released 9th January 2023.
|
|||||||
## Fixes
|
## Fixes
|
||||||
- Fixed players getting kicked during PvP.
|
- Fixed players getting kicked during PvP.
|
||||||
- Fixed players randomly getting kicked on Windows (improper rate limit handling wrt. 15ms timer resolution).
|
- Fixed players randomly getting kicked on Windows (improper rate limit handling wrt. 15ms timer resolution).
|
||||||
|
|
||||||
|
# 4.12.9
|
||||||
|
Released 16th January 2023.
|
||||||
|
|
||||||
|
## Improvements
|
||||||
|
### Timings
|
||||||
|
- Added new timers:
|
||||||
|
- `Server Mid-Tick Processing` - time spent processing Snooze interrupts between ticks (e.g. incoming network packets)
|
||||||
|
- `Server Tick Update Cycle` - time spent processing regular per-tick updates (e.g. entity movement, world updates, etc.) (`Server->tick()`)
|
||||||
|
- `Full Server Tick` timer now counts the total of `Server Mid-Tick Processing` and `Server Tick Update Cycle`, which generates more accurate performance metrics.
|
||||||
|
- Previously, this timer only counted the time spent during regular per-tick updates, and the time recorded by `Server Mid-Tick Processing` was not included in the report at all.
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
- Fixed blocks such as pressure plates being able to be placed without the correct supporting blocks if the clicked block was solid.
|
||||||
|
- Pressure plates now self-destruct when the block below them is removed.
|
||||||
|
- Fixed being unable to place blocks by clicking on the side of a bell (when the click doesn't result in ringing the bell).
|
||||||
|
- Fixed various rotation-aware blocks (e.g. stairs) behaving incorrectly when placed by clicking on the side of a replaceable block (e.g. tall grass).
|
||||||
|
- Fixed banners being able to be placed on top of blocks such as skulls.
|
||||||
|
- Fixed server-side collision boxes of walls and glass (which should connect, but didn't). Note that wall connections still don't show client side - this just fixes the collision boxes.
|
||||||
|
- Fixed `PlayerInteractEvent` with `LEFT_CLICK` sometimes firing before `BlockBreakEvent` when breaking blocks.
|
||||||
|
|
||||||
|
## Other changes
|
||||||
|
- Increased packet batch budget for player sessions.
|
||||||
|
14
composer.lock
generated
14
composer.lock
generated
@ -2309,20 +2309,20 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpunit/phpunit",
|
"name": "phpunit/phpunit",
|
||||||
"version": "9.5.27",
|
"version": "9.5.28",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||||
"reference": "a2bc7ffdca99f92d959b3f2270529334030bba38"
|
"reference": "954ca3113a03bf780d22f07bf055d883ee04b65e"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a2bc7ffdca99f92d959b3f2270529334030bba38",
|
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/954ca3113a03bf780d22f07bf055d883ee04b65e",
|
||||||
"reference": "a2bc7ffdca99f92d959b3f2270529334030bba38",
|
"reference": "954ca3113a03bf780d22f07bf055d883ee04b65e",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"doctrine/instantiator": "^1.3.1",
|
"doctrine/instantiator": "^1.3.1 || ^2",
|
||||||
"ext-dom": "*",
|
"ext-dom": "*",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-libxml": "*",
|
"ext-libxml": "*",
|
||||||
@ -2391,7 +2391,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
|
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
|
||||||
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.27"
|
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.28"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -2407,7 +2407,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-12-09T07:31:23+00:00"
|
"time": "2023-01-14T12:32:24+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "sebastian/cli-parser",
|
"name": "sebastian/cli-parser",
|
||||||
|
@ -91,6 +91,7 @@ use pocketmine\scheduler\AsyncPool;
|
|||||||
use pocketmine\snooze\SleeperHandler;
|
use pocketmine\snooze\SleeperHandler;
|
||||||
use pocketmine\stats\SendUsageTask;
|
use pocketmine\stats\SendUsageTask;
|
||||||
use pocketmine\timings\Timings;
|
use pocketmine\timings\Timings;
|
||||||
|
use pocketmine\timings\TimingsAwareSleeperHandler;
|
||||||
use pocketmine\timings\TimingsHandler;
|
use pocketmine\timings\TimingsHandler;
|
||||||
use pocketmine\updater\UpdateChecker;
|
use pocketmine\updater\UpdateChecker;
|
||||||
use pocketmine\utils\AssumptionFailedError;
|
use pocketmine\utils\AssumptionFailedError;
|
||||||
@ -771,7 +772,8 @@ class Server{
|
|||||||
$this->tickAverage = array_fill(0, self::TARGET_TICKS_PER_SECOND, self::TARGET_TICKS_PER_SECOND);
|
$this->tickAverage = array_fill(0, self::TARGET_TICKS_PER_SECOND, self::TARGET_TICKS_PER_SECOND);
|
||||||
$this->useAverage = array_fill(0, self::TARGET_TICKS_PER_SECOND, 0);
|
$this->useAverage = array_fill(0, self::TARGET_TICKS_PER_SECOND, 0);
|
||||||
|
|
||||||
$this->tickSleeper = new SleeperHandler();
|
Timings::init();
|
||||||
|
$this->tickSleeper = new TimingsAwareSleeperHandler(Timings::$serverInterrupts);
|
||||||
|
|
||||||
$this->signalHandler = new SignalHandler(function() : void{
|
$this->signalHandler = new SignalHandler(function() : void{
|
||||||
$this->logger->info("Received signal interrupt, stopping the server");
|
$this->logger->info("Received signal interrupt, stopping the server");
|
||||||
@ -951,7 +953,6 @@ class Server{
|
|||||||
)));
|
)));
|
||||||
$this->logger->info($this->getLanguage()->translate(KnownTranslationFactory::pocketmine_server_license($this->getName())));
|
$this->logger->info($this->getLanguage()->translate(KnownTranslationFactory::pocketmine_server_license($this->getName())));
|
||||||
|
|
||||||
Timings::init();
|
|
||||||
TimingsHandler::setEnabled($this->configGroup->getPropertyBool("settings.enable-profiling", false));
|
TimingsHandler::setEnabled($this->configGroup->getPropertyBool("settings.enable-profiling", false));
|
||||||
$this->profilingTickRate = $this->configGroup->getPropertyInt("settings.profile-report-trigger", self::TARGET_TICKS_PER_SECOND);
|
$this->profilingTickRate = $this->configGroup->getPropertyInt("settings.profile-report-trigger", self::TARGET_TICKS_PER_SECOND);
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ use function str_repeat;
|
|||||||
|
|
||||||
final class VersionInfo{
|
final class VersionInfo{
|
||||||
public const NAME = "PocketMine-MP";
|
public const NAME = "PocketMine-MP";
|
||||||
public const BASE_VERSION = "4.12.9";
|
public const BASE_VERSION = "4.12.10";
|
||||||
public const IS_DEVELOPMENT_BUILD = true;
|
public const IS_DEVELOPMENT_BUILD = true;
|
||||||
public const BUILD_CHANNEL = "stable";
|
public const BUILD_CHANNEL = "stable";
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ use const SORT_NUMERIC;
|
|||||||
|
|
||||||
class NetworkSession{
|
class NetworkSession{
|
||||||
private const INCOMING_PACKET_BATCH_PER_TICK = 2; //usually max 1 per tick, but transactions may arrive separately
|
private const INCOMING_PACKET_BATCH_PER_TICK = 2; //usually max 1 per tick, but transactions may arrive separately
|
||||||
private const INCOMING_PACKET_BATCH_MAX_BUDGET = 100; //enough to account for a 5-second lag spike
|
private const INCOMING_PACKET_BATCH_MAX_BUDGET = 100 * self::INCOMING_PACKET_BATCH_PER_TICK; //enough to account for a 5-second lag spike
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* At most this many more packets can be received. If this reaches zero, any additional packets received will cause
|
* At most this many more packets can be received. If this reaches zero, any additional packets received will cause
|
||||||
|
@ -249,20 +249,6 @@ class InGamePacketHandler extends PacketHandler{
|
|||||||
|
|
||||||
$packetHandled = true;
|
$packetHandled = true;
|
||||||
|
|
||||||
$useItemTransaction = $packet->getItemInteractionData();
|
|
||||||
if($useItemTransaction !== null){
|
|
||||||
if(count($useItemTransaction->getTransactionData()->getActions()) > 100){
|
|
||||||
throw new PacketHandlingException("Too many actions in item use transaction");
|
|
||||||
}
|
|
||||||
$this->inventoryManager->addPredictedSlotChanges($useItemTransaction->getTransactionData()->getActions());
|
|
||||||
if(!$this->handleUseItemTransaction($useItemTransaction->getTransactionData())){
|
|
||||||
$packetHandled = false;
|
|
||||||
$this->session->getLogger()->debug("Unhandled transaction in PlayerAuthInputPacket (type " . $useItemTransaction->getTransactionData()->getActionType() . ")");
|
|
||||||
}else{
|
|
||||||
$this->inventoryManager->syncMismatchedPredictedSlotChanges();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$blockActions = $packet->getBlockActions();
|
$blockActions = $packet->getBlockActions();
|
||||||
if($blockActions !== null){
|
if($blockActions !== null){
|
||||||
if(count($blockActions) > 100){
|
if(count($blockActions) > 100){
|
||||||
@ -283,6 +269,20 @@ class InGamePacketHandler extends PacketHandler{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$useItemTransaction = $packet->getItemInteractionData();
|
||||||
|
if($useItemTransaction !== null){
|
||||||
|
if(count($useItemTransaction->getTransactionData()->getActions()) > 100){
|
||||||
|
throw new PacketHandlingException("Too many actions in item use transaction");
|
||||||
|
}
|
||||||
|
$this->inventoryManager->addPredictedSlotChanges($useItemTransaction->getTransactionData()->getActions());
|
||||||
|
if(!$this->handleUseItemTransaction($useItemTransaction->getTransactionData())){
|
||||||
|
$packetHandled = false;
|
||||||
|
$this->session->getLogger()->debug("Unhandled transaction in PlayerAuthInputPacket (type " . $useItemTransaction->getTransactionData()->getActionType() . ")");
|
||||||
|
}else{
|
||||||
|
$this->inventoryManager->syncMismatchedPredictedSlotChanges();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $packetHandled;
|
return $packetHandled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,6 +41,8 @@ abstract class Timings{
|
|||||||
/** @var TimingsHandler */
|
/** @var TimingsHandler */
|
||||||
public static $serverTick;
|
public static $serverTick;
|
||||||
/** @var TimingsHandler */
|
/** @var TimingsHandler */
|
||||||
|
public static $serverInterrupts;
|
||||||
|
/** @var TimingsHandler */
|
||||||
public static $memoryManager;
|
public static $memoryManager;
|
||||||
/** @var TimingsHandler */
|
/** @var TimingsHandler */
|
||||||
public static $garbageCollector;
|
public static $garbageCollector;
|
||||||
@ -140,7 +142,8 @@ abstract class Timings{
|
|||||||
self::$initialized = true;
|
self::$initialized = true;
|
||||||
|
|
||||||
self::$fullTick = new TimingsHandler("Full Server Tick");
|
self::$fullTick = new TimingsHandler("Full Server Tick");
|
||||||
self::$serverTick = new TimingsHandler(self::INCLUDED_BY_OTHER_TIMINGS_PREFIX . "Full Server Tick", self::$fullTick);
|
self::$serverTick = new TimingsHandler(self::INCLUDED_BY_OTHER_TIMINGS_PREFIX . "Server Tick Update Cycle", self::$fullTick);
|
||||||
|
self::$serverInterrupts = new TimingsHandler(self::INCLUDED_BY_OTHER_TIMINGS_PREFIX . "Server Mid-Tick Processing", self::$fullTick);
|
||||||
self::$memoryManager = new TimingsHandler("Memory Manager");
|
self::$memoryManager = new TimingsHandler("Memory Manager");
|
||||||
self::$garbageCollector = new TimingsHandler("Garbage Collector", self::$memoryManager);
|
self::$garbageCollector = new TimingsHandler("Garbage Collector", self::$memoryManager);
|
||||||
self::$titleTick = new TimingsHandler("Console Title Tick");
|
self::$titleTick = new TimingsHandler("Console Title Tick");
|
||||||
|
47
src/timings/TimingsAwareSleeperHandler.php
Normal file
47
src/timings/TimingsAwareSleeperHandler.php
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* @author PocketMine Team
|
||||||
|
* @link http://www.pocketmine.net/
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace pocketmine\timings;
|
||||||
|
|
||||||
|
use pocketmine\snooze\SleeperHandler;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom Snooze sleeper handler which captures notification processing time.
|
||||||
|
*/
|
||||||
|
final class TimingsAwareSleeperHandler extends SleeperHandler{
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
private TimingsHandler $timings
|
||||||
|
){
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function processNotifications() : void{
|
||||||
|
$this->timings->startTiming();
|
||||||
|
try{
|
||||||
|
parent::processNotifications();
|
||||||
|
}finally{
|
||||||
|
$this->timings->stopTiming();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user