Default to random guest username in all places net/nick is fetched. Fixes
issue #588
--- a/QTfrontend/hwform.cpp Mon May 27 10:52:30 2013 +0400
+++ b/QTfrontend/hwform.cpp Mon May 27 10:47:59 2013 -0400
@@ -153,7 +153,7 @@
config = new GameUIConfig(this, DataManager::instance().settingsFileName());
frontendEffects = config->value("frontend/effects", true).toBool();
- playerHash = QString(QCryptographicHash::hash(config->value("net/nick","").toString().toUtf8(), QCryptographicHash::Md5).toHex());
+ playerHash = QString(QCryptographicHash::hash(config->value("net/nick",tr("Guest")+QString("%1").arg(rand())).toString().toUtf8(), QCryptographicHash::Md5).toHex());
ui.pageRoomsList->setSettings(config);
ui.pageNetGame->setSettings(config);
@@ -470,7 +470,7 @@
if(teamslist.empty())
{
- QString currentNickName = config->value("net/nick","").toString().toUtf8();
+ QString currentNickName = config->value("net/nick",tr("Guest")+QString("%1").arg(rand())).toString().toUtf8();
QString teamName;
if (currentNickName.isEmpty())
@@ -1379,7 +1379,7 @@
if (hwnet->m_private_game == false && AskForNickAndPwd() != 0)
return;
- QString nickname = config->value("net/nick", "").toString();
+ QString nickname = config->value("net/nick",tr("Guest")+QString("%1").arg(rand())).toString();
ui.pageRoomsList->setUser(nickname);
ui.pageNetGame->setUser(nickname);
@@ -1398,7 +1398,7 @@
QString password;
do {
- nickname = config->value("net/nick", "").toString();
+ nickname = config->value("net/nick",tr("Guest")+QString("%1").arg(rand())).toString();
hash = config->passwordHash();
temphash = config->tempHash();