Human_Player check before join Lobby, Sortable AvailablePlayer List in Lobby
This commit is contained in:
@@ -55,7 +55,7 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0)
|
|||||||
if(strcmp(argv[i], "--nowriteaccess") == 0) { noWriteAccess = 1; }
|
if(strcmp(argv[i], "--nowriteaccess") == 0) { noWriteAccess = 1; }
|
||||||
}
|
}
|
||||||
// !!!! Revisionsnummer der Configdefaults !!!!!
|
// !!!! Revisionsnummer der Configdefaults !!!!!
|
||||||
configRev = 41;
|
configRev = 42;
|
||||||
|
|
||||||
//standard defaults
|
//standard defaults
|
||||||
logOnOffDefault = "1";
|
logOnOffDefault = "1";
|
||||||
@@ -214,7 +214,7 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0)
|
|||||||
configList.push_back(ConfigInfo("InternetGamePassword", CONFIG_TYPE_STRING, ""));
|
configList.push_back(ConfigInfo("InternetGamePassword", CONFIG_TYPE_STRING, ""));
|
||||||
configList.push_back(ConfigInfo("IRCServerAddress", CONFIG_TYPE_STRING, "chat.freenode.net"));
|
configList.push_back(ConfigInfo("IRCServerAddress", CONFIG_TYPE_STRING, "chat.freenode.net"));
|
||||||
configList.push_back(ConfigInfo("IRCServerPort", CONFIG_TYPE_INT, "6667"));
|
configList.push_back(ConfigInfo("IRCServerPort", CONFIG_TYPE_INT, "6667"));
|
||||||
configList.push_back(ConfigInfo("IRCChannel", CONFIG_TYPE_STRING, "#pokerth"));
|
configList.push_back(ConfigInfo("IRCChannel", CONFIG_TYPE_STRING, "#pokerth-lobby"));
|
||||||
configList.push_back(ConfigInfo("IRCServerUseIpv6", CONFIG_TYPE_INT, "0"));
|
configList.push_back(ConfigInfo("IRCServerUseIpv6", CONFIG_TYPE_INT, "0"));
|
||||||
configList.push_back(ConfigInfo("MyName", CONFIG_TYPE_STRING, "Human Player"));
|
configList.push_back(ConfigInfo("MyName", CONFIG_TYPE_STRING, "Human Player"));
|
||||||
configList.push_back(ConfigInfo("MyAvatar", CONFIG_TYPE_STRING, ""));
|
configList.push_back(ConfigInfo("MyAvatar", CONFIG_TYPE_STRING, ""));
|
||||||
|
|||||||
@@ -13,18 +13,26 @@
|
|||||||
<string>Network Error</string>
|
<string>Network Error</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" >
|
<layout class="QGridLayout" >
|
||||||
<property name="margin" >
|
<property name="leftMargin" >
|
||||||
<number>9</number>
|
<number>9</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing" >
|
<property name="topMargin" >
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin" >
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin" >
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="horizontalSpacing" >
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="verticalSpacing" >
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0" colspan="2" >
|
<item row="0" column="0" colspan="2" >
|
||||||
<widget class="QLabel" name="label_Message" >
|
<widget class="QLabel" name="label_Message" />
|
||||||
<property name="alignment" >
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1" >
|
<item row="1" column="1" >
|
||||||
<widget class="QLineEdit" name="lineEdit" />
|
<widget class="QLineEdit" name="lineEdit" />
|
||||||
|
|||||||
@@ -33,6 +33,15 @@
|
|||||||
<height>16777215</height>
|
<height>16777215</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="indentation" >
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
<property name="rootIsDecorated" >
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="sortingEnabled" >
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
<column>
|
<column>
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>Available Players</string>
|
<string>Available Players</string>
|
||||||
|
|||||||
@@ -68,6 +68,8 @@ void LobbyChat::playerJoined(QString playerName)
|
|||||||
{
|
{
|
||||||
QTreeWidgetItem *item = new QTreeWidgetItem(myLobby->treeWidget_NickList, 0);
|
QTreeWidgetItem *item = new QTreeWidgetItem(myLobby->treeWidget_NickList, 0);
|
||||||
item->setData(0, Qt::DisplayRole, playerName);
|
item->setData(0, Qt::DisplayRole, playerName);
|
||||||
|
|
||||||
|
myLobby->treeWidget_NickList->sortItems(0, Qt::AscendingOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LobbyChat::playerLeft(QString playerName)
|
void LobbyChat::playerLeft(QString playerName)
|
||||||
@@ -75,6 +77,8 @@ void LobbyChat::playerLeft(QString playerName)
|
|||||||
QList<QTreeWidgetItem *> tmpList(myLobby->treeWidget_NickList->findItems(playerName, Qt::MatchExactly));
|
QList<QTreeWidgetItem *> tmpList(myLobby->treeWidget_NickList->findItems(playerName, Qt::MatchExactly));
|
||||||
if (!tmpList.empty())
|
if (!tmpList.empty())
|
||||||
myLobby->treeWidget_NickList->takeTopLevelItem(myLobby->treeWidget_NickList->indexOfTopLevelItem(tmpList.front()));
|
myLobby->treeWidget_NickList->takeTopLevelItem(myLobby->treeWidget_NickList->indexOfTopLevelItem(tmpList.front()));
|
||||||
|
|
||||||
|
myLobby->treeWidget_NickList->sortItems(0, Qt::AscendingOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LobbyChat::displayMessage(QString playerName, QString message) {
|
void LobbyChat::displayMessage(QString playerName, QString message) {
|
||||||
|
|||||||
@@ -935,10 +935,26 @@ void mainWindowImpl::callJoinNetworkGameDialog() {
|
|||||||
|
|
||||||
void mainWindowImpl::callGameLobbyDialog() {
|
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();
|
mySession->terminateNetworkClient();
|
||||||
if (myServerGuiInterface.get())
|
if (myServerGuiInterface.get())
|
||||||
myServerGuiInterface->getSession().terminateNetworkServer();
|
myServerGuiInterface->getSession().terminateNetworkServer();
|
||||||
|
|
||||||
myGameLobbyDialog->setSession(&getSession());
|
myGameLobbyDialog->setSession(&getSession());
|
||||||
myStartNetworkGameDialog->setSession(&getSession());
|
myStartNetworkGameDialog->setSession(&getSession());
|
||||||
|
|
||||||
|
|||||||
@@ -183,6 +183,7 @@ public slots:
|
|||||||
void callCreateNetworkGameDialog();
|
void callCreateNetworkGameDialog();
|
||||||
void callJoinNetworkGameDialog();
|
void callJoinNetworkGameDialog();
|
||||||
void callGameLobbyDialog();
|
void callGameLobbyDialog();
|
||||||
|
void joinGameLobby();
|
||||||
|
|
||||||
void myBetRaise();
|
void myBetRaise();
|
||||||
void myFoldAllin();
|
void myFoldAllin();
|
||||||
|
|||||||
Reference in New Issue
Block a user