diff options
author | Simon Pribylski <66266021+Persson-dev@users.noreply.github.com> | 2022-01-24 21:24:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-24 21:24:55 +0100 |
commit | f4c04299961a96e153bf50e2e1fb92c8f9db77f5 (patch) | |
tree | df60ba3390281971920c1a1a2baf3a2f91ab55e9 /src/Protocol/Protocol_1_9.cpp | |
parent | Add aarch64 to easyinstall. Fixes #5386 (diff) | |
download | cuberite-f4c04299961a96e153bf50e2e1fb92c8f9db77f5.tar cuberite-f4c04299961a96e153bf50e2e1fb92c8f9db77f5.tar.gz cuberite-f4c04299961a96e153bf50e2e1fb92c8f9db77f5.tar.bz2 cuberite-f4c04299961a96e153bf50e2e1fb92c8f9db77f5.tar.lz cuberite-f4c04299961a96e153bf50e2e1fb92c8f9db77f5.tar.xz cuberite-f4c04299961a96e153bf50e2e1fb92c8f9db77f5.tar.zst cuberite-f4c04299961a96e153bf50e2e1fb92c8f9db77f5.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Protocol/Protocol_1_9.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/Protocol/Protocol_1_9.cpp b/src/Protocol/Protocol_1_9.cpp index 587b01f0d..ad304b4ac 100644 --- a/src/Protocol/Protocol_1_9.cpp +++ b/src/Protocol/Protocol_1_9.cpp @@ -501,6 +501,42 @@ void cProtocol_1_9_0::SendPlayerMoveLook(void) +void cProtocol_1_9_0::SendPlayerPermissionLevel() +{ + const cPlayer & Player = *m_Client->GetPlayer(); + + cPacketizer Pkt(*this, pktEntityStatus); + Pkt.WriteBEUInt32(Player.GetUniqueID()); + Pkt.WriteBEInt8([&Player]() -> signed char + { + if (Player.HasPermission("core.stop") || Player.HasPermission("core.reload") || Player.HasPermission("core.save-all")) + { + return 28; + } + + if (Player.HasPermission("core.ban") || Player.HasPermission("core.deop") || Player.HasPermission("core.kick") || Player.HasPermission("core.op")) + { + return 27; + } + + if (Player.HasPermission("cuberite.comandblock.set") || Player.HasPermission("core.clear") || Player.HasPermission("core.difficulty") || Player.HasPermission("core.effect") || Player.HasPermission("core.gamemode") || Player.HasPermission("core.tp") || Player.HasPermission("core.give")) + { + return 26; + } + + if (Player.HasPermission("core.spawnprotect.bypass")) + { + return 25; + } + + return 24; + }()); +} + + + + + void cProtocol_1_9_0::SendPlayerSpawn(const cPlayer & a_Player) { // Called to spawn another player for the client |