Forum rules - please read before posting.

Asynchronous GatherSaveFiles()

Hey there!
I'm implementing savedata on the PlayStation, PlayerPrefs are working, but I'd like to try implementing it properly.
The save system on PlayStation is asynchronous, so it's important that everything gets loaded and saved in a structered order.

I wrote my own SaveFileHandler_SystemFile, which is working well! However there is one function, GatherSaveFiles(), that I need to work asynchronously. But it currently doesn't have a callback or can be easily converted, because it is used in multiple places.

How can I best approach this?

Comments

  • Thanks for the details.

    The GatherSaveFiles function currently returns a List of SaveFiles. Would it be enough to have it instead accept a callback of the form:

    void GatherSaveFiles (System.Action<List<SaveFile>> onComplete)
    

    ?

    If so, I can look to see if this change can be made.

  • Thanks Chris, Yes I think a callback like that would work great!

    Right now I wrote a solution that searches the directory for save files only on startup. And then keeps track of newly created/deleted save files when they happen to avoid async functions.

    It already works, but a callback like that will work a bit cleaner.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.