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