mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
servatrice: stub for reveal_card, database changes
This commit is contained in:
parent
03847a9b36
commit
08df264556
5 changed files with 49 additions and 5 deletions
|
|
@ -184,6 +184,8 @@ const ServerSocket::CommandProperties ServerSocket::commandList[ServerSocket::nu
|
|||
{"ready_start", true, true, false, QList<QVariant::Type>(), &ServerSocket::cmdReadyStart},
|
||||
{"shuffle", true, true, true, QList<QVariant::Type>(), &ServerSocket::cmdShuffle},
|
||||
{"draw_cards", true, true, true, QList<QVariant::Type>() << QVariant::Int, &ServerSocket::cmdDrawCards},
|
||||
{"reveal_card", true, true, true, QList<QVariant::Type>() << QVariant::Int
|
||||
<< QVariant::String, &ServerSocket::cmdRevealCard},
|
||||
{"move_card", true, true, true, QList<QVariant::Type>() << QVariant::Int
|
||||
<< QVariant::String
|
||||
<< QVariant::String
|
||||
|
|
@ -337,6 +339,20 @@ ReturnMessage::ReturnCode ServerSocket::cmdDrawCards(const QList<QVariant> ¶
|
|||
return ReturnMessage::ReturnOk;
|
||||
}
|
||||
|
||||
ReturnMessage::ReturnCode ServerSocket::cmdRevealCard(const QList<QVariant> ¶ms)
|
||||
{
|
||||
int cardid = params[0].toInt();
|
||||
PlayerZone *zone = getZone(params[1].toString());
|
||||
if (!zone)
|
||||
return ReturnMessage::ReturnContextError;
|
||||
int position = -1;
|
||||
Card *card = zone->getCard(cardid, false, &position);
|
||||
if (!card)
|
||||
return ReturnMessage::ReturnContextError;
|
||||
emit broadcastEvent(QString("reveal_card|%1|%2|%3").arg(cardid).arg(zone->getName()).arg(card->getName()), this);
|
||||
return ReturnMessage::ReturnOk;
|
||||
}
|
||||
|
||||
ReturnMessage::ReturnCode ServerSocket::cmdMoveCard(const QList<QVariant> ¶ms)
|
||||
{
|
||||
// ID Karte, Startzone, Zielzone, Koordinaten X, Y, Facedown
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue