mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Turn Card, Deck_List, Protocol, RNG, Network (Client, Server), Settings and Utility into libraries and remove cockatrice_common. (#6212)
--------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de> Co-authored-by: ebbit1q <ebbit1q@gmail.com>
This commit is contained in:
parent
be1403c920
commit
1ef07309d6
605 changed files with 3812 additions and 3408 deletions
|
|
@ -96,19 +96,18 @@ set(DESKTOPDIR
|
|||
CACHE STRING "desktop file destination"
|
||||
)
|
||||
|
||||
# Include directories
|
||||
include_directories(../common)
|
||||
include_directories(${PROTOBUF_INCLUDE_DIR})
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR}/../common)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
# Build servatrice binary and link it
|
||||
add_executable(servatrice MACOSX_BUNDLE ${servatrice_MOC_SRCS} ${servatrice_RESOURCES_RCC} ${servatrice_SOURCES})
|
||||
|
||||
if(CMAKE_HOST_SYSTEM MATCHES "FreeBSD")
|
||||
target_link_libraries(servatrice cockatrice_common Threads::Threads ${SERVATRICE_QT_MODULES} ${LIBEXECINFO_LIBRARY})
|
||||
target_link_libraries(
|
||||
servatrice libcockatrice_deck_list libcockatrice_network_server_remote Threads::Threads ${SERVATRICE_QT_MODULES}
|
||||
${LIBEXECINFO_LIBRARY}
|
||||
)
|
||||
else()
|
||||
target_link_libraries(servatrice cockatrice_common Threads::Threads ${SERVATRICE_QT_MODULES})
|
||||
target_link_libraries(
|
||||
servatrice libcockatrice_deck_list libcockatrice_network_server_remote Threads::Threads ${SERVATRICE_QT_MODULES}
|
||||
)
|
||||
endif()
|
||||
|
||||
# install rules
|
||||
|
|
|
|||
|
|
@ -1,25 +1,25 @@
|
|||
#include "isl_interface.h"
|
||||
|
||||
#include "debug_pb_message.h"
|
||||
#include "get_pb_extension.h"
|
||||
#include "main.h"
|
||||
#include "pb/event_game_joined.pb.h"
|
||||
#include "pb/event_join_room.pb.h"
|
||||
#include "pb/event_leave_room.pb.h"
|
||||
#include "pb/event_list_games.pb.h"
|
||||
#include "pb/event_remove_messages.pb.h"
|
||||
#include "pb/event_room_say.pb.h"
|
||||
#include "pb/event_server_complete_list.pb.h"
|
||||
#include "pb/event_user_joined.pb.h"
|
||||
#include "pb/event_user_left.pb.h"
|
||||
#include "pb/event_user_message.pb.h"
|
||||
#include "pb/isl_message.pb.h"
|
||||
#include "server/server_protocolhandler.h"
|
||||
#include "server/server_room.h"
|
||||
#include "server_logger.h"
|
||||
|
||||
#include <QSslSocket>
|
||||
#include <google/protobuf/descriptor.h>
|
||||
#include <libcockatrice/protocol/debug_pb_message.h>
|
||||
#include <libcockatrice/protocol/get_pb_extension.h>
|
||||
#include <libcockatrice/protocol/pb/event_game_joined.pb.h>
|
||||
#include <libcockatrice/protocol/pb/event_join_room.pb.h>
|
||||
#include <libcockatrice/protocol/pb/event_leave_room.pb.h>
|
||||
#include <libcockatrice/protocol/pb/event_list_games.pb.h>
|
||||
#include <libcockatrice/protocol/pb/event_remove_messages.pb.h>
|
||||
#include <libcockatrice/protocol/pb/event_room_say.pb.h>
|
||||
#include <libcockatrice/protocol/pb/event_server_complete_list.pb.h>
|
||||
#include <libcockatrice/protocol/pb/event_user_joined.pb.h>
|
||||
#include <libcockatrice/protocol/pb/event_user_left.pb.h>
|
||||
#include <libcockatrice/protocol/pb/event_user_message.pb.h>
|
||||
#include <libcockatrice/protocol/pb/isl_message.pb.h>
|
||||
#include <server_protocolhandler.h>
|
||||
#include <server_room.h>
|
||||
|
||||
void IslInterface::sharedCtor(const QSslCertificate &cert, const QSslKey &privateKey)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
#ifndef ISL_INTERFACE_H
|
||||
#define ISL_INTERFACE_H
|
||||
|
||||
#include "pb/serverinfo_game.pb.h"
|
||||
#include "pb/serverinfo_room.pb.h"
|
||||
#include "pb/serverinfo_user.pb.h"
|
||||
#include "servatrice.h"
|
||||
|
||||
#include <QSslCertificate>
|
||||
#include <QWaitCondition>
|
||||
#include <libcockatrice/protocol/pb/serverinfo_game.pb.h>
|
||||
#include <libcockatrice/protocol/pb/serverinfo_room.pb.h>
|
||||
#include <libcockatrice/protocol/pb/serverinfo_user.pb.h>
|
||||
|
||||
class Servatrice;
|
||||
class QSslSocket;
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "passwordhasher.h"
|
||||
#include "rng_sfmt.h"
|
||||
#include "servatrice.h"
|
||||
#include "server_logger.h"
|
||||
#include "settingscache.h"
|
||||
|
|
@ -34,6 +32,8 @@
|
|||
#include <QMetaType>
|
||||
#include <QtGlobal>
|
||||
#include <iostream>
|
||||
#include <libcockatrice/rng/rng_sfmt.h>
|
||||
#include <libcockatrice/utility/passwordhasher.h>
|
||||
|
||||
RNG_Abstract *rng;
|
||||
ServerLogger *logger;
|
||||
|
|
|
|||
|
|
@ -19,17 +19,11 @@
|
|||
***************************************************************************/
|
||||
#include "servatrice.h"
|
||||
|
||||
#include "deck_list.h"
|
||||
#include "email_parser.h"
|
||||
#include "featureset.h"
|
||||
#include "isl_interface.h"
|
||||
#include "main.h"
|
||||
#include "pb/event_connection_closed.pb.h"
|
||||
#include "pb/event_server_message.pb.h"
|
||||
#include "pb/event_server_shutdown.pb.h"
|
||||
#include "servatrice_connection_pool.h"
|
||||
#include "servatrice_database_interface.h"
|
||||
#include "server/server_room.h"
|
||||
#include "server_logger.h"
|
||||
#include "serversocketinterface.h"
|
||||
#include "settingscache.h"
|
||||
|
|
@ -45,6 +39,12 @@
|
|||
#include <QTimer>
|
||||
#include <QUrl>
|
||||
#include <iostream>
|
||||
#include <libcockatrice/deck_list/deck_list.h>
|
||||
#include <libcockatrice/protocol/featureset.h>
|
||||
#include <libcockatrice/protocol/pb/event_connection_closed.pb.h>
|
||||
#include <libcockatrice/protocol/pb/event_server_message.pb.h>
|
||||
#include <libcockatrice/protocol/pb/event_server_shutdown.pb.h>
|
||||
#include <server_room.h>
|
||||
|
||||
Servatrice_GameServer::Servatrice_GameServer(Servatrice *_server,
|
||||
int _numberPools,
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@
|
|||
#ifndef SERVATRICE_H
|
||||
#define SERVATRICE_H
|
||||
|
||||
#include "server/server.h"
|
||||
|
||||
#include <QHostAddress>
|
||||
#include <QMetaType>
|
||||
#include <QMutex>
|
||||
|
|
@ -31,6 +29,7 @@
|
|||
#include <QSslKey>
|
||||
#include <QTcpServer>
|
||||
#include <QWebSocketServer>
|
||||
#include <server.h>
|
||||
#include <utility>
|
||||
|
||||
Q_DECLARE_METATYPE(QSqlDatabase)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
#include "servatrice_database_interface.h"
|
||||
|
||||
#include "deck_list.h"
|
||||
#include "passwordhasher.h"
|
||||
#include "pb/game_replay.pb.h"
|
||||
#include "servatrice.h"
|
||||
#include "serversocketinterface.h"
|
||||
#include "settingscache.h"
|
||||
|
|
@ -12,6 +9,9 @@
|
|||
#include <QDebug>
|
||||
#include <QSqlError>
|
||||
#include <QSqlQuery>
|
||||
#include <libcockatrice/deck_list/deck_list.h>
|
||||
#include <libcockatrice/protocol/pb/game_replay.pb.h>
|
||||
#include <libcockatrice/utility/passwordhasher.h>
|
||||
|
||||
Servatrice_DatabaseInterface::Servatrice_DatabaseInterface(int _instanceId, Servatrice *_server)
|
||||
: instanceId(_instanceId), sqlDatabase(QSqlDatabase()), server(_server)
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
#ifndef SERVATRICE_DATABASE_INTERFACE_H
|
||||
#define SERVATRICE_DATABASE_INTERFACE_H
|
||||
|
||||
#include "server/server.h"
|
||||
#include "server/server_database_interface.h"
|
||||
|
||||
#include <QChar>
|
||||
#include <QHash>
|
||||
#include <QObject>
|
||||
#include <QSqlDatabase>
|
||||
#include <server.h>
|
||||
#include <server_database_interface.h>
|
||||
|
||||
#define DATABASE_SCHEMA_VERSION 34
|
||||
|
||||
|
|
|
|||
|
|
@ -20,57 +20,12 @@
|
|||
|
||||
#include "serversocketinterface.h"
|
||||
|
||||
#include "deck_list.h"
|
||||
#include "email_parser.h"
|
||||
#include "main.h"
|
||||
#include "pb/command_deck_del.pb.h"
|
||||
#include "pb/command_deck_del_dir.pb.h"
|
||||
#include "pb/command_deck_download.pb.h"
|
||||
#include "pb/command_deck_list.pb.h"
|
||||
#include "pb/command_deck_new_dir.pb.h"
|
||||
#include "pb/command_deck_upload.pb.h"
|
||||
#include "pb/command_replay_delete_match.pb.h"
|
||||
#include "pb/command_replay_download.pb.h"
|
||||
#include "pb/command_replay_get_code.pb.h"
|
||||
#include "pb/command_replay_list.pb.h"
|
||||
#include "pb/command_replay_modify_match.pb.h"
|
||||
#include "pb/command_replay_submit_code.pb.h"
|
||||
#include "pb/commands.pb.h"
|
||||
#include "pb/event_add_to_list.pb.h"
|
||||
#include "pb/event_connection_closed.pb.h"
|
||||
#include "pb/event_notify_user.pb.h"
|
||||
#include "pb/event_remove_from_list.pb.h"
|
||||
#include "pb/event_replay_added.pb.h"
|
||||
#include "pb/event_server_identification.pb.h"
|
||||
#include "pb/event_server_message.pb.h"
|
||||
#include "pb/event_user_message.pb.h"
|
||||
#include "pb/response_ban_history.pb.h"
|
||||
#include "pb/response_deck_download.pb.h"
|
||||
#include "pb/response_deck_list.pb.h"
|
||||
#include "pb/response_deck_upload.pb.h"
|
||||
#include "pb/response_forgotpasswordrequest.pb.h"
|
||||
#include "pb/response_get_admin_notes.pb.h"
|
||||
#include "pb/response_password_salt.pb.h"
|
||||
#include "pb/response_register.pb.h"
|
||||
#include "pb/response_replay_download.pb.h"
|
||||
#include "pb/response_replay_get_code.pb.h"
|
||||
#include "pb/response_replay_list.pb.h"
|
||||
#include "pb/response_viewlog_history.pb.h"
|
||||
#include "pb/response_warn_history.pb.h"
|
||||
#include "pb/response_warn_list.pb.h"
|
||||
#include "pb/serverinfo_ban.pb.h"
|
||||
#include "pb/serverinfo_chat_message.pb.h"
|
||||
#include "pb/serverinfo_deckstorage.pb.h"
|
||||
#include "pb/serverinfo_replay.pb.h"
|
||||
#include "pb/serverinfo_user.pb.h"
|
||||
#include "servatrice.h"
|
||||
#include "servatrice_database_interface.h"
|
||||
#include "server/game/server_player.h"
|
||||
#include "server/server_response_containers.h"
|
||||
#include "server/server_room.h"
|
||||
#include "server_logger.h"
|
||||
#include "settingscache.h"
|
||||
#include "trice_limits.h"
|
||||
#include "version_string.h"
|
||||
|
||||
#include <QDateTime>
|
||||
|
|
@ -80,7 +35,52 @@
|
|||
#include <QSqlError>
|
||||
#include <QSqlQuery>
|
||||
#include <QString>
|
||||
#include <game/server_player.h>
|
||||
#include <iostream>
|
||||
#include <libcockatrice/deck_list/deck_list.h>
|
||||
#include <libcockatrice/protocol/pb/command_deck_del.pb.h>
|
||||
#include <libcockatrice/protocol/pb/command_deck_del_dir.pb.h>
|
||||
#include <libcockatrice/protocol/pb/command_deck_download.pb.h>
|
||||
#include <libcockatrice/protocol/pb/command_deck_list.pb.h>
|
||||
#include <libcockatrice/protocol/pb/command_deck_new_dir.pb.h>
|
||||
#include <libcockatrice/protocol/pb/command_deck_upload.pb.h>
|
||||
#include <libcockatrice/protocol/pb/command_replay_delete_match.pb.h>
|
||||
#include <libcockatrice/protocol/pb/command_replay_download.pb.h>
|
||||
#include <libcockatrice/protocol/pb/command_replay_get_code.pb.h>
|
||||
#include <libcockatrice/protocol/pb/command_replay_list.pb.h>
|
||||
#include <libcockatrice/protocol/pb/command_replay_modify_match.pb.h>
|
||||
#include <libcockatrice/protocol/pb/command_replay_submit_code.pb.h>
|
||||
#include <libcockatrice/protocol/pb/commands.pb.h>
|
||||
#include <libcockatrice/protocol/pb/event_add_to_list.pb.h>
|
||||
#include <libcockatrice/protocol/pb/event_connection_closed.pb.h>
|
||||
#include <libcockatrice/protocol/pb/event_notify_user.pb.h>
|
||||
#include <libcockatrice/protocol/pb/event_remove_from_list.pb.h>
|
||||
#include <libcockatrice/protocol/pb/event_replay_added.pb.h>
|
||||
#include <libcockatrice/protocol/pb/event_server_identification.pb.h>
|
||||
#include <libcockatrice/protocol/pb/event_server_message.pb.h>
|
||||
#include <libcockatrice/protocol/pb/event_user_message.pb.h>
|
||||
#include <libcockatrice/protocol/pb/response_ban_history.pb.h>
|
||||
#include <libcockatrice/protocol/pb/response_deck_download.pb.h>
|
||||
#include <libcockatrice/protocol/pb/response_deck_list.pb.h>
|
||||
#include <libcockatrice/protocol/pb/response_deck_upload.pb.h>
|
||||
#include <libcockatrice/protocol/pb/response_forgotpasswordrequest.pb.h>
|
||||
#include <libcockatrice/protocol/pb/response_get_admin_notes.pb.h>
|
||||
#include <libcockatrice/protocol/pb/response_password_salt.pb.h>
|
||||
#include <libcockatrice/protocol/pb/response_register.pb.h>
|
||||
#include <libcockatrice/protocol/pb/response_replay_download.pb.h>
|
||||
#include <libcockatrice/protocol/pb/response_replay_get_code.pb.h>
|
||||
#include <libcockatrice/protocol/pb/response_replay_list.pb.h>
|
||||
#include <libcockatrice/protocol/pb/response_viewlog_history.pb.h>
|
||||
#include <libcockatrice/protocol/pb/response_warn_history.pb.h>
|
||||
#include <libcockatrice/protocol/pb/response_warn_list.pb.h>
|
||||
#include <libcockatrice/protocol/pb/serverinfo_ban.pb.h>
|
||||
#include <libcockatrice/protocol/pb/serverinfo_chat_message.pb.h>
|
||||
#include <libcockatrice/protocol/pb/serverinfo_deckstorage.pb.h>
|
||||
#include <libcockatrice/protocol/pb/serverinfo_replay.pb.h>
|
||||
#include <libcockatrice/protocol/pb/serverinfo_user.pb.h>
|
||||
#include <libcockatrice/utility/trice_limits.h>
|
||||
#include <server_response_containers.h>
|
||||
#include <server_room.h>
|
||||
#include <string>
|
||||
|
||||
static const int protocolVersion = 14;
|
||||
|
|
|
|||
|
|
@ -20,12 +20,11 @@
|
|||
#ifndef SERVERSOCKETINTERFACE_H
|
||||
#define SERVERSOCKETINTERFACE_H
|
||||
|
||||
#include "server/server_protocolhandler.h"
|
||||
|
||||
#include <QHostAddress>
|
||||
#include <QMutex>
|
||||
#include <QTcpSocket>
|
||||
#include <QWebSocket>
|
||||
#include <server_protocolhandler.h>
|
||||
|
||||
class Servatrice;
|
||||
class Servatrice_DatabaseInterface;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue