Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Core/Build: Enable Clang PCH support and OS X specific features

Core: Fix warnings here and there
  • Loading branch information...
commit 333b8e5159ada2f1b8cbfd1dd8eb9072754477d7 1 parent 90c9580
@Spp- Spp- authored
Showing with 517 additions and 952 deletions.
  1. +3 −1 .gitignore
  2. +15 −0 cmake/compiler/clang/settings.cmake
  3. +10 −10 cmake/compiler/gcc/settings.cmake
  4. +0 −2  cmake/compiler/xcode/settings.cmake
  5. +0 −180 cmake/macros/FindOpenSSL.cmake
  6. +94 −305 cmake/macros/FindPCHSupport.cmake
  7. +5 −3 cmake/platform/osx/settings.cmake
  8. +1 −0  cmake/platform/unix/settings.cmake
  9. +9 −31 src/server/authserver/CMakeLists.txt
  10. +3 −3 src/server/authserver/Server/AuthSocket.cpp
  11. +1 −1  src/server/authserver/Server/RealmSocket.cpp
  12. +1 −1  src/server/authserver/Server/RealmSocket.h
  13. +11 −17 src/server/collision/CMakeLists.txt
  14. +1 −1  src/server/collision/RegularGrid.h
  15. +0 −1  src/server/game/Achievements/AchievementMgr.cpp
  16. +2 −0  src/server/game/Battlefield/Battlefield.h
  17. +4 −4 src/server/game/Battlefield/Zones/BattlefieldWG.h
  18. +11 −18 src/server/game/CMakeLists.txt
  19. +138 −142 src/server/game/DataStores/DBCEnums.h
  20. +2 −2 src/server/game/Handlers/ChatHandler.cpp
  21. +6 −6 src/server/game/Handlers/PetHandler.cpp
  22. +1 −1  src/server/game/Maps/MapUpdater.cpp
  23. +4 −10 src/server/game/Movement/MovementGenerator.h
  24. +11 −11 src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
  25. +4 −4 src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h
  26. +12 −12 src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
  27. +4 −4 src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h
  28. +4 −4 src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp
  29. +4 −4 src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h
  30. +12 −12 src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp
  31. +4 −4 src/server/game/Movement/MovementGenerators/PointMovementGenerator.h
  32. +5 −5 src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
  33. +4 −4 src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h
  34. +23 −23 src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
  35. +7 −7 src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h
  36. +9 −9 src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
  37. +8 −8 src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h
  38. +1 −1  src/server/game/Server/WorldSession.h
  39. +3 −3 src/server/game/Texts/CreatureTextMgr.cpp
  40. +6 −6 src/server/game/Texts/CreatureTextMgr.h
  41. +10 −18 src/server/scripts/CMakeLists.txt
  42. +1 −1  src/server/scripts/Commands/cs_wp.cpp
  43. +2 −2 src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
  44. +1 −1  src/server/scripts/Northrend/wintergrasp.cpp
  45. +26 −26 src/server/shared/AutoPtr.h
  46. +10 −15 src/server/shared/CMakeLists.txt
  47. +2 −2 src/server/shared/Cryptography/BigNumber.cpp
  48. +2 −2 src/server/shared/Cryptography/BigNumber.h
  49. +5 −1 src/server/shared/Database/PreparedStatement.h
  50. +0 −1  src/server/shared/Database/QueryResult.h
  51. +1 −1  src/server/shared/Threading/DelayExecutor.cpp
  52. +1 −1  src/server/shared/Threading/DelayExecutor.h
  53. +13 −21 src/server/worldserver/CMakeLists.txt
View
4 .gitignore
@@ -7,10 +7,12 @@ build*/
*~
.hg/
*.kdev*
+.DS_Store
+CMakeLists.txt.user
*.bak
*.patch
*.diff
*.REMOTE.*
*.BACKUP.*
*.BASE.*
-*.LOCAL.*
+*.LOCAL.*
View
15 cmake/compiler/clang/settings.cmake
@@ -0,0 +1,15 @@
+# Set build-directive (used in core to tell which buildtype we used)
+add_definitions(-D_BUILD_DIRECTIVE='"$(CONFIGURATION)"')
+
+if(WITH_WARNINGS)
+ set(WARNING_FLAGS "-W -Wall -Wextra -Wwrite-strings -Winit-self -Woverloaded-virtual -Wfatal-errors")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS}")
+ message(STATUS "Clang: All warnings enabled")
+endif()
+
+if(WITH_COREDEBUG)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
+ message(STATUS "Clang: Debug-flags set (-g3)")
+endif()
View
20 cmake/compiler/gcc/settings.cmake
@@ -1,24 +1,24 @@
# Set build-directive (used in core to tell which buildtype we used)
add_definitions(-D_BUILD_DIRECTIVE='"${CMAKE_BUILD_TYPE}"')
-add_definitions(-fno-delete-null-pointer-checks)
-
if(PLATFORM EQUAL 32)
# Required on 32-bit systems to enable SSE2 (standard on x64)
- add_definitions(-msse2 -mfpmath=sse)
+ set(SSE_FLAGS "-msse2 -mfpmath=sse")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SSE_FLAGS}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SSE_FLAGS}")
endif()
add_definitions(-DHAVE_SSE2 -D__SSE2__)
-message(STATUS "GCC: SSE2 flags forced")
+message(STATUS "GCC: SFMT enabled, SSE2 flags forced")
if( WITH_WARNINGS )
- add_definitions(-Wall -Wfatal-errors -Wextra)
+ set(WARNING_FLAGS "-W -Wall -Wextra -Wwrite-strings -Winit-self -Woverloaded-virtual -Winvalid-pch -Wfatal-errors")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS}")
message(STATUS "GCC: All warnings enabled")
-else()
- add_definitions(--no-warnings)
- message(STATUS "GCC: All warnings disabled")
endif()
if( WITH_COREDEBUG )
- add_definitions(-ggdb3)
- message(STATUS "GCC: Debug-flags set (-ggdb3)")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
+ message(STATUS "GCC: Debug-flags set (-g3)")
endif()
View
2  cmake/compiler/xcode/settings.cmake
@@ -1,2 +0,0 @@
-# Set build-directive (used in core to tell which buildtype we used)
-add_definitions(-D_BUILD_DIRECTIVE='"$(CONFIGURATION)"')
View
180 cmake/macros/FindOpenSSL.cmake
@@ -1,180 +0,0 @@
-# - Try to find the OpenSSL encryption library
-# Once done this will define
-#
-# OPENSSL_ROOT_DIR - Set this variable to the root installation of OpenSSL
-#
-# Read-Only variables:
-# OPENSSL_FOUND - system has the OpenSSL library
-# OPENSSL_INCLUDE_DIR - the OpenSSL include directory
-# OPENSSL_LIBRARIES - The libraries needed to use OpenSSL
-
-#=============================================================================
-# Copyright 2006-2009 Kitware, Inc.
-# Copyright 2006 Alexander Neundorf <neundorf@kde.org>
-# Copyright 2009-2010 Mathieu Malaterre <mathieu.malaterre@gmail.com>
-#
-# 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 distributed this file outside of CMake, substitute the full
-# License text for the above reference.)
-
-# http://www.slproweb.com/products/Win32OpenSSL.html
-
-SET(_OPENSSL_ROOT_HINTS
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]"
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]"
- )
-
-IF(PLATFORM EQUAL 64)
- SET(_OPENSSL_ROOT_PATHS
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;InstallLocation]"
- "C:/OpenSSL-Win64/"
- "C:/OpenSSL/"
- )
-ELSE()
- SET(_OPENSSL_ROOT_PATHS
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]"
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]"
- "C:/OpenSSL/"
- )
-ENDIF()
-
-FIND_PATH(OPENSSL_ROOT_DIR
- NAMES
- include/openssl/ssl.h
- HINTS
- ${_OPENSSL_ROOT_HINTS}
- PATHS
- ${_OPENSSL_ROOT_PATHS}
-)
-MARK_AS_ADVANCED(OPENSSL_ROOT_DIR)
-
-# Re-use the previous path:
-FIND_PATH(OPENSSL_INCLUDE_DIR openssl/ssl.h
- ${OPENSSL_ROOT_DIR}/include
-)
-
-IF(WIN32 AND NOT CYGWIN)
- # MINGW should go here too
- IF(MSVC)
- # /MD and /MDd are the standard values - if someone wants to use
- # others, the libnames have to change here too
- # use also ssl and ssleay32 in debug as fallback for openssl < 0.9.8b
- # TODO: handle /MT and static lib
- # In Visual C++ naming convention each of these four kinds of Windows libraries has it's standard suffix:
- # * MD for dynamic-release
- # * MDd for dynamic-debug
- # * MT for static-release
- # * MTd for static-debug
-
- # Implementation details:
- # We are using the libraries located in the VC subdir instead of the parent directory eventhough :
- # libeay32MD.lib is identical to ../libeay32.lib, and
- # ssleay32MD.lib is identical to ../ssleay32.lib
-
- FIND_LIBRARY(LIB_EAY_DEBUG
- NAMES
- libeay32MDd libeay32
- PATHS
- ${OPENSSL_ROOT_DIR}/lib/VC
- )
-
- FIND_LIBRARY(LIB_EAY_RELEASE
- NAMES
- libeay32MD libeay32
- PATHS
- ${OPENSSL_ROOT_DIR}/lib/VC
- )
-
- FIND_LIBRARY(SSL_EAY_DEBUG
- NAMES
- ssleay32MDd ssleay32 ssl
- PATHS
- ${OPENSSL_ROOT_DIR}/lib/VC
- )
-
- FIND_LIBRARY(SSL_EAY_RELEASE
- NAMES
- ssleay32MD ssleay32 ssl
- PATHS
- ${OPENSSL_ROOT_DIR}/lib/VC
- )
-
- if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
- set( OPENSSL_LIBRARIES
- optimized ${SSL_EAY_RELEASE} ${LIB_EAY_RELEASE}
- debug ${SSL_EAY_DEBUG} ${LIB_EAY_DEBUG}
- )
- else()
- set( OPENSSL_LIBRARIES
- ${SSL_EAY_RELEASE}
- ${LIB_EAY_RELEASE}
- )
- endif()
-
- MARK_AS_ADVANCED(SSL_EAY_DEBUG SSL_EAY_RELEASE LIB_EAY_DEBUG LIB_EAY_RELEASE)
- ELSEIF(MINGW)
-
- # same player, for MingW
- FIND_LIBRARY(LIB_EAY
- NAMES
- libeay32
- PATHS
- ${OPENSSL_ROOT_DIR}/lib/MinGW
- )
-
- FIND_LIBRARY(SSL_EAY NAMES
- NAMES
- ssleay32
- PATHS
- ${OPENSSL_ROOT_DIR}/lib/MinGW
- )
-
- MARK_AS_ADVANCED(SSL_EAY LIB_EAY)
-
- set( OPENSSL_LIBRARIES
- ${SSL_EAY}
- ${LIB_EAY}
- )
- ELSE(MSVC)
- # Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues:
- FIND_LIBRARY(LIB_EAY
- NAMES
- libeay32
- PATHS
- ${OPENSSL_ROOT_DIR}/lib
- ${OPENSSL_ROOT_DIR}/lib/VC
- )
-
- FIND_LIBRARY(SSL_EAY
- NAMES
- ssleay32
- PATHS
- ${OPENSSL_ROOT_DIR}/lib
- ${OPENSSL_ROOT_DIR}/lib/VC
- )
- MARK_AS_ADVANCED(SSL_EAY LIB_EAY)
-
- SET( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
- ENDIF(MSVC)
-ELSE(WIN32 AND NOT CYGWIN)
- FIND_LIBRARY(OPENSSL_SSL_LIBRARIES NAMES ssl ssleay32 ssleay32MD)
- FIND_LIBRARY(OPENSSL_CRYPTO_LIBRARIES NAMES crypto)
- MARK_AS_ADVANCED(OPENSSL_CRYPTO_LIBRARIES OPENSSL_SSL_LIBRARIES)
-
- SET(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARIES})
-
-ENDIF(WIN32 AND NOT CYGWIN)
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(OpenSSL DEFAULT_MSG
- OPENSSL_LIBRARIES
- OPENSSL_INCLUDE_DIR
-)
-
-MARK_AS_ADVANCED(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)
View
399 cmake/macros/FindPCHSupport.cmake
@@ -1,315 +1,104 @@
-# - Try to find precompiled headers support for GCC 3.4 and 4.x (and MSVC)
-# Once done this will define:
-#
-# Variable:
-# PCHSupport_FOUND
-#
-# Macro:
-# ADD_PRECOMPILED_HEADER _targetName _input _dowarn
-# ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use _dowarn
-# ADD_NATIVE_PRECOMPILED_HEADER _targetName _input _dowarn
-# GET_NATIVE_PRECOMPILED_HEADER _targetName _input
+FUNCTION(GET_COMMON_PCH_PARAMS PCH_HEADER PCH_FE INCLUDE_PREFIX)
+ GET_FILENAME_COMPONENT(PCH_HEADER_N ${PCH_HEADER} NAME)
+ GET_DIRECTORY_PROPERTY(TARGET_INCLUDES INCLUDE_DIRECTORIES)
+
+ FOREACH(ITEM ${TARGET_INCLUDES})
+ LIST(APPEND INCLUDE_FLAGS_LIST "${INCLUDE_PREFIX}${ITEM} ")
+ ENDFOREACH(ITEM)
+
+ SET(PCH_HEADER_NAME ${PCH_HEADER_N} PARENT_SCOPE)
+ SET(PCH_HEADER_OUT ${CMAKE_CURRENT_BINARY_DIR}/${PCH_HEADER_N}.${PCH_FE} PARENT_SCOPE)
+ SET(INCLUDE_FLAGS ${INCLUDE_FLAGS_LIST} PARENT_SCOPE)
+ENDFUNCTION(GET_COMMON_PCH_PARAMS)
+
+FUNCTION(GENERATE_CXX_PCH_COMMAND TARGET_NAME INCLUDE_FLAGS IN PCH_SRC OUT)
+ IF (CMAKE_BUILD_TYPE)
+ STRING(TOUPPER _${CMAKE_BUILD_TYPE} CURRENT_BUILD_TYPE)
+ ENDIF ()
+
+ SET(COMPILE_FLAGS ${CMAKE_CXX_FLAGS${CURRENT_BUILD_TYPE}})
+ LIST(APPEND COMPILE_FLAGS ${CMAKE_CXX_FLAGS})
+
+ IF ("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
+ IF (NOT "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
+ LIST(APPEND COMPILE_FLAGS "-arch ${CMAKE_OSX_ARCHITECTURES}")
+ ENDIF ()
+ IF (NOT "${CMAKE_OSX_SYSROOT}" STREQUAL "")
+ LIST(APPEND COMPILE_FLAGS "-isysroot ${CMAKE_OSX_SYSROOT}")
+ ENDIF ()
+ IF (NOT "${CMAKE_OSX_DEPLOYMENT_TARGET}" STREQUAL "")
+ LIST(APPEND COMPILE_FLAGS "-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
+ ENDIF ()
+ ENDIF ()
+
+ GET_DIRECTORY_PROPERTY(TARGET_DEFINITIONS COMPILE_DEFINITIONS)
+ FOREACH(ITEM ${TARGET_DEFINITIONS})
+ LIST(APPEND DEFINITION_FLAGS "-D${ITEM} ")
+ ENDFOREACH(ITEM)
+
+ SEPARATE_ARGUMENTS(COMPILE_FLAGS)
+ SEPARATE_ARGUMENTS(INCLUDE_FLAGS)
+ SEPARATE_ARGUMENTS(DEFINITION_FLAGS)
+
+ GET_FILENAME_COMPONENT(PCH_SRC_N ${PCH_SRC} NAME)
+ ADD_LIBRARY(${PCH_SRC_N}_dephelp MODULE ${PCH_SRC})
-IF(CMAKE_COMPILER_IS_GNUCXX)
-
- EXEC_PROGRAM(
- ${CMAKE_CXX_COMPILER}
- ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
- OUTPUT_VARIABLE gcc_compiler_version
- )
- #MESSAGE("GCC Version: ${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]")
- SET(PCHSupport_FOUND TRUE)
- ENDIF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]")
- ENDIF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
-
- 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)
-
-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)
- GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE)
- IF(${_targetType} STREQUAL SHARED_LIBRARY AND NOT WIN32)
- LIST(APPEND ${_out_compile_flags} -fPIC)
- ENDIF()
-
- ELSE(CMAKE_COMPILER_IS_GNUCXX)
- ## TODO ... ? or does it work out of the box
- ENDIF(CMAKE_COMPILER_IS_GNUCXX)
-
- GET_DIRECTORY_PROPERTY(DIRINC INCLUDE_DIRECTORIES )
- FOREACH(item ${DIRINC})
- LIST(APPEND ${_out_compile_flags} "${_PCH_include_prefix}${item}")
- ENDFOREACH(item)
-
- GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS)
- GET_DIRECTORY_PROPERTY(_global_definitions DIRECTORY ${CMAKE_SOURCE_DIR} DEFINITIONS)
- #MESSAGE("_directory_flags ${_directory_flags} ${_global_definitions}" )
- LIST(APPEND ${_out_compile_flags} ${_directory_flags})
- LIST(APPEND ${_out_compile_flags} ${_global_definitions})
- LIST(APPEND ${_out_compile_flags} ${CMAKE_CXX_FLAGS} )
-
- SEPARATE_ARGUMENTS(${_out_compile_flags})
-
-ENDMACRO(_PCH_GET_COMPILE_FLAGS)
-
-MACRO(_PCH_WRITE_PCHDEP_CXX _targetName _include_file _dephelp)
-
- SET(${_dephelp} ${CMAKE_CURRENT_BINARY_DIR}/${_targetName}_pch_dephelp.cxx)
- FILE(WRITE ${${_dephelp}}
-"#include \"${_include_file}\"
-int testfunction()
-{
- return 0;
-}
-"
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${OUT}
+ COMMAND ${CMAKE_CXX_COMPILER}
+ ARGS ${DEFINITION_FLAGS} ${COMPILE_FLAGS} ${INCLUDE_FLAGS} -x c++-header ${IN} -o ${OUT}
+ DEPENDS ${IN} ${PCH_SRC_N}_dephelp
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
-ENDMACRO(_PCH_WRITE_PCHDEP_CXX )
-
-MACRO(_PCH_GET_COMPILE_COMMAND out_command _input _output)
-
- FILE(TO_NATIVE_PATH ${_input} _native_input)
- FILE(TO_NATIVE_PATH ${_output} _native_output)
-
-
- IF(CMAKE_COMPILER_IS_GNUCXX)
- IF(CMAKE_CXX_COMPILER_ARG1)
- # remove leading space in compiler argument
- STRING(REGEX REPLACE "^ +" "" pchsupport_compiler_cxx_arg1 ${CMAKE_CXX_COMPILER_ARG1})
-
- SET(${out_command}
- ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input}
- )
- ELSE(CMAKE_CXX_COMPILER_ARG1)
- SET(${out_command}
- ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input}
- )
- ENDIF(CMAKE_CXX_COMPILER_ARG1)
- ELSE(CMAKE_COMPILER_IS_GNUCXX)
-
- SET(_dummy_str "#include <${_input}>")
- FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/pch_dummy.cpp ${_dummy_str})
-
- SET(${out_command}
- ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} /c /Fp${_native_output} /Yc${_native_input} pch_dummy.cpp
- )
- #/out:${_output}
-
- ENDIF(CMAKE_COMPILER_IS_GNUCXX)
-
-ENDMACRO(_PCH_GET_COMPILE_COMMAND )
-
-
-
-MACRO(_PCH_GET_TARGET_COMPILE_FLAGS _cflags _header_name _pch_path _dowarn )
-
- FILE(TO_NATIVE_PATH ${_pch_path} _native_pch_path)
-
- IF(CMAKE_COMPILER_IS_GNUCXX)
- # for use with distcc and gcc >4.0.1 if preprocessed files are accessible
- # on all remote machines set
- # PCH_ADDITIONAL_COMPILER_FLAGS to -fpch-preprocess
- # if you want warnings for invalid header files (which is very inconvenient
- # if you have different versions of the headers for different build types
- # you may set _pch_dowarn
- IF (_dowarn)
- SET(${_cflags} "${PCH_ADDITIONAL_COMPILER_FLAGS} -include ${CMAKE_CURRENT_BINARY_DIR}/${_header_name} -Winvalid-pch " )
- ELSE (_dowarn)
- SET(${_cflags} "${PCH_ADDITIONAL_COMPILER_FLAGS} -include ${CMAKE_CURRENT_BINARY_DIR}/${_header_name} " )
- ENDIF (_dowarn)
- ELSE(CMAKE_COMPILER_IS_GNUCXX)
-
- set(${_cflags} "/Fp${_native_pch_path} /Yu${_header_name}" )
-
- ENDIF(CMAKE_COMPILER_IS_GNUCXX)
-
-ENDMACRO(_PCH_GET_TARGET_COMPILE_FLAGS )
-
-MACRO(GET_PRECOMPILED_HEADER_OUTPUT _targetName _input _output)
- GET_FILENAME_COMPONENT(_name ${_input} NAME)
- GET_FILENAME_COMPONENT(_path ${_input} PATH)
- SET(_output "${CMAKE_CURRENT_BINARY_DIR}/${_name}.gch/${_targetName}_${CMAKE_BUILD_TYPE}.gch")
-ENDMACRO(GET_PRECOMPILED_HEADER_OUTPUT _targetName _input)
-
-
-MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use )
-
- # to do: test whether compiler flags match between target _targetName
- # and _pch_output_to_use
- GET_FILENAME_COMPONENT(_name ${_input} NAME)
-
- IF( "${ARGN}" STREQUAL "0")
- SET(_dowarn 0)
- ELSE( "${ARGN}" STREQUAL "0")
- SET(_dowarn 1)
- ENDIF("${ARGN}" STREQUAL "0")
+ ADD_CUSTOM_TARGET(generate_${PCH_SRC_N}
+ DEPENDS ${OUT}
+ )
+ ADD_DEPENDENCIES(${TARGET_NAME} generate_${PCH_SRC_N})
+ENDFUNCTION(GENERATE_CXX_PCH_COMMAND)
- _PCH_GET_TARGET_COMPILE_FLAGS(_target_cflags ${_name} ${_pch_output_to_use} ${_dowarn})
- # MESSAGE("Add flags ${_target_cflags} to ${_targetName} " )
- SET_TARGET_PROPERTIES(${_targetName}
- PROPERTIES
- COMPILE_FLAGS ${_target_cflags}
+FUNCTION(ADD_CXX_PCH_GCC TARGET_NAME PCH_HEADER PCH_SOURCE)
+ GET_COMMON_PCH_PARAMS(${PCH_HEADER} "gch" "-I")
+ GENERATE_CXX_PCH_COMMAND(${TARGET_NAME} "${INCLUDE_FLAGS}" ${PCH_HEADER} ${PCH_SOURCE} ${PCH_HEADER_OUT})
+ SET_TARGET_PROPERTIES(
+ ${TARGET_NAME} PROPERTIES
+ COMPILE_FLAGS "-include ${CMAKE_CURRENT_BINARY_DIR}/${PCH_HEADER_NAME}"
)
-
- ADD_CUSTOM_TARGET(pch_Generate_${_targetName}
- DEPENDS ${_pch_output_to_use}
+ENDFUNCTION(ADD_CXX_PCH_GCC)
+
+FUNCTION(ADD_CXX_PCH_CLANG TARGET_NAME PCH_HEADER PCH_SOURCE)
+ GET_COMMON_PCH_PARAMS(${PCH_HEADER} "pch" "-I")
+ GENERATE_CXX_PCH_COMMAND(${TARGET_NAME} "${INCLUDE_FLAGS}" ${PCH_HEADER} ${PCH_SOURCE} ${PCH_HEADER_OUT})
+ SET_TARGET_PROPERTIES(
+ ${TARGET_NAME} PROPERTIES
+ COMPILE_FLAGS "-include-pch ${PCH_HEADER_OUT}"
)
+ENDFUNCTION(ADD_CXX_PCH_CLANG)
- ADD_DEPENDENCIES(${_targetName} pch_Generate_${_targetName} )
-
-ENDMACRO(ADD_PRECOMPILED_HEADER_TO_TARGET)
-
-MACRO(ADD_PRECOMPILED_HEADER _targetName _input)
-
- SET(_PCH_current_target ${_targetName})
-
- IF(NOT CMAKE_BUILD_TYPE)
- MESSAGE(FATAL_ERROR
- "This is the ADD_PRECOMPILED_HEADER macro. "
- "You must set CMAKE_BUILD_TYPE!"
- )
- ENDIF(NOT CMAKE_BUILD_TYPE)
-
- IF( "${ARGN}" STREQUAL "0")
- SET(_dowarn 0)
- ELSE( "${ARGN}" STREQUAL "0")
- SET(_dowarn 1)
- ENDIF("${ARGN}" STREQUAL "0")
-
- GET_FILENAME_COMPONENT(_name ${_input} NAME)
- GET_FILENAME_COMPONENT(_path ${_input} PATH)
- GET_PRECOMPILED_HEADER_OUTPUT( ${_targetName} ${_input} _output)
-
- GET_FILENAME_COMPONENT(_outdir ${_output} PATH )
-
- GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE)
- _PCH_WRITE_PCHDEP_CXX(${_targetName} ${_input} _pch_dephelp_cxx)
-
- IF(${_targetType} STREQUAL SHARED_LIBRARY)
- ADD_LIBRARY(${_targetName}_pch_dephelp STATIC ${_pch_dephelp_cxx} )
- ELSE(${_targetType} STREQUAL SHARED_LIBRARY)
- ADD_LIBRARY(${_targetName}_pch_dephelp STATIC ${_pch_dephelp_cxx})
- ENDIF(${_targetType} STREQUAL SHARED_LIBRARY)
-
- FILE(MAKE_DIRECTORY ${_outdir})
-
- _PCH_GET_COMPILE_FLAGS(_compile_FLAGS)
-
- #MESSAGE("_compile_FLAGS: ${_compile_FLAGS}")
- #message("COMMAND ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input}")
- SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/${_name} PROPERTIES GENERATED 1)
- ADD_CUSTOM_COMMAND(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_name}
- COMMAND ${CMAKE_COMMAND} -E copy ${_input} ${CMAKE_CURRENT_BINARY_DIR}/${_name} # ensure same directory! Required by gcc
- DEPENDS ${_input}
+FUNCTION(ADD_CXX_PCH_MSVC TARGET_NAME PCH_HEADER PCH_SOURCE)
+ GET_COMMON_PCH_PARAMS(${PCH_HEADER} "pch" "/I")
+ SET_TARGET_PROPERTIES(
+ ${TARGET_NAME} PROPERTIES
+ COMPILE_FLAGS "/FI${PCH_HEADER_NAME} /Yu${PCH_HEADER_NAME}"
)
-
- #message("_command ${_input} ${_output}")
- _PCH_GET_COMPILE_COMMAND(_command ${CMAKE_CURRENT_BINARY_DIR}/${_name} ${_output} )
-
- #message(${_input} )
- #message("_output ${_output}")
-
- ADD_CUSTOM_COMMAND(
- OUTPUT ${_output}
- COMMAND ${_command}
- DEPENDS ${_input} ${CMAKE_CURRENT_BINARY_DIR}/${_name} ${_targetName}_pch_dephelp
+ SET_SOURCE_FILES_PROPERTIES(
+ ${PCH_SOURCE} PROPERTIES
+ COMPILE_FLAGS "/Yc${PCH_HEADER_NAME}"
)
-
- ADD_PRECOMPILED_HEADER_TO_TARGET(${_targetName} ${_input} ${_output} ${_dowarn})
-ENDMACRO(ADD_PRECOMPILED_HEADER)
-
-# Generates the use of precompiled in a target,
-# without using depency targets (2 extra for each target)
-# Using Visual, must also add ${_targetName}_pch to sources
-# Not needed by Xcode
-
-MACRO(GET_NATIVE_PRECOMPILED_HEADER _targetName _input)
-
- if(CMAKE_GENERATOR MATCHES Visual*)
-
- SET(_dummy_str "#include \"${_input}\"\n"
- "// This is required to suppress LNK4221. Very annoying.\n"
- "void *g_${_targetName}Dummy = 0\;\n")
-
- # Use of cxx extension for generated files (as Qt does)
- SET(${_targetName}_pch ${CMAKE_CURRENT_BINARY_DIR}/${_targetName}_pch.cxx)
- if(EXISTS ${${_targetName}_pch})
- # Check if contents is the same, if not rewrite
- # todo
- else(EXISTS ${${_targetName}_pch})
- FILE(WRITE ${${_targetName}_pch} ${_dummy_str})
- endif(EXISTS ${${_targetName}_pch})
- endif(CMAKE_GENERATOR MATCHES Visual*)
-
-ENDMACRO(GET_NATIVE_PRECOMPILED_HEADER)
-
-MACRO(ADD_NATIVE_PRECOMPILED_HEADER _targetName _input)
-
- IF( "${ARGN}" STREQUAL "0")
- SET(_dowarn 0)
- ELSE( "${ARGN}" STREQUAL "0")
- SET(_dowarn 1)
- ENDIF("${ARGN}" STREQUAL "0")
-
- if(CMAKE_GENERATOR MATCHES Visual*)
- # 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)
-
- GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS)
- if (${oldProps} MATCHES NOTFOUND)
- SET(oldProps "")
- endif(${oldProps} MATCHES NOTFOUND)
-
- SET(newProperties "${oldProps} /Yu\"${_input}.h\" /FI\"${_input}.h\"")
- SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS "${newProperties}")
-
- #also inlude ${oldProps} to have the same compile options
- SET_SOURCE_FILES_PROPERTIES(${_input}.cpp PROPERTIES COMPILE_FLAGS "${oldProps} /Yc\"${_input}.h\"")
-
- 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 ${_input} 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} ${_input} ${_dowarn})
- endif(CMAKE_GENERATOR MATCHES Xcode)
- endif(CMAKE_GENERATOR MATCHES Visual*)
-
-ENDMACRO(ADD_NATIVE_PRECOMPILED_HEADER)
+ENDFUNCTION(ADD_CXX_PCH_MSVC)
+
+FUNCTION(ADD_CXX_PCH TARGET_NAME PCH_HEADER PCH_SOURCE)
+ IF (MSVC)
+ ADD_CXX_PCH_MSVC(${TARGET_NAME} ${PCH_HEADER} ${PCH_SOURCE})
+ ELSEIF ("${CMAKE_GENERATOR}" MATCHES "Xcode")
+ SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
+ XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER YES
+ XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/${PCH_HEADER}"
+ )
+ ELSEIF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+ ADD_CXX_PCH_CLANG(${TARGET_NAME} ${PCH_HEADER} ${PCH_SOURCE})
+ ELSEIF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
+ ADD_CXX_PCH_GCC(${TARGET_NAME} ${PCH_HEADER} ${PCH_SOURCE})
+ ENDIF ()
+ENDFUNCTION(ADD_CXX_PCH)
View
8 cmake/platform/osx/settings.cmake
@@ -1,6 +1,4 @@
set(MACOSX 1)
-set(OSX_LIBS /usr/lib/libcrypto.dylib)
-add_definitions(-D__ASSERTMACROS__)
# set default configuration directory
if( NOT CONF_DIR )
@@ -28,4 +26,8 @@ add_custom_target(uninstall
)
message(STATUS "OSX: Created uninstall target")
-include(${CMAKE_SOURCE_DIR}/cmake/compiler/xcode/settings.cmake)
+if (CMAKE_COMPILER_IS_GNUCC)
+ include(${CMAKE_SOURCE_DIR}/cmake/compiler/gcc/settings.cmake)
+elseif (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
+ include(${CMAKE_SOURCE_DIR}/cmake/compiler/clang/settings.cmake)
+endif()
View
1  cmake/platform/unix/settings.cmake
@@ -2,6 +2,7 @@
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
if (NOT NOJEM)
set(JEMALLOC_LIBRARY "jemalloc")
+ message(STATUS "UNIX: Using jemalloc")
endif()
endif()
View
40 src/server/authserver/CMakeLists.txt
@@ -15,15 +15,9 @@ file(GLOB_RECURSE sources_realms Realms/*.cpp Realms/*.h)
file(GLOB_RECURSE sources_server Server/*.cpp Server/*.h)
file(GLOB sources_localdir *.cpp *.h)
-if( USE_COREPCH )
- include_directories(${CMAKE_CURRENT_BINARY_DIR})
-endif()
-
-if ( USE_COREPCH AND MSVC )
- set(authserver_SRCS
- PrecompiledHeaders/authPCH.cpp
- PrecompiledHeaders/authPCH.h
- )
+if (USE_COREPCH)
+ set(authserver_PCH_HDR PrecompiledHeaders/authPCH.h)
+ set(authserver_PCH_SRC PrecompiledHeaders/authPCH.cpp)
endif()
set(authserver_SRCS
@@ -62,34 +56,23 @@ include_directories(
${OPENSSL_INCLUDE_DIR}
)
-set(authserver_LINK_FLAGS "")
-
add_executable(authserver
${authserver_SRCS}
+ ${authserver_PCH_SRC}
)
add_dependencies(authserver revision.h)
if( NOT WIN32 )
- add_definitions(-D_TRINITY_REALM_CONFIG='"${CONF_DIR}/authserver.conf"')
-endif()
-
-if( UNIX )
- set(authserver_LINK_FLAGS "-pthread ${authserver_LINK_FLAGS}")
-endif()
-
-if( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
- set(authserver_LINK_FLAGS "-framework Carbon ${authserver_LINK_FLAGS}")
+ set_target_properties(authserver PROPERTIES
+ COMPILE_DEFINITIONS _TRINITY_REALM_CONFIG="${CONF_DIR}/authserver.conf"
+ )
endif()
-set_target_properties(authserver PROPERTIES LINK_FLAGS "${authserver_LINK_FLAGS}")
-
target_link_libraries(authserver
shared
${MYSQL_LIBRARY}
${OPENSSL_LIBRARIES}
- ${OPENSSL_EXTRA_LIBRARIES}
- ${OSX_LIBS}
)
if( WIN32 )
@@ -108,11 +91,6 @@ elseif( WIN32 )
endif()
# Generate precompiled header
-if( USE_COREPCH )
- if(CMAKE_COMPILER_IS_GNUCXX)
- add_precompiled_header(authserver ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders/authPCH.h)
- elseif(MSVC)
- add_native_precompiled_header(authserver ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders/authPCH)
- endif()
+if (USE_COREPCH)
+ add_cxx_pch(authserver ${authserver_PCH_HDR} ${authserver_PCH_SRC})
endif()
-
View
6 src/server/authserver/Server/AuthSocket.cpp
@@ -280,7 +280,7 @@ void AuthSocket::_SetVSFields(const std::string& rI)
v = g.ModExp(x, N);
// No SQL injection (username escaped)
- const char *v_hex, *s_hex;
+ char *v_hex, *s_hex;
v_hex = v.AsHexStr();
s_hex = s.AsHexStr();
@@ -290,8 +290,8 @@ void AuthSocket::_SetVSFields(const std::string& rI)
stmt->setString(2, _login);
LoginDatabase.Execute(stmt);
- OPENSSL_free((void*)v_hex);
- OPENSSL_free((void*)s_hex);
+ OPENSSL_free(v_hex);
+ OPENSSL_free(s_hex);
}
// Logon Challenge command handler
View
2  src/server/authserver/Server/RealmSocket.cpp
@@ -79,7 +79,7 @@ int RealmSocket::open(void * arg)
return 0;
}
-int RealmSocket::close(int)
+int RealmSocket::close(u_long)
{
shutdown();
View
2  src/server/authserver/Server/RealmSocket.h
@@ -59,7 +59,7 @@ class RealmSocket : public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>
virtual int open(void *);
- virtual int close(int);
+ virtual int close(u_long);
virtual int handle_input(ACE_HANDLE = ACE_INVALID_HANDLE);
virtual int handle_output(ACE_HANDLE = ACE_INVALID_HANDLE);
View
28 src/server/collision/CMakeLists.txt
@@ -17,12 +17,10 @@ file(GLOB_RECURSE sources_Maps Maps/*.cpp Maps/*.h)
file(GLOB_RECURSE sources_Models Models/*.cpp Models/*.h)
file(GLOB sources_localdir *.cpp *.h)
-if( USE_COREPCH AND MSVC )
- set(collision_STAT_SRCS
- PrecompiledHeaders/collisionPCH.cpp
- PrecompiledHeaders/collisionPCH.h
- )
-endif()
+if (USE_COREPCH)
+ set(collision_STAT_PCH_HDR PrecompiledHeaders/collisionPCH.h)
+ set(collision_STAT_PCH_SRC PrecompiledHeaders/collisionPCH.cpp)
+endif ()
set(collision_STAT_SRCS
${collision_STAT_SRCS}
@@ -73,20 +71,16 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/Management
${CMAKE_CURRENT_SOURCE_DIR}/Maps
${CMAKE_CURRENT_SOURCE_DIR}/Models
- ${CMAKE_BINARY_DIR}
${ACE_INCLUDE_DIR}
${MYSQL_INCLUDE_DIR}
- ${OPENSSL_INCLUDE_DIR}
)
-add_library(collision STATIC ${collision_STAT_SRCS})
+add_library(collision STATIC
+ ${collision_STAT_SRCS}
+ ${collision_STAT_PCH_SRC}
+)
# Generate precompiled header
-if( USE_COREPCH )
- if(CMAKE_COMPILER_IS_GNUCXX)
- add_precompiled_header(collision ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders/collisionPCH.h)
- elseif(MSVC)
- add_native_precompiled_header(collision ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders/collisionPCH)
- endif()
-endif()
-
+if (USE_COREPCH)
+ add_cxx_pch(collision ${collision_STAT_PCH_HDR} ${collision_STAT_PCH_SRC})
+endif ()
View
2  src/server/collision/RegularGrid.h
@@ -86,7 +86,7 @@ class RegularGrid2D
static Cell ComputeCell(float fx, float fy)
{
- Cell c = {fx * (1.f/CELL_SIZE) + (CELL_NUMBER/2), fy * (1.f/CELL_SIZE) + (CELL_NUMBER/2)};
+ Cell c = { int(fx * (1.f/CELL_SIZE) + (CELL_NUMBER/2)), int(fy * (1.f/CELL_SIZE) + (CELL_NUMBER/2)) };
return c;
}
View
1  src/server/game/Achievements/AchievementMgr.cpp
@@ -1617,7 +1617,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
case ACHIEVEMENT_CRITERIA_TYPE_OWN_RANK:
case ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE:
case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE:
- case ACHIEVEMENT_CRITERIA_TYPE_TOTAL:
break; // Not implemented yet :(
}
View
2  src/server/game/Battlefield/Battlefield.h
@@ -79,6 +79,8 @@ class BfCapturePoint
public:
BfCapturePoint(Battlefield* bf);
+ virtual ~BfCapturePoint() { }
+
virtual void FillInitialWorldStates(WorldPacket& /*data*/) {}
// Send world state update to all players present
View
8 src/server/game/Battlefield/Zones/BattlefieldWG.h
@@ -153,10 +153,10 @@ class BfGraveyardWG : public BfGraveyard
public:
BfGraveyardWG(BattlefieldWG* Bf);
- void SetTextId(uint32 textid) { m_GossipTextId = textid; }
- uint32 GetTextId() { return m_GossipTextId; }
+ void SetTextId(int32 textid) { m_GossipTextId = textid; }
+ int32 GetTextId() { return m_GossipTextId; }
protected:
- uint32 m_GossipTextId;
+ int32 m_GossipTextId;
};
enum WGGraveyardId
@@ -227,7 +227,7 @@ struct BfWGCoordGY
float o;
uint32 gyid;
uint8 type;
- uint32 textid; // for gossip menu
+ int32 textid; // for gossip menu
TeamId startcontrol;
};
View
29 src/server/game/CMakeLists.txt
@@ -8,10 +8,6 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-if( USE_COREPCH )
- include_directories(${CMAKE_CURRENT_BINARY_DIR})
-endif()
-
file(GLOB_RECURSE sources_Accounts Accounts/*.cpp Accounts/*.h)
file(GLOB_RECURSE sources_Achievements Achievements/*.cpp Achievements/*.h)
file(GLOB_RECURSE sources_Addons Addons/*.cpp Addons/*.h)
@@ -55,12 +51,10 @@ file(GLOB_RECURSE sources_World World/*.cpp World/*.h)
# Create game-libary
-if( USE_COREPCH AND MSVC )
- set(game_STAT_SRCS
- PrecompiledHeaders/gamePCH.cpp
- PrecompiledHeaders/gamePCH.h
- )
-endif()
+if (USE_COREPCH)
+ set(game_STAT_PCH_HDR PrecompiledHeaders/gamePCH.h)
+ set(game_STAT_PCH_SRC PrecompiledHeaders/gamePCH.cpp)
+endif ()
set(game_STAT_SRCS
${game_STAT_SRCS}
@@ -205,15 +199,14 @@ include_directories(
${OPENSSL_INCLUDE_DIR}
)
-add_library(game STATIC ${game_STAT_SRCS})
+add_library(game STATIC
+ ${game_STAT_SRCS}
+ ${game_STAT_PCH_SRC}
+)
add_dependencies(game revision.h)
# Generate precompiled header
-if( USE_COREPCH )
- if(CMAKE_COMPILER_IS_GNUCXX)
- add_precompiled_header(game ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders/gamePCH.h)
- elseif(MSVC)
- add_native_precompiled_header(game ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders/gamePCH)
- endif()
-endif()
+if (USE_COREPCH)
+ add_cxx_pch(game ${game_STAT_PCH_HDR} ${game_STAT_PCH_SRC})
+endif ()
View
280 src/server/game/DataStores/DBCEnums.h
@@ -19,18 +19,21 @@
#ifndef DBCENUMS_H
#define DBCENUMS_H
-// Client expected level limitation, like as used in DBC item max levels for "until max player level"
-// use as default max player level, must be fit max level for used client
-// also see MAX_LEVEL and STRONG_MAX_LEVEL define
-#define DEFAULT_MAX_LEVEL 80
-
-// client supported max level for player/pets/etc. Avoid overflow or client stability affected.
-// also see GT_MAX_LEVEL define
-#define MAX_LEVEL 100
-
-// Server side limitation. Base at used code requirements.
-// also see MAX_LEVEL and GT_MAX_LEVEL define
-#define STRONG_MAX_LEVEL 255
+enum LevelLimit
+{
+ // Client expected level limitation, like as used in DBC item max levels for "until max player level"
+ // use as default max player level, must be fit max level for used client
+ // also see MAX_LEVEL and STRONG_MAX_LEVEL define
+ DEFAULT_MAX_LEVEL = 80,
+
+ // client supported max level for player/pets/etc. Avoid overflow or client stability affected.
+ // also see GT_MAX_LEVEL define
+ MAX_LEVEL = 100,
+
+ // Server side limitation. Base at used code requirements.
+ // also see MAX_LEVEL and GT_MAX_LEVEL define
+ STRONG_MAX_LEVEL = 255,
+};
enum BattlegroundBracketId // bracketId for level ranges
{
@@ -58,16 +61,16 @@ enum AchievementFaction
enum AchievementFlags
{
- ACHIEVEMENT_FLAG_COUNTER = 0x00000001, // Just count statistic (never stop and complete)
- ACHIEVEMENT_FLAG_HIDDEN = 0x00000002, // Not sent to client - internal use only
- ACHIEVEMENT_FLAG_STORE_MAX_VALUE = 0x00000004, // Store only max value? used only in "Reach level xx"
- ACHIEVEMENT_FLAG_SUMM = 0x00000008, // Use summ criteria value from all reqirements (and calculate max value)
- ACHIEVEMENT_FLAG_MAX_USED = 0x00000010, // Show max criteria (and calculate max value ??)
- ACHIEVEMENT_FLAG_REQ_COUNT = 0x00000020, // Use not zero req count (and calculate max value)
- ACHIEVEMENT_FLAG_AVERAGE = 0x00000040, // Show as average value (value / time_in_days) depend from other flag (by def use last criteria value)
- ACHIEVEMENT_FLAG_BAR = 0x00000080, // Show as progress bar (value / max vale) depend from other flag (by def use last criteria value)
- ACHIEVEMENT_FLAG_REALM_FIRST_REACH = 0x00000100, //
- ACHIEVEMENT_FLAG_REALM_FIRST_KILL = 0x00000200 //
+ ACHIEVEMENT_FLAG_COUNTER = 0x00000001, // Just count statistic (never stop and complete)
+ ACHIEVEMENT_FLAG_HIDDEN = 0x00000002, // Not sent to client - internal use only
+ ACHIEVEMENT_FLAG_STORE_MAX_VALUE = 0x00000004, // Store only max value? used only in "Reach level xx"
+ ACHIEVEMENT_FLAG_SUMM = 0x00000008, // Use summ criteria value from all requirements (and calculate max value)
+ ACHIEVEMENT_FLAG_MAX_USED = 0x00000010, // Show max criteria (and calculate max value ??)
+ ACHIEVEMENT_FLAG_REQ_COUNT = 0x00000020, // Use not zero req count (and calculate max value)
+ ACHIEVEMENT_FLAG_AVERAGE = 0x00000040, // Show as average value (value / time_in_days) depend from other flag (by def use last criteria value)
+ ACHIEVEMENT_FLAG_BAR = 0x00000080, // Show as progress bar (value / max vale) depend from other flag (by def use last criteria value)
+ ACHIEVEMENT_FLAG_REALM_FIRST_REACH = 0x00000100, //
+ ACHIEVEMENT_FLAG_REALM_FIRST_KILL = 0x00000200 //
};
#define MAX_CRITERIA_REQUIREMENTS 2
@@ -108,124 +111,117 @@ enum AchievementCriteriaTimedTypes
enum AchievementCriteriaTypes
{
- ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE = 0,
- ACHIEVEMENT_CRITERIA_TYPE_WIN_BG = 1,
- ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL = 5,
- ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL = 7,
- ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT = 8,
- ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT = 9,
- // you have to complete a daily quest x times in a row
- ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY = 10,
- ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE = 11,
- ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE = 13,
- ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST = 14,
- ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND= 15,
- ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP= 16,
- ACHIEVEMENT_CRITERIA_TYPE_DEATH= 17,
- ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON = 18,
- ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID = 19,
- ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE = 20,
- ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER = 23,
- ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING = 24,
- ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM = 26,
- ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST = 27,
- ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET = 28,
- ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL= 29,
- ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE = 30,
- ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA = 31,
- ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA = 32,
- ACHIEVEMENT_CRITERIA_TYPE_PLAY_ARENA = 33,
- ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL = 34,
- ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL = 35,
- ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM = 36,
- // TODO: the archievements 1162 and 1163 requires a special rating which can't be found in the dbc
- ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA = 37,
- ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_TEAM_RATING = 38,
- ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_PERSONAL_RATING = 39,
- ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL = 40,
- ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM = 41,
- ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM= 42,
- ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA = 43,
- ACHIEVEMENT_CRITERIA_TYPE_OWN_RANK= 44,
- ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT= 45,
- ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION= 46,
- ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION= 47,
- // noted: rewarded as soon as the player payed, not at taking place at the seat
- ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP= 48,
- ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM = 49,
- // TODO: itemlevel is mentioned in text but not present in dbc
- ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT = 50,
- ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT= 51,
- ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS = 52,
- ACHIEVEMENT_CRITERIA_TYPE_HK_RACE = 53,
- ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE = 54,
- ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE = 55,
- // TODO: in some cases map not present, and in some cases need do without die
- ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS = 56,
- ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM = 57,
- ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS = 59,
- ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TALENTS = 60,
- ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS = 61,
- ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD = 62,
- ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING = 63,
- ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER = 65,
- ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_MAIL = 66,
- ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY = 67,
- ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT = 68,
- ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2= 69,
- ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL= 70,
- ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT = 72,
- // TODO: title id is not mentioned in dbc
- ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE = 74,
- ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS= 75,
- ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL = 76,
- ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL = 77,
- // TODO: creature type (demon, undead etc.) is not stored in dbc
- ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE = 78,
- ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS= 80,
- ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION= 82,
- ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID= 83,
- ACHIEVEMENT_CRITERIA_TYPE_WON_AUCTIONS= 84,
- ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_SOLD = 85,
- ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_GOLD_VALUE_OWNED = 86,
- ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION = 87,
- ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION = 88,
- ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS = 89,
- ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM = 90,
- ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM = 91,
- ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED = 93,
- ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED = 94,
- ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALTH = 95,
- ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_POWER = 96,
- ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_STAT = 97,
- ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_SPELLPOWER = 98,
- ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_ARMOR = 99,
- ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_RATING = 100,
- ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_DEALT = 101,
- ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_RECEIVED = 102,
- ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED = 103,
- ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED = 104,
- ACHIEVEMENT_CRITERIA_TYPE_TOTAL_HEALING_RECEIVED = 105,
- ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED = 106,
- ACHIEVEMENT_CRITERIA_TYPE_QUEST_ABANDONED = 107,
- ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN = 108,
- ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE = 109,
- // TODO: target entry is missing
- ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2 = 110,
- ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE= 112,
- ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL = 113,
- ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS = 114,
- // 0..115 => 116 criteria types total
- ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS = 115,
+ ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE = 0,
+ ACHIEVEMENT_CRITERIA_TYPE_WIN_BG = 1,
+ ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL = 5,
+ ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL = 7,
+ ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT = 8,
+ ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT = 9,
+ ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY = 10, // you have to complete a daily quest x times in a row
+ ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE = 11,
+ ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE = 13,
+ ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST = 14,
+ ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND = 15,
+ ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP = 16,
+ ACHIEVEMENT_CRITERIA_TYPE_DEATH = 17,
+ ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON = 18,
+ ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID = 19,
+ ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE = 20,
+ ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER = 23,
+ ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING = 24,
+ ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM = 26,
+ ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST = 27,
+ ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET = 28,
+ ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL = 29,
+ ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE = 30,
+ ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA = 31,
+ ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA = 32,
+ ACHIEVEMENT_CRITERIA_TYPE_PLAY_ARENA = 33,
+ ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL = 34,
+ ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL = 35,
+ ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM = 36,
+ ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA = 37, // TODO: the archievements 1162 and 1163 requires a special rating which can't be found in the dbc
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_TEAM_RATING = 38,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_PERSONAL_RATING = 39,
+ ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL = 40,
+ ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM = 41,
+ ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM = 42,
+ ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA = 43,
+ ACHIEVEMENT_CRITERIA_TYPE_OWN_RANK = 44,
+ ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT = 45,
+ ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION = 46,
+ ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION = 47,
+ ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP = 48,
+ ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM = 49,
+ ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT = 50, // TODO: itemlevel is mentioned in text but not present in dbc
+ ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT = 51,
+ ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS = 52,
+ ACHIEVEMENT_CRITERIA_TYPE_HK_RACE = 53,
+ ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE = 54,
+ ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE = 55,
+ ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS = 56, // TODO: in some cases map not present, and in some cases need do without die
+ ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM = 57,
+ ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS = 59,
+ ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TALENTS = 60,
+ ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS = 61,
+ ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD = 62,
+ ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING = 63,
+ ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER = 65,
+ ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_MAIL = 66,
+ ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY = 67,
+ ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT = 68,
+ ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2 = 69,
+ ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL = 70,
+ ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT = 72,
+ // TODO 73: Achievements 1515, 1241, 1103 (Name: Mal'Ganis)
+ ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE = 74, // TODO: title id is not mentioned in dbc
+ ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS = 75,
+ ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL = 76,
+ ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL = 77,
+ ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE = 78,
+ ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS = 80,
+ ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION = 82,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID = 83,
+ ACHIEVEMENT_CRITERIA_TYPE_WON_AUCTIONS = 84,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_SOLD = 85,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_GOLD_VALUE_OWNED = 86,
+ ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION = 87,
+ ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION = 88,
+ ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS = 89,
+ ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM = 90,
+ ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM = 91,
+ ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED = 93,
+ ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED = 94,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALTH = 95,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_POWER = 96,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_STAT = 97,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_SPELLPOWER = 98,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_ARMOR = 99,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_RATING = 100,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_DEALT = 101,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_RECEIVED = 102,
+ ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED = 103,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED = 104,
+ ACHIEVEMENT_CRITERIA_TYPE_TOTAL_HEALING_RECEIVED = 105,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED = 106,
+ ACHIEVEMENT_CRITERIA_TYPE_QUEST_ABANDONED = 107,
+ ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN = 108,
+ ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE = 109,
+ ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2 = 110, // TODO: target entry is missing
+ ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE = 112,
+ ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL = 113,
+ ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS = 114,
+ ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS = 115,
ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS = 119,
// 120
// 121
// 122
// 123
// 0..123 => 124 criteria types total
- ACHIEVEMENT_CRITERIA_TYPE_TOTAL = 124
};
+#define ACHIEVEMENT_CRITERIA_TYPE_TOTAL 124
+
enum AchievementCategory
{
CATEGORY_CHILDRENS_WEEK = 163
@@ -286,7 +282,7 @@ enum Difficulty
enum SpawnMask
{
- SPAWNMASK_CONTINENT = (1 << REGULAR_DIFFICULTY), // any any maps without spawn modes
+ SPAWNMASK_CONTINENT = (1 << REGULAR_DIFFICULTY), // any maps without spawn modes
SPAWNMASK_DUNGEON_NORMAL = (1 << DUNGEON_DIFFICULTY_NORMAL),
SPAWNMASK_DUNGEON_HEROIC = (1 << DUNGEON_DIFFICULTY_HEROIC),
@@ -349,19 +345,19 @@ enum ItemEnchantmentType
enum ItemLimitCategoryMode
{
- ITEM_LIMIT_CATEGORY_MODE_HAVE = 0, // limit applied to amount items in inventory/bank
- ITEM_LIMIT_CATEGORY_MODE_EQUIP = 1 // limit applied to amount equipped items (including used gems)
+ ITEM_LIMIT_CATEGORY_MODE_HAVE = 0, // limit applied to amount items in inventory/bank
+ ITEM_LIMIT_CATEGORY_MODE_EQUIP = 1 // limit applied to amount equipped items (including used gems)
};
enum TotemCategoryType
{
- TOTEM_CATEGORY_TYPE_KNIFE = 1,
- TOTEM_CATEGORY_TYPE_TOTEM = 2,
- TOTEM_CATEGORY_TYPE_ROD = 3,
- TOTEM_CATEGORY_TYPE_PICK = 21,
- TOTEM_CATEGORY_TYPE_STONE = 22,
- TOTEM_CATEGORY_TYPE_HAMMER = 23,
- TOTEM_CATEGORY_TYPE_SPANNER = 24
+ TOTEM_CATEGORY_TYPE_KNIFE = 1,
+ TOTEM_CATEGORY_TYPE_TOTEM = 2,
+ TOTEM_CATEGORY_TYPE_ROD = 3,
+ TOTEM_CATEGORY_TYPE_PICK = 21,
+ TOTEM_CATEGORY_TYPE_STONE = 22,
+ TOTEM_CATEGORY_TYPE_HAMMER = 23,
+ TOTEM_CATEGORY_TYPE_SPANNER = 24
};
// SummonProperties.dbc, col 1
View
4 src/server/game/Handlers/ChatHandler.cpp
@@ -561,8 +561,8 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket& recvData)
// Only allow text-emotes for "dead" entities (feign death included)
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
break;
- GetPlayer()->HandleEmoteCommand(emote_anim);
- break;
+ GetPlayer()->HandleEmoteCommand(emote_anim);
+ break;
}
Unit* unit = ObjectAccessor::GetUnit(*_player, guid);
View
12 src/server/game/Handlers/PetHandler.cpp
@@ -32,7 +32,7 @@
#include "Group.h"
#include "SpellInfo.h"
-void WorldSession::HandleDismissCritter(WorldPacket &recvData)
+void WorldSession::HandleDismissCritter(WorldPacket& recvData)
{
uint64 guid;
recvData >> guid;
@@ -138,7 +138,7 @@ void WorldSession::HandlePetStopAttack(WorldPacket &recvData)
pet->AttackStop();
}
-void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid, uint16 flag, uint64 guid2)
+void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid, uint16 flag, uint64 guid2)
{
CharmInfo* charmInfo = pet->GetCharmInfo();
if (!charmInfo)
@@ -855,15 +855,15 @@ void WorldSession::SendPetNameInvalid(uint32 error, const std::string& name, Dec
SendPacket(&data);
}
-void WorldSession::HandlePetLearnTalent(WorldPacket & recvData)
+void WorldSession::HandlePetLearnTalent(WorldPacket& recvData)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_PET_LEARN_TALENT");
uint64 guid;
- uint32 talent_id, requested_rank;
- recvData >> guid >> talent_id >> requested_rank;
+ uint32 talentId, requestedRank;
+ recvData >> guid >> talentId >> requestedRank;
- _player->LearnPetTalent(guid, talent_id, requested_rank);
+ _player->LearnPetTalent(guid, talentId, requestedRank);
_player->SendTalentsInfoData(true);
}
View
2  src/server/game/Maps/MapUpdater.cpp
@@ -69,7 +69,7 @@ MapUpdater::~MapUpdater()
int MapUpdater::activate(size_t num_threads)
{
- return m_executor.activate((int)num_threads, new WDBThreadStartReq1, new WDBThreadEndReq1);
+ return m_executor.start((int)num_threads, new WDBThreadStartReq1, new WDBThreadEndReq1);
}
int MapUpdater::deactivate()
View
14 src/server/game/Movement/MovementGenerator.h
@@ -52,29 +52,23 @@ class MovementGeneratorMedium : public MovementGenerator
void Initialize(Unit &u)
{
//u->AssertIsType<T>();
- (static_cast<D*>(this))->Initialize(*((T*)&u));
+ (static_cast<D*>(this))->DoInitialize(*((T*)&u));
}
void Finalize(Unit &u)
{
//u->AssertIsType<T>();
- (static_cast<D*>(this))->Finalize(*((T*)&u));
+ (static_cast<D*>(this))->DoFinalize(*((T*)&u));
}
void Reset(Unit &u)
{
//u->AssertIsType<T>();
- (static_cast<D*>(this))->Reset(*((T*)&u));
+ (static_cast<D*>(this))->DoReset(*((T*)&u));
}
bool Update(Unit &u, const uint32& time_diff)
{
//u->AssertIsType<T>();
- return (static_cast<D*>(this))->Update(*((T*)&u), time_diff);
+ return (static_cast<D*>(this))->DoUpdate(*((T*)&u), time_diff);
}
- public:
- // will not link if not overridden in the generators
- void Initialize(T &u);
- void Finalize(T &u);
- void Reset(T &u);
- bool Update(T &u, const uint32& time_diff);
};
struct SelectableMovement : public FactoryHolder<MovementGenerator, MovementGeneratorType>
View
22 src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
@@ -30,7 +30,7 @@
#endif
template<class T>
-void ConfusedMovementGenerator<T>::Initialize(T &unit)
+void ConfusedMovementGenerator<T>::DoInitialize(T &unit)
{
unit.StopMoving();
float const wander_distance = 4;
@@ -100,7 +100,7 @@ void ConfusedMovementGenerator<Player>::_InitSpecific(Player &, bool &is_water_o
}
template<class T>
-void ConfusedMovementGenerator<T>::Reset(T &unit)
+void ConfusedMovementGenerator<T>::DoReset(T &unit)
{
i_nextMove = 1;
i_nextMoveTime.Reset(0);
@@ -109,7 +109,7 @@ void ConfusedMovementGenerator<T>::Reset(T &unit)
}
template<class T>
-bool ConfusedMovementGenerator<T>::Update(T &unit, const uint32 &diff)
+bool ConfusedMovementGenerator<T>::DoUpdate(T &unit, const uint32 &diff)
{
if (unit.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED))
return true;
@@ -149,14 +149,14 @@ bool ConfusedMovementGenerator<T>::Update(T &unit, const uint32 &diff)
}
template<>
-void ConfusedMovementGenerator<Player>::Finalize(Player &unit)
+void ConfusedMovementGenerator<Player>::DoFinalize(Player &unit)
{
unit.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
unit.ClearUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_CONFUSED_MOVE);
}
template<>
-void ConfusedMovementGenerator<Creature>::Finalize(Creature &unit)
+void ConfusedMovementGenerator<Creature>::DoFinalize(Creature &unit)
{
unit.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
unit.ClearUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_CONFUSED_MOVE);
@@ -164,10 +164,10 @@ void ConfusedMovementGenerator<Creature>::Finalize(Creature &unit)
unit.SetTarget(unit.getVictim()->GetGUID());
}
-template void ConfusedMovementGenerator<Player>::Initialize(Player &player);
-template void ConfusedMovementGenerator<Creature>::Initialize(Creature &creature);
-template void ConfusedMovementGenerator<Player>::Reset(Player &player);
-template void ConfusedMovementGenerator<Creature>::Reset(Creature &creature);
-template bool ConfusedMovementGenerator<Player>::Update(Player &player, const uint32 &diff);
-template bool ConfusedMovementGenerator<Creature>::Update(Creature &creature, const uint32 &diff);
+template void ConfusedMovementGenerator<Player>::DoInitialize(Player &player);
+template void ConfusedMovementGenerator<Creature>::DoInitialize(Creature &creature);
+template void ConfusedMovementGenerator<Player>::DoReset(Player &player);
+template void ConfusedMovementGenerator<Creature>::DoReset(Creature &creature);
+template bool ConfusedMovementGenerator<Player>::DoUpdate(Player &player, const uint32 &diff);
+template bool ConfusedMovementGenerator<Creature>::DoUpdate(Creature &creature, const uint32 &diff);
View
8 src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h
@@ -30,10 +30,10 @@ class ConfusedMovementGenerator : public MovementGeneratorMedium< T, ConfusedMov
public:
explicit ConfusedMovementGenerator() : i_nextMoveTime(0) {}
- void Initialize(T &);
- void Finalize(T &);
- void Reset(T &);
- bool Update(T &, const uint32 &);
+ void DoInitialize(T &);
+ void DoFinalize(T &);
+ void DoReset(T &);
+ bool DoUpdate(T &, const uint32 &);
MovementGeneratorType GetMovementGeneratorType() { return CONFUSED_MOTION_TYPE; }
private:
View
24 src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
@@ -282,7 +282,7 @@ bool FleeingMovementGenerator<T>::_setMoveData(T &owner)
}
template<class T>
-void FleeingMovementGenerator<T>::Initialize(T &owner)
+void FleeingMovementGenerator<T>::DoInitialize(T &owner)
{
if (!&owner)
return;
@@ -331,7 +331,7 @@ void FleeingMovementGenerator<Player>::_Init(Player &)
}
template<>
-void FleeingMovementGenerator<Player>::Finalize(Player &owner)
+void FleeingMovementGenerator<Player>::DoFinalize(Player &owner)
{
owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
owner.ClearUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE);
@@ -339,7 +339,7 @@ void FleeingMovementGenerator<Player>::Finalize(Player &owner)
}
template<>
-void FleeingMovementGenerator<Creature>::Finalize(Creature &owner)
+void FleeingMovementGenerator<Creature>::DoFinalize(Creature &owner)
{
owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
owner.ClearUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE);
@@ -348,13 +348,13 @@ void FleeingMovementGenerator<Creature>::Finalize(Creature &owner)
}
template<class T>
-void FleeingMovementGenerator<T>::Reset(T &owner)
+void FleeingMovementGenerator<T>::DoReset(T &owner)
{
- Initialize(owner);
+ DoInitialize(owner);
}
template<class T>
-bool FleeingMovementGenerator<T>::Update(T &owner, const uint32 &time_diff)
+bool FleeingMovementGenerator<T>::DoUpdate(T &owner, const uint32 &time_diff)
{
if (!&owner || !owner.isAlive())
return false;
@@ -371,18 +371,18 @@ bool FleeingMovementGenerator<T>::Update(T &owner, const uint32 &time_diff)
return true;
}
-template void FleeingMovementGenerator<Player>::Initialize(Player &);
-template void FleeingMovementGenerator<Creature>::Initialize(Creature &);
+template void FleeingMovementGenerator<Player>::DoInitialize(Player &);
+template void FleeingMovementGenerator<Creature>::DoInitialize(Creature &);
template bool FleeingMovementGenerator<Player>::_setMoveData(Player &);
template bool FleeingMovementGenerator<Creature>::_setMoveData(Creature &);
template bool FleeingMovementGenerator<Player>::_getPoint(Player &, float &, float &, float &);
template bool FleeingMovementGenerator<Creature>::_getPoint(Creature &, float &, float &, float &);
template void FleeingMovementGenerator<Player>::_setTargetLocation(Player &);
template void FleeingMovementGenerator<Creature>::_setTargetLocation(Creature &);
-template void FleeingMovementGenerator<Player>::Reset(Player &);
-template void FleeingMovementGenerator<Creature>::Reset(Creature &);
-template bool FleeingMovementGenerator<Player>::Update(Player &, const uint32 &);
-template bool FleeingMovementGenerator<Creature>::Update(Creature &, const uint32 &);
+template void FleeingMovementGenerator<Player>::DoReset(Player &);
+template void FleeingMovementGenerator<Creature>::DoReset(Creature &);
+template bool FleeingMovementGenerator<Player>::DoUpdate(Player &, const uint32 &);
+template bool FleeingMovementGenerator<Creature>::DoUpdate(Creature &, const uint32 &);
void TimedFleeingMovementGenerator::Finalize(Unit &owner)
{
View
8 src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h
@@ -27,10 +27,10 @@ class FleeingMovementGenerator : public MovementGeneratorMedium< T, FleeingMovem
public:
FleeingMovementGenerator(uint64 fright) : i_frightGUID(fright), i_nextCheckTime(0) {}
- void Initialize(T &);
- void Finalize(T &);
- void Reset(T &);
- bool Update(T &, const uint32 &);
+ void DoInitialize(T &);
+ void DoFinalize(T &);
+ void DoReset(T &);
+ bool DoUpdate(T &, const uint32 &);
MovementGeneratorType GetMovementGeneratorType() { return FLEEING_MOTION_TYPE; }
View
8 src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp
@@ -23,12 +23,12 @@
#include "MoveSplineInit.h"
#include "MoveSpline.h"
-void HomeMovementGenerator<Creature>::Initialize(Creature & owner)
+void HomeMovementGenerator<Creature>::DoInitialize(Creature & owner)
{
_setTargetLocation(owner);
}
-void HomeMovementGenerator<Creature>::Reset(Creature &)
+void HomeMovementGenerator<Creature>::DoReset(Creature &)
{
}
@@ -53,13 +53,13 @@ void HomeMovementGenerator<Creature>::_setTargetLocation(Creature & owner)
owner.ClearUnitState(UNIT_STATE_ALL_STATE & ~UNIT_STATE_EVADE);
}
-bool HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32 /*time_diff*/)
+bool HomeMovementGenerator<Creature>::DoUpdate(Creature &owner, const uint32 /*time_diff*/)
{
arrived = owner.movespline->Finalized();
return !arrived;
}
-void HomeMovementGenerator<Creature>::Finalize(Creature& owner)
+void HomeMovementGenerator<Creature>::DoFinalize(Creature& owner)
{
if (arrived)
{
View
8 src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h
@@ -34,10 +34,10 @@ class HomeMovementGenerator<Creature> : public MovementGeneratorMedium< Creature
HomeMovementGenerator() : arrived(false) {}
~HomeMovementGenerator() {}
- void Initialize(Creature &);
- void Finalize(Creature &);
- void Reset(Creature &);
- bool Update(Creature &, const uint32);
+ void DoInitialize(Creature &);
+ void DoFinalize(Creature &);
+ void DoReset(Creature &);
+ bool DoUpdate(Creature &, const uint32);
MovementGeneratorType GetMovementGeneratorType() { return HOME_MOTION_TYPE; }
private:
View
24 src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp
@@ -27,7 +27,7 @@
//----- Point Movement Generator
template<class T>
-void PointMovementGenerator<T>::Initialize(T &unit)
+void PointMovementGenerator<T>::DoInitialize(T &unit)
{
if (!unit.IsStopped())
unit.StopMoving();
@@ -42,7 +42,7 @@ void PointMovementGenerator<T>::Initialize(T &unit)
}
template<class T>
-bool PointMovementGenerator<T>::Update(T &unit, const uint32 & /*diff*/)
+bool PointMovementGenerator<T>::DoUpdate(T &unit, const uint32 & /*diff*/)
{
if (!&unit)
return false;
@@ -69,7 +69,7 @@ bool PointMovementGenerator<T>::Update(T &unit, const uint32 & /*diff*/)
}
template<class T>
-void PointMovementGenerator<T>::Finalize(T &unit)
+void PointMovementGenerator<T>::DoFinalize(T &unit)
{
unit.ClearUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
@@ -78,7 +78,7 @@ void PointMovementGenerator<T>::Finalize(T &unit)
}
template<class T>
-void PointMovementGenerator<T>::Reset(T &unit)
+void PointMovementGenerator<T>::DoReset(T &unit)
{
if (!unit.IsStopped())
unit.StopMoving();
@@ -97,14 +97,14 @@ template <> void PointMovementGenerator<Creature>::MovementInform(Creature &unit
unit.AI()->MovementInform(POINT_MOTION_TYPE, id);
}
-template void PointMovementGenerator<Player>::Initialize(Player&);
-template void PointMovementGenerator<Creature>::Initialize(Creature&);
-template void PointMovementGenerator<Player>::Finalize(Player&);
-template void PointMovementGenerator<Creature>::Finalize(Creature&);
-template void PointMovementGenerator<Player>::Reset(Player&);
-template void PointMovementGenerator<Creature>::Reset(Creature&);
-template bool PointMovementGenerator<Player>::Update(Player &, const uint32 &);
-template bool PointMovementGenerator<Creature>::Update(Creature&, const uint32 &);
+template void PointMovementGenerator<Player>::DoInitialize(Player&);
+template void PointMovementGenerator<Creature>::DoInitialize(Creature&);
+template void PointMovementGenerator<Player>::DoFinalize(Player&);
+template void PointMovementGenerator<Creature>::DoFinalize(Creature&);
+template void PointMovementGenerator<Player>::DoReset(Player&);
+template void PointMovementGenerator<Creature>::DoReset(Creature&);
+template bool PointMovementGenerator<Player>::DoUpdate(Player &, const uint32 &);
+template bool PointMovementGenerator<Creature>::DoUpdate(Creature&, const uint32 &);
void AssistanceMovementGenerator::Finalize(Unit &unit)
{
View
8 src/server/game/Movement/MovementGenerators/PointMovementGenerator.h
@@ -29,10 +29,10 @@ class PointMovementGenerator : public MovementGeneratorMedium< T, PointMovementG
PointMovementGenerator(uint32 _id, float _x, float _y, float _z, float _speed = 0.0f) : id(_id),
i_x(_x), i_y(_y), i_z(_z), speed(_speed) {}
- void Initialize(T &);
- void Finalize(T &);
- void Reset(T &);
- bool Update(T &, const uint32 &);
+ void DoInitialize(T &);
+ void DoFinalize(T &);
+ void DoReset(T &);
+ bool DoUpdate(T &, const uint32 &);
void MovementInform(T &);
View
10 src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
@@ -114,7 +114,7 @@ void RandomMovementGenerator<Creature>::_setRandomLocation(Creature& creature)
}
template<>
-void RandomMovementGenerator<Creature>::Initialize(Creature &creature)
+void RandomMovementGenerator<Creature>::DoInitialize(Creature &creature)
{
if (!creature.isAlive())
return;
@@ -127,20 +127,20 @@ void RandomMovementGenerator<Creature>::Initialize(Creature &creature)
}
template<>
-void RandomMovementGenerator<Creature>::Reset(Creature &creature)
+void RandomMovementGenerator<Creature>::DoReset(Creature &creature)
{
- Initialize(creature);
+ DoInitialize(creature);
}
template<>
-void RandomMovementGenerator<Creature>::Finalize(Creature &creature)
+void RandomMovementGenerator<Creature>::DoFinalize(Creature &creature)
{
creature.ClearUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
creature.SetWalk(false);
}
template<>
-bool RandomMovementGenerator<Creature>::Update(Creature &creature, const uint32 diff)
+bool RandomMovementGenerator<Creature>::DoUpdate(Creature &creature, const uint32 diff)
{
if (creature.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED))
{
View
8 src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h
@@ -28,10 +28,10 @@ class RandomMovementGenerator : public MovementGeneratorMedium< T, RandomMovemen
RandomMovementGenerator(float spawn_dist = 0.0f) : i_nextMoveTime(0), wander_distance(spawn_dist) {}
void _setRandomLocation(T &);
- void Initialize(T &);
- void Finalize(T &);
- void Reset(T &);
- bool Update(T &, const uint32);
+ void DoInitialize(T &);
+ void DoFinalize(T &);
+ void DoReset(T &);
+ bool DoUpdate(T &, const uint32);
bool GetResetPosition(T&, float& x, float& y, float& z);
MovementGeneratorType GetMovementGeneratorType() { return RANDOM_MOTION_TYPE; }
private:
View
46 src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
@@ -120,7 +120,7 @@ void TargetedMovementGeneratorMedium<Creature,FollowMovementGenerator<Creature>
}
template<class T, typename D>
-bool TargetedMovementGeneratorMedium<T,D>::Update(T &owner, const uint32 & time_diff)
+bool TargetedMovementGeneratorMedium<T,D>::DoUpdate(T &owner, const uint32 & time_diff)
{
if (!i_target.isValid() || !i_target->IsInWorld())
return false;
@@ -189,14 +189,14 @@ void ChaseMovementGenerator<T>::_reachTarget(T &owner)
}
template<>
-void ChaseMovementGenerator<Player>::Initialize(Player &owner)
+void ChaseMovementGenerator<Player>::DoInitialize(Player &owner)
{
owner.AddUnitState(UNIT_STATE_CHASE|UNIT_STATE_CHASE_MOVE);
_setTargetLocation(owner);
}
template<>
-void ChaseMovementGenerator<Creature>::Initialize(Creature &owner)
+void ChaseMovementGenerator<Creature>::DoInitialize(Creature &owner)
{
owner.SetWalk(false);
owner.AddUnitState(UNIT_STATE_CHASE|UNIT_STATE_CHASE_MOVE);
@@ -204,15 +204,15 @@ void ChaseMovementGenerator<Creature>::Initialize(Creature &owner)
}
template<class T>
-void ChaseMovementGenerator<T>::Finalize(T &owner)
+void ChaseMovementGenerator<T>::DoFinalize(T &owner)
{
owner.ClearUnitState(UNIT_STATE_CHASE|UNIT_STATE_CHASE_MOVE);
}
template<class T>
-void ChaseMovementGenerator<T>::Reset(T &owner)
+void ChaseMovementGenerator<T>::DoReset(T &owner)
{
- Initialize(owner);
+ DoInitialize(owner);
}
template<class T>
@@ -260,7 +260,7 @@ void FollowMovementGenerator<Creature>::_updateSpeed(Creature &u)
}
template<>
-void FollowMovementGenerator<Player>::Initialize(Player &owner)
+void FollowMovementGenerator<Player>::DoInitialize(Player &owner)
{
owner.AddUnitState(UNIT_STATE_FOLLOW|UNIT_STATE_FOLLOW_MOVE);
_updateSpeed(owner);
@@ -268,7 +268,7 @@ void FollowMovementGenerator<Player>::Initialize(Player &owner)
}
template<>
-void FollowMovementGenerator<Creature>::Initialize(Creature &owner)
+void FollowMovementGenerator<Creature>::DoInitialize(Creature &owner)
{
owner.AddUnitState(UNIT_STATE_FOLLOW|UNIT_STATE_FOLLOW_MOVE);
_updateSpeed(owner);
@@ -276,16 +276,16 @@ void FollowMovementGenerator<Creature>::Initialize(Creature &owner)
}
template<class T>
-void FollowMovementGenerator<T>::Finalize(T &owner)
+void FollowMovementGenerator<T>::DoFinalize(T &owner)
{
owner.ClearUnitState(UNIT_STATE_FOLLOW|UNIT_STATE_FOLLOW_MOVE);
_updateSpeed(owner);
}
template<class T>
-void FollowMovementGenerator<T>::Reset(T &owner)
+void FollowMovementGenerator<T>::DoReset(T &owner)
{
- Initialize(owner);
+ DoInitialize(owner);
}
template<class T>
@@ -306,21 +306,21 @@ template void TargetedMovementGeneratorMedium<Player,ChaseMovementGenerator<Play
template void TargetedMovementGeneratorMedium<Player,FollowMovementGenerator<Player> >::_setTargetLocation(Player &);
template void TargetedMovementGeneratorMedium<Creature,ChaseMovementGenerator<Creature> >::_setTargetLocation(Creature &);
template void TargetedMovementGeneratorMedium<Creature,FollowMovementGenerator<Creature> >::_setTargetLocation(Creature &);
-template bool TargetedMovementGeneratorMedium<Player,ChaseMovementGenerator<Player> >::Update(Player &, const uint32 &);
-template bool TargetedMovementGeneratorMedium<Player,FollowMovementGenerator<Player> >::Update(Player &, const uint32 &);
-template bool TargetedMovementGeneratorMedium<Creature,ChaseMovementGenerator<Creature> >::Update(Creature &, const uint32 &);
-template bool TargetedMovementGeneratorMedium<Creature,FollowMovementGenerator<Creature> >::Update(Creature &, const uint32 &);
+template bool TargetedMovementGeneratorMedium<Player,ChaseMovementGenerator<Player> >::DoUpdate(Player &, const uint32 &);
+template bool TargetedMovementGeneratorMedium<Player,FollowMovementGenerator<Player> >::DoUpdate(Player &, const uint32 &);
+template bool TargetedMovementGeneratorMedium<Creature,ChaseMovementGenerator<Creature> >::DoUpdate(Creature &, const uint32 &);
+template bool TargetedMovementGeneratorMedium<Creature,FollowMovementGenerator<Creature> >::DoUpdate(Creature &, const uint32 &);
template void ChaseMovementGenerator<Player>::_reachTarget(Player &);
template void ChaseMovementGenerator<Creature>::_reachTarget(Creature &);
-template void ChaseMovementGenerator<Player>::Finalize(Player &);
-template void ChaseMovementGenerator<Creature>::Finalize(Creature &);
-template void ChaseMovementGenerator<Player>::Reset(Player &);
-template void ChaseMovementGenerator<Creature>::Reset(Creature &);
+template void ChaseMovementGenerator<Player>::DoFinalize(Player &);
+template void ChaseMovementGenerator<Creature>::DoFinalize(Creature &);
+template void ChaseMovementGenerator<Player>::DoReset(Player &);
+template void ChaseMovementGenerator<Creature>::DoReset(Creature &);
template void ChaseMovementGenerator<Player>::MovementInform(Player &unit);
-template void FollowMovementGenerator<Player>::Finalize(Player &);
-template void FollowMovementGenerator<Creature>::Finalize(Creature &);
-template void FollowMovementGenerator<Player>::Reset(Player &);
-template void FollowMovementGenerator<Creature>::Reset(Creature &);
+template void FollowMovementGenerator<Player>::DoFinalize(Player &);
+template void FollowMovementGenerator<Creature>::DoFinalize(Creature &);
+template void FollowMovementGenerator<Player>::DoReset(Player &);
+template void FollowMovementGenerator<Creature>::DoReset(Creature &);
template void FollowMovementGenerator<Player>::MovementInform(Player &unit);
View
14 src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h
@@ -46,7 +46,7 @@ class TargetedMovementGeneratorMedium : public MovementGeneratorMedium< T, D >,
~TargetedMovementGeneratorMedium() {}
public:
- bool Update(T &, const uint32 &);
+ bool DoUpdate(T &, const uint32 &);
Unit* GetTarget() const { return i_target.getTarget(); }
void unitSpeedChanged() { i_recalculateTravel=true; }
@@ -74,9 +74,9 @@ class ChaseMovementGenerator : public TargetedMovementGeneratorMedium<T, ChaseMo
MovementGeneratorType GetMovementGeneratorType() { return CHASE_MOTION_TYPE; }
- void Initialize(T &);
- void Finalize(T &);
- void Reset(T &);
+ void DoInitialize(T &);
+ void DoFinalize(T &);
+ void DoReset(T &);
void MovementInform(T &);
static void _clearUnitStateMove(T &u) { u.ClearUnitState(UNIT_STATE_CHASE_MOVE); }
@@ -98,9 +98,9 @@ class FollowMovementGenerator : public TargetedMovementGeneratorMedium<T, Follow
MovementGeneratorType GetMovementGeneratorType() { return FOLLOW_MOTION_TYPE; }
- void Initialize(T &);
- void Finalize(T &);
- void Reset(T &);
+ void DoInitialize(T &);
+ void DoFinalize(T &);
+ void DoReset(T &);
void MovementInform(T &);
static void _clearUnitStateMove(T &u) { u.ClearUnitState(UNIT_STATE_FOLLOW_MOVE); }
View
18 src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
@@ -48,19 +48,19 @@ void WaypointMovementGenerator<Creature>::LoadPath(Creature &creature)
StartMoveNow(creature);
}
-void WaypointMovementGenerator<Creature>::Initialize(Creature &creature)
+void WaypointMovementGenerator<Creature>::DoInitialize(Creature &creature)
{
LoadPath(creature);
creature.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
}
-void WaypointMovementGenerator<Creature>::Finalize(Creature &creature)
+void WaypointMovementGenerator<Creature>::DoFinalize(Creature &creature)
{
creature.ClearUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
creature.SetWalk(false);
}
-void WaypointMovementGenerator<Creature>::Reset(Creature &creature)
+void WaypointMovementGenerator<Creature>::DoReset(Creature &creature)
{
creature.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
StartMoveNow(creature);
@@ -130,7 +130,7 @@ bool WaypointMovementGenerator<Creature>::StartMove(Creature &creature)
return true;
}
-bool WaypointMovementGenerator<Creature>::Update(Creature &creature, const uint32 &diff)
+bool WaypointMovementGenerator<Creature>::DoUpdate(Creature &creature, const uint32 &diff)
{
// Waypoint movement can be switched on/off
// This is quite handy for escort quests and other stuff
@@ -196,13 +196,13 @@ uint32 FlightPathMovementGenerator::GetPathAtMapEnd() const
return i_path->size();
}
-void FlightPathMovementGenerator::Initialize(Player &player)
+void FlightPathMovementGenerator::DoInitialize(Player &player)
{
- Reset(player);
+ DoReset(player);
InitEndGridInfo();
}
-void FlightPathMovementGenerator::Finalize(Player& player)
+void FlightPathMovementGenerator::DoFinalize(Player& player)
{
// remove flag to prevent send object build movement packets for flight state and crash (movement generator already not at top of stack)
player.ClearUnitState(UNIT_STATE_IN_FLIGHT);
@@ -222,7 +222,7 @@ void FlightPathMovementGenerator::Finalize(Player& player)
#define PLAYER_FLIGHT_SPEED 32.0f
-void FlightPathMovementGenerator::Reset(Player & player)
+void FlightPathMovementGenerator::DoReset(Player & player)
{
player.getHostileRefManager().setOnlineOfflineState(false);
player.AddUnitState(UNIT_STATE_IN_FLIGHT);
@@ -241,7 +241,7 @@ void FlightPathMovementGenerator::Reset(Player & player)
init.Launch();
}
-bool FlightPathMovementGenerator::Update(Player &player, const uint32& /*diff*/)
+bool FlightPathMovementGenerator::DoUpdate(Player &player, const uint32& /*diff*/)
{
uint32 pointId = (uint32)player.movespline->currentPathIdx();
if (pointId > i_currentNode)
View
16 src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h
@@ -65,10 +65,10 @@ class WaypointMovementGenerator<Creature> : public MovementGeneratorMedium< Crea
WaypointMovementGenerator(uint32 _path_id = 0, bool _repeating = true)
: i_nextMoveTime(0), m_isArrivalDone(false), path_id(_path_id), repeating(_repeating) {}
~WaypointMovementGenerator() { i_path = NULL; }
- void Initialize(Creature &);
- void Finalize(Creature &);
- void Reset(Creature &);
- bool Update(Creature &, const uint32 &diff);
+ void DoInitialize(Creature &);
+ void DoFinalize(Creature &);
+ void DoReset(Creature &);
+ bool DoUpdate(Creature &, const uint32 &diff);
void MovementInform(Creature &);
@@ -118,10 +118,10 @@ class FlightPathMovementGenerator : public MovementGeneratorMedium< Player, Flig
i_path = &pathnodes;
i_currentNode = startNode;
}
- void Initialize(Player &);
- void Reset(Player &);
- void Finalize(Player &);
- bool Update(Player &, const uint32&);
+ void DoInitialize(Player &);
+ void DoReset(Player &);
+ void DoFinalize(Player &);
+ bool DoUpdate(Player &, const uint32&);
MovementGeneratorType GetMovementGeneratorType() { return FLIGHT_MOTION_TYPE; }
TaxiPathNodeList const& GetPath() { return *i_path; }
View
2  src/server/game/Server/WorldSession.h
@@ -750,7 +750,7 @@ class WorldSession
//Pet
void HandlePetAction(WorldPacket& recvData);
void HandlePetStopAttack(WorldPacket& recvData);
- void HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid, uint16 flag, uint64 guid2);
+ void HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid, uint16 flag, uint64 guid2);
void HandlePetNameQuery(WorldPacket& recvData);
void HandlePetSetAction(WorldPacket& recvData);
void HandlePetAbandon(WorldPacket& recvData);
View
6 src/server/game/Texts/CreatureTextMgr.cpp
@@ -170,7 +170,7 @@ void CreatureTextMgr::LoadCreatureTextLocales()
}
-uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, uint64 whisperGuid /*= 0*/, ChatMsg msgType /*= CHAT_MSG_ADDON*/, Language language /*= LANG_ADDON*/, TextRange range /*= TEXT_RANGE_NORMAL*/, uint32 sound /*= 0*/, Team team /*= TEAM_OTHER*/, bool gmOnly /*= false*/, Player* srcPlr /*= NULL*/)
+uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, uint64 whisperGuid /*= 0*/, ChatMsg msgType /*= CHAT_MSG_ADDON*/, Language language /*= LANG_ADDON*/, CreatureTextRange range /*= TEXT_RANGE_NORMAL*/, uint32 sound /*= 0*/, Team team /*= TEAM_OTHER*/, bool gmOnly /*= false*/, Player* srcPlr /*= NULL*/)
{
if (!source)
return 0;
@@ -288,7 +288,7 @@ float CreatureTextMgr::GetRangeForChatType(ChatMsg msgType) const
return dist;
}
-void CreatureTextMgr::SendSound(Creature* source, uint32 sound, ChatMsg msgType, uint64 whisperGuid, TextRange range, Team team, bool gmOnly)
+void CreatureTextMgr::SendSound(Creature* source, uint32 sound, ChatMsg msgType, uint64 whisperGuid, CreatureTextRange range, Team team, bool gmOnly)
{
if (!sound || !source)
return;
@@ -298,7 +298,7 @@ void CreatureTextMgr::SendSound(Creature* source, uint32 sound, ChatMsg msgType,
SendNonChatPacket(source, &data, msgType, whisperGuid, range, team, gmOnly);
}
-void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket* data, ChatMsg msgType, uint64 whisperGuid, TextRange range, Team team, bool gmOnly) const
+void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket* data, ChatMsg msgType, uint64 whisperGuid, CreatureTextRange range, Team team, bool gmOnly) const
{
float dist = GetRangeForChatType(msgType);
View
12 src/server/game/Texts/CreatureTextMgr.h
@@ -37,7 +37,7 @@ struct CreatureTextEntry
uint32 sound;
};
-enum TextRange
+enum CreatureTextRange
{
TEXT_RANGE_NORMAL = 0,
TEXT_RANGE_AREA = 1,
@@ -89,21 +89,21 @@ class CreatureTextMgr
void LoadCreatureTextLocales();
CreatureTextMap const& GetTextMap() const { return mTextMap; }
- void SendSound(Creature* source, uint32 sound, ChatMsg msgType, uint64 whisperGuid, TextRange range, Team team, bool gmOnly);
+ void SendSound(Creature* source, uint32 sound, ChatMsg msgType, uint64 whisperGuid, CreatureTextRange range, Team team, bool gmOnly);
void SendEmote(Unit* source, uint32 emote);
//if sent, returns the 'duration' of the text else 0 if error
- uint32 SendChat(Creature* source, uint8 textGroup, uint64 whisperGuid = 0, ChatMsg msgType = CHAT_MSG_ADDON, Language language = LANG_ADDON, TextRange range = TEXT_RANGE_NORMAL, uint32 sound = 0, Team team = TEAM_OTHER, bool gmOnly = false, Player* srcPlr = NULL);
+ uint32 SendChat(Creature* source, uint8 textGroup, uint64 whisperGuid = 0, ChatMsg msgType = CHAT_MSG_ADDON, Language language = LANG_ADDON, CreatureTextRange range = TEXT_RANGE_NORMAL, uint32 sound = 0, Team team = TEAM_OTHER, bool gmOnly = false, Player* srcPlr = NULL);
bool TextExist(uint32 sourceEntry, uint8 textGroup);
std::string GetLocalizedChatString(uint32 entry, uint8 textGroup, uint32 id, LocaleConstant locale) const;
template<class Builder>
- void SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, uint64 whisperGuid = 0, TextRange range = TEXT_RANGE_NORMAL, Team team = TEAM_OTHER, bool gmOnly = false) const;
+ void SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, uint64 whisperGuid = 0, CreatureTextRange range = TEXT_RANGE_NORMAL, Team team = TEAM_OTHER, bool gmOnly = false) const;
private:
CreatureTextRepeatIds GetRepeatGroup(Creature* source, uint8 textGroup);
void SetRepeatId(Creature* source, uint8 textGroup, uint8 id);
- void SendNonChatPacket(WorldObject* source, WorldPacket* data, ChatMsg msgType, uint64 whisperGuid, TextRange range, Team team, bool gmOnly) const;
+ void SendNonChatPacket(WorldObject* source, WorldPacket* data, ChatMsg msgType, uint64 whisperGuid, CreatureTextRange range, Team team, bool gmOnly) const;
float GetRangeForChatType(ChatMsg msgType) const;
CreatureTextMap mTextMap;
@@ -172,7 +172,7 @@ class CreatureTextLocalizer
};
template<class Builder>
-void CreatureTextMgr::SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, uint64 whisperGuid, TextRange range, Team team, bool gmOnly) const
+void CreatureTextMgr::SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, uint64 whisperGuid, CreatureTextRange range, Team team, bool gmOnly) const
{
if (!source)
return;
View
28 src/server/scripts/CMakeLists.txt
@@ -9,18 +9,11 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# Enable precompiled headers when using the GCC compiler.
-if( USE_SCRIPTPCH )
- include_directories(
- ${CMAKE_CURRENT_BINARY_DIR}
- )
-endif()
-if( USE_SCRIPTPCH AND MSVC )
- set(scripts_STAT_SRCS
- PrecompiledHeaders/ScriptPCH.cpp
- PrecompiledHeaders/ScriptPCH.h
- )
-endif()
+if (USE_SCRIPTPCH)
+ set(scripts_STAT_PCH_HDR PrecompiledHeaders/ScriptPCH.h)
+ set(scripts_STAT_PCH_SRC PrecompiledHeaders/ScriptPCH.cpp)
+endif ()
message(STATUS "SCRIPT PREPARATIONS")
include(Spells/CMakeLists.txt)
@@ -148,15 +141,14 @@ include_directories(
${MYSQL_INCLUDE_DIR}
)
-add_library(scripts STATIC ${scripts_STAT_SRCS})
+add_library(scripts STATIC
+ ${scripts_STAT_SRCS}
+ ${scripts_STAT_PCH_SRC}
+)
add_dependencies(scripts revision.h)
# Generate precompiled header
-if( USE_SCRIPTPCH )
- if(CMAKE_COMPILER_IS_GNUCXX)
- add_precompiled_header(scripts ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders/ScriptPCH.h)
- elseif(MSVC)
- add_native_precompiled_header(scripts ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders/ScriptPCH)
- endif()
+if (USE_SCRIPTPCH)
+ add_cxx_pch(scripts ${scripts_STAT_PCH_HDR} ${scripts_STAT_PCH_SRC})
endif()
View
2  src/server/scripts/Commands/cs_wp.cpp
@@ -941,7 +941,7 @@ class wp_commandscript : public CommandScript
{
wpCreature->SetDisplayId(target->GetDisplayId());
wpCreature->SetObjectScale(0.5f);
- wpCreature->SetLevel(point > STRONG_MAX_LEVEL ? STRONG_MAX_LEVEL : point);
+ wpCreature->SetLevel(std::min<uint32>(point, STRONG_MAX_LEVEL));
}
}
while (result->NextRow());
View
4 src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
@@ -1375,7 +1375,7 @@ class spell_halion_combustion_consumption : public SpellScriptLoader
public:
spell_halion_combustion_consumption_AuraScript(uint32 spellID) : AuraScript(), _markSpell(spellID) { }
- bool Validate(SpellEntry const* /*spell*/)
+ bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(_markSpell))
return false;
@@ -1434,7 +1434,7 @@ class spell_halion_marks : public SpellScriptLoader
spell_halion_marks_AuraScript(uint32 summonSpell, uint32 removeSpell) : AuraScript(),
_summonSpellId(summonSpell), _removeSpellId(removeSpell) { }
- bool Validate(SpellEntry const* /*spell*/)
+ bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(_summonSpellId))
return false;
View
2 </