mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-02 16:49:03 +00:00
[GH-ISSUE #246] Music doesn't play through Parabot #2905
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dginovker on GitHub (Dec 9, 2019).
Original GitHub issue: https://github.com/2006-Scape/2006Scape/issues/246
You're likely going to want to be part of the Parabot slack to fix this, so comment below if you want an invite to that channel.
General instructions for setting up Parabot locally are in the Readme folder. At a high level, you use the hooks file to map classes from Parabot's interface to the client. If the hooks file is wrong, your server won't load up - so we know our hooks file "works", but there might be something else to it.
Parabot doesn't think it's on their end, and the raw .jar's music plays just fine. I don't personally know what's missing, but if anyone does, please share your thoughts.
@JKetelaar commented on GitHub (Dec 9, 2019):
@JKetelaar commented on GitHub (Dec 9, 2019):
What different do you do from loading music and playing music from a clean 317 client and yours?
@mrextremez commented on GitHub (Dec 9, 2019):
Pretty sure this is the music system I added, seems that many others have used it as well
https://www.rune-server.ee/runescape-development/rs2-client/snippets/363314-sounds-music.html @JKetelaar
@JKetelaar commented on GitHub (Dec 9, 2019):
Can you refer to this within your own code? So I can look through it
@dginovker commented on GitHub (Dec 9, 2019):
Client.java change: https://github.com/dginovker/2006rebotted/blob/master/2006Redone%20Client/src/Game.java#L6486
SoundPlayer.java: https://github.com/dginovker/2006rebotted/blob/master/2006Redone%20Client/src/SoundPlayer.java
@JKetelaar commented on GitHub (Dec 10, 2019):
Does it ever reach
#method90?https://github.com/dginovker/2006rebotted/blob/master/2006Redone%20Client/src/Game.java#L6486
Can you check if the method is being called properly?
@JKetelaar commented on GitHub (Dec 10, 2019):
And what happens if you run Parabot with
-no_sec?@dginovker commented on GitHub (Dec 10, 2019):
-no_secfixes it!Method90 gets called in non-Parabot client (but the same one that feeds in).
What should we do?
@JKetelaar commented on GitHub (Dec 10, 2019):
Apparently there is a redirect class that you are using;
https://github.com/Parabot/Parabot/tree/master/src/main/java/org/parabot/core/asm/redirect
It might be SystemRedirect, but you'll have to check this yourself.
You could go disable all redirects in:
https://github.com/Parabot/Parabot/blob/master/src/main/java/org/parabot/core/asm/RedirectClassAdapter.java#L26
And enable them one-by-one to ensure which is causing it, so you can debug further
@JKetelaar commented on GitHub (Dec 10, 2019):
You might also want to enable print of stack traces (https://github.com/dginovker/2006rebotted/blob/master/2006Redone%20Client/src/Game.java#L3141), so you know where it's coming from
@dginovker commented on GitHub (Dec 11, 2019):
The culprit is
redirects.put("java/awt/Toolkit", ToolkitRedirect.class);on line 27.Disabling that makes it work.
When enabling the 2006rebotted stacktraces and loading it up in the Parabot client (even with
-verboseflag), nothing shows up. I'm not sure if those print lines come through the PB client, though.I checked out the ToolkitRedirect class and I see it's preventing malicious scripts from accessing parts of the host system. Which do you think is causing the problems?
@JKetelaar commented on GitHub (Dec 12, 2019):
So somewhere you are using
java.awt.Toolkitand the method either doesn't exist in the ToolkitRedirect class or the method returns an error, because it protects its users@dginovker commented on GitHub (Dec 13, 2019):
So I've gone through the whole Client project and replaced all
import java.awt.*with more restrictive imports, and removed all instances ofjava.awt.Toolkit(with the exception ofSprite.java), but still no music on compile. You can see my branch where I did this here: https://github.com/dginovker/2006rebotted/commit/9efafdff474e62b40bd8dfcf060d17730375ef22As I was going through it, it didn't seem like anything used the Toolkit either (outside Sprite.java), least of all method90 & SoundPlayer, where the music is playing from.
Is there any way, by modifying the Parabot client perhaps, I could figure out what methods are being blocked?
@JKetelaar commented on GitHub (Dec 16, 2019):
I am not sure, to be honest. Somewhere you are not printing your stack traces, therefore it causes an error that you cannot see (really bad practice). I would say ensure that every stack trace (everywhere) gets printed, so you can debug this further.
@JKetelaar commented on GitHub (Dec 16, 2019):
Another option you can do is run Parabot with
-dump. This will create a dump of the client with the injected code (indocuments/Parabot/dump.jar). Then you can use this dump to see where the ToolKit class gets used for the redirect.