Page 1 of 1

Spring.Restart and Linux

Posted: 25 Feb 2012, 05:24
by zwzsg
As I understood it, the Lua command Spring.Restart takes two arguments:
- First argument is a string with all the commandline arguments
- Second argument is a string with all the content of a startscript

But! Passing a startscript filename as a commandline argument makes Spring uses it!

So there are two ways to use Spring.Restart
  • With a string containing a script filename as first argument, and "" as second argument.
  • With a dummy commandline argument such as "-s" as first argument and a startscript content as second argument
From second-hand accounts I get from Linux people, it appears the second way does not work in Linux's Spring.

For testing:
  • Kernel_Panic_4.4.sd7: a version of Kernel Panic where my single player widget use something akin to Spring.Restart("-s",VFS.LoadFile("MyStartScript.txt"))
  • Kernel_Panic_4.4TL1.sd7: a version of Kernel Panic where my single player widget use something akin to Spring.Restart("MyStartScript.txt","")
As a Linux user:
Can you test my single player menu of each of this two KP version, and tell me if it works in, both, none, or either?
Note: To test my single player menu, play alone, press esc to bring up the menu, then click "skirmish" and "run". Ideally it should close Spring and reopen a new Spring instance with random skirmish game.


As dev:
Can you tell me if I understood right the usage of Spring.Restart, and why does my widget doesn't work for so many Linux people, is it a bug in Linux implementation of Spring.Restart, or am I using Spring.Restart wrongly?

Re: Spring.Restart and Linux

Posted: 25 Feb 2012, 09:49
by abma
looks like double-quotes for me:

open("\"/home/abma/.spring/script.txt\"", O_RDONLY) = -1 ENOENT (No such file or directory)

(thats the non-tl version)

fixed in next release: https://github.com/spring/spring/commit ... 0d3e0cf403

Re: Spring.Restart and Linux

Posted: 25 Feb 2012, 17:01
by zwzsg
Thank you!

Re: Spring.Restart and Linux

Posted: 25 Feb 2012, 17:12
by knorke
Spring.Restart appearently fails on Mac too.
eg here:
http://springrts.com/phpbb/viewtopic.ph ... c&start=47
Posts are a bit older..thought i had made a mantis but seems not so.

Re: Spring.Restart and Linux

Posted: 25 Feb 2012, 17:29
by zwzsg
Spring Tank uses:
local file=VFS.LoadFile(startscriptfilename)
Spring.Restart("-s", file)

I heard MacOS Spring build are derived from Linux build.

So this is indeed looks like the same bug.