* 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>
* 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
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 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
* 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
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
* 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.
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
* 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
* - 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
* 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
* 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