GithubHelp home page GithubHelp logo

cockatrice / cockatrice Goto Github PK

View Code? Open in Web Editor NEW
1.5K 73.0 426.0 50.25 MB

A cross-platform virtual tabletop for multiplayer card games

Home Page: https://cockatrice.github.io

License: GNU General Public License v2.0

CMake 2.20% C++ 83.84% C 1.20% Shell 1.16% Python 0.05% HTML 0.06% CSS 0.70% Dockerfile 0.18% TypeScript 10.45% JavaScript 0.15%
card-games magic-the-gathering tabletop-gaming cockatrice c-plus-plus transifex hacktoberfest

cockatrice's Introduction


Cockatrice | Download | Get Involved | Community | Translations | Build | Run | License



To get started, ⇢ view our webpage
To get support or suggest changes ⇢ file an issue (How?) To help with development, see how to get involved

Cockatrice

Cockatrice is an open-source, multiplatform program for playing tabletop card games over a network. The program's server design prevents users from manipulating the game for unfair advantage. The client also provides a single-player mode, which allows users to brew while offline. This project uses C++ and the Qt5 libraries.

Download Cockatrice Eternal Download Count

Downloads are available for full releases and the current beta version in development. There is no strict release schedule for either of them.

  • Latest stable release: Download from GitHub Releases DL Count on Latest Release

    • Stable versions are checkpoints featuring major feature and UI enhancements.
    • Recommended for most users!
  • Latest beta release: Download from GitHub Pre-Releases DL Count on Latest Pre-Release

    • Beta versions include the most recently added features and bugfixes, but can be unstable.
    • To be a Cockatrice Beta Tester, use this version. Find more information here!

Get Involved Discord

Join our Discord community to connect with the project or fellow users of the app. The Cockatrice developers are also available on Gitter. Come here to talk about the application, features, or just to hang out.
For support regarding specific servers, please contact that server's admin or forum for support rather than asking here.

To contribute code to the project, please review the guidelines. We maintain two tags for contributors to find issues to work on:

  • Good first issue: issues tagged in this way provide a simple way to get started. They don't require much experience to be worked on.
  • Help wanted: This tag is used for issues that we are looking for a contributor to work on. Often this is for feature suggestions we are willing to accept, but don't have the time to work on ourselves.

For both tags, we're willing to provide help to contributors in showing them where and how they can make changes, as well as code review for changes they submit.

We try to be responsive to new issues. We'll provide advice on how best to implement a feature; alternately, we can show you where the codebase is doing something similar before you get too far along.

Cockatrice uses the Google Developer Documentation Style Guide to ensure consistent documentation. We encourage you to improve the documentation by suggesting edits based on this guide.

Community Resources

Translations Transifex Project

Cockatrice uses Transifex for translations. You can help us bring Cockatrice, Oracle and Webatrice to your language or just adjust single wordings right from within your browser by visiting our Transifex project page.

Check out our Translator FAQ for more information about contributing!

Build CI Desktop CI Web

Detailed compiling instructions can be found on the Cockatrice wiki under Compiling Cockatrice

Dependencies: (for minimum requirements search our CMake file)

Oracle can optionally use zlib and xz to load compressed files:

To compile:

mkdir build
cd build
cmake ..
make

You can then run

make install

to get a cockatrice installation inside the release folder, or:

make package

to create a system-specific installation package.

The following flags can be passed to cmake:

  • -DWITH_SERVER=1 Whether to build the server (default 0 = no).
  • -DWITH_CLIENT=0 Whether to build the client (default 1 = yes).
  • -DWITH_ORACLE=0 Whether to build oracle (default 1 = yes).
  • -DCMAKE_BUILD_TYPE=Debug Compile in debug mode. Enables extra logging output, debug symbols, and much more verbose compiler warnings (default Release).
  • -DWARNING_AS_ERROR=0 Whether to treat compilation warnings as errors in debug mode (default 1 = yes).
  • -DUPDATE_TRANSLATIONS=1 Configure make to update the translation .ts files for new strings in the source code. Note: Running make clean will remove the .ts files (default 0 = no).
  • -DTEST=1 Enable regression tests (default 0 = no). Note: needs googletest, will be downloaded on the fly if unavailable. To run tests: make test.
  • -DFORCE_USE_QT5=1 Skip looking for Qt6 before trying to find Qt5

Run

Cockatrice is the game client
Oracle fetches card data
Servatrice is the server

Servatrice Docker container

You can run an instance of Servatrice (the Cockatrice server) using Docker and the Cockatrice Dockerfile.

First, create an image from the Dockerfile
cd /path/to/Cockatrice-Repo/ docker build -t servatrice .
And then run it
docker run -i -p 4747:4747/tcp -t servatrice:latest

Note: Running this command exposes the TCP port 4747 of the docker container
to permit connections to the server.

Find more information on how to use Servatrice with Docker in our wiki.

Docker compose

There is also a docker-compose file available which will configure and run both a MySQL server and Servatrice. The docker-compose setup scripts can be found in the servatrice/docker folder and vary only slightly from the default sql and server .ini files. The setup scripts can either be modified in place, or docker-compose can mount alternative files into the images, as you prefer.

To run Servatrice via docker-compose, first install docker-compose following the install instructions. Once installed, run the following from the root of the repository:

docker-compose build    # Build the Servatrice image using the same Dockerfile as above.
docker-compose up       # Setup and run both the MySQL server and Servatrice.

Note: Similar to the above Docker setup, this will expose TCP ports 4747 and 4748.

Note: The first time running the docker-compose setup, the MySQL server will take a little time to run the initial setup scripts. Due to this, the Servatrice instance may fail the first few attempts to connect to the database. Servatrice is set to restart: always in the docker-compose.yml, which will allow it to continue attempting to start up. Once the MySQL scripts have completed, Servatrice should then connect automatically on the next attempt.

Docker compose in Windows A out of box working docker-compose file has been added to help setup in Windows.

Docker in Windows requires additional steps in form of using Docker Desktop to allow resource sharing from the drive the volumes are mapped from, as well as potential workarounds needed to get file sharing working in Windows. This StackOverflow discussion sheds some light on it

License GPLv2 License

Cockatrice is free software, licensed under the GPLv2.

cockatrice's People

Contributors

arxanas avatar basicer avatar ctrlaltca avatar daenyth avatar dependabot[bot] avatar dev-id avatar ebbit1q avatar elarnon avatar fizztastic avatar github-actions[bot] avatar imaspen avatar jaeiclee avatar jjcard avatar kaiserfro avatar knitknit avatar marcofernandezheras avatar mattkelly avatar mbruker avatar mitchellwrosen avatar pliu avatar poixen avatar psithief avatar seavor avatar skwerlman avatar slightlycircuitous avatar tooomm avatar transifex-integration[bot] avatar vafthrudnir avatar woogerboy21 avatar zeldazach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cockatrice's Issues

Log File / Memory Usage

As the server runs it appears that whatever is logged in the log file gets consumed into memory. I am not certain if this is the expected behavior but in doing so after pro-longed periods of time the server ends up crashing due to resource exhaustion. I've managed to get around the problem by backing up and clearing the logs on a scheduled bases while the server is running but it would be nice to see the issue resolved permanently with out having to band-aid a solution in place.

New Deck Editor needs UI Polish

  • Card movement icons need improvement (keycodes listed, better icons)
  • The color filter needs the user to enter "g" for "green", etc. It should handle the color words
  • Case handling might not be consistent
  • Hitting - on a filter doesn't remove it
  • Oracle text can't be viewed at the same time as image, and the toggle between is hidden in the menu
  • There's no "clear all" button for filters except hidden in the menu
  • cardname filter box is anchored to beginning of name instead of anywhere in name
  • Deck editor needs to do natural sort. Diacritics should come after their unmodified form. Eg should come after Jo and before Jw

OS X Mavericks Compile Issue

I tried building the app and it fail when linking Oracle. It is fixed by removing the -s from set(CMAKE_CXX_FLAGS_RELEASE "-s -O2"). I don't know if this is only a thing with Mavericks or if it's an OS X thing but removing this -s lets it finish with a working product.

Very large decks make cockatrice hang up/crash

Hi,
I had written a small script to create a COD-deck including one of every card ever printed (plus a lot of basic lands) to play a casual fun game with it. Unfortunately, upon loading this deck in a lobby, cockatrice hung up for several minutes - then, after it had finished loading, when you started the game, cockatrice stopped responding altogether. This is quite a nuisance, since when you reconnect to the server, cockatrice will try to resume the ongoing game, thereby loading the deck and crashing again.

Steps to reproduce:

Create github website

