ID:2270489
 
Code:
    for(var/entry in userdb.cd)
entry.Add(list)


Problem description:
I am using a save file to store clients, but I need them formed into a list when the game boots, but I am unsure how to go about looping through the entire save file to fetch everything from it, I tried the above code but it did not work.
How do I make this work?
How are you storing them?
/datum/userdb/proc/AddToDB(var/client/C)
if(userdb && C)
if(userdb["[C.key]"])
return 0 // Already in the DB, no action required.
else
userdb["[C.key]"] << C.key


Like you would any regular thing in a save file I suppose.
Look up savefile.dir. It's a list that stores all the subdirectories of the current dir (cd).
Will that variable work for looping through the save file though? Because that's all I'm really looking for, to just take everything in the save file and store it in a list
Give it a shot. savefile.dir is the component you are missing.
Oh shit, thank you man! At least now I know how to do that, I took the .cd from another post that seemed to be the same issue, but good to know the right way now.