Commit graph

612 commits

Author SHA1 Message Date
ctrlaltca
1415a4dafa
Fix servatrice linking under FreeBSD - fix #3376 (#3377)
Fix servatrice linking under FreeBSD - fix #3376
2018-09-06 12:20:20 +02:00
ctrlaltca
e223f07462 fix #3235 (#3302) 2018-06-21 18:56:53 -04:00
ctrlaltca
f97959febc
fix #3257 (#3258) 2018-05-24 15:46:02 +02:00
skwerlman
ad66a48b8e ensure column ordering is consistent (#3249) 2018-05-18 18:07:39 -04:00
ctrlaltca
4cdd17945d
Servatrice: make listening host configurable; fix #3241 (#3242)
* fix #3241

* clangify
2018-05-12 23:54:03 +02:00
ctrlaltca
c06fc562a1
Cmake scripts refactoring; fix #3225 (#3230)
* fix #3225

* Servatrice: use websockets as an optional component (for qt < 5.3)

* Attempt++
2018-05-12 23:28:22 +02:00
Zach H
2520d07ef2
log moderation stats in the uptime table (#3215) 2018-05-02 17:31:54 -04:00
ctrlaltca
2780270911 macOS: fix qt plugin installation (#3216)
* 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
2018-05-02 15:57:35 -04:00
ctrlaltca
e127cb74b6 Fixed most issues from codacy (#3050) 2018-01-27 13:31:44 -05:00
ctrlaltca
b29bd9e070
Clang-format (#3028)
* 1/3 Add .clang-format file and travis compilation check

* 2/3 Run clang-format

* 3/3 Fix compilation problems due to include reordering

* 3bis/3 AfterControlStatement: false
2018-01-27 10:41:32 +01:00
woogerboy21
da7c7c1f83
Update Servatrice MySQL Search Path (#3039)
Removed the older versions of the mysql library install paths and updated to reflect the 5.7 product paths.
2018-01-21 11:05:13 -05:00
ctrlaltca
cd558a9722 Even out db collation to utfmb4_unicode_ci; fix #2835 ; fix #2218 (#2915) 2018-01-13 04:02:22 -05:00
woogerboy21
b684c12964 Correct VS2017 Compile Issue (#2878)
A line in the servatrice CMAKE file was removed in a prior commit causing a compile error in newer versions of visual studio.  This returns the line.
2017-10-03 09:23:33 -04:00
ctrlaltca
7875407795 servatrice: case-insensitve check for email and token challenge; fix #2857 (#2860) 2017-09-28 15:34:35 -04:00
ctrlaltca
ccee0aa3fd Cmake: remove old unneeded POLICIES (fix Appveyor) (#2859) 2017-09-22 17:47:05 +02:00
ctrlaltca
1366e5970e Portable mode for windows (#2794)
* 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
2017-07-08 11:22:29 +02:00
woogerboy21
1811bad835 Fix room chat history (#2698)
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.
2017-05-09 23:22:48 -04:00
Zach H
657e1ac9e6 fix c style casting (#2561) 2017-04-05 15:45:58 -04:00
woogerboy21
2f23a9cb2f Smarter rooms (#2484)
* 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.
2017-03-22 21:45:16 -04:00
woogerboy21
d0088f6a18 Server audit table (#2423)
* 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
2017-02-25 13:48:31 -05:00
Zach H
47cafde521 fix lowercase (#2419)
* fix lowercase

* fix changes

* fix .desktop

* servatrice .desktop
2017-02-23 08:53:18 +01:00
tritoch
884e604909 Reverse wording on logfilters description (#2421)
The `logfilters` setting was inverted.
Previously said it logged everything *except* listed strings,
but it actually logs *only* listed strings.
2017-02-21 14:39:00 -05:00
woogerboy21
0cfa6863d5 Simpler forgot password functionality (#2393)
* Simpler forgot password functionality (Server/Client)
2017-02-15 17:41:40 -05:00
woogerboy21
0fdb9b7c83 Added registration email blacklist (#2352)
* 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
2017-02-08 15:25:27 -05:00
ctrlaltca
ae5fc1fe2c Fix use of uninitalized value (#2364) 2017-01-16 21:06:35 +01:00
woogerboy21
a85b0dcbba Add email registration restriction (#2350)
* 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.
2017-01-07 11:26:23 -05:00
woogerboy21
3e39432ccc Add configuration to enable/disable internal smtp client (#2337)
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.
2017-01-06 17:02:52 -05:00
woogerboy21
f7c8651d51 Added privilege level start/end columns (#2328)
* 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
2016-12-30 16:45:28 -08:00
tritoch
42fb17bdd2 Document '--config' parameter (#2311)
servatrice.ini can be passed to servatrice via the --config parameter.  I don't think this is documented anywhere.
2016-12-10 01:11:44 +01:00
woogerboy21
960ecaaeda New privuser gummys (#2305)
* 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!
2016-12-08 22:52:25 -05:00
woogerboy21
c9a8dafd01 Update sessions table columns for consistency (#2299)
* 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
2016-12-08 10:43:11 +01:00
woogerboy21
f86b9e0be7 Remedy connection type query at every login (#2298)
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.
2016-12-07 01:35:35 -05:00
woogerboy21
a6f1f4c01d Add enable/disable log query functionality (#2294)
* 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.
2016-12-06 15:37:36 -05:00
skwerlman
c90c4ea41f Delete aps file (#2296)
* Delete aps file

This is a VS cache file, and was probably committed accidentally.

* add aps to gitignore
2016-12-06 02:52:23 -05:00
woogerboy21
6962777ded Rework idle timeout, now server side (#2259)
* 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
2016-11-08 22:18:12 -05:00
woogerboy21
21a34eaaa1 Cleanup server running variable information (#2239)
* 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.
2016-10-31 10:30:12 +01:00
woogerboy21
f17a0da434 Added user privilege level (#2228)
* 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
2016-10-26 02:07:42 -04:00
woogerboy21
b060f4ea6b Call class functions for consistency
Updated code to call functions for consistency.
2016-10-24 08:05:33 -04:00
woogerboy21
749bc5d6f5 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.
2016-10-24 00:30:58 -04:00
woogerboy21
32d2fa13f6 Missed example bra cket 2016-10-19 19:26:06 -04:00
woogerboy21
05f90a74a4 Update log path example when running under windows
Added example of log path syntax when running servatrice under windows.
2016-10-19 19:24:44 -04:00
ctrlaltca
40468a79ea Merge branch 'master' into CleanupMaxUserCheck 2016-10-17 12:27:20 +02:00
Kevin Boxhoorn
0b7f4c134c Disallow usernames that contain certain words and RegExp (#2200)
* 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`
2016-10-17 12:24:42 +02:00
woogerboy21
10b677acdf Cleanup max user check at login
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.
2016-10-16 12:48:39 -04:00
ctrlaltca
0f0f9a1246 fix #2118 (#2119) 2016-08-02 21:58:56 -04:00
woogerboy21
5002c293c7 Corrected servatrice.sql file room table entries that were missed 2016-07-25 01:01:35 -04:00
ctrlaltca
2cbfc5a8e6 Merge pull request #2096 from ctrlaltca/fix_2091
Fix infinite loop on local game close
2016-07-24 12:29:03 +02:00
woogerboy21
1c1192c525 Update maint script files 2016-07-21 10:38:46 -04:00
woogerboy21
b39a18b446 Remove unused news database table 2016-07-21 10:30:38 -04:00
woogerboy21
600a8e8c60 Update servatrice to respect server id when doing room information lookups 2016-07-21 09:09:06 -04:00
Fabio Bas
d61d9c98a0 Avoid locking on local server shutdown 2016-07-20 16:53:57 +02:00
Fabio Bas
36e62df67d Remove additional minute 2016-07-19 11:57:11 +02:00
Zach H
d82564d84c Shutdown timer changes (#2084)
* change msg popup time from 10min to 30min

* countdown at half time

* simplify math

* move shutdown after checks
2016-07-15 14:02:40 -04:00
skwerlman
deb8a2c954 fix typo in sample servatrice ini 2016-07-14 03:01:11 -04:00
Fabio Bas
430f1baf2f make gcc an happy puppy 2016-07-09 10:18:12 +02:00
Fabio Bas
5b21dc8cde Implementation of websockets in servatrice and test js client 2016-06-26 19:38:53 +02:00
Gavin Bisesi
089acfd84a Use QCommandLineParser instead of by-hand parsing.
This will be more flexible for future CLI options
2016-05-16 22:07:29 +02:00
Fabio Bas
bb5292aa8d Drop Qt4, libgcrypt, qtmobility dependencies 2016-05-11 12:45:58 +02:00
ctrlaltca
55f3e9314b Merge pull request #1859 from ctrlaltca/carddb
Rework some parts of the card database
2016-03-30 22:55:36 +02:00
Fabio Bas
a55b3784eb cmake: Enable c++11 for all targets 2016-03-21 11:42:38 +01:00
ctrlaltca
41494b49dd Merge pull request #1873 from ctrlaltca/serva_emailz
Servatrice: Split requireemail into requireemail and requireemailaction
2016-03-18 18:59:17 +01:00
Fabio Bas
68e2fb912f Servatrice: Split requireemail into requireemail and requireemailactivation 2016-03-17 16:22:42 +01:00
Fabio Bas
62cb89d224 Fix mysql plugin deploy on windows 2016-03-08 12:54:04 +01:00
woogerboy21
3ba3f1e2a7 Added MySQL 5.7 lib path to servatrice CMAKE
Added default search path for most recent version of MySQL
2016-02-27 15:13:59 -05:00
Fabio Bas
ac06544849 Added 64bit libraries each path for libmysqlclient 2016-02-23 08:56:47 +01:00
ctrlaltca
66634c9b3d Merge pull request #1808 from ctrlaltca/innodb
Move schema to Innodb and add FKs
2016-02-22 16:39:03 +01:00
woogerboy21
4e78d6ec95 Merge remote-tracking branch 'refs/remotes/origin/master' into mod_notify_onbanwarn 2016-02-21 16:36:20 -05:00
Fabio Bas
aac2d09f48 Move schema to Innodb and add FKs
Fix #1805
2016-02-17 21:24:28 +01:00
woogerboy21
8f819dfa66 Update replay maintenance script
Update the replay maintenance script to allow for rolling replay maintenance along with cleanup of the two associated db tables (replay access and games).  This updated script will now allow players to see the past X days (8 by default) of replays rather than loosing all replays from the point in the the script gets run.
2016-02-10 10:53:18 -05:00
woogerboy21
3ed3919349 Merge branch 'master' into mod_notify_onbanwarn 2015-12-30 12:58:29 -05:00
Fabio Bas
49b22b7d2f Try to fix package creation 2015-12-27 16:03:32 +01:00
Fabio Bas
53191fcb99 Whoops: Fix db schema number 2015-12-13 11:53:30 +01:00
ctrlaltca
ce6c97bcef Merge pull request #1670 from jedinerd/sql_fix_for_token_disabled_option
Having token set to not null breaks the use of requireemail=false
2015-12-13 11:46:23 +01:00
Gavin Bisesi
3aac8930cc Add script to validate schema changes.
Basic assertions about version updates
2015-12-13 10:47:39 +01:00
Fabio Bas
beecc0f970 Improved login error message 2015-12-11 18:42:29 +01:00
Michael Hogg
d9c0c97ae7 Updating schema version to 12 and adding migration script. 2015-11-08 03:05:12 -08:00
Michael Hogg
9963e9dfe7 Having token set to not null breaks the use of requireemail=false in the servatrice.ini as token will be null in this use case. 2015-11-07 12:57:58 -08:00
Fabio Bas
74c58cc2b0 fix qt libraries bundling on osx
fix #1547
2015-10-01 23:35:54 +02:00
woogerboy21
acbe2b0b3c Re-Implemented the moderator notification upon user warning/ban 2015-09-28 18:21:39 -04:00
woogerboy21
7d7151135e Removed mod notification code that causes crashes 2015-09-26 23:19:49 -04:00
woogerboy21
7a4cabaf67 Corrected mod_name column syntax in warnings table
It was missing a comma at the end of the line.
2015-09-25 18:19:44 -04:00
woogerboy21
b65882f7ce Updated cockatrice_warnings table to use id column as primary key 2015-09-25 07:35:23 -04:00
woogerboy21
62ffcde6bd Added logs tab to allow moderators the ability to review log history/details 2015-09-23 00:50:01 -04:00
woogerboy21
6ad2a59367 Added official warning messages moderators can use to inform users 2015-09-22 22:27:46 -04:00
Zach H
ccc8ac4826 minor fixes 2015-09-18 09:56:32 -04:00
woogerboy21
b0693299c7 Added server private message functionality to allow server based PM notifications.
Ban based notification to other online moderators is the first form implemented by this PR.
2015-09-17 22:40:29 -04:00
woogerboy21
87a64da1bc Added chat history to a room that is displayed on join.
With this update a new chat history definition is added on a per
room bases which allows operators to specify the number of chat
messages to store and present to the user on join.  Please see
the sample ini for room definitions.
2015-09-14 17:54:04 -04:00
woogerboy21
46f78fcead Fix server crash on banning 2015-09-13 00:52:52 -04:00
woogerboy21
90cb890cc2 Added the ability or moderation staff to request user ban history 2015-09-10 16:02:45 -04:00
woogerboy21
d7d50def51 Added user analytics table to database 2015-09-08 14:56:10 -04:00
Gavin Bisesi
ebc4011559 Restore register.py script removed in 5ace0dd892
This is intended to be an example of using the protocol from something
other than C++ and to be a building block for future test clients.
2015-09-03 09:13:31 -04:00
woogerboy21
044c2356ff Added server/client feature set communication 2015-09-02 17:54:06 -04:00
marco
baa61d0571 Merge branch 'master' into Refactor-settings
Conflicts:
	oracle/CMakeLists.txt
2015-09-01 21:28:53 +02:00
woogerboy21
d8b53f9345 Update ban check to exclude empty client id's 2015-08-30 18:48:57 -04:00
marco
0b94b47f72 Servatrice portable + cmake options
Use -DPORTABLE=1 to build a portable version
2015-08-25 21:25:13 +02:00
Zach
e9156ecd62 Merge pull request #1391 from woogerboy21/admin_adjustmods
Allows admins to promote users to mod and demote mod to user
2015-08-22 00:03:46 -04:00
Gavin Bisesi
66f14c1168 Address PR feedback 2015-08-21 23:03:15 -04:00
Zach
a6a62b3334 Merge pull request #1354 from Cockatrice/fix-1351
Fix #1351 - Server ignores only-reg if in "none" auth mode.
2015-08-21 22:15:32 -04:00
Daenyth
6170c9037f Fix #1351 - Server ignores only-reg if in "none" auth mode.
When in none auth mode, registered users don't exist; hence the setting
makes the game impossible to join.

Normally the setting would be greyed out when the user is unregistered,
but commit 475c54bf introduced a new edge case where the stored setting
would apply to the field even if the user is unregistered, making the
setting possible to apply in no-reg mode. Regardless, any client could
have done this, not just the default cockatrice.

The server side fix should prevent all issues in the future.
2015-08-21 20:30:46 -04:00
woogerboy21
39fcabe921 Allows moderators to promote users to mod and demote mod to user 2015-08-20 22:42:10 -04:00