Commit graph

557 commits

Author SHA1 Message Date
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
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
marco
c8d59eec5e Refactred settings to use settingscache & ini files 2015-08-22 01:05:15 +02:00
woogerboy21
39fcabe921 Allows moderators to promote users to mod and demote mod to user 2015-08-20 22:42:10 -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
woogerboy21
eb5833609a Add clientid field to sessions table. 2015-08-11 12:45:04 -04:00
woogerboy21
fa77cdf3b5 Removed clientid requirements from the protocol handler. 2015-08-10 16:07:20 -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
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
13011180f7 Merge pull request #1313 from woogerboy21/update_pingtime
Update Client & Server ping time
2015-08-03 12:31:20 -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
8d325b9e19 Servatrice: do not disclose user emails to clients 2015-07-28 22:20:40 +02:00
woogerboy21
a9acb3f1cc Total Max User Restriction
Syntax correction.
2015-07-13 17:54:03 -04:00
Zach
f199e20740 Merge pull request #1216 from ZeldaZach/fix_morphs
Fix Morphs from Sharing Information
2015-07-07 22:00:32 -04:00
Zach
6bf421cc31 Merge pull request #1210 from ctrlaltca/profile_edit
Profile management
2015-07-07 02:01:27 -04:00
Zach
e76c109f2d Merge pull request #1217 from ZeldaZach/fix_cheat
Prevent Hash Collision
2015-07-06 23:49:48 -04:00
Zach H
339db24b56 efficency loop 2015-07-06 17:52:20 -04:00
Zach H
9e2da24629 use QSet for zones 2015-07-06 11:02:43 -04:00
Zach H
8e4f0c50af remove breaks 2015-07-06 01:31:24 -04:00
Zach H
ef268d79c3 prevent cheating with hashes 2015-07-06 00:30:17 -04:00
Zach H
8221d37bbe don't share PT 2015-07-05 23:11:26 -04:00
Zach H
1bda6e53b2 allow mod global msg 2015-07-05 22:06:35 -04:00
Fabio Bas
15998fb3e6 Misc fixes 2015-07-05 22:44:35 +02:00
Fabio Bas
7f5f290c93 Profile management 2015-07-05 22:44:35 +02:00
Zach
31890450dc Merge pull request #1205 from ZeldaZach/fix_1173
Server Name Rules Information
2015-07-04 19:37:50 -04:00
Fabio Bas
6cf3db7e6b Servatrice: refactor signal handling and permit config reloading 2015-06-30 22:21:26 +02:00
Fabio Bas
02dcaff356 Publish username rules in login failure, too 2015-06-30 18:44:40 +02:00
Fabio Bas
4c27304047 publish username rules in registration failure 2015-06-29 23:35:27 +02:00
Fabio Bas
8826908923 Automatically attach related cards to the original card 2015-06-13 15:40:59 +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
42796b0d0e More fix for -Werror=unused-parameter 2015-05-23 21:17:22 +02:00
Fabio Bas
16d9534757 fix for -Werror=unused-parameter 2015-05-23 21:09:29 +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
ctrlaltca
25f444a5af Merge pull request #1051 from poixen/reveal_top_x
Reveal top x cards
2015-05-16 18:20:56 +02:00
poixen
325e240d67 Merge pull request #1044 from poixen/reveal_bug
Fixed revealing top card bug
2015-05-06 14:15:39 +02:00
Matt Lowe
59c0834427 Reveal top x cards
Updated reveal top card to reveal top x cards
Sometimes you want to reveal more than only the top 1 card.
2015-05-04 10:49:49 +02:00
Matt Lowe
33fa3ae032 Fixed revealing top card bug
Previously if you were to reveal the top card, then look at the top x (x
> 1) cards, then move them to another zone, the top card would stop
being revealed.

The issue was that when moving the cards the first card was being
revealed, then being moved.

I have also fixed an issue too:
+ reveal top card
+ scry 4
+ grab all cards and move to the first column of available space at the
left most of the screen (column 0). Everything is fine.
+ now try with another column (> 0), you will see that the card order
has flipped.

This no longer happens.

This needs some testing before being merged. I will run the build for a
while, right now it feels good though.
2015-05-02 17:25:41 +02:00
Matt Lowe
878b760321 Removed lprotobuf error on building
Will need @ctrlaltca to confirm this wont mess anything up. I have
removed a option to se set from the cmake file. This option is not
needed.

Windows users, you will need to run cmake to create the sln again.
2015-05-01 22:32:31 +02:00
Matt Lowe
9c1e509a37 Fixed issue with non creature perms set to 0/0
The issue was that I had set the ctor to set the p/t to 0/0 rather than
-1/-1. This meant that when you join a game in progress (spec or
reconnect) the server would send the card value to the client as 0/0,
instead of -1/-1. The client has been coded so that if the toughness is
<0 then dont show it. 0/0 is instead shown.

We still need to look into cards with no p/t being set to a 0/1 as
@tooomm mentioned in anther issue. As it stands, this is more important
than that.
2015-04-26 00:57:31 +02:00
Matt Lowe
1356bbcd94 Fix for #1007 2015-04-22 16:53:07 +02:00
Matt Lowe
9a36ac8035 Added colored storm counter 2015-04-19 18:14:29 +02:00
Fabio Bas
1b9d835213 Quick compilation fix for debug mode 2015-04-17 17:30:42 +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
be2a5f4720 Creatures can now have power less than -1
Addresses issue from #934
2015-04-10 12:39:41 +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
Zach
bc8d9427e3 Merge pull request #899 from poixen/mull_flood
Added Mull to the server whitelist
2015-04-01 18:15:44 -04:00
Fabio Bas
dcc6677e8f fix #884 2015-04-01 23:04:10 +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
poixen
93286f6d18 Merge pull request #803 from poixen/removed_constructor
Removed constructor
2015-03-07 11:50:41 +01:00
Zach
5f05c0be91 Merge pull request #775 from Cockatrice/fix-331
Cards played face down always go untapped to main row.
2015-03-06 23:57:05 -05:00
Matt Lowe
319b5d88b2 Removed redundant constructor
Removed constructor that was not needed. Also removes annoying "error"
output when compiling.
2015-03-06 21:09:18 +01:00
Fabio Bas
c72ddcfaed Tabs -> spaces 2015-02-22 20:07:47 +01:00
Fabio Bas
a7b8934a1b Fix remaining issues 2015-02-22 20:02:58 +01:00
Gavin Bises
4d8218da13 Avoid compilation failure due to protobuf bug on osx
https://code.google.com/p/protobuf/issues/detail?id=119
2015-02-21 07:16:51 -05:00
Jeffrey Oliver
843cd9718e Reduce the whitespace in the server game constructor. 2015-02-03 22:22:31 -08:00
Gavin Bisesi
69e6aa355f Merge pull request #534 from poixen/accountage
Added account age to user info window
2015-01-11 21:37:07 -05:00
Matt Lowe
02043ad4f9 Added Account Age
+ Added the ability to see the account age of registered users. Changes
are both in server and client. The server will now send back the
registration date along with the user data. The client will then use
this to calculate the account age and display it in the user details
window.
2015-01-11 00:45:12 +01:00
Fabio Bas
925b4a83b0 Fix "sender id" and "ip address" fields in game 2015-01-01 16:20:57 +01:00
Fabio Bas
cd69bc8f9d Add configuration options to enable database logging 2015-01-01 15:48:53 +01:00
Fabio Bas
c875054fb5 Log messages from rooms, games and chats 2014-12-13 18:43:59 +01:00
Fabio Bas
02978ce404 Implement the logging method 2014-12-13 18:43:31 +01:00
Fabio Bas
15555c16fd Fix servatrice's regonly mode 2014-10-06 22:56:09 +02:00
Gavin Bisesi
134810b979 Merge pull request #279 from ctrlaltca/valgrind_unified
Fixed Valgrind warnings
2014-08-11 09:11:12 -04:00
Gavin Bisesi
5c46cfc169 Merge pull request #179 from woogerboy21/registered-user-only-server
Registered Only Server
2014-08-11 09:03:57 -04:00
Fabio Bas
1da2e7154c Fixed Valgrind warnings
Running cockatrice in valgrind i didn't found any bad memory leak
(good!), but only a few jumps depending on uninitialized variables.
Even if the possibility of crashes are remote, it's nice to sort them
out.
2014-08-11 10:08:33 +02:00
woogerboy21
6b8ca1e8a2 Cleaned up potential memory leak 2014-08-10 15:48:15 -04:00
Fabio Bas
3102dd60f9 Hide unused parameters in common/ to avoid warnings 2014-07-24 18:09:28 +02:00
Fabio Bas
6c7ba0950a Fix warning for DeskList copy constructors
Using pointers for classes derived from QObject would be the best idea.
2014-07-24 18:00:20 +02:00
Gavin Bisesi
395658988a Merge pull request #220 from arxanas/deck-parser-ampersand
Fix #183: Deck parser doesn't too eagerly replace ampersands.
2014-07-23 08:53:04 -04:00
Waleed Khan
359882917a Merge remote-tracking branch 'upstream/master'
Some tabs to spaces, and maybe fixed to work with Qt 5.

