fix: remove Applet dependency for non-applet OSRS client#1674
fix: remove Applet dependency for non-applet OSRS client#1674mzarglis wants to merge 1 commit intochsami:mainfrom
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
WalkthroughThe pull request migrates RuneLite's initialization architecture from an Applet-based system to a client-based configuration system. Changes span three files: RuneLiteDebug.java replaces applet lifecycle methods with client initialization calls and adds client.unblockStartup(); MicrobotClientLoader.java removes Applet casting and switches to Client.setConfiguration() with a configuration stub; MicrobotRSAppletStub.java changes from implementing AppletStub to implementing ClientConfiguration, replacing multiple applet-related methods with a centralized onError(String code) method for error handling. 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
runelite-client/src/main/java/net/runelite/client/RuneLiteDebug.java (1)
322-399:⚠️ Potential issue | 🟠 MajorGuard client calls when
isOutdatedis true.
isOutdatedis defined asclient == null, butclient.initialize()andclient.unblockStartup()are still called unconditionally, which will NPE if the client failed to load. Consider an early return or a hard fail before usingclient.Suggested fix
- client.initialize(); + if (isOutdated) + { + throw new IllegalStateException("Client failed to load"); + } + client.initialize(); @@ - client.unblockStartup(); + client.unblockStartup();
The OSRS client no longer extends java.applet.Applet, causing a ClassCastException when running in debug mode. Changes: - MicrobotRSAppletStub: Changed from implementing AppletStub to implementing ClientConfiguration interface - MicrobotClientLoader: Changed from ((Applet) rs).setStub() to rs.setConfiguration() - RuneLiteDebug: Replaced applet.init()/start() with client.initialize() and added client.unblockStartup() after plugins start This aligns the debug client loader with the main RuneLite/ClientLoader implementation that already uses the new ClientConfiguration interface.
0a24972 to
4419261
Compare
Summary
The OSRS client no longer extends
java.applet.Applet, causing aClassCastExceptionwhen running in debug mode viaRuneLiteDebug:This PR updates the Microbot-specific client loading code to use the new
ClientConfigurationinterface, aligning it with the mainRuneLite/ClientLoaderimplementation.Changes
AppletStubto implementingClientConfigurationinterface, replacingshowDocument()error handling with the newonError(String code)method((Applet) rs).setStub()tors.setConfiguration()applet.init()/applet.start()withclient.initialize()and addedclient.unblockStartup()after plugins start