comment out script engine file watching
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2025-04-14 17:03:26 -04:00
parent 2532e73656
commit ccc767618c
2 changed files with 39 additions and 38 deletions

View File

@ -1472,6 +1472,7 @@ Voxel type work
(04/14/2025)
Inventory sounds for some materials
Inventory audio work
Comment out script engine file watching for testing purposes

View File

@ -142,27 +142,27 @@ public class ScriptEngine extends SignalServiceImpl {
}
);
sourceMap = new HashMap<String,Source>();
this.fs = FileSystems.getDefault();
try {
this.watchService = fs.newWatchService();
} catch (IOException e) {
LoggerInterface.loggerFileIO.ERROR(e);
}
//register all source directories
try {
Files.walkFileTree(new File(TS_SOURCE_DIR).toPath(), new SimpleFileVisitor<Path>(){
@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attr) throws IOException {
dir.register(
watchService,
new WatchEvent.Kind[]{StandardWatchEventKinds.ENTRY_MODIFY, StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_DELETE}
);
return FileVisitResult.CONTINUE;
}
});
} catch (IOException e) {
LoggerInterface.loggerEngine.ERROR(e);
}
// this.fs = FileSystems.getDefault();
// try {
// this.watchService = fs.newWatchService();
// } catch (IOException e) {
// LoggerInterface.loggerFileIO.ERROR(e);
// }
// //register all source directories
// try {
// Files.walkFileTree(new File(TS_SOURCE_DIR).toPath(), new SimpleFileVisitor<Path>(){
// @Override
// public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attr) throws IOException {
// dir.register(
// watchService,
// new WatchEvent.Kind[]{StandardWatchEventKinds.ENTRY_MODIFY, StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_DELETE}
// );
// return FileVisitResult.CONTINUE;
// }
// });
// } catch (IOException e) {
// LoggerInterface.loggerEngine.ERROR(e);
// }
}
/**
@ -193,23 +193,23 @@ public class ScriptEngine extends SignalServiceImpl {
* Scans the scripts directory for updates
*/
public void scanScriptDir(){
WatchKey key = null;
while((key = watchService.poll()) != null){
List<WatchEvent<?>> events = key.pollEvents();
for(WatchEvent<?> event : events){
if(event.kind() == StandardWatchEventKinds.ENTRY_MODIFY){
if(event.context() instanceof Path){
// Path filePath = (Path)event.context();
// System.out.println(filePath);
}
} else if(event.kind() == StandardWatchEventKinds.ENTRY_CREATE){
throw new Error("Cannot handle create events yet");
} else if(event.kind() == StandardWatchEventKinds.ENTRY_DELETE){
throw new Error("Cannot handle delete events yet");
}
}
key.reset();
}
// WatchKey key = null;
// while((key = watchService.poll()) != null){
// List<WatchEvent<?>> events = key.pollEvents();
// for(WatchEvent<?> event : events){
// if(event.kind() == StandardWatchEventKinds.ENTRY_MODIFY){
// if(event.context() instanceof Path){
// // Path filePath = (Path)event.context();
// // System.out.println(filePath);
// }
// } else if(event.kind() == StandardWatchEventKinds.ENTRY_CREATE){
// throw new Error("Cannot handle create events yet");
// } else if(event.kind() == StandardWatchEventKinds.ENTRY_DELETE){
// throw new Error("Cannot handle delete events yet");
// }
// }
// key.reset();
// }
}
/**