Commit db43a060 authored by Daenyth's avatar Daenyth
Browse files

Merge branch 'master' of github.com:Daenyth/Cockatrice

parents c0fdbb2c 2dd50802
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
......@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
......@@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
......@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
......@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
......@@ -225,7 +225,7 @@ impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
......@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
......@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
......@@ -303,10 +303,9 @@ the "copyright" line and a pointer to where the full notice is found.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
......@@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names:
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
......@@ -14,33 +14,28 @@ Cockatrice is free software, licensed under the GPLv2; see COPYING for details.
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
```
To compile:
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
`oracle` fetches card data
`cockatrice` is the game client
`servatrice` is the server
#TODOs
This is an unordered list of possible todo items for Cockatrice.
Note that "improve" and "write" always also means: "document and comment"
##Docs
* Improve README.md, it is very minimalistic and technical
##Improve packaging:
* Add SSL libraries to Windows build to support https links in oracle.exe
* Improve nsis file git hash extraction, it only works if the build directory is cleared as version_string.cpp does not seem to get updated by git pull/cmake
* Fix prepareMacRelease.sh to use default installation paths for Qt and protobuf
* Add Mac compile+package howto to the documentation
* Create script/... for creating Linux packages (deb, rpm, ebuild, ...) or at least an official tarball/git tags; package maintainers dislike using git snapshots so much that they rather ignore software without stable tarballs.
* Move everything package related into one directory
##Scripts
* Write example init script for servatrice.
##Webinterface
* Write a default cgi webinterface in some language for the servatrice database. Keep it simple and think about SQL-injections and other security risks - especially if you do it in PHP :-P
##Improve usermanual:
* Improve Layout, Text, Screenshots; nearly everything is still quick n dirty copy and paste.
* Add missing TODOs
* Translate the Documentation
* Include faq.txt and shortcuts.txt in usermanual, then remove them.
* Rename the picture filenames to something more meaningful.
* Create an index, lists of tables/figures/...
## Storage
* Find a better place for sets.xml than doc.
##Create developer documentation:
* Create developer manual
* Add comments to code
* Describe which components exist and how they work and interact
* Describe the *.proto files
* Comment and document servatrice.sql
* Document everything!1!!
* Coding guidelines
##Fix compile warnings
* (CMAKE_VERBOSE_MAKEFILE, compile with clang++), this could indicate missing program functionality:
```
cockatrice/src/abstractclient.cpp:72:12: warning: enumeration value 'SessionEvent_SessionEventType_SERVER_COMPLETE_LIST' not handled in switch [-Wswitch]
switch ((SessionEvent::SessionEventType) getPbExtension(event)) {
```
```
cockatrice/Cockatrice.VanNostrand/cockatrice/src/player.cpp:1725:12: warning: 4 enumeration values not handled in switch: 'cmMoveToTopLibrary', 'cmMoveToBottomLibrary', 'cmMoveToGraveyard'... [-Wswitch]
switch (static_cast<CardMenuActionType>(a->data().toInt())) {
```
```
cockatrice/src/cardzone.cpp:127:11: warning: enumeration values 'CaseTopCardsOfZone', 'CaseRevealZone', and 'CaseShuffleZone' not handled in switch [-Wswitch]
switch (gc) {
```
##Else
* Update SFMT library (http://www.math.sci.hiroshima-u.ac.jp/~m-mat@math.sci.hiroshima-u.ac.jp/MT/SFMT/) in common/sfmt and adapt common/rng_sfmt.cpp
* Prepare to update to Qt5, as Qt4 will die some day. See http://qt-project.org/wiki/Transition_from_Qt_4.x_to_Qt5 for relevant information.
* Move hardcoded URLs (especially from oracle and cockatrice) into a config file.
* Update the oracle to find all MtG extensions by itself, why the need for sets.xml when the oracle could ask the Gatherer or magiccards.info directly for this information?
* Update the oracle with some intelligence or improve it otherwise to deal with changes from the Gatherer.
* Remove cockatrice/resources/mtgforum.png as it is unused. Find other dead files or dead references to websites and files in the program code and documentation.
* Search git log for useful information/problems/bugs/...
......@@ -89,4 +89,4 @@ public:
static PendingCommand *prepareAdminCommand(const ::google::protobuf::Message &cmd);
};
#endif
\ No newline at end of file
#endif
......@@ -32,4 +32,4 @@ public:
void removeArrowTo(ArrowItem *arrow) { arrowsTo.removeAt(arrowsTo.indexOf(arrow)); }
};
#endif
\ No newline at end of file
#endif
......@@ -331,7 +331,6 @@ void CardItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
if (!cardMenu->isEmpty())
cardMenu->exec(event->screenPos());
} else if ((event->button() == Qt::LeftButton) && !settingsCache->getDoubleClickToPlay()) {
setCursor(Qt::OpenHandCursor);
bool hideCard = false;
if (zone->getIsView()) {
......@@ -345,6 +344,7 @@ void CardItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
playCard(event->modifiers().testFlag(Qt::ShiftModifier));
}
setCursor(Qt::OpenHandCursor);
AbstractCardItem::mouseReleaseEvent(event);
}
......
......@@ -50,4 +50,4 @@ signals:
void deleteCardInfoPopup(QString cardName);
};
#endif
\ No newline at end of file
#endif
......@@ -26,4 +26,4 @@ Q_DECLARE_METATYPE(QList<ServerInfo_User>)
Q_DECLARE_METATYPE(Event_ReplayAdded)
#endif
\ No newline at end of file
#endif
......@@ -14,4 +14,4 @@ public:
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
};
#endif
\ No newline at end of file
#endif
......@@ -21,4 +21,4 @@ public:
QSet<QString> getCardColors() const;
};
#endif
\ No newline at end of file
#endif
......@@ -13,7 +13,7 @@ DlgConnect::DlgConnect(QWidget *parent)
settings.beginGroup("server");
hostLabel = new QLabel(tr("&Host:"));
hostEdit = new QLineEdit(settings.value("hostname", "play.cockatrice.de").toString());
hostEdit = new QLineEdit(settings.value("hostname", "cockatrice.woogerworks.com").toString());
hostLabel->setBuddy(hostEdit);
portLabel = new QLabel(tr("&Port:"));
......
......@@ -5,4 +5,4 @@
typedef QMap<int, QString> GameTypeMap;
#endif
\ No newline at end of file
#endif
......@@ -18,4 +18,4 @@ private slots:
void itemFromServer(const ServerMessage &item);
};
#endif
\ No newline at end of file
#endif
......@@ -20,4 +20,4 @@ public slots:
void itemFromClient(const CommandContainer &item);
};
#endif
\ No newline at end of file
#endif
......@@ -39,7 +39,7 @@ void PhaseButton::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*op
painter->setBrush(QColor(220 * (activeAnimationCounter / 10.0), 220 * (activeAnimationCounter / 10.0), 220 * (activeAnimationCounter / 10.0)));
painter->setPen(Qt::gray);
painter->drawRect(0.5, 0.5, width - 1, width - 1);
painter->drawRect(0, 0, width - 1, width - 1);
painter->save();
painter->resetTransform();
painter->drawPixmap(iconPixmap.rect().translated(round(3 * scaleFactor), round(3 * scaleFactor)), iconPixmap, iconPixmap.rect());
......@@ -47,7 +47,7 @@ void PhaseButton::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*op
painter->setBrush(QColor(0, 0, 0, 255 * ((10 - activeAnimationCounter) / 15.0)));
painter->setPen(Qt::gray);
painter->drawRect(0.5, 0.5, width - 1, width - 1);
painter->drawRect(0, 0, width - 1, width - 1);
}
void PhaseButton::setWidth(double _width)
......
......@@ -123,7 +123,7 @@ QPixmap CountryPixmapGenerator::generatePixmap(int height, const QString &countr
QPainter painter(&pixmap);
svg.render(&painter, QRectF(0, 0, width, height));
painter.setPen(Qt::black);
painter.drawRect(0.5, 0.5, width - 1, height - 1);
painter.drawRect(0, 0, width - 1, height - 1);
pmCache.insert(key, pixmap);
return pixmap;
......
......@@ -35,4 +35,4 @@ public:
AbstractCounter *addCounter(int _counterId, const QString &_name, int _value);
};
#endif
\ No newline at end of file
#endif
......@@ -31,4 +31,4 @@ public slots:
extern SoundEngine *soundEngine;
#endif
\ No newline at end of file
#endif
......@@ -46,4 +46,4 @@ public:
bool getLocked() const { return locked; }
};
#endif
\ No newline at end of file
#endif
......@@ -77,7 +77,7 @@ void ToggleButton::paintEvent(QPaintEvent *event)
painter.setPen(QPen(Qt::green, 3));
else
painter.setPen(QPen(Qt::red, 3));
painter.drawRect(1.5, 1.5, width() - 3, height() - 3);
painter.drawRect(1, 1, width() - 3, height() - 3);
}
void ToggleButton::setState(bool _state)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment