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

Warp Endeavour ability causes game crash #3

Closed
BenjaminAmos opened this issue Sep 26, 2021 · 0 comments · Fixed by MovingBlocks/DestinationSol#681 · May be fixed by MovingBlocks/DestinationSol#648
Closed

Warp Endeavour ability causes game crash #3

BenjaminAmos opened this issue Sep 26, 2021 · 0 comments · Fixed by MovingBlocks/DestinationSol#681 · May be fixed by MovingBlocks/DestinationSol#648
Labels
bug Something isn't working

Comments

@BenjaminAmos
Copy link
Collaborator

The warp Endeavour ability uses the same code as the in-game star ports to transport the player between planets. This crash only seems to occur when the ability takes the player to the same location where a star port already exists. It was previously rare but seems to be consistently reproduceable with the new system builder code.

The reason for this crash appears to be that the game attempts to save when the player reaches a star port. This fails beacuse the warp module does not have permission to access the save files. Maybe an AccessController.doPrivileged call in the relevant engine code would help?

ERROR [main] (SolApplication.java:231) - Fatal Error:
java.security.AccessControlException: access denied ("java.io.FilePermission" "engine\src\main\resources\world.json" "write")
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
	at java.security.AccessController.checkPermission(AccessController.java:886)
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
	at org.terasology.gestalt.module.sandbox.ModuleSecurityManager.checkPermission(ModuleSecurityManager.java:48)
	at java.lang.SecurityManager.checkWrite(SecurityManager.java:979)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:200)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
	at java.io.PrintWriter.<init>(PrintWriter.java:192)
	at java.io.PrintWriter.<init>(PrintWriter.java:232)
	at org.destinationsol.game.SaveManager.saveWorld(SaveManager.java:249)
	at org.destinationsol.game.StarPort$Transcendent.update(StarPort.java:405)
	at org.destinationsol.warp.abilities.PlanetTunnelAbility.update(PlanetTunnelAbility.java:51)
	at org.destinationsol.game.ship.SolShip.updateAbility(SolShip.java:300)
	at org.destinationsol.game.ship.SolShip.update(SolShip.java:240)
	at org.destinationsol.game.ObjectManager.update(ObjectManager.java:98)
	at org.destinationsol.game.SolGame.lambda$null$2(SolGame.java:404)
	at java.util.ArrayList.forEach(ArrayList.java:1259)
	at org.destinationsol.game.SolGame.lambda$update$3(SolGame.java:403)
	at java.lang.Iterable.forEach(Iterable.java:75)
	at org.destinationsol.game.SolGame.update(SolGame.java:402)
	at org.destinationsol.SolApplication.update(SolApplication.java:255)
	at org.destinationsol.SolApplication.safeUpdate(SolApplication.java:229)
	at org.destinationsol.SolApplication.render(SolApplication.java:193)
	at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.update(Lwjgl3Window.java:392)
	at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.loop(Lwjgl3Application.java:137)
	at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:111)
	at org.destinationsol.desktop.SolDesktop.main(SolDesktop.java:149)
Exception in thread "main" java.security.AccessControlException: access denied ("java.io.FilePermission" "engine\src\main\resources\world.json" "write")
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
	at java.security.AccessController.checkPermission(AccessController.java:886)
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
	at org.terasology.gestalt.module.sandbox.ModuleSecurityManager.checkPermission(ModuleSecurityManager.java:48)
	at java.lang.SecurityManager.checkWrite(SecurityManager.java:979)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:200)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
	at java.io.PrintWriter.<init>(PrintWriter.java:192)
	at java.io.PrintWriter.<init>(PrintWriter.java:232)
	at org.destinationsol.game.SaveManager.saveWorld(SaveManager.java:249)
	at org.destinationsol.game.StarPort$Transcendent.update(StarPort.java:405)
	at org.destinationsol.warp.abilities.PlanetTunnelAbility.update(PlanetTunnelAbility.java:51)
	at org.destinationsol.game.ship.SolShip.updateAbility(SolShip.java:300)
	at org.destinationsol.game.ship.SolShip.update(SolShip.java:240)
	at org.destinationsol.game.ObjectManager.update(ObjectManager.java:98)
	at org.destinationsol.game.SolGame.lambda$null$2(SolGame.java:404)
	at java.util.ArrayList.forEach(ArrayList.java:1259)
	at org.destinationsol.game.SolGame.lambda$update$3(SolGame.java:403)
	at java.lang.Iterable.forEach(Iterable.java:75)
	at org.destinationsol.game.SolGame.update(SolGame.java:402)
	at org.destinationsol.SolApplication.update(SolApplication.java:255)
	at org.destinationsol.SolApplication.safeUpdate(SolApplication.java:229)
	at org.destinationsol.SolApplication.render(SolApplication.java:193)
	at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.update(Lwjgl3Window.java:392)
	at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.loop(Lwjgl3Application.java:137)
	at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:111)
	at org.destinationsol.desktop.SolDesktop.main(SolDesktop.java:149)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant