Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
04a96be8
Commit
04a96be8
authored
May 27, 2011
by
Max-Wilhelm Bruker
Browse files
fixed doesntUntap bug (with protocol change)
parent
808d2a3c
Changes
6
Show whitespace changes
Inline
Side-by-side
cockatrice/src/carditem.cpp
View file @
04a96be8
...
...
@@ -380,6 +380,7 @@ void CardItem::processCardInfo(ServerInfo_Card *info)
setColor
(
info
->
getColor
());
setTapped
(
info
->
getTapped
());
setDestroyOnZoneChange
(
info
->
getDestroyOnZoneChange
());
setDoesntUntap
(
info
->
getDoesntUntap
());
}
CardDragItem
*
CardItem
::
createDragItem
(
int
_id
,
const
QPointF
&
_pos
,
const
QPointF
&
_scenePos
,
bool
faceDown
)
...
...
common/protocol_datastructures.cpp
View file @
04a96be8
...
...
@@ -115,7 +115,7 @@ ServerInfo_CardCounter::ServerInfo_CardCounter(int _id, int _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"
)
{
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
(
"annotation"
,
_annotation
));
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_String
(
"attach_zone"
,
_attachZone
));
insertItem
(
new
SerializableItem_Int
(
"attach_card_id"
,
_attachCardId
));
...
...
common/protocol_datastructures.h
View file @
04a96be8
...
...
@@ -118,7 +118,7 @@ public:
class
ServerInfo_Card
:
public
SerializableItem_Map
{
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
;
}
int
getId
()
const
{
return
static_cast
<
SerializableItem_Int
*>
(
itemMap
.
value
(
"id"
))
->
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
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
getDoesntUntap
()
const
{
return
static_cast
<
SerializableItem_Bool
*>
(
itemMap
.
value
(
"doesnt_untap"
))
->
getData
();
}
QList
<
ServerInfo_CardCounter
*>
getCounters
()
const
{
return
typecastItemList
<
ServerInfo_CardCounter
*>
();
}
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
();
}
...
...
common/server_game.cpp
View file @
04a96be8
...
...
@@ -415,7 +415,7 @@ QList<ServerInfo_Player *> Server_Game::getGameState(Server_Player *playerWhosAs
attachZone
=
card
->
getParentCard
()
->
getZone
()
->
getName
();
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
));
...
...
common/server_protocolhandler.cpp
View file @
04a96be8
...
...
@@ -1139,7 +1139,7 @@ ResponseCode Server_ProtocolHandler::cmdDumpZone(Command_DumpZone *cmd, CommandC
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
)
{
...
...
@@ -1227,8 +1227,8 @@ ResponseCode Server_ProtocolHandler::cmdRevealCards(Command_RevealCards *cmd, Co
}
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
));
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
));
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
(),
card
->
getDoesntUntap
(),
cardCounterListOmniscient
,
attachPlayerId
,
attachZone
,
attachCardId
));
}
if
(
cmd
->
getPlayerId
()
==
-
1
)
...
...
servatrice/src/servatrice.cpp
View file @
04a96be8
...
...
@@ -376,4 +376,4 @@ void Servatrice::statusUpdate()
execSqlQuery
(
query
);
}
const
QString
Servatrice
::
versionString
=
"Servatrice 0.20110
421
"
;
const
QString
Servatrice
::
versionString
=
"Servatrice 0.20110
527
"
;
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment