Thread: Hyperion region/player updating bug

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1 Hyperion region/player updating bug 
    Author of the first public OSRSPS

    Shadowy's Avatar
    Join Date
    Sep 2009
    Age
    28
    Posts
    1,499
    Thanks given
    490
    Thanks received
    241
    Rep Power
    307
    Edit: solved: hyperion has a dodgy unregister player process and some offline players still existed within other players' localplayer map.

    I am unsure of the cause but have identified something going wrong in the client's player updating.

    When I enter a new region, entities which were in the previous region are removed from the client. My problem is a null-pointer occurs when the client tries to null a Player which needs to be removed in the local_players list:

    Code:
    Error: Class124:1235 Class132:360 Class132:333 java.lang.Thread.run | java.lang.NullPointerException | 246,206,167,9,3069,3540,-51,-63,52,-113,-1,-1,16,-1,-1,
    This leads to

    Code:
    for (int idx = 0; idx < removedCounter; ++idx) {
    	slot = indicesPendingRemoval[idx];
    	if (localPlayers[slot].lastUpdated != cycle) {
    		localPlayers[slot] = null;
    	}
    }
    The red code throws a null-pointer, the PID of the entity we want to remove is not in the local_players array.

    Spoiler for extra:
    Extra: the indicesPendingRemoval variable is declared as:
    Code:
    static int[] indicesPendingRemoval = new int[1000];
    When other player movement is decoded in player updating, firstly this variable is used here:

    Code:
    int numLocalPlayers = ClientCopy.packetBuffer.readBits(8);
    int ptr;
    if (numLocalPlayers < ClientCopy.numLocalPlayers) {//we'be been told to update 5 entities but the client contains 6
    	for (ptr = numLocalPlayers; ptr < ClientCopy.numLocalPlayers ; ++ptr) {//remove the entity at the end of the array
    		ClientCopy.indicesPendingRemoval[(ClientCopy.removedCounter += 1)  - 1] = ClientCopy.playerIndices[ptr];//set the PID to remove
    		
    	}
    }
    And as usual, we request an update with bit value '1' - then request them to be removed with bit value '3' :
    Code:
    if (2 == movetype) {//running
    	ClientCopy.playerIndices[(ClientCopy.numLocalPlayers -= 1542815315) - 1] = index;//the big number here is some added obfuscation
    	var5.lastUpdated = ClientCopy.cycle;
    	var8 = ClientCopy.packetBuffer.readBits(3);
    	var5.moveInDirection(var8);
    	var7 = ClientCopy.packetBuffer.readBits(3);
    	var5.moveInDirection(var7);
    	int maskUpdate = ClientCopy.packetBuffer.readBits(1);
    	if (1 == maskUpdate) {
    		ClientCopy.entitiesRequiringUpdates[(ClientCopy.updateReqCount -= 472402375) * -184592375 - 1] = index;
    	}
    } else if (movetype == 3) {//remove a player
    	ClientCopy.indicesPendingRemoval[(ClientCopy.removedCounter += 1906858221) * 104842469 - 1] = index;
    }


    When I did some debugging, the correct senario is:

    Code:
    Update 15
    New: [-14, 3, req:1, dir:0]
    
    Update 16
    
    Update 17
    
    Update 18
    
    Update 19
    GPU removal request pid 1 count 0
    nulling 1
    
    Update 20
    
    Update 21
    
    Update 22
    
    Update 23
    New: [-13, 4, req:1, dir:0]
    Update x is the count of how many update packet's we've processed. The new[x,y,req,dir] is when a new player is added to our region. The GPU removal/nulling is removing an entity we no longer can see.

    I've identified this senario of what happens which I believe is causing the problem:

    Code:
    GPU removal request pid 0 count 0
    GPU removal request pid 0 count 1
    GPU removal request pid 0 count 2
    GPU removal request pid 0 count 3
    GPU removal request pid 0 count 4
    GPU removal request pid 0 count 5
    GPU removal request pid 0 count 6
    GPU removal request pid 11 count 7
    New: [-3, -2, req:1, dir:0]
    New: [-9, 4, req:1, dir:0]
    New: [-10, 6, req:1, dir:0]
    New: [-10, 6, req:1, dir:0]
    New: [-10, 6, req:1, dir:0]
    New: [-10, 6, req:1, dir:0]
    New: [-9, 4, req:1, dir:0]
    New: [-9, 13, req:1, dir:0]
    nulling 8
    As you can see, there is a request to remove 8 entities, however their PID is 0, not possible. I'm therefore lead to assume that there are players stuck in the server-sided local_player list with invalid PIDs.

    I'm not sure as to whether the adding and removing entities in the same tick has an effect. The problem is I can't investigate until it happens.

    I think but am not sure that the below images are related:

    Here is a player we can see, in the Karil's, but we can't right click them. Their animation is also playing super-fast (you can't tell because with low graphics there is not much movement)



    If we stand on the player, we can right-click them:



    So I'm guessing this entity is only half-removed from the client. It's there visibly but when the client calculates where you're clicking in correlation with any on-screen entities, it doesn't detect them.



    So, all in all I think there is a problem with entities being added and removed from regions server-sided. Has anyone experienced this using hyperion?
    Edit: I think this is unique to the base I've used.


    This is a major problem and I'm really not sure of the cause. I could spend hours trying to figure it out but get nowhere. Do you think I should go as far as to change base, or maybe compare the region system from another hyperion/rs2-server base?
    Owner of OS-RSPS, the first Oldschool RuneScape Server (2014)
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Jun 2011
    Posts
    2
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Bump. Gl on the fix bro.
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Dec 2011
    Age
    26
    Posts
    2,303
    Thanks given
    471
    Thanks received
    764
    Rep Power
    0
    bump
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Jul 2013
    Posts
    86
    Thanks given
    1
    Thanks received
    13
    Rep Power
    11
    bump
    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    Mar 2011
    Posts
    4,062
    Thanks given
    194
    Thanks received
    689
    Rep Power
    0
    if (localPlayers[slot] != null && localPlayers[slot].lastUpdated != cycle) {
    Reply With Quote  
     

  6. #6  
    Banned

    Join Date
    Mar 2011
    Posts
    4,062
    Thanks given
    194
    Thanks received
    689
    Rep Power
    0
    Quote Originally Posted by Richard1992 View Post
    No it will be


    due to the fact yo will remove the player if its null or wasnt updated last cycle
    it's setting the player in the array to null anyway...
    Reply With Quote  
     

  7. #7  
    Registered Member Ho3ein's Avatar
    Join Date
    Oct 2014
    Posts
    53
    Thanks given
    0
    Thanks received
    10
    Rep Power
    10
    Bump
    Reply With Quote  
     

  8. #8  
    Author of the first public OSRSPS

    Shadowy's Avatar
    Join Date
    Sep 2009
    Age
    28
    Posts
    1,499
    Thanks given
    490
    Thanks received
    241
    Rep Power
    307
    Quote Originally Posted by relex lawl View Post
    it's setting the player in the array to null anyway...
    I haven't tested it but I assume such a modification could damage the updating? It should technically work, but the point is I shouldn't have to hard code the client when it's programmed to work in the first place.
    Owner of OS-RSPS, the first Oldschool RuneScape Server (2014)
    Reply With Quote  
     

  9. #9  
    Author of the first public OSRSPS

    Shadowy's Avatar
    Join Date
    Sep 2009
    Age
    28
    Posts
    1,499
    Thanks given
    490
    Thanks received
    241
    Rep Power
    307
    Quote Originally Posted by Ham Lap View Post
    Are you using an OSRS client? The deobfuscating probably broke the client, I would look at the 317 client (one that's refactored well enough) and compare the player updating with the OSRS client's updating, They should be really similar.
    I'm not sure if the same glitch of attempting to remove players with pid 0 appears but the other glitch where players are duplicated has happened using the same base on a different revision (464)
    Owner of OS-RSPS, the first Oldschool RuneScape Server (2014)
    Reply With Quote  
     

  10. #10  
    Extreme Donator

    Lost Valentino's Avatar
    Join Date
    May 2009
    Posts
    3,793
    Thanks given
    12
    Thanks received
    344
    Rep Power
    1952
    we had the same problem on Aeresan. I did ask Graham for help but he couldn't because of his agreement with jagex.
    Reply With Quote  
     

  11. 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. Hyperion 666 Player updating
    By nixztez in forum Requests
    Replies: 2
    Last Post: 08-08-2014, 10:49 PM
  2. Replies: 0
    Last Post: 10-19-2013, 01:59 PM
  3. Replies: 0
    Last Post: 12-23-2011, 02:30 AM
  4. Region Based Player Updating
    By Colby in forum Snippets
    Replies: 26
    Last Post: 08-23-2010, 04:29 PM
  5. [474] Hyperion player updating fix
    By Paketa in forum Snippets
    Replies: 4
    Last Post: 08-08-2010, 11:02 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
  •