Thread: Player update protocol - Could use a little guidance :P

Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15
  1. #11  
    Registered Member
    Join Date
    Sep 2019
    Posts
    29
    Thanks given
    2
    Thanks received
    8
    Rep Power
    65
    Quote Originally Posted by Graham View Post
    I don't quite understand what you're trying to get at. The magic 2047 clause works for any number of players - it makes the client break out of the loop early and switch to the block reading mode.

    Remember that the bit-based updates for all players are always prior to the (byte-based) blocks for all players. They aren't interleaved - i.e: the order is like this:

    - existing player 1 bits
    - existing player 2 bits
    - new player 3 bits
    - magic 2047 marker
    - existing player 1 blocks
    - existing player 2 blocks
    - new player 3 blocks

    If no players have any blocks, then you can omit the magic 2047 marker, because there is no need to distinguish between bits/blocks in that case. The client detects it is at the end of the packet and skips reading the blocks.



    The A/C/S suffixes aren't Jagex's naming scheme (I don't think we know what Jagex call them).

    But yes, I've long suspected that whoever used those suffixes originally used them to stand for add, complement and subtract respectively.
    Basically in that loop it's considering my masks data, which it shouldn't obviously lol cause then its reading the bits in my masks as new players. That's my prob, I've actually got another post explaining my problem in much more detail here:
    [Only registered and activated users can see links. ]

    Quote Originally Posted by Graham View Post
    I don't quite understand what you're trying to get at. The magic 2047 clause works for any number of players - it makes the client break out of the loop early and switch to the block reading mode.

    Remember that the bit-based updates for all players are always prior to the (byte-based) blocks for all players. They aren't interleaved - i.e: the order is like this:

    - existing player 1 bits
    - existing player 2 bits
    - new player 3 bits
    - magic 2047 marker
    - existing player 1 blocks
    - existing player 2 blocks
    - new player 3 blocks

    If no players have any blocks, then you can omit the magic 2047 marker, because there is no need to distinguish between bits/blocks in that case. The client detects it is at the end of the packet and skips reading the blocks.



    The A/C/S suffixes aren't Jagex's naming scheme (I don't think we know what Jagex call them).

    But yes, I've long suspected that whoever used those suffixes originally used them to stand for add, complement and subtract respectively.
    Omg Graham thank you! I just presumed it was for a single-player instance, but manually breaking makes a lot of sense, THANK YOU!
    Reply With Quote  
     

  2. #12  
    Programmer, Contributor, RM and Veteran




    Join Date
    Mar 2007
    Posts
    5,074
    Thanks given
    2,625
    Thanks received
    3,579
    Discord
    View profile
    Rep Power
    5000
    Quote Originally Posted by wolfajk View Post
    Omg Graham thank you! I just presumed it was for a single-player instance, but manually breaking makes a lot of sense, THANK YOU!
    does this mean the other thread you linked to above can be considered answered too?
    .
    Reply With Quote  
     

  3. Thankful user:


  4. #13  
    Registered Member
    Join Date
    Sep 2019
    Posts
    29
    Thanks given
    2
    Thanks received
    8
    Rep Power
    65
    Quote Originally Posted by Graham View Post
    does this mean the other thread you linked to above can be considered answered too?
    It does, I'll update it with 'resolved'. I can't believe I was so straight minded about the client ending the loop itself lol... Thank you again.
    Reply With Quote  
     

  5. #14  
    Registered Member

    Join Date
    Feb 2010
    Posts
    3,187
    Thanks given
    1,124
    Thanks received
    834
    Discord
    View profile
    Rep Power
    1514
    I did say the other day 2047 is a magic number used to determine whether we need to add a new player to the list or jump to the blocks lol.

    Have you sorted it, as in implemented it yet then?

    Quote Originally Posted by Graham View Post
    does this mean the other thread you linked to above can be considered answered too?
    Someone really needs to update the documentation we have because when I wrote my own implementation in C I didn't find veers post completely accurate in some cases. I might just write it myself.
    Reply With Quote  
     

  6. #15  
    Programmer, Contributor, RM and Veteran




    Join Date
    Mar 2007
    Posts
    5,074
    Thanks given
    2,625
    Thanks received
    3,579
    Discord
    View profile
    Rep Power
    5000
    Quote Originally Posted by Fire Cape View Post
    Someone really needs to update the documentation we have because when I wrote my own implementation in C I didn't find veers post completely accurate in some cases. I might just write it myself.
    tbh bits of it are quite hard to express in written English. In some ways, I think the best reference is to look at both the client code and how an existing server does it (though most servers don't take full advantage of all the packet's functionality - e.g. there's a way to remove a batch of players from the end of the list without sending putBits(2, 3) repeatedly, but hardly anyone has implemented that).

    At some point I'm intending to write some relatively thorough documentation for all 550 packets (including updating) but I don't know when I will get around to it.
    .
    Reply With Quote  
     

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. [731] Player updating protocol
    By clem585 in forum Help
    Replies: 5
    Last Post: 06-22-2018, 11:47 AM
  2. Could Use a Little Help; 718
    By W R X in forum Help
    Replies: 0
    Last Post: 03-22-2015, 07:44 PM
  3. Replies: 6
    Last Post: 02-22-2013, 11:09 PM
  4. Replies: 36
    Last Post: 02-28-2012, 12:59 AM
  5. Replies: 8
    Last Post: 03-11-2008, 01:19 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
  •