
Config File Change Listening
fzzyhmstrs opened this issue ยท 1 comments
Come up with an approach to file updating "on the fly". In 0.6.8 I started impl of a Thread-based WatchService
approach. I may continue that for 0.6.9, or move to checking files in the datapack event.
For thread-based approach, need to make sure file-based updating respects game state.
- If a client is remotely connected to a server and is "OVERWRITE", check permissions, apply and sync appropriate changes back to the server, reject and re-save the rest.
- Out of game on client, apply changes to non RequiresWorld settings.
- Start and stop the service on server start/stop events.
- Servers update and propagate changes as usual.
Datapack event update would be relatively simple.
- Store last modified time in the SyncedRegistry
- Pass in a config context to the reg, not a simple config, and have that context include the file and its changed time.
- On datapack event, go through the reg and if any file change times don't match up, reload.
- In SP also do the client config registry
- In MP, have a resource reload event? Is there one?
- could use a resource reloader registered to both data and resources to be the "event"