mojo_client/src/Client/ControlSocket.h
false_genesis 32248f0880 * updated the ControlSocket to be telnet-compatible. original idea by klip, thx.
* added optional password to the ContolSocket
* fixed possible exception/crash in the DefScript variable handler (occurred when typing "getvar" into the console or telnet). maybe a very slight code speedup, too.
* minor chat script updates (more telnet-friendly)
* note: if you use PHP or anything that is NOT telnet/netcat to send commands to the ControlSocket, you have to terminate each line with '\n' !
2008-11-01 10:21:43 +00:00

30 lines
510 B
C++

#ifndef CONTROLSOCKET_H
#define CONTROLSOCKET_H
#include "Network/TcpSocket.h"
#include "RemoteController.h"
class ControlSocket : public TcpSocket
{
public:
ControlSocket(SocketHandler& h);
void SetInstance(PseuInstance *in) { _instance = in; }
void OnAccept();
void OnRead();
void HandleString(std::string);
void SendTelnetText(std::string);
private:
void _Execute(std::string);
PseuInstance *_instance;
bool _ok;
std::string _str;
bool _authed;
};
#endif