Conflicts:
	cockatrice/src/deckstats_interface.cpp
	common/decklist.cpp
	common/decklist.h
	oracle/src/oracleimporter.cpp
2014-07-20 14:40:18 -04:00
arxanas
b1bfda9f4e Merge remote-tracking branch 'upstream/master' into deck-parser-ampersand
Conflicts:
	common/decklist.cpp
2014-07-19 18:12:49 -04:00
arxanas
0eb97c91b3 Fix #183: Deck parser doesn't too eagerly replace ampersands. 2014-07-19 14:47:19 -04:00
arxanas
88e6d0d3eb Tabs to spaces. 2014-07-19 14:28:46 -04:00
woogerboy21
021f0911c4 Merge remote-tracking branch 'upstream/master' into registered-user-only-server
Conflicts:
	common/server.cpp
	common/server_protocolhandler.cpp
	servatrice/src/servatrice.cpp
2014-07-18 23:46:56 -04:00
Gavin Bisesi
f83d58309b Merge pull request #126 from ctrlaltca/cmake_qt5
Qt5 support
2014-07-10 13:13:51 -04:00
arxanas
04e80304ef Fix #184: Deck loader reads 4x cardname correctly. 2014-07-08 22:56:18 -04:00
arxanas
4e8ba699d2 Tabs to spaces. 2014-07-08 22:53:02 -04: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
arxanas
7cbe410172 Fix #45: don't send tokens to deckstats. 2014-06-30 03:08:55 -04:00
Fabio Bas
fc24ffdec2 Cmake reorganization
* Move all cmake-related files in a new “cmake” folder
* move nsis files in there, too, since they are templates parsed by cake
* retrieve git version once when cmake is run, and use it for both
creating version_string.h/cpp and for package naming
2014-06-28 19:39:26 +02:00
Daenyth
09d6d26fb2 Merge branch 'master' into cmake_qt5
Conflicts:
	cockatrice/src/main.cpp
2014-06-28 09:13:10 -04:00
Daenyth
4c2a553f03 Have servatrice inform players of sideboard size
Ref #142
2014-06-28 00:36:43 -04:00
Daenyth
6d3fe428e7 Fix some warnings
Ref #127
2014-06-27 22:19:23 -04:00
Fabio Bas
80f68306b5 Ported oracle to Qt5 2014-06-24 18:28:09 +02:00
Fabio Bas
5c13c06982 Merge remote-tracking branch 'upstream/master' into cmake_qt5 2014-06-24 18:13:26 +02:00
Daenyth
e5d9692d78 Fall back to plain text load when xml load fails 2014-06-24 00:14:59 -04:00
Daenyth
68c0932a2f Don't have decklist sort behavior rely on column order 2014-06-22 08:36:35 -04:00
Daenyth
e99c1bbe6d Merge remote-tracking branch 'origin/master' into editor-sorting-v5 2014-06-22 08:10:22 -04:00
Fabio Bas
d7a962c055 CMake: support fir linking against qt5 2014-06-21 14:12:55 +02:00
Mark Morschhäuser
8708c96695 Merge remote-tracking branch 'origin/master' into win32
Conflicts:
	cockatrice/CMakeLists.txt
	oracle/CMakeLists.txt
2014-06-18 12:09:32 +02:00
Daenyth
6913f2bb4e Merge branch 'master' into musty
Conflicts:
	common/server_cardzone.cpp
2014-06-14 19:06:49 -04:00
Fabio Bas
a4fbf8b677 Force linking with pthread under unix
Protobuf depends on pthread under unix, but cmake’s FindProtobuf
doesn’t add -lpthread to link flags
2014-06-13 19:09:33 +02:00
Fabio Bas
721cf6fe4f Re-indent CMakeLists.txt using spaces 2014-06-11 18:08:30 +02:00
Fabio Bas
ed0311d59e Added comments for comment's CMakeLists.txt 2014-06-11 01:26:54 +02:00
Fabio Bas
4fd8c94df0 Overhaul common's CMakeLists.txt
* Use automoc instead of a manual list of headers
* Remove Qt4 detection
* Created missing .cpp for .h files (for automoc detection)
* Remove pthread linking
* Forcing -lprotobuf is not needed for mingw; msvc only?
2014-06-11 01:24:34 +02:00
Mark Morschhäuser
ccab97ca7d RNG: added additional checks (which forced an interface redesign), updated comments 2014-06-09 13:31:21 +02:00
Mark Morschhäuser
197dd0f3c8 Remove useless bound checks. 2014-05-30 11:48:07 +02:00
Mark Morschhäuser
69201460e6 Included climits for UINT_MAX non-aware compilers. 2014-05-18 10:54:41 +02:00
Mark Morschhäuser
f964dcc656 Added additional bound checks. 2014-03-20 15:37:21 +01:00
Mark Morschhäuser
fbf54b62bc Test if macro already exists to shutup warning. 2014-03-18 20:41:39 +01:00
Mark Morschhäuser
7c606af63e Fixed warning regarding virtual function overrides. Using C++ standard.
See http://msdn.microsoft.com/en-us/library/bb384874(v=vs.90).aspx
2014-03-12 09:11:01 +01:00
Mark Morschhäuser
4eb845d438 Throw exception if RNG is used with invalid bounds. 2014-03-11 09:41:37 +01:00
Mark Morschhäuser
9a20e5e2e2 Commented a pitfall in case of RNG replacement. 2014-03-11 08:18:54 +01:00
Mark Morschhäuser
800f7e6373 Use distribution function with rejection sampling. 2014-03-10 14:13:46 +01:00
Mark Morschhäuser
424513eb90 Forgot to add lower bound in RNG generation. 2014-03-08 17:45:59 +01:00
Name
0128798c64 4 Space Tabs 2014-03-08 11:35:35 -05:00
Mark Morschhäuser
a15eb6f29f Updated SFMT RNG code, removed Qt RNG 2014-03-08 17:08:40 +01:00
Musty Mustelidae
1d3667f37d Implemented Fisher–Yates shuffle. Assumes RNG function is in form getNumber(min,max), with min and max inclusive (Did not find documentation on function) 2014-03-08 01:23:21 -05:00
Musty Mustelidae
2ad09399f4 Implemented Fisher–Yates shuffle. Assumes RNG function is in form getNumber(min,max), with min and max inclusive (Did not find documentation on function) 2014-03-07 09:09:56 -05:00
Buce
a62ba91a5d Add different compare methods for sorting
Give DeckList nodes the ability to sort based on name, price, or
number.
2014-02-28 15:38:23 -06:00
Matt Kelly
b93317cc17 OS X still works with pthread fix - added explanation 2014-02-14 14:14:10 -05:00
Matt Kelly
e366bd7a71 Fixed for Linux - pushing to test on OS X 2014-02-14 13:58:54 -05:00
jfreake
504a56cf95 Right aligned the regex check
decklist - Right aligned the regex check
2014-01-08 12:55:44 -04:00
jfreake
67c4d089be Deck Load Mods and Movable Tabs
Changes:
Deck Load - Default to all types *.*
Decklist - Strip "|edition" from .dec formats that include a pipe and
the edition after the card name
Tab_Supervisor - Make tabs movable (able to rearrange tabs)
2014-01-08 11:54:02 -04:00
Tomasz Wegrzanowski
b57d628278 Made Ctrl-V importer work more robust. 2013-11-12 11:46:38 +00:00
Mark Morschhäuser
562de0553f Fixed compile warnings due to missing \n at EOF. 2013-05-15 21:31:47 +02:00
Daenyth
347d30a84b Merge branch 'master' of git://github.com/mbruker/Cockatrice 2013-02-27 12:36:14 -05:00
Max-Wilhelm Bruker
ce642e3000 don't use Server_Room::getInfo when updating 2013-02-15 19:31:37 +01: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
9f13254d01 don't allow players to move cards that are attached to something 2013-02-03 18:23:54 +01:00
Max-Wilhelm Bruker
6807bb0bd7 server crash fix 2013-01-28 13:40:42 +01:00
Max-Wilhelm Bruker
c65f327e71 server crash fixes 2013-01-27 15:15:27 +01:00
Max-Wilhelm Bruker
14287e54f9 server crash fix 2013-01-26 16:08:42 +01:00
Max-Wilhelm Bruker
d5ccda49a1 server code cleanup 2013-01-23 11:51:59 +01:00
Max-Wilhelm Bruker
60a1f5d7d1 Server_CardZone::getFreeGridColumn() now runs in O(log n), which should remove the performance bottleneck when processing insertCard(x = -1) commands on a large zone, e.g. createToken 2013-01-20 16:40:15 +01:00
Max-Wilhelm Bruker
590ab2f598 fixed #84: game creator couldn't re-join his game if the only buddies flag was set 2013-01-19 21:17:21 +01:00
Max-Wilhelm Bruker
2789116d03 fixed cmdDeckSelect (2) 2013-01-12 16:33:29 +01:00
Max-Wilhelm Bruker
1d151d2d12 cmdDeckSelect fixed 2013-01-10 14:31:07 +01:00
Max-Wilhelm Bruker
733aa6c52b Server_CardZone speed optimisation 2013-01-03 18:16:17 +01:00
Max-Wilhelm Bruker
8b6eace312 code cleanup 2013-01-03 17:18:37 +01:00
Max-Wilhelm Bruker
cc3760a7df fixed deadlock condition 2012-11-16 21:42:17 +01:00
Max-Wilhelm Bruker
43d7cf6a1a removed recursive lock in server; moved object serialisation to worker thread 2012-10-14 13:19:03 +02:00
Daenyth
af09d0d294 Reject more invalid usernames from clients.
Specifically this should cover people connecting with a username of
"\u200C"
2012-07-25 00:12:35 -04:00
Max-Wilhelm Bruker
4c9165f099 fixed #62: shuffling doesn't reveal the top card even if AlwaysRevealTopCard is set 2012-07-17 19:22:09 +02:00
Max-Wilhelm Bruker
886f12d116 fixed #63: spectators have sideboard lock icons 2012-07-17 19:17:26 +02:00
Max-Wilhelm Bruker
a1e35ccda5 servatrice: create correct game ids when not using a database 2012-07-17 18:47:00 +02:00
Max-Wilhelm Bruker
f080e8b1a4 fixed bug #61: replay doesn't show game info; also fixed playing area not being displayed in any subgame but the first 2012-06-27 20:03:39 +02:00