Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add The Sims 2 #927

Open
wants to merge 51 commits into
base: master
Choose a base branch
from
Open

Add The Sims 2 #927

wants to merge 51 commits into from

Conversation

Zemogiter
Copy link
Contributor

@Zemogiter Zemogiter commented May 6, 2019

As of right now the script crashes when trying to download the file in fixes variable.

javax.script.ScriptException: ReferenceError: "AppResource" is not defined in <eval> at line number 28
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:477)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:461)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:413)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:409)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:162)
	at java.scripting/javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
	at org.phoenicis.scripts.nashorn.NashornEngine.eval(NashornEngine.java:50)
	at org.phoenicis.scripts.nashorn.NashornScriptInterpreter.runScript(NashornScriptInterpreter.java:35)
	at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$runScript$0(BackgroundScriptInterpreter.java:35)
	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)
Caused by: <eval>:28 ReferenceError: "AppResource" is not defined
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:319)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:291)
	at jdk.scripting.nashorn/jdk.nashorn.internal.objects.Global.__noSuchProperty__(Global.java:1616)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$1463$1102AA$\^eval\_.run#L:24(<eval>:28)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$1462$633$\^eval\_$cu1$restOf.go(engines.wine.quick_script.origin_script:60)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$1309$516$\^eval\_.run(<eval>:15)
	at jdk.nashorn.javaadapters.org_phoenicis_scripts_Installer.run(Unknown Source)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$1308$\^eval\_$cu1$restOf.:program(<eval>:55)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:655)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:527)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:456)
	... 10 more

Because of that I was unable to go any further and test if the game works. Requesting the Help Needed label for the PR.
Comparing to the Lutris script (https://lutris.net/games/install/8277/view) I've noticed we may need these things:

TL;DR
The game works but sims are displayed as red, T-posing models and textures of trees are white aka exploding textures. Tried DVK9 (crashes the game) and V9K (dosen't fix the issue).

@ImperatorS79
Copy link
Contributor

Why is there commits for atmlib despite it is already in the main repo ?
For the environment variable, it is this issue #869.
Is there not an specific include to use an AppRessource ?

@Zemogiter
Copy link
Contributor Author

@ImperatorS79 no idea why they are here since I've created this branch out of master not atmlib. There isn't a include for AppResource - just Resource but isn't that the same thing?

@ImperatorS79
Copy link
Contributor

@Zemogiter You need to include utils.functions.apps.resources !

Removed accidential changes.
@Zemogiter
Copy link
Contributor Author

Despite Codacy having issues the installation went though and the game - against all odds - works just fine aside that it changes my display's resolution to 1024x768 and the files in postInstall are downloaded/extracted to a new directory called $USER rather than $USER just pulling the current username like I expected. These files are needed to fix issues stated here:
https://github.com/lutris/lutris/wiki/Game:-The-Sims-2

Zemogiter added 2 commits May 6, 2019 12:51
Removal of unused includes.
@plata
Copy link
Collaborator

plata commented May 6, 2019

You probably have to use something like java.lang.System.getenv().

@Zemogiter
Copy link
Contributor Author

Okay so I've played this game and the tree textures are white and Sims are red human-shaped t-posing polygons. I've tried Lutris script but the game installation crashes because of vcrun error. Changine wine version in Lutris dosen't help. We may need that patched wine from the OP after all.

Trying to obtain username so that postInstall would work without user intervention. Untested.
@ImperatorS79
Copy link
Contributor

A log from wine could be nice to debug.

@Zemogiter
Copy link
Contributor Author

wine.log

@ImperatorS79
Copy link
Contributor

@Zemogiter Did you check WINEDEBUG ? Seems pretty empty ^^.

@Zemogiter
Copy link
Contributor Author

WINEDEBUG is set in /etc/environment to fixme-all

Copy link
Collaborator

@madoar madoar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong click the previous comments are change requests

Removing extra newlines
code clearup
Fixed name mismatch and indentation.
Using different link for fixes constant, moved the username constant up, added an env value.
Commenting out stuff related to regedit because I'm not sure if they are needed based on how Lutris script looks like.
Trailing spaces strike back!
@madoar madoar added the requires testing This Pull Request requires by a user that actually owns the software label Nov 27, 2019
Made the script more similiar to Lutris one.
@Zemogiter
Copy link
Contributor Author

Extracting the fixes archive results in error:

[ERROR] org.phoenicis.multithreading.ControlledThreadPoolExecutorService (l.64) - TypeError: Extractor is not a function
	at <js> :anonymous(Unnamed:38:1762-1776)
	at <js> go(Unnamed:60:1969-2004)
	at com.oracle.truffle.polyglot.ObjectProxyHandler.invoke(HostInteropReflect.java:678)
	at com.sun.proxy.$Proxy66.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)

[WARNING] 
org.graalvm.polyglot.PolyglotException: TypeError: Extractor is not a function
    at <js>.:anonymous (Unnamed:38)
    at <js>.go (Unnamed:60)
    at com.oracle.truffle.polyglot.ObjectProxyHandler.invoke (HostInteropReflect.java:678)
    at com.sun.proxy.$Proxy66.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.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
    at java.lang.Thread.run (Thread.java:834)

@madoar
Copy link
Collaborator

madoar commented Dec 12, 2019

This looks like a syntax error. Can you identify which of your two Extractor object leads to the error?
Additionally it would be useful to know which command on the Extractor object produces the error. Is it the constructor call or a later call?

@Zemogiter
Copy link
Contributor Author

I have only one Extractor object.

@madoar
Copy link
Collaborator

madoar commented Dec 15, 2019

Your PR contains two Extractor usages. One in the LocalInstallerScript and one in the OriginScript. Which one leads to the error?

@Zemogiter
Copy link
Contributor Author

Your PR contains two Extractor usages. One in the LocalInstallerScript and one in the OriginScript. Which one leads to the error?

I use OriginScript because that's the only one I have access to.

@plata
Copy link
Collaborator

plata commented Dec 28, 2019

If the LocalInstallerScript cannot be tested, it might make sense to remove it from this PR.

Unable to test local installation.
Dosen't seem to be useful anymore
@Zemogiter
Copy link
Contributor Author

@plata you're correct

@plata
Copy link
Collaborator

plata commented Dec 28, 2019

What's the status now? Does it work?

@Zemogiter
Copy link
Contributor Author

Zemogiter commented Dec 28, 2019

Blocked by #1154 not anymore
Now the Extractor error shows up again:

[ERROR] org.phoenicis.multithreading.ControlledThreadPoolExecutorService (l.64) - TypeError: Extractor is not a function
	at <js> :anonymous(Unnamed:44:1930-1944)
	at <js> go(Unnamed:60:1969-2004)
	at com.oracle.truffle.polyglot.ObjectProxyHandler.invoke(HostInteropReflect.java:678)
	at com.sun.proxy.$Proxy71.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)

