PhoenicisOrg/scripts

SteamScript shortcuts does not work

Zemogiter opened this issue · 15 comments

Tried with Space Engineers and Space Colony and with each I get this error:

[ERROR] org.phoenicis.multithreading.ControlledThreadPoolExecutorService (l.64) - TypeError: com.oracle.truffle.api.interop.UnsupportedTypeException: Cannot convert '297920'(language: JavaScript, type: number) to Java type 'java.lang.String': Invalid or lossy primitive coercion.
	at <js> run(Unnamed:411:15584-15632)
	at <js> run(Unnamed:170:5379-5469)
	at <js> run(Unnamed:39-41:1232-1396)
	at <js> run(Unnamed:107:3183-3212)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.ObjectProxyHandler.invoke(HostInteropReflect.java:678)
	at com.sun.proxy.$Proxy44.run(Unknown Source)
	at org.phoenicis.library.ShortcutRunner.lambda$run$0(ShortcutRunner.java:52)
	at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval(PhoenicisInteractiveScriptSession.java:35)
	at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1(BackgroundScriptInterpreter.java:45)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

Exception in thread "pool-3-thread-4" TypeError: com.oracle.truffle.api.interop.UnsupportedTypeException: Cannot convert '297920'(language: JavaScript, type: number) to Java type 'java.lang.String': Invalid or lossy primitive coercion.
	at <js> run(Unnamed:411:15584-15632)
	at <js> run(Unnamed:170:5379-5469)
	at <js> run(Unnamed:39-41:1232-1396)
	at <js> run(Unnamed:107:3183-3212)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.ObjectProxyHandler.invoke(HostInteropReflect.java:678)
	at com.sun.proxy.$Proxy44.run(Unknown Source)
	at org.phoenicis.library.ShortcutRunner.lambda$run$0(ShortcutRunner.java:52)
	at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval(PhoenicisInteractiveScriptSession.java:35)
	at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1(BackgroundScriptInterpreter.java:45)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

Can you share the content of the corresponding *.shortcut file?

Space Engineers shortcut:

{"type":"WINE","environment":{"WINEDEBUG":"-all"},"trustLevel":"0","winePrefix":"Space Engineers","arguments":["-silent","-applaunch",244850,"-no-ces-sandbox","-skipintro"],"workingDirectory":"/home/jonasz/.Phoenicis/containers/wineprefix/Space Engineers/drive_c/Program Files (x86)/Steam","executable":"/home/jonasz/.Phoenicis/containers/wineprefix/Space Engineers/drive_c/Program Files (x86)/Steam/Steam.exe"}

Space Colony shortcut:

{"type":"WINE","environment":{"WINEDEBUG":"-all"},"trustLevel":"0","winePrefix":"Space Colony","arguments":["-no-cef-sandbox","-silent","-applaunch",297920],"workingDirectory":"/home/jonasz/.Phoenicis/containers/wineprefix/Space Colony/drive_c/Program Files/Steam","executable":"/home/jonasz/.Phoenicis/containers/wineprefix/Space Colony/drive_c/Program Files/Steam/Steam.exe"}

Can you try wrapping the appId in ""? I.e. "244850" and "297920". Do the applications launch correctly then?

They do launch now.

Can you try to add in https://github.com/PhoenicisOrg/scripts/blob/master/Engines/Wine/QuickScript/Steam%20Script/script.js line 83 a num.toString(this._appId) instead of this.appId and try to install a new steam app and see if it works @Zemogiter.

there is no this.appId in that line

Line 93 sorry

Results in this error:

ERROR] org.phoenicis.multithreading.ControlledThreadPoolExecutorService (l.64) - ReferenceError: num is not defined
	at <js> go(Unnamed:93:5903-5905)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.ObjectProxyHandler.invoke(HostInteropReflect.java:678)
	at com.sun.proxy.$Proxy44.go(Unknown Source)
	at org.phoenicis.javafx.components.application.skin.ApplicationInformationPanelSkin.lambda$installScript$7(ApplicationInformationPanelSkin.java:237)
	at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval(PhoenicisInteractiveScriptSession.java:35)
	at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1(BackgroundScriptInterpreter.java:45)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

Exception in thread "pool-3-thread-11" ReferenceError: num is not defined
	at <js> go(Unnamed:93:5903-5905)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.ObjectProxyHandler.invoke(HostInteropReflect.java:678)
	at com.sun.proxy.$Proxy44.go(Unknown Source)
	at org.phoenicis.javafx.components.application.skin.ApplicationInformationPanelSkin.lambda$installScript$7(ApplicationInformationPanelSkin.java:237)
	at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval(PhoenicisInteractiveScriptSession.java:35)
	at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1(BackgroundScriptInterpreter.java:45)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

And just String(this._appId)?

@ImperatorS79 I've moved past that error but D3DX9 verb gave me this error:

[ERROR] org.phoenicis.multithreading.ControlledThreadPoolExecutorService (l.64) - TypeError: <this>.architecture is not a function
	at <js> go(Unnamed:95:3384-3402)
	at <js> :anonymous(Unnamed:21:702-721)
	at <js> go(Unnamed:144:8014-8048)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.ObjectProxyHandler.invoke(HostInteropReflect.java:678)
	at com.sun.proxy.$Proxy44.go(Unknown Source)
	at org.phoenicis.javafx.components.application.skin.ApplicationInformationPanelSkin.lambda$installScript$7(ApplicationInformationPanelSkin.java:237)
	at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval(PhoenicisInteractiveScriptSession.java:35)
	at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1(BackgroundScriptInterpreter.java:45)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

Exception in thread "pool-3-thread-5" TypeError: <this>.architecture is not a function
	at <js> go(Unnamed:95:3384-3402)
	at <js> :anonymous(Unnamed:21:702-721)
	at <js> go(Unnamed:144:8014-8048)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.ObjectProxyHandler.invoke(HostInteropReflect.java:678)
	at com.sun.proxy.$Proxy44.go(Unknown Source)
	at org.phoenicis.javafx.components.application.skin.ApplicationInformationPanelSkin.lambda$installScript$7(ApplicationInformationPanelSkin.java:237)
	at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval(PhoenicisInteractiveScriptSession.java:35)
	at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1(BackgroundScriptInterpreter.java:45)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

Will fix it in gdiplus pr.

Edit: @Zemogiter How did you fix Steam error ?

@ImperatorS79 String(this._appId) however that previous error showed up right after pressing install button.

Try changing:

this._executableArgs = ["-no-cef-sandbox", "-silent", "-applaunch", this._appId];

to:

this._executableArgs = ["-no-cef-sandbox", "-silent", "-applaunch", `${this._appId}`];

I see two possible long-term solutions to this:

  1. we decide that this._executableArgs must contain only string values. My previous solution would work in this case
  2. we decide that the calling site is responsible to interpret the values correctly. In this case we will need to check where the shortcut is read and interpreted and fix the issue there

ImperatorS79's solution worked