mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-11 07:04:32 +02:00
+ Initial source checkin
This commit is contained in:
parent
9804c93f2e
commit
9a7e90b9b2
31 changed files with 4361 additions and 0 deletions
55
mods/connect.js
Normal file
55
mods/connect.js
Normal file
|
@ -0,0 +1,55 @@
|
|||
/* jslint node: true */
|
||||
'use strict';
|
||||
|
||||
var ansi = require('../core/ansi_term.js');
|
||||
var artwork = require('../core/art.js');
|
||||
var modules = require('../core/modules.js');
|
||||
var packageJson = require('../package.json');
|
||||
var util = require('util');
|
||||
|
||||
exports.moduleInfo = {
|
||||
name : 'Connect',
|
||||
desc : 'First module upon connection',
|
||||
author : 'NuSkooler',
|
||||
};
|
||||
|
||||
exports.entryPoint = entryPoint;
|
||||
|
||||
function entryPoint(client) {
|
||||
/*var self = this;
|
||||
this.client = client;
|
||||
var term = this.client.term;*/
|
||||
|
||||
var term = client.term;
|
||||
|
||||
term.write(ansi.normal());
|
||||
|
||||
term.write(ansi.disableVT100LineWrapping());
|
||||
|
||||
// :TODO: set xterm stuff -- see x84/others
|
||||
|
||||
// :TODO: add URL to banner
|
||||
term.write(ansi.fromPipeCode(util.format('' +
|
||||
'|33Conected to |32EN|33|01i|32|22GMA|32|01½|00 |33BBS version|31|01 %s\n' +
|
||||
'|00|33Copyright (c) 2014 Bryan Ashby\n' +
|
||||
'|00', packageJson.version)));
|
||||
|
||||
setTimeout(function onTimeout() {
|
||||
term.write(ansi.clearScreen());
|
||||
|
||||
artwork.getArt('CONNECT', { random : true, readSauce : true }, function onArt(err, art) {
|
||||
var timeout = 0;
|
||||
|
||||
if(!err) {
|
||||
term.write(art.data);
|
||||
timeout = 1000;
|
||||
}
|
||||
|
||||
setTimeout(function onTimeout() {
|
||||
term.write(ansi.clearScreen());
|
||||
modules.goto('matrix', client);
|
||||
}, timeout);
|
||||
});
|
||||
}, 500);
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue