* 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
* Force Oracle run on new install/update
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* Add settings option to disable such a check
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* 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>
* 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
* 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
* 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.
* 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
* 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
* 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
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
* 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.
* 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!
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
* 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
* 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`).
* 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.