View Issue Details

IDProjectCategoryView StatusLast Update
0004481Multi Theft Auto : San AndreasServerpublic2012-02-22 20:15
ReporterPaul_CortezAssigned Tokevuwk 
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version1.3.1 
Summary0004481: Add more download functionality
Description

With slower servers, downloading is a big hell for players joining. While downloading, resources aren't starting. And that sometimes can be a major pain. For example Freeroam GUI will need GUI for a player to select a spawn position, which is client-side and doesn't work during downloads.

I'm making the following suggestion that may improve downloads and resource awareness of download progress:

  • Script files should always have a higher priority than other downloaded files, if that's not already the case.

  • Added parameters to <file> and <script> tags in meta.xml: (better name suggestions welcome)

    • "direct": Downloads immediately, if set to false, it will wait for a script to tell the server to send it
    • "start_when_done": Starts the script as soon as it's done downloading, so for instance Freeroam GUI can at least start (with limited functionality available) These files have the biggest download priority
  • Added scripting function:

    • bool startFileDownload(player thePlayer, string theFile[, resource theResource]): Starts the download of the file (if "direct" is set to false)
  • Added events: ([...] = source)

    • "onClientFileDownloaded" (string theFile) [resource theResource]: Notifies client-side scripts a certain file from a certain resource has been done downloading, so if it's needed, the script can use it right away.
    • "onClientResourceDoneDownloading" () [resource theResource]: Notifies client-side scripts the resource's download has been completed.
    • "onPlayerResourceDoneDownloading" (resource theResource) [player thePlayer]: Notifies server-side scripts a specific player has done downloading a specific resource.

Possible applications:

  • A server where you have custom models for vehicles, you can give them the choise to either download the models, or to just play without them.
  • In a gamemode like Race or Freeroam, you don't need to wait the entire download anymore, just that resource/part of that resource.
  • Set a limit of maximum amount of players downloading a specific resource, so you won't get your net overloaded with people all downloading the same thing.
TagsNo tags attached.

Relationships

has duplicate 0004222 closed New issues Add background and permanent downloads 
child of 0003344 closed New Feature Requests Requested features tracker 

Activities

x86

2010-01-12 16:08

administrator   ~~0010962

Maybe: downloadFile(string file [,resource = getThisResource()]) ?

MX_Master

2010-10-30 18:21

viewer   ~~0012089

just needs client-side features such as function
downloadFile ( path )
and event
"onFileDownloadDone" ( path )
that's all. Will be great feature for servers with non-static contents.

Devan_LT

2010-10-30 20:51

viewer   ~~0012090

It's not needed, as it's scriptable because MTA SA 1.1 already has client-side file functions.

Kayl

2010-10-31 13:14

developer   ~~0012093

@Devan_LT about 1.1 client-side file functions:
Could they get documented in http://wiki.multitheftauto.com/wiki/Client_Scripting_Functions and http://wiki.multitheftauto.com/wiki/Client_Scripting_Events for us to know (even just by name) if it really solves all the good points raised in this request?

MX_Master

2010-10-31 18:52

viewer   ~~0012094

i heard about file functions but i dunno nothing about what it will be

one way to know is looking in sources

Devan_LT

2010-11-01 07:35

viewer   ~~0012095

Those functions are the same as in the server side. So you can trigger client event and use file data as argument, and client-side script can write that data to the file.

Kayl

2010-11-03 08:59

developer   ~~0012104

Sounds like overkill to go through event system to send vast amount of data.
I have a hard time believing sending such events to all users on a real scale server (100+ users) won't deteriorate the performances, whereas an internal MTA feature that opens http connections on demand (just like initial download but controlled by scripts) would be more natural.

Devan_LT

2010-11-03 14:20

viewer   ~~0012106

Maybe you're right. I have already thought about that, and I think I must have been high on something, so that everything what is already scriptable seemed unnecessary to me :D

lil_Toady

2010-11-03 14:31

administrator   ~~0012107

imo mta just needs callRemote client side, it'll cover all problems

Alexxxxx

2011-06-29 16:00

viewer   ~~0013842

Maybe add some scripting functions to it, like: only change the car model if a player enters the car, not just when he enters the server.

NeonBlack

2012-02-22 00:40

viewer   ~~0016136

For security reasons a downloadFile call from a client should trigger a serverside event like onClientDownloadRequest with the filename and the client object. On canceling the event the client would get notified that the download request has been denied. The server owner could decide whether to send the file or not then.

kevuwk

2012-02-22 20:15

administrator   ~~0016143

just added downloadFile and onClientFileDownloadComplete, see wiki

Issue History

Date Modified Username Field Change