diff --git a/cockatrice/cockatrice.pro b/cockatrice/cockatrice.pro index b126f14a..5902e418 100644 --- a/cockatrice/cockatrice.pro +++ b/cockatrice/cockatrice.pro @@ -28,6 +28,8 @@ HEADERS += src/abstractcounter.h \ src/handcounter.h \ src/carddatabase.h \ src/gameview.h \ + src/gameselector.h \ + src/gametypemap.h \ src/decklistmodel.h \ src/dlg_load_deck_from_clipboard.h \ src/dlg_load_remote_deck.h \ @@ -114,6 +116,7 @@ SOURCES += src/abstractcounter.cpp \ src/handcounter.cpp \ src/carddatabase.cpp \ src/gameview.cpp \ + src/gameselector.cpp \ src/decklistmodel.cpp \ src/dlg_load_deck_from_clipboard.cpp \ src/dlg_load_remote_deck.cpp \ diff --git a/cockatrice/src/gamesmodel.cpp b/cockatrice/src/gamesmodel.cpp index 700877f2..9aff702b 100644 --- a/cockatrice/src/gamesmodel.cpp +++ b/cockatrice/src/gamesmodel.cpp @@ -1,8 +1,8 @@ #include "gamesmodel.h" #include "protocol_datastructures.h" -GamesModel::GamesModel(const QMap &_gameTypes, QObject *parent) - : QAbstractTableModel(parent), gameTypes(_gameTypes) +GamesModel::GamesModel(const QMap &_rooms, const QMap &_gameTypes, QObject *parent) + : QAbstractTableModel(parent), rooms(_rooms), gameTypes(_gameTypes) { } @@ -30,17 +30,19 @@ QVariant GamesModel::data(const QModelIndex &index, int role) const ServerInfo_Game *g = gameList[index.row()]; switch (index.column()) { - case 0: return g->getDescription(); - case 1: return g->getCreatorInfo()->getName(); - case 2: { + case 0: return rooms.value(g->getRoomId()); + case 1: return g->getDescription(); + case 2: return g->getCreatorInfo()->getName(); + case 3: { QStringList result; QList gameTypeList = g->getGameTypes(); + GameTypeMap gameTypeMap = gameTypes.value(g->getRoomId()); for (int i = 0; i < gameTypeList.size(); ++i) - result.append(gameTypes.value(gameTypeList[i]->getData())); + result.append(gameTypeMap.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: { + case 4: return g->getHasPassword() ? (g->getSpectatorsNeedPassword() ? tr("yes") : tr("yes, free for spectators")) : tr("no"); + case 5: { QStringList result; if (g->getOnlyBuddies()) result.append(tr("buddies only")); @@ -48,8 +50,8 @@ QVariant GamesModel::data(const QModelIndex &index, int role) const result.append(tr("reg. users only")); return result.join(", "); } - case 5: return QString("%1/%2").arg(g->getPlayerCount()).arg(g->getMaxPlayers()); - case 6: return g->getSpectatorsAllowed() ? QVariant(g->getSpectatorCount()) : QVariant(tr("not allowed")); + case 6: return QString("%1/%2").arg(g->getPlayerCount()).arg(g->getMaxPlayers()); + case 7: return g->getSpectatorsAllowed() ? QVariant(g->getSpectatorCount()) : QVariant(tr("not allowed")); default: return QVariant(); } } @@ -59,13 +61,14 @@ QVariant GamesModel::headerData(int section, Qt::Orientation orientation, int ro if ((role != Qt::DisplayRole) || (orientation != Qt::Horizontal)) return QVariant(); switch (section) { - case 0: return tr("Description"); - case 1: return tr("Creator"); - case 2: return tr("Game type"); - case 3: return tr("Password"); - case 4: return tr("Restrictions"); - case 5: return tr("Players"); - case 6: return tr("Spectators"); + case 0: return tr("Room"); + case 1: return tr("Description"); + case 2: return tr("Creator"); + case 3: return tr("Game type"); + case 4: return tr("Password"); + case 5: return tr("Restrictions"); + case 6: return tr("Players"); + case 7: return tr("Spectators"); default: return QVariant(); } } @@ -82,7 +85,7 @@ void GamesModel::updateGameList(ServerInfo_Game *_game) 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->getOnlyBuddies(), _game->getOnlyRegistered(), _game->getSpectatorsAllowed(), _game->getSpectatorsNeedPassword(), _game->getSpectatorCount()); + ServerInfo_Game *game = new ServerInfo_Game(_game->getRoomId(), _game->getGameId(), _game->getDescription(), _game->getHasPassword(), _game->getPlayerCount(), _game->getMaxPlayers(), gameTypeList, new ServerInfo_User(_game->getCreatorInfo()), _game->getOnlyBuddies(), _game->getOnlyRegistered(), _game->getSpectatorsAllowed(), _game->getSpectatorsNeedPassword(), _game->getSpectatorCount()); for (int i = 0; i < gameList.size(); i++) if (gameList[i]->getGameId() == game->getGameId()) { if (game->getPlayerCount() == 0) { @@ -92,7 +95,7 @@ void GamesModel::updateGameList(ServerInfo_Game *_game) } else { delete gameList[i]; gameList[i] = game; - emit dataChanged(index(i, 0), index(i, 4)); + emit dataChanged(index(i, 0), index(i, 7)); } return; } diff --git a/cockatrice/src/gamesmodel.h b/cockatrice/src/gamesmodel.h index a7f4fe68..6be0d140 100644 --- a/cockatrice/src/gamesmodel.h +++ b/cockatrice/src/gamesmodel.h @@ -4,6 +4,7 @@ #include #include #include +#include "gametypemap.h" class ServerInfo_Game; @@ -11,12 +12,13 @@ class GamesModel : public QAbstractTableModel { Q_OBJECT private: QList gameList; - QMap gameTypes; + QMap rooms; + QMap gameTypes; public: - GamesModel(const QMap &_gameTypes, QObject *parent = 0); + GamesModel(const QMap &_rooms, 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 7; } + int columnCount(const QModelIndex &/*parent*/ = QModelIndex()) const { return 8; } QVariant data(const QModelIndex &index, int role) const; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; diff --git a/cockatrice/src/tab_room.cpp b/cockatrice/src/tab_room.cpp index b1d23c93..7fbce5a7 100644 --- a/cockatrice/src/tab_room.cpp +++ b/cockatrice/src/tab_room.cpp @@ -4,127 +4,17 @@ #include #include #include -#include #include #include -#include #include #include -#include "dlg_creategame.h" #include "tab_supervisor.h" #include "tab_room.h" #include "userlist.h" #include "abstractclient.h" #include "protocol_items.h" -#include "gamesmodel.h" #include "chatview.h" - -GameSelector::GameSelector(AbstractClient *_client, TabRoom *_room, QWidget *parent) - : QGroupBox(parent), client(_client), room(_room) -{ - gameListView = new QTreeView; - gameListModel = new GamesModel(room->getGameTypes(), this); - gameListProxyModel = new GamesProxyModel(this); - gameListProxyModel->setSourceModel(gameListModel); - gameListProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive); - gameListView->setModel(gameListProxyModel); - gameListView->header()->setResizeMode(0, QHeaderView::ResizeToContents); - gameListView->setSortingEnabled(true); - - showFullGamesCheckBox = new QCheckBox; - createButton = new QPushButton; - joinButton = new QPushButton; - spectateButton = new QPushButton; - QHBoxLayout *buttonLayout = new QHBoxLayout; - buttonLayout->addWidget(showFullGamesCheckBox); - buttonLayout->addStretch(); - buttonLayout->addWidget(createButton); - buttonLayout->addWidget(joinButton); - buttonLayout->addWidget(spectateButton); - - QVBoxLayout *mainLayout = new QVBoxLayout; - mainLayout->addWidget(gameListView); - mainLayout->addLayout(buttonLayout); - - retranslateUi(); - setLayout(mainLayout); - - setMinimumWidth((qreal) (gameListView->columnWidth(0) * gameListModel->columnCount()) / 1.5); - setMinimumHeight(200); - - connect(showFullGamesCheckBox, SIGNAL(stateChanged(int)), this, SLOT(showFullGamesChanged(int))); - connect(createButton, SIGNAL(clicked()), this, SLOT(actCreate())); - connect(joinButton, SIGNAL(clicked()), this, SLOT(actJoin())); - connect(spectateButton, SIGNAL(clicked()), this, SLOT(actJoin())); -} - -void GameSelector::showFullGamesChanged(int state) -{ - gameListProxyModel->setFullGamesVisible(state); -} - -void GameSelector::actCreate() -{ - DlgCreateGame dlg(client, room->getRoomId(), room->getGameTypes(), this); - dlg.exec(); -} - -void GameSelector::checkResponse(ResponseCode response) -{ - createButton->setEnabled(true); - joinButton->setEnabled(true); - spectateButton->setEnabled(true); - - switch (response) { - case RespWrongPassword: QMessageBox::critical(this, tr("Error"), tr("Wrong password.")); break; - case RespSpectatorsNotAllowed: QMessageBox::critical(this, tr("Error"), tr("Spectators are not allowed in this game.")); break; - case RespGameFull: QMessageBox::critical(this, tr("Error"), tr("The game is already full.")); break; - case RespNameNotFound: QMessageBox::critical(this, tr("Error"), tr("The game does not exist any more.")); break; - case RespUserLevelTooLow: QMessageBox::critical(this, tr("Error"), tr("This game is only open to registered users.")); break; - case RespOnlyBuddies: QMessageBox::critical(this, tr("Error"), tr("This game is only open to its creator's buddies.")); break; - case RespInIgnoreList: QMessageBox::critical(this, tr("Error"), tr("You are being ignored by the creator of this game.")); break; - default: ; - } -} - -void GameSelector::actJoin() -{ - bool spectator = sender() == spectateButton; - - QModelIndex ind = gameListView->currentIndex(); - if (!ind.isValid()) - return; - ServerInfo_Game *game = gameListModel->getGame(ind.data(Qt::UserRole).toInt()); - QString password; - if (game->getHasPassword() && !(spectator && !game->getSpectatorsNeedPassword())) { - bool ok; - password = QInputDialog::getText(this, tr("Join game"), tr("Password:"), QLineEdit::Password, QString(), &ok); - if (!ok) - return; - } - - Command_JoinGame *commandJoinGame = new Command_JoinGame(room->getRoomId(), game->getGameId(), password, spectator); - connect(commandJoinGame, SIGNAL(finished(ResponseCode)), this, SLOT(checkResponse(ResponseCode))); - client->sendCommand(commandJoinGame); - - createButton->setEnabled(false); - joinButton->setEnabled(false); - spectateButton->setEnabled(false); -} - -void GameSelector::retranslateUi() -{ - setTitle(tr("Games")); - showFullGamesCheckBox->setText(tr("Show &full games")); - createButton->setText(tr("C&reate")); - joinButton->setText(tr("&Join")); - spectateButton->setText(tr("J&oin as spectator")); -} - -void GameSelector::processGameInfo(ServerInfo_Game *info) -{ - gameListModel->updateGameList(info); -} +#include "gameselector.h" TabRoom::TabRoom(TabSupervisor *_tabSupervisor, AbstractClient *_client, const QString &_ownName, ServerInfo_Room *info) : Tab(_tabSupervisor), client(_client), roomId(info->getRoomId()), roomName(info->getName()), ownName(_ownName) @@ -133,7 +23,9 @@ TabRoom::TabRoom(TabSupervisor *_tabSupervisor, AbstractClient *_client, const Q for (int i = 0; i < gameTypeList.size(); ++i) gameTypes.insert(gameTypeList[i]->getGameTypeId(), gameTypeList[i]->getDescription()); - gameSelector = new GameSelector(client, this); + QMap tempMap; + tempMap.insert(info->getRoomId(), gameTypes); + gameSelector = new GameSelector(client, this, QMap(), tempMap); userList = new UserList(tabSupervisor, client, UserList::RoomList); connect(userList, SIGNAL(openMessageDialog(const QString &, bool)), this, SIGNAL(openMessageDialog(const QString &, bool))); diff --git a/cockatrice/src/tab_room.h b/cockatrice/src/tab_room.h index 9c19542f..37e6a3d1 100644 --- a/cockatrice/src/tab_room.h +++ b/cockatrice/src/tab_room.h @@ -2,20 +2,16 @@ #define TAB_ROOM_H #include "tab.h" -#include "protocol_datastructures.h" #include +#include class AbstractClient; class UserList; class QLabel; class ChatView; class QLineEdit; -class QTreeView; class QPushButton; class QTextTable; -class QCheckBox; -class GamesModel; -class GamesProxyModel; class RoomEvent; class ServerInfo_Room; class ServerInfo_Game; @@ -24,31 +20,7 @@ class Event_JoinRoom; class Event_LeaveRoom; class Event_RoomSay; class ProtocolResponse; -class TabRoom; - -class GameSelector : public QGroupBox { - Q_OBJECT -private slots: - void showFullGamesChanged(int state); - void actCreate(); - void actJoin(); - void checkResponse(ResponseCode response); -signals: - void gameJoined(int gameId); -private: - AbstractClient *client; - TabRoom *room; - - QTreeView *gameListView; - GamesModel *gameListModel; - GamesProxyModel *gameListProxyModel; - QPushButton *createButton, *joinButton, *spectateButton; - QCheckBox *showFullGamesCheckBox; -public: - GameSelector(AbstractClient *_client, TabRoom *_room, QWidget *parent = 0); - void retranslateUi(); - void processGameInfo(ServerInfo_Game *info); -}; +class GameSelector; class TabRoom : public Tab { Q_OBJECT diff --git a/cockatrice/src/userlist.cpp b/cockatrice/src/userlist.cpp index 419d8b78..20b60992 100644 --- a/cockatrice/src/userlist.cpp +++ b/cockatrice/src/userlist.cpp @@ -5,6 +5,7 @@ #include "pixmapgenerator.h" #include "userinfobox.h" #include "protocol_items.h" +#include "gameselector.h" #include #include #include @@ -210,6 +211,35 @@ void UserList::userClicked(QTreeWidgetItem *item, int /*column*/) emit openMessageDialog(item->data(2, Qt::UserRole).toString(), true); } +void UserList::gamesOfUserReceived(ProtocolResponse *resp) +{ + Command_GetGamesOfUser *command = static_cast(sender()); + Response_GetGamesOfUser *response = qobject_cast(resp); + if (!response) + return; + + QMap gameTypeMap; + QMap roomMap; + const QList roomList = response->getRoomList(); + for (int i = 0; i < roomList.size(); ++i) { + roomMap.insert(roomList[i]->getRoomId(), roomList[i]->getName()); + const QList gameTypeList = roomList[i]->getGameTypeList(); + GameTypeMap tempMap; + for (int j = 0; j < gameTypeList.size(); ++j) + tempMap.insert(gameTypeList[j]->getGameTypeId(), gameTypeList[j]->getDescription()); + gameTypeMap.insert(roomList[i]->getRoomId(), tempMap); + } + + GameSelector *selector = new GameSelector(client, 0, roomMap, gameTypeMap); + const QList gameList = response->getGameList(); + for (int i = 0; i < gameList.size(); ++i) + selector->processGameInfo(gameList[i]); + + selector->setWindowTitle(tr("%1's games").arg(command->getUserName())); + selector->setAttribute(Qt::WA_DeleteOnClose); + selector->show(); +} + void UserList::showContextMenu(const QPoint &pos, const QModelIndex &index) { const QString &userName = index.sibling(index.row(), 2).data(Qt::UserRole).toString(); @@ -230,6 +260,7 @@ void UserList::showContextMenu(const QPoint &pos, const QModelIndex &index) menu->addAction(aUserName); menu->addSeparator(); menu->addAction(aDetails); + menu->addAction(aShowGames); menu->addAction(aChat); if ((userLevel & ServerInfo_User::IsRegistered) && (tabSupervisor->getUserLevel() & ServerInfo_User::IsRegistered)) { menu->addSeparator(); @@ -260,7 +291,7 @@ void UserList::showContextMenu(const QPoint &pos, const QModelIndex &index) client->sendCommand(new Command_RemoveFromList("buddy", userName)); else if (actionClicked == aShowGames) { Command *cmd = new Command_GetGamesOfUser(userName); - connect(cmd, SIGNAL(responseReceived(ProtocolResponse *)), this, SLOT(gamesOfUserReceived(ProtocolResponse *))); + connect(cmd, SIGNAL(finished(ProtocolResponse *)), this, SLOT(gamesOfUserReceived(ProtocolResponse *))); client->sendCommand(cmd); } else if (actionClicked == aAddToIgnoreList) client->sendCommand(new Command_AddToList("ignore", userName)); diff --git a/cockatrice/src/userlist.h b/cockatrice/src/userlist.h index a40fca0f..c71ddc31 100644 --- a/cockatrice/src/userlist.h +++ b/cockatrice/src/userlist.h @@ -12,6 +12,7 @@ class AbstractClient; class TabSupervisor; class QSpinBox; class QPlainTextEdit; +class ProtocolResponse; class BanDialog : public QDialog { Q_OBJECT @@ -52,6 +53,7 @@ private: void setUserOnline(QTreeWidgetItem *user, bool online); private slots: void userClicked(QTreeWidgetItem *item, int column); + void gamesOfUserReceived(ProtocolResponse *resp); signals: void openMessageDialog(const QString &userName, bool focus); void addBuddy(const QString &userName); diff --git a/cockatrice/translations/cockatrice_cs.ts b/cockatrice/translations/cockatrice_cs.ts index a3f47786..0b328cc0 100644 --- a/cockatrice/translations/cockatrice_cs.ts +++ b/cockatrice/translations/cockatrice_cs.ts @@ -129,29 +129,29 @@ BanDialog - + Please enter the duration of the ban (in minutes). Enter 0 for an indefinite ban. - + Please enter the reason for the ban. This is only saved for moderators and cannot be seen by the banned person. - + &OK - + &Cancel - + Ban user from server @@ -926,82 +926,82 @@ This is only saved for moderators and cannot be seen by the banned person. - + P&layers: - + Game type - + &Password: - + Only &buddies can join - + Only &registered users can join - + Joining restrictions - + &Spectators allowed - + Spectators &need a password to join - + Spectators can &chat - + Spectators see &everything - + Spectators - + &OK - + &Cancel - + Create game - + Error - + Server error. @@ -1203,83 +1203,89 @@ This is only saved for moderators and cannot be seen by the banned person. GameSelector - - - - - - - + + + + + + + + Error - + + Please join the appropriate room first. + + + + Wrong password. - + Spectators are not allowed in this game. - + The game is already full. - + The game does not exist any more. - + This game is only open to registered users. - + This game is only open to its creator's buddies. - + You are being ignored by the creator of this game. - + Join game - + Password: - + Games - + Show &full games - + C&reate - + &Join - + J&oin as spectator @@ -1295,67 +1301,72 @@ This is only saved for moderators and cannot be seen by the banned person. GamesModel - + yes - + yes, free for spectators - + no - + buddies only - + reg. users only - + not allowed - - - Description - - - - - Creator - - - Game type + Room - Password + Description - Restrictions + Creator - Players + Game type + Password + + + + + Restrictions + + + + + Players + + + + Spectators @@ -2581,7 +2592,7 @@ Local version is %1, remote version is %2. - + Number: @@ -2606,27 +2617,27 @@ Local version is %1, remote version is %2. - + Set power/toughness - + Please enter the new PT: - + Set annotation - + Please enter the new annotation: - + Set counters @@ -3083,27 +3094,27 @@ Please enter a name: TabRoom - + &Say: - + Chat - + &Room - + &Leave room - + You are flooding the chat. Please wait a couple of seconds. @@ -3213,57 +3224,67 @@ Please enter a name: UserList - + Users online: %1 - + Users in this room: %1 - + Buddies online: %1 / %2 - + Ignored users online: %1 / %2 - + + %1's games + + + + User &details - + Direct &chat - + + Show this user's &games + + + + Add to &buddy list - + Remove from &buddy list - + Add to &ignore list - + Remove from &ignore list - + Ban from &server diff --git a/cockatrice/translations/cockatrice_de.ts b/cockatrice/translations/cockatrice_de.ts index 6ca4c184..735b3c3b 100644 --- a/cockatrice/translations/cockatrice_de.ts +++ b/cockatrice/translations/cockatrice_de.ts @@ -164,7 +164,7 @@ BanDialog - + Please enter the duration of the ban (in minutes). Enter 0 for an indefinite ban. Bitte geben Sie die Dauer des Banns ein (in Minuten). @@ -175,24 +175,24 @@ Geben Sie 0 ein für einen unbefristeten Bann. Bitte geben Sie den Grund für den Bann ein. Dies wird nur für Moderatoren gespeichert und kann von der gebannten Person nicht gesehen werden. - + Please enter the reason for the ban. This is only saved for moderators and cannot be seen by the banned person. Bitte geben Sie den Grund für den Bann ein. Dies wird nur für Moderatoren gespeichert und kann von der gebannten Person nicht gesehen werden. - + &OK &OK - + &Cancel &Abbrechen - + Ban user from server Benutzer vom Server bannen @@ -1361,42 +1361,42 @@ Dies wird nur für Moderatoren gespeichert und kann von der gebannten Person nic &Beschreibung: - + &Password: &Passwort: - + P&layers: &Spieler: - + Game type Spieltyp - + Only &buddies can join Nur &Freunde können teilnehmen - + Only &registered users can join Nur &registrierte Benutzer können teilnehmen - + Joining restrictions Teilnahmebedingungen - + &Spectators allowed &Zuschauer zugelassen - + Spectators &need a password to join Zuschauer brauchen &auch ein Passwort @@ -1405,37 +1405,37 @@ Dies wird nur für Moderatoren gespeichert und kann von der gebannten Person nic 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 @@ -1444,7 +1444,7 @@ Dies wird nur für Moderatoren gespeichert und kann von der gebannten Person nic Ungültige Anzahl an Spielern. - + Server error. Serverfehler. @@ -1947,23 +1947,24 @@ Dies wird nur für Moderatoren gespeichert und kann von der gebannten Person nic GameSelector - + C&reate Spiel e&rstellen - + &Join &Teilnehmen - - - - - - - + + + + + + + + Error Fehler @@ -1972,57 +1973,62 @@ Dies wird nur für Moderatoren gespeichert und kann von der gebannten Person nic XXX - + + Please join the appropriate room first. + Bitte betreten Sie erst den entsprechenden Raum. + + + 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. - + This game is only open to registered users. Dieses Spiel kann nur von registrierten Benutzern betreten werden. - + This game is only open to its creator's buddies. Dieses Spiel kann nur von Freunden des Erstellers betreten werden. - + You are being ignored by the creator of this game. Der Ersteller dieses Spiels ignoriert Sie. - + Join game Spiel beitreten - + Password: Passwort: - + Games Spiele - + Show &full games &Volle Spiele anzeigen @@ -2031,7 +2037,7 @@ Dies wird nur für Moderatoren gespeichert und kann von der gebannten Person nic &Volle Spiele anzeigen - + J&oin as spectator &Zuschauen @@ -2047,12 +2053,12 @@ Dies wird nur für Moderatoren gespeichert und kann von der gebannten Person nic GamesModel - + yes ja - + no nein @@ -2061,57 +2067,62 @@ Dies wird nur für Moderatoren gespeichert und kann von der gebannten Person nic Spiel ID - + Creator Ersteller - + Description Beschreibung - + yes, free for spectators ja, außer für Zuschauer - + buddies only nur Freunde - + reg. users only nur reg. Benutzer - + not allowed nicht erlaubt + Room + Raum + + + Game type Spieltyp - + Password Passwort - + Restrictions Bedingungen - + Players Spieler - + Spectators Zuschauer @@ -3843,7 +3854,7 @@ Lokale Version ist %1, Serverversion ist %2. - + Number: Anzahl: @@ -3858,27 +3869,27 @@ Lokale Version ist %1, Serverversion ist %2. 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 @@ -4460,27 +4471,27 @@ Bitte geben Sie einen Namen ein: TabRoom - + &Say: &Sagen: - + Chat Unterhaltung - + &Room &Raum - + &Leave room Raum ver&lassen - + You are flooding the chat. Please wait a couple of seconds. Sie überfluten den Chatraum. Bitte warten Sie ein paar Sekunden. @@ -4617,57 +4628,67 @@ Bitte geben Sie einen Namen ein: UserList - + Users online: %1 Benutzer online: %1 - + Users in this room: %1 Benutzer in diesem Raum: %1 - + Buddies online: %1 / %2 Freunde online: %1 / %2 - + Ignored users online: %1 / %2 Ignorierte Benutzer online: %1 / %2 - + + %1's games + %1s Spiele + + + User &details Benutzer&details - + Direct &chat &Persönliches Gespräch - + + Show this user's &games + Spiele dieses &Benutzers anzeigen + + + Add to &buddy list Zur &Freundesliste hinzufügen - + Remove from &buddy list Von &Freundesliste entfernen - + Add to &ignore list &Ignorieren - + Remove from &ignore list Nicht mehr &ignorieren - + Ban from &server Vom &Server bannen diff --git a/cockatrice/translations/cockatrice_en.ts b/cockatrice/translations/cockatrice_en.ts index 3fcd278e..87989e2c 100644 --- a/cockatrice/translations/cockatrice_en.ts +++ b/cockatrice/translations/cockatrice_en.ts @@ -129,29 +129,29 @@ BanDialog - + Please enter the duration of the ban (in minutes). Enter 0 for an indefinite ban. - + Please enter the reason for the ban. This is only saved for moderators and cannot be seen by the banned person. - + &OK - + &Cancel - + Ban user from server @@ -926,82 +926,82 @@ This is only saved for moderators and cannot be seen by the banned person. - + &Password: - + P&layers: - + Game type - + Only &buddies can join - + Only &registered users can join - + Joining restrictions - + &Spectators allowed - + Spectators &need a password to join - + Spectators can &chat - + Spectators see &everything - + Spectators - + &OK - + &Cancel - + Create game - + Error - + Server error. @@ -1203,83 +1203,89 @@ This is only saved for moderators and cannot be seen by the banned person. GameSelector - + C&reate - + &Join - - - - - - - + + + + + + + + Error - + + Please join the appropriate room first. + + + + Wrong password. - + Spectators are not allowed in this game. - + The game is already full. - + The game does not exist any more. - + This game is only open to registered users. - + This game is only open to its creator's buddies. - + You are being ignored by the creator of this game. - + Join game - + Password: - + Games - + Show &full games - + J&oin as spectator @@ -1295,67 +1301,72 @@ This is only saved for moderators and cannot be seen by the banned person. GamesModel - + yes - + no - + Creator - + Description - + yes, free for spectators - + buddies only - + reg. users only - + not allowed - Game type - - - - - Password - - - - - Restrictions + Room - Players + Game type + Password + + + + + Restrictions + + + + + Players + + + + Spectators @@ -2587,7 +2598,7 @@ Local version is %1, remote version is %2. - + Number: @@ -2612,27 +2623,27 @@ Local version is %1, remote version is %2. - + Set power/toughness - + Please enter the new PT: - + Set annotation - + Please enter the new annotation: - + Set counters @@ -3089,27 +3100,27 @@ Please enter a name: TabRoom - + &Say: - + Chat - + &Room - + &Leave room - + You are flooding the chat. Please wait a couple of seconds. @@ -3219,57 +3230,67 @@ Please enter a name: UserList - + Users online: %1 - + Users in this room: %1 - + Buddies online: %1 / %2 - + Ignored users online: %1 / %2 - + + %1's games + + + + User &details - + Direct &chat - + + Show this user's &games + + + + Add to &buddy list - + Remove from &buddy list - + Add to &ignore list - + Remove from &ignore list - + Ban from &server diff --git a/cockatrice/translations/cockatrice_es.ts b/cockatrice/translations/cockatrice_es.ts index e5e199b2..877347b7 100644 --- a/cockatrice/translations/cockatrice_es.ts +++ b/cockatrice/translations/cockatrice_es.ts @@ -137,30 +137,30 @@ BanDialog - + Please enter the duration of the ban (in minutes). Enter 0 for an indefinite ban. Por favor, introduce la duración del ban (en minutos) Indica 0 para un ban indefinido. - + Please enter the reason for the ban. This is only saved for moderators and cannot be seen by the banned person. - + &OK &Aceptar - + &Cancel &Cancelar - + Ban user from server @@ -1276,82 +1276,82 @@ This is only saved for moderators and cannot be seen by the banned person.&Descripción: - + &Password: &Contraseña: - + P&layers: &Jugadores: - + Game type Tipo de partida - + Only &buddies can join Sólo los &amigos pueden participar - + Only &registered users can join Sólo los usuarios &registrados pueden participar - + Joining restrictions Restricciones de participación - + &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. @@ -1565,78 +1565,84 @@ This is only saved for moderators and cannot be seen by the banned person. GameSelector - + C&reate C&rear - + &Join E&ntrar - - - - - - - + + + + + + + + Error Error - + + Please join the appropriate room first. + + + + 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. - + This game is only open to registered users. Esta partida está abierta sólo a usuarios registrados. - + This game is only open to its creator's buddies. Esta partida está abierta sólo a los amigos del creador. - + You are being ignored by the creator of this game. Estas siendo ignorado por el creador de la partida. - + Join game Entrar en la partida - + Password: Contraseña: - + Games Partidas - + Show &full games Ver partidas &sin plazas libres @@ -1645,7 +1651,7 @@ This is only saved for moderators and cannot be seen by the banned person.&Ver partidas sin plazas libres - + J&oin as spectator Entrar como e&spectador @@ -1661,67 +1667,72 @@ This is only saved for moderators and cannot be seen by the banned person. GamesModel - + yes - + no no - + Creator Creador - + Description Descripción - + yes, free for spectators sí, libre para espectadores - + buddies only solo amigos - + reg. users only solo usuarios registrados - + not allowed no permitido + Room + Sala + + + Game type Tipo de partida - + Password Contraseña - + Restrictions Restricciones - + Players Jugadores - + Spectators Espectadores @@ -2981,7 +2992,7 @@ La versión local es %1, la versión remota es %2. - + Number: Número: @@ -3006,27 +3017,27 @@ La versión local es %1, la versión remota es %2. 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 @@ -3538,27 +3549,27 @@ Por favor, introduzca un nombre: TabRoom - + &Say: &Decir: - + Chat Chat - + &Room &Sala - + &Leave room &Dejar sala - + You are flooding the chat. Please wait a couple of seconds. Estás floodeando el chat. Por favor, espera unos segundos. @@ -3680,57 +3691,67 @@ Por favor, introduzca un nombre: UserList - + Users online: %1 Usuarios online: %1 - + Users in this room: %1 Usuarios en esta sala: %1 - + Buddies online: %1 / %2 Amigos online: %1 / %2 - + Ignored users online: %1 / %2 Usuarios ignorados online: %1 / %2 - + + %1's games + + + + User &details &Detalles del usuario - + Direct &chat &Chat privado - + + Show this user's &games + + + + Add to &buddy list Añadir a la lista de &amigos - + Remove from &buddy list Quitar de la lista de &amigos - + Add to &ignore list Añadir a la lista de &ignorados - + Remove from &ignore list Quitar de la lista de &ignorados - + Ban from &server Banear del &servidor diff --git a/cockatrice/translations/cockatrice_fr.ts b/cockatrice/translations/cockatrice_fr.ts index 1aec9f3c..2df8edd4 100644 --- a/cockatrice/translations/cockatrice_fr.ts +++ b/cockatrice/translations/cockatrice_fr.ts @@ -129,30 +129,30 @@ BanDialog - + Please enter the duration of the ban (in minutes). Enter 0 for an indefinite ban. Entrez la durée de temps du ban (en minutes). Entrez 0 pour une durée illimitée du ban. - + Please enter the reason for the ban. This is only saved for moderators and cannot be seen by the banned person. - + &OK &OK - + &Cancel &Annuler - + Ban user from server @@ -1138,82 +1138,82 @@ This is only saved for moderators and cannot be seen by the banned person.&Description: - + &Password: Mot de &Passe: - + P&layers: &Joueurs: - + Game type Type de partie - + Only &buddies can join Seuls les &amis peuvent rejoindre - + Only &registered users can join Seules les personnes en&registrées peuvent rejoindre - + Joining restrictions Conditions pour rejoindre - + &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 dis&cuter - + 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. @@ -1415,68 +1415,74 @@ This is only saved for moderators and cannot be seen by the banned person. GameSelector - - - - - - - + + + + + + + + Error Erreur - + + Please join the appropriate room first. + + + + Wrong password. Mot de passe erroné. - + 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. - + This game is only open to registered users. Cette partie n'est accessible qu'aux joueurs enregistrés. - + This game is only open to its creator's buddies. Cette partie n'est accessible qu'aux amis. - + You are being ignored by the creator of this game. Vous avez été ignoré par le créateur de la partie. - + Join game Rejoindre partie - + Password: Mot de passe: - + Games Parties - + Show &full games Montrer &toutes les parties @@ -1486,17 +1492,17 @@ This is only saved for moderators and cannot be seen by the banned person.&Montrer toutes les parties - + C&reate C&réer - + &Join Re&joindre - + J&oin as spectator Rej&oindre en tant que spectateur @@ -1512,67 +1518,72 @@ This is only saved for moderators and cannot be seen by the banned person. GamesModel - + yes oui - + yes, free for spectators oui, libre pour les spectateurs - + no non - + buddies only invités uniquement - + reg. users only joueurs enregistrés uniquement - + not allowed non autorisé - + + Room + Salon + + + Description Description - + Creator Créateur - + Game type Type de jeu - + Password Mot de passe - + Restrictions Restrictions - + Players Joueurs - + Spectators Spectateurs @@ -2846,7 +2857,7 @@ La version la plus récente est %1, l'ancienne version est %2. - + Number: Nombre: @@ -2871,28 +2882,28 @@ La version la plus récente est %1, l'ancienne version est %2.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 une note - + Please enter the new annotation: Entrez la nouvelle note: - + Set counters Mettre des marqueurs @@ -3398,27 +3409,27 @@ Entrez un nom s'il vous plaît: TabRoom - + &Say: &Dire: - + Chat Chat - + &Room &Salon - + &Leave room &Quitter le salon - + You are flooding the chat. Please wait a couple of seconds. Vous floodez le chat. Veuillez patienter quelques secondes. @@ -3541,57 +3552,67 @@ Entrez un nom s'il vous plaît: UserList - + Users online: %1 Utilisateurs en ligne:%1 - + Users in this room: %1 Utilisateurs dans ce salon: %1 - + Buddies online: %1 / %2 Amis connectés; %1 / %2 - + Ignored users online: %1 / %2 Personnes sur liste noire connectés: %1 / %2 - + + %1's games + + + + User &details &Détails utilisateur - + Direct &chat &Chat direct - + + Show this user's &games + + + + Add to &buddy list Ajouter à la liste d'&amis - + Remove from &buddy list Retirer de la liste d'&amis - + Add to &ignore list Ajouter à la liste &noire - + Remove from &ignore list Retirer de la liste &noire - + Ban from &server Bannir du &serveur diff --git a/cockatrice/translations/cockatrice_ja.ts b/cockatrice/translations/cockatrice_ja.ts index f6d1b9c0..c9f0a6e9 100644 --- a/cockatrice/translations/cockatrice_ja.ts +++ b/cockatrice/translations/cockatrice_ja.ts @@ -134,29 +134,29 @@ BanDialog - + Please enter the duration of the ban (in minutes). Enter 0 for an indefinite ban. バンする期間を入力してください(分単位).0でバンを解除します. - + Please enter the reason for the ban. This is only saved for moderators and cannot be seen by the banned person. - + &OK - + &Cancel - + Ban user from server @@ -974,82 +974,82 @@ This is only saved for moderators and cannot be seen by the banned person.説明: - + &Password: パスワード: - + P&layers: プレイヤー人数: - + Game type ゲームタイプ - + Only &buddies can join フレンドのみ参加可能 - + Only &registered users can join 登録済みプレイヤーのみ参加可能 - + Joining restrictions 参加制限 - + &Spectators allowed 観戦者を許可する - + Spectators &need a password to join 観戦者は参加にパスワードが必要 - + Spectators can &chat 観戦者はチャットに参加できる - + Spectators see &everything 観戦者は全て見れる - + Spectators 観戦者 - + &OK - + &Cancel - + Create game 部屋を作る - + Error エラー - + Server error. サーバーエラー. @@ -1251,78 +1251,84 @@ This is only saved for moderators and cannot be seen by the banned person. GameSelector - + C&reate 部屋を作る - + &Join 参加する - - - - - - - + + + + + + + + Error エラー - + + Please join the appropriate room first. + + + + Wrong password. パスワードが間違っています. - + Spectators are not allowed in this game. この試合は観戦者は許可されていません. - + The game is already full. このゲームはすでに満員です. - + The game does not exist any more. このゲームはもう存在しません. - + This game is only open to registered users. このゲームは登録済みプレイヤーにのみ公開されています. - + This game is only open to its creator's buddies. このゲームは作成者のフレンドのみに公開されています. - + You are being ignored by the creator of this game. あなたはこのゲームの作成者によって拒否されています. - + Join game 参加 - + Password: パスワード: - + Games ゲーム - + Show &full games 全てのゲームを見る @@ -1331,7 +1337,7 @@ This is only saved for moderators and cannot be seen by the banned person.全てのゲームを見る - + J&oin as spectator 観戦者として参加 @@ -1347,67 +1353,72 @@ This is only saved for moderators and cannot be seen by the banned person. GamesModel - + yes あり - + no なし - + Creator 作成者 - + Description 説明 - + yes, free for spectators あり,観戦は自由 - + buddies only フレンドのみ - + reg. users only 登録済みユーザーのみ - + not allowed 不許可 + Room + 部屋 + + + Game type ゲームタイプ - + Password パスワード - + Restrictions 制限 - + Players プレイヤー - + Spectators 観戦者 @@ -2634,7 +2645,7 @@ Local version is %1, remote version is %2. - + Number: 枚数 @@ -2659,27 +2670,27 @@ Local version is %1, remote version is %2. 面の数: - + Set power/toughness パワーとタフネスを設定する - + Please enter the new PT: 新しいP/Tを入力してください - + Set annotation 補足を付ける - + Please enter the new annotation: 新しい補足を付けてください - + Set counters カウンターを設定する @@ -3174,27 +3185,27 @@ Please enter a name: TabRoom - + &Say: 発言する - + Chat チャット - + &Room 部屋 - + &Leave room 部屋から出る - + You are flooding the chat. Please wait a couple of seconds. あなたはチャットルームから弾かれました.少々お待ちください. @@ -3316,57 +3327,67 @@ Please enter a name: UserList - + Users online: %1 ユーザー オンライン: %1 - + Users in this room: %1 部屋のユーザー数: %1 - + Buddies online: %1 / %2 フレンドオンライン: %1 / %2 - + Ignored users online: %1 / %2 無視ユーザーオンライン: %1 / %2 - + + %1's games + + + + User &details ユーザー補足 - + Direct &chat 個人チャット - + + Show this user's &games + + + + Add to &buddy list フレンドリストに追加 - + Remove from &buddy list フレンドリストから削除 - + Add to &ignore list 無視リストに追加 - + Remove from &ignore list 無視リストから削除 - + Ban from &server サーバーからバンする diff --git a/cockatrice/translations/cockatrice_pl.ts b/cockatrice/translations/cockatrice_pl.ts index 07fd6510..492dbed2 100644 --- a/cockatrice/translations/cockatrice_pl.ts +++ b/cockatrice/translations/cockatrice_pl.ts @@ -129,29 +129,29 @@ BanDialog - + Please enter the duration of the ban (in minutes). Enter 0 for an indefinite ban. - + Please enter the reason for the ban. This is only saved for moderators and cannot be seen by the banned person. - + &OK - + &Cancel - + Ban user from server @@ -926,82 +926,82 @@ This is only saved for moderators and cannot be seen by the banned person. - + P&layers: - + Game type - + &Password: - + Only &buddies can join - + Only &registered users can join - + Joining restrictions - + &Spectators allowed - + Spectators &need a password to join - + Spectators can &chat - + Spectators see &everything - + Spectators - + &OK - + &Cancel - + Create game - + Error - + Server error. @@ -1203,83 +1203,89 @@ This is only saved for moderators and cannot be seen by the banned person. GameSelector - - - - - - - + + + + + + + + Error - + + Please join the appropriate room first. + + + + Wrong password. - + Spectators are not allowed in this game. - + The game is already full. - + The game does not exist any more. - + This game is only open to registered users. - + This game is only open to its creator's buddies. - + You are being ignored by the creator of this game. - + Join game - + Password: - + Games - + Show &full games - + C&reate - + &Join - + J&oin as spectator @@ -1295,67 +1301,72 @@ This is only saved for moderators and cannot be seen by the banned person. GamesModel - + yes - + yes, free for spectators - + no - + buddies only - + reg. users only - + not allowed - - - Description - - - - - Creator - - - Game type + Room - Password + Description - Restrictions + Creator - Players + Game type + Password + + + + + Restrictions + + + + + Players + + + + Spectators @@ -2581,7 +2592,7 @@ Local version is %1, remote version is %2. - + Number: @@ -2606,27 +2617,27 @@ Local version is %1, remote version is %2. - + Set power/toughness - + Please enter the new PT: - + Set annotation - + Please enter the new annotation: - + Set counters @@ -3083,27 +3094,27 @@ Please enter a name: TabRoom - + &Say: - + Chat - + &Room - + &Leave room - + You are flooding the chat. Please wait a couple of seconds. @@ -3213,57 +3224,67 @@ Please enter a name: UserList - + Users online: %1 - + Users in this room: %1 - + Buddies online: %1 / %2 - + Ignored users online: %1 / %2 - + + %1's games + + + + User &details - + Direct &chat - + + Show this user's &games + + + + Add to &buddy list - + Remove from &buddy list - + Add to &ignore list - + Remove from &ignore list - + Ban from &server diff --git a/cockatrice/translations/cockatrice_pt-br.ts b/cockatrice/translations/cockatrice_pt-br.ts index 478d43f9..0404d46d 100644 --- a/cockatrice/translations/cockatrice_pt-br.ts +++ b/cockatrice/translations/cockatrice_pt-br.ts @@ -133,30 +133,30 @@ BanDialog - + Please enter the duration of the ban (in minutes). Enter 0 for an indefinite ban. Por favor, digite a duração do banimento (em minutos). Digite 0 para banir indefinidamente. - + Please enter the reason for the ban. This is only saved for moderators and cannot be seen by the banned person. - + &OK &OK - + &Cancel &Cancelar - + Ban user from server @@ -1142,82 +1142,82 @@ This is only saved for moderators and cannot be seen by the banned person.&Descrição: - + &Password: S&enha: - + P&layers: &Jogadores: - + Game type Tipo de jogo - + Only &buddies can join Apenas ami&gos podem entrar - + Only &registered users can join Apenas usuários re&gistrados podem entrar - + Joining restrictions Restrições para entrar - + &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. @@ -1419,78 +1419,84 @@ This is only saved for moderators and cannot be seen by the banned person. GameSelector - + C&reate &Criar - + &Join &Entrar - - - - - - - + + + + + + + + Error Erro - + + Please join the appropriate room first. + + + + 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. - + This game is only open to registered users. Este jogo é aberto apenas para usuários registrados. - + This game is only open to its creator's buddies. Este jogo é aberto apenas para os amigos de quem criou o jogo. - + You are being ignored by the creator of this game. Você está sendo ignorado pelo criador deste jogo. - + Join game Entrar no jogo - + Password: Senha: - + Games Jogos - + Show &full games &Mostrar os jogos cheios @@ -1499,7 +1505,7 @@ This is only saved for moderators and cannot be seen by the banned person.&Mostrar os jogos cheios - + J&oin as spectator E&ntrar como visitante @@ -1515,67 +1521,72 @@ This is only saved for moderators and cannot be seen by the banned person. GamesModel - + yes sim - + no não - + Creator Criador - + Description Descrição - + yes, free for spectators sim, livre para visitantes - + buddies only apenas amigos - + reg. users only usuários reg. apenas - + not allowed não permitidos + Room + Sala + + + Game type Tipo de jogo - + Password Senha - + Restrictions Restrições - + Players Jogadores - + Spectators Visitantes @@ -2831,7 +2842,7 @@ A versão local é %1 e a versão remota é %2. - + Number: Número: @@ -2856,27 +2867,27 @@ A versão local é %1 e a versão remota é %2. 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 @@ -3380,27 +3391,27 @@ Por favor, entre um nome: TabRoom - + &Say: &Falar: - + Chat Chat - + &Room &Sala - + &Leave room S&air da sala - + You are flooding the chat. Please wait a couple of seconds. Você está flodando o chat. Por favor, espere alguns segundos. @@ -3522,57 +3533,67 @@ Por favor, entre um nome: UserList - + Users online: %1 Usuários online: %1 - + Users in this room: %1 Usuários nesta sala: %1 - + Buddies online: %1 / %2 Amigos online: %1 / %2 - + Ignored users online: %1 / %2 Usuários ignorados online: %1 / %2 - + + %1's games + + + + User &details &Detalhes do usuário - + Direct &chat &Chat direto - + + Show this user's &games + + + + Add to &buddy list Adicionar à &lista de amigos - + Remove from &buddy list Remover da li&sta de amigos - + Add to &ignore list Adicionar à li&sta dos ignorados - + Remove from &ignore list Remover da lista dos i&gnorados - + Ban from &server Ban&ir do servidor diff --git a/cockatrice/translations/cockatrice_pt.ts b/cockatrice/translations/cockatrice_pt.ts index 67609431..351b8b98 100644 --- a/cockatrice/translations/cockatrice_pt.ts +++ b/cockatrice/translations/cockatrice_pt.ts @@ -133,30 +133,30 @@ BanDialog - + Please enter the duration of the ban (in minutes). Enter 0 for an indefinite ban. Por favor introduza a duração do banimento (em minutos). Introduza 0 para um banimento indefinido. - + Please enter the reason for the ban. This is only saved for moderators and cannot be seen by the banned person. - + &OK - + &Cancel &Cancelar - + Ban user from server @@ -1142,82 +1142,82 @@ This is only saved for moderators and cannot be seen by the banned person.&Descrição: - + &Password: &Password: - + P&layers: &Jogadores: - + Game type Tipo de jogo - + Only &buddies can join Apenas &amigos podem entrar - + Only &registered users can join Apenas utilizadores &registados podem entrar - + Joining restrictions Restrições para ligar - + &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. @@ -1419,68 +1419,74 @@ This is only saved for moderators and cannot be seen by the banned person. GameSelector - - - - - - - + + + + + + + + Error Erro - + + Please join the appropriate room first. + + + + 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. - + This game is only open to registered users. Este jogo só está aberto a utilizadores registados. - + This game is only open to its creator's buddies. Este jogo só está aberto aos amigos do seu criador. - + You are being ignored by the creator of this game. Você está a ser ignorado pelo criador deste jogo. - + Join game Entrar no jogo - + Password: Password: - + Games Jogos - + Show &full games &Mostrar jogos cheios @@ -1489,17 +1495,17 @@ This is only saved for moderators and cannot be seen by the banned person.&Mostrar jogos cheios - + C&reate &Criar - + &Join &Entrar - + J&oin as spectator Entrar como &espectador @@ -1515,67 +1521,72 @@ This is only saved for moderators and cannot be seen by the banned person. GamesModel - + yes sim - + yes, free for spectators sim, livre para espectadores - + no não - + buddies only amigos apenas - + reg. users only utilizadores registados apenas - + not allowed não permitidos - + + Room + Sala + + + Description Descrição - + Creator Criador - + Game type Tipo de jogo - + Password Password - + Restrictions Restrições - + Players Jogadores - + Spectators Espectadores @@ -2835,7 +2846,7 @@ Versão local é %1, versão remota é %2. - + Number: Número: @@ -2860,27 +2871,27 @@ Versão local é %1, versão remota é %2. 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 @@ -3384,27 +3395,27 @@ Por favor introduza um nome: TabRoom - + &Say: &Dizer: - + Chat - + &Room &Sala - + &Leave room &Abandonar a sala - + You are flooding the chat. Please wait a couple of seconds. Estás a inundar o chat .Por favor aguarde alguns segundos. @@ -3526,57 +3537,67 @@ Por favor introduza um nome: UserList - + Users online: %1 Utilizadores online: %1 - + Users in this room: %1 Utilizadores nesta sala:%1 - + Buddies online: %1 / %2 Amigos online: %1 / %2 - + Ignored users online: %1 / %2 Utilizadores ignorados online %1 / %2 - + + %1's games + + + + User &details Detalhes do &utilizador - + Direct &chat Conversação &directa - + + Show this user's &games + + + + Add to &buddy list Adicionar a lista de &amigos - + Remove from &buddy list Remover da lista de &amigos - + Add to &ignore list Adicionar a lista a &ignorar - + Remove from &ignore list Remover da lista a &ignorar - + Ban from &server Banir do &servidor diff --git a/cockatrice/translations/cockatrice_ru.ts b/cockatrice/translations/cockatrice_ru.ts index af264167..8f875c2a 100644 --- a/cockatrice/translations/cockatrice_ru.ts +++ b/cockatrice/translations/cockatrice_ru.ts @@ -129,30 +129,30 @@ BanDialog - + Please enter the duration of the ban (in minutes). Enter 0 for an indefinite ban. Введите продолжительность бана (в минутах). Введите 0 чтобы забанить пожизненно. - + Please enter the reason for the ban. This is only saved for moderators and cannot be seen by the banned person. - + &OK &Ок - + &Cancel &Отмена - + Ban user from server @@ -1081,82 +1081,82 @@ This is only saved for moderators and cannot be seen by the banned person.&Подпись: - + &Password: &Пароль: - + P&layers: &Количество игроков: - + Game type Формат игры - + Only &buddies can join Только для &своих - + Only &registered users can join Только для &зарег. пользователей - + Joining restrictions Ограничения - + &Spectators allowed &Разрешить зрителей - + Spectators &need a password to join Требовать &пароль у зрителей - + Spectators can &chat Позволить зрителям &комментировать - + Spectators see &everything Показывать зрителям &все - + Spectators Зрители - + &OK &Ок - + &Cancel &Отмена - + Create game Создать игру - + Error Ошибка - + Server error. Ошибка сервера. @@ -1358,83 +1358,89 @@ This is only saved for moderators and cannot be seen by the banned person. GameSelector - - - - - - - + + + + + + + + Error Ошибка - + + Please join the appropriate room first. + + + + Wrong password. Неверный пароль. - + Spectators are not allowed in this game. В эту игру не пускают зрителей. - + The game is already full. Все места заняты! =Ь - + The game does not exist any more. Эта игра была удалена. - + This game is only open to registered users. Доступно только для зарегистрированных. - + This game is only open to its creator's buddies. Доступно только для друзей. - + You are being ignored by the creator of this game. Вы добавлены в игнор-лист данного игрока. - + Join game Присоединиться - + Password: Пароль: - + Games Игры - + Show &full games Показывать &текущие - + C&reate С&оздать - + &Join &Присоединиться - + J&oin as spectator П&рисоединиться как зритель @@ -1450,67 +1456,72 @@ This is only saved for moderators and cannot be seen by the banned person. GamesModel - + yes да - + yes, free for spectators да, свободно для зрителей - + no нет - + buddies only только свои - + reg. users only только зарег. - + not allowed Не допускаются - + + Room + Комната + + + Description Подпись - + Creator Создал - + Game type Формат игры - + Password Пароль - + Restrictions Ограничения - + Players Количество игроков - + Spectators Зрители @@ -2768,7 +2779,7 @@ Local version is %1, remote version is %2. - + Number: Количество: @@ -2793,27 +2804,27 @@ Local version is %1, remote version is %2. Количество граней: - + Set power/toughness Установить Силу/Защиту - + Please enter the new PT: Введите новые Силу/Защиту: - + Set annotation Пометка - + Please enter the new annotation: Введите текст: - + Set counters Установить жетоны @@ -3283,27 +3294,27 @@ Please enter a name: TabRoom - + &Say: &Сказать: - + Chat Чат - + &Room &Комната - + &Leave room &Покинуть комнату - + You are flooding the chat. Please wait a couple of seconds. Кажется, Вы нафлудили. Пожалуйста, подождите пару секунд. @@ -3417,57 +3428,67 @@ Please enter a name: UserList - + Users online: %1 Пользователей онлайн: %1 - + Users in this room: %1 Пользователей в этой комнате: %1 - + Buddies online: %1 / %2 Друзей онлайн: %1 / %2 - + Ignored users online: %1 / %2 Игнорируемых пользователей онлайн: %1 / %2 - + + %1's games + + + + User &details Данные о &пользователе - + Direct &chat Обратиться &лично - + + Show this user's &games + + + + Add to &buddy list Добавить в список &друзей - + Remove from &buddy list &Удалить из друзей - + Add to &ignore list Добавить в &игнор-лист - + Remove from &ignore list Удалить и&з игнор-листа - + Ban from &server За&банить на сервере diff --git a/cockatrice/translations/cockatrice_sk.ts b/cockatrice/translations/cockatrice_sk.ts index 63a3c840..dddb7465 100644 --- a/cockatrice/translations/cockatrice_sk.ts +++ b/cockatrice/translations/cockatrice_sk.ts @@ -129,29 +129,29 @@ BanDialog - + Please enter the duration of the ban (in minutes). Enter 0 for an indefinite ban. - + Please enter the reason for the ban. This is only saved for moderators and cannot be seen by the banned person. - + &OK - + &Cancel - + Ban user from server @@ -926,82 +926,82 @@ This is only saved for moderators and cannot be seen by the banned person. - + P&layers: - + Game type - + &Password: - + Only &buddies can join - + Only &registered users can join - + Joining restrictions - + &Spectators allowed - + Spectators &need a password to join - + Spectators can &chat - + Spectators see &everything - + Spectators - + &OK - + &Cancel - + Create game - + Error - + Server error. @@ -1203,83 +1203,89 @@ This is only saved for moderators and cannot be seen by the banned person. GameSelector - - - - - - - + + + + + + + + Error - + + Please join the appropriate room first. + + + + Wrong password. - + Spectators are not allowed in this game. - + The game is already full. - + The game does not exist any more. - + This game is only open to registered users. - + This game is only open to its creator's buddies. - + You are being ignored by the creator of this game. - + Join game - + Password: - + Games - + Show &full games - + C&reate - + &Join - + J&oin as spectator @@ -1295,67 +1301,72 @@ This is only saved for moderators and cannot be seen by the banned person. GamesModel - + yes - + yes, free for spectators - + no - + buddies only - + reg. users only - + not allowed - - - Description - - - - - Creator - - - Game type + Room - Password + Description - Restrictions + Creator - Players + Game type + Password + + + + + Restrictions + + + + + Players + + + + Spectators @@ -2581,7 +2592,7 @@ Local version is %1, remote version is %2. - + Number: @@ -2606,27 +2617,27 @@ Local version is %1, remote version is %2. - + Set power/toughness - + Please enter the new PT: - + Set annotation - + Please enter the new annotation: - + Set counters @@ -3083,27 +3094,27 @@ Please enter a name: TabRoom - + &Say: - + Chat - + &Room - + &Leave room - + You are flooding the chat. Please wait a couple of seconds. @@ -3213,57 +3224,67 @@ Please enter a name: UserList - + Users online: %1 - + Users in this room: %1 - + Buddies online: %1 / %2 - + Ignored users online: %1 / %2 - + + %1's games + + + + User &details - + Direct &chat - + + Show this user's &games + + + + Add to &buddy list - + Remove from &buddy list - + Add to &ignore list - + Remove from &ignore list - + Ban from &server diff --git a/common/protocol.cpp b/common/protocol.cpp index 205f2b2a..85c581d0 100644 --- a/common/protocol.cpp +++ b/common/protocol.cpp @@ -257,6 +257,7 @@ void ProtocolResponse::initializeHash() { responseHash.insert(QString(), RespNothing); responseHash.insert("ok", RespOk); + responseHash.insert("not_in_room", RespNotInRoom); responseHash.insert("internal_error", RespInternalError); responseHash.insert("invalid_command", RespInvalidCommand); responseHash.insert("name_not_found", RespNameNotFound); @@ -297,12 +298,34 @@ Response_DeckList::Response_DeckList(int _cmdId, ResponseCode _responseCode, Dec insertItem(_root); } -Response_GetGamesOfUser::Response_GetGamesOfUser(int _cmdId, ResponseCode _responseCode, const QList &_gameList) +Response_GetGamesOfUser::Response_GetGamesOfUser(int _cmdId, ResponseCode _responseCode, const QList &_roomList, const QList &_gameList) + : ProtocolResponse(_cmdId, _responseCode, "get_games_of_user") { + roomList = _roomList; + for (int i = 0; i < _roomList.size(); ++i) + itemList.append(_roomList[i]); + + gameList = _gameList; for (int i = 0; i < _gameList.size(); ++i) itemList.append(_gameList[i]); } +void Response_GetGamesOfUser::extractData() +{ + for (int i = 0; i < itemList.size(); ++i) { + ServerInfo_Room *room = dynamic_cast(itemList[i]); + if (room) { + roomList.append(room); + continue; + } + ServerInfo_Game *game = dynamic_cast(itemList[i]); + if (game) { + gameList.append(game); + continue; + } + } +} + Response_GetUserInfo::Response_GetUserInfo(int _cmdId, ResponseCode _responseCode, ServerInfo_User *_user) : ProtocolResponse(_cmdId, _responseCode, "get_user_info") { diff --git a/common/protocol.h b/common/protocol.h index 1feda02f..beb09d49 100644 --- a/common/protocol.h +++ b/common/protocol.h @@ -285,11 +285,17 @@ public: class Response_GetGamesOfUser : public ProtocolResponse { Q_OBJECT +private: + QList gameList; + QList roomList; +protected: + void extractData(); public: - Response_GetGamesOfUser(int _cmdId = -1, ResponseCode _responseCode = RespOk, const QList &_gameList = QList()); + Response_GetGamesOfUser(int _cmdId = -1, ResponseCode _responseCode = RespOk, const QList &_roomList = QList(), const QList &_gameList = QList()); int getItemId() const { return ItemId_Response_GetGamesOfUser; } static SerializableItem *newItem() { return new Response_GetGamesOfUser; } - QList getGameList() const { return typecastItemList(); } + QList getRoomList() const { return roomList; } + QList getGameList() const { return gameList; } }; class Response_GetUserInfo : public ProtocolResponse { diff --git a/common/protocol_datastructures.h b/common/protocol_datastructures.h index 40ab6751..6ad7cd09 100644 --- a/common/protocol_datastructures.h +++ b/common/protocol_datastructures.h @@ -8,7 +8,7 @@ class DeckList; -enum ResponseCode { RespNothing, RespOk, RespInternalError, RespInvalidCommand, RespInvalidData, RespNameNotFound, RespLoginNeeded, RespFunctionNotAllowed, RespGameNotStarted, RespGameFull, RespContextError, RespWrongPassword, RespSpectatorsNotAllowed, RespOnlyBuddies, RespUserLevelTooLow, RespInIgnoreList, RespWouldOverwriteOldSession, RespChatFlood }; +enum ResponseCode { RespNothing, RespOk, RespNotInRoom, RespInternalError, RespInvalidCommand, RespInvalidData, RespNameNotFound, RespLoginNeeded, RespFunctionNotAllowed, RespGameNotStarted, RespGameFull, RespContextError, RespWrongPassword, RespSpectatorsNotAllowed, RespOnlyBuddies, RespUserLevelTooLow, RespInIgnoreList, RespWouldOverwriteOldSession, RespChatFlood }; // PrivateZone: Contents of the zone are always visible to the owner, // but not to anyone else. @@ -71,6 +71,7 @@ class ServerInfo_Game : public SerializableItem_Map { public: ServerInfo_Game(int _roomId = -1, 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 _onlyBuddies = false, bool _onlyRegistered = false, bool _spectatorsAllowed = false, bool _spectatorsNeedPassword = false, int _spectatorCount = -1); static SerializableItem *newItem() { return new ServerInfo_Game; } + int getRoomId() const { return static_cast(itemMap.value("room_id"))->getData(); } 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(); } diff --git a/common/server_protocolhandler.cpp b/common/server_protocolhandler.cpp index e6cadb58..974869e7 100644 --- a/common/server_protocolhandler.cpp +++ b/common/server_protocolhandler.cpp @@ -80,7 +80,7 @@ ResponseCode Server_ProtocolHandler::processCommandHelper(Command *command, Comm Server_Room *room = rooms.value(roomCommand->getRoomId(), 0); if (!room) - return RespNameNotFound; + return RespNotInRoom; QMutexLocker locker(&room->roomMutex); @@ -101,7 +101,7 @@ ResponseCode Server_ProtocolHandler::processCommandHelper(Command *command, Comm gameListMutex.lock(); if (!games.contains(gameCommand->getGameId())) { qDebug() << "invalid game"; - return RespNameNotFound; + return RespNotInRoom; } QPair gamePair = games.value(gameCommand->getGameId()); Server_Game *game = gamePair.first; @@ -340,13 +340,19 @@ ResponseCode Server_ProtocolHandler::cmdGetGamesOfUser(Command_GetGamesOfUser *c if (!server->getUsers().contains(cmd->getUserName())) return RespNameNotFound; + QList roomList; QList gameList; QMapIterator roomIterator(server->getRooms()); - while (roomIterator.hasNext()) - gameList.append(roomIterator.next().value()->getGamesOfUser(cmd->getUserName())); + while (roomIterator.hasNext()) { + Server_Room *room = roomIterator.next().value(); + room->roomMutex.lock(); + roomList.append(room->getInfo(false, true)); + gameList.append(room->getGamesOfUser(cmd->getUserName())); + room->roomMutex.unlock(); + } server->serverMutex.unlock(); - ProtocolResponse *resp = new Response_GetGamesOfUser(cont->getCmdId(), RespOk, gameList); + ProtocolResponse *resp = new Response_GetGamesOfUser(cont->getCmdId(), RespOk, roomList, gameList); if (getCompressionSupport()) resp->setCompressed(true); cont->setResponse(resp); diff --git a/common/server_room.cpp b/common/server_room.cpp index 77030bff..9e9aa571 100644 --- a/common/server_room.cpp +++ b/common/server_room.cpp @@ -26,7 +26,7 @@ Server *Server_Room::getServer() const return static_cast(parent()); } -ServerInfo_Room *Server_Room::getInfo(bool complete) const +ServerInfo_Room *Server_Room::getInfo(bool complete, bool showGameTypes) const { QMutexLocker locker(&roomMutex); @@ -40,10 +40,10 @@ ServerInfo_Room *Server_Room::getInfo(bool complete) const for (int i = 0; i < size(); ++i) userList.append(new ServerInfo_User(at(i)->getUserInfo(), false)); - + } + if (complete || showGameTypes) 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, gameTypeList); } @@ -133,8 +133,6 @@ int Server_Room::getGamesCreatedByUser(const QString &userName) const QList Server_Room::getGamesOfUser(const QString &userName) const { - QMutexLocker locker(&roomMutex); - QList result; QMapIterator gamesIterator(games); while (gamesIterator.hasNext()) { diff --git a/common/server_room.h b/common/server_room.h index 96712ac6..663c9cee 100644 --- a/common/server_room.h +++ b/common/server_room.h @@ -38,7 +38,7 @@ public: QString getJoinMessage() const { return joinMessage; } const QMap &getGames() const { return games; } Server *getServer() const; - ServerInfo_Room *getInfo(bool complete) const; + ServerInfo_Room *getInfo(bool complete, bool showGameTypes = false) const; int getGamesCreatedByUser(const QString &name) const; QList getGamesOfUser(const QString &name) const;