Thread: bank interface doesn't show all items in the bank...? Im stumped

Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17
  1. #11  
    nice


    Join Date
    Jul 2014
    Posts
    740
    Thanks given
    382
    Thanks received
    562
    Rep Power
    4239
    Quote Originally Posted by Perplexity View Post
    because it didn't

    Unless more needs changing than .height that does not achieve what I was asking
    yes it does, u also need to update other things, something in RSInterface(Forgot the name) otherwise ull get a Arrayindexofbounds if i can remember correctly
    and obv update the max capacity server-sided...
    Reply With Quote  
     

  2. #12  
    Perplexity owner

    Join Date
    Feb 2011
    Posts
    171
    Thanks given
    32
    Thanks received
    15
    Rep Power
    0
    Quote Originally Posted by Suic View Post
    yes it does, u also need to update other things, something in RSInterface(Forgot the name) otherwise ull get a Arrayindexofbounds if i can remember correctly
    and obv update the max capacity server-sided...

    I guess I will have to try and find what else needs changing in RSInterface then
    Reply With Quote  
     

  3. #13  
    nice


    Join Date
    Jul 2014
    Posts
    740
    Thanks given
    382
    Thanks received
    562
    Rep Power
    4239
    Quote Originally Posted by Perplexity View Post
    I guess I will have to try and find what else needs changing in RSInterface then
    Yes, i have no idea how u haven't already after days tho.
    Reply With Quote  
     

  4. #14  
    Perplexity owner

    Join Date
    Feb 2011
    Posts
    171
    Thanks given
    32
    Thanks received
    15
    Rep Power
    0
    Quote Originally Posted by Suic View Post
    Yes, i have no idea how u haven't already after days tho.


    This post above is making out that it's something very obvious, maybe it is? I just can't find what else needs changing because I have no idea what is causing the array out of bounds

    As you decided to post this as a personal attack, I will return the favour.
    looking at some of your previous posts you have made makes me wonder do you actually not "remember" what else needs changing or do you also not know yourself.
    you then proceed to tell me "and obv update the max capacity server-sided..." When the very first line of my thread stated that was what I had done and
    Reply With Quote  
     

  5. #15  
    Registered Member
    TheChosenOne's Avatar
    Join Date
    Jan 2013
    Posts
    967
    Thanks given
    47
    Thanks received
    161
    Rep Power
    366
    I hope I'm correct with this explanation.

    Take a look at my code inside the unpack method for (game)interfaces

    Code:
    if(gInterface.interfaceType == 2){
        gInterface.containerItemIds = new int[gInterface.width * gInterface.height];
        gInterface.containerStackSizes = new int[gInterface.width * gInterface.height];
        gInterface.allowClick = stream.getUByte() == 1;
        gInterface.isInventoryInterface = stream.getUByte() == 1;
        gInterface.usableItemInterface = stream.getUByte() == 1;
        gInterface.allowDrag = stream.getUByte() == 1;
        gInterface.invSpritePadX = stream.getUByte();
        gInterface.invSpritePadY = stream.getUByte();
        gInterface.spritesX = new int[20];
        gInterface.spritesY = new int[20];
        gInterface.sprites = new Sprite[20];
        for(int j2 = 0; j2 < 20; j2++){
            int k3 = stream.getUByte();
            if(k3 == 1){
                gInterface.spritesX[j2] = stream.getSShort();
                gInterface.spritesY[j2] = stream.getSShort();
                String fileName = stream.getString();
                if(streamLoader_1 != null && fileName.length() > 0){
                    int separator = fileName.lastIndexOf(",");
                    gInterface.sprites[j2] = getSprite(Integer.parseInt(fileName.substring(separator + 1)), streamLoader_1, fileName.substring(0, separator));
                }
            }
        }
        gInterface.actions = new String[5];
        for(int l3 = 0; l3 < gInterface.actions.length; l3++){
            gInterface.actions[l3] = stream.getString();
            if(gInterface.actions[l3].length() == 0)
                gInterface.actions[l3] = null;
            if(gInterface.parentId == 1644)
                gInterface.actions[2] = "Operate";
        }
    }
    It's refactored so you'll have to figure out how various variables are called in your source code.

    Make sure both containerItemIds and containerStackSizes have the correct size as those are the most likely candidates of your ArrayIndexOutOfBoundsException.

    EDIT:
    I forgot to answer your original question.
    The maximum of 20 items shown.
    This is indeed something you'd need to increase.
    In my above code look for spritesX, spritesY and sprites. The 20 you see there is the maximum you encounter.
    BUT that's not all.
    There's also some code preventing processing more than 20 slots in those arrays.
    If you look for usages of those arrays you'll find they're ignored when using an index of 20 or higher.
    You'll need to compare this to the size of the array instead.

    Right now I myself can find it in 3 places + once in the unpack method.
    It looks something like this:
    Code:
    if(parsedSlot < 20){
        spriteSlotX += gameInterface.spritesX[parsedSlot];
        spriteSlotY += gameInterface.spritesY[parsedSlot];
    }
    Code:
    if(slot < 20){
        j3 += childInterface.spritesX[slot];
        k3 += childInterface.spritesY[slot];
    }
    Code:
    } else if(gameInterface.sprites != null && parsedSlot < 20){
        Sprite class30_sub2_sub1_sub1_1 = gameInterface.sprites[parsedSlot];
        if(class30_sub2_sub1_sub1_1 != null)
            class30_sub2_sub1_sub1_1.drawSprite(spriteSlotX, spriteSlotY);
    }
    DO NOT change this to the new size of container. But change this to the maximum number of items you want to display.

    EDIT 2:
    Now that I think about it, I have no idea why an inventory can display more than 20 items.
    Last edited by TheChosenOne; 04-25-2019 at 09:29 PM. Reason: Forgot to answer actual question
    Reply With Quote  
     

  6. #16  
    nice


    Join Date
    Jul 2014
    Posts
    740
    Thanks given
    382
    Thanks received
    562
    Rep Power
    4239
    Quote Originally Posted by Perplexity View Post
    This post above is making out that it's something very obvious, maybe it is? I just can't find what else needs changing because I have no idea what is causing the array out of bounds

    As you decided to post this as a personal attack, I will return the favour.
    looking at some of your previous posts you have made makes me wonder do you actually not "remember" what else needs changing or do you also not know yourself.
    you then proceed to tell me "and obv update the max capacity server-sided..." When the very first line of my thread stated that was what I had done and
    huh lol, afaik i have never had an issue with this. {Another person posted a month ago who had a similiar issue, that is the only time i tried to increase it myself, and it took < 5mins to do it all} so i was just surprised that u haven't figured this out in days, even after i basically told u how to do most of it, not intended as a personal attack at all.
    Reply With Quote  
     

  7. #17  
    Extreme Donator


    Join Date
    Oct 2010
    Posts
    2,853
    Thanks given
    1,213
    Thanks received
    1,622
    Rep Power
    5000
    You need to increase the inv[] and invStackSizes[], just take a look in opcode 91 to find the naming your client uses. Make them have the same length as the server.

    Code:
                } else if (opcode == 91) {
                    int amount = byteBuffer.getShort();
                    inv = new int[amount];
                    invStackSizes = new int[amount];
                    for (int x = 0; x < amount; x++) {
                        inv[x] = byteBuffer.getInt();
                        invStackSizes[x] = byteBuffer.getInt();
                    }
    [Today 01:29 AM] RSTrials: Nice 0.97 Win/Loss Ratio luke. That's pretty bad.
    [Today 01:30 AM] Luke132: Ok u fucking moron i forgot i could influence misc.random
    Reply With Quote  
     

  8. Thankful users:


Page 2 of 2 FirstFirst 12

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. Removing all items in edge bank
    By Matt _ in forum Requests
    Replies: 8
    Last Post: 08-29-2011, 12:45 AM
  2. Replies: 6
    Last Post: 06-13-2011, 06:46 PM
  3. [508]Withdraw-All but one option in the bank
    By Laxika in forum Configuration
    Replies: 5
    Last Post: 07-08-2009, 12:49 PM
  4. Replies: 9
    Last Post: 01-27-2009, 03:22 PM
  5. All Items in Item.cfg(Up to 15489)
    By Sir Raśl in forum Configuration
    Replies: 3
    Last Post: 11-28-2008, 02:47 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
  •