* 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.
<!-- this template comes from .ci/release_template.md -->
<!-- Don't forget to delete the previous betas after publishing this!
git push -d origin --REPLACE-WITH-BETA-LIST--
-->
<!-- This list of binaries should be updated every time the CI is changed to
include different targets -->
<pre>
<b>Pre-compiled binaries we serve:</b>
- <kbd>Windows 10+</kbd>
- <kbd>Windows 7+</kbd>
- <kbd>macOS 14+</kbd> ("Sonoma") / Apple M
- <kbd>macOS 13+</kbd> ("Ventura") / Intel
- <kbd>Ubuntu 24.04 LTS</kbd> ("Noble Numbat")
- <kbd>Ubuntu 22.04 LTS</kbd> ("Jammy Jellyfish")
- <kbd>Ubuntu 20.04 LTS</kbd> ("Focal Fossa")
- <kbd>Debian 12</kbd> ("Bookworm")
- <kbd>Debian 11</kbd> ("Bullseye")
- <kbd>Fedora 41</kbd>
- <kbd>Fedora 40</kbd>
<i>We are also packaged in <kbd>Arch Linux</kbd>'s official "extra" repository, courtesy of @FFY00</i>
<i>General Linux support is available via a <kbd>flatpak</kbd> package (Flathub)</i>
</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#get-involved-).
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. -->
*Override this line with the exact operating system you are running! (e.g. "Win 7 SP1", "OS X 10.8.5", "Ubuntu 15.10" ...)*
<b>Cockatrice version:</b>
*Put your Cockatrice version number & build date here! You find them inside the app: `Help` --> `About Cockatrice` (e.g. "2d53ce9 (2016-02-18)"). If you can't access this menu for any reason, please include the full filename of the installer you used.*
___
<br>
*Explain your Issue/Request/Suggestion in detail here!*
<b>If you're getting started ⇢ [view our webpage](https://cockatrice.github.io/)</b><br>
<b>If you're trying to get support or suggest changes ⇢ [file an issue](https://github.com/Cockatrice/Cockatrice/issues) ([How?](https://github.com/Cockatrice/Cockatrice/wiki/How-to-Create-a-GitHub-Ticket))</b>
<b>To get started, ⇢ [view our webpage](https://cockatrice.github.io/)</b><br>
<b>To get support or suggest changes ⇢ [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, see how to [get involved](#get-involved-)</b>
</pre><br>
# Cockatrice
Cockatrice is an open-source multiplatform supported program for playing tabletop card games over a network. The program's server design prevents any kind of client modifications to gain an unfair advantage in a game. The client also has a built in single-player mode where you can brew without being connected to a server. This project is written in C++/Qt with support for both Qt4 and Qt5.<br>
Cockatrice is an open-source, multiplatform program for playing tabletop card games over a network. The program's server design prevents users from manipulating the game for unfair advantage. The client also provides a single-player mode, which allows users to brew while offline. This project uses C++ and the Qt5 libraries.<br>
We offer a download for all full releases and the latest development version (recommended). Full releases are checkpoints with major feature or UI enhancements between them, but are infrequently updated. The development version contains the most recently added features and bugfixes, but can be more unstable. Downloads for development versions are updated automatically with every change.
Downloads are hosted on [BinTray](https://bintray.com/cockatrice/Cockatrice).
Downloads are available for full releases and the current beta version in development. There is no strict release schedule for either of them.
- Latest development version (recommended): [ ](https://bintray.com/cockatrice/Cockatrice/Cockatrice-git/_latestVersion#files)
-Latest full release: [  ](https://bintray.com/cockatrice/Cockatrice/Cockatrice/_latestVersion#files)
- Latest `stable` release: [](https://github.com/cockatrice/cockatrice/releases/latest) [](https://tooomm.github.io/github-release-stats/?username=Cockatrice&repository=Cockatrice)<br>
-Stable versions are checkpoints featuring major feature and UI enhancements.
- **Recommended for most users!**
- Latest `beta` release: [](https://github.com/cockatrice/cockatrice/releases) [](https://tooomm.github.io/github-release-stats/?username=Cockatrice&repository=Cockatrice)
- Beta versions include the most recently added features and bugfixes, but can be unstable.
- To be a Cockatrice Beta Tester, use this version. Find more information [here](https://github.com/Cockatrice/Cockatrice/wiki/Release-Channels)!
# Get Involved [](https://gitter.im/Cockatrice/Cockatrice)
# Get Involved [](https://discord.gg/3Z9yzmA)
Chat with the Cockatrice developers on Gitter. Come here to talk about the application, features, or just to hang out. For support regarding specific servers, please contact that server's admin or forum for support rather than asking here.<br>
Join our [Discord community](https://discord.gg/3Z9yzmA) to connect with the project, contributors or fellow users of the app. Come here to talk about the application, features, or just to hang out.<br>
For support regarding specific servers, please contact that server's admin or forum for support rather than asking here.<br>
To contribute code to the project, please review [the guidelines](https://github.com/Cockatrice/Cockatrice/blob/master/.github/CONTRIBUTING.md).
We maintain two tags for contributors to find issues to work on:
- [Good first issue](https://github.com/Cockatrice/Cockatrice/issues?utf8=%E2%9C%93&q=is%3Aopen%20is%3Aissue%20label%3A%22Good%20first%20issue%22%20): issues tagged in this way provide a simple way to get started. They don't require much experience to be worked on.
- [Help wanted](https://github.com/Cockatrice/Cockatrice/issues?utf8=%E2%9C%93&q=is%3Aopen%20is%3Aissue%20label%3A%22Help%20Wanted%22%20): This tag is used for issues that we are looking for a contributor to work on. Often this is for feature suggestions we are willing to accept, but don't have the time to work on ourselves.
For both tags, we're willing to provide help to contributors in showing them where and how they can make changes, as well as code review for changes they submit.
We try to be responsive to new issues. We'll provide advice on how best to implement a feature; alternately, we can show you where the codebase is doing something similar before you get too far along.
Cockatrice uses the [Google Developer Documentation Style Guide](https://developers.google.com/style/) to ensure consistent documentation. We encourage you to improve the documentation by suggesting edits based on this guide.
# Community Resources
- [Cockatrice Official Site](https://cockatrice.github.io)
- [Cockatrice Official Wiki](https://github.com/Cockatrice/Cockatrice/wiki)
- [Cockatrice Official Discord](https://discord.gg/3Z9yzmA)
# Translation Status [](https://www.transifex.com/projects/p/cockatrice/)
Cockatrice uses Transifex for translations. You can help us bring Cockatrice and Oracle to your language or just edit single wordings right from within your browser by simply visiting our [Transifex project page](https://www.transifex.com/projects/p/cockatrice/).<br>
Cockatrice uses Transifex for translations. You can help us bring Cockatrice, Oracle and Webatrice to your language or just adjust single wordings right from within your browser by visiting our [Transifex project page](https://transifex.com/cockatrice/cockatrice/).<br>
Check out our [Translator FAQ](https://github.com/Cockatrice/Cockatrice/wiki/Translation-FAQ) for more information about contributing!<br>
# Building [](https://travis-ci.org/Cockatrice/Cockatrice) [](https://ci.appveyor.com/project/Daenyth/cockatrice/branch/master)
**Detailed compiling instructions are on the Cockatrice wiki under [Compiling Cockatrice](https://github.com/Cockatrice/Cockatrice/wiki/Compiling-Cockatrice)**
**Detailed compiling instructions can be found on the Cockatrice wiki under [Compiling Cockatrice](https://github.com/Cockatrice/Cockatrice/wiki/Compiling-Cockatrice)**
-`-DWITH_QT4=1` Force compilation to use Qt4 instead of Qt5 (default 0 = no).
-`-DCMAKE_BUILD_TYPE=Debug` Compile in debug mode. Enables extra logging output, debug symbols, and much more verbose compiler warnings (default `Release`).
-`-DWARNING_AS_ERROR=0` Whether to treat compilation warnings as errors in debug mode (default 1 = yes).
-`-DUPDATE_TRANSLATIONS=1` Configure `make` to update the translation .ts files for new strings in the source code. Note: Running `make clean` will remove the .ts files (default 0 = no).
-`-DTEST=1` Enable regression tests (default 0 = no). Note: needs googletest, will be downloaded on the fly if unavailable. To run tests: ```make test```.
-`-DFORCE_USE_QT5=1` Skip looking for Qt6 before trying to find Qt5
#### Servatrice Docker container
# Run
A Dockerfile is provided to run Servatrice (the Cockatrice server) using [Docker](https://www.docker.com/what-docker).<br>
`Cockatrice` is the game client<br>
`Oracle` fetches card data<br>
`Servatrice` is the server<br>
You just need to create an image from the Dockerfile<br>
**Servatrice Docker container**
You can run an instance of Servatrice (the Cockatrice server) using [Docker](https://www.docker.com/what-docker) and the Cockatrice Dockerfile.<br>
First, create an image from the Dockerfile<br>
`cd /path/to/Cockatrice-Repo/`
`docker build -t servatrice .`<br>
And then run it<br>
`docker run -i -p 4747:4747/tcp -t servatrice:latest`<br>
Please note that running this command will expose the TCP port 4747 of the docker container to permit connections to the server.<br>
More infos on how to use Servatrice with Docker can be found in our [wiki](https://github.com/Cockatrice/Cockatrice/wiki/Setting-up-Servatrice#using-docker).
>Note: Running this command exposes the TCP port 4747 of the docker container<br>
to permit connections to the server.
Find more information on how to use Servatrice with Docker in our [wiki](https://github.com/Cockatrice/Cockatrice/wiki/Setting-up-Servatrice#using-docker).
**Docker compose**
There is also a docker-compose file available which will configure and run both a MySQL server and Servatrice. The docker-compose setup scripts can be found in the `servatrice/docker` folder and vary only slightly from the default sql and server .ini files. The setup scripts can either be modified in place, or docker-compose can mount alternative files into the images, as you prefer.
To run Servatrice via docker-compose, first install docker-compose following the [install instructions](https://docs.docker.com/compose/install/). Once installed, run the following from the root of the repository:
```bash
docker-compose build # Build the Servatrice image using the same Dockerfile as above.
docker-compose up # Setup and run both the MySQL server and Servatrice.
```
>Note: Similar to the above Docker setup, this will expose TCP ports 4747 and 4748.
>Note: The first time running the docker-compose setup, the MySQL server will take a little time to run the initial setup scripts. Due to this, the Servatrice instance may fail the first few attempts to connect to the database. Servatrice is set to `restart: always` in the docker-compose.yml, which will allow it to continue attempting to start up. Once the MySQL scripts have completed, Servatrice should then connect automatically on the next attempt.
**Docker compose in Windows**
A out of box working docker-compose file has been added to help setup in Windows.
Docker in Windows requires additional steps in form of using Docker Desktop to allow resource sharing from the drive the volumes are mapped from, as well as potential workarounds needed to get file sharing working in Windows. This [StackOverflow discussion sheds some light on it](https://stackoverflow.com/questions/42203488/settings-to-windows-firewall-to-allow-docker-for-windows-to-share-drive)
This is an unordered list of possible todo items for Cockatrice.
Note that "improve" and "write" always also means: "document and comment"
##Improve packaging:
* 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
* 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.
##Scripts
* Write example init script for servatrice.
##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!!
##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
* Move hardcoded URLs (especially from oracle and cockatrice) into a config file.
* Search git log for useful information/problems/bugs/...
<!-- Intersexual/Transgendered symbol by Gregory Maxwell. Copyright 2005. GFDL-1.2 only -->
<svg
xmlns="http://www.w3.org/2000/svg"
version="1.1"
width="210"
height="280">
<pathd="M 188,38 v 20 l 14,-8 v -42 h -42 l -8,14 h 20 l -37,37 a 79,79 0 1,0 -59,141 v 22 h -27 v 23 h 27 v 27 h 23 v -27 h 27 v -23 h -27 v -22 a 79,79 0 0,0 52,-125 zm -100,27 a 57,57 0 1,1 0,114 a 57,57 0 1,1 0,-114 z"/>
The search bar recognizes a set of special commands similar to some other card databases.<br>
In this list of examples below, each entry has an explanation and can be clicked to test the query. Note that all searches are case insensitive.
<dl>
<dt>Name:</dt>
<dd>[birds of paradise](#birds of paradise) <small>(Any card name containing the words birds, of, and paradise)</small></dd>
<dd>["birds of paradise"](#%22birds of paradise%22) <small>(Any card name containing the exact phrase "birds of paradise")</small></dd>
<dt>Rules Text (<u>O</u>racle):</dt>
<dd>[o:flying](#o:flying) <small>(Any card text that has the word flying)</small></dd>
<dd>[o:"first strike"](#o:%22first strike%22) <small>(Any card text that has the exact phrase "first strike")</small></dd>
<dd>[o:"{T}" o:"add one mana of any color"](#o:%22{T}%22 o:%22add one mana of any color%22) <small>(Any card text that has a tap symbol and the phrase "add one mana of any color")</small></dd>
<dt><u>T</u>ypes:</dt>
<dd>[t:angel](#t:angel) <small>(Any card with the type angel)</small></dd>
<dd>[t:angel t:legendary](#t:angel t:legendary) <small>(Any angel that's also legendary)</small></dd>
<dd>[t:basic](#t:basic) <small>(Any card with the type basic)</small></dd>
<dd>[t:arcane t:instant](#t:arcane t:instant) <small>(Any card with the types arcane and instant)</small></dd>
<dt><u>C</u>olors:</dt>
<dd>[c:w](#c:w) <small>(Any card that is white)</small></dd>
<dd>[c:wu](#c:wu) <small>(Any card that is white or blue)</small></dd>
<dd>[c:wum](#c:wum) <small>(Any card that is white or blue, and multicolored)</small></dd>
<!--
<dd>[c!w](#c!w) <small>(Cards that are only white)</small></dd>
<dd>[c!wu](#c!wu) <small>(Cards that are only white or blue, or both)</small></dd>
<dd>[c!wum](#c!wum) <small>(Cards that are only white and blue, and multicolored)</small></dd>
<dd>[c=wubrg](#c%3Dwubrg) <small>(Cards that are all five colors)</small></dd>
<pathstyle=" stroke:none;fill-rule:nonzero;fill:#000000;fill-opacity:1;"d="M 24 2 C 17.398438 2 12 7.398438 12 14 L 12 16 C 9.789063 16 8 17.789063 8 20 L 8 40 C 8 42.210938 9.789063 44 12 44 L 36 44 C 38.210938 44 40 42.210938 40 40 L 40 20 C 40 17.789063 38.210938 16 36 16 L 36 14 C 36 7.398438 30.601563 2 24 2 Z M 24 6 C 28.4375 6 32 9.5625 32 14 L 32 16 L 16 16 L 16 14 C 16 9.5625 19.554688 6 24 6 Z M 23.9375 19.9375 C 29.929688 19.9375 30 24.398438 30 25.25 C 30 29.71875 25.125 29.96875 25.375 33.875 L 21.875 33.875 C 21.578125 28.632813 26.0625 28.398438 26.0625 25.4375 C 26.0625 23.3125 24.632813 23.125 23.9375 23.125 C 21.859375 23.125 21.757813 25.09375 21.75 25.5 L 17.8125 25.5 C 17.820313 24.554688 18.015625 19.9375 23.9375 19.9375 Z M 23.6875 35.9375 C 25.671875 35.9375 25.875 37.765625 25.875 38.0625 C 25.875 38.351563 25.671875 40.125 23.6875 40.125 C 21.632813 40.125 21.5 38.351563 21.5 38.0625 C 21.5 37.765625 21.671875 35.9375 23.6875 35.9375 Z "/>
<pathstyle=" stroke:none;fill-rule:nonzero;fill:#000000;fill-opacity:1;"d="M 240 0 L 240 45 C 130.078125 55.234375 43.75 147.421875 43.75 260 C 43.75 318.671875 67.03125 371.640625 105 410.625 L 159.375 361.875 C 133.203125 335.859375 116.875 299.765625 116.875 260 C 116.875 187.8125 170.46875 127.96875 240 118.125 L 240 160 L 368.125 80 Z M 415 109.375 L 361.25 158.125 C 387.421875 184.140625 403.125 220.3125 403.125 260 C 403.125 332.265625 349.609375 391.484375 280 401.25 L 280 360 L 151.875 440 L 280 520 L 280 475 C 389.921875 464.765625 476.25 372.578125 476.25 260 C 476.25 201.328125 452.96875 148.359375 415 109.375 Z "/>
<text>Tip of the Day is a new feature to Cockatrice that allows users to get information about the newest features of the program and some of the most commonly asked questions!</text>
<image>tip_of_the_day.png</image>
<date>2018-03-01</date>
</tip>
<tip>
<title>Suggesting New Tips</title>
<text>You can suggest new Tips of the Day by reaching out to the development team on <a href="https://discord.gg/3Z9yzmA">Discord</a>!</text>
<image>discord.png</image>
<date>2023-10-18</date>
</tip>
<tip>
<title>Reporting Bugs</title>
<text>If you encounter a bug while using Cockatrice, you can report the bug to the development team via <a href="https://github.com/cockatrice/cockatrice/issues">GitHub<a></text>
<image>github_logo.png</image>
<date>2018-03-01</date>
</tip>
<tip>
<title>FAQ/Troubleshooting Wiki</title>
<text>You can find answers to the most common questions and some helpful Cockatrice toubleshooting over on the <a href="https://github.com/cockatrice/cockatrice/wiki">GitHub wiki<a></text>
<image>cockatrice_wiki.png</image>
<date>2018-03-01</date>
</tip>
<tip>
<title>Register for a Server</title>
<text>Click on either Cockatrice (Windows) or Actions (Mac) and then Register to server... When the dialogue appears, fill out the desired server information.</text>
<image>cockatrice_register.png</image>
<date>2018-03-01</date>
</tip>
<tip>
<title>Drawing Arrows</title>
<text>You can draw arrows of different color by holding a combination of keys!
Right Click: Red Arrow
Shift + Right Click: Green Arrow
Alt + Right Click: Blue Arrow
Cmd + Right Click: Yellow Arrow
</text>
<image>arrows.png</image>
<date>2018-03-01</date>
</tip>
<tip>
<title>Filtering Games</title>
<text>Don't see all the active games? Want to see a smaller selection? Use the Game Filters to change your horizon</text>
<image>filter_games.png</image>
<date>2018-03-01</date>
</tip>
<tip>
<title>Upload Custom Avatar</title>
<text>Want to show off your hippo avatar? Need to update your password? Check out the Accounts Tab for more info!</text>
<image>accounts_tab.png</image>
<date>2018-03-01</date>
</tip>
<tip>
<title>Common Shortcuts</title>
<text>You can find a full list of shortcuts <a href="https://github.com/Cockatrice/Cockatrice/wiki/Custom-Keyboard-Shortcuts">on the wiki</a>, but a short list:
<br>Roll a die: CTRL + I
<br>Mulligan: CTRL + M
<br>Draw a card: CTRL + D
<br>Undo a draw: CTRL + SHIFT + D
<br>View Sideboard: CTRL + F3
<br>Change Life: CTRL + L
<br>All shortcuts can be customized via Settings->Shortcuts!
</text>
<image>shortcuts.png</image>
<date>2018-03-01</date>
</tip>
<tip>
<title>Changing Themes</title>
<text>Did you know Cockatrice has custom themes? You can either <a href="https://github.com/Cockatrice/Cockatrice/wiki/Themes">create one yourself</a> or use one of the several pre-loaded ones! Go to Settings->Appearance and try them out!</text>
<image>themes.png</image>
<date>2018-03-01</date>
</tip>
<tip>
<title>Flip of the Coin</title>
<text>You can flip a coin instead of rolling a die by rolling a 2 sided die instead!</text>
<image>coin_flip.png</image>
<date>2018-03-01</date>
</tip>
<tip>
<title>Face Down Cards</title>
<text>You can hold Shift while dragging or clicking on a card to have it enter play face down</text>
<image>face_down.png</image>
<date>2018-03-01</date>
</tip>
<tip>
<title>Counter expressions</title>
<text>When setting a counter value, you can type a math expression in the box and the counter will be set to the result.<br>The "x" variable contains the current counter value.</text>
<image>counter_expression.png</image>
<date>2019-02-02</date>
</tip>
<tip>
<title>Power and Toughness</title>
<text>You can add and subtract to a creature's stats.<br>With a card selected, set the power and toughness ( default: ctrl + p ) and enter +3/-1 to increase power by three while decreasing toughness by one.<br>You can also reset it to the original value ( default: ctrl + alt + 0 ).</text>
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.