supertux
supertux copied to clipboard
`Downloader`: Asynchronous downloading to memory, apply to release checker
Transfer is now a base class for two new derived classes: FileTransfer and StringTransfer. FileTransfer has the same functionality which Transfer had before - it writes received data to a file. StringTransfer, however, appends received data to a referenced string. These additions are also supported by WASM (NOTE: Needs to be tested).
A StringTransfer, which is requested by calling Downloader::request_string_download(), is now used for downloading the "supertux-versioninfo" file, used by the in-game release checker.
Additionally:
- WASM now supports downloaders, other than the
AddonManagerone, by providing a pointer to the currentDownloader(NOTE: Needs to be tested). - Support for parent
TransferStatusLists has been added to allDownloaderfunctions. ReaderDocumentnow contains thefrom_string()static function, which is a convenience wrapper aroundfrom_stream(), where a stream, which only has the given string in its buffer, is provided.
Closes #2627.