mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-04 09:10:00 +00:00
Add some permission constants to AdventureSettings
This commit is contained in:
parent
d9e6676176
commit
813bb98850
@ -1170,7 +1170,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$pk->allowFlight = $this->allowFlight;
|
$pk->allowFlight = $this->allowFlight;
|
||||||
$pk->noClip = $this->isSpectator();
|
$pk->noClip = $this->isSpectator();
|
||||||
$pk->isFlying = $this->flying;
|
$pk->isFlying = $this->flying;
|
||||||
$pk->userPermission = 2;
|
$pk->userPermission = ($this->isOp() ? AdventureSettingsPacket::PERMISSION_OPERATOR : AdventureSettingsPacket::PERMISSION_NORMAL);
|
||||||
$this->dataPacket($pk);
|
$this->dataPacket($pk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,6 +27,12 @@ namespace pocketmine\network\protocol;
|
|||||||
class AdventureSettingsPacket extends DataPacket{
|
class AdventureSettingsPacket extends DataPacket{
|
||||||
const NETWORK_ID = Info::ADVENTURE_SETTINGS_PACKET;
|
const NETWORK_ID = Info::ADVENTURE_SETTINGS_PACKET;
|
||||||
|
|
||||||
|
const PERMISSION_NORMAL = 0;
|
||||||
|
const PERMISSION_OPERATOR = 1;
|
||||||
|
const PERMISSION_HOST = 2;
|
||||||
|
const PERMISSION_AUTOMATION = 3;
|
||||||
|
const PERMISSION_ADMIN = 4;
|
||||||
|
|
||||||
public $worldImmutable;
|
public $worldImmutable;
|
||||||
public $noPvp;
|
public $noPvp;
|
||||||
public $noPvm;
|
public $noPvm;
|
||||||
@ -85,7 +91,7 @@ class AdventureSettingsPacket extends DataPacket{
|
|||||||
$this->flags |= ((int) $this->isFlying) << 9;
|
$this->flags |= ((int) $this->isFlying) << 9;
|
||||||
|
|
||||||
$this->putUnsignedVarInt($this->flags);
|
$this->putUnsignedVarInt($this->flags);
|
||||||
$this->putUnsignedVarInt($this->userPermission); //TODO: verify this
|
$this->putUnsignedVarInt($this->userPermission);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user