Author SHA1 Message Date
Kai Philipp 29259f1f29 bugfix 2020-01-25 17:23:44 +01:00
Kai Philipp 1ff513e09a bugfix 2020-01-25 17:17:41 +01:00
Kai Philipp b03d39d141 bugfix 2020-01-25 17:16:54 +01:00
Kai Philipp 99de54cdf5 string output optimized 2020-01-25 17:16:09 +01:00
Kai Philipp d2849449ce bugfix 2020-01-25 17:14:13 +01:00
Kai Philipp f31127e695 bugfix 2020-01-25 17:12:08 +01:00
Kai Philipp 03602cd37f pro missing linked boost_random 2020-01-25 17:10:09 +01:00
Kai Philipp a5c8aefeb2 pro missing linked boost 2020-01-25 17:05:33 +01:00
Kai Philipp 4e888e2cfe pro file adaption 2020-01-25 16:59:22 +01:00
Kai Philipp c96955e719 pro file adaptions 2020-01-25 16:58:08 +01:00
Kai Philipp ef1ccfdbd7 bugfix 2020-01-25 16:55:54 +01:00
Kai Philipp cedf5f7218 bugfix 2020-01-25 16:53:13 +01:00
Kai Philipp ad80896fae dealer_random_test added 2020-01-25 16:50:06 +01:00
Kai Philipp 20793e24a1 Merge pull request #376 from rkfg/hand_name
Show the winning hand after the round

@TODO: to be tested in an internet game
2020-01-15 00:55:04 +01:00
Sergey Shpikin 382b533488 Show the winning hand after the round 2020-01-13 17:53:49 +03:00
Kai Philipp 7c538fc436 limit rank games per time unit implemented 2019-11-20 18:19:46 +01:00
48 changed files with 48523 additions and 24523 deletions
+1 -5
View File
@@ -18,8 +18,4 @@ uics/
make.sh make.sh
gitpush_serverstuff_stable gitpush_serverstuff_stable
pokerth_server pokerth_server
.vscode .vscode/
.qmake.stash
pokerth.ap*
*.DS_STORE
.gitignore.save
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<manifest package="org.qtproject.example" android:versionName="1.1" xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" android:versionCode="1"> <manifest package="org.qtproject.example" android:versionName="1.1" xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" android:versionCode="1">
<application android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="PokerTH" android:icon="@drawable/icon"> <application android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="PokerTH" android:icon="@drawable/icon">
<activity android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="PokerTH" android:screenOrientation="landscape" android:configChanges="orientation|uiMode|screenLayout|locale|fontScale|keyboard|keyboardHidden|navigation"> <activity android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="PokerTH" android:screenOrientation="landscape" android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
@@ -31,7 +31,7 @@
<!-- Splash screen --> <!-- Splash screen -->
</activity> </activity>
</application> </application>
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28"/> <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="19"/>
<supports-screens android:smallScreens="true" android:anyDensity="true" android:largeScreens="true" android:normalScreens="true"/> <supports-screens android:smallScreens="true" android:anyDensity="true" android:largeScreens="true" android:normalScreens="true"/>
<!-- %%INSERT_PERMISSIONS --> <!-- %%INSERT_PERMISSIONS -->
<!-- %%INSERT_FEATURES --> <!-- %%INSERT_FEATURES -->
+36 -1
View File
@@ -1 +1,36 @@
see https://github.com/pokerth/pokerth/wiki/Building-PokerTH Requirements
============
To compile PokerTH you need following libs:
Linux:
- Qt version >= 4.4.3, 4.8.x recommended --> http://qtsoftware.com/
- zlib version >= 1.2.3 --> http://www.zlib.net/
- libcurl version >= 7.16 --> http://curl.haxx.se/
- libgcrypt (e.g. version 1.4.6) --> http://www.gnu.org/software/libgcrypt/
- libgsasl version >= 1.4 --> http://www.gnu.org/software/gsasl/
- libboost_thread, libboost_filesystem, libboost_datetime, libboost_program_options,
libboost_iostreams, libboost_asio, libboost_regex, libboost_random, libboost_uuid
(version >= 1.49, latest always recommended) --> http://www.boost.org/
- libSDL_mixer, libSDL --> http://www.libsdl.org/
- libSQLite3 --> http://sqlite.org/
- libtinyxml > 2.0 --> http://www.sourceforge.net/projects/tinyxml
- protoc >= 2.3.0 (during build), libprotobuf >= 2.3.0 -> https://github.com/google/protobuf
- For the server: libircclient 1.3 --> http://www.sourceforge.net/projects/libircclient/
Windows:
see docs/build_mingw_windows.txt
Basic Installation
==================
Linux:
1. Type "cd path/to/the/sources". Then do for example "/usr/qt/4/bin/qmake pokerth.pro" to configure the makefile for your system.
Pay attention that the QTDIR environment variable points to Qt4 not Qt3. For example QTDIR=/usr/qt/4.
You can set this variable typing: "export QTDIR=/usr/qt/4"
2. Type "make" to compile the package.
3. Become root (typing "su") and type "make install" to install the program binary.
@@ -1,16 +0,0 @@
{
"description": "This file is generated by qmake to be read by androiddeployqt and should not be modified by hand.",
"qt": "/home/min/Dokumente/Qt5.13.0/5.13.0/android_armv7",
"sdk": "/home/min/Dokumente/Android",
"sdkBuildToolsRevision": "",
"ndk": "/home/min/Dokumente/Android/android-ndk-r13b",
"toolchain-prefix": "arm-linux-androideabi",
"tool-prefix": "arm-linux-androideabi",
"toolchain-version": "4.9",
"ndk-host": "linux-x86_64",
"target-architecture": "armeabi-v7a",
"qml-root-path": "/home/min/Dokumente/pokerth",
"stdcpp-path": "/home/min/Dokumente/Android/android-ndk-r13b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libgnustl_shared.so",
"useLLVM": false,
"application-binary": "/home/min/Dokumente/pokerth/libpokerth.so"
}
+86
View File
@@ -0,0 +1,86 @@
# QMake pro-file for the PokerTH dedicated server
isEmpty( PREFIX ){
PREFIX =/usr
}
TEMPLATE = app
CODECFORSRC = UTF-8
CONFIG += thread console embed_manifest_exe exceptions rtti stl warn_on
UI_DIR = uics
TARGET = bin/dealer_random_test
MOC_DIR = mocs
OBJECTS_DIR = obj
DEFINES += PREFIX=\"$${PREFIX}\"
QT -= core gui
#PRECOMPILED_HEADER = src/pch_lib.h
INCLUDEPATH += . \
src
DEPENDPATH += . \
src
# Input
SOURCES += \
src/dealer_random_test.cpp
unix : !mac {
##### My release static build options
#QMAKE_CXXFLAGS += -ffunction-sections -fdata-sections
#QMAKE_LFLAGS += -Wl,--gc-sections
QMAKE_LIBDIR += lib $${PREFIX}/lib /opt/gsasl/lib
INCLUDEPATH += $${PREFIX}/include
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_QMAKE -query QT_INSTALL_LIBS)
# to override the default '/usr' pass PREFIX
# variable to qmake.
#
for(dir, LIB_DIRS){
exists($$dir){
for(lib, BOOST_PROGRAM_OPTIONS):exists($${dir}/lib$${lib}.so*) {
message("Found $$lib")
BOOST_PROGRAM_OPTIONS = -l$$lib
}
for(lib, BOOST_PROGRAM_OPTIONS):exists($${dir}/lib$${lib}.a) {
message("Found $$lib")
BOOST_PROGRAM_OPTIONS = -l$$lib
}
for(lib, BOOST_SYS):exists($${dir}/lib$${lib}.so*) {
message("Found $$lib")
BOOST_SYS = -l$$lib
}
for(lib, BOOST_SYS):exists($${dir}/lib$${lib}.a) {
message("Found $$lib")
BOOST_SYS = -l$$lib
}
}
}
BOOST_LIBS = $$BOOST_PROGRAM_OPTIONS $$BOOST_SYS
!count(BOOST_LIBS, 2){
error("Unable to find boost libraries in PREFIX=$${PREFIX}")
}
UNAME = $$system(uname -s)
BSD = $$find(UNAME, "BSD")
kFreeBSD = $$find(UNAME, "kFreeBSD")
LIBS += $$BOOST_LIBS
LIBS += -lprotobuf -lgsasl -lgcrypt -lidn -lboost_thread -lboost_system -lboost_random
#### INSTALL ####
binary.path += $${PREFIX}/bin/
binary.files += dealer_random_test
INSTALLS += binary
}
+5 -63
View File
@@ -9,13 +9,12 @@
# of binary-size if you leave Qt out. # of binary-size if you leave Qt out.
# (see http://trolltech.com/developer/downloads/qt/mac) # (see http://trolltech.com/developer/downloads/qt/mac)
QT_FW_PATH="/usr/local/Cellar/qt/5.13.0/lib" QT_FW_PATH="/Users/$USER/Qt/5.9/clang_64/lib"
QT_PLUGIN_PATH="/usr/local/Cellar/qt/5.13.0/plugins" QT_PLUGIN_PATH="/Users/$USER/Qt/5.9/clang_64/plugins"
SDL_FW_PATH="/Library/Frameworks" SDL_FW_PATH="/Library/Frameworks"
APPLICATION="./pokerth.app" APPLICATION="./pokerth.app"
BINARY="$APPLICATION/Contents/MacOs/pokerth" BINARY="$APPLICATION/Contents/MacOs/pokerth"
RESOURCES="$APPLICATION/Contents/Resources" RESOURCES="$APPLICATION/Contents/Resources"
DYLIB_PATH="$APPLICATION/Contents/MacOs/dylibs"
# strip binary # strip binary
strip $BINARY strip $BINARY
@@ -24,56 +23,18 @@ cp -R ./data $RESOURCES/
find $RESOURCES/data -name ".svn" | xargs rm -Rf find $RESOURCES/data -name ".svn" | xargs rm -Rf
# create framework-path # create framework-path
BINARY_FW_PATH="$APPLICATION/Contents/Frameworks" BINARY_FW_PATH="$APPLICATION/Contents/Frameworks"
BINARY_PLUGIN_PATH="$APPLICATION/Contents/plugins"
rm -rf $BINARY_FW_PATH
rm -rf $BINARY_PLUGIN_PATH
rm -rf $DYLIB_PATH
mkdir $BINARY_FW_PATH mkdir $BINARY_FW_PATH
BINARY_PLUGIN_PATH="$APPLICATION/Contents/plugins"
mkdir -p $BINARY_PLUGIN_PATH/imageformats mkdir -p $BINARY_PLUGIN_PATH/imageformats
mkdir -p $BINARY_PLUGIN_PATH/sqldrivers mkdir -p $BINARY_PLUGIN_PATH/sqldrivers
mkdir -p $BINARY_PLUGIN_PATH/platforms mkdir -p $BINARY_PLUGIN_PATH/platforms
mkdir -p $DYLIB_PATH
# integrate SDL-frameworks into binary # integrate SDL-frameworks into binary
cp -R $SDL_FW_PATH/SDL.framework $BINARY_FW_PATH cp -R $SDL_FW_PATH/SDL.framework $BINARY_FW_PATH
cp -R $SDL_FW_PATH/SDL_mixer.framework $BINARY_FW_PATH cp -R $SDL_FW_PATH/SDL_mixer.framework $BINARY_FW_PATH
# integrate dylibs
cp /usr/lib/libcurl.4.dylib $DYLIB_PATH/.
cp /usr/local/Cellar/openssl/1.0.2s/lib/libcrypto.1.0.0.dylib $DYLIB_PATH/.
cp /usr/local/opt/openssl/lib/libssl.1.0.0.dylib $DYLIB_PATH/.
cp /usr/lib/libsqlite3.dylib $DYLIB_PATH/.
cp /usr/local/opt/tinyxml/lib/libtinyxml.dylib $DYLIB_PATH/.
cp /usr/local/opt/protobuf/lib/libprotobuf.18.dylib $DYLIB_PATH/.
cp /usr/lib/libz.1.dylib $DYLIB_PATH/.
chmod -R +w $DYLIB_PATH;
LIBCURL_LINK=$(otool -L $BINARY | grep libcurl | cut -d"(" -f1 | cut -f2)
LIBCRYPTO_LINK=$(otool -L $BINARY | grep libcrypto | cut -d"(" -f1 | cut -f2)
LIBSSL_LINK=$(otool -L $BINARY | grep libssl | cut -d"(" -f1 | cut -f2)
LIBTINYXML_LINK=$(otool -L $BINARY | grep libtinyxml | cut -d"(" -f1 | cut -f2)
LIBSQLITE_LINK=$(otool -L $BINARY | grep libsqlite | cut -d"(" -f1 | cut -f2)
LIBPROTOBUF_LINK=$(otool -L $BINARY | grep libprotobuf | cut -d"(" -f1 | cut -f2)
LIBZ_LINK=$(otool -L $BINARY | grep libz | cut -d"(" -f1 | cut -f2)
install_name_tool -change $LIBCURL_LINK @loader_path/dylibs/libcurl.4.dylib $BINARY
install_name_tool -change $LIBCRYPTO_LINK @loader_path/dylibs/libcrypto.1.0.0.dylib $BINARY
install_name_tool -change $LIBSSL_LINK @loader_path/dylibs/libssl.1.0.0.dylib $BINARY
install_name_tool -change $LIBTINYXML_LINK @loader_path/dylibs/libtinyxml.dylib $BINARY
install_name_tool -change $LIBSQLITE_LINK @loader_path/dylibs/libsqlite3.dylib $BINARY
install_name_tool -change $LIBPROTOBUF_LINK @loader_path/dylibs/libprotobuf.18.dylib $BINARY
install_name_tool -change $LIBSQLITE_LINK @loader_path/dylibs/libsqlite3.dylib $BINARY
install_name_tool -change $LIBZ_LINK @loader_path/dylibs/libz.1.dylib $BINARY
LIBCRYPTO_LINK=$(otool -L $DYLIB_PATH/libssl.1.0.0.dylib | grep libcrypto | cut -d"(" -f1 | cut -f2)
LIBSSL_LINK=$(otool -L $DYLIB_PATH/libssl.1.0.0.dylib | grep libssl | cut -d"(" -f1 | cut -f2)
install_name_tool -change $LIBCRYPTO_LINK @executable_path/dylibs/libcrypto.1.0.0.dylib $DYLIB_PATH/libssl.1.0.0.dylib
install_name_tool -change /usr/local/opt/openssl/lib/libssl.1.0.0.dylib @executable_path/dylibs/libssl.1.0.0.dylib $DYLIB_PATH/libssl.1.0.0.dylib
# integrate Qt-frameworks into binary # integrate Qt-frameworks into binary
if [ "$1" != "--without-qt" ] ; then if [ "$1" != "--without-qt" ] ; then
cp $QT_PLUGIN_PATH/imageformats/libqgif.dylib $BINARY_PLUGIN_PATH/imageformats cp $QT_PLUGIN_PATH/imageformats/libqgif.dylib $BINARY_PLUGIN_PATH/imageformats
cp $QT_PLUGIN_PATH/imageformats/libqjpeg.dylib $BINARY_PLUGIN_PATH/imageformats cp $QT_PLUGIN_PATH/imageformats/libqjpeg.dylib $BINARY_PLUGIN_PATH/imageformats
@@ -85,8 +46,6 @@ if [ "$1" != "--without-qt" ] ; then
cp -R $QT_FW_PATH/QtSql.framework $BINARY_FW_PATH cp -R $QT_FW_PATH/QtSql.framework $BINARY_FW_PATH
cp -R $QT_FW_PATH/QtNetwork.framework $BINARY_FW_PATH cp -R $QT_FW_PATH/QtNetwork.framework $BINARY_FW_PATH
cp -R $QT_FW_PATH/QtPrintSupport.framework $BINARY_FW_PATH cp -R $QT_FW_PATH/QtPrintSupport.framework $BINARY_FW_PATH
cp -R /usr/local/Cellar/qt/5.13.0/lib/QtDBus.framework $BINARY_FW_PATH
chmod -R 775 $BINARY_FW_PATH
# remove debug versions # remove debug versions
rm -f $APPLICATION/Contents/Frameworks/QtCore.framework/QtCore_debug rm -f $APPLICATION/Contents/Frameworks/QtCore.framework/QtCore_debug
rm -f $APPLICATION/Contents/Frameworks/QtCore.framework/QtCore_debug.prl rm -f $APPLICATION/Contents/Frameworks/QtCore.framework/QtCore_debug.prl
@@ -106,9 +65,6 @@ if [ "$1" != "--without-qt" ] ; then
rm -f $APPLICATION/Contents/Frameworks/QtPrintSupport.framework/QtPrintSupport_debug rm -f $APPLICATION/Contents/Frameworks/QtPrintSupport.framework/QtPrintSupport_debug
rm -f $APPLICATION/Contents/Frameworks/QtPrintSupport.framework/QtPrintSupport_debug.prl rm -f $APPLICATION/Contents/Frameworks/QtPrintSupport.framework/QtPrintSupport_debug.prl
rm -f $APPLICATION/Contents/Frameworks/QtPrintSupport.framework/Versions/5/QtPrintSupport_debug rm -f $APPLICATION/Contents/Frameworks/QtPrintSupport.framework/Versions/5/QtPrintSupport_debug
rm -f $APPLICATION/Contents/Frameworks/QtDBus.framework/QtDBus_debug
rm -f $APPLICATION/Contents/Frameworks/QtDBus.framework/QtDBus_debug.prl
rm -f $APPLICATION/Contents/Frameworks/QtDBus.framework/Versions/5/QtDBus_debug
# redirect binary to use integrated frameworks # redirect binary to use integrated frameworks
QTCORE="QtCore.framework/Versions/5/QtCore" QTCORE="QtCore.framework/Versions/5/QtCore"
@@ -117,20 +73,18 @@ if [ "$1" != "--without-qt" ] ; then
QTSQL="QtSql.framework/Versions/5/QtSql" QTSQL="QtSql.framework/Versions/5/QtSql"
QTNETWORK="QtNetwork.framework/Versions/5/QtNetwork" QTNETWORK="QtNetwork.framework/Versions/5/QtNetwork"
QTPRINT="QtPrintSupport.framework/Versions/5/QtPrintSupport" QTPRINT="QtPrintSupport.framework/Versions/5/QtPrintSupport"
QTDBUS="QtDBus.framework/Versions/5/QtDBus"
install_name_tool -id @executable_path/../Frameworks/$QTCORE $BINARY_FW_PATH/$QTCORE install_name_tool -id @executable_path/../Frameworks/$QTCORE $BINARY_FW_PATH/$QTCORE
install_name_tool -id @executable_path/../Frameworks/$QTGUI $BINARY_FW_PATH/$QTGUI install_name_tool -id @executable_path/../Frameworks/$QTGUI $BINARY_FW_PATH/$QTGUI
install_name_tool -id @executable_path/../Frameworks/$QTWIDGETS $BINARY_FW_PATH/$QTWIDGETS install_name_tool -id @executable_path/../Frameworks/$QTWIDGETS $BINARY_FW_PATH/$QTWIDGETS
install_name_tool -id @executable_path/../Frameworks/$QTSQL $BINARY_FW_PATH/$QTSQL install_name_tool -id @executable_path/../Frameworks/$QTSQL $BINARY_FW_PATH/$QTSQL
install_name_tool -id @executable_path/../Frameworks/$QTNETWORK $BINARY_FW_PATH/$QTNETWORK install_name_tool -id @executable_path/../Frameworks/$QTNETWORK $BINARY_FW_PATH/$QTNETWORK
install_name_tool -id @executable_path/../Frameworks/$QTPRINT $BINARY_FW_PATH/$QTPRINT install_name_tool -id @executable_path/../Frameworks/$QTPRINT $BINARY_FW_PATH/$QTPRINT
install_name_tool -id @executable_path/../Frameworks/$QDBUS $BINARY_FW_PATH/$QTDBUS
QTCORE_LINK=$(otool -L $BINARY | grep QtCore | cut -d"(" -f1 | cut -f2) QTCORE_LINK=$(otool -L $BINARY | grep QtCore | cut -d"(" -f1 | cut -f2)
QTGUI_LINK=$(otool -L $BINARY | grep QtGui | cut -d"(" -f1 | cut -f2) QTGUI_LINK=$(otool -L $BINARY | grep QtGui | cut -d"(" -f1 | cut -f2)
QTWIDGETS_LINK=$(otool -L $BINARY | grep QtWidgets | cut -d"(" -f1 | cut -f2) QTWIDGETS_LINK=$(otool -L $BINARY | grep QtWidgets | cut -d"(" -f1 | cut -f2)
QTSQL_LINK=$(otool -L $BINARY | grep QtSql | cut -d"(" -f1 | cut -f2) QTSQL_LINK=$(otool -L $BINARY | grep QtSql | cut -d"(" -f1 | cut -f2)
QTNETWORK_LINK=$(otool -L $BINARY | grep QtNetwork | cut -d"(" -f1 | cut -f2) QTNETWORK_LINK=$(otool -L $BINARY | grep QtNetwork | cut -d"(" -f1 | cut -f2)
QTPRINT_LINK=$(otool -L $BINARY_PLUGIN_PATH/platforms/libqcocoa.dylib | grep QtPrintSupport | cut -d"(" -f1 | cut -f2)
install_name_tool -change $QTCORE_LINK @executable_path/../Frameworks/$QTCORE $BINARY install_name_tool -change $QTCORE_LINK @executable_path/../Frameworks/$QTCORE $BINARY
install_name_tool -change $QTGUI_LINK @executable_path/../Frameworks/$QTGUI $BINARY install_name_tool -change $QTGUI_LINK @executable_path/../Frameworks/$QTGUI $BINARY
install_name_tool -change $QTWIDGETS_LINK @executable_path/../Frameworks/$QTWIDGETS $BINARY install_name_tool -change $QTWIDGETS_LINK @executable_path/../Frameworks/$QTWIDGETS $BINARY
@@ -144,22 +98,10 @@ if [ "$1" != "--without-qt" ] ; then
install_name_tool -change $QTWIDGETS_LINK @executable_path/../Frameworks/$QTWIDGETS $BINARY_PLUGIN_PATH/imageformats/libqjpeg.dylib install_name_tool -change $QTWIDGETS_LINK @executable_path/../Frameworks/$QTWIDGETS $BINARY_PLUGIN_PATH/imageformats/libqjpeg.dylib
install_name_tool -change $QTCORE_LINK @executable_path/../Frameworks/$QTCORE $BINARY_PLUGIN_PATH/sqldrivers/libqsqlite.dylib install_name_tool -change $QTCORE_LINK @executable_path/../Frameworks/$QTCORE $BINARY_PLUGIN_PATH/sqldrivers/libqsqlite.dylib
install_name_tool -change $QTSQL_LINK @executable_path/../Frameworks/$QTSQL $BINARY_PLUGIN_PATH/sqldrivers/libqsqlite.dylib install_name_tool -change $QTSQL_LINK @executable_path/../Frameworks/$QTSQL $BINARY_PLUGIN_PATH/sqldrivers/libqsqlite.dylib
QTDBUS_LINK=$(otool -L $BINARY_PLUGIN_PATH/platforms/libqcocoa.dylib | grep QtDBus | cut -d"(" -f1 | cut -f2)
QTPRINT_LINK=$(otool -L $BINARY_PLUGIN_PATH/platforms/libqcocoa.dylib | grep QtPrintSupport | cut -d"(" -f1 | cut -f2)
QTZ_LINK=$(otool -L $BINARY_PLUGIN_PATH/platforms/libqcocoa.dylib | grep libz | cut -d"(" -f1 | cut -f2)
QTCORE_LINK=$(otool -L $BINARY_PLUGIN_PATH/platforms/libqcocoa.dylib | grep QtCore | cut -d"(" -f1 | cut -f2)
QTGUI_LINK=$(otool -L $BINARY_PLUGIN_PATH/platforms/libqcocoa.dylib | grep QtGui | cut -d"(" -f1 | cut -f2)
QTWIDGETS_LINK=$(otool -L $BINARY_PLUGIN_PATH/platforms/libqcocoa.dylib | grep QtWidgets | cut -d"(" -f1 | cut -f2)
install_name_tool -change $QTCORE_LINK @executable_path/../Frameworks/$QTCORE $BINARY_PLUGIN_PATH/platforms/libqcocoa.dylib install_name_tool -change $QTCORE_LINK @executable_path/../Frameworks/$QTCORE $BINARY_PLUGIN_PATH/platforms/libqcocoa.dylib
install_name_tool -change $QTGUI_LINK @executable_path/../Frameworks/$QTGUI $BINARY_PLUGIN_PATH/platforms/libqcocoa.dylib install_name_tool -change $QTGUI_LINK @executable_path/../Frameworks/$QTGUI $BINARY_PLUGIN_PATH/platforms/libqcocoa.dylib
install_name_tool -change $QTWIDGETS_LINK @executable_path/../Frameworks/$QTWIDGETS $BINARY_PLUGIN_PATH/platforms/libqcocoa.dylib install_name_tool -change $QTWIDGETS_LINK @executable_path/../Frameworks/$QTWIDGETS $BINARY_PLUGIN_PATH/platforms/libqcocoa.dylib
install_name_tool -change $QTPRINT_LINK @executable_path/../Frameworks/$QTPRINT $BINARY_PLUGIN_PATH/platforms/libqcocoa.dylib install_name_tool -change $QTPRINT_LINK @executable_path/../Frameworks/$QTPRINT $BINARY_PLUGIN_PATH/platforms/libqcocoa.dylib
install_name_tool -change $QTDBUS_LINK @executable_path/../Frameworks/$QTDBUS $BINARY_PLUGIN_PATH/platforms/libqcocoa.dylib
install_name_tool -change $QTZ_LINK @loader_path/dylibs/libz.1.dylib $BINARY_PLUGIN_PATH/platforms/libqcocoa.dylib
QTCORE_LINK=$(otool -L $BINARY_FW_PATH/$QTDBUS | grep QtCore | head -1 | cut -d"(" -f1 | cut -f2)
install_name_tool -change $QTCORE_LINK @executable_path/../Frameworks/$QTCORE $BINARY_FW_PATH/$QTDBUS
QTCORE_LINK=$(otool -L $BINARY_FW_PATH/$QTGUI | grep QtCore | head -1 | cut -d"(" -f1 | cut -f2) QTCORE_LINK=$(otool -L $BINARY_FW_PATH/$QTGUI | grep QtCore | head -1 | cut -d"(" -f1 | cut -f2)
install_name_tool -change $QTCORE_LINK @executable_path/../Frameworks/$QTCORE $BINARY_FW_PATH/$QTGUI install_name_tool -change $QTCORE_LINK @executable_path/../Frameworks/$QTCORE $BINARY_FW_PATH/$QTGUI
-230
View File
@@ -1,230 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.9.1, 2019-08-10T02:50:36. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{305266b5-7802-47a6-9864-ddd965ca89a2}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap">
<valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey"/>
<value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 5.13.0 for Android ARMv7</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Qt 5.13.0 for Android ARMv7</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{548474b4-3c43-4596-9405-a81c8aa43ccd}</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/min/Dokumente/pokerth</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments">'CONFIG+=client gui_800x480' 'PREFIX+=/home/min/Dokumente/Android/cmoss/bin/droid'</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Erstellen</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Bereinigen</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deployment auf Android-Gerät</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.AndroidDeployQtStep</value>
<value type="bool" key="UninstallPreviousPackage">false</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deployment</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deployment auf Android-Gerät</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.AndroidDeployConfiguration2</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
<valuelist type="QVariantList" key="Analyzer.Perf.Events">
<value type="QString">cpu-cycles</value>
</valuelist>
<valuelist type="QVariantList" key="Analyzer.Perf.ExtraArguments"/>
<value type="int" key="Analyzer.Perf.Frequency">250</value>
<value type="QString" key="Analyzer.Perf.SampleMode">-F</value>
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
<value type="int" key="Analyzer.Perf.StackSize">4096</value>
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="QString" key="Analyzer.Valgrind.KCachegrindExecutable">kcachegrind</value>
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<value type="QString" key="Android.AmStartArgsKey"></value>
<valuelist type="QVariantList" key="Android.PostStartShellCmdListKey"/>
<valuelist type="QVariantList" key="Android.PreStartShellCmdListKey"/>
<value type="int" key="PE.EnvironmentAspect.Base">0</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">pokerth_game</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">pokerth_game</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.AndroidRunConfiguration:/home/min/Dokumente/pokerth/pokerth_game.pro</value>
<value type="QString" key="RunConfiguration.Arguments"></value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">21</value>
</data>
<data>
<variable>Version</variable>
<value type="int">21</value>
</data>
</qtcreator>
+1 -1
View File
@@ -60,7 +60,7 @@ mac{
CONFIG += x86_64 CONFIG += x86_64
CONFIG -= x86 CONFIG -= x86
CONFIG -= ppc CONFIG -= ppc
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7 QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.12
QMAKE_CXXFLAGS -= -std=gnu++0x QMAKE_CXXFLAGS -= -std=gnu++0x
# for universal-compilation on PPC-Mac uncomment the following line # for universal-compilation on PPC-Mac uncomment the following line
+2
View File
@@ -42,6 +42,7 @@ HEADERS += src/dbofficial/asyncdbauth.h \
src/dbofficial/asyncdbavatarblacklist.h \ src/dbofficial/asyncdbavatarblacklist.h \
src/dbofficial/asyncdbadminplayers.h \ src/dbofficial/asyncdbadminplayers.h \
src/dbofficial/asyncdbblockplayer.h \ src/dbofficial/asyncdbblockplayer.h \
src/dbofficial/asyncdbplayerlastgames.h \
src/dbofficial/dbidmanager.h src/dbofficial/dbidmanager.h
SOURCES += src/dbofficial/asyncdbauth.cpp \ SOURCES += src/dbofficial/asyncdbauth.cpp \
src/dbofficial/asyncdbcreategame.cpp \ src/dbofficial/asyncdbcreategame.cpp \
@@ -60,6 +61,7 @@ SOURCES += src/dbofficial/asyncdbauth.cpp \
src/dbofficial/asyncdbavatarblacklist.cpp \ src/dbofficial/asyncdbavatarblacklist.cpp \
src/dbofficial/asyncdbadminplayers.cpp \ src/dbofficial/asyncdbadminplayers.cpp \
src/dbofficial/asyncdbblockplayer.cpp \ src/dbofficial/asyncdbblockplayer.cpp \
src/dbofficial/asyncdbplayerlastgames.cpp \
src/dbofficial/dbidmanager.cpp src/dbofficial/dbidmanager.cpp
win32 { win32 {
DEFINES += _WIN32_WINNT=0x0501 DEFINES += _WIN32_WINNT=0x0501
+9 -11
View File
@@ -538,7 +538,7 @@ unix:!mac {
$$BOOST_IOSTREAMS \ $$BOOST_IOSTREAMS \
$$BOOST_REGEX \ $$BOOST_REGEX \
$$BOOST_SYS $$BOOST_SYS
!count(BOOST_LIBS, 5):error("Unable to find boost libraries in PREFIX=$${PREFIX}/armv7") !count(BOOST_LIBS, 5):error("Unable to find boost libraries in PREFIX=$${PREFIX}/armv5")
LIBS += -ltinyxml LIBS += -ltinyxml
LIBS += $$BOOST_LIBS LIBS += $$BOOST_LIBS
LIBS += -lgsasl -lidn LIBS += -lgsasl -lidn
@@ -576,7 +576,7 @@ mac {
CONFIG += x86_64 CONFIG += x86_64
CONFIG -= x86 CONFIG -= x86
CONFIG -= ppc CONFIG -= ppc
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7 QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.12
QMAKE_CXXFLAGS -= -std=gnu++0x QMAKE_CXXFLAGS -= -std=gnu++0x
# workaround for problems with boost_filesystem exceptions # workaround for problems with boost_filesystem exceptions
@@ -587,14 +587,13 @@ mac {
# QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk/ # QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk/
LIBPATH += lib LIBPATH += lib
# QT dynamic linked framework (see also mac_post_make.sh) # QT dynamic linked framework (see also mac_post_make.sh)
LIBS += -F /Library/Frameworks LIBS += -F /Library/Frameworks
# LIBS += -framework \ LIBS += -framework \
# QtCore QtCore
# LIBS += -framework \ LIBS += -framework \
# QtGui QtGui
LIBS += -framework \ LIBS += -framework \
SDL SDL
LIBS += -framework \ LIBS += -framework \
SDL_mixer SDL_mixer
@@ -616,7 +615,7 @@ mac {
-lprotobuf \ -lprotobuf \
-lz \ -lz \
-framework \ -framework \
Cocoa Cocoa
# set the application icon # set the application icon
RC_FILE = pokerth.icns RC_FILE = pokerth.icns
@@ -673,7 +672,6 @@ android{
DEFINES += TIXML_USE_STL DEFINES += TIXML_USE_STL
# sqlite3 is included directly. # sqlite3 is included directly.
INCLUDEPATH += src/third_party/sqlite3 INCLUDEPATH += src/third_party/sqlite3
INCLUDEPATH += /home/min/Dokumente/Android/android-ndk-r13b/platforms/android-19/arch-arm/usr/include
# sound system switches # sound system switches
!android_api8 { !android_api8 {
+2 -3
View File
@@ -31,7 +31,7 @@ INCLUDEPATH += . \
src/engine/network_engine \ src/engine/network_engine \
src/config \ src/config \
src/core \ src/core \
src/third_party/websocketpp src/third_party/websocketpp
DEPENDPATH += . \ DEPENDPATH += . \
src \ src \
@@ -294,7 +294,7 @@ mac{
CONFIG += x86_64 CONFIG += x86_64
CONFIG -= x86 CONFIG -= x86
CONFIG -= ppc CONFIG -= ppc
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7 QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.12
QMAKE_CXXFLAGS -= -std=gnu++0x QMAKE_CXXFLAGS -= -std=gnu++0x
# for universal-compilation on PPC-Mac uncomment the following line # for universal-compilation on PPC-Mac uncomment the following line
@@ -312,7 +312,6 @@ android{
DEFINES += BOOST_FILESYSTEM_VERSION=3 DEFINES += BOOST_FILESYSTEM_VERSION=3
# sqlite3 is included directly. # sqlite3 is included directly.
INCLUDEPATH += src/third_party/sqlite3 INCLUDEPATH += src/third_party/sqlite3
INCLUDEPATH += /home/min/Dokumente/Android/android-ndk-r13b/platforms/android-19/arch-arm/usr/include
SOURCES += src/third_party/sqlite3/sqlite3.c SOURCES += src/third_party/sqlite3/sqlite3.c
} }
+6 -9
View File
@@ -40,7 +40,7 @@ win32 {
system(protoc pokerth.proto --java_out=tests/src) system(protoc pokerth.proto --java_out=tests/src)
} }
unix : !mac { unix : !mac {
INCLUDEPATH += $${PREFIX}/include INCLUDEPATH += $${PREFIX}/include
system(protoc pokerth.proto --cpp_out=src/third_party/protobuf) system(protoc pokerth.proto --cpp_out=src/third_party/protobuf)
system(protoc chatcleaner.proto --cpp_out=src/third_party/protobuf) system(protoc chatcleaner.proto --cpp_out=src/third_party/protobuf)
system(protoc pokerth.proto --java_out=tests/src) system(protoc pokerth.proto --java_out=tests/src)
@@ -52,14 +52,11 @@ unix : !mac {
} }
} }
mac { mac {
# make it x86_64 only # make it x86_64 only
CONFIG += x86_64 CONFIG += x86_64
CONFIG -= x86 CONFIG -= x86
CONFIG -= ppc CONFIG -= ppc
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7 QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.12
system(protoc pokerth.proto --cpp_out=src/third_party/protobuf)
system(protoc chatcleaner.proto --cpp_out=src/third_party/protobuf)
system(protoc pokerth.proto --java_out=tests/src)
# for universal-compilation on PPC-Mac uncomment the following line # for universal-compilation on PPC-Mac uncomment the following line
# on Intel-Mac you have to comment this line out or build will fail. # on Intel-Mac you have to comment this line out or build will fail.
+1 -1
View File
@@ -310,7 +310,7 @@ mac {
CONFIG += x86_64 CONFIG += x86_64
CONFIG -= x86 CONFIG -= x86
CONFIG -= ppc CONFIG -= ppc
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7 QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.12
QMAKE_CXXFLAGS -= -std=gnu++0x QMAKE_CXXFLAGS -= -std=gnu++0x
# workaround for problems with boost_filesystem exceptions # workaround for problems with boost_filesystem exceptions
BIN
View File
Binary file not shown.
+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("DBServerEncryptionKey", CONFIG_TYPE_STRING, ""));
configList.push_back(ConfigInfo("GameNameBadWordList", CONFIG_TYPE_STRING_LIST, "Regex")); configList.push_back(ConfigInfo("GameNameBadWordList", CONFIG_TYPE_STRING_LIST, "Regex"));
configList.push_back(ConfigInfo("ServerRestrictGuestLogin", CONFIG_TYPE_INT, "0")); 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 //fill tempList firstTime
configBufferList = configList; configBufferList = configList;
+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 void
ServerDBGeneric::EndGame(unsigned /*requestId*/) ServerDBGeneric::EndGame(unsigned /*requestId*/)
{ {
+3
View File
@@ -35,6 +35,7 @@
#include <string> #include <string>
#include <ctime> #include <ctime>
#include <vector>
typedef unsigned DB_id; typedef unsigned DB_id;
#define DB_ID_INVALID 0 #define DB_ID_INVALID 0
@@ -45,6 +46,8 @@ struct DBPlayerData {
std::string secret; std::string secret;
std::string country; std::string country;
std::string last_login; std::string last_login;
std::string last_games;
std::string last_ip;
}; };
#endif #endif
+1
View File
@@ -57,6 +57,7 @@ public:
virtual void AsyncCreateGame(unsigned requestId, const std::string &gameName); virtual void AsyncCreateGame(unsigned requestId, const std::string &gameName);
virtual void SetGamePlayerPlace(unsigned requestId, DB_id playerId, unsigned place); 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 EndGame(unsigned requestId);
virtual void AsyncReportAvatar(unsigned requestId, unsigned replyId, DB_id reportedPlayerId, const std::string &avatarHash, const std::string &avatarType, DB_id *byPlayerId); 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 <db/serverdbcallback.h>
#include <string> #include <string>
#include <list> #include <list>
#include <vector>
typedef std::list<DB_id> db_list; typedef std::list<DB_id> db_list;
@@ -57,6 +58,7 @@ public:
virtual void AsyncCreateGame(unsigned requestId, const std::string &gameName) = 0; virtual void AsyncCreateGame(unsigned requestId, const std::string &gameName) = 0;
virtual void SetGamePlayerPlace(unsigned requestId, DB_id playerId, unsigned place) = 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 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; 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 AsyncCreateGame(unsigned /*requestId*/, const std::string &/*gameName*/) {}
virtual void SetGamePlayerPlace(unsigned /*requestId*/, DB_id /*playerId*/, unsigned /*place*/) {} 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 EndGame(unsigned /*requestId*/) {}
virtual void AsyncReportAvatar(unsigned /*requestId*/, unsigned /*replyId*/, DB_id /*reportedPlayerId*/, const std::string &/*avatarHash*/, const std::string &/*avatarType*/, DB_id * /*byPlayerId*/) {} 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())); service.post(boost::bind(&ServerDBCallback::PlayerLoginFailed, &cb, GetId()));
} else { } else {
int blocked = result[0][2]; int blocked = result[0][2];
int active = result[0][5]; int active = result[0][7];
if ((active != 1) || (blocked != 0)) { if ((active != 1) || (blocked != 0)) {
service.post(boost::bind(&ServerDBCallback::PlayerLoginBlocked, &cb, GetId())); service.post(boost::bind(&ServerDBCallback::PlayerLoginBlocked, &cb, GetId()));
} else { } else {
mysqlpp::String secret(result[0][1]); mysqlpp::String secret(result[0][1]);
mysqlpp::String country(result[0][3]); mysqlpp::String country(result[0][3]);
mysqlpp::String last_login(result[0][4]); 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); boost::shared_ptr<DBPlayerData> tmpData(new DBPlayerData);
tmpData->id = result[0][0]; tmpData->id = result[0][0];
secret.to_string(tmpData->secret); secret.to_string(tmpData->secret);
if (!country.is_null()) if (!country.is_null())
country.to_string(tmpData->country); country.to_string(tmpData->country);
last_login.to_string(tmpData->last_login); 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)); 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_ACTIVE "active"
#define DB_TABLE_PLAYER_COL_AVATARHASH "avatar_hash" #define DB_TABLE_PLAYER_COL_AVATARHASH "avatar_hash"
#define DB_TABLE_PLAYER_COL_AVATARTYPE "avatar_mime" #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 "game"
#define DB_TABLE_GAME_COL_ID "idgame" #define DB_TABLE_GAME_COL_ID "idgame"
+38 -3
View File
@@ -41,12 +41,15 @@
#include <dbofficial/asyncdbreportgame.h> #include <dbofficial/asyncdbreportgame.h>
#include <dbofficial/asyncdbadminplayers.h> #include <dbofficial/asyncdbadminplayers.h>
#include <dbofficial/asyncdbblockplayer.h> #include <dbofficial/asyncdbblockplayer.h>
#include <dbofficial/asyncdbplayerlastgames.h>
#include <dbofficial/compositeasyncdbquery.h> #include <dbofficial/compositeasyncdbquery.h>
#include <dbofficial/db_table_defs.h> #include <dbofficial/db_table_defs.h>
#include <ctime> #include <ctime>
#include <sstream> #include <sstream>
#include <mysql++.h> #include <mysql++.h>
#include <core/loghelper.h> // @TODO: remove in productive
#define QUERY_NICK_PREPARE "nick_template" #define QUERY_NICK_PREPARE "nick_template"
#define QUERY_LOGIN_PREPARE "login_template" #define QUERY_LOGIN_PREPARE "login_template"
#define QUERY_AVATAR_BLACKLIST_PREPARE "avatar_blacklist_template" #define QUERY_AVATAR_BLACKLIST_PREPARE "avatar_blacklist_template"
@@ -58,6 +61,7 @@
#define QUERY_REPORT_GAME_PREPARE "report_game_template" #define QUERY_REPORT_GAME_PREPARE "report_game_template"
#define QUERY_ADMIN_PLAYER_PREPARE "admin_player_template" #define QUERY_ADMIN_PLAYER_PREPARE "admin_player_template"
#define QUERY_BLOCK_PLAYER_PREPARE "block_player_template" #define QUERY_BLOCK_PLAYER_PREPARE "block_player_template"
#define QUERY_PLAYER_LASTGAMES_PREPARE "player_lastgames_template"
using namespace std; using namespace std;
@@ -230,6 +234,33 @@ ServerDBThread::SetGamePlayerPlace(unsigned requestId, DB_id playerId, unsigned
m_semaphore.post(); 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 void
ServerDBThread::EndGame(unsigned requestId) ServerDBThread::EndGame(unsigned requestId)
{ {
@@ -432,7 +463,7 @@ ServerDBThread::EstablishDBConnection()
*/ */
prepareNick prepareNick
<< "PREPARE " QUERY_NICK_PREPARE " FROM " << mysqlpp::quote << "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(); mysqlpp::Query prepareAvatarBlacklist = m_connData->conn.query();
prepareAvatarBlacklist prepareAvatarBlacklist
@@ -479,12 +510,16 @@ ServerDBThread::EstablishDBConnection()
prepareBlockPlayer prepareBlockPlayer
<< "PREPARE " QUERY_BLOCK_PLAYER_PREPARE " FROM " << mysqlpp::quote << "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 " = ?"; << "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() if (!prepareNick.exec() || !prepareAvatarBlacklist.exec() || !prepareLogin.exec() || !prepareCreateGame.exec()
|| !prepareEndGame.exec() || !prepareRelation.exec() || !prepareScore.exec() || !prepareReportAvatar.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() + string tmpError = string(prepareNick.error()) + prepareAvatarBlacklist.error() + prepareLogin.error() + prepareCreateGame.error() +
prepareEndGame.error() + prepareRelation.error() + prepareScore.error() + prepareReportAvatar.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_connData->conn.disconnect();
m_ioService->post(boost::bind(&ServerDBCallback::ConnectFailed, &m_callback, tmpError)); m_ioService->post(boost::bind(&ServerDBCallback::ConnectFailed, &m_callback, tmpError));
m_permanentError = true; m_permanentError = true;
+2
View File
@@ -42,6 +42,7 @@
#include <dbofficial/dbidmanager.h> #include <dbofficial/dbidmanager.h>
#include <core/thread.h> #include <core/thread.h>
struct DBConnectionData; struct DBConnectionData;
class AsyncDBQuery; class AsyncDBQuery;
@@ -66,6 +67,7 @@ public:
virtual void AsyncCreateGame(unsigned requestId, const std::string &gameName); virtual void AsyncCreateGame(unsigned requestId, const std::string &gameName);
virtual void SetGamePlayerPlace(unsigned requestId, DB_id playerId, unsigned place); 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 EndGame(unsigned requestId);
virtual void AsyncReportAvatar(unsigned requestId, unsigned replyId, DB_id reportedPlayerId, const std::string &avatarHash, const std::string &avatarType, DB_id *byPlayerId); virtual void AsyncReportAvatar(unsigned requestId, unsigned replyId, DB_id reportedPlayerId, const std::string &avatarHash, const std::string &avatarType, DB_id *byPlayerId);
+115
View File
@@ -0,0 +1,115 @@
/*****************************************************************************
* PokerTH - The open source texas holdem engine *
* Copyright (C) 2006-2012 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. *
*****************************************************************************/
// Connectivity test program for PokerTH
#include <iostream>
#include <boost/program_options.hpp>
#include <boost/thread.hpp>
#include <boost/nondet_random.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/random/variate_generator.hpp>
using namespace std;
namespace po = boost::program_options;
boost::thread_specific_ptr<boost::random_device> g_rand_state;
struct nondet_rng : std::unary_function<unsigned, unsigned> {
boost::random_device &_state;
unsigned operator()(unsigned i)
{
boost::uniform_int<> rng(0, i - 1);
return rng(_state);
}
nondet_rng(boost::random_device &state) : _state(state) {}
};
int
main(int argc, char *argv[])
{
try {
// Check command line options.
po::options_description desc("Allowed options");
desc.add_options()
("help,h", "produce help message")
("num,n", po::value<int>(), "set num of deals")
;
po::variables_map vm;
po::store(po::parse_command_line(argc, argv, desc), vm);
po::notify(vm);
if (vm.count("help")) {
cout << desc << endl;
return 1;
}
if (!vm.count("num")) {
cout << "Missing option!" << endl << desc << endl;
return 1;
}
int num = vm["num"].as<int>();
const int NumCards = 52;
for(int i=0; i<num;i++){
// shuffle cards
int cardsArray[NumCards] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
50, 51
};
if (!g_rand_state.get()) {
g_rand_state.reset(new boost::random_device);
}
nondet_rng rand(*g_rand_state);
random_shuffle(&cardsArray[0], &cardsArray[NumCards], rand);
ostringstream oss("");
for (int temp = 0; temp < NumCards; temp++){
if(temp > 0) cout << ",";
cout << cardsArray[temp];
}
cout << endl;
}
} catch (...) {
cout << "Exception caught" << endl;
return 1;
}
return 0;
}
+1 -1
View File
@@ -35,7 +35,7 @@
#ifdef ANDROID #ifdef ANDROID
#ifndef ANDROID_TEST #ifndef ANDROID_TEST
#include "QtGui/5.13.0/QtGui/qpa/qplatformnativeinterface.h" #include "QtGui/5.7.1/QtGui/qpa/qplatformnativeinterface.h"
#include <jni.h> #include <jni.h>
#endif #endif
#endif #endif
+9 -2
View File
@@ -2222,13 +2222,13 @@ p, li { white-space: pre-wrap; }
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>600</width> <width>600</width>
<height>94</height> <height>114</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>600</width> <width>600</width>
<height>94</height> <height>114</height>
</size> </size>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
@@ -2631,6 +2631,13 @@ p, li { white-space: pre-wrap; }
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="1" column="0" colspan="5">
<widget class="QLabel" name="label_WinningCombination">
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
+5 -1
View File
@@ -69,7 +69,7 @@
#ifdef ANDROID #ifdef ANDROID
#ifndef ANDROID_TEST #ifndef ANDROID_TEST
#include "QtGui/5.13.0/QtGui/qpa/qplatformnativeinterface.h" #include "QtGui/5.7.1/QtGui/qpa/qplatformnativeinterface.h"
#include <jni.h> #include <jni.h>
#endif #endif
#endif #endif
@@ -2530,6 +2530,7 @@ void gameTableImpl::postRiverRunAnimation2()
if(nonfoldPlayersCounter!=1) { if(nonfoldPlayersCounter!=1) {
label_WinningCombination->setText(CardsValue::determineHandName(currentGame->getCurrentHand()->getCurrentBeRo()->getHighestCardsValue(), activePlayerList).c_str());
if(!flipHolecardsAllInAlreadyDone) { if(!flipHolecardsAllInAlreadyDone) {
for (it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); ++it_c) { for (it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); ++it_c) {
@@ -3017,6 +3018,8 @@ void gameTableImpl::nextRoundCleanGui()
resetMyButtonsCheckStateMemory(); resetMyButtonsCheckStateMemory();
clearMyButtons(); clearMyButtons();
pushButton_showMyCards->hide(); pushButton_showMyCards->hide();
label_WinningCombination->clear();
update();
} }
void gameTableImpl::stopTimer() void gameTableImpl::stopTimer()
@@ -4117,6 +4120,7 @@ void gameTableImpl::refreshGameTableStyle()
myGameTableStyle->setBigFontBoardStyle(textLabel_handLabel); myGameTableStyle->setBigFontBoardStyle(textLabel_handLabel);
myGameTableStyle->setBigFontBoardStyle(label_Pot); myGameTableStyle->setBigFontBoardStyle(label_Pot);
#endif #endif
myGameTableStyle->setBigFontBoardStyle(label_WinningCombination);
myGameTableStyle->setCardHolderStyle(label_CardHolder0,0); myGameTableStyle->setCardHolderStyle(label_CardHolder0,0);
myGameTableStyle->setCardHolderStyle(label_CardHolder1,0); myGameTableStyle->setCardHolderStyle(label_CardHolder1,0);
myGameTableStyle->setCardHolderStyle(label_CardHolder2,0); myGameTableStyle->setCardHolderStyle(label_CardHolder2,0);
+9 -2
View File
@@ -2745,13 +2745,13 @@ p, li { white-space: pre-wrap; }
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>390</width> <width>390</width>
<height>82</height> <height>102</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>390</width> <width>390</width>
<height>82</height> <height>102</height>
</size> </size>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
@@ -3039,6 +3039,13 @@ p, li { white-space: pre-wrap; }
</widget> </widget>
</widget> </widget>
</item> </item>
<item row="1" column="0">
<widget class="QLabel" name="label_WinningCombination">
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
+1 -1
View File
@@ -61,7 +61,7 @@
#ifdef ANDROID #ifdef ANDROID
#ifndef ANDROID_TEST #ifndef ANDROID_TEST
#include "QtGui/5.13.0/QtGui/qpa/qplatformnativeinterface.h" #include "QtGui/5.7.1/QtGui/qpa/qplatformnativeinterface.h"
#include <jni.h> #include <jni.h>
#endif #endif
#endif #endif
+28
View File
@@ -293,11 +293,13 @@ ServerGame::TimerVoteKick(const boost::system::error_code &ec)
PlayerDataList PlayerDataList
ServerGame::InternalStartGame() ServerGame::InternalStartGame()
{ {
LOG_ERROR("InternalStartGame() entered.");
// Initialize the game. // Initialize the game.
PlayerDataList playerData(GetFullPlayerDataList()); PlayerDataList playerData(GetFullPlayerDataList());
if (playerData.size() >= 2) { if (playerData.size() >= 2) {
// Set DB Backend. // Set DB Backend.
// @TODO: check for wec or bbc game with bbcbot as creator
if (GetGameData().gameType == GAME_TYPE_RANKING) if (GetGameData().gameType == GAME_TYPE_RANKING)
m_database = GetLobbyThread().GetDatabase(); m_database = GetLobbyThread().GetDatabase();
else else
@@ -346,6 +348,12 @@ ServerGame::InternalStartGame()
GetDatabase().AsyncCreateGame(GetId(), GetName()); GetDatabase().AsyncCreateGame(GetId(), GetName());
InitRankingMap(playerData); InitRankingMap(playerData);
// @TODO: here to save last_games with mysql per player
if (GetGameData().gameType == GAME_TYPE_RANKING)
StoreLastGames(playerData);
} }
return playerData; return playerData;
} }
@@ -442,6 +450,26 @@ ServerGame::StoreAndResetRanking()
m_rankingMap.clear(); 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 void
ServerGame::RemoveAutoLeavePlayers() ServerGame::RemoveAutoLeavePlayers()
{ {
+27 -8
View File
@@ -62,6 +62,7 @@
#include <boost/uuid/uuid.hpp> #include <boost/uuid/uuid.hpp>
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <gsasl.h> #include <gsasl.h>
#include <ctime>
#define SERVER_MAX_NUM_LOBBY_SESSIONS 512 // Maximum number of idle users in lobby. #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 #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); m_sessionManager.AddSession(sessionData);
LOG_VERBOSE("Accepted connection - session #" << sessionData->GetId() << "."); LOG_VERBOSE("Accepted connection - session #" << sessionData->GetId() << ".");
LOG_ERROR("Accepted connection - session #" << sessionData->GetId() << ".");
sessionData->StartTimerInitTimeout(SERVER_INIT_SESSION_TIMEOUT_SEC); sessionData->StartTimerInitTimeout(SERVER_INIT_SESSION_TIMEOUT_SEC);
sessionData->StartTimerGlobalTimeout(SERVER_SESSION_FORCED_TIMEOUT_SEC); sessionData->StartTimerGlobalTimeout(SERVER_SESSION_FORCED_TIMEOUT_SEC);
@@ -1347,7 +1349,7 @@ ServerLobbyThread::HandleNetPacketRetrieveAvatar(boost::shared_ptr<SessionData>
void void
ServerLobbyThread::HandleNetPacketCreateGame(boost::shared_ptr<SessionData> session, const JoinNewGameMessage &newGame) 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; string password;
if (newGame.has_password()) if (newGame.has_password())
@@ -1377,6 +1379,10 @@ ServerLobbyThread::HandleNetPacketCreateGame(boost::shared_ptr<SessionData> sess
SendJoinGameFailed(session, gameId, NTF_NET_JOIN_GUEST_FORBIDDEN); SendJoinGameFailed(session, gameId, NTF_NET_JOIN_GUEST_FORBIDDEN);
} else if (!ServerGame::CheckSettings(tmpData, password, GetServerMode())) { } else if (!ServerGame::CheckSettings(tmpData, password, GetServerMode())) {
SendJoinGameFailed(session, gameId, NTF_NET_JOIN_INVALID_SETTINGS); 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 { } else {
boost::shared_ptr<ServerGame> game( boost::shared_ptr<ServerGame> game(
new ServerGame( new ServerGame(
@@ -1418,6 +1424,7 @@ ServerLobbyThread::HandleNetPacketJoinGame(boost::shared_ptr<SessionData> sessio
MoveSessionToGame(game, session, joinGame.autoleave(), true); MoveSessionToGame(game, session, joinGame.autoleave(), true);
} }
} else { } else {
LOG_ERROR("JoinGame pre validation");
// As guest, you are only allowed to join normal games. // As guest, you are only allowed to join normal games.
if (session->GetPlayerData()->GetRights() == PLAYER_RIGHTS_GUEST if (session->GetPlayerData()->GetRights() == PLAYER_RIGHTS_GUEST
&& tmpData.gameType != GAME_TYPE_NORMAL) { && 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); SendJoinGameFailed(session, joinGame.gameid(), NTF_NET_JOIN_NOT_INVITED);
} else if (!game->CheckPassword(password)) { } else if (!game->CheckPassword(password)) {
SendJoinGameFailed(session, joinGame.gameid(), NTF_NET_JOIN_INVALID_PASSWORD); SendJoinGameFailed(session, joinGame.gameid(), NTF_NET_JOIN_INVALID_PASSWORD);
} else if (tmpData.gameType == GAME_TYPE_RANKING } else if (tmpData.gameType == GAME_TYPE_RANKING && !session->GetPlayerData()->IsPlayerAllowedToJoinCreateLimitRank(m_serverConfig.readConfigString("ServerLimitRankNum"), m_serverConfig.readConfigString("ServerLimitRankPeriod"))) {
&& !joinGame.spectateonly() SendJoinGameFailed(session, joinGame.gameid(), NTF_NET_JOIN_IP_BLOCKED);
&& session->GetClientAddr() != SERVER_ADDRESS_LOCALHOST_STR } else if (tmpData.gameType == GAME_TYPE_RANKING && !joinGame.spectateonly()
&& session->GetClientAddr() != SERVER_ADDRESS_LOCALHOST_STR_V4V6 && session->GetClientAddr() != SERVER_ADDRESS_LOCALHOST_STR
&& session->GetClientAddr() != SERVER_ADDRESS_LOCALHOST_STR_V4 && session->GetClientAddr() != SERVER_ADDRESS_LOCALHOST_STR_V4V6
&& game->IsClientAddressConnected(session->GetClientAddr())) { && session->GetClientAddr() != SERVER_ADDRESS_LOCALHOST_STR_V4
&& game->IsClientAddressConnected(session->GetClientAddr())) {
SendJoinGameFailed(session, joinGame.gameid(), NTF_NET_JOIN_IP_BLOCKED); SendJoinGameFailed(session, joinGame.gameid(), NTF_NET_JOIN_IP_BLOCKED);
} else { } else {
MoveSessionToGame(game, session, joinGame.autoleave(), false); MoveSessionToGame(game, session, joinGame.autoleave(), false);
} }
@@ -1803,6 +1810,18 @@ ServerLobbyThread::UserValid(unsigned playerId, const DBPlayerData &dbPlayerData
if (tmpSession && tmpSession->GetPlayerData()) { if (tmpSession && tmpSession->GetPlayerData()) {
tmpSession->GetPlayerData()->SetDBId(dbPlayerData.id); tmpSession->GetPlayerData()->SetDBId(dbPlayerData.id);
tmpSession->GetPlayerData()->SetCountry(dbPlayerData.country); 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); this->AuthChallenge(tmpSession, dbPlayerData.secret);
} }
} }
+2
View File
@@ -34,6 +34,8 @@
#include <net/serverexception.h> #include <net/serverexception.h>
#include <net/socket_msg.h> #include <net/socket_msg.h>
#include <ctime>
using namespace std; using namespace std;
#define SERVER_MAX_GUEST_USERS_LOBBY 50 // LG: Maximum number of guests users in lobby allowed #define SERVER_MAX_GUEST_USERS_LOBBY 50 // LG: Maximum number of guests users in lobby allowed
+1
View File
@@ -148,6 +148,7 @@ protected:
void SetPlayerPlace(unsigned playerId, int place); void SetPlayerPlace(unsigned playerId, int place);
void ReplaceRankingPlayer(unsigned oldPlayerId, unsigned newPlayerId); void ReplaceRankingPlayer(unsigned oldPlayerId, unsigned newPlayerId);
void StoreAndResetRanking(); void StoreAndResetRanking();
void StoreLastGames(const PlayerDataList &playerDataList);
void RemoveAutoLeavePlayers(); void RemoveAutoLeavePlayers();
void InternalEndGame(); void InternalEndGame();
+1
View File
@@ -40,6 +40,7 @@ typedef unsigned SessionId;
#include <boost/thread.hpp> #include <boost/thread.hpp>
#include <boost/enable_shared_from_this.hpp> #include <boost/enable_shared_from_this.hpp>
#include <string> #include <string>
#include <vector>
#include <net/socket_helper.h> #include <net/socket_helper.h>
#include <net/sessiondatacallback.h> #include <net/sessiondatacallback.h>
+2
View File
@@ -65,6 +65,8 @@ public:
bool IsPlayerConnected(unsigned uniqueId) const; bool IsPlayerConnected(unsigned uniqueId) const;
bool IsClientAddressConnected(const std::string &clientAddress) const; bool IsClientAddressConnected(const std::string &clientAddress) const;
bool IsGuestAllowedToConnect(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); void ForEach(boost::function<void (boost::shared_ptr<SessionData>)> func);
+58
View File
@@ -29,6 +29,8 @@
* as that of the covered work. * * as that of the covered work. *
*****************************************************************************/ *****************************************************************************/
#include <playerdata.h> #include <playerdata.h>
#include <ctime>
#include <core/loghelper.h> // @TODO: remove in productive
using namespace std; using namespace std;
@@ -242,3 +244,59 @@ PlayerData::operator<(const PlayerData &other) const
return m_number < other.GetNumber(); 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; int GetStartCash() const;
void SetStartCash(int cash); 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; bool operator<(const PlayerData &other) const;
private: private:
@@ -135,6 +141,8 @@ private:
bool m_isGameAdmin; bool m_isGameAdmin;
boost::shared_ptr<AvatarFile> m_netAvatarFile; boost::shared_ptr<AvatarFile> m_netAvatarFile;
std::vector<long> m_last_games;
mutable boost::mutex m_dataMutex; mutable boost::mutex m_dataMutex;
}; };
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+7537 -3399
View File
File diff suppressed because it is too large Load Diff
+6663 -2190
View File
File diff suppressed because it is too large Load Diff
@@ -1,28 +0,0 @@
# - Config file for the websocketpp package
# It defines the following variables
# WEBSOCKETPP_FOUND - indicates that the module was found
# WEBSOCKETPP_INCLUDE_DIR - include directories
####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
####### Any changes to this file will be overwritten by the next CMake run ####
####### The input file was websocketpp-config.cmake.in ########
get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
macro(set_and_check _var _file)
set(${_var} "${_file}")
if(NOT EXISTS "${_file}")
message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
endif()
endmacro()
####################################################################################
set_and_check(WEBSOCKETPP_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/include")
set(WEBSOCKETPP_FOUND TRUE)
#This is a bit of a hack, but it works well. It also allows continued support of CMake 2.8
if(${CMAKE_VERSION} VERSION_GREATER 3.0.0 OR ${CMAKE_VERSION} VERSION_EQUAL 3.0.0)
add_library(websocketpp::websocketpp INTERFACE IMPORTED)
set_target_properties(websocketpp::websocketpp PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${WEBSOCKETPP_INCLUDE_DIR}")
endif()
@@ -1,52 +0,0 @@
# This is a basic version file for the Config-mode of find_package().
# It is used by write_basic_package_version_file() as input file for configure_file()
# to create a version-file which can be installed along a config.cmake file.
#
# The created file sets PACKAGE_VERSION_EXACT if the current version string and
# the requested version string are exactly the same and it sets
# PACKAGE_VERSION_COMPATIBLE if the current version is equal to the requested version.
# The tweak version component is ignored.
# The variable CVF_VERSION must be set before calling configure_file().
set(PACKAGE_VERSION "0.8.1")
if("0.8.1" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)\\.") # strip the tweak version
set(CVF_VERSION_NO_TWEAK "${CMAKE_MATCH_1}")
else()
set(CVF_VERSION_NO_TWEAK "0.8.1")
endif()
if(PACKAGE_FIND_VERSION MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)\\.") # strip the tweak version
set(REQUESTED_VERSION_NO_TWEAK "${CMAKE_MATCH_1}")
else()
set(REQUESTED_VERSION_NO_TWEAK "${PACKAGE_FIND_VERSION}")
endif()
if(REQUESTED_VERSION_NO_TWEAK STREQUAL CVF_VERSION_NO_TWEAK)
set(PACKAGE_VERSION_COMPATIBLE TRUE)
else()
set(PACKAGE_VERSION_COMPATIBLE FALSE)
endif()
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()
# if the installed project requested no architecture check, don't perform the check
if("FALSE")
return()
endif()
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "")
return()
endif()
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8")
math(EXPR installedBits "8 * 8")
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
endif()
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -95,7 +95,7 @@ mac{
# make it universal # make it universal
CONFIG += x86 CONFIG += x86
CONFIG += ppc CONFIG += ppc
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7 QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.3
# workaround for problems with boost_filesystem exceptions # workaround for problems with boost_filesystem exceptions
QMAKE_LFLAGS += -no_dead_strip_inits_and_terms QMAKE_LFLAGS += -no_dead_strip_inits_and_terms