feat(web): align Web audio/clipboard/screenshot hooks and reflection whitelist with Desktop and Android
Bring `2006Scape-Web` platform hooks and TeaVM reflection support in-line with the shared `2006Scape Client` and `2006Scape-Android` implementations. ### Platform Hooks & Web Audio - `Class56_Sub1_Sub1.java` & `index.html` - Forwarded `boolean loop` from `method827` to `DesktopHooks.playMidiBytes(midiBytes, vol, loop)` and `window.scapeWebAudio.playMidi(bytes, volume, loop)` so FluidSynth honors `setPlayerLoop(loop ? -1 : 0)`. - Overrode `setLoop(boolean loop, boolean restartIfStopped)` to sync MIDI loop toggles immediately via `DesktopHooks.setMidiLoop` and `scapeWebAudio.setMidiLoop`. - `DesktopHooks.java` & `index.html` - Added browser `paste` and `focus` (`navigator.clipboard.readText()`) tracking to `window.scapeClipboardText` and implemented ASCII `32..122` filtering in `DesktopHooks.getClipBoard()`. - Updated `takeScreenshot` to use `<username or SERVER_NAME>_<timestamp>.png` and send `"A picture has been downloaded."` to in-game chat when `sendMessage` is `true`. - Removed duplicate `ensureHudAssets()` call in `drawModernMinimap`. ### TeaVM Script Reflection - `WebReflectionSupplier.java` - Added `WorldWebWalker` to `SCRIPTABLE_CLASSES` and expanded `isLangStr` (`lastIndexOf`, `charAt`, `split`) and `isUtilColl` (`set`, `indexOf`, `containsValue`, `keySet`, `values`).
This commit is contained in:
1 parent
558243a3b7
commit
f08736d2df
4 files changed
+80
-15
No files matched your search
@@ -41,10 +41,12 @@ public final class WebReflectionSupplier implements ReflectionSupplier {
|
||||
SCRIPTABLE_CLASSES.add(p + "PluginContext$PlayerQuery");
|
||||
SCRIPTABLE_CLASSES.add(p + "PluginGraphics");
|
||||
SCRIPTABLE_CLASSES.add(p + "PluginConfigItem");
|
||||
SCRIPTABLE_CLASSES.add(p + "MenuEntry");
|
||||
SCRIPTABLE_CLASSES.add(p + "ClientScript");
|
||||
SCRIPTABLE_CLASSES.add(p + "ClientPlugin");
|
||||
SCRIPTABLE_CLASSES.add(p + "ClientSettings");
|
||||
SCRIPTABLE_CLASSES.add(p + "ScriptLogger");
|
||||
SCRIPTABLE_CLASSES.add(p + "WorldWebWalker");
|
||||
SCRIPTABLE_CLASSES.add(p + "Game");
|
||||
SCRIPTABLE_CLASSES.add(p + "Player");
|
||||
SCRIPTABLE_CLASSES.add(p + "NPC");
|
||||
@@ -116,12 +118,15 @@ public final class WebReflectionSupplier implements ReflectionSupplier {
|
||||
if (!"length".equals(name) && !"equals".equals(name) && !"equalsIgnoreCase".equals(name)
|
||||
&& !"contains".equals(name) && !"startsWith".equals(name) && !"endsWith".equals(name)
|
||||
&& !"toLowerCase".equals(name) && !"toUpperCase".equals(name) && !"trim".equals(name)
|
||||
&& !"substring".equals(name) && !"indexOf".equals(name) && !"replace".equals(name)
|
||||
&& !"substring".equals(name) && !"indexOf".equals(name) && !"lastIndexOf".equals(name)
|
||||
&& !"replace".equals(name) && !"charAt".equals(name) && !"split".equals(name)
|
||||
&& !"isEmpty".equals(name) && !"valueOf".equals(name)) continue;
|
||||
} else if (isUtilColl) {
|
||||
if (!"size".equals(name) && !"isEmpty".equals(name) && !"get".equals(name)
|
||||
&& !"add".equals(name) && !"remove".equals(name) && !"clear".equals(name)
|
||||
&& !"contains".equals(name) && !"containsKey".equals(name) && !"put".equals(name)) continue;
|
||||
&& !"set".equals(name) && !"add".equals(name) && !"remove".equals(name)
|
||||
&& !"clear".equals(name) && !"contains".equals(name) && !"indexOf".equals(name)
|
||||
&& !"containsKey".equals(name) && !"containsValue".equals(name)
|
||||
&& !"put".equals(name) && !"keySet".equals(name) && !"values".equals(name)) continue;
|
||||
}
|
||||
methods.add(m.getDescriptor());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user