Human_Player check before join Lobby, Sortable AvailablePlayer List in Lobby

This commit is contained in:
doitux
2007-09-29 09:47:09 +00:00
parent 9d797edcb6
commit 4b56af8c42
6 changed files with 54 additions and 16 deletions
+23 -7
View File
@@ -935,26 +935,42 @@ void mainWindowImpl::callJoinNetworkGameDialog() {
void mainWindowImpl::callGameLobbyDialog() {
//Avoid join Lobby with "Human Player" nick
if(QString::fromUtf8(myConfig->readConfigString("MyName").c_str()) == QString("Human Player")) {
myChangeHumanPlayerNameDialog->label_Message->setText(tr("You cannot join Internet-Game-Lobby with \"Human Player\" as nickname.\nPlease choose another one."));
myChangeHumanPlayerNameDialog->exec();
if(myChangeHumanPlayerNameDialog->result() == QDialog::Accepted) {
joinGameLobby();
}
}
else {
joinGameLobby();
}
}
void mainWindowImpl::joinGameLobby() {
// Join Lobby
mySession->terminateNetworkClient();
if (myServerGuiInterface.get())
myServerGuiInterface->getSession().terminateNetworkServer();
myGameLobbyDialog->setSession(&getSession());
myStartNetworkGameDialog->setSession(&getSession());
myGameLobbyDialog->setSession(&getSession());
myStartNetworkGameDialog->setSession(&getSession());
// Start client for dedicated server.
mySession->startInternetClient();
//Dialog mit Statusbalken
myConnectToServerDialog->exec();
if (myConnectToServerDialog->result() == QDialog::Rejected ) {
mySession->terminateNetworkClient();
}
else
{
myGameLobbyDialog->exec();
if (myGameLobbyDialog->result() == QDialog::Accepted)
{
//some gui modifications