mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 11:39:11 +03:00
[FEATURE] 4 новых permissions
This commit is contained in:
parent
c865a8fec8
commit
f761460122
1 changed files with 26 additions and 2 deletions
|
@ -8,23 +8,43 @@
|
|||
public class ClientPermissions {
|
||||
public static final ClientPermissions DEFAULT = new ClientPermissions();
|
||||
@LauncherAPI
|
||||
public boolean canAdmin;
|
||||
public boolean canAdmin = false;
|
||||
@LauncherAPI
|
||||
public boolean canServer;
|
||||
public boolean canServer = false;
|
||||
@LauncherAPI
|
||||
public boolean canUSR1 = false;
|
||||
@LauncherAPI
|
||||
public boolean canUSR2 = false;
|
||||
@LauncherAPI
|
||||
public boolean canUSR3 = false;
|
||||
@LauncherAPI
|
||||
public boolean canBot = false;
|
||||
|
||||
public ClientPermissions(HInput input) throws IOException {
|
||||
canAdmin = input.readBoolean();
|
||||
canServer = input.readBoolean();
|
||||
canUSR1 = input.readBoolean();
|
||||
canUSR2 = input.readBoolean();
|
||||
canUSR3 = input.readBoolean();
|
||||
canBot = input.readBoolean();
|
||||
}
|
||||
|
||||
public ClientPermissions() {
|
||||
canAdmin = false;
|
||||
canServer = false;
|
||||
canUSR1 = false;
|
||||
canUSR2 = false;
|
||||
canUSR3 = false;
|
||||
canBot = false;
|
||||
}
|
||||
|
||||
public ClientPermissions(long data) {
|
||||
canAdmin = (data & (1)) != 0;
|
||||
canServer = (data & (1 << 1)) != 0;
|
||||
canUSR1 = (data & (1 << 2)) != 0;
|
||||
canUSR2 = (data & (1 << 3)) != 0;
|
||||
canUSR3 = (data & (1 << 4)) != 0;
|
||||
canBot = (data & (1 << 5)) != 0;
|
||||
}
|
||||
|
||||
public static ClientPermissions getSuperuserAccount() {
|
||||
|
@ -37,5 +57,9 @@ public static ClientPermissions getSuperuserAccount() {
|
|||
public void write(HOutput output) throws IOException {
|
||||
output.writeBoolean(canAdmin);
|
||||
output.writeBoolean(canServer);
|
||||
output.writeBoolean(canUSR1);
|
||||
output.writeBoolean(canUSR2);
|
||||
output.writeBoolean(canUSR3);
|
||||
output.writeBoolean(canBot);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue