mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-03 00:37:55 +00:00
Script/server bin folder args
This commit is contained in:
@@ -8,6 +8,8 @@ import org.parabot.core.ui.ServerSelector;
|
||||
import org.parabot.core.ui.utils.UILog;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
@@ -89,6 +91,12 @@ public final class Landing {
|
||||
case "-dump":
|
||||
Core.setDump(true);
|
||||
break;
|
||||
case "-scriptsbin":
|
||||
Directories.setScriptCompiledDirectory(new File(args[++i]));
|
||||
break;
|
||||
case "-serversbin":
|
||||
Directories.setServerCompiledDirectory(new File(args[++i]));
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ public class Directories {
|
||||
private static Map<String, File> cached;
|
||||
|
||||
static {
|
||||
cached = new HashMap<String, File>();
|
||||
cached = new HashMap<String, File>();
|
||||
switch (OperatingSystem.getOS()) {
|
||||
case WINDOWS:
|
||||
cached.put("Root", new JFileChooser().getFileSystemView().getDefaultDirectory());
|
||||
@@ -36,6 +36,30 @@ public class Directories {
|
||||
cached.put("Cache", new File(cached.get("Root"), "/Parabot/cache/"));
|
||||
Core.verbose("Directories cached.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Set script bin folder
|
||||
* @param f
|
||||
*/
|
||||
public static void setScriptCompiledDirectory(File f) {
|
||||
if(!f.isDirectory()) {
|
||||
throw new IllegalArgumentException(f + "is not a directory.");
|
||||
}
|
||||
cached.put("Compiled", f);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set server bin folder
|
||||
* @param f
|
||||
*/
|
||||
public static void setServerCompiledDirectory(File f) {
|
||||
if(!f.isDirectory()) {
|
||||
throw new IllegalArgumentException(f + "is not a directory.");
|
||||
}
|
||||
cached.put("Servers", f);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns the root directory outside of the main Parabot folder.
|
||||
|
||||
Reference in New Issue
Block a user