mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Merge branch 'stable' into master
# Conflicts: # composer.lock # resources/vanilla # src/command/defaults/StatusCommand.php # src/pocketmine/entity/Entity.php # src/pocketmine/level/format/SubChunk.php
This commit is contained in:
commit
75e3a0aa0f
@ -40,6 +40,7 @@ use function fwrite;
|
||||
use function gc_collect_cycles;
|
||||
use function gc_disable;
|
||||
use function gc_enable;
|
||||
use function gc_mem_caches;
|
||||
use function get_class;
|
||||
use function get_declared_classes;
|
||||
use function ini_get;
|
||||
@ -276,6 +277,7 @@ class MemoryManager{
|
||||
}
|
||||
|
||||
$cycles = gc_collect_cycles();
|
||||
gc_mem_caches();
|
||||
|
||||
Timings::$garbageCollectorTimer->stopTiming();
|
||||
|
||||
|
@ -54,9 +54,9 @@ class StatusCommand extends VanillaCommand{
|
||||
$server = $sender->getServer();
|
||||
$sender->sendMessage(TextFormat::GREEN . "---- " . TextFormat::WHITE . "Server status" . TextFormat::GREEN . " ----");
|
||||
|
||||
$time = microtime(true) - $server->getStartTime();
|
||||
$time = (int) (microtime(true) - $server->getStartTime());
|
||||
|
||||
$seconds = floor($time % 60);
|
||||
$seconds = $time % 60;
|
||||
$minutes = null;
|
||||
$hours = null;
|
||||
$days = null;
|
||||
|
@ -893,7 +893,7 @@ abstract class Entity{
|
||||
}
|
||||
|
||||
public function getHorizontalFacing() : int{
|
||||
$angle = $this->location->yaw % 360;
|
||||
$angle = fmod($this->location->yaw, 360);
|
||||
if($angle < 0){
|
||||
$angle += 360.0;
|
||||
}
|
||||
|
@ -25,11 +25,13 @@ namespace pocketmine\scheduler;
|
||||
|
||||
use function gc_collect_cycles;
|
||||
use function gc_enable;
|
||||
use function gc_mem_caches;
|
||||
|
||||
class GarbageCollectionTask extends AsyncTask{
|
||||
|
||||
public function onRun() : void{
|
||||
gc_enable();
|
||||
gc_collect_cycles();
|
||||
gc_mem_caches();
|
||||
}
|
||||
}
|
||||
|
@ -69,11 +69,14 @@ final class RegionGarbageMap{
|
||||
/** @var RegionLocationTableEntry|null $prevEntry */
|
||||
$prevEntry = null;
|
||||
foreach($usedMap as $firstSector => $entry){
|
||||
$expectedStart = ($prevEntry !== null ? $prevEntry->getLastSector() + 1 : RegionLoader::FIRST_SECTOR);
|
||||
$actualStart = $entry->getFirstSector();
|
||||
if($expectedStart < $actualStart){
|
||||
$prevEndPlusOne = ($prevEntry !== null ? $prevEntry->getLastSector() + 1 : RegionLoader::FIRST_SECTOR);
|
||||
$currentStart = $entry->getFirstSector();
|
||||
if($prevEndPlusOne < $currentStart){
|
||||
//found a gap in the table
|
||||
$garbageMap[$expectedStart] = new RegionLocationTableEntry($expectedStart, $actualStart - $expectedStart, 0);
|
||||
$garbageMap[$prevEndPlusOne] = new RegionLocationTableEntry($prevEndPlusOne, $currentStart - $prevEndPlusOne, 0);
|
||||
}elseif($prevEndPlusOne > $currentStart){
|
||||
//current entry starts inside the previous. This would be a bug since RegionLoader should prevent this
|
||||
throw new AssumptionFailedError("Overlapping entries detected");
|
||||
}
|
||||
$prevEntry = $entry;
|
||||
}
|
||||
|
@ -283,6 +283,7 @@ class RegionLoader{
|
||||
throw new CorruptedRegionException("Corrupted region header (unexpected end of file)");
|
||||
}
|
||||
|
||||
/** @var int[] $data */
|
||||
$data = unpack("N*", $headerRaw);
|
||||
|
||||
for($i = 0; $i < 1024; ++$i){
|
||||
|
@ -49,7 +49,7 @@ before_script:
|
||||
- pecl install channel://pecl.php.net/igbinary-3.1.2
|
||||
- git clone https://github.com/pmmp/pthreads.git
|
||||
- cd pthreads
|
||||
- git checkout e0f514dfde01c5e7e9cf94c43615918af482a45c
|
||||
- git checkout b81ab29df58fa0fb239a9d5ca1c2380a0d087feb
|
||||
- phpize
|
||||
- ./configure
|
||||
- make
|
||||
|
Loading…
x
Reference in New Issue
Block a user