undefined Posted July 1, 2015 Share Posted July 1, 2015 Hi guys. Im make download system. But i have problem. Example; filename skin/dead.col for example: if crete new text document and change name dead.col and set file path skin/dead.col the system is exists sense it. How can i prevent it? Sry for my english .s Link to comment
Moderators IIYAMA Posted July 1, 2015 Moderators Share Posted July 1, 2015 You mean, people are applying their own mods? You should use https://wiki.multitheftauto.com/wiki/DownloadFile instead of triggerLatentClientEvent. To let the system check if the file is validated. If you use triggerLatentClientEvent you can check if the filesize has chanced, but you won't be able to check the timestamp of the creation/edit time. Only mta can do that, so it a risk. Link to comment
undefined Posted July 2, 2015 Author Share Posted July 2, 2015 Im use downloadFile for download resource. It is download first important scripts after other scripts. So, is downloadFile already check it? Link to comment
John Smith Posted July 2, 2015 Share Posted July 2, 2015 Read original files and store hash of their content somewhere Then when checking if client has files,if he has, read those files that client has and turn the content into hash and compare this hash with your stored one. If hashes are different, client has tried to load his own mod. Link to comment
arezu Posted July 2, 2015 Share Posted July 2, 2015 From downloadFile wiki page: If the file has been previously downloaded and the CRC matches, the file will not be downloaded again but onClientFileDownloadComplete will still run. In other words: downloadFile will only download the file if the file doesn't exist, or if the file exists and the content of the file does not match the content of the file you want to download. Link to comment
undefined Posted July 2, 2015 Author Share Posted July 2, 2015 Thank you! It's solved. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now