Commit graph

593 commits

Author SHA1 Message Date
ebbit1q
2fc85e0c08
use hashed passwords in all commands (#4493)
* 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
2022-01-16 20:32:30 -05:00
ebbit1q
ae9b8b8f34
miscellaneous refactors (#4521) 2022-01-16 17:58:53 -05:00
ebbit1q
994704d353
implement max lengths for input dialogs that are sent to the server (#4522)
* 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
2022-01-16 17:57:01 -05:00
ebbit1q
07e6aadbbe
deprecate the gender property from the protocol entirely (#4496)
* deprecate the gender property from the protocol entirely

* use obsolete instead of deprecated

* add the database migration

* update internal database version as well
2021-12-14 01:51:57 -05:00
ebbit1q
811ee54c76
Fix move (#4491)
* wip fix card moving on server

* fix flipped cards being moved as -1

* fix cards from hand being moved as -1
2021-12-07 22:56:58 -05:00
ebbit1q
d1a40fd36e
fix regression in local games (#4490) 2021-12-07 22:54:36 -05:00
ZeldaZach
8b1daa21ef Revert "fix card moving on server (#4413)"
This reverts commit c25bf491e4.
2021-11-15 00:54:21 -05:00
ebbit1q
691bcb9338
comment out new feature from feature list (#4477)
we don't have an official release for a version that has this feature
yet
2021-11-15 00:44:16 -05:00
ebbit1q
45d86e7ab7
allow login using hashed passwords (#4464)
* 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>
2021-11-09 20:00:41 -05:00
ebbit1q
1e995cd97c
add option to delete a user's messages (#4362)
* 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
2021-09-14 16:05:20 -04:00
ebbit1q
c25bf491e4
fix card moving on server (#4413)
* wip fix card moving on server

* fix flipped cards being moved as -1
2021-09-14 15:48:46 -04:00
Zach H
051be37419
Server Config Whitelist Email Providers (#4416)
* 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
2021-08-18 21:18:53 -04:00
ebbit1q
0280fea3e6
apply chat flood prevention in games next to rooms (#4387)
* apply chat flood prevention in games next to rooms

* add limit to private messages as well
2021-06-28 01:57:46 -04:00
ebbit1q
ebe2c494aa
remove the stop dump zone command from the protocol (#4326)
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
2021-06-01 21:52:20 -04:00
ebbit1q
ae7437750b
do not edit the zone currently iterated on (#4345)
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
2021-05-10 13:21:12 -04:00
Zach H
8fb561b4c4
Fix regression from #4281 which caused crash with QList and GCC race time (#4341) 2021-05-09 14:50:48 -04:00
Zach H
b9c4b496e4
Fix regression from #4281 which caused crash if card was null (#4340) 2021-05-09 13:10:13 -04:00
ebbit1q
e034de9083
don't log in users while giving them an error for missing the clientid (#4335) 2021-05-08 18:12:05 -04:00
ebbit1q
63fe34437a
fix deprecation of QMutex::Recursive in favor of QRecursiveMutex (#4328) 2021-05-01 18:51:17 -04:00
ebbit1q
6c004155ff
fix local games no longer working (#4315) 2021-04-15 01:00:41 -04:00
ebbit1q
1c48656623
fix #4249 (#4285)
ignore "deck" at start of a list
add tests
add tests to clangify.sh
2021-04-01 23:35:36 -04:00
ebbit1q
09de56ac87
send hidden info to judge instead of player (#4297) 2021-03-25 22:35:46 -04:00
omegaula
073349fd05
Always look at top card (#4238)
* 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>
2021-03-13 14:54:13 -05:00
ebbit1q
1811f7305e
only invalidate undoDrawList up to moved card (#4280) 2021-03-13 14:41:09 -05:00
ebbit1q
06bfc0291a
Create game as spectator (#4281)
* 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
2021-03-13 14:39:25 -05:00
ebbit1q
7e3a669af0
use correct settings group for command interval settings (#4257)
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
2021-03-08 12:18:22 -05:00
ebbit1q
401fdcaf7a
move changing x coord to after check for token deletion (#4236)
fixes #4235
reverts #4216
2021-01-30 16:44:12 -05:00
ZeldaZach
00c0162da3 Change release name/number for 2.8.0 and make it a forced update 2021-01-26 14:56:29 -05:00
knitknit
a0deb73df6
Fix #2771: Do not change x coordinates of moved card if it will be destroyed when it leaves the table (#4216) 2021-01-02 22:45:11 -05:00
ebbit1q
8441cb7ba9
refactor pingClockTimeout (#4169)
* refactor pingClockTimeout

try to see if it changes #3954

* use lcoks and unlocks again
2020-11-22 20:21:43 -05:00
knitknit
8e9d4e3a67
Retain lastDrawList if a card is being moved within hand, e.g. hand reordering only. (#4152) 2020-11-01 15:02:17 -05:00
ebbit1q
35fe6f624c
apply clang format to proto files (#4123)
* 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
2020-10-02 12:14:05 -04:00
ebbit1q
e2251fe06b
update sfmt to version 1.5.1 from 1.4.1 (#4124) 2020-10-02 12:13:12 -04:00
Zach H
bec02b4952
Judges can talk in games (#4091) 2020-09-09 13:20:59 -04:00
Zach H
3536fa8a75
Fix #4072 by changing outdated HTTP to HTTPS calls within the codebase (#4073) 2020-08-23 17:24:26 -04:00
ebbit1q
0337f58088
add extra exceptions to plaintext imports (#4018)
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
2020-06-02 10:56:01 -04:00
Olxinos
db85ec48c7
Minor fixes to some std::sort calls (#3967) 2020-04-23 11:23:59 -04:00
ebbit1q
18a07274d4
clangify everything with the new header sorting (#3908) 2020-03-18 17:36:02 -04:00
ebbit1q
a80c756dcb
update deprecated methods in qt5.14 and protobuf 3.4 (#3906) 2020-03-16 20:41:41 -04:00
kopcion
cd431594e2 Issue 3015 - store timestamp when password is reset (#3863)
* 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.
2019-11-22 23:52:45 -05:00
ebbit1q
8879fc2e39 fix compiling on gcc 9 (#3830) 2019-10-02 15:48:49 -04:00
ebbit1q
257f2eb34c warning message is way too scary (#3805)
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
2019-09-05 15:43:51 +02:00
ctrlaltca
b6df5a4ac3 Deal with recent Qt methods deprecation (#3801)
* 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
2019-08-27 20:06:54 -04:00
ctrlaltca
f54165025e Add a new command to reverse turn order (#3802) 2019-08-27 20:04:27 -04:00
ebbit1q
a3a1e20074 replace old mulligan with new behavior (#3773) 2019-07-11 22:53:09 -04:00
ebbit1q
11b2942d09 try to use fabs instead of abs to see if flatpack cares (#3638) 2019-03-10 18:49:18 +01:00
ebbit1q
abe4f5ca60 don't remove pt! 🔥🔥🔥🔥 (#3606)
* don't remove pt! 🔥🔥🔥🔥

* apply water to burns

* clangify

* fix clientside

* clangify

* missed qdebug

Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
2019-03-04 00:55:54 -05:00
ebbit1q
9411396b97 rework pt setting (#3584)
* 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
2019-03-03 16:24:57 -05:00
Rob Blanckaert
ea8201af5c Judge mode (#3531)
* Judge mode

* Use seperate judge icon

* Fix clang init ordering complaint

* Create gavel.svg

* Add judge level

* Adjust judge permissions.

* - Tag events caused by judges
- Allow judges access to card right click menus.

* Allow judges to  change phase / turn.

* Remove gavel from pawn

* Make judge action text black.

* Create scales

* Rename scales to scales.svg

* Use scales

* remove gavel

* - Address PR feedback
- Fix sort order

* Zach

* add option to servatrice.ini
2019-02-21 14:00:00 -05:00
Rob Blanckaert
d49ec0088f Fix shuffle (#3578) 2019-02-10 21:06:30 -05:00