diff --git a/cockatrice/src/carditem.cpp b/cockatrice/src/carditem.cpp index 7ae4a83b..87a617f3 100644 --- a/cockatrice/src/carditem.cpp +++ b/cockatrice/src/carditem.cpp @@ -93,6 +93,8 @@ void CardItem::setAttacking(bool _attacking) void CardItem::setFaceDown(bool _facedown) { facedown = _facedown; + if (facedown) + setName(QString()); update(); } diff --git a/cockatrice/src/cardzone.cpp b/cockatrice/src/cardzone.cpp index ece1cdf4..35e7c07b 100644 --- a/cockatrice/src/cardzone.cpp +++ b/cockatrice/src/cardzone.cpp @@ -47,7 +47,8 @@ void CardZone::mousePressEvent(QGraphicsSceneMouseEvent *event) void CardZone::addCard(CardItem *card, bool reorganize, int x, int y) { if (view) - view->addCard(new CardItem(player->getDb(), card->getName(), card->getId()), reorganize, x, y); + if ((x <= view->getCards().size()) || (view->getNumberCards() == -1)) + view->addCard(new CardItem(player->getDb(), card->getName(), card->getId()), reorganize, x, y); addCardImpl(card, x, y); diff --git a/cockatrice/src/game.cpp b/cockatrice/src/game.cpp index cc163917..af537d9d 100644 --- a/cockatrice/src/game.cpp +++ b/cockatrice/src/game.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "serverplayer.h" #include "game.h" #include "servereventdata.h" @@ -80,19 +81,17 @@ Game::Game(CardDatabase *_db, Client *_client, QGraphicsScene *_scene, QMenu *_a initSayMenu(); aTap = new QAction(tr("&Tap"), this); - connect(aTap, SIGNAL(triggered()), this, SLOT(actTap())); aUntap = new QAction(tr("&Untap"), this); - connect(aUntap, SIGNAL(triggered()), this, SLOT(actUntap())); aDoesntUntap = new QAction(tr("Toggle &normal untapping"), this); - connect(aDoesntUntap, SIGNAL(triggered()), this, SLOT(actDoesntUntap())); aFlip = new QAction(tr("&Flip"), this); - connect(aFlip, SIGNAL(triggered()), this, SLOT(actFlip())); aAddCounter = new QAction(tr("&Add counter"), this); - connect(aAddCounter, SIGNAL(triggered()), this, SLOT(actAddCounter())); aRemoveCounter = new QAction(tr("&Remove counter"), this); - connect(aRemoveCounter, SIGNAL(triggered()), this, SLOT(actRemoveCounter())); aSetCounters = new QAction(tr("&Set counters..."), this); connect(aSetCounters, SIGNAL(triggered()), this, SLOT(actSetCounters())); + aMoveToTopLibrary = new QAction(tr("&top of library"), this); + aMoveToBottomLibrary = new QAction(tr("&bottom of library"), this); + aMoveToGraveyard = new QAction(tr("&graveyard"), this); + aMoveToExile = new QAction(tr("&exile"), this); cardMenu->addAction(aTap); cardMenu->addAction(aUntap); @@ -103,6 +102,30 @@ Game::Game(CardDatabase *_db, Client *_client, QGraphicsScene *_scene, QMenu *_a cardMenu->addAction(aAddCounter); cardMenu->addAction(aRemoveCounter); cardMenu->addAction(aSetCounters); + cardMenu->addSeparator(); + moveMenu = cardMenu->addMenu(tr("&Move to")); + + moveMenu->addAction(aMoveToTopLibrary); + moveMenu->addAction(aMoveToBottomLibrary); + moveMenu->addAction(aMoveToGraveyard); + moveMenu->addAction(aMoveToExile); + + cardMenuHandlers.insert(aTap, &Game::actTap); + cardMenuHandlers.insert(aUntap, &Game::actUntap); + cardMenuHandlers.insert(aDoesntUntap, &Game::actDoesntUntap); + cardMenuHandlers.insert(aFlip, &Game::actFlip); + cardMenuHandlers.insert(aAddCounter, &Game::actAddCounter); + cardMenuHandlers.insert(aRemoveCounter, &Game::actRemoveCounter); + cardMenuHandlers.insert(aMoveToTopLibrary, &Game::actMoveToTopLibrary); + cardMenuHandlers.insert(aMoveToBottomLibrary, &Game::actMoveToBottomLibrary); + cardMenuHandlers.insert(aMoveToGraveyard, &Game::actMoveToGraveyard); + cardMenuHandlers.insert(aMoveToExile, &Game::actMoveToExile); + + QHashIterator i(cardMenuHandlers); + while (i.hasNext()) { + i.next(); + connect(i.key(), SIGNAL(triggered()), this, SLOT(cardMenuAction())); + } dlgStartGame = new DlgStartGame(db); connect(dlgStartGame, SIGNAL(newDeckLoaded(const QStringList &)), client, SLOT(submitDeck(const QStringList &))); @@ -367,63 +390,55 @@ void Game::showCardMenu(QPoint p) cardMenu->exec(p); } -void Game::actTap() +void Game::cardMenuAction() { - QListIterator i(scene->selectedItems()); - while (i.hasNext()) { - CardItem *temp = (CardItem *) i.next(); - if (!temp->getTapped()) - client->setCardAttr(qgraphicsitem_cast(temp->parentItem())->getName(), temp->getId(), "tapped", "1"); + // Determine the appropriate handler function. + CardMenuHandler handler = cardMenuHandlers.value(static_cast(sender())); + + // The list of selected items is randomly shuffled. + QList sel = scene->selectedItems(); + while (!sel.isEmpty()) { + unsigned int i = (unsigned int) (((double) sel.size()) * qrand() / (RAND_MAX + 1.0)); + qDebug(QString("%1 items left, i=%2").arg(sel.size()).arg(i).toLatin1()); + CardItem *card = qgraphicsitem_cast(sel.takeAt(i)); + // For each item, the handler function is called. + (this->*handler)(card); } } -void Game::actUntap() +void Game::actTap(CardItem *card) { - QListIterator i(scene->selectedItems()); - while (i.hasNext()) { - CardItem *temp = (CardItem *) i.next(); - if (temp->getTapped()) - client->setCardAttr(qgraphicsitem_cast(temp->parentItem())->getName(), temp->getId(), "tapped", "0"); - } + if (!card->getTapped()) + client->setCardAttr(qgraphicsitem_cast(card->parentItem())->getName(), card->getId(), "tapped", "1"); } -void Game::actDoesntUntap() +void Game::actUntap(CardItem *card) { - QListIterator i(scene->selectedItems()); - while (i.hasNext()) { - CardItem *temp = (CardItem *) i.next(); - client->setCardAttr(qgraphicsitem_cast(temp->parentItem())->getName(), temp->getId(), "doesnt_untap", QString::number(!temp->getDoesntUntap())); - } + if (card->getTapped()) + client->setCardAttr(qgraphicsitem_cast(card->parentItem())->getName(), card->getId(), "tapped", "0"); } -void Game::actFlip() +void Game::actDoesntUntap(CardItem *card) { - QListIterator i(scene->selectedItems()); - while (i.hasNext()) { - CardItem *temp = (CardItem *) i.next(); - QString zone = qgraphicsitem_cast(temp->parentItem())->getName(); - client->moveCard(temp->getId(), zone, zone, temp->getGridPoint().x(), temp->getGridPoint().y(), !temp->getFaceDown()); - } + client->setCardAttr(qgraphicsitem_cast(card->parentItem())->getName(), card->getId(), "doesnt_untap", QString::number(!card->getDoesntUntap())); } -void Game::actAddCounter() +void Game::actFlip(CardItem *card) { - QListIterator i(scene->selectedItems()); - while (i.hasNext()) { - CardItem *temp = (CardItem *) i.next(); - if (temp->getCounters() < MAX_COUNTERS_ON_CARD) - client->setCardAttr(qgraphicsitem_cast(temp->parentItem())->getName(), temp->getId(), "counters", QString::number(temp->getCounters() + 1)); - } + QString zone = qgraphicsitem_cast(card->parentItem())->getName(); + client->moveCard(card->getId(), zone, zone, card->getGridPoint().x(), card->getGridPoint().y(), !card->getFaceDown()); } -void Game::actRemoveCounter() +void Game::actAddCounter(CardItem *card) { - QListIterator i(scene->selectedItems()); - while (i.hasNext()) { - CardItem *temp = (CardItem *) i.next(); - if (temp->getCounters()) - client->setCardAttr(qgraphicsitem_cast(temp->parentItem())->getName(), temp->getId(), "counters", QString::number(temp->getCounters() - 1)); - } + if (card->getCounters() < MAX_COUNTERS_ON_CARD) + client->setCardAttr(qgraphicsitem_cast(card->parentItem())->getName(), card->getId(), "counters", QString::number(card->getCounters() + 1)); +} + +void Game::actRemoveCounter(CardItem *card) +{ + if (card->getCounters()) + client->setCardAttr(qgraphicsitem_cast(card->parentItem())->getName(), card->getId(), "counters", QString::number(card->getCounters() - 1)); } void Game::actSetCounters() @@ -440,6 +455,30 @@ void Game::actSetCounters() } } +void Game::actMoveToTopLibrary(CardItem *card) +{ + CardZone *startZone = qgraphicsitem_cast(card->parentItem()); + client->moveCard(card->getId(), startZone->getName(), "deck", 0, 0, false); +} + +void Game::actMoveToBottomLibrary(CardItem *card) +{ + CardZone *startZone = qgraphicsitem_cast(card->parentItem()); + client->moveCard(card->getId(), startZone->getName(), "deck", -1, 0, false); +} + +void Game::actMoveToGraveyard(CardItem *card) +{ + CardZone *startZone = qgraphicsitem_cast(card->parentItem()); + client->moveCard(card->getId(), startZone->getName(), "grave", 0, 0, false); +} + +void Game::actMoveToExile(CardItem *card) +{ + CardZone *startZone = qgraphicsitem_cast(card->parentItem()); + client->moveCard(card->getId(), startZone->getName(), "rfg", 0, 0, false); +} + void Game::actSayMessage() { QAction *a = qobject_cast(sender()); diff --git a/cockatrice/src/game.h b/cockatrice/src/game.h index b899f2cb..869aeb83 100644 --- a/cockatrice/src/game.h +++ b/cockatrice/src/game.h @@ -17,8 +17,12 @@ class Game : public QObject { private: static const int phaseCount = 11; - QMenu *actionsMenu, *sayMenu, *cardMenu; + typedef void (Game::*CardMenuHandler)(CardItem *card); + QHash cardMenuHandlers; + + QMenu *actionsMenu, *sayMenu, *cardMenu, *moveMenu; QAction *aTap, *aUntap, *aDoesntUntap, *aFlip, *aAddCounter, *aRemoveCounter, *aSetCounters, + *aMoveToTopLibrary, *aMoveToBottomLibrary, *aMoveToGraveyard, *aMoveToExile, *aNextPhase, *aNextTurn, *aUntapAll, *aDecLife, *aIncLife, *aSetLife, *aShuffle, *aDraw, *aDrawCards, *aRollDice, *aCreateToken; DlgStartGame *dlgStartGame; @@ -32,6 +36,8 @@ private: Player *addPlayer(int playerId, const QString &playerName, QPointF base, bool local); void initSayMenu(); private slots: + void cardMenuAction(); + void actNextPhase(); void actNextTurn(); void actUntapAll(); @@ -45,20 +51,23 @@ private slots: void actCreateToken(); void showCardMenu(QPoint p); - void actDoesntUntap(); - void actFlip(); - void actAddCounter(); - void actRemoveCounter(); + void actTap(CardItem *card); + void actUntap(CardItem *card); + void actDoesntUntap(CardItem *card); + void actFlip(CardItem *card); + void actAddCounter(CardItem *card); + void actRemoveCounter(CardItem *card); void actSetCounters(); + void actMoveToTopLibrary(CardItem *card); + void actMoveToBottomLibrary(CardItem *card); + void actMoveToGraveyard(CardItem *card); + void actMoveToExile(CardItem *card); void actSayMessage(); void gameEvent(const ServerEventData &msg); void playerListReceived(QList playerList); void readyStart(); -public slots: - void actTap(); - void actUntap(); signals: void submitDecklist(); void hoverCard(QString name); diff --git a/cockatrice/src/main.cpp b/cockatrice/src/main.cpp index 109bb0d9..8635cd4a 100644 --- a/cockatrice/src/main.cpp +++ b/cockatrice/src/main.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -66,7 +67,7 @@ int main(int argc, char *argv[]) translator.load(lang); app.installTranslator(&translator); - + qsrand(QDateTime::currentDateTime().toTime_t()); MainWindow ui(&translator); qDebug("main(): MainWindow constructor finished"); diff --git a/cockatrice/src/messagelogwidget.cpp b/cockatrice/src/messagelogwidget.cpp index 056f0933..15335d16 100644 --- a/cockatrice/src/messagelogwidget.cpp +++ b/cockatrice/src/messagelogwidget.cpp @@ -186,7 +186,7 @@ void MessageLogWidget::logSetDoesntUntap(Player *player, QString cardName, bool void MessageLogWidget::logDumpZone(Player *player, QString zoneName, QString zoneOwner, int numberCards) { - if (numberCards) + if (numberCards != -1) append(tr("%1 is looking at the top %2 cards of %3's %4").arg(sanitizeHtml(player->getName())).arg(numberCards).arg(zoneOwner).arg(zoneName)); else append(tr("%1 is looking at %2's %3").arg(sanitizeHtml(player->getName())).arg(zoneOwner).arg(zoneName)); diff --git a/cockatrice/src/player.cpp b/cockatrice/src/player.cpp index 77c2f6dc..5e063aa4 100644 --- a/cockatrice/src/player.cpp +++ b/cockatrice/src/player.cpp @@ -86,7 +86,7 @@ void Player::actMoveHandToBottomLibrary() void Player::actViewLibrary() { - emit toggleZoneView(this, "deck", 0); + emit toggleZoneView(this, "deck", -1); } void Player::actViewTopCards() @@ -101,17 +101,17 @@ void Player::actViewTopCards() void Player::actViewGraveyard() { - emit toggleZoneView(this, "grave", 0); + emit toggleZoneView(this, "grave", -1); } void Player::actViewRfg() { - emit toggleZoneView(this, "rfg", 0); + emit toggleZoneView(this, "rfg", -1); } void Player::actViewSideboard() { - emit toggleZoneView(this, "sb", 0); + emit toggleZoneView(this, "sb", -1); } void Player::addZone(CardZone *z) diff --git a/cockatrice/src/zoneviewwidget.cpp b/cockatrice/src/zoneviewwidget.cpp index ceaec6a4..298ab816 100644 --- a/cockatrice/src/zoneviewwidget.cpp +++ b/cockatrice/src/zoneviewwidget.cpp @@ -14,7 +14,6 @@ ZoneViewWidget::ZoneViewWidget(CardDatabase *_db, Player *_player, CardZone *_or qreal y = 10; if (_origZone->getIsShufflable() && (numberCards == 0)) { - qDebug(QString("ZoneViewWidget: bla!").toLatin1()); shuffleCheckBox = new QCheckBox("shuffle when closing"); shuffleCheckBox->setChecked(true); QGraphicsProxyWidget *shuffleProxy = new QGraphicsProxyWidget(this); diff --git a/cockatrice/src/zoneviewzone.cpp b/cockatrice/src/zoneviewzone.cpp index 02181290..84b405c5 100644 --- a/cockatrice/src/zoneviewzone.cpp +++ b/cockatrice/src/zoneviewzone.cpp @@ -30,7 +30,7 @@ bool ZoneViewZone::initializeCards() return false; const CardList &c = origZone->getCards(); - int number = numberCards == 0 ? c.size() : (numberCards < c.size() ? numberCards : c.size()); + int number = numberCards == -1 ? c.size() : (numberCards < c.size() ? numberCards : c.size()); for (int i = 0; i < number; i++) { CardItem *card = c.at(i); addCard(new CardItem(player->getDb(), card->getName(), card->getId(), this), false, i); diff --git a/cockatrice/src/zoneviewzone.h b/cockatrice/src/zoneviewzone.h index 9d3db9b5..27ee0235 100644 --- a/cockatrice/src/zoneviewzone.h +++ b/cockatrice/src/zoneviewzone.h @@ -15,7 +15,7 @@ private: signals: void removeZoneViewWidget(ZoneViewWidget *zv); public: - ZoneViewZone(Player *_p, CardZone *_origZone, int _numberCards = 0, QGraphicsItem *parent = 0); + ZoneViewZone(Player *_p, CardZone *_origZone, int _numberCards = -1, QGraphicsItem *parent = 0); ~ZoneViewZone(); QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); diff --git a/cockatrice/translations/cockatrice_de.ts b/cockatrice/translations/cockatrice_de.ts index df055ac5..417f12fd 100644 --- a/cockatrice/translations/cockatrice_de.ts +++ b/cockatrice/translations/cockatrice_de.ts @@ -278,131 +278,156 @@ Game - + &Untap all permanents &Enttappe alle bleibenden Karten - + Ctrl+U Ctrl+U - + &Decrement life Lebenspunkt &verringern - + F11 F11 - + &Increment life Lebens&punkt erhöhen - + F12 F12 - + &Set life &Setze Lebenspunkte - + Ctrl+L Ctrl+L - + &Shuffle Mi&schen - + Ctrl+S Ctrl+S - + &Draw a card Karte &ziehen - + Ctrl+D Ctrl+D - + D&raw cards... Ka&rten ziehen... - + Ctrl+E Ctrl+E - + R&oll dice... &Würfeln... - + Ctrl+I Ctrl+I - + &Create token... &Token erstellen... - + Ctrl+T Ctrl+T - + Next &phase Nächste &Phase - + Ctrl+Space Ctrl+Space - + Next &turn Nächster &Zug - + Ctrl+Enter Ctrl+Enter - + Ctrl+Return Ctrl+Return + + + &top of library + &auf die Bibliothek + + + + &bottom of library + &unter die Bibliothek + + + + &graveyard + in den &Friedhof + + + + &exile + ins &Exil + + + + &Move to + &Verschieben + &Edit messages... Mitteilungen &bearbeiten... - + S&ay &Sagen - + &Tap &Tappen @@ -412,27 +437,27 @@ E&nttappen - + Toggle &normal untapping &Normales enttappen umschalten - + &Flip &Umdrehen - + &Add counter Zählm&arke hinzufügen - + &Remove counter Zählma&rke entfernen - + &Set counters... &Setze Zählmarken... @@ -441,78 +466,78 @@ Neu a&rrangieren - + F5 F5 - + F6 F6 - + F7 F7 - + F8 F8 - + F9 F9 - + F10 F10 - + Set life Setze Leben - + New life total: Neues Leben insgesammt: - + Roll dice Würfeln - + Number of sides: Anzahl der Seiten: - + Draw cards Karten ziehen - - + + Number: Anzahl: - + Create token Token erstellen - + Name: Name: - + Set counters Setze Zählmarke diff --git a/cockatrice/translations/cockatrice_en.ts b/cockatrice/translations/cockatrice_en.ts index 14aae681..056d0b71 100644 --- a/cockatrice/translations/cockatrice_en.ts +++ b/cockatrice/translations/cockatrice_en.ts @@ -219,127 +219,127 @@ Game - + &Untap all permanents - + Ctrl+U - + &Decrement life - + F11 - + &Increment life - + F12 - + &Set life - + Ctrl+L - + &Shuffle - + Ctrl+S - + &Draw a card - + Ctrl+D - + D&raw cards... - + Ctrl+E - + R&oll dice... - + Ctrl+I - + &Create token... - + Ctrl+T - + Next &phase - + Ctrl+Space - + Next &turn - + Ctrl+Enter - + Ctrl+Return - + S&ay - + &Tap @@ -349,103 +349,128 @@ - + Toggle &normal untapping - + &Flip - + &Add counter - + &Remove counter - + &Set counters... - + + &top of library + + + + + &bottom of library + + + + + &graveyard + + + + + &exile + + + + + &Move to + + + + F5 - + F6 - + F7 - + F8 - + F9 - + F10 - + Set life - + New life total: - + Roll dice - + Number of sides: - + Draw cards - - + + Number: - + Create token - + Name: - + Set counters diff --git a/servatrice/src/playerzone.cpp b/servatrice/src/playerzone.cpp index 6855d480..abefe617 100644 --- a/servatrice/src/playerzone.cpp +++ b/servatrice/src/playerzone.cpp @@ -22,7 +22,7 @@ #include "card.h" PlayerZone::PlayerZone(const QString &_name, bool _has_coords, ZoneType _type) - : name(_name), has_coords(_has_coords), type(_type), cardsBeingLookedAt(-1) + : name(_name), has_coords(_has_coords), type(_type), cardsBeingLookedAt(0) { } diff --git a/servatrice/src/serversocket.cpp b/servatrice/src/serversocket.cpp index de101f95..d16157e0 100644 --- a/servatrice/src/serversocket.cpp +++ b/servatrice/src/serversocket.cpp @@ -362,28 +362,28 @@ ReturnMessage::ReturnCode ServerSocket::cmdMoveCard(const QList ¶m targetzone->insertCard(card, x, y); + bool targetBeingLookedAt = (targetzone->getType() != PlayerZone::HiddenZone) || (targetzone->getCardsBeingLookedAt() > x) || (targetzone->getCardsBeingLookedAt() == -1); + bool sourceBeingLookedAt = (startzone->getType() != PlayerZone::HiddenZone) || (startzone->getCardsBeingLookedAt() > position) || (startzone->getCardsBeingLookedAt() == -1); + + bool targetHiddenToPlayer = facedown || !targetBeingLookedAt; + bool targetHiddenToOthers = facedown || (targetzone->getType() != PlayerZone::PublicZone); + bool sourceHiddenToPlayer = card->getFaceDown() || !sourceBeingLookedAt; + bool sourceHiddenToOthers = card->getFaceDown() || (startzone->getType() != PlayerZone::PublicZone); + QString privateCardName, publicCardName; + if (!(sourceHiddenToPlayer && targetHiddenToPlayer)) + privateCardName = card->getName(); + if (!(sourceHiddenToOthers && targetHiddenToOthers)) + publicCardName = card->getName(); + if (facedown) card->setId(newCardId()); - if ((!facedown && !card->getFaceDown()) - || (card->getFaceDown() && !facedown && (startzone->getType() == PlayerZone::PublicZone) && (targetzone->getType() == PlayerZone::PublicZone))) - publicCardName = card->getName(); - if ((!facedown && !card->getFaceDown()) - || (card->getFaceDown() && !facedown && (startzone->getType() == PlayerZone::PublicZone) && (targetzone->getType() == PlayerZone::PublicZone)) - || (!facedown && (targetzone->getType() != PlayerZone::PublicZone))) - privateCardName = card->getName(); - card->setFaceDown(facedown); // The player does not get to see which card he moved if it moves between two parts of hidden zones which // are not being looked at. QString privateCardId = QString::number(card->getId()); - if ((targetzone->getType() == PlayerZone::HiddenZone) - && (startzone->getType() == PlayerZone::HiddenZone) - && (startzone->getCardsBeingLookedAt() <= position) - && (startzone->getCardsBeingLookedAt() != 0) - && (targetzone->getCardsBeingLookedAt() <= x) - && (targetzone->getCardsBeingLookedAt() != 0)) { + if (!targetBeingLookedAt && !sourceBeingLookedAt) { privateCardId = QString(); privateCardName = QString(); } @@ -399,9 +399,9 @@ ReturnMessage::ReturnCode ServerSocket::cmdMoveCard(const QList ¶m // Other players do not get to see the start and/or target position of the card if the respective // part of the zone is being looked at. The information is not needed anyway because in hidden zones, // all cards are equal. - if ((startzone->getType() == PlayerZone::HiddenZone) && ((startzone->getCardsBeingLookedAt() > position) || (startzone->getCardsBeingLookedAt() == 0))) + if ((startzone->getType() == PlayerZone::HiddenZone) && ((startzone->getCardsBeingLookedAt() > position) || (startzone->getCardsBeingLookedAt() == -1))) position = -1; - if ((targetzone->getType() == PlayerZone::HiddenZone) && ((targetzone->getCardsBeingLookedAt() > position) || (targetzone->getCardsBeingLookedAt() == 0))) + if ((targetzone->getType() == PlayerZone::HiddenZone) && ((targetzone->getCardsBeingLookedAt() > x) || (targetzone->getCardsBeingLookedAt() == -1))) x = -1; if ((startzone->getType() == PlayerZone::PublicZone) || (targetzone->getType() == PlayerZone::PublicZone)) @@ -558,7 +558,7 @@ ReturnMessage::ReturnCode ServerSocket::cmdDumpZone(const QList ¶m QListIterator card_iterator(zone->cards); QStringList result; - for (int i = 0; card_iterator.hasNext() && (i < number_cards || number_cards == 0); i++) { + for (int i = 0; card_iterator.hasNext() && (i < number_cards || number_cards == -1); i++) { Card *tmp = card_iterator.next(); // XXX Face down cards if (zone->getType() != PlayerZone::HiddenZone) @@ -590,7 +590,7 @@ ReturnMessage::ReturnCode ServerSocket::cmdStopDumpZone(const QList &p return ReturnMessage::ReturnContextError; if (zone->getType() == PlayerZone::HiddenZone) { - zone->setCardsBeingLookedAt(-1); + zone->setCardsBeingLookedAt(0); emit broadcastEvent(QString("stop_dump_zone|%1|%2").arg(player->getPlayerId()).arg(zone->getName()), this); } return ReturnMessage::ReturnOk; @@ -603,7 +603,7 @@ ReturnMessage::ReturnCode ServerSocket::cmdRollDice(const QList ¶m return ReturnMessage::ReturnOk; } -ReturnMessage::ReturnCode ServerSocket::cmdNextTurn(const QList ¶ms) +ReturnMessage::ReturnCode ServerSocket::cmdNextTurn(const QList &/*params*/) { int activePlayer = game->getActivePlayer(); if (++activePlayer == game->getPlayerCount())