Merge: From default to build_pipeline_v3

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 13 years ago
commit c03597dd73

@ -91,6 +91,7 @@ NL_CONFIGURE_CHECKS()
#Platform specifics
SETUP_EXTERNAL()
NL_GEN_REVISION_H()
IF(WIN32)
SET(WINSOCK2_LIB ws2_32.lib)

@ -0,0 +1,108 @@
# - Extract information from a subversion working copy
# The module defines the following variables:
# Mercurial_HG_EXECUTABLE - path to hg command line client
# Mercurial_VERSION_HG - version of hg command line client
# Mercurial_FOUND - true if the command line client was found
# MERCURIAL_FOUND - same as Mercurial_FOUND, set for compatiblity reasons
#
# The minimum required version of Mercurial can be specified using the
# standard syntax, e.g. FIND_PACKAGE(Mercurial 1.4)
#
# If the command line client executable is found two macros are defined:
# Mercurial_WC_INFO(<dir> <var-prefix>)
# Mercurial_WC_LOG(<dir> <var-prefix>)
# Mercurial_WC_INFO extracts information of a subversion working copy at
# a given location. This macro defines the following variables:
# <var-prefix>_WC_URL - url of the repository (at <dir>)
# <var-prefix>_WC_ROOT - root url of the repository
# <var-prefix>_WC_REVISION - current revision
# <var-prefix>_WC_LAST_CHANGED_AUTHOR - author of last commit
# <var-prefix>_WC_LAST_CHANGED_DATE - date of last commit
# <var-prefix>_WC_LAST_CHANGED_REV - revision of last commit
# <var-prefix>_WC_INFO - output of command `hg info <dir>'
# Mercurial_WC_LOG retrieves the log message of the base revision of a
# subversion working copy at a given location. This macro defines the
# variable:
# <var-prefix>_LAST_CHANGED_LOG - last log of base revision
# Example usage:
# FIND_PACKAGE(Mercurial)
# IF(MERCURIAL_FOUND)
# Mercurial_WC_INFO(${PROJECT_SOURCE_DIR} Project)
# MESSAGE("Current revision is ${Project_WC_REVISION}")
# Mercurial_WC_LOG(${PROJECT_SOURCE_DIR} Project)
# MESSAGE("Last changed log is ${Project_LAST_CHANGED_LOG}")
# ENDIF(MERCURIAL_FOUND)
#=============================================================================
# Copyright 2006-2009 Kitware, Inc.
# Copyright 2006 Tristan Carel
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PROGRAM(Mercurial_HG_EXECUTABLE hg
DOC "mercurial command line client")
MARK_AS_ADVANCED(Mercurial_HG_EXECUTABLE)
IF(Mercurial_HG_EXECUTABLE)
EXECUTE_PROCESS(COMMAND ${Mercurial_HG_EXECUTABLE} --version
OUTPUT_VARIABLE Mercurial_VERSION_HG
OUTPUT_STRIP_TRAILING_WHITESPACE)
STRING(REGEX REPLACE ".*version ([\\.0-9]+).*"
"\\1" Mercurial_VERSION_HG "${Mercurial_VERSION_HG}")
MACRO(Mercurial_WC_INFO dir prefix)
EXECUTE_PROCESS(COMMAND ${Mercurial_HG_EXECUTABLE} tip
WORKING_DIRECTORY ${dir}
OUTPUT_VARIABLE ${prefix}_WC_INFO
ERROR_VARIABLE Mercurial_hg_info_error
RESULT_VARIABLE Mercurial_hg_info_result
OUTPUT_STRIP_TRAILING_WHITESPACE)
IF(NOT ${Mercurial_hg_info_result} EQUAL 0)
MESSAGE(SEND_ERROR "Command \"${Mercurial_HG_EXECUTABLE} tip\" failed with output:\n${Mercurial_hg_info_error}")
ELSE(NOT ${Mercurial_hg_info_result} EQUAL 0)
STRING(REGEX REPLACE "^(.*\n)?Repository Root: ([^\n]+).*"
"\\2" ${prefix}_WC_ROOT "${${prefix}_WC_INFO}")
STRING(REGEX REPLACE "^(.*\n)?changeset: *([0-9]+).*"
"\\2" ${prefix}_WC_REVISION "${${prefix}_WC_INFO}")
STRING(REGEX REPLACE "^(.*\n)?Last Changed Author: ([^\n]+).*"
"\\2" ${prefix}_WC_LAST_CHANGED_AUTHOR "${${prefix}_WC_INFO}")
STRING(REGEX REPLACE "^(.*\n)?Last Changed Rev: ([^\n]+).*"
"\\2" ${prefix}_WC_LAST_CHANGED_REV "${${prefix}_WC_INFO}")
STRING(REGEX REPLACE "^(.*\n)?Last Changed Date: ([^\n]+).*"
"\\2" ${prefix}_WC_LAST_CHANGED_DATE "${${prefix}_WC_INFO}")
ENDIF(NOT ${Mercurial_hg_info_result} EQUAL 0)
ENDMACRO(Mercurial_WC_INFO)
MACRO(Mercurial_WC_LOG dir prefix)
# This macro can block if the certificate is not signed:
# hg ask you to accept the certificate and wait for your answer
# This macro requires a hg server network access (Internet most of the time)
# and can also be slow since it access the hg server
EXECUTE_PROCESS(COMMAND
${Mercurial_HG_EXECUTABLE} --non-interactive log -r BASE ${dir}
OUTPUT_VARIABLE ${prefix}_LAST_CHANGED_LOG
ERROR_VARIABLE Mercurial_hg_log_error
RESULT_VARIABLE Mercurial_hg_log_result
OUTPUT_STRIP_TRAILING_WHITESPACE)
IF(NOT ${Mercurial_hg_log_result} EQUAL 0)
MESSAGE(SEND_ERROR "Command \"${Mercurial_HG_EXECUTABLE} log -r BASE ${dir}\" failed with output:\n${Mercurial_hg_log_error}")
ENDIF(NOT ${Mercurial_hg_log_result} EQUAL 0)
ENDMACRO(Mercurial_WC_LOG)
ENDIF(Mercurial_HG_EXECUTABLE)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Mercurial DEFAULT_MSG Mercurial_HG_EXECUTABLE)

