Build file index
After modifying some of the content, you should update the index file. If not updated, your changes will not be noticed by MMDAgent-EX clients.
Index file
The index file should be named .mmdagent-content-files
and should be placed at the top of your content directory.
Here is an example of the index file. The first line of the file should contain the last update time in UNIX time. After that, each line should have two field separated by spaces, the first one is the file size in bytes and the second one is file path, relative to the top directory. The order of the files are not important.
1543501419
2911 FromExample/Motion/mei_breath/COPYRIGHT.txt
248180 Objects/table.pmd
3455 Objects/pc/cover.jpg
1518 README.txt
210 Main.mdf
1822553 Stage/nit_comspace_f.png
4596 FromExample/Motion/sd_mei_bye/README.txt
30205 Motions/sitdown.vmd
12725 FromExample/Motion/mei_point/mei_point_center_center.vmd
100352 Button/btn_lee.png
4595 FromExample/Motion/mei_laugh/README.txt
2911 FromExample/Motion/mei_idle/COPYRIGHT.txt
2911 FromExample/Motion/sd_mei_wait/COPYRIGHT.txt
Tool mit
A tiny script mit.pl
is provided in the GitHub page that can manage the index file.
Perl is required to run the script. Below is a usage example of updating index file, adding ALL files under the content directory.
% cd content_topdir
% mit.pl add .
% mit.pl update
After that the index file .mmdagent-content-files
will be made up-to-date, and ready to upload to web server.
How it works
At download of a content,
- It first fetches the index file at “
[content_url]/.mmdagent-content-files
”. - Files in local cache folders are compared with the entries (pairs of file name and size)
- The differential parts are downloaded.
- Start playing the content.
According to the scheme above, MMDAgent-EX can execute per-file download resume at network down.
At content start up,
- If the content is marked as “updatable”, re-download content from source before start.
- After content start up, it fetch the recent index file from source URL after 5 second of launch in background.
- If the time stamp of the newly fetched index file is newer than the local cache, mark the content as “updatable”, to be updated at next startup.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.