204 Commits
Author SHA1 Message Date
Kai Philipp ffdcd9af61 bugfix ip block 2019-10-03 20:28:52 +02:00
Kai Philipp 1449e370d5 re-enabled ip block 2019-10-03 20:27:31 +02:00
Kai Philipp 31f7b845ff bugfix create game 2019-10-03 20:15:34 +02:00
Kai Philipp 60d96d4d75 bugfix 2019-10-03 13:55:37 +02:00
Kai Philipp 8ebc7509e9 disabled ip block for ranking games - tesfor testing 2019-10-03 13:52:51 +02:00
Kai Philipp 95fac5a4f5 switched to rank only games 2019-10-03 13:49:59 +02:00
Kai Philipp 0341c26559 bugfix 2019-09-15 19:50:47 +02:00
Kai Philipp 1e985d9069 bugfix 2019-09-15 19:47:17 +02:00
Kai Philipp a54de1f063 bugfix 2019-09-15 19:44:57 +02:00
Kai Philipp 0622ed28a1 bugfix 2019-09-15 19:42:13 +02:00
Kai Philipp f901d63298 bugfix 2019-09-15 19:41:49 +02:00
Kai Philipp ea596f286b bugfix 2019-09-15 19:41:20 +02:00
Kai Philipp 6a5554ca6f bugfix 2019-09-15 19:38:51 +02:00
Kai Philipp b44e7aef7d bugfix 2019-09-15 19:38:04 +02:00
Kai Philipp 3fcb4bdf04 bugfix 2019-09-15 19:36:34 +02:00
Kai Philipp add1a616b2 bugfix 2019-09-15 19:35:52 +02:00
Kai Philipp 1e7799ca79 bugfix 2019-09-15 19:34:23 +02:00
Kai Philipp 836986c70b error msg 2019-09-15 19:33:38 +02:00
Kai Philipp ebf6108e53 error msg 2019-09-15 19:21:39 +02:00
Kai Philipp 363c5f13e0 error msg 2019-09-15 18:13:10 +02:00
Kai Philipp 0e0a8fddd8 error msg 2019-09-15 18:11:36 +02:00
Kai Philipp 9e359ae749 usigned warning 2019-09-15 18:07:42 +02:00
Kai Philipp 5b369cfaf7 error msg 2019-09-15 18:06:31 +02:00
Kai Philipp 5c4983fb1e bugfix 2019-09-15 17:41:25 +02:00
Kai Philipp f9b9b91df7 bugfix 2019-09-15 17:39:17 +02:00
Kai Philipp d707d3d653 bugfix 2019-09-15 17:36:03 +02:00
Kai Philipp fb9a1a8781 bugfix 2019-09-15 17:34:16 +02:00
Kai Philipp 926924a7f6 using config.xml values for limitrank 2019-09-15 17:31:24 +02:00
Kai Philipp c2aba0782c using config.xml values for limitrank 2019-09-15 17:30:54 +02:00
Kai Philipp b3117f3046 using config.xml values for limitrank 2019-09-15 17:29:09 +02:00
Kai Philipp bbd05513fd bugfix 2019-09-14 21:54:47 +02:00
Kai Philipp 78d150867f bugfix 2019-09-14 21:51:38 +02:00
Kai Philipp 289adcd743 bugfix 2019-09-14 21:50:14 +02:00
Kai Philipp b628df6868 bugfix 2019-09-14 18:52:02 +02:00
Kai Philipp 8120e1772f bugfix vector erase 2019-09-14 18:51:18 +02:00
Kai Philipp 9062317a38 bugfix vector erase 2019-09-14 18:20:21 +02:00
Kai Philipp 7303d235a0 bugfix string split 2019-09-14 18:14:34 +02:00
Kai Philipp f44711082b bugfix string split 2019-09-14 18:10:36 +02:00
Kai Philipp 3f1f946653 bugfix string split 2019-09-14 18:08:47 +02:00
Kai Philipp df81e925dc bugfix vector erase 2019-09-14 18:07:54 +02:00
Kai Philipp 213d110bc6 bugfix vector erase 2019-09-14 17:54:20 +02:00
Kai Philipp a93bb49485 bugfix vector erase 2019-09-14 17:50:48 +02:00
Kai Philipp 16282c5096 bugfix vector erase 2019-09-14 17:48:08 +02:00
Kai Philipp 749c0bb633 bugfix vector erase 2019-09-14 17:47:28 +02:00
Kai Philipp 8290930393 bugfix vector erase 2019-09-14 17:46:43 +02:00
Kai Philipp 5bd3d84bc2 bugfix vector erase 2019-09-14 17:43:32 +02:00
Kai Philipp 66169137a5 log_error 2019-09-14 17:40:01 +02:00
Kai Philipp 0bba55d3c4 log_error 2019-09-14 17:39:36 +02:00
Kai Philipp 9042442d33 log_error 2019-09-14 17:37:02 +02:00
Kai Philipp 8c7d409a8d log_error 2019-09-14 17:35:33 +02:00
Kai Philipp e5a975dd8c log_error 2019-09-14 17:29:10 +02:00
Kai Philipp 6681fe2102 log_error 2019-09-14 17:18:55 +02:00
Kai Philipp 1f6758f3dc log_error 2019-09-13 19:21:16 +02:00
Kai Philipp b8d84e32b9 bugfix 2019-09-13 19:09:48 +02:00
Kai Philipp 24b9a4eb4d bugfix 2019-09-13 18:52:51 +02:00
Kai Philipp 6146a71ddd bugfix 2019-09-13 18:52:00 +02:00
Kai Philipp 3606875b3d bugfix 2019-09-13 18:42:24 +02:00
Kai Philipp eedd9c0526 bugfix 2019-09-13 18:38:02 +02:00
Kai Philipp cfced4e480 bugfix 2019-09-13 18:36:13 +02:00
Kai Philipp 33c3cc2dc4 bugfix 2019-09-13 18:32:07 +02:00
Kai Philipp f610568532 bugfix 2019-09-13 18:30:51 +02:00
Kai Philipp 36389ba750 bugfix 2019-09-13 18:28:42 +02:00
Kai Philipp fdc37cfb65 bugfix 2019-09-13 18:27:44 +02:00
Kai Philipp d0332aab7c bugfix 2019-09-13 18:26:17 +02:00
Kai Philipp 4c30f251f0 NULL check 2019-09-13 18:24:44 +02:00
Kai Philipp 2f4492a4af NULL check 2019-09-13 18:22:42 +02:00
Kai Philipp a1f9278b4f NULL check 2019-09-13 18:21:21 +02:00
Kai Philipp 9931e499bc NULL check 2019-09-13 17:54:59 +02:00
Kai Philipp 5fa4dee864 NULL check 2019-09-13 17:52:20 +02:00
Kai Philipp c5bd29f4fe NULL check 2019-09-13 17:51:16 +02:00
Kai Philipp 0598470942 NULL check 2019-09-13 17:49:30 +02:00
Kai Philipp 834449af57 NULL check 2019-09-13 17:46:06 +02:00
Kai Philipp 63cf638805 NULL check 2019-09-13 17:44:41 +02:00
Kai Philipp e1bceec4b1 NULL check 2019-09-13 17:36:54 +02:00
Kai Philipp e272ff0eed NULL check 2019-09-13 17:35:41 +02:00
Kai Philipp 5f69d6e9f0 NULL check 2019-09-13 17:34:16 +02:00
Kai Philipp a28d67ac97 NULL check 2019-09-13 17:32:36 +02:00
Kai Philipp 8ad3f8de69 NULL check 2019-09-13 17:21:08 +02:00
Kai Philipp 9e547bcb98 NULL check 2019-09-13 17:20:17 +02:00
Kai Philipp 2dbc570f15 NULL check 2019-09-13 17:17:57 +02:00
Kai Philipp ab595e8bea hmmm 2019-09-13 17:15:57 +02:00
Kai Philipp dbcb482cb9 hmmm 2019-09-13 17:12:05 +02:00
Kai Philipp 2a43df54e0 string to long conversion 2019-09-13 17:09:21 +02:00
Kai Philipp 57a17d7955 string to long conversion 2019-09-13 17:08:36 +02:00
Kai Philipp 97cac10b9a uncommented 2019-09-13 16:56:14 +02:00
Kai Philipp c3ecf794d8 active block handling fixed 2019-09-13 15:53:32 +02:00
Kai Philipp cab243d978 bug enclosing 2019-09-13 15:42:35 +02:00
Kai Philipp 2b15e8536c bug enclosing 2019-09-13 15:07:54 +02:00
Kai Philipp 40a25f4a1e bug enclosing 2019-09-13 15:05:22 +02:00
Kai Philipp ec1c39040d missing assignment 2019-09-13 15:02:26 +02:00
Kai Philipp dd585173c3 correct query now 2019-09-13 14:56:13 +02:00
Kai Philipp eab4ddde55 bugfix 2019-09-13 14:50:11 +02:00
Kai Philipp 600f95bdd0 bugfix 2019-09-13 14:49:26 +02:00
Kai Philipp e6413d143e bugfix 2019-09-13 14:47:56 +02:00
Kai Philipp 06f9fb7fff lastGames restored after login 2019-09-13 14:38:05 +02:00
Kai Philipp f35ce20ff9 bugfix join - rank out 2019-09-11 21:32:00 +02:00
Kai Philipp e4f27684c9 typo! 2019-09-11 20:49:22 +02:00
Kai Philipp 36ac47e1af typo 2019-09-11 20:48:28 +02:00
Kai Philipp c3a5c8ec85 create game limit 2019-09-11 20:45:52 +02:00
Kai Philipp ff4c2c5302 saving real data incl ip now 2019-09-11 20:13:43 +02:00
Kai Philipp 7cda99e881 minor issue 2019-09-11 14:07:24 +02:00
Kai Philipp f4b1d7a5f3 query params ordered 2019-09-11 14:00:33 +02:00
Kai Philipp b2fbe16387 but but :D 2019-09-11 13:47:03 +02:00
Kai Philipp c83be07cd0 now! 2019-09-11 13:43:36 +02:00
Kai Philipp ac44fcf8c6 maybe 2019-09-11 13:28:35 +02:00
Kai Philipp 197d11b787 maybe 2019-09-11 13:22:15 +02:00
Kai Philipp f4f0c4ec71 I dont know 2019-09-11 13:17:11 +02:00
Kai Philipp 7d37c2f3fc Init re-integrated 2019-09-11 13:05:31 +02:00
Kai Philipp 0e90d0ab52 pfff 2019-09-11 12:56:54 +02:00
Kai Philipp c97fd1daa1 direct SingleAsync try 2019-09-11 12:50:55 +02:00
Kai Philipp 4fa8364571 test 2019-09-11 12:20:17 +02:00
Kai Philipp 1325690e8e bugfix? 2019-09-11 12:06:15 +02:00
Kai Philipp 32063dbf16 parameter issue 2019-09-11 11:47:21 +02:00
Kai Philipp 02b5fd9675 paramsissue 2019-09-11 11:36:50 +02:00
Kai Philipp aa4a71fb10 missing include 2019-09-11 11:32:15 +02:00
Kai Philipp e17cb27a8b scope issue? 2019-09-11 11:30:10 +02:00
Kai Philipp 9d8d10d123 bugfix 2019-09-11 11:20:30 +02:00
Kai Philipp be3f7c93c8 missing db class 2019-09-11 11:15:58 +02:00
Kai Philipp 04b4cb211c bugfix 2019-09-11 11:05:24 +02:00
Kai Philipp 5c945df87e SetPlayerLastGames query done 2019-09-11 11:01:08 +02:00
Kai Philipp 9c5a47a5bf bugfix 2019-09-11 05:09:16 +02:00
Kai Philipp 98ce3c6f95 db issue 2019-09-11 05:07:51 +02:00
Kai Philipp ff56a0629b debug 2019-09-11 04:52:41 +02:00
Kai Philipp 8b223f6796 not sure 2019-09-11 04:48:05 +02:00
Kai Philipp 86e348ed94 debug 2019-09-11 04:45:58 +02:00
Kai Philipp 1c71253efe bugifx redec 2019-09-11 04:44:03 +02:00
Kai Philipp 9b3fffc003 bugfix vector type def 2019-09-11 04:41:11 +02:00
Kai Philipp 1c1195fa43 bugfix vector include 2019-09-11 04:38:54 +02:00
Kai Philipp afcec9d39a implemented SetPlayerLastGames db function 2019-09-11 04:36:54 +02:00
Kai Philipp ecf5996135 bugfix 2019-09-11 04:18:42 +02:00
Kai Philipp 4e695d88af iteration over playerDataList 2019-09-11 04:16:29 +02:00
Kai Philipp a153d458dc bugfix 2019-09-11 03:56:37 +02:00
Kai Philipp da00a9a20e bugfix 2019-09-11 03:55:10 +02:00
Kai Philipp 64e543fc16 debug 2019-09-11 03:54:31 +02:00
Kai Philipp ca8e11b18c session iteration 2019-09-11 03:50:31 +02:00
Kai Philipp 9ea49b6d1c debug add connection 2019-09-11 03:43:43 +02:00
Kai Philipp 106a37330a debugging 2019-09-10 22:05:12 +02:00
Kai Philipp 1a5cd36dcf debugging 2019-09-10 21:58:39 +02:00
Kai Philipp df460313ab debugging 2019-09-10 21:49:18 +02:00
Kai Philipp cbb35b4aa3 debugging 2019-09-10 21:46:44 +02:00
Kai Philipp fc614ca5ec debugging 2019-09-10 21:45:54 +02:00
Kai Philipp 69189291af debugging 2019-09-10 21:42:32 +02:00
Kai Philipp cee8977958 debugging 2019-09-10 21:37:58 +02:00
Kai Philipp 2b17095641 debugging 2019-09-10 21:32:44 +02:00
Kai Philipp 8f61128714 bugfix 2019-09-10 21:24:31 +02:00
Kai Philipp 373052a8c7 revert bugfix 2019-09-10 21:23:05 +02:00
Kai Philipp 9d31fc3b5e PlayerIdList StoreLastGames 2019-09-10 21:15:38 +02:00
Kai Philipp 1eb486660e bugfix 2019-09-10 21:01:02 +02:00
Kai Philipp ce5b242ac3 bugfix 2019-09-10 21:00:03 +02:00
Kai Philipp 93534a5154 bugfix 2019-09-10 20:58:29 +02:00
Kai Philipp d246fbcb64 bugfix 2019-09-10 20:57:22 +02:00
Kai Philipp 5cf037c43f bugfix 2019-09-10 20:55:51 +02:00
Kai Philipp 09c4e09946 bugfix 2019-09-10 20:54:59 +02:00
Kai Philipp a667b65a22 bugfix 2019-09-10 20:54:10 +02:00
Kai Philipp e1260038ea bugfix 2019-09-10 20:52:24 +02:00
Kai Philipp 06e3c0e3c3 lastgames from sessiondata to playerdata 2019-09-10 20:47:10 +02:00
Kai Philipp aa93874a45 bugfix 2019-09-10 04:50:24 +02:00
Kai Philipp 709e898c51 bugfix 2019-09-10 04:36:13 +02:00
Kai Philipp 34f17f24dc storelastgames check 2019-09-10 04:33:13 +02:00
Kai Philipp 830145ff3a bugfixes 2019-09-09 23:09:51 +02:00
Kai Philipp c80724c58a bugfixes 2019-09-09 23:08:36 +02:00
Kai Philipp 2f595bb8c7 now maybe? 2019-09-09 23:06:52 +02:00
Kai Philipp f35495c05f now 2019-09-09 23:02:51 +02:00
Kai Philipp b29a8cc0e7 missing redecs 2019-09-09 23:02:08 +02:00
Kai Philipp b3674f2ea5 another iteration try 2019-09-09 23:01:04 +02:00
Kai Philipp d488619ce3 stupid unsigned removed 2019-09-09 22:54:01 +02:00
Kai Philipp 289282dc7a vector handling bugfix 2019-09-09 22:52:35 +02:00
Kai Philipp 5fe59ac751 vector handling bugfix 2019-09-09 22:45:54 +02:00
Kai Philipp 7cc45e85d3 vector handling bugfix 2019-09-09 22:41:57 +02:00
Kai Philipp 2effd5219a 1st timestamp iteration and vector cleanup 2019-09-09 22:40:16 +02:00
Kai Philipp cb51ee79f2 isallowed returns true now 2019-09-09 22:23:22 +02:00
Kai Philipp 4f91bf60dc bugfix 2019-09-09 22:21:39 +02:00
Kai Philipp 7dc83ce49f bugfix 2019-09-09 22:20:54 +02:00
Kai Philipp d882d4f675 timestamp stored debuglog 2019-09-09 22:18:47 +02:00
Kai Philipp f6c47c053b ip block disabled now? 2019-09-09 21:20:16 +02:00
Kai Philipp 8765379a2e if else clause turn-around 2019-09-09 21:13:40 +02:00
Kai Philipp df8f38b8a8 different error msg 2019-09-09 20:46:28 +02:00
Kai Philipp 53602107d9 ip-check off 2019-09-09 20:42:31 +02:00
Kai Philipp 02e8c81974 array to vector now 2019-09-09 20:34:58 +02:00
Kai Philipp ee6c80406a bugfix 2019-09-09 20:28:22 +02:00
Kai Philipp 17036816af bugfix 2019-09-09 20:27:40 +02:00
Kai Philipp 8964467ef9 bugfix 2019-09-09 20:26:41 +02:00
Kai Philipp 9285fa1e32 re-structuring 2019-09-09 20:24:29 +02:00
Kai Philipp ad5735b9fd std:array ? 2019-09-09 20:06:12 +02:00
Kai Philipp 24c05f6d74 another bugfix array declaration 2019-09-09 20:02:16 +02:00
Kai Philipp a3337dd869 another bugfix array declaration 2019-09-09 20:01:20 +02:00
Kai Philipp 16cff5612e bugfix array declaration 2019-09-09 19:59:59 +02:00
Kai Philipp 835a0f6df8 std:array to array 2019-09-09 19:40:03 +02:00
Kai Philipp 962eb48148 switch from std::time to long timestamp only 2019-09-09 19:37:32 +02:00
Kai Philipp 13ebae6618 bugfix array def 2019-09-09 19:33:20 +02:00
Kai Philipp ada2365a73 included array 2019-09-09 19:28:59 +02:00
Kai Philipp e18e459434 limitrank - draft with return false always 2019-09-09 19:21:15 +02:00
Kai Philipp add886ebee Merge pull request #367 from albmed/stable
Stable
2019-07-26 13:55:28 +02:00
Albert Medela f9a2ebebb4 Fix for openssl 1.1.X versions 2019-03-21 13:16:18 +01:00
albmed 21b8088ecf Merge pull request #4 from pokerth/stable
Stable
2019-03-20 16:36:00 +01:00
Olivier Humbert 09281f3179 French translation improvements 2019-01-21 18:27:04 +01:00
q4z1 f5688e01b0 minor bugfix newSock <-> acceptedSocket 2018-10-17 16:39:49 +02:00
Kai Philipp f920d5f1c8 Merge pull request #356 from LocutusOfBorg/cross-fix
make the package cross-compile safe
2018-09-11 15:51:28 +02:00
Helmut Grohne 008d703de1 make the package cross-compile safe 2018-09-11 15:47:27 +02:00
Kai Philipp 0a8b6d597f Merge pull request #349 from albmed/stable
Compilation bugs
2018-07-18 15:15:21 +02:00
albmed 3813664b94 Merge pull request #3 from albmed/dev
Error: HDPI setting moved to non-android targets
2018-05-24 18:39:24 +02:00
Albert Medela ad8c9cabfb Error: HDPI setting moved to non-android targets 2018-05-24 18:33:29 +02:00
albmed 678da490d4 Merge pull request #2 from albmed/dev
Correct #347, #342, #338, #339
2018-05-24 18:31:23 +02:00
Albert Medela 8e5b09ac62 Correct #347, #342, #338, #339 2018-05-24 18:26:34 +02:00
36 changed files with 374 additions and 45 deletions
+1 -1
View File
@@ -18,4 +18,4 @@ uics/
make.sh
gitpush_serverstuff_stable
pokerth_server
.vscode/
+1
View File
@@ -28,6 +28,7 @@
* shall include the source code for the parts of OpenSSL used as well *
* as that of the covered work. *
*****************************************************************************/
syntax = "proto2";
option java_package = "de.chatcleaner.protocol";
option java_outer_classname = "ProtoBuf";
+2 -2
View File
@@ -41,13 +41,13 @@ unix : !mac {
QMAKE_LIBDIR += lib $${PREFIX}/lib /opt/gsasl/lib
INCLUDEPATH += $${PREFIX}/include
LIB_DIRS = $${PREFIX}/lib $${PREFIX}/lib64 $$system(qmake -query QT_INSTALL_LIBS)
LIB_DIRS = $${PREFIX}/lib $${PREFIX}/lib64 $$system($$QMAKE_QMAKE -query QT_INSTALL_LIBS)
BOOST_PROGRAM_OPTIONS = boost_program_options boost_program_options-mt
BOOST_SYS = boost_system boost_system-mt
#
# searching in $PREFIX/lib, $PREFIX/lib64 and $$system(qmake -query QT_INSTALL_LIBS)
# searching in $PREFIX/lib, $PREFIX/lib64 and $$system($$QMAKE_QMAKE -query QT_INSTALL_LIBS)
# to override the default '/usr' pass PREFIX
# variable to qmake.
#
+2 -2
View File
@@ -42,14 +42,14 @@ unix : !mac {
QMAKE_LIBDIR += lib $${PREFIX}/lib /opt/gsasl/lib
INCLUDEPATH += $${PREFIX}/include
LIB_DIRS = $${PREFIX}/lib $${PREFIX}/lib64 $$system(qmake -query QT_INSTALL_LIBS)
LIB_DIRS = $${PREFIX}/lib $${PREFIX}/lib64 $$system($$QMAKE_QMAKE -query QT_INSTALL_LIBS)
BOOST_THREAD = boost_thread boost_thread-mt
BOOST_PROGRAM_OPTIONS = boost_program_options boost_program_options-mt
BOOST_SYS = boost_system boost_system-mt
#
# searching in $PREFIX/lib, $PREFIX/lib64 and $$system(qmake -query QT_INSTALL_LIBS)
# searching in $PREFIX/lib, $PREFIX/lib64 and $$system($$QMAKE_QMAKE -query QT_INSTALL_LIBS)
# to override the default '/usr' pass PREFIX
# variable to qmake.
#
+2 -1
View File
@@ -1,3 +1,4 @@
syntax = "proto2";
/*****************************************************************************
* PokerTH - The open source texas holdem engine *
* Copyright (C) 2006-2013 Felix Hammer, Florian Thauer, Lothar May *
@@ -701,7 +702,7 @@ message ReportGameAckMessage {
message ErrorMessage {
enum ErrorReason {
reserved = 0;
custReserved = 0;
initVersionNotSupported = 1;
initServerFull = 2;
initAuthFailure = 3;
+2
View File
@@ -42,6 +42,7 @@ HEADERS += src/dbofficial/asyncdbauth.h \
src/dbofficial/asyncdbavatarblacklist.h \
src/dbofficial/asyncdbadminplayers.h \
src/dbofficial/asyncdbblockplayer.h \
src/dbofficial/asyncdbplayerlastgames.h \
src/dbofficial/dbidmanager.h
SOURCES += src/dbofficial/asyncdbauth.cpp \
src/dbofficial/asyncdbcreategame.cpp \
@@ -60,6 +61,7 @@ SOURCES += src/dbofficial/asyncdbauth.cpp \
src/dbofficial/asyncdbavatarblacklist.cpp \
src/dbofficial/asyncdbadminplayers.cpp \
src/dbofficial/asyncdbblockplayer.cpp \
src/dbofficial/asyncdbplayerlastgames.cpp \
src/dbofficial/dbidmanager.cpp
win32 {
DEFINES += _WIN32_WINNT=0x0501
+2 -2
View File
@@ -412,7 +412,7 @@ unix:!mac {
LIB_DIRS = $${PREFIX}/lib \
$${PREFIX}/lib64 \
$${PREFIX}/lib/x86_64-linux-gnu \
$$system(qmake -query QT_INSTALL_LIBS)
$$system($$QMAKE_QMAKE -query QT_INSTALL_LIBS)
}
android{
LIBPATH += $${PREFIX}/lib/armv7
@@ -433,7 +433,7 @@ unix:!mac {
BOOST_CHRONO = boost_chrono \
boost_chrono-mt
# searching in $PREFIX/lib, $PREFIX/lib64 and $$system(qmake -query QT_INSTALL_LIBS)
# searching in $PREFIX/lib, $PREFIX/lib64 and $$system($$QMAKE_QMAKE -query QT_INSTALL_LIBS)
# to override the default '/usr' pass PREFIX
# variable to qmake.
for(dir, LIB_DIRS):exists($$dir) {
+2 -2
View File
@@ -180,7 +180,7 @@ unix : !mac {
INCLUDEPATH += $${PREFIX}/include
# see issue https://github.com/pokerth/pokerth/issues/282
INCLUDEPATH += $${PREFIX}/include/libircclient
LIB_DIRS = $${PREFIX}/lib $${PREFIX}/lib64 $$system(qmake -query QT_INSTALL_LIBS)
LIB_DIRS = $${PREFIX}/lib $${PREFIX}/lib64 $$system($$QMAKE_QMAKE -query QT_INSTALL_LIBS)
BOOST_FS = boost_filesystem boost_filesystem-mt
BOOST_THREAD = boost_thread boost_thread-mt
BOOST_PROGRAM_OPTIONS = boost_program_options boost_program_options-mt
@@ -191,7 +191,7 @@ unix : !mac {
BOOST_CHRONO = boost_chrono boost_chrono-mt
#
# searching in $PREFIX/lib, $PREFIX/lib64 and $$system(qmake -query QT_INSTALL_LIBS)
# searching in $PREFIX/lib, $PREFIX/lib64 and $$system($$QMAKE_QMAKE -query QT_INSTALL_LIBS)
# to override the default '/usr' pass PREFIX
# variable to qmake.
#
+2
View File
@@ -312,6 +312,8 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly)
configList.push_back(ConfigInfo("DBServerEncryptionKey", CONFIG_TYPE_STRING, ""));
configList.push_back(ConfigInfo("GameNameBadWordList", CONFIG_TYPE_STRING_LIST, "Regex"));
configList.push_back(ConfigInfo("ServerRestrictGuestLogin", CONFIG_TYPE_INT, "0"));
configList.push_back(ConfigInfo("ServerLimitRankNum", CONFIG_TYPE_INT, "4"));
configList.push_back(ConfigInfo("ServerLimitRankPeriod", CONFIG_TYPE_INT, "60"));
//fill tempList firstTime
configBufferList = configList;
+34 -12
View File
@@ -291,22 +291,33 @@ CryptHelper::AES128Encrypt(const unsigned char *keyData, unsigned keySize, const
outCipher.resize(cipherSize);
#ifdef HAVE_OPENSSL
EVP_CIPHER_CTX encryptCtx;
EVP_CIPHER_CTX_init(&encryptCtx);
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
EVP_CIPHER_CTX *encryptCtx = EVP_CIPHER_CTX_new();
#else
EVP_CIPHER_CTX _encryptCtx;
EVP_CIPHER_CTX *encryptCtx;
encryptCtx = &_encryptCtx;
#endif // OPENSSL_VERSION_NUMBER >= 0x10100000L
EVP_CIPHER_CTX_init(encryptCtx);
int outCipherSize = cipherSize;
int success = EVP_EncryptInit(&encryptCtx, EVP_aes_128_cbc(), key, iv);
EVP_CIPHER_CTX_set_padding(&encryptCtx, 0);
int success = EVP_EncryptInit(encryptCtx, EVP_aes_128_cbc(), key, iv);
EVP_CIPHER_CTX_set_padding(encryptCtx, 0);
if (success) {
success = EVP_EncryptUpdate(&encryptCtx, &outCipher[0], &outCipherSize, paddedPlainStr, paddedPlainSize);
success = EVP_EncryptUpdate(encryptCtx, &outCipher[0], &outCipherSize, paddedPlainStr, paddedPlainSize);
if (success && outCipherSize) {
// Since padding is off, this will not modify the cipher. However, parameters need to be set.
EVP_EncryptFinal(&encryptCtx, &outCipher[0], &outCipherSize);
EVP_EncryptFinal(encryptCtx, &outCipher[0], &outCipherSize);
retVal = true;
}
} else
outCipher.clear();
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
EVP_CIPHER_CTX_free(encryptCtx);
#endif // OPENSSL_VERSION_NUMBER >= 0x10100000L
#else
gcry_cipher_hd_t hd;
gcry_error_t err = gcry_cipher_open(&hd, GCRY_CIPHER_AES128, GCRY_CIPHER_MODE_CBC, 0);
@@ -338,22 +349,33 @@ CryptHelper::AES128Decrypt(const unsigned char *keyData, unsigned keySize, const
BytesToKey(keyData, keySize, key, iv);
outPlain.resize(cipherSize);
#ifdef HAVE_OPENSSL
EVP_CIPHER_CTX decryptCtx;
EVP_CIPHER_CTX_init(&decryptCtx);
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
EVP_CIPHER_CTX *decryptCtx = EVP_CIPHER_CTX_new();
#else
EVP_CIPHER_CTX _decryptCtx;
EVP_CIPHER_CTX *decryptCtx;
decryptCtx = &_decryptCtx;
#endif // OPENSSL_VERSION_NUMBER >= 0x10100000L
EVP_CIPHER_CTX_init(decryptCtx);
int outPlainSize = cipherSize;
int success = EVP_DecryptInit(&decryptCtx, EVP_aes_128_cbc(), key, iv);
EVP_CIPHER_CTX_set_padding(&decryptCtx, 0);
int success = EVP_DecryptInit(decryptCtx, EVP_aes_128_cbc(), key, iv);
EVP_CIPHER_CTX_set_padding(decryptCtx, 0);
if (success) {
success = EVP_DecryptUpdate(&decryptCtx, (unsigned char *)&outPlain[0], &outPlainSize, cipher, cipherSize);
success = EVP_DecryptUpdate(decryptCtx, (unsigned char *)&outPlain[0], &outPlainSize, cipher, cipherSize);
if (success && outPlainSize) {
// Since padding is off, this will not modify the plain text. However, parameters need to be set.
EVP_DecryptFinal(&decryptCtx, (unsigned char *)outPlain.c_str(), &outPlainSize);
EVP_DecryptFinal(decryptCtx, (unsigned char *)outPlain.c_str(), &outPlainSize);
retVal = true;
}
} else
outPlain.clear();
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
EVP_CIPHER_CTX_free(decryptCtx);
#endif // OPENSSL_VERSION_NUMBER >= 0x10100000L
#else
gcry_cipher_hd_t hd;
gcry_error_t err = gcry_cipher_open(&hd, GCRY_CIPHER_AES128, GCRY_CIPHER_MODE_CBC, 0);
+5
View File
@@ -93,6 +93,11 @@ ServerDBGeneric::SetGamePlayerPlace(unsigned /*requestId*/, DB_id /*playerId*/,
{
}
void
ServerDBGeneric::SetPlayerLastGames(unsigned /*requestId*/, DB_id /*playerId*/, std::vector<long> /*last_games*/, std::string /*playerIp*/)
{
}
void
ServerDBGeneric::EndGame(unsigned /*requestId*/)
{
+3
View File
@@ -35,6 +35,7 @@
#include <string>
#include <ctime>
#include <vector>
typedef unsigned DB_id;
#define DB_ID_INVALID 0
@@ -45,6 +46,8 @@ struct DBPlayerData {
std::string secret;
std::string country;
std::string last_login;
std::string last_games;
std::string last_ip;
};
#endif
+1
View File
@@ -57,6 +57,7 @@ public:
virtual void AsyncCreateGame(unsigned requestId, const std::string &gameName);
virtual void SetGamePlayerPlace(unsigned requestId, DB_id playerId, unsigned place);
virtual void SetPlayerLastGames(unsigned requestId, DB_id playerId, std::vector<long> last_games, std::string playerIp);
virtual void EndGame(unsigned requestId);
virtual void AsyncReportAvatar(unsigned requestId, unsigned replyId, DB_id reportedPlayerId, const std::string &avatarHash, const std::string &avatarType, DB_id *byPlayerId);
+2
View File
@@ -36,6 +36,7 @@
#include <db/serverdbcallback.h>
#include <string>
#include <list>
#include <vector>
typedef std::list<DB_id> db_list;
@@ -57,6 +58,7 @@ public:
virtual void AsyncCreateGame(unsigned requestId, const std::string &gameName) = 0;
virtual void SetGamePlayerPlace(unsigned requestId, DB_id playerId, unsigned place) = 0;
virtual void SetPlayerLastGames(unsigned requestId, DB_id playerId, std::vector<long> last_games, std::string playerIp) = 0;
virtual void EndGame(unsigned requestId) = 0;
virtual void AsyncReportAvatar(unsigned requestId, unsigned replyId, DB_id reportedPlayerId, const std::string &avatarHash, const std::string &avatarType, DB_id *byPlayerId) = 0;
+1
View File
@@ -55,6 +55,7 @@ public:
virtual void AsyncCreateGame(unsigned /*requestId*/, const std::string &/*gameName*/) {}
virtual void SetGamePlayerPlace(unsigned /*requestId*/, DB_id /*playerId*/, unsigned /*place*/) {}
virtual void SetPlayerLastGames(unsigned /*requestId*/, DB_id /*playerId*/, std::vector<long> /*last_games*/, std::string /*playerIp*/) {}
virtual void EndGame(unsigned /*requestId*/) {}
virtual void AsyncReportAvatar(unsigned /*requestId*/, unsigned /*replyId*/, DB_id /*reportedPlayerId*/, const std::string &/*avatarHash*/, const std::string &/*avatarType*/, DB_id * /*byPlayerId*/) {}
+7 -1
View File
@@ -52,19 +52,25 @@ AsyncDBAuth::HandleResult(mysqlpp::Query &/*query*/, DBIdManager& /*idManager*/,
service.post(boost::bind(&ServerDBCallback::PlayerLoginFailed, &cb, GetId()));
} else {
int blocked = result[0][2];
int active = result[0][5];
int active = result[0][7];
if ((active != 1) || (blocked != 0)) {
service.post(boost::bind(&ServerDBCallback::PlayerLoginBlocked, &cb, GetId()));
} else {
mysqlpp::String secret(result[0][1]);
mysqlpp::String country(result[0][3]);
mysqlpp::String last_login(result[0][4]);
mysqlpp::String last_games(result[0][5]);
mysqlpp::String last_ip(result[0][6]);
boost::shared_ptr<DBPlayerData> tmpData(new DBPlayerData);
tmpData->id = result[0][0];
secret.to_string(tmpData->secret);
if (!country.is_null())
country.to_string(tmpData->country);
last_login.to_string(tmpData->last_login);
if (!last_games.is_null())
last_games.to_string(tmpData->last_games);
if (!last_ip.is_null())
last_ip.to_string(tmpData->last_ip);
service.post(boost::bind(&ServerDBCallback::PlayerLoginSuccess, &cb, GetId(), tmpData));
}
+62
View File
@@ -0,0 +1,62 @@
/*****************************************************************************
* PokerTH - The open source texas holdem engine *
* Copyright (C) 2006-2016 Felix Hammer, Florian Thauer, Lothar May *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
* *
* Additional permission under GNU AGPL version 3 section 7 *
* *
* If you modify this program, or any covered work, by linking or *
* combining it with the OpenSSL project's OpenSSL library (or a *
* modified version of that library), containing parts covered by the *
* terms of the OpenSSL or SSLeay licenses, the authors of PokerTH *
* (Felix Hammer, Florian Thauer, Lothar May) grant you additional *
* permission to convey the resulting work. *
* Corresponding Source for a non-source form of such a combination *
* shall include the source code for the parts of OpenSSL used as well *
* as that of the covered work. *
*****************************************************************************/
#include <dbofficial/asyncdbplayerlastgames.h>
using namespace std;
AsyncDBPlayerLastGames::AsyncDBPlayerLastGames(unsigned queryId, const string &preparedName, const list<string> &params)
: SingleAsyncDBQuery(queryId, preparedName, params)
{
}
AsyncDBPlayerLastGames::~AsyncDBPlayerLastGames()
{
}
void
AsyncDBPlayerLastGames::HandleResult(mysqlpp::Query &/*query*/, DBIdManager &/*idManager*/, mysqlpp::StoreQueryResult &/*result*/, boost::asio::io_service &service, ServerDBCallback &cb)
{
// This query does not produce a result.
HandleError(service, cb);
}
void
AsyncDBPlayerLastGames::HandleNoResult(mysqlpp::Query &/*query*/, DBIdManager& /*idManager*/, boost::asio::io_service &/*service*/, ServerDBCallback &/*cb*/)
{
}
void
AsyncDBPlayerLastGames::HandleError(boost::asio::io_service &service, ServerDBCallback &cb)
{
}
+57
View File
@@ -0,0 +1,57 @@
/*****************************************************************************
* PokerTH - The open source texas holdem engine *
* Copyright (C) 2006-2016 Felix Hammer, Florian Thauer, Lothar May *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
* *
* Additional permission under GNU AGPL version 3 section 7 *
* *
* If you modify this program, or any covered work, by linking or *
* combining it with the OpenSSL project's OpenSSL library (or a *
* modified version of that library), containing parts covered by the *
* terms of the OpenSSL or SSLeay licenses, the authors of PokerTH *
* (Felix Hammer, Florian Thauer, Lothar May) grant you additional *
* permission to convey the resulting work. *
* Corresponding Source for a non-source form of such a combination *
* shall include the source code for the parts of OpenSSL used as well *
* as that of the covered work. *
*****************************************************************************/
/* Async database update to block a player. */
#ifndef _ASYNCDBPLAYERLASTGAMES_H_
#define _ASYNCDBPLAYERLASTGAMES_H_
#include <dbofficial/singleasyncdbquery.h>
class AsyncDBPlayerLastGames : public SingleAsyncDBQuery
{
public:
AsyncDBPlayerLastGames(unsigned queryId, const std::string &preparedName, const std::list<std::string> &params);
virtual ~AsyncDBPlayerLastGames();
virtual void Init(DBIdManager& /*idManager*/) {}
virtual void HandleResult(mysqlpp::Query &query, DBIdManager& idManager, mysqlpp::StoreQueryResult& result, boost::asio::io_service &service, ServerDBCallback &cb);
virtual void HandleNoResult(mysqlpp::Query &query, DBIdManager& idManager, boost::asio::io_service &service, ServerDBCallback &cb);
virtual void HandleError(boost::asio::io_service &service, ServerDBCallback &cb);
virtual bool RequiresResultSet() const
{
return false;
}
};
#endif
+2
View File
@@ -42,6 +42,8 @@
#define DB_TABLE_PLAYER_COL_ACTIVE "active"
#define DB_TABLE_PLAYER_COL_AVATARHASH "avatar_hash"
#define DB_TABLE_PLAYER_COL_AVATARTYPE "avatar_mime"
#define DB_TABLE_PLAYER_COL_LASTGAMES "last_games"
#define DB_TABLE_PLAYER_COL_LASTIP "last_ip"
#define DB_TABLE_GAME "game"
#define DB_TABLE_GAME_COL_ID "idgame"
+38 -3
View File
@@ -41,12 +41,15 @@
#include <dbofficial/asyncdbreportgame.h>
#include <dbofficial/asyncdbadminplayers.h>
#include <dbofficial/asyncdbblockplayer.h>
#include <dbofficial/asyncdbplayerlastgames.h>
#include <dbofficial/compositeasyncdbquery.h>
#include <dbofficial/db_table_defs.h>
#include <ctime>
#include <sstream>
#include <mysql++.h>
#include <core/loghelper.h> // @TODO: remove in productive
#define QUERY_NICK_PREPARE "nick_template"
#define QUERY_LOGIN_PREPARE "login_template"
#define QUERY_AVATAR_BLACKLIST_PREPARE "avatar_blacklist_template"
@@ -58,6 +61,7 @@
#define QUERY_REPORT_GAME_PREPARE "report_game_template"
#define QUERY_ADMIN_PLAYER_PREPARE "admin_player_template"
#define QUERY_BLOCK_PLAYER_PREPARE "block_player_template"
#define QUERY_PLAYER_LASTGAMES_PREPARE "player_lastgames_template"
using namespace std;
@@ -230,6 +234,33 @@ ServerDBThread::SetGamePlayerPlace(unsigned requestId, DB_id playerId, unsigned
m_semaphore.post();
}
void
ServerDBThread::SetPlayerLastGames(unsigned requestId, DB_id playerId, std::vector<long> last_games, std::string playerIp)
{
LOG_ERROR("ServerDBThread::SetPlayerLastGames() entered.");
std::ostringstream oss;
std::copy(last_games.begin(), last_games.end(), std::ostream_iterator<int>(oss, ","));
std::string last_gamesFieldValue( oss.str() );
list<string> params;
ostringstream paramStream;
params.push_back(last_gamesFieldValue);
params.push_back(playerIp);
paramStream << playerId;
params.push_back(paramStream.str());
boost::shared_ptr<AsyncDBQuery> asyncQuery(
new AsyncDBPlayerLastGames(
requestId,
QUERY_PLAYER_LASTGAMES_PREPARE,
params));
{
boost::mutex::scoped_lock lock(m_asyncQueueMutex);
m_asyncQueue.push(asyncQuery);
}
LOG_ERROR("Query posted.");
m_semaphore.post();
}
void
ServerDBThread::EndGame(unsigned requestId)
{
@@ -432,7 +463,7 @@ ServerDBThread::EstablishDBConnection()
*/
prepareNick
<< "PREPARE " QUERY_NICK_PREPARE " FROM " << mysqlpp::quote
<< "SELECT " DB_TABLE_PLAYER_COL_ID ", AES_DECRYPT(" DB_TABLE_PLAYER_COL_PASSWORD ", ?), " DB_TABLE_PLAYER_COL_VALID ", TRIM(" DB_TABLE_PLAYER_COL_COUNTRY "), " DB_TABLE_PLAYER_COL_LASTLOGIN ", " DB_TABLE_PLAYER_COL_ACTIVE " FROM " DB_TABLE_PLAYER " WHERE " DB_TABLE_PLAYER_COL_USERNAME " = ?";
<< "SELECT " DB_TABLE_PLAYER_COL_ID ", AES_DECRYPT(" DB_TABLE_PLAYER_COL_PASSWORD ", ?), " DB_TABLE_PLAYER_COL_VALID ", TRIM(" DB_TABLE_PLAYER_COL_COUNTRY "), " DB_TABLE_PLAYER_COL_LASTLOGIN ", " DB_TABLE_PLAYER_COL_LASTGAMES ", " DB_TABLE_PLAYER_COL_LASTIP ", " DB_TABLE_PLAYER_COL_ACTIVE " FROM " DB_TABLE_PLAYER " WHERE " DB_TABLE_PLAYER_COL_USERNAME " = ?";
mysqlpp::Query prepareAvatarBlacklist = m_connData->conn.query();
prepareAvatarBlacklist
@@ -479,12 +510,16 @@ ServerDBThread::EstablishDBConnection()
prepareBlockPlayer
<< "PREPARE " QUERY_BLOCK_PLAYER_PREPARE " FROM " << mysqlpp::quote
<< "UPDATE " DB_TABLE_PLAYER " SET " DB_TABLE_PLAYER_COL_VALID " = ?, " DB_TABLE_PLAYER_COL_ACTIVE " = ? WHERE " DB_TABLE_PLAYER_COL_ID " = ?";
mysqlpp::Query preparePlayerLastGames = m_connData->conn.query();
preparePlayerLastGames
<< "PREPARE " QUERY_PLAYER_LASTGAMES_PREPARE " FROM " << mysqlpp::quote
<< "UPDATE " DB_TABLE_PLAYER " SET " DB_TABLE_PLAYER_COL_LASTGAMES " = ?, " DB_TABLE_PLAYER_COL_LASTIP " = ? WHERE " DB_TABLE_PLAYER_COL_ID " = ?";
if (!prepareNick.exec() || !prepareAvatarBlacklist.exec() || !prepareLogin.exec() || !prepareCreateGame.exec()
|| !prepareEndGame.exec() || !prepareRelation.exec() || !prepareScore.exec() || !prepareReportAvatar.exec()
|| !prepareReportGame.exec() || !prepareAdminPlayer.exec() || !prepareBlockPlayer.exec()) {
|| !prepareReportGame.exec() || !prepareAdminPlayer.exec() || !prepareBlockPlayer.exec() || !preparePlayerLastGames.exec()) {
string tmpError = string(prepareNick.error()) + prepareAvatarBlacklist.error() + prepareLogin.error() + prepareCreateGame.error() +
prepareEndGame.error() + prepareRelation.error() + prepareScore.error() + prepareReportAvatar.error() +
prepareReportGame.error() + prepareAdminPlayer.error() + prepareBlockPlayer.error();
prepareReportGame.error() + prepareAdminPlayer.error() + prepareBlockPlayer.error() + preparePlayerLastGames.error();
m_connData->conn.disconnect();
m_ioService->post(boost::bind(&ServerDBCallback::ConnectFailed, &m_callback, tmpError));
m_permanentError = true;
+2
View File
@@ -42,6 +42,7 @@
#include <dbofficial/dbidmanager.h>
#include <core/thread.h>
struct DBConnectionData;
class AsyncDBQuery;
@@ -66,6 +67,7 @@ public:
virtual void AsyncCreateGame(unsigned requestId, const std::string &gameName);
virtual void SetGamePlayerPlace(unsigned requestId, DB_id playerId, unsigned place);
virtual void SetPlayerLastGames(unsigned requestId, DB_id playerId, std::vector<long> last_games, std::string playerIp);
virtual void EndGame(unsigned requestId);
virtual void AsyncReportAvatar(unsigned requestId, unsigned replyId, DB_id reportedPlayerId, const std::string &avatarHash, const std::string &avatarType, DB_id *byPlayerId);
+1 -1
View File
@@ -3859,7 +3859,7 @@ void gameTableImpl::triggerVoteOnKick(int id)
int playerCount = static_cast<int>(seatList->size());
if (id < playerCount) {
PlayerListIterator pos = seatList->begin();
advance(pos, id);
std::advance(pos, id);
myStartWindow->getSession()->startVoteKickPlayer((*pos)->getMyUniqueID());
}
}
+5 -2
View File
@@ -993,8 +993,11 @@ ClientThread::CreateContextSession()
newSock.reset(new boost::asio::ip::tcp::socket(*m_ioService, tcp::v6()));
else
newSock.reset(new boost::asio::ip::tcp::socket(*m_ioService, tcp::v4()));
boost::asio::socket_base::non_blocking_io command(true);
newSock->io_control(command);
// Deprecated non_blocking_io command
/*boost::asio::socket_base::non_blocking_io command(true);
newSock->io_control(command);*/
newSock->non_blocking(true);
newSock->set_option(tcp::no_delay(true));
newSock->set_option(boost::asio::socket_base::keep_alive(true));
+1 -1
View File
@@ -249,7 +249,7 @@ NetPacket::GameErrorToNetError(int gameErrorReason)
retVal = ErrorMessage::sessionTimeout;
break;
default :
retVal = ErrorMessage::reserved;
retVal = ErrorMessage::custReserved;
break;
}
return retVal;
+28
View File
@@ -293,11 +293,13 @@ ServerGame::TimerVoteKick(const boost::system::error_code &ec)
PlayerDataList
ServerGame::InternalStartGame()
{
LOG_ERROR("InternalStartGame() entered.");
// Initialize the game.
PlayerDataList playerData(GetFullPlayerDataList());
if (playerData.size() >= 2) {
// Set DB Backend.
// @TODO: check for wec or bbc game with bbcbot as creator
if (GetGameData().gameType == GAME_TYPE_RANKING)
m_database = GetLobbyThread().GetDatabase();
else
@@ -346,6 +348,12 @@ ServerGame::InternalStartGame()
GetDatabase().AsyncCreateGame(GetId(), GetName());
InitRankingMap(playerData);
// @TODO: here to save last_games with mysql per player
if (GetGameData().gameType == GAME_TYPE_RANKING)
StoreLastGames(playerData);
}
return playerData;
}
@@ -442,6 +450,26 @@ ServerGame::StoreAndResetRanking()
m_rankingMap.clear();
}
void
ServerGame::StoreLastGames(const PlayerDataList &playerDataList)
{
// Store players lastgames in database.
PlayerDataList::const_iterator i = playerDataList.begin();
PlayerDataList::const_iterator end = playerDataList.end();
while (i != end) {
boost::shared_ptr<PlayerData> tmpPlayer(*i);
// tmpPlayer->GetUniqueId()
tmpPlayer->AddPlayerLastGame((long)time(NULL));
LOG_ERROR("TimeStamp stored: " << tmpPlayer->GetPlayerLastGames().back());
std::vector<long> last_games = tmpPlayer->GetPlayerLastGames();
LOG_ERROR("Ready for storing vector for player " << tmpPlayer->GetDBId() << " - lastGameTs " << last_games.back());
if(tmpPlayer->GetDBId() != DB_ID_INVALID){
GetDatabase().SetPlayerLastGames(GetId(), tmpPlayer->GetDBId(), last_games, GetSessionManager().GetSessionByUniquePlayerId(tmpPlayer->GetUniqueId())->GetClientAddr());
}
++i;
}
}
void
ServerGame::RemoveAutoLeavePlayers()
{
+27 -8
View File
@@ -62,6 +62,7 @@
#include <boost/uuid/uuid.hpp>
#include <boost/algorithm/string.hpp>
#include <gsasl.h>
#include <ctime>
#define SERVER_MAX_NUM_LOBBY_SESSIONS 512 // Maximum number of idle users in lobby.
#define SERVER_MAX_NUM_TOTAL_SESSIONS 2000 // Total maximum of sessions, fitting a 2048 handle limit
@@ -304,6 +305,7 @@ ServerLobbyThread::AddConnection(boost::shared_ptr<SessionData> sessionData)
m_sessionManager.AddSession(sessionData);
LOG_VERBOSE("Accepted connection - session #" << sessionData->GetId() << ".");
LOG_ERROR("Accepted connection - session #" << sessionData->GetId() << ".");
sessionData->StartTimerInitTimeout(SERVER_INIT_SESSION_TIMEOUT_SEC);
sessionData->StartTimerGlobalTimeout(SERVER_SESSION_FORCED_TIMEOUT_SEC);
@@ -1347,7 +1349,7 @@ ServerLobbyThread::HandleNetPacketRetrieveAvatar(boost::shared_ptr<SessionData>
void
ServerLobbyThread::HandleNetPacketCreateGame(boost::shared_ptr<SessionData> session, const JoinNewGameMessage &newGame)
{
LOG_VERBOSE("Creating new game, initiated by session #" << session->GetId() << ".");
LOG_ERROR("Creating new game, initiated by session #" << session->GetId() << ".");
string password;
if (newGame.has_password())
@@ -1377,6 +1379,10 @@ ServerLobbyThread::HandleNetPacketCreateGame(boost::shared_ptr<SessionData> sess
SendJoinGameFailed(session, gameId, NTF_NET_JOIN_GUEST_FORBIDDEN);
} else if (!ServerGame::CheckSettings(tmpData, password, GetServerMode())) {
SendJoinGameFailed(session, gameId, NTF_NET_JOIN_INVALID_SETTINGS);
} else if (!session->GetPlayerData()->IsPlayerAllowedToJoinCreateLimitRank(m_serverConfig.readConfigString("ServerLimitRankNum"), m_serverConfig.readConfigString("ServerLimitRankPeriod"))
&& tmpData.gameType == GAME_TYPE_RANKING ) {
LOG_ERROR("not allowed due to ranklimit");
SendJoinGameFailed(session, gameId, NTF_NET_JOIN_IP_BLOCKED);
} else {
boost::shared_ptr<ServerGame> game(
new ServerGame(
@@ -1418,6 +1424,7 @@ ServerLobbyThread::HandleNetPacketJoinGame(boost::shared_ptr<SessionData> sessio
MoveSessionToGame(game, session, joinGame.autoleave(), true);
}
} else {
LOG_ERROR("JoinGame pre validation");
// As guest, you are only allowed to join normal games.
if (session->GetPlayerData()->GetRights() == PLAYER_RIGHTS_GUEST
&& tmpData.gameType != GAME_TYPE_NORMAL) {
@@ -1427,14 +1434,14 @@ ServerLobbyThread::HandleNetPacketJoinGame(boost::shared_ptr<SessionData> sessio
SendJoinGameFailed(session, joinGame.gameid(), NTF_NET_JOIN_NOT_INVITED);
} else if (!game->CheckPassword(password)) {
SendJoinGameFailed(session, joinGame.gameid(), NTF_NET_JOIN_INVALID_PASSWORD);
} else if (tmpData.gameType == GAME_TYPE_RANKING
&& !joinGame.spectateonly()
&& session->GetClientAddr() != SERVER_ADDRESS_LOCALHOST_STR
&& session->GetClientAddr() != SERVER_ADDRESS_LOCALHOST_STR_V4V6
&& session->GetClientAddr() != SERVER_ADDRESS_LOCALHOST_STR_V4
&& game->IsClientAddressConnected(session->GetClientAddr())) {
} else if (tmpData.gameType == GAME_TYPE_RANKING && !session->GetPlayerData()->IsPlayerAllowedToJoinCreateLimitRank(m_serverConfig.readConfigString("ServerLimitRankNum"), m_serverConfig.readConfigString("ServerLimitRankPeriod"))) {
SendJoinGameFailed(session, joinGame.gameid(), NTF_NET_JOIN_IP_BLOCKED);
} else if (tmpData.gameType == GAME_TYPE_RANKING && !joinGame.spectateonly()
&& session->GetClientAddr() != SERVER_ADDRESS_LOCALHOST_STR
&& session->GetClientAddr() != SERVER_ADDRESS_LOCALHOST_STR_V4V6
&& session->GetClientAddr() != SERVER_ADDRESS_LOCALHOST_STR_V4
&& game->IsClientAddressConnected(session->GetClientAddr())) {
SendJoinGameFailed(session, joinGame.gameid(), NTF_NET_JOIN_IP_BLOCKED);
} else {
MoveSessionToGame(game, session, joinGame.autoleave(), false);
}
@@ -1803,6 +1810,18 @@ ServerLobbyThread::UserValid(unsigned playerId, const DBPlayerData &dbPlayerData
if (tmpSession && tmpSession->GetPlayerData()) {
tmpSession->GetPlayerData()->SetDBId(dbPlayerData.id);
tmpSession->GetPlayerData()->SetCountry(dbPlayerData.country);
if(dbPlayerData.last_games.length() > 0){
LOG_ERROR("last_games from db = " << dbPlayerData.last_games);
vector<string> last_games;
boost::split(last_games, dbPlayerData.last_games, boost::is_any_of(","));
for (unsigned int i = 0; i < last_games.size(); i++){
if(last_games[i].length() > 0)
tmpSession->GetPlayerData()->AddPlayerLastGame(stol(last_games[i]));
}
LOG_ERROR("last_games last from vector after db = " << tmpSession->GetPlayerData()->GetPlayerLastGames().back());
}else{
LOG_ERROR("no lastGames from db");
}
this->AuthChallenge(tmpSession, dbPlayerData.secret);
}
}
+2
View File
@@ -34,6 +34,8 @@
#include <net/serverexception.h>
#include <net/socket_msg.h>
#include <ctime>
using namespace std;
#define SERVER_MAX_GUEST_USERS_LOBBY 50 // LG: Maximum number of guests users in lobby allowed
+4 -2
View File
@@ -122,8 +122,10 @@ protected:
const boost::system::error_code &error)
{
if (!error) {
boost::asio::socket_base::non_blocking_io command(true);
acceptedSocket->io_control(command);
// Deprecated non_blocking_io command
/*boost::asio::socket_base::non_blocking_io command(true);
newSock->io_control(command);*/
acceptedSocket->non_blocking(true);
acceptedSocket->set_option(typename P::no_delay(true));
acceptedSocket->set_option(boost::asio::socket_base::keep_alive(true));
boost::shared_ptr<SessionData> sessionData(new SessionData(acceptedSocket, m_lobbyThread->GetNextSessionId(), m_lobbyThread->GetSessionDataCallback(), *m_ioService));
+1
View File
@@ -148,6 +148,7 @@ protected:
void SetPlayerPlace(unsigned playerId, int place);
void ReplaceRankingPlayer(unsigned oldPlayerId, unsigned newPlayerId);
void StoreAndResetRanking();
void StoreLastGames(const PlayerDataList &playerDataList);
void RemoveAutoLeavePlayers();
void InternalEndGame();
+1
View File
@@ -40,6 +40,7 @@ typedef unsigned SessionId;
#include <boost/thread.hpp>
#include <boost/enable_shared_from_this.hpp>
#include <string>
#include <vector>
#include <net/socket_helper.h>
#include <net/sessiondatacallback.h>
+2
View File
@@ -65,6 +65,8 @@ public:
bool IsPlayerConnected(unsigned uniqueId) const;
bool IsClientAddressConnected(const std::string &clientAddress) const;
bool IsGuestAllowedToConnect(const std::string &clientAddress) const;
bool IsPlayerAllowedToJoinCreateLimitRank(const std::string &playerName) const;
bool IsPlayerAllowedToJoinCreateLimitRank(unsigned uniqueId) const;
void ForEach(boost::function<void (boost::shared_ptr<SessionData>)> func);
+58
View File
@@ -29,6 +29,8 @@
* as that of the covered work. *
*****************************************************************************/
#include <playerdata.h>
#include <ctime>
#include <core/loghelper.h> // @TODO: remove in productive
using namespace std;
@@ -242,3 +244,59 @@ PlayerData::operator<(const PlayerData &other) const
return m_number < other.GetNumber();
}
void
PlayerData::SetPlayerLastGames(std::vector<long> last_games)
{
boost::mutex::scoped_lock lock(m_dataMutex);
m_last_games.clear();
m_last_games = last_games;
}
void
PlayerData::AddPlayerLastGame(long lastGame)
{
boost::mutex::scoped_lock lock(m_dataMutex);
m_last_games.push_back(lastGame);
}
std::vector<long>
PlayerData::GetPlayerLastGames()
{
boost::mutex::scoped_lock lock(m_dataMutex);
return m_last_games;
}
bool
PlayerData::IsPlayerAllowedToJoinCreateLimitRank(std::string num, std::string period)
{
bool retVal = false;
LOG_ERROR("checking IsPlayerAllowedToJoinCreateLimitRank() ");
LOG_ERROR("num = " << num << " period " << period);
boost::mutex::scoped_lock lock(m_dataMutex);
long then = (long)time(NULL) - (long)(stoi(period) * 60);
int count = 0;
int i=0;
for(std::vector<long>::iterator timeStamp = m_last_games.begin(); timeStamp != m_last_games.end(); ++timeStamp) {
LOG_ERROR("timeStamp " << *timeStamp);
time_t ts = (time_t)*timeStamp;
LOG_ERROR("comparing ts " << (long)ts << " with " << then);
if((long)ts > then){
LOG_ERROR("counting timeStamp in time " << ctime(&ts));
count++;
}else{
LOG_ERROR("erasing overdued timestamp " << ctime(&ts));
timeStamp = m_last_games.erase(timeStamp); // erase overdued entries
if( timeStamp == m_last_games.end())
break;
}
i++;
}
if(count < stoi(num))
retVal = true;
return retVal;
}
+8
View File
@@ -116,6 +116,12 @@ public:
int GetStartCash() const;
void SetStartCash(int cash);
// @TODO: last_games here
void AddPlayerLastGame(long last_games);
void SetPlayerLastGames(std::vector<long> last_games);
std::vector<long> GetPlayerLastGames();
bool IsPlayerAllowedToJoinCreateLimitRank(std::string num, std::string period);
bool operator<(const PlayerData &other) const;
private:
@@ -135,6 +141,8 @@ private:
bool m_isGameAdmin;
boost::shared_ptr<AvatarFile> m_netAvatarFile;
std::vector<long> m_last_games;
mutable boost::mutex m_dataMutex;
};
+1
View File
@@ -103,6 +103,7 @@ int main( int argc, char **argv )
QApplication a(argc, argv);
a.setApplicationName("PokerTH");
#else
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
SharedTools::QtSingleApplication a( "PokerTH", argc, argv );
if (a.sendMessage("Wake up!")) {
return 0;
+4 -4
View File
@@ -17,17 +17,17 @@
<message>
<location filename="../src/gui/qt/styles/carddeckstylereader.cpp" line="201"/>
<source>Some cards pictures are missing, please contact style maintainer for this issue.</source>
<translation>Certaines images des cartes sont manquantes, veuillez contacter l&apos;auteur pour qu&apos;il corrige ce problème.</translation>
<translation>Certaines images de cartes sont manquantes, veuillez contacter le mainteneur du style pour qu&apos;il corrige ce problème.</translation>
</message>
<message>
<location filename="../src/gui/qt/styles/carddeckstylereader.cpp" line="204"/>
<source>Some style fields are missing, please contact style maintainer for this issue.</source>
<translation>Certains champs sont manquants, veuillez contacter l&apos;auteur pour lui demander de corriger ce problème.</translation>
<translation>Certains champs sont manquants, veuillez contacter le mainteneur du style pour qu&apos;il corrige ce problème.</translation>
</message>
<message>
<location filename="../src/gui/qt/styles/carddeckstylereader.cpp" line="207"/>
<source>This style is outdated, please contact style maintainer for this issue.</source>
<translation>Ce style est obsolète, veuillez contacter l&apos;auteur pour lui demander de le mettre à jour.</translation>
<translation>Ce style est obsolète, veuillez contacter le mainteneur du style pour ce problème.</translation>
</message>
<message>
<location filename="../src/gui/qt/styles/carddeckstylereader.cpp" line="224"/>
@@ -8991,7 +8991,7 @@ Veuillez choisir un nom différent.</translation>
<message>
<location filename="../src/gui/qt/gui_800x480/tabs_800x480.ui" line="503"/>
<source>Chance</source>
<translation>Chance</translation>
<translation>Probabilité</translation>
</message>
<message>
<location filename="../src/gui/qt/gui_800x480/tabs_800x480.ui" line="608"/>
+1 -1
View File
@@ -48,7 +48,7 @@ unix : !mac {
#QMAKE_CXXFLAGS += -ffunction-sections -fdata-sections
#QMAKE_LFLAGS += -Wl,--gc-sections
LIB_DIRS = $${PREFIX}/lib $${PREFIX}/lib64 $$system(qmake -query QT_INSTALL_LIBS)
LIB_DIRS = $${PREFIX}/lib $${PREFIX}/lib64 $$system($$QMAKE_QMAKE -query QT_INSTALL_LIBS)
BOOST_FS = boost_filesystem boost_filesystem-mt
BOOST_IOSTREAMS = boost_iostreams boost_iostreams-mt
BOOST_SYSTEM = boost_system boost_system-mt