I want to make it so that old savefiles are deleted at the beginning of every month if they haven't been used in 30 days. I came across a thread at http://developer.byond.com/forum/ index.cgi?action=message_read&id=182261&forum=8&view=1&displ ay=1#182560
Would this work? Will that flist() end up picking files like the .rsc, etc. and delete them?
ID:172156
Jun 22 2004, 7:21 am
|
|
In response to Foomer
|
|
K i was thinking a while on this one seriously.
You need a date system in your game first of all. You need a atom/movable var called date=0 and one called ton=0 Everytime you save you need to save the day(in a sepearate save called day.sav or something) You also need to save a persons well um... days on in a row in a save called "[usr]D-on.sav" and everytime they log in have a proc that checks this save for the person whos using it, make it so it deletes the save if there amount is 1-5. Than reset the persons times on var to 0 and that should work. Although I'm not sure but it might work...... Please tell me if this works. |
In response to Chrisman767
|
|
How do I get files from only a certain folder? The files are saved to a folder called "players".
|
In response to EGUY
|
|
Its all covered in the DM Reference under flist(). Look it up.
|
In response to Chrisman767
|
|
Why not just create seperate directories within the savefile?
for example... proc/Save() Anyway, I really dont see how its possible for the player directory to be cleaned every 30 days, the player has to login for the game to do anything to there save, it might be able to if the savefile is on the hosts computer or something (which is where savefiles are normally stored anyway) but how to actually do it is over my head, sorry if this makes it more confusing, just hit me over the head with a metal bat or something |
In response to War_master66
|
|
War_master66 wrote:
it might be able to if the savefile is on the hosts computer or something (which is where savefiles are normally stored anyway) but how to actually do it is over my head, sorry if this makes it more confusing, just hit me over the head with a metal bat or something *clonk* ...well, you asked for it. ;-) The savefiles are on the host's computer. flist() and all similar functions work on the host's computer. So no problem there. =) |
<code>if(findtext("[file]", ".sav")) world.log << "Yes, its a savefile."</code>