Currently Cockatrice allows revealing the whole hand, or one card at random from the hand. Sometimes, a player needs to reveal a specific card from their hand instead, which is not supported. To achieve a similar effect, players usually move the corresponding card (or cards) to a public zone, then back to their hand. While this works, it is unsatisfactory (compared to a regular reveal, you can't keep the "revealed" window around, for one) and somewhat unintuitive. This patch adds a "Reveal to..." menu to cards and card selections in the player's hand or in custom zones (this includes looking at the player's library). This menu allows revealing a card or set of cards to any given player, or to all players. To implement this functionality at the protocol level, the existing RevealCards command is extended to support revealing multiple specific cards. This is done by making `card_id` a non-packed repeated field in the `Command_RevealCards` and `Event_RevealCards` protobufs. Using a non-packed repeated fields allows maintaining backwards compatibility: an empty optional field is encoded the same way as an empty non-packed list, an optional field with a value is encoded the same way as a one-element non-packed list, and when decoding a multi-elements non-packed list as an optional, only the last item in the list is read. Since the RevealCards command already exists, and due to the compatible encodings, a new client connecting to an old server can reveal a single specific card from their hand. When trying to reveal multiple cards at once, the old server will only see the request for one of the cards to be revealed, and the player will have to reveal each card separately. On the other hand, `Event_RevealedCards` already has an explicit list of cards revealed by the server, and the `card_id` field is only used when exactly one card has been revealed: thus, old and new clients will behave identically when receiving a new `Event_RevealedCards`. In particular, if a player using a new client reveals multiple cards from their hand on a new server, another player using an old client will correctly see all the revealed cards. The approach used to build the "Reveal to..." menu is slightly different from the approach used to build other player selection menus. Because the "Reveal to..." menu is specific to each card, but must also be updated whenever a player is added to or removed from the game, I chose to re-create it on the fly whenever a card is clicked, as that seemed the safest way to avoid both memory leaks and inconsistent state given my understanding of the code. |
||
---|---|---|
.ci | ||
.github | ||
.husky | ||
.tx | ||
cmake | ||
cockatrice | ||
common | ||
dbconverter | ||
doc | ||
oracle | ||
servatrice | ||
tests | ||
vcpkg@c30de8e136 | ||
webclient | ||
.clang-format | ||
.cmake-format.json | ||
.codacy.yml | ||
.dockerignore | ||
.gitignore | ||
.gitmodules | ||
CMakeLists.txt | ||
docker-compose.yml | ||
docker-compose.yml.windows | ||
Dockerfile | ||
format.sh | ||
LICENSE | ||
README.md | ||
vcpkg.json |
Cockatrice | Download | Get Involved | Community | Translations | Build | Run | License
To get started, ⇢ view our webpage
To get support or suggest changes ⇢ file an issue (How?) To help with development, see how to get involved
Cockatrice
Cockatrice is an open-source, multiplatform program for playing tabletop card games over a network. The program's server design prevents users from manipulating the game for unfair advantage. The client also provides a single-player mode, which allows users to brew while offline. This project uses C++ and the Qt5 libraries.
Download 
Downloads are available for full releases and the current beta version in development. There is no strict release schedule for either of them.
-
- Stable versions are checkpoints featuring major feature and UI enhancements.
- Recommended for most users!
-
- Beta versions include the most recently added features and bugfixes, but can be unstable.
- To be a Cockatrice Beta Tester, use this version. Find more information here!
Get Involved

Join our Discord community to connect with the project or fellow users of the app. The Cockatrice developers are also available on Gitter. Come here to talk about the application, features, or just to hang out.
For support regarding specific servers, please contact that server's admin or forum for support rather than asking here.
To contribute code to the project, please review the guidelines. We maintain two tags for contributors to find issues to work on:
- Good first issue: issues tagged in this way provide a simple way to get started. They don't require much experience to be worked on.
- Help wanted: This tag is used for issues that we are looking for a contributor to work on. Often this is for feature suggestions we are willing to accept, but don't have the time to work on ourselves.
For both tags, we're willing to provide help to contributors in showing them where and how they can make changes, as well as code review for changes they submit.
We try to be responsive to new issues. We'll provide advice on how best to implement a feature; alternately, we can show you where the codebase is doing something similar before you get too far along.
Cockatrice uses the Google Developer Documentation Style Guide to ensure consistent documentation. We encourage you to improve the documentation by suggesting edits based on this guide.
Community Resources
Translations 
Cockatrice uses Transifex for translations. You can help us bring Cockatrice and Oracle to your language or just edit single wordings right from within your browser by visiting our Transifex project page.
Cockatrice | Oracle |
---|---|
Check out our Translator FAQ for more information about contributing!
Build

Detailed compiling instructions can be found on the Cockatrice wiki under Compiling Cockatrice
Dependencies: (for minimum requirements search our CMake file)
Oracle can optionally use zlib and xz to load compressed files:
To compile:
mkdir build
cd build
cmake ..
make
You can then run
make install
to get a cockatrice installation inside the release
folder, or:
make package
to create a system-specific installation package.
The following flags can be passed to cmake
:
-DWITH_SERVER=1
Whether to build the server (default 0 = no).-DWITH_CLIENT=0
Whether to build the client (default 1 = yes).-DWITH_ORACLE=0
Whether to build oracle (default 1 = yes).-DCMAKE_BUILD_TYPE=Debug
Compile in debug mode. Enables extra logging output, debug symbols, and much more verbose compiler warnings (defaultRelease
).-DWARNING_AS_ERROR=0
Whether to treat compilation warnings as errors in debug mode (default 1 = yes).-DUPDATE_TRANSLATIONS=1
Configuremake
to update the translation .ts files for new strings in the source code. Note: Runningmake clean
will remove the .ts files (default 0 = no).-DTEST=1
Enable regression tests (default 0 = no). Note: needs googletest, will be downloaded on the fly if unavailable. To run tests:make test
.-DFORCE_USE_QT5=1
Skip looking for Qt6 before trying to find Qt5-DOPEN_SSL_PATH=C:/Path/To/Tools/OpenSSL/Win_x64/bin"
Designate the OpenSSL Path if you're using non-standard directives
Run
Cockatrice
is the game client
Oracle
fetches card data
Servatrice
is the server
Servatrice Docker container
You can run an instance of Servatrice (the Cockatrice server) using Docker and the Cockatrice Dockerfile.
First, create an image from the Dockerfile
cd /path/to/Cockatrice-Repo/
docker build -t servatrice .
And then run it
docker run -i -p 4747:4747/tcp -t servatrice:latest
Note: Running this command exposes the TCP port 4747 of the docker container
to permit connections to the server.
Find more information on how to use Servatrice with Docker in our wiki.
Docker compose
There is also a docker-compose file available which will configure and run both a MySQL server and Servatrice. The docker-compose setup scripts can be found in the servatrice/docker
folder and vary only slightly from the default sql and server .ini files. The setup scripts can either be modified in place, or docker-compose can mount alternative files into the images, as you prefer.
To run Servatrice via docker-compose, first install docker-compose following the install instructions. Once installed, run the following from the root of the repository:
docker-compose build # Build the Servatrice image using the same Dockerfile as above.
docker-compose up # Setup and run both the MySQL server and Servatrice.
Note: Similar to the above Docker setup, this will expose TCP ports 4747 and 4748.
Note: The first time running the docker-compose setup, the MySQL server will take a little time to run the initial setup scripts. Due to this, the Servatrice instance may fail the first few attempts to connect to the database. Servatrice is set to
restart: always
in the docker-compose.yml, which will allow it to continue attempting to start up. Once the MySQL scripts have completed, Servatrice should then connect automatically on the next attempt.
Docker compose in Windows A out of box working docker-compose file has been added to help setup in Windows.
Docker in Windows requires additional steps in form of using Docker Desktop to allow resource sharing from the drive the volumes are mapped from, as well as potential workarounds needed to get file sharing working in Windows. This StackOverflow discussion sheds some light on it
License 
Cockatrice is free software, licensed under the GPLv2.