@ -0,0 +1,44 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3)
# ROOT_DIR should be set to root of the repository (where to find the .svn or .hg directory)
# SOURCE_DIR should be set to root of your code (where to find CMakeLists.txt)
SET(CMAKE_MODULE_PATH "${SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
MACRO(NOW RESULT)
IF (WIN32)
EXECUTE_PROCESS(COMMAND "wmic" "os" "get" "localdatetime" OUTPUT_VARIABLE DATETIME)
STRING(REGEX REPLACE ".*\n([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9]).*" "\\1-\\2-\\3 \\4:\\5:\\6" ${RESULT} ${DATETIME})
ELSEIF(UNIX)
EXECUTE_PROCESS(COMMAND "date" "+'%Y-%m-%d %H:%M:%S'" OUTPUT_VARIABLE ${RESULT})
ELSE (WIN32)
MESSAGE(SEND_ERROR "date not implemented")
SET(${RESULT} 000000)
ENDIF (WIN32)
ENDMACRO(NOW)
IF(EXISTS "${ROOT_DIR}/.svn/")
FIND_PACKAGE(Subversion)
IF(SUBVERSION_FOUND)
Subversion_WC_INFO(${ROOT_DIR} ER)
SET(REVISION ${ER_WC_REVISION})
ENDIF(SUBVERSION_FOUND)
ENDIF(EXISTS "${ROOT_DIR}/.svn/")
IF(EXISTS "${ROOT_DIR}/.hg/")
FIND_PACKAGE(Mercurial)
IF(MERCURIAL_FOUND)
Mercurial_WC_INFO(${ROOT_DIR} ER)
SET(REVISION ${ER_WC_REVISION})
ENDIF(MERCURIAL_FOUND)
ENDIF(EXISTS "${ROOT_DIR}/.hg/")
IF(REVISION)
IF(EXISTS ${SOURCE_DIR}/revision.h.in)
NOW(BUILD_DATE)
CONFIGURE_FILE(${SOURCE_DIR}/revision.h.in revision.h.txt)
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy revision.h.txt revision.h) # copy_if_different
ENDIF(EXISTS ${SOURCE_DIR}/revision.h.in)
ENDIF(REVISION)

@ -8,44 +8,40 @@
# ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use
# ADD_NATIVE_PRECOMPILED_HEADER _targetName _inputh _inputcpp
IF(CMAKE_COMPILER_IS_GNUCXX)
EXEC_PROGRAM(
${CMAKE_CXX_COMPILER}
ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
OUTPUT_VARIABLE gcc_compiler_version)
IF(MSVC)
SET(PCHSupport_FOUND TRUE)
SET(_PCH_include_prefix "/I")
ELSE(MSVC)
IF(CMAKE_COMPILER_IS_GNUCXX)
EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
OUTPUT_VARIABLE gcc_compiler_version)
IF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
SET(PCHSupport_FOUND TRUE)
ELSE(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
IF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]")
IF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
SET(PCHSupport_FOUND TRUE)
ENDIF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]")
ENDIF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
ELSE(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
IF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]")
SET(PCHSupport_FOUND TRUE)
ENDIF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]")
ENDIF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
ELSE(CMAKE_COMPILER_IS_GNUCXX)
# TODO: make tests for other compilers than GCC
SET(PCHSupport_FOUND TRUE)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
SET(_PCH_include_prefix "-I")
ELSE(CMAKE_COMPILER_IS_GNUCXX)
IF(WIN32)
SET(PCHSupport_FOUND TRUE) # for experimental msvc support
SET(_PCH_include_prefix "/I")
ELSE(WIN32)
SET(PCHSupport_FOUND FALSE)
ENDIF(WIN32)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
ENDIF(MSVC)
MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags)
STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name)
SET(${_out_compile_flags} ${${_flags_var_name}} )
IF(CMAKE_COMPILER_IS_GNUCXX)
IF(NOT MSVC)
GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE)
IF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY)
LIST(APPEND ${_out_compile_flags} "-fPIC")
ENDIF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
ENDIF(NOT MSVC)
GET_DIRECTORY_PROPERTY(DIRINC INCLUDE_DIRECTORIES )
FOREACH(item ${DIRINC})
@ -100,17 +96,13 @@ MACRO(_PCH_GET_COMPILE_COMMAND out_command _input _inputcpp _output)
SET(pchsupport_compiler_cxx_arg1 "")
ENDIF(CMAKE_CXX_COMPILER_ARG1)
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(${out_command}
${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} -x c++-header -o ${_output} -c ${_input}
)
ELSE(CMAKE_COMPILER_IS_GNUCXX)
IF(MSVC)
_PCH_GET_PDB_FILENAME(PDB_FILE ${_PCH_current_target})
SET(${out_command}
${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} /Yc /Fp\"${_output}\" ${_inputcpp} /c /Fd\"${PDB_FILE}\"
)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
ENDMACRO(_PCH_GET_COMPILE_COMMAND )
SET(${out_command} ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} /Yc /Fp\"${_output}\" ${_inputcpp} /c /Fd\"${PDB_FILE}\")
ELSE(MSVC)
SET(${out_command} ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} -x c++-header -o ${_output} -c ${_input})
ENDIF(MSVC)
ENDMACRO(_PCH_GET_COMPILE_COMMAND)
MACRO(GET_PRECOMPILED_HEADER_OUTPUT _targetName _input _output)
IF(MSVC)
@ -128,7 +120,9 @@ MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use )
SET(oldProps "")
ENDIF(${oldProps} MATCHES NOTFOUND)
IF(CMAKE_COMPILER_IS_GNUCXX)
IF(MSVC)
SET(_target_cflags "${oldProps} /Yu\"${_input}\" /FI\"${_input}\" /Fp\"${_pch_output_to_use}\"")
ELSE(MSVC)
# to do: test whether compiler flags match between target _targetName
# and _pch_output_to_use
FILE(TO_NATIVE_PATH ${_pch_output_to_use} _native_pch_path)
@ -137,11 +131,7 @@ MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use )
# on all remote machines set
# PCH_ADDITIONAL_COMPILER_FLAGS to -fpch-preprocess
SET(_target_cflags "${oldProps} ${PCH_ADDITIONAL_COMPILER_FLAGS}-include ${_input} -Winvalid-pch")
ELSE(CMAKE_COMPILER_IS_GNUCXX)
IF(MSVC)
SET(_target_cflags "${oldProps} /Yu\"${_input}\" /FI\"${_input}\" /Fp\"${_pch_output_to_use}\"")
ENDIF(MSVC)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
ENDIF(MSVC)
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS ${_target_cflags})
IF(oldProps)
@ -184,8 +174,31 @@ MACRO(ADD_PRECOMPILED_HEADER _targetName _inputh _inputcpp)
ADD_PRECOMPILED_HEADER_TO_TARGET(${_targetName} ${_inputh} ${_output})
ENDMACRO(ADD_PRECOMPILED_HEADER)
# Macro to move PCH creation file to the front of files list
MACRO(FIX_PRECOMPILED_HEADER _files _pch)
# Remove .cpp creating PCH from the list
LIST(REMOVE_ITEM ${_files} ${_pch})
# Prepend .cpp creating PCH to the list
LIST(INSERT ${_files} 0 ${_pch})
ENDMACRO(FIX_PRECOMPILED_HEADER)
MACRO(ADD_NATIVE_PRECOMPILED_HEADER _targetName _inputh _inputcpp)
IF(CMAKE_GENERATOR MATCHES Visual*)
SET(PCH_METHOD 0)
# 0 => creating a new target for PCH, works for all makefiles
# 1 => setting PCH for VC++ project, works for VC++ projects
# 2 => setting PCH for XCode project, works for XCode projects
IF(CMAKE_GENERATOR MATCHES "Visual Studio")
SET(PCH_METHOD 1)
ELSEIF(CMAKE_GENERATOR MATCHES "NMake Makefiles" AND MFC_FOUND AND CMAKE_MFC_FLAG)
# To fix a bug with MFC
# Don't forget to use FIX_PRECOMPILED_HEADER before creating the target
# SET(PCH_METHOD 1)
ELSEIF(CMAKE_GENERATOR MATCHES "Xcode")
SET(PCH_METHOD 2)
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio")
IF(PCH_METHOD EQUAL 1)
# Auto include the precompile (useful for moc processing, since the use of
# precompiled is specified at the target level
# and I don't want to specifiy /F- for each moc/res/ui generated files (using Qt)
@ -200,26 +213,24 @@ MACRO(ADD_NATIVE_PRECOMPILED_HEADER _targetName _inputh _inputcpp)
#also inlude ${oldProps} to have the same compile options
SET_SOURCE_FILES_PROPERTIES(${_inputcpp} PROPERTIES COMPILE_FLAGS "${oldProps} /Yc\"${_inputh}\"")
ELSE(CMAKE_GENERATOR MATCHES Visual*)
IF(CMAKE_GENERATOR MATCHES Xcode)
# For Xcode, cmake needs my patch to process
# GCC_PREFIX_HEADER and GCC_PRECOMPILE_PREFIX_HEADER as target properties
GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS)
IF(${oldProps} MATCHES NOTFOUND)
SET(oldProps "")
ENDIF(${oldProps} MATCHES NOTFOUND)
# When buiding out of the tree, precompiled may not be located
# Use full path instead.
GET_FILENAME_COMPONENT(fullPath ${_inputh} ABSOLUTE)
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${fullPath}")
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES")
ELSE(CMAKE_GENERATOR MATCHES Xcode)
#Fallback to the "old" precompiled suppport
ADD_PRECOMPILED_HEADER(${_targetName} ${_inputh} ${_inputcpp})
ENDIF(CMAKE_GENERATOR MATCHES Xcode)
ENDIF(CMAKE_GENERATOR MATCHES Visual*)
ELSEIF(PCH_METHOD EQUAL 2)
# For Xcode, cmake needs my patch to process
# GCC_PREFIX_HEADER and GCC_PRECOMPILE_PREFIX_HEADER as target properties
GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS)
IF(${oldProps} MATCHES NOTFOUND)
SET(oldProps "")
ENDIF(${oldProps} MATCHES NOTFOUND)
# When buiding out of the tree, precompiled may not be located
# Use full path instead.
GET_FILENAME_COMPONENT(fullPath ${_inputh} ABSOLUTE)
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${fullPath}")
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES")
ELSE(PCH_METHOD EQUAL 1)
#Fallback to the "old" precompiled suppport
ADD_PRECOMPILED_HEADER(${_targetName} ${_inputh} ${_inputcpp})
ENDIF(PCH_METHOD EQUAL 1)
ENDMACRO(ADD_NATIVE_PRECOMPILED_HEADER)

