638 Commits

Author SHA1 Message Date
BruebachL
c5fde071e7 [Cleanup] Unused #includes (#6367)
* [Cleanup] Unused #includes

Took 44 minutes

* [Cleanup] More unused #includes

Took 55 minutes

* [Cleanup] Include QSet

Took 4 minutes

* [Cleanup] Include QDebug in deck_list.cpp

Took 3 minutes

* [Cleanup] Include protocol stuff in servatrice_database_interface.h

Took 3 minutes

* [Cleanup] Include QDialogButtonBox

Took 8 minutes

* [Cleanup] Include QUrl

Took 8 minutes

* [Cleanup] Include QTextOption in header.

Took 3 minutes

* [Cleanup] Include QMap in user_list_manager.h

Took 8 minutes

* [Cleanup] Adjust qjson

Took 8 minutes

* [Cleanup] include button box.

Took 3 minutes

* [Cleanup] Redo fwd declarations.

* [Cleanup] Redo last removed fwd declarations.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-11-29 18:53:11 +01:00
BruebachL
8abd04dab1 [Fix-Warnings] Remove more redundant empty declarations. (extra semicolons) (#6374) 2025-11-29 14:19:11 +01:00
Zach H
8f80996515 Strip dashes in Yahoo addresses (#6284) 2025-11-07 13:35:44 -05:00
ebbit1q
d206a70b8a update format.sh (#6240)
* update format.sh

add shellcheck to format.sh
add statement macros to .clang-format
add no clang format to format.sh
add changed file list to format.sh diff
rename --cf-version to --print-version in format.sh
lint files

* enable --shell on ci runs

* remove useless semicolons

removes the semicolons after empty function definitions
these semicolons are optional, they don't do anything
this will have functions be consistently formatted
if we want to keep the option to have these on the same line like they
were before we should use the option AllowShortFunctionsOnASingleLine: None

* fix script

* update echo line in lint_cpp.sh which doesn't lint cpp only at all
2025-11-07 15:00:39 +01:00
tooomm
aa61032cdf Delete servatrice/scripts/mk_pypb.sh (#6267)
See https://github.com/Cockatrice/Cockatrice/pull/6212#issuecomment-3447840864
2025-11-03 18:32:35 +01:00
BruebachL
1ef07309d6 Turn Card, Deck_List, Protocol, RNG, Network (Client, Server), Settings and Utility into libraries and remove cockatrice_common. (#6212)
---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2025-10-09 07:36:12 +02:00
ebbit1q
f0c3860032 squash #6156 (#6161)
* move common server files

* update includes with move

* create participant, move code

* fix linker errors

* fix regressions

* mark function as override to make clang happy

* split out spectator to new file

* forgot to add to cmakelists

* autocompleter picking wrong casing for var name

* clean up forwards declarations in player

* fix includes in game
2025-09-20 14:37:12 +02:00
BruebachL
2eba126ed7 Modularize and Doxygen decklist.cpp (#6099) 2025-09-04 22:52:46 -04:00
RickyRister
ab4373d025 Implement replay sharing (#6066)
* new protos

* implement commands on server

* add buttons

* icons

* run formatter

* Message on get replay code failure

* Add new commands to switch statement

* Better failure messages

* Fix permission check query

* Change hash method

* Prevent adding duplicate replays

* Clean up TabReplay ui

* Copy over replay name

* base64 encode the hash

* Shorten hash

* Better failure messages

* change icon back to search icon

* check hash before checking if user already has access

* update share icon

* Update label text
2025-08-24 22:40:44 -04:00
HypersonicWalrus
b6e6328e6a Modified setup_addfirstadmin script to bring it up to date to current cockatrice_users table (#5784)
Co-authored-by: Ben Boelens <bboelens@pop-os.tailc0350.ts.net>
2025-04-03 00:18:31 -04:00
tooomm
1f0846297f websocket is our default port/connection (#5679) 2025-03-14 21:43:11 -04:00
Zach H
cb060f43b5 Prevent server crash if DB is down and game is attempted to be created (#5600) 2025-02-09 22:11:00 +00:00
danbopes
8cbfe85ed4 Fix db reconnecting issues (#5590)
See:

c1b0d50237 (diff-02a32f437187bd4cbfab74877100fee0cfc669dab2c05418681a3557c2cf73f2R109)

We should be checking to see if the query is notActive. In this case, we're literally closing and reopening the connection to the database every time `checkSql()` is called, which is called in numerous places.
2025-02-09 12:12:16 +00:00
Zach H
f0adafb275 Reconnect Servatrice if DB Connection Dies (#5548) 2025-02-02 18:25:01 +00:00
RickyRister
95cea0f191 Add custom server-side pawn colors (#5543) 2025-02-02 03:25:25 +00:00
Zach H
ec6a23de56 Support more indices (#5505)
* Support more indices

* Support more indices
2025-01-25 04:16:41 +00:00
Zach H
090cc8c144 Support more indices (#5503) 2025-01-20 01:42:24 -05:00
RickyRister
c148c8df7f replace foreach macro with standard for each loop (#5485) 2025-01-17 05:18:15 +00:00
Zach H
99eea3a662 Improve Database Backup Speed (#5400)
* Support better indexes for Servatrice

- Prevent searching only on msg for logs
2025-01-01 00:28:57 -05:00
Zach H
026afeb885 Support auto-reconnect for Servatrice (#5391)
- Fix #5022
2024-12-30 04:35:32 +00:00
Zach H
1f58f7e93d Support Mod/Admin Notes Section (#5361) 2024-12-28 18:05:49 +00:00
Zach H
7a5704beaa Support Moderator/Admin force activating users (#5353) 2024-12-28 05:01:31 +00:00
ZeldaZach
3524231500 Allow Moderators/Admins to Grant Replay Access
- Only to themselves, at this time
- Automatically refreshes feed, no need to re-login
2024-12-27 18:32:39 -05:00
ebbit1q
4d394c31f9 fix the timezones used for the user info box and add comments (#5162) 2024-11-05 14:54:38 -05:00
Zach H
ce8092318e Allow up to 100 dice to be rolled at a time (#5047)
* Allow up to 100 dice to be rolled at a time
- Fix #4276
2024-06-12 08:37:04 -04:00
Zach H
07a8cd0a5f Fix #4903: Parse Email Addresses whenever used (#4932) 2023-12-09 00:52:47 -05:00
Zach H
186f4289e9 Address /W4 compiler warnings for Windows (#4910) 2023-10-15 20:31:13 -04:00
Zach H
c1b0d50237 Handle Qt6.6 Deprecations (#4908) 2023-10-13 20:53:47 -04:00
Zach H
0deb037035 Address connect errors in logs (#4882) 2023-10-01 15:30:54 -04:00
Guangcong Luo
bd3100dcda Update macOS Monterey app icon (#4805) 2023-08-06 17:46:03 -04:00
ebbit1q
afb7c35cfd add a way to replace the user facing list of disallowed words (#4807) 2023-08-06 17:45:37 -04:00
ebbit1q
3d4858b840 use qt6 in arch builds (#4691)
* use qt6 in arch builds

* fix 6.4.0 deprecations
2022-10-31 23:26:13 +01:00
ebbit1q
dec2a252fa remove dependency on deprecated qt5 libraries for qt6 (#4692)
* 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
2022-10-31 23:24:11 +01:00
ebbit1q
28aa473362 rework formatting with cmake-format (#4627)
* 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
2022-06-08 21:14:26 -04:00
Zach H
6b86e4d463 Update configuration path to be backwards compatible (#4620)
* 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.
2022-05-12 18:13:49 -04:00
Zach H
a95b338c80 Add cmake format (#4618)
* Support CMakeify operation

* Run Cmakeify

* Update cmakeify.sh

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2022-05-08 21:22:43 +02:00
ZeldaZach
b02adccf87 Support Qt6, Min Qt5.8, Fix Win32, Fix Servatrice
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
2022-05-06 17:31:08 -04:00
ebbit1q
7108eb42c8 implement custom protobuf debug string creation (#4532)
* implement custom protobuf debug log string creation

* add version guards

* add missing header

* debian10 repository misses headers

* clean up logging messages a bit

* fix some more formatting on debug messages
2022-02-23 23:46:23 +01:00
ebbit1q
7d0a255a49 add database migration from blob to mediumblob (#4568) 2022-02-09 20:11:13 +01:00
ebbit1q
252883f67e set rx and txBytes to zero on initialization (#4569) 2022-02-09 17:57:35 +01:00
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
fcafcb340a remove all instances of the type long (#4519)
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
2022-01-16 18:05:24 -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
a9f2fc427b allow servatrice to exit early based on commandline options (#4504) 2021-12-26 16:47:37 +01: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
a3d3aaaca8 fix server crash on receiving email without @ (#4492) 2021-11-30 19:44:20 -08: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
6f360374cc change the order in which the password challenge is performed (#4439)
this will force the user to always perform the challenge, meaning no
information on the account is leaked in case of failures
2021-10-23 20:18:08 -04: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