--jpDownload API jpDownload.activate ( sUserToken, sActivationKey ) jpDownload.callWebservice ( sURL, htOptPostParams, hOptObject, sAIModel, sHandler ) jpDownload.downloadFile ( sFile, sURL, bLoadFromDiskIfExisting, hOptObject, sAIModel, sHandler ) jpDownload.emptyCache ( ) nCount = jpDownload.getRemainingDownloads ( ) nCount = jpDownload.getRemainingWebservices ( ) jpDownload.removeFile ( sFile ) jpDownload.setMaxConcurrentDownloadCount ( nCount )
jpDownload is a very smart and powerful plugin that's aim is to advantageously replace ShiVa connections. Instead of a long description, here are the main key features:
jpDownload offers 2 distinct functions to establish connections: one for downloading files and one for calling webservices. Each one has its own download queue, that means even if the queue for downloading file is full, any webservice call will be able to be sent immediately because webservices have their own queue.
By opposition of the native ShiVa connections (cache and xml apis) where you must check the status of a connection to know when it has finished, jpDownload is based on notification events. As soon as a download ends, you are notified with an event sent to your AIModel.
Once a file download has ended, the file is automatically referenced in the cache of ShiVa. That means the plugin is totally transparent for using files: if you download an image, you can immediately set it to a HUD component for instance.
jpDownload has very impressive performances. It is hard to explain with words but there's no comparison point with ShiVa connections that are, in my opinion, very slow.
jpDownload is not only powerful for single files it is also the king for multi-threading. It can download many files at once. As an example, I'm using jpDownload in the project named MySpher for downloading movies jackets on a local server and it loads 65 images by second without any problem, it is so fast.
Webservices are not stored on the disk, they are just kept in memory the time you need them. One more thing that makes jpDownload extremely powerful.
You can easily define POST parameters for your webservice calls. It is as simple as passing a hashtable with your key/values pairs.
The plugin has been firstly designed for iOS, tvOS and Android and is full featured for these platforms. To make the development of a game using this plugin easier, I have developed the Windows, Mac and Linux sides of the plugin based on the default ShiVa 'cache' API, this way it works on ShiVa Editor on Windows, Mac and Linux, as well as on games exported for these platforms. The advantage it that the behaviour (event base programming, POST parameters, ...) is the same on all the platforms, the only difference is that what I have developed on iOS/tvOS/Android is much powerful than the default 'cache' API of ShiVa. Moreover, as ShiVa connections have a single download queue, the 2 queues available on iOS are simulated: for instance if you set 8 concurrent downloads, 5 will be assigned to the files and 3 for the webservices.