Many changes to ServerCore
This commit is contained in:
1 parent
6969ef0fbb
commit
d445834af6
83 files changed
+666
-756
No files matched your search
+9
-10
@@ -9,7 +9,7 @@ namespace core {
|
||||
|
||||
ConsoleSession::~ConsoleSession() {}
|
||||
|
||||
void ConsoleSession::protocol(std::string data = "") {
|
||||
void ConsoleSession::protocol(coreutils::ZString data) {
|
||||
|
||||
coreutils::Log(coreutils::LOG_DEBUG_1) << "ConsoleSession protocol " << status;
|
||||
switch (status) {
|
||||
@@ -24,7 +24,7 @@ namespace core {
|
||||
setCursorLocation(2, 1);
|
||||
setBackColor(BG_BLACK);
|
||||
status = LOGIN;
|
||||
protocol();
|
||||
protocol((char*)"");
|
||||
break;
|
||||
|
||||
case LOGIN:
|
||||
@@ -35,7 +35,7 @@ namespace core {
|
||||
|
||||
case WAIT_USER_PROFILE:
|
||||
status = PASSWORD;
|
||||
protocol();
|
||||
protocol((char*)"");
|
||||
break;
|
||||
|
||||
case PASSWORD:
|
||||
@@ -55,7 +55,7 @@ namespace core {
|
||||
setBackColor(BG_BLACK);
|
||||
scrollArea(2, 16);
|
||||
status = PROMPT;
|
||||
protocol();
|
||||
protocol((char*)"");
|
||||
break;
|
||||
|
||||
case PROMPT:
|
||||
@@ -66,16 +66,15 @@ namespace core {
|
||||
break;
|
||||
|
||||
case INPUT:
|
||||
command = std::string(data);
|
||||
command.erase(command.find_last_not_of("\r\n\t") + 1);
|
||||
command = data;
|
||||
status = PROCESS;
|
||||
protocol();
|
||||
protocol((char*)"");
|
||||
break;
|
||||
|
||||
case PROCESS:
|
||||
doCommand(command);
|
||||
status = (command == "exit")? DONE: PROMPT;
|
||||
protocol();
|
||||
status = command.equals((char *)"exit") ? DONE: PROMPT;
|
||||
protocol((char*)"");
|
||||
break;
|
||||
|
||||
case DONE:
|
||||
@@ -95,7 +94,7 @@ namespace core {
|
||||
send();
|
||||
}
|
||||
|
||||
void ConsoleSession::doCommand(std::string request) {
|
||||
void ConsoleSession::doCommand(coreutils::ZString request) {
|
||||
saveCursor();
|
||||
setCursorLocation(16, 1);
|
||||
out << "--> " << request << std::endl;
|
||||
|
||||
Reference in new issue
Block a user