mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 19:59:11 +00:00
Merge remote-tracking branch 'origin/master' into Faster-Network
This commit is contained in:
@@ -55,6 +55,8 @@ class RCON{
|
||||
for($n = 0; $n < $this->threads; ++$n){
|
||||
$this->workers[$n]->close();
|
||||
$this->workers[$n]->join();
|
||||
usleep(50000);
|
||||
$this->workers[$n]->kill();
|
||||
}
|
||||
@socket_close($this->socket);
|
||||
$this->threads = 0;
|
||||
|
@@ -800,12 +800,29 @@ class CustomPacketHandler{
|
||||
for($s = 0; $s < $this->data["count"] and !$this->feof(); ++$s){
|
||||
$this->data["slots"][$s] = Utils::readSlot($this);
|
||||
}
|
||||
if($this->data["windowid"] == 0){
|
||||
$slots = min(9, Utils::readShort($this->get(2), false));
|
||||
$this->data["hotbar"] = array();
|
||||
if($slots > 0){
|
||||
for($s = 0; $s < $slots; ++$s){
|
||||
$this->data["hotbar"][$s] = Utils::readInt($this->get(4));
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$this->raw .= chr($this->data["windowid"]);
|
||||
$this->raw .= Utils::writeShort(count($this->data["slots"]));
|
||||
foreach($this->data["slots"] as $slot){
|
||||
$this->raw .= Utils::writeSlot($slot);
|
||||
}
|
||||
if($this->data["windowid"] == 0 and isset($this->data["hotbar"])){
|
||||
if(count($this->data["hotbar"]) > 0){
|
||||
$this->raw .= Utils::writeShort(count($this->data["hotbar"]));
|
||||
foreach($this->data["hotbar"] as $slot){
|
||||
$this->raw .= Utils::writeInt($slot);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case MC_CONTAINER_SET_DATA:
|
||||
|
Reference in New Issue
Block a user