From fd333733ef1755c093392bc85cc650aa4cfff53c Mon Sep 17 00:00:00 2001 From: memetrollsXD Date: Thu, 28 Apr 2022 00:10:46 +0200 Subject: [PATCH] Add default permissions --- src/main/java/emu/grasscutter/Config.java | 1 + .../java/emu/grasscutter/server/dispatch/DispatchServer.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/main/java/emu/grasscutter/Config.java b/src/main/java/emu/grasscutter/Config.java index ee5fe65c8..3e6e16d20 100644 --- a/src/main/java/emu/grasscutter/Config.java +++ b/src/main/java/emu/grasscutter/Config.java @@ -33,6 +33,7 @@ public final class Config { public Boolean FrontHTTPS = true; public boolean AutomaticallyCreateAccounts = false; + public String[] defaultPermissions = new String[] { "" }; public RegionInfo[] GameServers = {}; diff --git a/src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java b/src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java index 1ac721ce2..99c5e4f8d 100644 --- a/src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java +++ b/src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java @@ -339,6 +339,10 @@ public final class DispatchServer { // added. account = DatabaseHelper.createAccountWithId(requestData.account, 0); + for (String permission : Grasscutter.getConfig().getDispatchOptions().defaultPermissions) { + account.addPermission(permission); + } + if (account != null) { responseData.message = "OK"; responseData.data.account.uid = account.getId();