1143 */ |
1143 */ |
1144 |
1144 |
1145 if(m_passwordHash.isEmpty() || m_serverSalt.isEmpty()) |
1145 if(m_passwordHash.isEmpty() || m_serverSalt.isEmpty()) |
1146 return; |
1146 return; |
1147 |
1147 |
1148 QString hash; |
1148 QString hash = QCryptographicHash::hash( |
1149 |
|
1150 hash = QCryptographicHash::hash( |
|
1151 m_clientSalt.toAscii() |
1149 m_clientSalt.toAscii() |
1152 .append(m_serverSalt.toAscii()) |
1150 .append(m_serverSalt.toAscii()) |
1153 .append(m_passwordHash) |
1151 .append(m_passwordHash) |
1154 .append(cProtoVer->toAscii()) |
1152 .append(cProtoVer->toAscii()) |
1155 .append("!hedgewars") |
1153 .append("!hedgewars") |
1156 , QCryptographicHash::Sha1); |
1154 , QCryptographicHash::Sha1).toHex(); |
1157 |
1155 |
1158 m_serverHash = QCryptographicHash::hash( |
1156 m_serverHash = QCryptographicHash::hash( |
1159 m_serverSalt.toAscii() |
1157 m_serverSalt.toAscii() |
1160 .append(m_clientSalt.toAscii()) |
1158 .append(m_clientSalt.toAscii()) |
1161 .append(m_passwordHash) |
1159 .append(m_passwordHash) |
1162 .append(cProtoVer->toAscii()) |
1160 .append(cProtoVer->toAscii()) |
1163 .append("!hedgewars") |
1161 .append("!hedgewars") |
1164 , QCryptographicHash::Sha1); |
1162 , QCryptographicHash::Sha1).toHex(); |
1165 |
1163 |
1166 RawSendNet(QString("PASSWORD%1%2%1%3").arg(delimeter).arg(hash).arg(m_clientSalt)); |
1164 RawSendNet(QString("PASSWORD%1%2%1%3").arg(delimeter).arg(hash).arg(m_clientSalt)); |
1167 } |
1165 } |