snatvb Posted January 19, 2017 Share Posted January 19, 2017 I want suggest add "file watcher" to server mta that we could waste time for develop and not write to console "restart <resource_name>" When you update lua file in recource, server updates this resource automaticly It's so bad Link to comment
Bonsai Posted January 19, 2017 Share Posted January 19, 2017 Resources should never restart automatically. The Developer knows best when to do that. 2 Link to comment
snatvb Posted January 19, 2017 Author Share Posted January 19, 2017 3 hours ago, Bonsai said: Resources should never restart automatically. The Developer knows best when to do that. now i have bind for restart, this resolved this problem) Link to comment
Noki Posted January 21, 2017 Share Posted January 21, 2017 (edited) You could implement it yourself in a number of ways. 1. Git hook. Write your own module that restarts the resource (using a folder name) for each file in a Git commit (filter out files from the same resource etc). It would be a bit tedious and require some hacky fixes to work. But it would work well with source control and keep things relatively neat. 2. HTTP uploading. Every time you upload a file (through HTTP), it calls the PHP SDK which calls a resource in-game that restarts another resource (resolving it from a folder name, or something). This is a very disgusting (also insecure and flawed) method and if anyone does it, I would be appalled yet impressed. 3. Constant scanning. Creating an application that constantly scans the resources folder for changes (using hash sums, for example) and restarts a resource (using a module or something that attaches to the server) every time a file changes. Note this is a terrible idea and would be cumbersome on server resources. 4. Create some sort of devilsh Node.js contraption that would do this for you. I don't want to write anything else because I'm scared someone might actually do this. But my favourite way is to just restart them when needed, at developer discretion, like what @Bonsai said. Any of these ways could introduce bugs (restart looping, restarting wrong resources, using too many system resources, etc) which could potentially create more problems than taking the time to write "/restart totallynotabuggyresource" in the console. Edited January 21, 2017 by Noki Link to comment
Recommended Posts