moc weirdness workaround on Unix, added install target

This commit is contained in:
Max-Wilhelm Bruker 2012-01-21 22:13:27 +01:00
parent f385917a90
commit e202d659a0
6 changed files with 21 additions and 7 deletions

View file

@ -3,3 +3,8 @@ add_subdirectory(common)
add_subdirectory(servatrice)
add_subdirectory(cockatrice)
add_subdirectory(oracle)
FILE(GLOB sounds "${CMAKE_CURRENT_SOURCE_DIR}/sounds/*.raw")
INSTALL(FILES ${sounds} DESTINATION share/cockatrice/sounds)
FILE(GLOB zonebg "${CMAKE_CURRENT_SOURCE_DIR}/zonebg/*.*")
INSTALL(FILES ${zonebg} DESTINATION share/cockatrice/zonebg)

View file

@ -188,5 +188,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/../common)
INCLUDE_DIRECTORIES(${QT_MOBILITY_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${QT_MOBILITY_MULTIMEDIAKIT_INCLUDE_DIR})
ADD_EXECUTABLE(cockatrice ${cockatrice_SOURCES} ${cockatrice_QM} ${cockatrice_RESOURCES_RCC} ${cockatrice_HEADERS_MOC})
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} ${PROTOBUF_LIBRARIES})
INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/cockatrice DESTINATION bin)

View file

@ -16,6 +16,7 @@
#include "pb/event_move_card.pb.h"
#include "pb/event_set_card_attr.pb.h"
#include "pb/context_move_card.pb.h"
#include "pb/context_undo_draw.pb.h"
#include <QDebug>
Server_Player::Server_Player(Server_Game *_game, int _playerId, const ServerInfo_User &_userInfo, bool _spectator, Server_ProtocolHandler *_handler)
@ -422,7 +423,6 @@ Response::ResponseCode Server_Player::moveCard(GameEventStorage &ges, Server_Car
Event_DestroyCard event;
event.set_zone_name(startzone->getName().toStdString());
event.set_card_id(card->getId());
ges.setGameEventContext(Context_MoveCard());
ges.enqueueGameEvent(event, playerId);
card->deleteLater();
@ -510,6 +510,11 @@ Response::ResponseCode Server_Player::moveCard(GameEventStorage &ges, Server_Car
setCardAttrHelper(ges, targetzone->getName(), card->getId(), AttrPT, ptString);
}
}
if (undoingDraw)
ges.setGameEventContext(Context_UndoDraw());
else
ges.setGameEventContext(Context_MoveCard());
if (startzone->hasCoords() && fixFreeSpaces)
startzone->fixFreeSpaces(ges);

View file

@ -15,5 +15,7 @@ QT4_WRAP_CPP(oracle_HEADERS_MOC ${oracle_HEADERS})
INCLUDE(${QT_USE_FILE})
INCLUDE_DIRECTORIES(../cockatrice/src)
ADD_EXECUTABLE(oracle ${oracle_SOURCES} ${oracle_HEADERS_MOC})
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)

View file

@ -68,18 +68,20 @@ void ServerLogger::flushBuffer()
}
}
#ifdef Q_OS_UNIX
void ServerLogger::hupSignalHandler(int /*unused*/)
{
#ifdef Q_OS_UNIX
if (!logFile)
return;
char a = 1;
::write(sigHupFD[0], &a, sizeof(a));
#endif
}
void ServerLogger::handleSigHup()
{
#ifdef Q_OS_UNIX
if (!logFile)
return;
@ -91,8 +93,8 @@ void ServerLogger::handleSigHup()
logFile->open(QIODevice::Append);
snHup->setEnabled(true);
}
#endif
}
QFile *ServerLogger::logFile;
int ServerLogger::sigHupFD[2];

View file

@ -20,9 +20,7 @@ public:
public slots:
void logMessage(QString message, ServerSocketInterface *ssi = 0);
private slots:
#ifdef Q_OS_UNIX
void handleSigHup();
#endif
void flushBuffer();
signals:
void sigFlushBuffer();