@ -9,6 +9,33 @@ MACRO(NL_GEN_PC name)
ENDIF(NOT WIN32 AND WITH_INSTALL_LIBRARIES)
ENDMACRO(NL_GEN_PC)
###
# Helper macro that generates revision.h from revision.h.in
###
MACRO(NL_GEN_REVISION_H)
IF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h.in)
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
ADD_DEFINITIONS(-DHAVE_REVISION_H)
SET(HAVE_REVISION_H ON)
# a custom target that is always built
ADD_CUSTOM_TARGET(revision ALL
DEPENDS ${CMAKE_BINARY_DIR}/revision.h)
# creates revision.h using cmake script
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_BINARY_DIR}/revision.h
COMMAND ${CMAKE_COMMAND}
-DSOURCE_DIR=${CMAKE_SOURCE_DIR}
-DROOT_DIR=${CMAKE_SOURCE_DIR}/..
-P ${CMAKE_SOURCE_DIR}/CMakeModules/GetRevision.cmake)
# revision.h is a generated file
SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/revision.h
PROPERTIES GENERATED TRUE
HEADER_FILE_ONLY TRUE)
ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h.in)
ENDMACRO(NL_GEN_REVISION_H)
###
#
###
@ -614,13 +641,19 @@ MACRO(SETUP_EXTERNAL)
ENDIF(${CMAKE_MAKE_PROGRAM} MATCHES "Common7")
ENDIF(MSVC10)
ELSE(WIN32)
IF(CMAKE_FIND_LIBRARY_SUFFIXES AND NOT APPLE)
IF(APPLE)
IF(WITH_STATIC_EXTERNAL)
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
SET(CMAKE_FIND_LIBRARY_SUFFIXES .a .dylib .so)
ELSE(WITH_STATIC_EXTERNAL)
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so")
SET(CMAKE_FIND_LIBRARY_SUFFIXES .dylib .so .a)
ENDIF(WITH_STATIC_EXTERNAL)
ENDIF(CMAKE_FIND_LIBRARY_SUFFIXES AND NOT APPLE)
ELSE(APPLE)
IF(WITH_STATIC_EXTERNAL)
SET(CMAKE_FIND_LIBRARY_SUFFIXES .a .so)
ELSE(WITH_STATIC_EXTERNAL)
SET(CMAKE_FIND_LIBRARY_SUFFIXES .so .a)
ENDIF(WITH_STATIC_EXTERNAL)
ENDIF(APPLE)
ENDIF(WIN32)
IF(WITH_STLPORT)

@ -0,0 +1,7 @@
#ifndef REVISION_H
#define REVISION_H
#cmakedefine REVISION "${REVISION}"
#cmakedefine BUILD_DATE "${BUILD_DATE}"
#endif

@ -1347,6 +1347,7 @@ void CClientConfig::setValues()
if (stricmp(mode, "over") == 0) p.Mode = SSysInfoParam::Over;
else if (stricmp(mode, "overonly") == 0) p.Mode = SSysInfoParam::OverOnly;
else if (stricmp(mode, "center") == 0) p.Mode = SSysInfoParam::Center;
else if (stricmp(mode, "centeraround") == 0) p.Mode = SSysInfoParam::CenterAround;
else if (stricmp(mode, "around") == 0) p.Mode = SSysInfoParam::Around;
ClientCfg.SystemInfoParams[toLower(sic->asString(2 * k))] = p;

@ -635,12 +635,15 @@ struct CClientConfig
// Mode is the display settings :
// Normal : just display in the system info window
// Over : must be displayed at bottom of the screen and in system info window
// OverOnly : must be displayed at bottom of the screen
// Center ; must be displayed at the center of the screen and in system info window
// Around ; must be displayed in the around chat window
// CenterAround ; must be displayed at the center of the screen and in around chat window
struct SSysInfoParam
{
CRGBA Color;
std::string SysInfoFxName;
enum TMode { Normal, Over, OverOnly, Center, Around };
enum TMode { Normal, Over, OverOnly, Center, Around, CenterAround };
TMode Mode;
SSysInfoParam()
{

@ -244,6 +244,7 @@ CInterfaceGroup *CInterfaceHelp::activateNextWindow(CDBCtrlSheet *elt, sint forc
i++;
}
bool showSlotAndCreator = false;
// If an active window get the same object, abort, but make it top.
for(i=0;i<_ActiveWindows.size();i++)
{
@ -261,6 +262,8 @@ CInterfaceGroup *CInterfaceHelp::activateNextWindow(CDBCtrlSheet *elt, sint forc
// for items, must also test if they have the same itemSlotId, cause relies also on "ItemInfo system"
if(elt->getType() == CCtrlSheetInfo::SheetType_Item)
{
showSlotAndCreator = true;
CDBCtrlSheet *realCtrlDst= _InfoWindows[_ActiveWindows[i]].CtrlSheet;
if(!realCtrlDst)
ok= false;
@ -344,6 +347,13 @@ CInterfaceGroup *CInterfaceHelp::activateNextWindow(CDBCtrlSheet *elt, sint forc
CInterfaceGroup *group= _InfoWindows[newIndexWindow].Window;
nlassert(group);
CInterfaceElement *ctrl = group->getElement(group->getId()+":content:ctrl_slot");
if (ctrl) ctrl->setActive(showSlotAndCreator);
ctrl = group->getElement(group->getId()+":content:creator");
if (ctrl) ctrl->setActive(showSlotAndCreator);
ctrl = group->getElement(group->getId()+":content:creator_header");
if (ctrl) ctrl->setActive(showSlotAndCreator);
// activate it, set top, copy item watched
group->setActive(true);
pIM->setTopWindow(group);
@ -1217,6 +1227,7 @@ static void setupSkillToTradeHelp(CSheetHelpSetup &setup)
if(setup.DestSheet)
{
setup.SrcSheet->copyAspect(setup.DestSheet);
setup.DestSheet->setActive(true);
}
ucstring skillText;
@ -2278,6 +2289,7 @@ static void setupItemHelp(CSheetHelpSetup &setup)
if(setup.DestSheet)
{
setup.SrcSheet->copyAspect(setup.DestSheet);
setup.DestSheet->setActive(true);
}
// NB: for raw materials only, must do each once only, must not do it at refresh, cause combo reseted
@ -2566,6 +2578,7 @@ static void setupPactHelp(CSheetHelpSetup &setup)
if(setup.DestSheet)
{
setup.SrcSheet->copyAspect(setup.DestSheet);
setup.DestSheet->setActive(true);
}
@ -2603,6 +2616,7 @@ static void setupMissionHelp(CSheetHelpSetup &setup)
if(setup.DestSheet)
{
setup.SrcSheet->copyAspect(setup.DestSheet);
setup.DestSheet->setActive(true);
}
// get detail text id from db
@ -2840,6 +2854,7 @@ void setupOutpostBuildingHelp(CSheetHelpSetup &setup)
if(setup.DestSheet)
{
setup.SrcSheet->copyAspect(setup.DestSheet);
setup.DestSheet->setActive(true);
}
const COutpostBuildingSheet *pOBS = setup.SrcSheet->asOutpostBuildingSheet();
@ -3164,6 +3179,7 @@ void setupSabrinaPhraseHelp(CSheetHelpSetup &setup, const CSPhraseCom &phrase, u
if(setup.DestSheet)
{
setup.SrcSheet->copyAspect(setup.DestSheet);
setup.DestSheet->setActive(true);
}
// **** setup the phrase Text info
@ -3233,6 +3249,7 @@ static void setupSabrinaBrickHelp(CSheetHelpSetup &setup, bool auraDisabled)
if(setup.DestSheet)
{
setup.SrcSheet->copyAspect(setup.DestSheet);
setup.DestSheet->setActive(true);
}

@ -370,8 +370,14 @@ void CGuildManager::update()
{
for (uint j = 0; j < CachedGuildMembers.size(); ++j)
{
if ((CachedGuildMembers[j].Name == _GuildMembers[i].Name) &&
(CachedGuildMembers[j].Online != _GuildMembers[i].Online))
// Status change is from offline to online/abroad online or vice versa.
TCharConnectionState prevState = CachedGuildMembers[j].Online;
TCharConnectionState curState = _GuildMembers[i].Online;
bool showMsg = (prevState != curState) &&
(CachedGuildMembers[j].Name == _GuildMembers[i].Name) &&
(prevState == ccs_offline || curState == ccs_offline);
if (showMsg)
{
ucstring msg = (_GuildMembers[i].Online != ccs_offline) ? onlineMessage : offlineMessage;
strFindReplace(msg, "%s", _GuildMembers[i].Name);

@ -4404,12 +4404,14 @@ void CInterfaceManager::displaySystemInfo(const ucstring &str, const string &cat
}
}
if (mode == CClientConfig::SSysInfoParam::Center || mode == CClientConfig::SSysInfoParam::CenterAround)
InSceneBubbleManager.addMessagePopupCenter(str, color);
// If over popup a string at the bottom of the screen
if ((mode == CClientConfig::SSysInfoParam::Over) || (mode == CClientConfig::SSysInfoParam::OverOnly))
InSceneBubbleManager.addMessagePopup(str, color);
else if (mode == CClientConfig::SSysInfoParam::Center)
InSceneBubbleManager.addMessagePopupCenter(str, color);
else if (mode == CClientConfig::SSysInfoParam::Around && PeopleInterraction.AroundMe.Window)
else if ( (mode == CClientConfig::SSysInfoParam::Around || mode == CClientConfig::SSysInfoParam::CenterAround)
&& PeopleInterraction.AroundMe.Window)
PeopleInterraction.ChatInput.AroundMe.displayMessage(str, color, 2);
}

@ -1420,11 +1420,9 @@ void CPeopleInterraction::updateContactInList(uint32 contactId, TCharConnectionS
sint index = FriendList.getIndexFromContactId(contactId);
if (index != -1)
{
// Only do work if online status has changed
if (FriendList.getOnline(index) != online)
{
// Only do work if online status has changed
FriendList.setOnline(index, online);
CCDBNodeLeaf* node = CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_ONLINE_OFFLINE_NOTIFICATIONS_CB", false);
if (node && node->getValueBool())
{
@ -1441,8 +1439,11 @@ void CPeopleInterraction::updateContactInList(uint32 contactId, TCharConnectionS
}
}
// Player is not in my guild
if (bOnlyFriend)
TCharConnectionState prevState = FriendList.getOnline(index);
bool showMsg = bOnlyFriend && (prevState == ccs_offline || online == ccs_offline);
// Player is not in my guild, and the status change is from offline to online/abroad online or vice versa.
if (showMsg)
{
ucstring msg = (online != ccs_offline) ? CI18N::get("uiPlayerOnline") : CI18N::get("uiPlayerOffline");
strFindReplace(msg, "%s", FriendList.getName(index));
@ -1458,6 +1459,8 @@ void CPeopleInterraction::updateContactInList(uint32 contactId, TCharConnectionS
PeopleInterraction.ChatInput.AroundMe.displayMessage(msg, col, 2, &dummy);
}
}
FriendList.setOnline(index, online);
}
}
}

@ -1605,29 +1605,38 @@ const ucchar *CStringManagerClient::getSPhraseLocalizedDescription(NLMISC::CShee
// ***************************************************************************
const ucchar *CStringManagerClient::getTitleLocalizedName(const std::string &titleId, bool women)
{
const ucchar * infos = getSpecialWord(titleId, women);
ucstring infosUC(infos);
vector<ucstring> listInfos = getTitleInfos(titleId, women);
vector<ucstring> listInfos;
splitUCString(infosUC, ucstring("#"), listInfos);
if (listInfos.empty())
return infos;
if (listInfos.size() > 0)
{
_TitleWords.push_back(listInfos[0]);
return _TitleWords.back().c_str();
}
_TitleWords.push_back(listInfos[0]);
return _TitleWords.back().c_str();
ucstring ucId;
ucId.fromUtf8(titleId);
return ucId.c_str();
}
// ***************************************************************************
vector<ucstring> CStringManagerClient::getTitleInfos(const std::string &titleId, bool women)
{
const ucchar * infos = getSpecialWord(titleId, women);
ucstring infosUC(infos);
ucstring infosUC;
infosUC.fromUtf8(titleId);
vector<ucstring> listInfos;
splitUCString(infosUC, ucstring("#"), listInfos);
if (listInfos.size() > 0)
{
if (titleId[0] != '#')
{
listInfos[0] = getSpecialWord(listInfos[0].toUtf8(), women);
}
}
return listInfos;
}
// ***************************************************************************
const ucchar *CStringManagerClient::getClassificationTypeLocalizedName(EGSPD::CClassificationType::TClassificationType type)
{

@ -108,6 +108,7 @@ public:
// Get the Localized Title name
static const ucchar *getTitleLocalizedName(const std::string &titleId, bool women);
static std::vector<ucstring> getTitleInfos(const std::string &titleId, bool women);
// Get the Localized name of a classification type
static const ucchar *getClassificationTypeLocalizedName(EGSPD::CClassificationType::TClassificationType type);

@ -1,7 +1,26 @@
FILE(GLOB SRC *.cpp time_weather_season/*.cpp)
FILE(GLOB PRIV_H *.h time_weather_season/*.h)
SOURCE_GROUP(headers FILES ${PRIV_H})
FILE(GLOB R2
dms.h dms.cpp
scenario.h scenario.cpp
user_connection_mgr.h user_connection_mgr.cpp
object.h object.cpp
server_animation_module.h server_animation_module.cpp
server_admin_module.h server_admin_module.cpp
server_edition_module.h server_edition_module.cpp
string_mgr_module.h string_mgr_module.cpp
scenario_entry_points.h scenario_entry_points.cpp
small_string_manager.h small_string_manager.cpp
ai_wrapper.h ai_wrapper.cpp
r2_*.h r2_*.cpp
ring_*.h ring_*.cpp)
LIST(REMOVE_ITEM SRC R2)
LIST(REMOVE_ITEM PRIV_H R2)
SOURCE_GROUP("" FILES ${SRC} ${PRIV_H})
SOURCE_GROUP("R2" FILES ${R2})
# Filter out the source files not actually compiled.
LIST(REMOVE_ITEM SRC ${CMAKE_CURRENT_SOURCE_DIR}/enum_template.cpp)

@ -40,6 +40,9 @@ forceTargetToDie :DEV:SGM:GM:EM: // Force entity target to die
getEventFaction :DEV:SGM:GM:EM: // Get the event faction of player: <player name>
giveRespawnPoint :DEV:SGM:GM: // Give a respawn point to a player: <respawn point name>
guildInvite // Send a guild invite to a player character without distance constrainte
setLeague // Create a League
leagueInvite // Send a League invite to a Team Leader character without distance constrainte
leagueKick // Kick a player or team from league
roomInvite // Send a room invite
roomKick // Remove a room invite
guildMOTD // Set the guild message of the day, command effective only for officer and more graded guild members
@ -72,8 +75,6 @@ renameGuild :DEV:SGM:GM:EM: // Rename a guild: <guild name> <new guild name
renamePlayer [SU] :DEV:SGM:GM:EM: // Rename a player: <player name> <new playerName>
renamePlayerForEvent :DEV:SGM:GM:EM:EG: // Rename a player temporarily for an event: <player name> <new playerName>
resetPowerFlags :DEV:SGM:GM:EM: // Reset the ineffective aura and the power flags for given character
respawnAfterDeath // Respawn after death at re-spawn point name, it must be valid (validated by PC and usable): <Respawn idx>
resurrected // Another PC resurrect PC by giving some energy: <Hp> <Sta> <Sap> <Focus>
root :DEV:SGM:GM:EM:VG:SG: // Root a player: <player name> <time in seconds>
saveToPDR :DEV:SGM: // Save a character to a binary PDR file: <file name>
saveToXML :DEV:SGM: // Save a character to an XML file: <file name>
@ -87,6 +88,8 @@ setGuildMessage // Set the guild message of the day: <message>
setItemSapLoad :DEV:SGM:GM:EM: // Set an item sap load: <slot index in bag (starts at 0)> <float value>
setPosFlag :DEV:SGM:GM:EM // Set a position flag: <flag name>
setPvPTag // Set player character PvP tag to true or false
setFamePlayer :DEV:SGM:GM:EM: // Set the fame value of a player in the given faction: <faction> <fame>
resetPVPTimers :DEV:SGM:GM:EM: // Reset the pvp timers of a player: <player name>
setSkillsToMaxValue :DEV:SGM:GM:EM: // Set player skills to max value
showCSR :DEV:SGM:GM:VG:SG:G:EM:EG: // Show CSR title if the player is a CSR
showFBT :DEV:SGM:GM:EM: // Show Focus Beta Tester title if the player is a FBT
@ -100,6 +103,7 @@ connectUserChannel // Connect to User Channel Chat
webExecCommand // Execute web command (need HMAC signature)
webDelCommandsIds // Delete web transactions for web_app
webAddCommandsIds // Add web command transactions for web_app
updateTarget // Update current target
teleport :DEV:SGM:GM:VG:SG:G:OBSERVER:EM:EG: // Teleport the CSR in front of a player: <player name>
tpPosFlag :DEV:SGM:GM:VG:SG:G:EM:EG: // Teleport a player to a position flag: <flag name>
universe :DEV:SGM:GM:EM: // Chat in universe mode: <boolean>
@ -107,7 +111,6 @@ unmute :DEV:SGM:GM:EM:VG:SG: // Unmute a user: <player name>
unmuteUniverse :DEV:SGM:GM:EM:VG:SG: // Unmute the universe channel
unroot :DEV:SGM:GM:EM:VG:SG: // Stop rooting a player: <player name>
updateGuildMembersList :DEV:SGM:GM: // update guild members list on members clients: <guild name>
validateRespawnPoint // Validate re-spawn point: <Re-spawn point idx>
//setPvpClan :DEV: // choose a clan for pvp
summonPet // player can summon it's pet one time only
allowSummonPet :DEV:SGM:GM: // autorize player to summon it's pet one time per pet
@ -121,6 +124,14 @@ farTPReturn :DEV:SGM:GM:VG:SG:EM: // used to tp back to your previous sessio
characterMissionDump :DEV:SGM:GM: //Dump mission list for a character
removeMission :DEV:SGM:GM: //Remove a mission of a character
addMission :DEV:SGM:GM: //add a mission to a character
characterInventoryDump :DEV:SGM:GM:EM: // Dump character inventory info: <inventory> <from slot> <to slot>
deleteInventoryItem :DEV:SGM:GM:EM: // Delete an item from a characters inventory: <inventory> <slot> <sheetname> <quality> <quantity>
lockItem // Lock/unlock item for trading, selling, destruction.
setTeamLeader // Set the team leader
setPetAnimalSatiety :DEV:SGM:GM:EM: // Set the satiety of pet animal (petIndex in 0..3): <petIndex> full|<value> [<nameForAnswer>]
getPetAnimalSatiety :DEV:SGM:GM:EM: // Get the satiety of pet animal (petIndex in 0..3): <petIndex> [<nameForAnswer>]
setPetAnimalName :DEV:SGM:GM:EM:EG: // Set the name of a pet animal (petIndex in 0..3): <petIndex> <name>
setSimplePhrase :DEV:SGM:GM:EM: // Set an IOS phrase: <id> <phrase> [<language code>]
// Variables
//
@ -138,6 +149,7 @@ Name :DEV:SGM:GM:EM: // Name of a player
Position :DEV:SGM:GM:VG:PR:OBSERVER:EM:EG: // Position of a player (in meters) <posx>,<posy>[,<posz>]] | <bot name> | <player name> | home
Priv :DEV: // User privilege
PriviledgePVP :DEV:SGM:GM:EM:EG: // Turns PVP on/off on character (blame coder for typo)
FullPVP :DEV:SGM:GM:EM:EG: // Turns Full PVP on/off on character (blame coder for typo)
RyzomDate :DEV:SGM:GM:EM: // Current ryzom date
RyzomTime :DEV:SGM:GM:EM: // Current ryzom time
@ -160,3 +172,8 @@ eventSetBotFameByKill :DEV:SGM:GM:EM: // Changes the amount of fame earned fo
eventSetBotURL :DEV:SGM:GM:EM: // Set the url of a bot
eventSetBotURLName :DEV:SGM:GM:EM: // Set the url name of a bot
eventSpawnToxic :DEV:SGM:GM:EM: // Add toxic cloud
eventNpcSay :DEV:SGM:GM:EM: // Have an NPC say a text
eventSetBotFacing :DEV:SGM:GM:EM: // Set the direction in which a bot faces
eventGiveControl :DEV:SGM:GM:EM: // Give control of entity A to entity B : <master eid> <slave eid>
eventLeaveControl :DEV:SGM:GM:EM: // Leave control of entity : <master eid>
resetName // Reset player's name; undo a temporary rename

@ -4720,9 +4720,6 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
if (command_args.size() < 4)
return false;
const CSheetId sheetId(command_args[1]);
if (sheetId == CSheetId::Unknown)
return false;
uint32 quality;
fromString(command_args[2], quality);
if (quality == 0)
@ -4755,7 +4752,22 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
}
}
CGameItemPtr new_item = c->createItem(quality, quantity, sheetId);
CGameItemPtr new_item;
string sheet = command_args[1];
if ( sheet.find(".sitem") == string::npos ) // try named item
{
new_item = CNamedItems::getInstance().createNamedItem(command_args[1], quantity);
if (new_item == NULL)
return true;
}
else
{
const CSheetId sheetId(sheet);
if (sheetId == CSheetId::Unknown)
return true;
new_item = c->createItem(quality, quantity, sheetId);
}
if (!c->addItemToInventory(inventory, new_item))
{

@ -705,9 +705,9 @@ public :
const CItemCraftParameters * getCraftParameters() const { return _CraftParameters; }
/// get custom string (for scroll-like items)
ucstring getCustomText() const { return _CustomText; }
const ucstring& getCustomText() const { return _CustomText; }
/// set custom string (for scroll-like items)
void setCustomText(ucstring val);
void setCustomText(const ucstring &val);
uint8 getPetIndex() const { return _PetIndex; }
void setPetIndex(uint8 val) { _PetIndex = val; }

@ -11423,7 +11423,7 @@ void CCharacter::setBerserkFlag(bool isBerserk)
}
else
{
sint8 percentTmp = sint8( (100.0 * ( target->getPhysScores()._PhysicalScores[ SCORES::hit_points ].Current ) ) / ( target->getPhysScores()._PhysicalScores[ SCORES::hit_points ].Max ) );
sint8 percentTmp = sint8( (127.0 * ( target->getPhysScores()._PhysicalScores[ SCORES::hit_points ].Current ) ) / ( target->getPhysScores()._PhysicalScores[ SCORES::hit_points ].Max ) );
if( percentTmp < 0 )
percent = 0;
else
@ -14846,16 +14846,12 @@ void CCharacter::addRoomAccessToPlayer(const NLMISC::CEntityId &id)
//--------------------------------------------------------------
void CCharacter::addPlayerToFriendList(const NLMISC::CEntityId &id)
{
/*// if player not found
if (id == CEntityId::Unknown || PlayerManager.getChar(id)==NULL)
// if player not found
if (id == CEntityId::Unknown)
{
if ( ! (IShardUnifierEvent::getInstance() && IShardUnifierEvent::getInstance()->isCharacterOnlineAbroad(id)))
{
// player not found => message
PHRASE_UTILITIES::sendDynamicSystemMessage( _EntityRowId, "OPERATION_OFFLINE");
return;
}
}*/
PHRASE_UTILITIES::sendDynamicSystemMessage( _EntityRowId, "OPERATION_OFFLINE");
return;
}
// check not already in list
const uint size = (uint)_FriendsList.size();
@ -14923,15 +14919,11 @@ void CCharacter::addPlayerToFriendList(const NLMISC::CEntityId &id)
void CCharacter::addPlayerToLeagueList(const NLMISC::CEntityId &id)
{
// if player not found
/*if (id == CEntityId::Unknown || PlayerManager.getChar(id)==NULL)
if (id == CEntityId::Unknown)
{
if ( ! (IShardUnifierEvent::getInstance() && IShardUnifierEvent::getInstance()->isCharacterOnlineAbroad(id)))
{
// player not found => message
PHRASE_UTILITIES::sendDynamicSystemMessage( _EntityRowId, "OPERATION_OFFLINE");
return;
}
}*/
PHRASE_UTILITIES::sendDynamicSystemMessage( _EntityRowId, "OPERATION_OFFLINE");
return;
}
// check not already in list
const uint size = _LeagueList.size();
@ -14972,7 +14964,7 @@ void CCharacter::addPlayerToLeagueList(const NLMISC::CEntityId &id)
if ( ! GenericMsgManager.pushNameToStream( "TEAM:CONTACT_CREATE", bms) )
{
nlwarning("<CEntityBase::addPlayerToFriendList> Msg name TEAM:CONTACT_CREATE not found");
nlwarning("<CEntityBase::addPlayerToLeagueList> Msg name TEAM:CONTACT_CREATE not found");
return;
}

@ -2391,9 +2391,9 @@ public:
void haveToUpdateItemsPrerequisit( bool b );
void channelAdded( bool b );
bool isChannelAdded();
bool isChannelAdded() const;
uint8 getNbUserChannels() { return _NbUserChannels; };
uint8 getNbUserChannels() const { return _NbUserChannels; };
void addUserChannel() { _NbUserChannels++; };
void removeUserChannel() { _NbUserChannels--; };
@ -2403,7 +2403,7 @@ public:
bool isAnActiveXpCatalyser( CGameItemPtr item );
void setShowFactionChannelsMode(TChanID channel, bool s);
bool showFactionChannelsMode(TChanID channel);
bool showFactionChannelsMode(TChanID channel) const;
// from offline command
void contactListRefChangeFromCommand(const NLMISC::CEntityId &id, const std::string &operation);

@ -911,7 +911,7 @@ inline const std::list<TCharacterLogTime>& CCharacter::getLastLogStats() const
//------------------------------------------------------------------------------
inline bool CCharacter::isChannelAdded()
inline bool CCharacter::isChannelAdded() const
{
return _ChannelAdded;
}

@ -1,5 +1,13 @@
FILE(GLOB SRC *.cpp *.h)
FILE(GLOB R2
r2_*.h r2_*.cpp)
LIST(REMOVE_ITEM SRC R2)
SOURCE_GROUP("" FILES ${SRC})
SOURCE_GROUP("R2" FILES ${R2})
NL_TARGET_LIB(ryzom_servershare ${SRC})
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${MYSQL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})

Loading…
Cancel
Save