diff --git a/src/main/js/plugins/classroom/classroom.js b/src/main/js/plugins/classroom/classroom.js index d0ebf2a..dd22cc8 100644 --- a/src/main/js/plugins/classroom/classroom.js +++ b/src/main/js/plugins/classroom/classroom.js @@ -106,7 +106,7 @@ function revokeScripting ( player ) { var playerDir = new File( playersDir + playerName ); unwatchDir( playerDir ); } -exports.classroomAutoloadTime = 0; +exports.classroomAutoloadTime = {}; function grantScripting( player ) { console.log('Enabling scripting for player ' + player.name); var playerName = '' + player.name; @@ -122,10 +122,10 @@ function grantScripting( player ) { //this check is here because this callback might get called multiple times for the watch interval //one call for the file change and another for directory change //(this happens only in Linux because in Windows the folder lastModifiedTime is not changed) - if(currentTime-exports.classroomAutoloadTime>1000) { + if(currentTime-exports.classroomAutoloadTime[playerName]>1000) { autoload(playerContext, playerDir, logger, { cache: false }); } - exports.classroomAutoloadTime = currentTime; + exports.classroomAutoloadTime[playerName] = currentTime; }); /*