A cross-platform virtual tabletop for multiplayer card games https://cockatrice.github.io
Find a file
BruebachL 6823d54c1e
[DeckShare] Browse and open public decks with loading, error and accessibility states (#7245)
* [DeckShare] Browse and open public decks with loading, error and accessibility states

Add a public-decks tab that lists decks published by other users using the
server's deck visibility feature, previewing each deck's banner card, color
identity, tags and upload time without downloading the deck list until the
user opens it.

- Add a public-decks tab with a shared-settings widget and a remote model
  that fetches the target user's decks and refreshes both automatically and
  on user request, with a loading indicator and a server-error message
  instead of a blank tab when the fetch fails or the connection drops
- Render each deck as a focusable preview tile whose banner, color identity,
  tags and upload time follow the existing Preview settings, with the deck
  name announced as the tile's accessible name and Space/Enter opening the
  deck, mirroring the shared-deck preview tile
- Show a message box when opening a public deck fails or arrives corrupted
- Publish and unpublish decks from the server storage toolbar and context
  menu, toggling the deck's own visibility bit (what the server persists)
  rather than the inherited effective state, and batch the visibility
  refresh until the last in-flight change is acknowledged
- Add the Show Upload Time setting so the tile's upload stamp can be hidden
  like the other preview details
- Update the retranslateUi wiring for the new public-decks tab and rename
  the share action tooltip from "Deck share" to "Share link"

* [DeckShare] Adapt deck upload to the server-derived banner and tag protocol

The server now derives the banner card and tags from the uploaded deck
list itself, so Command_DeckUpload only carries the client-computed color
identity. Drop the reserved banner/tag setters from the editor and storage
uploads, send the color identity on remote saves, and read tags from the
now-repeated ServerInfo_DeckStorage_TreeItem field.

* [DeckStorage] Refresh the visibility column with a guarded timer instead of a latch counter

A dropped visibility reply used to leave the pendingVisibilityChanges
counter permanently positive, so the Public/Private column never refreshed
again and nothing reset it on disconnect. A restartable single-shot timer
with a boolean guard re-reads the tree whenever publishes quiet down and is
stopped on disconnect, so a lost reply costs one stale refresh instead of
killing the column for the session.

* [DeckStorage] Summarize batch publish failures when the batch drains

Each rejected node stacked its own modal dialog, so publishing a ten-deck
selection against a rejecting server made the user dismiss ten dialogs one
at a time. Failures are now collected while the batch is in flight and shown
as a single summary when the visibility refresh timer fires; a reply that
lands outside an active batch still reports right away.

* [PublicDecks] Time out the loading state so a dropped reply cannot wedge the tab

loading only cleared in decksReceived, but the ping sweep can drop a pending
command without ever emitting finished, leaving the tab stuck on 'Loading
public decks...' and the refresh button permanently inert. A single-shot
timer started per refresh clears the latch and reports a timeout; the latch
also clears when the client disconnects.

* [PublicDecks] Escape remote-crafted text in tooltips and the tab title

Deck names and usernames come from other users' records and Qt renders
QLabel tooltips as AutoText, so a name like '<h1><table>...' parsed as
markup. Escape and bound the deck-name tooltip and escape the username
interpolated into the title label.

* [DeckStorage] Distinguish an inherited public state in the visibility column

The column reported the effective state while publishing toggles the node's
own bit, so a private deck inside a public folder already read 'Public' and
toggling appeared to do nothing (and toggling again silently unpublished
it). The cell now shows 'Public (inherited)' for that case and the tooltip
explains why.

* [PublicDecks] Run retranslateUi at construction and name the refresh button

retranslateUi was never called from the constructor, so the tooltips set
there were absent until a language change. Call it before the first refresh,
and give the icon-only refresh button an accessible name for screen readers.

* [PublicDecks] Keep the empty and status variants correct across language changes

retranslateUi unconditionally rewrote the empty label to the 'nothing
published' variant, stomping the 'no decks match your filters' choice
rebuildGrid had made, and a visible loading message stayed in the old
language. Let retranslateUi pick the same variant rebuildGrid does and
re-show the status so it retranslates.

* [VDS] Share one color-identity match rule between the two deck grids

The remote public decks model verbatim-copied updateColorMatches' switch,
down to the ExactMatch normalization and the fact that Includes/Excludes do
not normalize case. Extract colorIdentityMatches() next to the FilterMode
enum and call it from both so the subtle rule cannot drift.

* [DeckStorage] Drop the unused tree widget model accessor

The accessor handed the model out past the wrapper methods that exist to
keep it encapsulated, and nothing in the stack called it.

* [DeckShare] End the public-decks files with a trailing newline

keeps the final line's diff clean and stops clang-format CI from flagging
the files.

* [VDS] Reuse the shared quick settings widget for the public decks tab

PublicDecksQuickSettingsWidget was VisualDeckStorageQuickSettingsWidget
minus the folders, banner and tooltip controls, with identical wiring for
the shared keys and a version of the near-identical file to keep in sync by
hand. Fold the Show Upload Time checkbox into the shared widget, give it a
setPublicDecksMode() that hides the controls that do not apply, and delete
the duplicate.

* [PublicDecks] Drop stale deck-list replies after the loading timeout

A reply that lands after its own loading timeout (the reverse of the ping
sweep dropping the command) could stop the newer request's timeout timer
and repaint the grid with out-of-date data. Each refresh now captures a
monotonically increasing request id, and only the newest request's reply
updates the grid.

* [PublicDecks] Re-show a displayed failure message on language changes

The status label carries both the loading and the failure message, and
retranslateUi hid it whenever the model was not loading, so a language
change while a server-error or timeout message was on screen swapped it
for the (empty) grid. The tab now keeps the last failure text and
re-shows it when not loading, clearing it once a new refresh starts.

* [DeckStorage] Keep the visibility refresh armed until replies land

The single-shot drain was armed with the 500 ms delay at send time, so a
round trip slower than that drained before the server applied the change,
re-read the old state and never re-armed, leaving the column stale until
a manual refresh. The timer is now armed with the full network timeout at
send time (a lost reply still costs one stale refresh) and re-armed with
the short delay every time a reply lands.

* [DeckShare] Close public decks tabs when the client disconnects

TabSupervisor::stop() built tabsToDelete from the room and game tabs
only, so a public decks tab survived a disconnect, sitting with stale
contents and a refresh button that kept hitting the dead client. Its
values are now folded into the same cleanup.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2026-09-20 20:22:17 +02:00
.ci [Build] Keep Windows installs free of build-tree artifacts (#7316) 2026-09-20 20:21:52 +02:00
.github Alphabetical ordering of Qt modules/packages (#7334) 2026-09-20 19:24:55 +02:00
.tx Remove webclient (extracted to Webatrice repo) (#6848) 2026-05-08 09:14:53 -04:00
cmake [Build] Keep Windows installs free of build-tree artifacts (#7316) 2026-09-20 20:21:52 +02:00
cockatrice [DeckShare] Browse and open public decks with loading, error and accessibility states (#7245) 2026-09-20 20:22:17 +02:00
doc [Client] Show localized card names, texts and pictures (#7294) 2026-09-18 12:03:07 +02:00
libcockatrice_card [Client] Show localized card names, texts and pictures (#7294) 2026-09-18 12:03:07 +02:00
libcockatrice_deck_list [DeckList] Extract deck metadata element readers (#7325) 2026-09-19 10:35:05 +02:00
libcockatrice_filters Allow to filter sets by release date (#7239) 2026-09-05 11:58:37 -07:00
libcockatrice_interfaces [Client] Show localized card names, texts and pictures (#7294) 2026-09-18 12:03:07 +02:00
libcockatrice_models [Client] Show localized card names, texts and pictures (#7294) 2026-09-18 12:03:07 +02:00
libcockatrice_network [Game] Allow judges to enter any game regardless of restrictions (#7315) 2026-09-19 10:39:52 +02:00
libcockatrice_protocol [Server] Add deck share links and public deck visibility (#7241) 2026-09-20 20:22:16 +02:00
libcockatrice_rng [Security] Use a CSPRNG for salts, tokens, and RNG seeding (#7192) 2026-09-04 13:49:18 +02:00
libcockatrice_settings [DeckShare] Browse and open public decks with loading, error and accessibility states (#7245) 2026-09-20 20:22:17 +02:00
libcockatrice_utility [Security] Use a CSPRNG for salts, tokens, and RNG seeding (#7192) 2026-09-04 13:49:18 +02:00
oracle [Build] Keep Windows installs free of build-tree artifacts (#7316) 2026-09-20 20:21:52 +02:00
servatrice [Server] Add deck share links and public deck visibility (#7241) 2026-09-20 20:22:16 +02:00
tests [DeckShare] Browse and open public decks with loading, error and accessibility states (#7245) 2026-09-20 20:22:17 +02:00
vcpkg@9e593bb18e Update vcpkg submodule to 2026.07.29 release (+ add baseline) (#7067) 2026-08-05 22:00:06 +02:00
.clang-format Enable RemoveSemicolon & update format.sh (#6896) 2026-05-16 20:26:37 +02:00
.cmake-format.json rework formatting with cmake-format (#4627) 2022-06-08 21:14:26 -04:00
.dockerignore Update CONTRIBUTING and more travis removing (#4179) 2020-11-28 03:14:15 -05:00
.gitignore [Card Database] Improve loading times through binary cache (#7051) 2026-07-27 23:12:53 +02:00
.gitmodules Docs: Use doxygen-awesome-css theme (#6512) 2026-01-24 11:22:43 +01:00
CMakeLists.txt Alphabetical ordering of Qt modules/packages (#7334) 2026-09-20 19:24:55 +02:00
docker-compose.yml Docker compose: Link to our GHCR hosted servatrice image (#6728) 2026-03-22 10:28:24 +01:00
docker-compose.yml.windows Docker compose: Link to our GHCR hosted servatrice image (#6728) 2026-03-22 10:28:24 +01:00
Dockerfile [Security] Use a CSPRNG for salts, tokens, and RNG seeding (#7192) 2026-09-04 13:49:18 +02:00
Doxyfile [Networking] Doxygen (#7030) 2026-07-27 11:27:00 +02:00
format.sh [Build] Add precompiled headers for Qt-backed executables (#7235) 2026-09-05 19:40:36 +02:00
LICENSE update the address of the fsf in the license (#6113) 2025-09-10 18:18:34 -04:00
README.md fix table formatting (#7256) 2026-09-06 22:18:36 +02:00
shell.nix nix: Add development utilities to shell.nix (#5725) 2025-03-15 19:03:26 +00:00
vcpkg.json Update vcpkg submodule to 2026.07.29 release (+ add baseline) (#7067) 2026-08-05 22:00:06 +02:00


Cockatrice | Download | Related | Community | Contribute | Build | Run



To get started with Cockatrice ⇢ view our webpage
To get support, or suggest changes to the app ⇢ file an issue (How?) To help with development ⇢ learn how to contribute


Cockatrice

Cockatrice is an open-source, multiplatform application 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 Qt libraries.

Download Cockatrice Eternal Download Count

Downloads are available for stable releases and the current beta version in development.
There is no strict release schedule for either of them.

Latest stable release:
Download Stable Release  
Latest beta version:
Download Beta Release   
While incorporating the latest fixes and features, beta builds may not be stable or contain new bugs!
Please report any findings and open new issues when testing them!

Related Repositories

Community Resources Discord

Join our Discord community to connect with other project contributors (#dev channel) or fellow users of the app. Come here to talk about the application, features, or just to hang out.

Important

For support regarding specific servers, please contact that server's admin/mods and use their dedicated communication channels rather than contacting the team building the software.

Contribute

Code | Documentation | Translation

Repository Activity

Cockatrice Repo Analytics

Kudos to all our amazing contributors ❤️

Made with contrib.rocks

Code

To contribute code to the project, please review our guidelines first.
We maintain two tags for contributors to easier find issues to potentially 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 somebody to pick up. Often this is for feature suggestions we support, 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 reviews for submitted changes.
We'll happily advice on how best to implement a feature, or we can show you where the codebase is doing something similar before you get too far along - put a note on an issue you want to discuss more on!

You can also have a look at our Todo List in our Code Documentation or search the repo for \todo comments.

Documentation CI Docs

There are various places where useful information for different needs are maintained:

Cockatrice tries to use the Google Developer Documentation Style Guide to ensure consistent documentation. We encourage you to improve the documentation by suggesting edits based on this guide.

Translation Transifex Project

Cockatrice uses Transifex to manage translations. You can help us bring Cockatrice and Oracle to your language and just adjust single wordings right from within your browser by visiting our Transifex project page. The Webatrice web client manages its own translations in its repo.

Check out our Translator FAQ for more information about getting involved, and join a group of hundreds of others!

Build CI Desktop CI Docker

Dependencies: (for minimum versions search our CMake file)

Oracle can optionally use some packages to load compressed card files:


Basic compilation steps:

mkdir build
cd build
cmake ..
make

You can then

  • Create a Cockatrice installation inside the release folder:
    make install
    
  • Or make an installation package specific to your system:
    make package
    

Note

Detailed compiling instructions can be found in the Cockatrice wiki at Compiling Cockatrice


The following flags (with their non-default values) can be passed to cmake:

Flag Description
-DWITH_SERVER=1 Build Servatrice server
-DWITH_CLIENT=0 Don't build Cockatrice client
-DWITH_ORACLE=0 Don't build Oracle card database tool
-DCMAKE_BUILD_TYPE=Debug Compile in debug mode
Enables extra logging output, debug symbols, and much more verbose compiler warnings
-DWARNING_AS_ERROR=0 Don't treat compilation warnings as errors in debug mode
-DUPDATE_TRANSLATIONS=1 Configure make to update the translation .ts files for new strings in the source code
Note: make clean will remove the .ts files
-DTEST=1 Enable regression tests
Note: make test to run tests, googletest will be downloaded if not available

Run

Cockatrice is the game client
Oracle fetches card data
Servatrice is the server

Docker

You can build an image & deploy a Servatrice (Cockatrice server) container using Docker and our Dockerfile yourself.

For more details, look into our wiki section on Setting up Servatrice.
You'll also find more hints on our pre-build image there, or the docker-compose file which will configure and run both a MySQL server and Servatrice.

License GPLv2 License

Cockatrice is free software, licensed under the GPLv2.