Compiles.

This commit is contained in:
Brad Arant committed 2021-08-10 14:07:50 -07:00
1 parent 43489e5b3a
commit b16e2e1a1b
18 files changed
+43 -50

No files matched your search

+12 -32
View File
@@ -1,9 +1,10 @@
#include "ConsoleSession.h"
#include "TCPServer.h"
#include "Log.h"
namespace core {
ConsoleSession::ConsoleSession(EPoll &ePoll, TCPServer &server) : TerminalSession(ePoll, server) {
ConsoleSession::ConsoleSession(EPoll &ePoll, TCPServer &server) : TCPSession(ePoll, server) {
coreutils::Log(coreutils::LOG_DEBUG_2) << "Constructing ConsoleSession...";
}
@@ -16,21 +17,12 @@ namespace core {
switch (status) {
case WELCOME:
setBackColor(BG_BLACK);
clear();
setCursorLocation(1, 1);
setBackColor(BG_BLUE);
clearEOL();
out << "ConsoleSession";
setCursorLocation(2, 1);
setBackColor(BG_BLACK);
status = LOGIN;
protocol(blank);
break;
case LOGIN:
setCursorLocation(3, 3);
out << "Enter User Profile: ";
out << "User: ";
status = WAIT_USER_PROFILE;
break;
@@ -40,29 +32,17 @@ namespace core {
break;
case PASSWORD:
setCursorLocation(4, 7);
out << "Enter Password: ";
out << "Password: ";
status = WAIT_PASSWORD;
break;
case WAIT_PASSWORD:
setBackColor(BG_BLACK);
clear();
setCursorLocation(1, 1);
setBackColor(BG_BLUE);
clearEOL();
out << "ConsoleSession";
setCursorLocation(2, 1);
setBackColor(BG_BLACK);
scrollArea(2, 16);
status = PROMPT;
protocol(blank);
break;
case PROMPT:
setCursorLocation(17, 1);
clearEOL();
out << ("--> ");
out << (": ");
status = INPUT;
break;
@@ -89,17 +69,17 @@ namespace core {
}
void ConsoleSession::writeLog(std::string data) {
saveCursor();
setCursorLocation(16, 1);
restoreCursor();
// saveCursor();
// setCursorLocation(16, 1);
// restoreCursor();
}
void ConsoleSession::doCommand(coreutils::ZString request) {
saveCursor();
setCursorLocation(16, 1);
out << "--> " << request << std::endl;
// saveCursor();
// setCursorLocation(16, 1);
// out << "--> " << request << std::endl;
server.commands.processRequest(request, *this);
restoreCursor();
// restoreCursor();
}
}