Thread: Slow container updating

Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1 Slow container updating 
    Respected Member


    George's Avatar
    Join Date
    Mar 2009
    Posts
    7,099
    Thanks given
    2,226
    Thanks received
    3,146
    Rep Power
    5000
    Issue (Happens when you first login):
    Attached image
    Attached image

    This generally happens when you update a container when you first login, also happens when updating a singular slot in the container (e.g drinking a potion, the potion will dissappere for a split of a second).

    What could be the issue? I don't imagine the time from encoding the packet to the client recieving it, is super slow.

    Packet 34 (updating a single slot)
    Code:
    			case 34:
    				int containerInterfaceId = inStream.readUnsignedWord();
    				RSInterface class9_2 = RSInterface.interfaceCache[containerInterfaceId];
    				while (inStream.position < pktSize) {
    					int itemSlot = inStream.method422();
    					int itemId = inStream.readUnsignedWord();
    					int itemAmount = inStream.readUnsignedByte();
    					if (itemAmount == 255)
    						itemAmount = inStream.readDWord();
    					if (itemSlot >= 0 && itemSlot < class9_2.inv.length) {
    						class9_2.inv[itemSlot] = itemId;
    						class9_2.invStackSizes[itemSlot] = itemAmount;
    					}
    				}
    				pktType = -1;
    				return true;
    packet 53 (updating multiple slots)
    Code:
    				int i7 = inStream.readUnsignedWord();
    				RSInterface class9_1 = RSInterface.interfaceCache[i7];
    				int j19 = inStream.readUnsignedWord();
    				for (int j22 = 0; j22 < j19; j22++) {
    					int i25 = inStream.readUnsignedByte();
    					if (i25 == 255)
    						i25 = inStream.method440();
    					class9_1.inv[j22] = inStream.method436();
    					class9_1.invStackSizes[j22] = i25;
    				}
    				for (int j25 = j19; j25 < class9_1.inv.length; j25++) {
    					class9_1.inv[j25] = 0;
    					class9_1.invStackSizes[j25] = 0;
    				}
    				pktType = -1;
    Attached image

    Spoiler for Spoilers!:
    Attached image
    Attached image
    Attached image
    Attached image
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Oct 2012
    Posts
    4,710
    Thanks given
    1,679
    Thanks received
    1,105
    Rep Power
    0
    Definitely not the packet client sided, can you show the server side "refresh" method and processing.
    Reply With Quote  
     

  3. #3  
    Respected Member


    George's Avatar
    Join Date
    Mar 2009
    Posts
    7,099
    Thanks given
    2,226
    Thanks received
    3,146
    Rep Power
    5000
    Quote Originally Posted by _Patrick_ View Post
    Definitely not the packet client sided, can you show the server side "refresh" method and processing.
    // used when regularily updating the container (wearing an item)
    Code:
    		PacketBuilder updateContainerSlotBuilder = new PacketBuilder(PacketConstants.UPDATE_CONTAINER_SLOT, PacketType.VARIABLE_SHORT);
    		updateContainerSlotBuilder.writeShort(interfaceId);
    		updateContainerSlotBuilder.writeSmart(slot);
    		if (item == null) {
    			updateContainerSlotBuilder.writeShort(0);
    			updateContainerSlotBuilder.writeByte(0);
    		} else {
    			updateContainerSlotBuilder.writeShort((item.getId() + 1));
    			if (item.getAmount() > 254) {
    				updateContainerSlotBuilder.writeByte(255);
    				updateContainerSlotBuilder.writeInt(item.getAmount());
    			} else {
    				updateContainerSlotBuilder.writeByte(item.getAmount());
    			}
    		}
    		player.write(updateContainerSlotBuilder.toPacket());
    // used when initiating the container
    Code:
    		PacketBuilder updateContainerBuilder = new PacketBuilder(PacketConstants.UPDATE_ALL_CONTAINER_SLOTS, PacketType.VARIABLE_SHORT);
    		updateContainerBuilder.writeShort(interfaceId);
    		updateContainerBuilder.writeShort(items.length);
    		for (int slot = 0; slot < items.length; slot++) {
    			Item item = items[slot];
    			if (item == null) {
    				updateContainerBuilder.writeByte((byte) 0);
    				updateContainerBuilder.writeLEShortA(0);
    			} else {
    				if (item.getAmount() > 254) {
    					updateContainerBuilder.writeByte((byte) 255);
    					updateContainerBuilder.writeInt2(item.getAmount());
    				} else {
    					updateContainerBuilder.writeByte((byte) item.getAmount());
    				}
    				updateContainerBuilder.writeLEShortA(item.getId() + 1);
    			}
    		}
    		player.write(updateContainerBuilder.toPacket());
    		return this;
    Attached image

    Spoiler for Spoilers!:
    Attached image
    Attached image
    Attached image
    Attached image
    Reply With Quote  
     

  4. #4  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    It doesn't seem like it's just the container, it also appears to be the interface button and the slot backgrounds as well. The issue could be anything from the client not drawing interface components fast enough to having a limited number of bytes being sent over the network at once.

    If you're worried it's the latency in the network you can always send an additional 8 bytes representing the timestamp that the packet was created and then compare it against when it was received. You could also check the duration between when you start to draw the container and when it's done. It could really be anything, just debug.
    Reply With Quote  
     

  5. Thankful user:


  6. #5  
    Respected Member


    George's Avatar
    Join Date
    Mar 2009
    Posts
    7,099
    Thanks given
    2,226
    Thanks received
    3,146
    Rep Power
    5000
    Quote Originally Posted by Jason View Post
    It doesn't seem like it's just the container, it also appears to be the interface button and the slot backgrounds as well. The issue could be anything from the client not drawing interface components fast enough to having a limited number of bytes being sent over the network at once.

    If you're worried it's the latency in the network you can always send an additional 8 bytes representing the timestamp that the packet was created and then compare it against when it was received. You could also check the duration between when you start to draw the container and when it's done. It could really be anything, just debug.
    Noticed that as well, the drawing seems to only be affected when updating the container though
    Attached image
    Attached image

    Spoiler for Spoilers!:
    Attached image
    Attached image
    Attached image
    Attached image
    Reply With Quote  
     

  7. #6  
    Respected Member


    Join Date
    Jan 2009
    Posts
    5,743
    Thanks given
    1,162
    Thanks received
    3,603
    Rep Power
    5000
    item container packet is received then the next draw cycle will draw the container that you have updated, item by item. this is exactly what you're seeing in both gifs.
    Reply With Quote  
     

  8. #7  
    Donator


    Join Date
    Dec 2014
    Posts
    369
    Thanks given
    77
    Thanks received
    112
    Rep Power
    164
    I'm more concerned about your minimap, wtf is that :O
    Attached image
    Reply With Quote  
     


  9. #8  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    Is it possible your using packet 53 to update a single slot, forcing multiple updates to occur per slot per cycle? Can you post the code that gets sent on login to update worn items? Check to see how long in milliseconds each reference to update a slot or all slots take. Is it possible the packets being sent out are limited at a certain rate per cycle?
    Reply With Quote  
     

  10. #9  
    Respected Member


    George's Avatar
    Join Date
    Mar 2009
    Posts
    7,099
    Thanks given
    2,226
    Thanks received
    3,146
    Rep Power
    5000
    Quote Originally Posted by Jason View Post
    Is it possible your using packet 53 to update a single slot, forcing multiple updates to occur per slot per cycle? Can you post the code that gets sent on login to update worn items? Check to see how long in milliseconds each reference to update a slot or all slots take. Is it possible the packets being sent out are limited at a certain rate per cycle?
    I’m not using packet 53 to update single slots; its only sent when you login or a new container is attached to the player.
    Will get back to you eith an answer to the rest of your questions, am currently out, thanks for your inputs

    Quote Originally Posted by Klem3n View Post
    I'm more concerned about your minimap, wtf is that :O
    Need to pack the new overlays and underlays
    Attached image

    Spoiler for Spoilers!:
    Attached image
    Attached image
    Attached image
    Attached image
    Reply With Quote  
     

  11. #10  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000
    It's a problem with all 317s, nothing to really worry over. It's not just the items or the container that's causing this, it's how 317s load the interfaces. If you look at your very first gif, you'll notice that it's not just items that are loaded with a delay, the bonuses button there is loaded as the final component. 317s don't do any caching for the components when loading them, unlike osrs(and all the other higher revisions obviously) which caches everything during the load process and after it finishes all of it(cs2 calls n other misc crap), it will draw everything instantly.
    Attached image
    Reply With Quote  
     

  12. Thankful user:


Page 1 of 2 12 LastLast

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. Replies: 0
    Last Post: 07-24-2013, 04:30 AM
  2. Lonelyisle update
    By SandyBridge in forum Downloads
    Replies: 6
    Last Post: 12-10-2007, 05:32 PM
  3. Marius MegaPack v1.1 (Updated)
    By Chimeric in forum Tools
    Replies: 19
    Last Post: 08-01-2007, 02:34 AM
  4. SOTM III Update
    By Bullet in forum General
    Replies: 2
    Last Post: 03-28-2007, 06:20 PM
  5. Replies: 0
    Last Post: 12-26-2006, 06:36 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •