Skip to content

Commit

Permalink
bumped version to 0.24.0
Browse files Browse the repository at this point in the history
  • Loading branch information
velnias75 committed Aug 22, 2015
1 parent 1421152 commit 1878600
Show file tree
Hide file tree
Showing 20 changed files with 60 additions and 253 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.61])
AC_INIT([NetMauMau], [0.23.7], [[email protected]], [netmaumau], [https://github.com/velnias75/NetMauMau])
AC_INIT([NetMauMau], [0.24.0], [[email protected]], [netmaumau], [https://github.com/velnias75/NetMauMau])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
AM_INIT_AUTOMAKE([foreign dist-xz no-dist-gzip tar-pax no-installinfo no-texinfo.tex])
AM_MAINTAINER_MODE
Expand Down
2 changes: 1 addition & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
netmaumau (0.23.7) UNRELEASED; urgency=low
netmaumau (0.24.0) UNRELEASED; urgency=low

* added a webserver showing the current status

Expand Down
12 changes: 6 additions & 6 deletions src/client/abstractclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include "clientcardfactory.h" // for CardFactory
#include "interceptederrorexception.h" // for InterceptedErrorException
#include "pngcheck.h" // for checkPNG
#include "scoresexception.h" // for ScoresException
#include "shutdownexception.h"
#include "remoteplayerexception.h"
#include "lostconnectionexception.h"
Expand Down Expand Up @@ -639,7 +638,7 @@ AbstractClientV05::performPlayerPicksCard(const _playInternalParams &p) const {
std::string player, extra;
_pimpl->m_connection >> player >> extra;

if(extra == NetMauMau::Common::Protocol::V15::CARDTAKEN) {
if(extra.compare(NetMauMau::Common::Protocol::V15::CARDTAKEN) == 0) {
_pimpl->m_connection >> p.msg;
const NetMauMau::Common::ICard *c = (NetMauMau::Client::CardFactory(p.msg)).create();
playerPicksCard(player, c);
Expand Down Expand Up @@ -675,8 +674,8 @@ throw(NetMauMau::Common::Exception::SocketException) {

if(ret == NOT_UNDERSTOOD) {

if(!_pimpl->m_disconnectNow && p.msg.substr(0, 10) ==
NetMauMau::Common::Protocol::V15::PLAYERWINS) {
if(!_pimpl->m_disconnectNow &&
p.msg.compare(0, 10, NetMauMau::Common::Protocol::V15::PLAYERWINS) == 0) {

const bool ultimate = p.msg.length() > 10 && p.msg[10] == '+';

Expand All @@ -685,8 +684,9 @@ throw(NetMauMau::Common::Exception::SocketException) {

if(!ultimate) return performBye(p);

} else if(!_pimpl->m_disconnectNow && p.msg.substr(0, 10) ==
NetMauMau::Common::Protocol::V15::PLAYERLOST) {
} else if(!_pimpl->m_disconnectNow && p.msg.compare(0, 10,
NetMauMau::Common::Protocol::V15::PLAYERLOST) == 0) {

std::string pl, pc;
_pimpl->m_connection >> pl >> pc;
playerLost(pl, *p.cturn, std::strtoul(pc.c_str(), NULL, 10));
Expand Down
2 changes: 1 addition & 1 deletion src/client/abstractclientv05impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct cardEqualsDescription : std::binary_function < NetMauMau::Common::ICard *
std::string, bool > {
inline result_type operator()(const first_argument_type c,
const second_argument_type &d) const {
return c->description() == d;
return c->description().compare(d) == 0;
}
};

Expand Down
14 changes: 0 additions & 14 deletions src/client/clientconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
#include "protocolerrorexception.h" // for ProtocolErrorException
#include "scoresexception.h" // for ScoresException
#include "versionmismatchexception.h" // for VersionMismatchException
#include "signalblocker.h"
#include "protocol.h" // for ERROR

#define MAX_PNAME 1024
Expand Down Expand Up @@ -109,7 +108,6 @@ void Connection::setTimeout(struct timeval *timeout) {
Connection::PLAYERINFOS Connection::playerList(const IPlayerPicListener *hdl, bool playerPNG)
throw(NetMauMau::Common::Exception::SocketException) {

BLOCK_MOST_SIGNALS;
TCPOPT_CORK(getSocketFD());

PLAYERINFOS plv;
Expand Down Expand Up @@ -184,7 +182,6 @@ throw(NetMauMau::Common::Exception::SocketException) {
Connection::CAPABILITIES Connection::capabilities()
throw(NetMauMau::Common::Exception::SocketException) {

BLOCK_ALL_SIGNALS;
TCPOPT_CORK(getSocketFD());

Connection::CAPABILITIES caps;
Expand Down Expand Up @@ -218,7 +215,6 @@ throw(NetMauMau::Common::Exception::SocketException) {
Connection::SCORES Connection::getScores(SCORE_TYPE::_scoreType type, std::size_t limit)
throw(NetMauMau::Common::Exception::SocketException) {

BLOCK_ALL_SIGNALS;
TCPOPT_CORK(getSocketFD());

try {
Expand Down Expand Up @@ -289,8 +285,6 @@ throw(NetMauMau::Common::Exception::SocketException) {
void Connection::connect(const IPlayerPicListener *l, const unsigned char *data, std::size_t len)
throw(NetMauMau::Common::Exception::SocketException) {

BLOCK_ALL_SIGNALS;

uint16_t maj = 0, min = 0;

if(_pimpl->hello(&maj, &min)) {
Expand Down Expand Up @@ -422,8 +416,6 @@ throw(NetMauMau::Common::Exception::SocketException) {
#pragma GCC diagnostic push
bool Connection::wire(SOCKET sockfd, const struct sockaddr *addr, socklen_t addrlen) const {

BLOCK_ALL_SIGNALS;

int ret = -1;

if((ret = TEMP_FAILURE_RETRY(::connect(sockfd, addr, addrlen))) == -1) shutdown(sockfd);
Expand All @@ -439,8 +431,6 @@ std::string Connection::wireError(const std::string &err) const {
Connection &Connection::operator>>(std::string &msg)
throw(NetMauMau::Common::Exception::SocketException) {

BLOCK_ALL_SIGNALS;

std::string str;
char buf[1024] = { 0 };

Expand Down Expand Up @@ -476,11 +466,7 @@ throw(NetMauMau::Common::Exception::SocketException) {

Connection &Connection::operator<<(const std::string &msg)
throw(NetMauMau::Common::Exception::SocketException) {

BLOCK_ALL_SIGNALS;

send(msg.c_str(), msg.length(), getSocketFD());

return *this;
}

Expand Down
3 changes: 0 additions & 3 deletions src/client/clientconnectionimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

#include "select.h"
#include "logger.h"
#include "signalblocker.h"
#include "errorstring.h" // for errorString
#include "timeoutexception.h" // for TimeoutException

Expand Down Expand Up @@ -61,8 +60,6 @@ ConnectionImpl::~ConnectionImpl() {}
bool ConnectionImpl::hello(uint16_t *maj, uint16_t *min)
throw(NetMauMau::Common::Exception::SocketException) {

BLOCK_ALL_SIGNALS;

_piface->NetMauMau::Common::AbstractConnection::connect();

fd_set rfds;
Expand Down
9 changes: 4 additions & 5 deletions src/common/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ BUILT_SOURCES = ai-icon.h

noinst_HEADERS = abstractconnectionimpl.h abstractsocketimpl.h base64.h basiclogger.h \
ci_string.h eff_map.h errorstring.h icardfactory.h iobserver.h iplayer.h logger.h \
mimemagic.h observable.h pathtools.h pngcheck.h protocol.h select.h signalblocker.h \
smartptr.h smartsingleton.h tcpopt_base.h tcpopt_cork.h tcpopt_nodelay.h zlibexception.h \
zstreambuf.h
mimemagic.h observable.h pathtools.h pngcheck.h protocol.h select.h smartptr.h \
smartsingleton.h tcpopt_base.h tcpopt_cork.h tcpopt_nodelay.h zlibexception.h zstreambuf.h

DISTCLEANFILES = ai-icon.h

Expand All @@ -27,8 +26,8 @@ libnetmaumaucommon_private_la_CPPFLAGS = $(GSL) -DNMM_EXE_PATH=\"$(bindir)\" \
$(NO_EXCEPTIONS) -DEXPORT_SMARTSINGLETON
libnetmaumaucommon_private_la_CXXFLAGS = -I$(top_srcdir)/src/include
libnetmaumaucommon_private_la_SOURCES = cardtools.cpp ci_string.cpp defaultplayerimage.cpp \
errorstring.cpp mimemagic.cpp pathtools.cpp pngcheck.cpp protocol.cpp signalblocker.cpp \
tcpopt_base.cpp tcpopt_cork.cpp tcpopt_nodelay.cpp
errorstring.cpp mimemagic.cpp pathtools.cpp pngcheck.cpp protocol.cpp tcpopt_base.cpp \
tcpopt_cork.cpp tcpopt_nodelay.cpp
libnetmaumaucommon_private_la_LIBADD = $(MAGIC_LIBS)

libnetmaumaucommon_la_CPPFLAGS = $(GSL) -DEXPORT_SMARTSINGLETON
Expand Down
2 changes: 1 addition & 1 deletion src/common/abstractconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ bool AbstractConnection::isHello(std::string::size_type dot, std::string::size_t

bool AbstractConnection::isValidHello(std::string::size_type dot, std::string::size_type spc,
const std::string &rHello, const std::string &expHello) {
return isHello(dot, spc) && rHello.substr(0, std::strlen(PACKAGE_NAME)) == expHello;
return isHello(dot, spc) && rHello.compare(0, std::strlen(PACKAGE_NAME), expHello) == 0;
}

uint16_t AbstractConnection::getMajorFromHello(const std::string &hello,
Expand Down
2 changes: 1 addition & 1 deletion src/common/abstractconnectionimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace {
struct _isInfo : std::binary_function < NetMauMau::Common::AbstractConnection::NAMESOCKFD,
NetMauMau::Common::AbstractConnection::INFO, bool > {
result_type operator()(const first_argument_type &nsd, const second_argument_type &info) const {
return nsd.name == info.name;
return nsd.name.compare(info.name) == 0;
}
};

Expand Down
4 changes: 0 additions & 4 deletions src/common/abstractsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@

#include "abstractsocket.h" // for AbstractSocket
#include "abstractsocketimpl.h" // for AbstractSocketImpl
#include "signalblocker.h"
#include "errorstring.h" // for errorString
#include "logger.h" // for logWarning
#include "select.h"
Expand Down Expand Up @@ -408,9 +407,6 @@ SOCKET AbstractSocket::getSocketFD() const {
}

void AbstractSocket::shutdown(SOCKET cfd) {

BLOCK_ALL_SIGNALS;

::shutdown(cfd, SHUT_RDWR);
#ifndef _WIN32
TEMP_FAILURE_RETRY(close(cfd));
Expand Down
2 changes: 1 addition & 1 deletion src/common/mimemagic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ bool MimeMagic::checkMime(const unsigned char *data, std::size_t dataLen,
const char *mime) const throw() {
#if defined(HAVE_MAGIC_H) && defined(HAVE_LIBMAGIC)
const std::string &m(getMime(data, dataLen));
return m.empty() ? true : m == mime;
return m.empty() ? true : (m.compare(mime) == 0);
#else
return true;
#endif
Expand Down
81 changes: 0 additions & 81 deletions src/common/signalblocker.cpp

This file was deleted.

83 changes: 0 additions & 83 deletions src/common/signalblocker.h

This file was deleted.

3 changes: 0 additions & 3 deletions src/include/abstractclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -844,9 +844,6 @@ class _EXPORT AbstractClientV09 : public AbstractClientV08 {
* @note if no scores are available (currently Windows servers) or the server never served
* a game, the scores vector is empty
*
* @throws Exception::ScoresException if the scores couldn't get received or called within
* a running game
*
* @param type type of scores
* @param limit limit the result, @c 0 disables the limit
* @param timeout throw a @c Exception::TimeoutException on exceeding @c timeout
Expand Down
Loading

0 comments on commit 1878600

Please sign in to comment.