From 387c786eef7f7e203d7a7d5745c8e98f33ab45d2 Mon Sep 17 00:00:00 2001 From: Gravit Date: Mon, 21 Jan 2019 20:42:26 +0700 Subject: [PATCH] =?UTF-8?q?[FEATURE]=20=D0=A4=D1=83=D0=BD=D0=BA=D1=86?= =?UTF-8?q?=D0=B8=D1=8F=20toLong=20=D0=B8=20=D0=B2=D0=BE=D0=B7=D0=BC=D0=BE?= =?UTF-8?q?=D0=B6=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20=D0=BD=D0=B0=D0=BF=D0=B8?= =?UTF-8?q?=D1=81=D0=B0=D0=BD=D0=B8=D1=8F=20=D1=81=D0=B2=D0=BE=D0=B8=D1=85?= =?UTF-8?q?=20permissions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/ru/gravit/launcher/ClientPermissions.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libLauncher/src/main/java/ru/gravit/launcher/ClientPermissions.java b/libLauncher/src/main/java/ru/gravit/launcher/ClientPermissions.java index c55fb07b..0c77e2bc 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/ClientPermissions.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/ClientPermissions.java @@ -46,6 +46,17 @@ public ClientPermissions(long data) { canUSR3 = (data & (1 << 4)) != 0; canBot = (data & (1 << 5)) != 0; } + public long toLong() + { + long result = 0; + result |= canAdmin ? 0 : 1; + result |= canServer ? 0 : (1 << 1); + result |= canUSR1 ? 0 : (1 << 2); + result |= canUSR2 ? 0 : (1 << 3); + result |= canUSR3 ? 0 : (1 << 4); + result |= canBot ? 0 : (1 << 5); + return result; + } public static ClientPermissions getSuperuserAccount() { ClientPermissions perm = new ClientPermissions();