View Issue Details

IDProjectCategoryView StatusLast Update
0005358Multi Theft Auto : San AndreasScriptingpublic2012-02-22 00:28
ReporterPhatLooser Assigned Tokevuwk  
Status resolvedResolutionfixed 
Product Version1.0.3 
Target Version1.3.1Fixed in Version1.3.1 
Summary0005358: Add a "downloadFile"

The reason for this function is simple.
Normal case: You join a server, have to download 20 MB cause of music n stuff.
With uploadFileToClientResource: The scripter can remove all the files from the meta.xml, and upload them to the client as soon as the client is ready to do so, i.e. when the client is going afk.
Another positive Aspect is that some sounds etc. may not be important, but when the download fails on exactly those files, the player still gets disconnected (at least, if those files are listed in the meta.xml).
If you put all non-important files into its own script and call the "uploadFileToClientResource", and the upload fails, the client can simply try again since that file does not seem to be important, and even go on playing.
Also, you would have the server side advantage that you could put all the files into one resource (for the glory of order) in single folders, like /images/ or /sounds/ or /models/, and upload them with that function into the client folder where they are needed.

I am better at algorithms, so let me explain it this way:
Important file -> put in meta.xml.
Unimportant file -> use script function "uploadFileToClientResource".

Player has 600 ms pingtime -> upload 0.0001 yogtobit bad quality mono mp3.
Player has 10 ms pingtime -> upload 150000000000 yotaByte good quality stereo mp3.

TagsNo tags attached.


child of 0003344 closed New Feature Requests Requested features tracker 



2010-10-30 18:12

viewer   ~~0012086

  • just client-side function downloadFile ( path )
  • and client-side event "onFileDownloadDone" ( path )


2012-02-17 09:06

reporter   ~~0016094

Last edited: 2012-02-17 09:18

downloadFile would be an idea, too.
Actually, it would be THE idea, since it can be done with an apache server. Apache > MTA. Thats a fact.


2012-02-19 16:30

reporter   ~~0016128

It would be very nice indeed, but doesnt triggerLatentServer/ClientEvent resolve this? You can download anything you want using this by scripting and you can expand it to your own needs. Not sure about how native functions can make this better, could anyone inform me about this?


2012-02-19 17:35

viewer   ~~0016129

you can do it in theory, just needs some check (probably md5), and the latent event handlers + fileWrite.


2012-02-19 19:20

reporter   ~~0016131

Nope, Remi-X, since I want to download it from a http folder. That would move the download from MTA back to apache2, which can handle such requests more effective and faster (but it ain't a gameserver)


2012-02-22 00:28

administrator   ~~0016135

fixed in r3868, see wiki for downloadFile and i'll document onFileDownloadComplete soon

onFileDownloadComplete ( string fileName, bool success )
fileName = file downloaded
success = true for successful and false for failed/error

Issue History

Date Modified Username Field Change