* Pause after tooManyArt

This commit is contained in:
Bryan Ashby 2015-08-03 23:21:23 -06:00
parent 608d4dc094
commit 36a8d771e8
2 changed files with 12 additions and 6 deletions

View File

@ -76,14 +76,16 @@ function AbracadabraModule(options) {
if(_.isString(self.config.tooManyArt)) { if(_.isString(self.config.tooManyArt)) {
theme.displayThemeArt( { client : self.client, name : self.config.tooManyArt }, function displayed() { theme.displayThemeArt( { client : self.client, name : self.config.tooManyArt }, function displayed() {
theme.displayThemedPause( { client : self.client }, function keyPressed() {
callback(new Error('Too many active instances')); callback(new Error('Too many active instances'));
}); });
});
} else { } else {
self.client.term.write('\nToo many active instances. Try again later.\n'); self.client.term.write('\nToo many active instances. Try again later.\n');
setTimeout(function timeout() { theme.displayThemedPause( { client : self.client }, function keyPressed() {
callback(new Error('Too many active instances')); callback(new Error('Too many active instances'));
}, 1000); });
} }
} else { } else {
// :TODO: JS elegant way to do this? // :TODO: JS elegant way to do this?
@ -113,6 +115,7 @@ function AbracadabraModule(options) {
], ],
function complete(err) { function complete(err) {
if(err) { if(err) {
self.lastError = err;
self.fallbackModule(); self.fallbackModule();
} else { } else {
self.finishedLoading(); self.finishedLoading();
@ -164,7 +167,9 @@ AbracadabraModule.prototype.enter = function(client) {
AbracadabraModule.prototype.leave = function() { AbracadabraModule.prototype.leave = function() {
AbracadabraModule.super_.prototype.leave.call(this); AbracadabraModule.super_.prototype.leave.call(this);
if(!this.lastError) {
activeDoorNodeInstances[this.config.name] -= 1; activeDoorNodeInstances[this.config.name] -= 1;
}
}; };
AbracadabraModule.prototype.finishedLoading = function() { AbracadabraModule.prototype.finishedLoading = function() {

View File

@ -266,7 +266,8 @@
"args" : [ "args" : [
"-quiet", "-f", "/home/nuskooler/DOS/X/LORD/dosemu.conf", "X:\\PW\\START.BAT {dropfile} {node}" "-quiet", "-f", "/home/nuskooler/DOS/X/LORD/dosemu.conf", "X:\\PW\\START.BAT {dropfile} {node}"
], ],
"nodeMax" : 1 "nodeMax" : 1,
"tooManyArt" : "doortoomany.ans"
} }
}, },
"doorLORD" : { "doorLORD" : {