diff --git a/cockatrice/src/tab_game.cpp b/cockatrice/src/tab_game.cpp index 0f6cb736..f7411559 100644 --- a/cockatrice/src/tab_game.cpp +++ b/cockatrice/src/tab_game.cpp @@ -729,7 +729,6 @@ void TabGame::processGameEventContainer(const GameEventContainer &cont, Abstract const int eventListSize = cont.event_list_size(); for (int i = 0; i < eventListSize; ++i) { const GameEvent &event = cont.event_list(i); -qDebug() << "[REPLAY]" << QString::fromStdString(event.ShortDebugString()); const int playerId = event.player_id(); const GameEvent::GameEventType eventType = static_cast(getPbExtension(event)); if (spectators.contains(playerId)) { diff --git a/common/server_player.cpp b/common/server_player.cpp index 8229fd66..506c4aa8 100644 --- a/common/server_player.cpp +++ b/common/server_player.cpp @@ -523,12 +523,12 @@ Response::ResponseCode Server_Player::moveCard(GameEventStorage &ges, Server_Car ges.enqueueGameEvent(eventPrivate, playerId, GameEventStorageItem::SendToPrivate, playerId); ges.enqueueGameEvent(eventOthers, playerId, GameEventStorageItem::SendToOthers); - + if (thisCardProperties->tapped()) - setCardAttrHelper(ges, targetzone->getPlayer()->getPlayerId(), targetzone->getName(), card->getId(), AttrTapped, "1"); + setCardAttrHelper(ges, targetzone->getName(), card->getId(), AttrTapped, "1"); QString ptString = QString::fromStdString(thisCardProperties->pt()); if (!ptString.isEmpty() && !faceDown) - setCardAttrHelper(ges, targetzone->getPlayer()->getPlayerId(), targetzone->getName(), card->getId(), AttrPT, ptString); + setCardAttrHelper(ges, targetzone->getName(), card->getId(), AttrPT, ptString); } if (startzone->getAlwaysRevealTopCard() && !startzone->getCards().isEmpty() && (originalPosition == 0)) { Event_RevealCards revealEvent; @@ -578,7 +578,7 @@ void Server_Player::unattachCard(GameEventStorage &ges, Server_Card *card) parentCard->getZone()->updateCardCoordinates(parentCard, parentCard->getX(), parentCard->getY()); } -Response::ResponseCode Server_Player::setCardAttrHelper(GameEventStorage &ges, int targetPlayerId, const QString &zoneName, int cardId, CardAttribute attribute, const QString &attrValue) +Response::ResponseCode Server_Player::setCardAttrHelper(GameEventStorage &ges, const QString &zoneName, int cardId, CardAttribute attribute, const QString &attrValue) { Server_CardZone *zone = getZones().value(zoneName); if (!zone) @@ -609,7 +609,7 @@ Response::ResponseCode Server_Player::setCardAttrHelper(GameEventStorage &ges, i event.set_card_id(cardId); event.set_attribute(attribute); event.set_attr_value(result.toStdString()); - ges.enqueueGameEvent(event, targetPlayerId); + ges.enqueueGameEvent(event, playerId); return Response::RespOk; } @@ -1224,7 +1224,7 @@ Response::ResponseCode Server_Player::cmdSetCardAttr(const Command_SetCardAttr & if (conceded) return Response::RespContextError; - return setCardAttrHelper(ges, playerId, QString::fromStdString(cmd.zone()), cmd.card_id(), cmd.attribute(), QString::fromStdString(cmd.attr_value())); + return setCardAttrHelper(ges, QString::fromStdString(cmd.zone()), cmd.card_id(), cmd.attribute(), QString::fromStdString(cmd.attr_value())); } Response::ResponseCode Server_Player::cmdSetCardCounter(const Command_SetCardCounter &cmd, ResponseContainer & /*rc*/, GameEventStorage &ges) diff --git a/common/server_player.h b/common/server_player.h index 8011bac4..873a4a76 100644 --- a/common/server_player.h +++ b/common/server_player.h @@ -121,7 +121,7 @@ public: Response::ResponseCode drawCards(GameEventStorage &ges, int number); Response::ResponseCode moveCard(GameEventStorage &ges, Server_CardZone *startzone, const QList &_cards, Server_CardZone *targetzone, int x, int y, bool fixFreeSpaces = true, bool undoingDraw = false); void unattachCard(GameEventStorage &ges, Server_Card *card); - Response::ResponseCode setCardAttrHelper(GameEventStorage &ges, int targetPlayerId, const QString &zone, int cardId, CardAttribute attribute, const QString &attrValue); + Response::ResponseCode setCardAttrHelper(GameEventStorage &ges, const QString &zone, int cardId, CardAttribute attribute, const QString &attrValue); Response::ResponseCode cmdLeaveGame(const Command_LeaveGame &cmd, ResponseContainer &rc, GameEventStorage &ges); Response::ResponseCode cmdKickFromGame(const Command_KickFromGame &cmd, ResponseContainer &rc, GameEventStorage &ges);