[FEATURE] Функция toLong и возможность написания своих permissions

This commit is contained in:
Gravit 2019-01-21 20:42:26 +07:00
parent f761460122
commit 387c786eef
No known key found for this signature in database
GPG key ID: 061981E1E85D3216

View file

@ -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();