mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-25 12:08:21 +02:00
* Pause after tooManyArt
This commit is contained in:
parent
608d4dc094
commit
36a8d771e8
2 changed files with 12 additions and 6 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue