Fix issue #220
This commit is contained in:
parent
d0e919db19
commit
16c3c6b01f
3 changed files with 10 additions and 4 deletions
|
@ -5345,7 +5345,7 @@ all of Javascript's Array goodness.
|
|||
#### Example
|
||||
|
||||
var utils = require('utils');
|
||||
var worlds = utils.array(server.worlds);
|
||||
var worlds = utils.array(server.worldManager.getAllWorlds());
|
||||
|
||||
### utils.players() function
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ at('06:00', wakeup, null, false);
|
|||
function at(time24hr, callback, pWorlds, repeat) {
|
||||
var timeParts = time24hr.split( ':' );
|
||||
var timeMins = (timeParts[0] * 60) + (timeParts[1] * 1);
|
||||
if (!pWorlds || typeof pWorlds == 'undefined' ) {
|
||||
if (!pWorlds || pWorlds === undefined ) {
|
||||
pWorlds = utils.worlds();
|
||||
}
|
||||
if (repeat === undefined){
|
||||
|
@ -68,8 +68,8 @@ var atTasks = {};
|
|||
function atMonitorFactory(world){
|
||||
var worldName = ''+ world.name;
|
||||
var lastRun = null;
|
||||
return function(){
|
||||
var timeMins = utils.getTime24(world);
|
||||
return function atMonitorForWorld(){
|
||||
var timeMins = utils.time24(world);
|
||||
if (timeMins === lastRun){
|
||||
return;
|
||||
}
|
||||
|
@ -120,3 +120,5 @@ addUnloadHandler(function(){
|
|||
clearInterval(atInterval);
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = at;
|
||||
|
|
4
src/main/js/plugins/at.js
Normal file
4
src/main/js/plugins/at.js
Normal file
|
@ -0,0 +1,4 @@
|
|||
// ensure that the at world-load event handlers are
|
||||
// registered early in server startup
|
||||
var at = require('at');
|
||||
// nothing more needed.
|
Reference in a new issue