Restructured network server.

This commit is contained in:
lotodore
2007-05-14 21:18:24 +00:00
parent 80a11af74c
commit 5f033730da
19 changed files with 103 additions and 338 deletions
+11 -19
View File
@@ -69,7 +69,7 @@ void LocalFlop::flopRun() {
//also gehe in Turn
myHand->setActualRound(2);
//Action lchen und ActionButtons refresh
//Action loeschen und ActionButtons refresh
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
if(myHand->getPlayerArray()[i]->getMyAction() != 1 && myHand->getPlayerArray()[i]->getMyAction() != 6) myHand->getPlayerArray()[i]->setMyAction(0);
}
@@ -94,7 +94,7 @@ void LocalFlop::flopRun() {
}
// nhsten Spieler ermitteln
// naechsten Spieler ermitteln
do { playersTurn = (playersTurn+1)%(MAX_NUMBER_OF_PLAYERS);
} while(!(myHand->getPlayerArray()[playersTurn]->getMyActiveStatus()) || (myHand->getPlayerArray()[playersTurn]->getMyAction())==1 || (myHand->getPlayerArray()[playersTurn]->getMyAction())==6);
@@ -111,24 +111,16 @@ void LocalFlop::flopRun() {
// wenn wir letzter aktiver Spieler vor SmallBlind sind, dann flopFirstRound zuende
if(myHand->getPlayerArray()[playersTurn]->getMyID() == activePlayerBeforeSmallBlind) { firstFlopRound = 0; }
if(myHand->getGuiInterface()->isNetworkServer())
{
myHand->getGuiInterface()->waitForNetworkAction(
GAME_STATE_FLOP, myHand->getPlayerArray()[playersTurn]->getMyUniqueID());
if(playersTurn == 0) {
// Wir sind dran
// cout << "actualRound " << myHand->getActualRound() << endl;
// cout << "highestSet vor meInAction " << highestSet << endl;
myHand->getGuiInterface()->meInAction();
}
else
{
if(playersTurn == 0) {
// Wir sind dran
// cout << "actualRound " << myHand->getActualRound() << endl;
// cout << "highestSet vor meInAction " << highestSet << endl;
myHand->getGuiInterface()->meInAction();
}
else {
//Gegner sind dran
// cout << "NextPlayerSpeed3 start" << endl;
myHand->getGuiInterface()->flopAnimation2();
}
else {
//Gegner sind dran
// cout << "NextPlayerSpeed3 start" << endl;
myHand->getGuiInterface()->flopAnimation2();
}
}
}
+8 -16
View File
@@ -72,7 +72,7 @@ void LocalPreflop::preflopRun() {
//also gehe in Flop
myHand->setActualRound(1);
//Action lchen und ActionButtons refresh
//Action loeschen und ActionButtons refresh
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
if(myHand->getPlayerArray()[i]->getMyAction() != 1 && myHand->getPlayerArray()[i]->getMyAction() != 6) myHand->getPlayerArray()[i]->setMyAction(0);
}
@@ -103,22 +103,14 @@ void LocalPreflop::preflopRun() {
myHand->getPlayerArray()[playersTurn]->setMyTurn(1);
myHand->getGuiInterface()->refreshGroupbox(playersTurn,2);
if(myHand->getGuiInterface()->isNetworkServer())
{
myHand->getGuiInterface()->waitForNetworkAction(
GAME_STATE_PREFLOP, myHand->getPlayerArray()[playersTurn]->getMyUniqueID());
if(playersTurn == 0) {
// Wir sind dran
myHand->getGuiInterface()->meInAction();
}
else
{
if(playersTurn == 0) {
// Wir sind dran
myHand->getGuiInterface()->meInAction();
}
else {
//Gegner sind dran
// cout << "NextPlayerSpeed3 start" << endl;
myHand->getGuiInterface()->preflopAnimation2();
}
else {
//Gegner sind dran
// cout << "NextPlayerSpeed3 start" << endl;
myHand->getGuiInterface()->preflopAnimation2();
}
}
}
+8 -16
View File
@@ -111,23 +111,15 @@ void LocalRiver::riverRun() {
// wenn wir letzter aktiver Spieler vor SmallBlind sind, dann flopFirstRound zuende
if(myHand->getPlayerArray()[playersTurn]->getMyID() == activePlayerBeforeSmallBlind) { firstRiverRound = 0; }
if(myHand->getGuiInterface()->isNetworkServer())
{
myHand->getGuiInterface()->waitForNetworkAction(
GAME_STATE_RIVER, myHand->getPlayerArray()[playersTurn]->getMyUniqueID());
if(playersTurn == 0) {
// Wir sind dran
// cout << "actualRound " << myHand->getActualRound() << endl;
// cout << "highestSet vor meInAction " << highestSet << endl;
myHand->getGuiInterface()->meInAction();
}
else
{
if(playersTurn == 0) {
// Wir sind dran
// cout << "actualRound " << myHand->getActualRound() << endl;
// cout << "highestSet vor meInAction " << highestSet << endl;
myHand->getGuiInterface()->meInAction();
}
else {
//Gegner sind dran
myHand->getGuiInterface()->riverAnimation2();
}
else {
//Gegner sind dran
myHand->getGuiInterface()->riverAnimation2();
}
}
}
+11 -19
View File
@@ -107,29 +107,21 @@ void LocalTurn::turnRun() {
myHand->getPlayerArray()[playersTurn]->setMyTurn(1);
myHand->getGuiInterface()->refreshGroupbox(playersTurn,2);
// cout << "activePlayerBeforeSmallBlind " << activePlayerBeforeSmallBlind << endl;
// cout << "playersTurn " << playersTurn << endl;
// cout << "activePlayerBeforeSmallBlind " << activePlayerBeforeSmallBlind << endl;
// cout << "playersTurn " << playersTurn << endl;
// wenn wir letzter aktiver Spieler vor SmallBlind sind, dann flopFirstRound zuende
if(myHand->getPlayerArray()[playersTurn]->getMyID() == activePlayerBeforeSmallBlind) { firstTurnRound = 0; }
if(myHand->getGuiInterface()->isNetworkServer())
{
myHand->getGuiInterface()->waitForNetworkAction(
GAME_STATE_TURN, myHand->getPlayerArray()[playersTurn]->getMyUniqueID());
if(playersTurn == 0) {
// Wir sind dran
// cout << "actualRound " << myHand->getActualRound() << endl;
// cout << "highestSet vor meInAction " << highestSet << endl;
myHand->getGuiInterface()->meInAction();
}
else
{
if(playersTurn == 0) {
// Wir sind dran
// cout << "actualRound " << myHand->getActualRound() << endl;
// cout << "highestSet vor meInAction " << highestSet << endl;
myHand->getGuiInterface()->meInAction();
}
else {
//Gegner sind dran
// cout << "NextPlayerSpeed3 start" << endl;
myHand->getGuiInterface()->turnAnimation2();
}
else {
//Gegner sind dran
// cout << "NextPlayerSpeed3 start" << endl;
myHand->getGuiInterface()->turnAnimation2();
}
}
}