Thread: teleport doesn't update...

Results 1 to 6 of 6
  1. #1 teleport doesn't update... 
    Registered Member
    Join Date
    Sep 2007
    Posts
    128
    Thanks given
    23
    Thanks received
    1
    Rep Power
    1
    Say you and a friend are standing around the area where varrock teleport sends you. Now you friend teleports and you do not, you will see the animation and gfx... but their position doesn't update, and when they walk beside you it appears as though they are standing so much farther away from you then you think.

    NVM problem is in PlayerHandler.java lol has something to do with this:

    Code:
    		for(int i = 0; i < size; i++) {
    			// this update packet does not support teleporting of other players directly
    			// instead we're going to remove this player here and readd it right away below
    			if(plr.didTeleport == false && plr.withinDistance(plr.playerList[i]) == true) {
    				plr.playerList[i].updatePlayerMovement(str);
    				plr.playerList[i].appendPlayerUpdateBlock(updateBlock);
    				plr.playerList[plr.playerListSize++] = plr.playerList[i];
    			} else {
    				int id = plr.playerList[i].playerId;
    				plr.playerInListBitmap[id>>3] &= ~(1 << (id&7));		// clear the flag
    				str.writeBits(1, 1);
    				str.writeBits(2, 3);		// tells client to remove this char from list
    			}
    		}
    
    		// iterate through all players to check whether there's new players to add
    		for(int i = 0; i < maxPlayers; i++) {
    			if(players[i] == null || players[i].isActive == false || players[i] == plr) {
    				//not existing, not active or you are that player
    			} else {
    				int id = players[i].playerId;
    				if(plr.didTeleport == false && (plr.playerInListBitmap[id>>3]&(1 << (id&7))) != 0) {
    					// player already in playerList
    				} else if(plr.withinDistance(players[i]) == false) {
    					// out of sight
    				} else {
    					plr.addNewPlayer(players[i], str, updateBlock);
    				}
    			}
    		}
    When shot down, turn right around.
    If you have ever been told you can't, but you have exceeded the expectations.. Put this in your signature.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Smokey's Avatar
    Join Date
    Apr 2011
    Posts
    287
    Thanks given
    124
    Thanks received
    73
    Rep Power
    351
    Code:
    		for(int i = 0; i < size; i++) {
    			// this update packet does not support teleporting of other players directly
    			// instead we're going to remove this player here and readd it right away below
    			if(plr.didTeleport == false && plr.withinDistance(plr.playerList[i]) == true) {
    				plr.playerList[i].updatePlayerMovement(str);
    				plr.playerList[i].appendPlayerUpdateBlock(updateBlock);
    				plr.playerList[plr.playerListSize++] = plr.playerList[i];
    			} else {
    				int id = plr.playerList[i].playerId;
    				plr.playerInListBitmap[id>>3] &= ~(1 << (id&7));		// clear the flag
    				str.writeBits(1, 1);
    				str.writeBits(2, 3);		// tells client to remove this char from list
    			}
    		}
    
    		// iterate through all players to check whether there's new players to add
    		for(int i = 0; i < maxPlayers; i++) {
    			if(players[i] == null || players[i].isActive == false || players[i] == plr) {
    				//not existing, not active or you are that player
    			} else {
    				int id = players[i].playerId;
    				if(plr.didTeleport == false && (plr.playerInListBitmap[id>>3]&(1 << (id&7))) != 0) {
    					// player already in playerList
    				} else if(plr.withinDistance(players[i]) == false) {
    					// out of sight
    				} else {
    					plr.addNewPlayer(players[i], str, updateBlock);
    				}
    			}
    		}
    winterlove? here's the method that came in blakescape

    Code:
    	public void updatePlayer(Player plr, stream str) {
    
    		updateBlock.currentOffset = 0;
    
    		// update thisPlayer
    		plr.updateThisPlayerMovement(str); // handles
    					     // walking/running and
    					     // teleporting
    
    		// do NOT send chat text back to thisPlayer!
    		boolean saveChatTextUpdate = plr.chatTextUpdateRequired;
    		plr.chatTextUpdateRequired = false;
    		plr.appendPlayerUpdateBlock(updateBlock);
    		plr.chatTextUpdateRequired = saveChatTextUpdate;
    
    		// update/remove players that are already in the playerList
    		str.writeBits(8, plr.playerListSize);
    
    		int size = plr.playerListSize;
    
    		plr.playerListSize = 0;// we're going to rebuild the list
    				   // right away
    		for (int i = 0; i < size; i++) {
    			// this update packet does not support teleporting
    			// of other players directly
    			// instead we're going to remove this player here
    			// and readd it right away below
    			if (!plr.playerList[i].didTeleport
    			                    && plr.withinDistance(plr.playerList[i])) {
    				plr.playerList[i].updatePlayerMovement(str);
    				plr.playerList[i].appendPlayerUpdateBlock(updateBlock);
    				plr.playerList[plr.playerListSize++] = plr.playerList[i];
    			} else {
    				int id = plr.playerList[i].playerId;
    				plr.playerInListBitmap[id >> 3] &= ~(1 << (id & 7)); // clear
    									   // the
    									   // flag
    				str.writeBits(1, 1);
    				str.writeBits(2, 3); // tells client to
    						 // remove this char
    						 // from list
    			}
    		}
    
    		// iterate through all players to check whether there's new
    		// players to add
    		for (int i = 0; i < maxPlayers; i++) {
    			if (players[i] == null || !players[i].isActive
    			                    || players[i] == plr) {
    				continue;
    			}
    			int id = players[i].playerId;
    			if ((plr.playerInListBitmap[id >> 3] & (1 << (id & 7))) != 0) {
    				continue; // player already in
    					// playerList
    			}
    			if (!plr.withinDistance(players[i])) {
    				continue; // out of sight
    			}
    			plr.addNewPlayer(players[i], str, updateBlock);
    		}
    
    		if (updateBlock.currentOffset > 0) {
    			str.writeBits(11, 2047); // magic EOF - needed
    					     // only when player
    					     // updateblock follows
    			str.finishBitAccess();
    
    			// append update block
    			str.writeBytes(updateBlock.buffer,
    			                    updateBlock.currentOffset, 0);
    		} else {
    			str.finishBitAccess();
    		}
    
    		str.endFrameVarSizeWord();
    	}
    if you can't pick it out here's your code:

    Code:
    		for (int i = 0; i < size; i++) {
    			// this update packet does not support teleporting
    			// of other players directly
    			// instead we're going to remove this player here
    			// and readd it right away below
    			if (!plr.playerList[i].didTeleport
    			                    && plr.withinDistance(plr.playerList[i])) {
    				plr.playerList[i].updatePlayerMovement(str);
    				plr.playerList[i].appendPlayerUpdateBlock(updateBlock);
    				plr.playerList[plr.playerListSize++] = plr.playerList[i];
    			} else {
    				int id = plr.playerList[i].playerId;
    				plr.playerInListBitmap[id >> 3] &= ~(1 << (id & 7)); // clear
    									   // the
    									   // flag
    				str.writeBits(1, 1);
    				str.writeBits(2, 3); // tells client to
    						 // remove this char
    						 // from list
    			}
    		}
    
    		// iterate through all players to check whether there's new
    		// players to add
    		for (int i = 0; i < maxPlayers; i++) {
    			if (players[i] == null || !players[i].isActive
    			                    || players[i] == plr) {
    				continue;
    			}
    			int id = players[i].playerId;
    			if ((plr.playerInListBitmap[id >> 3] & (1 << (id & 7))) != 0) {
    				continue; // player already in
    					// playerList
    			}
    			if (!plr.withinDistance(players[i])) {
    				continue; // out of sight
    			}
    			plr.addNewPlayer(players[i], str, updateBlock);
    		}
    Spoiler for signature:

    He is richest who is content with the least, for contentment is the wealth of nature. - Socrates
    Attached image
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member
    Join Date
    Sep 2007
    Posts
    128
    Thanks given
    23
    Thanks received
    1
    Rep Power
    1
    WOW.. yeah that fixed the problem up like a charm, thanks man you deserve the rep and thanks!
    When shot down, turn right around.
    If you have ever been told you can't, but you have exceeded the expectations.. Put this in your signature.
    Reply With Quote  
     

  5. Thankful user:


  6. #4  
    Banned
    Join Date
    Oct 2011
    Age
    27
    Posts
    68
    Thanks given
    8
    Thanks received
    14
    Rep Power
    0
    Rip it off a [PI] Server.
    Reply With Quote  
     

  7. #5  
    Registered Member Pakku's Avatar
    Join Date
    Mar 2010
    Posts
    1,234
    Thanks given
    127
    Thanks received
    111
    Rep Power
    47
    Quote Originally Posted by `Notepad View Post
    Rip it off a [PI] Server.
    Are you blind?

    Quote Originally Posted by lkc cheat service View Post
    WOW.. yeah that fixed the problem up like a charm, thanks man you deserve the rep and thanks!


    Reply With Quote  
     

  8. Thankful user:


  9. #6  
    Registered Member
    Smokey's Avatar
    Join Date
    Apr 2011
    Posts
    287
    Thanks given
    124
    Thanks received
    73
    Rep Power
    351
    No problem sir, I happened to be looking over the update protocol right before I looked at the thread, I believe the problem is those missing continue's, in a loop when continue is called it breaks from the loop and continues with the next iteration, when return is called it breaks from the method.

    Quote Originally Posted by `Notepad View Post
    Rip it off a [PI] Server.
    Spoiler for signature:

    He is richest who is content with the least, for contentment is the wealth of nature. - Socrates
    Attached image
    Reply With Quote  
     


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. update key extractor/538 update keys
    By Simon in forum Requests
    Replies: 2
    Last Post: 01-16-2011, 04:06 PM
  2. Replies: 3
    Last Post: 08-09-2010, 06:12 PM
  3. ::update system update error z525
    By lt gangster in forum Help
    Replies: 3
    Last Post: 08-09-2010, 04:02 AM
  4. update key loading/update server
    By Simon in forum Requests
    Replies: 4
    Last Post: 01-11-2010, 06:32 PM
  5. Replies: 5
    Last Post: 03-22-2008, 04:55 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
  •