mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-10 22:54:37 +02:00
* Start work on database & users
This commit is contained in:
parent
eab6da2b0a
commit
7a3e375f5d
7 changed files with 196 additions and 41 deletions
|
@ -5,6 +5,7 @@
|
|||
var ansi = require('../core/ansi_term.js');
|
||||
var lineEditor = require('../core/line_editor.js');
|
||||
var art = require('../core/art.js');
|
||||
var user = require('../core/user.js');
|
||||
|
||||
var view = require('../core/view.js');
|
||||
|
||||
|
@ -20,23 +21,7 @@ function entryPoint(client) {
|
|||
var term = client.term;
|
||||
|
||||
term.write(ansi.resetScreen());
|
||||
|
||||
//-------------
|
||||
/*
|
||||
client.on('position', function onPos(pos) {
|
||||
console.log(pos);
|
||||
});
|
||||
|
||||
term.write('Hello, world!');
|
||||
term.write(ansi.queryPos());
|
||||
term.write(ansi.goto(5,5));
|
||||
term.write('Yehawww a bunch of text incoming.... maybe that is what breaks it... hrm... who knows.\nHave to do more testing ;(\n');
|
||||
term.write(ansi.queryPos());
|
||||
return;
|
||||
*/
|
||||
|
||||
//-------------
|
||||
|
||||
|
||||
// :TODO: types, random, and others? could come from conf.mods.matrix or such
|
||||
|
||||
//art.getArt('SO-CC1.ANS'/* 'MATRIX'*/, { types: ['.ans'], random: true}, function onArt(err, theArt) {
|
||||
|
@ -52,6 +37,23 @@ function entryPoint(client) {
|
|||
vc.loadFromMCIMap(mci);
|
||||
vc.setViewOrder();
|
||||
vc.switchFocus(1);
|
||||
vc.setSubmitView(2);
|
||||
|
||||
vc.on('action', function onAction(act) {
|
||||
if('submit' === act.action) {
|
||||
console.log('userName=' + vc.getView(1).value);
|
||||
console.log('password: ' + act.view.value);
|
||||
|
||||
user.User.load(vc.getView(1).value, function onUser(err, user) {
|
||||
if(err) {
|
||||
console.log(err);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(user.id);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue