This commit is contained in:
ctrlaltca 2017-04-29 12:21:37 +02:00 committed by GitHub
parent 12c9e4b81a
commit b20c60e603
2 changed files with 7 additions and 7 deletions

View file

@ -525,10 +525,10 @@ Response::ResponseCode Server_Player::moveCard(GameEventStorage &ges, Server_Car
ges.enqueueGameEvent(eventOthers, playerId, GameEventStorageItem::SendToOthers); ges.enqueueGameEvent(eventOthers, playerId, GameEventStorageItem::SendToOthers);
if (thisCardProperties->tapped()) if (thisCardProperties->tapped())
setCardAttrHelper(ges, targetzone->getName(), card->getId(), AttrTapped, "1"); setCardAttrHelper(ges, targetzone->getPlayer()->getPlayerId(), targetzone->getName(), card->getId(), AttrTapped, "1");
QString ptString = QString::fromStdString(thisCardProperties->pt()); QString ptString = QString::fromStdString(thisCardProperties->pt());
if (!ptString.isEmpty() && !faceDown) if (!ptString.isEmpty() && !faceDown)
setCardAttrHelper(ges, targetzone->getName(), card->getId(), AttrPT, ptString); setCardAttrHelper(ges, targetzone->getPlayer()->getPlayerId(), targetzone->getName(), card->getId(), AttrPT, ptString);
} }
if (startzone->getAlwaysRevealTopCard() && !startzone->getCards().isEmpty() && (originalPosition == 0)) { if (startzone->getAlwaysRevealTopCard() && !startzone->getCards().isEmpty() && (originalPosition == 0)) {
Event_RevealCards revealEvent; Event_RevealCards revealEvent;
@ -578,7 +578,7 @@ void Server_Player::unattachCard(GameEventStorage &ges, Server_Card *card)
parentCard->getZone()->updateCardCoordinates(parentCard, parentCard->getX(), parentCard->getY()); parentCard->getZone()->updateCardCoordinates(parentCard, parentCard->getX(), parentCard->getY());
} }
Response::ResponseCode Server_Player::setCardAttrHelper(GameEventStorage &ges, const QString &zoneName, int cardId, CardAttribute attribute, const QString &attrValue) Response::ResponseCode Server_Player::setCardAttrHelper(GameEventStorage &ges, int targetPlayerId, const QString &zoneName, int cardId, CardAttribute attribute, const QString &attrValue)
{ {
Server_CardZone *zone = getZones().value(zoneName); Server_CardZone *zone = getZones().value(zoneName);
if (!zone) if (!zone)
@ -609,7 +609,7 @@ Response::ResponseCode Server_Player::setCardAttrHelper(GameEventStorage &ges, c
event.set_card_id(cardId); event.set_card_id(cardId);
event.set_attribute(attribute); event.set_attribute(attribute);
event.set_attr_value(result.toStdString()); event.set_attr_value(result.toStdString());
ges.enqueueGameEvent(event, playerId); ges.enqueueGameEvent(event, targetPlayerId);
return Response::RespOk; return Response::RespOk;
} }
@ -1224,7 +1224,7 @@ Response::ResponseCode Server_Player::cmdSetCardAttr(const Command_SetCardAttr &
if (conceded) if (conceded)
return Response::RespContextError; return Response::RespContextError;
return setCardAttrHelper(ges, QString::fromStdString(cmd.zone()), cmd.card_id(), cmd.attribute(), QString::fromStdString(cmd.attr_value())); return setCardAttrHelper(ges, playerId, 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) Response::ResponseCode Server_Player::cmdSetCardCounter(const Command_SetCardCounter &cmd, ResponseContainer & /*rc*/, GameEventStorage &ges)

View file

@ -121,7 +121,7 @@ public:
Response::ResponseCode drawCards(GameEventStorage &ges, int number); Response::ResponseCode drawCards(GameEventStorage &ges, int number);
Response::ResponseCode moveCard(GameEventStorage &ges, Server_CardZone *startzone, const QList<const CardToMove *> &_cards, Server_CardZone *targetzone, int x, int y, bool fixFreeSpaces = true, bool undoingDraw = false); Response::ResponseCode moveCard(GameEventStorage &ges, Server_CardZone *startzone, const QList<const CardToMove *> &_cards, Server_CardZone *targetzone, int x, int y, bool fixFreeSpaces = true, bool undoingDraw = false);
void unattachCard(GameEventStorage &ges, Server_Card *card); void unattachCard(GameEventStorage &ges, Server_Card *card);
Response::ResponseCode setCardAttrHelper(GameEventStorage &ges, const QString &zone, int cardId, CardAttribute attribute, const QString &attrValue); Response::ResponseCode setCardAttrHelper(GameEventStorage &ges, int targetPlayerId, const QString &zone, int cardId, CardAttribute attribute, const QString &attrValue);
Response::ResponseCode cmdLeaveGame(const Command_LeaveGame &cmd, ResponseContainer &rc, GameEventStorage &ges); Response::ResponseCode cmdLeaveGame(const Command_LeaveGame &cmd, ResponseContainer &rc, GameEventStorage &ges);
Response::ResponseCode cmdKickFromGame(const Command_KickFromGame &cmd, ResponseContainer &rc, GameEventStorage &ges); Response::ResponseCode cmdKickFromGame(const Command_KickFromGame &cmd, ResponseContainer &rc, GameEventStorage &ges);