group perms for cmds, player groups, move perms to own new folder
All checks were successful
/ Auto-Build-App (push) Successful in 1m32s
All checks were successful
/ Auto-Build-App (push) Successful in 1m32s
This commit is contained in:
parent
87894d545e
commit
b2b55f322b
15 changed files with 265 additions and 102 deletions
|
@ -3,6 +3,8 @@ package net.pietru.cookie_utils.api;
|
|||
import com.badlogic.gdx.math.Vector3;
|
||||
import com.badlogic.gdx.math.collision.BoundingBox;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import net.pietru.cookie_utils.permissions.ObjectPermList;
|
||||
import net.pietru.cookie_utils.permissions.PlayerAreaPerm;
|
||||
|
||||
public class Area {
|
||||
BoundingBox space = new BoundingBox();
|
||||
|
@ -13,6 +15,7 @@ public class Area {
|
|||
public ObjectPermList perms = new ObjectPermList();
|
||||
|
||||
public int piority = 0;
|
||||
public long size = 0;
|
||||
public Array<PlayerAreaPerm> player_perms = new Array<>();
|
||||
|
||||
public BoundingBox getBox() {
|
||||
|
@ -25,6 +28,7 @@ public class Area {
|
|||
|
||||
public void setCorners(Vector3 a, Vector3 b){
|
||||
space.set(a,b);
|
||||
size= (int) (space.getDepth()*space.getWidth()*space.getHeight());
|
||||
}
|
||||
|
||||
public boolean does_intersect(Vector3 c){
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package net.pietru.cookie_utils.api;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import net.pietru.cookie_utils.permissions.Permissions;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
|
|
@ -1,72 +0,0 @@
|
|||
package net.pietru.cookie_utils.api;
|
||||
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Random;
|
||||
|
||||
public class Permissions {
|
||||
public static Array<String> playerUniqueIds = new Array<>();
|
||||
|
||||
public static String code = "";
|
||||
|
||||
static Thread t;
|
||||
static Map<String,Thread> player_revoke_perm_timer = new HashMap<>();
|
||||
|
||||
public static void generate_new_code(){
|
||||
code = generateRandomString(6);
|
||||
System.out.println("[Permissions] New perm code is %s".replace("%s",code));
|
||||
// Create a new Thread object
|
||||
t = new Thread(new Delay(60,"reset_permission_code"));
|
||||
|
||||
// Start the thread
|
||||
t.start();
|
||||
}
|
||||
|
||||
public static void check_code_and_add_user(String cd, String playerId){
|
||||
if (playerUniqueIds.contains(playerId,false)) {
|
||||
System.out.println("[Permissions] Player %s tried re-verificate too early...".replace("%s", playerId));
|
||||
return;
|
||||
}
|
||||
if (code.isEmpty())
|
||||
return;
|
||||
if (!Objects.equals(cd, code))
|
||||
return;
|
||||
t.interrupt();
|
||||
code="";
|
||||
System.out.println("[Permissions] Player %s passed verification...".replace("%s",playerId));
|
||||
Map<String,String> data = new HashMap<>();
|
||||
data.put("id",playerId);
|
||||
Thread player_t = new Thread(new Delay(60*2,"revoke_usr_perm",data));
|
||||
player_t.start();
|
||||
player_revoke_perm_timer.put(playerId,player_t);
|
||||
playerUniqueIds.add(playerId);
|
||||
}
|
||||
|
||||
public static void clear_user_perm(String playerId, boolean stop_thread){
|
||||
while (Permissions.playerUniqueIds.contains(playerId,false))
|
||||
Permissions.playerUniqueIds.removeValue(playerId,false);
|
||||
if (stop_thread && Permissions.player_revoke_perm_timer.containsKey(playerId))
|
||||
Permissions.player_revoke_perm_timer.get(playerId).interrupt();
|
||||
Permissions.player_revoke_perm_timer.remove(playerId);
|
||||
}
|
||||
|
||||
public static boolean has_user_special_perm(String playerId){
|
||||
return playerUniqueIds.contains(playerId,false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static final String CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
|
||||
public static String generateRandomString(int length) {
|
||||
StringBuilder sb = new StringBuilder(length);
|
||||
Random random = new Random();
|
||||
for (int i = 0; i < length; i++) {
|
||||
sb.append(CHARACTERS.charAt(random.nextInt(CHARACTERS.length())));
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
|
@ -6,14 +6,18 @@ import com.badlogic.gdx.utils.*;
|
|||
import finalforeach.cosmicreach.blocks.BlockPosition;
|
||||
import finalforeach.cosmicreach.io.SaveLocation;
|
||||
import finalforeach.cosmicreach.world.Zone;
|
||||
import net.pietru.cookie_utils.permissions.ObjectPermList;
|
||||
import net.pietru.cookie_utils.permissions.PlayerAreaPerm;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
|
||||
import static net.pietru.cookie_utils.utils.directory_utils.get_path_string;
|
||||
|
||||
public class Region {
|
||||
|
||||
static JsonReader jsonReader = new JsonReader();
|
||||
public static JsonReader jsonReader = new JsonReader();
|
||||
public static Array<Area> areas = new Array<>();
|
||||
|
||||
public static boolean is_not_reloading = true;
|
||||
|
@ -64,10 +68,6 @@ public class Region {
|
|||
return can;
|
||||
}
|
||||
|
||||
public static String get_path_string(String ...path_parts){
|
||||
return String.join(File.separator, path_parts);
|
||||
}
|
||||
|
||||
public static void reload_regions(){
|
||||
is_not_reloading=false;
|
||||
|
||||
|
@ -143,7 +143,12 @@ public class Region {
|
|||
|
||||
Sort sorter = Sort.instance();
|
||||
|
||||
sorter.sort(areas,(a,b)->b.piority-a.piority);
|
||||
sorter.sort(areas,(a,b)->{
|
||||
int pior = b.piority-a.piority;
|
||||
if (pior!=0)
|
||||
return pior;
|
||||
return Math.toIntExact(a.size - b.size);
|
||||
});
|
||||
|
||||
is_not_reloading=true;
|
||||
|
||||
|
|
|
@ -8,12 +8,14 @@ import finalforeach.cosmicreach.networking.packets.MessagePacket;
|
|||
import finalforeach.cosmicreach.networking.server.ServerSingletons;
|
||||
import finalforeach.cosmicreach.savelib.utils.TriConsumer;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import net.pietru.cookie_utils.permissions.Permissions;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static net.pietru.cookie_utils.api.Region.reload_area_player_perms;
|
||||
import static net.pietru.cookie_utils.api.Region.reload_regions;
|
||||
import static net.pietru.cookie_utils.permissions.Permissions.reload_perm_groups;
|
||||
|
||||
public class TextCommands {
|
||||
public static final Map<String, TriConsumer<String[], NetworkIdentity, ChannelHandlerContext>> commands = new HashMap<>();
|
||||
|
@ -23,6 +25,9 @@ public class TextCommands {
|
|||
return;
|
||||
if (!commands.containsKey(args[0]))
|
||||
return;
|
||||
Account account = ServerSingletons.getAccount(id);
|
||||
if (!Permissions.has_perm(account.getUniqueId(),args[0]))
|
||||
return;
|
||||
TriConsumer<String[], NetworkIdentity, ChannelHandlerContext> cmd = commands.get(args[0]);
|
||||
cmd.accept(args, id, ctx);
|
||||
}
|
||||
|
@ -52,6 +57,25 @@ public class TextCommands {
|
|||
packet.playerUniqueId=account.getUniqueId();
|
||||
packet.setupAndSend(channelHandlerContext);
|
||||
});
|
||||
|
||||
|
||||
commands.put("perm_code",(args, networkIdentity, channelHandlerContext) -> {
|
||||
Account account = ServerSingletons.getAccount(networkIdentity);
|
||||
if (args.length==1)
|
||||
Permissions.generate_new_code();
|
||||
if (args.length==2)
|
||||
Permissions.check_code_and_add_user(args[1],account.getUniqueId());
|
||||
});
|
||||
|
||||
commands.put("perm_clear",(args, networkIdentity, channelHandlerContext) -> {
|
||||
Account account = ServerSingletons.getAccount(networkIdentity);
|
||||
if (args.length==1) {
|
||||
Permissions.clear_user_perm(account.getUniqueId(),true);
|
||||
System.out.println("[Permissions] Users %s permission revoked - user request...".replace("%s",account.getUniqueId()));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
commands.put("reload_regions",(args, networkIdentity, channelHandlerContext) -> {
|
||||
MessagePacket packet = null;
|
||||
if (args.length==1) {
|
||||
|
@ -69,20 +93,12 @@ public class TextCommands {
|
|||
packet.setupAndSend(channelHandlerContext);
|
||||
});
|
||||
|
||||
commands.put("perm_code",(args, networkIdentity, channelHandlerContext) -> {
|
||||
commands.put("reload_groups",(args, networkIdentity, channelHandlerContext) -> {
|
||||
MessagePacket packet = new MessagePacket("Reloaded regions...");;
|
||||
reload_perm_groups();
|
||||
Account account = ServerSingletons.getAccount(networkIdentity);
|
||||
if (args.length==1)
|
||||
Permissions.generate_new_code();
|
||||
if (args.length==2)
|
||||
Permissions.check_code_and_add_user(args[1],account.getUniqueId());
|
||||
});
|
||||
|
||||
commands.put("perm_clear",(args, networkIdentity, channelHandlerContext) -> {
|
||||
Account account = ServerSingletons.getAccount(networkIdentity);
|
||||
if (args.length==1) {
|
||||
Permissions.clear_user_perm(account.getUniqueId(),true);
|
||||
System.out.println("[Permissions] Users %s permission revoked - user request...".replace("%s",account.getUniqueId()));
|
||||
}
|
||||
packet.playerUniqueId=account.getUniqueId();
|
||||
packet.setupAndSend(channelHandlerContext);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ import finalforeach.cosmicreach.networking.packets.blocks.BreakBlockPacket;
|
|||
import finalforeach.cosmicreach.networking.server.ServerSingletons;
|
||||
import finalforeach.cosmicreach.world.Zone;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import net.pietru.cookie_utils.api.Permissions;
|
||||
import net.pietru.cookie_utils.permissions.Permissions;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
|
|
@ -11,7 +11,7 @@ import finalforeach.cosmicreach.networking.packets.blocks.PlaceBlockPacket;
|
|||
import finalforeach.cosmicreach.networking.server.ServerSingletons;
|
||||
import finalforeach.cosmicreach.world.Zone;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import net.pietru.cookie_utils.api.Permissions;
|
||||
import net.pietru.cookie_utils.permissions.Permissions;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
|
|
@ -11,7 +11,7 @@ import finalforeach.cosmicreach.networking.packets.blocks.InteractBlockPacket;
|
|||
import finalforeach.cosmicreach.networking.server.ServerSingletons;
|
||||
import finalforeach.cosmicreach.world.Zone;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import net.pietru.cookie_utils.api.Permissions;
|
||||
import net.pietru.cookie_utils.permissions.Permissions;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
|
|
@ -11,7 +11,7 @@ import finalforeach.cosmicreach.networking.packets.MessagePacket;
|
|||
import finalforeach.cosmicreach.networking.packets.entities.PlayerPositionPacket;
|
||||
import finalforeach.cosmicreach.networking.server.ServerSingletons;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import net.pietru.cookie_utils.api.Permissions;
|
||||
import net.pietru.cookie_utils.permissions.Permissions;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
|
|
@ -2,6 +2,7 @@ package net.pietru.cookie_utils.mixins;
|
|||
|
||||
import finalforeach.cosmicreach.networking.server.ServerSingletons;
|
||||
import net.pietru.cookie_utils.api.Region;
|
||||
import net.pietru.cookie_utils.permissions.Permissions;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
|
@ -12,6 +13,8 @@ public class ServerSingletonsMixin {
|
|||
|
||||
@Inject(method = "create", at = @At("HEAD"))
|
||||
private static void on_singletons_create(CallbackInfo ci){
|
||||
Permissions.reload_perm_groups();
|
||||
Permissions.reload_player_groups(true);
|
||||
Region.reload_regions();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
package net.pietru.cookie_utils.permissions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class GroupPerms {
|
||||
public String group_id = "";
|
||||
public ArrayList<String> perms = new ArrayList<>();
|
||||
|
||||
public boolean has_perm(String perm){
|
||||
return perms.contains(perm);
|
||||
}
|
||||
|
||||
public static GroupPerms get_default_perms(){
|
||||
GroupPerms val = new GroupPerms();
|
||||
val.group_id="default";
|
||||
val.perms.add("gpos");
|
||||
val.perms.add("my_zone");
|
||||
val.perms.add("my_id");
|
||||
val.perms.add("perm_code");
|
||||
val.perms.add("perm_clear");
|
||||
return val;
|
||||
}
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
package net.pietru.cookie_utils.api;
|
||||
package net.pietru.cookie_utils.permissions;
|
||||
|
||||
import com.badlogic.gdx.utils.Json;
|
||||
import com.badlogic.gdx.utils.JsonValue;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -25,13 +24,12 @@ public class ObjectPermList {
|
|||
return bool_perms.getOrDefault(key,def_val);
|
||||
}
|
||||
|
||||
public static JsonValue get_default_perms(JsonValue val){
|
||||
public static void get_default_perms(JsonValue val){
|
||||
val.addChild("canPlace", new JsonValue(false));
|
||||
val.addChild("canBreak", new JsonValue(false));
|
||||
val.addChild("canInteract", new JsonValue(false));
|
||||
|
||||
val.addChild("canExplode", new JsonValue(false));
|
||||
val.addChild("canEnter", new JsonValue(true));
|
||||
return val;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,177 @@
|
|||
package net.pietru.cookie_utils.permissions;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import com.badlogic.gdx.utils.Json;
|
||||
import com.badlogic.gdx.utils.JsonWriter;
|
||||
import finalforeach.cosmicreach.io.SaveLocation;
|
||||
import net.pietru.cookie_utils.api.Delay;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Random;
|
||||
|
||||
import static net.pietru.cookie_utils.utils.directory_utils.get_path_string;
|
||||
|
||||
public class Permissions {
|
||||
static Json json = new Json();
|
||||
public static Array<String> playerUniqueIds = new Array<>();
|
||||
|
||||
public static String code = "";
|
||||
|
||||
static Thread t;
|
||||
static Map<String,Thread> player_revoke_perm_timer = new HashMap<>();
|
||||
|
||||
static GroupPerms default_group;
|
||||
static Map<String,GroupPerms> groupPermsMap = new HashMap<>();
|
||||
static Map<String,String> player_group = new HashMap<>();
|
||||
|
||||
public static void reload_player_groups(boolean load){
|
||||
groupPermsMap.clear();
|
||||
|
||||
File def = new File(get_path_string(SaveLocation.getSaveFolder().getPath(),"player_groups.json"));
|
||||
if (load && def.exists()) {
|
||||
try {
|
||||
player_group = json.fromJson(HashMap.class, Gdx.files.absolute(def.getPath()));
|
||||
} catch (Exception ignored) {
|
||||
System.out.println("[GROUPS] Encountered exception while loading player groups...");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
Json json = new Json();
|
||||
json.setOutputType(JsonWriter.OutputType.json);
|
||||
BufferedWriter writer = new BufferedWriter(new FileWriter(def.getPath()));
|
||||
writer.write(json.prettyPrint(player_group));
|
||||
writer.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
System.out.println("[GROUPS] Saved player groups.");
|
||||
}
|
||||
|
||||
public static void reload_perm_groups(){
|
||||
groupPermsMap.clear();
|
||||
|
||||
File perms_folder = new File(get_path_string(SaveLocation.getSaveFolder().getPath(),"perm_groups"));
|
||||
if (!perms_folder.exists()) {
|
||||
perms_folder.mkdirs();
|
||||
}
|
||||
File def = new File(get_path_string(perms_folder.getPath(),"default.json"));
|
||||
File[] perms = perms_folder.listFiles(((dir, name) -> name.endsWith(".json")));
|
||||
if (perms!=null) {
|
||||
System.out.println("[GROUPS] Trying to load %s perm groups.".replace("%s",String.valueOf(perms.length)));
|
||||
for (File f : perms) {
|
||||
GroupPerms group;
|
||||
try {
|
||||
group=json.fromJson(GroupPerms.class,Gdx.files.absolute(f.getPath()));
|
||||
} catch (Exception ignored){
|
||||
System.out.println("[GROUPS] Perm group file \"%s\" had encountered exception while loading...".replace("%s", f.getPath()));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (f.getPath().equals(def.getPath())) {
|
||||
group.group_id = "default";
|
||||
default_group=group;
|
||||
}
|
||||
|
||||
if (group.group_id.isEmpty())
|
||||
continue;
|
||||
|
||||
|
||||
groupPermsMap.put(group.group_id,group);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
if (!def.exists()) {
|
||||
Json json = new Json();
|
||||
json.setOutputType(JsonWriter.OutputType.json);
|
||||
BufferedWriter writer = new BufferedWriter(new FileWriter(def.getPath()));
|
||||
writer.write(json.prettyPrint(GroupPerms.get_default_perms()));
|
||||
writer.close();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
System.out.println("[GROUPS] Loaded %s permissions.".replace("%s",String.valueOf(groupPermsMap.size())));
|
||||
}
|
||||
|
||||
public static boolean has_perm(String playerId,String perm){
|
||||
GroupPerms group = default_group;
|
||||
if (player_group.containsKey(playerId))
|
||||
if (groupPermsMap.containsKey(player_group.get(playerId)))
|
||||
group=groupPermsMap.get(player_group.get(playerId));
|
||||
return has_user_special_perm(playerId) || group.has_perm(perm);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
///////////sudo code/////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public static void generate_new_code(){
|
||||
code = generateRandomString(6);
|
||||
System.out.println("[Permissions] New perm code is %s".replace("%s",code));
|
||||
// Create a new Thread object
|
||||
t = new Thread(new Delay(60,"reset_permission_code"));
|
||||
|
||||
// Start the thread
|
||||
t.start();
|
||||
}
|
||||
|
||||
public static void check_code_and_add_user(String cd, String playerId){
|
||||
if (playerUniqueIds.contains(playerId,false)) {
|
||||
System.out.println("[Permissions] Player %s tried re-verificate too early...".replace("%s", playerId));
|
||||
return;
|
||||
}
|
||||
if (code.isEmpty())
|
||||
return;
|
||||
if (!Objects.equals(cd, code))
|
||||
return;
|
||||
t.interrupt();
|
||||
code="";
|
||||
System.out.println("[Permissions] Player %s passed verification...".replace("%s",playerId));
|
||||
Map<String,String> data = new HashMap<>();
|
||||
data.put("id",playerId);
|
||||
Thread player_t = new Thread(new Delay(60*2,"revoke_usr_perm",data));
|
||||
player_t.start();
|
||||
player_revoke_perm_timer.put(playerId,player_t);
|
||||
playerUniqueIds.add(playerId);
|
||||
}
|
||||
|
||||
public static void clear_user_perm(String playerId, boolean stop_thread){
|
||||
while (Permissions.playerUniqueIds.contains(playerId,false))
|
||||
Permissions.playerUniqueIds.removeValue(playerId,false);
|
||||
if (stop_thread && Permissions.player_revoke_perm_timer.containsKey(playerId))
|
||||
Permissions.player_revoke_perm_timer.get(playerId).interrupt();
|
||||
Permissions.player_revoke_perm_timer.remove(playerId);
|
||||
}
|
||||
|
||||
public static boolean has_user_special_perm(String playerId){
|
||||
return playerUniqueIds.contains(playerId,false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static final String CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
|
||||
public static String generateRandomString(int length) {
|
||||
StringBuilder sb = new StringBuilder(length);
|
||||
Random random = new Random();
|
||||
for (int i = 0; i < length; i++) {
|
||||
sb.append(CHARACTERS.charAt(random.nextInt(CHARACTERS.length())));
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
package net.pietru.cookie_utils.api;
|
||||
package net.pietru.cookie_utils.permissions;
|
||||
|
||||
import com.badlogic.gdx.utils.Json;
|
||||
import com.badlogic.gdx.utils.JsonValue;
|
||||
|
||||
public class PlayerAreaPerm {
|
|
@ -0,0 +1,10 @@
|
|||
package net.pietru.cookie_utils.utils;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class directory_utils {
|
||||
|
||||
public static String get_path_string(String ...path_parts){
|
||||
return String.join(File.separator, path_parts);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue