Use toUtf8 instead TODO - find out 'sactly what the website is using for hashes.
authornemo
Wed, 27 Jun 2012 13:47:42 -0400
changeset 7313 162bc562335b
parent 7311 06b31a1b333c
child 7315 59b5b19e6604
Use toUtf8 instead TODO - find out 'sactly what the website is using for hashes.
QTfrontend/gameuiconfig.cpp
QTfrontend/hwform.cpp
QTfrontend/team.cpp
--- a/QTfrontend/gameuiconfig.cpp	Wed Jun 27 13:39:46 2012 -0400
+++ b/QTfrontend/gameuiconfig.cpp	Wed Jun 27 13:47:42 2012 -0400
@@ -333,7 +333,7 @@
 
 QByteArray GameUIConfig::netPasswordHash()
 {
-    return QCryptographicHash::hash(Form->ui.pageOptions->editNetPassword->text().toLatin1(), QCryptographicHash::Md5).toHex();
+    return QCryptographicHash::hash(Form->ui.pageOptions->editNetPassword->text().toUtf8(), QCryptographicHash::Md5).toHex();
 }
 
 int GameUIConfig::netPasswordLength()
--- a/QTfrontend/hwform.cpp	Wed Jun 27 13:39:46 2012 -0400
+++ b/QTfrontend/hwform.cpp	Wed Jun 27 13:47:42 2012 -0400
@@ -128,7 +128,7 @@
 #endif
     gameSettings = new QSettings(cfgdir->absolutePath() + "/hedgewars.ini", QSettings::IniFormat);
     frontendEffects = gameSettings->value("frontend/effects", true).toBool();
-    playerHash = QString(QCryptographicHash::hash(gameSettings->value("net/nick","").toString().toLatin1(), QCryptographicHash::Md5).toHex());
+    playerHash = QString(QCryptographicHash::hash(gameSettings->value("net/nick","").toString().toUtf8(), QCryptographicHash::Md5).toHex());
 
     this->setStyleSheet(styleSheet);
     ui.setupUi(this);
@@ -968,7 +968,7 @@
         }
 
         QString password = hpd->lePassword->text();
-        hash = QCryptographicHash::hash(password.toLatin1(), QCryptographicHash::Md5).toHex();
+        hash = QCryptographicHash::hash(password.toUtf8(), QCryptographicHash::Md5).toHex();
 
         bool save = hpd->cbSave->isChecked();
         config->setValue("net/savepassword", save);
--- a/QTfrontend/team.cpp	Wed Jun 27 13:39:46 2012 -0400
+++ b/QTfrontend/team.cpp	Wed Jun 27 13:47:42 2012 -0400
@@ -259,7 +259,7 @@
     QStringList sl;
     if (m_isNetTeam)
     {
-        sl.push_back(QString("eaddteam %3 %1 %2").arg(qcolor().rgb() & 0xffffff).arg(m_name).arg(QString(QCryptographicHash::hash(m_owner.toLatin1(), QCryptographicHash::Md5).toHex())));
+        sl.push_back(QString("eaddteam %3 %1 %2").arg(qcolor().rgb() & 0xffffff).arg(m_name).arg(QString(QCryptographicHash::hash(m_owner.toUtf8(), QCryptographicHash::Md5).toHex())));
         sl.push_back("erdriven");
     }
     else sl.push_back(QString("eaddteam %3 %1 %2").arg(qcolor().rgb() & 0xffffff).arg(m_name).arg(playerHash));