Page 1 of 1

1.05j infinite loop while saving.

Posted: Sat Nov 09, 2013 2:14 pm
by Grahammm
I have completed escape from reknor, exited to the world map (via the Iron town) and entered into Norgos Lair. There is a pop-up box saying "Please Wait while saving" with the 'bar at 100%'. In the character status area, beneath the equilibrium bar, there is a yellow bar indicating "Saving 107%". The console is streaming the following.

[SAVEFILE] checked validity of type zone => path not found
[SAVEFILE PIPE] *RE*new save running in the pipe: Frnn zone :: zone-reknor-escape.teaz :: table: 0x4051af78 => table: 0x426c5d00 (3281)
Loading savefile /save/Frnn/
[SAVEFILE PIPE] Resaving sent Frnn zone /save/Frnn/zone-reknor-escape.teaz.tmp
Saving zipname /save/Frnn/zone-reknor-escape.teaz.tmp
Saved zipname /save/Frnn/zone-reknor-escape.teaz.tmp
[SAVEFILE PIPE] Checking save Frnn zone /save/Frnn/zone-reknor-escape.teaz.tmp
Loading savefile /save/Frnn/
[SAVEFILE] checked validity of type zone => path not found
[SAVEFILE PIPE] *RE*new save running in the pipe: Frnn zone :: zone-reknor-escape.teaz :: table: 0x4051af78 => table: 0x426c5d00 (3281)
Loading savefile /save/Frnn/
[SAVEFILE PIPE] Resaving sent Frnn zone /save/Frnn/zone-reknor-escape.teaz.tmp
Saving zipname /save/Frnn/zone-reknor-escape.teaz.tmp
Saved zipname /save/Frnn/zone-reknor-escape.teaz.tmp
[SAVEFILE PIPE] Checking save Frnn zone /save/Frnn/zone-reknor-escape.teaz.tmp
Loading savefile /save/Frnn/
[SAVEFILE] checked validity of type zone => path not found
[SAVEFILE PIPE] *RE*new save running in the pipe: Frnn zone :: zone-reknor-escape.teaz :: table: 0x4051af78 => table: 0x426c5d00 (3281)
Loading savefile /save/Frnn/

Re: 1.05j infinite loop while saving.

Posted: Sat Nov 09, 2013 4:57 pm
by Doctornull
Same thing is happening for me.

Code: Select all

Loading savefile 	/save/YEEEK/
[SAVEFILE] checked validity of type	zone	 => path not found
[SAVEFILE PIPE] *RE*new save running in the pipe:	YEEEK	zone	::	zone-town-irkkk.teaz	::	table: 0x096e0e40	=>	table: 0x101b3630	(2205)
Loading savefile 	/save/YEEEK/
[SAVEFILE PIPE] Resaving sent	YEEEK	zone	/save/YEEEK/zone-town-irkkk.teaz.tmp
Saving zipname /save/YEEEK/zone-town-irkkk.teaz.tmp
Saved zipname /save/YEEEK/zone-town-irkkk.teaz.tmp
[SAVEFILE PIPE] Checking save	YEEEK	zone	/save/YEEEK/zone-town-irkkk.teaz.tmp
Loading savefile 	/save/YEEEK/
[SAVEFILE] checked validity of type	zone	 => path not found
[SAVEFILE PIPE] *RE*new save running in the pipe:	YEEEK	zone	::	zone-town-irkkk.teaz	::	table: 0x096e0e40	=>	table: 0x101b3630	(2205)
Loading savefile 	/save/YEEEK/
[SAVEFILE PIPE] Resaving sent	YEEEK	zone	/save/YEEEK/zone-town-irkkk.teaz.tmp
Saving zipname /save/YEEEK/zone-town-irkkk.teaz.tmp
Saved zipname /save/YEEEK/zone-town-irkkk.teaz.tmp
[SAVEFILE PIPE] Checking save	YEEEK	zone	/save/YEEEK/zone-town-irkkk.teaz.tmp
Loading savefile 	/save/YEEEK/

Re: 1.05j infinite loop while saving.

Posted: Sat Nov 09, 2013 5:30 pm
by Doctornull
Yeah I can't enter any zones after the 1st.

This beta is unplayable.

Re: 1.05j infinite loop while saving.

Posted: Sat Nov 09, 2013 6:20 pm
by Fungah
Yeah, same thing's happening to me. Also if I try to exit while the saving loop's happening, the game hangs and I have to sic the task manager on it. Here's my log from where it starts saving onwards:

http://pastebin.com/KrpZAu18

e: oh, there's also a weird graphical glitch going on where if you let the game keep saving, it keeps creating little yellow bars going horizontally across the screen.

Re: 1.05j infinite loop while saving.

Posted: Sat Nov 09, 2013 7:06 pm
by jotwebe
Same thing, linux 64 bit.

Code: Select all

Loading savefile 	/save/Granitas/
[SAVEFILE] checked validity of type	zone	 => path not found
[SAVEFILE PIPE] *RE*new save running in the pipe:	Granitas	zone	::	zone-norgos-lair.teaz	::	table: 0x412d9050	=>	table: 0x4043e180	(1503)
Loading savefile 	/save/Granitas/
Saving zipname /save/Granitas/zone-norgos-lair.teaz.tmp
[SAVEFILE PIPE] Resaving sent	Granitas	zone	/save/Granitas/zone-norgos-lair.teaz.tmp

Re: 1.05j infinite loop while saving.

Posted: Sun Nov 10, 2013 3:07 am
by Waladil
StarKeep asked me to unbreak it... so I did. Really surprised I managed to actually do it, too.
Here's the code that DG wrote in engine/savefile.lua:

--- Checks validity of a kind
function _M:checkValidity(type)
local path = fs.getRealPath(self.save_dir..self['nameLoad'..type:lower():capitalize()](self))
if not path or path == "" then
print("[SAVEFILE] checked validity of type", type, " => path not found")
return false
end
fs.mount(path, self.load_dir)
local ok = false
local f = fs.open(self.load_dir.."main", "r")
if f then ok = true f:close() end
fs.umount(path)
print("[SAVEFILE] checked validity of type", type, " => ", ok and "all fine" or "main not found")
return ok
end


Going off of a few complete guesses, I tried changing the code to this:

--- Checks validity of a kind
function _M:checkValidity(type)
local path = fs.getRealPath(self.save_dir..self['nameLoad'..type:lower():capitalize()](self))
fs.mount(path, self.load_dir)
if not path or path == "" then
print("[SAVEFILE] checked validity of type", type, " => path not found")
return false
end
local ok = false
local f = fs.open(self.load_dir.."main", "r")
if f then ok = true f:close() end
fs.umount(path)
print("[SAVEFILE] checked validity of type", type, " => ", ok and "all fine" or "main not found")
return ok
end

and it SEEMS TO work. Notice that the only change is the line of code "fs.mount(path, self.load_dir)" was moved up a few lines to before the game checks for it. A simple code mistake (assuming I actually fixed it, and didn't just accidentally break everything while making it look fixed).

EDIT: As expected, I found a flaw in my fix. It seems that this only makes it work on manual saves or non-background saves. If it tries to save in the background then it'll hang at around 40-60% complete. Disabling background saves seems to work fine, though.

Re: 1.05j infinite loop while saving.

Posted: Sun Nov 10, 2013 5:51 am
by Waladil
Found a better fix. This removes the functionality from the save checking, but has no special caveats.

Open the file \engine\SaveFilePipe.lua and find the line that starts "local okmain =" and just remove the function call and make it "local okmain = true"

That'll bypass the buggy function. It doesn't have the level of security that DG was trying to get with the new code though.

Re: 1.05j infinite loop while saving.

Posted: Sun Nov 10, 2013 4:28 pm
by Elroniel
Forgive the potentially noob question, but where is this file? I was looking in the engine folder, but I'm not seeing any .lua files. Do I need to do something to make them viewable?

EDIT: I did find an engine.lua file, is that what I'm looking for? And, if so, what do I need to edit it? Notepad?

Re: 1.05j infinite loop while saving.

Posted: Sun Nov 10, 2013 5:49 pm
by Alamar
Elroniel wrote:Forgive the potentially noob question, but where is this file? I was looking in the engine folder, but I'm not seeing any .lua files. Do I need to do something to make them viewable?

EDIT: I did find an engine.lua file, is that what I'm looking for? And, if so, what do I need to edit it? Notepad?
edit in any editor you like. then put .lua file back into the archive (te4-1.0.5.teae)

Re: 1.05j infinite loop while saving.

Posted: Sun Nov 10, 2013 6:37 pm
by Doctornull
Waladil wrote:Found a better fix. This removes the functionality from the save checking, but has no special caveats.

Open the file \engine\SaveFilePipe.lua and find the line that starts "local okmain =" and just remove the function call and make it "local okmain = true"

That'll bypass the buggy function. It doesn't have the level of security that DG was trying to get with the new code though.
Seems to work, thanks!

Everyone else:
- game/engines/te-1.0.5.teae is secretly a zip file
- unzip it
- find engines/SavefilePipe.lua and edit it
- re-zip
- rename if you must

Re: 1.05j infinite loop while saving.

Posted: Sun Nov 10, 2013 8:44 pm
by Elroniel
Thank you very much, guys; that got it worked out nicely!