mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-01-09 00:59:44 +03:00
[FEATURE] Функция toLong и возможность написания своих permissions
This commit is contained in:
parent
f761460122
commit
387c786eef
1 changed files with 11 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue