Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ModemConnection::telnetMessage(const QString &msg)
- {
- tBuffer.append(msg);
- qDebug() << msg;
- if(!telnetLoggedInState)
- {
- //qDebug() << tBuffer;
- if(msg.contains("Login: ") || msg.contains("Username : "))
- telnet->sendData(user);
- else if(msg.contains("Password: ") || msg.contains("Password : ") || msg.contains("Password")){
- //qDebug() << pass;
- telnet->sendData(pass);
- //This is needed for the fuckig horid comtrend telnet server that doesn't return the prompt
- status = "Testing log in";
- //setLoggedInState(true);
- clearTelnetBuffer();
- emit modemStatusUpdated();
- }
- if (msg.contains("#") || msg.contains("~") || msg.contains(">")
- || tBuffer.contains("=>") || tBuffer.contains(">"))
- {
- status = "Logged in";
- setLoggedInState(true);
- clearTelnetBuffer();
- emit modemStatusUpdated();
- }
- if(msg.contains("Login incorrect") || msg.contains("Invalid username/password"))
- {
- setLoggedInState(false);
- status = "Login incorrect";
- emit modemStatusUpdated();
- }
- if(msg.contains("help")){
- status = "Logged via Horid Comtrend Hack";
- setLoggedInState(true);
- clearTelnetBuffer();
- emit modemStatusUpdated();
- }
- }
- emit telnetBufferUpdated();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement