summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol_1_9.cpp
diff options
context:
space:
mode:
authorSimon Pribylski <66266021+Persson-dev@users.noreply.github.com>2022-01-24 21:24:55 +0100
committerGitHub <noreply@github.com>2022-01-24 21:24:55 +0100
commitf4c04299961a96e153bf50e2e1fb92c8f9db77f5 (patch)
treedf60ba3390281971920c1a1a2baf3a2f91ab55e9 /src/Protocol/Protocol_1_9.cpp
parentAdd aarch64 to easyinstall. Fixes #5386 (diff)
downloadcuberite-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 'src/Protocol/Protocol_1_9.cpp')
-rw-r--r--src/Protocol/Protocol_1_9.cpp36
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