equal
deleted
inserted
replaced
166 |
166 |
167 ui.pageOptions->CBResolution->addItems(SDLInteraction::instance().getResolutions()); |
167 ui.pageOptions->CBResolution->addItems(SDLInteraction::instance().getResolutions()); |
168 |
168 |
169 config = new GameUIConfig(this, DataManager::instance().settingsFileName()); |
169 config = new GameUIConfig(this, DataManager::instance().settingsFileName()); |
170 frontendEffects = config->value("frontend/effects", true).toBool(); |
170 frontendEffects = config->value("frontend/effects", true).toBool(); |
171 playerHash = QString(QCryptographicHash::hash(config->value("net/nick",tr("Guest")+QString("%1").arg(rand())).toString().toUtf8(), QCryptographicHash::Md5).toHex()); |
171 playerHash = QString(QCryptographicHash::hash(config->value("net/nick", config->getRandomNick()).toString().toUtf8(), QCryptographicHash::Md5).toHex()); |
172 |
172 |
173 // Icons for finished missions |
173 // Icons for finished missions |
174 finishedIcon.addFile(":/res/missionFinished.png", QSize(), QIcon::Normal, QIcon::On); |
174 finishedIcon.addFile(":/res/missionFinished.png", QSize(), QIcon::Normal, QIcon::On); |
175 finishedIcon.addFile(":/res/missionFinishedSelected.png", QSize(), QIcon::Selected, QIcon::On); |
175 finishedIcon.addFile(":/res/missionFinishedSelected.png", QSize(), QIcon::Selected, QIcon::On); |
176 |
176 |
519 { |
519 { |
520 QStringList teamslist = config->GetTeamsList(); |
520 QStringList teamslist = config->GetTeamsList(); |
521 |
521 |
522 if(teamslist.empty()) |
522 if(teamslist.empty()) |
523 { |
523 { |
524 QString currentNickName = config->value("net/nick",tr("Guest")+QString("%1").arg(rand())).toString(); |
524 QString currentNickName = config->value("net/nick", config->getRandomNick()).toString(); |
525 QString teamName; |
525 QString teamName; |
526 int firstHumanTeam = 1; |
526 int firstHumanTeam = 1; |
527 int lastHumanTeam = 2; |
527 int lastHumanTeam = 2; |
528 |
528 |
529 // Default team |
529 // Default team |
1521 //nick and pass stuff |
1521 //nick and pass stuff |
1522 hwnet->m_private_game = !(hostName == NETGAME_DEFAULT_SERVER && port == NETGAME_DEFAULT_PORT); |
1522 hwnet->m_private_game = !(hostName == NETGAME_DEFAULT_SERVER && port == NETGAME_DEFAULT_PORT); |
1523 if (hwnet->m_private_game == false && AskForNickAndPwd() != 0) |
1523 if (hwnet->m_private_game == false && AskForNickAndPwd() != 0) |
1524 return; |
1524 return; |
1525 |
1525 |
1526 QString nickname = config->value("net/nick",tr("Guest")+QString("%1").arg(rand())).toString(); |
1526 QString nickname = config->value("net/nick", config->getRandomNick()).toString(); |
1527 ui.pageRoomsList->setUser(nickname); |
1527 ui.pageRoomsList->setUser(nickname); |
1528 ui.pageNetGame->setUser(nickname); |
1528 ui.pageNetGame->setUser(nickname); |
1529 |
1529 |
1530 hwnet->Connect(hostName, port, nickname); |
1530 hwnet->Connect(hostName, port, nickname); |
1531 } |
1531 } |
1540 QString temphash; |
1540 QString temphash; |
1541 QString nickname; |
1541 QString nickname; |
1542 QString password; |
1542 QString password; |
1543 |
1543 |
1544 do { |
1544 do { |
1545 nickname = config->value("net/nick",tr("Guest")+QString("%1").arg(rand())).toString(); |
1545 nickname = config->value("net/nick", config->getRandomNick()).toString(); |
1546 hash = config->passwordHash(); |
1546 hash = config->passwordHash(); |
1547 temphash = config->tempHash(); |
1547 temphash = config->tempHash(); |
1548 |
1548 |
1549 //if something from login is missing, start dialog loop |
1549 //if something from login is missing, start dialog loop |
1550 if (nickname.isEmpty() || hash.isEmpty()) { |
1550 if (nickname.isEmpty() || hash.isEmpty()) { |