Thread: Client script issue

Results 1 to 3 of 3
  1. #1 Client script issue 
    Registered Member
    Join Date
    Sep 2020
    Posts
    14
    Thanks given
    13
    Thanks received
    5
    Rep Power
    29
    Fixed
    Reply With Quote  
     

  2. #2  
    Registered Member
    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,448
    Thanks given
    588
    Thanks received
    605
    Rep Power
    238
    Quote Originally Posted by parabellum View Post
    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?
    Code:
    			if (i != 7) //Guessing dummy value
    				((GrandExchangeOffer) this).unknown = 29; //todo find out, this is amount being bought/sold or something?
    This is dead code, it's just there to obfuscate and make it harder to understand the code. You can safely remove it along with the parameter, after confirming the parameter is always 7.

    I think your problem is probably this:

    Code:
    		sendViewItem(-1);
    		sendSlot(-1);
    The -1 overflows and become 65535. Have you tried sending 0 for both instead?
    Project thread
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member
    Join Date
    Sep 2020
    Posts
    14
    Thanks given
    13
    Thanks received
    5
    Rep Power
    29
    Quote Originally Posted by clem585 View Post
    Code:
    			if (i != 7) //Guessing dummy value
    				((GrandExchangeOffer) this).unknown = 29; //todo find out, this is amount being bought/sold or something?
    This is dead code, it's just there to obfuscate and make it harder to understand the code. You can safely remove it along with the parameter, after confirming the parameter is always 7.

    I think your problem is probably this:

    Code:
    		sendViewItem(-1);
    		sendSlot(-1);
    The -1 overflows and become 65535. Have you tried sending 0 for both instead?
    Thanks turns out this error was from me experimenting with varps using a command too
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Client Scripts
    By dragonkk in forum Configuration
    Replies: 12
    Last Post: 01-16-2012, 10:21 PM
  2. Replies: 3
    Last Post: 08-14-2010, 06:06 PM
  3. client music issues...
    By Mr Reece in forum Help
    Replies: 2
    Last Post: 12-14-2009, 01:51 AM
  4. [508] Client/Server Issue
    By Lighty in forum Help
    Replies: 0
    Last Post: 05-05-2009, 05:51 PM
  5. Client Compile Issues
    By -Rave King- in forum Help
    Replies: 2
    Last Post: 02-08-2009, 09:31 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •