Advertisement
Guest User

Untitled

a guest
May 29th, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.49 KB | None | 0 0
  1. void ModemConnection::telnetMessage(const QString &msg)
  2. {
  3.     tBuffer.append(msg);
  4.     qDebug() << msg;
  5.     if(!telnetLoggedInState)
  6.     {
  7.         //qDebug() << tBuffer;
  8.         if(msg.contains("Login: ") || msg.contains("Username : "))
  9.             telnet->sendData(user);
  10.         else if(msg.contains("Password: ") || msg.contains("Password : ") || msg.contains("Password")){
  11.             //qDebug() << pass;
  12.             telnet->sendData(pass);
  13.             //This is needed for the fuckig horid comtrend telnet server that doesn't return the prompt
  14.             status = "Testing log in";
  15.             //setLoggedInState(true);
  16.             clearTelnetBuffer();
  17.             emit modemStatusUpdated();
  18.         }
  19.         if (msg.contains("#") || msg.contains("~")  || msg.contains(">")
  20.             || tBuffer.contains("=>") || tBuffer.contains(">"))
  21.         {
  22.             status = "Logged in";
  23.             setLoggedInState(true);
  24.             clearTelnetBuffer();
  25.             emit modemStatusUpdated();
  26.         }
  27.         if(msg.contains("Login incorrect") || msg.contains("Invalid username/password"))
  28.         {
  29.             setLoggedInState(false);
  30.             status = "Login incorrect";
  31.             emit modemStatusUpdated();
  32.         }
  33.         if(msg.contains("help")){
  34.             status = "Logged via Horid Comtrend Hack";
  35.             setLoggedInState(true);
  36.             clearTelnetBuffer();
  37.             emit modemStatusUpdated();
  38.         }
  39.     }
  40.    
  41.     emit telnetBufferUpdated();
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement