QTfrontend/net/newnetclient.cpp
branchqt5transition
changeset 12897 fc47fc4af6bd
parent 11865 047be82b6f67
child 13322 b77a9380dd0f
--- a/QTfrontend/net/newnetclient.cpp	Wed Jan 24 21:05:34 2018 +0100
+++ b/QTfrontend/net/newnetclient.cpp	Wed Jan 24 22:20:10 2018 +0100
@@ -242,7 +242,7 @@
 void HWNewNet::SendPasswordHash(const QString & hash)
 {
     // don't send it immediately, only store and check if server asked us for a password
-    m_passwordHash = hash.toAscii();
+    m_passwordHash = hash.toLatin1();
 
     maybeSendPassword();
 }
@@ -271,7 +271,7 @@
     if (lst[0] == "ERROR")
     {
         if (lst.size() == 2)
-            emit Error(HWApplication::translate("server", lst[1].toAscii().constData()));
+            emit Error(HWApplication::translate("server", lst[1].toLatin1().constData()));
         else
             emit Error("Unknown error");
         return;
@@ -280,7 +280,7 @@
     if (lst[0] == "WARNING")
     {
         if (lst.size() == 2)
-            emit Warning(HWApplication::translate("server", lst[1].toAscii().constData()));
+            emit Warning(HWApplication::translate("server", lst[1].toLatin1().constData()));
         else
             emit Warning("Unknown warning");
         return;
@@ -447,7 +447,7 @@
         while(flags.size() > 1)
         {
             flags.remove(0, 1);
-            char c = flags[0].toAscii();
+            char c = flags[0].toLatin1();
             bool inRoom = (netClientState == InRoom || netClientState == InGame);
 
             switch(c)
@@ -673,7 +673,7 @@
         }
         m_game_connected = false;
         Disconnect();
-        emit disconnected(HWApplication::translate("server", lst[1].toAscii().constData()));
+        emit disconnected(HWApplication::translate("server", lst[1].toLatin1().constData()));
         return;
     }
 
@@ -727,7 +727,7 @@
             }
             for(int i = 1; i < lst.size(); ++i)
             {
-                QByteArray em = QByteArray::fromBase64(lst[i].toAscii());
+                QByteArray em = QByteArray::fromBase64(lst[i].toLatin1());
                 emit FromNet(em);
             }
             return;
@@ -1155,18 +1155,18 @@
         return;
 
     QString hash = QCryptographicHash::hash(
-                m_clientSalt.toAscii()
-                .append(m_serverSalt.toAscii())
+                m_clientSalt.toLatin1()
+                .append(m_serverSalt.toLatin1())
                 .append(m_passwordHash)
-                .append(cProtoVer->toAscii())
+                .append(cProtoVer->toLatin1())
                 .append("!hedgewars")
                 , QCryptographicHash::Sha1).toHex();
 
     m_serverHash = QCryptographicHash::hash(
-                m_serverSalt.toAscii()
-                .append(m_clientSalt.toAscii())
+                m_serverSalt.toLatin1()
+                .append(m_clientSalt.toLatin1())
                 .append(m_passwordHash)
-                .append(cProtoVer->toAscii())
+                .append(cProtoVer->toLatin1())
                 .append("!hedgewars")
                 , QCryptographicHash::Sha1).toHex();