Posted October 6, 20213 yr comment_63117 Welcome! Today I'll be showing a SUPER simple way to replace the old, outdated and frankly terrible way that most Ruse servers handle launching URLs. First off, go ahead and create a new packet in your PacketSender (May be called PacketHandler). This is the hidden content, please Sign In or Sign Up I called mine openURL. (Big brain, I know!) Next, you'll want to head over to your Client Configuration file. Scroll to the bottom, and you'll see a load of seemingly confusing numbers. You can usually find them easily: This is the hidden content, please Sign In or Sign Up Find one that is currently 0 I have chosen packet 220. Next, do a search in Client.java for: This is the hidden content, please Sign In or Sign Up E.g. If you don't find anything, open up your PacketHandler / PacketSender again. Search for the packet number you've selected. Again, hopefully nothing is found.. Great! If you did find that the packet you selected is already in use, select a new number and try again. Once you find the unused number, change the 0 to -1. This allows the packet to accept non specific data. Bare in mind that the first number of each row ends in a 0. E.g... This is the hidden content, please Sign In or Sign Up Now, we need to finish the packet code in PacketSender. This is the hidden content, please Sign In or Sign Up That's the packet done! You'll be able to use this anywhere. E.g: This is the hidden content, please Sign In or Sign Up Now, head back to your Client.java file and do another search. This time, we're searching for: This is the hidden content, please Sign In or Sign Up This is where your client handles the information that it receives from packets. We'll need to make a new case for the packet number that you selected (As shown in the image above). Now, here is the code annotated: This is the hidden content, please Sign In or Sign Up That's it! You should be good to go. I would suggest wrapping the above code in a try / catch block in case you pass a non-valid URL. Here is an example command that utilises this new ability.. This is the hidden content, please Sign In or Sign Up You should update any existing command such as ::donate or ::store so that they open using the native way! Done
Create an account or sign in to comment