mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 19:59:11 +00:00
Merge branch 'stable'
This commit is contained in:
@@ -73,6 +73,11 @@ final class Filesystem{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function cleanPath($path){
|
||||
$result = str_replace(["\\", ".php", "phar://"], ["/", "", ""], $path);
|
||||
|
||||
|
@@ -223,6 +223,12 @@ class MainLogger extends \AttachableThreadedLogger{
|
||||
$this->notify();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param string $level
|
||||
* @param string $prefix
|
||||
* @param string $color
|
||||
*/
|
||||
protected function send($message, $level, $prefix, $color) : void{
|
||||
$time = new \DateTime('now', new \DateTimeZone($this->timezone));
|
||||
|
||||
|
@@ -119,6 +119,9 @@ final class Process{
|
||||
return count(ThreadManager::getInstance()->getAll()) + 3; //RakLib + MainLogger + Main Thread
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $pid
|
||||
*/
|
||||
public static function kill($pid) : void{
|
||||
$logger = \GlobalLogger::get();
|
||||
if($logger instanceof MainLogger){
|
||||
|
@@ -25,7 +25,14 @@ namespace pocketmine\utils;
|
||||
|
||||
class ReversePriorityQueue extends \SplPriorityQueue{
|
||||
|
||||
/**
|
||||
* @param mixed $priority1
|
||||
* @param mixed $priority2
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function compare($priority1, $priority2){
|
||||
//TODO: this will crash if non-numeric priorities are used
|
||||
return (int) -($priority1 - $priority2);
|
||||
}
|
||||
}
|
||||
|
@@ -35,6 +35,9 @@ class ServerKiller extends Thread{
|
||||
/** @var bool */
|
||||
private $stopped = false;
|
||||
|
||||
/**
|
||||
* @param int $time
|
||||
*/
|
||||
public function __construct($time = 15){
|
||||
$this->time = $time;
|
||||
}
|
||||
|
Reference in New Issue
Block a user