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
var utils = require('utils');
var worlds = utils.array(server.worlds);
var worlds = utils.array(server.worldManager.getAllWorlds());
### utils.players() function

View file

@ -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;

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.