Categories
Uncategorized

DLC Downloader Flow

This week I came up with a DLC downloader design and implemented some of the functions in DLC Manager.

DLC Manager before was just a shell with empty definitions, and I had not given much thought to what the functions or how the DLC Manager should behave.

Now that I have given some thought, here is a rough flow of the DLC Downloader: For downloading DLCs, we are providing a GUI with an available downloadable games list. Users can select a DLC and click the Download button to start the download. However, the download button under the hood adds this DLC as a download task in the DLCManager’s queue. The queue maintains the queued download tasks. We will be processing each download task one at a time. Once a download task is finished/canceled/interrupted, then the next one in the queue starts downloading.

But how are we achieving this? We have a processDownload() function which looks at this queue. If it’s not empty (i.e., there is/are pending download task(s) that we need to handle), we will use an async function called startDownloadAsync() to handle the downloading from the distribution store. The startDownloadAsync() will, of course, be different for different distribution stores and will be executed in another thread to not block the GUI.

The callback function provided in the startDownloadAsync() will run the processDownload() after startDownloadAsync() finishes executing. The callback function will do two things – first, notify download has finished/canceled/interrupted and then, invoke the processDownload() function again to process the next download task in the queue.

There is now a further GUI requirement; since users will need a way to see what is currently downloading and its progress, we would need another modal that can be opened from a button. I have the rough UI design in mind for this new “downloading” modal.

Finally, here’s the overall flow of the DLC downloader:

Leave a Reply

Your email address will not be published. Required fields are marked *