Commit graph

586 commits

Author SHA1 Message Date
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
woogerboy21
65635bcdd8 Corrected miss-matched schema versions
Schema version should be 7 (not 6) for current commit level.  Not sure exactly why it wasn't updated.
2015-08-18 07:40:12 -04:00
woogerboy21
3e94c9d283 Define permission levels for rooms 2015-08-15 21:00:51 -04:00
woogerboy21
bb0b626cee Add last_login column to user table and populate upon login 2015-08-15 03:00:34 -04:00
woogerboy21
b102a05a36 Add ability to ban by client id 2015-08-14 00:06:37 -04:00
woogerboy21
8bf58af727 Merge pull request #1365 from woogerboy21/add_clientid_tosessions
Add clientid field to sessions table.
2015-08-12 08:07:01 -04:00
Zach
1c3e13109f Merge pull request #1361 from woogerboy21/servatrice_disable_replaystorage
Add option to servatrice to disable replay storage.
2015-08-11 16:32:37 -04:00
woogerboy21
7c81f8a610 Added lower case country code on correction. 2015-08-11 15:46:59 -04:00
woogerboy21
f636c0ee19 Add script to validate/clear invalid country codes in the DB. 2015-08-11 14:20:40 -04:00
woogerboy21
d52cf379ee Updated servatrice.sql to reflect new sessions table field. 2015-08-11 12:53:56 -04:00
woogerboy21
eb5833609a Add clientid field to sessions table. 2015-08-11 12:45:04 -04:00
woogerboy21
fefceac2c6 Add option to servatrice to disable replay storage. 2015-08-10 15:29:30 -04:00
woogerboy21
f4942d1ea7 Merge pull request #1346 from woogerboy21/regonly_server_refactor
Reg only server cleanup
2015-08-09 13:57:17 -04:00
Fabio Bas
76ba3b557d Fix compilation of servatrice with mdvc
Should fix #1336
2015-08-09 18:17:10 +02:00
woogerboy21
b4e0c00cca Add database migration script for client id 2015-08-09 08:47:21 -04:00
woogerboy21
17392f1ae5 Moved the RegOnlyRequirement functions out of the Database interface into the proper Server block of code. 2015-08-08 16:24:37 -04:00
woogerboy21
af237c7d07 Fixed space/tabing issues. 2015-08-08 08:52:19 -04:00
woogerboy21
bc99024e4f Added server side setting to allow the requirement of a client id from clients. 2015-08-08 08:52:19 -04:00
woogerboy21
52db13a1ca Initial release of client ID generation. 2015-08-05 10:15:49 -04:00
woogerboy21
eb9ca58fd0 Updated pingClockTimeout to account for adjustments in client keep alive settings value.
Changed the default value for the client keep alive variable back to 1 (since that is what the setting is if the value is not found in the configuration ini file).
2015-07-30 16:38:02 -04:00
woogerboy21
8c7301b19f Updated server and client ping to 5 seconds. Also changed hard set 1 second value on the ping timers to read values from the settings cache. 2015-07-29 23:44:00 -04:00
Zach
c0bb640a37 Merge pull request #1295 from ctrlaltca/servatrice_email_v2
Refactor servatrice email send
2015-07-26 21:13:58 -07:00
Zach
f3ee1eac12 Merge pull request #1287 from ctrlaltca/servatrice_db_version
Fix misleading error message in servatrice; fix #1275
2015-07-25 22:36:01 -07:00
Fabio Bas
9c38b08407 Again on the same problem 2015-07-25 19:51:32 +02:00
Fabio Bas
c714932e25 Fix compilation under OSX with homebrew's qt5.5 2015-07-25 19:28:30 +02:00
Fabio Bas
1ffc9b4561 Refactor servatrice email send 2015-07-25 18:48:34 +02:00
Fabio Bas
946410de2b Fix misleading error message in servatrice; fix #1275 2015-07-22 17:51:30 +02:00