add delay between hands option for network/internet game

This commit is contained in:
doitux
2009-10-23 23:12:33 +00:00
parent 52e3dba934
commit 857cbf357e
11 changed files with 105 additions and 97 deletions
+2 -1
View File
@@ -406,7 +406,8 @@ unix:!mac {
-lpokerth_protocol -lpokerth_protocol
LIBS += $$BOOST_LIBS LIBS += $$BOOST_LIBS
LIBS += -lSDL_mixer \ LIBS += -lSDL_mixer \
-lcurl -lcurl \
-lgsasl
!isEmpty( BSD ) && isEmpty( kFreeBSD ):LIBS += -lcrypto !isEmpty( BSD ) && isEmpty( kFreeBSD ):LIBS += -lcrypto
else:LIBS += -lgnutls-openssl \ else:LIBS += -lgnutls-openssl \
-lgcrypt -lgcrypt
+1 -1
View File
@@ -241,7 +241,7 @@ unix : !mac {
-lpokerth_db \ -lpokerth_db \
-lpokerth_protocol -lpokerth_protocol
LIBS += $$BOOST_LIBS LIBS += $$BOOST_LIBS
LIBS += -lcurl LIBS += -lcurl -lgsasl
!isEmpty( BSD ) && isEmpty( kFreeBSD ){ !isEmpty( BSD ) && isEmpty( kFreeBSD ){
LIBS += -lcrypto -liconv LIBS += -lcrypto -liconv
} else { } else {
+2 -1
View File
@@ -48,7 +48,7 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly)
myQtToolsInterface = CreateQtToolsWrapper(); myQtToolsInterface = CreateQtToolsWrapper();
// !!!! Revisionsnummer der Configdefaults !!!!! // !!!! Revisionsnummer der Configdefaults !!!!!
configRev = 77; configRev = 78;
//standard defaults //standard defaults
logOnOffDefault = "1"; logOnOffDefault = "1";
@@ -189,6 +189,7 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly)
configList.push_back(ConfigInfo("NetAfterMBAlwaysRaiseValue", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("NetAfterMBAlwaysRaiseValue", CONFIG_TYPE_INT, "0"));
configList.push_back(ConfigInfo("NetAfterMBStayAtLastBlind", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("NetAfterMBStayAtLastBlind", CONFIG_TYPE_INT, "0"));
configList.push_back(ConfigInfo("NetGameSpeed", CONFIG_TYPE_INT, "4")); configList.push_back(ConfigInfo("NetGameSpeed", CONFIG_TYPE_INT, "4"));
configList.push_back(ConfigInfo("NetDelayBetweenHands", CONFIG_TYPE_INT, "7"));
configList.push_back(ConfigInfo("NetTimeOutPlayerAction", CONFIG_TYPE_INT, "20")); configList.push_back(ConfigInfo("NetTimeOutPlayerAction", CONFIG_TYPE_INT, "20"));
configList.push_back(ConfigInfo("ServerPassword", CONFIG_TYPE_STRING, "")); configList.push_back(ConfigInfo("ServerPassword", CONFIG_TYPE_STRING, ""));
configList.push_back(ConfigInfo("ServerUseIpv6", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("ServerUseIpv6", CONFIG_TYPE_INT, "0"));
+53 -52
View File
@@ -110,56 +110,7 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="3" column="0" colspan="3"> <item row="6" column="0" colspan="4">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Game Speed for computer opponents:</string>
</property>
<property name="buddy">
<cstring>spinBox_gameSpeed</cstring>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QSpinBox" name="spinBox_gameSpeed">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>11</number>
</property>
<property name="value">
<number>4</number>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Timeout for player action:</string>
</property>
<property name="buddy">
<cstring>spinBox_netTimeOutPlayerAction</cstring>
</property>
</widget>
</item>
<item row="4" column="2" colspan="2">
<widget class="QSpinBox" name="spinBox_netTimeOutPlayerAction">
<property name="suffix">
<string> s</string>
</property>
<property name="minimum">
<number>5</number>
</property>
<property name="maximum">
<number>60</number>
</property>
<property name="value">
<number>20</number>
</property>
</widget>
</item>
<item row="5" column="0" colspan="4">
<layout class="QHBoxLayout"> <layout class="QHBoxLayout">
<property name="spacing"> <property name="spacing">
<number>6</number> <number>6</number>
@@ -186,6 +137,58 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Timeout for player action:</string>
</property>
<property name="buddy">
<cstring>spinBox_netTimeOutPlayerAction</cstring>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Delay between hands:</string>
</property>
<property name="buddy">
<cstring>spinBox_netDelayBetweenHands</cstring>
</property>
</widget>
</item>
<item row="3" column="2" colspan="2">
<widget class="QSpinBox" name="spinBox_netTimeOutPlayerAction">
<property name="suffix">
<string> s</string>
</property>
<property name="minimum">
<number>5</number>
</property>
<property name="maximum">
<number>60</number>
</property>
<property name="value">
<number>20</number>
</property>
</widget>
</item>
<item row="4" column="2" colspan="2">
<widget class="QSpinBox" name="spinBox_netDelayBetweenHands">
<property name="suffix">
<string> s</string>
</property>
<property name="minimum">
<number>5</number>
</property>
<property name="maximum">
<number>20</number>
</property>
<property name="value">
<number>7</number>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
@@ -233,8 +236,6 @@
<tabstop>spinBox_startCash</tabstop> <tabstop>spinBox_startCash</tabstop>
<tabstop>radioButton_useSavedBlindsSettings</tabstop> <tabstop>radioButton_useSavedBlindsSettings</tabstop>
<tabstop>radioButton_changeBlindsSettings</tabstop> <tabstop>radioButton_changeBlindsSettings</tabstop>
<tabstop>spinBox_gameSpeed</tabstop>
<tabstop>spinBox_netTimeOutPlayerAction</tabstop>
<tabstop>checkBox_Password</tabstop> <tabstop>checkBox_Password</tabstop>
<tabstop>lineEdit_Password</tabstop> <tabstop>lineEdit_Password</tabstop>
<tabstop>pushButton_createGame</tabstop> <tabstop>pushButton_createGame</tabstop>
@@ -67,8 +67,7 @@ void createInternetGameDialogImpl::fillFormular() {
//Network Game Settings //Network Game Settings
spinBox_quantityPlayers->setValue(myConfig->readConfigInt("NetNumberOfPlayers")); spinBox_quantityPlayers->setValue(myConfig->readConfigInt("NetNumberOfPlayers"));
spinBox_startCash->setValue(myConfig->readConfigInt("NetStartCash")); spinBox_startCash->setValue(myConfig->readConfigInt("NetStartCash"));
//temporarely unused until ai is enabled in network spinBox_netDelayBetweenHands->setValue(myConfig->readConfigInt("NetDelayBetweenHands"));
spinBox_gameSpeed->setValue(myConfig->readConfigInt("NetGameSpeed"));
spinBox_netTimeOutPlayerAction->setValue(myConfig->readConfigInt("NetTimeOutPlayerAction")); spinBox_netTimeOutPlayerAction->setValue(myConfig->readConfigInt("NetTimeOutPlayerAction"));
checkBox_Password->setChecked(myConfig->readConfigInt("UseInternetGamePassword")); checkBox_Password->setChecked(myConfig->readConfigInt("UseInternetGamePassword"));
if(myConfig->readConfigInt("UseInternetGamePassword")) { if(myConfig->readConfigInt("UseInternetGamePassword")) {
+28 -27
View File
@@ -104,30 +104,7 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="3" column="0" colspan="3"> <item row="4" column="0" colspan="3">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Game Speed for computer opponents:</string>
</property>
<property name="buddy">
<cstring>spinBox_gameSpeed</cstring>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QSpinBox" name="spinBox_gameSpeed">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>11</number>
</property>
<property name="value">
<number>4</number>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QLabel" name="label_6"> <widget class="QLabel" name="label_6">
<property name="text"> <property name="text">
<string>Timeout for player action:</string> <string>Timeout for player action:</string>
@@ -137,7 +114,17 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="2" colspan="2"> <item row="5" column="0" colspan="3">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Delay between hands:</string>
</property>
<property name="buddy">
<cstring>spinBox_netDelayBetweenHands</cstring>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QSpinBox" name="spinBox_netTimeOutPlayerAction"> <widget class="QSpinBox" name="spinBox_netTimeOutPlayerAction">
<property name="suffix"> <property name="suffix">
<string> s</string> <string> s</string>
@@ -153,6 +140,22 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="3">
<widget class="QSpinBox" name="spinBox_netDelayBetweenHands">
<property name="suffix">
<string> s</string>
</property>
<property name="minimum">
<number>5</number>
</property>
<property name="maximum">
<number>20</number>
</property>
<property name="value">
<number>7</number>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
@@ -200,8 +203,6 @@
<tabstop>spinBox_startCash</tabstop> <tabstop>spinBox_startCash</tabstop>
<tabstop>radioButton_useSavedBlindsSettings</tabstop> <tabstop>radioButton_useSavedBlindsSettings</tabstop>
<tabstop>radioButton_changeBlindsSettings</tabstop> <tabstop>radioButton_changeBlindsSettings</tabstop>
<tabstop>spinBox_gameSpeed</tabstop>
<tabstop>spinBox_netTimeOutPlayerAction</tabstop>
<tabstop>pushButton_createGame</tabstop> <tabstop>pushButton_createGame</tabstop>
<tabstop>pushButton_cancel</tabstop> <tabstop>pushButton_cancel</tabstop>
</tabstops> </tabstops>
@@ -66,8 +66,7 @@ void createNetworkGameDialogImpl::fillFormular() {
//Network Game Settings //Network Game Settings
spinBox_quantityPlayers->setValue(myConfig->readConfigInt("NetNumberOfPlayers")); spinBox_quantityPlayers->setValue(myConfig->readConfigInt("NetNumberOfPlayers"));
spinBox_startCash->setValue(myConfig->readConfigInt("NetStartCash")); spinBox_startCash->setValue(myConfig->readConfigInt("NetStartCash"));
//temporarely unused until ai is enabled in network spinBox_netDelayBetweenHands->setValue(myConfig->readConfigInt("NetDelayBetweenHands"));
spinBox_gameSpeed->setValue(myConfig->readConfigInt("NetGameSpeed"));
spinBox_netTimeOutPlayerAction->setValue(myConfig->readConfigInt("NetTimeOutPlayerAction")); spinBox_netTimeOutPlayerAction->setValue(myConfig->readConfigInt("NetTimeOutPlayerAction"));
//fill changeCompleteBlindsDialog //fill changeCompleteBlindsDialog
@@ -176,7 +176,7 @@ void gameLobbyDialogImpl::createGame()
} }
} }
gameData.guiSpeed = myCreateInternetGameDialog->spinBox_gameSpeed->value(); gameData.guiSpeed = myConfig->readConfigInt("GameSpeed");
gameData.playerActionTimeoutSec = myCreateInternetGameDialog->spinBox_netTimeOutPlayerAction->value(); gameData.playerActionTimeoutSec = myCreateInternetGameDialog->spinBox_netTimeOutPlayerAction->value();
QString gameString(tr("%1's game")); QString gameString(tr("%1's game"));
+13 -7
View File
@@ -125,7 +125,7 @@
<item> <item>
<widget class="QStackedWidget" name="stackedWidget"> <widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>4</number>
</property> </property>
<widget class="QWidget" name="page"> <widget class="QWidget" name="page">
<layout class="QGridLayout" name="gridLayout_8"> <layout class="QGridLayout" name="gridLayout_8">
@@ -1294,24 +1294,30 @@ p, li { white-space: pre-wrap; }
<item> <item>
<widget class="QLabel" name="label_36"> <widget class="QLabel" name="label_36">
<property name="text"> <property name="text">
<string>Game Speed for computer opponents:</string> <string>Delay between hands:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>spinBox_netGameSpeed</cstring> <cstring>spinBox_netDelayBetweenHands</cstring>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QSpinBox" name="spinBox_netGameSpeed"> <widget class="QSpinBox" name="spinBox_netDelayBetweenHands">
<property name="suffix">
<string> s</string>
</property>
<property name="minimum"> <property name="minimum">
<number>1</number> <number>5</number>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>11</number> <number>20</number>
</property> </property>
<property name="singleStep"> <property name="singleStep">
<number>1</number> <number>1</number>
</property> </property>
<property name="value">
<number>7</number>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
@@ -3363,7 +3369,7 @@ p, li { white-space: pre-wrap; }
<tabstop>radioButton_netAlwaysDoubleBlinds</tabstop> <tabstop>radioButton_netAlwaysDoubleBlinds</tabstop>
<tabstop>radioButton_netManualBlindsOrder</tabstop> <tabstop>radioButton_netManualBlindsOrder</tabstop>
<tabstop>pushButton_netEditManualBlindsOrder</tabstop> <tabstop>pushButton_netEditManualBlindsOrder</tabstop>
<tabstop>spinBox_netGameSpeed</tabstop> <tabstop>spinBox_netDelayBetweenHands</tabstop>
<tabstop>spinBox_netTimeOutPlayerAction</tabstop> <tabstop>spinBox_netTimeOutPlayerAction</tabstop>
<tabstop>spinBox_serverPort</tabstop> <tabstop>spinBox_serverPort</tabstop>
<tabstop>lineEdit_serverPassword</tabstop> <tabstop>lineEdit_serverPassword</tabstop>
@@ -180,7 +180,7 @@ void settingsDialogImpl::exec() {
spinBox_netRaiseSmallBlindEveryMinutes->setValue(myConfig->readConfigInt("NetRaiseSmallBlindEveryMinutes")); spinBox_netRaiseSmallBlindEveryMinutes->setValue(myConfig->readConfigInt("NetRaiseSmallBlindEveryMinutes"));
radioButton_netAlwaysDoubleBlinds->setChecked(myConfig->readConfigInt("NetAlwaysDoubleBlinds")); radioButton_netAlwaysDoubleBlinds->setChecked(myConfig->readConfigInt("NetAlwaysDoubleBlinds"));
radioButton_netManualBlindsOrder->setChecked(myConfig->readConfigInt("NetManualBlindsOrder")); radioButton_netManualBlindsOrder->setChecked(myConfig->readConfigInt("NetManualBlindsOrder"));
spinBox_netGameSpeed->setValue(myConfig->readConfigInt("NetGameSpeed")); spinBox_netDelayBetweenHands->setValue(myConfig->readConfigInt("NetDelayBetweenHands"));
spinBox_netTimeOutPlayerAction->setValue(myConfig->readConfigInt("NetTimeOutPlayerAction")); spinBox_netTimeOutPlayerAction->setValue(myConfig->readConfigInt("NetTimeOutPlayerAction"));
spinBox_serverPort->setValue(myConfig->readConfigInt("ServerPort")); spinBox_serverPort->setValue(myConfig->readConfigInt("ServerPort"));
lineEdit_serverPassword->setText(QString::fromUtf8(myConfig->readConfigString("ServerPassword").c_str())); lineEdit_serverPassword->setText(QString::fromUtf8(myConfig->readConfigString("ServerPassword").c_str()));
@@ -483,7 +483,7 @@ void settingsDialogImpl::isAccepted() {
myConfig->writeConfigInt("NetRaiseSmallBlindEveryMinutes", spinBox_netRaiseSmallBlindEveryMinutes->value()); myConfig->writeConfigInt("NetRaiseSmallBlindEveryMinutes", spinBox_netRaiseSmallBlindEveryMinutes->value());
myConfig->writeConfigInt("NetAlwaysDoubleBlinds", radioButton_netAlwaysDoubleBlinds->isChecked()); myConfig->writeConfigInt("NetAlwaysDoubleBlinds", radioButton_netAlwaysDoubleBlinds->isChecked());
myConfig->writeConfigInt("NetManualBlindsOrder", radioButton_netManualBlindsOrder->isChecked()); myConfig->writeConfigInt("NetManualBlindsOrder", radioButton_netManualBlindsOrder->isChecked());
myConfig->writeConfigInt("NetGameSpeed", spinBox_netGameSpeed->value()); myConfig->writeConfigInt("NetDelayBetweenHands", spinBox_netDelayBetweenHands->value());
myConfig->writeConfigInt("NetTimeOutPlayerAction", spinBox_netTimeOutPlayerAction->value()); myConfig->writeConfigInt("NetTimeOutPlayerAction", spinBox_netTimeOutPlayerAction->value());
myConfig->writeConfigInt("ServerPort", spinBox_serverPort->value()); myConfig->writeConfigInt("ServerPort", spinBox_serverPort->value());
myConfig->writeConfigString("ServerPassword", lineEdit_serverPassword->text().toUtf8().constData()); myConfig->writeConfigString("ServerPassword", lineEdit_serverPassword->text().toUtf8().constData());
+1 -1
View File
@@ -390,7 +390,7 @@ void startWindowImpl::callCreateNetworkGameDialog() {
} }
} }
gameData.guiSpeed = myCreateNetworkGameDialog->spinBox_gameSpeed->value(); gameData.guiSpeed = myConfig->readConfigInt("GameSpeed");
gameData.playerActionTimeoutSec = myCreateNetworkGameDialog->spinBox_netTimeOutPlayerAction->value(); gameData.playerActionTimeoutSec = myCreateNetworkGameDialog->spinBox_netTimeOutPlayerAction->value();
myGameLobbyDialog->setSession(getSession()); myGameLobbyDialog->setSession(getSession());