mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-06 00:37:52 +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 org.parabot.core.ui.utils.UILog;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -89,6 +91,12 @@ public final class Landing {
|
|||||||
case "-dump":
|
case "-dump":
|
||||||
Core.setDump(true);
|
Core.setDump(true);
|
||||||
break;
|
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;
|
private static Map<String, File> cached;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
cached = new HashMap<String, File>();
|
cached = new HashMap<String, File>();
|
||||||
switch (OperatingSystem.getOS()) {
|
switch (OperatingSystem.getOS()) {
|
||||||
case WINDOWS:
|
case WINDOWS:
|
||||||
cached.put("Root", new JFileChooser().getFileSystemView().getDefaultDirectory());
|
cached.put("Root", new JFileChooser().getFileSystemView().getDefaultDirectory());
|
||||||
@@ -36,6 +36,30 @@ public class Directories {
|
|||||||
cached.put("Cache", new File(cached.get("Root"), "/Parabot/cache/"));
|
cached.put("Cache", new File(cached.get("Root"), "/Parabot/cache/"));
|
||||||
Core.verbose("Directories cached.");
|
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.
|
* Returns the root directory outside of the main Parabot folder.
|
||||||
|
|||||||
Reference in New Issue
Block a user