diff --git a/CMakeLists.txt b/CMakeLists.txt index 8baa75eb8..47febc9ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -327,8 +327,8 @@ endif() include(CPack) add_subdirectory(common) +add_subdirectory(${CMAKE_SOURCE_DIR}/libs/protocol ${CMAKE_BINARY_DIR}/libs/protocol) add_subdirectory(${CMAKE_SOURCE_DIR}/libs/deck_list ${CMAKE_BINARY_DIR}/libs/deck_list) -add_subdirectory(${CMAKE_SOURCE_DIR}/libs/pb ${CMAKE_BINARY_DIR}/libs/pb) add_subdirectory(${CMAKE_SOURCE_DIR}/libs/rng ${CMAKE_BINARY_DIR}/libs/rng) add_subdirectory(${CMAKE_SOURCE_DIR}/libs/server ${CMAKE_BINARY_DIR}/libs/server) add_subdirectory(${CMAKE_SOURCE_DIR}/libs/settings ${CMAKE_BINARY_DIR}/libs/settings) diff --git a/libs/deck_list/CMakeLists.txt b/libs/deck_list/CMakeLists.txt index a8ca084d1..b87d150ac 100644 --- a/libs/deck_list/CMakeLists.txt +++ b/libs/deck_list/CMakeLists.txt @@ -25,10 +25,12 @@ add_library(cockatrice_deck_list STATIC ${MOC_SOURCES} ) +add_dependencies(cockatrice_deck_list cockatrice_protocol_wrapper) + target_include_directories(cockatrice_deck_list PUBLIC include ) target_link_libraries(cockatrice_deck_list - PUBLIC cockatrice_protocol utility ${COCKATRICE_QT_MODULES} + PUBLIC cockatrice_protocol_wrapper utility ${COCKATRICE_QT_MODULES} ) diff --git a/libs/protocol/CMakeLists.txt b/libs/protocol/CMakeLists.txt new file mode 100644 index 000000000..fe162a07a --- /dev/null +++ b/libs/protocol/CMakeLists.txt @@ -0,0 +1,14 @@ +# Top-level wrapper for the protobuf library +add_library(cockatrice_protocol_wrapper STATIC + # Optionally, you can add a dummy source if needed +) + +# Link the actual generated protobuf library +target_link_libraries(cockatrice_protocol_wrapper + PUBLIC cockatrice_protocol +) + +# Expose the pb/ folder so consumers can do #include "pb/header.pb.h" +target_include_directories(cockatrice_protocol_wrapper + PUBLIC ${CMAKE_BINARY_DIR} # points to the generated headers +) diff --git a/libs/pb/CMakeLists.txt b/libs/protocol/pb/CMakeLists.txt similarity index 85% rename from libs/pb/CMakeLists.txt rename to libs/protocol/pb/CMakeLists.txt index 89c2eba9e..8cf4051b1 100644 --- a/libs/pb/CMakeLists.txt +++ b/libs/protocol/pb/CMakeLists.txt @@ -165,46 +165,18 @@ set(PROTO_FILES session_event.proto ) -# Common output directory for generated files -file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/pb) -set(PROTO_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/pb") - if(${Protobuf_VERSION} VERSION_LESS "3.21.0.0") message(STATUS "Using Protobuf Legacy Mode") - include_directories(${PROTOBUF_INCLUDE_DIRS}) - include_directories(${PROTO_BINARY_DIR}) # expose pb/ folder - - # Generate protobuf cpp/h files directly into pb/ - set(PROTO_SRCS) - set(PROTO_HDRS) - foreach (f ${PROTO_FILES}) - get_filename_component(fname ${f} NAME_WE) - set(src_cpp ${PROTO_BINARY_DIR}/${fname}.pb.cc) - set(src_h ${PROTO_BINARY_DIR}/${fname}.pb.h) - - add_custom_command( - OUTPUT ${src_cpp} ${src_h} - COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} - --cpp_out=${PROTO_BINARY_DIR} - -I ${CMAKE_CURRENT_LIST_DIR} - ${CMAKE_CURRENT_LIST_DIR}/${f} - DEPENDS ${CMAKE_CURRENT_LIST_DIR}/${f} - COMMENT "Generating ${fname}.pb.cc / .pb.h" - ) - - list(APPEND PROTO_SRCS ${src_cpp}) - list(APPEND PROTO_HDRS ${src_h}) - endforeach () + include_directories(${CMAKE_CURRENT_BINARY_DIR}) + protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${PROTO_FILES}) add_library(cockatrice_protocol ${PROTO_SRCS} ${PROTO_HDRS}) - set(cockatrice_protocol_LIBS ${PROTOBUF_LIBRARIES}) if(UNIX) set(cockatrice_protocol_LIBS ${cockatrice_protocol_LIBS} -lpthread) endif(UNIX) target_link_libraries(cockatrice_protocol ${cockatrice_protocol_LIBS}) - target_include_directories(cockatrice_protocol PUBLIC ${PROTO_BINARY_DIR}) # ubuntu uses an outdated package for protobuf, 3.1.0 is required if(${Protobuf_VERSION} VERSION_LESS "3.1.0") @@ -218,7 +190,8 @@ if(${Protobuf_VERSION} VERSION_LESS "3.21.0.0") else() add_library(cockatrice_protocol ${PROTO_FILES}) target_link_libraries(cockatrice_protocol PUBLIC protobuf::libprotobuf) - target_include_directories(cockatrice_protocol PUBLIC "${PROTOBUF_INCLUDE_DIRS}" PUBLIC ${CMAKE_CURRENT_BINARY_DIR} PUBLIC ${PROTO_BINARY_DIR}) + set(PROTO_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}") + target_include_directories(cockatrice_protocol PUBLIC "${PROTOBUF_INCLUDE_DIRS}") protobuf_generate( TARGET cockatrice_protocol IMPORT_DIRS "${CMAKE_CURRENT_LIST_DIR}" PROTOC_OUT_DIR "${PROTO_BINARY_DIR}" diff --git a/libs/pb/admin_commands.proto b/libs/protocol/pb/admin_commands.proto similarity index 100% rename from libs/pb/admin_commands.proto rename to libs/protocol/pb/admin_commands.proto diff --git a/libs/pb/card_attributes.proto b/libs/protocol/pb/card_attributes.proto similarity index 100% rename from libs/pb/card_attributes.proto rename to libs/protocol/pb/card_attributes.proto diff --git a/libs/pb/color.proto b/libs/protocol/pb/color.proto similarity index 100% rename from libs/pb/color.proto rename to libs/protocol/pb/color.proto diff --git a/libs/pb/command_attach_card.proto b/libs/protocol/pb/command_attach_card.proto similarity index 100% rename from libs/pb/command_attach_card.proto rename to libs/protocol/pb/command_attach_card.proto diff --git a/libs/pb/command_change_zone_properties.proto b/libs/protocol/pb/command_change_zone_properties.proto similarity index 100% rename from libs/pb/command_change_zone_properties.proto rename to libs/protocol/pb/command_change_zone_properties.proto diff --git a/libs/pb/command_concede.proto b/libs/protocol/pb/command_concede.proto similarity index 100% rename from libs/pb/command_concede.proto rename to libs/protocol/pb/command_concede.proto diff --git a/libs/pb/command_create_arrow.proto b/libs/protocol/pb/command_create_arrow.proto similarity index 100% rename from libs/pb/command_create_arrow.proto rename to libs/protocol/pb/command_create_arrow.proto diff --git a/libs/pb/command_create_counter.proto b/libs/protocol/pb/command_create_counter.proto similarity index 100% rename from libs/pb/command_create_counter.proto rename to libs/protocol/pb/command_create_counter.proto diff --git a/libs/pb/command_create_token.proto b/libs/protocol/pb/command_create_token.proto similarity index 100% rename from libs/pb/command_create_token.proto rename to libs/protocol/pb/command_create_token.proto diff --git a/libs/pb/command_deck_del.proto b/libs/protocol/pb/command_deck_del.proto similarity index 100% rename from libs/pb/command_deck_del.proto rename to libs/protocol/pb/command_deck_del.proto diff --git a/libs/pb/command_deck_del_dir.proto b/libs/protocol/pb/command_deck_del_dir.proto similarity index 100% rename from libs/pb/command_deck_del_dir.proto rename to libs/protocol/pb/command_deck_del_dir.proto diff --git a/libs/pb/command_deck_download.proto b/libs/protocol/pb/command_deck_download.proto similarity index 100% rename from libs/pb/command_deck_download.proto rename to libs/protocol/pb/command_deck_download.proto diff --git a/libs/pb/command_deck_list.proto b/libs/protocol/pb/command_deck_list.proto similarity index 100% rename from libs/pb/command_deck_list.proto rename to libs/protocol/pb/command_deck_list.proto diff --git a/libs/pb/command_deck_new_dir.proto b/libs/protocol/pb/command_deck_new_dir.proto similarity index 100% rename from libs/pb/command_deck_new_dir.proto rename to libs/protocol/pb/command_deck_new_dir.proto diff --git a/libs/pb/command_deck_select.proto b/libs/protocol/pb/command_deck_select.proto similarity index 100% rename from libs/pb/command_deck_select.proto rename to libs/protocol/pb/command_deck_select.proto diff --git a/libs/pb/command_deck_upload.proto b/libs/protocol/pb/command_deck_upload.proto similarity index 100% rename from libs/pb/command_deck_upload.proto rename to libs/protocol/pb/command_deck_upload.proto diff --git a/libs/pb/command_del_counter.proto b/libs/protocol/pb/command_del_counter.proto similarity index 100% rename from libs/pb/command_del_counter.proto rename to libs/protocol/pb/command_del_counter.proto diff --git a/libs/pb/command_delete_arrow.proto b/libs/protocol/pb/command_delete_arrow.proto similarity index 100% rename from libs/pb/command_delete_arrow.proto rename to libs/protocol/pb/command_delete_arrow.proto diff --git a/libs/pb/command_draw_cards.proto b/libs/protocol/pb/command_draw_cards.proto similarity index 100% rename from libs/pb/command_draw_cards.proto rename to libs/protocol/pb/command_draw_cards.proto diff --git a/libs/pb/command_dump_zone.proto b/libs/protocol/pb/command_dump_zone.proto similarity index 100% rename from libs/pb/command_dump_zone.proto rename to libs/protocol/pb/command_dump_zone.proto diff --git a/libs/pb/command_flip_card.proto b/libs/protocol/pb/command_flip_card.proto similarity index 100% rename from libs/pb/command_flip_card.proto rename to libs/protocol/pb/command_flip_card.proto diff --git a/libs/pb/command_game_say.proto b/libs/protocol/pb/command_game_say.proto similarity index 100% rename from libs/pb/command_game_say.proto rename to libs/protocol/pb/command_game_say.proto diff --git a/libs/pb/command_inc_card_counter.proto b/libs/protocol/pb/command_inc_card_counter.proto similarity index 100% rename from libs/pb/command_inc_card_counter.proto rename to libs/protocol/pb/command_inc_card_counter.proto diff --git a/libs/pb/command_inc_counter.proto b/libs/protocol/pb/command_inc_counter.proto similarity index 100% rename from libs/pb/command_inc_counter.proto rename to libs/protocol/pb/command_inc_counter.proto diff --git a/libs/pb/command_kick_from_game.proto b/libs/protocol/pb/command_kick_from_game.proto similarity index 100% rename from libs/pb/command_kick_from_game.proto rename to libs/protocol/pb/command_kick_from_game.proto diff --git a/libs/pb/command_leave_game.proto b/libs/protocol/pb/command_leave_game.proto similarity index 100% rename from libs/pb/command_leave_game.proto rename to libs/protocol/pb/command_leave_game.proto diff --git a/libs/pb/command_move_card.proto b/libs/protocol/pb/command_move_card.proto similarity index 100% rename from libs/pb/command_move_card.proto rename to libs/protocol/pb/command_move_card.proto diff --git a/libs/pb/command_mulligan.proto b/libs/protocol/pb/command_mulligan.proto similarity index 100% rename from libs/pb/command_mulligan.proto rename to libs/protocol/pb/command_mulligan.proto diff --git a/libs/pb/command_next_turn.proto b/libs/protocol/pb/command_next_turn.proto similarity index 100% rename from libs/pb/command_next_turn.proto rename to libs/protocol/pb/command_next_turn.proto diff --git a/libs/pb/command_ready_start.proto b/libs/protocol/pb/command_ready_start.proto similarity index 100% rename from libs/pb/command_ready_start.proto rename to libs/protocol/pb/command_ready_start.proto diff --git a/libs/pb/command_replay_delete_match.proto b/libs/protocol/pb/command_replay_delete_match.proto similarity index 100% rename from libs/pb/command_replay_delete_match.proto rename to libs/protocol/pb/command_replay_delete_match.proto diff --git a/libs/pb/command_replay_download.proto b/libs/protocol/pb/command_replay_download.proto similarity index 100% rename from libs/pb/command_replay_download.proto rename to libs/protocol/pb/command_replay_download.proto diff --git a/libs/pb/command_replay_get_code.proto b/libs/protocol/pb/command_replay_get_code.proto similarity index 100% rename from libs/pb/command_replay_get_code.proto rename to libs/protocol/pb/command_replay_get_code.proto diff --git a/libs/pb/command_replay_list.proto b/libs/protocol/pb/command_replay_list.proto similarity index 100% rename from libs/pb/command_replay_list.proto rename to libs/protocol/pb/command_replay_list.proto diff --git a/libs/pb/command_replay_modify_match.proto b/libs/protocol/pb/command_replay_modify_match.proto similarity index 100% rename from libs/pb/command_replay_modify_match.proto rename to libs/protocol/pb/command_replay_modify_match.proto diff --git a/libs/pb/command_replay_submit_code.proto b/libs/protocol/pb/command_replay_submit_code.proto similarity index 100% rename from libs/pb/command_replay_submit_code.proto rename to libs/protocol/pb/command_replay_submit_code.proto diff --git a/libs/pb/command_reveal_cards.proto b/libs/protocol/pb/command_reveal_cards.proto similarity index 100% rename from libs/pb/command_reveal_cards.proto rename to libs/protocol/pb/command_reveal_cards.proto diff --git a/libs/pb/command_reverse_turn.proto b/libs/protocol/pb/command_reverse_turn.proto similarity index 100% rename from libs/pb/command_reverse_turn.proto rename to libs/protocol/pb/command_reverse_turn.proto diff --git a/libs/pb/command_roll_die.proto b/libs/protocol/pb/command_roll_die.proto similarity index 100% rename from libs/pb/command_roll_die.proto rename to libs/protocol/pb/command_roll_die.proto diff --git a/libs/pb/command_set_active_phase.proto b/libs/protocol/pb/command_set_active_phase.proto similarity index 100% rename from libs/pb/command_set_active_phase.proto rename to libs/protocol/pb/command_set_active_phase.proto diff --git a/libs/pb/command_set_card_attr.proto b/libs/protocol/pb/command_set_card_attr.proto similarity index 100% rename from libs/pb/command_set_card_attr.proto rename to libs/protocol/pb/command_set_card_attr.proto diff --git a/libs/pb/command_set_card_counter.proto b/libs/protocol/pb/command_set_card_counter.proto similarity index 100% rename from libs/pb/command_set_card_counter.proto rename to libs/protocol/pb/command_set_card_counter.proto diff --git a/libs/pb/command_set_counter.proto b/libs/protocol/pb/command_set_counter.proto similarity index 100% rename from libs/pb/command_set_counter.proto rename to libs/protocol/pb/command_set_counter.proto diff --git a/libs/pb/command_set_sideboard_lock.proto b/libs/protocol/pb/command_set_sideboard_lock.proto similarity index 100% rename from libs/pb/command_set_sideboard_lock.proto rename to libs/protocol/pb/command_set_sideboard_lock.proto diff --git a/libs/pb/command_set_sideboard_plan.proto b/libs/protocol/pb/command_set_sideboard_plan.proto similarity index 100% rename from libs/pb/command_set_sideboard_plan.proto rename to libs/protocol/pb/command_set_sideboard_plan.proto diff --git a/libs/pb/command_shuffle.proto b/libs/protocol/pb/command_shuffle.proto similarity index 100% rename from libs/pb/command_shuffle.proto rename to libs/protocol/pb/command_shuffle.proto diff --git a/libs/pb/command_undo_draw.proto b/libs/protocol/pb/command_undo_draw.proto similarity index 100% rename from libs/pb/command_undo_draw.proto rename to libs/protocol/pb/command_undo_draw.proto diff --git a/libs/pb/commands.proto b/libs/protocol/pb/commands.proto similarity index 100% rename from libs/pb/commands.proto rename to libs/protocol/pb/commands.proto diff --git a/libs/pb/context_concede.proto b/libs/protocol/pb/context_concede.proto similarity index 100% rename from libs/pb/context_concede.proto rename to libs/protocol/pb/context_concede.proto diff --git a/libs/pb/context_connection_state_changed.proto b/libs/protocol/pb/context_connection_state_changed.proto similarity index 100% rename from libs/pb/context_connection_state_changed.proto rename to libs/protocol/pb/context_connection_state_changed.proto diff --git a/libs/pb/context_deck_select.proto b/libs/protocol/pb/context_deck_select.proto similarity index 100% rename from libs/pb/context_deck_select.proto rename to libs/protocol/pb/context_deck_select.proto diff --git a/libs/pb/context_move_card.proto b/libs/protocol/pb/context_move_card.proto similarity index 100% rename from libs/pb/context_move_card.proto rename to libs/protocol/pb/context_move_card.proto diff --git a/libs/pb/context_mulligan.proto b/libs/protocol/pb/context_mulligan.proto similarity index 100% rename from libs/pb/context_mulligan.proto rename to libs/protocol/pb/context_mulligan.proto diff --git a/libs/pb/context_ping_changed.proto b/libs/protocol/pb/context_ping_changed.proto similarity index 100% rename from libs/pb/context_ping_changed.proto rename to libs/protocol/pb/context_ping_changed.proto diff --git a/libs/pb/context_ready_start.proto b/libs/protocol/pb/context_ready_start.proto similarity index 100% rename from libs/pb/context_ready_start.proto rename to libs/protocol/pb/context_ready_start.proto diff --git a/libs/pb/context_set_sideboard_lock.proto b/libs/protocol/pb/context_set_sideboard_lock.proto similarity index 100% rename from libs/pb/context_set_sideboard_lock.proto rename to libs/protocol/pb/context_set_sideboard_lock.proto diff --git a/libs/pb/context_undo_draw.proto b/libs/protocol/pb/context_undo_draw.proto similarity index 100% rename from libs/pb/context_undo_draw.proto rename to libs/protocol/pb/context_undo_draw.proto diff --git a/libs/pb/event_add_to_list.proto b/libs/protocol/pb/event_add_to_list.proto similarity index 100% rename from libs/pb/event_add_to_list.proto rename to libs/protocol/pb/event_add_to_list.proto diff --git a/libs/pb/event_attach_card.proto b/libs/protocol/pb/event_attach_card.proto similarity index 100% rename from libs/pb/event_attach_card.proto rename to libs/protocol/pb/event_attach_card.proto diff --git a/libs/pb/event_change_zone_properties.proto b/libs/protocol/pb/event_change_zone_properties.proto similarity index 100% rename from libs/pb/event_change_zone_properties.proto rename to libs/protocol/pb/event_change_zone_properties.proto diff --git a/libs/pb/event_connection_closed.proto b/libs/protocol/pb/event_connection_closed.proto similarity index 100% rename from libs/pb/event_connection_closed.proto rename to libs/protocol/pb/event_connection_closed.proto diff --git a/libs/pb/event_create_arrow.proto b/libs/protocol/pb/event_create_arrow.proto similarity index 100% rename from libs/pb/event_create_arrow.proto rename to libs/protocol/pb/event_create_arrow.proto diff --git a/libs/pb/event_create_counter.proto b/libs/protocol/pb/event_create_counter.proto similarity index 100% rename from libs/pb/event_create_counter.proto rename to libs/protocol/pb/event_create_counter.proto diff --git a/libs/pb/event_create_token.proto b/libs/protocol/pb/event_create_token.proto similarity index 100% rename from libs/pb/event_create_token.proto rename to libs/protocol/pb/event_create_token.proto diff --git a/libs/pb/event_del_counter.proto b/libs/protocol/pb/event_del_counter.proto similarity index 100% rename from libs/pb/event_del_counter.proto rename to libs/protocol/pb/event_del_counter.proto diff --git a/libs/pb/event_delete_arrow.proto b/libs/protocol/pb/event_delete_arrow.proto similarity index 100% rename from libs/pb/event_delete_arrow.proto rename to libs/protocol/pb/event_delete_arrow.proto diff --git a/libs/pb/event_destroy_card.proto b/libs/protocol/pb/event_destroy_card.proto similarity index 100% rename from libs/pb/event_destroy_card.proto rename to libs/protocol/pb/event_destroy_card.proto diff --git a/libs/pb/event_draw_cards.proto b/libs/protocol/pb/event_draw_cards.proto similarity index 100% rename from libs/pb/event_draw_cards.proto rename to libs/protocol/pb/event_draw_cards.proto diff --git a/libs/pb/event_dump_zone.proto b/libs/protocol/pb/event_dump_zone.proto similarity index 100% rename from libs/pb/event_dump_zone.proto rename to libs/protocol/pb/event_dump_zone.proto diff --git a/libs/pb/event_flip_card.proto b/libs/protocol/pb/event_flip_card.proto similarity index 100% rename from libs/pb/event_flip_card.proto rename to libs/protocol/pb/event_flip_card.proto diff --git a/libs/pb/event_game_closed.proto b/libs/protocol/pb/event_game_closed.proto similarity index 100% rename from libs/pb/event_game_closed.proto rename to libs/protocol/pb/event_game_closed.proto diff --git a/libs/pb/event_game_host_changed.proto b/libs/protocol/pb/event_game_host_changed.proto similarity index 100% rename from libs/pb/event_game_host_changed.proto rename to libs/protocol/pb/event_game_host_changed.proto diff --git a/libs/pb/event_game_joined.proto b/libs/protocol/pb/event_game_joined.proto similarity index 100% rename from libs/pb/event_game_joined.proto rename to libs/protocol/pb/event_game_joined.proto diff --git a/libs/pb/event_game_say.proto b/libs/protocol/pb/event_game_say.proto similarity index 100% rename from libs/pb/event_game_say.proto rename to libs/protocol/pb/event_game_say.proto diff --git a/libs/pb/event_game_state_changed.proto b/libs/protocol/pb/event_game_state_changed.proto similarity index 100% rename from libs/pb/event_game_state_changed.proto rename to libs/protocol/pb/event_game_state_changed.proto diff --git a/libs/pb/event_join.proto b/libs/protocol/pb/event_join.proto similarity index 100% rename from libs/pb/event_join.proto rename to libs/protocol/pb/event_join.proto diff --git a/libs/pb/event_join_room.proto b/libs/protocol/pb/event_join_room.proto similarity index 100% rename from libs/pb/event_join_room.proto rename to libs/protocol/pb/event_join_room.proto diff --git a/libs/pb/event_kicked.proto b/libs/protocol/pb/event_kicked.proto similarity index 100% rename from libs/pb/event_kicked.proto rename to libs/protocol/pb/event_kicked.proto diff --git a/libs/pb/event_leave.proto b/libs/protocol/pb/event_leave.proto similarity index 100% rename from libs/pb/event_leave.proto rename to libs/protocol/pb/event_leave.proto diff --git a/libs/pb/event_leave_room.proto b/libs/protocol/pb/event_leave_room.proto similarity index 100% rename from libs/pb/event_leave_room.proto rename to libs/protocol/pb/event_leave_room.proto diff --git a/libs/pb/event_list_games.proto b/libs/protocol/pb/event_list_games.proto similarity index 100% rename from libs/pb/event_list_games.proto rename to libs/protocol/pb/event_list_games.proto diff --git a/libs/pb/event_list_rooms.proto b/libs/protocol/pb/event_list_rooms.proto similarity index 100% rename from libs/pb/event_list_rooms.proto rename to libs/protocol/pb/event_list_rooms.proto diff --git a/libs/pb/event_move_card.proto b/libs/protocol/pb/event_move_card.proto similarity index 100% rename from libs/pb/event_move_card.proto rename to libs/protocol/pb/event_move_card.proto diff --git a/libs/pb/event_notify_user.proto b/libs/protocol/pb/event_notify_user.proto similarity index 100% rename from libs/pb/event_notify_user.proto rename to libs/protocol/pb/event_notify_user.proto diff --git a/libs/pb/event_player_properties_changed.proto b/libs/protocol/pb/event_player_properties_changed.proto similarity index 100% rename from libs/pb/event_player_properties_changed.proto rename to libs/protocol/pb/event_player_properties_changed.proto diff --git a/libs/pb/event_remove_from_list.proto b/libs/protocol/pb/event_remove_from_list.proto similarity index 100% rename from libs/pb/event_remove_from_list.proto rename to libs/protocol/pb/event_remove_from_list.proto diff --git a/libs/pb/event_remove_messages.proto b/libs/protocol/pb/event_remove_messages.proto similarity index 100% rename from libs/pb/event_remove_messages.proto rename to libs/protocol/pb/event_remove_messages.proto diff --git a/libs/pb/event_replay_added.proto b/libs/protocol/pb/event_replay_added.proto similarity index 100% rename from libs/pb/event_replay_added.proto rename to libs/protocol/pb/event_replay_added.proto diff --git a/libs/pb/event_reveal_cards.proto b/libs/protocol/pb/event_reveal_cards.proto similarity index 100% rename from libs/pb/event_reveal_cards.proto rename to libs/protocol/pb/event_reveal_cards.proto diff --git a/libs/pb/event_reverse_turn.proto b/libs/protocol/pb/event_reverse_turn.proto similarity index 100% rename from libs/pb/event_reverse_turn.proto rename to libs/protocol/pb/event_reverse_turn.proto diff --git a/libs/pb/event_roll_die.proto b/libs/protocol/pb/event_roll_die.proto similarity index 100% rename from libs/pb/event_roll_die.proto rename to libs/protocol/pb/event_roll_die.proto diff --git a/libs/pb/event_room_say.proto b/libs/protocol/pb/event_room_say.proto similarity index 100% rename from libs/pb/event_room_say.proto rename to libs/protocol/pb/event_room_say.proto diff --git a/libs/pb/event_server_complete_list.proto b/libs/protocol/pb/event_server_complete_list.proto similarity index 100% rename from libs/pb/event_server_complete_list.proto rename to libs/protocol/pb/event_server_complete_list.proto diff --git a/libs/pb/event_server_identification.proto b/libs/protocol/pb/event_server_identification.proto similarity index 100% rename from libs/pb/event_server_identification.proto rename to libs/protocol/pb/event_server_identification.proto diff --git a/libs/pb/event_server_message.proto b/libs/protocol/pb/event_server_message.proto similarity index 100% rename from libs/pb/event_server_message.proto rename to libs/protocol/pb/event_server_message.proto diff --git a/libs/pb/event_server_shutdown.proto b/libs/protocol/pb/event_server_shutdown.proto similarity index 100% rename from libs/pb/event_server_shutdown.proto rename to libs/protocol/pb/event_server_shutdown.proto diff --git a/libs/pb/event_set_active_phase.proto b/libs/protocol/pb/event_set_active_phase.proto similarity index 100% rename from libs/pb/event_set_active_phase.proto rename to libs/protocol/pb/event_set_active_phase.proto diff --git a/libs/pb/event_set_active_player.proto b/libs/protocol/pb/event_set_active_player.proto similarity index 100% rename from libs/pb/event_set_active_player.proto rename to libs/protocol/pb/event_set_active_player.proto diff --git a/libs/pb/event_set_card_attr.proto b/libs/protocol/pb/event_set_card_attr.proto similarity index 100% rename from libs/pb/event_set_card_attr.proto rename to libs/protocol/pb/event_set_card_attr.proto diff --git a/libs/pb/event_set_card_counter.proto b/libs/protocol/pb/event_set_card_counter.proto similarity index 100% rename from libs/pb/event_set_card_counter.proto rename to libs/protocol/pb/event_set_card_counter.proto diff --git a/libs/pb/event_set_counter.proto b/libs/protocol/pb/event_set_counter.proto similarity index 100% rename from libs/pb/event_set_counter.proto rename to libs/protocol/pb/event_set_counter.proto diff --git a/libs/pb/event_shuffle.proto b/libs/protocol/pb/event_shuffle.proto similarity index 100% rename from libs/pb/event_shuffle.proto rename to libs/protocol/pb/event_shuffle.proto diff --git a/libs/pb/event_user_joined.proto b/libs/protocol/pb/event_user_joined.proto similarity index 100% rename from libs/pb/event_user_joined.proto rename to libs/protocol/pb/event_user_joined.proto diff --git a/libs/pb/event_user_left.proto b/libs/protocol/pb/event_user_left.proto similarity index 100% rename from libs/pb/event_user_left.proto rename to libs/protocol/pb/event_user_left.proto diff --git a/libs/pb/event_user_message.proto b/libs/protocol/pb/event_user_message.proto similarity index 100% rename from libs/pb/event_user_message.proto rename to libs/protocol/pb/event_user_message.proto diff --git a/libs/pb/game_commands.proto b/libs/protocol/pb/game_commands.proto similarity index 100% rename from libs/pb/game_commands.proto rename to libs/protocol/pb/game_commands.proto diff --git a/libs/pb/game_event.proto b/libs/protocol/pb/game_event.proto similarity index 100% rename from libs/pb/game_event.proto rename to libs/protocol/pb/game_event.proto diff --git a/libs/pb/game_event_container.proto b/libs/protocol/pb/game_event_container.proto similarity index 100% rename from libs/pb/game_event_container.proto rename to libs/protocol/pb/game_event_container.proto diff --git a/libs/pb/game_event_context.proto b/libs/protocol/pb/game_event_context.proto similarity index 100% rename from libs/pb/game_event_context.proto rename to libs/protocol/pb/game_event_context.proto diff --git a/libs/pb/game_replay.proto b/libs/protocol/pb/game_replay.proto similarity index 100% rename from libs/pb/game_replay.proto rename to libs/protocol/pb/game_replay.proto diff --git a/libs/pb/isl_message.proto b/libs/protocol/pb/isl_message.proto similarity index 100% rename from libs/pb/isl_message.proto rename to libs/protocol/pb/isl_message.proto diff --git a/libs/pb/moderator_commands.proto b/libs/protocol/pb/moderator_commands.proto similarity index 100% rename from libs/pb/moderator_commands.proto rename to libs/protocol/pb/moderator_commands.proto diff --git a/libs/pb/move_card_to_zone.proto b/libs/protocol/pb/move_card_to_zone.proto similarity index 100% rename from libs/pb/move_card_to_zone.proto rename to libs/protocol/pb/move_card_to_zone.proto diff --git a/libs/pb/response.proto b/libs/protocol/pb/response.proto similarity index 100% rename from libs/pb/response.proto rename to libs/protocol/pb/response.proto diff --git a/libs/pb/response_activate.proto b/libs/protocol/pb/response_activate.proto similarity index 100% rename from libs/pb/response_activate.proto rename to libs/protocol/pb/response_activate.proto diff --git a/libs/pb/response_adjust_mod.proto b/libs/protocol/pb/response_adjust_mod.proto similarity index 100% rename from libs/pb/response_adjust_mod.proto rename to libs/protocol/pb/response_adjust_mod.proto diff --git a/libs/pb/response_ban_history.proto b/libs/protocol/pb/response_ban_history.proto similarity index 100% rename from libs/pb/response_ban_history.proto rename to libs/protocol/pb/response_ban_history.proto diff --git a/libs/pb/response_deck_download.proto b/libs/protocol/pb/response_deck_download.proto similarity index 100% rename from libs/pb/response_deck_download.proto rename to libs/protocol/pb/response_deck_download.proto diff --git a/libs/pb/response_deck_list.proto b/libs/protocol/pb/response_deck_list.proto similarity index 100% rename from libs/pb/response_deck_list.proto rename to libs/protocol/pb/response_deck_list.proto diff --git a/libs/pb/response_deck_upload.proto b/libs/protocol/pb/response_deck_upload.proto similarity index 100% rename from libs/pb/response_deck_upload.proto rename to libs/protocol/pb/response_deck_upload.proto diff --git a/libs/pb/response_dump_zone.proto b/libs/protocol/pb/response_dump_zone.proto similarity index 100% rename from libs/pb/response_dump_zone.proto rename to libs/protocol/pb/response_dump_zone.proto diff --git a/libs/pb/response_forgotpasswordrequest.proto b/libs/protocol/pb/response_forgotpasswordrequest.proto similarity index 100% rename from libs/pb/response_forgotpasswordrequest.proto rename to libs/protocol/pb/response_forgotpasswordrequest.proto diff --git a/libs/pb/response_get_admin_notes.proto b/libs/protocol/pb/response_get_admin_notes.proto similarity index 100% rename from libs/pb/response_get_admin_notes.proto rename to libs/protocol/pb/response_get_admin_notes.proto diff --git a/libs/pb/response_get_games_of_user.proto b/libs/protocol/pb/response_get_games_of_user.proto similarity index 100% rename from libs/pb/response_get_games_of_user.proto rename to libs/protocol/pb/response_get_games_of_user.proto diff --git a/libs/pb/response_get_user_info.proto b/libs/protocol/pb/response_get_user_info.proto similarity index 100% rename from libs/pb/response_get_user_info.proto rename to libs/protocol/pb/response_get_user_info.proto diff --git a/libs/pb/response_join_room.proto b/libs/protocol/pb/response_join_room.proto similarity index 100% rename from libs/pb/response_join_room.proto rename to libs/protocol/pb/response_join_room.proto diff --git a/libs/pb/response_list_users.proto b/libs/protocol/pb/response_list_users.proto similarity index 100% rename from libs/pb/response_list_users.proto rename to libs/protocol/pb/response_list_users.proto diff --git a/libs/pb/response_login.proto b/libs/protocol/pb/response_login.proto similarity index 100% rename from libs/pb/response_login.proto rename to libs/protocol/pb/response_login.proto diff --git a/libs/pb/response_password_salt.proto b/libs/protocol/pb/response_password_salt.proto similarity index 100% rename from libs/pb/response_password_salt.proto rename to libs/protocol/pb/response_password_salt.proto diff --git a/libs/pb/response_register.proto b/libs/protocol/pb/response_register.proto similarity index 100% rename from libs/pb/response_register.proto rename to libs/protocol/pb/response_register.proto diff --git a/libs/pb/response_replay_download.proto b/libs/protocol/pb/response_replay_download.proto similarity index 100% rename from libs/pb/response_replay_download.proto rename to libs/protocol/pb/response_replay_download.proto diff --git a/libs/pb/response_replay_get_code.proto b/libs/protocol/pb/response_replay_get_code.proto similarity index 100% rename from libs/pb/response_replay_get_code.proto rename to libs/protocol/pb/response_replay_get_code.proto diff --git a/libs/pb/response_replay_list.proto b/libs/protocol/pb/response_replay_list.proto similarity index 100% rename from libs/pb/response_replay_list.proto rename to libs/protocol/pb/response_replay_list.proto diff --git a/libs/pb/response_viewlog_history.proto b/libs/protocol/pb/response_viewlog_history.proto similarity index 100% rename from libs/pb/response_viewlog_history.proto rename to libs/protocol/pb/response_viewlog_history.proto diff --git a/libs/pb/response_warn_history.proto b/libs/protocol/pb/response_warn_history.proto similarity index 100% rename from libs/pb/response_warn_history.proto rename to libs/protocol/pb/response_warn_history.proto diff --git a/libs/pb/response_warn_list.proto b/libs/protocol/pb/response_warn_list.proto similarity index 100% rename from libs/pb/response_warn_list.proto rename to libs/protocol/pb/response_warn_list.proto diff --git a/libs/pb/room_commands.proto b/libs/protocol/pb/room_commands.proto similarity index 100% rename from libs/pb/room_commands.proto rename to libs/protocol/pb/room_commands.proto diff --git a/libs/pb/room_event.proto b/libs/protocol/pb/room_event.proto similarity index 100% rename from libs/pb/room_event.proto rename to libs/protocol/pb/room_event.proto diff --git a/libs/pb/server_message.proto b/libs/protocol/pb/server_message.proto similarity index 100% rename from libs/pb/server_message.proto rename to libs/protocol/pb/server_message.proto diff --git a/libs/pb/serverinfo_arrow.proto b/libs/protocol/pb/serverinfo_arrow.proto similarity index 100% rename from libs/pb/serverinfo_arrow.proto rename to libs/protocol/pb/serverinfo_arrow.proto diff --git a/libs/pb/serverinfo_ban.proto b/libs/protocol/pb/serverinfo_ban.proto similarity index 100% rename from libs/pb/serverinfo_ban.proto rename to libs/protocol/pb/serverinfo_ban.proto diff --git a/libs/pb/serverinfo_card.proto b/libs/protocol/pb/serverinfo_card.proto similarity index 100% rename from libs/pb/serverinfo_card.proto rename to libs/protocol/pb/serverinfo_card.proto diff --git a/libs/pb/serverinfo_cardcounter.proto b/libs/protocol/pb/serverinfo_cardcounter.proto similarity index 100% rename from libs/pb/serverinfo_cardcounter.proto rename to libs/protocol/pb/serverinfo_cardcounter.proto diff --git a/libs/pb/serverinfo_chat_message.proto b/libs/protocol/pb/serverinfo_chat_message.proto similarity index 100% rename from libs/pb/serverinfo_chat_message.proto rename to libs/protocol/pb/serverinfo_chat_message.proto diff --git a/libs/pb/serverinfo_counter.proto b/libs/protocol/pb/serverinfo_counter.proto similarity index 100% rename from libs/pb/serverinfo_counter.proto rename to libs/protocol/pb/serverinfo_counter.proto diff --git a/libs/pb/serverinfo_deckstorage.proto b/libs/protocol/pb/serverinfo_deckstorage.proto similarity index 100% rename from libs/pb/serverinfo_deckstorage.proto rename to libs/protocol/pb/serverinfo_deckstorage.proto diff --git a/libs/pb/serverinfo_game.proto b/libs/protocol/pb/serverinfo_game.proto similarity index 100% rename from libs/pb/serverinfo_game.proto rename to libs/protocol/pb/serverinfo_game.proto diff --git a/libs/pb/serverinfo_gametype.proto b/libs/protocol/pb/serverinfo_gametype.proto similarity index 100% rename from libs/pb/serverinfo_gametype.proto rename to libs/protocol/pb/serverinfo_gametype.proto diff --git a/libs/pb/serverinfo_player.proto b/libs/protocol/pb/serverinfo_player.proto similarity index 100% rename from libs/pb/serverinfo_player.proto rename to libs/protocol/pb/serverinfo_player.proto diff --git a/libs/pb/serverinfo_playerping.proto b/libs/protocol/pb/serverinfo_playerping.proto similarity index 100% rename from libs/pb/serverinfo_playerping.proto rename to libs/protocol/pb/serverinfo_playerping.proto diff --git a/libs/pb/serverinfo_playerproperties.proto b/libs/protocol/pb/serverinfo_playerproperties.proto similarity index 100% rename from libs/pb/serverinfo_playerproperties.proto rename to libs/protocol/pb/serverinfo_playerproperties.proto diff --git a/libs/pb/serverinfo_replay.proto b/libs/protocol/pb/serverinfo_replay.proto similarity index 100% rename from libs/pb/serverinfo_replay.proto rename to libs/protocol/pb/serverinfo_replay.proto diff --git a/libs/pb/serverinfo_replay_match.proto b/libs/protocol/pb/serverinfo_replay_match.proto similarity index 100% rename from libs/pb/serverinfo_replay_match.proto rename to libs/protocol/pb/serverinfo_replay_match.proto diff --git a/libs/pb/serverinfo_room.proto b/libs/protocol/pb/serverinfo_room.proto similarity index 100% rename from libs/pb/serverinfo_room.proto rename to libs/protocol/pb/serverinfo_room.proto diff --git a/libs/pb/serverinfo_user.proto b/libs/protocol/pb/serverinfo_user.proto similarity index 100% rename from libs/pb/serverinfo_user.proto rename to libs/protocol/pb/serverinfo_user.proto diff --git a/libs/pb/serverinfo_warning.proto b/libs/protocol/pb/serverinfo_warning.proto similarity index 100% rename from libs/pb/serverinfo_warning.proto rename to libs/protocol/pb/serverinfo_warning.proto diff --git a/libs/pb/serverinfo_zone.proto b/libs/protocol/pb/serverinfo_zone.proto similarity index 100% rename from libs/pb/serverinfo_zone.proto rename to libs/protocol/pb/serverinfo_zone.proto diff --git a/libs/pb/session_commands.proto b/libs/protocol/pb/session_commands.proto similarity index 100% rename from libs/pb/session_commands.proto rename to libs/protocol/pb/session_commands.proto diff --git a/libs/pb/session_event.proto b/libs/protocol/pb/session_event.proto similarity index 100% rename from libs/pb/session_event.proto rename to libs/protocol/pb/session_event.proto diff --git a/libs/server/CMakeLists.txt b/libs/server/CMakeLists.txt index eb3ebefcf..103ec0cff 100644 --- a/libs/server/CMakeLists.txt +++ b/libs/server/CMakeLists.txt @@ -53,6 +53,8 @@ add_library(cockatrice_server STATIC ${MOC_SOURCES} ) +add_dependencies(cockatrice_server cockatrice_protocol_wrapper) + target_include_directories(cockatrice_server PUBLIC include PUBLIC ${CMAKE_SOURCE_DIR}/common @@ -60,5 +62,5 @@ target_include_directories(cockatrice_server # Make cockatrice_server depend on cockatrice_protocol target_link_libraries(cockatrice_server - PUBLIC cockatrice_common cockatrice_protocol utility cockatrice_rng cockatrice_deck_list ${COCKATRICE_QT_MODULES} + PUBLIC cockatrice_common cockatrice_protocol_wrapper utility cockatrice_rng cockatrice_deck_list ${COCKATRICE_QT_MODULES} ) \ No newline at end of file