This commit is contained in:
walterhiggins 2015-02-28 23:54:59 +00:00
parent d0e919db19
commit 16c3c6b01f
3 changed files with 10 additions and 4 deletions

View file

@ -5345,7 +5345,7 @@ all of Javascript's Array goodness.
#### Example #### Example
var utils = require('utils'); var utils = require('utils');
var worlds = utils.array(server.worlds); var worlds = utils.array(server.worldManager.getAllWorlds());
### utils.players() function ### utils.players() function

View file

@ -50,7 +50,7 @@ at('06:00', wakeup, null, false);
function at(time24hr, callback, pWorlds, repeat) { function at(time24hr, callback, pWorlds, repeat) {
var timeParts = time24hr.split( ':' ); var timeParts = time24hr.split( ':' );
var timeMins = (timeParts[0] * 60) + (timeParts[1] * 1); var timeMins = (timeParts[0] * 60) + (timeParts[1] * 1);
if (!pWorlds || typeof pWorlds == 'undefined' ) { if (!pWorlds || pWorlds === undefined ) {
pWorlds = utils.worlds(); pWorlds = utils.worlds();
} }
if (repeat === undefined){ if (repeat === undefined){
@ -68,8 +68,8 @@ var atTasks = {};
function atMonitorFactory(world){ function atMonitorFactory(world){
var worldName = ''+ world.name; var worldName = ''+ world.name;
var lastRun = null; var lastRun = null;
return function(){ return function atMonitorForWorld(){
var timeMins = utils.getTime24(world); var timeMins = utils.time24(world);
if (timeMins === lastRun){ if (timeMins === lastRun){
return; return;
} }
@ -120,3 +120,5 @@ addUnloadHandler(function(){
clearInterval(atInterval); clearInterval(atInterval);
}); });
}); });
module.exports = at;

View 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.