fixed doesntUntap bug (with protocol change)
This commit is contained in:
parent
808d2a3c01
commit
04a96be84a
6 changed files with 10 additions and 7 deletions
|
@ -380,6 +380,7 @@ void CardItem::processCardInfo(ServerInfo_Card *info)
|
||||||
setColor(info->getColor());
|
setColor(info->getColor());
|
||||||
setTapped(info->getTapped());
|
setTapped(info->getTapped());
|
||||||
setDestroyOnZoneChange(info->getDestroyOnZoneChange());
|
setDestroyOnZoneChange(info->getDestroyOnZoneChange());
|
||||||
|
setDoesntUntap(info->getDoesntUntap());
|
||||||
}
|
}
|
||||||
|
|
||||||
CardDragItem *CardItem::createDragItem(int _id, const QPointF &_pos, const QPointF &_scenePos, bool faceDown)
|
CardDragItem *CardItem::createDragItem(int _id, const QPointF &_pos, const QPointF &_scenePos, bool faceDown)
|
||||||
|
|
|
@ -115,7 +115,7 @@ ServerInfo_CardCounter::ServerInfo_CardCounter(int _id, int _value)
|
||||||
insertItem(new SerializableItem_Int("value", _value));
|
insertItem(new SerializableItem_Int("value", _value));
|
||||||
}
|
}
|
||||||
|
|
||||||
ServerInfo_Card::ServerInfo_Card(int _id, const QString &_name, int _x, int _y, bool _tapped, bool _attacking, const QString &_color, const QString &_pt, const QString &_annotation, bool _destroyOnZoneChange, const QList<ServerInfo_CardCounter *> &_counters, int _attachPlayerId, const QString &_attachZone, int _attachCardId)
|
ServerInfo_Card::ServerInfo_Card(int _id, const QString &_name, int _x, int _y, bool _tapped, bool _attacking, const QString &_color, const QString &_pt, const QString &_annotation, bool _destroyOnZoneChange, bool _doesntUntap, const QList<ServerInfo_CardCounter *> &_counters, int _attachPlayerId, const QString &_attachZone, int _attachCardId)
|
||||||
: SerializableItem_Map("card")
|
: SerializableItem_Map("card")
|
||||||
{
|
{
|
||||||
insertItem(new SerializableItem_Int("id", _id));
|
insertItem(new SerializableItem_Int("id", _id));
|
||||||
|
@ -128,6 +128,7 @@ ServerInfo_Card::ServerInfo_Card(int _id, const QString &_name, int _x, int _y,
|
||||||
insertItem(new SerializableItem_String("pt", _pt));
|
insertItem(new SerializableItem_String("pt", _pt));
|
||||||
insertItem(new SerializableItem_String("annotation", _annotation));
|
insertItem(new SerializableItem_String("annotation", _annotation));
|
||||||
insertItem(new SerializableItem_Bool("destroy_on_zone_change", _destroyOnZoneChange));
|
insertItem(new SerializableItem_Bool("destroy_on_zone_change", _destroyOnZoneChange));
|
||||||
|
insertItem(new SerializableItem_Bool("doesnt_untap", _doesntUntap));
|
||||||
insertItem(new SerializableItem_Int("attach_player_id", _attachPlayerId));
|
insertItem(new SerializableItem_Int("attach_player_id", _attachPlayerId));
|
||||||
insertItem(new SerializableItem_String("attach_zone", _attachZone));
|
insertItem(new SerializableItem_String("attach_zone", _attachZone));
|
||||||
insertItem(new SerializableItem_Int("attach_card_id", _attachCardId));
|
insertItem(new SerializableItem_Int("attach_card_id", _attachCardId));
|
||||||
|
|
|
@ -118,7 +118,7 @@ public:
|
||||||
|
|
||||||
class ServerInfo_Card : public SerializableItem_Map {
|
class ServerInfo_Card : public SerializableItem_Map {
|
||||||
public:
|
public:
|
||||||
ServerInfo_Card(int _id = -1, const QString &_name = QString(), int _x = -1, int _y = -1, bool _tapped = false, bool _attacking = false, const QString &_color = QString(), const QString &_pt = QString(), const QString &_annotation = QString(), bool _destroyOnZoneChange = false, const QList<ServerInfo_CardCounter *> &_counterList = QList<ServerInfo_CardCounter *>(), int attachPlayerId = -1, const QString &_attachZone = QString(), int attachCardId = -1);
|
ServerInfo_Card(int _id = -1, const QString &_name = QString(), int _x = -1, int _y = -1, bool _tapped = false, bool _attacking = false, const QString &_color = QString(), const QString &_pt = QString(), const QString &_annotation = QString(), bool _destroyOnZoneChange = false, bool _doesntUntap = false, const QList<ServerInfo_CardCounter *> &_counterList = QList<ServerInfo_CardCounter *>(), int attachPlayerId = -1, const QString &_attachZone = QString(), int attachCardId = -1);
|
||||||
static SerializableItem *newItem() { return new ServerInfo_Card; }
|
static SerializableItem *newItem() { return new ServerInfo_Card; }
|
||||||
int getId() const { return static_cast<SerializableItem_Int *>(itemMap.value("id"))->getData(); }
|
int getId() const { return static_cast<SerializableItem_Int *>(itemMap.value("id"))->getData(); }
|
||||||
QString getName() const { return static_cast<SerializableItem_String *>(itemMap.value("name"))->getData(); }
|
QString getName() const { return static_cast<SerializableItem_String *>(itemMap.value("name"))->getData(); }
|
||||||
|
@ -130,6 +130,7 @@ public:
|
||||||
QString getPT() const { return static_cast<SerializableItem_String *>(itemMap.value("pt"))->getData(); }
|
QString getPT() const { return static_cast<SerializableItem_String *>(itemMap.value("pt"))->getData(); }
|
||||||
QString getAnnotation() const { return static_cast<SerializableItem_String *>(itemMap.value("annotation"))->getData(); }
|
QString getAnnotation() const { return static_cast<SerializableItem_String *>(itemMap.value("annotation"))->getData(); }
|
||||||
bool getDestroyOnZoneChange() const { return static_cast<SerializableItem_Bool *>(itemMap.value("destroy_on_zone_change"))->getData(); }
|
bool getDestroyOnZoneChange() const { return static_cast<SerializableItem_Bool *>(itemMap.value("destroy_on_zone_change"))->getData(); }
|
||||||
|
bool getDoesntUntap() const { return static_cast<SerializableItem_Bool *>(itemMap.value("doesnt_untap"))->getData(); }
|
||||||
QList<ServerInfo_CardCounter *> getCounters() const { return typecastItemList<ServerInfo_CardCounter *>(); }
|
QList<ServerInfo_CardCounter *> getCounters() const { return typecastItemList<ServerInfo_CardCounter *>(); }
|
||||||
int getAttachPlayerId() const { return static_cast<SerializableItem_Int *>(itemMap.value("attach_player_id"))->getData(); }
|
int getAttachPlayerId() const { return static_cast<SerializableItem_Int *>(itemMap.value("attach_player_id"))->getData(); }
|
||||||
QString getAttachZone() const { return static_cast<SerializableItem_String *>(itemMap.value("attach_zone"))->getData(); }
|
QString getAttachZone() const { return static_cast<SerializableItem_String *>(itemMap.value("attach_zone"))->getData(); }
|
||||||
|
|
|
@ -415,7 +415,7 @@ QList<ServerInfo_Player *> Server_Game::getGameState(Server_Player *playerWhosAs
|
||||||
attachZone = card->getParentCard()->getZone()->getName();
|
attachZone = card->getParentCard()->getZone()->getName();
|
||||||
attachCardId = card->getParentCard()->getId();
|
attachCardId = card->getParentCard()->getId();
|
||||||
}
|
}
|
||||||
cardList.append(new ServerInfo_Card(card->getId(), displayedName, card->getX(), card->getY(), card->getTapped(), card->getAttacking(), card->getColor(), card->getPT(), card->getAnnotation(), card->getDestroyOnZoneChange(), cardCounterList, attachPlayerId, attachZone, attachCardId));
|
cardList.append(new ServerInfo_Card(card->getId(), displayedName, card->getX(), card->getY(), card->getTapped(), card->getAttacking(), card->getColor(), card->getPT(), card->getAnnotation(), card->getDestroyOnZoneChange(), card->getDoesntUntap(), cardCounterList, attachPlayerId, attachZone, attachCardId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
zoneList.append(new ServerInfo_Zone(zone->getName(), zone->getType(), zone->hasCoords(), zone->cards.size(), cardList));
|
zoneList.append(new ServerInfo_Zone(zone->getName(), zone->getType(), zone->hasCoords(), zone->cards.size(), cardList));
|
||||||
|
|
|
@ -1139,7 +1139,7 @@ ResponseCode Server_ProtocolHandler::cmdDumpZone(Command_DumpZone *cmd, CommandC
|
||||||
attachCardId = card->getParentCard()->getId();
|
attachCardId = card->getParentCard()->getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
respCardList.append(new ServerInfo_Card(card->getId(), displayedName, card->getX(), card->getY(), card->getTapped(), card->getAttacking(), card->getColor(), card->getPT(), card->getAnnotation(), card->getDestroyOnZoneChange(), cardCounterList, attachPlayerId, attachZone, attachCardId));
|
respCardList.append(new ServerInfo_Card(card->getId(), displayedName, card->getX(), card->getY(), card->getTapped(), card->getAttacking(), card->getColor(), card->getPT(), card->getAnnotation(), card->getDestroyOnZoneChange(), card->getDoesntUntap(), cardCounterList, attachPlayerId, attachZone, attachCardId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (zone->getType() == HiddenZone) {
|
if (zone->getType() == HiddenZone) {
|
||||||
|
@ -1227,8 +1227,8 @@ ResponseCode Server_ProtocolHandler::cmdRevealCards(Command_RevealCards *cmd, Co
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmd->getPlayerId() != -1)
|
if (cmd->getPlayerId() != -1)
|
||||||
respCardListPrivate.append(new ServerInfo_Card(card->getId(), card->getName(), card->getX(), card->getY(), card->getTapped(), card->getAttacking(), card->getColor(), card->getPT(), card->getAnnotation(), card->getDestroyOnZoneChange(), cardCounterListPrivate, attachPlayerId, attachZone, attachCardId));
|
respCardListPrivate.append(new ServerInfo_Card(card->getId(), card->getName(), card->getX(), card->getY(), card->getTapped(), card->getAttacking(), card->getColor(), card->getPT(), card->getAnnotation(), card->getDestroyOnZoneChange(), card->getDoesntUntap(), cardCounterListPrivate, attachPlayerId, attachZone, attachCardId));
|
||||||
respCardListOmniscient.append(new ServerInfo_Card(card->getId(), card->getName(), card->getX(), card->getY(), card->getTapped(), card->getAttacking(), card->getColor(), card->getPT(), card->getAnnotation(), card->getDestroyOnZoneChange(), cardCounterListOmniscient, attachPlayerId, attachZone, attachCardId));
|
respCardListOmniscient.append(new ServerInfo_Card(card->getId(), card->getName(), card->getX(), card->getY(), card->getTapped(), card->getAttacking(), card->getColor(), card->getPT(), card->getAnnotation(), card->getDestroyOnZoneChange(), card->getDoesntUntap(), cardCounterListOmniscient, attachPlayerId, attachZone, attachCardId));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmd->getPlayerId() == -1)
|
if (cmd->getPlayerId() == -1)
|
||||||
|
|
|
@ -376,4 +376,4 @@ void Servatrice::statusUpdate()
|
||||||
execSqlQuery(query);
|
execSqlQuery(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString Servatrice::versionString = "Servatrice 0.20110421";
|
const QString Servatrice::versionString = "Servatrice 0.20110527";
|
||||||
|
|
Loading…
Reference in a new issue