mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-01-13 02:53:16 +03:00
[FEATURE] ClientPermissions сериализуется в Long
This commit is contained in:
parent
d6ef1fd99d
commit
5c88b8eb14
2 changed files with 9 additions and 19 deletions
|
@ -103,7 +103,7 @@ public static void main(String... args) throws Throwable {
|
||||||
gsonBuiler.setPrettyPrinting();
|
gsonBuiler.setPrettyPrinting();
|
||||||
gson = gsonBuiler.create();
|
gson = gsonBuiler.create();
|
||||||
initGson();
|
initGson();
|
||||||
if(args.length > 0 && args[0].equals("setup"))
|
if(args.length > 0 && args[0].equals("setup") && !disableSetup)
|
||||||
{
|
{
|
||||||
generateConfigIfNotExists();
|
generateConfigIfNotExists();
|
||||||
LogHelper.debug("Read ServerWrapperConfig.json");
|
LogHelper.debug("Read ServerWrapperConfig.json");
|
||||||
|
|
|
@ -8,25 +8,20 @@
|
||||||
public class ClientPermissions {
|
public class ClientPermissions {
|
||||||
public static final ClientPermissions DEFAULT = new ClientPermissions();
|
public static final ClientPermissions DEFAULT = new ClientPermissions();
|
||||||
@LauncherAPI
|
@LauncherAPI
|
||||||
public boolean canAdmin = false;
|
public boolean canAdmin;
|
||||||
@LauncherAPI
|
@LauncherAPI
|
||||||
public boolean canServer = false;
|
public boolean canServer;
|
||||||
@LauncherAPI
|
@LauncherAPI
|
||||||
public boolean canUSR1 = false;
|
public boolean canUSR1;
|
||||||
@LauncherAPI
|
@LauncherAPI
|
||||||
public boolean canUSR2 = false;
|
public boolean canUSR2;
|
||||||
@LauncherAPI
|
@LauncherAPI
|
||||||
public boolean canUSR3 = false;
|
public boolean canUSR3;
|
||||||
@LauncherAPI
|
@LauncherAPI
|
||||||
public boolean canBot = false;
|
public boolean canBot;
|
||||||
|
|
||||||
public ClientPermissions(HInput input) throws IOException {
|
public ClientPermissions(HInput input) throws IOException {
|
||||||
canAdmin = input.readBoolean();
|
this(input.readLong());
|
||||||
canServer = input.readBoolean();
|
|
||||||
canUSR1 = input.readBoolean();
|
|
||||||
canUSR2 = input.readBoolean();
|
|
||||||
canUSR3 = input.readBoolean();
|
|
||||||
canBot = input.readBoolean();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClientPermissions() {
|
public ClientPermissions() {
|
||||||
|
@ -67,11 +62,6 @@ public static ClientPermissions getSuperuserAccount() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void write(HOutput output) throws IOException {
|
public void write(HOutput output) throws IOException {
|
||||||
output.writeBoolean(canAdmin);
|
output.writeLong(toLong());
|
||||||
output.writeBoolean(canServer);
|
|
||||||
output.writeBoolean(canUSR1);
|
|
||||||
output.writeBoolean(canUSR2);
|
|
||||||
output.writeBoolean(canUSR3);
|
|
||||||
output.writeBoolean(canBot);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue