* 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,15 +76,17 @@ function AbracadabraModule(options) {
if(_.isString(self.config.tooManyArt)) {
theme.displayThemeArt( { client : self.client, name : self.config.tooManyArt }, function displayed() {
callback(new Error('Too many active instances'));
theme.displayThemedPause( { client : self.client }, function keyPressed() {
callback(new Error('Too many active instances'));
});
});
} else {
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'));
}, 1000);
}
});
}
} else {
// :TODO: JS elegant way to do this?
if(activeDoorNodeInstances[self.config.name]) {
@ -113,6 +115,7 @@ function AbracadabraModule(options) {
],
function complete(err) {
if(err) {
self.lastError = err;
self.fallbackModule();
} else {
self.finishedLoading();
@ -164,7 +167,9 @@ AbracadabraModule.prototype.enter = function(client) {
AbracadabraModule.prototype.leave = function() {
AbracadabraModule.super_.prototype.leave.call(this);
activeDoorNodeInstances[this.config.name] -= 1;
if(!this.lastError) {
activeDoorNodeInstances[this.config.name] -= 1;
}
};
AbracadabraModule.prototype.finishedLoading = function() {

View File

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