deltanedas / rtfm

A documentation library mod for Mindustry.
GNU General Public License v3.0
78 stars 20 forks source link

Not Working, Or problem in Foo's client. #36

Open COALROCK8642 opened 1 year ago

COALROCK8642 commented 1 year ago

Please check.

deltanedas commented 1 year ago

whys it not working, any logs

Maxgamerboy1 commented 1 year ago

as a new player, i stumbled across this mod as i need to RTFM 😅 i havent joined the discord so apologies if further discussion has happened there. saw that this is not working and did a little investigation, here's a log.

[I] [GL] Version: OpenGL 4.6.0 / NVIDIA Corporation / NVIDIA GeForce RTX 2080 Ti/PCIe/SSE2
[I] [GL] Max texture size: 32768
[I] [GL] Using OpenGL 2 context.
[I] [JAVA] Version: 16.0.1
[I] [RAM] Available: 15.9 GB
[I] [Mindustry] Version: 145.1
[I] Loaded mod 'rtfm' in 1.41ms
[I] Loaded mod 'ui_lib' in 0.5385ms
[E] rhino.WrappedException: Wrapped arc.util.ArcRuntimeException: Error reading file: deltanedas-rtfm-6bcda65\manuals\$rtfm.docs.title\$rtfm.docs.getting-started (absolute) (library#24)
    at rhino.Context.throwAsScriptRuntimeEx(Context.java:1538)
    at rhino.MemberBox.invoke(MemberBox.java:126)
    at rhino.NativeJavaMethod.call(NativeJavaMethod.java:205)
    at rhino.optimizer.OptRuntime.callProp0(OptRuntime.java:71)
    at rhino.gen.library_4._c_anonymous_2(library:24)
    at rhino.gen.library_4.call(library)
    at rhino.ArrowFunction.call(ArrowFunction.java:33)
    at rhino.optimizer.OptRuntime.callName(OptRuntime.java:51)
    at rhino.gen.library_4._c_anonymous_3(library:38)
    at rhino.gen.library_4.call(library)
    at rhino.ArrowFunction.call(ArrowFunction.java:33)
    at rhino.optimizer.OptRuntime.callName(OptRuntime.java:51)
    at rhino.gen.library_4._c_anonymous_8(library:85)
    at rhino.gen.library_4.call(library)
    at rhino.optimizer.OptRuntime.callN(OptRuntime.java:41)
    at rhino.gen.library_4._c_anonymous_10(library:142)
    at rhino.gen.library_4.call(library)
    at rhino.optimizer.OptRuntime.call2(OptRuntime.java:32)
    at rhino.gen.docs_7._c_script_0(docs:21)
    at rhino.gen.docs_7.call(docs)
    at rhino.gen.docs_7.exec(docs)
    at rhino.module.Require.executeModuleScript(Require.java:321)
    at rhino.module.Require.getExportedModuleInterface(Require.java:272)
    at rhino.module.Require.call(Require.java:202)
    at rhino.optimizer.OptRuntime.callName(OptRuntime.java:51)
    at rhino.gen.main_js_3._c_anonymous_1(main.js:19)
    at rhino.gen.main_js_3.call(main.js)
    at rhino.optimizer.OptRuntime.call0(OptRuntime.java:15)
    at rhino.gen.main_js_3._c_script_0(main.js:0)
    at rhino.gen.main_js_3.call(main.js)
    at rhino.ContextFactory.doTopCall(ContextFactory.java:328)
    at rhino.ScriptRuntime.doTopCall(ScriptRuntime.java:3114)
    at rhino.gen.main_js_3.call(main.js)
    at rhino.gen.main_js_3.exec(main.js)
    at rhino.Context.evaluateString(Context.java:989)
    at mindustry.mod.Scripts.run(Scripts.java:86)
    at mindustry.mod.Scripts.run(Scripts.java:76)
    at mindustry.mod.Mods.lambda$loadScripts$24(Mods.java:647)
    at arc.struct.Seq.each(Seq.java:182)
    at mindustry.mod.Mods.eachEnabled(Mods.java:789)
    at mindustry.mod.Mods.loadScripts(Mods.java:635)
    at mindustry.ClientLauncher.lambda$setup$4(ClientLauncher.java:159)
    at arc.assets.AssetManager$1.loadSync(AssetManager.java:333)
    at arc.assets.AssetLoadingTask.handleAsyncLoader(AssetLoadingTask.java:108)
    at arc.assets.AssetLoadingTask.update(AssetLoadingTask.java:73)
    at arc.assets.AssetManager.updateTask(AssetManager.java:590)
    at arc.assets.AssetManager.update(AssetManager.java:439)
    at arc.assets.AssetManager.update(AssetManager.java:464)
    at mindustry.ClientLauncher.update(ClientLauncher.java:206)
    at arc.backend.sdl.SdlApplication.listen(SdlApplication.java:204)
    at arc.backend.sdl.SdlApplication.loop(SdlApplication.java:192)
    at arc.backend.sdl.SdlApplication.<init>(SdlApplication.java:54)
    at mindustry.desktop.DesktopLauncher.main(DesktopLauncher.java:39)
Caused by: arc.util.ArcRuntimeException: Error reading file: deltanedas-rtfm-6bcda65\manuals\$rtfm.docs.title\$rtfm.docs.getting-started (absolute)
    at arc.files.Fi.read(Fi.java:207)
    at arc.files.Fi.readString(Fi.java:281)
    at arc.files.Fi.readString(Fi.java:266)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at rhino.MemberBox.invoke(MemberBox.java:104)
    ... 51 more
Caused by: java.io.FileNotFoundException: deltanedas-rtfm-6bcda65\manuals\$rtfm.docs.title\$rtfm.docs.getting-started (The system cannot find the path specified)
    at java.base/java.io.FileInputStream.open0(Native Method)
    at java.base/java.io.FileInputStream.open(Unknown Source)
    at java.base/java.io.FileInputStream.<init>(Unknown Source)
    at arc.files.Fi.read(Fi.java:203)
    ... 58 more

[E] [rtfm/main.js]: WrappedException: Wrapped arc.util.ArcRuntimeException: Error reading file: deltanedas-rtfm-6bcda65\manuals\$rtfm.docs.title\$rtfm.docs.getting-started (absolute) (library#24)
[I] Time to initialize modded scripts: 326.6575
[I] Total time to load: 2951ms
[I] Fetching community servers at https://raw.githubusercontent.com/Anuken/Mindustry/master/servers_v7.json
[I] Received steam stats.
[I] Fetched 46 community servers.

having a little nosey at the js for this mod. i think it could be to do with how we're attempting to load the section from the bundle. bundle defines rtfm.docs.title and rtfm.docs.getting-started here yet following the call to load this page: from -> to -> to. we arent calling into Core.bundle.get at any point, so it puts the $-erd bundle key in the file path... i think

deltanedas commented 1 year ago

yeah

deltanedas commented 1 year ago

ok so issue is that in readTranslated the first readString call is failing update to 3.15.2 now and see what the error is

Maxgamerboy1 commented 1 year ago

sure, here's latest log:

[I] [GL] Version: OpenGL 4.6.0 / NVIDIA Corporation / NVIDIA GeForce RTX 2080 Ti/PCIe/SSE2
[I] [GL] Max texture size: 32768
[I] [GL] Using OpenGL 2 context.
[I] [JAVA] Version: 16.0.1
[I] [RAM] Available: 15.9 GB
[I] [Mindustry] Version: 145.1
[I] Loaded mod 'rtfm' in 1.2002ms
[I] Loaded mod 'ui_lib' in 0.6358ms
[E] Failed to read manuals/RTFM Docs/Getting Started
[E] JavaException: arc.util.ArcRuntimeException: Error reading file: deltanedas-rtfm-2da7085\manuals\RTFM Docs\Getting Started (absolute)
[E] rhino.WrappedException: Wrapped arc.util.ArcRuntimeException: Error reading file: deltanedas-rtfm-2da7085\manuals\$rtfm.docs.title\$rtfm.docs.getting-started (absolute) (library#24)
    at rhino.Context.throwAsScriptRuntimeEx(Context.java:1538)
    at rhino.MemberBox.invoke(MemberBox.java:126)
    at rhino.NativeJavaMethod.call(NativeJavaMethod.java:205)
    at rhino.optimizer.OptRuntime.callProp0(OptRuntime.java:71)
    at rhino.gen.library_4._c_anonymous_2(library:24)
    at rhino.gen.library_4.call(library)
    at rhino.ArrowFunction.call(ArrowFunction.java:33)
    at rhino.optimizer.OptRuntime.callName(OptRuntime.java:51)
    at rhino.gen.library_4._c_anonymous_3(library:40)
    at rhino.gen.library_4.call(library)
    at rhino.ArrowFunction.call(ArrowFunction.java:33)
    at rhino.optimizer.OptRuntime.callName(OptRuntime.java:51)
    at rhino.gen.library_4._c_anonymous_8(library:87)
    at rhino.gen.library_4.call(library)
    at rhino.optimizer.OptRuntime.callN(OptRuntime.java:41)
    at rhino.gen.library_4._c_anonymous_10(library:144)
    at rhino.gen.library_4.call(library)
    at rhino.optimizer.OptRuntime.call2(OptRuntime.java:32)
    at rhino.gen.docs_7._c_script_0(docs:21)
    at rhino.gen.docs_7.call(docs)
    at rhino.gen.docs_7.exec(docs)
    at rhino.module.Require.executeModuleScript(Require.java:321)
    at rhino.module.Require.getExportedModuleInterface(Require.java:272)
    at rhino.module.Require.call(Require.java:202)
    at rhino.optimizer.OptRuntime.callName(OptRuntime.java:51)
    at rhino.gen.main_js_3._c_anonymous_1(main.js:19)
    at rhino.gen.main_js_3.call(main.js)
    at rhino.optimizer.OptRuntime.call0(OptRuntime.java:15)
    at rhino.gen.main_js_3._c_script_0(main.js:0)
    at rhino.gen.main_js_3.call(main.js)
    at rhino.ContextFactory.doTopCall(ContextFactory.java:328)
    at rhino.ScriptRuntime.doTopCall(ScriptRuntime.java:3114)
    at rhino.gen.main_js_3.call(main.js)
    at rhino.gen.main_js_3.exec(main.js)
    at rhino.Context.evaluateString(Context.java:989)
    at mindustry.mod.Scripts.run(Scripts.java:86)
    at mindustry.mod.Scripts.run(Scripts.java:76)
    at mindustry.mod.Mods.lambda$loadScripts$24(Mods.java:647)
    at arc.struct.Seq.each(Seq.java:182)
    at mindustry.mod.Mods.eachEnabled(Mods.java:789)
    at mindustry.mod.Mods.loadScripts(Mods.java:635)
    at mindustry.ClientLauncher.lambda$setup$4(ClientLauncher.java:159)
    at arc.assets.AssetManager$1.loadSync(AssetManager.java:333)
    at arc.assets.AssetLoadingTask.handleAsyncLoader(AssetLoadingTask.java:108)
    at arc.assets.AssetLoadingTask.update(AssetLoadingTask.java:73)
    at arc.assets.AssetManager.updateTask(AssetManager.java:590)
    at arc.assets.AssetManager.update(AssetManager.java:439)
    at arc.assets.AssetManager.update(AssetManager.java:464)
    at mindustry.ClientLauncher.update(ClientLauncher.java:206)
    at arc.backend.sdl.SdlApplication.listen(SdlApplication.java:204)
    at arc.backend.sdl.SdlApplication.loop(SdlApplication.java:192)
    at arc.backend.sdl.SdlApplication.<init>(SdlApplication.java:54)
    at mindustry.desktop.DesktopLauncher.main(DesktopLauncher.java:39)
Caused by: arc.util.ArcRuntimeException: Error reading file: deltanedas-rtfm-2da7085\manuals\$rtfm.docs.title\$rtfm.docs.getting-started (absolute)
    at arc.files.Fi.read(Fi.java:207)
    at arc.files.Fi.readString(Fi.java:281)
    at arc.files.Fi.readString(Fi.java:266)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at rhino.MemberBox.invoke(MemberBox.java:104)
    ... 51 more
Caused by: java.io.FileNotFoundException: deltanedas-rtfm-2da7085\manuals\$rtfm.docs.title\$rtfm.docs.getting-started (The system cannot find the path specified)
    at java.base/java.io.FileInputStream.open0(Native Method)
    at java.base/java.io.FileInputStream.open(Unknown Source)
    at java.base/java.io.FileInputStream.<init>(Unknown Source)
    at arc.files.Fi.read(Fi.java:203)
    ... 58 more

[E] [rtfm/main.js]: WrappedException: Wrapped arc.util.ArcRuntimeException: Error reading file: deltanedas-rtfm-2da7085\manuals\$rtfm.docs.title\$rtfm.docs.getting-started (absolute) (library#24)
[I] Time to initialize modded scripts: 312.8186
[I] Total time to load: 2886ms
[I] Fetching community servers at https://raw.githubusercontent.com/Anuken/Mindustry/master/servers_v7.json
[I] Received steam stats.
[I] Fetched 46 community servers.

seems two additional logs have been added

[E] Failed to read manuals/RTFM Docs/Getting Started [E] JavaException: arc.util.ArcRuntimeException: Error reading file: deltanedas-rtfm-2da7085\manuals\RTFM Docs\Getting Started (absolute)

i wonder if it cant parse the spaces?

deltanedas commented 1 year ago

either its binbows moment with spaces or suddenly arc wants an absolute path but mindustry returns a relative path for the mod

Maxgamerboy1 commented 1 year ago

i think it's the latter. made a local change to rename all files and folders, replacing spaces with _ and the same error is returned. out of curiousty i added a line in the readString method (the one commented here)

const readString = path => {
    const file = currentMod.root.child(path);
    // Log.err(file.absolutePath());
    return file.readString();
};

and it gives this in the log;

... [I] Loaded mod 'rtfm' in 1.1763ms [I] Loaded mod 'ui_lib' in 0.445401ms [E] I:/Steam/steamapps/common/Mindustry/deltanedas-rtfm-6bcda65/manuals/RTFM_Docs/Getting_Started ...

and that filepath is invalid image

i wonder if currentMod.file.child(...) would be better suited, as i think that points to the location of the zip. imma see what happens with that

deltanedas commented 1 year ago

yeah if that works ill just change it to child

Maxgamerboy1 commented 1 year ago

hmm, not quite that simple; using currentMod.file.child(...) gives us almost the correct file path

[E] I:/Steam/steamapps/common/Mindustry/saves/mods/deltanedasrtfm.zip/manuals/RTFM Docs/Getting Started

but the .zip structure has an extra folder, which includes a partial hash I:\Steam\steamapps\common\Mindustry\saves\mods\deltanedasrtfm.zip\deltanedas-rtfm-2da7085\... the log also now shows the file as (local) rather than absolute path, so not sure now what context of currentMod.file is in... here's another log dump

[I] [GL] Version: OpenGL 4.6.0 / NVIDIA Corporation / NVIDIA GeForce RTX 2080 Ti/PCIe/SSE2
[I] [GL] Max texture size: 32768
[I] [GL] Using OpenGL 2 context.
[I] [JAVA] Version: 16.0.1
[I] [RAM] Available: 15.9 GB
[I] [Mindustry] Version: 145.1
[I] Loaded mod 'rtfm' in 1.087799ms
[I] Loaded mod 'ui_lib' in 0.4566ms
[E] Failed to read manuals/RTFM Docs/Getting Started
[E] JavaException: arc.util.ArcRuntimeException: File not found: saves\mods\deltanedasrtfm.zip\manuals\RTFM Docs\Getting Started (local)
[E] rhino.WrappedException: Wrapped arc.util.ArcRuntimeException: File not found: saves\mods\deltanedasrtfm.zip\manuals\$rtfm.docs.title\$rtfm.docs.getting-started (local) (library#24)
    at rhino.Context.throwAsScriptRuntimeEx(Context.java:1538)
    at rhino.MemberBox.invoke(MemberBox.java:126)
    at rhino.NativeJavaMethod.call(NativeJavaMethod.java:205)
    at rhino.optimizer.OptRuntime.callProp0(OptRuntime.java:71)
    at rhino.gen.library_4._c_anonymous_2(library:24)
    at rhino.gen.library_4.call(library)
    at rhino.ArrowFunction.call(ArrowFunction.java:33)
    at rhino.optimizer.OptRuntime.callName(OptRuntime.java:51)
    at rhino.gen.library_4._c_anonymous_3(library:40)
    at rhino.gen.library_4.call(library)
    at rhino.ArrowFunction.call(ArrowFunction.java:33)
    at rhino.optimizer.OptRuntime.callName(OptRuntime.java:51)
    at rhino.gen.library_4._c_anonymous_8(library:87)
    at rhino.gen.library_4.call(library)
    at rhino.optimizer.OptRuntime.callN(OptRuntime.java:41)
    at rhino.gen.library_4._c_anonymous_10(library:144)
    at rhino.gen.library_4.call(library)
    at rhino.optimizer.OptRuntime.call2(OptRuntime.java:32)
    at rhino.gen.docs_7._c_script_0(docs:21)
    at rhino.gen.docs_7.call(docs)
    at rhino.gen.docs_7.exec(docs)
    at rhino.module.Require.executeModuleScript(Require.java:321)
    at rhino.module.Require.getExportedModuleInterface(Require.java:272)
    at rhino.module.Require.call(Require.java:202)
    at rhino.optimizer.OptRuntime.callName(OptRuntime.java:51)
    at rhino.gen.main_js_3._c_anonymous_1(main.js:19)
    at rhino.gen.main_js_3.call(main.js)
    at rhino.optimizer.OptRuntime.call0(OptRuntime.java:15)
    at rhino.gen.main_js_3._c_script_0(main.js:0)
    at rhino.gen.main_js_3.call(main.js)
    at rhino.ContextFactory.doTopCall(ContextFactory.java:328)
    at rhino.ScriptRuntime.doTopCall(ScriptRuntime.java:3114)
    at rhino.gen.main_js_3.call(main.js)
    at rhino.gen.main_js_3.exec(main.js)
    at rhino.Context.evaluateString(Context.java:989)
    at mindustry.mod.Scripts.run(Scripts.java:86)
    at mindustry.mod.Scripts.run(Scripts.java:76)
    at mindustry.mod.Mods.lambda$loadScripts$24(Mods.java:647)
    at arc.struct.Seq.each(Seq.java:182)
    at mindustry.mod.Mods.eachEnabled(Mods.java:789)
    at mindustry.mod.Mods.loadScripts(Mods.java:635)
    at mindustry.ClientLauncher.lambda$setup$4(ClientLauncher.java:159)
    at arc.assets.AssetManager$1.loadSync(AssetManager.java:333)
    at arc.assets.AssetLoadingTask.handleAsyncLoader(AssetLoadingTask.java:108)
    at arc.assets.AssetLoadingTask.update(AssetLoadingTask.java:73)
    at arc.assets.AssetManager.updateTask(AssetManager.java:590)
    at arc.assets.AssetManager.update(AssetManager.java:439)
    at arc.assets.AssetManager.update(AssetManager.java:464)
    at mindustry.ClientLauncher.update(ClientLauncher.java:206)
    at arc.backend.sdl.SdlApplication.listen(SdlApplication.java:204)
    at arc.backend.sdl.SdlApplication.loop(SdlApplication.java:192)
    at arc.backend.sdl.SdlApplication.<init>(SdlApplication.java:54)
    at mindustry.desktop.DesktopLauncher.main(DesktopLauncher.java:39)
Caused by: arc.util.ArcRuntimeException: File not found: saves\mods\deltanedasrtfm.zip\manuals\$rtfm.docs.title\$rtfm.docs.getting-started (local)
    at arc.files.Fi.read(Fi.java:199)
    at arc.files.Fi.readString(Fi.java:281)
    at arc.files.Fi.readString(Fi.java:266)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at rhino.MemberBox.invoke(MemberBox.java:104)
    ... 51 more

[E] [rtfm/main.js]: WrappedException: Wrapped arc.util.ArcRuntimeException: File not found: saves\mods\deltanedasrtfm.zip\manuals\$rtfm.docs.title\$rtfm.docs.getting-started (local) (library#24)
[I] Time to initialize modded scripts: 328.3722
[I] Total time to load: 3138ms
[I] Fetching community servers at https://raw.githubusercontent.com/Anuken/Mindustry/master/servers_v7.json
[I] Received steam stats.
[I] Fetched 46 community servers.