diff --git a/cockatrice/cockatrice.pro b/cockatrice/cockatrice.pro
index d9893b1d..be01da98 100644
--- a/cockatrice/cockatrice.pro
+++ b/cockatrice/cockatrice.pro
@@ -174,7 +174,8 @@ TRANSLATIONS += \
translations/cockatrice_pt.ts \
translations/cockatrice_pt-br.ts \
translations/cockatrice_fr.ts \
- translations/cockatrice_ja.ts
+ translations/cockatrice_ja.ts \
+ translations/cockatrice_ru.ts
win32 {
RC_FILE = cockatrice.rc
}
diff --git a/cockatrice/cockatrice.qrc b/cockatrice/cockatrice.qrc
index 5ed2db25..3e9a550c 100644
--- a/cockatrice/cockatrice.qrc
+++ b/cockatrice/cockatrice.qrc
@@ -24,13 +24,6 @@
resources/icon_search.svg
resources/icon_clearsearch.svg
resources/hr.jpg
- translations/cockatrice_de.qm
- translations/cockatrice_en.qm
- translations/cockatrice_es.qm
- translations/cockatrice_pt.qm
- translations/cockatrice_pt-br.qm
- translations/cockatrice_fr.qm
- translations/cockatrice_ja.qm
resources/appicon.svg
resources/add_to_sideboard.svg
resources/decrement.svg
@@ -44,6 +37,15 @@
resources/icon_player.svg
resources/icon_spectator.svg
+ translations/cockatrice_de.qm
+ translations/cockatrice_en.qm
+ translations/cockatrice_es.qm
+ translations/cockatrice_pt.qm
+ translations/cockatrice_pt-br.qm
+ translations/cockatrice_fr.qm
+ translations/cockatrice_ja.qm
+ translations/cockatrice_ru.qm
+
resources/countries/at.svg
resources/countries/au.svg
resources/countries/be.svg
diff --git a/cockatrice/src/abstractcounter.cpp b/cockatrice/src/abstractcounter.cpp
index aed566c8..864b26b1 100644
--- a/cockatrice/src/abstractcounter.cpp
+++ b/cockatrice/src/abstractcounter.cpp
@@ -97,13 +97,13 @@ void AbstractCounter::mousePressEvent(QGraphicsSceneMouseEvent *event)
event->ignore();
}
-void AbstractCounter::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
+void AbstractCounter::hoverEnterEvent(QGraphicsSceneHoverEvent * /*event*/)
{
hovered = true;
update();
}
-void AbstractCounter::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
+void AbstractCounter::hoverLeaveEvent(QGraphicsSceneHoverEvent * /*event*/)
{
hovered = false;
update();
diff --git a/cockatrice/src/chatview.cpp b/cockatrice/src/chatview.cpp
index a23b5a6e..47724d9d 100644
--- a/cockatrice/src/chatview.cpp
+++ b/cockatrice/src/chatview.cpp
@@ -8,35 +8,37 @@ ChatView::ChatView(const QString &_ownName, QWidget *parent)
: QTextEdit(parent), ownName(_ownName)
{
setTextInteractionFlags(Qt::TextSelectableByMouse);
-
- QTextTableFormat format;
- format.setBorderStyle(QTextFrameFormat::BorderStyle_None);
- table = textCursor().insertTable(1, 3, format);
}
void ChatView::appendMessage(const QString &sender, const QString &message)
{
- QTextCursor cellCursor = table->cellAt(table->rows() - 1, 0).lastCursorPosition();
- cellCursor.insertText(QDateTime::currentDateTime().toString("[hh:mm]"));
- QTextTableCell senderCell = table->cellAt(table->rows() - 1, 1);
+ QTextCursor cursor(document()->lastBlock());
+ cursor.movePosition(QTextCursor::End);
+
+ QTextBlockFormat blockFormat;
+ blockFormat.setBottomMargin(3);
+ cursor.insertBlock(blockFormat);
+
+ QTextCharFormat timeFormat;
+ timeFormat.setForeground(Qt::black);
+ cursor.setCharFormat(timeFormat);
+ cursor.insertText(QDateTime::currentDateTime().toString("[hh:mm] "));
+
QTextCharFormat senderFormat;
if (sender == ownName) {
senderFormat.setFontWeight(QFont::Bold);
senderFormat.setForeground(Qt::red);
} else
senderFormat.setForeground(Qt::blue);
- senderCell.setFormat(senderFormat);
- cellCursor = senderCell.lastCursorPosition();
- cellCursor.insertText(sender);
- QTextTableCell messageCell = table->cellAt(table->rows() - 1, 2);
+ cursor.setCharFormat(senderFormat);
+ cursor.insertText(sender + " ");
+
QTextCharFormat messageFormat;
if (sender.isEmpty())
messageFormat.setForeground(Qt::darkGreen);
- messageCell.setFormat(messageFormat);
- cellCursor = messageCell.lastCursorPosition();
- cellCursor.insertText(message);
+ cursor.setCharFormat(messageFormat);
+ cursor.insertText(message);
- table->appendRows(1);
verticalScrollBar()->setValue(verticalScrollBar()->maximum());
-}
\ No newline at end of file
+}
diff --git a/cockatrice/src/dlg_creategame.cpp b/cockatrice/src/dlg_creategame.cpp
index e36a6815..20775954 100644
--- a/cockatrice/src/dlg_creategame.cpp
+++ b/cockatrice/src/dlg_creategame.cpp
@@ -11,8 +11,8 @@
#include "dlg_creategame.h"
#include "protocol_items.h"
-DlgCreateGame::DlgCreateGame(AbstractClient *_client, int _roomId, QWidget *parent)
- : QDialog(parent), client(_client), roomId(_roomId)
+DlgCreateGame::DlgCreateGame(AbstractClient *_client, int _roomId, const QMap &_gameTypes, QWidget *parent)
+ : QDialog(parent), client(_client), roomId(_roomId), gameTypes(_gameTypes)
{
descriptionLabel = new QLabel(tr("&Description:"));
descriptionEdit = new QLineEdit;
@@ -29,6 +29,17 @@ DlgCreateGame::DlgCreateGame(AbstractClient *_client, int _roomId, QWidget *pare
maxPlayersEdit->setValue(2);
maxPlayersLabel->setBuddy(maxPlayersEdit);
+ QVBoxLayout *gameTypeLayout = new QVBoxLayout;
+ QMapIterator gameTypeIterator(gameTypes);
+ while (gameTypeIterator.hasNext()) {
+ gameTypeIterator.next();
+ QCheckBox *gameTypeCheckBox = new QCheckBox(gameTypeIterator.value());
+ gameTypeLayout->addWidget(gameTypeCheckBox);
+ gameTypeCheckBoxes.insert(gameTypeIterator.key(), gameTypeCheckBox);
+ }
+ QGroupBox *gameTypeGroupBox = new QGroupBox(tr("Game type"));
+ gameTypeGroupBox->setLayout(gameTypeLayout);
+
spectatorsAllowedCheckBox = new QCheckBox(tr("&Spectators allowed"));
spectatorsAllowedCheckBox->setChecked(true);
connect(spectatorsAllowedCheckBox, SIGNAL(stateChanged(int)), this, SLOT(spectatorsAllowedChanged(int)));
@@ -50,7 +61,8 @@ DlgCreateGame::DlgCreateGame(AbstractClient *_client, int _roomId, QWidget *pare
grid->addWidget(passwordEdit, 1, 1);
grid->addWidget(maxPlayersLabel, 2, 0);
grid->addWidget(maxPlayersEdit, 2, 1);
- grid->addWidget(spectatorsGroupBox, 3, 0, 1, 2);
+ grid->addWidget(gameTypeGroupBox, 3, 0, 1, 2);
+ grid->addWidget(spectatorsGroupBox, 4, 0, 1, 2);
okButton = new QPushButton(tr("&OK"));
okButton->setDefault(true);
@@ -76,11 +88,20 @@ DlgCreateGame::DlgCreateGame(AbstractClient *_client, int _roomId, QWidget *pare
void DlgCreateGame::actOK()
{
+ QList gameTypeList;
+ QMapIterator gameTypeCheckBoxIterator(gameTypeCheckBoxes);
+ while (gameTypeCheckBoxIterator.hasNext()) {
+ gameTypeCheckBoxIterator.next();
+ if (gameTypeCheckBoxIterator.value()->isChecked())
+ gameTypeList.append(new GameTypeId(gameTypeCheckBoxIterator.key()));
+ }
+
Command_CreateGame *createCommand = new Command_CreateGame(
roomId,
descriptionEdit->text(),
passwordEdit->text(),
maxPlayersEdit->value(),
+ gameTypeList,
spectatorsAllowedCheckBox->isChecked(),
spectatorsNeedPasswordCheckBox->isChecked(),
spectatorsCanTalkCheckBox->isChecked(),
diff --git a/cockatrice/src/dlg_creategame.h b/cockatrice/src/dlg_creategame.h
index dcd901df..dd68e08e 100644
--- a/cockatrice/src/dlg_creategame.h
+++ b/cockatrice/src/dlg_creategame.h
@@ -14,7 +14,7 @@ class QSpinBox;
class DlgCreateGame : public QDialog {
Q_OBJECT
public:
- DlgCreateGame(AbstractClient *_client, int _roomId, QWidget *parent = 0);
+ DlgCreateGame(AbstractClient *_client, int _roomId, const QMap &_gameTypes, QWidget *parent = 0);
private slots:
void actOK();
void checkResponse(ResponseCode response);
@@ -22,6 +22,8 @@ private slots:
private:
AbstractClient *client;
int roomId;
+ QMap gameTypes;
+ QMap gameTypeCheckBoxes;
QGroupBox *spectatorsGroupBox;
QLabel *descriptionLabel, *passwordLabel, *maxPlayersLabel;
diff --git a/cockatrice/src/gamesmodel.cpp b/cockatrice/src/gamesmodel.cpp
index a448d078..38adbd16 100644
--- a/cockatrice/src/gamesmodel.cpp
+++ b/cockatrice/src/gamesmodel.cpp
@@ -1,6 +1,11 @@
#include "gamesmodel.h"
#include "protocol_datastructures.h"
+GamesModel::GamesModel(const QMap &_gameTypes, QObject *parent)
+ : QAbstractTableModel(parent), gameTypes(_gameTypes)
+{
+}
+
GamesModel::~GamesModel()
{
if (!gameList.isEmpty()) {
@@ -27,9 +32,16 @@ QVariant GamesModel::data(const QModelIndex &index, int role) const
switch (index.column()) {
case 0: return g->getDescription();
case 1: return g->getCreatorInfo()->getName();
- case 2: return g->getHasPassword() ? (g->getSpectatorsNeedPassword() ? tr("yes") : tr("yes, free for spectators")) : tr("no");
- case 3: return QString("%1/%2").arg(g->getPlayerCount()).arg(g->getMaxPlayers());
- case 4: return g->getSpectatorsAllowed() ? QVariant(g->getSpectatorCount()) : QVariant(tr("not allowed"));
+ case 2: {
+ QStringList result;
+ QList gameTypeList = g->getGameTypes();
+ for (int i = 0; i < gameTypeList.size(); ++i)
+ result.append(gameTypes.value(gameTypeList[i]->getData()));
+ return result.join(", ");
+ }
+ case 3: return g->getHasPassword() ? (g->getSpectatorsNeedPassword() ? tr("yes") : tr("yes, free for spectators")) : tr("no");
+ case 4: return QString("%1/%2").arg(g->getPlayerCount()).arg(g->getMaxPlayers());
+ case 5: return g->getSpectatorsAllowed() ? QVariant(g->getSpectatorCount()) : QVariant(tr("not allowed"));
default: return QVariant();
}
}
@@ -41,9 +53,10 @@ QVariant GamesModel::headerData(int section, Qt::Orientation orientation, int ro
switch (section) {
case 0: return tr("Description");
case 1: return tr("Creator");
- case 2: return tr("Password");
- case 3: return tr("Players");
- case 4: return tr("Spectators");
+ case 2: return tr("Game type");
+ case 3: return tr("Password");
+ case 4: return tr("Players");
+ case 5: return tr("Spectators");
default: return QVariant();
}
}
@@ -56,7 +69,11 @@ ServerInfo_Game *GamesModel::getGame(int row)
void GamesModel::updateGameList(ServerInfo_Game *_game)
{
- ServerInfo_Game *game = new ServerInfo_Game(_game->getGameId(), _game->getDescription(), _game->getHasPassword(), _game->getPlayerCount(), _game->getMaxPlayers(), new ServerInfo_User(_game->getCreatorInfo()), _game->getSpectatorsAllowed(), _game->getSpectatorsNeedPassword(), _game->getSpectatorCount());
+ QList gameTypeList, oldGameTypeList = _game->getGameTypes();
+ for (int i = 0; i < oldGameTypeList.size(); ++i)
+ gameTypeList.append(new GameTypeId(oldGameTypeList[i]->getData()));
+
+ ServerInfo_Game *game = new ServerInfo_Game(_game->getGameId(), _game->getDescription(), _game->getHasPassword(), _game->getPlayerCount(), _game->getMaxPlayers(), gameTypeList, new ServerInfo_User(_game->getCreatorInfo()), _game->getSpectatorsAllowed(), _game->getSpectatorsNeedPassword(), _game->getSpectatorCount());
for (int i = 0; i < gameList.size(); i++)
if (gameList[i]->getGameId() == game->getGameId()) {
if (game->getPlayerCount() == 0) {
diff --git a/cockatrice/src/gamesmodel.h b/cockatrice/src/gamesmodel.h
index b9558db2..525d75e6 100644
--- a/cockatrice/src/gamesmodel.h
+++ b/cockatrice/src/gamesmodel.h
@@ -9,8 +9,11 @@ class ServerInfo_Game;
class GamesModel : public QAbstractTableModel {
Q_OBJECT
+private:
+ QList gameList;
+ QMap gameTypes;
public:
- GamesModel(QObject *parent = 0) : QAbstractTableModel(parent) { }
+ GamesModel(const QMap &_gameTypes, QObject *parent = 0);
~GamesModel();
int rowCount(const QModelIndex &parent = QModelIndex()) const { return parent.isValid() ? 0 : gameList.size(); }
int columnCount(const QModelIndex &/*parent*/ = QModelIndex()) const { return 5; }
@@ -19,8 +22,6 @@ public:
ServerInfo_Game *getGame(int row);
void updateGameList(ServerInfo_Game *game);
-private:
- QList gameList;
};
class GamesProxyModel : public QSortFilterProxyModel {
diff --git a/cockatrice/src/localserver.cpp b/cockatrice/src/localserver.cpp
index da403f91..4cadbdf3 100644
--- a/cockatrice/src/localserver.cpp
+++ b/cockatrice/src/localserver.cpp
@@ -5,7 +5,7 @@
LocalServer::LocalServer(QObject *parent)
: Server(parent)
{
- addRoom(new Server_Room(0, QString(), QString(), false, QString(), this));
+ addRoom(new Server_Room(0, QString(), QString(), false, QString(), QStringList(), this));
}
LocalServer::~LocalServer()
diff --git a/cockatrice/src/messagelogwidget.cpp b/cockatrice/src/messagelogwidget.cpp
index d7935435..bb68276e 100644
--- a/cockatrice/src/messagelogwidget.cpp
+++ b/cockatrice/src/messagelogwidget.cpp
@@ -138,6 +138,14 @@ void MessageLogWidget::logDrawCards(Player *player, int number)
append(tr("%1 draws %2 cards.").arg(sanitizeHtml(player->getName())).arg(number));
}
+void MessageLogWidget::logUndoDraw(Player *player, QString cardName)
+{
+ if (cardName.isEmpty())
+ append(tr("%1 undoes his last draw.").arg(sanitizeHtml(player->getName())));
+ else
+ append(tr("%1 undoes his last draw (%2).").arg(sanitizeHtml(player->getName())).arg(sanitizeHtml(cardName)));
+}
+
QPair MessageLogWidget::getFromStr(CardZone *zone, QString cardName, int position) const
{
bool cardNameContainsStartZone = false;
@@ -428,6 +436,7 @@ void MessageLogWidget::connectToPlayer(Player *player)
connect(player, SIGNAL(logDumpZone(Player *, CardZone *, int)), this, SLOT(logDumpZone(Player *, CardZone *, int)));
connect(player, SIGNAL(logStopDumpZone(Player *, CardZone *)), this, SLOT(logStopDumpZone(Player *, CardZone *)));
connect(player, SIGNAL(logDrawCards(Player *, int)), this, SLOT(logDrawCards(Player *, int)));
+ connect(player, SIGNAL(logUndoDraw(Player *, QString)), this, SLOT(logUndoDraw(Player *, QString)));
connect(player, SIGNAL(logRevealCards(Player *, CardZone *, int, QString, Player *)), this, SLOT(logRevealCards(Player *, CardZone *, int, QString, Player *)));
}
diff --git a/cockatrice/src/messagelogwidget.h b/cockatrice/src/messagelogwidget.h
index 2cd2a375..ee1f5e27 100644
--- a/cockatrice/src/messagelogwidget.h
+++ b/cockatrice/src/messagelogwidget.h
@@ -47,6 +47,7 @@ public slots:
void logShuffle(Player *player);
void logRollDie(Player *player, int sides, int roll);
void logDrawCards(Player *player, int number);
+ void logUndoDraw(Player *player, QString cardName);
void logMoveCard(Player *player, QString cardName, CardZone *startZone, int oldX, CardZone *targetZone, int newX);
void logFlipCard(Player *player, QString cardName, bool faceDown);
void logDestroyCard(Player *player, QString cardName);
diff --git a/cockatrice/src/player.cpp b/cockatrice/src/player.cpp
index 359cea4b..13da1d23 100644
--- a/cockatrice/src/player.cpp
+++ b/cockatrice/src/player.cpp
@@ -130,6 +130,8 @@ Player::Player(ServerInfo_User *info, int _id, bool _local, TabGame *_parent)
connect(aDrawCard, SIGNAL(triggered()), this, SLOT(actDrawCard()));
aDrawCards = new QAction(this);
connect(aDrawCards, SIGNAL(triggered()), this, SLOT(actDrawCards()));
+ aUndoDraw = new QAction(this);
+ connect(aUndoDraw, SIGNAL(triggered()), this, SLOT(actUndoDraw()));
aShuffle = new QAction(this);
connect(aShuffle, SIGNAL(triggered()), this, SLOT(actShuffle()));
aMulligan = new QAction(this);
@@ -159,6 +161,7 @@ Player::Player(ServerInfo_User *info, int _id, bool _local, TabGame *_parent)
libraryMenu = playerMenu->addMenu(QString());
libraryMenu->addAction(aDrawCard);
libraryMenu->addAction(aDrawCards);
+ libraryMenu->addAction(aUndoDraw);
libraryMenu->addSeparator();
libraryMenu->addAction(aShuffle);
libraryMenu->addSeparator();
@@ -409,6 +412,7 @@ void Player::retranslateUi()
aViewSideboard->setText(tr("&View sideboard"));
aDrawCard->setText(tr("&Draw card"));
aDrawCards->setText(tr("D&raw cards..."));
+ aUndoDraw->setText(tr("&Undo last draw"));
aMulligan->setText(tr("Take &mulligan"));
aShuffle->setText(tr("&Shuffle"));
aMoveTopCardsToGrave->setText(tr("Move top cards to &graveyard..."));
@@ -447,11 +451,13 @@ void Player::setShortcutsActive()
{
shortcutsActive = true;
+ aViewSideboard->setShortcut(tr("Ctrl+F3"));
aViewLibrary->setShortcut(tr("F3"));
aViewTopCards->setShortcut(tr("Ctrl+W"));
aViewGraveyard->setShortcut(tr("F4"));
aDrawCard->setShortcut(tr("Ctrl+D"));
aDrawCards->setShortcut(tr("Ctrl+E"));
+ aUndoDraw->setShortcut(tr("Ctrl+Shift+D"));
aMulligan->setShortcut(tr("Ctrl+M"));
aShuffle->setShortcut(tr("Ctrl+S"));
aUntapAll->setShortcut(tr("Ctrl+U"));
@@ -468,11 +474,13 @@ void Player::setShortcutsInactive()
{
shortcutsActive = false;
+ aViewSideboard->setShortcut(QKeySequence());
aViewLibrary->setShortcut(QKeySequence());
aViewTopCards->setShortcut(QKeySequence());
aViewGraveyard->setShortcut(QKeySequence());
aDrawCard->setShortcut(QKeySequence());
aDrawCards->setShortcut(QKeySequence());
+ aUndoDraw->setShortcut(QKeySequence());
aMulligan->setShortcut(QKeySequence());
aShuffle->setShortcut(QKeySequence());
aUntapAll->setShortcut(QKeySequence());
@@ -553,6 +561,11 @@ void Player::actDrawCards()
sendGameCommand(new Command_DrawCards(-1, number));
}
+void Player::actUndoDraw()
+{
+ sendGameCommand(new Command_UndoDraw);
+}
+
void Player::actMoveTopCardsToGrave()
{
int number = QInputDialog::getInteger(0, tr("Move top cards to grave"), tr("Number:"));
@@ -791,7 +804,7 @@ void Player::eventStopDumpZone(Event_StopDumpZone *event)
emit logStopDumpZone(this, zone);
}
-void Player::eventMoveCard(Event_MoveCard *event)
+void Player::eventMoveCard(Event_MoveCard *event, GameEventContext *context)
{
CardZone *startZone = zones.value(event->getStartZone(), 0);
Player *targetPlayer = static_cast(parent())->getPlayers().value(event->getTargetPlayerId());
@@ -838,7 +851,13 @@ void Player::eventMoveCard(Event_MoveCard *event)
// The log event has to be sent before the card is added to the target zone
// because the addCard function can modify the card object.
- emit logMoveCard(this, card->getName(), startZone, logPosition, targetZone, logX);
+ if (context)
+ switch (context->getItemId()) {
+ case ItemId_Context_UndoDraw: emit logUndoDraw(this, card->getName()); break;
+ default: ;
+ }
+ else
+ emit logMoveCard(this, card->getName(), startZone, logPosition, targetZone, logX);
targetZone->addCard(card, true, x, y);
@@ -981,25 +1000,25 @@ void Player::processGameEvent(GameEvent *event, GameEventContext *context)
{
qDebug() << "player event: id=" << event->getItemId();
switch (event->getItemId()) {
- case ItemId_Event_Say: eventSay(qobject_cast(event)); break;
- case ItemId_Event_Shuffle: eventShuffle(qobject_cast(event)); break;
- case ItemId_Event_RollDie: eventRollDie(qobject_cast(event)); break;
- case ItemId_Event_CreateArrows: eventCreateArrows(qobject_cast(event)); break;
- case ItemId_Event_DeleteArrow: eventDeleteArrow(qobject_cast(event)); break;
- case ItemId_Event_CreateToken: eventCreateToken(qobject_cast(event)); break;
- case ItemId_Event_SetCardAttr: eventSetCardAttr(qobject_cast(event)); break;
- case ItemId_Event_SetCardCounter: eventSetCardCounter(qobject_cast(event)); break;
- case ItemId_Event_CreateCounters: eventCreateCounters(qobject_cast(event)); break;
- case ItemId_Event_SetCounter: eventSetCounter(qobject_cast(event)); break;
- case ItemId_Event_DelCounter: eventDelCounter(qobject_cast(event)); break;
- case ItemId_Event_DumpZone: eventDumpZone(qobject_cast(event)); break;
- case ItemId_Event_StopDumpZone: eventStopDumpZone(qobject_cast(event)); break;
- case ItemId_Event_MoveCard: eventMoveCard(qobject_cast(event)); break;
- case ItemId_Event_FlipCard: eventFlipCard(qobject_cast(event)); break;
- case ItemId_Event_DestroyCard: eventDestroyCard(qobject_cast(event)); break;
- case ItemId_Event_AttachCard: eventAttachCard(qobject_cast(event)); break;
- case ItemId_Event_DrawCards: eventDrawCards(qobject_cast(event)); break;
- case ItemId_Event_RevealCards: eventRevealCards(qobject_cast(event)); break;
+ case ItemId_Event_Say: eventSay(static_cast(event)); break;
+ case ItemId_Event_Shuffle: eventShuffle(static_cast(event)); break;
+ case ItemId_Event_RollDie: eventRollDie(static_cast(event)); break;
+ case ItemId_Event_CreateArrows: eventCreateArrows(static_cast(event)); break;
+ case ItemId_Event_DeleteArrow: eventDeleteArrow(static_cast(event)); break;
+ case ItemId_Event_CreateToken: eventCreateToken(static_cast(event)); break;
+ case ItemId_Event_SetCardAttr: eventSetCardAttr(static_cast(event)); break;
+ case ItemId_Event_SetCardCounter: eventSetCardCounter(static_cast(event)); break;
+ case ItemId_Event_CreateCounters: eventCreateCounters(static_cast(event)); break;
+ case ItemId_Event_SetCounter: eventSetCounter(static_cast(event)); break;
+ case ItemId_Event_DelCounter: eventDelCounter(static_cast(event)); break;
+ case ItemId_Event_DumpZone: eventDumpZone(static_cast(event)); break;
+ case ItemId_Event_StopDumpZone: eventStopDumpZone(static_cast(event)); break;
+ case ItemId_Event_MoveCard: eventMoveCard(static_cast(event), context); break;
+ case ItemId_Event_FlipCard: eventFlipCard(static_cast(event)); break;
+ case ItemId_Event_DestroyCard: eventDestroyCard(static_cast(event)); break;
+ case ItemId_Event_AttachCard: eventAttachCard(static_cast(event)); break;
+ case ItemId_Event_DrawCards: eventDrawCards(static_cast(event)); break;
+ case ItemId_Event_RevealCards: eventRevealCards(static_cast(event)); break;
default: {
qDebug() << "unhandled game event";
}
diff --git a/cockatrice/src/player.h b/cockatrice/src/player.h
index 49ccab69..5516f2f5 100644
--- a/cockatrice/src/player.h
+++ b/cockatrice/src/player.h
@@ -57,6 +57,7 @@ signals:
void logCreateArrow(Player *player, Player *startPlayer, QString startCard, Player *targetPlayer, QString targetCard, bool _playerTarget);
void logCreateToken(Player *player, QString cardName, QString pt);
void logDrawCards(Player *player, int number);
+ void logUndoDraw(Player *player, QString cardName);
void logMoveCard(Player *player, QString cardName, CardZone *startZone, int oldX, CardZone *targetZone, int newX);
void logFlipCard(Player *player, QString cardName, bool faceDown);
void logDestroyCard(Player *player, QString cardName);
@@ -81,6 +82,7 @@ public slots:
void actShuffle();
void actDrawCard();
void actDrawCards();
+ void actUndoDraw();
void actMulligan();
void actMoveTopCardsToGrave();
void actMoveTopCardsToExile();
@@ -119,7 +121,7 @@ private:
*aMoveRfgToTopLibrary, *aMoveRfgToBottomLibrary, *aMoveRfgToHand, *aMoveRfgToGrave,
*aViewLibrary, *aViewTopCards, *aMoveTopCardsToGrave, *aMoveTopCardsToExile, *aMoveTopCardToBottom,
*aViewGraveyard, *aViewRfg, *aViewSideboard,
- *aDrawCard, *aDrawCards, *aMulligan, *aShuffle,
+ *aDrawCard, *aDrawCards, *aUndoDraw, *aMulligan, *aShuffle,
*aUntapAll, *aRollDie, *aCreateToken, *aCreateAnotherToken,
*aCardMenu;
@@ -167,7 +169,7 @@ private:
void eventDelCounter(Event_DelCounter *event);
void eventDumpZone(Event_DumpZone *event);
void eventStopDumpZone(Event_StopDumpZone *event);
- void eventMoveCard(Event_MoveCard *event);
+ void eventMoveCard(Event_MoveCard *event, GameEventContext *context);
void eventFlipCard(Event_FlipCard *event);
void eventDestroyCard(Event_DestroyCard *event);
void eventAttachCard(Event_AttachCard *event);
diff --git a/cockatrice/src/tab_room.cpp b/cockatrice/src/tab_room.cpp
index 9493cee0..d8f15168 100644
--- a/cockatrice/src/tab_room.cpp
+++ b/cockatrice/src/tab_room.cpp
@@ -17,15 +17,16 @@
#include "gamesmodel.h"
#include "chatview.h"
-GameSelector::GameSelector(AbstractClient *_client, int _roomId, QWidget *parent)
- : QGroupBox(parent), client(_client), roomId(_roomId)
+GameSelector::GameSelector(AbstractClient *_client, TabRoom *_room, QWidget *parent)
+ : QGroupBox(parent), client(_client), room(_room)
{
gameListView = new QTreeView;
- gameListModel = new GamesModel(this);
+ gameListModel = new GamesModel(room->getGameTypes(), this);
gameListProxyModel = new GamesProxyModel(this);
gameListProxyModel->setSourceModel(gameListModel);
gameListView->setModel(gameListProxyModel);
gameListView->header()->setResizeMode(0, QHeaderView::ResizeToContents);
+ gameListView->setSortingEnabled(true);
showFullGamesCheckBox = new QCheckBox;
createButton = new QPushButton;
@@ -61,7 +62,7 @@ void GameSelector::showFullGamesChanged(int state)
void GameSelector::actCreate()
{
- DlgCreateGame dlg(client, roomId, this);
+ DlgCreateGame dlg(client, room->getRoomId(), room->getGameTypes(), this);
dlg.exec();
}
@@ -96,7 +97,7 @@ void GameSelector::actJoin()
return;
}
- Command_JoinGame *commandJoinGame = new Command_JoinGame(roomId, game->getGameId(), password, spectator);
+ Command_JoinGame *commandJoinGame = new Command_JoinGame(room->getRoomId(), game->getGameId(), password, spectator);
connect(commandJoinGame, SIGNAL(finished(ResponseCode)), this, SLOT(checkResponse(ResponseCode)));
client->sendCommand(commandJoinGame);
@@ -122,7 +123,11 @@ void GameSelector::processGameInfo(ServerInfo_Game *info)
TabRoom::TabRoom(AbstractClient *_client, const QString &_ownName, ServerInfo_Room *info)
: Tab(), client(_client), roomId(info->getRoomId()), roomName(info->getName()), ownName(_ownName)
{
- gameSelector = new GameSelector(client, roomId);
+ const QList gameTypeList = info->getGameTypeList();
+ for (int i = 0; i < gameTypeList.size(); ++i)
+ gameTypes.insert(gameTypeList[i]->getGameTypeId(), gameTypeList[i]->getDescription());
+
+ gameSelector = new GameSelector(client, this);
userList = new UserList(client, false);
connect(userList, SIGNAL(openMessageDialog(const QString &, bool)), this, SIGNAL(openMessageDialog(const QString &, bool)));
@@ -226,14 +231,12 @@ void TabRoom::processListGamesEvent(Event_ListGames *event)
void TabRoom::processJoinRoomEvent(Event_JoinRoom *event)
{
- chatView->appendMessage(QString(), tr("%1 has joined the room.").arg(event->getUserInfo()->getName()));
userList->processUserInfo(event->getUserInfo());
userList->sortItems();
}
void TabRoom::processLeaveRoomEvent(Event_LeaveRoom *event)
{
- chatView->appendMessage(QString(), tr("%1 has left the room.").arg(event->getPlayerName()));
userList->deleteUser(event->getPlayerName());
}
diff --git a/cockatrice/src/tab_room.h b/cockatrice/src/tab_room.h
index d9ac35af..331097f2 100644
--- a/cockatrice/src/tab_room.h
+++ b/cockatrice/src/tab_room.h
@@ -23,6 +23,7 @@ class Event_ListGames;
class Event_JoinRoom;
class Event_LeaveRoom;
class Event_RoomSay;
+class TabRoom;
class GameSelector : public QGroupBox {
Q_OBJECT
@@ -35,7 +36,7 @@ signals:
void gameJoined(int gameId);
private:
AbstractClient *client;
- int roomId;
+ TabRoom *room;
QTreeView *gameListView;
GamesModel *gameListModel;
@@ -43,7 +44,7 @@ private:
QPushButton *createButton, *joinButton, *spectateButton;
QCheckBox *showFullGamesCheckBox;
public:
- GameSelector(AbstractClient *_client, int _roomId, QWidget *parent = 0);
+ GameSelector(AbstractClient *_client, TabRoom *_room, QWidget *parent = 0);
void retranslateUi();
void processGameInfo(ServerInfo_Game *info);
};
@@ -55,6 +56,7 @@ private:
int roomId;
QString roomName;
QString ownName;
+ QMap gameTypes;
GameSelector *gameSelector;
UserList *userList;
@@ -82,6 +84,7 @@ public:
void retranslateUi();
void processRoomEvent(RoomEvent *event);
int getRoomId() const { return roomId; }
+ const QMap &getGameTypes() const { return gameTypes; }
QString getChannelName() const { return roomName; }
QString getTabText() const { return roomName; }
};
diff --git a/cockatrice/src/userlist.cpp b/cockatrice/src/userlist.cpp
index dbf8bf6e..353554c6 100644
--- a/cockatrice/src/userlist.cpp
+++ b/cockatrice/src/userlist.cpp
@@ -8,7 +8,7 @@
#include
UserListItemDelegate::UserListItemDelegate(QObject *const parent)
- : QItemDelegate(parent)
+ : QStyledItemDelegate(parent)
{
}
@@ -21,7 +21,7 @@ bool UserListItemDelegate::editorEvent(QEvent *event, QAbstractItemModel *model,
return true;
}
}
- return QItemDelegate::editorEvent(event, model, option, index);
+ return QStyledItemDelegate::editorEvent(event, model, option, index);
}
UserListTWI::UserListTWI()
diff --git a/cockatrice/src/userlist.h b/cockatrice/src/userlist.h
index 86726d67..09b5d888 100644
--- a/cockatrice/src/userlist.h
+++ b/cockatrice/src/userlist.h
@@ -3,13 +3,13 @@
#include
#include
-#include
+#include
class QTreeWidget;
class ServerInfo_User;
class AbstractClient;
-class UserListItemDelegate : public QItemDelegate {
+class UserListItemDelegate : public QStyledItemDelegate {
public:
UserListItemDelegate(QObject *const parent);
bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index);
diff --git a/cockatrice/src/window_main.cpp b/cockatrice/src/window_main.cpp
index 671738a9..35c45db3 100644
--- a/cockatrice/src/window_main.cpp
+++ b/cockatrice/src/window_main.cpp
@@ -113,7 +113,7 @@ void MainWindow::actSinglePlayer()
}
tabSupervisor->startLocal(localClients);
- Command_CreateGame *createCommand = new Command_CreateGame(0, QString(), QString(), numberPlayers, false, false, false, false);
+ Command_CreateGame *createCommand = new Command_CreateGame(0, QString(), QString(), numberPlayers, QList(), false, false, false, false);
mainClient->sendCommand(createCommand);
}
@@ -186,7 +186,10 @@ void MainWindow::socketError(const QString &errorStr)
void MainWindow::protocolVersionMismatch(int localVersion, int remoteVersion)
{
- QMessageBox::critical(this, tr("Error"), tr("Protocol version mismatch. Local version: %1, remote version: %2.").arg(localVersion).arg(remoteVersion));
+ if (localVersion > remoteVersion)
+ QMessageBox::critical(this, tr("Error"), tr("You are trying to connect to an obsolete server. Please downgrade your Cockatrice version or connect to a suitable server.\nLocal version is %1, remote version is %2.").arg(localVersion).arg(remoteVersion));
+ else
+ QMessageBox::critical(this, tr("Error"), tr("Your Cockatrice client is obsolete. Please update your Cockatrice version.\nLocal version is %1, remote version is %2.").arg(localVersion).arg(remoteVersion));
}
void MainWindow::setClientStatusTitle()
diff --git a/cockatrice/translations/cockatrice_de.ts b/cockatrice/translations/cockatrice_de.ts
index fdb3660c..2a208e2a 100644
--- a/cockatrice/translations/cockatrice_de.ts
+++ b/cockatrice/translations/cockatrice_de.ts
@@ -873,12 +873,17 @@
&Spieler:
-
+
+ Game type
+ Spieltyp
+
+
+
&Spectators allowed
&Zuschauer zugelassen
-
+
Spectators &need a password to join
Zuschauer brauchen &auch ein Passwort
@@ -887,37 +892,37 @@
Zuschauer können sp&rechen
-
+
Spectators can &chat
Zuschauer können s&chreiben
-
+
Spectators see &everything
Zuschauer sehen &alles
-
+
Spectators
Zuschauer
-
+
&OK
&OK
-
+
&Cancel
&Abbruch
-
+
Create game
Spiel erstellen
-
+
Error
Fehler
@@ -926,7 +931,7 @@
Ungültige Anzahl an Spielern.
-
+
Server error.
Serverfehler.
@@ -1424,20 +1429,20 @@
GameSelector
-
+
C&reate
Spiel e&rstellen
-
+
&Join
&Teilnehmen
+
+
-
-
Error
Fehler
@@ -1446,42 +1451,42 @@
XXX
-
+
Wrong password.
Falsches Passwort.
-
+
Spectators are not allowed in this game.
In diesem Spiel sind keine Zuschauer zugelassen.
-
+
The game is already full.
Das Spiel ist bereits voll.
-
+
The game does not exist any more.
Dieses Spiel gibt es nicht mehr.
-
+
Join game
Spiel beitreten
-
+
Password:
Passwort:
-
+
Games
Spiele
-
+
Show &full games
&Volle Spiele anzeigen
@@ -1490,7 +1495,7 @@
&Volle Spiele anzeigen
-
+
J&oin as spectator
&Zuschauen
@@ -1506,12 +1511,12 @@
GamesModel
-
+
yes
ja
-
+
no
nein
@@ -1520,37 +1525,42 @@
Spiel ID
-
+
Creator
Ersteller
-
+
Description
Beschreibung
-
+
yes, free for spectators
ja, außer für Zuschauer
-
+
not allowed
nicht erlaubt
-
+
+ Game type
+ Spieltyp
+
+
+
Password
Passwort
-
+
Players
Spieler
-
+
Spectators
Zuschauer
@@ -1673,7 +1683,8 @@
-
+
+
Error
Fehler
@@ -1693,57 +1704,70 @@
Netzwerkfehler: %1
-
- Protocol version mismatch. Local version: %1, remote version: %2.
- Protokollversionen stimmen nicht überein. Lokale Version: %1, Serverversion: %2.
+
+ You are trying to connect to an obsolete server. Please downgrade your Cockatrice version or connect to a suitable server.
+Local version is %1, remote version is %2.
+ Sie versuchen sich an einem veralteten Server anzumelden. Bitte verwenden Sie eine ältere Cockatrice-Version oder melden Sie sich an einem aktuellen Server an.
+Lokale Version ist %1, Serverversion ist %2.
-
+
+ Your Cockatrice client is obsolete. Please update your Cockatrice version.
+Local version is %1, remote version is %2.
+ Ihr Cockatrice-Client ist veraltet. Bitte laden Sie sich die neueste Version herunter.
+Lokale Version ist %1, Serverversion ist %2.
+
+
+ Protocol version mismatch. Local version: %1, remote version: %2.
+ Protokollversionen stimmen nicht überein. Lokale Version: %1, Serverversion: %2.
+
+
+
Connecting to %1...
Verbinde zu %1...
-
+
Disconnected
nicht verbunden
-
+
Logged in at %1
Angemeldet bei %1
-
+
&Connect...
&Verbinden...
-
+
&Disconnect
Verbindung &trennen
-
+
Start &local game...
&Lokales Spiel starten...
-
+
&About Cockatrice
&Über Cockatrice
-
+
&Help
&Hilfe
-
+
Are you sure?
Sind Sie sicher?
-
+
There are still open games. Are you sure you want to quit?
Es gibt noch offene Spiele. Wollen Sie das Programm wirklich beenden?
@@ -1760,27 +1784,27 @@
Spiel ver&lassen
-
+
&Deck editor
&Deck-Editor
-
+
&Full screen
&Vollbild
-
+
Ctrl+F
Ctrl+F
-
+
&Settings...
&Einstellungen...
-
+
&Exit
&Beenden
@@ -1793,7 +1817,7 @@
Esc
-
+
&Cockatrice
&Cockatrice
@@ -1877,8 +1901,8 @@
%1 zieht %2 Karten
-
-
+
+
a card
eine Karte
@@ -2037,167 +2061,177 @@
%1 zieht %2 Karten.
-
+
+ %1 undoes his last draw.
+ %1 legt die zuletzt gezogene Karte zurück.
+
+
+
+ %1 undoes his last draw (%2).
+ %1 legt die zuletzt gezogene Karte zurück (%2).
+
+
+
from table
vom Spielfeld
-
+
from graveyard
aus dem Friedhof
-
+
from exile
aus dem Exil
-
+
from hand
von der Hand
-
+
the bottom card of his library
die unterste Karte seiner Bibliothek
-
+
from the bottom of his library
, die unterste Karte seiner Bibliothek,
-
+
the top card of his library
die oberste Karte seiner Bibliothek
-
+
from the top of his library
, die oberste Karte seiner Bibliothek,
-
+
from library
aus der Bibliothek
-
+
from sideboard
aus dem Sideboard
-
+
from the stack
vom Stapel
-
+
%1 gives %2 control over %3.
%1 überlässt %2 die Kontrolle über %3.
-
+
%1 puts %2 into play%3.
%1 bringt %2%3 ins Spiel.
-
+
%1 puts %2%3 into graveyard.
%1 legt %2%3 auf den Friedhof.
-
+
%1 exiles %2%3.
%1 schickt %2%3 ins Exil.
-
+
%1 moves %2%3 to hand.
%1 nimmt %2%3 auf die Hand.
-
+
%1 puts %2%3 into his library.
%1 legt %2%3 in seine Bibliothek.
-
+
%1 puts %2%3 on bottom of his library.
%1 legt %2%3 unter seine Bibliothek.
-
+
%1 puts %2%3 on top of his library.
%1 legt %2%3 auf die Bibliothek.
-
+
%1 puts %2%3 into his library at position %4.
%1 legt %2%3 in seine Bibliothek an %4. Stelle.
-
+
%1 moves %2%3 to sideboard.
%1 legt %2%3 in sein Sideboard.
-
+
%1 plays %2%3.
%1 spielt %2%3 aus.
-
+
%1 flips %2 face-down.
%1 wendet %2 auf die Rückseite.
-
+
%1 flips %2 face-up.
%1 wendet %2 auf die Vorderseite.
-
+
%1 destroys %2.
%1 zerstört %2.
-
+
%1 attaches %2 to %3's %4.
%1 legt %2 an %3s %4 an.
-
+
%1 unattaches %2.
%1 löst %2 ab.
-
+
%1 creates token: %2%3.
%1 erstellt Token: %2%3.
-
+
%1 points from %2's %3 to %4.
%1 zeigt von %2s %3 auf %4.
-
+
%1 randomly reveals %2%3 to %4.
%1 zeigt %4 zufällig %2%3 vor.
-
+
%1 randomly reveals %2%3.
%1 zeigt zufällig %2%3 offen vor.
-
+
%1 reveals %2%3 to %4.
%1 zeigt %4 %2%3 vor.
-
+
%1 reveals %2%3.
%1 zeigt %2%3 offen vor.
@@ -2206,12 +2240,12 @@
%1 erstellt einen Spielstein: %2 (%3).
-
+
%1 points from %2's %3 to %4's %5.
%1 zeigt von %2s %3 auf %4s %5.
-
+
%1 places %n counter(s) (%2) on %3 (now %4).
%1 legt eine Marke (%2) auf %3 (jetzt %4).
@@ -2219,7 +2253,7 @@
-
+
%1 removes %n counter(s) (%2) from %3 (now %4).
%1 entfernt eine Marke (%2) von %3 (jetzt %4).
@@ -2227,37 +2261,37 @@
-
+
red
rot
-
+
yellow
gelb
-
+
green
grün
-
+
%1 sets counter %2 to %3 (%4%5).
%1 setzt Zähler %2 auf %3 (%4%5).
-
+
%1 sets PT of %2 to %3.
%1 setzt Kampfwerte von %2 auf %3.
-
+
%1 sets annotation of %2 to %3.
%1 versieht %2 mit dem Hinweis %3.
-
+
%1 is looking at the top %2 cards %3.
%1 sieht sich die obersten %2 Karten %3 an.
@@ -2354,7 +2388,7 @@
%1 entfernt %2 Zählmarken von %3 (jetzt %4).
-
+
%1 %2 %3.
%1 %2 %3.
@@ -2367,22 +2401,22 @@
%1 sieht sich die obersten %2 Karten %3 an.
-
+
%1 is looking at %2.
%1 sieht sich %2 an.
-
+
%1 stops looking at %2.
%1 sieht sich %2 nicht mehr an.
-
+
%1 reveals %2 to %3.
%1 zeigt %3 %2.
-
+
%1 reveals %2.
%1 zeigt %2 offen vor.
@@ -2403,7 +2437,7 @@
%1 zeigt %2 aus %3 offen vor.
-
+
ending phase
die Zugendphase
@@ -2432,57 +2466,57 @@
%1 sieht sich %2s %3 nicht mehr an
-
+
It is now %1's turn.
%1 ist am Zug.
-
+
untap step
das Enttappsegment
-
+
upkeep step
das Versorgungssegment
-
+
draw step
das Ziehsegment
-
+
first main phase
die erste Hauptphase
-
+
beginning of combat step
das Anfangssegment der Kampfphase
-
+
declare attackers step
das Angreifer-Deklarieren-Segment
-
+
declare blockers step
das Blocker-Deklarieren-Segment
-
+
combat damage step
das Kampfschadenssegment
-
+
end of combat step
das Endsegment der Kampfphase
-
+
second main phase
die zweite Hauptphase
@@ -2491,7 +2525,7 @@
das Ende-des-Zuges-Segment
-
+
It is now the %1.
Es ist nun %1.
@@ -2500,12 +2534,12 @@
%1 bewegt %2 %3 nach %4
-
+
taps
tappt
-
+
untaps
enttappt
@@ -2530,7 +2564,7 @@
%1 entfernt %2 Zählmarken von %3 (jetzt %4)
-
+
his permanents
seine bleibenden Karten
@@ -2543,12 +2577,12 @@
%1 setzt Zähler "%2" auf %3 (%4%5)
-
+
%1 sets %2 to not untap normally.
%1 setzt %2 auf explizites Enttappen.
-
+
%1 sets %2 to untap normally.
%1 setzt %2 auf normales Enttappen.
@@ -2653,21 +2687,21 @@
Player
-
-
-
+
+
+
Move to &top of library
Oben auf die Biblio&thek legen
-
-
-
+
+
+
Move to &bottom of library
Unter die &Bibliothek legen
-
+
&View library
&Zeige Bibliothek
@@ -2676,32 +2710,37 @@
Oberste Karten in den F&riedhof legen...
-
+
Move top cards to &exile...
Oberste Karten ins &Exil schicken...
-
+
F3
F3
-
+
View &top cards of library...
Zeige die oberen Kar&ten der Bibliothek...
-
+
&View graveyard
&Zeige Friedhof
-
+
&All players
&allen Spielern
-
+
+ Ctrl+F3
+ Ctrl+F3
+
+
+
F4
F4
@@ -2710,68 +2749,73 @@
Zeige ent&fernte Karten
-
+
&View sideboard
Zeige &Sideboard
-
+
Player "%1"
Spieler "%1"
-
-
+
+
Move to &graveyard
Auf den &Friedhof legen
-
+
Reveal &library to
&Bibliothek jemandem zeigen
-
+
Reveal t&op card to
&Oberste Karte jemandem zeigen
-
+
+ &Undo last draw
+ Zuletzt gezogene Karte zur&ücklegen
+
+
+
Take &mulligan
&Mulligan nehmen
-
+
Move top cards to &graveyard...
Oberste Karten auf den F&riedhof legen...
-
+
Put top card on &bottom
Oberste Karte nach &unten legen
-
+
&Hand
&Hand
-
+
&Reveal to
Jemandem &zeigen
-
+
Reveal r&andom card to
Z&ufällige Karte jemandem zeigen
-
+
&Library
Bib&liothek
-
+
&Graveyard
&Friedhof
@@ -2780,7 +2824,7 @@
Entfe&rnte Karten
-
+
&Sideboard
&Sideboard
@@ -2793,33 +2837,33 @@
&Hinweis setzen...
-
+
View top cards of library
Zeige die obersten Karten der Bibliothek
-
+
Number of cards:
Anzahl der Karten:
-
+
&Draw card
Karte &ziehen
-
+
&View exile
&Zeige Exil
-
+
&Exile
&Exil
-
-
+
+
Move to &hand
auf die &Hand nehmen
@@ -2828,28 +2872,28 @@
auf den &Friedhof legen
-
-
+
+
Move to &exile
ins &Exil schicken
-
+
Ctrl+W
Ctrl+W
-
+
Ctrl+D
Ctrl+D
-
+
D&raw cards...
Ka&rten ziehen...
-
+
Ctrl+E
Ctrl+E
@@ -2858,32 +2902,37 @@
&Mulligan nehmen...
-
+
Ctrl+M
Ctrl+M
-
+
&Shuffle
Mi&schen
-
+
Ctrl+S
Ctrl+S
-
+
&Counters
&Zähler
-
+
&Untap all permanents
&Enttappe alle bleibenden Karten
-
+
+ Ctrl+Shift+D
+ Ctrl+Shift+D
+
+
+
Ctrl+U
Ctrl+U
@@ -2912,42 +2961,42 @@
Ctrl+L
-
+
R&oll die...
&Würfeln...
-
+
Ctrl+I
Ctrl+I
-
+
&Create token...
Spiels&tein erstellen...
-
+
Ctrl+T
Ctrl+T
-
+
C&reate another token
&Noch einen Spielstein erstellen
-
+
Ctrl+G
Ctrl+G
-
+
S&ay
S&agen
-
+
C&ard
&Karte
@@ -3040,50 +3089,50 @@
F10
-
+
Draw cards
Karten ziehen
-
-
-
-
+
+
+
+
Number:
Anzahl:
-
+
Move top cards to grave
Oberste Karten in den Friedhof legen
-
+
Move top cards to exile
Oberste Karten ins Exil schicken
-
+
Set power/toughness
Kampfwerte setzen
-
+
Please enter the new PT:
Bitte die neuen Kampfwerte eingeben:
-
+
Set annotation
Hinweis setzen
-
+
Please enter the new annotation:
Bitte den Hinweis eingeben:
-
+
Set counters
Setze Zählmarken
@@ -3096,12 +3145,12 @@
Neue Lebenspunkte insgesamt:
-
+
Roll die
Würfeln
-
+
Number of sides:
Anzahl der Seiten:
@@ -3509,22 +3558,27 @@ Bitte geben Sie einen Namen ein:
TabMessage
-
+
Personal &talk
Persönliches &Gespräch
-
+
&Leave
Ver&lassen
-
+
%1 has left the server.
%1 hat den Server verlassen.
-
+
+ %1 has joined the server.
+ %1 hat den Server betreten.
+
+
+
Talking to %1
Gespräch mit %1
@@ -3532,40 +3586,38 @@ Bitte geben Sie einen Namen ein:
TabRoom
-
+
&Say:
&Sagen:
-
+
Chat
Unterhaltung
-
+
&Room
&Raum
-
+
&Leave room
Raum ver&lassen
-
%1 has joined the room.
- %1 hat den Raum betreten.
+ %1 hat den Raum betreten.
-
%1 has left the room.
- %1 hat den Raum verlassen.
+ %1 hat den Raum verlassen.
TabServer
-
+
Server
Server
diff --git a/cockatrice/translations/cockatrice_en.ts b/cockatrice/translations/cockatrice_en.ts
index c01abe60..1e4ed498 100644
--- a/cockatrice/translations/cockatrice_en.ts
+++ b/cockatrice/translations/cockatrice_en.ts
@@ -598,52 +598,57 @@
-
- &Spectators allowed
-
-
-
-
- Spectators &need a password to join
-
-
-
-
- Spectators can &chat
-
-
-
-
- Spectators see &everything
+
+ Game type
+ &Spectators allowed
+
+
+
+
+ Spectators &need a password to join
+
+
+
+
+ Spectators can &chat
+
+
+
+
+ Spectators see &everything
+
+
+
+
Spectators
-
+
&OK
-
+
&Cancel
-
+
Create game
-
+
Error
-
+
Server error.
@@ -840,65 +845,65 @@
GameSelector
-
+
C&reate
-
+
&Join
+
+
-
-
Error
-
+
Wrong password.
-
+
Spectators are not allowed in this game.
-
+
The game is already full.
-
+
The game does not exist any more.
-
+
Join game
-
+
Password:
-
+
Games
-
+
Show &full games
-
+
J&oin as spectator
@@ -914,47 +919,52 @@
GamesModel
-
+
yes
-
+
no
-
+
Creator
-
+
Description
-
+
yes, free for spectators
-
+
not allowed
-
+
+ Game type
+
+
+
+
Password
-
+
Players
-
+
Spectators
@@ -1077,7 +1087,8 @@
-
+
+
Error
@@ -1097,87 +1108,94 @@
-
- Protocol version mismatch. Local version: %1, remote version: %2.
+
+ You are trying to connect to an obsolete server. Please downgrade your Cockatrice version or connect to a suitable server.
+Local version is %1, remote version is %2.
-
+
+ Your Cockatrice client is obsolete. Please update your Cockatrice version.
+Local version is %1, remote version is %2.
+
+
+
+
Connecting to %1...
-
+
Disconnected
-
+
Logged in at %1
-
+
&Connect...
-
+
&Disconnect
-
+
Start &local game...
-
+
&Deck editor
-
+
&Full screen
-
+
Ctrl+F
-
+
&Settings...
-
+
&Exit
-
+
&Cockatrice
-
+
&About Cockatrice
-
+
&Help
-
+
Are you sure?
-
+
There are still open games. Are you sure you want to quit?
@@ -1230,148 +1248,158 @@
-
+
+ %1 undoes his last draw.
+
+
+
+
+ %1 undoes his last draw (%2).
+
+
+
+
from table
-
+
from graveyard
-
+
from exile
-
+
from hand
-
+
the bottom card of his library
-
+
from the bottom of his library
-
+
the top card of his library
-
+
from the top of his library
-
+
from library
-
+
from sideboard
-
+
from the stack
-
+
%1 gives %2 control over %3.
-
+
%1 puts %2 into play%3.
-
+
%1 puts %2%3 into graveyard.
-
+
%1 exiles %2%3.
-
+
%1 moves %2%3 to hand.
-
+
%1 puts %2%3 into his library.
-
+
%1 puts %2%3 on bottom of his library.
-
+
%1 puts %2%3 on top of his library.
-
+
%1 puts %2%3 into his library at position %4.
-
+
%1 moves %2%3 to sideboard.
-
+
%1 plays %2%3.
-
-
+
+
a card
-
+
%1 flips %2 face-down.
-
+
%1 flips %2 face-up.
-
+
%1 attaches %2 to %3's %4.
-
+
%1 unattaches %2.
-
+
%1 points from %2's %3 to %4's %5.
-
+
%1 places %n counter(s) (%2) on %3 (now %4).
%1 places a counter (%2) on %3 (now %4).
@@ -1379,7 +1407,7 @@
-
+
%1 removes %n counter(s) (%2) from %3 (now %4).
%1 removes a counter (%2) from %3 (now %4).
@@ -1387,37 +1415,37 @@
-
+
red
-
+
yellow
-
+
green
-
+
%1 sets counter %2 to %3 (%4%5).
-
+
%1 sets PT of %2 to %3.
-
+
%1 sets annotation of %2 to %3.
-
+
%1 is looking at the top %2 cards %3.
@@ -1482,52 +1510,52 @@
-
+
%1 destroys %2.
-
+
%1 creates token: %2%3.
-
+
%1 points from %2's %3 to %4.
-
+
%1 %2 %3.
-
+
%1 is looking at %2.
-
+
%1 stops looking at %2.
-
+
%1 reveals %2 to %3.
-
+
%1 reveals %2.
-
+
ending phase
-
+
It is now %1's turn.
@@ -1537,102 +1565,102 @@
-
+
%1 randomly reveals %2%3 to %4.
-
+
%1 randomly reveals %2%3.
-
+
%1 reveals %2%3 to %4.
-
+
%1 reveals %2%3.
-
+
untap step
-
+
upkeep step
-
+
draw step
-
+
first main phase
-
+
beginning of combat step
-
+
declare attackers step
-
+
declare blockers step
-
+
combat damage step
-
+
end of combat step
-
+
second main phase
-
+
It is now the %1.
-
+
taps
-
+
untaps
-
+
%1 sets %2 to not untap normally.
-
+
%1 sets %2 to untap normally.
-
+
his permanents
@@ -1721,307 +1749,322 @@
Player
-
-
-
+
+
+
Move to &top of library
-
-
-
+
+
+
Move to &bottom of library
-
-
+
+
Move to &graveyard
-
+
&View library
-
+
Reveal &library to
-
+
Reveal t&op card to
-
+
Move top cards to &graveyard...
-
+
F3
-
+
View &top cards of library...
-
+
&View graveyard
-
+
F4
-
+
&View sideboard
-
+
Player "%1"
-
+
&Hand
-
+
&Library
-
+
&Graveyard
-
+
&Sideboard
-
+
View top cards of library
-
+
Number of cards:
-
+
&Draw card
-
+
&View exile
-
+
&Exile
+
+
+
+ Move to &hand
+
+
- Move to &hand
-
-
-
-
-
Move to &exile
-
+
Ctrl+W
-
+
Ctrl+D
-
+
D&raw cards...
-
+
Ctrl+E
-
+
Take &mulligan
-
+
Ctrl+M
-
+
&Shuffle
-
+
Ctrl+S
-
+
&Counters
-
+
&Untap all permanents
-
+
Ctrl+U
-
+
R&oll die...
-
+
Ctrl+I
-
+
&Create token...
-
+
Ctrl+T
-
+
C&reate another token
-
+
Ctrl+G
-
+
S&ay
- Move top cards to &exile...
-
-
-
-
- Put top card on &bottom
+ &Undo last draw
- &Reveal to
+ Move top cards to &exile...
+ Put top card on &bottom
+
+
+
+
+ &Reveal to
+
+
+
+
Reveal r&andom card to
-
+
C&ard
-
+
&All players
-
+
+ Ctrl+F3
+
+
+
+
+ Ctrl+Shift+D
+
+
+
+
Draw cards
-
-
-
-
+
+
+
+
Number:
-
+
Move top cards to grave
-
+
Move top cards to exile
-
+
Roll die
-
+
Number of sides:
-
+
Set power/toughness
-
+
Please enter the new PT:
-
+
Set annotation
-
+
Please enter the new annotation:
-
+
Set counters
@@ -2342,22 +2385,27 @@ Please enter a name:
TabMessage
-
+
Personal &talk
-
+
&Leave
-
+
%1 has left the server.
-
+
+ %1 has joined the server.
+
+
+
+
Talking to %1
@@ -2365,40 +2413,30 @@ Please enter a name:
TabRoom
-
+
&Say:
-
+
Chat
-
+
&Room
-
+
&Leave room
-
-
- %1 has joined the room.
-
-
-
-
- %1 has left the room.
-
-
TabServer
-
+
Server
diff --git a/cockatrice/translations/cockatrice_es.ts b/cockatrice/translations/cockatrice_es.ts
index 94cfb287..510f3605 100644
--- a/cockatrice/translations/cockatrice_es.ts
+++ b/cockatrice/translations/cockatrice_es.ts
@@ -793,52 +793,57 @@
&Jugadores:
-
+
+ Game type
+
+
+
+
&Spectators allowed
Permitir e&spectadores
-
+
Spectators &need a password to join
Los espectadores &necesitan contraseña para unirse
-
+
Spectators can &chat
Los espectadores pueden &chatear
-
+
Spectators see &everything
Los espectadores pueden verlo &todo
-
+
Spectators
Espectadores
-
+
&OK
&Aceptar
-
+
&Cancel
&Cancelar
-
+
Create game
Crear partida
-
+
Error
Error
-
+
Server error.
Error del servidor.
@@ -1047,60 +1052,60 @@
GameSelector
-
+
C&reate
C&rear
-
+
&Join
E&ntrar
+
+
-
-
Error
Error
-
+
Wrong password.
Contraseña incorrecta.
-
+
Spectators are not allowed in this game.
No se permiten espectadores en esta partida.
-
+
The game is already full.
La partida no tiene plazas libres.
-
+
The game does not exist any more.
La partida ya no existe.
-
+
Join game
Entrar en la partida
-
+
Password:
Contraseña:
-
+
Games
Partidas
-
+
Show &full games
Ver partidas &sin plazas libres
@@ -1109,7 +1114,7 @@
&Ver partidas sin plazas libres
-
+
J&oin as spectator
Entrar como e&spectador
@@ -1125,47 +1130,52 @@
GamesModel
-
+
yes
sí
-
+
no
no
-
+
Creator
Creador
-
+
Description
Descripción
-
+
yes, free for spectators
sí, libre para espectadores
-
+
not allowed
no permitido
-
+
+ Game type
+
+
+
+
Password
Contraseña
-
+
Players
Jugadores
-
+
Spectators
Espectadores
@@ -1288,7 +1298,8 @@
-
+
+
Error
Error
@@ -1308,87 +1319,98 @@
Error del Socket: %1
-
- Protocol version mismatch. Local version: %1, remote version: %2.
- La versión del protocolo es diferente. Version local: %1, version remota: %2.
+
+ You are trying to connect to an obsolete server. Please downgrade your Cockatrice version or connect to a suitable server.
+Local version is %1, remote version is %2.
+
-
+
+ Your Cockatrice client is obsolete. Please update your Cockatrice version.
+Local version is %1, remote version is %2.
+
+
+
+ Protocol version mismatch. Local version: %1, remote version: %2.
+ La versión del protocolo es diferente. Version local: %1, version remota: %2.
+
+
+
Connecting to %1...
Conectando a %1...
-
+
Disconnected
Desconectado
-
+
Logged in at %1
Conectado en %1
-
+
&Connect...
&Conectar...
-
+
&Disconnect
&Desconectar
-
+
Start &local game...
Empezar partida &local...
-
+
&Deck editor
Editor de &mazos
-
+
&Full screen
&Pantalla completa
-
+
Ctrl+F
CTRL+F
-
+
&Settings...
&Preferencias...
-
+
&Exit
&Salir
-
+
&Cockatrice
&Cockatrice
-
+
&About Cockatrice
&Acerca de Cockatrice
-
+
&Help
A&yuda
-
+
Are you sure?
¿Estás seguro?
-
+
There are still open games. Are you sure you want to quit?
Todavía hay partidas abiertas. ¿Estás seguro que quieres salir?
@@ -1441,148 +1463,158 @@
%1 sacó un %2 con un dado de %3 caras.
-
+
+ %1 undoes his last draw.
+
+
+
+
+ %1 undoes his last draw (%2).
+
+
+
+
from table
de la mesa
-
+
from graveyard
del cementerio
-
+
from exile
del exilio
-
+
from hand
de la mano
-
+
the bottom card of his library
el fondo de la biblioteca
-
+
from the bottom of his library
del fondo de la biblioteca
-
+
the top card of his library
la parte superior de la biblioteca
-
+
from the top of his library
de la parte superior de la biblioteca
-
+
from library
de la biblioteca
-
+
from sideboard
de la reserva
-
+
from the stack
de la pila
-
+
%1 gives %2 control over %3.
%1 entrega a %2 el control sobre %3.
-
+
%1 puts %2 into play%3.
%1 pone %2 en juego%3.
-
+
%1 puts %2%3 into graveyard.
%1 pone %2%3 en el cementerio.
-
+
%1 exiles %2%3.
%1 exilia %2%3.
-
+
%1 moves %2%3 to hand.
%1 mueve %2%3 a la mano.
-
+
%1 puts %2%3 into his library.
%1 pone %2%3 en la biblioteca.
-
+
%1 puts %2%3 on bottom of his library.
%1 pone %2%3 en la parte inferior de su biblioteca.
-
+
%1 puts %2%3 on top of his library.
%1 pone %2%3 en la parte superior de su biblioteca.
-
+
%1 puts %2%3 into his library at position %4.
%1 pone %2%3 en su biblioteca en la posición %4.
-
+
%1 moves %2%3 to sideboard.
%1 mueve %2%3 a la reserva.
-
+
%1 plays %2%3.
%1 juega %2%3.
-
-
+
+
a card
una carta
-
+
%1 flips %2 face-down.
%1 voltea %2 boca abajo.
-
+
%1 flips %2 face-up.
%1 voltea %2 boca arriba.
-
+
%1 attaches %2 to %3's %4.
%1 anexa %2 a el %4 de %3.
-
+
%1 unattaches %2.
%1 desanexa %2.
-
+
%1 points from %2's %3 to %4's %5.
%1 apunta desde el %3 de %2 al %5 de %4.
-
+
%1 places %n counter(s) (%2) on %3 (now %4).
%1 pone un contador (%2) en %3 (ahora %4).
@@ -1590,7 +1622,7 @@
-
+
%1 removes %n counter(s) (%2) from %3 (now %4).
%1 remueve un contador (%2) de %3 (ahora %4).
@@ -1598,37 +1630,37 @@
-
+
red
rojo
-
+
yellow
amarillo
-
+
green
verde
-
+
%1 sets counter %2 to %3 (%4%5).
%1 establece los contadores de %2 a %3 (%4%5).
-
+
%1 sets PT of %2 to %3.
%1 establece F/R de %2 a %3.
-
+
%1 sets annotation of %2 to %3.
%1 establece la anotación de %2 a %3.
-
+
%1 is looking at the top %2 cards %3.
%1 esta mirando las primeras %2 cartas de %3.
@@ -1693,52 +1725,52 @@
%1 roba %2 cartas.
-
+
%1 destroys %2.
%1 destruye %2.
-
+
%1 creates token: %2%3.
%1 crea una ficha: %2%3.
-
+
%1 points from %2's %3 to %4.
%1 apunta desde el %3 de %2 a %4.
-
+
%1 %2 %3.
%1 %2 %3.
-
+
%1 is looking at %2.
%1 está mirando: %2.
-
+
%1 stops looking at %2.
%1 termina de mirar: %2.
-
+
%1 reveals %2 to %3.
%1 revela %2 a %3.
-
+
%1 reveals %2.
%1 revela %2.
-
+
ending phase
fase de fin de turno
-
+
It is now %1's turn.
Es el turno de %1.
@@ -1748,102 +1780,102 @@
%1 baraja su biblioteca.
-
+
%1 randomly reveals %2%3 to %4.
%1 revela aleatoriamente %2%3 a %4.
-
+
%1 randomly reveals %2%3.
%1 revela aleatoriamente %2%3.
-
+
%1 reveals %2%3 to %4.
%1 revela %2%3 a %4.
-
+
%1 reveals %2%3.
%1 revela %2%3.
-
+
untap step
paso de enderezar
-
+
upkeep step
paso de mantenimiento
-
+
draw step
paso de robar
-
+
first main phase
primera fase principal
-
+
beginning of combat step
paso de inicio de combate
-
+
declare attackers step
paso de declarar atacantes
-
+
declare blockers step
paso de declarar bloqueadores
-
+
combat damage step
paso de daño de combate
-
+
end of combat step
paso de fin de combate
-
+
second main phase
segunda fase principal
-
+
It is now the %1.
Ahora es el %1.
-
+
taps
gira
-
+
untaps
endereza
-
+
%1 sets %2 to not untap normally.
%1 establece que %2 no se endereze normalmente.
-
+
%1 sets %2 to untap normally.
%1 establece que %2 se endereze normalmente.
-
+
his permanents
sus permanentes
@@ -1932,123 +1964,128 @@
Player
-
-
-
+
+
+
Move to &top of library
Mover a la &parte superior de la biblioteca
-
-
-
+
+
+
Move to &bottom of library
Mover al &fondo de la biblioteca
-
-
+
+
Move to &graveyard
Mover al &cementerio
-
+
&View library
&Ver biblioteca
-
+
Reveal &library to
Revelar &biblioteca a
-
+
Reveal t&op card to
Revelar la carta &superior de la biblioteca a
-
+
+ &Undo last draw
+
+
+
+
Move top cards to &graveyard...
Mover cartas de la parte s&uperior de la biblioteca al cementerio...
-
+
F3
F3
-
+
View &top cards of library...
Ver cartas de la parte &superior de la biblioteca...
-
+
&View graveyard
Ver &Cementerio
-
+
F4
F4
-
+
&View sideboard
Ver &sideboard
-
+
Player "%1"
Jugador "%1"
-
+
&Hand
&Mano
-
+
&Library
&Biblioteca
-
+
&Graveyard
&Cementerio
-
+
&Sideboard
&Reserva
-
+
View top cards of library
Ver cartas de la parte superior de la biblioteca
-
+
Number of cards:
Número de cartas:
-
+
&Draw card
&Robar carta
-
+
&View exile
Ver &exilio
-
+
&Exile
&Exilio
-
-
+
+
Move to &hand
Mover a la m&ano
@@ -2057,98 +2094,98 @@
Mover al &cementerio
-
-
+
+
Move to &exile
Mover al &exilio
-
+
Ctrl+W
Ctrl+W
-
+
Ctrl+D
Ctrl+D
-
+
D&raw cards...
&Robar cartas...
-
+
Ctrl+E
Ctrl+E
-
+
Take &mulligan
Hacer &mulligan
-
+
Ctrl+M
Ctrl+M
-
+
&Shuffle
&Barajar
-
+
Ctrl+S
Ctrl+S
-
+
&Counters
&Contadores
-
+
&Untap all permanents
&Enderezar todos los permanentes
-
+
Ctrl+U
Ctrl+U
-
+
R&oll die...
&Lanzar dado...
-
+
Ctrl+I
Ctrl+I
-
+
&Create token...
Crear &Ficha...
-
+
Ctrl+T
Ctrl+T
-
+
C&reate another token
C&rea otra ficha
-
+
Ctrl+G
Ctrl+G
-
+
S&ay
D&ecir
@@ -2157,90 +2194,100 @@
Mover cartas superiores al ce&menterio...
-
+
Move top cards to &exile...
Mover cartas superiores al &exilio...
-
+
Put top card on &bottom
Poner carta superior en la parte &inferior
-
+
&Reveal to
&Revelar a
-
+
Reveal r&andom card to
Revelar carta &aleatoriamente a
-
+
C&ard
C&arta
-
+
&All players
&Todos los jugadores
-
+
+ Ctrl+F3
+
+
+
+
+ Ctrl+Shift+D
+
+
+
+
Draw cards
Robar cartas
-
-
-
-
+
+
+
+
Number:
Número:
-
+
Move top cards to grave
Mover cartas superiores al cementerio
-
+
Move top cards to exile
Mover cartas superiores al exilio
-
+
Roll die
Lanzar dado
-
+
Number of sides:
Número de caras:
-
+
Set power/toughness
Establecer fuerza/resistencia
-
+
Please enter the new PT:
Por favor, introduzca la nueva F/R:
-
+
Set annotation
Escribir anotación
-
+
Please enter the new annotation:
Por favor, introduza la nueva anotación:
-
+
Set counters
Establecer contadores
@@ -2600,22 +2647,27 @@ Por favor, introduzca un nombre:
TabMessage
-
+
Personal &talk
&Conversación personal
-
+
&Leave
&Cerrar
-
+
%1 has left the server.
%1 ha abandonado el servidor.
-
+
+ %1 has joined the server.
+
+
+
+
Talking to %1
Hablando con %1
@@ -2623,40 +2675,38 @@ Por favor, introduzca un nombre:
TabRoom
-
+
&Say:
&Decir:
-
+
Chat
Chat
-
+
&Room
&Sala
-
+
&Leave room
&Dejar sala
-
%1 has joined the room.
- %1 se ha unido a la sala.
+ %1 se ha unido a la sala.
-
%1 has left the room.
- %1 ha dejado la sala.
+ %1 ha dejado la sala.
TabServer
-
+
Server
Servidor
diff --git a/cockatrice/translations/cockatrice_fr.ts b/cockatrice/translations/cockatrice_fr.ts
index 10c1cf1a..94a73f4c 100644
--- a/cockatrice/translations/cockatrice_fr.ts
+++ b/cockatrice/translations/cockatrice_fr.ts
@@ -655,52 +655,57 @@
-
+
+ Game type
+
+
+
+
&Spectators allowed
&Spectateurs autorisés
-
+
Spectators &need a password to join
Les spectateurs ont besoin d'un mot de passe pour rejoindre
-
+
Spectators can &chat
Les spectateurs peuvent discuter
-
+
Spectators see &everything
Les spectateurs p&euvent tout voir
-
+
Spectators
Spectateurs
-
+
&OK
&OK
-
+
&Cancel
&Annuler
-
+
Create game
Créer partie
-
+
Error
Erreur
-
+
Server error.
Erreur serveur.
@@ -897,50 +902,50 @@
GameSelector
+
+
-
-
Error
Erreur
-
+
Wrong password.
Mauvais mot de passe
-
+
Spectators are not allowed in this game.
Les spectateurs ne sont pas autorisés dans cette partie
-
+
The game is already full.
Cette partie est déjà pleine.
-
+
The game does not exist any more.
La partie n'existe plus.
-
+
Join game
Rejoindre partie
-
+
Password:
Mot de passe:
-
+
Games
Parties
-
+
Show &full games
Montrer &toutes les parties
@@ -950,17 +955,17 @@
&Montrer toutes les parties
-
+
C&reate
C&réer
-
+
&Join
Re&joindre
-
+
J&oin as spectator
J&oindre en tant que spectateur
@@ -976,47 +981,52 @@
GamesModel
-
+
yes
oui
-
+
yes, free for spectators
oui, libre pour les spectateurs
-
+
no
non
-
+
not allowed
non autorisé
-
+
Description
Description
-
+
Creator
Créateur
-
+
+ Game type
+
+
+
+
Password
Mot de passe
-
+
Players
Joueurs
-
+
Spectators
Spectateurs
@@ -1143,7 +1153,8 @@
-
+
+
Error
Erreur
@@ -1163,88 +1174,99 @@
Erreur de socket: %1
-
Protocol version mismatch. Local version: %1, remote version: %2.
- Version de protocole différente. Version locale: %1 ,version distante: %2.
+ Version de protocole différente. Version locale: %1 ,version distante: %2.
-
+
+ You are trying to connect to an obsolete server. Please downgrade your Cockatrice version or connect to a suitable server.
+Local version is %1, remote version is %2.
+
+
+
+
+ Your Cockatrice client is obsolete. Please update your Cockatrice version.
+Local version is %1, remote version is %2.
+
+
+
+
Connecting to %1...
Connexion à %1...
-
+
Disconnected
Déconnecté
-
+
Logged in at %1
Connecté à %1
-
+
&Connect...
à verifier
&Connecter...
-
+
&Disconnect
&Déconnecter
-
+
Start &local game...
Démarrer une partie &locale...
-
+
&Deck editor
Editeur de &deck
-
+
&Full screen
&Plein écran
-
+
Ctrl+F
Ctrl+F
-
+
&Settings...
&Paramètres
-
+
&Exit
&Quitter
-
+
&Cockatrice
&Cockatrice
-
+
&About Cockatrice
&A propos de Cockatrice
-
+
&Help
A&ide
-
+
Are you sure?
Etes vous sur?
-
+
There are still open games. Are you sure you want to quit?
Il y a encore des parties en cours. Etes vous sure de vouloir quitter?
@@ -1364,167 +1386,177 @@
%1 pioche %2 cartes.
-
+
from table
de la table
-
+
from graveyard
depuis le cimetière
-
+
from exile
depuis la zone d'éxil
-
+
from hand
depuis la main
-
+
the bottom card of his library
la carte du dessous de sa bibliothèque
-
+
from the bottom of his library
depuis le dessous de sa bibliothèque
-
+
the top card of his library
le carte du dessus de sa bibliothèque
-
+
from the top of his library
du dessus de sa bibliothèque
-
+
from library
de la bibliothèque
-
+
from sideboard
de la réserve
-
+
from the stack
de la pile
-
+
%1 puts %2 into play%3.
what is %3? plz exemple
%1 met %2 en jeu %3.
-
+
%1 puts %2%3 into graveyard.
%1 met %2%3 dans le cimetière.
-
+
%1 exiles %2%3.
%1 exile %2%3.
-
+
%1 moves %2%3 to hand.
%1 déplace %2%3 dans sa main.
-
+
%1 puts %2%3 into his library.
%1 met %2%3 dans sa bibliothèque.
-
+
%1 puts %2%3 on bottom of his library.
%1 met %2%3 en dessous de sa bibliothèque.
-
+
%1 puts %2%3 on top of his library.
%1 met %2%3 au dessus de sa bibliothèque.
-
+
%1 puts %2%3 into his library at position %4.
%1 met %2%3 dans sa bibliothèque à la position %4.
-
+
%1 moves %2%3 to sideboard.
%1 déplace %2%3 vers la réserve.
-
+
%1 plays %2%3.
%1 joue %2%3.
-
-
+
+
a card
une carte
-
+
+ %1 undoes his last draw.
+
+
+
+
+ %1 undoes his last draw (%2).
+
+
+
+
%1 gives %2 control over %3.
%1 donne le contrôle de %2 à%3.
-
+
%1 flips %2 face-down.
%1 retourne %2 face cachée.
-
+
%1 flips %2 face-up.
%1 retourne %2 face visible.
-
+
%1 destroys %2.
%1 détruit %2.
-
+
%1 attaches %2 to %3's %4.
need exemple
%1 attache %2 à %4 de %3.
-
+
%1 unattaches %2.
%1 détache %2.
-
+
%1 creates token: %2%3.
%1 crée un jeton %2%3.
-
+
%1 points from %2's %3 to %4.
need exemple
%1 désigne le %3 de %2 à %4.
-
+
%1 points from %2's %3 to %4's %5.
need exemple
%1 désigne %3 de %2 à %5 de %4.
-
+
%1 places %n counter(s) (%2) on %3 (now %4).
need exemple
@@ -1533,7 +1565,7 @@
-
+
%1 removes %n counter(s) (%2) from %3 (now %4).
need exemple
@@ -1542,179 +1574,179 @@
-
+
red
rouge
-
+
yellow
jaune
-
+
green
vert
-
+
his permanents
ses permanents
-
+
%1 %2 %3.
wtf ?
%1 %2 %3.
-
+
taps
engage
-
+
untaps
dégage
-
+
%1 sets counter %2 to %3 (%4%5).
need exemple
%1 met les compteurs %2 à %3 (%4%5).
-
+
%1 sets %2 to not untap normally.
need exemple
%1 met %2 pour ne pas se dégager normalement.
-
+
%1 sets %2 to untap normally.
%1 met %2 pour ne se dégager normalement.
-
+
%1 sets PT of %2 to %3.
exemple plz
%1 met la F/E de %2 à %3.
-
+
%1 sets annotation of %2 to %3.
%1 met l'annotation de %2 à %3.
-
+
%1 is looking at the top %2 cards %3.
exemple plz
%1 regarde les %2 cartes du dessus de%3.
-
+
%1 is looking at %2.
exemple plz
%1 regarde %2.
-
+
%1 stops looking at %2.
need exemple to be sure
%1 arrète de regarder à %2
-
+
%1 reveals %2 to %3.
%1 révèle %2 à %3.
-
+
%1 reveals %2.
%1 révèle %2.
-
+
%1 randomly reveals %2%3 to %4.
%1 révèle aléatoirement %2%3 à %4.
-
+
%1 randomly reveals %2%3.
%1 révèle aléatoirement %2%3.
-
+
%1 reveals %2%3 to %4.
%1 révèle %2%3 à %4.
-
+
%1 reveals %2%3.
%1 révèle %2%3
-
+
It is now %1's turn.
C'est maintenant le tour de %1.
-
+
untap step
étape de dégagement
-
+
upkeep step
étape d'entretien
-
+
draw step
étape de pioche
-
+
first main phase
première phase principale
-
+
beginning of combat step
étape de début du combat
-
+
declare attackers step
étape de déclaration des attaquants
-
+
declare blockers step
étape de déclaration des attaquants
-
+
combat damage step
étape de répartition des blessures
-
+
end of combat step
étape de fin de combat
-
+
second main phase
seconde phase principale
-
+
ending phase
phase de fin
-
+
It is now the %1.
need exemple
C'est maintenant %1.
@@ -1804,308 +1836,323 @@
Player
-
+
&View graveyard
&Voir le cimetière
-
+
&View exile
&Voir la zone d'exil
-
+
Player "%1"
Joueur "%1"
-
+
&Graveyard
&Cimetière
-
+
&Exile
&Exil
-
-
-
+
+
+
Move to &top of library
Déplacer vers le &dessus de la bibliothèque
-
-
-
+
+
+
Move to &bottom of library
Déplacer en des&sous de la bibliothèque
-
-
+
+
Move to &graveyard
Déplacer vers le cimetière
-
-
+
+
Move to &exile
Déplacer vers l'&exil
-
-
+
+
Move to &hand
Déplacer vers la &main
-
+
&View library
&Voir la bibliothèque
-
+
View &top cards of library...
Voir les cartes du &dessus de la bibliothèque...
-
+
Reveal &library to
Révéler la &bibliothèque à
-
+
Reveal t&op card to
Révéler la carte du &dessus à
-
+
&View sideboard
&Voir la réserve
-
+
&Draw card
&Piocher carte
-
+
D&raw cards...
P&iocher plusieurs cartes...
-
+
+ &Undo last draw
+
+
+
+
Take &mulligan
Prendre un &mulligan
-
+
&Shuffle
&Mélanger
-
+
Move top cards to &graveyard...
Déplacer les cartes du dessus vers le &cimetière...
-
+
Move top cards to &exile...
Déplacer les cartes du dessus vers le &exil...
-
+
Put top card on &bottom
Met la carte du dessus en &dessous
-
+
&Hand
&Main
-
+
&Reveal to
&Révéler à
-
+
Reveal r&andom card to
Révéler &aléatoirement une carte à
-
+
&Sideboard
Ré&serve
-
+
&Library
&Bibliothèque
-
+
&Counters
&Compteurs
-
+
&Untap all permanents
&Dégager tous les permanents
-
+
R&oll die...
Lancer le &dé...
-
+
&Create token...
&Créer un jeton...
-
+
C&reate another token
C&réer un autre jeton
-
+
S&ay
D&ire
-
+
C&ard
C&arte
-
+
&All players
&Tout les joueurs
-
+
+ Ctrl+F3
+
+
+
+
F3
F3
-
+
Ctrl+W
Ctrl+W
-
+
F4
F4
-
+
Ctrl+D
Ctrl+D
-
+
Ctrl+E
Ctrl+E
-
+
+ Ctrl+Shift+D
+
+
+
+
Ctrl+M
Ctrl+M
-
+
Ctrl+S
Ctrl+S
-
+
Ctrl+U
Ctrl+U
-
+
Ctrl+I
Ctrl+I
-
+
Ctrl+T
Ctrl+T
-
+
Ctrl+G
Ctrl+G
-
+
View top cards of library
Voir les cartes du dessus de la bibliothèque
-
+
Number of cards:
Nombre de cartes:
-
+
Draw cards
Piocher des cartes
-
-
-
-
+
+
+
+
Number:
Nombre:
-
+
Move top cards to grave
Déplacer les cartes du dessus dans le cimetière
-
+
Move top cards to exile
Déplacer les cartes du dessus vers le exil
-
+
Roll die
Lancer le dé...
-
+
Number of sides:
Nombre de faces:
-
+
Set power/toughness
Fixer force/endurance
-
+
Please enter the new PT:
maybe better with /
Entrer la nouvelle F/E
-
+
Set annotation
Mettre annotation
-
+
Please enter the new annotation:
Entrez la nouvelle annotation
-
+
Set counters
Mettre des compteurs
@@ -2454,23 +2501,28 @@ Entrez un nom s'il vous plait:
TabMessage
-
+
Personal &talk
need exemple
&Discussion personnelle
-
+
&Leave
&Quitter
-
+
%1 has left the server.
%1 a quitté le serveur.
-
+
+ %1 has joined the server.
+
+
+
+
Talking to %1
Vous parlez à %1
@@ -2478,40 +2530,38 @@ Entrez un nom s'il vous plait:
TabRoom
-
+
&Say:
&Dire:
-
+
Chat
Chat
-
+
&Room
&Salon
-
+
&Leave room
&Partir du salon
-
%1 has joined the room.
- %1 a rejoin le salon.
+ %1 a rejoin le salon.
-
%1 has left the room.
- %1 a quitté le salon.
+ %1 a quitté le salon.
TabServer
-
+
Server
Serveur
diff --git a/cockatrice/translations/cockatrice_ja.ts b/cockatrice/translations/cockatrice_ja.ts
index a84fc2e7..de7037e5 100644
--- a/cockatrice/translations/cockatrice_ja.ts
+++ b/cockatrice/translations/cockatrice_ja.ts
@@ -641,52 +641,57 @@
プレイヤー人数:
-
+
+ Game type
+
+
+
+
&Spectators allowed
観戦者を許可する
-
+
Spectators &need a password to join
観戦者は参加にパスワードが必要
-
+
Spectators can &chat
観戦者はチャットに参加できる
-
+
Spectators see &everything
観戦者は全て見れる
-
+
Spectators
観戦者
-
+
&OK
-
+
&Cancel
-
+
Create game
部屋を作る
-
+
Error
エラー
-
+
Server error.
サーバーエラー.
@@ -883,60 +888,60 @@
GameSelector
-
+
C&reate
部屋を作る
-
+
&Join
参加する
+
+
-
-
Error
エラー
-
+
Wrong password.
パスワードが間違っています.
-
+
Spectators are not allowed in this game.
この試合は観戦者は許可されていません.
-
+
The game is already full.
このゲームはすでに満員です.
-
+
The game does not exist any more.
このゲームはもう存在しません.
-
+
Join game
参加
-
+
Password:
パスワード:
-
+
Games
ゲーム
-
+
Show &full games
全てのゲームを見る
@@ -945,7 +950,7 @@
全てのゲームを見る
-
+
J&oin as spectator
観戦者として参加
@@ -961,47 +966,52 @@
GamesModel
-
+
yes
あり
-
+
no
なし
-
+
Creator
作成者
-
+
Description
説明
-
+
yes, free for spectators
あり,観戦は自由
-
+
not allowed
不許可
-
+
+ Game type
+
+
+
+
Password
パスワード
-
+
Players
プレイヤー
-
+
Spectators
観戦者
@@ -1124,7 +1134,8 @@
-
+
+
Error
エラー
@@ -1144,87 +1155,94 @@
ソケットエラー: %1
-
- Protocol version mismatch. Local version: %1, remote version: %2.
-
+
+ You are trying to connect to an obsolete server. Please downgrade your Cockatrice version or connect to a suitable server.
+Local version is %1, remote version is %2.
+
-
+
+ Your Cockatrice client is obsolete. Please update your Cockatrice version.
+Local version is %1, remote version is %2.
+
+
+
+
Connecting to %1...
%1へ接続しています...
-
+
Disconnected
切断されました
-
+
Logged in at %1
%1にログイン中
-
+
&Connect...
接続...
-
+
&Disconnect
切断
-
+
Start &local game...
ローカルゲームを開始...
-
+
&Deck editor
デッキエディター
-
+
&Full screen
フルスクリーン
-
+
Ctrl+F
-
+
&Settings...
設定...
-
+
&Exit
終了
-
+
&Cockatrice
-
+
&About Cockatrice
-
+
&Help
ヘルプ
-
+
Are you sure?
よろしいですか?
-
+
There are still open games. Are you sure you want to quit?
ゲームがまだ開いています.本当に退出しますか?
@@ -1277,192 +1295,202 @@
-
+
+ %1 undoes his last draw.
+
+
+
+
+ %1 undoes his last draw (%2).
+
+
+
+
from table
-
+
from graveyard
-
+
from exile
-
+
from hand
-
+
the bottom card of his library
-
+
from the bottom of his library
-
+
the top card of his library
-
+
from the top of his library
-
+
from library
-
+
from sideboard
-
+
from the stack
-
+
%1 gives %2 control over %3.
-
+
%1 puts %2 into play%3.
-
+
%1 puts %2%3 into graveyard.
-
+
%1 exiles %2%3.
-
+
%1 moves %2%3 to hand.
-
+
%1 puts %2%3 into his library.
-
+
%1 puts %2%3 on bottom of his library.
-
+
%1 puts %2%3 on top of his library.
-
+
%1 puts %2%3 into his library at position %4.
-
+
%1 moves %2%3 to sideboard.
-
+
%1 plays %2%3.
-
-
+
+
a card
-
+
%1 flips %2 face-down.
-
+
%1 flips %2 face-up.
-
+
%1 attaches %2 to %3's %4.
-
+
%1 unattaches %2.
-
+
%1 points from %2's %3 to %4's %5.
-
+
%1 places %n counter(s) (%2) on %3 (now %4).
%1 places a counter (%2) on %3 (now %4).
-
+
%1 removes %n counter(s) (%2) from %3 (now %4).
%1 removes a counter (%2) from %3 (now %4).
-
+
red
-
+
yellow
-
+
green
-
+
%1 sets counter %2 to %3 (%4%5).
-
+
%1 sets PT of %2 to %3.
-
+
%1 sets annotation of %2 to %3.
-
+
%1 is looking at the top %2 cards %3.
@@ -1527,52 +1555,52 @@
-
+
%1 destroys %2.
-
+
%1 creates token: %2%3.
-
+
%1 points from %2's %3 to %4.
-
+
%1 %2 %3.
-
+
%1 is looking at %2.
-
+
%1 stops looking at %2.
-
+
%1 reveals %2 to %3.
-
+
%1 reveals %2.
-
+
ending phase
-
+
It is now %1's turn.
@@ -1582,102 +1610,102 @@
-
+
%1 randomly reveals %2%3 to %4.
-
+
%1 randomly reveals %2%3.
-
+
%1 reveals %2%3 to %4.
-
+
%1 reveals %2%3.
-
+
untap step
-
+
upkeep step
-
+
draw step
-
+
first main phase
-
+
beginning of combat step
-
+
declare attackers step
-
+
declare blockers step
-
+
combat damage step
-
+
end of combat step
-
+
second main phase
-
+
It is now the %1.
-
+
taps
-
+
untaps
-
+
%1 sets %2 to not untap normally.
-
+
%1 sets %2 to untap normally.
-
+
his permanents
@@ -1766,307 +1794,322 @@
Player
-
-
-
+
+
+
Move to &top of library
ライブラリーの一番上へ移動
-
-
-
+
+
+
Move to &bottom of library
ライブラリーの一番下へ移動
-
-
+
+
Move to &graveyard
墓地へ移動
-
+
&View library
ライブラリーを見る
-
+
Reveal &library to
ライブラリーを公開する
-
+
Reveal t&op card to
一番上のカードを公開する
-
+
Move top cards to &graveyard...
カードを上から墓地へ置く...
-
+
F3
-
+
View &top cards of library...
ライブラリーのカードを上からX枚見る
-
+
&View graveyard
墓地を見る
-
+
F4
-
+
&View sideboard
サイドボードを見る
-
+
Player "%1"
プレイヤー "%1"
-
+
&Hand
手札
-
+
&Library
ライブラリー
-
+
&Graveyard
墓地
-
+
&Sideboard
サイドボード
-
+
View top cards of library
ライブラリーのカードを上からX枚見る
-
+
Number of cards:
カードの枚数:
-
+
&Draw card
カードを引く
-
+
&View exile
追放領域を見る
-
+
&Exile
追放領域
-
-
+
+
Move to &hand
手札に移動する
-
-
+
+
Move to &exile
追放領域へ移動する
-
+
Ctrl+W
-
+
Ctrl+D
-
+
D&raw cards...
カードをX枚引く
-
+
Ctrl+E
-
+
Take &mulligan
マリガンする
-
+
Ctrl+M
-
+
&Shuffle
シャッフル
-
+
Ctrl+S
-
+
&Counters
カウンター
-
+
&Untap all permanents
全てのパーマネントをアンタップする
-
+
Ctrl+U
-
+
R&oll die...
X面ダイスを振る
-
+
Ctrl+I
-
+
&Create token...
トークンを作成する
-
+
Ctrl+T
-
+
C&reate another token
同じトークンを作成する
-
+
Ctrl+G
-
+
S&ay
発言する
+ &Undo last draw
+
+
+
+
Move top cards to &exile...
ライブラリーの一番上からX枚追放する
-
+
Put top card on &bottom
一番上のカードを一番下に置く
-
+
&Reveal to
公開する
-
+
Reveal r&andom card to
ランダムに公開する
-
+
C&ard
カード
-
+
&All players
全てのプレイヤー
-
+
+ Ctrl+F3
+
+
+
+
+ Ctrl+Shift+D
+
+
+
+
Draw cards
カードを引く
-
-
-
-
+
+
+
+
Number:
枚数
-
+
Move top cards to grave
ライブラリーのトップからX枚墓地へ置く
-
+
Move top cards to exile
ライブラリーのトップからX枚追放領域へ置く
-
+
Roll die
ダイスを振る
-
+
Number of sides:
面の数:
-
+
Set power/toughness
パワーとタフネスを設定する
-
+
Please enter the new PT:
新しいP/Tを入力してください
-
+
Set annotation
補足を付ける
-
+
Please enter the new annotation:
新しい補足を付けてください
-
+
Set counters
カウンターを設定する
@@ -2413,22 +2456,27 @@ Please enter a name:
TabMessage
-
+
Personal &talk
個人会話
-
+
&Leave
退出する
-
+
%1 has left the server.
%1はサーバーから退出しました.
-
+
+ %1 has joined the server.
+
+
+
+
Talking to %1
%1と会話
@@ -2436,40 +2484,38 @@ Please enter a name:
TabRoom
-
+
&Say:
発言する
-
+
Chat
チャット
-
+
&Room
部屋
-
+
&Leave room
部屋から出る
-
%1 has joined the room.
- %1は部屋に参加しました
+ %1は部屋に参加しました
-
%1 has left the room.
- %1は部屋から退出しました
+ %1は部屋から退出しました
TabServer
-
+
Server
サーバー
diff --git a/cockatrice/translations/cockatrice_pt-br.ts b/cockatrice/translations/cockatrice_pt-br.ts
index c6a05fbf..01ceec6c 100644
--- a/cockatrice/translations/cockatrice_pt-br.ts
+++ b/cockatrice/translations/cockatrice_pt-br.ts
@@ -659,52 +659,57 @@
&Jogadores:
-
+
+ Game type
+
+
+
+
&Spectators allowed
&Permitir visitantes
-
+
Spectators &need a password to join
Visitantes &precisam de senha para entrar
-
+
Spectators can &chat
Visitantes podem c&onversar
-
+
Spectators see &everything
Visitantes podem ver &tudo
-
+
Spectators
Visitantes
-
+
&OK
&OK
-
+
&Cancel
&Cancelar
-
+
Create game
Criar jogo
-
+
Error
Erro
-
+
Server error.
Erro do servidor.
@@ -901,60 +906,60 @@
GameSelector
-
+
C&reate
&Criar
-
+
&Join
&Entrar
+
+
-
-
Error
Erro
-
+
Wrong password.
Senha incorreta.
-
+
Spectators are not allowed in this game.
Não são permitidos visitantes neste jogo.
-
+
The game is already full.
O jogo está cheio.
-
+
The game does not exist any more.
O jogo não existe mais.
-
+
Join game
Entrar no jogo
-
+
Password:
Senha:
-
+
Games
Jogos
-
+
Show &full games
&Mostrar os jogos cheios
@@ -963,7 +968,7 @@
&Mostrar os jogos cheios
-
+
J&oin as spectator
E&ntrar como visitante
@@ -979,47 +984,52 @@
GamesModel
-
+
yes
sim
-
+
no
não
-
+
Creator
Criador
-
+
Description
Descrição
-
+
yes, free for spectators
sim, livre para visitantes
-
+
not allowed
não permitidos
-
+
+ Game type
+
+
+
+
Password
Senha
-
+
Players
Jogadores
-
+
Spectators
Visitantes
@@ -1146,7 +1156,8 @@
-
+
+
Error
Erro
@@ -1166,87 +1177,98 @@
Erro de ligação:%1
-
Protocol version mismatch. Local version: %1, remote version: %2.
- Versão dos protocolos incompatível. Versão local:%1, versão remota:%2.
+ Versão dos protocolos incompatível. Versão local:%1, versão remota:%2.
-
+
+ You are trying to connect to an obsolete server. Please downgrade your Cockatrice version or connect to a suitable server.
+Local version is %1, remote version is %2.
+
+
+
+
+ Your Cockatrice client is obsolete. Please update your Cockatrice version.
+Local version is %1, remote version is %2.
+
+
+
+
Connecting to %1...
Conectando a %1...
-
+
Disconnected
Desconectado
-
+
Logged in at %1
Logado em %1
-
+
&Connect...
&Conectar...
-
+
&Disconnect
&Desconectar
-
+
Start &local game...
Iniciar jogo &local...
-
+
&Deck editor
Editor de &decks
-
+
&Full screen
Tela &cheia
-
+
Ctrl+F
Ctrl+F
-
+
&Settings...
&Configurações...
-
+
&Exit
&Sair
-
+
&Cockatrice
&Cockatrice
-
+
&About Cockatrice
So&bre o Cockatrice
-
+
&Help
&Ajuda
-
+
Are you sure?
Você tem certeza?
-
+
There are still open games. Are you sure you want to quit?
Ainda existem jogos abertos. Você tem certeza que deseja sair?
@@ -1299,148 +1321,158 @@
%1 tirou um %2 com um dado de %3 lados.
-
+
+ %1 undoes his last draw.
+
+
+
+
+ %1 undoes his last draw (%2).
+
+
+
+
from table
vindo do campo de batalha
-
+
from graveyard
vindo do cemitério
-
+
from exile
vindo do exílio
-
+
from hand
vindo da mão
-
+
the bottom card of his library
o card do fundo do seu grimório
-
+
from the bottom of his library
vindo do fundo do seu grimório
-
+
the top card of his library
o card do topo do seu grimório
-
+
from the top of his library
vindo do topo do seu grimório
-
+
from library
vindo do grimório
-
+
from sideboard
vindo do sideboard
-
+
from the stack
vindo da pilha
-
+
%1 gives %2 control over %3.
%1 dá controle para %2 sobre %3.
-
+
%1 puts %2 into play%3.
%1 põe %2 no campo de batalha %3.
-
+
%1 puts %2%3 into graveyard.
%1 põe %2 no cemitério%3.
-
+
%1 exiles %2%3.
%1 exila %2%3.
-
+
%1 moves %2%3 to hand.
%1 move %2 para a mão%3.
-
+
%1 puts %2%3 into his library.
%1 põe %2 no seu grimório%3.
-
+
%1 puts %2%3 on bottom of his library.
%1 põe %2 no fundo do seu grimório%3.
-
+
%1 puts %2%3 on top of his library.
%1 põe %2 no topo do seu grimório%3.
-
+
%1 puts %2%3 into his library at position %4.
%1 põe %2 no seu grimório na posição %4%3.
-
+
%1 moves %2%3 to sideboard.
%1 move %2 para o sideboard%3.
-
+
%1 plays %2%3.
%1 põe %2 na pilha%3.
-
-
+
+
a card
um card
-
+
%1 flips %2 face-down.
%1 vira %2 para baixo.
-
+
%1 flips %2 face-up.
%1 vira %2 para cima.
-
+
%1 attaches %2 to %3's %4.
%1 anexa %2 a %4 de %3.
-
+
%1 unattaches %2.
%1 desanexa %2.
-
+
%1 points from %2's %3 to %4's %5.
%1 aponta para %5 de %4 com %3 de %2.
-
+
%1 places %n counter(s) (%2) on %3 (now %4).
%1 põe %n marcador(es) (%2) em %3 (agora com %4).
@@ -1448,7 +1480,7 @@
-
+
%1 removes %n counter(s) (%2) from %3 (now %4).
%1 tira %n marcador(es) (%2) em %3 (agora com %4).
@@ -1456,37 +1488,37 @@
-
+
red
vermelho
-
+
yellow
amarelo
-
+
green
verde
-
+
%1 sets counter %2 to %3 (%4%5).
%1 altera o marcador %2 para %3 (%4%5).
-
+
%1 sets PT of %2 to %3.
%1 altera o P/R de %2 para %3.
-
+
%1 sets annotation of %2 to %3.
%1 altera a nota de %2 para%3.
-
+
%1 is looking at the top %2 cards %3.
%1 está olhando para os %2 cards do topo %3.
@@ -1551,52 +1583,52 @@
%1 compra %2 cards.
-
+
%1 destroys %2.
%1 destrói %2.
-
+
%1 creates token: %2%3.
%1 cria a ficha: %2%3.
-
+
%1 points from %2's %3 to %4.
%1 aponta para %4 com %3 de %2 .
-
+
%1 %2 %3.
%1 %2 %3.
-
+
%1 is looking at %2.
%1 está olhando para %2.
-
+
%1 stops looking at %2.
%1 para de olhar para %2.
-
+
%1 reveals %2 to %3.
%1 revela %2 para %3.
-
+
%1 reveals %2.
%1 revela %2.
-
+
ending phase
fase final
-
+
It is now %1's turn.
Agora é o turno de %1.
@@ -1606,102 +1638,102 @@
%1 embaralha o seu grimório.
-
+
%1 randomly reveals %2%3 to %4.
%1 revela aleatoriamente %2%3. para %4.
-
+
%1 randomly reveals %2%3.
%1 revela aleatoriamente %2%3.
-
+
%1 reveals %2%3 to %4.
%1 revela %2%3 para %4.
-
+
%1 reveals %2%3.
%1 revela %2%3.
-
+
untap step
etapa de desvirar
-
+
upkeep step
etapa de manutenção
-
+
draw step
etapa de compra
-
+
first main phase
primeira fase principal
-
+
beginning of combat step
etapa de início de combate
-
+
declare attackers step
etapa de declaracão de atacantes
-
+
declare blockers step
etapa de declaração de bloqueadores
-
+
combat damage step
etapa de dano de combate
-
+
end of combat step
etapa de fim de combate
-
+
second main phase
segunda fase principal
-
+
It is now the %1.
Agora é a %1.
-
+
taps
vira
-
+
untaps
desvira
-
+
%1 sets %2 to not untap normally.
%1 define que %2 não desvira normalmente.
-
+
%1 sets %2 to untap normally.
%1 define que %2 desvira normalmente.
-
+
his permanents
as suas permanentes
@@ -1790,307 +1822,322 @@
Player
-
-
-
+
+
+
Move to &top of library
Mover para o &topo do grimório
-
-
-
+
+
+
Move to &bottom of library
Mover para o &fundo do grimório
-
-
+
+
Move to &graveyard
Mover para o &cemitério
-
+
&View library
&Ver grimório
-
+
Reveal &library to
Revelar o &grimório para
-
+
Reveal t&op card to
Revelar o card do t&opo para
-
+
Move top cards to &graveyard...
Mover os cards do topo para o ce&mitério...
-
+
F3
F3
-
+
View &top cards of library...
Ver os cards do to&po do grimório...
-
+
&View graveyard
V&er cemitério
-
+
F4
F4
-
+
&View sideboard
&Ver sideboard
-
+
Player "%1"
Jogador "%1"
-
+
&Hand
&Mão
-
+
&Library
&Grimório
-
+
&Graveyard
&Cemitério
-
+
&Sideboard
&Sideboard
-
+
View top cards of library
Ver os cards do topo do grimório
-
+
Number of cards:
Número de cards:
-
+
&Draw card
Co&mprar card
-
+
&View exile
&Ver exílio
-
+
&Exile
&Exílio
-
-
+
+
Move to &hand
Mo&ver para a mão
-
-
+
+
Move to &exile
Mover para o &exílio
-
+
Ctrl+W
Ctrl+W
-
+
Ctrl+D
Ctrl+D
-
+
D&raw cards...
Comprar car&ds...
-
+
Ctrl+E
Ctrl+E
-
+
Take &mulligan
Pedir mu&lligan
-
+
Ctrl+M
Ctrl+M
-
+
&Shuffle
&Embaralhar
-
+
Ctrl+S
Ctrl+S
-
+
&Counters
&Marcadores
-
+
&Untap all permanents
Des&virar todos as permanentes
-
+
Ctrl+U
Ctrl+U
-
+
R&oll die...
&Jogar dado...
-
+
Ctrl+I
Ctrl+I
-
+
&Create token...
Criar fich&a...
-
+
Ctrl+T
Ctrl+T
-
+
C&reate another token
Criar &outra ficha
-
+
Ctrl+G
Ctrl+G
-
+
S&ay
&Falar
+ &Undo last draw
+
+
+
+
Move top cards to &exile...
Mover os cards do topo para o e&xílio...
-
+
Put top card on &bottom
Colocar o card do topo no &fundo
-
+
&Reveal to
Re&velar para
-
+
Reveal r&andom card to
Revelar card alea&tório para
-
+
C&ard
C&ard
-
+
&All players
To&dos os jogadores
-
+
+ Ctrl+F3
+
+
+
+
+ Ctrl+Shift+D
+
+
+
+
Draw cards
Comprar cards
-
-
-
-
+
+
+
+
Number:
Número:
-
+
Move top cards to grave
Mover os cards do topo para o cemitério
-
+
Move top cards to exile
Mover os cards do topo para o exílio
-
+
Roll die
Jogar dado
-
+
Number of sides:
Número de lados:
-
+
Set power/toughness
Alterar poder/resistência
-
+
Please enter the new PT:
Por favor, entre com o novo P/R:
-
+
Set annotation
Alterar nota
-
+
Please enter the new annotation:
Por favor, entre com a nova nota:
-
+
Set counters
Alterar marcadores
@@ -2438,22 +2485,27 @@ Por favor, entre um nome:
TabMessage
-
+
Personal &talk
Chat &privado
-
+
&Leave
&Sair
-
+
%1 has left the server.
%1 saiu do servidor.
-
+
+ %1 has joined the server.
+
+
+
+
Talking to %1
Falando com %1
@@ -2461,40 +2513,38 @@ Por favor, entre um nome:
TabRoom
-
+
&Say:
&Falar:
-
+
Chat
Chat
-
+
&Room
&Sala
-
+
&Leave room
S&air da sala
-
%1 has joined the room.
- %1 entrou na sala.
+ %1 entrou na sala.
-
%1 has left the room.
- %1 saiu da sala.
+ %1 saiu da sala.
TabServer
-
+
Server
Servidor
diff --git a/cockatrice/translations/cockatrice_pt.ts b/cockatrice/translations/cockatrice_pt.ts
index 9aeafc1b..8ee716c4 100644
--- a/cockatrice/translations/cockatrice_pt.ts
+++ b/cockatrice/translations/cockatrice_pt.ts
@@ -659,52 +659,57 @@
&Jogadores:
-
+
+ Game type
+
+
+
+
&Spectators allowed
&Espectadores permitidos
-
+
Spectators &need a password to join
Espectadores &necessitam de password para aceder
-
+
Spectators can &chat
Espectadores podem c&onversar
-
+
Spectators see &everything
Espectadores podem ver &tudo
-
+
Spectators
Espectadores
-
+
&OK
O&K
-
+
&Cancel
&Cancelar
-
+
Create game
Criar jogo
-
+
Error
Erro
-
+
Server error.
Erro do servidor.
@@ -901,50 +906,50 @@
GameSelector
+
+
-
-
Error
Erro
-
+
Wrong password.
Password incorrecta.
-
+
Spectators are not allowed in this game.
Não são permitidos espectadores neste jogo.
-
+
The game is already full.
O jogo já se encontra cheio.
-
+
The game does not exist any more.
O jogo já não existe.
-
+
Join game
Entrar no jogo
-
+
Password:
Password:
-
+
Games
Jogos
-
+
Show &full games
&Mostrar jogos cheios
@@ -953,17 +958,17 @@
&Mostrar jogos cheios
-
+
C&reate
&Criar
-
+
&Join
&Entrar
-
+
J&oin as spectator
Entrar como &espectador
@@ -979,47 +984,52 @@
GamesModel
-
+
yes
sim
-
+
yes, free for spectators
sim, livre para espectadores
-
+
no
não
-
+
not allowed
não permitidos
-
+
Description
Descrição
-
+
Creator
Criador
-
+
+ Game type
+
+
+
+
Password
Password
-
+
Players
Jogadores
-
+
Spectators
Espectadores
@@ -1150,7 +1160,8 @@
-
+
+
Error
Erro
@@ -1170,87 +1181,98 @@
Erro de ligação:%1
-
Protocol version mismatch. Local version: %1, remote version: %2.
- Versão dos protocolos incompatível. Versão local:%1, versão remota:%2.
+ Versão dos protocolos incompatível. Versão local:%1, versão remota:%2.
-
+
+ You are trying to connect to an obsolete server. Please downgrade your Cockatrice version or connect to a suitable server.
+Local version is %1, remote version is %2.
+
+
+
+
+ Your Cockatrice client is obsolete. Please update your Cockatrice version.
+Local version is %1, remote version is %2.
+
+
+
+
Connecting to %1...
Ligando a %1...
-
+
Disconnected
Desligado
-
+
Logged in at %1
Logado em %1
-
+
&Connect...
&Ligar...
-
+
&Disconnect
&Desligar
-
+
Start &local game...
Começar &jogo local...
-
+
&Deck editor
&Editor de decks
-
+
&Full screen
Ecrã &inteiro
-
+
Ctrl+F
Ctrl+F
-
+
&Settings...
&Configurações...
-
+
&Exit
&Sair
-
+
&Cockatrice
&Cockatrice
-
+
&About Cockatrice
S&obre o Cockatrice
-
+
&Help
&Ajuda
-
+
Are you sure?
Tens a certeza?
-
+
There are still open games. Are you sure you want to quit?
Ainda há jogos abertos. Tem a certeza que deseja sair?
@@ -1368,163 +1390,173 @@
%1 compra %2 cartas.
-
+
from table
vindo da mesa
-
+
from graveyard
vindo do cemitério
-
+
from exile
vindo do exílio
-
+
from hand
vindo da mão
-
+
the bottom card of his library
a carta do fundo do seu grimório
-
+
from the bottom of his library
do fundo do seu grimório
-
+
the top card of his library
a carta do topo do seu grimório
-
+
from the top of his library
do topo do seu grimório
-
+
from library
do grimório
-
+
from sideboard
do sideboard
-
+
from the stack
da pilha
-
+
%1 puts %2 into play%3.
%1 coloca %2 em jogo %3.
-
+
%1 puts %2%3 into graveyard.
%1 coloca %2%3 no cemitério.
-
+
%1 exiles %2%3.
%1 exila %2%3.
-
+
%1 moves %2%3 to hand.
%1 move %2%3 para a mão.
-
+
%1 puts %2%3 into his library.
%1 coloca %2%3 no seu grimório.
-
+
%1 puts %2%3 on bottom of his library.
%1 coloca %2%3 no topo do seu grimório.
-
+
%1 puts %2%3 on top of his library.
%1 coloca %2%3 no topo do seu grimório.
-
+
%1 puts %2%3 into his library at position %4.
%1 coloca %2%3 no seu grimório na posição %4.
-
+
%1 moves %2%3 to sideboard.
%1 move %2%3 para o sideboard.
-
+
%1 plays %2%3.
%1 joga %2%3.
-
-
+
+
a card
uma carta
-
+
+ %1 undoes his last draw.
+
+
+
+
+ %1 undoes his last draw (%2).
+
+
+
+
%1 gives %2 control over %3.
%1 dá controlo sobre %3 a %2.
-
+
%1 flips %2 face-down.
%1 volta a face de %2 para baixo.
-
+
%1 flips %2 face-up.
%1 volta a face de %2 para cima.
-
+
%1 destroys %2.
%1 destroí %2.
-
+
%1 attaches %2 to %3's %4.
%1 anexa %2 a %4 de %3.
-
+
%1 unattaches %2.
%1 desanexa %2.
-
+
%1 creates token: %2%3.
%1 cria ficha: %2%3.
-
+
%1 points from %2's %3 to %4.
%1 aponta de %3 de %2 para %4.
-
+
%1 points from %2's %3 to %4's %5.
%1 aponta de %3 de %2 para %5 de %4.
-
+
%1 places %n counter(s) (%2) on %3 (now %4).
%1 coloca %n marcador (%2)de %3 (agora com %4).
@@ -1532,7 +1564,7 @@
-
+
%1 removes %n counter(s) (%2) from %3 (now %4).
%1 remove %n marcador (%2)de %3 (agora com %4).
@@ -1540,172 +1572,172 @@
-
+
red
vermelho
-
+
yellow
amarelo
-
+
green
verde
-
+
his permanents
as suas permanentes
-
+
%1 %2 %3.
%1 %2 %3.
-
+
taps
vira
-
+
untaps
desvira
-
+
%1 sets counter %2 to %3 (%4%5).
%1 altera o número de marcadores %2 para %3(%4%5).
-
+
%1 sets %2 to not untap normally.
%1 define %2 para não desvirar normalmente.
-
+
%1 sets %2 to untap normally.
%1 define %2 para desvirar normalmente.
-
+
%1 sets PT of %2 to %3.
%1 define o P/R de %2 como %3.
-
+
%1 sets annotation of %2 to %3.
%1 coloca uma nota de %2 em%3.
-
+
%1 is looking at the top %2 cards %3.
%1 está a olhar para as %2 cartas do topo %3.
-
+
%1 is looking at %2.
%1 está a olhar para %2.
-
+
%1 stops looking at %2.
%1 para de olhar para %2.
-
+
%1 reveals %2 to %3.
%1 revela %2 a %3.
-
+
%1 reveals %2.
%1 revela %2.
-
+
%1 randomly reveals %2%3 to %4.
%1 revela aleatoreamente %2%3. a %4.
-
+
%1 randomly reveals %2%3.
%1 revela aleatoreamente %2%3.
-
+
%1 reveals %2%3 to %4.
%1 revela %2%3 a %4.
-
+
%1 reveals %2%3.
%1 revela %2%3.
-
+
It is now %1's turn.
É agora o turno de %1.
-
+
untap step
Etapa de Desvirar
-
+
upkeep step
Etapa de Manutenção
-
+
draw step
Etapa de Compra
-
+
first main phase
1ª Fase Principal (pré-combate)
-
+
beginning of combat step
Etapa de Início de Combate
-
+
declare attackers step
Etapa de Declaração de Atacantes
-
+
declare blockers step
Etapa de Declaração de Bloqueadores
-
+
combat damage step
Etapa de Dano de Combate
-
+
end of combat step
Etapa de Fim de Combate
-
+
second main phase
2ª Fase Principal (pós-combate)
-
+
ending phase
Fase Final
-
+
It is now the %1.
É agora a %1.
@@ -1794,307 +1826,322 @@
Player
-
+
&View graveyard
&Ver cemitério
-
+
&View exile
&Ver exílio
-
+
Player "%1"
Jogador "%1"
-
+
&Graveyard
&Cemitério
-
+
&Exile
&Exílio
-
-
-
+
+
+
Move to &top of library
Mover para o &topo do grimório
-
-
-
+
+
+
Move to &bottom of library
Mover para o &fundo do grimório
-
-
+
+
Move to &graveyard
Mover para o &cemitério
-
-
+
+
Move to &exile
Mover para o &exílio
-
-
+
+
Move to &hand
Mover para a &mão
-
+
&View library
&Ver grimório
-
+
View &top cards of library...
Ver as cartas do &topo do grimório...
-
+
Reveal &library to
Revelar &grimório a
-
+
Reveal t&op card to
Revelar carta do t&opo a
-
+
&View sideboard
&Ver sideboard
-
+
&Draw card
&Comprar carta
-
+
D&raw cards...
C&omprar cartas...
-
+
+ &Undo last draw
+
+
+
+
Take &mulligan
Fazer &mulligan
-
+
&Shuffle
&Baralhar
-
+
Move top cards to &graveyard...
Mover as cartas do topo para o &cemitério...
-
+
Move top cards to &exile...
Mover as cartas do topo para o &exílio...
-
+
Put top card on &bottom
Colocar carta do topo no &fundo
-
+
&Hand
&Mão
-
+
&Reveal to
&Revelar a
-
+
Reveal r&andom card to
Revelar carta &aleatória a
-
+
&Sideboard
&Sideboard
-
+
&Library
&Grimório
-
+
&Counters
&Marcadores
-
+
&Untap all permanents
&Desvirar topas as permanentes
-
+
R&oll die...
&Lançar dado...
-
+
&Create token...
Criar fic&ha...
-
+
C&reate another token
Cr&iar outra ficha
-
+
S&ay
&Dizer
-
+
C&ard
C&arta
-
+
&All players
Todos os &jogadores
-
+
+ Ctrl+F3
+
+
+
+
F3
F3
-
+
Ctrl+W
Ctrl+W
-
+
F4
F4
-
+
Ctrl+D
Ctrl+D
-
+
Ctrl+E
Ctrl+E
-
+
+ Ctrl+Shift+D
+
+
+
+
Ctrl+M
Ctrl+M
-
+
Ctrl+S
Ctrl+S
-
+
Ctrl+U
Ctrl+U
-
+
Ctrl+I
Ctrl+I
-
+
Ctrl+T
Ctrl+T
-
+
Ctrl+G
Ctrl+G
-
+
View top cards of library
Ver as cartas do topo do grimório
-
+
Number of cards:
Número de cartas:
-
+
Draw cards
Comprar cartas
-
-
-
-
+
+
+
+
Number:
Número:
-
+
Move top cards to grave
Mover as cartas to topo para o cemitério
-
+
Move top cards to exile
Mover as cartas to topo para o exílio
-
+
Roll die
Lançar dado
-
+
Number of sides:
Número de faces:
-
+
Set power/toughness
Definir poder/resistência
-
+
Please enter the new PT:
Por favor introduza o novo P/R:
-
+
Set annotation
Colocar nota
-
+
Please enter the new annotation:
Por favor introduza a nova nota:
-
+
Set counters
Definir marcadores
@@ -2442,22 +2489,27 @@ Por favor introduza um nome:
TabMessage
-
+
Personal &talk
Conversação &privada
-
+
&Leave
&Abandonar
-
+
%1 has left the server.
%1 abandonou o servidor.
-
+
+ %1 has joined the server.
+
+
+
+
Talking to %1
Falar para %1
@@ -2465,40 +2517,38 @@ Por favor introduza um nome:
TabRoom
-
+
&Say:
&Dizer:
-
+
Chat
-
+
&Room
&Sala
-
+
&Leave room
&Abandonar a sala
-
%1 has joined the room.
- %1 entrou na sala.
+ %1 entrou na sala.
-
%1 has left the room.
- %1 abandonou na sala.
+ %1 abandonou na sala.
TabServer
-
+
Server
Servidor
diff --git a/cockatrice/translations/cockatrice_ru.ts b/cockatrice/translations/cockatrice_ru.ts
new file mode 100644
index 00000000..a47b354a
--- /dev/null
+++ b/cockatrice/translations/cockatrice_ru.ts
@@ -0,0 +1,2748 @@
+
+
+
+
+ AbstractCounter
+
+
+ &Set counter...
+
+
+
+
+ Ctrl+L
+
+
+
+
+ F11
+
+
+
+
+ F12
+
+
+
+
+ Set counter
+
+
+
+
+ New value for counter '%1':
+
+
+
+
+ AppearanceSettingsPage
+
+
+ Zone background pictures
+
+
+
+
+ Path to hand background:
+
+
+
+
+ Path to stack background:
+
+
+
+
+ Path to table background:
+
+
+
+
+ Path to player info background:
+
+
+
+
+ Path to picture of card back:
+
+
+
+
+ Hand layout
+
+
+
+
+ Display hand horizontally (wastes space)
+
+
+
+
+ Table grid layout
+
+
+
+
+ Invert vertical coordinate
+
+
+
+
+ Zone view layout
+
+
+
+
+ Sort by name
+
+
+
+
+ Sort by type
+
+
+
+
+
+
+
+
+ Choose path
+
+
+
+
+ CardDatabaseModel
+
+
+ Name
+
+
+
+
+ Sets
+
+
+
+
+ Mana cost
+
+
+
+
+ Card type
+
+
+
+
+ P/T
+
+
+
+
+ CardInfoWidget
+
+
+ Name:
+
+
+
+
+ Mana cost:
+
+
+
+
+ Card type:
+
+
+
+
+ P / T:
+
+
+
+
+ CardItem
+
+
+ &Play
+
+
+
+
+ &Hide
+
+
+
+
+ &Tap
+
+
+
+
+ &Untap
+
+
+
+
+ Toggle &normal untapping
+
+
+
+
+ &Flip
+
+
+
+
+ &Clone
+
+
+
+
+ &Attach to card...
+
+
+
+
+ Ctrl+A
+
+
+
+
+ Unattac&h
+
+
+
+
+ Set &P/T...
+
+
+
+
+ &Set annotation...
+
+
+
+
+ red
+
+
+
+
+ yellow
+
+
+
+
+ green
+
+
+
+
+ &Add counter (%1)
+
+
+
+
+ &Remove counter (%1)
+
+
+
+
+ &Set counters (%1)...
+
+
+
+
+ &top of library
+
+
+
+
+ &bottom of library
+
+
+
+
+ &graveyard
+
+
+
+
+ Ctrl+Del
+
+
+
+
+ &exile
+
+
+
+
+ &Move to
+
+
+
+
+ CardZone
+
+
+ his hand
+ nominative
+
+
+
+
+ %1's hand
+ nominative
+
+
+
+
+ of his hand
+ genitive
+
+
+
+
+ of %1's hand
+ genitive
+
+
+
+
+ his hand
+ accusative
+
+
+
+
+ %1's hand
+ accusative
+
+
+
+
+ his library
+ nominative
+
+
+
+
+ %1's library
+ nominative
+
+
+
+
+ of his library
+ genitive
+
+
+
+
+ of %1's library
+ genitive
+
+
+
+
+ his library
+ accusative
+
+
+
+
+ %1's library
+ accusative
+
+
+
+
+ his graveyard
+ nominative
+
+
+
+
+ %1's graveyard
+ nominative
+
+
+
+
+ of his graveyard
+ genitive
+
+
+
+
+ of %1's graveyard
+ genitive
+
+
+
+
+ his graveyard
+ accusative
+
+
+
+
+ %1's graveyard
+ accusative
+
+
+
+
+ his exile
+ nominative
+
+
+
+
+ %1's exile
+ nominative
+
+
+
+
+ of his exile
+ genitive
+
+
+
+
+ of %1's exile
+ genitive
+
+
+
+
+ his exile
+ accusative
+
+
+
+
+ %1's exile
+ accusative
+
+
+
+
+ his sideboard
+ nominative
+
+
+
+
+ %1's sideboard
+ nominative
+
+
+
+
+ of his sideboard
+ genitive
+
+
+
+
+ of %1's sideboard
+ genitive
+
+
+
+
+ his sideboard
+ accusative
+
+
+
+
+ %1's sideboard
+ accusative
+
+
+
+
+ DeckListModel
+
+
+ Number
+
+
+
+
+ Card
+
+
+
+
+ DeckViewContainer
+
+
+ Load &local deck
+
+
+
+
+ Load d&eck from server
+
+
+
+
+ Ready to s&tart
+
+
+
+
+ Load deck
+
+
+
+
+ DlgCardSearch
+
+
+ Card name:
+
+
+
+
+ Card text:
+
+
+
+
+ Card type (OR):
+
+
+
+
+ Color (OR):
+
+
+
+
+ O&K
+
+
+
+
+ &Cancel
+
+
+
+
+ Card search
+
+
+
+
+ DlgConnect
+
+
+ &Host:
+
+
+
+
+ &Port:
+
+
+
+
+ Player &name:
+
+
+
+
+ P&assword:
+
+
+
+
+ &OK
+
+
+
+
+ &Cancel
+
+
+
+
+ Connect to server
+
+
+
+
+ DlgCreateGame
+
+
+ &Description:
+
+
+
+
+ &Password:
+
+
+
+
+ P&layers:
+
+
+
+
+ Game type
+
+
+
+
+ &Spectators allowed
+
+
+
+
+ Spectators &need a password to join
+
+
+
+
+ Spectators can &chat
+
+
+
+
+ Spectators see &everything
+
+
+
+
+ Spectators
+
+
+
+
+ &OK
+
+
+
+
+ &Cancel
+
+
+
+
+ Create game
+
+
+
+
+ Error
+
+
+
+
+ Server error.
+
+
+
+
+ DlgCreateToken
+
+
+ &Name:
+
+
+
+
+ Token
+
+
+
+
+ C&olor:
+
+
+
+
+ white
+
+
+
+
+ blue
+
+
+
+
+ black
+
+
+
+
+ red
+
+
+
+
+ green
+
+
+
+
+ multicolor
+
+
+
+
+ colorless
+
+
+
+
+ &P/T:
+
+
+
+
+ &Annotation:
+
+
+
+
+ &Destroy token when it leaves the table
+
+
+
+
+ &OK
+
+
+
+
+ &Cancel
+
+
+
+
+ Create token
+
+
+
+
+ DlgLoadDeckFromClipboard
+
+
+ &Refresh
+
+
+
+
+ &OK
+
+
+
+
+ &Cancel
+
+
+
+
+ Load deck from clipboard
+
+
+
+
+ Error
+
+
+
+
+ Invalid deck list.
+
+
+
+
+ DlgLoadRemoteDeck
+
+
+ O&K
+
+
+
+
+ &Cancel
+
+
+
+
+ Load deck
+
+
+
+
+ DlgSettings
+
+
+
+
+ Error
+
+
+
+
+ Your card database is invalid. Would you like to go back and set the correct path?
+
+
+
+
+ The path to your deck directory is invalid. Would you like to go back and set the correct path?
+
+
+
+
+ The path to your card pictures directory is invalid. Would you like to go back and set the correct path?
+
+
+
+
+ Settings
+
+
+
+
+ General
+
+
+
+
+ Appearance
+
+
+
+
+ User interface
+
+
+
+
+ Messages
+
+
+
+
+ &Close
+
+
+
+
+ GameSelector
+
+
+
+
+
+ Error
+
+
+
+
+ Wrong password.
+
+
+
+
+ Spectators are not allowed in this game.
+
+
+
+
+ The game is already full.
+
+
+
+
+ The game does not exist any more.
+
+
+
+
+ Join game
+
+
+
+
+ Password:
+
+
+
+
+ Games
+
+
+
+
+ Show &full games
+
+
+
+
+ C&reate
+
+
+
+
+ &Join
+
+
+
+
+ J&oin as spectator
+
+
+
+
+ GameView
+
+
+ Esc
+
+
+
+
+ GamesModel
+
+
+ yes
+
+
+
+
+ yes, free for spectators
+
+
+
+
+ no
+
+
+
+
+ not allowed
+
+
+
+
+ Description
+
+
+
+
+ Creator
+
+
+
+
+ Game type
+
+
+
+
+ Password
+
+
+
+
+ Players
+
+
+
+
+ Spectators
+
+
+
+
+ GeneralSettingsPage
+
+
+
+ English
+
+
+
+
+
+
+ Choose path
+
+
+
+
+ Personal settings
+
+
+
+
+ Language:
+
+
+
+
+ Download card pictures on the fly
+
+
+
+
+ Paths
+
+
+
+
+ Decks directory:
+
+
+
+
+ Pictures directory:
+
+
+
+
+ Path to card database:
+
+
+
+
+ MainWindow
+
+
+ Number of players
+
+
+
+
+ Please enter the number of players.
+
+
+
+
+
+ Player %1
+
+
+
+
+ About Cockatrice
+
+
+
+
+ Version %1
+
+
+
+
+ Authors:
+
+
+
+
+ Translators:
+
+
+
+
+ Spanish:
+
+
+
+
+ Portugese (Portugal):
+
+
+
+
+ Portugese (Brazil):
+
+
+
+
+ French:
+
+
+
+
+ Japanese:
+
+
+
+
+
+
+
+
+ Error
+
+
+
+
+ Server timeout
+
+
+
+
+ Invalid login data.
+
+
+
+
+ Socket error: %1
+
+
+
+
+ You are trying to connect to an obsolete server. Please downgrade your Cockatrice version or connect to a suitable server.
+Local version is %1, remote version is %2.
+
+
+
+
+ Your Cockatrice client is obsolete. Please update your Cockatrice version.
+Local version is %1, remote version is %2.
+
+
+
+
+ Connecting to %1...
+
+
+
+
+ Disconnected
+
+
+
+
+ Logged in at %1
+
+
+
+
+ &Connect...
+
+
+
+
+ &Disconnect
+
+
+
+
+ Start &local game...
+
+
+
+
+ &Deck editor
+
+
+
+
+ &Full screen
+
+
+
+
+ Ctrl+F
+
+
+
+
+ &Settings...
+
+
+
+
+ &Exit
+
+
+
+
+ &Cockatrice
+
+
+
+
+ &About Cockatrice
+
+
+
+
+ &Help
+
+
+
+
+ Are you sure?
+
+
+
+
+ There are still open games. Are you sure you want to quit?
+
+
+
+
+ MessageLogWidget
+
+
+ Connecting to %1...
+
+
+
+
+ Connected.
+
+
+
+
+ Disconnected from server.
+
+
+
+
+ Invalid password.
+
+
+
+
+ Protocol version mismatch. Client: %1, Server: %2
+
+
+
+
+ Protocol error.
+
+
+
+
+ You have joined game #%1.
+
+
+
+
+ %1 has joined the game.
+
+
+
+
+ %1 has left the game.
+
+
+
+
+ The game has been closed.
+
+
+
+
+ %1 is now watching the game.
+
+
+
+
+ %1 is not watching the game any more.
+
+
+
+
+ %1 has loaded a local deck.
+
+
+
+
+ %1 has loaded deck #%2.
+
+
+
+
+ %1 is ready to start the game.
+
+
+
+
+ %1 is not ready to start the game any more.
+
+
+
+
+ %1 has conceded the game.
+
+
+
+
+ The game has started.
+
+
+
+
+ %1 shuffles his library.
+
+
+
+
+ %1 rolls a %2 with a %3-sided die.
+
+
+
+
+ %1 draws a card.
+
+
+
+
+ %1 draws %2 cards.
+
+
+
+
+ %1 undoes his last draw.
+
+
+
+
+ %1 undoes his last draw (%2).
+
+
+
+
+ from table
+
+
+
+
+ from graveyard
+
+
+
+
+ from exile
+
+
+
+
+ from hand
+
+
+
+
+ the bottom card of his library
+
+
+
+
+ from the bottom of his library
+
+
+
+
+ the top card of his library
+
+
+
+
+ from the top of his library
+
+
+
+
+ from library
+
+
+
+
+ from sideboard
+
+
+
+
+ from the stack
+
+
+
+
+
+ a card
+
+
+
+
+ %1 gives %2 control over %3.
+
+
+
+
+ %1 puts %2 into play%3.
+
+
+
+
+ %1 puts %2%3 into graveyard.
+
+
+
+
+ %1 exiles %2%3.
+
+
+
+
+ %1 moves %2%3 to hand.
+
+
+
+
+ %1 puts %2%3 into his library.
+
+
+
+
+ %1 puts %2%3 on bottom of his library.
+
+
+
+
+ %1 puts %2%3 on top of his library.
+
+
+
+
+ %1 puts %2%3 into his library at position %4.
+
+
+
+
+ %1 moves %2%3 to sideboard.
+
+
+
+
+ %1 plays %2%3.
+
+
+
+
+ %1 flips %2 face-down.
+
+
+
+
+ %1 flips %2 face-up.
+
+
+
+
+ %1 destroys %2.
+
+
+
+
+ %1 attaches %2 to %3's %4.
+
+
+
+
+ %1 unattaches %2.
+
+
+
+
+ %1 creates token: %2%3.
+
+
+
+
+ %1 points from %2's %3 to %4.
+
+
+
+
+ %1 points from %2's %3 to %4's %5.
+
+
+
+
+ %1 places %n counter(s) (%2) on %3 (now %4).
+
+
+
+
+
+
+
+
+ %1 removes %n counter(s) (%2) from %3 (now %4).
+
+
+
+
+
+
+
+
+ red
+
+
+
+
+ yellow
+
+
+
+
+ green
+
+
+
+
+ his permanents
+
+
+
+
+ %1 %2 %3.
+
+
+
+
+ taps
+
+
+
+
+ untaps
+
+
+
+
+ %1 sets counter %2 to %3 (%4%5).
+
+
+
+
+ %1 sets %2 to not untap normally.
+
+
+
+
+ %1 sets %2 to untap normally.
+
+
+
+
+ %1 sets PT of %2 to %3.
+
+
+
+
+ %1 sets annotation of %2 to %3.
+
+
+
+
+ %1 is looking at the top %2 cards %3.
+
+
+
+
+ %1 is looking at %2.
+
+
+
+
+ %1 stops looking at %2.
+
+
+
+
+ %1 reveals %2 to %3.
+
+
+
+
+ %1 reveals %2.
+
+
+
+
+ %1 randomly reveals %2%3 to %4.
+
+
+
+
+ %1 randomly reveals %2%3.
+
+
+
+
+ %1 reveals %2%3 to %4.
+
+
+
+
+ %1 reveals %2%3.
+
+
+
+
+ It is now %1's turn.
+
+
+
+
+ untap step
+
+
+
+
+ upkeep step
+
+
+
+
+ draw step
+
+
+
+
+ first main phase
+
+
+
+
+ beginning of combat step
+
+
+
+
+ declare attackers step
+
+
+
+
+ declare blockers step
+
+
+
+
+ combat damage step
+
+
+
+
+ end of combat step
+
+
+
+
+ second main phase
+
+
+
+
+ ending phase
+
+
+
+
+ It is now the %1.
+
+
+
+
+ MessagesSettingsPage
+
+
+ Add message
+
+
+
+
+ Message:
+
+
+
+
+ &Add
+
+
+
+
+ &Remove
+
+
+
+
+ PhasesToolbar
+
+
+ Untap step
+
+
+
+
+ Upkeep step
+
+
+
+
+ Draw step
+
+
+
+
+ First main phase
+
+
+
+
+ Beginning of combat step
+
+
+
+
+ Declare attackers step
+
+
+
+
+ Declare blockers step
+
+
+
+
+ Combat damage step
+
+
+
+
+ End of combat step
+
+
+
+
+ Second main phase
+
+
+
+
+ End of turn step
+
+
+
+
+ Player
+
+
+ &View graveyard
+
+
+
+
+ &View exile
+
+
+
+
+ Player "%1"
+
+
+
+
+ &Graveyard
+
+
+
+
+ &Exile
+
+
+
+
+
+
+ Move to &top of library
+
+
+
+
+
+
+ Move to &bottom of library
+
+
+
+
+
+ Move to &graveyard
+
+
+
+
+
+ Move to &exile
+
+
+
+
+
+ Move to &hand
+
+
+
+
+ &View library
+
+
+
+
+ View &top cards of library...
+
+
+
+
+ Reveal &library to
+
+
+
+
+ Reveal t&op card to
+
+
+
+
+ &View sideboard
+
+
+
+
+ &Draw card
+
+
+
+
+ D&raw cards...
+
+
+
+
+ &Undo last draw
+
+
+
+
+ Take &mulligan
+
+
+
+
+ &Shuffle
+
+
+
+
+ Move top cards to &graveyard...
+
+
+
+
+ Move top cards to &exile...
+
+
+
+
+ Put top card on &bottom
+
+
+
+
+ &Hand
+
+
+
+
+ &Reveal to
+
+
+
+
+ Reveal r&andom card to
+
+
+
+
+ &Sideboard
+
+
+
+
+ &Library
+
+
+
+
+ &Counters
+
+
+
+
+ &Untap all permanents
+
+
+
+
+ R&oll die...
+
+
+
+
+ &Create token...
+
+
+
+
+ C&reate another token
+
+
+
+
+ S&ay
+
+
+
+
+ C&ard
+
+
+
+
+ &All players
+
+
+
+
+ Ctrl+F3
+
+
+
+
+ F3
+
+
+
+
+ Ctrl+W
+
+
+
+
+ F4
+
+
+
+
+ Ctrl+D
+
+
+
+
+ Ctrl+E
+
+
+
+
+ Ctrl+Shift+D
+
+
+
+
+ Ctrl+M
+
+
+
+
+ Ctrl+S
+
+
+
+
+ Ctrl+U
+
+
+
+
+ Ctrl+I
+
+
+
+
+ Ctrl+T
+
+
+
+
+ Ctrl+G
+
+
+
+
+ View top cards of library
+
+
+
+
+ Number of cards:
+
+
+
+
+ Draw cards
+
+
+
+
+
+
+
+ Number:
+
+
+
+
+ Move top cards to grave
+
+
+
+
+ Move top cards to exile
+
+
+
+
+ Roll die
+
+
+
+
+ Number of sides:
+
+
+
+
+ Set power/toughness
+
+
+
+
+ Please enter the new PT:
+
+
+
+
+ Set annotation
+
+
+
+
+ Please enter the new annotation:
+
+
+
+
+ Set counters
+
+
+
+
+ PlayerListWidget
+
+
+ Player name
+
+
+
+
+ Deck
+
+
+
+
+ ---
+
+
+
+
+ local
+
+
+
+
+ #%1
+
+
+
+
+ QObject
+
+
+ Maindeck
+
+
+
+
+ Sideboard
+
+
+
+
+ Cockatrice decks (*.cod)
+
+
+
+
+ Plain text decks (*.dec *.mwDeck)
+
+
+
+
+ All files (*.*)
+
+
+
+
+ RemoteDeckList_TreeModel
+
+
+ Name
+
+
+
+
+ ID
+
+
+
+
+ Upload time
+
+
+
+
+ RoomSelector
+
+
+ Rooms
+
+
+
+
+ Joi&n
+
+
+
+
+ Room
+
+
+
+
+ Description
+
+
+
+
+ Players
+
+
+
+
+ Games
+
+
+
+
+ SetsModel
+
+
+ Short name
+
+
+
+
+ Long name
+
+
+
+
+ TabAdmin
+
+
+ Update server &message
+
+
+
+
+ Server administration functions
+
+
+
+
+ &Unlock functions
+
+
+
+
+ &Lock functions
+
+
+
+
+ Unlock administration functions
+
+
+
+
+ Do you really want to unlock the administration functions?
+
+
+
+
+ Administration
+
+
+
+
+ TabDeckStorage
+
+
+ Local file system
+
+
+
+
+ Server deck storage
+
+
+
+
+
+ Open in deck editor
+
+
+
+
+ Upload deck
+
+
+
+
+ Download deck
+
+
+
+
+
+ New folder
+
+
+
+
+ Delete
+
+
+
+
+ Enter deck name
+
+
+
+
+ This decklist does not have a name.
+Please enter a name:
+
+
+
+
+
+ Unnamed deck
+
+
+
+
+ Name of new folder:
+
+
+
+
+ Deck storage
+
+
+
+
+ TabGame
+
+
+ &Game
+
+
+
+
+ Next &phase
+
+
+
+
+ Ctrl+Space
+
+
+
+
+ Next &turn
+
+
+
+
+ Ctrl+Return
+
+
+
+
+ Ctrl+Enter
+
+
+
+
+ &Remove all local arrows
+
+
+
+
+ Ctrl+R
+
+
+
+
+ &Concede
+
+
+
+
+ F2
+
+
+
+
+ &Leave game
+
+
+
+
+ &Say:
+
+
+
+
+ Concede
+
+
+
+
+ Are you sure you want to concede this game?
+
+
+
+
+ Leave game
+
+
+
+
+ Are you sure you want to leave this game?
+
+
+
+
+ Game %1: %2
+
+
+
+
+ TabMessage
+
+
+ Personal &talk
+
+
+
+
+ &Leave
+
+
+
+
+ %1 has left the server.
+
+
+
+
+ %1 has joined the server.
+
+
+
+
+ Talking to %1
+
+
+
+
+ TabRoom
+
+
+ &Say:
+
+
+
+
+ Chat
+
+
+
+
+ &Room
+
+
+
+
+ &Leave room
+
+
+
+
+ TabServer
+
+
+ Server
+
+
+
+
+ UserInfoBox
+
+
+ User information
+
+
+
+
+ Real name:
+
+
+
+
+ Location:
+
+
+
+
+ User level:
+
+
+
+
+ Administrator
+
+
+
+
+ Judge
+
+
+
+
+ Registered user
+
+
+
+
+ Unregistered user
+
+
+
+
+ UserInterfaceSettingsPage
+
+
+ General interface settings
+
+
+
+
+ &Double-click cards to play them (instead of single-click)
+
+
+
+
+ Animation settings
+
+
+
+
+ &Tap/untap animation
+
+
+
+
+ UserList
+
+
+ Users online: %1
+
+
+
+
+ Users in this room: %1
+
+
+
+
+ User &details
+
+
+
+
+ Direct &chat
+
+
+
+
+ WndDeckEditor
+
+
+ &Search...
+
+
+
+
+ &Clear search
+
+
+
+
+ &Search for:
+
+
+
+
+ Deck &name:
+
+
+
+
+ &Comments:
+
+
+
+
+ Deck editor [*]
+
+
+
+
+ &New deck
+
+
+
+
+ &Load deck...
+
+
+
+
+ &Save deck
+
+
+
+
+ Save deck &as...
+
+
+
+
+ Load deck from cl&ipboard...
+
+
+
+
+ Save deck to clip&board
+
+
+
+
+ &Print deck...
+
+
+
+
+ &Close
+
+
+
+
+ Ctrl+Q
+
+
+
+
+ &Edit sets...
+
+
+
+
+ &Deck
+
+
+
+
+ &Card database
+
+
+
+
+ Add card to &maindeck
+
+
+
+
+ Return
+
+
+
+
+ Enter
+
+
+
+
+ Add card to &sideboard
+
+
+
+
+ Ctrl+Return
+
+
+
+
+ Ctrl+Enter
+
+
+
+
+ &Remove row
+
+
+
+
+ Del
+
+
+
+
+ &Increment number
+
+
+
+
+ +
+
+
+
+
+ &Decrement number
+
+
+
+
+ -
+
+
+
+
+ Are you sure?
+
+
+
+
+ The decklist has been modified.
+Do you want to save the changes?
+
+
+
+
+ Load deck
+
+
+
+
+
+ Error
+
+
+
+
+
+ The deck could not be saved.
+Please check that the directory is writable and try again.
+
+
+
+
+ Save deck
+
+
+
+
+ WndSets
+
+
+ Edit sets
+
+
+
+
+ ZoneViewWidget
+
+
+ sort by name
+
+
+
+
+ sort by type
+
+
+
+
+ shuffle when closing
+
+
+
+
diff --git a/common/protocol.cpp b/common/protocol.cpp
index 3448de77..624ebed0 100644
--- a/common/protocol.cpp
+++ b/common/protocol.cpp
@@ -17,6 +17,7 @@ void ProtocolItem::initializeHash()
registerSerializableItem("room", ServerInfo_Room::newItem);
registerSerializableItem("user", ServerInfo_User::newItem);
registerSerializableItem("game", ServerInfo_Game::newItem);
+ registerSerializableItem("game_type", ServerInfo_GameType::newItem);
registerSerializableItem("card_counter", ServerInfo_CardCounter::newItem);
registerSerializableItem("card", ServerInfo_Card::newItem);
registerSerializableItem("zone", ServerInfo_Zone::newItem);
@@ -28,10 +29,12 @@ void ProtocolItem::initializeHash()
registerSerializableItem("file", DeckList_File::newItem);
registerSerializableItem("directory", DeckList_Directory::newItem);
registerSerializableItem("card_id", CardId::newItem);
+ registerSerializableItem("game_type_id", GameTypeId::newItem);
registerSerializableItem("containercmd", CommandContainer::newItem);
registerSerializableItem("containergame_event", GameEventContainer::newItem);
+ registerSerializableItem("cmdcreate_game", Command_CreateGame::newItem);
registerSerializableItem("cmddeck_upload", Command_DeckUpload::newItem);
registerSerializableItem("cmddeck_select", Command_DeckSelect::newItem);
registerSerializableItem("cmdset_sideboard_plan", Command_SetSideboardPlan::newItem);
@@ -138,26 +141,47 @@ void CommandContainer::setResponse(ProtocolResponse *_resp)
resp = _resp;
}
-void CommandContainer::enqueueGameEventPublic(GameEvent *event, int gameId)
+void CommandContainer::enqueueGameEventPublic(GameEvent *event, int gameId, GameEventContext *context)
{
if (!gameEventQueuePublic)
gameEventQueuePublic = new GameEventContainer(QList(), gameId);
gameEventQueuePublic->addGameEvent(event);
+ if (context)
+ gameEventQueuePublic->setContext(context);
}
-void CommandContainer::enqueueGameEventOmniscient(GameEvent *event, int gameId)
+void CommandContainer::enqueueGameEventOmniscient(GameEvent *event, int gameId, GameEventContext *context)
{
if (!gameEventQueueOmniscient)
gameEventQueueOmniscient = new GameEventContainer(QList(), gameId);
gameEventQueueOmniscient->addGameEvent(event);
+ if (context)
+ gameEventQueueOmniscient->setContext(context);
}
-void CommandContainer::enqueueGameEventPrivate(GameEvent *event, int gameId, int playerId)
+void CommandContainer::enqueueGameEventPrivate(GameEvent *event, int gameId, int playerId, GameEventContext *context)
{
if (!gameEventQueuePrivate)
gameEventQueuePrivate = new GameEventContainer(QList(), gameId);
gameEventQueuePrivate->addGameEvent(event);
privatePlayerId = playerId;
+ if (context)
+ gameEventQueuePrivate->setContext(context);
+}
+
+Command_CreateGame::Command_CreateGame(int _roomId, const QString &_description, const QString &_password, int _maxPlayers, const QList &_gameTypes, bool _spectatorsAllowed, bool _spectatorsNeedPassword, bool _spectatorsCanTalk, bool _spectatorsSeeEverything)
+ : RoomCommand("create_game", _roomId)
+{
+ insertItem(new SerializableItem_String("description", _description));
+ insertItem(new SerializableItem_String("password", _password));
+ insertItem(new SerializableItem_Int("max_players", _maxPlayers));
+ insertItem(new SerializableItem_Bool("spectators_allowed", _spectatorsAllowed));
+ insertItem(new SerializableItem_Bool("spectators_need_password", _spectatorsNeedPassword));
+ insertItem(new SerializableItem_Bool("spectators_can_talk", _spectatorsCanTalk));
+ insertItem(new SerializableItem_Bool("spectators_see_everything", _spectatorsSeeEverything));
+
+ for (int i = 0; i < _gameTypes.size(); ++i)
+ itemList.append(_gameTypes[i]);
}
Command_DeckUpload::Command_DeckUpload(DeckList *_deck, const QString &_path)
diff --git a/common/protocol.h b/common/protocol.h
index d23969d6..fc3b1d1d 100644
--- a/common/protocol.h
+++ b/common/protocol.h
@@ -17,11 +17,13 @@ class ProtocolResponse;
class DeckList;
class GameEvent;
class GameEventContainer;
+class GameEventContext;
class MoveCardToZone;
enum ItemId {
ItemId_CommandContainer = ItemId_Other + 50,
ItemId_GameEventContainer = ItemId_Other + 51,
+ ItemId_Command_CreateGame = ItemId_Other + 99,
ItemId_Command_DeckUpload = ItemId_Other + 100,
ItemId_Command_DeckSelect = ItemId_Other + 101,
ItemId_Command_SetSideboardPlan = ItemId_Other + 102,
@@ -55,7 +57,7 @@ private:
static void initializeHashAuto();
bool receiverMayDelete;
public:
- static const int protocolVersion = 11;
+ static const int protocolVersion = 12;
static void initializeHash();
virtual int getItemId() const = 0;
bool getReceiverMayDelete() const { return receiverMayDelete; }
@@ -132,11 +134,11 @@ public:
const QList &getItemQueue() const { return itemQueue; }
void enqueueItem(ProtocolItem *item) { itemQueue.append(item); }
GameEventContainer *getGameEventQueuePublic() const { return gameEventQueuePublic; }
- void enqueueGameEventPublic(GameEvent *event, int gameId);
+ void enqueueGameEventPublic(GameEvent *event, int gameId, GameEventContext *context = 0);
GameEventContainer *getGameEventQueueOmniscient() const { return gameEventQueueOmniscient; }
- void enqueueGameEventOmniscient(GameEvent *event, int gameId);
+ void enqueueGameEventOmniscient(GameEvent *event, int gameId, GameEventContext *context = 0);
GameEventContainer *getGameEventQueuePrivate() const { return gameEventQueuePrivate; }
- void enqueueGameEventPrivate(GameEvent *event, int gameId, int playerId = -1);
+ void enqueueGameEventPrivate(GameEvent *event, int gameId, int playerId = -1, GameEventContext *context = 0);
int getPrivatePlayerId() const { return privatePlayerId; }
};
@@ -172,6 +174,22 @@ public:
}
};
+class Command_CreateGame : public RoomCommand {
+ Q_OBJECT
+public:
+ Command_CreateGame(int _roomId = -1, const QString &_description = QString(), const QString &_password = QString(), int _maxPlayers = -1, const QList &_gameTypes = QList(), bool _spectatorsAllowed = false, bool _spectatorsNeedPassword = false, bool _spectatorsCanTalk = false, bool _spectatorsSeeEverything = false);
+ QString getDescription() const { return static_cast(itemMap.value("description"))->getData(); };
+ QString getPassword() const { return static_cast(itemMap.value("password"))->getData(); };
+ int getMaxPlayers() const { return static_cast(itemMap.value("max_players"))->getData(); };
+ bool getSpectatorsAllowed() const { return static_cast(itemMap.value("spectators_allowed"))->getData(); };
+ bool getSpectatorsNeedPassword() const { return static_cast(itemMap.value("spectators_need_password"))->getData(); };
+ bool getSpectatorsCanTalk() const { return static_cast(itemMap.value("spectators_can_talk"))->getData(); };
+ bool getSpectatorsSeeEverything() const { return static_cast(itemMap.value("spectators_see_everything"))->getData(); };
+ QList getGameTypes() const { return typecastItemList(); }
+ static SerializableItem *newItem() { return new Command_CreateGame; }
+ int getItemId() const { return ItemId_Command_CreateGame; }
+};
+
class Command_DeckUpload : public Command {
Q_OBJECT
public:
diff --git a/common/protocol_datastructures.cpp b/common/protocol_datastructures.cpp
index 20c85506..93748bce 100644
--- a/common/protocol_datastructures.cpp
+++ b/common/protocol_datastructures.cpp
@@ -23,7 +23,7 @@ ServerInfo_User::ServerInfo_User(const ServerInfo_User *other, bool complete)
insertItem(new SerializableItem_ByteArray("avatar_bmp", complete ? other->getAvatarBmp() : QByteArray()));
}
-ServerInfo_Game::ServerInfo_Game(int _gameId, const QString &_description, bool _hasPassword, int _playerCount, int _maxPlayers, ServerInfo_User *_creatorInfo, bool _spectatorsAllowed, bool _spectatorsNeedPassword, int _spectatorCount)
+ServerInfo_Game::ServerInfo_Game(int _gameId, const QString &_description, bool _hasPassword, int _playerCount, int _maxPlayers, const QList &_gameTypes, ServerInfo_User *_creatorInfo, bool _spectatorsAllowed, bool _spectatorsNeedPassword, int _spectatorCount)
: SerializableItem_Map("game")
{
insertItem(new SerializableItem_Int("game_id", _gameId));
@@ -37,9 +37,19 @@ ServerInfo_Game::ServerInfo_Game(int _gameId, const QString &_description, bool
insertItem(new SerializableItem_Bool("spectators_allowed", _spectatorsAllowed));
insertItem(new SerializableItem_Bool("spectators_need_password", _spectatorsNeedPassword));
insertItem(new SerializableItem_Int("spectator_count", _spectatorCount));
+
+ for (int i = 0; i < _gameTypes.size(); ++i)
+ itemList.append(_gameTypes[i]);
}
-ServerInfo_Room::ServerInfo_Room(int _roomId, const QString &_name, const QString &_description, int _gameCount, int _playerCount, bool _autoJoin, const QList &_gameList, const QList &_userList)
+ServerInfo_GameType::ServerInfo_GameType(int _gameTypeId, const QString &_description)
+ : SerializableItem_Map("game_type")
+{
+ insertItem(new SerializableItem_Int("game_type_id", _gameTypeId));
+ insertItem(new SerializableItem_String("description", _description));
+}
+
+ServerInfo_Room::ServerInfo_Room(int _roomId, const QString &_name, const QString &_description, int _gameCount, int _playerCount, bool _autoJoin, const QList &_gameList, const QList &_userList, const QList &_gameTypeList)
: SerializableItem_Map("room")
{
insertItem(new SerializableItem_Int("room_id", _roomId));
@@ -55,6 +65,9 @@ ServerInfo_Room::ServerInfo_Room(int _roomId, const QString &_name, const QStrin
userList = _userList;
for (int i = 0; i < _userList.size(); ++i)
itemList.append(_userList[i]);
+ gameTypeList = _gameTypeList;
+ for (int i = 0; i < _gameTypeList.size(); ++i)
+ itemList.append(_gameTypeList[i]);
}
void ServerInfo_Room::extractData()
@@ -70,6 +83,11 @@ void ServerInfo_Room::extractData()
gameList.append(game);
continue;
}
+ ServerInfo_GameType *gameType = dynamic_cast(itemList[i]);
+ if (gameType) {
+ gameTypeList.append(gameType);
+ continue;
+ }
}
}
diff --git a/common/protocol_datastructures.h b/common/protocol_datastructures.h
index a6a9c9ac..39d9efc1 100644
--- a/common/protocol_datastructures.h
+++ b/common/protocol_datastructures.h
@@ -25,6 +25,11 @@ public:
CardId(int _cardId = -1) : SerializableItem_Int("card_id", _cardId) { }
static SerializableItem *newItem() { return new CardId; }
};
+class GameTypeId : public SerializableItem_Int {
+public:
+ GameTypeId(int _gameTypeId = -1) : SerializableItem_Int("game_type_id", _gameTypeId) { }
+ static SerializableItem *newItem() { return new GameTypeId; }
+};
class ServerInfo_User : public SerializableItem_Map {
public:
@@ -48,27 +53,37 @@ public:
class ServerInfo_Game : public SerializableItem_Map {
public:
- ServerInfo_Game(int _gameId = -1, const QString &_description = QString(), bool _hasPassword = false, int _playerCount = -1, int _maxPlayers = -1, ServerInfo_User *creatorInfo = 0, bool _spectatorsAllowed = false, bool _spectatorsNeedPassword = false, int _spectatorCount = -1);
+ ServerInfo_Game(int _gameId = -1, const QString &_description = QString(), bool _hasPassword = false, int _playerCount = -1, int _maxPlayers = -1, const QList &_gameTypes = QList(), ServerInfo_User *creatorInfo = 0, bool _spectatorsAllowed = false, bool _spectatorsNeedPassword = false, int _spectatorCount = -1);
static SerializableItem *newItem() { return new ServerInfo_Game; }
int getGameId() const { return static_cast(itemMap.value("game_id"))->getData(); }
QString getDescription() const { return static_cast(itemMap.value("description"))->getData(); }
bool getHasPassword() const { return static_cast(itemMap.value("has_password"))->getData(); }
int getPlayerCount() const { return static_cast(itemMap.value("player_count"))->getData(); }
int getMaxPlayers() const { return static_cast(itemMap.value("max_players"))->getData(); }
+ QList getGameTypes() const { return typecastItemList(); }
ServerInfo_User *getCreatorInfo() const { return static_cast(itemMap.value("user")); }
bool getSpectatorsAllowed() const { return static_cast(itemMap.value("spectators_allowed"))->getData(); }
bool getSpectatorsNeedPassword() const { return static_cast(itemMap.value("spectators_need_password"))->getData(); }
int getSpectatorCount() const { return static_cast(itemMap.value("spectator_count"))->getData(); }
};
+class ServerInfo_GameType : public SerializableItem_Map {
+public:
+ ServerInfo_GameType(int _gameTypeId = -1, const QString &_description = QString());
+ static SerializableItem *newItem() { return new ServerInfo_GameType; }
+ int getGameTypeId() const { return static_cast(itemMap.value("game_type_id"))->getData(); }
+ QString getDescription() const { return static_cast(itemMap.value("description"))->getData(); }
+};
+
class ServerInfo_Room : public SerializableItem_Map {
private:
QList gameList;
QList userList;
+ QList gameTypeList;
protected:
void extractData();
public:
- ServerInfo_Room(int _id = -1, const QString &_name = QString(), const QString &_description = QString(), int _gameCount = -1, int _playerCount = -1, bool _autoJoin = false, const QList &_gameList = QList(), const QList &_userList = QList());
+ ServerInfo_Room(int _id = -1, const QString &_name = QString(), const QString &_description = QString(), int _gameCount = -1, int _playerCount = -1, bool _autoJoin = false, const QList &_gameList = QList(), const QList &_userList = QList(), const QList &_gameTypeList = QList());
static SerializableItem *newItem() { return new ServerInfo_Room; }
int getRoomId() const { return static_cast(itemMap.value("room_id"))->getData(); }
QString getName() const { return static_cast(itemMap.value("name"))->getData(); }
@@ -78,6 +93,7 @@ public:
bool getAutoJoin() const { return static_cast(itemMap.value("auto_join"))->getData(); }
const QList &getGameList() const { return gameList; }
const QList &getUserList() const { return userList; }
+ const QList &getGameTypeList() const { return gameTypeList; }
};
class ServerInfo_CardCounter : public SerializableItem_Map {
diff --git a/common/protocol_item_ids.h b/common/protocol_item_ids.h
index 2ed9fe3a..534ffe26 100644
--- a/common/protocol_item_ids.h
+++ b/common/protocol_item_ids.h
@@ -13,14 +13,14 @@ ItemId_Command_ListRooms = 1011,
ItemId_Command_JoinRoom = 1012,
ItemId_Command_LeaveRoom = 1013,
ItemId_Command_RoomSay = 1014,
-ItemId_Command_CreateGame = 1015,
-ItemId_Command_JoinGame = 1016,
-ItemId_Command_LeaveGame = 1017,
-ItemId_Command_Say = 1018,
-ItemId_Command_Shuffle = 1019,
-ItemId_Command_Mulligan = 1020,
-ItemId_Command_RollDie = 1021,
-ItemId_Command_DrawCards = 1022,
+ItemId_Command_JoinGame = 1015,
+ItemId_Command_LeaveGame = 1016,
+ItemId_Command_Say = 1017,
+ItemId_Command_Shuffle = 1018,
+ItemId_Command_Mulligan = 1019,
+ItemId_Command_RollDie = 1020,
+ItemId_Command_DrawCards = 1021,
+ItemId_Command_UndoDraw = 1022,
ItemId_Command_FlipCard = 1023,
ItemId_Command_AttachCard = 1024,
ItemId_Command_CreateToken = 1025,
@@ -68,6 +68,7 @@ ItemId_Event_RoomSay = 1066,
ItemId_Context_ReadyStart = 1067,
ItemId_Context_Concede = 1068,
ItemId_Context_DeckSelect = 1069,
-ItemId_Command_UpdateServerMessage = 1070,
-ItemId_Other = 1071
+ItemId_Context_UndoDraw = 1070,
+ItemId_Command_UpdateServerMessage = 1071,
+ItemId_Other = 1072
};
diff --git a/common/protocol_items.cpp b/common/protocol_items.cpp
index 0265652f..3e569cb9 100644
--- a/common/protocol_items.cpp
+++ b/common/protocol_items.cpp
@@ -69,17 +69,6 @@ Command_RoomSay::Command_RoomSay(int _roomId, const QString &_message)
{
insertItem(new SerializableItem_String("message", _message));
}
-Command_CreateGame::Command_CreateGame(int _roomId, const QString &_description, const QString &_password, int _maxPlayers, bool _spectatorsAllowed, bool _spectatorsNeedPassword, bool _spectatorsCanTalk, bool _spectatorsSeeEverything)
- : RoomCommand("create_game", _roomId)
-{
- insertItem(new SerializableItem_String("description", _description));
- insertItem(new SerializableItem_String("password", _password));
- insertItem(new SerializableItem_Int("max_players", _maxPlayers));
- insertItem(new SerializableItem_Bool("spectators_allowed", _spectatorsAllowed));
- insertItem(new SerializableItem_Bool("spectators_need_password", _spectatorsNeedPassword));
- insertItem(new SerializableItem_Bool("spectators_can_talk", _spectatorsCanTalk));
- insertItem(new SerializableItem_Bool("spectators_see_everything", _spectatorsSeeEverything));
-}
Command_JoinGame::Command_JoinGame(int _roomId, int _gameId, const QString &_password, bool _spectator)
: RoomCommand("join_game", _roomId)
{
@@ -114,6 +103,10 @@ Command_DrawCards::Command_DrawCards(int _gameId, int _number)
{
insertItem(new SerializableItem_Int("number", _number));
}
+Command_UndoDraw::Command_UndoDraw(int _gameId)
+ : GameCommand("undo_draw", _gameId)
+{
+}
Command_FlipCard::Command_FlipCard(int _gameId, const QString &_zone, int _cardId, bool _faceDown)
: GameCommand("flip_card", _gameId)
{
@@ -425,6 +418,10 @@ Context_DeckSelect::Context_DeckSelect(int _deckId)
{
insertItem(new SerializableItem_Int("deck_id", _deckId));
}
+Context_UndoDraw::Context_UndoDraw()
+ : GameEventContext("undo_draw")
+{
+}
Command_UpdateServerMessage::Command_UpdateServerMessage()
: AdminCommand("update_server_message")
{
@@ -445,7 +442,6 @@ void ProtocolItem::initializeHashAuto()
itemNameHash.insert("cmdjoin_room", Command_JoinRoom::newItem);
itemNameHash.insert("cmdleave_room", Command_LeaveRoom::newItem);
itemNameHash.insert("cmdroom_say", Command_RoomSay::newItem);
- itemNameHash.insert("cmdcreate_game", Command_CreateGame::newItem);
itemNameHash.insert("cmdjoin_game", Command_JoinGame::newItem);
itemNameHash.insert("cmdleave_game", Command_LeaveGame::newItem);
itemNameHash.insert("cmdsay", Command_Say::newItem);
@@ -453,6 +449,7 @@ void ProtocolItem::initializeHashAuto()
itemNameHash.insert("cmdmulligan", Command_Mulligan::newItem);
itemNameHash.insert("cmdroll_die", Command_RollDie::newItem);
itemNameHash.insert("cmddraw_cards", Command_DrawCards::newItem);
+ itemNameHash.insert("cmdundo_draw", Command_UndoDraw::newItem);
itemNameHash.insert("cmdflip_card", Command_FlipCard::newItem);
itemNameHash.insert("cmdattach_card", Command_AttachCard::newItem);
itemNameHash.insert("cmdcreate_token", Command_CreateToken::newItem);
@@ -500,5 +497,6 @@ void ProtocolItem::initializeHashAuto()
itemNameHash.insert("game_event_contextready_start", Context_ReadyStart::newItem);
itemNameHash.insert("game_event_contextconcede", Context_Concede::newItem);
itemNameHash.insert("game_event_contextdeck_select", Context_DeckSelect::newItem);
+ itemNameHash.insert("game_event_contextundo_draw", Context_UndoDraw::newItem);
itemNameHash.insert("cmdupdate_server_message", Command_UpdateServerMessage::newItem);
}
diff --git a/common/protocol_items.dat b/common/protocol_items.dat
index db617398..c2018087 100644
--- a/common/protocol_items.dat
+++ b/common/protocol_items.dat
@@ -12,7 +12,6 @@
0:join_room:i,room_id
1:leave_room
1:room_say:s,message
-1:create_game:s,description:s,password:i,max_players:b,spectators_allowed:b,spectators_need_password:b,spectators_can_talk:b,spectators_see_everything
1:join_game:i,game_id:s,password:b,spectator
2:leave_game
2:say:s,message
@@ -20,6 +19,7 @@
2:mulligan
2:roll_die:i,sides
2:draw_cards:i,number
+2:undo_draw
2:flip_card:s,zone:i,card_id:b,face_down
2:attach_card:s,start_zone:i,card_id:i,target_player_id:s,target_zone:i,target_card_id
2:create_token:s,zone:s,card_name:s,color:s,pt:s,annotation:b,destroy:i,x:i,y
@@ -67,4 +67,5 @@
6:ready_start
6:concede
6:deck_select:i,deck_id
+6:undo_draw
7:update_server_message
diff --git a/common/protocol_items.h b/common/protocol_items.h
index aed7c43c..a0242130 100644
--- a/common/protocol_items.h
+++ b/common/protocol_items.h
@@ -113,20 +113,6 @@ public:
static SerializableItem *newItem() { return new Command_RoomSay; }
int getItemId() const { return ItemId_Command_RoomSay; }
};
-class Command_CreateGame : public RoomCommand {
- Q_OBJECT
-public:
- Command_CreateGame(int _roomId = -1, const QString &_description = QString(), const QString &_password = QString(), int _maxPlayers = -1, bool _spectatorsAllowed = false, bool _spectatorsNeedPassword = false, bool _spectatorsCanTalk = false, bool _spectatorsSeeEverything = false);
- QString getDescription() const { return static_cast(itemMap.value("description"))->getData(); };
- QString getPassword() const { return static_cast(itemMap.value("password"))->getData(); };
- int getMaxPlayers() const { return static_cast(itemMap.value("max_players"))->getData(); };
- bool getSpectatorsAllowed() const { return static_cast(itemMap.value("spectators_allowed"))->getData(); };
- bool getSpectatorsNeedPassword() const { return static_cast(itemMap.value("spectators_need_password"))->getData(); };
- bool getSpectatorsCanTalk() const { return static_cast(itemMap.value("spectators_can_talk"))->getData(); };
- bool getSpectatorsSeeEverything() const { return static_cast(itemMap.value("spectators_see_everything"))->getData(); };
- static SerializableItem *newItem() { return new Command_CreateGame; }
- int getItemId() const { return ItemId_Command_CreateGame; }
-};
class Command_JoinGame : public RoomCommand {
Q_OBJECT
public:
@@ -182,6 +168,13 @@ public:
static SerializableItem *newItem() { return new Command_DrawCards; }
int getItemId() const { return ItemId_Command_DrawCards; }
};
+class Command_UndoDraw : public GameCommand {
+ Q_OBJECT
+public:
+ Command_UndoDraw(int _gameId = -1);
+ static SerializableItem *newItem() { return new Command_UndoDraw; }
+ int getItemId() const { return ItemId_Command_UndoDraw; }
+};
class Command_FlipCard : public GameCommand {
Q_OBJECT
public:
@@ -634,6 +627,13 @@ public:
static SerializableItem *newItem() { return new Context_DeckSelect; }
int getItemId() const { return ItemId_Context_DeckSelect; }
};
+class Context_UndoDraw : public GameEventContext {
+ Q_OBJECT
+public:
+ Context_UndoDraw();
+ static SerializableItem *newItem() { return new Context_UndoDraw; }
+ int getItemId() const { return ItemId_Context_UndoDraw; }
+};
class Command_UpdateServerMessage : public AdminCommand {
Q_OBJECT
public:
diff --git a/common/server_game.cpp b/common/server_game.cpp
index 330534bf..92234d45 100644
--- a/common/server_game.cpp
+++ b/common/server_game.cpp
@@ -28,8 +28,8 @@
#include
#include
-Server_Game::Server_Game(Server_ProtocolHandler *_creator, int _gameId, const QString &_description, const QString &_password, int _maxPlayers, bool _spectatorsAllowed, bool _spectatorsNeedPassword, bool _spectatorsCanTalk, bool _spectatorsSeeEverything, Server_Room *parent)
- : QObject(parent), creatorInfo(new ServerInfo_User(_creator->getUserInfo())), gameStarted(false), gameId(_gameId), description(_description), password(_password), maxPlayers(_maxPlayers), activePlayer(-1), activePhase(-1), spectatorsAllowed(_spectatorsAllowed), spectatorsNeedPassword(_spectatorsNeedPassword), spectatorsCanTalk(_spectatorsCanTalk), spectatorsSeeEverything(_spectatorsSeeEverything), inactivityCounter(0), secondsElapsed(0)
+Server_Game::Server_Game(Server_ProtocolHandler *_creator, int _gameId, const QString &_description, const QString &_password, int _maxPlayers, const QList &_gameTypes, bool _spectatorsAllowed, bool _spectatorsNeedPassword, bool _spectatorsCanTalk, bool _spectatorsSeeEverything, Server_Room *parent)
+ : QObject(parent), creatorInfo(new ServerInfo_User(_creator->getUserInfo())), gameStarted(false), gameId(_gameId), description(_description), password(_password), maxPlayers(_maxPlayers), gameTypes(_gameTypes), activePlayer(-1), activePhase(-1), spectatorsAllowed(_spectatorsAllowed), spectatorsNeedPassword(_spectatorsNeedPassword), spectatorsCanTalk(_spectatorsCanTalk), spectatorsSeeEverything(_spectatorsSeeEverything), inactivityCounter(0), secondsElapsed(0)
{
addPlayer(_creator, false, false);
@@ -399,18 +399,25 @@ ServerInfo_Game *Server_Game::getInfo() const
{
if (players.isEmpty())
// Game is closing
- return new ServerInfo_Game(getGameId(), QString(), false, 0, getMaxPlayers(), 0, false, 0);
- else
+ return new ServerInfo_Game(getGameId(), QString(), false, 0, getMaxPlayers(), QList(), 0, false, 0);
+ else {
// Game is open
+
+ QList gameTypeList;
+ for (int i = 0; i < gameTypes.size(); ++i)
+ gameTypeList.append(new GameTypeId(gameTypes[i]));
+
return new ServerInfo_Game(
getGameId(),
getDescription(),
!getPassword().isEmpty(),
getPlayerCount(),
getMaxPlayers(),
+ gameTypeList,
new ServerInfo_User(getCreatorInfo(), false),
getSpectatorsAllowed(),
getSpectatorsNeedPassword(),
getSpectatorCount()
);
+ }
}
\ No newline at end of file
diff --git a/common/server_game.h b/common/server_game.h
index 29d2c91a..e5fbc5a2 100644
--- a/common/server_game.h
+++ b/common/server_game.h
@@ -40,6 +40,7 @@ private:
QString description;
QString password;
int maxPlayers;
+ QList gameTypes;
int activePlayer, activePhase;
bool spectatorsAllowed;
bool spectatorsNeedPassword;
@@ -53,7 +54,7 @@ signals:
private slots:
void pingClockTimeout();
public:
- Server_Game(Server_ProtocolHandler *_creator, int _gameId, const QString &_description, const QString &_password, int _maxPlayers, bool _spectatorsAllowed, bool _spectatorsNeedPassword, bool _spectatorsCanTalk, bool _spectatorsSeeEverything, Server_Room *parent);
+ Server_Game(Server_ProtocolHandler *_creator, int _gameId, const QString &_description, const QString &_password, int _maxPlayers, const QList &_gameTypes, bool _spectatorsAllowed, bool _spectatorsNeedPassword, bool _spectatorsCanTalk, bool _spectatorsSeeEverything, Server_Room *parent);
~Server_Game();
ServerInfo_Game *getInfo() const;
ServerInfo_User *getCreatorInfo() const { return creatorInfo; }
diff --git a/common/server_player.cpp b/common/server_player.cpp
index d479edce..2981269d 100644
--- a/common/server_player.cpp
+++ b/common/server_player.cpp
@@ -150,6 +150,8 @@ void Server_Player::clearZones()
while (arrowIterator.hasNext())
delete arrowIterator.next().value();
arrows.clear();
+
+ lastDrawList.clear();
}
ServerInfo_PlayerProperties *Server_Player::getProperties()
@@ -199,6 +201,37 @@ bool Server_Player::deleteCounter(int counterId)
return true;
}
+ResponseCode Server_Player::drawCards(CommandContainer *cont, int number)
+{
+ Server_CardZone *deckZone = zones.value("deck");
+ Server_CardZone *handZone = zones.value("hand");
+ if (deckZone->cards.size() < number)
+ number = deckZone->cards.size();
+
+ QList cardListPrivate;
+ QList cardListOmniscient;
+ for (int i = 0; i < number; ++i) {
+ Server_Card *card = deckZone->cards.takeFirst();
+ handZone->cards.append(card);
+ lastDrawList.append(card->getId());
+ cardListPrivate.append(new ServerInfo_Card(card->getId(), card->getName()));
+ cardListOmniscient.append(new ServerInfo_Card(card->getId(), card->getName()));
+ }
+ cont->enqueueGameEventPrivate(new Event_DrawCards(playerId, cardListPrivate.size(), cardListPrivate), game->getGameId());
+ cont->enqueueGameEventOmniscient(new Event_DrawCards(playerId, cardListOmniscient.size(), cardListOmniscient), game->getGameId());
+ cont->enqueueGameEventPublic(new Event_DrawCards(playerId, cardListPrivate.size()), game->getGameId());
+
+ return RespOk;
+}
+
+ResponseCode Server_Player::undoDraw(CommandContainer *cont)
+{
+ if (lastDrawList.isEmpty())
+ return RespContextError;
+
+ return moveCard(cont, zones.value("hand"), QList() << lastDrawList.takeLast(), zones.value("deck"), 0, 0, false, false, false, true);
+}
+
ResponseCode Server_Player::moveCard(CommandContainer *cont, const QString &_startZone, const QList &_cardIds, int targetPlayerId, const QString &_targetZone, int x, int y, bool faceDown, bool tapped)
{
Server_CardZone *startzone = getZones().value(_startZone);
@@ -233,7 +266,7 @@ public:
}
};
-ResponseCode Server_Player::moveCard(CommandContainer *cont, Server_CardZone *startzone, const QList &_cardIds, Server_CardZone *targetzone, int x, int y, bool faceDown, bool tapped, bool fixFreeSpaces)
+ResponseCode Server_Player::moveCard(CommandContainer *cont, Server_CardZone *startzone, const QList &_cardIds, Server_CardZone *targetzone, int x, int y, bool faceDown, bool tapped, bool fixFreeSpaces, bool undoingDraw)
{
// Disallow controller change to other zones than the table.
if (((targetzone->getType() != PublicZone) || !targetzone->hasCoords()) && (startzone->getPlayer() != targetzone->getPlayer()))
@@ -262,6 +295,13 @@ ResponseCode Server_Player::moveCard(CommandContainer *cont, Server_CardZone *st
Server_Card *card = cardsToMove[cardIndex].first;
int originalPosition = cardsToMove[cardIndex].second;
int position = startzone->removeCard(card);
+ if (startzone->getName() == "hand") {
+ if (undoingDraw)
+ lastDrawList.removeAt(lastDrawList.indexOf(card->getId()));
+ else if (lastDrawList.contains(card->getId()))
+ lastDrawList.clear();
+ }
+
if ((startzone == targetzone) && !startzone->hasCoords()) {
if (!secondHalf && (originalPosition < x)) {
xIndex = -1;
@@ -346,8 +386,8 @@ ResponseCode Server_Player::moveCard(CommandContainer *cont, Server_CardZone *st
int privatePosition = -1;
if (startzone->getType() == HiddenZone)
privatePosition = position;
- cont->enqueueGameEventPrivate(new Event_MoveCard(getPlayerId(), privateOldCardId, privateCardName, startzone->getName(), privatePosition, targetzone->getPlayer()->getPlayerId(), targetzone->getName(), newX, y, privateNewCardId, faceDown), game->getGameId());
- cont->enqueueGameEventOmniscient(new Event_MoveCard(getPlayerId(), privateOldCardId, privateCardName, startzone->getName(), privatePosition, targetzone->getPlayer()->getPlayerId(), targetzone->getName(), newX, y, privateNewCardId, faceDown), game->getGameId());
+ cont->enqueueGameEventPrivate(new Event_MoveCard(getPlayerId(), privateOldCardId, privateCardName, startzone->getName(), privatePosition, targetzone->getPlayer()->getPlayerId(), targetzone->getName(), newX, y, privateNewCardId, faceDown), game->getGameId(), -1, undoingDraw ? new Context_UndoDraw : 0);
+ cont->enqueueGameEventOmniscient(new Event_MoveCard(getPlayerId(), privateOldCardId, privateCardName, startzone->getName(), privatePosition, targetzone->getPlayer()->getPlayerId(), targetzone->getName(), newX, y, privateNewCardId, faceDown), game->getGameId(), undoingDraw ? new Context_UndoDraw : 0);
// Other players do not get to see the start and/or target position of the card if the respective
// part of the zone is being looked at. The information is not needed anyway because in hidden zones,
@@ -361,9 +401,9 @@ ResponseCode Server_Player::moveCard(CommandContainer *cont, Server_CardZone *st
newX = -1;
if ((startzone->getType() == PublicZone) || (targetzone->getType() == PublicZone))
- cont->enqueueGameEventPublic(new Event_MoveCard(getPlayerId(), oldCardId, publicCardName, startzone->getName(), position, targetzone->getPlayer()->getPlayerId(), targetzone->getName(), newX, y, card->getId(), faceDown), game->getGameId());
+ cont->enqueueGameEventPublic(new Event_MoveCard(getPlayerId(), oldCardId, publicCardName, startzone->getName(), position, targetzone->getPlayer()->getPlayerId(), targetzone->getName(), newX, y, card->getId(), faceDown), game->getGameId(), undoingDraw ? new Context_UndoDraw : 0);
else
- cont->enqueueGameEventPublic(new Event_MoveCard(getPlayerId(), -1, QString(), startzone->getName(), position, targetzone->getPlayer()->getPlayerId(), targetzone->getName(), newX, y, -1, false), game->getGameId());
+ cont->enqueueGameEventPublic(new Event_MoveCard(getPlayerId(), -1, QString(), startzone->getName(), position, targetzone->getPlayer()->getPlayerId(), targetzone->getName(), newX, y, -1, false), game->getGameId(), undoingDraw ? new Context_UndoDraw : 0);
if (tapped)
setCardAttrHelper(cont, targetzone->getName(), card->getId(), "tapped", "1");
diff --git a/common/server_player.h b/common/server_player.h
index 24eebf01..b53357aa 100644
--- a/common/server_player.h
+++ b/common/server_player.h
@@ -30,6 +30,7 @@ private:
QMap zones;
QMap counters;
QMap arrows;
+ QList lastDrawList;
int playerId;
bool spectator;
int initialCards;
@@ -75,8 +76,10 @@ public:
void clearZones();
void setupZones();
+ ResponseCode drawCards(CommandContainer *cont, int number);
+ ResponseCode undoDraw(CommandContainer *cont);
ResponseCode moveCard(CommandContainer *cont, const QString &_startZone, const QList &_cardId, int _targetPlayer, const QString &_targetZone, int _x, int _y, bool _faceDown, bool _tapped);
- ResponseCode moveCard(CommandContainer *cont, Server_CardZone *startzone, const QList &_cardId, Server_CardZone *targetzone, int x, int y, bool faceDown, bool tapped, bool fixFreeSpaces = true);
+ ResponseCode moveCard(CommandContainer *cont, Server_CardZone *startzone, const QList &_cardId, Server_CardZone *targetzone, int x, int y, bool faceDown, bool tapped, bool fixFreeSpaces = true, bool undoingDraw = false);
void unattachCard(CommandContainer *cont, Server_Card *card);
ResponseCode setCardAttrHelper(CommandContainer *cont, const QString &zone, int cardId, const QString &attrName, const QString &attrValue);
diff --git a/common/server_protocolhandler.cpp b/common/server_protocolhandler.cpp
index b8c9ab48..db9348f5 100644
--- a/common/server_protocolhandler.cpp
+++ b/common/server_protocolhandler.cpp
@@ -97,6 +97,7 @@ ResponseCode Server_ProtocolHandler::processCommandHelper(Command *command, Comm
case ItemId_Command_Mulligan: return cmdMulligan(static_cast(command), cont, game, player);
case ItemId_Command_RollDie: return cmdRollDie(static_cast(command), cont, game, player);
case ItemId_Command_DrawCards: return cmdDrawCards(static_cast(command), cont, game, player);
+ case ItemId_Command_UndoDraw: return cmdUndoDraw(static_cast(command), cont, game, player);
case ItemId_Command_MoveCard: return cmdMoveCard(static_cast(command), cont, game, player);
case ItemId_Command_FlipCard: return cmdFlipCard(static_cast(command), cont, game, player);
case ItemId_Command_AttachCard: return cmdAttachCard(static_cast(command), cont, game, player);
@@ -355,7 +356,12 @@ ResponseCode Server_ProtocolHandler::cmdCreateGame(Command_CreateGame *cmd, Comm
if (authState == PasswordWrong)
return RespLoginNeeded;
- Server_Game *game = room->createGame(cmd->getDescription(), cmd->getPassword(), cmd->getMaxPlayers(), cmd->getSpectatorsAllowed(), cmd->getSpectatorsNeedPassword(), cmd->getSpectatorsCanTalk(), cmd->getSpectatorsSeeEverything(), this);
+ QList gameTypes;
+ QList gameTypeList = cmd->getGameTypes();
+ for (int i = 0; i < gameTypeList.size(); ++i)
+ gameTypes.append(gameTypeList[i]->getData());
+
+ Server_Game *game = room->createGame(cmd->getDescription(), cmd->getPassword(), cmd->getMaxPlayers(), gameTypes, cmd->getSpectatorsAllowed(), cmd->getSpectatorsNeedPassword(), cmd->getSpectatorsCanTalk(), cmd->getSpectatorsSeeEverything(), this);
Server_Player *creator = game->getPlayers().values().first();
games.insert(game->getGameId(), QPair(game, creator));
@@ -501,7 +507,7 @@ ResponseCode Server_ProtocolHandler::cmdMulligan(Command_Mulligan * /*cmd*/, Com
cont->enqueueGameEventPrivate(new Event_Shuffle(player->getPlayerId()), game->getGameId());
cont->enqueueGameEventPublic(new Event_Shuffle(player->getPlayerId()), game->getGameId());
- drawCards(game, player, cont, number);
+ player->drawCards(cont, number);
return RespOk;
}
@@ -515,7 +521,7 @@ ResponseCode Server_ProtocolHandler::cmdRollDie(Command_RollDie *cmd, CommandCon
return RespOk;
}
-ResponseCode Server_ProtocolHandler::drawCards(Server_Game *game, Server_Player *player, CommandContainer *cont, int number)
+ResponseCode Server_ProtocolHandler::cmdDrawCards(Command_DrawCards *cmd, CommandContainer *cont, Server_Game *game, Server_Player *player)
{
if (player->getSpectator())
return RespFunctionNotAllowed;
@@ -523,33 +529,20 @@ ResponseCode Server_ProtocolHandler::drawCards(Server_Game *game, Server_Player
if (!game->getGameStarted())
return RespGameNotStarted;
- Server_CardZone *deck = player->getZones().value("deck");
- Server_CardZone *hand = player->getZones().value("hand");
- if (deck->cards.size() < number)
- number = deck->cards.size();
-
- QList cardListPrivate;
- QList cardListOmniscient;
- for (int i = 0; i < number; ++i) {
- Server_Card *card = deck->cards.takeFirst();
- hand->cards.append(card);
- cardListPrivate.append(new ServerInfo_Card(card->getId(), card->getName()));
- cardListOmniscient.append(new ServerInfo_Card(card->getId(), card->getName()));
- }
- cont->enqueueGameEventPrivate(new Event_DrawCards(player->getPlayerId(), cardListPrivate.size(), cardListPrivate), game->getGameId());
- cont->enqueueGameEventOmniscient(new Event_DrawCards(player->getPlayerId(), cardListOmniscient.size(), cardListOmniscient), game->getGameId());
- cont->enqueueGameEventPublic(new Event_DrawCards(player->getPlayerId(), cardListPrivate.size()), game->getGameId());
-
- return RespOk;
+ return player->drawCards(cont, cmd->getNumber());
}
-
-ResponseCode Server_ProtocolHandler::cmdDrawCards(Command_DrawCards *cmd, CommandContainer *cont, Server_Game *game, Server_Player *player)
+ResponseCode Server_ProtocolHandler::cmdUndoDraw(Command_UndoDraw *cmd, CommandContainer *cont, Server_Game *game, Server_Player *player)
{
- return drawCards(game, player, cont, cmd->getNumber());
+ if (player->getSpectator())
+ return RespFunctionNotAllowed;
+
+ if (!game->getGameStarted())
+ return RespGameNotStarted;
+
+ return player->undoDraw(cont);
}
-
ResponseCode Server_ProtocolHandler::cmdMoveCard(Command_MoveCard *cmd, CommandContainer *cont, Server_Game *game, Server_Player *player)
{
if (player->getSpectator())
diff --git a/common/server_protocolhandler.h b/common/server_protocolhandler.h
index 3e915f42..10d8516d 100644
--- a/common/server_protocolhandler.h
+++ b/common/server_protocolhandler.h
@@ -61,8 +61,8 @@ private:
ResponseCode cmdShuffle(Command_Shuffle *cmd, CommandContainer *cont, Server_Game *game, Server_Player *player);
ResponseCode cmdMulligan(Command_Mulligan *cmd, CommandContainer *cont, Server_Game *game, Server_Player *player);
ResponseCode cmdRollDie(Command_RollDie *cmd, CommandContainer *cont, Server_Game *game, Server_Player *player);
- ResponseCode drawCards(Server_Game *game, Server_Player *player, CommandContainer *cont, int number);
ResponseCode cmdDrawCards(Command_DrawCards *cmd, CommandContainer *cont, Server_Game *game, Server_Player *player);
+ ResponseCode cmdUndoDraw(Command_UndoDraw *cmd, CommandContainer *cont, Server_Game *game, Server_Player *player);
ResponseCode cmdMoveCard(Command_MoveCard *cmd, CommandContainer *cont, Server_Game *game, Server_Player *player);
ResponseCode cmdFlipCard(Command_FlipCard *cmd, CommandContainer *cont, Server_Game *game, Server_Player *player);
ResponseCode cmdAttachCard(Command_AttachCard *cmd, CommandContainer *cont, Server_Game *game, Server_Player *player);
diff --git a/common/server_room.cpp b/common/server_room.cpp
index 2d244255..0bbea016 100644
--- a/common/server_room.cpp
+++ b/common/server_room.cpp
@@ -3,8 +3,8 @@
#include "server_game.h"
#include
-Server_Room::Server_Room(int _id, const QString &_name, const QString &_description, bool _autoJoin, const QString &_joinMessage, Server *parent)
- : QObject(parent), id(_id), name(_name), description(_description), autoJoin(_autoJoin), joinMessage(_joinMessage)
+Server_Room::Server_Room(int _id, const QString &_name, const QString &_description, bool _autoJoin, const QString &_joinMessage, const QStringList &_gameTypes, Server *parent)
+ : QObject(parent), id(_id), name(_name), description(_description), autoJoin(_autoJoin), joinMessage(_joinMessage), gameTypes(_gameTypes)
{
}
@@ -17,6 +17,7 @@ ServerInfo_Room *Server_Room::getInfo(bool complete) const
{
QList gameList;
QList userList;
+ QList gameTypeList;
if (complete) {
QMapIterator gameIterator(games);
while (gameIterator.hasNext())
@@ -24,9 +25,12 @@ ServerInfo_Room *Server_Room::getInfo(bool complete) const
for (int i = 0; i < size(); ++i)
userList.append(new ServerInfo_User(at(i)->getUserInfo(), false));
+
+ for (int i = 0; i < gameTypes.size(); ++i)
+ gameTypeList.append(new ServerInfo_GameType(i, gameTypes[i]));
}
- return new ServerInfo_Room(id, name, description, games.size(), size(), autoJoin, gameList, userList);
+ return new ServerInfo_Room(id, name, description, games.size(), size(), autoJoin, gameList, userList, gameTypeList);
}
void Server_Room::addClient(Server_ProtocolHandler *client)
@@ -64,9 +68,9 @@ void Server_Room::broadcastGameListUpdate(Server_Game *game)
delete event;
}
-Server_Game *Server_Room::createGame(const QString &description, const QString &password, int maxPlayers, bool spectatorsAllowed, bool spectatorsNeedPassword, bool spectatorsCanTalk, bool spectatorsSeeEverything, Server_ProtocolHandler *creator)
+Server_Game *Server_Room::createGame(const QString &description, const QString &password, int maxPlayers, const QList &gameTypes, bool spectatorsAllowed, bool spectatorsNeedPassword, bool spectatorsCanTalk, bool spectatorsSeeEverything, Server_ProtocolHandler *creator)
{
- Server_Game *newGame = new Server_Game(creator, static_cast(parent())->getNextGameId(), description, password, maxPlayers, spectatorsAllowed, spectatorsNeedPassword, spectatorsCanTalk, spectatorsSeeEverything, this);
+ Server_Game *newGame = new Server_Game(creator, static_cast(parent())->getNextGameId(), description, password, maxPlayers, gameTypes, spectatorsAllowed, spectatorsNeedPassword, spectatorsCanTalk, spectatorsSeeEverything, this);
games.insert(newGame->getGameId(), newGame);
connect(newGame, SIGNAL(gameClosing()), this, SLOT(removeGame()));
diff --git a/common/server_room.h b/common/server_room.h
index 3df55b87..cc8c52aa 100644
--- a/common/server_room.h
+++ b/common/server_room.h
@@ -25,11 +25,12 @@ private:
QString description;
bool autoJoin;
QString joinMessage;
+ QStringList gameTypes;
QMap games;
private slots:
void removeGame();
public:
- Server_Room(int _id, const QString &_name, const QString &_description, bool _autoJoin, const QString &_joinMessage, Server *parent);
+ Server_Room(int _id, const QString &_name, const QString &_description, bool _autoJoin, const QString &_joinMessage, const QStringList &_gameTypes, Server *parent);
int getId() const { return id; }
QString getName() const { return name; }
QString getDescription() const { return description; }
@@ -43,7 +44,7 @@ public:
void removeClient(Server_ProtocolHandler *client);
void say(Server_ProtocolHandler *client, const QString &s);
void broadcastGameListUpdate(Server_Game *game);
- Server_Game *createGame(const QString &description, const QString &password, int maxPlayers, bool spectatorsAllowed, bool spectatorsNeedPassword, bool spectatorsCanTalk, bool spectatorsSeeEverything, Server_ProtocolHandler *creator);
+ Server_Game *createGame(const QString &description, const QString &password, int maxPlayers, const QList &_gameTypes, bool spectatorsAllowed, bool spectatorsNeedPassword, bool spectatorsCanTalk, bool spectatorsSeeEverything, Server_ProtocolHandler *creator);
void sendRoomEvent(RoomEvent *event);
};
diff --git a/servatrice/servatrice.ini.example b/servatrice/servatrice.ini.example
index e9d1246e..46a2359d 100644
--- a/servatrice/servatrice.ini.example
+++ b/servatrice/servatrice.ini.example
@@ -19,6 +19,10 @@ size=1
1\description="Play anything here."
1\autojoin=true
1\joinmessage="This message is only here to show that rooms can have a join message."
+1\game_types\size=3
+1\game_types\1\name="GameType1"
+1\game_types\2\name="GameType2"
+1\game_types\3\name="GameType3"
[game]
max_game_inactivity_time=120
diff --git a/servatrice/src/servatrice.cpp b/servatrice/src/servatrice.cpp
index 05f7106f..89b89f0e 100644
--- a/servatrice/src/servatrice.cpp
+++ b/servatrice/src/servatrice.cpp
@@ -58,12 +58,22 @@ Servatrice::Servatrice(QObject *parent)
int size = settings->beginReadArray("rooms");
for (int i = 0; i < size; ++i) {
settings->setArrayIndex(i);
+
+ QStringList gameTypes;
+ int size2 = settings->beginReadArray("game_types");
+ for (int j = 0; j < size2; ++j) {
+ settings->setArrayIndex(j);
+ gameTypes.append(settings->value("name").toString());
+ }
+ settings->endArray();
+
Server_Room *newRoom = new Server_Room(
i,
settings->value("name").toString(),
settings->value("description").toString(),
settings->value("autojoin").toBool(),
settings->value("joinmessage").toString(),
+ gameTypes,
this
);
addRoom(newRoom);
@@ -225,4 +235,4 @@ void Servatrice::statusUpdate()
execSqlQuery(query);
}
-const QString Servatrice::versionString = "Servatrice 0.20110126";
+const QString Servatrice::versionString = "Servatrice 0.20110127";
diff --git a/servatrice/src/serversocketinterface.cpp b/servatrice/src/serversocketinterface.cpp
index 44cf4729..99fb1bb1 100644
--- a/servatrice/src/serversocketinterface.cpp
+++ b/servatrice/src/serversocketinterface.cpp
@@ -85,7 +85,7 @@ void ServerSocketInterface::readClient()
void ServerSocketInterface::catchSocketError(QAbstractSocket::SocketError socketError)
{
- qDebug(QString("socket error: %1").arg(socketError).toLatin1());
+ qDebug() << "Socket error:" << socketError;
deleteLater();
}
@@ -327,7 +327,7 @@ ResponseCode ServerSocketInterface::cmdDeckDownload(Command_DeckDownload *cmd, C
// ADMIN FUNCTIONS.
// Permission is checked by the calling function.
-ResponseCode ServerSocketInterface::cmdUpdateServerMessage(Command_UpdateServerMessage *cmd, CommandContainer *cont)
+ResponseCode ServerSocketInterface::cmdUpdateServerMessage(Command_UpdateServerMessage * /*cmd*/, CommandContainer * /*cont*/)
{
servatrice->updateLoginMessage();
return RespOk;