ID:141798
 
Code:
    proc/ExportSafeFile(savefile/s)
var/safetext = RC5_Encrypt(s.ExportText("/"), "test")
del(s)
s = new("[ckey].sav")
s["safetext"] << safetext
src.Export(s)


Problem description:

So, I'm using this code from the rc5 encryption demo, it will create the savefile in the host's folder, but it won't create a new save in my key_info. Does anyone have an idea what's wrong?
Don't put anything in the new() proc. It's probably failing because you've assigned file name. Client saves assign their own.
In response to Xooxer
I only put something there to check whether the save was valid at all. Before that it didn't work either, but I can retry.

Nope, not working.
In response to CIB
You're using del() on s, then proceeding to continue using it. That kinda strikes me as odd.

Have you considered assigning another variable after the del(s) to take care of the rest?
In response to Tiberath
Good point. Tried, but failed. This seems to be rather a problem I'm having with BYOND than with the code =/
In response to CIB
Well, I'm not sure. Here's Chatters' save, which also uses RC5 and client saves. Maybe you can see a difference:

        Save(mob/chatter/C)
var/savefile/S = new()
C.Write(S)
sleep(5)
var/filetext = S.ExportText("/")
var/crypt = RC5_Encrypt(filetext, md5(world.hub_password))
var/savefile/F = new()
F["version"] << savefile_version
F["CRYPTO"] << crypt
C.client.Export(F)
In response to Xooxer
I simply copypasted that into my game and removed all the undefined variables and it.. didn't work? o.0
In response to CIB
Weird. Is it making a -1.sav instead?
In response to Xooxer
The proc wasn't being called for some reason. Making a verb that does so makes it work correctly.

Under client:
    Del()
Save()
sleep(100)
..()


Anything wrong with that?
In response to CIB
Yes, read this: [link].
In response to Xooxer
Oh, I see, that makes sense, though I'd have expected DreamSeeker to call Logout()/Del() a few ticks before it actually disconnects. Saving at a certain rate seems rather messy to me, I think I will rather call Save() everytime I modify a variable that is to be saved, since there aren't many of those.

Thanks alot for the help by the way =)
In response to CIB
That's what I do in Chatters, and it seems to work well.