Thread: Ruse v2 construction packet fixes

Page 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1 Ruse v2 construction packet fixes 
    Extreme Donator


    Join Date
    Oct 2010
    Posts
    2,853
    Thanks given
    1,213
    Thanks received
    1,622
    Rep Power
    5000
    Just to piss off this troll I quickly downloaded Ruse v2 and fixed the Construction packets which were messed up. There's still some work required to make the Construction fully functional, but I'd rather not release that right now.

    In PacketSender.java, find and replace:
    Code:
    public PacketSender constructMapRegion(Palette palette) {
    		PacketBuilder bldr = new PacketBuilder(241, PacketType.SHORT);
    		bldr.putShort(player.getPosition().getRegionY() + 6, ValueType.A);
    		bldr.putShort(player.getPosition().getRegionX() + 6);
    		bldr.initializeAccess(AccessType.BIT);
    		for (int z = 0; z < 4; z++) {
    			for (int x = 0; x < 13; x++) {
    				for (int y = 0; y < 13; y++) {
    					PaletteTile tile = palette.getTile(x, y, z);
    					boolean b = false;
    					if (x < 2 || x > 10 || y < 2 || y > 10)
    						b = true;
    					bldr.putBits(1, !b && tile != null ? 1 : 0);
    					if (tile != null && !b) {
    						bldr.putBits(
    								26,
    								tile.getX() << 14 | tile.getY() << 3
    										| tile.getZ() << 24
    										| tile.getRotation() << 1);
    					}
    				}
    			}
    		}
    		bldr.initializeAccess(AccessType.BYTE);		
    		player.getSession().queueMessage(bldr);
    		return this;
    	}
    Client.java, find and replace:
    Code:
    if (pktType == 241) {
    					i11 = getInputBuffer().method435();
    					l2 = getInputBuffer().getUnsignedShort();
    					getInputBuffer().initBitAccess();
    					for (int j16 = 0; j16 < 4; j16++) {
    						for (int l20 = 0; l20 < 13; l20++) {
    							for (int j23 = 0; j23 < 13; j23++) {
    								int emptyFloor = getInputBuffer().getBits(1);
    								if (emptyFloor == 1) {
    									anIntArrayArrayArray1129[j16][l20][j23] = getInputBuffer().getBits(26);
    								} else {
    									anIntArrayArrayArray1129[j16][l20][j23] = -1;
    								}
    							}
    						}
    					}
    					getInputBuffer().finishBitAccess();
    					aBoolean1159 = true;
    				}
    				if (pktType != 241 && anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
    					pktType = -1;
    					return true;
    				}
    Oh and make sure the size of packet 241 is -2 (it should be by default).

    Fix for construction object spawns packet:
    In Client.java, find and replace the following:
    Code:
    				case 4:
    				case 44:
    				case 84:
    				case 101:
    				case 105:
    				case 117:
    				case 147:
    				case 151:
    				case 156:
    				case 160:
    				case 215:
    					parseEntityPacket(getInputBuffer(), pktType);
    					pktType = -1;
    					return true;
    Under void parseEntityPacket, add the following:
    Code:
    if (j == 152) {
    			int tileData = stream.method426();
    			int tileX = anInt1268 + (tileData >> 4 & 7);
    			int tileY = anInt1268 + (tileData & 7);
    			int objID = stream.getShortBigEndian();
    			int typeAndFaceBits = stream.method428();
    			int obType = typeAndFaceBits >> 2;
    			int obFace = typeAndFaceBits & 3;
    			int toPlane = stream.getByte();
    			int l17 = anIntArray1177[obType];
    			if (tileX >= 0 && tileY >= 0 && tileX < 104 && tileY < 104)
    				method130(-1, objID, obFace, l17, tileY, obType,
    						toPlane, tileX, 0);
    			return;
    		}
    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    Registered Member
    Vippy's Avatar
    Join Date
    Oct 2014
    Age
    25
    Posts
    2,572
    Thanks given
    984
    Thanks received
    1,933
    Rep Power
    5000
    Lmao probably better as well. Cheers
    Reply With Quote  
     

  4. Thankful user:


  5. #3  
    Extreme Donator Ruse v2 construction packet fixes Market Banned



    Join Date
    Aug 2011
    Age
    28
    Posts
    3,589
    Thanks given
    1,402
    Thanks received
    1,620
    Rep Power
    5000
    cheers for this lol, he deserves it.

    Attached image

    Attached image
    Discord: Roy#2382

    Reply With Quote  
     

  6. Thankful user:


  7. #4  
    Registered Member Stevenhax's Avatar
    Join Date
    Jul 2014
    Posts
    387
    Thanks given
    55
    Thanks received
    64
    Rep Power
    42
    Cheers will check out when I'm done with what I'm adding currently.
    I already ported the interfaces over earlier, when adding this does it fix the doors as well?
    When I used Meteorite's fix there were no doors so I couldn't build rooms.
    Reply With Quote  
     

  8. #5  
    Extreme Donator


    Join Date
    Oct 2010
    Posts
    2,853
    Thanks given
    1,213
    Thanks received
    1,622
    Rep Power
    5000
    Quote Originally Posted by Stevenhax View Post
    Cheers will check out when I'm done with what I'm adding currently.
    I already ported the interfaces over earlier, when adding this does it fix the doors as well?
    When I used Meteorite's fix there were no doors so I couldn't build rooms.
    No idea haha. This basically just makes the construct custom map region packet & object spawning work.
    [Today 01:29 AM] RSTrials: Nice 0.97 Win/Loss Ratio luke. That's pretty bad.
    [Today 01:30 AM] Luke132: Ok u fucking moron i forgot i could influence misc.random
    Reply With Quote  
     

  9. #6  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000
    What exactly was wrong with it? Just wondering, I haven't got any of these sources downloaded on my PC. @Everyone - This is the correct way to build a map area, rather than use different heights (height +=4). It's used in many different places in RS - A lot of solo minigames, such as fight caves as well as construction of course.
    Attached image
    Reply With Quote  
     

  10. #7  
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    Quote Originally Posted by Professor Oak View Post
    Just to piss off this troll I quickly downloaded Ruse v2 and fixed the Construction packets which were messed up. There's still some work required to make the Construction fully functional, but I'd rather not release that right now.

    In PacketSender.java, find and replace:
    Code:
    public PacketSender constructMapRegion(Palette palette) {
    		PacketBuilder bldr = new PacketBuilder(241, PacketType.SHORT);
    		bldr.putShort(player.getPosition().getRegionY() + 6, ValueType.A);
    		bldr.putShort(player.getPosition().getRegionX() + 6);
    		bldr.initializeAccess(AccessType.BIT);
    		for (int z = 0; z < 4; z++) {
    			for (int x = 0; x < 13; x++) {
    				for (int y = 0; y < 13; y++) {
    					PaletteTile tile = palette.getTile(x, y, z);
    					boolean b = false;
    					if (x < 2 || x > 10 || y < 2 || y > 10)
    						b = true;
    					bldr.putBits(1, !b && tile != null ? 1 : 0);
    					if (tile != null && !b) {
    						bldr.putBits(
    								26,
    								tile.getX() << 14 | tile.getY() << 3
    										| tile.getZ() << 24
    										| tile.getRotation() << 1);
    					}
    				}
    			}
    		}
    		bldr.initializeAccess(AccessType.BYTE);		
    		player.getSession().queueMessage(bldr);
    		return this;
    	}
    Client.java, find and replace:
    Code:
    if (pktType == 241) {
    					i11 = getInputBuffer().method435();
    					l2 = getInputBuffer().getUnsignedShort();
    					getInputBuffer().initBitAccess();
    					for (int j16 = 0; j16 < 4; j16++) {
    						for (int l20 = 0; l20 < 13; l20++) {
    							for (int j23 = 0; j23 < 13; j23++) {
    								int emptyFloor = getInputBuffer().getBits(1);
    								if (emptyFloor == 1) {
    									anIntArrayArrayArray1129[j16][l20][j23] = getInputBuffer().getBits(26);
    								} else {
    									anIntArrayArrayArray1129[j16][l20][j23] = -1;
    								}
    							}
    						}
    					}
    					getInputBuffer().finishBitAccess();
    					aBoolean1159 = true;
    				}
    				if (pktType != 241 && anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
    					pktType = -1;
    					return true;
    				}
    Oh and make sure the size of packet 241 is -2 (it should be by default).

    Fix for construction object spawns packet:
    In Client.java, find and replace the following:
    Code:
    				case 4:
    				case 44:
    				case 84:
    				case 101:
    				case 105:
    				case 117:
    				case 147:
    				case 151:
    				case 156:
    				case 160:
    				case 215:
    					parseEntityPacket(getInputBuffer(), pktType);
    					pktType = -1;
    					return true;
    Under void parseEntityPacket, add the following:
    Code:
    if (j == 152) {
    			int tileData = stream.method426();
    			int tileX = anInt1268 + (tileData >> 4 & 7);
    			int tileY = anInt1268 + (tileData & 7);
    			int objID = stream.getShortBigEndian();
    			int typeAndFaceBits = stream.method428();
    			int obType = typeAndFaceBits >> 2;
    			int obFace = typeAndFaceBits & 3;
    			int toPlane = stream.getByte();
    			int l17 = anIntArray1177[obType];
    			if (tileX >= 0 && tileY >= 0 && tileX < 104 && tileY < 104)
    				method130(-1, objID, obFace, l17, tileY, obType,
    						toPlane, tileX, 0);
    			return;
    		}
    Thank you very much, not sure if I'm ever going to need this.
    Attached image
    Reply With Quote  
     

  11. #8  
    Extreme Donator


    Join Date
    Oct 2010
    Posts
    2,853
    Thanks given
    1,213
    Thanks received
    1,622
    Rep Power
    5000
    Quote Originally Posted by Kris View Post
    What exactly was wrong with it? Just wondering, I haven't got any of these sources downloaded on my PC. @Everyone - This is the correct way to build a map area, rather than use different heights (height +=4). It's used in many different places in RS - A lot of solo minigames, such as fight caves as well as construction of course.
    The construct map region packet was completely messed up, and some moron tried fixing it by sending the palette/tile bits in a string lol...
    The construction object spawn packet wasnt even added to the v2 client.
    [Today 01:29 AM] RSTrials: Nice 0.97 Win/Loss Ratio luke. That's pretty bad.
    [Today 01:30 AM] Luke132: Ok u fucking moron i forgot i could influence misc.random
    Reply With Quote  
     

  12. #9  
    Registered Member CapitalCoding's Avatar
    Join Date
    Jul 2011
    Posts
    193
    Thanks given
    30
    Thanks received
    25
    Rep Power
    13
    Quote Originally Posted by Professor Oak View Post
    The construct map region packet was completely messed up, and some moron tried fixing it by sending the palette/tile bits in a string lol...
    The construction object spawn packet wasnt even added to the v2 client.
    Swiffy is not an idiot, btw only an idiot don't know how to handle string buffer in the client
    Attached image
    Reply With Quote  
     

  13. #10  
    Extreme Donator


    Join Date
    Oct 2010
    Posts
    2,853
    Thanks given
    1,213
    Thanks received
    1,622
    Rep Power
    5000
    Quote Originally Posted by CapitalCoding View Post
    Swiffy is not an idiot, btw only an idiot don't know how to handle string buffer in the client
    You literally have no idea what you're talking about.

    The previous packet was sending the tile value as a string. That's just plain retarded. It should be sent as bits..
    Also, I'm pretty sure anyone can use parseInt, don't worry lmao.

    Attached image

    Quote Originally Posted by RememberM3 View Post
    Thank you very much, not sure if I'm ever going to need this.
    No problem. Also, you don't need to quote the entire thing haha. It's not going anywhere.
    [Today 01:29 AM] RSTrials: Nice 0.97 Win/Loss Ratio luke. That's pretty bad.
    [Today 01:30 AM] Luke132: Ok u fucking moron i forgot i could influence misc.random
    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. Ruse v2 construction fix
    By CapitalCoding in forum Snippets
    Replies: 29
    Last Post: 03-10-2017, 10:45 PM
  2. Buying Ruse V2 Construction fix.
    By Iann in forum Buying
    Replies: 0
    Last Post: 12-28-2016, 01:35 AM
  3. Ruse v2 Construction
    By Sirpain in forum Help
    Replies: 6
    Last Post: 10-18-2016, 12:33 AM
  4. [Ruse v2] Sound & Music packet fixes
    By Metorrite in forum Snippets
    Replies: 10
    Last Post: 06-22-2016, 11:57 PM
  5. [Ruse V2] Client Animation Fixes
    By Greg in forum Buying
    Replies: 2
    Last Post: 03-26-2016, 08:14 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
  •