mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-23 00:55:57 +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->noClip = $this->isSpectator();
|
||||
$pk->isFlying = $this->flying;
|
||||
$pk->userPermission = 2;
|
||||
$pk->userPermission = ($this->isOp() ? AdventureSettingsPacket::PERMISSION_OPERATOR : AdventureSettingsPacket::PERMISSION_NORMAL);
|
||||
$this->dataPacket($pk);
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,12 @@ namespace pocketmine\network\protocol;
|
||||
class AdventureSettingsPacket extends DataPacket{
|
||||
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 $noPvp;
|
||||
public $noPvm;
|
||||
@ -85,7 +91,7 @@ class AdventureSettingsPacket extends DataPacket{
|
||||
$this->flags |= ((int) $this->isFlying) << 9;
|
||||
|
||||
$this->putUnsignedVarInt($this->flags);
|
||||
$this->putUnsignedVarInt($this->userPermission); //TODO: verify this
|
||||
$this->putUnsignedVarInt($this->userPermission);
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user