From 9a5d240163af1d67895d3238849881bd7a487b6c Mon Sep 17 00:00:00 2001 From: sfb Date: Wed, 29 Feb 2012 09:26:31 -0600 Subject: [PATCH] Changed: #1436 Enabled patchman build, fixed its CMakeLists added missing header includes, eliminated static-ness of extern'd functions. --- code/ryzom/server/src/CMakeLists.txt | 3 ++- .../src/patchman_service/CMakeLists.txt | 20 ++++++++++++++++--- .../deployment_configuration_synchroniser.cpp | 1 + .../patchman_service/log_report_module.cpp | 1 + .../pam_patchman_admin_module.cpp | 4 ++-- .../src/patchman_service/service_main.cpp | 7 ++++++- .../spa_server_patch_applier.cpp | 5 +++-- .../spm_server_patch_manager.cpp | 2 +- .../spt_server_patch_terminal.cpp | 3 ++- 9 files changed, 35 insertions(+), 11 deletions(-) diff --git a/code/ryzom/server/src/CMakeLists.txt b/code/ryzom/server/src/CMakeLists.txt index d0c789328..ddcca99bb 100644 --- a/code/ryzom/server/src/CMakeLists.txt +++ b/code/ryzom/server/src/CMakeLists.txt @@ -27,13 +27,14 @@ ADD_SUBDIRECTORY(persistant_data_service) ADD_SUBDIRECTORY(session_browser_server) ADD_SUBDIRECTORY(shard_unifier_service) ADD_SUBDIRECTORY(tick_service) +ADD_SUBDIRECTORY(patchman_service) + # Deprecated, no longer used. #ADD_SUBDIRECTORY(ags_test) #ADD_SUBDIRECTORY(ai_data_service) #ADD_SUBDIRECTORY(entity_view_service) #ADD_SUBDIRECTORY(general_utilities_service) -#ADD_SUBDIRECTORY(patchman_service) # Not sure, no longer used maybe? #sabrina diff --git a/code/ryzom/server/src/patchman_service/CMakeLists.txt b/code/ryzom/server/src/patchman_service/CMakeLists.txt index 606c4e40a..dd818fc2f 100644 --- a/code/ryzom/server/src/patchman_service/CMakeLists.txt +++ b/code/ryzom/server/src/patchman_service/CMakeLists.txt @@ -2,11 +2,25 @@ FILE(GLOB SRC *.cpp *.h) LIST(REMOVE_ITEM SRC ${CMAKE_CURRENT_SOURCE_DIR}/rr_module_itf.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/rr_module_itf.h) + ${CMAKE_CURRENT_SOURCE_DIR}/rr_module_itf.h + ${CMAKE_CURRENT_SOURCE_DIR}/re_module_itf.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/re_module_itf.h + ${CMAKE_CURRENT_SOURCE_DIR}/spt_module_itf.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/spt_module_itf.h + ${CMAKE_CURRENT_SOURCE_DIR}/spm_module_itf.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/spm_module_itf.h + ${CMAKE_CURRENT_SOURCE_DIR}/spa_module_itf.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/spa_module_itf.h + ${CMAKE_CURRENT_SOURCE_DIR}/re_repository_emitter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/re_repository_emitter.h + ${CMAKE_CURRENT_SOURCE_DIR}/rr_repository_reciever.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rr_repository_reciever.h + ${CMAKE_CURRENT_SOURCE_DIR}/stdin_monitor_thread.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/stdin_monitor_thread.h) -ADD_EXECUTABLE(ryzom_patchman_service ${SRC}) +ADD_EXECUTABLE(ryzom_patchman_service WIN32 ${SRC}) -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/server/src ${LIBXML2_INCLUDE_DIR} ${MYSQL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ${NEL_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${RZ_SERVER_SRC_DIR} ${LIBXML2_INCLUDE_DIR} ${MYSQL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ${NEL_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(ryzom_patchman_service ryzom_adminmodules diff --git a/code/ryzom/server/src/patchman_service/deployment_configuration_synchroniser.cpp b/code/ryzom/server/src/patchman_service/deployment_configuration_synchroniser.cpp index cd5e6ba1e..7962c49ed 100644 --- a/code/ryzom/server/src/patchman_service/deployment_configuration_synchroniser.cpp +++ b/code/ryzom/server/src/patchman_service/deployment_configuration_synchroniser.cpp @@ -23,6 +23,7 @@ // game share #include "game_share/utils.h" +#include "game_share/deployment_configuration.h" // local #include "deployment_configuration_synchroniser.h" diff --git a/code/ryzom/server/src/patchman_service/log_report_module.cpp b/code/ryzom/server/src/patchman_service/log_report_module.cpp index 4d8dead49..bc5339e1c 100644 --- a/code/ryzom/server/src/patchman_service/log_report_module.cpp +++ b/code/ryzom/server/src/patchman_service/log_report_module.cpp @@ -26,6 +26,7 @@ // game_share #include "game_share/utils.h" +#include "game_share/deployment_configuration.h" // patchman #include "administered_module.h" diff --git a/code/ryzom/server/src/patchman_service/pam_patchman_admin_module.cpp b/code/ryzom/server/src/patchman_service/pam_patchman_admin_module.cpp index b7ec31592..334fabb74 100644 --- a/code/ryzom/server/src/patchman_service/pam_patchman_admin_module.cpp +++ b/code/ryzom/server/src/patchman_service/pam_patchman_admin_module.cpp @@ -27,7 +27,7 @@ // game share #include "game_share/utils.h" #include "game_share/file_description_container.h" - +#include "game_share/deployment_configuration.h" // local #include "administered_module.h" #include "file_receiver.h" @@ -263,7 +263,7 @@ void CPatchmanAdminModule::cbFileDownloadSuccess(const CSString& fileName,const NLMISC::CPath::setCurrentPath(oldDirectory.c_str()); time_t rawtime; nl_time ( &rawtime ); - setStateVariable("Environment",NLMISC::toString("Updated %s",nl_asctime (nl_localtime ( &rawtime )))); + setStateVariable("Environment",NLMISC::toString("Updated %s",asctime (nl_localtime ( &rawtime )))); return; } diff --git a/code/ryzom/server/src/patchman_service/service_main.cpp b/code/ryzom/server/src/patchman_service/service_main.cpp index 3751bb123..aa0cfbffb 100644 --- a/code/ryzom/server/src/patchman_service/service_main.cpp +++ b/code/ryzom/server/src/patchman_service/service_main.cpp @@ -28,13 +28,18 @@ #include "game_share/ryzom_version.h" #include "game_share/tick_event_handler.h" #include "game_share/singleton_registry.h" -#include "game_share/handy_commands.h" +#include "server_share/handy_commands.h" #include "game_share/utils.h" // local #include "service_main.h" #include "patchman_tester.h" +#ifdef NL_OS_WINDOWS +# define NOMINMAX +# include +#endif // NL_OS_WINDOWS + //----------------------------------------------------------------------------- // namespaces diff --git a/code/ryzom/server/src/patchman_service/spa_server_patch_applier.cpp b/code/ryzom/server/src/patchman_service/spa_server_patch_applier.cpp index 85ca066e0..80697cc97 100644 --- a/code/ryzom/server/src/patchman_service/spa_server_patch_applier.cpp +++ b/code/ryzom/server/src/patchman_service/spa_server_patch_applier.cpp @@ -25,6 +25,7 @@ // game share #include "game_share/utils.h" #include "game_share/file_description_container.h" +#include "game_share/deployment_configuration.h" // local #include "administered_module.h" @@ -214,7 +215,7 @@ static bool untar(const NLMISC::CSString& tarFile,const NLMISC::CSString& destin return ok; } -static uint32 readVersionFile(const NLMISC::CSString& fileName) +uint32 readVersionFile(const NLMISC::CSString& fileName) { if (!NLMISC::CFile::fileExists(fileName)) { @@ -226,7 +227,7 @@ static uint32 readVersionFile(const NLMISC::CSString& fileName) return s.strip().atoi(); } -static void writeVersionFile(const NLMISC::CSString& fileName, uint32 version) +void writeVersionFile(const NLMISC::CSString& fileName, uint32 version) { NLMISC::CSString(NLMISC::toString(version)).writeToFile(fileName); } diff --git a/code/ryzom/server/src/patchman_service/spm_server_patch_manager.cpp b/code/ryzom/server/src/patchman_service/spm_server_patch_manager.cpp index 8951fbc54..5aace43e0 100644 --- a/code/ryzom/server/src/patchman_service/spm_server_patch_manager.cpp +++ b/code/ryzom/server/src/patchman_service/spm_server_patch_manager.cpp @@ -32,7 +32,7 @@ #include "deployment_configuration_synchroniser.h" #include "patchman_constants.h" -#include "game_share/mysql_wrapper.h" +#include "server_share/mysql_wrapper.h" //------------------------------------------------------------------------------------------------- diff --git a/code/ryzom/server/src/patchman_service/spt_server_patch_terminal.cpp b/code/ryzom/server/src/patchman_service/spt_server_patch_terminal.cpp index 365b3d0e7..3b649835a 100644 --- a/code/ryzom/server/src/patchman_service/spt_server_patch_terminal.cpp +++ b/code/ryzom/server/src/patchman_service/spt_server_patch_terminal.cpp @@ -27,6 +27,7 @@ // game share #include "game_share/utils.h" +#include "game_share/deployment_configuration.h" // local #include "module_admin_itf.h" @@ -783,7 +784,7 @@ NLMISC_CLASS_COMMAND_IMPL(CServerPatchTerminal, depDevCfg) CSString batch; // hack the cmd line CVectorSString cmdParams; - explode(appDesc.CmdLine, " ", reinterpret_cast&>(cmdParams), true); + explode(string(appDesc.CmdLine), string(" "), reinterpret_cast&>(cmdParams), true); for (uint i=0; i