QTfrontend/net/newnetclient.cpp
changeset 14866 e088bd03812d
parent 14865 90cf07c60feb
child 14903 5119203470f3
equal deleted inserted replaced
14865:90cf07c60feb 14866:e088bd03812d
    83 void HWNewNet::Connect(const QString & hostName, quint16 port, bool useTls, const QString & nick)
    83 void HWNewNet::Connect(const QString & hostName, quint16 port, bool useTls, const QString & nick)
    84 {
    84 {
    85     netClientState = Connecting;
    85     netClientState = Connecting;
    86     mynick = nick;
    86     mynick = nick;
    87     myhost = hostName + QString(":%1").arg(port);
    87     myhost = hostName + QString(":%1").arg(port);
    88     NetSocket.connectToHost(hostName, port);
    88     if (useTls)
       
    89     {
       
    90         NetSocket.connectToHostEncrypted(hostName, port);
       
    91         if (!NetSocket.waitForEncrypted())
       
    92         {
       
    93             qWarning("Handshake failed");
       
    94         }
       
    95     }
       
    96     else 
       
    97     {
       
    98         NetSocket.connectToHost(hostName, port);
       
    99     }
    89 }
   100 }
    90 
   101 
    91 void HWNewNet::Disconnect()
   102 void HWNewNet::Disconnect()
    92 {
   103 {
    93     if (m_game_connected)
   104     if (m_game_connected)