Code: Select all
local function ForceModNameAndPort(input)
output,_=string.gsub(input,"GameType=[^;]*;","GameType="..ModSpecific.ModFileName..";",1)
output,_=string.gsub(output,"HostPort=[^;]*;","HostPort="..(0)..";",1)
return output
end
local function DoTheRestart(startscriptfilename)
Spring.Echo(widget:GetInfo().name..": About to call Spring.Restart(\"-s\",VFS.LoadFile("..startscriptfilename.."))")
Spring.Echo(widget:GetInfo().name..": that file contains:")
Spring.Echo(widget:GetInfo().name..": <<BEGIN DUMPING \""..startscriptfilename.."\">>")
Spring.Echo(ForceModNameAndPort(VFS.LoadFile(startscriptfilename)))
Spring.Echo(widget:GetInfo().name..": <<END DUMPING \""..startscriptfilename.."\">>")
Spring.Echo(widget:GetInfo().name..": Ok, calling Spring.Restart(\"-s\",VFS.LoadFile("..startscriptfilename..")) now!")
Spring.Restart("-s",ForceModNameAndPort(VFS.LoadFile(startscriptfilename)))
Spring.Echo(widget:GetInfo().name..": Just called Spring.Restart(\"-s\",VFS.LoadFile("..startscriptfilename.."))")
Spring.Echo(widget:GetInfo().name..": Wait, we shouldn't be here, should have restarted or crashed or quitted by now.")
end
That infolog shows the startscript was correctly written, and contains correct information. Saktoth told me the file Kernel_Panic_script.txt was in his Spring folder, and that drag'n'dropping it over Spring.exe worked.
Edit: MidKnight got same issue: http://pastebin.com/d3cde9a3d
Script is correct, Spring.Restart is called, and then Spring close but does not restart. There's not much I can do. Need your help Auswaschbar!