ID:1643851
 
Problem description:
So im wondering how am i or how will i Save()/Load() my vars and verbs with this lib http://www.byond.com/developer/Metamorphman/SuperSaving using the client-side saving while also using the slot system. what do i put in "data" argument? i just need an explanation on how this actually works



client/verb
ClientSlot_load()
var/s[] = Slots()
if( s && s.len )
s = input( src, "Select a slot", "Slot" ) as anything in s
if(copytext(s,1,6) != "char_") src << Load(s)

ClientSlot_save()
var/s = input( src, "Select a slot", "Slot" ) as num
var/d = input( src, "Select data to save to slot.", "Data" ) as text
Save( d, s )

var/const/salt = "myhashtag" // Customize this for your game. It should be unique and difficult to guess.
//proc/salt( text )

proc/secureSave( savefile/f, path )
var/savefile/F
if( path ) F = new( path )
else F = new
F["data"] << f
F["hash"] << md5("[salt][F.ExportText("/data")]")
return F

proc/secureLoad( path )
var/savefile/F = new(path)
var/h
F["hash"] >> h
if( h == md5("[salt][F.ExportText("/data")]") )
F["data"] >> .
.=new/savefile(.)


client/proc

Save( data, slot )
var/savefile/f
var/i = Import()
if(i) f = secureLoad(i)
else f = new
if(f)
if( !slot ) slot = length(Slots(key)) +1
f["[slot]"] << data
Export( secureSave(f) )

Load( slot )
var/savefile/f = Import()
if(f)
f = secureLoad(f)
if(f) f["[slot]"] >> .

Slots()
var/savefile/f = Import()
if(f)
f = secureLoad(f)
if(f) return f.dir