Thread: Player facing issue.

Results 1 to 3 of 3
  1. #1 Player facing issue. 
    Registered Member
    Stanaveli's Avatar
    Join Date
    Aug 2014
    Posts
    1,490
    Thanks given
    184
    Thanks received
    653
    Rep Power
    1338
    Hello, for some reason it's not updating for player two.

    The client is not modified and i've checked various methods involving the mask and they are all the same as any other 317 deobbed client.

    As you can see, the main player is facing the other player but for player 2 it seems like he isn't facing him. And yeah, i'm sending 32768 + player index to differentiate from facing npcs.



    Will rep ofcourse
    Keep your head up.



    Reply With Quote  
     

  2. #2  
    Community Veteran

    WH:II:DOW's Avatar
    Join Date
    Dec 2007
    Age
    34
    Posts
    2,017
    Thanks given
    145
    Thanks received
    872
    Rep Power
    4275
    You're either not updating the other guy or you have the wrong player id for the other guy so he doesn't know who/what to face.
    hella titties
    Reply With Quote  
     

  3. #3  
    Registered Member
    Stanaveli's Avatar
    Join Date
    Aug 2014
    Posts
    1,490
    Thanks given
    184
    Thanks received
    653
    Rep Power
    1338
    Quote Originally Posted by WH:II:DOW View Post
    You're either not updating the other guy or you have the wrong player id for the other guy so he doesn't know who/what to face.
    I think it's the first, however, i'm not sure what exactly is wrong with it? I've compared it and I think i'm either blind or really stupid lol

    Code:
    	@Override
    	public AsynchronousBuffer dispatch(Player player) {
    		if (player.getUpdateFlags().contains("map-region")) {
    			player.send(new RegionalUpdatePacket());
    		}
    		AsynchronousBuffer packet = new AsynchronousBuffer(ByteBuffer.allocate(16384));
    		AsynchronousBuffer update = new AsynchronousBuffer(ByteBuffer.allocate(8192));
    		packet.writeVariableShortPacketHeader(player.getConnection().getCryptionPair().getWriter(), getOpcode());
    		packet.startBitAccess();
    		player.getListener().updateThisPlayerMovement(player, packet);
    		if (player.isUpdateRequired()) {
    			player.getListener().updatePlayerState(player, update, false, true);
    		}
    		packet.writeBits(8, player.getLocalPlayers().size());
    		for(Iterator<Player> iterator = player.getLocalPlayers().iterator(); iterator.hasNext();) {
    			Player otherPlayer = iterator.next();
    			if (World.getSingleton().getPlayers().containsValue(otherPlayer) && otherPlayer.getPosition().isWithinDistance(player.getPosition(), 15) && !otherPlayer.getUpdateFlags().contains("teleporting")) {
    				player.getListener().updateOtherPlayerMovement(otherPlayer, packet);
    				if (otherPlayer.isUpdateRequired()) {
    					player.getListener().updatePlayerState(otherPlayer, update, false, false);
    				}
    			} else {
    				iterator.remove();
    				packet.writeBits(1, 1);
    				packet.writeBits(2, 3);
    			}
    		}
    		for (Player otherPlayer : World.getSingleton().getPlayers().values()) {
    			if (otherPlayer.getLocalPlayers().size() >= 255) {
    				break;
    			}
    			if (otherPlayer == player || player.getLocalPlayers().contains(otherPlayer)) {
    				continue;
    			}
    			if (otherPlayer.getPosition().isWithinDistance(player.getPosition(), 15)) {
    				player.getLocalPlayers().add(otherPlayer);
    				packet.writeBits(11, otherPlayer.getIndex());
    				packet.writeBits(1, 1);
    				packet.writeBits(1, 1);
    				packet.writeBits(5, otherPlayer.getPosition().getY() - player.getPosition().getY());
    				packet.writeBits(5, otherPlayer.getPosition().getX() - player.getPosition().getX());
    				player.getListener().updatePlayerState(otherPlayer, update, true, false);
    			}
    		}
    		if (update.getBuffer().position() > 0) {
    			packet.writeBits(11, 2047);
    			packet.startByteAcces();
    			packet.writeBytes(update.getBuffer());
    		} else {
    			packet.startByteAcces();
    		}
    		packet.finishVariableShortPacketHeader();
    		return packet;
    	}
    Keep your head up.



    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. Replies: 0
    Last Post: 10-21-2008, 09:40 PM
  2. Ivory Fist 508, player faces when barraging
    By Khanz in forum Downloads
    Replies: 16
    Last Post: 10-16-2008, 03:41 AM
  3. making a player face npcs on dodian properly
    By killamess in forum Tutorials
    Replies: 9
    Last Post: 04-05-2008, 10:51 AM
  4. Player Faces Player
    By X_mahatma_x in forum Tutorials
    Replies: 5
    Last Post: 09-23-2007, 05:43 AM
  5. [REQ] Player face player
    By kilermage in forum Tutorials
    Replies: 3
    Last Post: 09-22-2007, 11:46 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
  •