mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-06 16:50:39 +00:00
Merge branch 'development' into feature/launch-by-uuid
This commit is contained in:
@@ -40,6 +40,7 @@ public class AddCallbackAdapter implements Injectable, Opcodes {
|
|||||||
Label l0 = new Label();
|
Label l0 = new Label();
|
||||||
inject.add(new LabelNode(l0));
|
inject.add(new LabelNode(l0));
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
|
if (args != null) {
|
||||||
for (int arg : args) {
|
for (int arg : args) {
|
||||||
if (Modifier.isStatic(method.access)) {
|
if (Modifier.isStatic(method.access)) {
|
||||||
int loadOpcode = ASMUtils.getLoadOpcode(types[arg]
|
int loadOpcode = ASMUtils.getLoadOpcode(types[arg]
|
||||||
@@ -53,6 +54,7 @@ public class AddCallbackAdapter implements Injectable, Opcodes {
|
|||||||
.getDescriptor()), arg + 1));
|
.getDescriptor()), arg + 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
inject.add(new MethodInsnNode(INVOKESTATIC,
|
inject.add(new MethodInsnNode(INVOKESTATIC,
|
||||||
this.invokeClass, this.invokeMethod,
|
this.invokeClass, this.invokeMethod,
|
||||||
this.desc));
|
this.desc));
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ public class Callback implements Injectable {
|
|||||||
this.invokeMethod = callbackMethod;
|
this.invokeMethod = callbackMethod;
|
||||||
this.desc = callbackDesc;
|
this.desc = callbackDesc;
|
||||||
this.conditional = conditional;
|
this.conditional = conditional;
|
||||||
|
if (args.length() > 0) {
|
||||||
if (args.contains(",")) {
|
if (args.contains(",")) {
|
||||||
final String[] strArgs = args.split(",");
|
final String[] strArgs = args.split(",");
|
||||||
this.args = new int[strArgs.length];
|
this.args = new int[strArgs.length];
|
||||||
@@ -33,7 +34,8 @@ public class Callback implements Injectable {
|
|||||||
this.args[i] = Integer.parseInt(strArgs[i]);
|
this.args[i] = Integer.parseInt(strArgs[i]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.args = new int[]{ Integer.parseInt(args) };
|
this.args = new int[]{Integer.parseInt(args)};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,8 +65,17 @@ public class XMLHookParser extends HookParser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static final String getValue(String tag, Element element) {
|
private static final String getValue(String tag, Element element) {
|
||||||
|
if (element.getElementsByTagName(tag).item(0) == null) {
|
||||||
|
throw new NullPointerException("MISSING HOOK TAG: The '" + tag + "' xml tag is missing from one of the hooks of type: " + element.getParentNode().getNodeName());
|
||||||
|
}
|
||||||
NodeList nodes = element.getElementsByTagName(tag).item(0)
|
NodeList nodes = element.getElementsByTagName(tag).item(0)
|
||||||
.getChildNodes();
|
.getChildNodes();
|
||||||
|
if (nodes.getLength() == 0 || nodes.item(0) == null) {
|
||||||
|
if (Core.inVerboseMode()) {
|
||||||
|
System.err.println("WARNING: Invalid Hook " + tag + " subnode. Tag is missing or empty?");
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
Node node = (Node) nodes.item(0);
|
Node node = (Node) nodes.item(0);
|
||||||
return node.getNodeValue();
|
return node.getNodeValue();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user