Initial repository 1.0.0
This commit is contained in:
commit
d8b1275884
1861 files changed
+66342
No files matched your search
@@ -0,0 +1,41 @@
|
||||
#ifndef __ConsoleSession_h__
|
||||
#define __ConsoleSession_h__
|
||||
|
||||
#include "TerminalSession.h"
|
||||
#include "Session.h"
|
||||
#include "ConsoleServer.h"
|
||||
#include "CommandList.h"
|
||||
|
||||
namespace core {
|
||||
|
||||
///
|
||||
/// ConsoleSession
|
||||
///
|
||||
/// Extends the session parameters for this TCPSocket derived object.
|
||||
/// Extend the protocol() method in order to define the behavior and
|
||||
/// protocol interaction for this socket which is a console session.
|
||||
///
|
||||
|
||||
class ConsoleSession : public TerminalSession {
|
||||
|
||||
public:
|
||||
ConsoleSession(EPoll &ePoll, ConsoleServer &server);
|
||||
~ConsoleSession();
|
||||
|
||||
virtual void output(std::stringstream &out);
|
||||
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
|
||||
Reference in new issue
Block a user