[WARNING] 
org.graalvm.polyglot.PolyglotException: TypeError: Extractor is not a function
    at <js>.:anonymous (Unnamed:44)
    at <js>.go (Unnamed:60)
    at com.oracle.truffle.polyglot.ObjectProxyHandler.invoke (HostInteropReflect.java:678)
    at com.sun.proxy.$Proxy71.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.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
    at java.lang.Thread.run (Thread.java:834)

@madoar
Copy link
Collaborator

madoar commented Jan 3, 2020

@Zemogiter I think you will need to try again with a "clean" script repository, Extractor should work

@Zemogiter
Copy link
Contributor Author

@madoar still the same error happens at the exact same time

@Zemogiter
Copy link
Contributor Author

After updating the local repo and the app and including #1198 and changing .environment() to a function I get this error after pressing "next":

[ERROR] org.phoenicis.multithreading.ControlledThreadPoolExecutorService (l.64) - java.lang.ClassCastException: class java.lang.String cannot be cast to class org.graalvm.polyglot.Value (java.lang.String is in module java.base of loader 'bootstrap'; org.graalvm.polyglot.Value is in module org.graalvm.sdk of loader 'app')
	at org.phoenicis.javafx.components.application.skin.ApplicationInformationPanelSkin.lambda$installScript$7(ApplicationInformationPanelSkin.java:235)
	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:830)

Exception in thread "pool-4-thread-7" java.lang.ClassCastException: class java.lang.String cannot be cast to class org.graalvm.polyglot.Value (java.lang.String is in module java.base of loader 'bootstrap'; org.graalvm.polyglot.Value is in module org.graalvm.sdk of loader 'app')
	at org.phoenicis.javafx.components.application.skin.ApplicationInformationPanelSkin.lambda$installScript$7(ApplicationInformationPanelSkin.java:235)
	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:830)
[INFO ] org.phoenicis.repository.types.MultipleRepository (l.46) - Fetching applications for: org.phoenicis.repository.types.MultipleRepository@74438ace[repositories=[org.phoenicis.repository.types.LocalRepository@7a847a36[repositorySource=file:/home/jonasz/Pobrane/scripts-master/,repositoryDirectory=/home/jonasz/Pobrane/scripts-master]]]
[INFO ] org.phoenicis.repository.types.LocalRepository (l.77) - Reading directory : /home/jonasz/Pobrane/scripts-master
[INFO ] org.phoenicis.repository.types.MultipleRepository (l.46) - Fetching applications for: org.phoenicis.repository.types.MultipleRepository@74438ace[repositories=[org.phoenicis.repository.types.LocalRepository@7a847a36[repositorySource=file:/home/jonasz/Pobrane/scripts-master/,repositoryDirectory=/home/jonasz/Pobrane/scripts-master]]]
[INFO ] org.phoenicis.repository.types.LocalRepository (l.77) - Reading directory : /home/jonasz/Pobrane/scripts-master
[INFO ] org.phoenicis.repository.types.MultipleRepository (l.46) - Fetching applications for: org.phoenicis.repository.types.MultipleRepository@74438ace[repositories=[org.phoenicis.repository.types.LocalRepository@7a847a36[repositorySource=file:/home/jonasz/Pobrane/scripts-master/,repositoryDirectory=/home/jonasz/Pobrane/scripts-master]]]
[INFO ] org.phoenicis.repository.types.LocalRepository (l.77) - Reading directory : /home/jonasz/Pobrane/scripts-master
[WARN ] org.phoenicis.javafx.views.mainwindow.installations.dto.InstallationDTO (l.56) - Installation ID (The Sims 2_1586168774968) contains invalid characters, will remove them.
[ERROR] org.phoenicis.multithreading.ControlledThreadPoolExecutorService (l.64) - TypeError: <this>._determineWineVersion is not a function
	at <js> go(Unnamed:31:965-1003)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.ObjectProxyHandler.invoke(HostInteropReflect.java:678)
	at com.sun.proxy.$Proxy65.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:830)

Exception in thread "pool-4-thread-12" TypeError: <this>._determineWineVersion is not a function
	at <js> go(Unnamed:31:965-1003)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.ObjectProxyHandler.invoke(HostInteropReflect.java:678)
	at com.sun.proxy.$Proxy65.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:830)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted requires testing This Pull Request requires by a user that actually owns the software
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants