ConsoleSession.h
Go to the documentation of this file.
#ifndef __ConsoleSession_h__
#define __ConsoleSession_h__
#include "TerminalSession.h"
#include "TCPSession.h"
#include "CommandList.h"
namespace core {
class ConsoleSession : public TerminalSession {
public:
ConsoleSession(EPoll &ePoll, TCPServer &server);
~ConsoleSession();
void writeLog(std::string data);
protected:
void protocol(std::string data) override;
private:
enum Status {WELCOME, LOGIN, WAIT_USER_PROFILE, PASSWORD, WAIT_PASSWORD, PROMPT, INPUT, PROCESS, DONE};
Status status = WELCOME;
void doCommand(std::string request);
std::string command;
};
}
#endif
core::Socket::ePoll
EPoll & ePoll
Definition: Socket.h:117
core::EPoll
Definition: EPoll.h:31
core::ConsoleSession::ConsoleSession
ConsoleSession(EPoll &ePoll, TCPServer &server)
Definition: ConsoleSession.cpp:6
core::TCPServer
Definition: TCPServer.h:24
TerminalSession.h
core::ConsoleSession::~ConsoleSession
~ConsoleSession()
Definition: ConsoleSession.cpp:10
TCPSession.h
core::ConsoleSession::protocol
void protocol(std::string data) override
Definition: ConsoleSession.cpp:12
core::ConsoleSession
Definition: ConsoleSession.h:18
core
Definition: Command.cpp:5
core::ConsoleSession::writeLog
void writeLog(std::string data)
Definition: ConsoleSession.cpp:91
core::TerminalSession
Definition: TerminalSession.h:30
CommandList.h
core::TCPSession::server
TCPServer & server
Definition: TCPSession.h:83