mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-10-01 02:17:22 +00:00
Reformat of parse package
This commit is contained in:
@@ -1,33 +1,25 @@
|
|||||||
package org.parabot.core.parsers;
|
package org.parabot.core.parsers;
|
||||||
|
|
||||||
import java.net.URL;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
import javax.xml.parsers.DocumentBuilder;
|
|
||||||
import javax.xml.parsers.DocumentBuilderFactory;
|
|
||||||
|
|
||||||
import org.parabot.core.asm.adapters.AddInterfaceAdapter;
|
import org.parabot.core.asm.adapters.AddInterfaceAdapter;
|
||||||
import org.parabot.core.asm.interfaces.Injectable;
|
import org.parabot.core.asm.interfaces.Injectable;
|
||||||
import org.parabot.core.asm.wrappers.Callback;
|
import org.parabot.core.asm.wrappers.*;
|
||||||
import org.parabot.core.asm.wrappers.Getter;
|
|
||||||
import org.parabot.core.asm.wrappers.Interface;
|
|
||||||
import org.parabot.core.asm.wrappers.Invoker;
|
|
||||||
import org.parabot.core.asm.wrappers.Setter;
|
|
||||||
import org.parabot.core.asm.wrappers.Super;
|
|
||||||
import org.parabot.environment.api.utils.WebUtil;
|
import org.parabot.environment.api.utils.WebUtil;
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.w3c.dom.Element;
|
import org.w3c.dom.Element;
|
||||||
import org.w3c.dom.Node;
|
import org.w3c.dom.Node;
|
||||||
import org.w3c.dom.NodeList;
|
import org.w3c.dom.NodeList;
|
||||||
|
|
||||||
|
import javax.xml.parsers.DocumentBuilder;
|
||||||
|
import javax.xml.parsers.DocumentBuilderFactory;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Parses an XML files which injects the hooks and other bytecode manipulation
|
* Parses an XML files which injects the hooks and other bytecode manipulation
|
||||||
* methods
|
* methods
|
||||||
*
|
*
|
||||||
* @author Everel
|
* @author Everel
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class HookParser {
|
public class HookParser {
|
||||||
private Document doc = null;
|
private Document doc = null;
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
package org.parabot.core.parsers.scripts;
|
package org.parabot.core.parsers.scripts;
|
||||||
|
|
||||||
import java.lang.reflect.Constructor;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.parabot.core.Directories;
|
import org.parabot.core.Directories;
|
||||||
import org.parabot.core.classpath.ClassPath;
|
import org.parabot.core.classpath.ClassPath;
|
||||||
import org.parabot.core.desc.ScriptDescription;
|
import org.parabot.core.desc.ScriptDescription;
|
||||||
@@ -12,12 +8,14 @@ import org.parabot.environment.scripts.Script;
|
|||||||
import org.parabot.environment.scripts.ScriptManifest;
|
import org.parabot.environment.scripts.ScriptManifest;
|
||||||
import org.parabot.environment.scripts.loader.JavaScriptLoader;
|
import org.parabot.environment.scripts.loader.JavaScriptLoader;
|
||||||
|
|
||||||
|
import java.lang.reflect.Constructor;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Parses locally stored java scripts
|
* Parses locally stored java scripts
|
||||||
*
|
*
|
||||||
* @author Everel
|
* @author Everel
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class LocalJavaScripts extends ScriptParser {
|
public class LocalJavaScripts extends ScriptParser {
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
package org.parabot.core.parsers.scripts;
|
package org.parabot.core.parsers.scripts;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FilenameFilter;
|
|
||||||
|
|
||||||
import org.parabot.core.Directories;
|
import org.parabot.core.Directories;
|
||||||
import org.parabot.core.desc.ScriptDescription;
|
import org.parabot.core.desc.ScriptDescription;
|
||||||
import org.parabot.environment.scripts.Category;
|
import org.parabot.environment.scripts.Category;
|
||||||
@@ -12,12 +8,14 @@ import org.parabot.environment.scripts.framework.PythonScript;
|
|||||||
import org.python.core.PyObject;
|
import org.python.core.PyObject;
|
||||||
import org.python.util.PythonInterpreter;
|
import org.python.util.PythonInterpreter;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FilenameFilter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Parses python scripts
|
* Parses python scripts
|
||||||
*
|
*
|
||||||
* @author Everel
|
* @author Everel
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class LocalPythonScripts extends ScriptParser {
|
public class LocalPythonScripts extends ScriptParser {
|
||||||
private PythonInterpreter interpreter = new PythonInterpreter();
|
private PythonInterpreter interpreter = new PythonInterpreter();
|
||||||
@@ -32,9 +30,7 @@ public class LocalPythonScripts extends ScriptParser {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* @param name - local var name
|
||||||
* @param name
|
|
||||||
* - local var name
|
|
||||||
* @return script instance
|
* @return script instance
|
||||||
*/
|
*/
|
||||||
public PythonScript getScript(String name) {
|
public PythonScript getScript(String name) {
|
||||||
@@ -71,13 +67,13 @@ public class LocalPythonScripts extends ScriptParser {
|
|||||||
Object ob;
|
Object ob;
|
||||||
|
|
||||||
String vip = "no";
|
String vip = "no";
|
||||||
if( (ob = interpreter.get("__vip__")) != null) {
|
if ((ob = interpreter.get("__vip__")) != null) {
|
||||||
final String isVip = ob.toString();
|
final String isVip = ob.toString();
|
||||||
vip = isVip.equals("True") ? "yes" : "no";
|
vip = isVip.equals("True") ? "yes" : "no";
|
||||||
}
|
}
|
||||||
|
|
||||||
String prem = "no";
|
String prem = "no";
|
||||||
if( (ob = interpreter.get("__premium__")) != null) {
|
if ((ob = interpreter.get("__premium__")) != null) {
|
||||||
final String isPrem = ob.toString();
|
final String isPrem = ob.toString();
|
||||||
prem = isPrem.equals("True") ? "yes" : "no";
|
prem = isPrem.equals("True") ? "yes" : "no";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package org.parabot.core.parsers.scripts;
|
package org.parabot.core.parsers.scripts;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.net.URL;
|
|
||||||
import org.parabot.core.Configuration;
|
import org.parabot.core.Configuration;
|
||||||
import org.parabot.core.desc.ScriptDescription;
|
import org.parabot.core.desc.ScriptDescription;
|
||||||
import org.parabot.core.forum.AccountManager;
|
import org.parabot.core.forum.AccountManager;
|
||||||
@@ -9,12 +7,13 @@ import org.parabot.core.forum.AccountManagerAccess;
|
|||||||
import org.parabot.environment.api.utils.WebUtil;
|
import org.parabot.environment.api.utils.WebUtil;
|
||||||
import org.parabot.environment.scripts.SDNScriptExecuter;
|
import org.parabot.environment.scripts.SDNScriptExecuter;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.net.URL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Parses scripts stored at parabot�s sdn
|
||||||
* Parses scripts stored at parabot´s sdn
|
|
||||||
*
|
*
|
||||||
* @author Everel
|
* @author Everel
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class SDNScripts extends ScriptParser {
|
public class SDNScripts extends ScriptParser {
|
||||||
private static AccountManager manager = null;
|
private static AccountManager manager = null;
|
||||||
@@ -79,7 +78,7 @@ public class SDNScripts extends ScriptParser {
|
|||||||
if (line.contains(", ")) {
|
if (line.contains(", ")) {
|
||||||
servers = line.split(", ");
|
servers = line.split(", ");
|
||||||
} else {
|
} else {
|
||||||
servers = new String[] { line };
|
servers = new String[]{line};
|
||||||
}
|
}
|
||||||
final ScriptDescription desc = new ScriptDescription(jarName, scriptName,
|
final ScriptDescription desc = new ScriptDescription(jarName, scriptName,
|
||||||
author, category, version, description,
|
author, category, version, description,
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package org.parabot.core.parsers.servers;
|
package org.parabot.core.parsers.servers;
|
||||||
|
|
||||||
import java.lang.reflect.Constructor;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import org.parabot.core.Directories;
|
import org.parabot.core.Directories;
|
||||||
import org.parabot.core.classpath.ClassPath;
|
import org.parabot.core.classpath.ClassPath;
|
||||||
import org.parabot.core.desc.ServerDescription;
|
import org.parabot.core.desc.ServerDescription;
|
||||||
@@ -10,12 +8,13 @@ import org.parabot.environment.servers.ServerManifest;
|
|||||||
import org.parabot.environment.servers.ServerProvider;
|
import org.parabot.environment.servers.ServerProvider;
|
||||||
import org.parabot.environment.servers.loader.ServerLoader;
|
import org.parabot.environment.servers.loader.ServerLoader;
|
||||||
|
|
||||||
|
import java.lang.reflect.Constructor;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Parses local server providers located in the servers directory
|
* Parses local server providers located in the servers directory
|
||||||
*
|
*
|
||||||
* @author Everel
|
* @author Everel
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class LocalServers extends ServerParser {
|
public class LocalServers extends ServerParser {
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,17 @@
|
|||||||
package org.parabot.core.parsers.servers;
|
package org.parabot.core.parsers.servers;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.net.URL;
|
|
||||||
|
|
||||||
import org.parabot.core.Configuration;
|
import org.parabot.core.Configuration;
|
||||||
import org.parabot.core.desc.ServerDescription;
|
import org.parabot.core.desc.ServerDescription;
|
||||||
import org.parabot.environment.api.utils.WebUtil;
|
import org.parabot.environment.api.utils.WebUtil;
|
||||||
import org.parabot.environment.servers.PublicServerExecuter;
|
import org.parabot.environment.servers.PublicServerExecuter;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.net.URL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Parses servers hosted on parabot
|
* Parses servers hosted on parabot
|
||||||
*
|
*
|
||||||
* @author Everel
|
* @author Everel
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class PublicServers extends ServerParser {
|
public class PublicServers extends ServerParser {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user