* [VDE] Consolidate statistical analysis into a separate object so multiple widgets can re-use calculations and calculation is only performed once on data change.
* [VDE] Lint.
* [VDE] Move struct up to not confuse compiler.
* [VDE] NoDiscards
* [VDE] Move variables
* [VDE] Lint.
* TabArchidekt and Archidekt API integration.
Took 37 seconds
Took 4 minutes
Took 40 seconds
Took 4 minutes
* Lint.
* Lont.
* Search bar, fancier display, resolve providerId
* Delegate click to base.
* Be explicit for pedantic compilers.
* Liiint.
* Leave them default I guess
* Leave them default I guess
* Small fixes.
* New utility display widgets.
* New style for deck listing.
* Lint.
* Lont.
* Scale things.
* Delegate paint to base.
* Use default Archidekt preview image for decks without featured.
* Consistent sizes.
* Increase font size, qt version guard.
* More version guards.
* Clean up filter layout, use mana symbols.
* Set content margins.
* Refresh on filter change.
* Lint.
* Better elision.
* Query actual new endpoints, new query parameters.
* Doxygen, reorder fields in constructor, readability.
* Update page size doc to min size.
* Update initial min deck size value.
* Add label to page selection.
* Okay, so, people upload a lot of 1 card decks frequently.
* Whoops.
* Add a selection combobox for sorting logic.
* Debounce and limit searches.
* Include.
* Lint.
* Don't imply that Archidekt supports multiple cards/commander names.
* Let's not lambda it and slot it instead.
* Overload.
* Add button to home tab.
Took 8 minutes
* Adjust to selection model change.
Took 5 minutes
* Cleanup auto-generated comments.
Took 8 minutes
* Remember card sizes.
Took 1 minute
* Initialize with correct size.
Took 3 minutes
* Use correct placeholders.
Took 2 minutes
* Style lint.
Took 16 minutes
* Parse double-faced cards correctly.
* Parse double-faced cards correctly.
* Allow TabArchidekt to use VDE group/sort/display buttons
* Lint.
* Indicate that things are clickable.
* Min treshold for nicer display.
* Lint.
* We have good labels at home.
* We do a little linting.
* Qt version guards.
* Qt5 is the devil.
* Update comments.
* Lint comments.
* More doxys.
* One more doxy.
* Lint.
* Update.
* Small fixes.
Took 7 minutes
Took 13 seconds
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* [Cleanup] Unused #includes
Took 44 minutes
* [Cleanup] More unused #includes
Took 55 minutes
* [Cleanup] Include QSet
Took 4 minutes
* [Cleanup] Include QDebug in deck_list.cpp
Took 3 minutes
* [Cleanup] Include protocol stuff in servatrice_database_interface.h
Took 3 minutes
* [Cleanup] Include QDialogButtonBox
Took 8 minutes
* [Cleanup] Include QUrl
Took 8 minutes
* [Cleanup] Include QTextOption in header.
Took 3 minutes
* [Cleanup] Include QMap in user_list_manager.h
Took 8 minutes
* [Cleanup] Adjust qjson
Took 8 minutes
* [Cleanup] include button box.
Took 3 minutes
* [Cleanup] Redo fwd declarations.
* [Cleanup] Redo last removed fwd declarations.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* [DeckLoader] Refactor last load info into struct
* Use constant
* [[nodiscard]]
* do discard, I guess.
---------
Co-authored-by: Brübach, Lukas <lukas.bruebach@student.fhws.de>
* [VDD] Add sorting
Took 17 seconds
Took 3 minutes
* Adjust to contents.
Took 13 minutes
* Adjust sort order as well.
Took 5 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* protocol changes
* servatrice changes
* add new setting
* implement client side with static 4 phases
* reading the code explains the code
* add subphases to phase.cpp
* use new subphase definition
* [BannerCard] Try to restore by providerId
Took 27 minutes
Took 41 seconds
* Style lint.
Took 2 minutes
* Don't look up by providerId if it's empty.
Took 8 minutes
* Add extra name guard to providerId clause.
Took 4 minutes
* Update cockatrice/src/interface/widgets/deck_editor/deck_editor_deck_dock_widget.cpp
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
* Update cockatrice/src/interface/widgets/deck_editor/deck_editor_deck_dock_widget.cpp
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
* Adjust to comments.
Took 11 minutes
* Extract to helper function.
Took 3 minutes
* Make helper static.
Took 5 minutes
* Remove const qualifier.
Took 3 minutes
* Finally.
Took 5 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
* [DeckEditor] Deck List History Manager.
Took 23 minutes
Took 17 minutes
* Add icons.
Took 2 minutes
Took 3 seconds
* Small fixes.
Took 12 minutes
* Style lint.
Took 48 seconds
* tr() things.
Took 5 minutes
* Add tooltips for buttons.
Took 3 minutes
* Add explanation label to history.
Took 3 minutes
* Refactor to .cpp, delegate undo/redo to manager, don't return memento
Took 8 minutes
* Clear history when setting deck.
Took 6 minutes
* Move to value based stacks.
Took 52 seconds
* Default constructor.
Took 31 seconds
Took 3 minutes
Took 4 minutes
Took 2 minutes
* Have it listen to deck editor additions.
Took 18 minutes
* Don't connect buttons *and* actions.
Took 2 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* [DeckList] Disable copy constructor
Took 1 hour 44 minutes
Took 1 minute
# Commit time for manual adjustment:
# Took 28 seconds
Took 33 seconds
* Revert member to pointer.
Took 19 minutes
* Revert pulling up setters/getters now that getDeckList is no longer const.
Took 6 minutes
* Revert more.
Took 2 minutes
* One more fix.
Took 1 minute
* Update cockatrice/src/interface/deck_loader/deck_loader.cpp
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
* [Refactor] Move AbstractGraphicsItem and GraphicsItemType to game_graphics/board folder.
Took 3 minutes
* Update CMakeLists.txt
Took 12 minutes
* Update CMakeLists.txt
Took 12 minutes
Took 2 minutes
Took 16 seconds
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Add button to join game as judge as well as convenience filters.
Took 1 hour 11 minutes
* Change button to filter to games created by buddies, set default filter settings to be very permissive.
Took 45 minutes
* Remove debug.
Took 3 minutes
* Update game_selector.cpp
* Add spacers, rearrange.
Took 20 minutes
Took 20 seconds
* Add explanation tooltip.
Took 39 seconds
* Try layouting.
Took 14 minutes
* Set min size, set spacing for mac os
Took 3 minutes
* Try without the labels.
Took 3 minutes
* Don't use labels.
Took 5 minutes
* Fine-tune.
Took 2 minutes
* AsJudge
Took 4 minutes
* Clear up comment.
Took 37 seconds
* Remove shift hotkey.
Took 4 minutes
* Spectate as judge.
Took 8 minutes
* Add checkBox to create game as judge.
Took 7 minutes
* Fix crash.
Took 12 minutes
* Rename, fix returns.
Took 19 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Include new pictures.
Took 57 minutes
* Update old pictures.
Took 6 minutes
Took 3 minutes
* Update export documentation.
Took 4 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Fix local variable double declaration.
Took 44 seconds
* Mark functions as [[nodiscard]]
Took 31 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* [Doxygen] Card Picture Loader
Took 25 minutes
Took 16 minutes
# Commit time for manual adjustment:
# Took 12 seconds
Took 14 seconds
* Remove placeholder file description.
Took 1 minute
* ... but do group PictureLoader again
Took 28 seconds
* Link to methods directly.
Took 6 minutes
* Forward declaration.
Took 49 seconds
* Remove redundant .cpp function documentation.
Took 15 minutes
* More fixes.
Took 7 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Helper to query deckList for DecklistCardNodes.
Took 30 minutes
Took 6 minutes
Took 2 minutes
* Fix unused.
Took 3 minutes
Took 1 minute
* Convert string to string list.
Took 2 minutes
* Adjust to rebase.
Took 2 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Give settings managers default groups instead of manually specifying them everywhere.
Took 1 hour 2 minutes
Took 41 seconds
Took 32 seconds
Took 5 minutes
* Fix dbconverter mock.
Took 2 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Docu stash
Took 1 hour 53 minutes
Took 5 minutes
Took 16 seconds
Took 33 seconds
* Remove file headers.
Took 8 minutes
* Group to card set.
Took 8 seconds
* More extra pages.
Took 28 seconds
* Small fix for now.
Took 3 minutes
* Expand on picture loading.
Took 44 minutes
* Fix line break breaking link.
Took 2 minutes
* Images and user documentation.
Took 1 hour 49 minutes
* Update doc/doxygen-extra-pages/developer_documentation/primer_cards.md
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
* Initialize all deck list member variables in constructor.
Took 10 minutes
* Revert "Initialize all deck list member variables in constructor."
This reverts commit fba2455808.
* setParent
Took 1 hour 2 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Move variable declaration closer to usage
* Leave comments
* inline some constants
* make code easier to understand
* Use structured binding to iterate over maps
* move things around
* static const regex
* remove redundant parens
* Can't use asKeyValueRange because of Qt versions
* A DeckLoader is not a DeckList.
Took 2 hours 39 minutes
* Explicitly initialize base class in copy constructor?
Took 3 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* attempts to fix the problem
* add test to show the problem
* fix workflow
* move logger to cockatrice
* more attempts
* undo stuff
* mark different libraries as gui
* fix SC2145
* rename servatrice only build
* Deck loader is a gui class.
Took 31 minutes
Took 3 minutes
* Deck Loader is responsible for printing.
Took 8 minutes
Took 2 seconds
* Style proxy.
Took 14 minutes
Took 6 minutes
Took 1 minute
* Don't need to include QBrush anymore.
Took 3 minutes
Took 7 seconds
* Includes for printer.
Took 5 minutes
* Nuke getDeckList()
Took 9 minutes
* Adjust to rebase.
Took 35 seconds
* Lint.
Took 3 minutes
* Braces for one line return statements.
Took 13 minutes
Took 50 seconds
* Enum for model columns.
Took 9 minutes
* One more single line if.
Took 1 minute
* Another style lint on a sunday night
Took 5 minutes
* Move enum to namespace.
Took 3 minutes
* Fix a critical blocker.
Took 5 minutes
* Update docs.
Took 3 minutes
* Doxygen and namespace enums.
Took 2 minutes
Took 15 seconds
* Adjust to namespace.
Took 4 minutes
Took 1 minute
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Fix crash on rejoining game when reconnecting.
Took 2 minutes
Took 13 minutes
* Proper lib include.
Took 1 minute
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Split filters into libraries where applicable.
Took 23 minutes
Took 2 minutes
* Include filter string.
Took 5 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
The VIP Moderator (Head Moderator) star icon was flipped horizontally
and did not match the orientation of other moderator icons. Fixed by
inverting the scaleX value in the transform matrix and adjusting the
translateX value to maintain the star's position.
Fixes#6290
* Add more sort options to hand sort
Took 14 minutes
* Move defaultOptions up a level
* Directly pass sort order as param
* fix include
* revert
* fallback expandSortOption
* Introduce additional checks for playerMenu shortcut activation when they are accessed by a judge, only activating them if the player is a local player.
Took 2 hours 7 minutes
Took 17 minutes
* Undo example change.
Took 5 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Have CardDatabase::getPreferredPrintingInfo respect card provider ID overrides (pinned printings)
Took 13 minutes
Took 37 seconds
Took 10 seconds
Took 10 seconds
# Commit time for manual adjustment:
# Took 30 seconds
Took 15 seconds
Took 8 minutes
Took 21 seconds
* Move settings cache and settings card preference provider out of libcockatrice_settings and into cockatrice
Took 52 minutes
Took 9 minutes
Took 1 minute
* Temp cache.
Took 16 minutes
* Dependency Injection for SettingsCache
* Turn SettingsCache into a QSharedPointer.
* Implement interfaces for settings that need it
Took 2 hours 38 minutes
* Adjust oracle.
Took 5 minutes
* Move abstract/noop interfaces to libcockatrice_interfaces so they can be linked against independently.
Took 52 minutes
* Clean up some links.
Took 3 minutes
* Cleanup two includes.
Took 3 minutes
* More fixes.
Took 7 minutes
* More includes that slipped past.
Took 3 minutes
* Stop mocking and start injecting for tests.
Took 15 minutes
* I don't know why remote_client was including main.
Took 4 minutes
* Include.
Took 3 minutes
* Lint.
Took 2 minutes
* Don't use Qt pointers.
Took 1 hour 7 minutes
* Make parser use CardSettingsInterface
Took 13 minutes
* Also adjust constructor lol.
Took 8 minutes
* Lint.
Took 32 minutes
* Revert "Lint."
This reverts commit ecb596c39e.
Took 3 minutes
* Test.
Took 3 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* update format.sh
add shellcheck to format.sh
add statement macros to .clang-format
add no clang format to format.sh
add changed file list to format.sh diff
rename --cf-version to --print-version in format.sh
lint files
* enable --shell on ci runs
* remove useless semicolons
removes the semicolons after empty function definitions
these semicolons are optional, they don't do anything
this will have functions be consistently formatted
if we want to keep the option to have these on the same line like they
were before we should use the option AllowShortFunctionsOnASingleLine: None
* fix script
* update echo line in lint_cpp.sh which doesn't lint cpp only at all
* ci: unify vcpkg jobs
* use build matrix variables: package_suffix
simplifying some convoluted logic, one variable at a time. work in progress.
* use build matrix variables: artifact_name
* use build matrix variables: qt stuff
* display cmake flags in builds
* add type to windows builds
* use build matrix variables: cmake stuff
* use build matrix variables: USE_CCACHE
* formatting
* more formatting
* spaces
* address review comments
* Move logger and key signals from libcockatrice_utility to Cockatrice.
Took 9 minutes
* Only link Qt::Core instead of COCKATRICE_QT_MODULES to libraries, if possible.
Took 2 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Move models to own library.
Took 35 minutes
Took 22 minutes
* Adjust CMakeLists
Took 20 seconds
* Reformat CMakeLists.
Took 2 minutes
* Revert "Reformat CMakeLists."
This reverts commit db5982ad1c.
Took 55 seconds
* Lint an include
Took 17 minutes
Took 9 seconds
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Translate oracle_en@source.ts in en@pirate [Manual Sync]
7% of minimum 4% translated source file: 'oracle_en@source.ts'
on 'en@pirate'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate cockatrice_en@source.ts in en@pirate [Manual Sync]
8% of minimum 4% translated source file: 'cockatrice_en@source.ts'
on 'en@pirate'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
---------
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
4% of minimum 4% translated source file: 'cockatrice_en@source.ts'
on 'tr'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
7% of minimum 4% translated source file: 'cockatrice_en@source.ts'
on 'nb'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* build: target older macos
* cleanup
* Align xcode versions
* Simplify --x86-macos
* use cmake flag in compile.sh i.s.o. env var in yml
* more cleanups
* adress initial reviews
* generate triplet file in compile.sh
* fix triplet name
* pass matrix.target as version
* small refactor
* another minor refactor
* ci: fix ccache cleaning
* add more comments
* try passing triplets config as cmake variables
* Revert "try passing triplets config as cmake variables"
This reverts commit 77e83e8590.
* move logic inside runner == macos if
* move logic to env var
* simplify script
* format script
"I just thinks it looks better like this"
* make script work for arm as well, might be useful
* use hyphen
* use DVCPKG_HOST_TRIPLET instead of DVCPKG_TARGET_TRIPLET
* use DVCPKG_HOST_TRIPLET AND DVCPKG_TARGET_TRIPLET
---------
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
* [PrintingSelector] Clearly warn users about disabling the providerId change, hide and disable the printingSelector, clear the networkCache.
Took 56 minutes
Took 4 seconds
Took 9 minutes
* Defer rollback so the rollback isn't swallowed logically.
Took 7 minutes
* Immediately enable select printing action.
Took 7 minutes
* Remove restart label.
Took 8 seconds
* Clear PixmapCache as well as NetworkCache.
Took 4 minutes
* Lint.
Took 3 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Player manager is responsible for deleting players.
Took 21 minutes
* Clean up dangling QAction* wrappers for PlayerMenus in TabGame::processPlayerLeave(Player* leavingPlayer)
Took 37 seconds
* Lint.
Took 11 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Populate playerLists for menus in their aboutToShow so they are always current and do not rely on playerMenu manually tracking them. Also add playerActions for previous playerListActions.
Took 1 hour 35 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Regroup a whole bunch of files.
Took 1 hour 38 minutes
* Reorder the structure.
Took 15 minutes
* Link some more things.
Took 18 minutes
* More links.
Took 14 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Untangle the card_info.cpp mess and split into individual files.
Took 53 minutes
* Auto-lint was disabled and my pre-commit hook didn't fire. Oh well.
Took 3 minutes
* Fix oracle.
Took 35 seconds
* Lint!
Took 20 seconds
* Fix tests.
Took 3 minutes
* CMakeLists.txt: The reason why I have to disable auto-lint.
Took 2 minutes
* dbconverter.
Took 3 minutes
* Oracle again.
Took 3 minutes
* dbconverter again.
Took 3 minutes
* dbconverter again again.
Took 2 minutes
* More fixes.
Took 4 minutes
Took 21 seconds
* Everything needs everything.
Took 3 minutes
* Everything means everything.
Took 4 minutes
* All the tests.
Took 4 minutes
* I hate everything about this.
Took 3 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Add a doxy group for the PictureLoader.
Took 26 minutes
* Linting is a fun activity for children and adults of all ages and sizes.
Took 5 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Sort *every* file into a doxygen group.
Took 7 hours 9 minutes
Took 18 seconds
Took 2 minutes
* Lint some ingroup definitions.
Took 10 minutes
Took 2 seconds
* Just include the groups in the Doxyfile in this commit.
Took 3 minutes
* Update some group comments so they link!
Took 14 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Layout adjustments.
Took 1 hour 54 minutes
Took 2 minutes
Took 6 minutes
* Remove the empty building page.
Took 7 minutes
* Change to @page
Took 11 minutes
* Change to @page again
Took 52 seconds
* Change to @page again again
Took 2 minutes
* Fence the page declaration in CONTRIBUTING.md
Took 8 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Manual trigger, branch name fix, rename yml
* Update documentation-build.yml
* Run on changes to file but only deploy on tags
* Update documentation-build.yml
* [TabGame/GameEventHandler] Re-emit spectator addition signals in eventGameStateChanged.
Took 36 minutes
* Check spectators as a whole.
Took 2 minutes
* Lint.
Took 42 seconds
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Add workflow to generate doxygen on tag push.
Took 17 minutes
* Publish correct dir.
Took 3 minutes
* Don't include common/libs.
Took 20 minutes
* Update workflow
Took 1 hour 25 minutes
* Style Doxygen output.
Took 55 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Clean up game scene code.
Took 18 minutes
* Doxygen.
Took 18 minutes
Took 5 seconds
Took 10 minutes
* Move some methods.
Took 6 minutes
* Restore the original warning, I guess.
Took 3 minutes
* Accidentally some methods.
Took 5 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* build: use vcpkg for most dependencies on macos
* factor out common params
* refactor: factor out common parameters in macOS matrix
* use env vars instead of matrix
* add comment about jianmingyong/ccache-action
* Remove unused 'qt_tools' param
* Use system python
* Let ccache caches be handled by ccache-action
* Add comment about why we use install-qt-action
* set unique ccache key
* nit
* fix cache prefix
* pass gh-token
* Revert "pass gh-token"
This reverts commit cadfa253c6.
* Reapply "pass gh-token"
This reverts commit bd15e96e18.
* do not cache qt on macos
* Simplify add card.
Took 25 minutes
Took 8 minutes
# Commit time for manual adjustment:
# Took 16 minutes
Took 7 seconds
* Refactor out db loading from card db.
Took 39 minutes
Took 9 minutes
Took 2 minutes
Took 17 seconds
* Refactor out db queries from card db.
Took 42 minutes
* Lint.
Took 3 minutes
* I guess.
Took 7 minutes
* Tests.
Took 15 minutes
* I don't understand this.
Took 9 minutes
* fix linker errors
* Rename to querier and promote to QObject
Took 39 minutes
* Lint.
Took 3 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
* [TabRoom] Re-layout game creation dialog.
Took 18 minutes
* Don't squish because then they overlap. Use new layout instead.
Took 8 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Handle concession properly.
Took 57 minutes
Took 38 seconds
Took 18 seconds
Took 21 seconds
* Set text and enable/disable on game start/stop. (Does not fix the translation issue but at least disables the button.)
Took 51 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Fix timer starting twice, not stopping and not resetting correctly.
Took 39 minutes
* Don't stop/start, just start.
Took 29 minutes
* Fix build.
Took 2 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Simplify add card.
Took 25 minutes
Took 6 minutes
* Simplify guessCard.
Took 2 minutes
* Simplify loadCardDatabases.
Took 3 minutes
Took 6 seconds
* Clean up mutexes instead of manually locking/unlocking.
Took 5 minutes
* Fix null/empty check.
Took 3 minutes
* Move some stuff around inside the file.
Took 4 minutes
* Move some more things.
Took 2 minutes
* Clean up refreshCachedReverseRelatedCards.
Took 2 minutes
Took 6 seconds
* Clean up getCardFromSameSet.
Took 2 minutes
* Lint.
Took 5 minutes
* Fix compiler warning.
Took 4 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Refactor CardDatabaseDisplayModel, TokenDisplayModel and TokenEditModel out of CardDatabaseModel. Move every model into an appropriate folder.
Took 54 minutes
* No folder for database models.
Took 6 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* move common server files
* update includes with move
* create participant, move code
* fix linker errors
* fix regressions
* mark function as override to make clang happy
* split out spectator to new file
* forgot to add to cmakelists
* autocompleter picking wrong casing for var name
* clean up forwards declarations in player
* fix includes in game
* big move
* also move game_specific_terms
* fix imports
* alphabetize cmake
* fix build failure
* create database folder and move files into it
* fix includes
* run formatter
* Disable shuffle if frequency is set to 0.
Took 13 minutes
Took 26 seconds
* Set special value text.
Took 12 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* check for null zone during card item teardown
Took 1 hour 32 minutes
Took 24 seconds
* Also check for it in the successful branch.
Took 6 minutes
* Comment.
Took 5 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Don't get local ID from playerInfo.
Took 39 minutes
Took 39 seconds
* Introduce isLocalPlayer convenience method.
Took 21 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Check if card has no PT set yet if dropped on table.
Took 22 minutes
* Use isEmpty() for comparison.
Took 6 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Disable view card database button until card db is loaded, add a new style for disabled buttons.
Took 4 minutes
Took 21 seconds
* Lint.
Took 8 minutes
* Rename variables, don't disable DB button anymore.
Took 4 minutes
Took 4 seconds
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Properly delete enlargedPixmapWidget.
Took 23 minutes
Took 13 seconds
Took 16 seconds
* Connect to QObject instead of emitting own signal.
Took 12 minutes
Took 7 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Refactor player menus into helper classes.
Took 2 hours 6 minutes
Took 11 minutes
* Lint.
Took 6 minutes
Took 22 seconds
* Refactor card and move menu.
Took 1 hour 6 minutes
Took 36 seconds
Took 52 seconds
* Set active shortcuts, move player info stuff to card menu.
Took 25 minutes
Took 18 seconds
* Refactor say and utility menu.
Took 54 minutes
Took 2 minutes
Took 5 minutes
Took 11 minutes
* Rename folder.
Took 24 minutes
Took 6 minutes
* Refactor sideboard menu.
Took 26 minutes
* Remove unused variable in constructor.
Took 42 seconds
* Lint.
Took 11 minutes
* Nullptr check
Took 8 minutes
* Use localOrJudge check
Took 6 minutes
* Fix the build.
Took 7 minutes
Took 35 seconds
* PlayerList things.
Took 16 minutes
* Retranslate and set shortcuts for everything.
Took 10 minutes
* Correctly nullptr out sayMenu if not local
Took 3 minutes
* Don't check playerInfo in sbMenu shortcutsActive
Took 3 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Player refactor.
Took 1 hour 43 minutes
Took 1 minute
Took 23 seconds
* Tiny lint.
Took 3 minutes
* Hook up tap logic again.
Took 13 minutes
* Fix an include.
Took 3 minutes
* Stuff.
Took 6 minutes
* Fix typo.
Took 7 minutes
* Include.
Took 1 minute
* Reorganize method/variable definitions, remove unused ones.
Took 1 hour 8 minutes
Took 24 seconds
* Clean up some unused imports.
Took 6 minutes
* Player holds the deck, emits deckChanged(), other elements player->getDeck() to respond to changes.
Took 37 minutes
* Connect player->openDeckEditor signal directly in the player constructor
Took 6 minutes
* Emit openDeckEditor signal in player_actions again.
Took 3 minutes
* Do to-do's
Took 3 hours 32 minutes
* Lint.
Took 3 minutes
* Lint again.
Took 2 minutes
* Fix include.
Took 32 minutes
* The stack should ensure card visibility.
Took 21 minutes
* Fine, the game can remember the tab.
Took 10 minutes
Took 21 seconds
Took 9 seconds
* zoneId is a dynamic gameplay property and thus belongs in player.cpp
Took 11 minutes
Took 19 seconds
* Signal view removal, addition.
Took 5 minutes
* Ensure all players are considered local in local game.
Took 10 minutes
* ENSURE they are.
Took 8 minutes
* Bounds check data sent by QAction()
Took 54 minutes
* Move comment.
Took 20 seconds
* Reimplement logging category for game_event_handler.cpp, remove linebreaks.
Took 36 seconds
* PlayerGraphicsItem is responsible for retranslateUi, not Player.
Took 14 seconds
* Set menu for sideboard again, translate some menu titles, reimplement actIncPT action
Took 54 seconds
* Comment spacing.
Took 43 seconds
* Change message_log_widget.cpp slots to take CardZoneLogic parameters as emitted by PlayerEventHandler.
Took 7 minutes
Took 14 seconds
* Remove unused player_logger.cpp
Took 2 minutes
* Query local game state correctly from tab_supervisor again
Took 3 minutes
* Revert Deck legality checker.
Took 3 minutes
* Instantiate menu before graphics item.
Took 1 hour 5 minutes
Took 55 minutes
* Differentiate games and replays.
Took 9 seconds
* Lint.
Took 10 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Move game state and event handling out of tab_game and into separate classes.
Took 6 hours 38 minutes
Took 23 seconds
* Meta Info
Took 14 hours 36 minutes
* Properly respond to game started again.
Took 49 minutes
* Hook up the message log widgets to game events again.
Took 33 minutes
Took 7 seconds
* Lint.
Took 4 minutes
* Hook up playerListWidget.
Took 1 hour 2 minutes
Took 10 seconds
* Hook up playerListWidget properly.
Took 1 hour 17 minutes
* Fix regressions.
Took 17 minutes
Took 9 seconds
* Log the local player joining too.
Took 2 minutes
* Connect some player signals unrelated to this refactor again.
Took 5 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* new protos
* implement commands on server
* add buttons
* icons
* run formatter
* Message on get replay code failure
* Add new commands to switch statement
* Better failure messages
* Fix permission check query
* Change hash method
* Prevent adding duplicate replays
* Clean up TabReplay ui
* Copy over replay name
* base64 encode the hash
* Shorten hash
* Better failure messages
* change icon back to search icon
* check hash before checking if user already has access
* update share icon
* Update label text
* Add option to share decklists on load.
Took 1 hour 58 minutes
Took 9 minutes
Took 39 minutes
* Lint.
Took 14 minutes
Took 2 minutes
* Stuffs
Took 39 minutes
Took 4 seconds
Took 43 minutes
* Process local player first.
Took 45 minutes
* Consider if the setting is set on the game info first.
Took 4 minutes
* Save an indent level.
Took 43 seconds
* Don't commit logging config.
Took 3 minutes
* Remove a debug print.
Took 10 seconds
Took 7 seconds
* Add another optional guard.
Took 5 minutes
* Hide the tab bar if only one (own deck) is visible.
Took 9 minutes
* Rename setting label for clarity
Took 2 minutes
* Capitalization.
Took 3 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* extract cardMenu from CardItem
* move cardMenu saving to TabGame
* delete TabGame::updateCardMenu
* move checking to updateCardMenu
* unset activeCard when all cards are unselected
Tokens created through Ctrl + T use the pinned printing, if available.
Tokens created through a related card menu use a token from the same set, if available.
Took 2 hours 25 minutes
Took 10 seconds
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Add sort hand shortcut
* add function to sort hand by type and name
* rig up the sort hand to the player
* fix sorting param
* use getShortcut instead of getSingleShortcut
* use correct method
* change default sorting
---------
Co-authored-by: Zach H <zahalpern+github@gmail.com>
* Add the option to load decklists from Archidekt, Deckstats, Moxfield, TappedOut in deck editor and lobby.
Took 3 hours 34 minutes
Took 9 seconds
Took 12 seconds
* Properly set quantities.
Took 11 minutes
* Warnings.
Took 5 minutes
* Static regexes.
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
* Category loggings and better warnings.
Took 18 minutes
Took 42 seconds
* use loadFromStream_Plain instead of manually adding CardNodes to the DeckList.
Took 30 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
* Allow more naming schemes for custom pictures.
Order is cardName_providerId, cardName_setName_collectorNumber, setName-collectorNumber-cardName and then just generically cardName, if the user has decided to override every printing. Most-to-least specific.
Took 2 minutes
Took 8 seconds
* Fixups.
Took 2 minutes
* Even more naming schemes.
Took 6 minutes
* Finally yeet the bug warning in PrintingSelector
Took 3 minutes
* Adjust to PrintingInfo change.
Took 5 minutes
* Don't use suffixes.
Took 7 minutes
Took 9 seconds
* Comments.
Took 2 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Inline getCardFromMap
map.value already returns a default-constructed value if the key is not present
* Use for-each instead of iterator
* Add new method
* clean up method order
* fix build failure
* clean up getPreferredPrinting usage
* early returns
* remove unnecessary consts
* removed unused
* rename class
* rename variables and methods
* rename again
* rename variables again
* rename field
* run formatter
* [PictureLoader] Reduce downtime between load attempts
* rename some stuff
* better comments
* Fix segfault from status bar
Pass just the relevant data through the signals to the status bar, instead of passing the entire Work object.
That way the data is detached from the Work object and we won't segfault when Work self-deletes before status bar tries to use that data.
* Rename method
* [PictureLoader] Properly run reply processing on Work's thread
* emit cachedImageHit first
* Remove unused fields
* Remove unused fields
* Fix double free requests from cache hit
If we hit a cached url, the request already gets to skip the queue.
By sending another free request once the cached request finishes, we're actually sending two free requests on each cache hit.
* Add the option to background the oracle wizard, add an option to automatically launch oracle wizard in background every X days since last launch.
* Mocks and a typo.
* Lint.
* Lint?
* qOverload the spinBox.
* Change to a prompt instead.
* An Label.
* Update window_main.cpp
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: Zach H <zahalpern+github@gmail.com>
* Performance stuffs.
* Actually make widgets track their indices.
* Functional stuff.
* More display stuff.
* Determine where we will insert the card before actually inserting it in the model.
* Allow overlap layouts to insert widgets at specific positions.
* Modified signals.
* Raise trailing widgets on overlap layout widget insertion.
* Nix the logging config changes.
* Lint.
* Address comments.
* Address comments.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Add a new dialog that allows editing the default suggested tags.
* Lint.
* Actually hand linting, lol.
* Fix Build
* Add dialog.
* Use show() instead of exec(), properly size hint list item widgets.
* Fix... something to do with the build?
* Cast to abstract tab deck editor instead of regular.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
* Consider local images, remove some unused variables.
* Move checking for local card images outside of card download loop, add NOT found debug line.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* feat: Configurable colors for card counter
This patch adds support for:
- User-defined colors for card counters;
- 3 additional types of card counters.
The colors used for counters is stored locally and not shared with other
users. This is intentional as the feature is likely to be used for
improved accessibility.
In order to preserve backwards-compatibility, and because I don't have a
better idea, counters keep their existing color-based names (Red, Green,
Yellow) in menus and in the message log. For consistency, the new
counters also get assigned color-based names (Cyan, Purple, Magenta).
This choice is a compromise, as allowing user-defined names for counters
raises many additional (UI/UX) questions that I don't know how to
answer. A good long-term solution would be to include counter names as
part of a game definition system and hence would be in scope for #1740.
The choice of adding 3 additional types of counters and the Cyan, Purple
and Magenta names are not random. The existing code for determining
counter colors goes: Red, Green, Yellow, Cyan, Purple, Magenta, Black
(unreadable) and thus 6 is the maximum number of counters that existing
versions of Cockatrice are able to support. This way, released clients
get a degraded experience (cannot interact with the new counters,
messages in the server log say "Player X places 1 on Card (now 1)"
without specifying 1 of what), but do see the counters properly.
Fixes#2020
* Do not use %n
* Use SettingsManager
* Use qSin instead of sin
Fix build failures with old GCC.
* Use letters for card counter names
* Place card counter actions in separate menu
* Remove copy-paste error
* include QtMath
* Do not color whole settings page
* derp
---------
Co-authored-by: Zach H <zahalpern+github@gmail.com>
* Parallelize picture loader.
* Queue requests instead.
* Include a status bar for the picture loader.
* Save redirect cache on destruction.
* Address comments.
* Let's not overwrite an ambigious variable name.
* Lint.
* Oracle needs the status bar too.
* We actually get a free request if we hit a cached image.
* Fix cmake list.
* toString() the url.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Add a group criteria to the deck list model and a combo box to the deck dock widget to change it.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Although this config is not built on CI, while trying to compile locally, the build failed due to warnings and -Werror.
Some qt functions were actually deprecated (but not removed) before version 6.0.0 and clang (righfully) complains about comparison between different types of enums.
* Remove `isView` flag from CardZone
This flag is used for two purposes:
1. It is used as a check for casting to a zone to a `ZoneViewZone`;
2. Non-view zones are added to the player's zones on construction
This patch removes the `isView` flag and instead:
1. We directly cast zones to `ZoneViewZone` using a dynamic (qobject)
cast and use the result of the cast instead of the `isView` flag to
detect if we are a view zone or not;
2. The player records its own zones when they are created, simplifying
control flow.
* Review
* client: Support arbitrary game zones
Currently, the client ignores cards in unknown zones, as there is an
implicit assumption that the set of zones known by the server and the
client are the same.
This patch makes it so that the client accept "custom zones" from the
server (zones outside the builtin deck, graveyard, exile, sideboard,
table, stack and hand zones) using the information from the
ServerInfo_CardZone. Moving cards from/into these zones happens
through a "View custom zone" action in the Game > Player menu and
properly appears in the chat.
Note that this patch intentionally does not introduce any support for
having the server actually create such zones. Instead, this patch aims
to improve backwards compatibility for when we do get to adding this
capability in the future, by making sure that current clients will be
able to interact with future new zones (even if suboptimally).
There is an issue with run-vcpkg GHA not caching properly. This ends up wasting 20 minutes of redundant vcpkg depency compilation.
See https://github.com/lukka/run-vcpkg/issues/243
* feat: build and release docker images using github cicd
* fix: attempt to publish to specific image name
* fix: typo in pipeline step
* typo
* typo
* limit to certain paths for PRs & naming
* ci: configure image title and url
* docker: include only necessary files and directories
this should make caching more powerful
* docker: reorder COPY with best guess of what changes least
* build(docker): remove seemingly unnecessary files
* fix: clean up docker metadata
remove annotations, it seems they're applied from the labels already, add description
* fix(ci): add back docker image annotations
* Update desktop-build.yml
* Update desktop-lint.yml
* Update desktop-build.yml
* Update docker-release.yml
* fix: remove run on master and add affected files to PR trigger
* metadata
* ci: run pipeline on main
this will ensure the container can always build and keep caches ready for release. push should only happen on tag triggers
It also removes some files from the PR trigger that should never break the build, and would just invalidate cache.
* Update docker-release.yml
---------
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
* add new fields to proto
* update token dlg
* send facedown in command
* update server to get it to work
* disable certain edits when face down
* update client event processing
* log face-down token creation
* Don't support colors on face-down tokens
The other client doesn't know about the color, so it causes a desync
* Update wording
Co-authored-by: Basile Clement <Elarnon@users.noreply.github.com>
* Allow annotations on face-down tokens
---------
Co-authored-by: Basile Clement <Elarnon@users.noreply.github.com>
* Remove `isView` flag from CardZone
This flag is used for two purposes:
1. It is used as a check for casting to a zone to a `ZoneViewZone`;
2. Non-view zones are added to the player's zones on construction
This patch removes the `isView` flag and instead:
1. We directly cast zones to `ZoneViewZone` using a dynamic (qobject)
cast and use the result of the cast instead of the `isView` flag to
detect if we are a view zone or not;
2. The player records its own zones when they are created, simplifying
control flow.
* Review
* remove unused dataDir variable
* inline setsMap
* join declaration and assignment
* make the protected methods static
* make getSetPriority static
* inline mainCardTypes list and make the method static
* pass by const ref when able
* rename param to match
* RetranslateUi instead of updating filter mode.
* Defer setting the filter tree on the database display model until AFTER all the filter widgets are initialized.
* Update visual_database_display_set_filter_widget.cpp
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: Zach H <zahalpern+github@gmail.com>
* Saner and more performant color filtering.
* Update visual_database_display_color_filter_widget.cpp
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: Zach H <zahalpern+github@gmail.com>
* update hnadling of keywords: AND, OR, NOT in card search
* added and
* update test
* update test
* update OR to not be [oO][rR] and just look for OR
* keyword testing
* adjusted new test
* implement test case for cards with keyword in name
* implement test case to cards with keyword in name
* format
* update test case
* change test cas
* update truth test case
* changed test card search from real cards to fake and added cards
* Update tests/carddatabase/data/cards.xml
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
* Update tests/carddatabase/filter_string_test.cpp
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
* Update tests/carddatabase/filter_string_test.cpp
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
* update formatting
* update cardatabase_test to include +2 cards
* update test case +1 set + 1 type
---------
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
* Implement a little "raise on enter" animation for deck preview widgets.
* Why does the linter need to be run twice?
* Fix build.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Refactor things into more sensible folders.
* Add navigation widget for budget and game changers.
* Lint.
* Add a card price display widget.
* Qt version check.
* Lint some thangs.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Refactor files in src/client/tabs to new Qt Slot/Signal syntax
* Refactor DeckEditorMenu to use new signal/slot syntax
Add DeckEditorMenu as friend class to AbstractTabDeckEditor since the slots are protected
* fix build failure
* change settings entry of the cod conversion prompt to a combobox
replace the two checkboxes of which one state is ignored if one is
checked with a three state combobox for better user experience
* Update dlg_settings.cpp
---------
Co-authored-by: Zach H <zahalpern+github@gmail.com>
* Revert "Add CONFIGURE_DEPENDS to the cmake (#5739)"
This reverts commit 57b9f0e54c.
* Revert "Automatically find all files for cockatrice_SOURCES (#5716)"
This reverts commit 4a0e0ed954.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* fix: Use isRebalanced to detect Arena cards
In #5759 we introduced a setting (off by default) to disable the use of
Arena cards. This was done by checking the `isOnlineOnly` property of
the card, which accidentally also disabled online *printings* of cards
that otherwise exist in paper (e.g. Vintage Masters).
This PR does the same thing but uses the `isRebalanced` property
instead, which is `true` for Arena cards only and should have been used
from the start. This setting does not impact online-only printings such
as Vintage Masters. The settings is still on by default.
* Update setting to mention Alchemy rather than Arena
* Try to better reproduce pre-provider ID behavior
If "override all card art with personal preference" setting is set, look
for custom art for all sets instead of just the most preferred set.
* Warning when using both custom art and the printing selector
* QDirIterator::nextFileInfo is Qt 6.3+
* Translation
`refreshTags` is not connecting the signal to open the dialog to edit
the tags, so tags can only be edited once for a given deck.
Fix by only having the logic for creating the "Edit tags" button once
and call it from `connectDeckList`.
The divideCardSpaceInZone function introduced in #4930 is buggy and
sometimes returns an index that is too large for the current zone, which
causes us to call `cards.at(index)` with an `index` that's bigger than
the amount of cards.
This is the bug that #5609 intended to fix but was improperly diagnosed.
Remove part of #5609 as the cases it is guarding against (e.g. null card
pointer) cannot actually happen.
C++ does not require compilers to zero-initialize value types, so
depending on the platform (here: Linux), the deck editor starts up with
an uninitialized value in the `modified` flag, which is usually not
zero.
This is part of the code from #4974, including an improved drag-and-drop
API and its use to display visual feedback of card destination on the
board.
It does not include the improved logic for pushing cards around as I
still need to figure out edge cases there - the logic for choosing where
cards go is not changed, so some of the artifacts described in #4817
and #4975 (particularly around multi-card) are still present.
* Close the `TabGame`s when closing the `TabSupervisor`
This ensures that we go through the same code path (in terms of Qt
events) when closing the whole supervisor as when closing a single tab.
Also, use the `close` event instead of the `hide` event to detect when
we are closing a game.
Fixes#5697
* Compat with old Qt versions
* Old Qt, reloaded
* Review: use hideEvent and call super
* Use enum for ThemeManager brushes
This patch introduces an enum to distinguish the different brushes that
can be set by the theme (hand, stack, etc.) and generic functions taking
the enum rather than having one copy of each function for each brush.
This is preliminary work before merging StackZone and HandZone to
simplify #4974.
* Include <array> header
* Header spacing
Currently, zones must keep track of which cards they move in order to
manually call `updatePath` on arrows.
This patch sets the `ItemSendsScenePositionChanges` flag on
`ArrowTarget`s to automatically update arrow positions without requiring
zones to keep track of that information.
- Remove hardening flags to allow debug builds (otherwise GCC complains
because nix adds the FORTIFY_SOURCE flag, which is not compatible
with -O0)
- Allow ninja as build system
- Add clang-tools dependency for LSP support
* remove recursion from flattenFolderStructure
findChildren is already recursive by default
* only trigger the top-level updateVisibility on filter update
Every folder widget was connecting the filter update signals to their updateVisibility, but updateVisibility is already recursive.
That means a bunch of redundant updateVisibility calls happen every time a filter update signal is emitted
* reduce redundant recursion in updateVisibility
findChildren is recursive by default, so only the top-level updateVisibility needs to loop through the found children
* delete now-unused signals
* implement functionality in dlg
* add action to deck editor
* refactor and comments
* is this refactor even a good idea?
* remove the friend class stuff
* reorder
* add option for not annotated
* Generic mana symbols.
* Update black mana symbol skull and symbol color.
* Update white mana symbol contrast.
* Update black mana symbol contrast.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Make BannerWidget's dropdown icon more robust
* use isHidden
Otherwise, it doesn't work correctly if the BannerWidget is offscreen
* don't show icon if there's no buddy
* Fix move to top of library shuffling an extra card
* Update cockatrice/src/game/player/player.cpp
---------
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
* Implement new method for DeckList to return cardlist with providerId, a new carddatabase method to fetch a cardlist with name and providerId and changed PictureLoader to use providerId versions of cards for caching.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Generify TabDeckEditor.
* Connect dockTopLevelChanged signals.
* Connect eventFilters.
* Remove comments.
* Fix ze build (accidentally deleted a line)
* Fix some pointer chaining.
* Be a lot saner about some signals/slots, as in, individual Deck Editor widgets now internally determine their CardInfo and then simply communicate this to the DeckEditor
* Lint.
* DeckDock can handle its own menu.
* DeckDock can handle its own decrement.
* DeckDock now notifies the deck editor on deck change, instead of individually modifying menu items and modification status.
* Rename.
* Include pixelmap generator for icon.
* Directly use an AbstractTabDeckEditor as parent.
* Move clearing database filter into signal/slot relation.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* add svg
* update pixmap cache
* get icon to work
* hide icon when not clickable
* use consistent naming
* use expandOnly because apparently that leads to higher image quality
* move card to play before creating attached token
* leave comment
* hardcode createCard target zone to table
To get attached token from graveyard/exile to work
* Move show folders option next to the search bar.
* Add a new settings button and settings popup, move the folder visibility checkbox there and the ability to hide tags.
* Make popup not close when interacting with child widgets.
* Fix mocks.
* Include cog icon.
* Move PrintingSelector Display options to new quick settings widget.
* Adjust size before first show so as to not overflow.
* Add option to hide card size slider in VDS.
* Qt5 support.
* Fix some warnings by containerizing layouts because addChildLayout is silly.
* Fix an incorrect slot/signal assignment.
* Correct sub-categories for settings to persist them.
* Shuffle some slots and signals around to distinguish between the tag filter and the tags on the deck preview widgets.
* Add a quick setting to draw unused color identities and center them.
* Respect the setting on startup.
* Move card size slider to the quick settings menu.
* Move PrintingSelector card size slider to quick menu, adjust other layout from other options.
* Improve layout, add a gray border.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Only resize on folder widget to make sure it doesn't squish the loading indicator.
* Clamp scrollArea widget to viewport width on showEvent to prevent widget being instantiated with wrong width when not visible.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Add a dialog to prompt user to convert to .cod format if trying to apply tags to a .txt deck.
* Lint mocks.
* Address comments, move dialog to appropriate folder.
* Unlint.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Move logging from QDebug to QCDebug and introduce LoggingCategories.
* Lint.
* Unlint like one change.
* Remove .debug category since this is autofilled by Qt and used to differentiate between QCDebug and QCWarning and QCError.
* Uncomment defaults, include main category.
* Make PictureLoader logging a bit more useful.
* Lint...?
* Address comments.
* Clean up some unnecessary classes in logging statements.
* Add a new message format to the logging handler.
* Lint.
* Lint.
* Support Windows in Regex
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
* Give deckList a signal to emit when the tags change and hook up the display widget to that.
* Reload from file when loading a visual deck to ensure latest changes propagate to the decklist.
* Eliminate loadVisualDeck and use loadDeckFromFile instead.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* rename method
* delete unused method
* refactor
* increase margins
* change visible buttons depending on if deck is loaded
* correctly send the ReadyStart command on unload
* fix force start button still being visible
* Add options to include/exclude set name and collector number during clipboard import/export.
* Missing parentheses in action label.
* Revert the silliest lint in the world.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* remove closeRequest override
* remove visualDeckStorage from WindowMain
* manage visual deck storage in TabSupervisor
* open on startup
* refresh vds on db load finish
* open deck editor tab first on startup
* Restore some button states (ready/sideboard locked) to sensible defaults when unloading a deck.
* Update last loaded timestamp in decklist file and then restore original last modified timestamp if a user requests a deck load.
* Add some todos.
* Loading a deck from local file dialog should swap out scenes, enable unload button.
* Lint.
* Shuffle some classes and signals around.
* More sort options, sort widgets directly.
* Banner cards should respect providerIds.
* Properly updateSortOrder on load.
* Add the color identity to the Deck Preview Widget.
* Properly set sort indices.
* Change replace visualDeckStorageWidget with deckView to be in deckSelectFinished so that it also works on remote deck load.
* Include settings for unused color identities display.
* Change opacity scaling.
* Overload for Qt.
* Lint.
* Lint.
* Include QMouseEvent
* Template because MacOs.
* Include a quick filter for color identities.
* Include a quick filter for color identities.
* Save some space.
* Refactor DeckPreviewWidgets to reside in their own folder.
* Add Deck Loader logging category.
* Introduce a tagging system.
* Add some more default tags.
* Even more default tags.
* Lint.
* Lint a comma.
* Remove extra set of braces.
* Lint some stuff.
* Refresh banner cards when tags are added.
* Lint.
* Wrestle with Qt Checkboxes.
* Lint.
* Adjust some sizes, relayout.
* Address comments.
* Lint.
* Reorder kindred types.
* Add a search bar for tags.
* Remove close button (for now) and change "Add tags ..." to "Edit tags ..."
* Retranslate window title for Deck Tag Manager Dialog.
* Style tag addition widget to be consistent.
* Lint.
* Override paintEvent.
* Override sizeHint
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* make closeRequest call close by default
* make all tabs closable by default
* closeRequest instead of deleteLater on stop
* null out pointer on destroy
* no need to manually null out the tabs anymore
* comment
* pass tabsMenu into ctor
* comment
* implement tabs menu
* fix segfault on close (again)
* remove deck editor action from WindowMain
* refactor closeTab
* always set tab parent to tabSupervisor
* set tabSupervisor parent
* use close instead of deleteLater
* be more clear about overloads
* add new param to closeRequest
* don't emit signals in dtors
* send closeRequest
* fix build failure
* fix build failure
* see if we can get away with the overloaded triggered
* fix build failure
* Get cardIds to update properly in bottom view (#5414)
* Get bottom view to update properly when card is inserted into known portion (#5415)
---------
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
* Extend the decklist parsing from clipboard to also support SetName, CollectorNumber and Foil Status.
* Q_UNUSED foil for now but keep parsing logic for future PR's/compatibility.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Add TabDeckStorageVisual
* Visual Deck Storage
* Add BannerCard to .cod format, use it in the visual deck storage widget.
* Show filename instead of deckname if deck name is empty.
* Lint.
* Don't delint cmake list through hooks.
* Add deck loading functionality.
* Open Decks on double click, not single click.
* Void event for now.
* Fix build issue with overload?
* Fix build issue with overload?
* Include QDebug.
* Turn the tab into a widget.
* Move the signals down to the widget, move the connections and slots up to the parent widgets.
* No banner card equals an empty CardInfoPtr.
* Add an option to sort by filename or last modified.
* Flip last modified comparison.
* Lint.
* Don't open decks twice in the storage tab.
* Fix unload deck not working by showing/hiding widgets instead of adding/removing to layout.
* Add a search bar.
* Add a card size slider.
* Lint.
* Lint.
* Lint.
* Fix settings mocks.
* No need to QDebug.
* No need to QDebug.
* Member variable.
* Member variable.
* Non-lambda.
* Change set to list conversion.
* Specify overload.
* Include MouseEvent
* Adjust font size dynamically.
* Add an option to show the visual deck storage on database load.
* Fix the close button not working on the tab, add an option to launch the visual deck storage tab to Cockatrice menu.
* Override virtual functions.
* Correct tab text.
* Add a setting to remember last used sorting order for visual deck storage widget.
* Update banner card combo box correctly.
* Fix mocks.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: Zach H <zahalpern+github@gmail.com>
* Add a button to swap the card between mainboard and sideboard to the deck editor.
* Add new icon to cockatrice.qrc and force update.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* support multiselect in deck editor
* fix crash
* don't reset selection after each action
* maintain old reselecting behavior when changing cards from left side
* fix crash for real (probably)
* maintain reselection behavior when deleting single selection
* Update Dockerfile to non-outdated Ubuntu version
1. Updated image to jammy as it is still in it's LTS window. Didn't go with 24.04/Noble as it released after latest version of cockatrice released.
2. Had to add new ARG
3. No qt5-default library, so replaced with qt5-qmake
* Update Dockerfile
Upped from Jammy -> Noble
Upped from Qt5 -> Tt6
* Update Dockerfile - new port
Added Port 4748 for new features
* Update Dockerfile
Changed Noble - > 24.04
* indentation
* remove unused dependencies
---------
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
* refactor: clean up to use for-each loop
* track cards in rect so far and toggle isSelected on change
* only clear selection if ctrl isn't held
* fix build errors
* add "open recent" menu option to deck editor tab
* change texts
* also get it to work with loading from deck storage tab
* add error message when fail to open
* only update recents on successful open
* only update recents on successful open
* reword to "Clear"
4% of minimum 3% translated source file: 'oracle_en@source.ts'
on 'en@pirate'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
19% of minimum 3% translated source file: 'i18n-default.json'
on 'nl'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
99% of minimum 3% translated source file: 'i18n-default.json'
on 'es'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
13% of minimum 3% translated source file: 'i18n-default.json'
on 'fi'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* Translate oracle_en@source.ts in tr [Manual Sync]
36% of minimum 3% translated source file: 'oracle_en@source.ts'
on 'tr'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate cockatrice_en@source.ts in tr [Manual Sync]
6% of minimum 3% translated source file: 'cockatrice_en@source.ts'
on 'tr'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
---------
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
99% of minimum 3% translated source file: 'i18n-default.json'
on 'fr'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
14% of minimum 3% translated source file: 'i18n-default.json'
on 'ru'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* Translate cockatrice_en@source.ts in it [Manual Sync]
99% of minimum 3% translated source file: 'cockatrice_en@source.ts'
on 'it'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate i18n-default.json in it [Manual Sync]
100% translated source file: 'i18n-default.json'
on 'it'.
---------
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
3% of minimum 3% translated source file: 'oracle_en@source.ts'
on 'cs'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* Fix the image shrinking due to repeated scaling and FP precision loss.
* Add a setting for auto-rotating sideways layout cards.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Support C++20 Standard
* Update peglib.h
* Fix lambdas
* Move from for loops to std::any/all_of
* Support fixed CFG
* Fix Rarity Search to be more accurate
* Have the server respect gameType info when setting up zones.
* ServerPlayer::setupZones is now passed the room->getGameTypes();
* ServerPlayer::setupZones now checks if the GameType String includes "Commander" and then sets the life total to 40 instead.
* Formatting.
* Remove debug logging imports.
* Move game option value declarations to dlg_create_game.
* Lint.
* Fix mocks.
* Add a default for backwards compatibility.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Squashed Commits
Lint things.
Set focus back to deckView after selecting a card to enable keyboard navigation.
Bump scrollbar to top when selecting a new card.
Update card info on hover.
Layout cleanups
Add +- to buttons.
Merge buttons into card picture.
Cleanup size, min 2 cards by default in rows
Support layout settings config and set min to 525 so two cols are visible by default for printings, when opened
Move Printing Selector to before Deck, and visible true
Null safety for setCard.
Turn down the dropshadow a little.
Make PrintingSelector dockable, don't duplicate sets when bumping them to the front of the list.
When swapping cards between mainboard and sideboard, use preferred printing if no uuid is available (i.e. null).
Reorder includes...
Unwonk an include.
Give the card widget a snazzy drop shadow, appease the linter gods.
Handle jumping between segments
Remember scale factor when initializing new widgets.
Cleanup
Select Card works (Not M->SB tho)
Resize word-wrapped label properly.
Fix the layouting, mostly.
remove tx
Build Fix
Squashed Commits
Load and store redirects properly.
Layouting is fun :)
* Group PrintingSelectorCardDisplayWidgets into distinct containers for alignment purposes.
Override resizeEvent() properly.
Word wrap properly.
Keep widget sizes uniform for aesthetic reasons (grid pattern).
Label stuff, center card picture widget, allow cardSizeSlider to scale down.
Replace cards which have no uuid in the decklist when first selecting a printing.
Add buttons for previous and next card in DeckList.
Add a card size slider.
Move sort options initialization to implementation file.
Explicitly nullptr the parent for the PrintingSelector.
Address PR comments (minor cleanups).
Hook up to the rows removed signal to update card counts properly.
Include QDebug.
Add labels to the mainboard/sideboard button boxes.
Implement a search bar.
Expand node recursively when we add a new card.
Only create image widgets for the printing selector if it is visible in order to not slow down image loading.
Minor Tweaks
Invert decklist export logic to write out setName, collectorNumber, providerId value if it is NOT empty.
Linting.
Update CardCounts properly, update PrintingSelector on Database selection.
Initialize sideboard card count label properly.
Split mainboard/sideboard display and increment/decrement buttons.
Add button to sort all sortOptions by ascending or descending order.
Add option to sort by release date in ascending or descending order.
Add PrintingSelector to database view.
Display placeholder image before loading.
Fix deckEditor crash on mainboard/sideboard swap by correcting column index to providerId instead of shortName.
Include currentZoneName, fix the column when updating from DeckView indexChanged to be UUID and not setShortName so cards are properly fetched again.
The most minor linter change you've ever seen.
Null checks are important.
Linter again.
Linter and refactor to providerId.
Sort properly, (We don't need a map, we need a list, a map won't be ordered right [i.e. 1, 10, 11, 2, 3, 4, ..., 9])
Sort alphabetically or by preference.
Hook printingSelector up to the CardInfoFrameWidget.
Allow info from CardFrame to be retrieved, properly initialize PrintingSelector again.
Refactors to reflect CardInfoPicture becoming CardInfoPictureWidget.
Make PrintingSelector re-usable by introducing setCard().
Make PrintingSelector use the CardFrame, not the database index.
Add a new selector widget for printings.
* Support multiple <set> tags per card within the database
This will allow us to show off all different printings for cards that might appear multiple times in a set (alt arts, Secret Lairs, etc.)
* Support Flip Cards with related art
* Minor Cleanup
* Minor Cleanup
* Release Date DESC default
* Load widgets in batches.
* Refactor local batch variables to be class variables/defines.
* Clear timer on updateDisplay.
* Fix Timer & Builds on Qt5
* Not Override
* Yes Override
* Yes Override
* Lint
* Can't override in function definition.
* Resize setName to picture width on initialization.
Also add a new signal to card_info_picture_widget to emit when the scale factor changes.
Hook this up to the setName resizing method to ensure card size updates trigger it appropriately after initialization.
Clean up unused enter and resize methods that just delegated to base-class.
* Add ability to force preferred set art to be loaded for every card.
* Show related cards from printing selector by right-clicking card image.
* fix build
* Fix UST cards
* Inc QDebug
* Fix Qt5 Builds
* Fix Qt5 Builds
* Fix Qt5 Builds
* Fix Qt5 Builds
* Fix Qt5 Builds
* Fix cards being able to jump between side and mainboard
* Don't hide PrintingSelector button widgets if the deck contains a card from the set.
* Update PrintingSelector properly on DeckListModel::dataChanged
* Add option to disable bumping sets to the front of the list if the deck contains cards from the set.
* Linter behave.
* Linter behave.
* Fix mocks.
* Fix cards without providerIds being counted for all cards.
* Flip preference sort so descending means "Most to least preferred".
* Set the index correctly when removing a non-providerId printing for a providerId printing to avoid jumping to the next card.
* Move the "Next/Previous" card buttons to their own widget.
* Move the card size slider to its own widget.
* Lint the makelist.
* Linter
* Crash fix
* Move the sorting options to their own widget.
* Move the search bar to its own widget.
* Minor cleanup
* Minor cleanup
* Minor cleanup
* Only overwrite card in deck if UUID _and_ Number missing
* Adjust font size when adjusting card size.
* Clean up some imports.
* Pivot to a view options toolbar.
* Persist sort options and change default to 'preference'.
* Lint.
* Remember how many cards were originally in deck when replacing with uuid version.
* Relabel buttons for clarity.
* Fix tests.
* Fix tests properly.
* Fix dbconverter mock.
* Try to wrangle font sizes.
* Update mainboard/sideboard labels correctly.
* Initialize button sizes correctly.
* Label texts are supposed to be white.
* Adjust another deckModel->findCard call to include number parameter.
* Style buttons again.
* Negative currentSize means we don't render the widget yet, return a default value.
* Clean up debug statements.
* Boop the mainboard/sideboard label and the cardCount after a little bit of delay to make sure they initialize at the right size.
* Persist card size slider selection in SettingsCache.
* Good Lint Inc.
* updateCardCount to get white color in initializer
* Make the view display options functional.
* Comment ALL the things.
* Lint the things.
* Brief accidentally nuked some constants.
* Proper Qt slot for checkboxes.
* Don't use timers, Qt provides ShowEvent for anything necessary before the widget is shown.
* Cleanup from Reading
* Cleanup Lints
* Minor
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: Zach Halpern <zahalpern+github@gmail.com>
* play action now applies to all selected cards
* check card zone before applying action
* fix bug with wonky play from deck
* refactor
* don't play card if it's already on table
* add new setting
* make actPlay and friends public
* implement thing
* refactor card_item
* add attach and draw arrow actions to more card menus
* implement attaching from other zones
* disallow attaching from deck
* do nothing if target is already attached
* add null check
* rip shortcut for aDrawArrow
* implement thing
* add separator below hide
* shorten text by 1 word
* move shortcut to under Playing_Area
* rebind draw arrow shortcut to Alt+A
* remove auto hotkey
* shorten to "Select All"
* add back auto-hotkey
* hide action now applies to all selected cards
* check card zone before applying action
so that we don't nuke cards from existence when we select across multiple zones
* small fixes
* remove redundant loop
* nullcheck view
* update settingsCache
* implement thing
* add new setting to window
* rename setting
* make it compile on qt5
* fix typo
* somehow changing the order here fixes a bug?
The loaded value was getting clamped to 99
* feat: prefer 'Core' and 'Expansion' sets for prioritization
* rework set prioritization
* clean up priority enum
* formatting
* revert changes to CockatriceXml3Parser
* re-add missing null check
* remove priority fallback ternary from CardSet model
* make defaultSort logic easier to follow
* revert changes to v3 card database xsd
* remove unused invisible priority col from sets dialog
* move draft innovation and duel deck sets to secondary prio
* minor fixes
* change PriorityFallback to 1
* make priority optional in xml
* remove PriorityUndefined and set PriorityFallback to 0
* set priority when not found to PriorityOther
in case a new set type is added it's unlikey we want it sorted first,
it'll probably be a new product so it's probably best to sort it with
the funny things
* simplify sort function
---------
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
* fix QComboBox creation order in retranslateUi
* move bottom row creation closer to where it's used
* rename QGraphicsLinearLayout variables
hFilterbox and hPilebox don't make much sense now
* add comment about #5204
- References seem to go to 0 in newer Qt versions(?)
https://doc.qt.io/qt-6/qtime.html
> QTime objects should be passed by value rather than by reference to const; they simply package int.
- QLabel sizes weren't taken into account until the widget is rendered
- Long QLabels can cause exacerbated issues
- Force refresh after 1ms to take QLabels into account
* refactor to allow for sorting by property of choice
* implement thing
* prevent overlapping sort properties
* enable/disable pile view checkbox if groupBy is off
* fix compiler warnings
* check to disable pile view checkbox on init
* Fix builds on Qt5
* Fix builds on Qt5
---------
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
* leave some documentation on Zone classes
* small refactor
* undo functional change from refactor and clean up comments
* move variables into if block
`QObject::connect: No such slot UserInterfaceSettingsPage::setNotificationEnabled(Qt::CheckState) in /Users/Ricky/GitHub/Cockatrice/cockatrice/src/dialogs/dlg_settings.cpp:448`
* Cache redirects properly by implementing our own QSettings cache for urls.
* Load and store redirects properly.
* Set the maximum network cache size from settings value on PictureLoaderWorker instantiation.
* Address comments.
* Lint.
* Adjust debug statements to be in line with existing ones.
* Minor Tweaks
* Make redirect cache ttl a user-adjustable setting.
* Fix Build
* Minor Cleanup
* Minor Cleanup
* Build Fix
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
* refactor to use confirmOpen
* implement extra button in confirmation
* use brackets in one-liner if statements
* refactor save confirmation window into function
* Refactor CardInfo Widgets to reside in their appropriate folder and to have a clearer naming structure.
* Added Zach's work on storing printing information in the DeckList (#1)
* Change CardInfo's PixmapCacheKey to be the UUID of the preferred set after database loading has finished. Otherwise, and if no UUID of a preferred set is available, default to the card name.
* Refactor CardDatabase *db global variable to singleton CardDatabaseManager.
This commit refactors the global variable CardDatabase *db into a singleton encapsulated by the DatabaseManager class, accessible via DatabaseManager::getInstance(). This change centralizes access to the database instance, improving code modularity and encapsulation, resolving dependencies on main.h for code that requires access to the database instance.
- Added DatabaseManager class with getInstance() method returning a pointer to the singleton CardDatabase.
- Removed global db variable and updated references across the codebase.
- Thread-safe static initialization for the singleton.
Impact: This refactor should have no functional impact on the application, as it maintains the same interface for accessing the CardDatabase instance. However, the codebase now benefits from improved encapsulation, lifetime management, and thread-safety.
* fixed db issue an renamed sets to set in picture loader
* canibalized zach work and added it to the decklist builder
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Reintroduce some changes lost in the merge.
* Introduce UUID attribute to abstract_card_item, card_item, deck_view_card, server_card and serverinfo_card.
* Have various game events respect the new UUID attribute on instantiation.
* Correct some calls to default to preferred printing.
* DeckList now tries to assign reasonable defaults for UUID and collectorNumber if none are found in loaded DeckLists.
Rename overloaded DeckListModel findChild() function to findCardChildByNameAndUUID() for clarity.
* canibalized zach work and added it to the decklist builder
* Change getPreferredPrintingForCard to getPreferredSetForCard to reflect refactor.
* Properly update and set the DeckEditor's CardFrame to fetch by name and UUID if a card was selected from the decklist.
* Mainboard/Sideboard swaps should respect the UUID from the old zone instead of just blindly adding preferredPrinting.
* If the card info is null, there's no point in trying to look for the sets.
* Don't define methods twice.
* Convenience method to fetch a specific CardInfoPerSet instance for a cardName and a UUID.
* Check if the uuid starts with card_ when comparing.
* Address pull request comments (nullptr checks and additional comments, mostly.)
* Reformat code so the linter will stop yelling at me.
* DeckList no longer pre-populates uuids.
* Update Event_MoveCard to include the card UUID.
* Update Player::MoveCard to include the card UUID.
* Set the uuid when we set the cardName, in terms of hidden zones.
* [TEST/RevertMe] Set the uuid everywhere to test.
* Don't inline setUUID and mimic setName for AbstractCardItem.
* Revert blindly setting uuid for testing.
* Address PR comments (AbstractCardItem).
* Combine if-statement.
* Re-order uuid to visually align with its field number.
* Remove unnecessary new uuid field from event_move_card.
* Remove unused imports.
* Include cardName in the PixmapCacheKey in order to not break double-faced cards.
* Refactor setCode to cardUUID and introduce new cardSetShortName field.
* Override
* Refactor UUID to be providerId and change QString comparisons with empty string to isEmpty().
* Update translations.
* Change parent to be the first argument.
* Pull Parent argument up for CardItem.
* Pull Parent argument up for CardItem.
* Linter.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: LunaticCat <39006478+LunyaticCat@users.noreply.github.com>
Co-authored-by: luna <yannbrun1507@outlook.fr>
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
* Add FlowWidget class with flexible layout and scroll handling
- Implemented FlowWidget class to organize widgets in a flow layout with scrollable options.
- Integrated QScrollArea to handle overflow with configurable horizontal and vertical scroll policies.
- Incorporated dynamic layout selection (FlowLayout, HorizontalFlowLayout, VerticalFlowLayout) based on scroll policy.
* Add OverlapWidget and OverlapLayout for managing overlapping child widgets
- Implemented the OverlapWidget class to manage child widgets in an overlapping manner, supporting configurable overlap percentage, maximum columns, maximum rows, and layout direction.
- Introduced the OverlapLayout class, which arranges widgets with overlapping positions, allowing flexible stacking based on specified parameters.
* Add OverlapControlWidget.
* Delete FlowLayout items later to allow them to finish their event loop.
* Allow OverlapWidgets to adjust their rows/columns on resize.
* Clamp vertical FlowLayout to any available parent scrollAreas.
* Implement margins and spacing for FlowLayouts.
* Adjust/revert some things.
* Address pull request comments (nullptr checks and additional comments, mostly.)
* Reformat code so the linter will stop yelling at me.
* Remove undefined methods from FlowLayouts.
* Fix the build.
* Revert FlowLayout::takeAt to index check.
* Commits will continue until linter morale improves.
* Fix various warnings in FlowLayout.
* Fix various warnings in FlowLayout.h.
* Fix various warnings in the FlowLayout classes.
* Fix [[nodiscard]] warning.
* Fix more warnings.
* Final round of yellow squiggle fixing.
* Linter formatting.
* Refactor column/row calculation to be more readable.
* Code style.
* Address PR comments.
* Combine if-statements.
* Replace std::math functions with Qt equivalents.
* Fix non-consts and QtMath.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Refactor CardInfo Widgets to reside in their appropriate folder and to have a clearer naming structure.
* Add optional HoverToZoom functionality to CardInfoPictureWidget (default: disabled) and utility class to display text over a CardInfoPictureWidget.
* Patch CardInfoWidgets to use the new CardDatabaseManager.
* Add HoverToZoom to CardInfoPictureWithTextOverlayWidget
* Refactors and new signals for CardInfoPictureWidgets.
* Address pull request comments (nullptr checks and additional comments, mostly.)
* Reformat code so the linter will stop yelling at me.
* Linting.
* Fix the build.
* Fix warnings.
* Formatting, const qualifiers.
* Sensibly call the base class's (QWidget) paint event.
* Address PR comments (card picture).
* QT Version check because enterEvent signature changed.
* Linting.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Change CardInfo's PixmapCacheKey to be the UUID of the preferred set after database loading has finished. Otherwise, and if no UUID of a preferred set is available, default to the card name.
* Clean up some variable names, clarify preferred Set insertion for PictureLoader, use the new CardDatabaseManager.
* Code formatting.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* [4191] fix: Move unfocusTextBox and aFocusChat shortcuts to Player family
* [4191] fix: fix formatting
* Revert "[4191] fix: fix formatting"
This reverts commit 86a4a675f3bc8118d4ba8dd45f408c4e8c348f33.
* Revert "[4191] fix: Move unfocusTextBox and aFocusChat shortcuts to Player family"
This reverts commit 3ec183628df81c48123a8a248d0416c529ee0c8e.
* [4191] fix: Textbox and tab_game shortcut groups cannot conflict with Player group
* Revert "[4191] fix: Textbox and tab_game shortcut groups cannot conflict with Player group"
This reverts commit 36800393339d997df1a932bb798f95d2d387399a.
* [4191] fix: Move unfocusTextBox and aFocusChat shortcuts to Player family
* [4191] fix: Migrate shortcuts if new version is detected
* [4191] fix: formatting
* [4191] fix: Maybe fix build issue on Windows7, Debian11, UbuntuBionic and UbuntuFocal
* Refactor CardDatabase *db global variable to singleton CardDatabaseManager.
This commit refactors the global variable CardDatabase *db into a singleton encapsulated by the DatabaseManager class, accessible via DatabaseManager::getInstance(). This change centralizes access to the database instance, improving code modularity and encapsulation, resolving dependencies on main.h for code that requires access to the database instance.
- Added DatabaseManager class with getInstance() method returning a pointer to the singleton CardDatabase.
- Removed global db variable and updated references across the codebase.
- Thread-safe static initialization for the singleton.
Impact: This refactor should have no functional impact on the application, as it maintains the same interface for accessing the CardDatabase instance. However, the codebase now benefits from improved encapsulation, lifetime management, and thread-safety.
* Refactor CardDatabase *db global variable to singleton CardDatabaseManager.
This commit refactors the global variable CardDatabase *db into a singleton encapsulated by the DatabaseManager class, accessible via DatabaseManager::getInstance(). This change centralizes access to the database instance, improving code modularity and encapsulation, resolving dependencies on main.h for code that requires access to the database instance.
- Added DatabaseManager class with getInstance() method returning a pointer to the singleton CardDatabase.
- Removed global db variable and updated references across the codebase.
- Thread-safe static initialization for the singleton.
Impact: This refactor should have no functional impact on the application, as it maintains the same interface for accessing the CardDatabase instance. However, the codebase now benefits from improved encapsulation, lifetime management, and thread-safety.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* split event processing to own method
* implement rewind throttling
* don't throttle backward skips from clicks
* use the term 'buffering' instead
* remove initial backup logic; just always buffer shortcut backward skips
* prevent segfault
* turns out you can just reuse the same one-shot timer
* try scaling timeout based on event count
* rewrite timeout calculation code
* fix linker error
* fix bug with incorrectly highlighted phases
* fix new bug with phases continuously darkening
* use preincrement instead of postincrement
* simplify conditional
it will emit in loadCardDatabases(), mirroring the else branch where cardDatabaseLoadingFailed() is emitted.
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* split skipToTime into own function
* implement shortcut
* fix shortcut warning bug
* check boundary conditions in skipToTime
* change default fast forward shortcut to .
* implement big skip shortcuts
* remove unnecessary arg in lambda
* change default fast forward shortcut to Ctrl+F
* rename constants
* change default fast forward shortcut to Ctrl+P
* use static const
* refactored cardzone.cpp, added doc and changed if to switch case
* started moving every files into different folders
* remove undercase to match with other files naming convention
* refactored dialog files
* ran format.sh
* refactored client/tabs folder
* refactored client/tabs folder
* refactored client/tabs folder
* refactored client folder
* refactored carddbparser
* refactored dialogs
* Create sonar-project.properties
temporary file for lint
* Create build.yml
temporary file for lint
* removed all files from root directory
* removed all files from root directory
* added current branch to workflow
* fixed most broken import
* fixed issues while renaming files
* fixed oracle importer
* fixed dbconverter
* updated translations
* made sub-folders for client
* removed linter
* removed linter folder
* fixed oracle import
* revert card_zone documentation
* renamed db parser files name and deck_view imports
* fixed dlg file issue
* ran format file and fixed test file
* fixed carddb test files
* moved player folder in game
* updated translations and format files
* fixed peglib import
* format cmake files
* removing vcpkg to try to add it back later
* tried fixing vcpkg file
* renamed filter to filters and moved database parser to cards folder
* reverted translation files
* reverted oracle translated
* Update cockatrice/src/dialogs/dlg_register.cpp
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
* Update cockatrice/src/client/ui/window_main.cpp
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
* removed empty line at file start
* removed useless include from tab_supervisor.cpp
* refactored cardzone.cpp, added doc and changed if to switch case
* started moving every files into different folders
* remove undercase to match with other files naming convention
* refactored dialog files
* ran format.sh
* refactored client/tabs folder
* refactored client folder
* refactored carddbparser
* refactored dialogs
* removed all files from root directory
* Create sonar-project.properties
temporary file for lint
* Create build.yml
temporary file for lint
* added current branch to workflow
* fixed most broken import
* fixed issues while renaming files
* fixed oracle importer
* fixed dbconverter
* updated translations
* made sub-folders for client
* removed linter
* removed linter folder
* fixed oracle import
* revert card_zone documentation
* renamed db parser files name and deck_view imports
* fixed dlg file issue
* ran format file and fixed test file
* fixed carddb test files
* moved player folder in game
* updated translations and format files
* fixed peglib import
* reverted translation files
* format cmake files
* removing vcpkg to try to add it back later
* tried fixing vcpkg file
* pre-updating of cockatrice changes
* removed empty line at file start
* reverted oracle translated
* Update cockatrice/src/dialogs/dlg_register.cpp
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
* Update cockatrice/src/client/ui/window_main.cpp
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
* removed useless include from tab_supervisor.cpp
---------
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
* #3945 deck list: Navigation keys (PageUp/Down, Home/End) interact with the deck list.
* make Home/End work normally when there is text in the search textbox
* fix debug build, explicit cast from int to Qt::Key enum
* Improve drag & drop behavior
This patch tweaks the drag & drop behavior (in particular, the grid
placement) to be more intuitive. More precisely, with this patch the
drag & drop will:
- Only use the "hot spot" (i.e. position of the cursor on the card)
for zones where the card is actually displayed around the cursor (in
particular, not on the table where the card snaps to the grid).
- Use better boundaries computed with respect to the center of the
card (rather than its top left corner) for determining which grid
cell a card should go to
- Align behavior of the preview and the actual effect when overflow of
the 3-card stacks occurs
- Avoid visual glitches where the cursor ends up outside of the card or
at incorrect offsets when moving the mouse too fast (which translates
to overflows of the hot spot computation)
* Address review comments
- Use simpler computation for restricting hotSpot range
- Prevent dropping cards onto full 3-card slots
* make cards on the stack slightly overlap to stress order
dragging cards to the stack now places the card at the location it is
dropped
* make default play action append to stack
* add vertical overlap to settings and vertical hand
* Update cockatrice/src/dlg_settings.cpp
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
* Fix format
---------
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
* simplify ci after 64bit only
* hint on macos 10.15 with qt6.2
* Update desktop-build.yml
* Update desktop-build.yml
* update xcode
* 14.3 finds 14.3.1, but 14.0 doesn't find 14.0.1
* Update desktop-build.yml
98% of minimum 80% translated source file: 'cockatrice_en@source.ts'
on 'en_US'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* Translate i18n-default.json in es [Manual Sync]
99% of minimum 80% translated source file: 'i18n-default.json'
on 'es'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate cockatrice_en@source.ts in es [Manual Sync]
98% of minimum 80% translated source file: 'cockatrice_en@source.ts'
on 'es'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate i18n-default.json in es [Manual Sync]
99% of minimum 95% translated source file: 'i18n-default.json'
on 'es'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate cockatrice_en@source.ts in es [Manual Sync]
98% of minimum 95% translated source file: 'cockatrice_en@source.ts'
on 'es'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
---------
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* Translate i18n-default.json in it [Manual Sync]
99% of minimum 80% translated source file: 'i18n-default.json'
on 'it'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate cockatrice_en@source.ts in it [Manual Sync]
98% of minimum 80% translated source file: 'cockatrice_en@source.ts'
on 'it'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate i18n-default.json in it [Manual Sync]
99% of minimum 95% translated source file: 'i18n-default.json'
on 'it'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
---------
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* Translate cockatrice_en@source.ts in fr [Manual Sync]
98% of minimum 80% translated source file: 'cockatrice_en@source.ts'
on 'fr'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate i18n-default.json in fr [Manual Sync]
99% of minimum 80% translated source file: 'i18n-default.json'
on 'fr'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate i18n-default.json in fr [Manual Sync]
99% of minimum 95% translated source file: 'i18n-default.json'
on 'fr'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
---------
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* Translate cockatrice_en@source.ts in pt_BR [Manual Sync]
98% of minimum 80% translated source file: 'cockatrice_en@source.ts'
on 'pt_BR'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate webclient/src/i18n-default.json in pt_BR
100% translated source file: 'webclient/src/i18n-default.json'
on 'pt_BR'.
---------
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* add more default shortcuts
replace the ctrl a look at top of library shortcut with ctrl shift n
use ctl a for draw arrow
replace ctrl shift b for toggle sideboard lock
use ctrl b for move card to bottom of library
use ctrl shift l for start local game
add keyboard shortcuts for all 3 counter colors using , . / keys
use ctrl [ ] \ for the "other" counter
add ctrl = as an easy alternative to ctrl + for people without keypads
( on linux ctrl alt keypad + is a special key that is reserved in x
it produces the XF86_Next_VMode keyboard event which isn't bindable )
use alt u for toggling untapping
use alt l for peeking at cards
use ctrl alt u for unattaching cards
use alt n for set annotation
use alt y for milling one card
* use alt f for flipping cards
a bit of a hack, the client will use the play top card action and then
compare it with the propmpted expression, as if you were cascading
normally but really fast
the new keybind for this is ctrl shift y
I have ratelimited the action to 10 cards a second
100% translated for the source file 'cockatrice/cockatrice_en@source.ts'
on the 'pt_BR' language.
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
100% translated for the source file 'webclient/src/i18n-default.json'
on the 'pt_BR' language.
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* Set some CPack variables
WIP for DMG background image
* Use a .tif for background
* Add Background image and DS_Store script
Script is from https://www.kitware.com//creating-mac-os-x-packages-with-cmake/ with cmake.app changed to cockatrice.app
* Add position for all icons
* Adjust background size and icon position
This draws dbconverter off the screen as a hack to hide it, so hopefully it doesn't break.
* Add files via upload
* Change Icon Position
Icon position is probably relative to the window edge, not the edge of the screen so the numbers should be lower.
* Adjust Icon Position and Window Boundaries
Applescript seems to use the center of the icon rather than the left corner so the coordinates need to be adjusted by 64 px.
The finder window counts the 22 px of the title bar in the window size so 22 must be added to the fourth coord of position to fit the entire image.
* Fix spelling of Servatrice
* Satifsfy Code Style
* Use vector format (eps)
* Delete background.tif
* Use vector format (eps)
* Use the right file extention in the script
* Point to svg
* Use svg
* Add svg for background image
* Delete background.eps
* Use plain SVG, adjust text
* Move applescript to /cmake
* Move background to /cmake
* Point CPack to /cmake
background and applescript now reside there
* Revert to .tif
* Use compressed .tif
* Use more specific file name
* Script expects .background:background.tif
* Create Lunar Dockerfile
Note that qt6-svg-dev and qt6-websockets-dev are renamed replacements for libqt6svg6-dev and libqt6websockets6-dev, respectively.
* Add Ubuntu Lunar
* Add Ubuntu Lunar to Template
translation completed for the source file '/webclient/src/i18n-default.json'
on the 'es' language.
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* Make cards rounded
Magic cards have rounded corners, and playing cards tend to have rounded
corners as well, but Cockatrice currently displays rectangular cards.
This can cause visual glitches when using image scans where the border
does not extend in the corner, and for this reason Cockatrice always
draws a (rectangular) border around the card to try and make it look a
bit better.
In this patch I take a different approach: rather than try to make
rounded pegs, er, cards, go into a square hole, the hole is now rounded.
More precisely, the AbstractCardItem now has a rounded rectangular shape
(with a corner of 5% of the width of the card, identical to that of
modern M:TG physical cards).
As a side effect, the card drawing gets a bit simplified by getting rid
of transformPainter() when drawing the card outline and using the
QPainter::drawPixmap overloads that takes a target QRectF instead. This
means we no longer have to bother about card rotation when painting
since that's taken care of by the Graphics View framework (which
transformPainter() undoes).
* format
* Also give PileZone rounded corners
* Forgot untap status + bits of CardDragItem
* fix deckviewcard calculations
* Rounded CardInfoPicture
* PictureLoader: Replace downloadedPics cache with QNetworkCache
Currently when the "Download card pictures on the fly" option is
enabled, Cockatrice stores downloaded pictures into a downloadedPics
sub-folder, keyed on set and card name. If a picture is found in that
folder, we never try to download a picture for that card ever again
(until it is reprinted in a more recent set, I guess).
This has the unfortunate consequence that if you change the URLs for
downloading card images, the changes are not applied to cards that
already have their picture downloaded. In particular, if you use
localized card pictures (through !sflang!), you get a mix of cards in
different languages depending on the currently configured language at
the time each card was downloaded.
This patch removes that mechanism in favor of setting a
QNetworkDiskCache on the QNetworkAccessManager used by the PictureLoader
to download pictures. The QNetworkDiskCache caches the picture keyed on
their URL: if the URL changes, a new request will be made. In
particular, if you use picture URLs with !sflang! and change the
language, pictures for the current language will be downloaded even for
cards that already have a picture. The QNetworkDiskCache is configured
with a maximum size of 4GB, which should be enough to hold one
high-quality JPEG for each M:TG card in existence.
Note that this does not affect the existing mechanism for defining
custom card art, either through the CUSTOM directory or the set-based
one. Cockatrice will still read existing cards in the downloadedPics
directory as before, it will just no longer write into that directory
(since pictures are cached by the QNetworkDiskCache instead). To fully
switch to the new cache, users should use the "Delete Downloaded Images"
button in the settings: it will clear the QNetworkDiskCache but also
remove the downloadedPics directory.
* Do not use system cache dir for portable installs
* Add settings for network cache size
* Delete corrupted cache entries
* Use old-style connect() syntax (Qt5 build failure)
* Add setNetworkCacheSizeInMB to test mocks
* setTransferTimeout was added in Qt 5.15
* Improve logging messages
We now have the following messages
- "Trying to download picture from url: URL" before loading a picture
when picture download is enabled
- "Trying to load picture from cache: URL" before loading a picture
when picture download is disabled (i.e. cache-only offline mode)
- "Removing corrupted cache file for url URL and retrying (ERR)" when
when we fail to load a picture from the cache. Usually, this should
be due to the timeout, in which case ERR will be "Operation
Canceled".
- "Download failed for url URL (ERR)" when there was an error
downloading a picture from the network (ERR is the error message)
- "Following redirect to URL" and "Following cached redirect to URL"
when following a redirect (from network/from cache)
- "Image successfully downloaded from URL" and "Image successfully
loaded from cached url at URL" on success
- "Possible cached/downloaded picture at URL could not be loaded" on
ImageReader error
* Clarify that network cache is on disk
Also migrate "Delete Downloaded Image" to a "Clear" button right next to
the network cache size.
* Remove qPrintable
* Move pixmap cache settings to card sources
* qDebug().nospace()
* some formatting on debug messages
* format
* inverted condition
---------
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
* Better support Double-Faced Cards
This patch allows cards to be (virtually) transformed into other cards
while preserving their state, essentially implemeting the MTG mechanic
of the same name.
On the server side, this is implemented by allowing cards to be "stashed
away". A card that is stashed away is not in any zone, but is instead
owned by another card. When a token is destroyed due to a zone change,
if it had a card stashed away, that card is placed in the target zone
instead of the token.
On the database side, `attach="transform"` is used on `<reverse>` and
`<reverse-related>` to indicate that the created token should be
transformed this way.
Old servers ignore the new field in `Command_CreateToken` and will
perform a regular attachment, as currently.
* Address review comments
* Prevent tokens from being stashed
* format.sh
* Replaced "e:lea,leb" with "e:lea or e:leb"
* Removed "e:lea,leb -(e:lea e:leb) (Cards that appear in Alpha or Beta but not in both editions)" as this does not produce results in Cockatrice (even when using "or" instead of "," as above)
In b282df2e27 (#4728) the logic for
creating <pt> values was updated to avoid adding a final slash after an
existing power value and missing toughness value. This works by setting
the ptSeparator to an empty string when either the power or the
toughness is undefined. However, due to the ptSeparator variable being
scoped out of the `for` loop, this causes all remaining cards to have an
empty string as a separator, ending up with <pt> values of e.g. 21
instead of 2/1.
Moreover, the implementation from #4728 is ambiguous in the case of a
card having a toughness value but no power value: in that situation, it
creates a <pt> entry with the toughness value and no separator, which is
not a good idea since it is not possible to know if <pt>2</pt> means
power 2 and no toughness, or no power and toughness 2 (Cockatrice takes
the first interpretation).
To avoid ambiguities, the <pt> value is now one of:
1. A regular P/T value when the card has power and toughness
2. A simplified P value when the card has power but no toughness
3. A simplified /T value when the card has toughness but no power
4. Absent when the card has neither power nor toughness
Note that, as far as I can tell, Cockatrice seems to (incorrectly, IMO)
ignore the initial slash if present in Player::parsePT, and treat /T as
a power value. However that is a separate issue: this patch is concerned
with Oracle and ensuring proper values in cards.xml, not with how
Cockatrice interprets those values.
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.
* Enable buttons for current game when receiving server response
Previously, upon joining a game, we were unconditionally re-enabling the
"Join" button in the lobby, even if it was not enabled in the first
place, causing #4698. This could also lead to issues where if the user
selects a different game after joining (which they can do in case of
e.g. network connectivity issues), the "Join as spectator" button could
get incorrectly disabled.
This fixes#4698 by re-enabling the buttons based on the state of the
currently selected game at the time the response is received. This also
avoids inconsistencies if a different game has been selected in between
joining and receiving a response from the server.
* Typo: enable gameButton in enableButtons
The "create game" button was incorrectly being disabled in enableButtons
whereas (as the name indicates) it should have been enabled
* Remove misleading comment about race conditions
* Fix#4706: Exit linting early if a card with the exact name is found first
* Remove ampersand conversion
* put back
* Update tests
* Format
* don't use qsizetype
---------
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
* macOS-10.15 environment is deprecated
Build for 10.14 has to be dropped.
Build for 10.15 can be preserved via 11.
* update xcode versions
* Xcode 13.0 doesn't work for us on Big Sur
* [skip ci] update list of binaries
translation completed updated for the source file '/webclient/src/i18n-default.json'
on the 'it' language.
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* Add URL Link to Explain Message Macros
* Add URL Link to Explain Message Macros
* Revert custom shortcuts wiki link
* Conform to formatting guidelines
translation completed for the source file '/cockatrice/cockatrice_en@source.ts'
on the 'it' language.
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* Move Join Message Block
- Moves Join Message code block to after the for loop that gets old chat message, which makes the Join Message the most recent message in the chat box instead of the oldest
-Only the rc.enqueuePostResponseItem() line really needs to move for functionality, but I have moved the whole block for readability
* Comply with formatting guide
-Remove offending white space
* remove dependency on deprecated qt5 libraries for qt6
removes the use of qt6-5compat for builds
replaces use of QRegExp with QRegularExpression
fixes incorrect usage of QRegExp
removes use of QTextCodec
fixes incorrect usage of QTextCodec
sets qtlinguist as a required component for qt6
* fix anchoredPattern not existing in qt 5.11
* save work
* fix perf issue on i18n rollup
* fix reset styling
* move body line-height from reset
Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
* When trying to join a game from GameSelector that's already been joined by you, navigate to its game tab.
* return immediately, do not change button states
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
* Logging a player drawing 0 cards will now result in the message "player had no cards left to draw."
* Added hint when drawing when deck is empty
* Added hint when drawing when deck is empty
* Added hint when drawing when deck is empty
* Update cockatrice/src/messagelogwidget.cpp
update log message to present tense
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
* added deckIsEmpty parameter to messagelogwidget::logDrawCards
* run format
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
translation completed for the source file '/oracle/oracle_en@source.ts'
on the 'it' language.
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
translation completed updated for the source file '/webclient/src/i18n-default.json'
on the 'fr' language.
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
this happened when viewing a replay with the "view replay" option in the
top menu, instead of using the replays tab while connected to a server.
this uses the local game player instead of the online one which does not
initialize the player info of the local spectating player, this causes a
crash when opening the context menu on another player in the replay from
one of their chat messages as it tries to check if you're a registered
user and could add them as a friend etc.
it now regards the uninitialized player info as an unregistered user and
will not show these options.
* fix crash when a cardmenu becomes an orphan
when a cardmenu is closed the cursor on that card reverts to the open
hand, this crashed the client when that card would be destroyed or moved
the act of reverting to the open hand now happens as an emitted signal,
this way it just doesn't exist anymore when the card is deleted.
* simplify fix
* Conjured xml attr
Add conjured attribute to related xml tags that makes those cards not be destroyed when they leave the battlefield.
* fix build errors, add sarkhan to test
* update oracle importer to support spellbooks from json
* debugging
* fix weird spacing
* fix oracle spacing too
* simplify if/else
Co-authored-by: Zach H <zahalpern+github@gmail.com>
* rename, remove oracle update
* remove extra linebreak
* run format.sh again
* fix keepalive being multiplied in server timeout
a timeout happened after the client not receiving anything for
keepalive * keepalive * maxtimeout (5 * 5 * 10) seconds instead of what
you'd expect, it now only uses keepalive once instead of twice this
means it should now take 50 seconds to time out when disconnected
* change timeout to 15 seconds instead
change time between pings to 3 from 5 seconds
change timout to 5 from 10 repeats
translation completed for the source file '/cockatrice/cockatrice_en@source.ts'
on the 'es' language.
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* merge clangify and cmakify into format.sh
update desktop lint workflow to 22.04
print cmake-format version as well
um, rename things?
add extra examples to format.sh --help
add option to not run clang-format
fix version display in .ci/lint_cpp.sh
fix relative paths in format.sh
fix formatting dirs
* run ./format.sh --cmake --branch ""
* revert formatting of cmake comments
* Update configuration path to be backwards compatible
Windows users have used AppData/Local/Cockatrice, whereas the new system was using AppData/Roaming/Cockatrice. This reverts the behavior in a Qt5/6 way.
* Prevent bad access potential for removals by checking bounds
Fix#4616
Switch to removeOne instead of bound checking removeAt
* Revert server cardzone check
Add lock around deleting arrows for commanding cards
Add support for Qt6 w/ Backwards Qt5
Handle Qt5/6 cross compilation better
Last cleanups
caps matter
Fix serv
Prevent crash on 6.3.0 Linux & bump to 5.8 min
Prevent out of bounds indexing
Delete shutdown timer if it exists
Fixup ticket comments, remove unneeded guards
Try to add support for missing OSes
Update .ci/release_template.md
Update PR based on comments
Update XML name after done and remove Hirsute
Address local game crash
Address comments from PR (again)
Tests don't work on mac, will see if a problem on other OSes
make soundengine more consistent across qt versions
disable tests on distros that are covered by others
Fix Oracle Crash due to bad memory access
Update Oracle to use new Qt6 way of adding translations
Add support for Qt5/Qt6 compiling of Cockatrice
Remove unneeded calls to QtMath/cmath/math.h
Update how we handle bitwise comparisons for enums with Tray Icon
Change header guards to not duplicate function
Leave comment & Fix Path for GHA Qt
Update common/server.h
Update cockatrice/src/window_main.cpp
Rollback change on cmake module path for NSIS
check docker image requirements
add size limit to ccache
put variables in quotes
properly set build type on mac
avoid names used in cmake
fix up cmake module path
cmake 3.10 does not recognize prepend
Support Tests in FindQtRuntime
set ccache size on non debug builds as well
immediately return when removing non existing client
handle incTxBytes with a signal instead
don't set common link libraries in cockatrice/CMakeLists.txt
add comments
set macos qt version to 6
Try upgrading XCode versions to latest they can be supported on
Ensure Qt gets linked
add tmate so i can see what's going on
Qt6 points two directories further down than Qt5 with regard to the top lib path, so we need to account for this
Establish Plugins directory for Qt6
Establish TLS plugins for Qt6 services
Minor change for release channel network manager
Let windows build in parallel cores
Wrong symbols
Qt6 patch up for signal
add missing qt6 package on deb builds
boolean expressions are hard
negative indexes should go to the end
Intentionally fail cache
move size checks to individual zone types
Hardcode libs needed for building on Windows, as the regex was annoying
Update wording
use the --parallel option in all builds
clean up the .ci scripts some more
tweak fedora build
add os parameter to compile.sh
I don't really like this but it seems the easiest way
I'd prefer if these types of quirks would live in the main configuration
file, the yml
fixup yml
readd appended cache key to vcpkg step
fix windows 32 quirk
the json hash is already added to the key as well
remove os parameter and clean up ci files
set name_build.sh to output relative paths
set backwards compatible version of xcode and qt on mac
set QTDIR for mac builds on qt5
has no effect for qt6
export BUILD_DIR to name_build.sh
merge mac build steps
merge homebrew steps, set package suffix
link qt5
remove brew link
set qtdir to qt5 only
compile.sh vars need to be empty not 0
fix sets manager search bar on qt 5.12/15
fix oracle subprocess errors being ignored on qt 5
clean up translation loading
move en@source translation file so it will not get included in packages
NOTE: this needs to be done at transifex as well!
Use generator platform over osname
Short circuit if not Win defined
* fix the uid and gid of the user in the container
this fixes this error:
unsafe repository ('/src' is owned by someone else)
this caused the hash to go missing in the version number
* add --interactive option to .ci/docker.sh
* add --dir to .ci/compile.sh
* fix up the comments on the ci scripts
* add extra comment to docker.sh
* i18n: login container and form
* i18n: activate, host, and register forms
* i18n: reset password forms
* i18n: login dialogs, ICU formatting
* i18n: login containers and components
Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
* update workflow to use windows 2022 image
* return the version of the run vcpkg action
the action has been changed to now use a vcpkg.json file instead of the
txt file we use now, we should try to find a way to update it to the new
workflow in case the current one becomes obsolete
* clean up a bit for consistency
* run ctest directly instead of relying on the makefile
* set -C flag for ctest
* set config option for cmake --build
this option is ignored for other platforms
* fix saved label, and fix using hashedPassword when Save is unchecked
* update host only after successful login
* cleanup
* fix ability to deselect saved password on successful login
* cleanup
* clear options after connection
* fix registration saved username
* cleanup
* change label
* fix tests
Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
* create .env file for server configuration
* render client version
* automate env file
* add prestart command
* create server-props.json instead of using .env
* automate master proto file
Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
* turn autocomplete off by default on inputs
* trim input fields onSubmit
* move trim to form submit
* cleanup
* remove dead code
* protect trim against null values
* make password optional on Login for servers that allow unregisted logins
* cleanup
Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
* support hashed passwords in register and resetPassword
* lint
* support hashedPasswords for accountActivation
* use salt in post-register login step
Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
* draft: handle firing an event once
* lint
* Prevent rapid double-click on sending messages
* no rest spread on single primative when sibling components exist
* clear message instead of using a fireOnce handler.
* fix tests
* remove unnecessary validate mock
* remove xcode string in file name
* alphabetical ordering + newest to the top
* remove not needed entries
* append -bit to name
* chronological
* spaces
* prevent stretched layout in settings
* restore layout of settings pages with already expanding elements
* Support full screen resolution and set a minimum that works well no matter the screen size
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
* protocol changes
* server changes
* client changes for password reset and registration
* add hashed password to change password in client
* always use hashed password to log in
* add warning to client when using plain text password
* require real password for changing email on server
this is backwards compatible as users logged in with a real password on
older clients will not need this, only users logged in with a hashed
password
* implement password dialog when changing email
* require min password length
* use qstringlist to build query instead
* use clear instead of = ""
* add max to password dialog
* use proper const ness in abstractclient
* reject too long passwords instead of trimming
the long type has different sizes across operating systems and should
not be used
in the timeline an overflow could occur if the width in pixels
multiplied by the total amount of milliseconds in the replay is larger
than 2^31 which is easy enough considering with only 500 pixels width
you'll reach this number with only 1.2 hours of replay (about 4 million
millis), note that this would be windows exclusive as *nix uses 64 bits
~~qt-json's own repo suggests using qt5's implementation instead, testing
revealed this is quite a bit faster, contrary to #3480~~ testing proved
this to not be compatible with older qt versions
servatrice uses the qthread usleep function which used to be protected
but is now public
cockatrice is not compatible with qt4 and hasn't been for a while
* implement max lengths for input dialogs that are sent to the server
* missed a double setMaxLength
* implement max string lengths server side
* add custom getText dialog with max length
* fix deck storage tab and miscellaneous server side
* add max size for deck uploads
* final pass on client side limits
* Address macOS issue where right-clicking a username in the main chat (or game chat) areas would pop up a seemingly empty user profile. This is because the resize event is overridden and doesn't actually attempt to resize based on the size hint of the dialog. Now that we're explicit with the call, this resize should be forced and have comparable results to popping up user profile from the user list.
* use datetime for calculating account age (#4526)
* use datetime for calculating account age
make translating easier by using tr multiples
automatically account for leap days
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
* Revert "Fixed layout on Deck Editor not using last layout. It was reseting layout on ctor. (#4420)"
This reverts commit 3bc90003b3.
* restart layout on fresh installs
* deprecate the gender property from the protocol entirely
* use obsolete instead of deprecated
* add the database migration
* update internal database version as well
* Support getting a user's password salt via initial websocket connection (added to Event_ServerIdentification)
* Nonsense stuff to figure out later
* move passwordhasher to correct location
* protobuf changes
* add ext to protobuf
* implement request password salt server side
* add supportspasswordhash to server identification
* check backwards compatibility
* reset some changes to master
* implement get password salt client side
* implement checking hashed passwords on server login
* check for registration requirement on getting password salt
* properly check password salt response and show errors
* remove unused property
* add password salt to list of response types
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
* Support password reset workflow. Also fix issue where a user would be disconnected "randomly" if they had a failed login, then successful one. Refactored a bit on Status Labels since they weren't really necessary and added complexity.
* Disconnect in default cases where we don't know what to do, but shouldn't stay connected to the server
* add ubuntu 21.10 to ci
remove ubuntu 20.10
* forgot to update dockerfile
* add googletest from repos
* update downloaded gtest
ideally this should just grab the master version
* fix hash
* fix cmake issue
* don't reset pt if there is nothing to reset
when the client resets the pt of a card it intentionally does not
include cards that already have the correct pt, this can lead to the
client sending an empty command to the server, which will be rejected
* clangify
* Support Registration on Webatrice with a baseline of handling. Still needs to support activation tokens & unit testing.
* Add support for account activation with token
* Activate Account refactor
* Fix typo
* Add Unit Testing for Commands/Events
* Changes based on review feedback
* add unit tests for websocket events
* add unit tests for KeepAliveService, clean up keepAlive termination flow
* put keepAlive command in protobuf service and expose thru webClient
* secure wss
* rename files tsx to ts
* add localhost support for ws/wss connection
Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
* put socket.updateHistory behind SessionCommand
* rename /websocket files from .tsx to .ts
* add unit tests to websocket commands
* complete unit tests for webClient commands
* secure wss
Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
* Fix for #4284
-> The menus have the update menu thing emitted when they get triggered.
| -> works surprising well https://youtu.be/KOOmhxvHA2c is a demo on a 10000ish card deck
* changed my comment to make sense
* fix to the issues that @ebbit1q found
what caued them idk
* Revert "fix to the issues that @ebbit1q found"
This reverts commit 20b1ad9f7a.
* actual fix for the issues @ebbit1q found
* its dirty but works
* fix cards in zoneviews not having a menu
* deleted isempty check as it is updated after the check
* key binds should work now
-> menus updated on zone change/attach/retranslate UI if selected
* clangify
* remove updateCardMenu from carditem entirely
updateCardMenu is done by the player and having it in carditem led to it
often being run multiple times, I've opted to instead run it in the
player and remove the signal entirely
the new logic updates the cardMenu every time a card is set as the
activeCard in the game tab
additionally a cardmenu can change while selected if the selected card:
moves zone, is flipped, or is attached (it receives the unattach action)
this is done in the player instead now, checking if the card is the
activeCard
this however exposes a flaw in the selection management where if you
unselect a card the activeCard is set to nullptr, this was an existing
bug and causes the action on selected cards to suddenly disappear, even
if there are other cards selected!
* revert null test of aCardMenu
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
* add option to delete a user's messages
add optional parameter remove_messages to the ban and warn commands
add event for clients to redact messages
implement server side command and message handling
implement server history removal
todo: client side implementation
add option to remove messages to moderator action dialogs
add storage of message beginnings to chatview
add redactMessage command
handle Event_RemoveMessages on rooms
this approach is favored over parsing the chatroom after the fact but
will use additional memory to store the block indexes
this also leaves a problem in that user messages from the chat backlog
are not removed in the same way because they don't have a user
associated with them
add workaround for old qt versions
add action for users to remove messages from users in chats
add chat history to userMessagePositions with regex
proper const usage for userName
allow removing the messages of unregistered users
add menus to usernames in chat history
this allows you to remove user messages on chat history as well
this also allows moderators to take actions on users in chat history
Apply suggestions from code review
* readd missing call to handler
* Support registration domain whitelist (registration/emailproviderwhitelist) that, if set, will require a user to have an email with one of the specified domain providers. Will require client updates to see the Whitelist message, otherwise they'll be greeted with a default alert.
This also works to remove the pain of Google Email addresses and their infinite combination of usernames for the same account (i.e. remove periods and everything after the first plus sign).
* Make blacklist response show custom dialog
the stop dump zone command was implemented as a courtesy to other
players in order to take into account when they would stop looking at
unknown information
however, this can be abused, a malicious client can send this command
whenever they would like
cockatrice is not a physical tabletop nor does it aim to be, if you can
take a screenshot of your deck and then close the view, you are not
cheating as you have been given this information
in order to prevent anyone from abusing this we should remove the
command from the protocol, this means servers will ignore this message
and clients will get a little invalid command reply in their debug log
the extension id will remain reserved
shuffling your deck will always invalidate any card view looking at
those cards
if players wish to signal that they stopped looking at their deck for
whatever reason they should just use the chat instead, optionally using
one of the chat macros
* add collapsable list
* make it show commit count
* why not have it also know the release type and name
* update the template as well
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
this can cause the iterator to become invalidated which will crash but
because of the data not always being moved it will often still work as
intended, giving the idea that it is random
* add menus for top and bottom actions
* style points
* github online editor is literally the worst
* add moving cards from bottom of deck to hand
fix getting multiple cards from the bottom
note that moving cards from the bottom of the deck does not get
remembered by or disrupt undoing draws
* Apply suggestions from code review
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
* add more info to dialogs
adds descriptive strings to the register, password reset request,
password reset challenge request, password reset token dialogs
adds tip to set manager to use ctrl a to select all sets
change sizes in set manager
moves default server info to settings instead of having it hardcoded in
each dialog
* make sets manager smaller
* clangify
* cleanup
* add button to open themes location to settings
botton creates directory if it doesn't exist yet
themes path is no longer hardcoded but included in settings
themes now default to None the default theme is no longer required
themes set to None will not look for empty directories anymore
this is backwards compatible
users with a nonexistant theme (Default) set will get the new None theme
* remove default theme from install instructions
The returned number of users from `getUsersWithAddress` will include the already connected user. The predicate `>= maxUsers` is incorrectly assuming that the new user is not already counted by `getUsersWithAddress`. This change corrects this off-by-one error by only closing connections after their are strictly too many users.
* Add option to always look at top card of deck
Similar to "always reveal", but reveals card only to the owner,
not all players.
* Add option to always look at top card of deck
Similar to "always reveal", but reveals card only to the owner,
not all players.
* Update bug_report.md (#4246)
* Update bug_report.md
* reproduction steps
* Update to address review comments
* Clangify
* set playerId on dumpEvent
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
Co-authored-by: Zach H <zahalpern+github@gmail.com>
* refactoring
* allow for creation of games as spectator
allow setting the amount of games per user to none
remove limit on amount of games when creating a game as judge as
spectator
* refactor common/server_player.cpp
* do not close games with spectating host automatically
* remove check that filters out 0 player games
this check didn't really do anything, deleted games are removed before
it would be reached
* don't transfer host to spectators
this seems to cause a bug, also present on master
the settings command_counting_interval and
max_command_count_per_interval are now in the [security] group as hinted
by their location in servatrice.ini.example
check values of comand interval settings before use
* don't sort split card halves alphabetically
fixes#4241
introduces new issue: aftermath cards are now switched upside down
* use list instead of multimap to enforce preservation of a given order
* add creation of release templates to ci and update guide
* touchups to markdown
* correct create release property
* correctly set fetch-depth and release body
* fix replacements, remove arrows
* check if there are no betas
* add extra output
* typo
correctly set prerelease flag
set prerelease names to their tag instead of full release name
detect version for use in release name during configuration
* Structure change
* Remove duplicate folders from previous structure
* Cleanup websocket protocol
* Updating from based off PR
* Fixup - remove wrong files during conflict and get the websocket working
* renaming tsx to ts
Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
* port webclient POC into react shell
* Abstract websocket messaging behind redux store
* refactor architecture
* add rooms store
* introduce application service layer and login form
* display room messages
* implement roomSay
* improve Room view styling
* display room games
* improve gameList update logic
* hide protected games
* improve game update logic
* move mapping to earlier lifecycle hook
* add autoscroll to bottom
* tabs to spaces, refresh guard
* implement server joins/leaves
* show users in room
* add material-ui to build
* refactor, add room joins/leaves to store and render
* begin using Material UI components
* fix spectatorsCount
* remove unused package
* improve Server and Room styling
* fix scroll context
* route on room join
* refactor room path
* add auth guard
* refactor authGuard export
* add missing files
* clear store on disconnect, add logout button to Account view
* fix disconnect handling
* Safari fixes
* organize current todos
* improve login page and server status tracking
* improve login page
* introduce sorting arch, refine reducers, begin viewLogHistory
* audit fix for handlebars
* implement moderator log view
* comply with code style rules
* remove original POC from codebase
* add missing semi
* minor improvements, begin registration functionality
* retry as ws when wss fails
additionally, dont mutate the default options when connecting
* retain user/pass in WebClient.options for login
* take protocol off of options, make it a connect param that defaults to wss
* cleanup server page styling
* match wss logic with desktop client
* add virtual scroll component, add context menu to UserDisplay
* revert VirtualTable on messages
* improve styling for Room view
* add routing to Player view
* increase tooltip delay
* begin implementing Account view
* disable app level contextMenu
* implement buddy/ignore list management
* fix gitignore
Co-authored-by: Jay Letto <jeremy.letto@merrillcorp.com>
Co-authored-by: skwerlman <skwerlman@users.noreply.github.com>
Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
* ci: Add vcpkg submodule
* cmake: Fix NSIS not detecting platform arch
* cmake: Add QTDIR(64|32)
This change adds a new var for QTDIR(32|64) which makes it easier
to specify a specific directory for Qt, rather than having to edit
the prefix path directly, which can get pretty messy. Functionally,
this shouldn't affect any builds that are already finding Qt as
part of path, and should not affect Linux/macOS.
* cmake: Bump min cmake version
* ci: Add GitHub Actions for Windows
* Fix#4043, Support MTGJSONv5 format in Oracle downloader
* Auto redirect V4 downloads to V5, as we won't support V4 after this change
* clangify >_>
* Remove null values and account for IDs missing
* fix split cards and double faced cards somewhat
* do not consider double faced cards duplicates
* fix promo double sided cards
* typo
* fix alternative versions of cards with (letter)
* zach says this is more readable
* pre qt 5.10 compatibility
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
* Fix#2820 by removing (this->setCursor) as this was null by the time we hit this component due to a racetime condition.
* check if card player pointer is valid before setting cursor
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
modify up the simplifyCardName function to ignore right halves
add guessCard function that prioritises full card names the simple ones
fix imports for misformatted split cards or double faced cards
introduces a small concession: not completely formatted names with a
shared name on the left side will get mixed up, eg "bind" but not "Bind"
this should be fine considering how this would fix a lot more cards
* free qprocess on oracle update fail
reload the database whenever oracle exits
search for oracle in ../oracle so you can use it from the build dir
* only ask for the db updater once
mana artifacts will use the stack and be placed in the normal tablerow
if you want to put it with your lands you're free to do so, as long as
you promise to not say oh this should not be here three turns after
shatterstorm resolved
* add proto files to clangify
* apply clangify to proto files
* remove blocksonsingleline, it didn't actually do anything
also add missing space to the travis warning, emoji are monospace too
* Part 1 for #3067: Basic combo box (dropdown) filtering mechanism for game age.
* Apply suggestions from draft review
# Conflicts:
# cockatrice/src/gamesmodel.cpp
# cockatrice/src/gamesmodel.h
* switch to using QTime
* check for games older than a day
* formatting for casts and more unnecessary cosmetic changes
* ebbit1q fixes
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
* consider cards with frameEffects promos
* skip duplicates entirely
all cards that are not "promo" or something like it will only retain the first copy instead of parsing all of them and keeping the last
* Fix#3957: Properly set filters to defaults on initial load and disable "Clear filters" button if filters are set to defaults
* Reuse resetFilterParameters() in GamesProxyModel constructor, and remove "off" designation for player min/max (as a default of 1/99 is enforced by the UI).
* Run tests on Windows CI.
* Add message logger
* Skip tests that cannot be linked.
* Fix test call
* Fix mock link issue on MSVC
* Fix PATH variable to find libraries for tests
* Fail test step on test errors
* add opening directory in file browser to linux
this uses QDesktopServices to open the url "file://[location]"
by default this is
"file://$HOME/.local/share/Cockatrice/Cockatrice/pics/CUSTOM"
any distro that has a file browser should have an accompanying mime type
specifying the file handler for the file:// protocol using the
inode/directory mime type
see https://specifications.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html
if a user were to have removed their mime database this will not work and
it will fail with nothing but a log message, this would be rare and not
worth checking in my opinion
* make opening directories the same for all oses
* sort headers
this specifically to support imports from mtg arena that have a set code
and then a collectors number like (ABC) 123 at the end, this pr strips
that from the card name (we don't use it anyway)
fixes#4011
* Add docker-compose document that works out of the box for Windows, and a storage location for the mysql-database.
* Documented Windows support in Readme file
* Some improvements to Servatice network code
1. fix crash on fuzzy connection (tcp server only)
2. ensure websockets are parent()ed to avoid leaking them
3. quick catch disconnect()ed sockets instead of waiting for a socket error to happen
4. supporto mulltiple connection pools on the websocket server; they are still bound to the same thread due to a qt5 limitation.
* Added keyboard shorcuts to focus and unfocus chat
* Fixed format
* Changed the Esc behavior to work on any QLineEdit in the main Window and ignore shortcut conflicts
* Fixed a conflict with shortcuts
* Configurable unfocus shortcut and format fixes
* minor style fix
* add pauper to the list of checked formats without a short form
l:p remains reserved for pioneer
* throw out weird hardcoded formats
this will at least still work whenever a format gets added
the shorthands are still kept
* ignore stars and promos but only sometimes
this will correct #3706 and #3715 being a bit overzealous in removing
cards and thus fix scheme cards being removed in entirety
fix#3845
note that this causes a lot more cards to be added that are in promo
sets, if these promo sets should prove to be problematic they should be
disabled somehow as having them as an option is still nice.
* remove debug lines
* Added few unsigned to ints in order to get rid of warnings.
Added column to users table, for when password is changed(issue#3015).
Moved password length check to separate method, to make it cleaner.
* Added migration file and changed schema version to 27 due to servatrice.sql schema modification.
* Make password length configurable.
* add osx mojave build+deploy
* add job names, change variables
* add zipping to packaging step
* see #3814
* update to high sierra
* update homebrew
* xcode 11.1
* [skip ci] add link to config explorer
* add support for adventures to oracle
this causes cockatrice to correctly fetch the front of the card for the adventure portion rather than sending lots of bad requests to scryfall
* treat adventures more like split cards
* dont hardcode `maintype: creature`
800b0f4b2f homebrew no longer provides a bottle for protobuf, which is so big we can't do without a precompiled version. This means we can no longer support sierra 10.12 and have to use high sierra 10.13, this does not seems like a very painful grade however as there are no differences in hardware requirements between the two and any user on sierra can upgrade to high sierra if they wanted to.
People keep complaining they can't compile on ubuntu 16.04 because of this warning message, while it just disables 2 "prettyness" warnings and only in the automatically generated code by protobuf which should never be a problem anyway!
original pr: #3432
* Deal with recent Qt methods deprecation
* Use std::sort, std::less instead of qSort/qLess
* Use QFontMetrics::horizontalAdvance instead of ::width
* Use qApp->primaryScreen() instead of QDesktopWidget
* use lambas instead of QSignalMapper
* Use QTreeWidgetItem::setForeground instead of ::setTextColor
* Use QDir::setPath instead of operator=(QString)
* Use QList::swapItemsAt instead of ::swap
* fix error
* add homebrew cache to cache
* use same image
* ruuun travis, ruunn
* remove extra space
* do these dashes do this?
* trigger ci
* these dashes confuse me, consistency is like woosh
* add a bunch of parents to dialogs
works on #3651
* use game as parent instead
* add more parents
* fix create token dialog modality
* add parent to game information window
* replace a bunch of nullptrs with the magic of sed
* add parent to tip of the day and counters
* reorder game ptr
* set parent for life counter
* clangify
* Fix#3618
* clanfigy me softly
* fix unused var and params
* Frce the dialog being modal; ensure self deletion
* More qt-like behavior
* Restore dialogSemaphore logic
* Shortcuts preference pane
* Honor and glory to the hypnoclangifier
* clanfigy: exclude deleted files from being checked
* keep the olf translation context to be able to reuse old translations
* Fix gcc; extract translations
* Moved generic buttons after the groupbox
* Update current item on "clear/reset all"
* Sequenceedit: make buttons larger and translatable, add text
* Event filter
* Don't filter arrow keys; added placeholder text
* group counters
* Fix crash on card relation to inexistent card; fix#3637
But that whole loop is a logic mess
* Check if related cards exists before creating the menu entry
* honor and glory to the hypnoclanfigier
* Only will auto-select RR if autoconnect is not checked off.
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* Only will auto-select RR if autoconnect is not checked off.
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* On disconnect, un-check autoconnect. Better naming.
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* rework pt setting
save pt as a string serverside
set the pt of cards that enter the battlefield to empty (was -1/0)
implement old behaviour as changePT clientside
display old pt to messagelog
add new keybind for new set behaviour (default ctrl+shift+p)
add flow pt actions and keybinds that increase while decreasing
put more braces everywhere
various refactors like adding consts and for loops
remove a single superfluous semicolon
does not change the way pt is displayed client side
does not fix 3455 fully
* fix drawing of pt
remove search for / in carditem's paint() (crash)
ptstring is now always orange unless it's a faceup card with a pt that
matches the cardinfo pt
set changept to remove the pt if the field is empty
set changept to keep the old value if one side is empty
return in changept for +0/+0
clean up some if statements
* return on change to +0/+0
* change log message for empty original pts
* typo
* remove changept
add parsept to unify reading pt strings
change setpt behavior to be an "upgraded" version of the old setpt
add arbitrary strings as anything that starts with /
* clangify
* remove debug lines
* add tip of the day
* add missing images
* clangify
* Add MagicCards.info like fitler parser.
* Use FilterString whenever one of [:=<>] is in the edit box.
* Opts
* Opt
* - Capture errors
- Allow querying any property by full name
* clang format
* Update cockatrice/src/filter_string.cpp
Co-Authored-By: basicer <basicer@basicer.com>
* - Some refactoring for clarity
- More filters
- Add filter help
* Clangify
* Add icon
* Fix test name
* Remove stay debug
* - Add Rarity filter
- Make " trigger filter string mode
* You have to pass both filter types
* clangify
* - Allow filtering by legality
- Import legality into card.xml
* Add format filter to filtertree
* More color search options
* RIP extended
* More fixes
* Fix c:m
* set syntax help parent
* Fix warning
* add additional explanations to syntax help
* Allow multiple ands/ors to be chained
* Cleanup and refactor
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* Move utility into guards
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* I heard you like refactors so I put a refactor inside your refactor (#3594)
* I heard you like refactors so I put a refactor inside your refactor
so you can refactor while you refactor
* clangify
* Update tab_deck_editor.h
* Minor cleanup & set RR default for new clients
* Handle case of no entries
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* Use RR as default on rebuilds
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* Click replay timeline to seek.
* Fix seek for long games
* Erase log when rewinding
* zach cleanup
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* - Allow shuffling a subset of a zone
- When moving cards to the bottom of library, shuffle them after
- Process events in the correct order serverside
* Zach fixes
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* Comments + additional guard
* Playing a tableRow 3 card from the stack puts it to grave.
* move to top by resetting pos
* Zach touch
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* removes the pt of face down cards
Instead of setting the pt of a hidden card to the value only known to
you, it's reset to nothing.
Resetting a card while it's already reset does nothing.
Removing the pt of a card is logged as "player removes the pt of card."
instead of "player sets the pt of card to ." (note the missing value).
* reset unknown cards to nothing instead
* replace cardname with card id for unknown cards
fixes#3543
* prefix #
* Add peglib
* - Add expression engine
- Take an expression when setting a counter
* Shift + Click = Middleclick for counters
* minor cleanup for clangify
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* Added tip entry
* Fix up Dockerfile to use ubuntu:bionic and actually build
* Remove commented PPA
* Fix up Dockerfile to use ubuntu:bionic and actually build
* cleanup
* fixup merge
## Short roundup of the initial problem
A beta release for 2.6.3 has been relesed, but the codebase is still at 2.6.2
## What will change with this Pull Request?
Bumped version to 2.6.3
* add the amount of cards logged to the reveal cards event
sets cardname to the amount for the call if not 1 for the fromstr only
add braces for single line statements
* zach cleanup
* CardDB: merge all card properties in a new structure
* Pre Json parser changes
* Cockatrice: use qt's builtin json support
* Move qt-json src dir from cockatrice to oracle
* Add dummy cockatricexml4 parser (yet to be implemented)
* Implement a new parser and xml format
* cockatricexml4: new xml parser following the "generic properties hash" pattern;
* oracleimporter: refactor the parsing code to better adapt to cockatricexml4; rewrote split cards parsing
* carddb: change "colors" from a stringlist to a string
* carddb: move the getMainCardType() method to the cockatricexml3 parser
*
* CardInfo: show all properties (stil missing: nice name + translation)
* Rework the "add related card" feature so that it doesn't change the card name in the carddb
Also, fix token count display
* Picture loader: Added support for transform cards
* Fix side information for flip cards
Mtgjson uses side a/b for flip cards, while scryfall doesn't
* Pictureloader: dynamic tag resolution from card properties
Examples old => new
* !cardid! => !set:muid!
* !uuid! => !set:uuid!
* !collectornumber! => !set:num!
New examples:
* !prop:type!
* !prop:manacost!
* Start moving mtg-related property names to a specific file
* Clangify
* Fix tests
* Make gcc an happy puppy
* Revert "Make gcc an happy puppy"
This reverts commit 446ec5f27516c4d3b32dbfc79557f4827c5c5bdf.
* Some gcc fixes
* Share set list between different db parsers, so they won't overwrite one each other
* All glory to the hypnoclangifier!
* Fix test compilation
* Cleanup edited files in the prior PR. (#3519)
* Cleanup edited files in the prior PR.
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* Fix includes
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* Update carddatabase.h
In #3439 the shortcuts got some overhaul but this shortcut wasn't
correctly renamed.
This fix will clear users' original shortcut for increasing toughness.
An improvement over the current state of it not working at all and being
unable to set to the default shortcut.
Fixes#3506
* Cockatrice Picture loader uses better defined URLs now
URLs are defined on the Card Management tab
Instead of Primary/Backup, you can now define a list of URLs
List of URLs can be drag/dropped for priority ordering
Oracle now uses scryfallId > mtgjsonUUID for !uuid!
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* Simplify to QStringList and remove metacall
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* fix issues brought up by Dae. Also fix how the defaults load to account for first time users.
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* clangify
* Fix save settings on row moved (#3495)
* merge model fix, and reclangify
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* Sources > Resources
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
## Short roundup of the initial problem
We released 2.6.2, but CMake still thinks it's 2.6.1
## What will change with this Pull Request?
Update CMake version to 2.6.2
* Use plural form whenever possible
Change for "%1 draws %2 card(s)" is self explanatory
Change for "look top X" switches var %2 and %3 so i can skip %3 for singular and translate as "top card", as explained in tr comment
For "counter(s)" i just moved it into %3 (each color) since plural form is already used there.
* clangify
* manual clangify attempt
* Add missing tr
* More missing tr
* Basic mtgjsonv4 support
* Fix set type
* [WIP] Oracle: use zx instead of zip
* clanfigy fixes
* Fix reading last block of xz
* Added back zip support
* [WIP] adding xz on ci + fixes
* typo
* resolve conflict
* Make gcc an happy puppy
* test appveyor build
* appveyor maybe
* Appveyor: add xz bindir
* Update ssl version (the old one is not available anymore)
* Windows is a really shitty platform to code on.
* test vcpkg
* again
* gosh
* nowarn
* warning 2
* static
* Maybe
* cmake fix
* fsck this pain
* FindWin32SslRuntime: add vcpkg path
* Appveyor: cache support, force usable of openssl from vcpkg
* updated as suggested
* ouch
* Import card uuids and expose this property as !uuid! for card image download
* Minor style fixes
* address changed URL
## Short roundup of the initial problem
Deployment conditions weren't met, because the $BUILDTYPE variable doesn't exist anymore.
@ebbit1q changed that, and there is a flag now that you pass to the compile script instead.
## What will change with this Pull Request?
- Remove that condition
It's not needed because we make sure via the build config itself that on tags no debug builds are run. This was a double check basically to prevent debug builds beeing deployed.
When i added the appended os nametags I didn't account for the dots inside the version, this will place the nametag before the last dot instead of after the first dot.
Set travis image to xcode9.2: this image uses sierra instead of
el_capitan, el_capitan no longer builds.
Disable homebrew autoupdates, this gives a major speedup.
* add fedora docker image to travis compilation
fixes#1746
* add dockerfile
* would you like to please install for me? [y/n]
* remove bc dependency
* save cache separately for different docker builds
* add development packages to fedora dockerfile
* add package names
* use env values to make these all look the same
* set docker image name correctly
* add missing dependency
* minor oversight, add %% to remove all braces in check schema
* add keybinds to mill cards
Add functions to move single card from top of deck to the graveyard and
exile.
Add keybinds to move single or multiple cards from top of deck to exile
or graveyard.
Add new keybinds to settings menu.
Move settings menu items around for a better fit.
Rename a few of the items in the settings menu.
Add default keybinds: ctrl alt d/e for single/multiple cards from top of
deck to the graveyard. No defaults are set for moving to exile.
* fix shortcut menu
* fix missing tag
* rename mismatched functions
* fixed your typos
* refactor shortcutsettings
correct a lot of typos
optimize a lot of functions
this could merit a pr on its own
* set mill keybinds
* refactor add related card actions
I found a function that was completely unintelligible so I made it
remotely legible and removed the duplication.
* shorten line by 17 characters
replace a lot of function calls with just a single reference
* add brackets
add brackets to all single line if statements etc.
readability improvements
* correct previous misstake in #3438
wrong, this fixes that.
* add checking for second argument to --package
nice to have
* split find result into path and file
* add more clang-format focus to CONTRIBUTING.md
Add more clang-format instructions and instructions on clangify.sh.
Move clang-format instructions to the section Formatting and make other format topics a subheader of it to articulate focus on it.
Add section about our ci formatting for people that look at this file after their test failed.
fixes#3065
also fixes#3340
* grammar
* grammar
* set error message to be conditional
#3443 fails on the git merge base for "some reason" but at least this error message should be clearer.
* fix issues created earlier in #3433
split version from actual diff
remove --color-diff argument as apparently it isn't supported
* add docker compilation to travis
add new matrix entry in .travis.yml for compiling on 18.04
add Dockerfile in .ci to build ubuntu 18.04 inside docker
remove release entry for uvuntu 16.04 to not conflict
refactor .travis.yml
refactor travis-comile.sh
merge travis-dependencies.sh into the travis.yml
remove travis-dependencies.sh
* enable debugging on travis-compile.sh
* set ubuntu16 buildtype to "Debug"
set buildtype Debug for as requirement for "test"
add --debug and --release flags to travis-compile.sh
* make output prettier
edit the format warning message and clangify.sh output
* fix clangify.sh
fix --cf-version flag
fix directory argument parsing
add directory parsing details to --help
add examples to --help
* test making packages
move dockerfile for bionic to make room for possibly other files
add missing file dependency
set macos brew to use protobuf --without-python@2
* remove test
* rm old Dockerfile
* add docker compilation to travis
add new matrix entry in .travis.yml for compiling on 18.04
add Dockerfile in .ci to build ubuntu 18.04 inside docker
remove release entry for uvuntu 16.04 to not conflict
refactor .travis.yml
refactor travis-comile.sh
merge travis-dependencies.sh into the travis.yml
remove travis-dependencies.sh
* enable debugging on travis-compile.sh
* set ubuntu16 buildtype to "Debug"
set buildtype Debug for as requirement for "test"
add --debug and --release flags to travis-compile.sh
* make output prettier
edit the format warning message and clangify.sh output
* fix clangify.sh
fix --cf-version flag
fix directory argument parsing
add directory parsing details to --help
add examples to --help
* Improve clangify.sh
Separated from #3433 merge this branch first!
* fix error codes on -n and -t
fix output on -n
format -h message
* separate color diff from diff
* set common protobuf files to compile with other tags in debug
force the same flags as release on debug builds
fixes#3431
* check for version first
* use Protobuf_VERSION instead of calling protoc --version
* lower verion requirement
* set tags to disable certain warnings instead of removing all
* improve loading from plain text
Fixes the loadFromStream_Plain function that is used to load plain text
decklists.
The rewritten function uses more regexes and is a bit cleaner.
This fixes multiple bugs with loading the various sources of decklists.
Note that the new function still has a few issues that are shared with
the original version like creating duplicate cards.
* clang format comments
apparently clang-format even complains about the spacing in your
comments
* refactor loading_from_clipboard tests
Remove all heap allocation and use references.
Use std::pair and std::string so gtest will show the cardnames in error messages.
(note that using QPair or QString does not work with gtest)
Improve the last two testcases to include weird names; and name and
comments testing.
Remove empty header file.
* fix compatibility with more formats
skip "sideboard" line
include everything in mainboard when there are multiple empty lines
add removal of the mwdeck cardversion selector in round braces
add replacal of lowercase ae combination that should never occur
Set cardname to lowercase as apparently our checks are hardcoded to only
accept lowercase.
* remove bugged test
The current load from plain is simply broken, removed checking the
comments for correct contents.
* rework load_from_clipboard tests again
rework the test to have less code duplication
add more tests and more special cases
note that text is still all lowercase
* improve loading from plain text
Fixes the loadFromStream_Plain function that is used to load plain text
decklists.
The rewritten function uses more regexes and is a bit cleaner.
This fixes multiple bugs with loading the various sources of decklists.
Note that the new function still has a few issues that are shared with
the original version like creating duplicate cards.
* clang format comments
apparently clang-format even complains about the spacing in your
comments
* refactor loading_from_clipboard tests
Remove all heap allocation and use references.
Use std::pair and std::string so gtest will show the cardnames in error messages.
(note that using QPair or QString does not work with gtest)
Improve the last two testcases to include weird names; and name and
comments testing.
Remove empty header file.
* fix compatibility with more formats
skip "sideboard" line
include everything in mainboard when there are multiple empty lines
add removal of the mwdeck cardversion selector in round braces
add replacal of lowercase ae combination that should never occur
Set cardname to lowercase as apparently our checks are hardcoded to only
accept lowercase.
* remove bugged test
The current load from plain is simply broken, removed checking the
comments for correct contents.
* rework load_from_clipboard tests again
rework the test to have less code duplication
add more tests and more special cases
note that text is still all lowercase
* remove forcing of lowercase cardnames
Cardnames in DeckList::loadFromStream_Plain will no longer be forced
lowercase if they aren't found in the database.
Empty lines in the comments of plaintext decklists will not be skipped.
The loading_from_clipboard_test gets its functions declared in a
separate header "clipboard_testing.h".
Add more edgecase tests.
Refactor code.
* add old QHash version support
QT 5.5 does not support using initializer lists for QHash.
Implement a preprocessor version check for conditionally using inserts
instead of a const with initializer list.
* add old QHash version support
QT 5.5 does not support using initializer lists for QHash.
Implement a preprocessor version check for conditionally using [] access
instead of a const with initializer list.
* add qHash on QRegularExpression below QT 5.6
Apparently QRegularExpression can't be hashed in lower QT versions,
so we add our own hash function, and everyone lived happily ever after,
and none the wiser.
* add header guards to clipboard_testing.h
Add extra rules that clang-format enforces, like the order of includes and the way single line comments should be formatted.
Correct some grammar ( what is up with the translation section ordering steps out of order?? ).
This is a web edit.
Remove the weird out of order numbering and replace it with just chapters for specific users.
Add a bit of explanation to adding translations as a developer.
This is just a recommendation for an improvement, jumplist could be added and/or #3423 merged with this. (it fixes the typos)
Add new brace guidelines, correct code sample.
Add detail to indentation guidelines.
Add basic clang-format information and a link to the documentation on llvm.
closes#3413
A quick edit to the contributing guide from the web ui, hope it comes out right.
* add reset power and toughness function on cards
Add actResetPT to set the power and toughness in the same way as
actSetPT but instead of prompting the user it will fetch the original
pt from the card info for each card.
Add the new command to the card rmb list, keybinds and settings.
* changed style to .clang-format
Please change the contributing guidelines to use this style instead.
* Added failing test to demonstrate issue with dec loading
* Prevents empty lines between comments from being interpreted as the start of the sideboard
* Translate curly apostrophe to ASCII apostrophe (#3395)
Treats the curly apostrophe as a straight apostrophe when searching in
the deck editor search bar.
* Moved logic for handeling translation to CardDatabaseDisplayModel.
This implementation was done with strings instead of characters because
the curly apostrophes and quotes are considered multi-characters.
Thus, the method of iterating through the string and replacing
the characters with the proper translations was difficult to cleanly
implement.
* clang-tidy modifications
* Implemented faster algorithm for string translation.
Optimized the algorithm for string translation, before it would compute
in O(N*M) time where N is the size of the string and M is the size of
the translation table. Now it will compute in O(N) time where N is the
length of the string.
* Renaming variables and methods.
* Fixed character literal type, was unicode, is now wide.
* Disable saving of decks when the deck is empty
* Replace tabs with spaces to conform with coding conventions
* Remove whitespace at end of line to satisfy the CI robot overlords
* Improve logic to check if deck is empty, fix functionality when a deck is loaded
* Fix code style issues
* Disable more menus when the deck is empty
* Streamline code for disabling save menus when the deck is empty
* Fix save-disabling when loading a deck from the clipboard
* Enable saving deck directly after loading deck
* 2479: Running clang-format
Reformatting files to be in line with style guidelines.
* 2479: Updates to remove set/url indices
This change removes set and Url indices in favor
of check for empty lists and removing items from them
instead.
* 2479: TransformUrl will now error on missing fields
If transformUrl is called with a template, and the card/set
is missing something required by that template, it will now
return an empty string, instead of the template with an empty
string substituted in.
* 2479: clang-format updates
* 2479: Fixing omission of ! from two properties
* 2479: Adding prefix on debug messages
Adding PictureLoader: to the front of each debug message
from this file, so that it can be more easily filtered out
by grep in the log of a running application.
* 2479: Remove outdated comment
* 2479: Remove unused method from intermediate work
* 2479: Updating QDebug messages to be more consistent
* 2479: clang-format updates
* 2479: Remove repeated code, replace with call to nextUrl
This removes some redundant code that is better replaced with a call
to nextUrl, in case the code needed to populate the nextUrl changes
significantly.
* 2479: Adding more detailed comments
* 2479: Refactor transformUrl
Refactor transformUrl to do everything in a single loop instead
of two almost identical loops. set information is populated if
present, but is added with empty strings if absent.
Url checking is now working as expected. In set order,
starting with custom sets, then going in priority
order by url template order, Urls will checked, and the
first successful one will be used.
Initial work on downloading cards through fallback URLs.
This change will add in the ability to proceed to the next URL
should the first one fail. First trial shows that it's working,
but needs more refinement.
Return a list instead of a single url. This is the start
of getting many possible urls instead of one. Functionally
identical except that the primary url will be attempted for
cards without a muid.
## Related Ticket(s)
- Fixes#3314
## Short roundup of the initial problem
When the view was sorted in the manage sets window, the "Enable/Disable All" buttons never toggled to "Enable/Disable selected" buttons, even when more sets were selected.
## What will change with this Pull Request?
- Selected sets can be enabled/disabled in sorted view as well
* version updates
- qt to 5.11.x
- openssl to 1.0.2o
- protobuf to 3.6
* undo protobuf change
* reapply with proper semver
* only qt latest
* combined env, protobuf 3.6
* slim build matrix config down
* fix env
* test
* fix env -eq
* test if script changes work
* /2
* enable cache again
* fix
* final
## Short roundup of the initial problem
It was mostly out of date because we have to manually update it with our current version number.
The use of that is suspect anyway, since it only displays in the appveyor build overview.
It also had a redundant info about the branch.
## What will change with this Pull Request?
- remove hard coded version number
- remove branch
- cleanup build trigger from [#3300](https://github.com/Cockatrice/Cockatrice/pull/3300/files#diff-11c909939117928998b102a1fff7d363)
- more readable style
## Screenshots
I did some tests, so don't be confused about the different styles displayed in the history:
<!-- simply drag & drop image files directly into this description! -->

* search field added; sortfilterproxy displayed in treeview
* searching works properly
* moving with filter on works; view isnt't updated yet
* clangify & view updating figured out
* moving disabled when sorting is active
* drag&drop disabled when view sorted
* clangified
* foreach replaced
* button rename & SORT_RESET defined
* changed variable names
* 'x' button added & searchlabel text modified
* 'enabled' column won't grow anymore
* column resize improvement
* button hint & restore original order added
* moving with filter on works; view isnt't updated yet
* sort disable build in column headers (3 clicks)
* codacy fix
* typo + wording
* background color for warning
* buttons moved down a bit
* clicking "default order" button will hide the warning text
## Related Ticket(s)
- Fixes#3212
## What will change with this Pull Request?
- `0` input on power/toughness filters will only return `0` values
- `relationCheck` method will only get called after simple string comparison failed
- due to their similar structure `acceptPower` and `acceptToughness` methods has been merged
## What will change with this Pull Request?
- cleanup of empty and unused languages files (catalan, lithuanian, hebrew, ukrainian)
- reflect language removing on transifex
* Osx: fix qt plugin installation
* Add make install step to travis debug build
* only install under osx
* Add "styles" plugins (for native look'n'feel)
* Osx: upgrade qt from 5.5 to current (5.10.1)
* Fix osx on travis
The qt homebrew formula now installs three qt* symlinks (qt, qt5, qt5@5.x) so we can't use/don't need bash globbing anymore
* "Tip of the Day" option added to Help menu
* Tip of the Day setting moved
* If no new tips are availabe, don't show tip of the day again
* list storing try #1
* first unseen tip shown first
* lastShownTip removed
* fixed next/previous buttons
* spaces > tab
* "Show this window on startup" is not checked by default
* Basic tip of the day with sample widget added
* "Show tips on startup" option added to settings
* tip cycling implemented
* Structure of the tipOfTheDay class and resource created
* tip getter function modified
* Resources added, feature works properly
* clangified
* accidental modification rolled back
* zach cleanup
* tips to spaces; cmake list combined
* cleanup img
* fix copy
* remove TOTD as QObject so we can copy construct it
* prevent mem leaks in dlg
* changed order of 'next' and 'previous' buttons
* Date and tip numbers added; content wraps around
* useless sizepolicy removed
* link support added & clangified
* Initial tips & memory management updates
* Shortcut setting checks for invalid keys
* Different message shown for invalid keys and used keys; warning message is displayed on start if conflic is detected
* Only shortcuts related to deck-builder are checked
* oracle now can be run in spoiler or normal mode
* tests for travis
* only run on relaunch
* spoilers in client (not oracle now) and tray icon shows when done
* spoiler status will be checked before downloading spoiler file
* only download if they care about spoilers
* reload db on spoiler download
* manual update button, code cleanup, and fix enabling sets when new
* cleanup, nullchecks, and fixes to spoiler
* reload DB even if not in spoiler season; necessary as we have a check elsewhere to prevent the reload if spoiler check happens
* Implement changes from 2991#issuecomment-356169374
* Change implicit nullptrs, alert on file deletion, minor changes
* make reload thread safe and minor changes from 2991#issuecomment-356450302
* Fix locking
* Disable update now button while process running
* Added “export deck” option to export deck to decklist.org for viewing/printing. Implemented using a new menu item, added shortcut ability, and functionality to parse the deck correctly and add main/sideboard cards to decklist. Per issue #2931
This change establishes the Google Developer Documentation Style Guide as the official style guide for the ReadMe. This will provide a starting point for editors or writers looking to work on documentation. This edit also does an initial patch on the readme based on that style guide
* prevent unnecessarybuilds
* readd qt5 string
sadly this is needed as of now:
ff6b0f86ec/cockatrice/src/releasechannel.cpp (L59-L68)
* wrap asterisks
* fixed with validator
https://ci.appveyor.com/tools/validate-yaml
* complete link
* add helpful links
this should not trigger a appveyor build
* add space in readme
this should not trigger a appveyor build
* highlight c++ types
this should not trigger a appveyor build
* remove empty line
this should not trigger a appveyor build
* declutter dockerignore
this should not trigger a appveyor build
* Appveyor updates
Remove unused stuff (mysql, choco)
Use MSVC 2015
Upgrade Qt to 5.9, protobuf to 3.4.1
* stick qith qt 5.6 for winxp 32bit compatibility; zlib test
* Appveyor is using a randmon clone path for pulls, get it from an env variable
Remove support for Fedora 22 (been EOL for a while)
Add support for Ubuntu 17.04 and 17.10
Note that debug builds for 17.04 and 17.10 are still affected by issue #2343, and so always fail.
* Portable mode for windows
* fix start menu in portable mode
* Make gcc an happy puppy
* Clean old installation if we are installing over an old portable mode installation
* Default to Desktop\CockatricePortable
* Settings dialog fixes
* wording
* enable cache
* caching on mac
* fix ci caching on mac
* fix
* add mac cache
* added homebrew cache and pretty print yaml (+ structural ordering)
* cleanup
* fix ccache on mac
* testing workaround
https://github.com/travis-ci/travis-ci/issues/7456#issuecomment-296505058
* try xcode7.3 instead of workaround
* cache timout value
more time for cache to upload
When checking unknown sets, consider sets with an empty long name,
set type and release date as 'incomplete'/'partial' sets.
Do not mark partial sets as known, or ask the user to enable them.
Instead, silently enable partial sets.
When a partial set becomes complete, the user is prompted to enable the
set as before. If they choose not to enable, those partial sets are
disabled, as we can no longer assume they are disabled by default.
* More descriptive reason for "to many requests" when registering
Currently the only way for a user to get a response of "to many registration attempts" is by the servers configuration to restrict the number of registration attempts but the error message presented to the user is very vague as to why they have been denied. This PR updates the reasoning. I'm open for suggestions on any clarity recommendations.
* Added more clarity
Updated error message to include email address information for even greater clarity.
* Colorless for color filter
Add 'colorless' as an option for color filter in deck editor / card list.
* Remove empty quote check
Empty quote does not work here. Add 'none' as optional string instead.
* Add C to colorless filters
Migrate from protobuf.js 5.x to 6.x (remove long.js and bytebuffer.js)
Upgrade jQuery from 1.x to 3.x
Upgrade jQueryUI to 1.12.x
Use minimized version of js libraries
Disable debug messages
Fix default value for Event_RoomSay’s RoomMessageType field
Looks like an addition to the table shifted things. We probably should look into some how use the actual column names (if it can be done). But for now this should fix the server room chat history.
* Update CONTRIBUTING.md
* Update CONTRIBUTING.md
"wait for CI upload" should be "wait for CI to upload"
"update again the version number" should be "update the version number again"
* Change version in about window and installer name
* Change version in about window and installer name
* Cmake get version updates
* dev snapshot format changed
* alignment changes
* Added VIP only room
* Added DONATOR room.
* Extended Room to include privilege level.
* Updated room join logic
* Updated server tab permissions column display based on perm+privlevel definitions
* Fixed new client -> old server blank permissions column on server tab
Added the ability for registered user - VIP/DONATOR/PRIVILEGED room.
* Extract createCard from actCreateRelatedCard
* Merge related cards and reverse related cards before handling
* Add "Create all related cards" action to a card
* Stop displaying all related tokens if only one token is available
* Add shortcut for Creating all tokens related to selected card
* Extract method for adding related card actions
* Prefer foreach to index based iteration
* Guard against null cards, card menus, or cardInfos
* Remove QRegExp dependency from commonly depended header
* Creating of server side audit table for auditing actions such as password resets, account registrations and log queries.
* Add migration script
Add migration script for database
* Update database script
Update database script to reflect new audit table
* Creating of server side audit table for auditing actions such as password resets, account registrations and log queries.
* Add migration script
Add migration script for database
* Update database script
Update database script to reflect new audit table
* Corrected results column possible value(s).
* Fixed migration script.
* Added boolean audit logic
Added enable/disable audit options
Added audit functionality for forgot password
* Added registration auditing
Added registration auditing
* Updated ActivateAccount Function
Created clientid variable and used it in preporation for future
potential protocol expansion.
* Extended activation protocol
Added clientid to activation command protocol
* Typo correction
Fix typo's
* Missed type fix
Found the infamous E!
* Updated database function syntax
Updated if/else syntax in db add audit function
* Untabify content
Untab files changed in PR
* Added registration email blacklist
Added the ability to define email blacklist for user registration. Now
server operators can prevent users from registering accounts that
contain providers they do not wish users to use.
* Update ini option for clarity
Updated servatrice ini option name for clarity.
* Updated description for clarity
Added implicit explination
* Add ability to limit number of account registrations with same email address
This commit adds server side functionality that will allow operators to
limit the number of accounts that can be registered to the server with
the same email address.
* Updated ini wording
Updated configuration file wording for better description.
added priv level to user details
Fix#1881
This change allows the server operator to enable or disable the internal
SMTP client that sends activation emails. With this new configuration
option server operators can choose to require email activation yet use
an external method of account verification and/or account token
notification.
Fix#1881
This change allows the server operator to enable or disable the internal
SMTP client that sends activation emails. With this new configuration
option server operators can choose to require email activation yet use
an external method of account verification and/or account token
notification.
Fix#2334
This update fixes the violation that happens when watching replays to
determin the proper user privlevel in order to generate the correct
gummy.
* Added privilege level start/end columns
Added 2 new columns to the users table to indicate when a users
privilege level date / time was recognised and when the privilege level
should end.
* Updated database header
Always forget about the database header file...
* Added priv level maintenance script
Added a bash maintenance script that can be run on a scheduled basis
that will demote privileged users that have the end times on the
accounts that are prior to the date/time the script is executed.
* Added donations table
Added donations table to db for tracking user donations
Fix#2319
This should resolve the issue of users getting the popup immediately when logging in and the time out value is set to 0.
This needs tested, its a quick fix put in with the web editor.
* New user gummys based on account privilege level
This change add's new user gummy icons for vip/donator priv levels that
are now available.
YaY for Zach!
* Update sessions table columns for consistency
Fix#2276
This update changes two columns in the sessions table to match the
column declartations in the users table.
* Update servatrice.sql
Update servatrice.sql to reflect new db schema version
* Fix Store Replays Functionality
For whatever reason we have a variable in the servers ini to
enable/disable the storing of replays but there is no code that uses
that variable. At one time there was but in light of it being removed
some were along the line this add's the ability back in for server
owners to disable the storing of game replay data.
* Added code
* Moved store replay check
Moved the check for storing replay information into existing routine.
* Updated Per Request
Combined lines per request
Fix#2285
This change adds an internal counter for each tcp/web socket connection
that the server makes and queries the stored memory count at login
rather than the previous way that quired the database during each login.
Each login that quired the DB put a significant load on the server as
the user base grew.
* Add enable/disable log query functionality
This change adds the ability for server owners to allow log querying
from inside the client. In the event the functionality is not allowed a
result is returned indicating the functionality is disabled.
* Added translation
Added the ability for the disabled messages to be translated.
Fix#2249
Add the ability for the client to remember the missing features that it
received from the server it last connected to and not display the
"missing/optional feature" message at every login.
* Server side idle timeout
Initial commit for server side idle timeout counter. This adds a new
int value that is updated when room/game/mod/admin commands occur and is
checked during the regular ping timout function that if the users new
"idle" value exceeds the idleclienttimeout value defined in the servers
configuration file the user is logged out. The user will receive a
warning at the 90% time frame mark about being idle.
* Use round instead of ceil
Travis fix for older xcode issue's.
* Fixed requested items
Mis-spelleed function, added header, added warning message sent check
value. Also corrected the protobuf declaration file for
event_notifyuser
* Moved bool to protected
* Re-Ordered Declarations
* Removed most stylistic items
Resolved most noted things.
* Remove client side idle timeout
Removed client side idle timeout functionality
* Created first round of helper functions
Started to go through server init function and move statically defined
variables that the server uses into helper functions to allow for
dynamic changing while the server is up rather than requiring a restart.
* Completed Helper Function Creation
Completed adding all the helper functions along with updated the virtual
server function calls and renamed helper functions to match settings
cached ini value names for clarity.
* Comment Cleanup
Removed lines commented out throughout previous changes as well as
cleaned up variable declarations that are no longer needed with helper
functions that query the settingsCache
* Added featureset dynamic refreshing
Added slots/functions/calls for updating the required feature sets
dynamically.
* Created first round of helper functions
Started to go through server init function and move statically defined
variables that the server uses into helper functions to allow for
dynamic changing while the server is up rather than requiring a restart.
* Add client UI setting for idleclientdisconnect
Added disabled option in client UI for client disconnect.
* Updated settings text
Updated settings text for clarity.
* Updated descripton text (again)
Per request for clarity
* Update log path example when running under windows
Added example of log path syntax when running servatrice under windows.
* Missed example bra cket
* Added user privilege level
Added a enum column in the users table named "privilevel" with the
current values of "none", "vip", and "donator". Also allowed anyone
with a higher privilege level than "none" to log in even if the server
is set to limit the user total and the user limit is reached. This
change add's the new user information into the users container that gets
populated and passed between client and server.
* Added user privilege level
Added a enum column in the users table named "privilevel" with the
current values of "none", "vip", and "donator". Also allowed anyone
with a higher privilege level than "none" to log in even if the server
is set to limit the user total and the user limit is reached. This
change add's the new user information into the users container that gets
populated and passed between client and server.
* don't use corrected name when downloading card (#2164)
* Fix dynamic user limit settings
PR #2220 removed the ability to be able to change the max user limit
count while the server is running requiring a restart to make the
settings change. This PR reverts the behavior back to how it operated
prior to the PR.
* Call class functions for consistency
Updated code to call functions for consistency.
* don't use corrected name when downloading card (#2164)
* Added user privilege level
Added a enum column in the users table named "privilevel" with the
current values of "none", "vip", and "donator". Also allowed anyone
with a higher privilege level than "none" to log in even if the server
is set to limit the user total and the user limit is reached. This
change add's the new user information into the users container that gets
populated and passed between client and server.
* Corrected Typo
Corrected typo in DB Migration Script
* Git fuckup?
* Added word column
Added the word column to migration script for backwards compatibility
PR #2220 removed the ability to be able to change the max user limit
count while the server is running requiring a restart to make the
settings change. This PR reverts the behavior back to how it operated
prior to the PR.
* Add `disallowedwords` setting and perform check
Check if any of the words in `disallowedwords` are contained in the username. If
so, return false like other checks.
NOTE: Needs testing for advanced bugs.
* Remove "administrator" from `disallowedwords`
"administrator" contains "admin" anyway, so it is not needed.
* Add error message if username contains a disallowed word
* Add `disallowedregexp` setting and perform check
Check if each expression in `disallowedregexp` exactly matches the username. If
so, return false.
TODO: Add specific error to dialog in `window_main.cpp`.
* Add error message for username matching RegExp
* Fix indentation
* Compile `disallowedregexp` into a QList upon initialization
Reduces system load with each registration request.
* Clean up `isUsernameValid` function
* Fix indentation
* Add backwards compatibility to client
Client can accept either 7 or 9 rules to maintain compatibility with older
versions of server.
* Add examples and warnings to `servatrice.ini`
This change accomplishes two goals. The first is it moves the checking
for if the servers set user limit is reached out of the socket interface
and into the protocol handler portion of the code (were it should live).
It also eleminates the need for a DB query at login to check the user
count. The user account is actually already maintained by the server
and a function already existed to get the user count total.
Added the functionality client side to log users out of servers if they
are idle for more than 1 hour without joining either a game or room.
Sending a message (room/game/private) or performing a game action.
In some situations, when the server disconnects the client during a login,
multiple dialogs will be shown. This is undesirable behavior, and hence
`loginError` should only be called when the client is actually connected
(`response.response_code() != Response::RespNotConnected`).
Add an autocomplete with known server names to the connect dialog;
Added support for server messages (identification, shutdown, user
warning and promotion)
Connection dialog’s inputs are now wider
Only declare implemented client features
Added check for protocol version on connect before login
Avoid listbox being rendered as dropdown on mobiles
* There is a circular update loop I had to cut off where the name field
updates the filter and then the currentRowChanged signal is firing without a row.
* I chose to make a private method to show intent instead of relying on
other QLineEdit methods (textEdited) that don't fire signals.
* Some other shenanigans may be at hand that are causing this
workaround, but my familiarity with Qt is pretty low.
added paragraphs for better readability
link to wiki on how to use docker
(also reordered the running part, call it alphabetically or most important part on top... both apply :P )
ClientID is now generated on startup and stored in settings cache. Then
upon connect there is a new SrvClientID generated from the ClientID +
servername being connected to
I'm working on a theme and realized we have a toolbar that used to be used for price, which we no longer display. I removed the code (and the unused price code action) as we weren't using either.
P/T column is really narrow. It should go before Card Type, so Card Type can expand into the remaining space.
Improves #1671, assuming I got this correct.
Untested!
* main.cpp: removed path checking and db loading
* card database: merge card loading methods into a single one
* settings cache: take care of returning safe paths for decks,
replays, etc..
* main window: if db loading fails (eg. first run), propose to run
oracle
NSIS: propose to run cockatrice instead of oracle
Rework card database loading
* Move carddatabase-related method out of deckeditor tab
* Load cards in another thread and render them progressively
* Optimize database reload after enabled sets change
Fix deck editor column width
* removed the noCard hack.
* getCard() no more creates cards instead of just returning existing
ones
* Fix the “edit tokens” dialog.
* PictureLoader: avoid trying to download twice the same card
* PictureLoader: correct return of card background
* AbstractCardItem: avoid recalculating card color at every paint
Use a different file to save custom tokens
Misc required improvements
* Use nullptr;
* Refactor CardInfoWidget to use CardInfoPicture and CardInfoText
instead of duplicating code;
* Added CardInfo::getColorChar()
* Fixed some potential crashes
* removed dead code related to CardInfoWidget
* Don't require a restart after adding a new custom sets file
* Bump CMake requirements to 3.1
Update the replay maintenance script to allow for rolling replay maintenance along with cleanup of the two associated db tables (replay access and games). This updated script will now allow players to see the past X days (8 by default) of replays rather than loosing all replays from the point in the the script gets run.
- added small 'new user guide' at top
- reworked 'downloads' part
- changed layout of 'translation' part
- removed server list in favor of gh pages link (server list can be found there)
- switched to https everywhere (zlib not supported yet --> added hint)
That marker is only recognized by pb3-compatible compilers, meaning that
tools which are otherwise compatible with our files break on them.
Notably, this includes hprotoc (for haskell).
With this update a new chat history definition is added on a per
room bases which allows operators to specify the number of chat
messages to store and present to the user on join. Please see
the sample ini for room definitions.
When in none auth mode, registered users don't exist; hence the setting
makes the game impossible to join.
Normally the setting would be greyed out when the user is unregistered,
but commit 475c54bf introduced a new edge case where the stored setting
would apply to the field even if the user is unregistered, making the
setting possible to apply in no-reg mode. Regardless, any client could
have done this, not just the default cockatrice.
The server side fix should prevent all issues in the future.
This update address's the issue were a server with no db has only non-registered users but when creating a game will cause the dialogue to only allow the check box of "registered users only" resulting in a game that no user will ever be able to join.
Changed the default value for the client keep alive variable back to 1 (since that is what the setting is if the value is not found in the configuration ini file).
This adds the ability to select previous servers from a list to connect
to.
You can remove items from the drop down by selecting them and pressing
delete.
If you connect to a new host it will be added to the previous hosts.
It will remember the last host connected to in the dropdown.
Rather than having the username limitations hard coded, I have moved it
into the ini file. I have added some examples to the code and also to
the ini.
This is only and example and can be expanded on by others.
Stub for registration command handling in server
First draft of handling registration requests
WIP (will be rebased)
clean up bad imports (rebase this later)
Finish checkUserIsBanned method
Add username validity check
Check servatrice registration settings
WIP
Finish(?) server side of registration
Needs testing
Fix switch case compile failure
I have no idea why I have to do this
WIP for registration testing python script
Stub register script initial attempt
Rearrange register script
First try at sending reg
register.py sends commands correctly now
Add more debug to register.py
Pack bytes the right way - servatrice can parse py script sends now
register.py should be working now
Parse xml hack correctly
Log registration enabled settings on server start
Insert gender correctly on register
Show tcpserver error message on failed gameserver listen
Fail startup if db configured and can't be opened.
TIL qt5 comes without mysql by default in homebrew...
No longer need to use the [url] tags to add **HTTPS** links. I want to
only link to "secure" site by default, hence only https.
Users can still use [url] tags if they want to.
The ENTIRE chat code needs to be rewitten, as it is just packing more
code upon code. It can be done in another PR though. This just gets the
base working feature in place.
* uninstaller: delete zlib1.dll (first issue in #876)
* require the user to uninstall the old version before installing the
new one
* use project-version as branding name (fourth issue in #876)
+ added sound setting page
+ added sound setting icon
+ moved sound settings from interface settings
Added master volume
+ added master volume slider.
+ volume can be changed by sliding bar or by using the spin box
+ Preview of volume will be played when dragging and releasing bar.
Added checks for qt4
Qt4 does not have support for setting the volume without some lengthy
work around, I have disabled volume control for qt4 users and have
mentioned that "Master volume requires qt5".
Updated sfx
+ removed all old sfx
+ added new end step and tap sound
+ tap/endstep sound has a timer on it to prevent spamming
+ test sound engine will now use endstep sound
Made end step sfx softer
end step felt too harsh
Added player joined sound
+ added a sound for when a new player joins a room
Updated
Was missing a sound when a player joins
Made end step softer
Made end step even softer
updated sound again
I saw in some images from other platforms it can take up alot of space.
Made the boxed horizontal, rather than vertical.
WIP Remade reveal zone
+ darkened card area to eaisily see boundries
+ reverted back to using a window
+ window can be resized
+ removed fake title bar and "X"
+ moved all cards revealed slightly to the right, makes it easier to
drag-select from the left
Cleanup
Changed style to use cockatrice icon
Changed cast
from static_cast to qstyleoption_cast
I have moved the default opening positions of some of the reveal zones.
Example:
The sideboard will be in the same position as the scry and the random
card from hand will be the same as the hand view.
Previously if you were to reveal the top card, then look at the top x (x
> 1) cards, then move them to another zone, the top card would stop
being revealed.
The issue was that when moving the cards the first card was being
revealed, then being moved.
I have also fixed an issue too:
+ reveal top card
+ scry 4
+ grab all cards and move to the first column of available space at the
left most of the screen (column 0). Everything is fine.
+ now try with another column (> 0), you will see that the card order
has flipped.
This no longer happens.
This needs some testing before being merged. I will run the build for a
while, right now it feels good though.
Will need @ctrlaltca to confirm this wont mess anything up. I have
removed a option to se set from the cmake file. This option is not
needed.
Windows users, you will need to run cmake to create the sln again.
Reverted back. Right now it feels strange to only have simple search.
Really you would want both simple search AND accurate search on, though
this requires twice the checks for each result.
Move the “check unknown sets” method inside the cards database, so that
it can be executed when the card database gets reloaded after a card
database update.
Additionally, show the user a welcome message the first time they run a
new cockatrice version, so that they know why they get shown the “edit
sets” window and how to hide/disable sets.
-updated and cleaned up cockatrice+servatrice svg's
-added old original svg's for future adjustments
-updated cockatrice+servatrice png's
ico+icns updates
-see #925 for more details
-updated svg's as source for new icon files
bmp updates
-updated svg's as source for new installer logos
cleaned up oracle.svg
cleaned up oracle.svg /2
svg updates /2
removed sensible data
`inkscape:export-filename` removed
removed sensible data
inkscape:export-filename
removed sensible data
inkscape:export-filename
removed sensible data
inkscape:export-filename
fix
fix2
Addresses issue #1032
If a token is created with no p/t then the local db value will be passed
instead. If a value is provided then that will be used instead.
The issue was that I had set the ctor to set the p/t to 0/0 rather than
-1/-1. This meant that when you join a game in progress (spec or
reconnect) the server would send the card value to the client as 0/0,
instead of -1/-1. The client has been coded so that if the toughness is
<0 then dont show it. 0/0 is instead shown.
We still need to look into cards with no p/t being set to a 0/1 as
@tooomm mentioned in anther issue. As it stands, this is more important
than that.
After feedback, and also noticing myself, the blue requires a little
more focus than should be nessesarry. I have updated to be orange, which
feels more comfortable. I have polled the community and they also agree
orange > blue.
Will follow the following rules
+ send a message initially
+ send a message every 20 mins
+ send a message every min when time <= 5
Updated client popup
Updated client to close any previous popups and bring up a new one.
NEEDS TO BE TESTED
added missing include
Added delete on close
I compare the card pt, to the card with the same name in the db. if the
card is found, we compare the pt, of the db item and the item in play.
If there is not a match then we change the color of the PT. This is
pretty much the same as mtgo does it.
I looked into having only the P, or the T colored, though this is not
posible, when you set a pen color you can not change it partway through
painting a string. That would require 3 strings painted, one for p, /
and t. Which is more effort than its worth. This does the job pretty
well.
I have also moved the pt slightly to the left so it lines up better. I
have some images to compate.
Remove argument that if added by default with out having the proper configuration defined during compiling would cause cockatrice to not open properly.
When clearing the chat, we now clear the last sender.
This fixes the issue where you clear the chat and a user continues to
talk, you get no indication of who is talking. Now it will show the
users name.
As the server has been updated to enforce username rules, we can now
check for the next position of whitespace. This allows ALL users to have
a working mention system. Currently "-" is available for users, this
will fix that.
+ No longer get "5hrs" and "5+ hrs" instead will be "4hrs" and "5+ hrs".
+ Refactored into an else-if with a single return.
+ removed comments
+ removed code from namespace and added to class
When searching for a card the line edit will not be empty, so this check
is not needed. The performance when the line edit IS empty will take a
slight hit, but you really want additional performance when searching,
not when the line edit is empty.
Removing will increase performance.
Previously would try to match the card name, if nothing is found, then
we would try again with the simple name.
I have now made it only the simple name version. We do not need to
perform the first check. Should help a little with performance.
I have updated the `maxMessageCountPerInterval` from 10 to 15. This will
allow some faster play from exp users.
NOTE:
If you have an existing server and update to this version, you will need
to manually change the value in the ini file, or have no ini file to
begin with. Otherwise the old ini will load in 10.
The problem was that back when I added #336 I made it so that if YOU
didnt recive the PT of the token, then it would be fetched from your
tokens.xml, the issue is that we needed to send that value to the
server. The server sees it as a 0/0
This fix will send the PT from the tokens.xml if available.
It is awkward to have to use precise punctuation when searching for
cards. Planeswalkers and legendary creatures often have "," in the name
and you have to enter it.
This commit means you no longer need to do that.
+ Can use " " in place of "-" (example: Wilt-Leaf Liege)
+ Can use "" in place of non word chars (Example: Hero's Downfall and
Ajani, Caller of the Pride)
Workaround the two remaining issues, mostly fixing the “load deck”
screen in tab_game:
* Only preload up to the first 300 cards of a deck;
* don’t even bother trying to load card images if they’ll be shown
with width <= 10
Trying a 17k cards deck like the one proposed in #67 is still a no go,
mostly due to the cpu time used to create all the objects. Anyway, i
tested decks up to 8k cards and they works fine now (if you like to
wait while trice is loading them)..
if you have the setting to NOT play cards to the stack enabled, it meant
that any spells (like Lightning Bolt) would be cast to the stack but no
arrow would show. This was an edge case I missed.
Set to false by default, let me know if you think it should be true.
As all cards are played to the left of the screen this feels more
comfortable to use as you dont need to keep looking at different areas
of the screen.
Will auto rearrange when changed during game-play.
Mullling through 2 hands will give a flood warning, a user thought this
should not happen. It is very similar to drawing cards, which is in the
white list.
Previously if you middle click on a counter (life/mana) and then click
away, depending on the button clicked, the counter would +/-.
I have added a fix to make sure the mouse is over the counter to change
it.
I noticed that sometimes I would have lots of icons in the sys tray. I
would have to mouse over them to make then be removed. This also happens
with some other programs too. I have added some code to hide() the sys
icon when the client is close, it seems to be helping with the issue.
Hard to reproduce, might also only be a windows issue.
+ Can be used for setting client size and closing the client.
Will expand on by sending client alerts to the tray.
Updated to push message notifactions to the toolbar
Preview image:
Added setting to enable/disable message popups
Added functionality
+ updated popup message and translation
+ Double clicking tray icon will now bring up the app/minimize it
+ can now be alerted of mentions
+ added setting to set if you want mentions on desktop
+ clicking mention message will take you to the main chat
+ added translations for icon menu
+ removed maximize/minimize/restore from menu, not needed.
Added disconnect
+ Disconnects any previous message slots/signals from the system icon
message bubble
This is enforcing a new client wide color scheme.
RULES
+ Green = Major server message (Welcome to chat room, change phase...)
+ Red = Minor server message (timestamps, game actions...)
+ Blue = Key word
+ Blue with modifier (underline/italics) = Keyword that can be
interacted with.
+ Black = User text
+ key numbers are now blue. player drew X cards, looks at the top X
cards, places X counters on . . . and so on.
+ card names are now italic (different from urls now)
I did have the player names set to blue also, but it felt like too much.
Player names in phase change are blue
Updates
+ Updated username colors in phases to match other areas of client
Small update
+ Made server message in chat room bold
+ made User names in chat/pm match the weight of in-game (consistancy)
fix for #749
+ You can now search for sets using lower case: "frf", "dtk", "rtr" and
so on.
+ You now need exact matches on set short and full names. "rtr" and
"return to ravnica" will work. "return" will not work.
I had previously removed some filtering code that would allow users to
filter cards using our filtering tools. This functionality has now been
re-added.
Script to add the first admin account to the servatrice database. Running this script after setting up a servatrice server will add the user account "servatrice" with the password of "password".
Due to an exploit of being able to mimic a die roll in a message:
"Hi all gl, hf !
username rolls a 20 with a 20-sided die."
I have changed all server messages to be colored.
Card search will now order the following way:
1. Exact match at top
2. Exact match with preceding values sorted lexically.
3. Match contained in word sorted lexically
While having more than 1 client open I found it hard to know which user
was which. I have added the user name to the title bar so you know who
you are logged in as.
Fix#782
The script will remove any registered user accounts that are not active that are 5 days old or older (by default). You can change the time frame to whatever liking you desire.
Code will now perform a one time check on starting to see if the cache
has been updated to the new 2048 default. If the update has not been set
we update. After this time if the user lowers the level, it will not
reset back to 2048 by default.
The problem was converting a negative int to an unsigned int. This was
resulting in a value of: (2^32) - n. Meaning that the room age was
extreamly old. After 48s the delay from the server will catch up and the
time diff will be 0 rather than negative, which is why after 48s the
room will change from 5+ hours to <1 min.
* ignore .tx folder
* cmake: when UPDATE_TRANSLATIONS=ON, extract new strings only to the
english translation file.
* added info in CONTRIBUTING.md
* updated english translations
- add link to translation faq in the wiki
- force more space between the images
- updated the picture links
Did you change any names from "oracle_ents" to "oracle" within transifex @ctrlaltca?
- add separate links to different translation files (cockatrice_en.ts & oracle_en.ts) if you click one of the statistics
- added transifex icon with link to cockatrice project
- text changes
Imported unzip methods from OSDaB-Zip project;
Adds a soft dependency on zlib to oracle; if lib if not found, oracle
will continue to compile and work but without zip support.
+Chat mention / username color can now be set via hex in the settings
+ Users can invert the color of the mention text black/white
+ if an invalid color is provided, the default will be used
now checks for non characters, so a mention s like "@username!" will now
work.
Requires some testing though, there are a lot of scenarios to check for.
Added new strings
Changed all instances of ‘zone’ based on oracle text of Torrent
Elemental
Changed all instances of ‘registered users’ into more commonly used term
+ removed password column
+ added a lock svg to restrictions if pw is needed
+ added "password" to restrictions if pw is needed
+ added user pawn to creator tab
+ reformatted code for easy adaptation later
~ Removed some heap allocs
~ Remaining heap allocs are needed.
~ Unrolled "one line" declarations in header
~ restructured logic in GeneralSettingsPage
Refactored Appearance Tab
- removed some heap allocs
- removed setting of zone view, its not needed here, its configurable in
real time, in game.
+ When viewing a sorted view (like revealing hand, or looking at
library), the cards will now be sorted in columns based on the main card
type.
+ Settings are now saved.
When being mentioned in a post with '@username' you will now see the entry highlighted. This
helps to see when someone is talking to you. It work across the main
chat, in game and in private chat.
+ Moved Icons to the top. You can now see all options.
+ All SVGs now have a background (GO! was missing one).
+ All SVGs now have the same background (General had one of its own)
+ Added the ability to see the account age of registered users. Changes
are both in server and client. The server will now send back the
registration date along with the user data. The client will then use
this to calculate the account age and display it in the user details
window.
Drop CardInfo’s own pixmap caches; use QPixmapCache instead.
Use QPixmap references instead of pointers.
Being stored in QPixmapCache, all card images are now subjected to
QPixmapCache’s size limit
Revealed library had write access, which meant that the user would see cards being removed from the zone as the other player drew cards. The cards were not the actual ones drawn, just the ones at the same index, so no information was leaked.
Fix#297
Hard coded CSS might have a slight chance of not rendering the same
across all platforms. More research needs to be performed. Until then I
have removed the hard coded search bar customization.
Please note that I don't feel that the search bar needs to be skinned by
users, hence why it is not part of the large css-skinning project. I
also feel that given the PR #416 a new search bar with highlight the new
search functionality.
Updated the look of the search bar:
+ larger, curved edges
+ changes color when has focus
+ search icon built into search
- removed "Search For" text in lieu of search icon
Running cockatrice in valgrind i didn't found any bad memory leak
(good!), but only a few jumps depending on uninitialized variables.
Even if the possibility of crashes are remote, it's nice to sort them
out.
Refactored the image loading loop to be two nested for loops: the outer loop iterating through the QList of paths to folders in which to search for images and the inner loop iterating through the QList of supported extensions.
/cockatrice/src/main.cpp:162:16: warning: format string is not a string
literal (potentially insecure) [-Wformat-security]
qDebug("Could not create " +
settingsCache->getPicsPath().toUtf8() + "/CUSTOM. Will fall back on
default card images.");
If a path to cards.xml is set, Oracle will update that cards.xml.
If Oracle is run before a path to cards.xml is set, if default is checked, cards.xml will be saved on the AppData path. Furthermore, this path will be set as the cards.xml path for both Oracle and Cockatrice.
If Oracle is run before a path to cards.xml is set, if default is NOT checked, cards.xml will be saved at the selected path and this path will be set as the cards.xml path for both Oracle and Cockatrice.
If a path to cards.xml is set, if default is NOT checked, cards.xml will be saved at the selected path but this path will NOT be set as the cards.xml path for either Oracle or Cockatrice. This allows people who already have a cards.xml (which may be customized), to still obtain clean copies of cards.xml through Oracle without overwriting their own
Some tabs to spaces, and maybe fixed to work with Qt 5.
Conflicts:
cockatrice/src/deckstats_interface.cpp
common/decklist.cpp
common/decklist.h
oracle/src/oracleimporter.cpp
* Use the new, shortest API m=
* for a card, grab prices for all sets
* use the lower price for a card from all sets, but avoid prices=0
(e.g.: some M15 cards have no price yet)
Implemented the ability to set the server to only allow registered
users. Also updated client to reflect the log-in rejection as well as
put a check in place for the server to not start if db connection is not
available yet registration is required.
Query card database to get a multiverseis for a card.
Get card price using that id instead of card name.
Tested Aether, split cards, question elemental?, _____
Probably settingscache would have been the correct place for the enum,
but keeping it in the same class/file where price sources are defined
sounds cleaner to me
* the previous PriceUpdater class has become abstract
* BLPPriceUpdater inherits the old code for blacklotusproject.com
* DBPriceUpdater is a new implementation for deckbrew.com
* add a setting to choose between the two
* Move all cmake-related files in a new “cmake” folder
* move nsis files in there, too, since they are templates parsed by cake
* retrieve git version once when cmake is run, and use it for both
creating version_string.h/cpp and for package naming
removed un-used variables
changed switch case to increase verbose level as loglevel increases
captured unset loglevel to default to highest verbose log level
<sub>We are also packaged in <kbd>Arch Linux</kbd>'s <a href="https://archlinux.org/packages/extra/x86_64/cockatrice">official extra repository</a>, courtesy of @FFY00.</sub>
<sub>General Linux support is available via a <kbd>flatpak</kbd> package at <a href="https://flathub.org/apps/io.github.Cockatrice.cockatrice">Flathub</a>!</sub>
</pre>
## General Notes
We're pleased to announce the newest official release: <kbd>--REPLACE-WITH-RELEASE-TITLE--</kbd>
We hope you enjoy the changes made! All improvements with their corresponding tickets since the last version of Cockatrice are listed in the changelog below.
If you ever encounter a bug, have a suggestion or idea, or feel a need for a developer to look into something, please feel free to [open a ticket](https://github.com/Cockatrice/Cockatrice/issues). ([How to create a Ticket for Cockatrice](https://github.com/Cockatrice/Cockatrice/wiki/How-to-Create-a-GitHub-Ticket-Regarding-Cockatrice))
For basic information related to the app and getting started, please take a look at our official site: **https://cockatrice.github.io**
If you'd like to help and contribute to Cockatrice in any way, check out our [README](https://github.com/Cockatrice/Cockatrice#contribute).
We're always available to answer questions you may have on how the program works and how you can provide a meaningful contribution.
## Upgrading Cockatrice
<!-- this optional section puts a warning banner for problems with updating
> [!IMPORTANT]
> **With this release, we no longer provide a ready-to-install binary for:**
> --DEPRECATED-OS-HERE--
-->
Run the internal software updater: <kbd>Help → Check for Client Updates</kbd>
Don't forget to update your card database right after! (<kbd>Help → Check for Card Updates...</kbd>)
## Changelog
<!--
This list is generated and should be moved to their respective header and
possibly edited a little.
Append PR numbers of fixups to their main PR to keep the list coherent.
Put the quantity of remaining PR's below the highlights section.
Remove empty headers when done.
--REPLACE-WITH-GENERATED-LIST--
-->
<!-- Highlights of the release -->
### 🔖 Highlights:
### ✨ New Features:
### 🐛 Fixed Bugs / Resolved Issues:
<!-- Complete list of changes (foldable) -->
<details>
<summary>
<b>Show all changes</b> (--REPLACE-WITH-COMMIT-COUNT-- commits)
</summary>
### User Interface
### Under the Hood
### Oracle
### Servatrice
### Webatrice
</details>
## Translations
- **Thanks for over 300 people contributing to 20+ different languages up to now!**
- Without the help of the community we couldn't offer that great language support... keep up the good work!
- It's actually very easy to join and help for yourself - find out more here:
- [Help us Translate Cockatrice into your native language!](https://github.com/Cockatrice/Cockatrice/wiki/Translation-FAQ)
## Special Thanks
<!-- Personalise this a bit! -->
It's amazing that so many people contribute their time, knowledge, code, testing and more to the project.
We'd like to thank the entire Cockatrice community for their efforts! 🙏
<!-- We'd like to especially recognize @ZeldaZach, --ADD-CONTRIBUTORS-HERE-- for their help in preparing so many amazing new features for the user base. -->
<b>To get started with Cockatrice ⇢ [view our webpage](https://cockatrice.github.io/)</b><br>
<b>To get support, or suggest changes to the app ⇢ [file an issue](https://github.com/Cockatrice/Cockatrice/issues) ([How?](https://github.com/Cockatrice/Cockatrice/wiki/How-to-Create-a-GitHub-Ticket-Regarding-Cockatrice))</b>
<b>To help with development ⇢ learn [how to contribute](#contribute-)</b>
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.<br><br>
This project uses <kbd>C++</kbd> and the <kbd>Qt</kbd> libraries.<br>
First work on a webclient with <kbd>Typescript</kbd> was started as well.<br>
Cockatrice is an open-source multiplatform software for playing card games,
such as Magic: The Gathering, over a network. It is fully client-server based
to prevent any kind of cheating, though it supports single-player games without
a network interface as well. Both client and server are written in Qt 4.
[](https://github.com/cockatrice/cockatrice/releases)  [](https://tooomm.github.io/github-release-stats/?username=Cockatrice&repository=Cockatrice&search=0) [](https://github.com/Cockatrice/Cockatrice/pulls?q=is%3Apr+is%3Aclosed)
<sub><i>While incorporating the latest fixes and features, beta builds may not be stable or contain new bugs!</i></sub>
<sub><b><i>Please report any findings and open new issues when testing them!</i></b></sub>
</pre>
# Building
# Related Repositories
Dependencies:
- [Magic-Token](https://github.com/Cockatrice/Magic-Token): MtG token data to use in Cockatrice
- [Magic-Spoiler](https://github.com/Cockatrice/Magic-Spoiler): Script to generate MtG spoiler data from [MTGJSON](https://github.com/mtgjson/mtgjson) to use in Cockatrice
- [cockatrice.github.io](https://github.com/Cockatrice/cockatrice.github.io): Code of the official webpage of the Cockatrice project
- [Qt](http://qt-project.org/)
- [protobuf](http://code.google.com/p/protobuf/)
- [CMake](http://www.cmake.org/)
The server requires an additional dependency:
# Community Resources [](https://discord.gg/3Z9yzmA)
Join our [Discord community](https://discord.gg/3Z9yzmA) to connect with other projet contributors (`#dev` channel) or fellow users of the app. Come here to talk about the application, features, or just to hang out.
>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.
mkdir build
cd build
cmake ..
make
# Contribute
### Code
To contribute code to the project, please review our [guidelines](https://github.com/Cockatrice/Cockatrice/blob/master/.github/CONTRIBUTING.md) first.<br>
We maintain two tags for contributors to easier find issues to potentially work on:
- [](https://github.com/Cockatrice/Cockatrice/issues?utf8=%E2%9C%93&q=is%3Aopen%20is%3Aissue%20label%3A%22Good%20first%20issue%22%20)<br>
Issues tagged in this way provide a simple way to get started. They don't require much experience to be worked on.
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.<br>
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!
Cockatrice tries to use the [Google Developer Documentation Style Guide](https://developers.google.com/style/) to ensure consistent documentation. We encourage you to improve the documentation by suggesting edits based on this guide.
<details>
<summary><b>Kudos to our amazing contributors ❤️</b></summary>
Cockatrice uses Transifex to manage translations. You can help us bring <kbd>Cockatrice</kbd>, <kbd>Oracle</kbd> and <kbd>Webatrice</kbd> to your language and just adjust single wordings right from within your browser by visiting our [Transifex project page](https://explore.transifex.com/cockatrice/cockatrice/).<br>
Check out our [Translator FAQ](https://github.com/Cockatrice/Cockatrice/wiki/Translation-FAQ) for more information about getting invovled, and join a group of hundreds of others!<br>
Oracle can *optionally* use some packages to load compressed card files:
- [xz](https://tukaani.org/xz/)
- [zlib](https://www.zlib.net/)
<br>
**Basic compilation steps:**
```bash
mkdir build
cd build
cmake ..
make
```
You can then
- Create a Cockatrice installation inside the `release` folder:
```bash
make install
```
- Or make an installation package specific to your system:
```bash
make package
```
The following flags can be passed to `cmake`:
>[!NOTE]
>Detailed compiling instructions can be found in the Cockatrice wiki at [Compiling Cockatrice](https://github.com/Cockatrice/Cockatrice/wiki/Compiling-Cockatrice)
-`-DWITH_SERVER=1` build the server
-`-DWITHOUT_CLIENT=1` do not build the client
<br>
# Running
The following flags (with their non-default values) can be passed to `cmake`:
| Flag | Description |
| --- | --- |
| `-DWITH_SERVER=1` | Build <kbd>Servatrice</kbd> server |
| `-DCMAKE_BUILD_TYPE=Debug` | Compile in debug mode<br> 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<br> **Note:** `make clean` will remove the .ts files |
| `-DTEST=1` | Enable regression tests<br> **Note:** `make test` to run tests, *googletest* will be downloaded if not available |
| `-DFORCE_USE_QT5=1` | Skip looking for Qt6 before trying to find Qt5 |
`oracle` fetches card data
`cockatrice` is the game client
`servatrice` is the server
# Run
<kbd>Cockatrice</kbd> is the game client<br>
<kbd>Oracle</kbd> fetches card data<br>
<kbd>Servatrice</kbd> is the server<br>
#### Docker
You can build an image & deploy a <kbd>Servatrice</kbd> (Cockatrice server) container using [Docker](https://www.docker.com/resources/what-container/) and our Dockerfile yourself.<br>
For more details, look into our wiki section on [Setting up Servatrice](https://github.com/Cockatrice/Cockatrice/wiki/Setting-up-Servatrice#using-docker).<br>
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.
This is an unordered list of possible todo items for Cockatrice.
Note that "improve" and "write" always also means: "document and comment"
##Docs
* Improve README.md, it is very minimalistic and technical
##Improve packaging:
* Add SSL libraries to Windows build to support https links in oracle.exe
* Improve nsis file git hash extraction, it only works if the build directory is cleared as version_string.cpp does not seem to get updated by git pull/cmake
* Fix prepareMacRelease.sh to use default installation paths for Qt and protobuf
* Add Mac compile+package howto to the documentation
* Create script/... for creating Linux packages (deb, rpm, ebuild, ...) or at least an official tarball/git tags; package maintainers dislike using git snapshots so much that they rather ignore software without stable tarballs.
* Move everything package related into one directory
##Scripts
* Write example init script for servatrice.
##Webinterface
* Write a default cgi webinterface in some language for the servatrice database. Keep it simple and think about SQL-injections and other security risks - especially if you do it in PHP :-P
##Improve usermanual:
* Improve Layout, Text, Screenshots; nearly everything is still quick n dirty copy and paste.
* Add missing TODOs
* Translate the Documentation
* Include faq.txt and shortcuts.txt in usermanual, then remove them.
* Rename the picture filenames to something more meaningful.
* Create an index, lists of tables/figures/...
## Storage
* Find a better place for sets.xml than doc.
##Create developer documentation:
* Create developer manual
* Add comments to code
* Describe which components exist and how they work and interact
* Describe the *.proto files
* Comment and document servatrice.sql
* Document everything!1!!
* Coding guidelines
##Else
* Update SFMT library (http://www.math.sci.hiroshima-u.ac.jp/~m-mat@math.sci.hiroshima-u.ac.jp/MT/SFMT/) in common/sfmt and adapt common/rng_sfmt.cpp
* Prepare to update to Qt5, as Qt4 will die some day. See http://qt-project.org/wiki/Transition_from_Qt_4.x_to_Qt5 for relevant information.
* Move hardcoded URLs (especially from oracle and cockatrice) into a config file.
* Update the oracle to find all MtG extensions by itself, why the need for sets.xml when the oracle could ask the Gatherer or magiccards.info directly for this information?
* Update the oracle with some intelligence or improve it otherwise to deal with changes from the Gatherer.
* Remove cockatrice/resources/mtgforum.png as it is unused. Find other dead files or dead references to websites and files in the program code and documentation.
* Search git log for useful information/problems/bugs/...
d="M 30.806368,0.85686126 C 29.034982,0.98914726 27.264478,1.1656403 25.510612,1.4661773 C 23.796106,1.7655132 22.103629,2.1976442 20.439589,2.7281242 C 19.21728,3.1056042 18.017557,3.5646622 16.839452,4.0765812 C 15.651082,4.6034292 14.495935,5.2138092 13.371335,5.8801812 C 11.912816,6.7464622 10.530751,7.7539632 9.2243805,8.8609672 C 8.4187244,9.5430992 7.6399884,10.262469 6.9145177,11.040719 C 5.620197,12.403477 4.4818823,13.932601 3.5234442,15.580236 C 3.0019741,16.480068 2.5348238,17.416384 2.1362796,18.385123 C 1.6804251,19.48228 1.3317871,20.628769 1.0695948,21.795033 C 0.75652219,23.256251 0.60324564,24.756201 0.61124599,26.254797 C 0.62193487,27.552852 0.7897313,28.84366 1.0337442,30.113781 C 1.3344362,31.649962 1.8041461,33.150192 2.4506358,34.561073 C 2.8706852,35.492735 3.3543551,36.391419 3.8768235,37.261925 C 4.6419727,38.490076 5.5010793,39.654404 6.4706387,40.707329 C 7.3596606,41.662951 8.297604,42.566604 9.2722931,43.422059 C 10.463433,44.447127 11.745074,45.349675 13.080336,46.147036 C 14.167464,46.805262 15.285489,47.406349 16.432387,47.937391 C 17.335164,48.348844 18.246803,48.739932 19.176788,49.076573 C 20.176277,49.440994 21.187956,49.769331 22.213361,50.040982 C 23.982628,50.519355 25.787921,50.832673 27.59864,51.068576 C 29.184164,51.257577 30.778441,51.374509 32.374326,51.378135 C 34.208468,51.393245 36.04276,51.33635 37.876831,51.36666 C 38.434029,51.394132 38.996114,51.373533 39.548214,51.468857 C 40.395454,51.629691 41.189649,52.027723 41.897068,52.542095 C 42.906233,53.246246 43.82274,54.092615 44.675187,54.999399 C 45.512204,55.903243 46.266785,56.888703 46.983782,57.901568 C 48.063059,59.393702 49.050446,60.961084 50.183724,62.408718 C 50.603098,62.897907 51.029706,63.407601 51.587664,63.719884 C 51.804498,63.841768 52.103879,63.868879 52.289383,63.669383 C 52.572771,63.417588 52.620316,62.996395 52.649089,62.627433 C 52.711632,61.844833 52.599022,61.057825 52.408292,60.302829 C 52.168482,59.302677 51.78517,58.35174 51.462684,57.380495 C 51.201962,56.629345 50.962671,55.869992 50.710396,55.115547 C 50.335598,53.977982 49.982246,52.829592 49.724991,51.654708 C 49.578941,50.967344 49.473946,50.261071 49.510957,49.554493 C 49.543479,49.062371 49.729699,48.57395 50.076258,48.238512 C 50.511787,47.761469 51.012891,47.360634 51.477328,46.916997 C 52.923187,45.590001 54.409164,44.313642 55.874783,43.011823 C 56.757712,42.194646 57.618666,41.349135 58.421933,40.442755 C 58.916458,39.885813 59.394731,39.311891 59.833969,38.70424 C 60.710709,37.528802 61.472131,36.255065 62.089397,34.905016 C 62.686408,33.597774 63.1598,32.225673 63.496977,30.816995 C 63.918773,29.061675 64.112872,27.241367 64.04458,25.430114 C 63.993915,24.1628 63.842987,22.897362 63.555691,21.66543 C 63.293091,20.48664 62.918558,19.336609 62.453814,18.231165 C 61.999994,17.149646 61.468614,16.10516 60.855606,15.116435 C 60.398759,14.374017 59.907921,13.654553 59.383662,12.964365 C 58.538398,11.856043 57.592092,10.838847 56.596116,9.8845992 C 55.568274,8.9130772 54.485916,8.0053472 53.337013,7.2011982 C 52.664003,6.7221662 51.968792,6.2783912 51.259706,5.8627892 C 50.063297,5.1749212 48.837819,4.5423942 47.573935,4.0072892 C 46.156955,3.3945402 44.708468,2.8644512 43.241049,2.4062912 C 42.115855,2.0591482 40.971103,1.7877702 39.816603,1.5776382 C 38.516427,1.3486333 37.205879,1.1933933 35.894625,1.0565313 C 34.340149,0.91502526 32.779796,0.84208126 31.219584,0.84739626 C 31.081846,0.85055126 30.944107,0.85370726 30.806368,0.85686126 z"
d="M 26.408397,32.530967 C 26.408382,34.365536 26.267064,35.8999 25.984444,37.134064 C 25.701793,38.368225 25.246433,39.357778 24.618367,40.102731 C 23.990272,40.858787 23.215639,41.392479 22.294465,41.703806 C 21.373269,42.026239 20.232255,42.187459 18.871422,42.187466 C 16.903429,42.187459 15.322759,41.664886 14.12941,40.619746 C 12.94652,39.574592 12.328908,38.090261 12.276571,36.166747 L 15.024424,36.166747 C 15.013953,36.933927 15.202377,37.567688 15.589699,38.068026 C 15.987478,38.579479 16.458538,38.929715 17.002882,39.118734 C 17.55768,39.307746 18.175292,39.402252 18.855721,39.402257 C 19.776897,39.402252 20.546296,39.246593 21.16392,38.935277 C 21.79199,38.635071 22.273519,38.179209 22.608508,37.567691 C 22.95394,36.956165 23.194703,36.255695 23.330801,35.466276 C 23.466871,34.676857 23.534914,33.726217 23.534928,32.614358 C 22.299689,34.159841 20.760891,34.932583 18.918529,34.932583 C 16.70977,34.932583 14.95638,34.104249 13.658349,32.447577 C 12.360313,30.79091 11.711296,28.633905 11.711296,25.976556 C 11.711296,23.274749 12.355079,21.073269 13.642646,19.37211 C 14.930209,17.670984 16.69407,16.820411 18.934233,16.820394 C 21.142972,16.820411 22.765515,17.443053 23.801861,18.688318 L 23.801861,17.220663 L 26.408397,17.220663 L 26.408397,32.530967 M 19.138358,19.638957 C 17.672828,19.638971 16.552752,20.189341 15.778122,21.290069 C 15.003484,22.390823 14.616169,23.880713 14.616173,25.759743 C 14.616169,29.92922 16.139265,32.013956 19.185464,32.013953 C 22.116498,32.013956 23.582021,29.962578 23.582035,25.85981 C 23.582021,24.848029 23.482576,23.958542 23.283694,23.191348 C 23.08479,22.41306 22.833558,21.807096 22.529997,21.373457 C 22.236882,20.928728 21.880969,20.572933 21.462259,20.306072 C 21.043527,20.039241 20.650977,19.861343 20.284606,19.77238 C 19.918215,19.683446 19.536134,19.638971 19.138358,19.638957 M 37.462629,35.11604 C 34.960765,35.11604 33.029417,34.326621 31.668578,32.747781 C 30.318204,31.157825 29.643017,28.934109 29.643017,26.076625 C 29.643017,23.230274 30.323438,20.978763 31.68428,19.322077 C 33.055588,17.654306 34.981701,16.820411 37.462629,16.820394 C 39.870262,16.820411 41.770207,17.637628 43.162466,19.272045 C 44.565166,20.895372 45.266522,23.080174 45.26654,25.826456 C 45.266522,27.216288 45.11997,28.456008 44.826883,29.545626 C 44.54423,30.624133 44.162149,31.508061 43.680635,32.197408 C 43.199091,32.886763 42.612882,33.459371 41.922007,33.915232 C 41.241573,34.359975 40.534981,34.671296 39.802234,34.849193 C 39.079929,35.027091 38.300062,35.11604 37.462629,35.11604 M 37.462629,19.4555 C 35.861016,19.455516 34.641493,20.044801 33.804055,21.223357 C 32.966609,22.40194 32.547888,24.019695 32.547893,26.076625 C 32.547888,27.132896 32.657803,28.061299 32.877637,28.86183 C 33.097461,29.651257 33.369629,30.268337 33.694141,30.713076 C 34.029114,31.157825 34.426898,31.519178 34.887498,31.797139 C 35.348082,32.075108 35.777271,32.258565 36.175063,32.347512 C 36.583308,32.436462 37.012496,32.480937 37.462629,32.480935 C 39.074695,32.480937 40.294218,31.913888 41.121203,30.779789 C 41.948163,29.645696 42.361649,28.044622 42.361662,25.976556 C 42.361649,24.953655 42.251736,24.04749 42.03192,23.258058 C 41.81208,22.457534 41.534677,21.823773 41.199714,21.35678 C 40.875192,20.889814 40.482643,20.511781 40.02206,20.222684 C 39.571926,19.922498 39.137504,19.722363 38.718791,19.622279 C 38.31053,19.511109 37.89181,19.455516 37.462629,19.4555 M 49.584599,18.271371 L 49.584599,10.749642 L 52.410963,10.749642 L 52.410963,18.271371 L 51.735778,28.845153 L 50.275486,28.845153 L 49.584599,18.271371 M 49.710215,31.697073 L 52.285348,31.697073 L 52.285348,34.932583 L 49.710215,34.932583 L 49.710215,31.697073"
<?xml version="1.0" encoding="UTF-8"?><svgxmlns="http://www.w3.org/2000/svg"xmlns:xlink="http://www.w3.org/1999/xlink"width="1280"height="640"viewBox="0 0 30240 15120"><defsid="defs6"><polygonpoints="0,-9 1.735535,-3.6038755 7.0364833,-5.6114082 3.8997116,-0.89008374 8.7743512,2.0026884 3.1273259,2.4939592 3.9049537,8.1087198 0,4 -3.9049537,8.1087198 -3.1273259,2.4939592 -8.7743512,2.0026884 -3.8997116,-0.89008374 -7.0364833,-5.6114082 -1.735535,-3.6038755 0,-9 "id="Star7"/><polygonpoints="0,-9 2.351141,-3.236068 8.5595086,-2.7811529 3.8042261,1.236068 5.2900673,7.2811529 0,4 -5.2900673,7.2811529 -3.8042261,1.236068 -8.5595086,-2.7811529 -2.351141,-3.236068 0,-9 "id="Star5"/></defs><pathd="M 0,0 L 30240,0 L 30240,15120 L 0,15120 L 0,0 z"style="fill:#00008b"/><usetransform="matrix(252,0,0,252,7560,11340)"id="Commonwealth_Star"style="fill:#fff"xlink:href="#Star7"/><usetransform="matrix(120,0,0,120,22680,12600)"id="Star_Alpha_Crucis"style="fill:#fff"xlink:href="#Star7"/><usetransform="matrix(120,0,0,120,18900,6615)"id="Star_Beta_Crucis"style="fill:#fff"xlink:href="#Star7"/><usetransform="matrix(120,0,0,120,22680,2520)"id="Star_Gamma_Crucis"style="fill:#fff"xlink:href="#Star7"/><usetransform="matrix(120,0,0,120,26040,5607)"id="Star_Delta_Crucis"style="fill:#fff"xlink:href="#Star7"/><usetransform="matrix(70,0,0,70,24192,8190)"id="Star_Epsilon_Crucis"style="fill:#fff"xlink:href="#Star5"/><pathd="M 6300,0 L 8820,0 L 8820,2520 L 15120,2520 L 15120,5040 L 8820,5040 L 8820,7560 L 6300,7560 L 6300,5040 L 0,5040 L 0,2520 L 6300,2520 L 6300,0 z"id="White_Cross"style="fill:#fff"/><pathd="M 0,0 L 1690.4674,0 L 15120,6714.7663 L 15120,7560 L 13429.533,7560 L 0,845.2337 L 0,0 z"id="White_Diagonal"style="fill:#fff"/><usetransform="matrix(-1,0,0,1,15120,0)"id="White_Diagonal_Flipped"style="fill:#fff"xlink:href="#White_Diagonal"/><pathd="M 6804,0 L 8316,0 L 8316,3024 L 15120,3024 L 15120,4536 L 8316,4536 L 8316,7560 L 6804,7560 L 6804,4536 L 0,4536 L 0,3024 L 6804,3024 L 6804,0 z"id="Red_Cross"style="fill:red"/><pathd="M 0,0 L 5040,2520 L 3913.0217,2520 L 0,563.48913 L 0,0 z M 15120,0 L 13993.022,0 L 8953.0217,2520 L 10080,2520 L 15120,0 z"id="Red_Diagonals"style="fill:red"/><usetransform="matrix(-1,0,0,-1,15120,7560)"id="Red_Diagonals_Rotated"style="fill:red"xlink:href="#Red_Diagonals"/></svg>
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.