Jump to content

event when resource has finished loading files?


John Smith

Recommended Posts

Posted

Hello. I'm facing a problem. I can't find a way how to know when resource has finished downloading (down)loading files.

I thought onResourceStart would be triggered after the resource files were (down)loaded, but onResourceStart seems to trigger when the download starts.

I'm asking for help in here because i'm facing an error which says something similiar to unable to load dff/txd file before onClientFileDownloadComplete event has finished (when that error happens, resource files are still downloading)

Is there a solution to this or should i create a custom downloader for scripts/files?

Posted

onClientResourceStart

This event is triggered when a resource is started. Please note that this is not triggered the same time as the serverside event onResourceStart is. The event is triggered when any clientside resources are started. This means it is triggered when a clientside script is initiated after a download, which includes downloading after join.
  • Moderators
Posted

John,

but onResourceStart seems to trigger when the download starts.

This is incorrect. A resource can't start when not all files are there.

If that was true, each resource would give a lot of errors while starting.

Posted

How so? The event is triggered when the resource is started on the server - after server side scripts are loaded. The onClientResourceStart event is very similar, except it is triggered after all the client files are downloaded (which implies the resource is already running on the server).

Posted

The server-side code is executed as soon as the resource is started, the client-side is executed when the files are downloaded. So, yes, onResourceStart can be called while the client is still downloading.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...