Jump to content

[For Develop] File Watcher


snatvb

Recommended Posts

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 by Noki
Link to comment
  • Recently Browsing   0 members

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