Thread: BufferSize of Bytes Read by Client.

Page 1 of 2 12 LastLast
Results 1 to 10 of 20
  1. #1 BufferSize of Bytes Read by Client. 
    Registered Member
    Hotyute's Avatar
    Join Date
    Jan 2008
    Posts
    2,016
    Thanks given
    7
    Thanks received
    92
    Rep Power
    1482
    Well We all know that there is communication between server and client. Ive always been checking out the client from since I started RSPS.

    At 508 I noticed that the client only read 5000 bytes from the server per flush.

    Eventually, I think around 560+ they increased the size to 7500 bytes. This means if you're flush is is ever greater than 7500 bytes, the remaining bytes will be lost (causing in most cases packet errors)

    The reason I bring this up is I hear all the time "I spawned 2000 players at once". This is pure false. It requires way more than 5000 or 7500 bytes to spawn more than 2000 players at once. If u notice on runescape Player's are added in segments of updates. Meaning that 500 will be added in one update (if the payload permits) and some more in the next, and so on and so on. Bottom line is The number of players u see per 600ms depends on the number of bytes the server is sending.

    Ive always wondered why runescape didn't use like 40kb or 100kb per update, but then again bytes are read from the server by the client every 30ms (even though the server only sends packets every 600ms).


    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    Номер 1


    Leanbow's Avatar
    Join Date
    Feb 2008
    Posts
    5,895
    Thanks given
    1,564
    Thanks received
    2,624
    Rep Power
    5000
    nice hotyute i learned something today
    Reply With Quote  
     

  4. #3  
    Renown Programmer and Respected Member
    Maxi's Avatar
    Join Date
    Jun 2008
    Posts
    3,197
    Thanks given
    281
    Thanks received
    1,095
    Rep Power
    1366
    In netty this is pretty easy to do. If the outgoing buffer is bigger than the maximum size the client reads every 30ms, take the first amount of bytes, send them and fire a new outbound event with the remaining buffer until the buffer is completely send.
    I think the reason is networking overhead. It's better to spread traffic than having all traffic at once.
    Reply With Quote  
     

  5. #4  
    Renown Programmer
    Method's Avatar
    Join Date
    Feb 2009
    Posts
    1,455
    Thanks given
    0
    Thanks received
    845
    Rep Power
    3019
    The only client that I've deobfuscated and refactored a bit that has an incoming buffer of size 7,500 is 616. The rest (613, 607, 604, 591, 578, etc.) only use a buffer of size 5,000. This definitely didn't change around revision 560.
    :-)
    Reply With Quote  
     

  6. #5  
    Registered Member

    Join Date
    Aug 2009
    Posts
    1,712
    Thanks given
    96
    Thanks received
    198
    Rep Power
    78
    I'm pretty sure it was still 5000 at 562. Anyways, yeh adding players has a max defined aswell iirc
    removed
    Reply With Quote  
     

  7. #6  
    :doge:

    Join Date
    Jan 2009
    Posts
    3,758
    Thanks given
    221
    Thanks received
    817
    Rep Power
    2116
    Thanks Sam, already knew about the player adding stuff, but i didn't know exactly how big the buffer size was.
    Reply With Quote  
     

  8. #7  
    Registered Member

    Join Date
    Feb 2010
    Posts
    715
    Thanks given
    133
    Thanks received
    378
    Rep Power
    550
    Ye this was disconnecting me with large amounts of players (tryed adding a max of adding 8 new players per cycle because appearance is a pretty big chunk, but just the spamming alone from 250 players (2k or 250 doesn't really make a diff..) could dc me sometimes sizes of 5.5-6.5k iirc) i changed the incomming buffer to 10k a while ago for testing, and i am yet to dc with a packet error
    Reply With Quote  
     

  9. #8  
    Community Veteran


    Join Date
    Jan 2008
    Posts
    2,659
    Thanks given
    494
    Thanks received
    627
    Rep Power
    980
    So does the client parse packets every 30ms? Meaning sending data bit by bit, as Maxi suggested, would work?
    ~iKilem
    Reply With Quote  
     

  10. #9  
    Registered Member

    Join Date
    Feb 2010
    Posts
    715
    Thanks given
    133
    Thanks received
    378
    Rep Power
    550
    Quote Originally Posted by iKilem View Post
    So does the client parse packets every 30ms? Meaning sending data bit by bit, as Maxi suggested, would work?
    Uh that 30ms parsing is for other packets aka frames, the client still needs to read the updating block as one packet
    Code:
    			while (len > 0) {
    				int read = anInputStream1127.read(buffer, startOffset, len);
    				if (read <= 0)
    					throw new EOFException();
    				len -= read;
    				startOffset += read;
    			}
    the read method will throw an out of bounds exception when the length (packetsize included in the packet) > buffer.length and will block untill the whole packet is read
    Reply With Quote  
     

  11. Thankful user:


  12. #10  
    Registered Member

    Join Date
    Oct 2008
    Posts
    2,358
    Thanks given
    146
    Thanks received
    1,041
    Rep Power
    869
    Quote Originally Posted by Vincent View Post
    Ye this was disconnecting me with large amounts of players (tryed adding a max of adding 8 new players per cycle because appearance is a pretty big chunk, but just the spamming alone from 250 players (2k or 250 doesn't really make a diff..) could dc me sometimes sizes of 5.5-6.5k iirc) i changed the incomming buffer to 10k a while ago for testing, and i am yet to dc with a packet error


    Just make your player update not send all renders at once as it the part of update that uses more data(I limited 2500bytes to it here =p)... Also use cached render appearences too it helps alot and make a limit of adding players per loop (250 here =P). I made my 562 client load up to 1k players without editing max packet size and works =).
    Attached image

    Attached image

    Reply With Quote  
     

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. Raw appearance bytes
    By Discardedx2 in forum Snippets
    Replies: 4
    Last Post: 09-28-2010, 02:29 PM
  2. 8-bit, 16-bit, 32-bit, bytes
    By Mikey` in forum Application Development
    Replies: 8
    Last Post: 06-01-2010, 01:11 AM
  3. Login player property bytes (9 bytes + 1 short)
    By Maxi in forum RS 503+ Client & Server
    Replies: 6
    Last Post: 03-22-2010, 09:16 PM
  4. Replies: 46
    Last Post: 03-03-2010, 09:32 AM
  5. Bytes V.S. Integers
    By Lazaro in forum Application Development
    Replies: 11
    Last Post: 03-19-2009, 02:55 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
  •