diff --git a/README.md b/README.md new file mode 100644 index 00000000..3502fd8a --- /dev/null +++ b/README.md @@ -0,0 +1,46 @@ +# Cockatrice + +Cockatrice is an open-source multiplatform software for playing card games, +such as Magic: The Gathering, over a network. It is fully client-server based +to prevent any kind of cheating, though it supports single-player games without +a network interface as well. Both client and server are written in Qt 4. + +# License + +Cockatrice is free software, licensed under the GPLv2; see COPYING for details. + +# Building + +Dependencies: + +- [Qt](http://qt-project.org/) + +- [protobuf](http://code.google.com/p/protobuf/) + +- [CMake](http://www.cmake.org/) + +The server requires an additional dependency: + +- [libgcrypt](http://www.gnu.org/software/libgcrypt/) + +``` +mkdir build +cd build +cmake .. +make +make install +``` + +The following flags can be passed to `cmake`: + +- `-DWITH_SERVER=1` build the server + +- `-DWITHOUT_CLIENT=1` do not build the client + +# Running + +`oracle` fetches card data + +`cockatrice` is the game client + +`servatrice` is the server diff --git a/cockatrice/CMakeLists.txt b/cockatrice/CMakeLists.txt index be989d73..70de75a5 100644 --- a/cockatrice/CMakeLists.txt +++ b/cockatrice/CMakeLists.txt @@ -222,7 +222,11 @@ INCLUDE_DIRECTORIES(${QT_MOBILITY_MULTIMEDIAKIT_INCLUDE_DIR}) ADD_EXECUTABLE(cockatrice WIN32 MACOSX_BUNDLE ${cockatrice_SOURCES} ${cockatrice_QM} ${cockatrice_RESOURCES_RCC} ${cockatrice_HEADERS_MOC}) TARGET_LINK_LIBRARIES(cockatrice cockatrice_common ${QT_LIBRARIES} ${QT_MOBILITY_MULTIMEDIAKIT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) -INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/cockatrice DESTINATION bin) +IF (NOT APPLE) + INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/cockatrice DESTINATION bin) +ELSE (APPLE) + INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/cockatrice.app DESTINATION bin) +ENDIF (NOT APPLE) if (NOT WIN32 AND NOT APPLE) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/cockatrice.png DESTINATION ${ICONDIR}/hicolor/48x48/apps) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/cockatrice.svg DESTINATION ${ICONDIR}/hicolor/scalable/apps) diff --git a/cockatrice/src/carddatabasemodel.cpp b/cockatrice/src/carddatabasemodel.cpp index 67b8404e..d63f6bde 100644 --- a/cockatrice/src/carddatabasemodel.cpp +++ b/cockatrice/src/carddatabasemodel.cpp @@ -117,7 +117,7 @@ bool CardDatabaseDisplayModel::filterAcceptsRow(int sourceRow, const QModelIndex { CardInfo const *info = static_cast(sourceModel())->getCard(sourceRow); - if (((isToken == ShowTrue) && !info->getIsToken()) || (isToken == ShowFalse) && info->getIsToken()) + if (((isToken == ShowTrue) && !info->getIsToken()) || ((isToken == ShowFalse) && info->getIsToken())) return false; if (!cardNameBeginning.isEmpty()) diff --git a/oracle/CMakeLists.txt b/oracle/CMakeLists.txt index 9f51a16f..41338903 100644 --- a/oracle/CMakeLists.txt +++ b/oracle/CMakeLists.txt @@ -22,7 +22,11 @@ INCLUDE_DIRECTORIES(../cockatrice/src) ADD_EXECUTABLE(oracle WIN32 MACOSX_BUNDLE ${oracle_SOURCES} ${oracle_HEADERS_MOC}) TARGET_LINK_LIBRARIES(oracle ${QT_LIBRARIES}) -INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/oracle DESTINATION bin) +IF (NOT APPLE) + INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/oracle DESTINATION bin) +ELSE (APPLE) + INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/oracle.app DESTINATION bin) +ENDIF (NOT APPLE) IF (NOT WIN32 AND NOT APPLE) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/oracle.desktop DESTINATION ${DESKTOPDIR}) ENDIF (NOT WIN32 AND NOT APPLE)