enigma-bbs/mods/logoff.js

41 lines
989 B
JavaScript

/* jslint node: true */
'use strict';
var MenuModule = require('../core/menu_module.js').MenuModule;
var ansi = require('../core/ansi_term.js');
exports.moduleInfo = {
name : 'LogOff',
desc : 'Log off / Goodbye Module',
author : 'NuSkooler',
};
exports.getModule = LogOffModule;
function LogOffModule(menuConfig) {
MenuModule.call(this, menuConfig);
}
require('util').inherits(LogOffModule, MenuModule);
LogOffModule.prototype.enter = function(client) {
LogOffModule.super_.prototype.enter.call(this, client);
};
LogOffModule.prototype.beforeArt = function() {
LogOffModule.super_.prototype.beforeArt.call(this);
this.client.term.write(ansi.resetScreen());
};
LogOffModule.prototype.mciReady = function(mciData) {
LogOffModule.super_.prototype.mciReady.call(this, mciData);
};
LogOffModule.prototype.finishedLoading = function() {
LogOffModule.super_.prototype.finishedLoading.call(this);
this.client.term.write(ansi.normal() + '\nATH0\n');
this.client.end();
};