mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 14:35:35 +00:00
Merge branch 'master' into mcpe-1.2
This commit is contained in:
commit
361b262d3a
@ -6,8 +6,9 @@ php:
|
||||
before_script:
|
||||
# - pecl install channel://pecl.php.net/pthreads-3.1.6
|
||||
- echo | pecl install channel://pecl.php.net/yaml-2.0.2
|
||||
- git clone https://github.com/krakjoe/pthreads.git --depth=1
|
||||
- git clone https://github.com/krakjoe/pthreads.git
|
||||
- cd pthreads
|
||||
- git checkout caca8dc42a5d75ddfb39e6fd15337e87e967517e #master is broken - https://github.com/krakjoe/pthreads/issues/757
|
||||
- phpize
|
||||
- ./configure
|
||||
- make
|
||||
|
@ -654,7 +654,6 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
$this->loaderId = Level::generateChunkLoaderId($this);
|
||||
$this->chunksPerTick = (int) $this->server->getProperty("chunk-sending.per-tick", 4);
|
||||
$this->spawnThreshold = (int) (($this->server->getProperty("chunk-sending.spawn-radius", 4) ** 2) * M_PI);
|
||||
$this->spawnPosition = null;
|
||||
$this->gamemode = $this->server->getGamemode();
|
||||
$this->setLevel($this->server->getDefaultLevel());
|
||||
$this->boundingBox = new AxisAlignedBB(0, 0, 0, 0, 0, 0);
|
||||
|
@ -54,7 +54,7 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
|
||||
private $players = [];
|
||||
|
||||
/** @var string[] */
|
||||
private $identifiers;
|
||||
private $identifiers = [];
|
||||
|
||||
/** @var int[] */
|
||||
private $identifiersACK = [];
|
||||
@ -63,9 +63,7 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
|
||||
private $interface;
|
||||
|
||||
public function __construct(Server $server){
|
||||
|
||||
$this->server = $server;
|
||||
$this->identifiers = [];
|
||||
|
||||
$this->rakLib = new RakLibServer($this->server->getLogger(), $this->server->getLoader(), $this->server->getPort(), $this->server->getIp() === "" ? "0.0.0.0" : $this->server->getIp(), false);
|
||||
$this->interface = new ServerHandler($this->rakLib, $this);
|
||||
@ -213,13 +211,10 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
|
||||
if($packet instanceof BatchPacket){
|
||||
if($needACK){
|
||||
$pk = new EncapsulatedPacket();
|
||||
$pk->identifierACK = $this->identifiersACK[$identifier]++;
|
||||
$pk->buffer = $packet->buffer;
|
||||
$pk->reliability = $immediate ? PacketReliability::RELIABLE : PacketReliability::RELIABLE_ORDERED;
|
||||
$pk->orderChannel = 0;
|
||||
|
||||
if($needACK === true){
|
||||
$pk->identifierACK = $this->identifiersACK[$identifier]++;
|
||||
}
|
||||
}else{
|
||||
if(!isset($packet->__encapsulatedPacket)){
|
||||
$packet->__encapsulatedPacket = new CachedEncapsulatedPacket;
|
||||
|
@ -57,7 +57,13 @@ abstract class Terminal{
|
||||
if(isset($opts["disable-ansi"])){
|
||||
self::$formattingCodes = false;
|
||||
}else{
|
||||
self::$formattingCodes = ((Utils::getOS() !== "win" and getenv("TERM") != "" and (!function_exists("posix_ttyname") or !defined("STDOUT") or posix_ttyname(STDOUT) !== false)) or isset($opts["enable-ansi"]));
|
||||
self::$formattingCodes = (isset($opts["enable-ansi"]) or ( //user explicitly told us to enable ANSI
|
||||
stream_isatty(STDOUT) and //STDOUT isn't being piped
|
||||
(
|
||||
getenv('TERM') !== false or //Console says it supports colours
|
||||
(function_exists('sapi_windows_vt100_support') and sapi_windows_vt100_support(STDOUT)) //we're on windows and have vt100 support
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user