Thread: [PI]Player Appearance Design Flaw

Page 1 of 3 123 LastLast
Results 1 to 10 of 26
  1. #1 [PI]Player Appearance Design Flaw 
    Forum Moderator


    Join Date
    Jan 2009
    Posts
    5,737
    Thanks given
    1,157
    Thanks received
    3,597
    Rep Power
    5000
    Original Thread: http://www.rune-server.org/runescape...sign-flaw.html
    Original Post: http://www.rune-server.org/2857911-post24.html

    Code:
    public class ChangeAppearance implements PacketType {
    
    	private static final int[][] MALE_VALUES = { { 0, 8 }, // head
    			{ 10, 17 }, // jaw
    			{ 18, 25 }, // torso
    			{ 26, 31 }, // arms
    			{ 33, 34 }, // hands
    			{ 36, 40 }, // legs
    			{ 42, 43 }, // feet
    	};
    
    	private static final int[][] FEMALE_VALUES = { { 45, 54 }, // head
    			{ -1, -1 }, // jaw
    			{ 56, 60 }, // torso
    			{ 61, 65 }, // arms
    			{ 67, 68 }, // hands
    			{ 70, 77 }, // legs
    			{ 79, 80 }, // feet
    	};
    
    	private static final int[][] ALLOWED_COLORS = { { 0, 11 }, // hair color
    			{ 0, 15 }, // torso color
    			{ 0, 15 }, // legs color
    			{ 0, 5 }, // feet color
    			{ 0, 7 } // skin color
    	};
    
    	@Override
    	public void processPacket(final Client client, final int packetType, final int packetSize) {
    		final int gender = client.getInStream().readSignedByte();
    
    		if (gender != 0 && gender != 1)
    			return;
    
    		final int[] apperances = new int[MALE_VALUES.length]; // apperance's
    																// value
    		// check
    		for (int i = 0; i < apperances.length; i++) {
    			int value = client.getInStream().readSignedByte();
    			if (value < (gender == 0 ? MALE_VALUES[i][0] : FEMALE_VALUES[i][0]) || value > (gender == 0 ? MALE_VALUES[i][1] : FEMALE_VALUES[i][1]))
    				value = (gender == 0 ? MALE_VALUES[i][0] : FEMALE_VALUES[i][0]);
    			apperances[i] = value;
    		}
    
    		final int[] colors = new int[ALLOWED_COLORS.length]; // color value
    																// check
    		for (int i = 0; i < colors.length; i++) {
    			int value = client.getInStream().readSignedByte();
    			if (value < ALLOWED_COLORS[i][0] || value > ALLOWED_COLORS[i][1])
    				value = ALLOWED_COLORS[i][0];
    			colors[i] = value;
    		}
    
    		if (client.canChangeAppearance) {
    			client.playerAppearance[0] = gender; // gender
    			client.playerAppearance[1] = apperances[0]; // head
    			client.playerAppearance[2] = apperances[2]; // torso
    			client.playerAppearance[3] = apperances[3]; // arms
    			client.playerAppearance[4] = apperances[4]; // hands
    			client.playerAppearance[5] = apperances[5]; // legs
    			client.playerAppearance[6] = apperances[6]; // feet
    			client.playerAppearance[7] = apperances[1]; // beard
    			client.playerAppearance[8] = colors[0]; // hair colour
    			client.playerAppearance[9] = colors[1]; // torso colour
    			client.playerAppearance[10] = colors[2]; // legs colour
    			client.playerAppearance[11] = colors[3]; // feet colour
    			client.playerAppearance[12] = colors[4]; // skin colour
    
    			client.getPA().removeAllWindows();
    			client.getPA().requestUpdates();
    			client.canChangeAppearance = false;
    		}
    	}
    
    }
    Reply With Quote  
     


  2. #2  
    Registered Member DestriX's Avatar
    Join Date
    Nov 2008
    Posts
    1,323
    Thanks given
    490
    Thanks received
    152
    Rep Power
    257
    Should help some people out that are using Project Insanity. Great Job man!
    Attached image
    Reply With Quote  
     

  3. #3  
    q.q


    Join Date
    Dec 2010
    Posts
    6,519
    Thanks given
    1,072
    Thanks received
    3,535
    Rep Power
    4752
    Quote Originally Posted by Psychedelic View Post
    whats this? i never really figured it out..
    Fixing the bug where players can send fake packets to make themselves invisible.
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Dec 2010
    Age
    29
    Posts
    1,186
    Thanks given
    513
    Thanks received
    340
    Rep Power
    35
    Quote Originally Posted by Harlan View Post
    Fixing the bug where players can send fake packets to make themselves invisible.

    Yeah i just figured that out.
    Reply With Quote  
     

  5. Thankful user:


  6. #5  
    Super Donator

    Benji's Avatar
    Join Date
    Feb 2010
    Age
    29
    Posts
    1,525
    Thanks given
    920
    Thanks received
    503
    Rep Power
    570
    deserves more attention, bump

    Reply With Quote  
     

  7. #6  
    Super Donator


    Join Date
    Sep 2008
    Age
    30
    Posts
    1,894
    Thanks given
    677
    Thanks received
    776
    Rep Power
    456
    Good job, iirc this issue is on all winterlove servers.
    Reply With Quote  
     

  8. #7  
    Registered MrClassic
    MrClassic's Avatar
    Join Date
    Oct 2008
    Age
    15
    Posts
    2,065
    Thanks given
    24,153
    Thanks received
    551
    Rep Power
    5000
    Thanks, although many people won't use the bug because they're lazy
    Reply With Quote  
     

  9. #8  
    supa fly guy


    Join Date
    Feb 2011
    Age
    27
    Posts
    2,201
    Thanks given
    488
    Thanks received
    988
    Rep Power
    992
    Thanks
    Reply With Quote  
     

  10. #9  
    Extreme Donator


    Join Date
    Feb 2009
    Posts
    361
    Thanks given
    51
    Thanks received
    85
    Rep Power
    177
    Good job on this.
    Reply With Quote  
     

  11. #10  
    Banned
    Join Date
    Oct 2011
    Age
    28
    Posts
    46
    Thanks given
    0
    Thanks received
    13
    Rep Power
    0
    Thanks, deserves a bump
    Reply With Quote  
     

Page 1 of 3 123 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. Testing the Player Appearance Design Flaw
    By istory in forum Tutorials
    Replies: 105
    Last Post: 08-16-2012, 11:56 AM
  2. Player appearance interface id
    By Shadowy in forum Help
    Replies: 2
    Last Post: 09-23-2010, 09:26 PM
  3. Spining player from the design player interface
    By Clienthax in forum Tutorials
    Replies: 5
    Last Post: 05-27-2008, 01:12 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
  •