Hey all,
I was developing Grand Exchange recently and I saw this being sent in the client. It didn't crash the client and I am also unaware if grand exchange caused this. I might have had it before but I'm not entirely sure.
Code:
java.lang.ArrayIndexOutOfBoundsException: 65535 | CS2: 621 v: 588 op: 3910
Not entirely sure where 65535 has come from but definitely seems wrong.
Method:
Code:
private static final void runClientScript(ClientScript clientScript, int maxLength) {
Error message:
Code:
} catch (Exception exception) {
if (((ClientScript) clientScript).name != null) {
za_Sub2.method1684(("Clientscript error in: " + ((ClientScript) clientScript).name), 4, (byte) 68);
StringBuffer stringbuffer = new StringBuffer(30);
stringbuffer.append("Clientscript error in: ").append(((ClientScript) clientScript).name).append("\n");
for (int i_289_ = scriptStackCount - 1; i_289_ >= 0; i_289_--)
stringbuffer.append("via: ")
.append(((ClientScript) (((ScriptState) scriptStates[i_289_]).clientScript)).name)
.append("\n");
stringbuffer.append("Op: ").append(opcode).append("\n");
String string = exception.getMessage();
if (string != null && string.length() > 0)
stringbuffer.append("Message: ").append(string).append("\n");
Class305_Sub1.method3585(exception, -125, stringbuffer.toString());
Class98_Sub46.sendDeveloperConsoleMessage(stringbuffer.toString(), -126);
} else {
StringBuffer stringbuffer = new StringBuffer(30);
stringbuffer.append("CS2: ").append(((Node) clientScript).hash).append(" ");
for (int i_290_ = scriptStackCount - 1; i_290_ >= 0; i_290_--)
stringbuffer.append("v: ").append(((Node) (((ScriptState) scriptStates[i_290_]).clientScript)).hash)
.append(" ");
stringbuffer.append("op: ").append(opcode);
stringbuffer.append(" maxLength: " + maxLength);
Class305_Sub1.method3585(exception, -125, stringbuffer.toString());
}
}
I am also unable to reproduce the error, but here is opcode 3910
Code:
if (opcode == 3910) {
int i_141_ = integerStack[--anInt1885];
int i_142_ = Class98_Sub10_Sub24.aClass101Array5666[i_141_].method1700(7);
integerStack[anInt1885++] = i_142_ == 0 ? 1 : 0;
return;
}
method1700 its calling:
Code:
final int method1700(int i) {
try {
if (i != 7) //Guessing dummy value
((GrandExchangeOffer) this).unknown = 29; //todo find out, this is amount being bought/sold or something?
return 0x7 & progress;
} catch (RuntimeException runtimeexception) {
throw Class64_Sub27.method667(runtimeexception, "gf.A(" + i + ')');
}
}
Here is how I view the exchange. Also everytime interface 105 (g.e) is sent that method is called so it seems to be handled only by this interface
Code:
/**
* Views the exchange.
*/
public void viewExchange() {
player.getInterfaceManager().closeInventoryInterface();
player.getInterfaceManager().closeChatboxInterface(true);
sendViewItem(-1);
sendSlot(-1);
sendItemAmount(0);
sendItemPrice(0);
sendScreen(VIEW_EXCHANGE_SCREEN);
closeSearch();
player.getInterfaceManager().sendInterface(105);
usingService = true;
}
Any help is welcome, I'm wondering if I'm missing to send something or a value is off causing this or it could be another client script I am sending elsewhere for something else but it does not seem like it.
At the moment I've implement all functionality for grand exchange for every screen apart from confirming an offer. I am currently in the process of setting up my db to handle g.e transactions. I was also wondering if it could be that I am not sending the grand exchange packet for any offers on the screen. Am i to still send it regardless of if there are any offers or not?