Thread: Packet parsing? Makes disconnect when you click on an object.

Results 1 to 9 of 9
  1. #1 Packet parsing? Makes disconnect when you click on an object. 
    Registered Member
    Join Date
    Nov 2009
    Posts
    185
    Thanks given
    5
    Thanks received
    0
    Rep Power
    1
    Ok so i've just added the 90% mining on my server, and this is what i get:

    Code:
    Exception encountered while parsing incoming packets from Skin.
    java.lang.ArrayIndexOutOfBoundsException: -10
            at Mining.mineOre(Mining.java:63)
            at client.parseIncomingPackets(client.java:12904)
            at client.packetProcess(client.java:17109)
            at PlayerHandler.process(PlayerHandler.java:268)
            at process.run(process.java:23)
            at java.lang.Thread.run(Unknown Source)
    Any help on what to fix please?

    line 63 + mineOre method:
    Code:
    	//Starts initial Mine
    	public void mineOre(int rock) {
    		int index = Arrays.binarySearch(rocks, rock);
    		if(index != -1) {
    			if (c.playerLevel[c.playerMining] < miningInfo[index][1]) {
    				c.sM("You don't have high enough level to mine this rock!");
    				return;
    			}
    			mineOre = miningInfo[index][0];
    			mineExp = 4*miningInfo[index][2];
    			beginMine(rock);
    		}
    	}
    2nd debug, requested by Impulser.
    Code:
    DEBUG: c.playerMining = 14, index = -10
    Exception encountered while parsing incoming packets from Skin.
    java.lang.ArrayIndexOutOfBoundsException: -10
            at Mining.mineOre(Mining.java:65)
            at client.parseIncomingPackets(client.java:12904)
            at client.packetProcess(client.java:17109)
            at PlayerHandler.process(PlayerHandler.java:268)
            at process.run(process.java:23)
            at java.lang.Thread.run(Unknown Source)
    Update: Creation X vAlpha 1.0 - 80%


    -Removed

    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Jan 2008
    Posts
    2,345
    Thanks given
    20
    Thanks received
    575
    Rep Power
    1202
    Post your mineOre method. (Point out line 63 of the Mining class as well, should be in the mineOre method.)
    Reply With Quote  
     

  3. #3  
    0x2B | ~0x2B


    Impulser's Avatar
    Join Date
    Jul 2006
    Posts
    1,305
    Thanks given
    389
    Thanks received
    335
    Rep Power
    2751
    Something in your server is trying to read the -10th index of an array which is not possible since an array's lowest index is zero.
    Reply With Quote  
     

  4. #4  
    Registered Member
    AMG A Bear's Avatar
    Join Date
    Jun 2008
    Posts
    1,157
    Thanks given
    27
    Thanks received
    87
    Rep Power
    945
    Dont even wanna know why you did some shit like this:

    java.lang.ArrayIndexOutOfBoundsException: -10

    sendMessage(messages[-10] + " Because -10 is a cool number.");

    rofl
    Quote Originally Posted by The Night Life View Post
    Errm. I had a similar idea a very long time ago, about instead of current rs's gameframe, (622) making a rsps with about a 1645 or something. Make it look like you walked outside. I even gathered proffesional computer programmers to help, but bailed on the idea after i realized if we all worked on it non-stop for months at a time, we'd barely get any progress. (unless you wanted to half ass it)
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Nov 2009
    Posts
    185
    Thanks given
    5
    Thanks received
    0
    Rep Power
    1
    Bump plx
    Update: Creation X vAlpha 1.0 - 80%


    -Removed

    Reply With Quote  
     

  6. #6  
    Registered Member
    Division's Avatar
    Join Date
    Dec 2009
    Age
    26
    Posts
    2,208
    Thanks given
    41
    Thanks received
    78
    Rep Power
    97
    Oh damn, i fixed this last time for myself, and i dont know it anymore how i did it...
    2mins later...
    Oh wait i know it! In your case 132 did it end with an "break;"
    Cause last time i accidentely deleted it and it causes an dc when clicking objects, so make sure it ends with an break;
    Reply With Quote  
     

  7. #7  
    0x2B | ~0x2B


    Impulser's Avatar
    Join Date
    Jul 2006
    Posts
    1,305
    Thanks given
    389
    Thanks received
    335
    Rep Power
    2751
    Try This:

    Code:
    	//Starts initial Mine
    	public void mineOre(int rock) {
    		Arrays.sort(rocks);
    		int index = Arrays.binarySearch(rocks, rock);
    		if(index != -1) {
    			if (c.playerLevel[c.playerMining] < miningInfo[index][1]) {
    				c.sM("You don't have high enough level to mine this rock!");
    				return;
    			}
    			mineOre = miningInfo[index][0];
    			mineExp = 4*miningInfo[index][2];
    			beginMine(rock);
    		}
    	}
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Nov 2009
    Posts
    185
    Thanks given
    5
    Thanks received
    0
    Rep Power
    1
    Nope
    Update: Creation X vAlpha 1.0 - 80%


    -Removed

    Reply With Quote  
     

  9. #9  
    Registered Member
    Mister Maggot's Avatar
    Join Date
    Dec 2008
    Posts
    7,246
    Thanks given
    3,283
    Thanks received
    2,874
    Discord
    View profile
    Rep Power
    5000
    Try not to point at a non-existing index on an array..
    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

Tags for this Thread

View Tag Cloud

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •