QTfrontend/hwform.cpp
changeset 9057 903f50e85144
parent 9033 b0ed8608303f
child 9063 5cab446e1341
equal deleted inserted replaced
9056:79ca70a295ac 9057:903f50e85144
   151 
   151 
   152     ui.pageOptions->CBResolution->addItems(SDLInteraction::instance().getResolutions());
   152     ui.pageOptions->CBResolution->addItems(SDLInteraction::instance().getResolutions());
   153 
   153 
   154     config = new GameUIConfig(this, DataManager::instance().settingsFileName());
   154     config = new GameUIConfig(this, DataManager::instance().settingsFileName());
   155     frontendEffects = config->value("frontend/effects", true).toBool();
   155     frontendEffects = config->value("frontend/effects", true).toBool();
   156     playerHash = QString(QCryptographicHash::hash(config->value("net/nick","").toString().toUtf8(), QCryptographicHash::Md5).toHex());
   156     playerHash = QString(QCryptographicHash::hash(config->value("net/nick",tr("Guest")+QString("%1").arg(rand())).toString().toUtf8(), QCryptographicHash::Md5).toHex());
   157 
   157 
   158     ui.pageRoomsList->setSettings(config);
   158     ui.pageRoomsList->setSettings(config);
   159     ui.pageNetGame->setSettings(config);
   159     ui.pageNetGame->setSettings(config);
   160     ui.pageNetGame->chatWidget->setSettings(config);
   160     ui.pageNetGame->chatWidget->setSettings(config);
   161     ui.pageRoomsList->chatWidget->setSettings(config);
   161     ui.pageRoomsList->chatWidget->setSettings(config);
   468 {
   468 {
   469     QStringList teamslist = config->GetTeamsList();
   469     QStringList teamslist = config->GetTeamsList();
   470 
   470 
   471     if(teamslist.empty())
   471     if(teamslist.empty())
   472     {
   472     {
   473         QString currentNickName = config->value("net/nick","").toString().toUtf8();
   473         QString currentNickName = config->value("net/nick",tr("Guest")+QString("%1").arg(rand())).toString().toUtf8();
   474         QString teamName;
   474         QString teamName;
   475 
   475 
   476         if (currentNickName.isEmpty())
   476         if (currentNickName.isEmpty())
   477         {
   477         {
   478             teamName = tr("DefaultTeam");
   478             teamName = tr("DefaultTeam");
  1377     //nick and pass stuff
  1377     //nick and pass stuff
  1378     hwnet->m_private_game = !(hostName == NETGAME_DEFAULT_SERVER && port == NETGAME_DEFAULT_PORT);
  1378     hwnet->m_private_game = !(hostName == NETGAME_DEFAULT_SERVER && port == NETGAME_DEFAULT_PORT);
  1379     if (hwnet->m_private_game == false && AskForNickAndPwd() != 0)
  1379     if (hwnet->m_private_game == false && AskForNickAndPwd() != 0)
  1380         return;
  1380         return;
  1381 
  1381 
  1382     QString nickname = config->value("net/nick", "").toString();
  1382     QString nickname = config->value("net/nick",tr("Guest")+QString("%1").arg(rand())).toString();
  1383     ui.pageRoomsList->setUser(nickname);
  1383     ui.pageRoomsList->setUser(nickname);
  1384     ui.pageNetGame->setUser(nickname);
  1384     ui.pageNetGame->setUser(nickname);
  1385 
  1385 
  1386     hwnet->Connect(hostName, port, nickname);
  1386     hwnet->Connect(hostName, port, nickname);
  1387 }
  1387 }
  1396     QString temphash;
  1396     QString temphash;
  1397     QString nickname;
  1397     QString nickname;
  1398     QString password;
  1398     QString password;
  1399 
  1399 
  1400     do {
  1400     do {
  1401         nickname = config->value("net/nick", "").toString();
  1401         nickname = config->value("net/nick",tr("Guest")+QString("%1").arg(rand())).toString();
  1402         hash = config->passwordHash();
  1402         hash = config->passwordHash();
  1403         temphash = config->tempHash();
  1403         temphash = config->tempHash();
  1404 
  1404 
  1405         //if something from login is missing, start dialog loop
  1405         //if something from login is missing, start dialog loop
  1406         if (nickname.isEmpty() || hash.isEmpty()) {
  1406         if (nickname.isEmpty() || hash.isEmpty()) {