Commit graph

229 commits

Author SHA1 Message Date
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
18a07274d4
clangify everything with the new header sorting (#3908) 2020-03-18 17:36:02 -04: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
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
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
bf154559eb Reset idle timer when a message is sent. (#2456) 2017-03-12 11:52:43 +01:00
woogerboy21
0cfa6863d5 Simpler forgot password functionality (#2393)
* Simpler forgot password functionality (Server/Client)
2017-02-15 17:41:40 -05:00
woogerboy21
36e6da2abd Fix idle timeout warning on registration / login (#2322)
Fix #2319
This should resolve the issue of users getting the popup immediately when logging in and the time out value is set to 0.
This needs tested, its a quick fix put in with the web editor.
2016-12-20 16:15:16 -08:00
woogerboy21
f6e4ee9a4a Fix #2270 (#2271)
Fix #2270
Check userinfo first before trying to use it.
2016-11-09 14:40:18 +01: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
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
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
Fabio Bas
5b21dc8cde Implementation of websockets in servatrice and test js client 2016-06-26 19:38:53 +02:00
Fabio Bas
d79d65797f Remove unneeded debug 2016-01-24 23:02:25 +01:00
Fabio Bas
25d77fb64a Possibly fix #1598 2015-12-15 16:58:44 +01:00
Fabio Bas
beecc0f970 Improved login error message 2015-12-11 18:42:29 +01: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
d7d50def51 Added user analytics table to database 2015-09-08 14:56:10 -04:00
woogerboy21
044c2356ff Added server/client feature set communication 2015-09-02 17:54:06 -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
3e94c9d283 Define permission levels for rooms 2015-08-15 21:00:51 -04:00
woogerboy21
fa77cdf3b5 Removed clientid requirements from the protocol handler. 2015-08-10 16:07:20 -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
94942e1a92 Commit to resolve requests made by @Daenyth discussed after the commit.
See https://github.com/Cockatrice/Cockatrice/pull/1340 for details.
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
Fabio Bas
02dcaff356 Publish username rules in login failure, too 2015-06-30 18:44:40 +02:00
Fabio Bas
471f6371b5 More work
* Refactored code out of common/ into servatrice/
 * added smtp client library
 * disable registration when connected
 * validate email address
 * send activation token via email
2015-05-24 23:02:51 +02:00
Fabio Bas
21155ce54a Make gcc an happy puppy (-Wunused-parameter) 2015-05-24 00:47:12 +02:00
Fabio Bas
ff1aed717e Added token generation, user activation command and response. 2015-05-24 00:37:45 +02:00
Fabio Bas
5ace0dd892 Almost completed registration
* added missing bits of serverside code;
 * added fronted in client;
 * removed demo python scripts;
2015-05-23 20:13:03 +02:00
Gavin Bises
735fcbf311 Add first draft of protocol extension for registration
Stub for registration command handling in server

First draft of handling registration requests

WIP (will be rebased)

clean up bad imports (rebase this later)

Finish checkUserIsBanned method

Add username validity check

Check servatrice registration settings

WIP

Finish(?) server side of registration

Needs testing

Fix switch case compile failure

I have no idea why I have to do this

WIP for registration testing python script

Stub register script initial attempt

Rearrange register script

First try at sending reg

register.py sends commands correctly now

Add more debug to register.py

Pack bytes the right way - servatrice can parse py script sends now

register.py should be working now

Parse xml hack correctly

Log registration enabled settings on server start

Insert gender correctly on register

Show tcpserver error message on failed gameserver listen

Fail startup if db configured and can't be opened.

TIL qt5 comes without mysql by default in homebrew...
2015-05-22 18:55:51 +02:00
Matt Lowe
f46d68b5c6 Server was using message limit for commands
Server was using getMaxMessageCountPerInterval over
getMaxCommandCountPerInterval.

Raised command limit from 10 to 20
2015-04-12 22:55:38 +02:00
Matt Lowe
7680154395 Added more actions to server white list
I have added card moving to the white list. I was getting flood messages
when moving cards quickly in my side deck.
2015-04-07 21:49:49 +02:00
Matt Lowe
c039a3aa42 Added Mull to the whitelist
Mullling through 2 hands will give a flood warning, a user thought this
should not happen. It is very similar to drawing cards, which is in the
white list.
2015-04-01 22:08:46 +02:00
Fabio Bas
5463255516 Added whitelist for game commands 2015-03-19 10:50:46 +01:00
Fabio Bas
0e437cf13b Anti flood for game commands 2015-03-14 19:44:32 +01:00
Fabio Bas
c875054fb5 Log messages from rooms, games and chats 2014-12-13 18:43:59 +01:00
woogerboy21
0a1fe7f5a8 Requested Cleanup
Corrected tab to 4 space (per request)
Moved regonly option under authentication ini location (per request)
2014-07-02 22:27:05 -04:00
woogerboy21
d246fa39fe Registered Only Server
Implemented the ability to set the server to only allow registered
users.  Also updated client to reflect the log-in rejection as well as
put a check in place for the server to not start if db connection is not
available yet registration is required.
2014-07-02 20:52:22 -04:00
Daenyth
347d30a84b Merge branch 'master' of git://github.com/mbruker/Cockatrice 2013-02-27 12:36:14 -05:00
Max-Wilhelm Bruker
7a30b827c8 changed Server_Room::gamesMutex to QReadWriteLock 2013-02-11 15:43:31 +01:00
Max-Wilhelm Bruker
00029eeeb4 Server_Room optimisation 2013-02-11 15:29:19 +01:00
Max-Wilhelm Bruker
c65f327e71 server crash fixes 2013-01-27 15:15:27 +01:00
Max-Wilhelm Bruker
d5ccda49a1 server code cleanup 2013-01-23 11:51:59 +01:00