github allows you to create a website for each project (http://pages.github.com/) and as there is still much confusion about where the cockatrice page is now, I suggest that such a site is created here.
It doesn't need to provide binaries if you don't want, but the page should contain information about the development, where public servers are and where to get/how to build binaries, because people use those pesky hosting services for two year old binaries.

Use CPack from CMake to create installers

CMake has the ability to create installers for several systems (Windows, OS X, rpm, deb, archives, ...), see the CMake tutorial step 6 [1], packaging with CPack [2] and the available generators [3].

This can supersede the self written NSIS installer file for Windows (though NSIS will still be used from CPack) and mute the question how to create a MacOS X package correcty.

[1] http://www.cmake.org/cmake/help/cmake_tutorial.html#s6
[2] http://www.cmake.org/Wiki/CMake:Packaging_With_CPack
[3] http://www.cmake.org/Wiki/CMake:CPackPackageGenerators

Compiler Warnings

I gathered the compiler warnings produced by clang on FreeBSD 10. They could indicate problems, so it's best to get rid of them.

In file included from Cockatrice/common/sfmt/SFMT.c:16:
Cockatrice/common/sfmt/SFMT-params.h:6:4: warning: "MEXP is not
defined. I assume MEXP is 19937." [-W#warnings]
#warning "MEXP is not defined. I assume MEXP is 19937."
^

Cockatrice/cockatrice/src/abstractclient.cpp:72:12: warning:
enumeration value 'SessionEvent_SessionEventType_SERVER_COMPLETE_LIST' not
handled in switch [-Wswitch]
switch ((SessionEvent::SessionEventType) getPbEx...
^

Cockatrice/cockatrice/src/player.cpp:1517:66: warning: '&&'
within '||' [-Wlogical-op-parentheses](settingsCache->getPlayToStack%28%29 && ci->getTableRow%28%29 != 0) &&
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
Cockatrice/cockatrice/src/player.cpp:1517:66: note: place
parentheses around the '&&' expression to silence this warning
(settingsCache->getPlayToStack() && ci->getTableRow() != 0) &&
^
Cockatrice/cockatrice/src/player.cpp:1728:12: warning: 4
enumeration values not handled in switch: 'cmMoveToTopLibrary',
'cmMoveToBottomLibrary', 'cmMoveToGraveyard'... [-Wswitch]
switch (static_cast(a->data(...
^

Cockatrice/cockatrice/src/cardzone.cpp:127:11: warning:
enumeration values 'CaseTopCardsOfZone', 'CaseRevealZone', and
'CaseShuffleZone' not handled in switch [-Wswitch]
switch (gc) {
^

/usr/local/include/gcrypt.h:1353:2: warning: 'gcry_ac_data_read_cb_t' is
deprecated [-Wdeprecated-declarations]
gcry_ac_data_read_cb_t cb;
^
/usr/local/include/gcrypt.h:1318:23: note: 'gcry_ac_data_read_cb_t' declared
here
typedef gpg_error_t (_gcry_ac_data_read_cb_t) (void *opaque,
^
/usr/local/include/gcrypt.h:1367:2: warning: 'gcry_ac_data_write_cb_t' is
deprecated [-Wdeprecated-declarations]
gcry_ac_data_write_cb_t cb;
^
/usr/local/include/gcrypt.h:1323:23: note: 'gcry_ac_data_write_cb_t' declared
here
typedef gpg_error_t (_gcry_ac_data_write_cb_t) (void *opaque,
^
/usr/local/include/gcrypt.h:1402:3: warning: 'gcry_md_algo_t' is deprecated
[-Wdeprecated-declarations]
gcry_md_algo_t md;
^
/usr/local/include/gcrypt.h:1396:28: note: 'gcry_md_algo_t' declared here
typedef enum gcry_md_algos gcry_md_algo_t _GCRY_ATTR_INTERNAL;
^
/usr/local/include/gcrypt.h:1410:3: warning: 'gcry_md_algo_t' is deprecated
[-Wdeprecated-declarations]
gcry_md_algo_t md;
^
/usr/local/include/gcrypt.h:1396:28: note: 'gcry_md_algo_t' declared here
typedef enum gcry_md_algos gcry_md_algo_t _GCRY_ATTR_INTERNAL;
^

MinGW

It seems there is hope for MinGW fans:

While digging around I found out that Qt 5.3.0 for Windows 32-bit (MinGW 4.8.2, OpenGL, 734 MB) includes the MinGW 4.8.2 buildchain and they write:

The MinGW binary package includes a 32 bit MinGW-builds (gcc 4.8.2, dwarf exception handing, posix threading) toolchain. Sources are available from the MinGW-builds project [...].

So actually the Qt project doesn't use MinGW itself (we know why: it sucks) but static builds from the MinGW-builds project.
MinGW(-build) 4.8.2 is the current testing release and it is also required for the Qt4 MinGW edition.
This means that Cockatrice should compile with this MinGW package: http://sourceforge.net/projects/mingwbuilds/files/host-windows/testing/4.8.2/32-bit/threads-posix/dwarf/x32-4.8.2-prerelease-20130717-rev200927-posix-dwarf.7z/download

If someone tells me that this works (see Usermanual f042b80), I can add a Windows+MinGW section to the usermanual.

From my experience with MinGW and Visual Studio I'd still suggest to use Visual Studio to build Cockatrice, because it is actually easier to use (no command typing) and creates smaller binaries without the additional library overhead (libstdc++-6.dll, libgcc_s_dw2-1.dll, mingwm10.dll).

Ubuntu crash if closing game window with opponent's hand revealed.

I crash if I close a game window with the opponent's hand revealed.

Here's what I get with a debug build:

GameScene::removePlayer
CardZone destructor:  "deck" 
CardZone destructor:  "grave" 
CardZone destructor:  "hand" 
CardZone destructor:  "rfg" 
CardZone destructor:  "sb" 
CardZone destructor:  "stack" 
CardZone destructor:  "table" 
Player destructor: "muttuser" 
GameScene::removePlayer
CardZone destructor:  "deck" 
CardZone destructor:  "grave" 
CardZone destructor:  "hand" 
CardZone destructor:  "rfg" 
CardZone destructor:  "sb" 
CardZone destructor:  "stack" 
CardZone destructor:  "table" 
ZoneViewZone destructor
CardZone destructor:  "hand" 
*** Error in `/home/callahan/cockatrice-new/Cockatrice/build/cockatrice/./cockatrice': corrupted double-linked list: 0x00000000036cc350 ***
#0  0x00007ffff5347c2b in malloc_consolidate (av=av@entry=0x7ffff5689740 <main_arena>) at malloc.c:4094
#1  0x00007ffff53487e8 in _int_free (av=0x7ffff5689740 <main_arena>, p=0x3c3ed80, have_lock=0) at malloc.c:3994
#2  0x00007ffff769957c in QGraphicsViewPrivate::~QGraphicsViewPrivate() () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#3  0x00007ffff683b8e5 in QObject::~QObject() () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#4  0x00007ffff70e6bcc in QWidget::~QWidget() () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#5  0x00007ffff7690f65 in QGraphicsView::~QGraphicsView() () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#6  0x000000000067d699 in GameView::~GameView (this=0x3b74950, __in_chrg=<optimized out>)
    at /home/linuxguy/cockatrice-new/Cockatrice/build/cockatrice/src/../../../cockatrice/src/gameview.h:8
#7  0x000000000067d6d2 in GameView::~GameView (this=0x3b74950, __in_chrg=<optimized out>)
    at /home/linuxguy/cockatrice-new/Cockatrice/build/cockatrice/src/../../../cockatrice/src/gameview.h:8
#8  0x00007ffff6839308 in QObjectPrivate::deleteChildren() () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#9  0x00007ffff70e6b37 in QWidget::~QWidget() () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#10 0x000000000062ab90 in Tab::~Tab (this=0x3b73a20, __in_chrg=<optimized out>)
    at /home/linuxguy/cockatrice-new/Cockatrice/cockatrice/src/tab.h:10
#11 0x0000000000632d52 in TabGame::~TabGame (this=0x3b73a20, __in_chrg=<optimized out>)
    at /home/linuxguy/cockatrice-new/Cockatrice/cockatrice/src/tab_game.cpp:509
#12 0x0000000000632eaa in TabGame::~TabGame (this=0x3b73a20, __in_chrg=<optimized out>)
    at /home/linuxguy/cockatrice-new/Cockatrice/cockatrice/src/tab_game.cpp:522
#13 0x00007ffff683ae08 in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#14 0x00007ffff70ea36b in QWidget::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#15 0x00007ffff709adfc in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#16 0x00007ffff70a1470 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#17 0x00007ffff68228bd in QCoreApplication::notifyInternal(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#18 0x00007ffff6825e1f in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#19 0x00007ffff6850073 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#20 0x00007ffff49a23b6 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#21 0x00007ffff49a2708 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#22 0x00007ffff49a27ac in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#23 0x00007ffff684fa55 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#24 0x00007ffff713c9d6 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#25 0x00007ffff68215ef in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#26 0x00007ffff68218e5 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#27 0x00007ffff6826e5b in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#28 0x00000000005acac8 in main (argc=1, argv=0x7fffffffdee8)
    at /home/linuxguy/cockatrice-new/Cockatrice/cockatrice/src/main.cpp:161

Interestingly the following patch fixes me. However I am not sure it is sufficient or why it is necessary:

diff --git a/cockatrice/src/gamescene.cpp b/cockatrice/src/gamescene.cpp
index ce083c7..da665a5 100644
--- a/cockatrice/src/gamescene.cpp
+++ b/cockatrice/src/gamescene.cpp
@@ -24,6 +24,7 @@ GameScene::GameScene(PhasesToolbar *_phasesToolbar, QObject *parent)

 GameScene::~GameScene()
 {
+       clearViews();
        delete animationTimer;
 }

Conversion of old XML style decks to new Text Format

I just rebuilt to the 92ff503 release, and realized zero of my decks actually load anymore because of the change in .cod formats.

I figured if I'm going to make a script to fix them all, if there would be any need to implement a pre-load conversion for old .cod files, and if so, the best way to handle it?

Suggestion : Card editor

Hi, I have a little suggestion that would come in in handy for many users. Have an actual GUI editor for editing card data, as well as do partial import/export of cards.xml. This will allow people to both add sets of newly-released "official" cards (not yet on gatherer) as well as create custom sets. People should not have to dig through XML in order to edit cards.

Compile Issue's/Warnings (06/17/2014)

Ran into this while compiling the source:

/Cockatrice/cockatrice/src/phasestoolbar.h:38: Warning: Class PhaseButton implements the interface QGraphicsItem but does not list it in Q_INTERFACES. qobject_cast to QGraphicsItem will not work!
/Cockatrice/cockatrice/src/phasestoolbar.h:69: Warning: Class PhasesToolbar implements the interface QGraphicsItem but does not list it in Q_INTERFACES. qobject_cast to QGraphicsItem will not work!
/Cockatrice/cockatrice/src/player.h:75: Warning: Class PlayerArea implements the interface QGraphicsItem but does not list it in Q_INTERFACES. qobject_cast to QGraphics Item will not work!
/Cockatrice/cockatrice/src/player.h:300: Warning: Class Player implements the interface QGraphicsItem but does not list it in Q_INTERFACES. qobject_cast to QGraphicsItem will not work!
/Cockatrice/cockatrice/src/zoneviewzone.h:48: Warning: Class ZoneViewZone implements the interface QGraphicsLayoutItem but does not list it in Q_INTERFACES. qobject_cast to QGraphicsLayoutItem will not work!

Servatrice password hashing

I propose to remove password hashing from the code and use crypto functions instead to store passwords.

Also, the salting procedure looks suspicious, because salts have to be random strings and they shouldn't be too small but the PasswordHasher uses the 16 first characters from the password as salt? Whatever the user uses, it is propably not random.
So this is insecure.

And why is this in PasswordHasher::computeHash()?
const int rounds = 1000;
char hash[hashLen], tmp[hashLen];
for (int i = 1; i < rounds; ++i) {
memcpy(tmp, hash, hashLen);
gcry_md_hash_buffer(algo, hash, tmp, hashLen);
}
-> memcpy copies the value from hash to tmp, then the digest is created and overwrites the old one... thousand times all over again?
This won't make it more secure or more random, use a cipher like Blowfish instead and replace this code.
For Qt there is the QCA library: http://delta.affinix.com/docs/qca/ so you can replace libgcrypt easily - and you don't need to convert QStrings to char arrays anymore.
There is a QCA tutorial: http://www.essentialunix.org/index.php?option=com_content&view=article&id=48:qcatutorial&catid=34:qttutorials&Itemid=53

Build instructions for OS X

If you want to build Cocaktrice on OS X and you use homebrew to install dependencies, protobuf needs to be installed with --c++11 --universal.
If not, make will fail with

Undefined symbols for architecture x86_64:"google::protobuf ...

Additional Banning Functionality

I'm opening this issue in response to a request by Gavin. Currently the banning functionality of with in the server side is very easy to circumvent by toxic users. The current methods of banning include by username or by IP. With out the ability to restrict the server to registered users only name banning is not possible and so IP banning must be used. Sadly the problematic users can circumvent this ban by using proxy servers or simply resetting there modems. Since the majority of users external IP address's are given to them by DHCP it is very easy for a user to change there IP address. So what happens is you end up banning a bunch of IP's or usernames and the problematic user simply goes through a proxy, registers a new user name, or even worse yet simply logs in as an unregistered user.

My suggestion was to add an additional banning function to the server / client. The thought I had would be that each client would generate a client id upon every startup of the application or possibly on every attempt to connect to a server. This client id would need to be generated from a non-changing hardware specific device. The MAC address of the computer that is being used to connect to the server is a good example (probably the real only example I can come up with). Once there is a unique client id per client the server then would need the ability to ban the client by that identifier. With this type of system in place it would prevent the current known methods of ban evasion.

Any other thoughts on how to prevent ban evasion? Simply allowing only registered users would be a great leap in security at the very least. At least having that ability would put some type of hurdle in place to prevent such simple ban evasions.

Servatrice user active/inactive account functionality oddity

When an account is created in the user database for a user to log in. If the account is set to "active = 0" (effectively inactive). The user is still able to actually log into the server. When the account is inactive, the user still needs to know the password to authenticate to the account but when logged in the account shows as "unregistered". I would expect the behavior to be that if the account is registered and the account is set to inactive that the account not be able to be logged in or used.

Move card menu does not work in 2 player local game

In version 92ff503 of cockatrice on Windows 7 64bit the "Move" context menu does not seem to work on any cards that belong to the non-active player.

For example, scrying when it is not your turn you cannot move cards to the bottom of your library.

Turn Counter

Hello to the great cockatrice community...
I would like to suggest to add a simple turn counter on the left or right side of the screen.

Regards,

Client not displaying HQ image?

It appears that though the oracle tool can include alternate URL's for things such as high quality images (picURLHq) that the client itself only is displaying the picURL path or possibly the ordering in which the URLs listed in the sets.xml is being incorrectly processed. I would think that if there is an "HQ" image url path available that the high quality image be downloaded and presented before any lower quality image.

Derp. It was a mistake on my part. It works as expected.

Invisible rooms

When hosting drafts/normal games, people often tend to just leave the room open for countless hours, letting people join, just to discover that theyve joined a waste of space.

A partial solution to that would be to have a box the creator can tick, which prevents people from joining and hides the room from the Chat Room. And prefferably have it automaticly tick itself once the room is filled up.

Invalid card database UX is unusably bad

5 things to improve.

on cockatrice start, settings dialog pops up (1, no indication why), then when I click ok it gives an error (2) that just says the path is wrong rather than db out of date (3) and if I don't go change the path it just closes trice (4) and doesn't offer the chance to launch oracle (5)

Multiserver Functionality

@Daenyth You by chance know anything about the multi-server functionality that appears to be built into the server side of cockatrice? Is it even functional and how it could/would be used?

If its not, what would it take to get it working? I would like to have a NA and EU server communicate its user database. I can do so on a scheduled type bases (like nightly) using various OS level type tricks but having the users be able to register an account and immediately use it on the opposing server would be great.

Decks saved then stored online don't load

Issue:When I save a deck then upload it to the storage it asks me to give it a name. When I upload it to storage and then go to use the stored deck the cards wont load.
Reproducing: It is extremely confusing on how to reproduce this. Its either caused by renaming the same save file to different names then saving as or its saving the deck when your connected to woogerworks server.
Until this is fixed can someone hook me up with the last version of cockatrice?
On Windows 8 x64.

Just tested this on my mac. Works fine. Sadly Windows is another story.

Servatrice issue

hi there
i hope that i can place my issue here

after installing Cockatrice/Servatrice on a Ubuntu Linux 12.04.4 server i start the server up. "/usr/local/bin/servatrice"
when i logged in with Cockatrice, i dont get a chatroom.
it looks like Servatrice dont use servatrice.ini file.
even when i remove the ini file it start up at 4747 and without a chatroom.
is this a bug . or what can i do to make it work.

Thanks

Linux compilation error

I'm sorry if this is a mistake on my part, but I've followed whatever instructions I can find, and in threads where people encounter this error they seem to give up or accept a solution that is not working on either my machine or a friend who is encountering the same error:

rob@lennyxubuntu:~/Cockatrice/build$ cmake ..
-- Using QtMobility version: system's default
Qt QTMULTIMEDIA library not found.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/rob/Cockatrice/build

qtmobility-dev is installed, I am using Xubuntu 13.10

Problems compiling new Cockatrice client on Mac OSX Mountain Lion

OS Mac OS X 10.8.5
Processor 2.66 GHz Intel Core 2 Duo
Memory 4 GB 1067 MHz DDR3
Graphics Nvidia GeForce 320M 256 MB
HDD 240 GB Crucial M500 SDD; ~142 GB free

When compiling using cockatrice_src_20140517_git-0…2004a.zip and Cockatrice-05172014_DEV.zip

Last login: Fri Jun 20 13:29:53 on ttys000
Joshua-Johnsons-MacBook-Pro:~ Josh$ cd Cockatrice
Joshua-Johnsons-MacBook-Pro:Cockatrice Josh$ cmake Cockatrice
-- The C compiler identification is Clang 5.1.0
-- The CXX compiler identification is Clang 5.1.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - not found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - found
-- Looking for QT_MAC_USE_COCOA
-- Looking for QT_MAC_USE_COCOA - found
-- Found Qt4: /usr/local/bin/qmake (found version "4.8.6") 
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE  
-- Found PROTOBUF: /usr/local/lib/libprotobuf.dylib  
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/Josh/Cockatrice
Joshua-Johnsons-MacBook-Pro:Cockatrice Josh$ make
[  1%] Generating Cockatrice/src/moc_pending_command.cxx
[  1%] Generating version_string.cpp, version_string.h
-- Found Git: /usr/bin/git (found version "1.8.5.2 (Apple Git-48)") 
[  1%] Generating cockatrice_de.qm
Updating '/Users/Josh/Cockatrice/cockatrice_de.qm'...
    Generated 791 translation(s) (791 finished and 0 unfinished)
[  2%] Generating cockatrice_en.qm
Updating '/Users/Josh/Cockatrice/cockatrice_en.qm'...
    Generated 9 translation(s) (7 finished and 2 unfinished)
    Ignored 782 untranslated source text(s)
[  2%] Generating cockatrice_es.qm
Updating '/Users/Josh/Cockatrice/cockatrice_es.qm'...
    Generated 791 translation(s) (791 finished and 0 unfinished)
[  2%] Generating cockatrice_it.qm
Updating '/Users/Josh/Cockatrice/cockatrice_it.qm'...
    Generated 791 translation(s) (791 finished and 0 unfinished)
[  3%] Generating cockatrice_ja.qm
Updating '/Users/Josh/Cockatrice/cockatrice_ja.qm'...
    Generated 659 translation(s) (578 finished and 81 unfinished)
    Ignored 132 untranslated source text(s)
[  3%] Generating cockatrice_pt.qm
Updating '/Users/Josh/Cockatrice/cockatrice_pt.qm'...
    Generated 791 translation(s) (791 finished and 0 unfinished)
[  4%] Generating cockatrice_sv.qm
Updating '/Users/Josh/Cockatrice/cockatrice_sv.qm'...
    Generated 791 translation(s) (791 finished and 0 unfinished)
[  4%] Generating qrc_cockatrice.cxx
[  4%] Generating Cockatrice/src/moc_abstractcounter.cxx
[  5%] Generating Cockatrice/src/moc_counter_general.cxx
[  5%] Generating Cockatrice/src/moc_dlg_creategame.cxx
[  6%] Generating Cockatrice/src/moc_dlg_filter_games.cxx
[  6%] Generating Cockatrice/src/moc_dlg_connect.cxx
[  6%] Generating Cockatrice/src/moc_dlg_create_token.cxx
[  7%] Generating Cockatrice/src/moc_dlg_edit_tokens.cxx
[  7%] Generating Cockatrice/src/moc_gamesmodel.cxx
[  8%] Generating Cockatrice/src/moc_abstractclient.cxx
[  8%] Generating Cockatrice/src/moc_remoteclient.cxx
[  8%] Generating Cockatrice/src/moc_window_main.cxx
[  9%] Generating Cockatrice/src/moc_cardzone.cxx
[  9%] Generating Cockatrice/src/moc_selectzone.cxx
[  9%] Generating Cockatrice/src/moc_player.cxx
[ 10%] Generating Cockatrice/src/moc_playertarget.cxx
[ 10%] Generating Cockatrice/src/moc_abstractcarditem.cxx
[ 11%] Generating Cockatrice/src/moc_carditem.cxx
[ 11%] Generating Cockatrice/src/moc_tablezone.cxx
[ 11%] Generating Cockatrice/src/moc_handzone.cxx
[ 12%] Generating Cockatrice/src/moc_handcounter.cxx
[ 12%] Generating Cockatrice/src/moc_carddatabase.cxx
[ 13%] Generating Cockatrice/src/moc_keysignals.cxx
[ 13%] Generating Cockatrice/src/moc_gameview.cxx
[ 13%] Generating Cockatrice/src/moc_gameselector.cxx
[ 14%] Generating Cockatrice/src/moc_decklistmodel.cxx
[ 14%] Generating Cockatrice/src/moc_deck_loader.cxx
[ 15%] Generating Cockatrice/src/moc_dlg_load_deck_from_clipboard.cxx
[ 15%] Generating Cockatrice/src/moc_dlg_load_remote_deck.cxx
[ 15%] Generating Cockatrice/src/moc_cardinfowidget.cxx
[ 16%] Generating Cockatrice/src/moc_cardframe.cxx
[ 16%] Generating Cockatrice/src/moc_cardinfopicture.cxx
[ 16%] Generating Cockatrice/src/moc_cardinfotext.cxx
[ 17%] Generating Cockatrice/src/moc_filterbuilder.cxx
[ 17%] Generating Cockatrice/src/moc_cardfilter.cxx
/Users/Josh/Cockatrice/Cockatrice/src/cardfilter.h:0: Note: No relevant classes found. No output generated.
[ 18%] Generating Cockatrice/src/moc_filtertreemodel.cxx
[ 18%] Generating Cockatrice/src/moc_filtertree.cxx
[ 18%] Generating Cockatrice/src/moc_messagelogwidget.cxx
[ 19%] Generating Cockatrice/src/moc_zoneviewzone.cxx
[ 19%] Generating Cockatrice/src/moc_zoneviewwidget.cxx
[ 20%] Generating Cockatrice/src/moc_pilezone.cxx
[ 20%] Generating Cockatrice/src/moc_stackzone.cxx
[ 20%] Generating Cockatrice/src/moc_carddragitem.cxx
[ 21%] Generating Cockatrice/src/moc_carddatabasemodel.cxx
[ 21%] Generating Cockatrice/src/moc_setsmodel.cxx
[ 22%] Generating Cockatrice/src/moc_window_sets.cxx
[ 22%] Generating Cockatrice/src/moc_abstractgraphicsitem.cxx
[ 22%] Generating Cockatrice/src/moc_abstractcarddragitem.cxx
[ 23%] Generating Cockatrice/src/moc_dlg_settings.cxx
[ 23%] Generating Cockatrice/src/moc_dlg_cardsearch.cxx
[ 23%] Generating Cockatrice/src/moc_phasestoolbar.cxx
[ 24%] Generating Cockatrice/src/moc_gamescene.cxx
[ 24%] Generating Cockatrice/src/moc_arrowitem.cxx
[ 25%] Generating Cockatrice/src/moc_arrowtarget.cxx
[ 25%] Generating Cockatrice/src/moc_tab.cxx
[ 25%] Generating Cockatrice/src/moc_tab_server.cxx
[ 26%] Generating Cockatrice/src/moc_tab_room.cxx
[ 26%] Generating Cockatrice/src/moc_tab_message.cxx
[ 27%] Generating Cockatrice/src/moc_tab_game.cxx
[ 27%] Generating Cockatrice/src/moc_tab_deck_storage.cxx
[ 27%] Generating Cockatrice/src/moc_tab_replays.cxx
[ 28%] Generating Cockatrice/src/moc_tab_supervisor.cxx
[ 28%] Generating Cockatrice/src/moc_tab_admin.cxx
[ 29%] Generating Cockatrice/src/moc_tab_userlists.cxx
[ 29%] Generating Cockatrice/src/moc_tab_deck_editor.cxx
[ 29%] Generating Cockatrice/src/moc_replay_timeline_widget.cxx
[ 30%] Generating Cockatrice/src/moc_deckstats_interface.cxx
[ 30%] Generating Cockatrice/src/moc_chatview.cxx
[ 30%] Generating Cockatrice/src/moc_userlist.cxx
[ 31%] Generating Cockatrice/src/moc_userinfobox.cxx
[ 31%] Generating Cockatrice/src/moc_user_context_menu.cxx
[ 32%] Generating Cockatrice/src/moc_remotedecklist_treewidget.cxx
[ 32%] Generating Cockatrice/src/moc_remotereplaylist_treewidget.cxx
[ 32%] Generating Cockatrice/src/moc_deckview.cxx
[ 33%] Generating Cockatrice/src/moc_playerlistwidget.cxx
[ 33%] Generating Cockatrice/src/moc_settingscache.cxx
[ 34%] Generating Cockatrice/src/moc_localserver.cxx
[ 34%] Generating Cockatrice/src/moc_localserverinterface.cxx
[ 34%] Generating Cockatrice/src/moc_localclient.cxx
[ 35%] Generating Cockatrice/src/moc_priceupdater.cxx
[ 35%] Generating Cockatrice/src/moc_soundengine.cxx
Scanning dependencies of target cockatrice
[ 35%] Building CXX object CMakeFiles/cockatrice.dir/src/abstractcounter.cpp.o
In file included from /Users/Josh/Cockatrice/Cockatrice/src/abstractcounter.cpp:2:
/Users/Josh/Cockatrice/Cockatrice/src/player.h:8:10: fatal error: 
      'pb/game_event.pb.h' file not found
#include "pb/game_event.pb.h"
         ^
1 error generated.
make[2]: *** [CMakeFiles/cockatrice.dir/src/abstractcounter.cpp.o] Error 1
make[1]: *** [CMakeFiles/cockatrice.dir/all] Error 2
make: *** [all] Error 2

When compiling with https://github.com/Daenyth/Cockatrice/archive/master.zip

Last login: Sat Jun 21 10:53:51 on ttys000
Joshua-Johnsons-MacBook-Pro:~ Josh$ cd Cockatrice
Joshua-Johnsons-MacBook-Pro:Cockatrice Josh$ cmake Cockatrice
-- The C compiler identification is Clang 5.1.0
-- The CXX compiler identification is Clang 5.1.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at CMakeLists.txt:129 (FIND_PACKAGE):
  By not providing "FindQtMobility.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "QtMobility", but CMake did not find one.

  Could not find a package configuration file provided by "QtMobility" with
  any of the following names:

    QtMobilityConfig.cmake
    qtmobility-config.cmake

  Add the installation prefix of "QtMobility" to CMAKE_PREFIX_PATH or set
  "QtMobility_DIR" to a directory containing one of the above files.  If
  "QtMobility" provides a separate development package or SDK, be sure it has
  been installed.


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 2.8)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!
See also "/Users/Josh/Cockatrice/CMakeFiles/CMakeOutput.log".

@Daenyth

Suggestion: Card description hinting

Often when we play a game with unreleased cards we have the issue that the opponent does not see those cards if he/she did not update its cards.xml, requiring you to explain to him/her in the chat and/or have him/her search the spoiler list. A solution to this would be to have the client without the new cards to request the card information (which includes image url, p/t, cost, loyalty, etc.) of unknown cards that the opponent put in a visible zone to the opponent's client. As soon as that client sees an unknown card created by a player (or anytime afterwards), the client in question sends a request to the other party (potentially through the server). If the opponent has indeed put this card in a visible zone during the game (to avoid allowing fishing for information by a rogue client), if the opponent has checked an appropriate option in his/her settings (to avoid leaking information by default) and if the opponent has not been sollicited for this particular card name more than N times during this game (to avoid denial-of-service), then the information for this card will be sent to the requesting client, which will display it with a yellow (or other color) border, to indicate that the information for this card was sent by another player (and warn the player that the info should not be trusted in absolute as being the valid info for this card).

Replace default sound effects

Hello Cockatrice Devs,

I was wondering how to replace the default sound effects. Is this documented anywhere? I was unable to find anything doing google and github searches. I tried renaming .wav files to .raw but that doesn't seem to work.

Any chance to incorporate this sound pack as an additional option:
http://opengameart.org/content/card-game-sounds

Thanks!

Oracle import: Flip cards

Flip cards are incorrectly imported if the flipped counterpart comes before the regular one alphabetically.
As such, the flipped rules text is not added to the regular card, rather, the regular card gets the rules text (and p/t) of the flip side.

I suggest storing flipped versions (the ones with brackets) in memory if the flipped version is encountered and their regular counterpart has not yet been encountered. Once the regular is encountered, it can be created and the flipped version's text can be added to it.

Imo, the import should also create a separate instance of the flipped version of the card, so that a token can be created using the secondary card name, which would have flipped art, making it more easily readable by those who prefer to read the card art instead of text boxes.

Also, because of the way flip cards are currently handled, the un-set Erase is not being imported correctly (because it thinks it's a flip card). The un-set text is added to the regular Erase's text.
(Not sure how to correct this, though)

B.F.M. also loses its bracketed text due to being treated like a flip card.

AErathi Berserker is another card which has problems being imported due to the way it's being handled. In the text spoiler, It uses the misprinted name as the name with the corrected oracle name between brackets.

If a card with brackets is encountered, and there is no card found which refers to what's between those brackets, it should add the card with the brackets as a regular card (at the end of that set's import). This would fix BFM, but not erase, nor the berserker... (which would become 'rathi Berserker (AErathi Berserker)')

Those would need to be handled as exceptions.

OS X App Bundle

This is mostly a quality-of-life issue.

Currently, the OS X app grossly violates the OS X Bundle Programming Guidelines.

While I personally doubt that this is causing issues (though I did see a crash log relating to the relative path of frameworks), Cmake should make this a pretty easy thing to fix–by generating an Xcode project.

Decks not being opened

Having an issue with the newest version not loading decks. When loaded from the Deck Editor, the dialogue dissapears, but no deck is loaded. When trying to load from a game the error "The selected file could not be loaded." is shown.

Stacks, Command zones

Have a shared stack for everyone, spells actually... stacking on it. The personal stacks have one use that im avare of and that is command zones. Removing them would beg for an alternate command zone, ideally something similar to what you see when checking your sideboard in-game, but visible to all players(and minimizable).

PS: #100, woot?

Permit specific unicode ranges in usernames

Unicode in usernames is currently prevented due to the ease of impersonation with lookalike characters.

It would be better to block generally but whitelist safe ranges (for example, asian languages)

Multiplayer boards

When using "multi-column layout" theres an awful lot of unused black space on the sides(top, bottom), itd be great to have the whole screen divided evenly(at least in 4p, which is the most common MP choice). In the normal layout the cards get tiny incredibly quickly. And my screen size is rather large.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.