diff --git a/.editorconfig b/.editorconfig index ebdfa7ac..a63178f1 100644 --- a/.editorconfig +++ b/.editorconfig @@ -73,4 +73,4 @@ cpp_space_around_assignment_operator=insert cpp_space_pointer_reference_alignment=left cpp_space_around_ternary_operator=insert cpp_wrap_preserve_blocks=one_liners -cpp_indent_comment=fasle +cpp_indent_comment=false diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index fc44885d..9c734166 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -16,12 +16,12 @@ jobs: os: [ windows-2022, ubuntu-22.04, macos-13 ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Add msbuild to PATH (Windows only) if: ${{ matrix.os == 'windows-2022' }} - uses: microsoft/setup-msbuild@v1.1 + uses: microsoft/setup-msbuild@v2 with: vs-version: '[17,18)' msbuild-architecture: x64 @@ -33,21 +33,19 @@ jobs: - name: cmake uses: lukka/run-cmake@v10 with: - configurePreset: "ci-${{matrix.os}}" - buildPreset: "ci-${{matrix.os}}" - testPreset: "ci-${{matrix.os}}" + workflowPreset: "ci-${{matrix.os}}" - name: artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: build-${{matrix.os}} path: | - build/*Server* - build/*.ini - build/*.so - build/*.dll - build/vanity/ - build/navmeshes/ - build/migrations/ - build/*.dcf - !build/*.pdb - !build/d*/ + build/*/*Server* + build/*/*.ini + build/*/*.so + build/*/*.dll + build/*/vanity/ + build/*/navmeshes/ + build/*/migrations/ + build/*/*.dcf + !build/*/*.pdb + !build/*/d*/ diff --git a/.gitignore b/.gitignore index 12a3b284..0b0d2ecf 100644 --- a/.gitignore +++ b/.gitignore @@ -122,4 +122,7 @@ docker/__pycache__ docker-compose.override.yml !*Test.bin + +# CMake scripts !cmake/* +!cmake/toolchains/* diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f8dbaf5..4a6c4b23 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,8 @@ cmake_minimum_required(VERSION 3.25) -project(Darkflame) +project(Darkflame + HOMEPAGE_URL "https://github.com/DarkflameUniverse/DarkflameServer" + LANGUAGES C CXX +) # check if the path to the source directory contains a space if("${CMAKE_SOURCE_DIR}" MATCHES " ") @@ -8,8 +11,10 @@ endif() include(CTest) +set(CMAKE_C_STANDARD 99) set(CMAKE_CXX_STANDARD 20) -set(CXX_STANDARD_REQUIRED ON) +set(CMAKE_C_STANDARD_REQUIRED ON) +set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Export the compile commands for debugging set(CMAKE_POLICY_DEFAULT_CMP0063 NEW) # Set CMAKE visibility policy to NEW on project and subprojects set(CMAKE_VISIBILITY_INLINES_HIDDEN ON) # Set C and C++ symbol visibility to hide inlined functions @@ -61,35 +66,36 @@ set(RECASTNAVIGATION_EXAMPLES OFF CACHE BOOL "" FORCE) # Disabled no-register # Disabled unknown pragmas because Linux doesn't understand Windows pragmas. if(UNIX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wuninitialized -fPIC") + add_compile_options("-fPIC") add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0 _GLIBCXX_USE_CXX17_ABI=0) - if(NOT APPLE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -lstdc++fs") + # For all except Clang and Apple Clang + if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options("-static-libgcc" "-lstdc++fs") endif() if(${DYNAMIC} AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -rdynamic") + add_link_options("-export-dynamic") endif() if(${GGDB}) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb") + add_compile_options("-ggdb") endif() - - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -O2 -fPIC") elseif(MSVC) # Skip warning for invalid conversion from size_t to uint32_t for all targets below for now # Also disable non-portable MSVC volatile behavior - add_compile_options("/wd4267" "/utf-8" "/volatile:iso") + add_compile_options("/wd4267" "/utf-8" "/volatile:iso" "/Zc:inline") elseif(WIN32) add_compile_definitions(_CRT_SECURE_NO_WARNINGS) endif() # Our output dir -set(CMAKE_BINARY_DIR ${PROJECT_BINARY_DIR}) #set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) # unfortunately, forces all libraries to be built in series, which will slow down the build process # TODO make this not have to override the build type directories +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}) +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_BINARY_DIR}) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_BINARY_DIR}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_BINARY_DIR}) @@ -109,31 +115,39 @@ make_directory(${CMAKE_BINARY_DIR}/resServer) # Create a /logs directory make_directory(${CMAKE_BINARY_DIR}/logs) +# Get DLU config directory +if(DEFINED ENV{DLU_CONFIG_DIR}) + set(DLU_CONFIG_DIR $ENV{DLU_CONFIG_DIR}) +else() + set(DLU_CONFIG_DIR ${PROJECT_BINARY_DIR}) +endif() +message(STATUS "Variable: DLU_CONFIG_DIR = ${DLU_CONFIG_DIR}") + # Copy resource files on first build set(RESOURCE_FILES "sharedconfig.ini" "authconfig.ini" "chatconfig.ini" "worldconfig.ini" "masterconfig.ini" "blocklist.dcf") message(STATUS "Checking resource file integrity") include(Utils) -UpdateConfigOption(${PROJECT_BINARY_DIR}/authconfig.ini "port" "auth_server_port") -UpdateConfigOption(${PROJECT_BINARY_DIR}/chatconfig.ini "port" "chat_server_port") -UpdateConfigOption(${PROJECT_BINARY_DIR}/masterconfig.ini "port" "master_server_port") +UpdateConfigOption(${DLU_CONFIG_DIR}/authconfig.ini "port" "auth_server_port") +UpdateConfigOption(${DLU_CONFIG_DIR}/chatconfig.ini "port" "chat_server_port") +UpdateConfigOption(${DLU_CONFIG_DIR}/masterconfig.ini "port" "master_server_port") foreach(resource_file ${RESOURCE_FILES}) set(file_size 0) - if(EXISTS ${PROJECT_BINARY_DIR}/${resource_file}) - file(SIZE ${PROJECT_BINARY_DIR}/${resource_file} file_size) + if(EXISTS ${DLU_CONFIG_DIR}/${resource_file}) + file(SIZE ${DLU_CONFIG_DIR}/${resource_file} file_size) endif() if(${file_size} EQUAL 0) configure_file( - ${CMAKE_SOURCE_DIR}/resources/${resource_file} ${PROJECT_BINARY_DIR}/${resource_file} + ${CMAKE_SOURCE_DIR}/resources/${resource_file} ${DLU_CONFIG_DIR}/${resource_file} COPYONLY ) - message(STATUS "Moved " ${resource_file} " to project binary directory") + message(STATUS "Moved " ${resource_file} " to DLU config directory") elseif(resource_file MATCHES ".ini") message(STATUS "Checking " ${resource_file} " for missing config options") - file(READ ${PROJECT_BINARY_DIR}/${resource_file} current_file_contents) + file(READ ${DLU_CONFIG_DIR}/${resource_file} current_file_contents) string(REPLACE "\\\n" "" current_file_contents ${current_file_contents}) string(REPLACE "\n" ";" current_file_contents ${current_file_contents}) set(parsed_current_file_contents "") @@ -164,10 +178,10 @@ foreach(resource_file ${RESOURCE_FILES}) set(line_to_add ${line_to_add} ${line}) foreach(line_to_append ${line_to_add}) - file(APPEND ${PROJECT_BINARY_DIR}/${resource_file} "\n" ${line_to_append}) + file(APPEND ${DLU_CONFIG_DIR}/${resource_file} "\n" ${line_to_append}) endforeach() - file(APPEND ${PROJECT_BINARY_DIR}/${resource_file} "\n") + file(APPEND ${DLU_CONFIG_DIR}/${resource_file} "\n") endif() set(line_to_add "") @@ -236,14 +250,15 @@ include_directories( "tests/dGameTests" "tests/dGameTests/dComponentsTests" - SYSTEM "thirdparty/magic_enum/include/magic_enum" - SYSTEM "thirdparty/raknet/Source" - SYSTEM "thirdparty/tinyxml2" - SYSTEM "thirdparty/recastnavigation" - SYSTEM "thirdparty/SQLite" - SYSTEM "thirdparty/cpplinq" - SYSTEM "thirdparty/cpp-httplib" - SYSTEM "thirdparty/MD5" + SYSTEM + "thirdparty/magic_enum/include/magic_enum" + "thirdparty/raknet/Source" + "thirdparty/tinyxml2" + "thirdparty/recastnavigation" + "thirdparty/SQLite" + "thirdparty/cpplinq" + "thirdparty/cpp-httplib" + "thirdparty/MD5" ) # Add system specfic includes for Apple, Windows and Other Unix OS' (including Linux) @@ -252,10 +267,17 @@ if(APPLE) include_directories("/usr/local/include/") endif() -# Add linking directories: -if (UNIX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wold-style-cast -Werror") # Warning flags +# Set warning flags +if(MSVC) + # add_compile_options("/W4") + # Want to enable warnings eventually, but WAY too much noise right now +elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") + add_compile_options("-Wuninitialized" "-Wold-style-cast") +else() + message(WARNING "Unknown compiler: '${CMAKE_CXX_COMPILER_ID}' - No warning flags enabled.") endif() + +# Add linking directories: file( GLOB HEADERS_DZONEMANAGER LIST_DIRECTORIES false diff --git a/CMakePresets.json b/CMakePresets.json index 2feabc53..c4595ed5 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -1,128 +1,641 @@ { - "version": 3, - "cmakeMinimumRequired": { - "major": 3, - "minor": 14, - "patch": 0 - }, - "configurePresets": [ - { - "name": "default", - "displayName": "Default configure step", - "description": "Use 'build' dir and Unix makefiles", - "binaryDir": "${sourceDir}/build", - "generator": "Unix Makefiles" - }, - { - "name": "ci-ubuntu-22.04", - "displayName": "CI configure step for Ubuntu", - "description": "Same as default, Used in GitHub actions workflow", - "inherits": "default" - }, - { - "name": "ci-macos-13", - "displayName": "CI configure step for MacOS", - "description": "Same as default, Used in GitHub actions workflow", - "inherits": "default" - }, - { - "name": "ci-windows-2022", - "displayName": "CI configure step for Windows", - "description": "Set architecture to 64-bit (b/c RakNet)", - "inherits": "default", - "generator": "Visual Studio 17 2022", - "architecture": { - "value": "x64" - }, - "cacheVariables": { - "CMAKE_BUILD_TYPE": "RelWithDebInfo" - } - }, - { - "name": "windows-default", - "inherits": "ci-windows-2022", - "displayName": "Windows only Configure Settings", - "description": "Sets build and install directories", - "generator": "Ninja", - "architecture": { - "value": "x64", - "strategy": "external" - } - } - ], - "buildPresets": [ - { - "name": "default", - "configurePreset": "default", - "displayName": "Default Build", - "description": "Default Build", - "jobs": 2 - }, - { - "name": "ci-windows-2022", - "configurePreset": "ci-windows-2022", - "displayName": "Windows CI Build", - "description": "This preset is used by the CI build on windows", - "configuration": "RelWithDebInfo", - "jobs": 2 - }, - { - "name": "ci-ubuntu-22.04", - "configurePreset": "ci-ubuntu-22.04", - "displayName": "Linux CI Build", - "description": "This preset is used by the CI build on linux", - "jobs": 2 - }, - { - "name": "ci-macos-13", - "configurePreset": "ci-macos-13", - "displayName": "MacOS CI Build", - "description": "This preset is used by the CI build on MacOS", - "jobs": 2 - } - ], - "testPresets": [ - { - "name": "ci-ubuntu-22.04", - "configurePreset": "ci-ubuntu-22.04", - "displayName": "CI Tests on Linux", - "description": "Runs all tests on a linux configuration", - "execution": { - "jobs": 2 + "version": 6, + "cmakeMinimumRequired": { + "major": 3, + "minor": 25, + "patch": 0 + }, + "configurePresets": [ + { + "name": "default", + "displayName": "Default configure step", + "description": "Use 'build' dir and Unix makefiles", + "binaryDir": "${sourceDir}/build", + "environment": { + "DLU_CONFIG_DIR": "${sourceDir}/build" + }, + "generator": "Unix Makefiles" }, - "output": { - "outputOnFailure": true - } - }, - { - "name": "ci-macos-13", - "configurePreset": "ci-macos-13", - "displayName": "CI Tests on MacOS", - "description": "Runs all tests on a Mac configuration", - "execution": { - "jobs": 2 - }, - "output": { - "outputOnFailure": true - } - }, - { - "name": "ci-windows-2022", - "configurePreset": "ci-windows-2022", - "displayName": "CI Tests on windows", - "description": "Runs all tests on a windows configuration", - "configuration": "RelWithDebInfo", - "execution": { - "jobs": 2 - }, - "output": { - "outputOnFailure": true - }, - "filter": { - "exclude": { - "name": "((example)|(minigzip))+" + { + "name": "debug-config", + "hidden": true, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" } + }, + { + "name": "relwithdebinfo-config", + "hidden": true, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo" + } + }, + { + "name": "release-config", + "hidden": true, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + }, + { + "name": "clang-config", + "hidden": true, + "toolchainFile": "${sourceDir}/cmake/toolchains/linux-clang.cmake" + }, + { + "name": "gnu-config", + "hidden": true, + "toolchainFile": "${sourceDir}/cmake/toolchains/linux-gnu.cmake" + }, + { + "name": "windows-msvc", + "inherits": "default", + "displayName": "[Multi] Windows (MSVC)", + "description": "Set architecture to 64-bit (b/c RakNet)", + "generator": "Visual Studio 17 2022", + "binaryDir": "${sourceDir}/build/msvc", + "architecture": { + "value": "x64" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { + "name": "windows-default", + "inherits": "windows-msvc", + "displayName": "Windows only Configure Settings", + "description": "Sets build and install directories", + "generator": "Ninja", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + }, + "architecture": { + "value": "x64" + } + }, + { + "name": "linux-config", + "inherits": "default", + "hidden": true, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + } + }, + { + "name": "linux-clang-debug", + "inherits": [ + "linux-config", + "clang-config", + "debug-config" + ], + "displayName": "EXPERIMENTAL - [Debug] Linux (Clang)", + "description": "Create a debug build using the Clang toolchain for Linux", + "binaryDir": "${sourceDir}/build/clang-debug" + }, + { + "name": "linux-clang-relwithdebinfo", + "inherits": [ + "linux-config", + "clang-config", + "relwithdebinfo-config" + ], + "displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)", + "description": "Create a release build with debug info using the Clang toolchain for Linux", + "binaryDir": "${sourceDir}/build/clang-relwithdebinfo" + }, + { + "name": "linux-clang-release", + "inherits": [ + "linux-config", + "clang-config", + "release-config" + ], + "displayName": "EXPERIMENTAL - [Release] Linux (Clang)", + "description": "Create a release build using the Clang toolchain for Linux", + "binaryDir": "${sourceDir}/build/clang-release" + }, + { + "name": "linux-gnu-debug", + "inherits": [ + "linux-config", + "gnu-config", + "debug-config" + ], + "displayName": "[Debug] Linux (GNU)", + "description": "Create a debug build using the GNU toolchain for Linux", + "binaryDir": "${sourceDir}/build/gnu-debug" + }, + { + "name": "linux-gnu-relwithdebinfo", + "inherits": [ + "linux-config", + "gnu-config", + "relwithdebinfo-config" + ], + "displayName": "[RelWithDebInfo] Linux (GNU)", + "description": "Create a release build with debug info using the GNU toolchain for Linux", + "binaryDir": "${sourceDir}/build/gnu-relwithdebinfo" + }, + { + "name": "linux-gnu-release", + "inherits": [ + "linux-config", + "gnu-config", + "release-config" + ], + "displayName": "[Release] Linux (GNU)", + "description": "Create a release build using the GNU toolchain for Linux", + "binaryDir": "${sourceDir}/build/gnu-release" + }, + { + "name": "macos", + "inherits": "default", + "displayName": "[Multi] MacOS", + "description": "Create a build for MacOS", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + }, + "binaryDir": "${sourceDir}/build/macos" } - } - ] - } + ], + "buildPresets": [ + { + "name": "default", + "configurePreset": "default", + "displayName": "Default Build", + "description": "Default Build", + "jobs": 2 + }, + { + "name": "windows-msvc-debug", + "inherits": "default", + "configurePreset": "windows-msvc", + "displayName": "[Debug] Windows (MSVC)", + "description": "This preset is used to build in debug mode using the MSVC toolchain on Windows", + "configuration": "Debug" + }, + { + "name": "windows-msvc-relwithdebinfo", + "inherits": "default", + "configurePreset": "windows-msvc", + "displayName": "[RelWithDebInfo] Windows (MSVC)", + "description": "This preset is used to build in debug mode using the MSVC toolchain on Windows", + "configuration": "RelWithDebInfo" + }, + { + "name": "windows-msvc-release", + "inherits": "default", + "configurePreset": "windows-msvc", + "displayName": "[Release] Windows (MSVC)", + "description": "This preset is used to build in release mode using the MSVC toolchain on Windows", + "configuration": "Release" + }, + { + "name": "linux-clang-debug", + "inherits": "default", + "configurePreset": "linux-clang-debug", + "displayName": "EXPERIMENTAL - [Debug] Linux (Clang)", + "description": "This preset is used to build in debug mode using the Clang toolchain on Linux", + "configuration": "Debug" + }, + { + "name": "linux-clang-relwithdebinfo", + "inherits": "default", + "configurePreset": "linux-clang-relwithdebinfo", + "displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)", + "description": "This preset is used to build in release mode with debug info using the Clang toolchain on Linux", + "configuration": "RelWithDebInfo" + }, + { + "name": "linux-clang-release", + "inherits": "default", + "configurePreset": "linux-clang-release", + "displayName": "EXPERIMENTAL - [Release] Linux (Clang)", + "description": "This preset is used to build in release mode using the Clang toolchain on Linux", + "configuration": "Release" + }, + { + "name": "linux-gnu-debug", + "inherits": "default", + "configurePreset": "linux-gnu-debug", + "displayName": "[Debug] Linux (GNU)", + "description": "This preset is used to build in debug mode using the GNU toolchain on Linux", + "configuration": "Debug" + }, + { + "name": "linux-gnu-relwithdebinfo", + "inherits": "default", + "configurePreset": "linux-gnu-relwithdebinfo", + "displayName": "[RelWithDebInfo] Linux (GNU)", + "description": "This preset is used to build in release mode with debug info using the GNU toolchain on Linux", + "configuration": "RelWithDebInfo" + }, + { + "name": "linux-gnu-release", + "inherits": "default", + "configurePreset": "linux-gnu-release", + "displayName": "[Release] Linux (GNU)", + "description": "This preset is used to build in release mode using the GNU toolchain on Linux", + "configuration": "Release" + }, + { + "name": "macos-debug", + "inherits": "default", + "configurePreset": "macos", + "displayName": "[Debug] MacOS", + "description": "This preset is used to build in debug mode on MacOS", + "configuration": "Debug" + }, + { + "name": "macos-relwithdebinfo", + "inherits": "default", + "configurePreset": "macos", + "displayName": "[RelWithDebInfo] MacOS", + "description": "This preset is used to build in release mode with debug info on MacOS", + "configuration": "RelWithDebInfo" + }, + { + "name": "macos-release", + "inherits": "default", + "configurePreset": "macos", + "displayName": "[Release] MacOS", + "description": "This preset is used to build in release mode on MacOS", + "configuration": "Release" + } + ], + "testPresets": [ + { + "name": "default", + "configurePreset": "default", + "execution": { + "jobs": 2 + }, + "output": { + "outputOnFailure": true + } + }, + { + "name": "windows-msvc-test", + "inherits": "default", + "configurePreset": "windows-msvc", + "hidden": true, + "filter": { + "exclude": { + "name": "((example)|(minigzip))+" + } + } + }, + { + "name": "windows-msvc-debug", + "inherits": "windows-msvc-test", + "configurePreset": "windows-msvc", + "displayName": "[Debug] Windows (MSVC)", + "description": "Runs all tests on a Windows configuration", + "configuration": "Debug" + }, + { + "name": "windows-msvc-relwithdebinfo", + "inherits": "windows-msvc-test", + "configurePreset": "windows-msvc", + "displayName": "[RelWithDebInfo] Windows (MSVC)", + "description": "Runs all tests on a Windows configuration", + "configuration": "RelWithDebInfo" + }, + { + "name": "windows-msvc-release", + "inherits": "windows-msvc-test", + "configurePreset": "windows-msvc", + "displayName": "[Release] Windows (MSVC)", + "description": "Runs all tests on a Windows configuration", + "configuration": "Release" + }, + { + "name": "linux-clang-debug", + "inherits": "default", + "configurePreset": "linux-clang-debug", + "displayName": "EXPERIMENTAL - [Debug] Linux (Clang)", + "description": "Runs all tests on a Linux Clang configuration", + "configuration": "Release" + }, + { + "name": "linux-clang-relwithdebinfo", + "inherits": "default", + "configurePreset": "linux-clang-relwithdebinfo", + "displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)", + "description": "Runs all tests on a Linux Clang configuration", + "configuration": "RelWithDebInfo" + }, + { + "name": "linux-clang-release", + "inherits": "default", + "configurePreset": "linux-clang-release", + "displayName": "EXPERIMENTAL - [Release] Linux (Clang)", + "description": "Runs all tests on a Linux Clang configuration", + "configuration": "Release" + }, + { + "name": "linux-gnu-debug", + "inherits": "default", + "configurePreset": "linux-gnu-debug", + "displayName": "[Debug] Linux (GNU)", + "description": "Runs all tests on a Linux GNU configuration", + "configuration": "Release" + }, + { + "name": "linux-gnu-relwithdebinfo", + "inherits": "default", + "configurePreset": "linux-gnu-relwithdebinfo", + "displayName": "[RelWithDebInfo] Linux (GNU)", + "description": "Runs all tests on a Linux GNU configuration", + "configuration": "RelWithDebInfo" + }, + { + "name": "linux-gnu-release", + "inherits": "default", + "configurePreset": "linux-gnu-release", + "displayName": "[Release] Linux (GNU)", + "description": "Runs all tests on a Linux GNU configuration", + "configuration": "Release" + }, + { + "name": "macos-debug", + "inherits": "default", + "configurePreset": "macos", + "displayName": "[Debug] MacOS", + "description": "Runs all tests on a MacOS configuration", + "configuration": "Debug" + }, + { + "name": "macos-relwithdebinfo", + "inherits": "default", + "configurePreset": "macos", + "displayName": "[RelWithDebInfo] MacOS", + "description": "Runs all tests on a MacOS configuration", + "configuration": "RelWithDebInfo" + }, + { + "name": "macos-release", + "inherits": "default", + "configurePreset": "macos", + "displayName": "[Release] MacOS", + "description": "Runs all tests on a MacOS configuration", + "configuration": "Release" + } + ], + "workflowPresets": [ + { + "name": "default", + "steps": [ + { + "type": "configure", + "name": "default" + }, + { + "type": "build", + "name": "default" + }, + { + "type": "test", + "name": "default" + } + ] + }, + { + "name": "windows-msvc-debug", + "displayName": "[Debug] Windows (MSVC)", + "description": "MSVC debug workflow preset for Windows", + "steps": [ + { + "type": "configure", + "name": "windows-msvc" + }, + { + "type": "build", + "name": "windows-msvc-debug" + }, + { + "type": "test", + "name": "windows-msvc-debug" + } + ] + }, + { + "name": "windows-msvc-relwithdebinfo", + "displayName": "[RelWithDebInfo] Windows (MSVC)", + "description": "MSVC release with debug info workflow preset for Windows", + "steps": [ + { + "type": "configure", + "name": "windows-msvc" + }, + { + "type": "build", + "name": "windows-msvc-relwithdebinfo" + }, + { + "type": "test", + "name": "windows-msvc-relwithdebinfo" + } + ] + }, + { + "name": "ci-windows-2022", + "displayName": "[Release] Windows (MSVC)", + "description": "CI workflow preset for Windows", + "steps": [ + { + "type": "configure", + "name": "windows-msvc" + }, + { + "type": "build", + "name": "windows-msvc-release" + }, + { + "type": "test", + "name": "windows-msvc-release" + } + ] + }, + { + "name": "linux-gnu-debug", + "displayName": "[Debug] Linux (GNU)", + "description": "GNU debug workflow preset for Linux", + "steps": [ + { + "type": "configure", + "name": "linux-gnu-debug" + }, + { + "type": "build", + "name": "linux-gnu-debug" + }, + { + "type": "test", + "name": "linux-gnu-debug" + } + ] + }, + { + "name": "linux-gnu-relwithdebinfo", + "displayName": "[RelWithDebInfo] Linux (GNU)", + "description": "GNU release with debug info workflow preset for Linux", + "steps": [ + { + "type": "configure", + "name": "linux-gnu-relwithdebinfo" + }, + { + "type": "build", + "name": "linux-gnu-relwithdebinfo" + }, + { + "type": "test", + "name": "linux-gnu-relwithdebinfo" + } + ] + }, + { + "name": "ci-ubuntu-22.04", + "displayName": "[Release] Linux (GNU)", + "description": "CI workflow preset for Ubuntu", + "steps": [ + { + "type": "configure", + "name": "linux-gnu-release" + }, + { + "type": "build", + "name": "linux-gnu-release" + }, + { + "type": "test", + "name": "linux-gnu-release" + } + ] + }, + { + "name": "linux-clang-debug", + "displayName": "EXPERIMENTAL - [Debug] Linux (Clang)", + "description": "Clang debug workflow preset for Linux", + "steps": [ + { + "type": "configure", + "name": "linux-clang-debug" + }, + { + "type": "build", + "name": "linux-clang-debug" + }, + { + "type": "test", + "name": "linux-clang-debug" + } + ] + }, + { + "name": "linux-clang-relwithdebinfo", + "displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)", + "description": "Clang release with debug info workflow preset for Linux", + "steps": [ + { + "type": "configure", + "name": "linux-clang-relwithdebinfo" + }, + { + "type": "build", + "name": "linux-clang-relwithdebinfo" + }, + { + "type": "test", + "name": "linux-clang-relwithdebinfo" + } + ] + }, + { + "name": "linux-clang-release", + "displayName": "EXPERIMENTAL - [Release] Linux (Clang)", + "description": "Clang release workflow preset for Linux", + "steps": [ + { + "type": "configure", + "name": "linux-clang-release" + }, + { + "type": "build", + "name": "linux-clang-release" + }, + { + "type": "test", + "name": "linux-clang-release" + } + ] + }, + { + "name": "macos-debug", + "displayName": "[Debug] MacOS", + "description": "Release workflow preset for MacOS", + "steps": [ + { + "type": "configure", + "name": "macos" + }, + { + "type": "build", + "name": "macos-debug" + }, + { + "type": "test", + "name": "macos-debug" + } + ] + }, + { + "name": "macos-relwithdebinfo", + "displayName": "[RelWithDebInfo] MacOS", + "description": "Release with debug info workflow preset for MacOS", + "steps": [ + { + "type": "configure", + "name": "macos" + }, + { + "type": "build", + "name": "macos-relwithdebinfo" + }, + { + "type": "test", + "name": "macos-relwithdebinfo" + } + ] + }, + { + "name": "ci-macos-13", + "displayName": "[Release] MacOS", + "description": "CI workflow preset for MacOS", + "steps": [ + { + "type": "configure", + "name": "macos" + }, + { + "type": "build", + "name": "macos-release" + }, + { + "type": "test", + "name": "macos-release" + } + ] + } + ] +} diff --git a/build.sh b/build.sh index b8d33492..3f36e8a3 100755 --- a/build.sh +++ b/build.sh @@ -6,8 +6,7 @@ mkdir -p build cd build # Run cmake to generate make files -cmake .. +cmake -DCMAKE_BUILD_TYPE="Release" .. # To build utilizing multiple cores, append `-j` and the amount of cores to utilize, for example `cmake --build . --config Release -j8' cmake --build . --config Release $1 - diff --git a/cmake/toolchains/linux-clang.cmake b/cmake/toolchains/linux-clang.cmake new file mode 100644 index 00000000..b4578a38 --- /dev/null +++ b/cmake/toolchains/linux-clang.cmake @@ -0,0 +1,14 @@ +# Try and find a clang-16 install, falling back to a generic clang install otherwise +find_program(CLANG_C_COMPILER clang-16 | clang REQUIRED) +find_program(CLANG_CXX_COMPILER clang++-16 | clang++ REQUIRED) + +# Debug messages +message(DEBUG "CLANG_C_COMPILER = ${CLANG_C_COMPILER}") +message(DEBUG "CLANG_CXX_COMPILER = ${CLANG_CXX_COMPILER}") + +# Set compilers to clang (need to cache for VSCode tools to work correctly) +set(CMAKE_C_COMPILER ${CLANG_C_COMPILER} CACHE STRING "Set C compiler") +set(CMAKE_CXX_COMPILER ${CLANG_CXX_COMPILER} CACHE STRING "Set C++ compiler") + +# Set linker to lld +add_link_options("-fuse-ld=lld") diff --git a/cmake/toolchains/linux-gnu.cmake b/cmake/toolchains/linux-gnu.cmake new file mode 100644 index 00000000..3eadbc9e --- /dev/null +++ b/cmake/toolchains/linux-gnu.cmake @@ -0,0 +1,11 @@ +# Try and find a gcc/g++ install +find_program(GNU_C_COMPILER cc | gcc REQUIRED) +find_program(GNU_CXX_COMPILER c++ | g++ REQUIRED) + +# Debug messages +message(DEBUG "GNU_C_COMPILER = ${GNU_C_COMPILER}") +message(DEBUG "GNU_CXX_COMPILER = ${GNU_CXX_COMPILER}") + +# Set compilers to GNU (need to cache for VSCode tools to work correctly) +set(CMAKE_C_COMPILER ${GNU_C_COMPILER} CACHE STRING "Set C compiler") +set(CMAKE_CXX_COMPILER ${GNU_CXX_COMPILER} CACHE STRING "Set C++ compiler") diff --git a/dAuthServer/AuthServer.cpp b/dAuthServer/AuthServer.cpp index 476e1a68..d306eb70 100644 --- a/dAuthServer/AuthServer.cpp +++ b/dAuthServer/AuthServer.cpp @@ -21,8 +21,8 @@ //Auth includes: #include "AuthPackets.h" #include "eConnectionType.h" -#include "eServerMessageType.h" -#include "eAuthMessageType.h" +#include "MessageType/Server.h" +#include "MessageType/Auth.h" #include "Game.h" #include "Server.h" @@ -102,7 +102,7 @@ int main(int argc, char** argv) { uint32_t framesSinceLastSQLPing = 0; AuthPackets::LoadClaimCodes(); - + Game::logger->Flush(); // once immediately before main loop while (!Game::ShouldShutdown()) { //Check if we're still connected to master: @@ -166,11 +166,11 @@ void HandlePacket(Packet* packet) { if (packet->data[0] == ID_USER_PACKET_ENUM) { if (static_cast(packet->data[1]) == eConnectionType::SERVER) { - if (static_cast(packet->data[3]) == eServerMessageType::VERSION_CONFIRM) { + if (static_cast(packet->data[3]) == MessageType::Server::VERSION_CONFIRM) { AuthPackets::HandleHandshake(Game::server, packet); } } else if (static_cast(packet->data[1]) == eConnectionType::AUTH) { - if (static_cast(packet->data[3]) == eAuthMessageType::LOGIN_REQUEST) { + if (static_cast(packet->data[3]) == MessageType::Auth::LOGIN_REQUEST) { AuthPackets::HandleLoginRequest(Game::server, packet); } } diff --git a/dChatServer/ChatIgnoreList.cpp b/dChatServer/ChatIgnoreList.cpp index 6dfbd7fc..3e0fbb93 100644 --- a/dChatServer/ChatIgnoreList.cpp +++ b/dChatServer/ChatIgnoreList.cpp @@ -1,6 +1,6 @@ #include "ChatIgnoreList.h" #include "PlayerContainer.h" -#include "eChatMessageType.h" +#include "MessageType/Chat.h" #include "BitStreamUtils.h" #include "Game.h" #include "Logger.h" @@ -13,7 +13,7 @@ // The only thing not auto-handled is instance activities force joining the team on the server. void WriteOutgoingReplyHeader(RakNet::BitStream& bitStream, const LWOOBJID& receivingPlayer, const ChatIgnoreList::Response type) { - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::WORLD_ROUTE_PACKET); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::WORLD_ROUTE_PACKET); bitStream.Write(receivingPlayer); //portion that will get routed: diff --git a/dChatServer/ChatPacketHandler.cpp b/dChatServer/ChatPacketHandler.cpp index 82cea018..891119dc 100644 --- a/dChatServer/ChatPacketHandler.cpp +++ b/dChatServer/ChatPacketHandler.cpp @@ -13,9 +13,9 @@ #include "dConfig.h" #include "eObjectBits.h" #include "eConnectionType.h" -#include "eChatMessageType.h" -#include "eClientMessageType.h" -#include "eGameMessageType.h" +#include "MessageType/Chat.h" +#include "MessageType/Client.h" +#include "MessageType/Game.h" #include "StringifiedEnum.h" #include "eGameMasterLevel.h" #include "ChatPackets.h" @@ -60,11 +60,11 @@ void ChatPacketHandler::HandleFriendlistRequest(Packet* packet) { //Now, we need to send the friendlist to the server they came from: CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::WORLD_ROUTE_PACKET); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::WORLD_ROUTE_PACKET); bitStream.Write(playerID); //portion that will get routed: - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::GET_FRIENDS_LIST_RESPONSE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::GET_FRIENDS_LIST_RESPONSE); bitStream.Write(0); bitStream.Write(1); //Length of packet -- just writing one as it doesn't matter, client skips it. bitStream.Write(player.friends.size()); @@ -368,10 +368,10 @@ void ChatPacketHandler::HandleWho(Packet* packet) { bool online = player; CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::WORLD_ROUTE_PACKET); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::WORLD_ROUTE_PACKET); bitStream.Write(request.requestor); - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::WHO_RESPONSE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::WHO_RESPONSE); bitStream.Write(online); bitStream.Write(player.zoneID.GetMapID()); bitStream.Write(player.zoneID.GetInstanceID()); @@ -391,10 +391,10 @@ void ChatPacketHandler::HandleShowAll(Packet* packet) { if (!sender) return; CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::WORLD_ROUTE_PACKET); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::WORLD_ROUTE_PACKET); bitStream.Write(request.requestor); - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::SHOW_ALL_RESPONSE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::SHOW_ALL_RESPONSE); bitStream.Write(!request.displayZoneData && !request.displayIndividualPlayers); bitStream.Write(Game::playerContainer.GetPlayerCount()); bitStream.Write(Game::playerContainer.GetSimCount()); @@ -416,7 +416,7 @@ void ChatPacketHandler::HandleShowAll(Packet* packet) { SEND_PACKET; } -// the structure the client uses to send this packet is shared in many chat messages +// the structure the client uses to send this packet is shared in many chat messages // that are sent to the server. Because of this, there are large gaps of unused data in chat messages void ChatPacketHandler::HandleChatMessage(Packet* packet) { CINSTREAM_SKIP_HEADER; @@ -428,7 +428,7 @@ void ChatPacketHandler::HandleChatMessage(Packet* packet) { eChatChannel channel; uint32_t size; - + inStream.IgnoreBytes(4); inStream.Read(channel); inStream.Read(size); @@ -436,7 +436,7 @@ void ChatPacketHandler::HandleChatMessage(Packet* packet) { LUWString message(size); inStream.Read(message); - + LOG("Got a message from (%s) via [%s]: %s", sender.playerName.c_str(), StringifiedEnum::ToString(channel).data(), message.GetAsString().c_str()); switch (channel) { @@ -457,7 +457,7 @@ void ChatPacketHandler::HandleChatMessage(Packet* packet) { } } -// the structure the client uses to send this packet is shared in many chat messages +// the structure the client uses to send this packet is shared in many chat messages // that are sent to the server. Because of this, there are large gaps of unused data in chat messages void ChatPacketHandler::HandlePrivateChatMessage(Packet* packet) { CINSTREAM_SKIP_HEADER; @@ -484,7 +484,7 @@ void ChatPacketHandler::HandlePrivateChatMessage(Packet* packet) { LUWString message(size); inStream.Read(message); - + LOG("Got a message from (%s) via [%s]: %s to %s", sender.playerName.c_str(), StringifiedEnum::ToString(channel).data(), message.GetAsString().c_str(), receiverName.c_str()); const auto& receiver = Game::playerContainer.GetPlayerData(receiverName); @@ -515,10 +515,10 @@ void ChatPacketHandler::HandlePrivateChatMessage(Packet* packet) { void ChatPacketHandler::SendPrivateChatMessage(const PlayerData& sender, const PlayerData& receiver, const PlayerData& routeTo, const LUWString& message, const eChatChannel channel, const eChatMessageResponseCode responseCode) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::WORLD_ROUTE_PACKET); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::WORLD_ROUTE_PACKET); bitStream.Write(routeTo.playerID); - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::PRIVATE_CHAT_MESSAGE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::PRIVATE_CHAT_MESSAGE); bitStream.Write(sender.playerID); bitStream.Write(channel); bitStream.Write(0); // not used @@ -757,11 +757,11 @@ void ChatPacketHandler::HandleTeamStatusRequest(Packet* packet) { void ChatPacketHandler::SendTeamInvite(const PlayerData& receiver, const PlayerData& sender) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::WORLD_ROUTE_PACKET); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::WORLD_ROUTE_PACKET); bitStream.Write(receiver.playerID); //portion that will get routed: - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::TEAM_INVITE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::TEAM_INVITE); bitStream.Write(LUWString(sender.playerName.c_str())); bitStream.Write(sender.playerID); @@ -772,14 +772,14 @@ void ChatPacketHandler::SendTeamInvite(const PlayerData& receiver, const PlayerD void ChatPacketHandler::SendTeamInviteConfirm(const PlayerData& receiver, bool bLeaderIsFreeTrial, LWOOBJID i64LeaderID, LWOZONEID i64LeaderZoneID, uint8_t ucLootFlag, uint8_t ucNumOfOtherPlayers, uint8_t ucResponseCode, std::u16string wsLeaderName) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::WORLD_ROUTE_PACKET); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::WORLD_ROUTE_PACKET); bitStream.Write(receiver.playerID); //portion that will get routed: CMSGHEADER; bitStream.Write(receiver.playerID); - bitStream.Write(eGameMessageType::TEAM_INVITE_CONFIRM); + bitStream.Write(MessageType::Game::TEAM_INVITE_CONFIRM); bitStream.Write(bLeaderIsFreeTrial); bitStream.Write(i64LeaderID); @@ -799,14 +799,14 @@ void ChatPacketHandler::SendTeamInviteConfirm(const PlayerData& receiver, bool b void ChatPacketHandler::SendTeamStatus(const PlayerData& receiver, LWOOBJID i64LeaderID, LWOZONEID i64LeaderZoneID, uint8_t ucLootFlag, uint8_t ucNumOfOtherPlayers, std::u16string wsLeaderName) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::WORLD_ROUTE_PACKET); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::WORLD_ROUTE_PACKET); bitStream.Write(receiver.playerID); //portion that will get routed: CMSGHEADER; bitStream.Write(receiver.playerID); - bitStream.Write(eGameMessageType::TEAM_GET_STATUS_RESPONSE); + bitStream.Write(MessageType::Game::TEAM_GET_STATUS_RESPONSE); bitStream.Write(i64LeaderID); bitStream.Write(i64LeaderZoneID); @@ -824,14 +824,14 @@ void ChatPacketHandler::SendTeamStatus(const PlayerData& receiver, LWOOBJID i64L void ChatPacketHandler::SendTeamSetLeader(const PlayerData& receiver, LWOOBJID i64PlayerID) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::WORLD_ROUTE_PACKET); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::WORLD_ROUTE_PACKET); bitStream.Write(receiver.playerID); //portion that will get routed: CMSGHEADER; bitStream.Write(receiver.playerID); - bitStream.Write(eGameMessageType::TEAM_SET_LEADER); + bitStream.Write(MessageType::Game::TEAM_SET_LEADER); bitStream.Write(i64PlayerID); @@ -841,14 +841,14 @@ void ChatPacketHandler::SendTeamSetLeader(const PlayerData& receiver, LWOOBJID i void ChatPacketHandler::SendTeamAddPlayer(const PlayerData& receiver, bool bIsFreeTrial, bool bLocal, bool bNoLootOnDeath, LWOOBJID i64PlayerID, std::u16string wsPlayerName, LWOZONEID zoneID) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::WORLD_ROUTE_PACKET); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::WORLD_ROUTE_PACKET); bitStream.Write(receiver.playerID); //portion that will get routed: CMSGHEADER; bitStream.Write(receiver.playerID); - bitStream.Write(eGameMessageType::TEAM_ADD_PLAYER); + bitStream.Write(MessageType::Game::TEAM_ADD_PLAYER); bitStream.Write(bIsFreeTrial); bitStream.Write(bLocal); @@ -870,14 +870,14 @@ void ChatPacketHandler::SendTeamAddPlayer(const PlayerData& receiver, bool bIsFr void ChatPacketHandler::SendTeamRemovePlayer(const PlayerData& receiver, bool bDisband, bool bIsKicked, bool bIsLeaving, bool bLocal, LWOOBJID i64LeaderID, LWOOBJID i64PlayerID, std::u16string wsPlayerName) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::WORLD_ROUTE_PACKET); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::WORLD_ROUTE_PACKET); bitStream.Write(receiver.playerID); //portion that will get routed: CMSGHEADER; bitStream.Write(receiver.playerID); - bitStream.Write(eGameMessageType::TEAM_REMOVE_PLAYER); + bitStream.Write(MessageType::Game::TEAM_REMOVE_PLAYER); bitStream.Write(bDisband); bitStream.Write(bIsKicked); @@ -896,14 +896,14 @@ void ChatPacketHandler::SendTeamRemovePlayer(const PlayerData& receiver, bool bD void ChatPacketHandler::SendTeamSetOffWorldFlag(const PlayerData& receiver, LWOOBJID i64PlayerID, LWOZONEID zoneID) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::WORLD_ROUTE_PACKET); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::WORLD_ROUTE_PACKET); bitStream.Write(receiver.playerID); //portion that will get routed: CMSGHEADER; bitStream.Write(receiver.playerID); - bitStream.Write(eGameMessageType::TEAM_SET_OFF_WORLD_FLAG); + bitStream.Write(MessageType::Game::TEAM_SET_OFF_WORLD_FLAG); bitStream.Write(i64PlayerID); if (receiver.zoneID.GetCloneID() == zoneID.GetCloneID()) { @@ -930,11 +930,11 @@ void ChatPacketHandler::SendFriendUpdate(const PlayerData& friendData, const Pla [bool] - is FTP*/ CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::WORLD_ROUTE_PACKET); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::WORLD_ROUTE_PACKET); bitStream.Write(friendData.playerID); //portion that will get routed: - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::UPDATE_FRIEND_NOTIFY); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::UPDATE_FRIEND_NOTIFY); bitStream.Write(notifyType); std::string playerName = playerData.playerName.c_str(); @@ -967,11 +967,11 @@ void ChatPacketHandler::SendFriendRequest(const PlayerData& receiver, const Play } CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::WORLD_ROUTE_PACKET); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::WORLD_ROUTE_PACKET); bitStream.Write(receiver.playerID); //portion that will get routed: - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::ADD_FRIEND_REQUEST); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::ADD_FRIEND_REQUEST); bitStream.Write(LUWString(sender.playerName)); bitStream.Write(0); // This is a BFF flag however this is unused in live and does not have an implementation client side. @@ -981,11 +981,11 @@ void ChatPacketHandler::SendFriendRequest(const PlayerData& receiver, const Play void ChatPacketHandler::SendFriendResponse(const PlayerData& receiver, const PlayerData& sender, eAddFriendResponseType responseCode, uint8_t isBestFriendsAlready, uint8_t isBestFriendRequest) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::WORLD_ROUTE_PACKET); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::WORLD_ROUTE_PACKET); bitStream.Write(receiver.playerID); // Portion that will get routed: - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::ADD_FRIEND_RESPONSE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::ADD_FRIEND_RESPONSE); bitStream.Write(responseCode); // For all requests besides accepted, write a flag that says whether or not we are already best friends with the receiver. bitStream.Write(responseCode != eAddFriendResponseType::ACCEPTED ? isBestFriendsAlready : sender.sysAddr != UNASSIGNED_SYSTEM_ADDRESS); @@ -1004,11 +1004,11 @@ void ChatPacketHandler::SendFriendResponse(const PlayerData& receiver, const Pla void ChatPacketHandler::SendRemoveFriend(const PlayerData& receiver, std::string& personToRemove, bool isSuccessful) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::WORLD_ROUTE_PACKET); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::WORLD_ROUTE_PACKET); bitStream.Write(receiver.playerID); //portion that will get routed: - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::REMOVE_FRIEND_RESPONSE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::REMOVE_FRIEND_RESPONSE); bitStream.Write(isSuccessful); //isOnline bitStream.Write(LUWString(personToRemove)); diff --git a/dChatServer/ChatServer.cpp b/dChatServer/ChatServer.cpp index d6e99230..022175e5 100644 --- a/dChatServer/ChatServer.cpp +++ b/dChatServer/ChatServer.cpp @@ -16,8 +16,8 @@ #include "eConnectionType.h" #include "PlayerContainer.h" #include "ChatPacketHandler.h" -#include "eChatMessageType.h" -#include "eWorldMessageType.h" +#include "MessageType/Chat.h" +#include "MessageType/World.h" #include "ChatIgnoreList.h" #include "StringifiedEnum.h" @@ -108,7 +108,7 @@ int main(int argc, char** argv) { const bool dontGenerateDCF = GeneralUtils::TryParse(Game::config->GetValue("dont_generate_dcf")).value_or(false); Game::chatFilter = new dChatFilter(Game::assetManager->GetResPath().string() + "/chatplus_en_us", dontGenerateDCF); - + Game::randomEngine = std::mt19937(time(0)); Game::playerContainer.Initialize(); @@ -190,154 +190,154 @@ void HandlePacket(Packet* packet) { inStream.SetReadOffset(BYTES_TO_BITS(1)); eConnectionType connection; - eChatMessageType chatMessageID; + MessageType::Chat chatMessageID; inStream.Read(connection); if (connection != eConnectionType::CHAT) return; inStream.Read(chatMessageID); - + switch (chatMessageID) { - case eChatMessageType::GM_MUTE: + case MessageType::Chat::GM_MUTE: Game::playerContainer.MuteUpdate(packet); break; - case eChatMessageType::CREATE_TEAM: + case MessageType::Chat::CREATE_TEAM: Game::playerContainer.CreateTeamServer(packet); break; - case eChatMessageType::GET_FRIENDS_LIST: + case MessageType::Chat::GET_FRIENDS_LIST: ChatPacketHandler::HandleFriendlistRequest(packet); break; - case eChatMessageType::GET_IGNORE_LIST: + case MessageType::Chat::GET_IGNORE_LIST: ChatIgnoreList::GetIgnoreList(packet); break; - case eChatMessageType::ADD_IGNORE: + case MessageType::Chat::ADD_IGNORE: ChatIgnoreList::AddIgnore(packet); break; - case eChatMessageType::REMOVE_IGNORE: + case MessageType::Chat::REMOVE_IGNORE: ChatIgnoreList::RemoveIgnore(packet); break; - case eChatMessageType::TEAM_GET_STATUS: + case MessageType::Chat::TEAM_GET_STATUS: ChatPacketHandler::HandleTeamStatusRequest(packet); break; - case eChatMessageType::ADD_FRIEND_REQUEST: + case MessageType::Chat::ADD_FRIEND_REQUEST: //this involves someone sending the initial request, the response is below, response as in from the other player. //We basically just check to see if this player is online or not and route the packet. ChatPacketHandler::HandleFriendRequest(packet); break; - case eChatMessageType::ADD_FRIEND_RESPONSE: + case MessageType::Chat::ADD_FRIEND_RESPONSE: //This isn't the response a server sent, rather it is a player's response to a received request. //Here, we'll actually have to add them to eachother's friend lists depending on the response code. ChatPacketHandler::HandleFriendResponse(packet); break; - case eChatMessageType::REMOVE_FRIEND: + case MessageType::Chat::REMOVE_FRIEND: ChatPacketHandler::HandleRemoveFriend(packet); break; - case eChatMessageType::GENERAL_CHAT_MESSAGE: + case MessageType::Chat::GENERAL_CHAT_MESSAGE: ChatPacketHandler::HandleChatMessage(packet); break; - case eChatMessageType::PRIVATE_CHAT_MESSAGE: + case MessageType::Chat::PRIVATE_CHAT_MESSAGE: //This message is supposed to be echo'd to both the sender and the receiver //BUT: they have to have different responseCodes, so we'll do some of the ol hacky wacky to fix that right up. ChatPacketHandler::HandlePrivateChatMessage(packet); break; - case eChatMessageType::TEAM_INVITE: + case MessageType::Chat::TEAM_INVITE: ChatPacketHandler::HandleTeamInvite(packet); break; - case eChatMessageType::TEAM_INVITE_RESPONSE: + case MessageType::Chat::TEAM_INVITE_RESPONSE: ChatPacketHandler::HandleTeamInviteResponse(packet); break; - case eChatMessageType::TEAM_LEAVE: + case MessageType::Chat::TEAM_LEAVE: ChatPacketHandler::HandleTeamLeave(packet); break; - case eChatMessageType::TEAM_SET_LEADER: + case MessageType::Chat::TEAM_SET_LEADER: ChatPacketHandler::HandleTeamPromote(packet); break; - case eChatMessageType::TEAM_KICK: + case MessageType::Chat::TEAM_KICK: ChatPacketHandler::HandleTeamKick(packet); break; - case eChatMessageType::TEAM_SET_LOOT: + case MessageType::Chat::TEAM_SET_LOOT: ChatPacketHandler::HandleTeamLootOption(packet); break; - case eChatMessageType::GMLEVEL_UPDATE: + case MessageType::Chat::GMLEVEL_UPDATE: ChatPacketHandler::HandleGMLevelUpdate(packet); break; - case eChatMessageType::LOGIN_SESSION_NOTIFY: + case MessageType::Chat::LOGIN_SESSION_NOTIFY: Game::playerContainer.InsertPlayer(packet); break; - case eChatMessageType::GM_ANNOUNCE:{ + case MessageType::Chat::GM_ANNOUNCE:{ // we just forward this packet to every connected server inStream.ResetReadPointer(); Game::server->Send(inStream, packet->systemAddress, true); // send to everyone except origin } break; - case eChatMessageType::UNEXPECTED_DISCONNECT: + case MessageType::Chat::UNEXPECTED_DISCONNECT: Game::playerContainer.RemovePlayer(packet); break; - case eChatMessageType::WHO: + case MessageType::Chat::WHO: ChatPacketHandler::HandleWho(packet); break; - case eChatMessageType::SHOW_ALL: + case MessageType::Chat::SHOW_ALL: ChatPacketHandler::HandleShowAll(packet); break; - case eChatMessageType::USER_CHANNEL_CHAT_MESSAGE: - case eChatMessageType::WORLD_DISCONNECT_REQUEST: - case eChatMessageType::WORLD_PROXIMITY_RESPONSE: - case eChatMessageType::WORLD_PARCEL_RESPONSE: - case eChatMessageType::TEAM_MISSED_INVITE_CHECK: - case eChatMessageType::GUILD_CREATE: - case eChatMessageType::GUILD_INVITE: - case eChatMessageType::GUILD_INVITE_RESPONSE: - case eChatMessageType::GUILD_LEAVE: - case eChatMessageType::GUILD_KICK: - case eChatMessageType::GUILD_GET_STATUS: - case eChatMessageType::GUILD_GET_ALL: - case eChatMessageType::BLUEPRINT_MODERATED: - case eChatMessageType::BLUEPRINT_MODEL_READY: - case eChatMessageType::PROPERTY_READY_FOR_APPROVAL: - case eChatMessageType::PROPERTY_MODERATION_CHANGED: - case eChatMessageType::PROPERTY_BUILDMODE_CHANGED: - case eChatMessageType::PROPERTY_BUILDMODE_CHANGED_REPORT: - case eChatMessageType::MAIL: - case eChatMessageType::WORLD_INSTANCE_LOCATION_REQUEST: - case eChatMessageType::REPUTATION_UPDATE: - case eChatMessageType::SEND_CANNED_TEXT: - case eChatMessageType::CHARACTER_NAME_CHANGE_REQUEST: - case eChatMessageType::CSR_REQUEST: - case eChatMessageType::CSR_REPLY: - case eChatMessageType::GM_KICK: - case eChatMessageType::WORLD_ROUTE_PACKET: - case eChatMessageType::GET_ZONE_POPULATIONS: - case eChatMessageType::REQUEST_MINIMUM_CHAT_MODE: - case eChatMessageType::MATCH_REQUEST: - case eChatMessageType::UGCMANIFEST_REPORT_MISSING_FILE: - case eChatMessageType::UGCMANIFEST_REPORT_DONE_FILE: - case eChatMessageType::UGCMANIFEST_REPORT_DONE_BLUEPRINT: - case eChatMessageType::UGCC_REQUEST: - case eChatMessageType::WORLD_PLAYERS_PET_MODERATED_ACKNOWLEDGE: - case eChatMessageType::ACHIEVEMENT_NOTIFY: - case eChatMessageType::GM_CLOSE_PRIVATE_CHAT_WINDOW: - case eChatMessageType::PLAYER_READY: - case eChatMessageType::GET_DONATION_TOTAL: - case eChatMessageType::UPDATE_DONATION: - case eChatMessageType::PRG_CSR_COMMAND: - case eChatMessageType::HEARTBEAT_REQUEST_FROM_WORLD: - case eChatMessageType::UPDATE_FREE_TRIAL_STATUS: + case MessageType::Chat::USER_CHANNEL_CHAT_MESSAGE: + case MessageType::Chat::WORLD_DISCONNECT_REQUEST: + case MessageType::Chat::WORLD_PROXIMITY_RESPONSE: + case MessageType::Chat::WORLD_PARCEL_RESPONSE: + case MessageType::Chat::TEAM_MISSED_INVITE_CHECK: + case MessageType::Chat::GUILD_CREATE: + case MessageType::Chat::GUILD_INVITE: + case MessageType::Chat::GUILD_INVITE_RESPONSE: + case MessageType::Chat::GUILD_LEAVE: + case MessageType::Chat::GUILD_KICK: + case MessageType::Chat::GUILD_GET_STATUS: + case MessageType::Chat::GUILD_GET_ALL: + case MessageType::Chat::BLUEPRINT_MODERATED: + case MessageType::Chat::BLUEPRINT_MODEL_READY: + case MessageType::Chat::PROPERTY_READY_FOR_APPROVAL: + case MessageType::Chat::PROPERTY_MODERATION_CHANGED: + case MessageType::Chat::PROPERTY_BUILDMODE_CHANGED: + case MessageType::Chat::PROPERTY_BUILDMODE_CHANGED_REPORT: + case MessageType::Chat::MAIL: + case MessageType::Chat::WORLD_INSTANCE_LOCATION_REQUEST: + case MessageType::Chat::REPUTATION_UPDATE: + case MessageType::Chat::SEND_CANNED_TEXT: + case MessageType::Chat::CHARACTER_NAME_CHANGE_REQUEST: + case MessageType::Chat::CSR_REQUEST: + case MessageType::Chat::CSR_REPLY: + case MessageType::Chat::GM_KICK: + case MessageType::Chat::WORLD_ROUTE_PACKET: + case MessageType::Chat::GET_ZONE_POPULATIONS: + case MessageType::Chat::REQUEST_MINIMUM_CHAT_MODE: + case MessageType::Chat::MATCH_REQUEST: + case MessageType::Chat::UGCMANIFEST_REPORT_MISSING_FILE: + case MessageType::Chat::UGCMANIFEST_REPORT_DONE_FILE: + case MessageType::Chat::UGCMANIFEST_REPORT_DONE_BLUEPRINT: + case MessageType::Chat::UGCC_REQUEST: + case MessageType::Chat::WORLD_PLAYERS_PET_MODERATED_ACKNOWLEDGE: + case MessageType::Chat::ACHIEVEMENT_NOTIFY: + case MessageType::Chat::GM_CLOSE_PRIVATE_CHAT_WINDOW: + case MessageType::Chat::PLAYER_READY: + case MessageType::Chat::GET_DONATION_TOTAL: + case MessageType::Chat::UPDATE_DONATION: + case MessageType::Chat::PRG_CSR_COMMAND: + case MessageType::Chat::HEARTBEAT_REQUEST_FROM_WORLD: + case MessageType::Chat::UPDATE_FREE_TRIAL_STATUS: LOG("Unhandled CHAT Message id: %s (%i)", StringifiedEnum::ToString(chatMessageID).data(), chatMessageID); break; default: diff --git a/dChatServer/PlayerContainer.cpp b/dChatServer/PlayerContainer.cpp index f279195e..d1141ce7 100644 --- a/dChatServer/PlayerContainer.cpp +++ b/dChatServer/PlayerContainer.cpp @@ -11,7 +11,7 @@ #include "eConnectionType.h" #include "ChatPackets.h" #include "dConfig.h" -#include "eChatMessageType.h" +#include "MessageType/Chat.h" void PlayerContainer::Initialize() { m_MaxNumberOfBestFriends = @@ -148,14 +148,13 @@ void PlayerContainer::CreateTeamServer(Packet* packet) { if (team != nullptr) { team->zoneId = zoneId; + UpdateTeamsOnWorld(team, false); } - - UpdateTeamsOnWorld(team, false); } void PlayerContainer::BroadcastMuteUpdate(LWOOBJID player, time_t time) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::GM_MUTE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::GM_MUTE); bitStream.Write(player); bitStream.Write(time); @@ -362,7 +361,7 @@ void PlayerContainer::TeamStatusUpdate(TeamData* team) { void PlayerContainer::UpdateTeamsOnWorld(TeamData* team, bool deleteTeam) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::TEAM_GET_STATUS); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::TEAM_GET_STATUS); bitStream.Write(team->teamID); bitStream.Write(deleteTeam); diff --git a/dCommon/AMFDeserialize.cpp b/dCommon/AMFDeserialize.cpp index 130ebc4a..884a0784 100644 --- a/dCommon/AMFDeserialize.cpp +++ b/dCommon/AMFDeserialize.cpp @@ -9,73 +9,54 @@ * AMF3 Deserializer written by EmosewaMC */ -AMFBaseValue* AMFDeserialize::Read(RakNet::BitStream& inStream) { - AMFBaseValue* returnValue = nullptr; +std::unique_ptr AMFDeserialize::Read(RakNet::BitStream& inStream) { // Read in the value type from the bitStream eAmf marker; inStream.Read(marker); // Based on the typing, create the value associated with that and return the base value class switch (marker) { - case eAmf::Undefined: { - returnValue = new AMFBaseValue(); - break; - } - - case eAmf::Null: { - returnValue = new AMFNullValue(); - break; - } - - case eAmf::False: { - returnValue = new AMFBoolValue(false); - break; - } - - case eAmf::True: { - returnValue = new AMFBoolValue(true); - break; - } - - case eAmf::Integer: { - returnValue = ReadAmfInteger(inStream); - break; - } - - case eAmf::Double: { - returnValue = ReadAmfDouble(inStream); - break; - } - - case eAmf::String: { - returnValue = ReadAmfString(inStream); - break; - } - - case eAmf::Array: { - returnValue = ReadAmfArray(inStream); - break; - } + case eAmf::Undefined: + return std::make_unique(); + case eAmf::Null: + return std::make_unique(); + case eAmf::False: + return std::make_unique(false); + case eAmf::True: + return std::make_unique(true); + case eAmf::Integer: + return ReadAmfInteger(inStream); + case eAmf::Double: + return ReadAmfDouble(inStream); + case eAmf::String: + return ReadAmfString(inStream); + case eAmf::Array: + return ReadAmfArray(inStream); // These values are unimplemented in the live client and will remain unimplemented // unless someone modifies the client to allow serializing of these values. case eAmf::XMLDoc: + [[fallthrough]]; case eAmf::Date: + [[fallthrough]]; case eAmf::Object: + [[fallthrough]]; case eAmf::XML: + [[fallthrough]]; case eAmf::ByteArray: + [[fallthrough]]; case eAmf::VectorInt: + [[fallthrough]]; case eAmf::VectorUInt: + [[fallthrough]]; case eAmf::VectorDouble: + [[fallthrough]]; case eAmf::VectorObject: - case eAmf::Dictionary: { + [[fallthrough]]; + case eAmf::Dictionary: throw marker; - break; - } default: throw std::invalid_argument("Invalid AMF3 marker" + std::to_string(static_cast(marker))); - break; } - return returnValue; } uint32_t AMFDeserialize::ReadU29(RakNet::BitStream& inStream) { @@ -118,14 +99,14 @@ const std::string AMFDeserialize::ReadString(RakNet::BitStream& inStream) { } } -AMFBaseValue* AMFDeserialize::ReadAmfDouble(RakNet::BitStream& inStream) { +std::unique_ptr AMFDeserialize::ReadAmfDouble(RakNet::BitStream& inStream) { double value; inStream.Read(value); - return new AMFDoubleValue(value); + return std::make_unique(value); } -AMFBaseValue* AMFDeserialize::ReadAmfArray(RakNet::BitStream& inStream) { - auto arrayValue = new AMFArrayValue(); +std::unique_ptr AMFDeserialize::ReadAmfArray(RakNet::BitStream& inStream) { + auto arrayValue = std::make_unique(); // Read size of dense array const auto sizeOfDenseArray = (ReadU29(inStream) >> 1); @@ -143,10 +124,10 @@ AMFBaseValue* AMFDeserialize::ReadAmfArray(RakNet::BitStream& inStream) { return arrayValue; } -AMFBaseValue* AMFDeserialize::ReadAmfString(RakNet::BitStream& inStream) { - return new AMFStringValue(ReadString(inStream)); +std::unique_ptr AMFDeserialize::ReadAmfString(RakNet::BitStream& inStream) { + return std::make_unique(ReadString(inStream)); } -AMFBaseValue* AMFDeserialize::ReadAmfInteger(RakNet::BitStream& inStream) { - return new AMFIntValue(ReadU29(inStream)); +std::unique_ptr AMFDeserialize::ReadAmfInteger(RakNet::BitStream& inStream) { + return std::make_unique(ReadU29(inStream)); // NOTE: NARROWING CONVERSION FROM UINT TO INT. IS THIS INTENDED? } diff --git a/dCommon/AMFDeserialize.h b/dCommon/AMFDeserialize.h index e204976d..dc8a21a8 100644 --- a/dCommon/AMFDeserialize.h +++ b/dCommon/AMFDeserialize.h @@ -1,12 +1,12 @@ #pragma once +#include "Amf3.h" #include "BitStream.h" +#include #include #include -class AMFBaseValue; - class AMFDeserialize { public: /** @@ -15,7 +15,7 @@ public: * @param inStream inStream to read value from. * @return Returns an AMFValue with all the information from the bitStream in it. */ - AMFBaseValue* Read(RakNet::BitStream& inStream); + std::unique_ptr Read(RakNet::BitStream& inStream); private: /** * @brief Private method to read a U29 integer from a bitstream @@ -39,7 +39,7 @@ private: * @param inStream bitStream to read data from * @return Double value represented as an AMFValue */ - AMFBaseValue* ReadAmfDouble(RakNet::BitStream& inStream); + static std::unique_ptr ReadAmfDouble(RakNet::BitStream& inStream); /** * @brief Read an AMFArray from a bitStream @@ -47,7 +47,7 @@ private: * @param inStream bitStream to read data from * @return Array value represented as an AMFValue */ - AMFBaseValue* ReadAmfArray(RakNet::BitStream& inStream); + std::unique_ptr ReadAmfArray(RakNet::BitStream& inStream); /** * @brief Read an AMFString from a bitStream @@ -55,7 +55,7 @@ private: * @param inStream bitStream to read data from * @return String value represented as an AMFValue */ - AMFBaseValue* ReadAmfString(RakNet::BitStream& inStream); + std::unique_ptr ReadAmfString(RakNet::BitStream& inStream); /** * @brief Read an AMFInteger from a bitStream @@ -63,7 +63,7 @@ private: * @param inStream bitStream to read data from * @return Integer value represented as an AMFValue */ - AMFBaseValue* ReadAmfInteger(RakNet::BitStream& inStream); + static std::unique_ptr ReadAmfInteger(RakNet::BitStream& inStream); /** * List of strings read so far saved to be read by reference. diff --git a/dCommon/Amf3.h b/dCommon/Amf3.h index 9fe728c0..21a3c0c7 100644 --- a/dCommon/Amf3.h +++ b/dCommon/Amf3.h @@ -105,27 +105,14 @@ using AMFDoubleValue = AMFValue; * and are not to be deleted by a caller. */ class AMFArrayValue : public AMFBaseValue { - using AMFAssociative = std::unordered_map; - using AMFDense = std::vector; + using AMFAssociative = + std::unordered_map, GeneralUtils::transparent_string_hash, std::equal_to<>>; + + using AMFDense = std::vector>; public: [[nodiscard]] constexpr eAmf GetValueType() const noexcept override { return eAmf::Array; } - ~AMFArrayValue() override { - for (const auto* valueToDelete : GetDense()) { - if (valueToDelete) { - delete valueToDelete; - valueToDelete = nullptr; - } - } - for (auto valueToDelete : GetAssociative()) { - if (valueToDelete.second) { - delete valueToDelete.second; - valueToDelete.second = nullptr; - } - } - } - /** * Returns the Associative portion of the object */ @@ -151,30 +138,32 @@ public: * or nullptr if a key existed and was not the same type */ template - [[maybe_unused]] std::pair*, bool> Insert(const std::string& key, const ValueType value) { + [[maybe_unused]] std::pair*, bool> Insert(const std::string_view key, const ValueType value) { const auto element = m_Associative.find(key); AMFValue* val = nullptr; bool found = true; if (element == m_Associative.cend()) { - val = new AMFValue(value); - m_Associative.emplace(key, val); + auto newVal = std::make_unique>(value); + val = newVal.get(); + m_Associative.emplace(key, std::move(newVal)); } else { - val = dynamic_cast*>(element->second); + val = dynamic_cast*>(element->second.get()); found = false; } return std::make_pair(val, found); } // Associates an array with a string key - [[maybe_unused]] std::pair Insert(const std::string& key) { + [[maybe_unused]] std::pair Insert(const std::string_view key) { const auto element = m_Associative.find(key); AMFArrayValue* val = nullptr; bool found = true; if (element == m_Associative.cend()) { - val = new AMFArrayValue(); - m_Associative.emplace(key, val); + auto newVal = std::make_unique(); + val = newVal.get(); + m_Associative.emplace(key, std::move(newVal)); } else { - val = dynamic_cast(element->second); + val = dynamic_cast(element->second.get()); found = false; } return std::make_pair(val, found); @@ -182,15 +171,13 @@ public: // Associates an array with an integer key [[maybe_unused]] std::pair Insert(const size_t index) { - AMFArrayValue* val = nullptr; bool inserted = false; if (index >= m_Dense.size()) { m_Dense.resize(index + 1); - val = new AMFArrayValue(); - m_Dense.at(index) = val; + m_Dense.at(index) = std::make_unique(); inserted = true; } - return std::make_pair(dynamic_cast(m_Dense.at(index)), inserted); + return std::make_pair(dynamic_cast(m_Dense.at(index).get()), inserted); } /** @@ -205,15 +192,13 @@ public: */ template [[maybe_unused]] std::pair*, bool> Insert(const size_t index, const ValueType value) { - AMFValue* val = nullptr; bool inserted = false; if (index >= m_Dense.size()) { m_Dense.resize(index + 1); - val = new AMFValue(value); - m_Dense.at(index) = val; + m_Dense.at(index) = std::make_unique>(value); inserted = true; } - return std::make_pair(dynamic_cast*>(m_Dense.at(index)), inserted); + return std::make_pair(dynamic_cast*>(m_Dense.at(index).get()), inserted); } /** @@ -225,13 +210,12 @@ public: * @param key The key to associate with the value * @param value The value to insert */ - void Insert(const std::string& key, AMFBaseValue* const value) { + void Insert(const std::string_view key, std::unique_ptr value) { const auto element = m_Associative.find(key); if (element != m_Associative.cend() && element->second) { - delete element->second; - element->second = value; + element->second = std::move(value); } else { - m_Associative.emplace(key, value); + m_Associative.emplace(key, std::move(value)); } } @@ -244,14 +228,11 @@ public: * @param key The key to associate with the value * @param value The value to insert */ - void Insert(const size_t index, AMFBaseValue* const value) { - if (index < m_Dense.size()) { - const AMFDense::const_iterator itr = m_Dense.cbegin() + index; - if (*itr) delete m_Dense.at(index); - } else { + void Insert(const size_t index, std::unique_ptr value) { + if (index >= m_Dense.size()) { m_Dense.resize(index + 1); } - m_Dense.at(index) = value; + m_Dense.at(index) = std::move(value); } /** @@ -279,8 +260,7 @@ public: void Remove(const std::string& key, const bool deleteValue = true) { const AMFAssociative::const_iterator it = m_Associative.find(key); if (it != m_Associative.cend()) { - if (deleteValue) delete it->second; - m_Associative.erase(it); + if (deleteValue) m_Associative.erase(it); } } @@ -290,7 +270,6 @@ public: void Remove(const size_t index) { if (!m_Dense.empty() && index < m_Dense.size()) { const auto itr = m_Dense.cbegin() + index; - if (*itr) delete (*itr); m_Dense.erase(itr); } } @@ -299,16 +278,16 @@ public: if (!m_Dense.empty()) Remove(m_Dense.size() - 1); } - [[nodiscard]] AMFArrayValue* GetArray(const std::string& key) const { + [[nodiscard]] AMFArrayValue* GetArray(const std::string_view key) const { const AMFAssociative::const_iterator it = m_Associative.find(key); - return it != m_Associative.cend() ? dynamic_cast(it->second) : nullptr; + return it != m_Associative.cend() ? dynamic_cast(it->second.get()) : nullptr; } [[nodiscard]] AMFArrayValue* GetArray(const size_t index) const { - return index < m_Dense.size() ? dynamic_cast(m_Dense.at(index)) : nullptr; + return index < m_Dense.size() ? dynamic_cast(m_Dense.at(index).get()) : nullptr; } - [[maybe_unused]] inline AMFArrayValue* InsertArray(const std::string& key) { + [[maybe_unused]] inline AMFArrayValue* InsertArray(const std::string_view key) { return static_cast(Insert(key).first); } @@ -330,17 +309,17 @@ public: * @return The AMFValue */ template - [[nodiscard]] AMFValue* Get(const std::string& key) const { + [[nodiscard]] AMFValue* Get(const std::string_view key) const { const AMFAssociative::const_iterator it = m_Associative.find(key); return it != m_Associative.cend() ? - dynamic_cast*>(it->second) : + dynamic_cast*>(it->second.get()) : nullptr; } // Get from the array but dont cast it - [[nodiscard]] AMFBaseValue* Get(const std::string& key) const { + [[nodiscard]] AMFBaseValue* Get(const std::string_view key) const { const AMFAssociative::const_iterator it = m_Associative.find(key); - return it != m_Associative.cend() ? it->second : nullptr; + return it != m_Associative.cend() ? it->second.get() : nullptr; } /** @@ -355,13 +334,13 @@ public: template [[nodiscard]] AMFValue* Get(const size_t index) const { return index < m_Dense.size() ? - dynamic_cast*>(m_Dense.at(index)) : + dynamic_cast*>(m_Dense.at(index).get()) : nullptr; } // Get from the dense but dont cast it [[nodiscard]] AMFBaseValue* Get(const size_t index) const { - return index < m_Dense.size() ? m_Dense.at(index) : nullptr; + return index < m_Dense.size() ? m_Dense.at(index).get() : nullptr; } private: diff --git a/dCommon/GeneralUtils.h b/dCommon/GeneralUtils.h index 0a8d15c1..2c93b656 100644 --- a/dCommon/GeneralUtils.h +++ b/dCommon/GeneralUtils.h @@ -129,6 +129,29 @@ namespace GeneralUtils { std::vector GetSqlFileNamesFromFolder(const std::string_view folder); + /** + * Transparent string hasher - used to allow string_view key lookups for maps storing std::string keys + * https://www.reddit.com/r/cpp_questions/comments/12xw3sn/find_stdstring_view_in_unordered_map_with/jhki225/ + * https://godbolt.org/z/789xv8Eeq + */ + template + struct overload : Bases... { + using is_transparent = void; + using Bases::operator() ... ; + }; + + struct char_pointer_hash { + auto operator()(const char* const ptr) const noexcept { + return std::hash{}(ptr); + } + }; + + using transparent_string_hash = overload< + std::hash, + std::hash, + char_pointer_hash + >; + // Concept constraining to enum types template concept Enum = std::is_enum_v; diff --git a/dCommon/Implementation.h b/dCommon/Implementation.h new file mode 100644 index 00000000..7cfa2012 --- /dev/null +++ b/dCommon/Implementation.h @@ -0,0 +1,92 @@ +#ifndef __IMPLEMENTATION_H__ +#define __IMPLEMENTATION_H__ + +#include +#include + +/** + * @brief A way to defer the implementation of an action. + * + * @tparam R The result of the action. + * @tparam T The types of the arguments that the implementation requires. + */ +template +class Implementation { +public: + typedef std::function(T...)> ImplementationFunction; + + /** + * @brief Sets the implementation of the action. + * + * @param implementation The implementation of the action. + */ + void SetImplementation(const ImplementationFunction& implementation) { + this->implementation = implementation; + } + + /** + * @brief Clears the implementation of the action. + */ + void ClearImplementation() { + implementation.reset(); + } + + /** + * @brief Checks if the implementation is set. + * + * @return true If the implementation is set. + * @return false If the implementation is not set. + */ + bool IsSet() const { + return implementation.has_value(); + } + + /** + * @brief Executes the implementation if it is set. + * + * @param args The arguments to pass to the implementation. + * @return std::optional The optional result of the implementation. If the result is not set, it indicates that the default action should be taken. + */ + std::optional Execute(T... args) const { + return IsSet() ? implementation.value()(args...) : std::nullopt; + } + + /** + * @brief Exectues the implementation if it is set, otherwise returns a default value. + * + * @param args The arguments to pass to the implementation. + * @param defaultValue The default value to return if the implementation is not set or should not be deferred. + */ + R ExecuteWithDefault(T... args, const R& defaultValue) const { + return Execute(args...).value_or(defaultValue); + } + + /** + * = operator overload. + */ + Implementation& operator=(const Implementation& other) { + implementation = other.implementation; + return *this; + } + + /** + * = operator overload. + */ + Implementation& operator=(const ImplementationFunction& implementation) { + this->implementation = implementation; + return *this; + } + + /** + * () operator overload. + */ + std::optional operator()(T... args) { + return !IsSet() ? std::nullopt : implementation(args...); + } + +private: + std::optional implementation; + +}; + +#endif //!__IMPLEMENTATION_H__ diff --git a/dCommon/Observable.h b/dCommon/Observable.h new file mode 100644 index 00000000..3acee05e --- /dev/null +++ b/dCommon/Observable.h @@ -0,0 +1,73 @@ +#ifndef __OBSERVABLE_H__ +#define __OBSERVABLE_H__ + +#include +#include + +/** + * @brief An event which can be observed by multiple observers. + * + * @tparam T The types of the arguments to be passed to the observers. + */ +template +class Observable { +public: + typedef std::function Observer; + + /** + * @brief Adds an observer to the event. + * + * @param observer The observer to add. + */ + void AddObserver(const Observer& observer) { + observers.push_back(observer); + } + + /** + * @brief Removes an observer from the event. + * + * @param observer The observer to remove. + */ + void RemoveObserver(const Observer& observer) { + observers.erase(std::remove(observers.begin(), observers.end(), observer), observers.end()); + } + + /** + * @brief Notifies all observers of the event. + * + * @param args The arguments to pass to the observers. + */ + void Notify(T... args) { + for (const auto& observer : observers) { + observer(args...); + } + } + + /** + * += operator overload. + */ + Observable& operator+=(const Observer& observer) { + AddObserver(observer); + return *this; + } + + /** + * -= operator overload. + */ + Observable& operator-=(const Observer& observer) { + RemoveObserver(observer); + return *this; + } + + /** + * () operator overload. + */ + void operator()(T... args) { + Notify(args...); + } + +private: + std::vector observers; +}; + +#endif //!__OBSERVABLE_H__ \ No newline at end of file diff --git a/dCommon/dEnums/MessageType/Auth.h b/dCommon/dEnums/MessageType/Auth.h new file mode 100644 index 00000000..12e28dcb --- /dev/null +++ b/dCommon/dEnums/MessageType/Auth.h @@ -0,0 +1,13 @@ +#pragma once +#include + +namespace MessageType { + enum class Auth : uint32_t { + LOGIN_REQUEST = 0, + LOGOUT_REQUEST, + CREATE_NEW_ACCOUNT_REQUEST, + LEGOINTERFACE_AUTH_RESPONSE, + SESSIONKEY_RECEIVED_CONFIRM, + RUNTIME_CONFIG + }; +} diff --git a/dCommon/dEnums/MessageType/Chat.h b/dCommon/dEnums/MessageType/Chat.h new file mode 100644 index 00000000..09f4ef69 --- /dev/null +++ b/dCommon/dEnums/MessageType/Chat.h @@ -0,0 +1,78 @@ +#pragma once +#include + +namespace MessageType { + //! The Internal Chat Packet Identifiers + enum class Chat : uint32_t { + LOGIN_SESSION_NOTIFY = 0, + GENERAL_CHAT_MESSAGE, + PRIVATE_CHAT_MESSAGE, + USER_CHANNEL_CHAT_MESSAGE, + WORLD_DISCONNECT_REQUEST, + WORLD_PROXIMITY_RESPONSE, + WORLD_PARCEL_RESPONSE, + ADD_FRIEND_REQUEST, + ADD_FRIEND_RESPONSE, + REMOVE_FRIEND, + GET_FRIENDS_LIST, + ADD_IGNORE, + REMOVE_IGNORE, + GET_IGNORE_LIST, + TEAM_MISSED_INVITE_CHECK, + TEAM_INVITE, + TEAM_INVITE_RESPONSE, + TEAM_KICK, + TEAM_LEAVE, + TEAM_SET_LOOT, + TEAM_SET_LEADER, + TEAM_GET_STATUS, + GUILD_CREATE, + GUILD_INVITE, + GUILD_INVITE_RESPONSE, + GUILD_LEAVE, + GUILD_KICK, + GUILD_GET_STATUS, + GUILD_GET_ALL, + SHOW_ALL, + BLUEPRINT_MODERATED, + BLUEPRINT_MODEL_READY, + PROPERTY_READY_FOR_APPROVAL, + PROPERTY_MODERATION_CHANGED, + PROPERTY_BUILDMODE_CHANGED, + PROPERTY_BUILDMODE_CHANGED_REPORT, + MAIL, + WORLD_INSTANCE_LOCATION_REQUEST, + REPUTATION_UPDATE, + SEND_CANNED_TEXT, + GMLEVEL_UPDATE, + CHARACTER_NAME_CHANGE_REQUEST, + CSR_REQUEST, + CSR_REPLY, + GM_KICK, + GM_ANNOUNCE, + GM_MUTE, + ACTIVITY_UPDATE, + WORLD_ROUTE_PACKET, + GET_ZONE_POPULATIONS, + REQUEST_MINIMUM_CHAT_MODE, + REQUEST_MINIMUM_CHAT_MODE_PRIVATE, + MATCH_REQUEST, + UGCMANIFEST_REPORT_MISSING_FILE, + UGCMANIFEST_REPORT_DONE_FILE, + UGCMANIFEST_REPORT_DONE_BLUEPRINT, + UGCC_REQUEST, + WHO, + WORLD_PLAYERS_PET_MODERATED_ACKNOWLEDGE, + ACHIEVEMENT_NOTIFY, + GM_CLOSE_PRIVATE_CHAT_WINDOW, + UNEXPECTED_DISCONNECT, + PLAYER_READY, + GET_DONATION_TOTAL, + UPDATE_DONATION, + PRG_CSR_COMMAND, + HEARTBEAT_REQUEST_FROM_WORLD, + UPDATE_FREE_TRIAL_STATUS, + // CUSTOM DLU MESSAGE ID FOR INTERNAL USE + CREATE_TEAM, + }; +} diff --git a/dCommon/dEnums/MessageType/Client.h b/dCommon/dEnums/MessageType/Client.h new file mode 100644 index 00000000..f80425d0 --- /dev/null +++ b/dCommon/dEnums/MessageType/Client.h @@ -0,0 +1,74 @@ +#pragma once +#include + +namespace MessageType { + enum class Client : uint32_t { + LOGIN_RESPONSE = 0, + LOGOUT_RESPONSE, + LOAD_STATIC_ZONE, + CREATE_OBJECT, + CREATE_CHARACTER, + CREATE_CHARACTER_EXTENDED, + CHARACTER_LIST_RESPONSE, + CHARACTER_CREATE_RESPONSE, + CHARACTER_RENAME_RESPONSE, + CHAT_CONNECT_RESPONSE, + AUTH_ACCOUNT_CREATE_RESPONSE, + DELETE_CHARACTER_RESPONSE, + GAME_MSG, + CONNECT_CHAT, + TRANSFER_TO_WORLD, + IMPENDING_RELOAD_NOTIFY, + MAKE_GM_RESPONSE, + HTTP_MONITOR_INFO_RESPONSE, + SLASH_PUSH_MAP_RESPONSE, + SLASH_PULL_MAP_RESPONSE, + SLASH_LOCK_MAP_RESPONSE, + BLUEPRINT_SAVE_RESPONSE, + BLUEPRINT_LUP_SAVE_RESPONSE, + BLUEPRINT_LOAD_RESPONSE_ITEMID, + BLUEPRINT_GET_ALL_DATA_RESPONSE, + MODEL_INSTANTIATE_RESPONSE, + DEBUG_OUTPUT, + ADD_FRIEND_REQUEST, + ADD_FRIEND_RESPONSE, + REMOVE_FRIEND_RESPONSE, + GET_FRIENDS_LIST_RESPONSE, + UPDATE_FRIEND_NOTIFY, + ADD_IGNORE_RESPONSE, + REMOVE_IGNORE_RESPONSE, + GET_IGNORE_LIST_RESPONSE, + TEAM_INVITE, + TEAM_INVITE_INITIAL_RESPONSE, + GUILD_CREATE_RESPONSE, + GUILD_GET_STATUS_RESPONSE, + GUILD_INVITE, + GUILD_INVITE_INITIAL_RESPONSE, + GUILD_INVITE_FINAL_RESPONSE, + GUILD_INVITE_CONFIRM, + GUILD_ADD_PLAYER, + GUILD_REMOVE_PLAYER, + GUILD_LOGIN_LOGOUT, + GUILD_RANK_CHANGE, + GUILD_DATA, + GUILD_STATUS, + MAIL, + DB_PROXY_RESULT, + SHOW_ALL_RESPONSE, + WHO_RESPONSE, + SEND_CANNED_TEXT, + UPDATE_CHARACTER_NAME, + SET_NETWORK_SIMULATOR, + INVALID_CHAT_MESSAGE, + MINIMUM_CHAT_MODE_RESPONSE, + MINIMUM_CHAT_MODE_RESPONSE_PRIVATE, + CHAT_MODERATION_STRING, + UGC_MANIFEST_RESPONSE, + IN_LOGIN_QUEUE, + SERVER_STATES, + GM_CLOSE_TARGET_CHAT_WINDOW, + GENERAL_TEXT_FOR_LOCALIZATION, + UPDATE_FREE_TRIAL_STATUS, + UGC_DOWNLOAD_FAILED = 120 + }; +} diff --git a/dCommon/dEnums/MessageType/Game.h b/dCommon/dEnums/MessageType/Game.h new file mode 100644 index 00000000..8c5bddae --- /dev/null +++ b/dCommon/dEnums/MessageType/Game.h @@ -0,0 +1,1612 @@ +#pragma once +#include + +#include "magic_enum.hpp" + +namespace MessageType { + enum class Game : uint16_t { + GET_POSITION = 0, + GET_ROTATION = 1, + GET_LINEAR_VELOCITY = 2, + GET_ANGULAR_VELOCITY = 3, + GET_FORWARD_VELOCITY = 4, + GET_PLAYER_FORWARD = 5, + GET_FORWARD_VECTOR = 6, + SET_POSITION = 7, + SET_LOCAL_POSITION = 8, + SET_ROTATION = 9, + SET_LINEAR_VELOCITY = 10, + MODIFY_LINEAR_VELOCITY = 11, + SET_ANGULAR_VELOCITY = 12, + MODIFY_ANGULAR_VELOCITY = 13, + DEFLECT = 14, + SEND_POSITION_UPDATE = 15, + SET_OBJECT_SCALE = 16, + GET_OBJECT_SCALE = 17, + TIMED_SCALE_FINISHED = 18, + TELEPORT = 19, + TOGGLE_PLAYER_FWD_TO_CAMERA = 20, + LOCK_PLAYER_ROT_TO_CAMERA = 21, + UNLOCK_PLAYER_ROT_FROM_CAMERA = 22, + TOGGLE_PLAYER_ROT_LOCK_TO_MOUSE = 23, + LOCK_PLAYER_ROT_TO_MOUSE = 24, + UNLOCK_PLAYER_ROT_FROM_MOUSE = 25, + SET_PLAYER_CONTROL_SCHEME = 26, + GET_PLAYER_CONTROL_SCHEME = 27, + RESET_PLAYER_CONTROL_SCHEME = 28, + PLAYER_TO_PREVIOUS_CONTROL_SCHEME = 29, + DROP_CLIENT_LOOT = 30, + GET_SPEED = 34, + GET_ROT_SPEED = 35, + IS_DEAD = 36, + DIE = 37, + REQUEST_DIE = 38, + ADD_OBJECT = 39, + PLAY_EMOTE = 41, + PRELOAD_ANIMATION = 42, + PLAY_ANIMATION = 43, + ANIMATION_COMPLETE = 44, + ENABLE_HIGHLIGHT = 45, + DISABLE_HIGHLIGHT = 46, + GET_ANIMATION_NAMES = 47, + CONTROL_BEHAVIORS = 48, + BLEND_PRIMARY_ANIMATION = 52, + SET_OFFSCREEN_ANIMATION = 53, + GET_MOVEMENT_INPUT_VALUES = 54, + SWAP_TEXTURE = 55, + SWAP_COLOR = 56, + ATTACH_HAIR = 57, + GET_ENTITY_STRUCT = 58, + SET_ENTITY_STRUCT = 59, + SET_ATTR = 60, + GET_ATTR = 61, + ON_HIT = 62, + HIT_OR_HEAL_RESULT = 63, + SHOW_ATTACK = 64, + GO_TO = 65, + GET_CONFIG_DATA = 66, + SET_CONFIG_DATA = 68, + GET_INVENTORY_EXTRA_INFO = 69, + GET_DISPLAY_NAME = 70, + GET_NAME = 71, + SET_NAME = 72, + IS_NAME_LOCALIZED = 73, + GET_HAIR_COLOR = 74, + SET_HAIR_COLOR = 75, + GET_HAIR_STYLE = 76, + SET_HAIR_STYLE = 77, + GET_HEAD = 78, + SET_HEAD = 79, + GET_TORSO = 80, + SET_TORSO = 81, + GET_LEGS = 82, + SET_LEGS = 83, + SET_PROXIMITY_RADIUS = 84, + PROXIMITY_UPDATE = 85, + GET_PROXIMITY_OBJECTS = 86, + UNSET_PROXIMITY_RADIUS = 87, + CLEAR_PROXIMITY_RADIUS = 88, + GET_PROXIMITY_DATA = 89, + SET_PROXIMITY_RADIUS_ICON = 90, + TOGGLE_TAC_ARC = 93, + CAST_SKILL = 95, + CAST_LOCAL_SKILL = 96, + ECHO_LOCAL_SKILL = 97, + QUEUE_AI_SKILL = 98, + ADD_THREAT_RATING = 99, + GET_THREAT_RATING = 100, + CLEAR_THREAT_LIST = 103, + GET_TIME_FOR_NPC_SKILL = 111, + ENEMY_HEAL_NOTIFICATION = 112, + RESET_SCRIPTED_AI_STATE = 113, + ENABLE_COMBAT_AI_COMPONENT = 114, + COMBAT_AI_FORCE_TETHER = 115, + SUSPEND_MOVEMENT_AI = 116, + NOTIFY_SCRIPT_VARS_INITIALIZED = 117, + ECHO_START_SKILL = 118, + START_SKILL = 119, + CASTER_DEAD = 120, + VERIFY_ACK = 121, + ADD_PENDING_VERIFY = 122, + MAP_SKILL = 123, + SELECT_SKILL = 124, + CAST_ACTIVE_SKILL = 125, + MODIFY_SKILL_COOLDOWN = 126, + ADD_SKILL = 127, + REMOVE_SKILL = 128, + LOG = 129, + LOG_CHAT = 130, + SET_MAX_CURRENCY = 131, + GET_MAX_CURRENCY = 132, + SET_CURRENCY = 133, + GET_CURRENCY = 134, + ADD_PENDING_CURRENCY = 136, + PICKUP_CURRENCY = 137, + SERVER_DELETE_LOOT_ITEM = 138, + PICKUP_ITEM = 139, + TEAM_PICKUP_ITEM = 140, + CLIENT_DELETE_LOOT_ITEM = 141, + CLIENT_SET_LOOT_ITEM_FFA = 143, + COLLISION_PHANTOM = 144, + OFF_COLLISION_PHANTOM = 145, + COLLISION_PROXIMITY = 146, + OFF_COLLISION_PROXIMITY = 147, + COLLISION = 148, + OFF_COLLISION = 149, + GET_SKILLS = 150, + CLEAR_FX_SINGLE_EFFECT = 152, + GET_FX_EXIST_EFFECT = 153, + PLAY_FX_EFFECT = 154, + STOP_FX_EFFECT = 155, + CLEAR_FX_ALL_CREATE_EFFECTS = 156, + UPDATE_FX_ALL_CREATE_EFFECTS = 157, + REQUEST_RESURRECT = 159, + RESURRECT = 160, + UPDATE_FROM_GHOST = 162, + FETCH_GHOST = 163, + KFM_LOADED = 164, + NIF_LOADED = 165, + HKX_LOADED = 166, + MOVE_TO_DELETE_QUEUE = 167, + RESTORE_FROM_DELETE_QUEUE = 168, + IS_ENEMY = 169, + GET_FACTION = 170, + SET_IMAGINATION = 171, + GET_IMAGINATION = 172, + SET_MAX_IMAGINATION = 173, + GET_MAX_IMAGINATION = 174, + MODIFY_IMAGINATION = 175, + MODIFY_MAX_IMAGINATION = 176, + SET_HEALTH = 177, + GET_HEALTH = 178, + SET_MAX_HEALTH = 179, + GET_MAX_HEALTH = 180, + MODIFY_HEALTH = 181, + MODIFY_MAX_HEALTH = 182, + SET_ARMOR = 183, + GET_ARMOR = 184, + SET_MAX_ARMOR = 185, + GET_MAX_ARMOR = 186, + MODIFY_ARMOR = 187, + MODIFY_MAX_ARMOR = 188, + POP_HEALTH_STATE = 190, + PUSH_EQUIPPED_ITEMS_STATE = 191, + POP_EQUIPPED_ITEMS_STATE = 192, + SET_GM_LEVEL = 193, + GET_GM_LEVEL = 194, + ADD_STATUS_EFFECT = 196, + REMOVE_STATUS_EFFECT = 197, + SET_STUNNED = 198, + GET_STUNNED = 199, + SET_STUN_IMMUNITY = 200, + GET_STUN_IMMUNITY = 201, + KNOCKBACK = 202, + SET_VISIBLE = 203, + GET_VISIBLE = 204, + REPORT_ITEM_INFO = 205, + GET_REBUILD_STATE = 207, + REBUILD_CANCEL = 209, + REBUILD_START = 211, + ENABLE_REBUILD = 213, + SKILL_FAILURE = 214, + IS_ATTACK_STANCE = 216, + SET_OBJECT_RENDER = 217, + REQUEST_MAPPED_SKILLS = 218, + UI_SELECT_MAPPED_SKILL = 219, + GET_INVENTORY_ITEM_IN_SLOT = 220, + GET_FIRST_INVENTORY_ITEM_BY_LOT = 221, + GET_SMALLEST_INVENTORY_STACK_BY_LOT = 222, + MOVE_ITEM_IN_INVENTORY = 224, + ADD_ITEM_TO_INVENTORY_CLIENT_SYNC = 227, + GET_EQUIPPED_ITEMS = 229, + REMOVE_ITEM_FROM_INVENTORY = 230, + EQUIP_INVENTORY = 231, + UN_EQUIP_INVENTORY = 233, + EQUIP_ITEM = 234, + UN_EQUIP_ITEM = 235, + IS_ITEM_RESPOND = 236, + IS_ITEM_EQUIPPED = 237, + ATTACH_ITEM = 238, + DETACH_ITEM = 239, + GET_NODE = 240, + GET_LOT = 241, + IS_ITEM_EQUIPPABLE = 242, + GET_CURRENT_ANIMATION = 243, + GET_INV_ITEM_COUNT = 244, + POST_LOAD_EQUIP = 245, + SET_PHYSICS_ACTIVE_STATE = 246, + GET_CURRENT_SKILL_TAC_ARC = 247, + OFFER_MISSION = 248, + RESPOND_TO_MISSION = 249, + GET_MISSION_STATE = 250, + GET_MISSION_COMPLETE_TIMESTAMP = 251, + NOTIFY_MISSION = 254, + NOTIFY_MISSION_TASK = 255, + ARE_GFX_LOADED = 257, + ADDED_TO_WORLD = 258, + REMOVE_EXTRA_GFX_FROM_PIPE = 259, + HIDE_EQUIPED_WEAPON = 260, + UN_HIDE_EQUIPED_WEAPON = 261, + GET_ITEM_SLOT = 262, + IS_CHARACTER = 263, + SET_IMMUNITY = 264, + TOGGLE_TOOLTIPS = 266, + GET_TOOLTIPS_DISABLED = 267, + GET_BOUNDING_INFO = 268, + OVERRIDE_BOUNDING_RADIUS = 269, + GET_OFFSCREEN = 270, + USE_STATE_MACHINE = 271, + ADD_STATE = 272, + ADD_SUB_STATE = 273, + SET_STATE = 274, + SET_SUB_STATE = 275, + ADD_MESSAGE = 276, + RELOAD_SCRIPT = 277, + RELOAD_ALL_SCRIPTS = 278, + FRIEND_INVITE_MSG = 279, + ADD_FRIEND_REPOSNSE_MSG = 280, + REMOVE_FRIEND_RESPONSE_MSG = 281, + ADD_FRIEND_FROM_UI_MSG = 282, + GET_CACHED_FRIENDS_LIST_MSG = 283, + REQUEST_NEW_FRIENDS_LIST_MSG = 284, + REPOPULATE_FRIENDS_LIST_MSG = 285, + ADD_IGNORE_REPONSE_MSG = 286, + REMOVE_IGNORE_RESPONSE_MSG = 287, + ADD_IGNORE_FROM_UI_MSG = 288, + GET_CACHED_IGNORE_LIST_MSG = 289, + REQUEST_NEW_IGNORE_LIST_MSG = 290, + REMOVE_FRIEND_BY_NAME = 291, + REMOVE_IGNORE_BY_NAME = 292, + IS_PLAYER_IN_IGNORE_LIST_MSG = 293, + REPOPULATE_IGNORE_LIST_MSG = 294, + GET_INVENTORY_LIST = 295, + UPDATE_FRIEND_MSG = 296, + UPDATE_FRIEND_NAME_MSG = 297, + UPDATE_IGNORE_NAME_MSG = 298, + DEPARTED = 299, + ARRIVED = 300, + TEMPLATE_CHANGE_WAYPOINTS = 301, + CANCELLED = 302, + FLUSH_CACHED_GRAPHICS = 303, + FOLLOW_TARGET = 304, + TIMER_DONE = 305, + TIMER_CANCELLED = 306, + SET_TETHER_POINT = 307, + GET_TETHER_POINT = 308, + LEFT_TETHER_RADIUS = 309, + GET_SCRIPT_VARS_PTR = 310, + FACE_TARGET = 311, + ROTATE_BY_DEGREES = 312, + STRING_RENDERED = 313, + RESET_PRIMARY_ANIMATION = 314, + FACE_PLAY_STREAM = 315, + TORSO_PLAY_STREAM = 316, + CAN_PICKUP = 317, + GET_INVENTORY_SIZE = 318, + GET_INVENTORY_COUNT = 319, + GET_OBJECTS_IN_GROUP = 320, + HIDE_ITEM = 321, + IS_OBJECT_IN_FOV = 322, + GET_TYPE = 323, + TEAM_INVITE_MSG = 324, + TEAM_GET_SIZE = 325, + TEAM_REQUEST_SET_LOOT = 326, + TEAM_REMOVE_PLAYER_MSG = 327, + TEAM_UPDATE_PLAYER_NAME_MSG = 328, + SET_UPDATABLE = 329, + REQUEST_TEAM_UI_UPDATE = 330, + SET_COLLISION_GROUP = 331, + GET_COLLISION_GROUP = 332, + GET_ORIGINAL_COLLISION_GROUP = 333, + SET_COLLISION_GROUP_TO_ORIGINAL = 334, + GET_OBJECT_RADIUS = 335, + REBUILD_NOTIFY_STATE = 336, + GET_PLAYER_INTERACTION = 337, + SET_PLAYER_INTERACTION = 338, + FORCE_PLAYER_TO_INTERACT = 339, + GET_SELECTED_POTENTIAL_INTERACTION = 340, + SET_SELECTED_POTENTIAL_INTERACTION = 341, + GET_INTERACTION_DISTANCE = 342, + SET_INTERACTION_DISTANCE = 343, + CALCULATE_INTERACTION_DISTANCE = 344, + INTERACTION_ATTEMPT_FROM_OUT_OF_RANGE = 345, + SET_PICKING_TARGET = 346, + CLIENT_UNUSE = 347, + BEGIN_PET_INTERACTION = 348, + WANTS_INTERACTION_ICON = 349, + PROPERTY_EDIT_ICON_INTERACTION = 350, + PROPERTY_MODEL_INTERACTION = 351, + GET_INTERACTION_DETAILS = 352, + GET_DISABLED_INTERACTION_TYPES = 353, + GET_INTERACTION_INFO = 354, + INTERACTION_GAME_STATE_CHANGE = 355, + TOGGLE_INTERACTION_UPDATES = 356, + TERMINATE_INTERACTION = 357, + SERVER_TERMINATE_INTERACTION = 358, + GET_PLAYERS_TARGET_FOR_SELECTION = 359, + PROCESS_INTERACTION_UNDER_CURSOR = 360, + HANDLE_INTERACT_ACTION = 361, + ATTEMPT_INTERACTION = 362, + HANDLE_INTERACTION_CAMERA = 363, + REQUEST_USE = 364, + CLIENT_USE = 366, + GET_PLAYER_MULTI_INTERACTION = 367, + GET_MULTI_INTERACTION_STATE = 368, + VENDOR_OPEN_WINDOW = 369, + VENDOR_CLOSE_WINDOW = 370, + EMOTE_PLAYED = 371, + EMOTE_RECEIVED = 372, + BUY_FROM_VENDOR = 373, + SELL_TO_VENDOR = 374, + ADD_DONATION_ITEM = 375, + REMOVE_DONATION_ITEM = 376, + CONFIRM_DONATION_ON_PLAYER = 378, + CANCEL_DONATION_ON_PLAYER = 379, + TEAM_GET_LEADER = 380, + TEAM_GET_ON_WORLD_MEMBERS = 381, + TEAM_GET_ALL_MEMBERS = 382, + TEAM_SET_OFF_WORLD_FLAG = 383, + SET_TRANSPARENCY = 385, + GET_PREFERS_FADE = 386, + PROJECTILE_IMPACT = 387, + SET_PROJECTILE_PARAMS = 388, + SET_INVENTORY_SIZE = 389, + ACKNOWLEDGE_POSSESSION = 391, + SET_POSSESSED_OBJECT = 392, + CHANGE_POSSESSOR = 393, + GET_POSSESSION_TYPE = 395, + GET_POSSESSED_OBJECT = 396, + GET_POSSESSOR = 397, + IS_POSSESSED = 398, + ENABLE_ACTIVITY = 399, + SET_SHOOTING_GALLERY_PARAMS = 400, + OPEN_ACTIVITY_START_DIALOG = 401, + REQUEST_ACTIVITY_START_STOP = 402, + REQUEST_ACTIVITY_ENTER = 403, + REQUEST_ACTIVITY_EXIT = 404, + ACTIVITY_ENTER = 405, + ACTIVITY_EXIT = 406, + ACTIVITY_START = 407, + ACTIVITY_STOP = 408, + SHOOTING_GALLERY_CLIENT_AIM_UPDATE = 409, + ROTATE_TO_POINT = 410, + SHOOTING_GALLERY_FIRE = 411, + CALCULATE_FIRING_PARAMETERS = 412, + GET_MUZZLE_OFFSET = 413, + GET_ACTIVITY_POINTS = 414, + TEAM_IS_ON_WORLD_MEMBER = 415, + REQUEST_VENDOR_STATUS_UPDATE = 416, + VENDOR_STATUS_UPDATE = 417, + CANCEL_MISSION = 418, + RESET_MISSIONS = 419, + RENDER_COMPONENT_READY = 420, + SEND_MINIFIG_DECALS = 421, + PHYSICS_COMPONENT_READY = 422, + ENTER_STANDBY_MODE = 423, + LEAVE_STANDBY_MODE = 424, + NOTIFY_CLIENT_SHOOTING_GALLERY_SCORE = 425, + REQUEST_CONSUME_ITEM = 426, + CONSUME_CLIENT_ITEM = 427, + CLIENT_ITEM_CONSUMED = 428, + QUERY_STANDBY_MODE = 429, + GET_NI_BOUND = 430, + MISSION_FAILURE = 431, + GET_ANIMATION_TIME = 432, + GET_CURRENT_ACTIVITY = 434, + SET_EYEBROWS = 435, + GET_EYEBROWS = 436, + SET_EYES = 437, + GET_EYES = 438, + SET_MOUTH = 439, + GET_MOUTH = 440, + IS_OBJECT_SMASHABLE = 441, + SMASHABLE_STATE_CHANGED = 443, + USE_STATE_LOGGER = 444, + ROTATE_SUB_NODE = 445, + GET_SUB_NODE_POSITION = 446, + GET_SUB_NODE = 447, + UPDATE_SHOOTING_GALLERY_ROTATION = 448, + RENDER_FLOATING_TEXT = 449, + REQUEST2_D_TEXT_ELEMENT = 450, + UPDATE2_D_TEXT_ELEMENT = 451, + REMOVE2_D_TEXT_ELEMENT = 452, + SET_COLOR = 453, + GET_COLOR = 454, + HKX_CHARACTER_LOADED = 455, + ACTIVATE_PHYSICS = 457, + SET_ICON_ABOVE_HEAD = 458, + ADD_ICON_COMPOSITE = 459, + CLEAR_ICON_COMPOSITES = 460, + ICON_NIF_LOADED = 461, + ICON_KFM_LOADED = 462, + GET_OVERHEAD_ICON_PROPERTIES_FROM_PARENT = 463, + BOUNCE_PLAYER = 464, + SET_USER_CTRL_COMP_PAUSE = 466, + HAS_COLLIDED = 467, + GET_TOOLTIP_FLAG = 468, + SET_TOOLTIP_FLAG = 469, + GET_FLAG = 470, + SET_FLAG = 471, + NOTIFY_CLIENT_FLAG_CHANGE = 472, + CURSOR_ON = 473, + CURSOR_OFF = 474, + HELP = 475, + VENDOR_TRANSACTION_RESULT = 476, + PERFORM_SPECIAL_DEATH = 477, + GET_SHADER_ID = 478, + GET_RENDER_ENVIRONMENT = 479, + FINISHED_LOADING_SCENE = 480, + GET_SKILL_INFO = 481, + ACTIVITY_CANCEL = 482, + MISSION_USES_OBJECT = 483, + GET_POSITIONAL_ID = 484, + SET_COLLECTIBLE_STATUS = 485, + HAS_BEEN_COLLECTED = 486, + HAS_BEEN_COLLECTED_BY_CLIENT = 487, + GET_POS_UPDATE_STATS = 488, + GET_NUM_VIEWERS_SCOPING_THIS = 489, + GET_ACTIVITY_USER = 490, + GET_ALL_ACTIVITY_USERS = 491, + GET_MISSION_FOR_PLAYER = 492, + SET_FACTION = 493, + SET_PLATFORM_IDLE_STATE = 494, + DISPLAY_CHAT_BUBBLE = 495, + REQUEST_CHAT_BUBBLE_ELEMENT = 496, + GET_MISSION_DATA = 497, + SPAWN_PET = 498, + DESPAWN_PET = 499, + SET_LOCAL_SPACE_STATE = 500, + GET_LOCAL_SPACE_STATE = 501, + SET_POSITION_TO_LOCAL_POSITION = 502, + ALLOW_LOCAL_SPACE_UPDATE = 503, + TOGGLE_FREE_CAM_MODE = 504, + PLAYER_LOADED = 505, + PLAYER_ADDED_TO_WORLD_LOCAL = 506, + OBJECT_LOADED = 507, + GET_PLAYER_READY = 508, + PLAYER_READY = 509, + SET_SMASHABLE_PARAMS = 510, + IS_LOOTABLE_CHEST = 511, + LOOT_OPEN_WINDOW = 512, + LOOT_SELECTION_UPDATE = 513, + TAKE_LOOT_CHEST_ITEM = 514, + REQUEST_LINKED_MISSION = 515, + TRANSFER_TO_ZONE = 516, + TRANSFER_TO_ZONE_CHECKED_IM = 517, + SECURED_TRANSFER_TO_ZONE = 518, + INVALID_ZONE_TRANSFER_LIST = 519, + MISSION_DIALOGUE_OK = 520, + GET_OBJECT_IN_SCOPE = 521, + SET_LAUNCHED_STATE = 522, + P_CREATE_EFFECT_FINISHED = 523, + SMASHED_OBJECT = 524, + CHECK_SMASHCHAIN_OVERRIDE = 525, + DISPLAY_REBUILD_ACTIVATOR = 526, + TRANSFER_TO_LAST_NON_INSTANCE = 527, + SET_ACTIVE_LOCAL_CHARACTER_ID = 528, + DISPLAY_MESSAGE_BOX = 529, + MESSAGE_BOX_RESPOND = 530, + CHOICE_BOX_RESPOND = 531, + SERVER_SET_USER_CTRL_COMP_PAUSE = 532, + SET_CHARACTER_AUTO_RUN = 533, + FOLLOW_WAYPOINTS = 534, + SWAP_DECAL_AND_COLOR = 535, + CONTINUE_WAYPOINTS = 536, + SMASH = 537, + UN_SMASH = 538, + GET_IS_SMASHED = 539, + GET_UP_VECTOR = 540, + SET_GRAVITY_SCALE = 541, + SET_GRAVITY_SCALE_FOR_RIGID_BODY = 542, + STOP_MOVING = 543, + SET_PATHING_SPEED = 544, + SET_SHIELDED = 545, + SET_SHOOTING_GALLERY_RETICULE_EFFECT = 546, + PLACE_MODEL_RESPONSE = 547, + SET_DODGE_INFO = 548, + GET_DODGE_INFO = 549, + SET_SKILL_ATTACK_SPEED = 550, + GET_SKILL_COOLDOWN_GROUP = 551, + GET_INITIAL_SKILL_COOLDOWN = 552, + GET_SKILL_COOLDOWN_REMAINING = 553, + GET_GLOBAL_COOLDOWN = 554, + SET_GLOBAL_COOLDOWN = 555, + RESET_GLOBAL_COOLDOWN = 556, + FINDINVENTORY_ITEM = 558, + PATH_STUCK = 559, + SET_CURRENT_PATH = 560, + SET_JET_PACK_MODE = 561, + SET_JET_PACK_TIME = 562, + PET_FOLLOW_OWNER = 563, + PLAYER_DIED = 564, + REGISTER_PET_ID = 565, + REGISTER_PET_DBID = 566, + GET_PET_ID = 567, + SHOW_ACTIVITY_COUNTDOWN = 568, + DISPLAY_TOOLTIP = 569, + SET_PHANTOM_BASE = 570, + GET_MOTION_STATE = 571, + GET_MOTION_CONFIG = 572, + SET_ACTIVE_PROJECTILE_SKILL = 573, + INITIALIZE_MISSION_VISUALS = 574, + GET_MISSIONS = 575, + START_ACTIVITY_TIME = 576, + ADD_ACTIVITY_TIME = 577, + GUILD_GET_SIZE = 578, + GUILD_CAN_WE_INVITE = 579, + GUILD_CAN_WE_KICK = 580, + SET_CHAR_GUILD_INFO = 581, + GET_CHAR_GUILD_INFO = 582, + GET_CHAR_IS_IN_GUILD = 583, + RE_RENDER_NAME_BILLBOARD = 584, + IS_IN_LOCAL_CHAR_PROXIMITY = 585, + GUILD_SET_STATUS = 586, + GUILD_ADD_PLAYER = 587, + GUILD_REMOVE_PLAYER = 588, + GUILD_UPDATE_PLAYER_NAME = 589, + GUILD_SET_PLAYER_RANK = 590, + GUILD_SET_ONLINE_STATUS = 591, + GUILD_INVITE = 592, + REQUEST_GUILD_DATA = 593, + POPULATE_GUILD_DATA = 594, + GET_CACHED_GUILD_DATA = 595, + GUILD_RENDER_NAME = 596, + GET_IS_SUPPORTED = 600, + CHARACTER_SUPPORT_CHANGED = 601, + ACTIVITY_PAUSE = 602, + USE_NON_EQUIPMENT_ITEM = 603, + REQUEST_USE_ITEM_ON = 604, + REQUEST_USE_ITEM_ON_TARGET = 605, + USE_ITEM_ON = 606, + USE_ITEM_RESULT = 607, + GET_PARENT_OBJ = 608, + SET_PARENT_OBJ = 609, + GET_UPDATES_WITH_PARENT_POSITION = 610, + PARENT_REMOVED = 611, + PARENT_LEFT_SCOPE = 612, + PARENT_ENTERED_SCOPE = 613, + CHILD_LOADED = 614, + CHILD_REMOVED = 615, + CHILD_DETACHED = 616, + CHILD_ENTERED_SCOPE = 617, + CHILD_LEFT_SCOPE = 618, + GET_CHILD_OBJECTS = 619, + ZONE_TRANSFER_FINISHED = 621, + CHAT_CONNECTION_UPDATE = 622, + PLATFORM_AT_LAST_WAYPOINT = 623, + LOOT_TAKE_ALL = 624, + GET_EQUIPPED_ITEM_INFO = 625, + DISPLAY_GUILD_CREATE_BOX = 626, + GET_EDITOR_LEVEL = 627, + GET_ACCOUNT_ID = 628, + GET_LAST_LOGOUT = 629, + GET_LAST_PROP_MOD_DISPLAY_TIME = 630, + SET_LAST_PROP_MOD_DISPLAY_TIME = 631, + SHOW_ACTIVITY_SUMMARY = 632, + CAN_RECEIVE_ALL_REWARDS = 633, + GET_ACTIVITY_REWARD = 634, + LOOT_CLOSE_WINDOW = 635, + GET_BLUEPRINT_ID = 636, + NOTIFY_BLUEPRINT_UPDATE = 637, + FETCH_MODEL_METADATA_REQUEST = 638, + FETCH_MODEL_METADATA_RESPONSE = 639, + COMMAND_PET = 640, + PET_RESPONSE = 641, + GET_ICON_ABOVE_HEAD_STATE = 642, + GET_ICON_ABOVE_HEAD = 643, + ICON_FINISHED_LOADING = 644, + ADD_PET_STATE = 645, + REMOVE_PET_STATE = 646, + SET_PET_STATE = 647, + REQUEST_ACTIVITY_SUMMARY_LEADERBOARD_DATA = 648, + SEND_ACTIVITY_SUMMARY_LEADERBOARD_DATA = 649, + SET_ON_TEAM = 650, + GET_PET_HAS_STATE = 651, + FIND_PROPERTY = 652, + SET_PET_MOVEMENT_STATE = 653, + GET_ITEM_TYPE = 654, + GET_ITEM_INFO_KEY = 655, + NOTIFY_OBJECT = 656, + IS_PET_WILD = 657, + CLIENT_NOTIFY_PET = 659, + NOTIFY_PET = 660, + NOTIFY_PET_TAMING_MINIGAME = 661, + START_SERVER_PET_MINIGAME_TIMER = 662, + CLIENT_EXIT_TAMING_MINIGAME = 663, + GET_BUILDMODE_ACTIVE = 664, + GET_PET_TAMING_MINIGAME_ACTIVE = 665, + PET_TAMING_OBJECT_PICKED = 666, + PET_TAMING_MINIGAME_RESULT = 667, + PET_TAMING_TRY_BUILD_RESULT = 668, + SET_PET_TAMING_MODEL = 669, + GET_PET_TAMING_MODEL = 670, + PET_ON_SWITCH = 671, + PET_OFF_SWITCH = 672, + NOTIFY_TAMING_BUILD_SUCCESS = 673, + NOTIFY_TAMING_MODEL_LOADED_ON_SERVER = 674, + NOTIFY_TAMING_PUZZLE_SELECTED = 675, + GET_INSTRUCTION_COUNT = 676, + GET_IS_NPC = 677, + ACTIVATE_BUBBLE_BUFF = 678, + DECTIVATE_BUBBLE_BUFF = 679, // This is spelled wrong in the client, so we misspell it here. + EXHIBIT_VOTE = 680, + ADD_PET_TO_PLAYER = 681, + REMOVE_PET_FROM_PLAYER = 682, + REQUEST_SET_PET_NAME = 683, + SET_PET_NAME = 684, + PET_NAME_CHANGED = 686, + GET_PET_AT_INDEX = 687, + GET_LOT_FOR_PET_BY_DBID = 688, + GET_NAME_FOR_PET_BY_DBID = 689, + GET_ACTIVE_PET_OBJ_ID = 690, + GET_ACTIVE_PET_INVENTORY_OBJ_ID = 691, + SHOW_PET_ACTION_BUTTON = 692, + SET_EMOTE_LOCK_STATE = 693, + GET_EMOTE_LOCK_STATE = 694, + LEAVE_TEAM_MSG = 695, + TEAM_KICK_PLAYER_MSG = 697, + TEAM_SET_LEADER_SEND_MSG = 698, + USE_ITEM_ON_CLIENT = 699, + DOES_FORWARD_TARGET_CLICKING = 700, + CHECK_USE_REQUIREMENTS = 701, + USE_REQUIREMENTS_RESPONSE = 702, + USE_ITEM_REQUIREMENTS_RESPONSE = 703, + PET_ADDED_TO_WORLD = 704, + BOUNCER_TRIGGERED = 705, + EXHIBIT_QUERY_CURRENT_MODEL = 706, + EXHIBIT_QUERY_CURRENT_MODEL_RESPONSE = 707, + EXHIBIT_ATTEMPT_VOTE = 708, + EXHIBIT_VOTE_RESPONSE = 709, + EHIBIT_REQUERYMODELS = 710, + IS_SKILL_ACTIVE = 711, + TOGGLE_ACTIVE_SKILL = 712, + PLAY_EMBEDDED_EFFECT_ON_ALL_CLIENTS_NEAR_OBJECT = 713, + EXHIBIT_GET_INFO = 714, + GET_PROPERTY_DATA = 715, + DOWNLOAD_PROPERTY_DATA = 716, + QUERY_PROPERTY_DATA = 717, + MODEL_MODERATION_ACTION = 719, + NOTIFY_SERVER_UGC_REVIEW_READY = 720, + NOTIFY_CLIENT_UGC_REVIEW_READY = 721, + OLD_USE_ITEM_ON = 722, + FIND_PROPERTY_FOR_SALE_RESPONSE = 723, + PROPERTY_EDITOR_BEGIN = 724, + PROPERTY_EDITOR_END = 725, + PROPERTY_EDITOR_SET_MODE = 726, + TOGGLE_TRIGGER = 727, + FIRE_EVENT = 728, + IS_MINIFIG_IN_A_BUBBLE = 729, + GET_ITEM_INFO = 730, + MISSION_NEEDS_LOT = 731, + STOP_PATHING = 732, + START_PATHING = 733, + ACTIVATE_BUBBLE_BUFF_FROM_SERVER = 734, + DEACTIVATE_BUBBLE_BUFF_FROM_SERVER = 735, + HAS_SKILL = 736, + NOTIFY_CLIENT_ZONE_OBJECT = 737, + MOVE_OBJECT = 738, + ROTATE_OBJECT = 739, + GET_SPAWNER_CONFIG_DATA = 740, + UPDATE_SPAWNER_CONFIG_DATA = 741, + TURN_AROUND = 743, + GO_FORWARD = 744, + GO_BACKWARD = 745, + UPDATE_REPUTATION = 746, + GET_REPUTATION = 747, + ADD_REPUTATION = 748, + UPDATE_PROPERTY_DATA = 749, + PROPERTY_RENTAL_RESPONSE = 750, + EXHIBIT_PLACEMENT_RESPONSE = 751, + SQUIRT_WITH_WATERGUN = 752, + GET_VOTES_LEFT = 753, + ADJUST_VOTES_LEFT = 754, + EVADE_TARGET = 755, + STOPPED_EVADING = 756, + GET_PET_HAS_ABILITY = 757, + REQUEST_PLATFORM_RESYNC = 760, + PLATFORM_RESYNC = 761, + PLAY_CINEMATIC = 762, + END_CINEMATIC = 763, + CINEMATIC_UPDATE = 764, + ATTACH_CAMERA_TO_RAIL = 765, + DETACH_CAMERA_FROM_RAIL = 766, + TOGGLE_GHOST_REFERENCE_OVERRIDE = 767, + SET_GHOST_REFERENCE_POSITION = 768, + GET_GHOST_REFERENCE_POSITION = 769, + FIRE_EVENT_SERVER_SIDE = 770, + GET_PET_ABILITY_OBJECT = 771, + TEAM_INVITE_MSG_FROM_UI = 772, + ADD_CAMERA_EFFECT = 773, + REMOVE_CAMERA_EFFECT = 774, + REMOVE_ALL_CAMERA_EFFECTS = 775, + GET_MY_PROPERTIES_IN_THIS_ZONE = 776, + IS_MODEL_WITHIN_PROPERTY_BOUNDS = 777, + PROPERTY_DATA_RESULTS = 778, + ON_UN_SERIALIZE = 779, + SCRIPT_NETWORK_VAR_UPDATE = 781, + ADD_OBJECT_TO_GROUP = 783, + REMOVE_OBJECT_FROM_GROUP = 784, + IS_OBJECT_STATIC = 785, + GET_HAS_MISSION = 786, + GET_MISSION_TARGET_LOT = 787, + GET_MISSION_OFFERER_LOT = 788, + USE_UNIQUE_ITEM = 789, + GET_IS_PET = 790, + DELETE_PROPERTY = 791, + CREATEMODEL_FROM_CLIENT = 792, + UPDATE_MODEL_FROM_CLIENT = 793, + DELETE_MODEL_FROM_CLIENT = 794, + SHOW_PROPERTY_BOUNDS = 795, + SET_PROPERTY_I_DS = 796, + PLAY_FACE_DECAL_ANIMATION = 797, + ADD_ACTIVITY_USER = 798, + REMOVE_ACTIVITY_USER = 799, + GET_NUM_ACTIVITY_USERS = 800, + ACTIVITY_USER_EXISTS = 801, + DO_COMPLETE_ACTIVITY_EVENTS = 805, + SET_ACTIVITY_PARAMS = 806, + SET_ACTIVITY_USER_DATA = 807, + GET_ACTIVITY_USER_DATA = 808, + DO_CALCULATE_ACTIVITY_RATING = 809, + ND_AUDIO_POST_SETUP = 812, + ND_AUDIO_PRE_SHUTDOWN = 813, + SET_ND_AUDION_LISTENER_STANCE = 814, + SET_UP_ND_AUDIO_EMIITTER = 815, + SHUT_DOWN_ND_AUDIO_EMITTER = 816, + METAIFY_ND_AUDIO_EMITTER = 817, + UN_METAIFY_ND_AUDIO_EMITTER = 818, + METAIFY_ND_AUDIO_EMITTERS = 819, + UN_METAIFY_ND_AUDIO_EMITTERS = 820, + PLAY_ND_AUDIO_EMITTER = 821, + STOP_ND_AUDIO_EMITTER = 822, + STOP_ND_AUDIO_EMITTER_ALL = 823, + SET_ND_AUDIO_EMITTER_PARAMETER = 824, + SET_ND_AUDIO_EMITTERS_PARAMETER = 825, + ND_AUDIO_CALLBACK = 826, + ACTIVATE_ND_AUDIO_MUSIC_CUE = 827, + DEACTIVATE_ND_AUDIO_MUSIC_CUE = 828, + FLASH_ND_AUDIO_MUSIC_CUE = 829, + SET_ND_AUDIO_MUSIC_PARAMETER = 830, + PLAY2_D_AMBIENT_SOUND = 831, + STOP2_D_AMBIENT_SOUND = 832, + PLAY3_D_AMBIENT_SOUND = 834, + STOP3_D_AMBIENT_SOUND = 835, + ACTIVATE_ND_AUDIO_MIXER_PROGRAM = 836, + DEACTIVATE_ND_AUDIO_MIXER_PROGRAM = 837, + UPDATE_ACTIVITY_LEADERBOARD = 838, + ACTIVITY_LEADERBOARD_UPDATED = 839, + ENTER_PROPERTY1 = 840, + ENTER_PROPERTY2 = 841, + PROPERTY_ENTRANCE_SYNC = 842, + SEND_PROPERTY_POPULATION_TO_CLIENT = 843, + SEN_PROPERTY_PLAQUE_VIS_UPDATE = 844, + PROPERTY_SELECT_QUERY = 845, + CREATE_POSITION_STRING = 848, + GET_PARALLEL_POSITION = 849, + PARSE_CHAT_MESSAGE = 850, + SET_MISSION_TYPE_STATE = 851, + GET_LOCATIONS_VISITED = 852, + GET_MISSION_TYPE_STATES = 853, + GET_TIME_PLAYED = 854, + SET_MISSION_VIEWED = 855, + HKX_VEHICLE_LOADED = 856, + SLASH_COMMAND_TEXT_FEEDBACK = 857, + BROADCAST_TEXT_TO_CHATBOX = 858, + HANDLE_SLASH_COMMAND_KORE_DEBUGGER = 859, + OPEN_PROPERTY_MANAGEMENT = 860, + OPEN_PROPERTY_VENDOR = 861, + VOTE_ON_PROPERTY = 862, + UPDATE_PROPERTY_OR_MODEL_FOR_FILTER_CHECK = 863, + NOTIFY_PLAYER_OF_PROPERTY_SUBMISSION = 865, + NOTIFY_PLAYER_OF_MODEL_SUBMISSION = 866, + PHYSICS_SYSTEM_LOADED = 867, + CLIENT_TRADE_REQUEST = 868, + SERVER_TRADE_REQUEST = 869, + SERVER_TRADE_INVITE = 870, + CLIENT_TRADE_REPLY = 871, + SERVER_TRADE_REPLY = 872, + SERVER_TRADE_INITIAL_REPLY = 873, + SERVER_TRADE_FINAL_REPLY = 874, + CLIENT_TRADE_UPDATE = 875, + SERVER_SIDE_TRADE_UPDATE = 876, + SERVER_TRADE_UPDATE = 877, + CLIENT_TRADE_CANCEL = 878, + CLIENT_SIDE_TRADE_CANCEL = 879, + CLIENT_TRADE_ACCEPT = 880, + SERVER_SIDE_TRADE_ACCEPT = 881, + SERVER_SIDE_TRADE_CANCEL = 882, + SERVER_TRADE_CANCEL = 883, + SERVER_TRADE_ACCEPT = 884, + GET_TRADE_INFO = 885, + KF_LOADED = 886, + BRICKS_LOADED = 887, + READY_FOR_UPDATES = 888, + SEND_READY_FOR_UPDATES = 889, + SET_LAST_CUSTOM_BUILD = 890, + GET_LAST_CUSTOM_BUILD = 891, + GET_STATUS_EFFECT_BY_ID = 892, + GET_ALL_STATUS_EFFECTS = 893, + CHILD_RENDER_COMPONENT_READY = 894, + NOTIFY_APPEARANCE_CHANGED_MSG = 895, + SET_PHYSICS_MOTION_STATE = 896, + GET_PHYSICS_MOTION_STATE = 897, + ATTACH_GRAYSCALE_EFFECT = 898, + ATTACH_FADE_EFFECT = 899, + ATTACH_CHANGE_RENDER_ENVIRONMENT_EFFECT = 900, + FORCE_MOVEMENT = 901, + CANCEL_FORCE_MOVEMENT = 902, + SET_IGNORE_PROJECTILE_COLLISION = 903, + GET_IGNORE_PROJECTILE_COLLISION = 904, + ORIENT_TO_OBJECT = 905, + ORIENT_TO_POSITION = 906, + ORIENT_TO_ANGLE = 907, + NOTIFY_CLIENT_UGC_MODEL_READY = 909, + NOTIFY_CLIENT_UGC_ICON_READY = 911, + PROPERTY_BUILD_MODE_CHANGED = 912, + PROPERTY_BUILD_MODE_UPDATE = 913, + PROPERTY_DELETION_ACTION = 914, + PROPERTY_MODERATION_STATUS_ACTION = 915, + PROPERTY_MODERATION_STATUS_ACTION_RESPONSE = 916, + PROPERTY_MODERATION_STATUS_UPDATE = 917, + PROPERTY_NEEDS_GM_ATTENTION = 918, + PROPERTY_MODERATION_CHANGED = 919, + INVENTORY_REFRESH_ITEM_DETAILS = 922, + INVENTORY_LOAD_CUSTOM_ICON = 923, + GET_STATUS_EFFECT_BY_TYPE = 924, + RELEASE_CHARGED_SKILL = 925, + PROPERTY_RELOAD_DB = 926, + SET_PLAYER_TARGET = 927, + GET_PLAYER_TARGET = 928, + LOCK_CAMERA_NETWORKED = 929, + MOVE_CAMERA_NETWORKED = 930, + REBUILD_ACTIVATED = 931, + BOUNCE_NOTIFICATION = 932, + REQUEST_CLIENT_BOUNCE = 934, + GET_RECENT_BOUNCED = 935, + SET_RECENT_BOUNCED = 936, + SET_ACTIVE_STATE = 937, + GET_ACTIVE_STATE = 938, + HAS_COMPONENT_TYPE = 939, + GET_COMPONENT_LIST = 940, + RESPONDS_TO_FACTION = 941, + BOUNCER_ACTIVE_STATUS = 942, + HF_ATTRIBUTES_PUSH = 943, + HF_ATTRIBUTES_PULL = 944, + HF_ATTRIBUTES_PATH_DISPLAY = 945, + HF_CONTROLS_PULL = 946, + HF_OBJECT_SELECTED = 947, + HF_PLACEHOLDER_UPDATE = 948, + HF_PLACEHOLDER_TOGGLE = 949, + HF_GET_ASSOCIATED_PATHS = 950, + HF_GETS_WANT_PATH = 951, + GET_RECENT_MOVEMENT_KEYS = 952, + TRACK_RECENT_MOVEMENT_KEYS = 953, + PHYSICS_MOVEMENT_NOTIFICATION_REQUEST = 954, + PHYSICS_MOVEMENT_NOTIFICATION = 955, + MOVE_INVENTORY_SINGLE = 956, + MOVE_INVENTORY_BATCH = 957, + MINI_GAME_SET_PARAMETERS = 958, + MINI_GAME_GET_TEAM_SKILLS = 961, + MINI_GAME_GET_TEAM_SCORE = 963, + MINI_GAME_GET_PLAYER_SCORE = 967, + MINI_GAME_GET_TEAM_COLOR = 972, + MINI_GAME_GET_TEAM_PLAYERS = 975, + MINI_GAME_UPDATE_CLIENT = 976, + MINI_GAME_GET_TEAM = 977, + MINI_GAME_GET_PARAMETERS = 978, + OBJECT_ACTIVATED_CLIENT = 980, + IS_RESURRECTING = 983, + GET_ITEM_OWNER = 984, + GET_STORED_CONFIG_DATA = 985, + SET_STORED_CONFIG_DATA = 986, + ON_PLAYER_RESSURECTED = 988, + PLAYER_RESURRECTION_FINISHED = 989, + TRANSFORM_CHANGELING_BUILD = 990, + RETURN_CHANGELING_BUILD_ID = 991, + SPEND_BRICK_INVENTORY_FOR_LXFML = 992, + BRICK_INVENTORY_FOR_LXFML_SPENT = 993, + REBUILD_BBB_AUTOSAVE_MSG = 995, + SET_BBB_AUTOSAVE = 996, + USE_BBB_INVENTORY = 998, + UN_USE_BBB_MODEL = 999, + BBB_LOAD_ITEM_REQUEST = 1000, + BBB_SAVE_REQUEST = 1001, + BBBLUP_SAVE_REQUEST = 1002, + BBB_GET_METADATA_SOURCE_ITEM = 1003, + BBB_RESET_METADATA_SOURCE_ITEM = 1004, + BBB_SAVE_RESPONSE = 1005, + PLAYER_EXIT = 1006, + SET_PVP_STATUS = 1008, + GET_PVP_STATUS = 1009, + IS_VALID_PVP_TARGET = 1010, + PVP_RENDER_NAME = 1011, + ATTACH_OBJECT = 1012, + DETACH_OBJECT = 1013, + BOUNCE_SUCCEEDED = 1014, + GET_GAME_OBJECT_POINTER = 1015, + PHANTOM_HKX_LOADED = 1016, + DELAY_CREATE_EFFECT = 1017, + CHOICE_BUILD_SELECTION_CONFIRMED = 1018, + NOTIFY_FADE_UP_VIS_COMPLETE = 1019, + ITEM_HAS_NEW_INFO = 1020, + RESET_SECONDARY_ANIMATION = 1021, + GET_PICK_TYPE = 1022, + SET_PICK_TYPE = 1023, + GET_PRIORITY_PICK_LIST_TYPE = 1024, + REQUEST_PICK_TYPE_UPDATE = 1025, + GET_OVERRIDE_PICK_TYPE = 1026, + REQUEST_DISPLAY_OBJECT_INFO = 1027, + REQUEST_SERVER_OBJECT_INFO = 1028, + REQUEST_OBJECT_INFO_AS_XML = 1029, + GET_OBJECT_REPORT_INFO = 1030, + GET_OBJECT_REPORT_WINDOW_CLOSE = 1031, + GET_OBJECT_REPORT_STATUS = 1032, + GET_MISSION_DATA_FOR_OBJECT_REPORT = 1033, + GET_OBJECT_ROLLOVER_INFO = 1034, + PERFORM_ZONE_ANALYSIS = 1035, + UPDATE_HK_VISUAL_IZATION = 1036, + CLEAR_ITEMS_OWNER = 1037, + APPLY_LINEAR_IMPULSE = 1038, + APPLY_ANGULAR_IMPULSE = 1039, + GET_CONTACT_NORMALS = 1040, + IS_WATCHING_FOR_EMOTE = 1041, + NOTIFY_CLIENT_OBJECT = 1042, + DISPLAY_ZONE_SUMMARY = 1043, + ZONE_SUMMARY_DISMISSED = 1044, + GET_PLAYER_ZONE_STATISTIC = 1045, + MODIFY_PLAYER_ZONE_STATISTIC = 1046, + APPLY_EXTERNAL_FORCE = 1049, + GET_APPLIED_EXTERNAL_FORCE = 1050, + ITEM_EQUIPPED = 1052, + ACTIVITY_STATE_CHANGE_REQUEST = 1053, + OVERRIDE_FRICTION = 1054, + ARRANGE_WITH_ITEM = 1055, + CHECK_CAN_BUILD_WITH_ITEM = 1056, + START_BUILDING_WITH_ITEM = 1057, + START_BUILD_SESSION = 1058, + FINISH_BUILD_SESSION = 1059, + DONE_BUILD_SESSION = 1060, + START_ARRANGING_WITH_ITEM = 1061, + FINISH_ARRANGING_WITH_ITEM = 1062, + DONE_ARRANGING_WITH_ITEM = 1063, + START_ARRANGE_MODE = 1064, + ARRANGE_MODE_WITH_ITEM = 1065, + FINISH_ARRANGE_MODE = 1066, + DONE_ARRANGE_MODE = 1067, + SET_BUILD_MODE = 1068, + BUILD_MODE_SET = 1069, + CONFIRM_BUILD_MODE = 1070, + BUILD_MODE_CONFIRMATION = 1071, + BUILD_EXIT_CONFIRMATION = 1072, + SET_BUILD_MODE_CONFIRMED = 1073, + BUILD_MODE_NOTIFICATION = 1074, + BUILD_MODE_NOTIFICATION_REPORT = 1075, + CLIENT_USE_MODULE_ON = 1076, + SET_MODEL_TO_BUILD = 1077, + SPAWN_MODEL_BRICKS = 1078, + CHECK_PRECONDITION = 1079, + CHECK_ALL_PRECONDITIONS = 1080, + NOTIFY_CLIENT_FAILED_PRECONDITION = 1081, + GET_IS_ITEM_EQUIPPED_BY_LOT = 1082, + GET_IS_ITEM_EQUIPPED_BY_ID = 1083, + GET_OBJECT_DIRECTION_VECTORS = 1084, + GET_CASTABLE_SKILLS = 1085, + CHOICEBUILD_COMPLETE = 1086, + GET_MISSION_CHAT = 1087, + GET_MISSION_AUDIO = 1088, + MODULE_EQUIPPED = 1089, + MODULE_DROPPED = 1090, + MODULE_PICKED_UP = 1091, + MODULE_INFO = 1092, + MOVE_ITEM_BETWEEN_INVENTORY_TYPES = 1093, + MODULAR_BUILD_BEGIN = 1094, + MODULAR_BUILD_END = 1095, + MODULAR_BUILD_MOVE_AND_EQUIP = 1096, + MODULAR_BUILD_FINISH = 1097, + SET_REGISTRATION_FOR_UI_UPDATE = 1114, + GO_TO_WAYPOINT = 1115, + ARRIVED_AT_DESIRED_WAYPOINT = 1116, + CHECK_WITHIN_BOUNDS = 1117, + ATTACH_TO_BUILD_ASSEMBLY = 1118, + SET_BUILD_ASSEMBLY = 1119, + RESET_BUILD_ASSEMBLY = 1120, + GET_INVENTORY_ITEM_INFO = 1125, + GET_ITEM_DETAILS = 1126, + GET_BUILD_ACTIVATOR = 1127, + GET_MISSION_ANIMATION = 1128, + MISSION_DIALOGUE_CANCELLED = 1129, + MODULE_ASSEMBLY_DB_DATA = 1130, + MODULE_ASSEMBLY_DB_DATA_FOR_CLIENT = 1131, + MODULE_ASSEMBLY_QUERY_DATA = 1132, + MODULE_ASSEMBLY_HKX_LOADED = 1133, + MODULE_ASSEMBLY_NIF_LOADED = 1134, + MODULE_ASSEMBLY_MAIN_NIF_LOADED = 1135, + MODULE_ASSEMBLY_KFM_LOADED = 1136, + GET_PRECONDITION_INFO = 1137, + GET_MODEL_LOT = 1138, + ANIMATION_FINISHED_PRELOADING = 1139, + CHILD_BUILD_ASSEMBLY_COMPLETE = 1140, + CHARACTER_UNSERIALIZED = 1141, + CHARACTER_NEEDS_TRANSITION = 1142, + SET_NEEDS_TRANSITION = 1143, + ECHO_SYNC_SKILL = 1144, + SYNC_SKILL = 1145, + GET_BEHAVIOR_HANDLE = 1146, + ADD_OUTSTANDING_BEHAVIOR = 1147, + REQUEST_SERVER_PROJECTILE_IMPACT = 1148, + OFF_WORLD_IMPACT_REQUEST = 1149, + SERVER_IMPACT_REQUEST = 1150, + DO_CLIENT_PROJECTILE_IMPACT = 1151, + MODULE_ASSEMBLY_PART_INFO = 1152, + GET_BUILD_TYPE = 1153, + CHECK_BUILD_TYPE = 1154, + MODULAR_BUILD_CONVERT_MODEL = 1155, + DO_NPC_SHOWCASE_MODEL_SUBMISSION = 1156, + GET_MISSION_I_DS_LIST = 1157, + SET_SHOWCASE_MISSION_NPC_VALS = 1158, + NOTIFY_SHOWCASE_MISSION_NP_COF_SUCCESS = 1159, + SEND_LUA_NOTIFICATION_REQUEST = 1160, + SEND_LUA_NOTIFICATION_CANCEL = 1161, + ACTIVATOR_TOGGLE = 1162, + MAKE_PHYSICS = 1163, + SET_RESPAWN_GROUP = 1164, + SET_PLAYER_ALLOWED_RESPAWN = 1165, + TOGGLE_SENDING_POSITION_UPDATES = 1166, + TOGGLE_RECEIVING_POSITION_UPDATES = 1167, + GET_ENEMY_PRECONDITIONS = 1168, + START_MODEL_VISUALIZATION = 1169, + PLACE_PROPERTY_MODEL = 1170, + PROPERTY_MODEL_PLACED = 1171, + OPEN_EXHIBIT_REPLACE_MODEL_UI = 1172, + REPLACE_SHOWCASEMODEL = 1173, + CLEAR_UI_HOOK_EXHIBIT_REPLACEMENT = 1174, + ATTACH_FLYTO_SCREEN_POS = 1175, + VEHICLE_GET_DEBUG_INFO = 1176, + VEHICLE_GET_MOVEMENT_INPUT_VALUES = 1177, + ACTIVITY_TIMER_SET = 1178, + ACTIVITY_TIMER_UPDATE = 1179, + ACTIVITY_TIMER_GET = 1180, + ACTIVITY_TIMER_STOP = 1181, + ACTIVITY_TIMER_DONE = 1182, + GET_ATTACK_PRIORITY = 1183, + UI_MESSAGE_SERVER_TO_SINGLE_CLIENT = 1184, + UI_MESSAGE_SERVER_TO_ALL_CLIENTS = 1185, + SET_LOSE_COINS_ON_DEATH = 1186, + LOAD_EFFECTS = 1187, + SET_CUSTOM_BUILD = 1188, + ACTIVITY_TIMER_RESET = 1189, + ACTIVITY_TIMER_STOP_ALL_TIMERS = 1190, + ACTIVITY_TIMER_MODIFY = 1191, + SET_KEYFRAM_TRANSFORM = 1192, + ADD_ACTIVITY_OWNER = 1193, + REMOVE_ACTIVITY_OWNER = 1194, + GET_CURRENT_ACTIVITY_OWNERS = 1195, + TOGGLE_SKILL_DEBUGGING = 1196, + PET_TAMING_TRY_BUILD = 1197, + REPORT_BUG = 1198, + REPORT_OFFENSIVE_MODEL = 1199, + REPORT_OFFENSIVE_PROPERTY = 1200, + GET_ACTIVITY_ID = 1201, + REQUEST_SMASH_PLAYER = 1202, + GET_TIMES_REQUESTED_SMASH = 1203, + RESPONSE_SMASH_PLAYER = 1204, + MODIFY_DAMAGE_ABSORPTION = 1205, + UNCAST_SKILL = 1206, + GET_SHOWCASE_MODEL_READY = 1207, + IS_SKILL_NEEDED = 1208, + GET_COMPONENT_DATA = 1209, + VEHICLE_SET_POWERSLIDE_METHOD = 1210, + SHOWS_NAMETAG = 1211, + FIRE_EVENT_CLIENT_SIDE = 1213, + GET_REQUIRES_NAME_RESUBMISSION = 1216, + SET_REQUIRES_NAME_RESUBMISSION = 1217, + TOGGLE_GM_INVIS = 1218, + GET_GM_INVIS = 1219, + KILLED_PLAYER = 1220, + GET_PICKUP_SKILLS = 1221, + GET_FACTION_SKILL = 1222, + CHANGE_OBJECT_WORLD_STATE = 1223, + GET_OBJECT_WORLD_STATE = 1224, + VISIBILITY_CHANGED = 1225, + MOTION_EFFECT_COMPLETE = 1226, + TOGGLE_FREEZE_MODE = 1227, + SHADER_RENDER_MSG_APPLIED = 1228, + PLAYER_RENAME_REQUEST = 1229, + VEHICLE_LOCK_INPUT = 1230, + VEHICLE_UNLOCK_INPUT = 1231, + SET_AIR_MOVEMENT = 1232, + MOVEMENT_STATE_CHANGED = 1233, + SKILL_MOVEMENT_CANCELLED = 1234, + AIR_MOVEMENT_COMPLETE = 1235, + CANCEL_AIR_MOVEMENT = 1236, + FORCE_MINIFIGURE_TEXTURE_UPDATE = 1237, + RESYNC_EQUIPMENT = 1238, + ADD_COMPONENT_TO_OBJECT = 1239, + VEHICLE_GET_MAX_GAME_SPEED = 1240, + VEHICLE_GET_MAX_GAME_SPEED_WITH_BOOST = 1241, + GET_SPEED_FACTOR = 1242, + FREEZE_INVENTORY = 1243, + ADD_STAT_TRIGGER = 1244, + ADD_STAT_TRIGGER_CHILD = 1245, + CHECK_TRIGGERS_AND_FIRE_IF_NEEDED = 1246, + STAT_EVENT_TRIGGERED = 1247, + GET_CURRENT_SPEED = 1248, + RACING_PLAYER_RANK_CHANGED = 1249, + RACING_PLAYER_WRONG_WAY_STATUS_CHANGED = 1250, + RACING_PLAYER_CROSSED_FINISH_LINE = 1251, + RACING_RESET_PLAYER_TO_LAST_RESET = 1252, + RACING_SERVER_SET_PLAYER_LAP_AND_PLANE = 1253, + RACING_SET_PLAYER_RESET_INFO = 1254, + RACING_PLAYER_INFO_RESET_FINISHED = 1255, + RACING_PLAYER_OUT_OF_TRACK_BOUNDS = 1256, + RACING_SYNC_INFO = 1257, + RACING_PLAYER_KEEP_ALIVE = 1258, + RACING_SERVER_KEEP_ALIVE = 1259, + LOCK_NODE_ROTATION = 1260, + GET_PHYSICS_COLLIDABLE = 1261, + SET_PHYSICS_COLOR_FOR_DEBUG = 1262, + GET_PHYSICS_COLOR_FOR_DEBUG = 1263, + SET_PHYSICS_TEXT_AND_STATE_FOR_DEBUG = 1264, + REQUEST_INFO_FOR_PHYSICS_DEBUGGER = 1265, + GET_COLLIDABLE_AT_ADDRESS = 1266, + REQUEST_SERVER_GET_COLLIDABLE_REPORT = 1267, + COLLISION_POINT_ADDED = 1268, + COLLISION_POINT_REMOVED = 1269, + SET_ATTACHED = 1270, + SET_DESTROYABLE_MODEL_BRICKS = 1271, + VEHICLE_SET_POWERSLIDE_LOCK_WHEELS = 1272, + VEHICLE_SET_WHEEL_LOCK_STATE = 1273, + SHOW_HEALTH_BAR = 1274, + GET_SHOWS_HEALTH_BAR = 1275, + NOTIFY_VEHICLE_OF_RACING_OBJECT = 1276, + ENABLE_CLIENT_EQUIP_MODE = 1278, + CLIENT_EQUIP_MODE_WAS_CHANGED = 1279, + VEHICLE_GET_SPAWN_HEIGHT = 1281, + SET_NAME_BILLBOARD_STATE = 1284, + CHECK_TARGETING_REQUIREMENTS = 1285, + VEHICLE_CAN_WRECK = 1286, + ATTACH_RENDER_EFFECT = 1287, + DETACH_RENDER_EFFECT = 1288, + IS_PET_USING_ABILITY = 1289, + SET_BLOCKING = 1290, + GET_BLOCKING = 1291, + UPDATE_BLOCKING = 1292, + CHECK_DAMAGE_RESULTS = 1293, + GET_OBJECT_IS_IN_RENDER_PIPE = 1294, + ATTACH_MOTION_FX_ARC = 1295, + PLAYER_REACHED_RESPAWN_CHECKPOINT = 1296, + GET_LAST_RESPAWN_CHECKPOINT = 1297, + GET_VEHICLE_DEBUG_COLLISIONS = 1298, + VISITING_PROPERTY = 1299, + HANDLE_UGC_POST_DELETE_BASED_ON_EDIT_MODE = 1300, + HANDLE_UGC_POST_CREATE_BASED_ON_EDIT_MODE = 1301, + WORLD_CHECK_RESPONSE = 1302, + ADD_DAMAGE_REDUCTION = 1303, + REMOVE_DAMAGE_REDUCTION = 1304, + PROPERTY_CONTENTS_FROM_CLIENT = 1305, + GET_MODELS_ON_PROPERTY = 1306, + IS_SHOWCASE_DISPLAY_PEDESTAL = 1307, + MATCH_REQUEST = 1308, + MATCH_RESPONSE = 1309, + MATCH_UPDATE = 1310, + IS_DEFAULT_SKILL_ACTIVE = 1311, + PROPERTY_EDITOR_CARRY = 1312, + GET_LOOT_OWNER_ID = 1313, + GET_ENEMY_LOOT_TAG = 1314, + GET_NUM_SPAWNED_BRICKS = 1315, + SET_ITEM_EQUIP_TRANSFORM = 1316, + GET_ITEM_EQUIP_TRANSFORM = 1317, + GET_PROPERTY_BUDGET_INFO = 1318, + CHATBOX_IS_INIT = 1319, + GET_SPAWNED_I_DS = 1320, + GET_IMMUNITY = 1321, + GET_GM_IMMUNITY = 1322, + PROCESS_REMOTE_SLASH_COMMAND = 1323, + IS_FRIEND_MSG = 1324, + RACING_PLAYER_EVENT = 1325, + GET_PROPERTY_EDIT_VALID = 1326, + REFRESH_RENDER_ASSET = 1327, + VEHICLE_APPLY_STAT_CHANGE = 1328, + ZONE_LOADED_INFO = 1329, + B3_INTERFACE_ACTION = 1330, + RACING_STAT_MODIFIERS_FROM_CLIENT = 1332, + GET_RACING_STAT_MODIFIERS = 1333, + SET_RACING_STAT_MODIFIERS = 1334, + GET_RACING_LICENSE_LEVEL = 1335, + ADD_EQUIP_CAST = 1336, + SHOW_BILLBOARD_INTERACT_ICON = 1337, + CHANGE_IDLE_FLAGS = 1338, + GET_ANIMATION_FLAG = 1339, + VEHICLE_ADD_PASSIVE_BOOST_ACTION = 1340, + VEHICLE_REMOVE_PASSIVE_BOOST_ACTION = 1341, + NOTIFY_SERVER_VEHICLE_ADD_PASSIVE_BOOST_ACTION = 1342, + NOTIFY_SERVER_VEHICLE_REMOVE_PASSIVE_BOOST_ACTION = 1343, + VEHICLE_ADD_SLOWDOWN_ACTION = 1344, + VEHICLE_REMOVE_SLOWDOWN_ACTION = 1345, + NOTIFY_SERVER_VEHICLE_ADD_SLOWDOWN_ACTION = 1346, + NOTIFY_SERVER_VEHICLE_REMOVE_SLOWDOWN_ACTION = 1347, + FORCE_UPDATE_ANIMATIONS = 1348, + MATCH_GET_DATA_FOR_PLAYER = 1349, + BUYBACK_FROM_VENDOR = 1350, + SET_INVENTORY_FILTER = 1351, + GET_INVENTORY_FILTER = 1352, + GET_INVENTORY_GROUPS = 1353, + GET_INVENTORY_GROUP = 1354, + UPDATE_INVENTORY_GROUP = 1355, + UPDATE_INVENTORY_UI = 1356, + UPDATE_INVENTORY_GROUP_CONTENTS = 1357, + CAN_REMOVE_ITEM_FROM_INVENTORY = 1362, + DRIVE_THIS_CAR = 1363, + VEHICLE_CAN_ADD_ACTIVE_BOOST = 1364, + VEHICLE_ADD_ACTIVE_BOOST = 1365, + SET_PROPERTY_ACCESS = 1366, + ZONE_PROPERTY_MODEL_PLACED = 1369, + ZONE_PROPERTY_MODEL_ROTATED = 1370, + ZONE_PROPERTY_MODEL_REMOVED_WHILE_EQUIPPED = 1371, + ZONE_PROPERTY_MODEL_EQUIPPED = 1372, + ZONE_PROPERTY_MODEL_PICKED_UP = 1373, + ZONE_PROPERTY_MODEL_REMOVED = 1374, + GET_VERSIONING_INFO = 1381, + OPEN_UG_BEHAVIOR_UI = 1382, + VEHICLE_NOTIFY_HIT_SMASHABLE = 1383, + GET_TETHER_RADIUS = 1384, + VEHICLE_NOTIFY_HIT_EXPLODER = 1385, + CHECK_NEAREST_ROCKET_LAUNCH_PRE_CONDITIONS = 1386, + REQUEST_NEAREST_ROCKET_LAUNCH_PRE_CONDITIONS = 1387, + CONFIGURE_RACING_CONTROL_CLIENT = 1389, + NOTIFY_RACING_CLIENT = 1390, + RACING_PLAYER_HACK_CAR = 1391, + RACING_PLAYER_LOADED = 1392, + RACING_CLIENT_READY = 1393, + POSSESSION_FINISHED_ATTACH = 1394, + UPDATE_CHAT_MODE = 1395, + VEHICLE_NOTIFY_FINISHED_RACE = 1396, + EQUIPPED_ITEM_STARTUP = 1397, + FACTION_TRIGGER_ITEM_EQUIPPED = 1400, + FACTION_TRIGGER_ITEM_UNEQUIPPED = 1401, + TOGGLE_PROPERTY_BEHAVIORS = 1402, + GET_UG_OBJECT_INFO = 1405, + RESET_PROPERTY_BEHAVIORS = 1406, + IS_PROPERTY_MODEL_RESET = 1407, + SET_UG_OBJECT_NAME_AND_DESCRIPTION = 1408, + SET_CONSUMABLE_ITEM = 1409, + VEHICLE_GET_CURRENT_LAP = 1410, + GET_UGID = 1411, + SET_UGID = 1412, + UGID_CHANGED = 1413, + RACING_GET_CURRENT_LAP_FOR_PLAYER = 1414, + SUB_ITEM_UN_EQUIPPED = 1415, + SET_CUSTOM_DROP_SHADOW_TEXTURE = 1416, + GET_PLAYER_KIT_FACTION = 1418, + USED_INFORMATION_PLAQUE = 1419, + RACING_ENABLE_WRONG_WAY_RESET = 1420, + RACING_TOGGLE_RUBBER_BANDING = 1421, + GET_RACING_CONTROL_DEBUG_INFO = 1422, + SET_PROPERTY_BOUNDS_VISIBILITY = 1423, + SET_PROPERTY_VENDOR_VISIBILITY = 1424, + SET_EQUIP_STATE = 1425, + NOTIFY_COMBAT_AI_STATE_CHANGE = 1426, + SET_PROPERTY_MODEL_INTERACTIVE = 1430, + SERVER_STATE_NOTIFY = 1431, + GET_SERVER_STATE = 1432, + GET_ICON_FOR_PROXIMITY = 1433, + GET_LEGO_CLUB_MEMBERSHIP_STATUS = 1434, + SET_STATUS_IMMUNITY = 1435, + GET_STATUS_IMMUNITY = 1436, + TEAM_IS_MEMBER = 1437, + ACTIVATE_BRICK_MODE = 1438, + GET_BUILD_OBJECT_ID = 1439, + SET_ANIMATION_ENABLED = 1444, + PAUSE_COOLDOWNS = 1446, + FORCE_UPDATE_RENDER_NODE = 1447, + SET_PET_NAME_MODERATED = 1448, + TOGGLE_STRAFE_MODE = 1449, + SET_SCHEME_SPEED_SCALE = 1450, + CANCEL_SKILL_CAST = 1451, + CHECK_PLAYER_ASSEMBLY_FOR_UNIQUE_MODULE_BY_LOT = 1454, + MODULE_ASSEMBLY_DB_DATA_TO_LUA = 1455, + IS_ALLY = 1458, + MODIFY_LEGO_SCORE = 1459, + GET_LEGO_SCORE = 1460, + GET_PLAYER_LEVEL = 1461, + NOTIFY_LEGO_SCORE_UPDATE = 1462, + SET_LEGO_SCORE = 1463, + UPDATE_BEHAVIOR_EXECUTION_DETAILS = 1466, + RESTORE_TO_POST_LOAD_STATS = 1468, + PICKUP_OBJECT_ERROR = 1469, + CHECK_AND_SHOW_INVENTORY_FULL_TIP = 1470, + SET_RAIL_MOVEMENT = 1471, + START_RAIL_MOVEMENT = 1472, + SET_UP_VECTOR = 1473, + CANCEL_RAIL_MOVEMENT = 1474, + GET_RAIL_INFO = 1475, + CLIENT_RAIL_MOVEMENT_READY = 1476, + PLAYER_RAIL_ARRIVED_NOTIFICATION = 1477, + NOTIFY_RAIL_ACTOVATOR_STATE_CHANGE = 1478, + REQUEST_RAIL_ACTIVATOR_STATE = 1479, + NOTIFY_REWARD_MAILED = 1480, + UPDATE_PLAYER_STATISTIC = 1481, + IS_IN_COMBAT = 1482, + IS_PRIMITIVE_MODEL_MSG = 1483, + SCALE_PRIMITICE_MODEL_MSG = 1484, + MODIFY_GHOSTING_DISTANCE = 1485, + PRIMITIVE_MODEL_CHANGED_MSG = 1487, + GET_PROPRTY_CLONE_ID = 1488, + REQUEST_LEAVE_PROPERTY = 1489, + REQUERY_PROPERTY_MODELS = 1491, + GET_BEHAVIOR_COUNT = 1492, + UPDATE_BEHAVIOR_CONTROLS = 1493, + MODULE_ASSEMBLY_LXFML_LOADED = 1494, + REQUEST_ASSEMBLED_LXFML = 1495, + ASSEMBLED_LXFML_LOADED = 1496, + GET_REORIENT_UP_VECTOR = 1497, + MODULAR_ASSEMBLY_NIF_COMPLETED = 1498, + CHARACTER_DISCONNECT_BEFORE_CREATE = 1499, + SEND_LAUNCH_TO_PREVIOUS_ZONE_TO_CLIENT = 1500, + ROCKETLAUNCH_REQUEST_DEFAULT_MAP_ID = 1501, + BEGIN_LAUNCH = 1502, + PROCESS_CLAIM_CODES = 1503, + GET_LAST_ZONE_ID = 1504, + ADD_RUN_SPEED_MODIFIER = 1505, + REMOVE_RUN_SPEED_MODIFIER = 1506, + SKILL_EVENT_FIRED = 1507, + SEND_HOT_PROPERTY_DATA = 1510, + GET_HOT_PROPERTY_DATA = 1511, + GET_EQUIPPED_ITEMS_IN_SET = 1512, + IS_ITEM_IN_SET = 1513, + GET_INVENTORY_TYPE_FOR_LOT = 1514, + GET_BANK_TYPE_FOR_LOT = 1515, + NOTIFY_NOT_ENOUGH_INV_SPACE = 1516, + IMPORT_MODEL_TO_BBB = 1517, + SEARCH_NEARBY_OBJECTS = 1518, + SEARCH_NEARBY_OBJECTS_REQUEST_BY_LOT = 1519, + REQUEST_OBJECT_POSITION_BY_ID = 1520, + SEARCH_NEARBY_OBJECTS_REQUEST_BY_COMPONENT = 1521, + SEARCH_NEARBY_OBJECTS_RESPONSE = 1522, + BROADCAST_NON_STANDARD_COLLISIONS = 1523, + GET_REGISTERED_NON_STANDARD_COLLISION_GROUP = 1524, + BROADCAST_CRUSHED_NOTIFICATIONS = 1525, + GET_REGISTERED_CRUSHED_COLLISION_GROUPS = 1526, + IS_BEING_CRUSHED = 1527, + GET_SUPPORTING_OBJECT = 1528, + TREAT_RIGID_BODY_COLLSIONS_AS_FIXED = 1529, + BROADCAST_TELEPORTED_WITHIN_NOTIFICATION = 1530, + GET_REGISTERED_TELEPORTED_WITHIN_OBJECT_GROUP = 1531, + GET_INTERPENTRATING_INFORMATION = 1532, + OBJECT_TELEPORTED_WITHIN = 1533, + SET_PHYSICS_SOLVER_PROPERTIES = 1534, + HAS_BEHAVIORS = 1535, + PLAY_BEHAVIOR_SOUND = 1536, + GET_PLAYER_BEHAVIOR_TIER = 1537, + GET_EMOTE_ANIMATION_TIME = 1538, + GET_CHARACTER_STAT_TRACKING = 1539, + PLAYER_INVENTORY_READY = 1540, + SET_PRECONDITIONS = 1541, + DETACH_SHADOW = 1542, + GET_LOOT_INFO = 1543, + GET_PLAYERS_ON_PROPERTY = 1544, + PROPERTY_SPAWN_BY_BEHAVIOR = 1545, + NOTIFY_PROPERTY_OF_EDIT_MODE = 1546, + UPDATE_PROPERTY_PERFORMANCE_COST = 1547, + GET_PROPERTY_PERFORMANCE_COST = 1548, + GET_INVENTORY_ITEM_WITH_SUBKEY = 1549, + DISPLAY_PROPERTY_SUMMARY_SCREEN = 1550, + VALIDATE_BBB_MODEL = 1551, + BBB_MODEL_VALIDATION = 1552, + PROPERTY_ENTRANCE_BEGIN = 1553, + CHECK_LIST_OF_PRECONDITIONS_FROM_LUA = 1554, + GET_PROPERTYIN_ZONE = 1555, + GET_ZONE_ID_FROM_MULTI_ZONE_ENTRANCE = 1556, + TEAM_SET_LEADER = 1557, + TEAM_INVITE_CONFIRM = 1558, + TEAM_GET_STATUS_RESPONSE = 1559, + MINI_GAME_ENABLE_LOCAL_TEAMS = 1560, + TEAM_INVITE_FINAL_RESPONSE = 1561, + TEAM_ADD_PLAYER = 1562, + TEAM_REMOVE_PLAYER = 1563, + TEAM_CREATE_LOCAL = 1564, + TEAM_GET_LOOT = 1565, + TEAM_SET_LOOT = 1566, + SET_ZERO_IMPULSE_AGAINST_COLLISION_GROUPS = 1567, + SET_CENTER_OF_MASS_TO_PHYSICAL_CENTER = 1568, + SET_INERTIA_INVERSE = 1569, + ADD_REMOVE_CLIMBING_LISTENER = 1570, + GET_INVENTORYITEM_DETAILS = 1571, + PERFORM_CLIENT_SIDE_DEATH = 1572, + LEGO_CLUB_ACCESS_RESULT = 1573, + VEHICLE_GET_IS_REVERSING = 1574, + CHECK_CLAIM_CODE = 1575, + GET_HOLIDAY_EVENT = 1576, + SET_EMOTES_ENABLED = 1577, + GET_EMOTES_ENABLED = 1578, + FREEZE_ANIMATION = 1579, + LOCALIZED_ANNOUNCEMENT_SERVER_TO_SINGLE_CLIENT = 1580, + ANCHOR_FX_NODE = 1581, + WS_GET_FRIEND_LIST_MESSAGE = 1582, + WS_ADD_FRIEND_RESPONSE = 1583, + WS_REMOVE_FRIEND_REPSONSE = 1584, + WS_UPDATE_FRIEND_STATUS = 1585, + WS_UPDATE_FRIEND_NAME = 1586, + IS_BEST_FRIEND = 1587, + TEAM_NOTIFY_UPDATE_MISSION_TASK = 1588, + VEHICLE_ADD_SLIPPERY_ACTION = 1589, + VEHICLE_REMOVE_SLIPPERY_ACTION = 1590, + SET_RESURRECT_RESTORE_VALUES = 1591, + GET_MASS = 1592, + SET_PROPERTY_MODERATION_STATUS = 1593, + UPDATE_PROPERTY_MODEL_DEFAULTS = 1594, + UPDATE_PROPERTYMODEL_COUNT = 1595, + GET_PROPERTY_MODEL_COUNT = 1596, + IS_PLAYER_LOADED = 1597, + ATTACH_RENDER_EFFECT_FROM_LUA = 1598, + DETACH_RENDER_EFFECT_FROM_LUA = 1599, + TEAM_IS_LOCAL = 1600, + CREATE_CAMERA_PARTICLES = 1602, + SET_SMASHABLE_GRAVITY_FACTOR = 1603, + VEHICLE_SET_SURFACE_TYPE_OVERRIDE = 1604, + VEHICLE_NOTIFY_HIT_IMAGINATION = 1605, + VEHICLE_NOTIFY_HIT_IMAGINATION_SERVER = 1606, + GET_SPAWNED_OBJECT_SPAWNER_INFO = 1607, + SAVE_PROPERTY = 1608, + SET_PROPERTY_DIRTY = 1609, + GET_PROPERTY_DIRTY = 1610, + GET_MODEL_LIST_FROM_PLAQUE = 1611, + GET_ORIGINAL_POSITION_AND_ROTATION = 1612, + VEHICLE_SET_MASS_FOR_COLLISION = 1613, + GET_INVENTORY_GROUP_COUNT = 1614, + GET_LATEST_CHAT_CHANNEL_USED = 1615, + SET_SUGGEST_LIST_LANGUAGE = 1616, + VEHICLE_STOP_BOOST = 1617, + START_CELEBRATION_EFFECT = 1618, + LOCK_PLAYER = 1619, + VEHICLE_IS_INPUT_LOCKED = 1620, + GET_MULTI_NODE = 1621, + RENEW_PROPERTY = 1622, + RENEW_PROPERTY_RESULT = 1623, + CHARGE_ACTIVITY_COST = 1624, + CAN_RECEIVE_LOOT = 1625, + JOIN_PLAYER_FACTION = 1626, + SET_PROXIMITY_UPDATE_RATE = 1627, + BBB_MODELS_TO_SAVE = 1628, + BELONGS_TO_FACTION = 1629, + MODIFY_FACTION = 1630, + FACTION_UPDATE = 1631, + CELEBRATION_COMPLETED = 1632, + PLAY_PRIMARY_MODULE_SOUNDS = 1633, + STOP_PRIMARY_MODULE_SOUNDS = 1634, + REQUEST_TEAM_PLAYER_UI_UPDATE = 1635, + SET_LOCAL_TEAM = 1636, + TEAM_GET_WORLD_MEMBERS_IN_RADIUS = 1637, + GET_PARENTAL_LEVEL = 1638, + GET_OBJECTS_MESSAGE_HANDLERS = 1639, + PROPERTY_FEATURED = 1640, + PROPERTY_NOTIFY_MODEL_SPAWNED = 1641, + SERVER_DONE_LOADING_ALL_OBJECTS = 1642, + GET_DONATION_TOTAL = 1643, + UPDATE_DONATION_VALUES = 1644, + DELAYED_DELETE_DROP_EFFECT_BRICK = 1645, + SET_CAMERA_UNLOCK_ROTATION_STATE = 1646, + ADD_BUFF = 1647, + REMOVE_BUFF = 1648, + CHECK_FOR_BUFF = 1649, + TEAM_MEMBERS_DISOWNS_LOOT = 1650, + GET_WHEEL_TEMPLATE = 1651, + ADD_SKILL_IN_PROGRESS = 1652, + REMOVE_SKILL_IN_PROGRESS = 1653, + SET_OVERHEAD_ICON_OFFSET = 1654, + SET_BILLBOARD_OFFSET = 1655, + SET_CHAT_BUBBLE_OFFSET = 1656, + SET_NO_TEAM_INVITES = 1657, + RESET_MODEL_TO_DEFAULTS = 1658, + IS_PROPERTY_IN_EDIT_MODE = 1659, + GET_OBJECTS_IN_PHYSICS_BOUNDS = 1660, + ENABLE_LU_REMOTE = 1661, + SET_IS_USING_FREE_TRIAL = 1662, + GET_IS_USING_FREE_TRIAL = 1663, + GET_ACCOUNT_FREE_TRIAL_MODE = 1664, + TOGGLE_INVENTORY_ITEM_LOCK = 1665, + REQUEST_MOVE_ITEM_BETWEEN_INVENTORY_TYPES = 1666, + RESPONSE_MOVE_ITEM_BETWEEN_INVENTORY_TYPES = 1667, + REMOVE_SUB_COMPONENT = 1668, + TEAM_GET_LOOT_MEMBERS = 1669, + GET_FACTION_TOKEN_TYPE = 1670, + GET_SUBSCRIPTION_PRICING = 1671, + INFORM_AFK = 1672, + OVERHEAD_INDICATOR_CREATED = 1673, + SET_OVERHEAD_INDICATOR_GRID_LOCATION = 1674, + PLAYSTREAM_LOAD_PENDING = 1675, + PLAYER_SET_CAMERA_CYCLING_MODE = 1676, + PLAYER_GET_CAMERA_CYCLING_MODE = 1677, + FORCE_CAMERA_TARGET_CYCLE = 1678, + GET_OBJECT_CONFIG_DATA = 1679, + GET_OBJECT_CONFIG_DATA_NON_CONST = 1680, + SCOPE_CHANGED = 1681, + SET_ALLOW_JUMP_WITHOUT_SUPPORT = 1682, + GET_ALLOW_JUMP_WITHOUT_SUPPORT = 1683, + SET_JUMP_HEIGHT_SCALE = 1684, + GET_JUMP_HEIGHT_SCALE = 1685, + SET_VELOCITY_RESISTANCE = 1686, + GET_VELOCITY_RESISTANCE = 1687, + GATE_RUSH_VEHICLE_HIT_GATE = 1688, + GATE_RUSH_PLAYER_COLLECTED_GATE = 1689, + GATE_RUSH_ADD_GATE = 1690, + GATE_RUSH_REMOVE_GATE = 1691, + NOTIFY_VEHICLE_UPDATED = 1692, + VEHICLE_NOTIFY_HIT_WEAPON_POWERUP = 1693, + VEHICLE_NOTIFY_HIT_WEAPON_POWERUP_SERVER = 1694, + LOCAL_PLAYER_TARGETED = 1696, + SKILL_COUNT_CHANGED = 1697, + DO_YAW_ROTATION = 1698, + DO_PITCH_ROTATION = 1699, + DO_ROLL_ROTATION = 1700, + GET_CURRENT_LOOT_MATRIX = 1701, + SEND_MULTI_MISSION_OFFER_UPDATE_I_DS = 1702, + SET_AIR_SPEED_VALUES = 1703, + USE_LAUNCHER = 1704, + START_LAUNCHER = 1705, + STOP_LAUNCHER = 1706, + CAN_USE_JET_PACK = 1707, + JET_PACK_STATE_CHANGED = 1708, + TURN_OFF_JET_PACK = 1709, + ADD_PLAYER_JET_PACK_PAD = 1710, + SET_JET_PACK_WARNING = 1711, + JET_PACK_DISABLED = 1712, + JET_PACK_PAD_ENTERED = 1713, + UPDATE_RENDER_POSSESSION_FLAG = 1714, + POSSESSABLE_GET_ATTACH_OFFSET = 1715, + ATTEMPT_TO_CRAFT_ITEM = 1718, + CRAFT_ATTEMPT_RESPONSE = 1719, + SET_C_SCORE = 1720, + FILL_IN_RENDERER = 1721, + TOGGLE_CRAFTING_WINDOW = 1722, + REMOVE_TEAM_BUFFS = 1724, + REQUEST_FREE_TRIAL_STATUS_REFRESH = 1725, + REMOVE_BUFFS_APPLIED_BY_OBJECT = 1726, + SET_MOUNT_INVENTORY_ID = 1727, + GET_MOUNT_INVENTORY_ID = 1728, + GET_BUILD_CINEMATIC_TIME_REMAINING = 1730, + JET_PACK_FLYING = 1731, + NOTIFY_SERVER_LEVEL_PROCESSING_COMPLETE = 1734, + NOTIFY_LEVEL_REWARDS = 1735, + CHARACTER_VERSION_CHANGED = 1736, + SET_FREE_TRIAL_RENAME_AVAILABLE = 1737, + SET_PROJECTILE_LAUNCHER_PARAMS = 1738, + RACE_PRECOUNTDOWN_DONE = 1739, + CHECK_INVITE_SPAMMING = 1740, + GET_RESPAWN_VOLUME_INFO = 1741, + INVITE_ACCEPTED = 1742, + TELEPORT_TO_NEAREST_RESPAWN = 1743, + SET_SKILL_CANCEL_ON_MOVE = 1744, + CANCEL_MOVE_SKILL = 1745, + SERVER_CANCEL_MOVE_SKILL = 1746, + CLIENT_CANCEL_MOVE_SKILL = 1747, + END_LAUNCH_SEQUENCE = 1748, + CANCEL_QUEUE = 1749, + UPDATE_PROJECTILE_LAUNCHER_ROTATION = 1750, + GET_CHARACTER_VERSION_INFO = 1751, + GET_CON_INFO = 1753, + GET_SKILLS_FOR_LOT = 1755, + DISMOUNT_COMPLETE = 1756, + MOUNT_FAILURE_RESPONSE = 1757, + CLEAR_BILLBOARD_OFFSET = 1758, + GET_INVENTORY_ITEM_ANIMATION_FLAG = 1759, + SET_JET_PACK_ALLOWED = 1760, + GET_BUILD_TIME_DETAILS = 1761, + USE_SKILL_SET = 1762, + SET_SKILL_SET_POSSESSOR = 1763, + POPULATE_ACTION_BAR = 1764, + GET_COMPONENT_TEMPLATE_ID = 1765, + GET_POSSESSABLE_SKILL_SET = 1766, + MARK_INVENTORY_ITEM_AS_ACTIVE = 1767, + UPDATE_FORGED_ITEM = 1768, + CAN_ITEMS_BE_REFORGED = 1769, + NOTIFY_CLIENT_RAIL_START_FAILED = 1771, + GET_IS_ON_RAIL = 1772 + }; +} + +template <> +struct magic_enum::customize::enum_range { + static constexpr int min = 0; + static constexpr int max = 1772; +}; diff --git a/dCommon/dEnums/MessageType/Master.h b/dCommon/dEnums/MessageType/Master.h new file mode 100644 index 00000000..b6054d7f --- /dev/null +++ b/dCommon/dEnums/MessageType/Master.h @@ -0,0 +1,34 @@ +#pragma once +#include + +namespace MessageType { + enum class Master : uint32_t { + REQUEST_PERSISTENT_ID = 1, + REQUEST_PERSISTENT_ID_RESPONSE, + REQUEST_ZONE_TRANSFER, + REQUEST_ZONE_TRANSFER_RESPONSE, + SERVER_INFO, + REQUEST_SESSION_KEY, + SET_SESSION_KEY, + SESSION_KEY_RESPONSE, + PLAYER_ADDED, + PLAYER_REMOVED, + + CREATE_PRIVATE_ZONE, + REQUEST_PRIVATE_ZONE, + + WORLD_READY, + PREP_ZONE, + + SHUTDOWN, + SHUTDOWN_RESPONSE, + SHUTDOWN_IMMEDIATE, + + SHUTDOWN_UNIVERSE, + + AFFIRM_TRANSFER_REQUEST, + AFFIRM_TRANSFER_RESPONSE, + + NEW_SESSION_ALERT + }; +} diff --git a/dCommon/dEnums/MessageType/Server.h b/dCommon/dEnums/MessageType/Server.h new file mode 100644 index 00000000..8a75153c --- /dev/null +++ b/dCommon/dEnums/MessageType/Server.h @@ -0,0 +1,11 @@ +#pragma once +#include + +namespace MessageType { + //! The Internal Server Packet Identifiers + enum class Server : uint32_t { + VERSION_CONFIRM = 0, + DISCONNECT_NOTIFY, + GENERAL_NOTIFY + }; +} diff --git a/dCommon/dEnums/MessageType/World.h b/dCommon/dEnums/MessageType/World.h new file mode 100644 index 00000000..acca6246 --- /dev/null +++ b/dCommon/dEnums/MessageType/World.h @@ -0,0 +1,49 @@ +#pragma once +#include + +#include "magic_enum.hpp" + +namespace MessageType { + enum class World : uint32_t { + VALIDATION = 1, // Session info + CHARACTER_LIST_REQUEST, + CHARACTER_CREATE_REQUEST, + LOGIN_REQUEST, // Character selected + GAME_MSG, + CHARACTER_DELETE_REQUEST, + CHARACTER_RENAME_REQUEST, + HAPPY_FLOWER_MODE_NOTIFY, + SLASH_RELOAD_MAP, // Reload map cmp + SLASH_PUSH_MAP_REQUEST, // Push map req cmd + SLASH_PUSH_MAP, // Push map cmd + SLASH_PULL_MAP, // Pull map cmd + LOCK_MAP_REQUEST, + GENERAL_CHAT_MESSAGE, // General chat message + HTTP_MONITOR_INFO_REQUEST, + SLASH_DEBUG_SCRIPTS, // Debug scripts cmd + MODELS_CLEAR, + EXHIBIT_INSERT_MODEL, + LEVEL_LOAD_COMPLETE, // Character data request + TMP_GUILD_CREATE, + ROUTE_PACKET, // Social? + POSITION_UPDATE, + MAIL, + WORD_CHECK, // AllowList word check + STRING_CHECK, // AllowList string check + GET_PLAYERS_IN_ZONE, + REQUEST_UGC_MANIFEST_INFO, + BLUEPRINT_GET_ALL_DATA_REQUEST, + CANCEL_MAP_QUEUE, + HANDLE_FUNNESS, + FAKE_PRG_CSR_MESSAGE, + REQUEST_FREE_TRIAL_REFRESH, + GM_SET_FREE_TRIAL_STATUS, + UI_HELP_TOP_5 = 91 + }; +} + +template <> +struct magic_enum::customize::enum_range { + static constexpr int min = 0; + static constexpr int max = 91; +}; diff --git a/dCommon/dEnums/dCommonVars.h b/dCommon/dEnums/dCommonVars.h index 7cdbfdb6..70eb1dc9 100644 --- a/dCommon/dEnums/dCommonVars.h +++ b/dCommon/dEnums/dCommonVars.h @@ -8,7 +8,7 @@ #include #include "BitStream.h" #include "eConnectionType.h" -#include "eClientMessageType.h" +#include "MessageType/Client.h" #include "BitStreamUtils.h" #pragma warning (disable:4251) //Disables SQL warnings @@ -33,7 +33,7 @@ constexpr uint32_t lowFrameDelta = FRAMES_TO_MS(lowFramerate); #define CBITSTREAM RakNet::BitStream bitStream; #define CINSTREAM RakNet::BitStream inStream(packet->data, packet->length, false); #define CINSTREAM_SKIP_HEADER CINSTREAM if (inStream.GetNumberOfUnreadBits() >= BYTES_TO_BITS(HEADER_SIZE)) inStream.IgnoreBytes(HEADER_SIZE); else inStream.IgnoreBits(inStream.GetNumberOfUnreadBits()); -#define CMSGHEADER BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::GAME_MSG); +#define CMSGHEADER BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::GAME_MSG); #define SEND_PACKET Game::server->Send(bitStream, sysAddr, false); #define SEND_PACKET_BROADCAST Game::server->Send(bitStream, UNASSIGNED_SYSTEM_ADDRESS, true); diff --git a/dCommon/dEnums/eAninmationFlags.h b/dCommon/dEnums/eAnimationFlags.h similarity index 100% rename from dCommon/dEnums/eAninmationFlags.h rename to dCommon/dEnums/eAnimationFlags.h diff --git a/dCommon/dEnums/eAuthMessageType.h b/dCommon/dEnums/eAuthMessageType.h deleted file mode 100644 index ecc17a37..00000000 --- a/dCommon/dEnums/eAuthMessageType.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef __EAUTHMESSAGETYPE__H__ -#define __EAUTHMESSAGETYPE__H__ - -#include - -enum class eAuthMessageType : uint32_t { - LOGIN_REQUEST = 0, - LOGOUT_REQUEST, - CREATE_NEW_ACCOUNT_REQUEST, - LEGOINTERFACE_AUTH_RESPONSE, - SESSIONKEY_RECEIVED_CONFIRM, - RUNTIME_CONFIG -}; - -#endif //!__EAUTHMESSAGETYPE__H__ diff --git a/dCommon/dEnums/eCharacterVersion.h b/dCommon/dEnums/eCharacterVersion.h index 0fab4498..683951e3 100644 --- a/dCommon/dEnums/eCharacterVersion.h +++ b/dCommon/dEnums/eCharacterVersion.h @@ -15,7 +15,8 @@ enum class eCharacterVersion : uint32_t { // Fixes vault size value VAULT_SIZE, // Fixes speed base value in level component - UP_TO_DATE, // will become SPEED_BASE + SPEED_BASE, + UP_TO_DATE, // will become NJ_JAYMISSIONS }; #endif //!__ECHARACTERVERSION__H__ diff --git a/dCommon/dEnums/eChatMessageType.h b/dCommon/dEnums/eChatMessageType.h deleted file mode 100644 index 38cd86de..00000000 --- a/dCommon/dEnums/eChatMessageType.h +++ /dev/null @@ -1,80 +0,0 @@ -#ifndef __ECHATMESSAGETYPE__H__ -#define __ECHATMESSAGETYPE__H__ - -#include - -//! The Internal Chat Packet Identifiers -enum class eChatMessageType :uint32_t { - LOGIN_SESSION_NOTIFY = 0, - GENERAL_CHAT_MESSAGE, - PRIVATE_CHAT_MESSAGE, - USER_CHANNEL_CHAT_MESSAGE, - WORLD_DISCONNECT_REQUEST, - WORLD_PROXIMITY_RESPONSE, - WORLD_PARCEL_RESPONSE, - ADD_FRIEND_REQUEST, - ADD_FRIEND_RESPONSE, - REMOVE_FRIEND, - GET_FRIENDS_LIST, - ADD_IGNORE, - REMOVE_IGNORE, - GET_IGNORE_LIST, - TEAM_MISSED_INVITE_CHECK, - TEAM_INVITE, - TEAM_INVITE_RESPONSE, - TEAM_KICK, - TEAM_LEAVE, - TEAM_SET_LOOT, - TEAM_SET_LEADER, - TEAM_GET_STATUS, - GUILD_CREATE, - GUILD_INVITE, - GUILD_INVITE_RESPONSE, - GUILD_LEAVE, - GUILD_KICK, - GUILD_GET_STATUS, - GUILD_GET_ALL, - SHOW_ALL, - BLUEPRINT_MODERATED, - BLUEPRINT_MODEL_READY, - PROPERTY_READY_FOR_APPROVAL, - PROPERTY_MODERATION_CHANGED, - PROPERTY_BUILDMODE_CHANGED, - PROPERTY_BUILDMODE_CHANGED_REPORT, - MAIL, - WORLD_INSTANCE_LOCATION_REQUEST, - REPUTATION_UPDATE, - SEND_CANNED_TEXT, - GMLEVEL_UPDATE, - CHARACTER_NAME_CHANGE_REQUEST, - CSR_REQUEST, - CSR_REPLY, - GM_KICK, - GM_ANNOUNCE, - GM_MUTE, - ACTIVITY_UPDATE, - WORLD_ROUTE_PACKET, - GET_ZONE_POPULATIONS, - REQUEST_MINIMUM_CHAT_MODE, - REQUEST_MINIMUM_CHAT_MODE_PRIVATE, - MATCH_REQUEST, - UGCMANIFEST_REPORT_MISSING_FILE, - UGCMANIFEST_REPORT_DONE_FILE, - UGCMANIFEST_REPORT_DONE_BLUEPRINT, - UGCC_REQUEST, - WHO, - WORLD_PLAYERS_PET_MODERATED_ACKNOWLEDGE, - ACHIEVEMENT_NOTIFY, - GM_CLOSE_PRIVATE_CHAT_WINDOW, - UNEXPECTED_DISCONNECT, - PLAYER_READY, - GET_DONATION_TOTAL, - UPDATE_DONATION, - PRG_CSR_COMMAND, - HEARTBEAT_REQUEST_FROM_WORLD, - UPDATE_FREE_TRIAL_STATUS, - // CUSTOM DLU MESSAGE ID FOR INTERNAL USE - CREATE_TEAM, -}; - -#endif //!__ECHATMESSAGETYPE__H__ diff --git a/dCommon/dEnums/eClientMessageType.h b/dCommon/dEnums/eClientMessageType.h deleted file mode 100644 index aafccc36..00000000 --- a/dCommon/dEnums/eClientMessageType.h +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef __ECLIENTMESSAGETYPE__H__ -#define __ECLIENTMESSAGETYPE__H__ - -#include - -enum class eClientMessageType : uint32_t { - LOGIN_RESPONSE = 0, - LOGOUT_RESPONSE, - LOAD_STATIC_ZONE, - CREATE_OBJECT, - CREATE_CHARACTER, - CREATE_CHARACTER_EXTENDED, - CHARACTER_LIST_RESPONSE, - CHARACTER_CREATE_RESPONSE, - CHARACTER_RENAME_RESPONSE, - CHAT_CONNECT_RESPONSE, - AUTH_ACCOUNT_CREATE_RESPONSE, - DELETE_CHARACTER_RESPONSE, - GAME_MSG, - CONNECT_CHAT, - TRANSFER_TO_WORLD, - IMPENDING_RELOAD_NOTIFY, - MAKE_GM_RESPONSE, - HTTP_MONITOR_INFO_RESPONSE, - SLASH_PUSH_MAP_RESPONSE, - SLASH_PULL_MAP_RESPONSE, - SLASH_LOCK_MAP_RESPONSE, - BLUEPRINT_SAVE_RESPONSE, - BLUEPRINT_LUP_SAVE_RESPONSE, - BLUEPRINT_LOAD_RESPONSE_ITEMID, - BLUEPRINT_GET_ALL_DATA_RESPONSE, - MODEL_INSTANTIATE_RESPONSE, - DEBUG_OUTPUT, - ADD_FRIEND_REQUEST, - ADD_FRIEND_RESPONSE, - REMOVE_FRIEND_RESPONSE, - GET_FRIENDS_LIST_RESPONSE, - UPDATE_FRIEND_NOTIFY, - ADD_IGNORE_RESPONSE, - REMOVE_IGNORE_RESPONSE, - GET_IGNORE_LIST_RESPONSE, - TEAM_INVITE, - TEAM_INVITE_INITIAL_RESPONSE, - GUILD_CREATE_RESPONSE, - GUILD_GET_STATUS_RESPONSE, - GUILD_INVITE, - GUILD_INVITE_INITIAL_RESPONSE, - GUILD_INVITE_FINAL_RESPONSE, - GUILD_INVITE_CONFIRM, - GUILD_ADD_PLAYER, - GUILD_REMOVE_PLAYER, - GUILD_LOGIN_LOGOUT, - GUILD_RANK_CHANGE, - GUILD_DATA, - GUILD_STATUS, - MAIL, - DB_PROXY_RESULT, - SHOW_ALL_RESPONSE, - WHO_RESPONSE, - SEND_CANNED_TEXT, - UPDATE_CHARACTER_NAME, - SET_NETWORK_SIMULATOR, - INVALID_CHAT_MESSAGE, - MINIMUM_CHAT_MODE_RESPONSE, - MINIMUM_CHAT_MODE_RESPONSE_PRIVATE, - CHAT_MODERATION_STRING, - UGC_MANIFEST_RESPONSE, - IN_LOGIN_QUEUE, - SERVER_STATES, - GM_CLOSE_TARGET_CHAT_WINDOW, - GENERAL_TEXT_FOR_LOCALIZATION, - UPDATE_FREE_TRIAL_STATUS, - UGC_DOWNLOAD_FAILED = 120 -}; - -#endif //!__ECLIENTMESSAGETYPE__H__ diff --git a/dCommon/dEnums/eGameMessageType.h b/dCommon/dEnums/eGameMessageType.h deleted file mode 100644 index 8e6980d6..00000000 --- a/dCommon/dEnums/eGameMessageType.h +++ /dev/null @@ -1,1614 +0,0 @@ -#ifndef __EGAMEMESSAGETYPE__H__ -#define __EGAMEMESSAGETYPE__H__ - -#include - -#include "magic_enum.hpp" - -enum class eGameMessageType : uint16_t { - GET_POSITION = 0, - GET_ROTATION = 1, - GET_LINEAR_VELOCITY = 2, - GET_ANGULAR_VELOCITY = 3, - GET_FORWARD_VELOCITY = 4, - GET_PLAYER_FORWARD = 5, - GET_FORWARD_VECTOR = 6, - SET_POSITION = 7, - SET_LOCAL_POSITION = 8, - SET_ROTATION = 9, - SET_LINEAR_VELOCITY = 10, - MODIFY_LINEAR_VELOCITY = 11, - SET_ANGULAR_VELOCITY = 12, - MODIFY_ANGULAR_VELOCITY = 13, - DEFLECT = 14, - SEND_POSITION_UPDATE = 15, - SET_OBJECT_SCALE = 16, - GET_OBJECT_SCALE = 17, - TIMED_SCALE_FINISHED = 18, - TELEPORT = 19, - TOGGLE_PLAYER_FWD_TO_CAMERA = 20, - LOCK_PLAYER_ROT_TO_CAMERA = 21, - UNLOCK_PLAYER_ROT_FROM_CAMERA = 22, - TOGGLE_PLAYER_ROT_LOCK_TO_MOUSE = 23, - LOCK_PLAYER_ROT_TO_MOUSE = 24, - UNLOCK_PLAYER_ROT_FROM_MOUSE = 25, - SET_PLAYER_CONTROL_SCHEME = 26, - GET_PLAYER_CONTROL_SCHEME = 27, - RESET_PLAYER_CONTROL_SCHEME = 28, - PLAYER_TO_PREVIOUS_CONTROL_SCHEME = 29, - DROP_CLIENT_LOOT = 30, - GET_SPEED = 34, - GET_ROT_SPEED = 35, - IS_DEAD = 36, - DIE = 37, - REQUEST_DIE = 38, - ADD_OBJECT = 39, - PLAY_EMOTE = 41, - PRELOAD_ANIMATION = 42, - PLAY_ANIMATION = 43, - ANIMATION_COMPLETE = 44, - ENABLE_HIGHLIGHT = 45, - DISABLE_HIGHLIGHT = 46, - GET_ANIMATION_NAMES = 47, - CONTROL_BEHAVIORS = 48, - BLEND_PRIMARY_ANIMATION = 52, - SET_OFFSCREEN_ANIMATION = 53, - GET_MOVEMENT_INPUT_VALUES = 54, - SWAP_TEXTURE = 55, - SWAP_COLOR = 56, - ATTACH_HAIR = 57, - GET_ENTITY_STRUCT = 58, - SET_ENTITY_STRUCT = 59, - SET_ATTR = 60, - GET_ATTR = 61, - ON_HIT = 62, - HIT_OR_HEAL_RESULT = 63, - SHOW_ATTACK = 64, - GO_TO = 65, - GET_CONFIG_DATA = 66, - SET_CONFIG_DATA = 68, - GET_INVENTORY_EXTRA_INFO = 69, - GET_DISPLAY_NAME = 70, - GET_NAME = 71, - SET_NAME = 72, - IS_NAME_LOCALIZED = 73, - GET_HAIR_COLOR = 74, - SET_HAIR_COLOR = 75, - GET_HAIR_STYLE = 76, - SET_HAIR_STYLE = 77, - GET_HEAD = 78, - SET_HEAD = 79, - GET_TORSO = 80, - SET_TORSO = 81, - GET_LEGS = 82, - SET_LEGS = 83, - SET_PROXIMITY_RADIUS = 84, - PROXIMITY_UPDATE = 85, - GET_PROXIMITY_OBJECTS = 86, - UNSET_PROXIMITY_RADIUS = 87, - CLEAR_PROXIMITY_RADIUS = 88, - GET_PROXIMITY_DATA = 89, - SET_PROXIMITY_RADIUS_ICON = 90, - TOGGLE_TAC_ARC = 93, - CAST_SKILL = 95, - CAST_LOCAL_SKILL = 96, - ECHO_LOCAL_SKILL = 97, - QUEUE_AI_SKILL = 98, - ADD_THREAT_RATING = 99, - GET_THREAT_RATING = 100, - CLEAR_THREAT_LIST = 103, - GET_TIME_FOR_NPC_SKILL = 111, - ENEMY_HEAL_NOTIFICATION = 112, - RESET_SCRIPTED_AI_STATE = 113, - ENABLE_COMBAT_AI_COMPONENT = 114, - COMBAT_AI_FORCE_TETHER = 115, - SUSPEND_MOVEMENT_AI = 116, - NOTIFY_SCRIPT_VARS_INITIALIZED = 117, - ECHO_START_SKILL = 118, - START_SKILL = 119, - CASTER_DEAD = 120, - VERIFY_ACK = 121, - ADD_PENDING_VERIFY = 122, - MAP_SKILL = 123, - SELECT_SKILL = 124, - CAST_ACTIVE_SKILL = 125, - MODIFY_SKILL_COOLDOWN = 126, - ADD_SKILL = 127, - REMOVE_SKILL = 128, - LOG = 129, - LOG_CHAT = 130, - SET_MAX_CURRENCY = 131, - GET_MAX_CURRENCY = 132, - SET_CURRENCY = 133, - GET_CURRENCY = 134, - ADD_PENDING_CURRENCY = 136, - PICKUP_CURRENCY = 137, - SERVER_DELETE_LOOT_ITEM = 138, - PICKUP_ITEM = 139, - TEAM_PICKUP_ITEM = 140, - CLIENT_DELETE_LOOT_ITEM = 141, - CLIENT_SET_LOOT_ITEM_FFA = 143, - COLLISION_PHANTOM = 144, - OFF_COLLISION_PHANTOM = 145, - COLLISION_PROXIMITY = 146, - OFF_COLLISION_PROXIMITY = 147, - COLLISION = 148, - OFF_COLLISION = 149, - GET_SKILLS = 150, - CLEAR_FX_SINGLE_EFFECT = 152, - GET_FX_EXIST_EFFECT = 153, - PLAY_FX_EFFECT = 154, - STOP_FX_EFFECT = 155, - CLEAR_FX_ALL_CREATE_EFFECTS = 156, - UPDATE_FX_ALL_CREATE_EFFECTS = 157, - REQUEST_RESURRECT = 159, - RESURRECT = 160, - UPDATE_FROM_GHOST = 162, - FETCH_GHOST = 163, - KFM_LOADED = 164, - NIF_LOADED = 165, - HKX_LOADED = 166, - MOVE_TO_DELETE_QUEUE = 167, - RESTORE_FROM_DELETE_QUEUE = 168, - IS_ENEMY = 169, - GET_FACTION = 170, - SET_IMAGINATION = 171, - GET_IMAGINATION = 172, - SET_MAX_IMAGINATION = 173, - GET_MAX_IMAGINATION = 174, - MODIFY_IMAGINATION = 175, - MODIFY_MAX_IMAGINATION = 176, - SET_HEALTH = 177, - GET_HEALTH = 178, - SET_MAX_HEALTH = 179, - GET_MAX_HEALTH = 180, - MODIFY_HEALTH = 181, - MODIFY_MAX_HEALTH = 182, - SET_ARMOR = 183, - GET_ARMOR = 184, - SET_MAX_ARMOR = 185, - GET_MAX_ARMOR = 186, - MODIFY_ARMOR = 187, - MODIFY_MAX_ARMOR = 188, - POP_HEALTH_STATE = 190, - PUSH_EQUIPPED_ITEMS_STATE = 191, - POP_EQUIPPED_ITEMS_STATE = 192, - SET_GM_LEVEL = 193, - GET_GM_LEVEL = 194, - ADD_STATUS_EFFECT = 196, - REMOVE_STATUS_EFFECT = 197, - SET_STUNNED = 198, - GET_STUNNED = 199, - SET_STUN_IMMUNITY = 200, - GET_STUN_IMMUNITY = 201, - KNOCKBACK = 202, - SET_VISIBLE = 203, - GET_VISIBLE = 204, - REPORT_ITEM_INFO = 205, - GET_REBUILD_STATE = 207, - REBUILD_CANCEL = 209, - REBUILD_START = 211, - ENABLE_REBUILD = 213, - SKILL_FAILURE = 214, - IS_ATTACK_STANCE = 216, - SET_OBJECT_RENDER = 217, - REQUEST_MAPPED_SKILLS = 218, - UI_SELECT_MAPPED_SKILL = 219, - GET_INVENTORY_ITEM_IN_SLOT = 220, - GET_FIRST_INVENTORY_ITEM_BY_LOT = 221, - GET_SMALLEST_INVENTORY_STACK_BY_LOT = 222, - MOVE_ITEM_IN_INVENTORY = 224, - ADD_ITEM_TO_INVENTORY_CLIENT_SYNC = 227, - GET_EQUIPPED_ITEMS = 229, - REMOVE_ITEM_FROM_INVENTORY = 230, - EQUIP_INVENTORY = 231, - UN_EQUIP_INVENTORY = 233, - EQUIP_ITEM = 234, - UN_EQUIP_ITEM = 235, - IS_ITEM_RESPOND = 236, - IS_ITEM_EQUIPPED = 237, - ATTACH_ITEM = 238, - DETACH_ITEM = 239, - GET_NODE = 240, - GET_LOT = 241, - IS_ITEM_EQUIPPABLE = 242, - GET_CURRENT_ANIMATION = 243, - GET_INV_ITEM_COUNT = 244, - POST_LOAD_EQUIP = 245, - SET_PHYSICS_ACTIVE_STATE = 246, - GET_CURRENT_SKILL_TAC_ARC = 247, - OFFER_MISSION = 248, - RESPOND_TO_MISSION = 249, - GET_MISSION_STATE = 250, - GET_MISSION_COMPLETE_TIMESTAMP = 251, - NOTIFY_MISSION = 254, - NOTIFY_MISSION_TASK = 255, - ARE_GFX_LOADED = 257, - ADDED_TO_WORLD = 258, - REMOVE_EXTRA_GFX_FROM_PIPE = 259, - HIDE_EQUIPED_WEAPON = 260, - UN_HIDE_EQUIPED_WEAPON = 261, - GET_ITEM_SLOT = 262, - IS_CHARACTER = 263, - SET_IMMUNITY = 264, - TOGGLE_TOOLTIPS = 266, - GET_TOOLTIPS_DISABLED = 267, - GET_BOUNDING_INFO = 268, - OVERRIDE_BOUNDING_RADIUS = 269, - GET_OFFSCREEN = 270, - USE_STATE_MACHINE = 271, - ADD_STATE = 272, - ADD_SUB_STATE = 273, - SET_STATE = 274, - SET_SUB_STATE = 275, - ADD_MESSAGE = 276, - RELOAD_SCRIPT = 277, - RELOAD_ALL_SCRIPTS = 278, - FRIEND_INVITE_MSG = 279, - ADD_FRIEND_REPOSNSE_MSG = 280, - REMOVE_FRIEND_RESPONSE_MSG = 281, - ADD_FRIEND_FROM_UI_MSG = 282, - GET_CACHED_FRIENDS_LIST_MSG = 283, - REQUEST_NEW_FRIENDS_LIST_MSG = 284, - REPOPULATE_FRIENDS_LIST_MSG = 285, - ADD_IGNORE_REPONSE_MSG = 286, - REMOVE_IGNORE_RESPONSE_MSG = 287, - ADD_IGNORE_FROM_UI_MSG = 288, - GET_CACHED_IGNORE_LIST_MSG = 289, - REQUEST_NEW_IGNORE_LIST_MSG = 290, - REMOVE_FRIEND_BY_NAME = 291, - REMOVE_IGNORE_BY_NAME = 292, - IS_PLAYER_IN_IGNORE_LIST_MSG = 293, - REPOPULATE_IGNORE_LIST_MSG = 294, - GET_INVENTORY_LIST = 295, - UPDATE_FRIEND_MSG = 296, - UPDATE_FRIEND_NAME_MSG = 297, - UPDATE_IGNORE_NAME_MSG = 298, - DEPARTED = 299, - ARRIVED = 300, - TEMPLATE_CHANGE_WAYPOINTS = 301, - CANCELLED = 302, - FLUSH_CACHED_GRAPHICS = 303, - FOLLOW_TARGET = 304, - TIMER_DONE = 305, - TIMER_CANCELLED = 306, - SET_TETHER_POINT = 307, - GET_TETHER_POINT = 308, - LEFT_TETHER_RADIUS = 309, - GET_SCRIPT_VARS_PTR = 310, - FACE_TARGET = 311, - ROTATE_BY_DEGREES = 312, - STRING_RENDERED = 313, - RESET_PRIMARY_ANIMATION = 314, - FACE_PLAY_STREAM = 315, - TORSO_PLAY_STREAM = 316, - CAN_PICKUP = 317, - GET_INVENTORY_SIZE = 318, - GET_INVENTORY_COUNT = 319, - GET_OBJECTS_IN_GROUP = 320, - HIDE_ITEM = 321, - IS_OBJECT_IN_FOV = 322, - GET_TYPE = 323, - TEAM_INVITE_MSG = 324, - TEAM_GET_SIZE = 325, - TEAM_REQUEST_SET_LOOT = 326, - TEAM_REMOVE_PLAYER_MSG = 327, - TEAM_UPDATE_PLAYER_NAME_MSG = 328, - SET_UPDATABLE = 329, - REQUEST_TEAM_UI_UPDATE = 330, - SET_COLLISION_GROUP = 331, - GET_COLLISION_GROUP = 332, - GET_ORIGINAL_COLLISION_GROUP = 333, - SET_COLLISION_GROUP_TO_ORIGINAL = 334, - GET_OBJECT_RADIUS = 335, - REBUILD_NOTIFY_STATE = 336, - GET_PLAYER_INTERACTION = 337, - SET_PLAYER_INTERACTION = 338, - FORCE_PLAYER_TO_INTERACT = 339, - GET_SELECTED_POTENTIAL_INTERACTION = 340, - SET_SELECTED_POTENTIAL_INTERACTION = 341, - GET_INTERACTION_DISTANCE = 342, - SET_INTERACTION_DISTANCE = 343, - CALCULATE_INTERACTION_DISTANCE = 344, - INTERACTION_ATTEMPT_FROM_OUT_OF_RANGE = 345, - SET_PICKING_TARGET = 346, - CLIENT_UNUSE = 347, - BEGIN_PET_INTERACTION = 348, - WANTS_INTERACTION_ICON = 349, - PROPERTY_EDIT_ICON_INTERACTION = 350, - PROPERTY_MODEL_INTERACTION = 351, - GET_INTERACTION_DETAILS = 352, - GET_DISABLED_INTERACTION_TYPES = 353, - GET_INTERACTION_INFO = 354, - INTERACTION_GAME_STATE_CHANGE = 355, - TOGGLE_INTERACTION_UPDATES = 356, - TERMINATE_INTERACTION = 357, - SERVER_TERMINATE_INTERACTION = 358, - GET_PLAYERS_TARGET_FOR_SELECTION = 359, - PROCESS_INTERACTION_UNDER_CURSOR = 360, - HANDLE_INTERACT_ACTION = 361, - ATTEMPT_INTERACTION = 362, - HANDLE_INTERACTION_CAMERA = 363, - REQUEST_USE = 364, - CLIENT_USE = 366, - GET_PLAYER_MULTI_INTERACTION = 367, - GET_MULTI_INTERACTION_STATE = 368, - VENDOR_OPEN_WINDOW = 369, - VENDOR_CLOSE_WINDOW = 370, - EMOTE_PLAYED = 371, - EMOTE_RECEIVED = 372, - BUY_FROM_VENDOR = 373, - SELL_TO_VENDOR = 374, - ADD_DONATION_ITEM = 375, - REMOVE_DONATION_ITEM = 376, - CONFIRM_DONATION_ON_PLAYER = 378, - CANCEL_DONATION_ON_PLAYER = 379, - TEAM_GET_LEADER = 380, - TEAM_GET_ON_WORLD_MEMBERS = 381, - TEAM_GET_ALL_MEMBERS = 382, - TEAM_SET_OFF_WORLD_FLAG = 383, - SET_TRANSPARENCY = 385, - GET_PREFERS_FADE = 386, - PROJECTILE_IMPACT = 387, - SET_PROJECTILE_PARAMS = 388, - SET_INVENTORY_SIZE = 389, - ACKNOWLEDGE_POSSESSION = 391, - SET_POSSESSED_OBJECT = 392, - CHANGE_POSSESSOR = 393, - GET_POSSESSION_TYPE = 395, - GET_POSSESSED_OBJECT = 396, - GET_POSSESSOR = 397, - IS_POSSESSED = 398, - ENABLE_ACTIVITY = 399, - SET_SHOOTING_GALLERY_PARAMS = 400, - OPEN_ACTIVITY_START_DIALOG = 401, - REQUEST_ACTIVITY_START_STOP = 402, - REQUEST_ACTIVITY_ENTER = 403, - REQUEST_ACTIVITY_EXIT = 404, - ACTIVITY_ENTER = 405, - ACTIVITY_EXIT = 406, - ACTIVITY_START = 407, - ACTIVITY_STOP = 408, - SHOOTING_GALLERY_CLIENT_AIM_UPDATE = 409, - ROTATE_TO_POINT = 410, - SHOOTING_GALLERY_FIRE = 411, - CALCULATE_FIRING_PARAMETERS = 412, - GET_MUZZLE_OFFSET = 413, - GET_ACTIVITY_POINTS = 414, - TEAM_IS_ON_WORLD_MEMBER = 415, - REQUEST_VENDOR_STATUS_UPDATE = 416, - VENDOR_STATUS_UPDATE = 417, - CANCEL_MISSION = 418, - RESET_MISSIONS = 419, - RENDER_COMPONENT_READY = 420, - SEND_MINIFIG_DECALS = 421, - PHYSICS_COMPONENT_READY = 422, - ENTER_STANDBY_MODE = 423, - LEAVE_STANDBY_MODE = 424, - NOTIFY_CLIENT_SHOOTING_GALLERY_SCORE = 425, - REQUEST_CONSUME_ITEM = 426, - CONSUME_CLIENT_ITEM = 427, - CLIENT_ITEM_CONSUMED = 428, - QUERY_STANDBY_MODE = 429, - GET_NI_BOUND = 430, - MISSION_FAILURE = 431, - GET_ANIMATION_TIME = 432, - GET_CURRENT_ACTIVITY = 434, - SET_EYEBROWS = 435, - GET_EYEBROWS = 436, - SET_EYES = 437, - GET_EYES = 438, - SET_MOUTH = 439, - GET_MOUTH = 440, - IS_OBJECT_SMASHABLE = 441, - SMASHABLE_STATE_CHANGED = 443, - USE_STATE_LOGGER = 444, - ROTATE_SUB_NODE = 445, - GET_SUB_NODE_POSITION = 446, - GET_SUB_NODE = 447, - UPDATE_SHOOTING_GALLERY_ROTATION = 448, - RENDER_FLOATING_TEXT = 449, - REQUEST2_D_TEXT_ELEMENT = 450, - UPDATE2_D_TEXT_ELEMENT = 451, - REMOVE2_D_TEXT_ELEMENT = 452, - SET_COLOR = 453, - GET_COLOR = 454, - HKX_CHARACTER_LOADED = 455, - ACTIVATE_PHYSICS = 457, - SET_ICON_ABOVE_HEAD = 458, - ADD_ICON_COMPOSITE = 459, - CLEAR_ICON_COMPOSITES = 460, - ICON_NIF_LOADED = 461, - ICON_KFM_LOADED = 462, - GET_OVERHEAD_ICON_PROPERTIES_FROM_PARENT = 463, - BOUNCE_PLAYER = 464, - SET_USER_CTRL_COMP_PAUSE = 466, - HAS_COLLIDED = 467, - GET_TOOLTIP_FLAG = 468, - SET_TOOLTIP_FLAG = 469, - GET_FLAG = 470, - SET_FLAG = 471, - NOTIFY_CLIENT_FLAG_CHANGE = 472, - CURSOR_ON = 473, - CURSOR_OFF = 474, - HELP = 475, - VENDOR_TRANSACTION_RESULT = 476, - PERFORM_SPECIAL_DEATH = 477, - GET_SHADER_ID = 478, - GET_RENDER_ENVIRONMENT = 479, - FINISHED_LOADING_SCENE = 480, - GET_SKILL_INFO = 481, - ACTIVITY_CANCEL = 482, - MISSION_USES_OBJECT = 483, - GET_POSITIONAL_ID = 484, - SET_COLLECTIBLE_STATUS = 485, - HAS_BEEN_COLLECTED = 486, - HAS_BEEN_COLLECTED_BY_CLIENT = 487, - GET_POS_UPDATE_STATS = 488, - GET_NUM_VIEWERS_SCOPING_THIS = 489, - GET_ACTIVITY_USER = 490, - GET_ALL_ACTIVITY_USERS = 491, - GET_MISSION_FOR_PLAYER = 492, - SET_FACTION = 493, - SET_PLATFORM_IDLE_STATE = 494, - DISPLAY_CHAT_BUBBLE = 495, - REQUEST_CHAT_BUBBLE_ELEMENT = 496, - GET_MISSION_DATA = 497, - SPAWN_PET = 498, - DESPAWN_PET = 499, - SET_LOCAL_SPACE_STATE = 500, - GET_LOCAL_SPACE_STATE = 501, - SET_POSITION_TO_LOCAL_POSITION = 502, - ALLOW_LOCAL_SPACE_UPDATE = 503, - TOGGLE_FREE_CAM_MODE = 504, - PLAYER_LOADED = 505, - PLAYER_ADDED_TO_WORLD_LOCAL = 506, - OBJECT_LOADED = 507, - GET_PLAYER_READY = 508, - PLAYER_READY = 509, - SET_SMASHABLE_PARAMS = 510, - IS_LOOTABLE_CHEST = 511, - LOOT_OPEN_WINDOW = 512, - LOOT_SELECTION_UPDATE = 513, - TAKE_LOOT_CHEST_ITEM = 514, - REQUEST_LINKED_MISSION = 515, - TRANSFER_TO_ZONE = 516, - TRANSFER_TO_ZONE_CHECKED_IM = 517, - SECURED_TRANSFER_TO_ZONE = 518, - INVALID_ZONE_TRANSFER_LIST = 519, - MISSION_DIALOGUE_OK = 520, - GET_OBJECT_IN_SCOPE = 521, - SET_LAUNCHED_STATE = 522, - P_CREATE_EFFECT_FINISHED = 523, - SMASHED_OBJECT = 524, - CHECK_SMASHCHAIN_OVERRIDE = 525, - DISPLAY_REBUILD_ACTIVATOR = 526, - TRANSFER_TO_LAST_NON_INSTANCE = 527, - SET_ACTIVE_LOCAL_CHARACTER_ID = 528, - DISPLAY_MESSAGE_BOX = 529, - MESSAGE_BOX_RESPOND = 530, - CHOICE_BOX_RESPOND = 531, - SERVER_SET_USER_CTRL_COMP_PAUSE = 532, - SET_CHARACTER_AUTO_RUN = 533, - FOLLOW_WAYPOINTS = 534, - SWAP_DECAL_AND_COLOR = 535, - CONTINUE_WAYPOINTS = 536, - SMASH = 537, - UN_SMASH = 538, - GET_IS_SMASHED = 539, - GET_UP_VECTOR = 540, - SET_GRAVITY_SCALE = 541, - SET_GRAVITY_SCALE_FOR_RIGID_BODY = 542, - STOP_MOVING = 543, - SET_PATHING_SPEED = 544, - SET_SHIELDED = 545, - SET_SHOOTING_GALLERY_RETICULE_EFFECT = 546, - PLACE_MODEL_RESPONSE = 547, - SET_DODGE_INFO = 548, - GET_DODGE_INFO = 549, - SET_SKILL_ATTACK_SPEED = 550, - GET_SKILL_COOLDOWN_GROUP = 551, - GET_INITIAL_SKILL_COOLDOWN = 552, - GET_SKILL_COOLDOWN_REMAINING = 553, - GET_GLOBAL_COOLDOWN = 554, - SET_GLOBAL_COOLDOWN = 555, - RESET_GLOBAL_COOLDOWN = 556, - FINDINVENTORY_ITEM = 558, - PATH_STUCK = 559, - SET_CURRENT_PATH = 560, - SET_JET_PACK_MODE = 561, - SET_JET_PACK_TIME = 562, - PET_FOLLOW_OWNER = 563, - PLAYER_DIED = 564, - REGISTER_PET_ID = 565, - REGISTER_PET_DBID = 566, - GET_PET_ID = 567, - SHOW_ACTIVITY_COUNTDOWN = 568, - DISPLAY_TOOLTIP = 569, - SET_PHANTOM_BASE = 570, - GET_MOTION_STATE = 571, - GET_MOTION_CONFIG = 572, - SET_ACTIVE_PROJECTILE_SKILL = 573, - INITIALIZE_MISSION_VISUALS = 574, - GET_MISSIONS = 575, - START_ACTIVITY_TIME = 576, - ADD_ACTIVITY_TIME = 577, - GUILD_GET_SIZE = 578, - GUILD_CAN_WE_INVITE = 579, - GUILD_CAN_WE_KICK = 580, - SET_CHAR_GUILD_INFO = 581, - GET_CHAR_GUILD_INFO = 582, - GET_CHAR_IS_IN_GUILD = 583, - RE_RENDER_NAME_BILLBOARD = 584, - IS_IN_LOCAL_CHAR_PROXIMITY = 585, - GUILD_SET_STATUS = 586, - GUILD_ADD_PLAYER = 587, - GUILD_REMOVE_PLAYER = 588, - GUILD_UPDATE_PLAYER_NAME = 589, - GUILD_SET_PLAYER_RANK = 590, - GUILD_SET_ONLINE_STATUS = 591, - GUILD_INVITE = 592, - REQUEST_GUILD_DATA = 593, - POPULATE_GUILD_DATA = 594, - GET_CACHED_GUILD_DATA = 595, - GUILD_RENDER_NAME = 596, - GET_IS_SUPPORTED = 600, - CHARACTER_SUPPORT_CHANGED = 601, - ACTIVITY_PAUSE = 602, - USE_NON_EQUIPMENT_ITEM = 603, - REQUEST_USE_ITEM_ON = 604, - REQUEST_USE_ITEM_ON_TARGET = 605, - USE_ITEM_ON = 606, - USE_ITEM_RESULT = 607, - GET_PARENT_OBJ = 608, - SET_PARENT_OBJ = 609, - GET_UPDATES_WITH_PARENT_POSITION = 610, - PARENT_REMOVED = 611, - PARENT_LEFT_SCOPE = 612, - PARENT_ENTERED_SCOPE = 613, - CHILD_LOADED = 614, - CHILD_REMOVED = 615, - CHILD_DETACHED = 616, - CHILD_ENTERED_SCOPE = 617, - CHILD_LEFT_SCOPE = 618, - GET_CHILD_OBJECTS = 619, - ZONE_TRANSFER_FINISHED = 621, - CHAT_CONNECTION_UPDATE = 622, - PLATFORM_AT_LAST_WAYPOINT = 623, - LOOT_TAKE_ALL = 624, - GET_EQUIPPED_ITEM_INFO = 625, - DISPLAY_GUILD_CREATE_BOX = 626, - GET_EDITOR_LEVEL = 627, - GET_ACCOUNT_ID = 628, - GET_LAST_LOGOUT = 629, - GET_LAST_PROP_MOD_DISPLAY_TIME = 630, - SET_LAST_PROP_MOD_DISPLAY_TIME = 631, - SHOW_ACTIVITY_SUMMARY = 632, - CAN_RECEIVE_ALL_REWARDS = 633, - GET_ACTIVITY_REWARD = 634, - LOOT_CLOSE_WINDOW = 635, - GET_BLUEPRINT_ID = 636, - NOTIFY_BLUEPRINT_UPDATE = 637, - FETCH_MODEL_METADATA_REQUEST = 638, - FETCH_MODEL_METADATA_RESPONSE = 639, - COMMAND_PET = 640, - PET_RESPONSE = 641, - GET_ICON_ABOVE_HEAD_STATE = 642, - GET_ICON_ABOVE_HEAD = 643, - ICON_FINISHED_LOADING = 644, - ADD_PET_STATE = 645, - REMOVE_PET_STATE = 646, - SET_PET_STATE = 647, - REQUEST_ACTIVITY_SUMMARY_LEADERBOARD_DATA = 648, - SEND_ACTIVITY_SUMMARY_LEADERBOARD_DATA = 649, - SET_ON_TEAM = 650, - GET_PET_HAS_STATE = 651, - FIND_PROPERTY = 652, - SET_PET_MOVEMENT_STATE = 653, - GET_ITEM_TYPE = 654, - GET_ITEM_INFO_KEY = 655, - NOTIFY_OBJECT = 656, - IS_PET_WILD = 657, - CLIENT_NOTIFY_PET = 659, - NOTIFY_PET = 660, - NOTIFY_PET_TAMING_MINIGAME = 661, - START_SERVER_PET_MINIGAME_TIMER = 662, - CLIENT_EXIT_TAMING_MINIGAME = 663, - GET_BUILDMODE_ACTIVE = 664, - GET_PET_TAMING_MINIGAME_ACTIVE = 665, - PET_TAMING_OBJECT_PICKED = 666, - PET_TAMING_MINIGAME_RESULT = 667, - PET_TAMING_TRY_BUILD_RESULT = 668, - SET_PET_TAMING_MODEL = 669, - GET_PET_TAMING_MODEL = 670, - PET_ON_SWITCH = 671, - PET_OFF_SWITCH = 672, - NOTIFY_TAMING_BUILD_SUCCESS = 673, - NOTIFY_TAMING_MODEL_LOADED_ON_SERVER = 674, - NOTIFY_TAMING_PUZZLE_SELECTED = 675, - GET_INSTRUCTION_COUNT = 676, - GET_IS_NPC = 677, - ACTIVATE_BUBBLE_BUFF = 678, - DECTIVATE_BUBBLE_BUFF = 679, // This is spelled wrong in the client, so we misspell it here. - EXHIBIT_VOTE = 680, - ADD_PET_TO_PLAYER = 681, - REMOVE_PET_FROM_PLAYER = 682, - REQUEST_SET_PET_NAME = 683, - SET_PET_NAME = 684, - PET_NAME_CHANGED = 686, - GET_PET_AT_INDEX = 687, - GET_LOT_FOR_PET_BY_DBID = 688, - GET_NAME_FOR_PET_BY_DBID = 689, - GET_ACTIVE_PET_OBJ_ID = 690, - GET_ACTIVE_PET_INVENTORY_OBJ_ID = 691, - SHOW_PET_ACTION_BUTTON = 692, - SET_EMOTE_LOCK_STATE = 693, - GET_EMOTE_LOCK_STATE = 694, - LEAVE_TEAM_MSG = 695, - TEAM_KICK_PLAYER_MSG = 697, - TEAM_SET_LEADER_SEND_MSG = 698, - USE_ITEM_ON_CLIENT = 699, - DOES_FORWARD_TARGET_CLICKING = 700, - CHECK_USE_REQUIREMENTS = 701, - USE_REQUIREMENTS_RESPONSE = 702, - USE_ITEM_REQUIREMENTS_RESPONSE = 703, - PET_ADDED_TO_WORLD = 704, - BOUNCER_TRIGGERED = 705, - EXHIBIT_QUERY_CURRENT_MODEL = 706, - EXHIBIT_QUERY_CURRENT_MODEL_RESPONSE = 707, - EXHIBIT_ATTEMPT_VOTE = 708, - EXHIBIT_VOTE_RESPONSE = 709, - EHIBIT_REQUERYMODELS = 710, - IS_SKILL_ACTIVE = 711, - TOGGLE_ACTIVE_SKILL = 712, - PLAY_EMBEDDED_EFFECT_ON_ALL_CLIENTS_NEAR_OBJECT = 713, - EXHIBIT_GET_INFO = 714, - GET_PROPERTY_DATA = 715, - DOWNLOAD_PROPERTY_DATA = 716, - QUERY_PROPERTY_DATA = 717, - MODEL_MODERATION_ACTION = 719, - NOTIFY_SERVER_UGC_REVIEW_READY = 720, - NOTIFY_CLIENT_UGC_REVIEW_READY = 721, - OLD_USE_ITEM_ON = 722, - FIND_PROPERTY_FOR_SALE_RESPONSE = 723, - PROPERTY_EDITOR_BEGIN = 724, - PROPERTY_EDITOR_END = 725, - PROPERTY_EDITOR_SET_MODE = 726, - TOGGLE_TRIGGER = 727, - FIRE_EVENT = 728, - IS_MINIFIG_IN_A_BUBBLE = 729, - GET_ITEM_INFO = 730, - MISSION_NEEDS_LOT = 731, - STOP_PATHING = 732, - START_PATHING = 733, - ACTIVATE_BUBBLE_BUFF_FROM_SERVER = 734, - DEACTIVATE_BUBBLE_BUFF_FROM_SERVER = 735, - HAS_SKILL = 736, - NOTIFY_CLIENT_ZONE_OBJECT = 737, - MOVE_OBJECT = 738, - ROTATE_OBJECT = 739, - GET_SPAWNER_CONFIG_DATA = 740, - UPDATE_SPAWNER_CONFIG_DATA = 741, - TURN_AROUND = 743, - GO_FORWARD = 744, - GO_BACKWARD = 745, - UPDATE_REPUTATION = 746, - GET_REPUTATION = 747, - ADD_REPUTATION = 748, - UPDATE_PROPERTY_DATA = 749, - PROPERTY_RENTAL_RESPONSE = 750, - EXHIBIT_PLACEMENT_RESPONSE = 751, - SQUIRT_WITH_WATERGUN = 752, - GET_VOTES_LEFT = 753, - ADJUST_VOTES_LEFT = 754, - EVADE_TARGET = 755, - STOPPED_EVADING = 756, - GET_PET_HAS_ABILITY = 757, - REQUEST_PLATFORM_RESYNC = 760, - PLATFORM_RESYNC = 761, - PLAY_CINEMATIC = 762, - END_CINEMATIC = 763, - CINEMATIC_UPDATE = 764, - ATTACH_CAMERA_TO_RAIL = 765, - DETACH_CAMERA_FROM_RAIL = 766, - TOGGLE_GHOST_REFERENCE_OVERRIDE = 767, - SET_GHOST_REFERENCE_POSITION = 768, - GET_GHOST_REFERENCE_POSITION = 769, - FIRE_EVENT_SERVER_SIDE = 770, - GET_PET_ABILITY_OBJECT = 771, - TEAM_INVITE_MSG_FROM_UI = 772, - ADD_CAMERA_EFFECT = 773, - REMOVE_CAMERA_EFFECT = 774, - REMOVE_ALL_CAMERA_EFFECTS = 775, - GET_MY_PROPERTIES_IN_THIS_ZONE = 776, - IS_MODEL_WITHIN_PROPERTY_BOUNDS = 777, - PROPERTY_DATA_RESULTS = 778, - ON_UN_SERIALIZE = 779, - SCRIPT_NETWORK_VAR_UPDATE = 781, - ADD_OBJECT_TO_GROUP = 783, - REMOVE_OBJECT_FROM_GROUP = 784, - IS_OBJECT_STATIC = 785, - GET_HAS_MISSION = 786, - GET_MISSION_TARGET_LOT = 787, - GET_MISSION_OFFERER_LOT = 788, - USE_UNIQUE_ITEM = 789, - GET_IS_PET = 790, - DELETE_PROPERTY = 791, - CREATEMODEL_FROM_CLIENT = 792, - UPDATE_MODEL_FROM_CLIENT = 793, - DELETE_MODEL_FROM_CLIENT = 794, - SHOW_PROPERTY_BOUNDS = 795, - SET_PROPERTY_I_DS = 796, - PLAY_FACE_DECAL_ANIMATION = 797, - ADD_ACTIVITY_USER = 798, - REMOVE_ACTIVITY_USER = 799, - GET_NUM_ACTIVITY_USERS = 800, - ACTIVITY_USER_EXISTS = 801, - DO_COMPLETE_ACTIVITY_EVENTS = 805, - SET_ACTIVITY_PARAMS = 806, - SET_ACTIVITY_USER_DATA = 807, - GET_ACTIVITY_USER_DATA = 808, - DO_CALCULATE_ACTIVITY_RATING = 809, - ND_AUDIO_POST_SETUP = 812, - ND_AUDIO_PRE_SHUTDOWN = 813, - SET_ND_AUDION_LISTENER_STANCE = 814, - SET_UP_ND_AUDIO_EMIITTER = 815, - SHUT_DOWN_ND_AUDIO_EMITTER = 816, - METAIFY_ND_AUDIO_EMITTER = 817, - UN_METAIFY_ND_AUDIO_EMITTER = 818, - METAIFY_ND_AUDIO_EMITTERS = 819, - UN_METAIFY_ND_AUDIO_EMITTERS = 820, - PLAY_ND_AUDIO_EMITTER = 821, - STOP_ND_AUDIO_EMITTER = 822, - STOP_ND_AUDIO_EMITTER_ALL = 823, - SET_ND_AUDIO_EMITTER_PARAMETER = 824, - SET_ND_AUDIO_EMITTERS_PARAMETER = 825, - ND_AUDIO_CALLBACK = 826, - ACTIVATE_ND_AUDIO_MUSIC_CUE = 827, - DEACTIVATE_ND_AUDIO_MUSIC_CUE = 828, - FLASH_ND_AUDIO_MUSIC_CUE = 829, - SET_ND_AUDIO_MUSIC_PARAMETER = 830, - PLAY2_D_AMBIENT_SOUND = 831, - STOP2_D_AMBIENT_SOUND = 832, - PLAY3_D_AMBIENT_SOUND = 834, - STOP3_D_AMBIENT_SOUND = 835, - ACTIVATE_ND_AUDIO_MIXER_PROGRAM = 836, - DEACTIVATE_ND_AUDIO_MIXER_PROGRAM = 837, - UPDATE_ACTIVITY_LEADERBOARD = 838, - ACTIVITY_LEADERBOARD_UPDATED = 839, - ENTER_PROPERTY1 = 840, - ENTER_PROPERTY2 = 841, - PROPERTY_ENTRANCE_SYNC = 842, - SEND_PROPERTY_POPULATION_TO_CLIENT = 843, - SEN_PROPERTY_PLAQUE_VIS_UPDATE = 844, - PROPERTY_SELECT_QUERY = 845, - CREATE_POSITION_STRING = 848, - GET_PARALLEL_POSITION = 849, - PARSE_CHAT_MESSAGE = 850, - SET_MISSION_TYPE_STATE = 851, - GET_LOCATIONS_VISITED = 852, - GET_MISSION_TYPE_STATES = 853, - GET_TIME_PLAYED = 854, - SET_MISSION_VIEWED = 855, - HKX_VEHICLE_LOADED = 856, - SLASH_COMMAND_TEXT_FEEDBACK = 857, - BROADCAST_TEXT_TO_CHATBOX = 858, - HANDLE_SLASH_COMMAND_KORE_DEBUGGER = 859, - OPEN_PROPERTY_MANAGEMENT = 860, - OPEN_PROPERTY_VENDOR = 861, - VOTE_ON_PROPERTY = 862, - UPDATE_PROPERTY_OR_MODEL_FOR_FILTER_CHECK = 863, - NOTIFY_PLAYER_OF_PROPERTY_SUBMISSION = 865, - NOTIFY_PLAYER_OF_MODEL_SUBMISSION = 866, - PHYSICS_SYSTEM_LOADED = 867, - CLIENT_TRADE_REQUEST = 868, - SERVER_TRADE_REQUEST = 869, - SERVER_TRADE_INVITE = 870, - CLIENT_TRADE_REPLY = 871, - SERVER_TRADE_REPLY = 872, - SERVER_TRADE_INITIAL_REPLY = 873, - SERVER_TRADE_FINAL_REPLY = 874, - CLIENT_TRADE_UPDATE = 875, - SERVER_SIDE_TRADE_UPDATE = 876, - SERVER_TRADE_UPDATE = 877, - CLIENT_TRADE_CANCEL = 878, - CLIENT_SIDE_TRADE_CANCEL = 879, - CLIENT_TRADE_ACCEPT = 880, - SERVER_SIDE_TRADE_ACCEPT = 881, - SERVER_SIDE_TRADE_CANCEL = 882, - SERVER_TRADE_CANCEL = 883, - SERVER_TRADE_ACCEPT = 884, - GET_TRADE_INFO = 885, - KF_LOADED = 886, - BRICKS_LOADED = 887, - READY_FOR_UPDATES = 888, - SEND_READY_FOR_UPDATES = 889, - SET_LAST_CUSTOM_BUILD = 890, - GET_LAST_CUSTOM_BUILD = 891, - GET_STATUS_EFFECT_BY_ID = 892, - GET_ALL_STATUS_EFFECTS = 893, - CHILD_RENDER_COMPONENT_READY = 894, - NOTIFY_APPEARANCE_CHANGED_MSG = 895, - SET_PHYSICS_MOTION_STATE = 896, - GET_PHYSICS_MOTION_STATE = 897, - ATTACH_GRAYSCALE_EFFECT = 898, - ATTACH_FADE_EFFECT = 899, - ATTACH_CHANGE_RENDER_ENVIRONMENT_EFFECT = 900, - FORCE_MOVEMENT = 901, - CANCEL_FORCE_MOVEMENT = 902, - SET_IGNORE_PROJECTILE_COLLISION = 903, - GET_IGNORE_PROJECTILE_COLLISION = 904, - ORIENT_TO_OBJECT = 905, - ORIENT_TO_POSITION = 906, - ORIENT_TO_ANGLE = 907, - NOTIFY_CLIENT_UGC_MODEL_READY = 909, - NOTIFY_CLIENT_UGC_ICON_READY = 911, - PROPERTY_BUILD_MODE_CHANGED = 912, - PROPERTY_BUILD_MODE_UPDATE = 913, - PROPERTY_DELETION_ACTION = 914, - PROPERTY_MODERATION_STATUS_ACTION = 915, - PROPERTY_MODERATION_STATUS_ACTION_RESPONSE = 916, - PROPERTY_MODERATION_STATUS_UPDATE = 917, - PROPERTY_NEEDS_GM_ATTENTION = 918, - PROPERTY_MODERATION_CHANGED = 919, - INVENTORY_REFRESH_ITEM_DETAILS = 922, - INVENTORY_LOAD_CUSTOM_ICON = 923, - GET_STATUS_EFFECT_BY_TYPE = 924, - RELEASE_CHARGED_SKILL = 925, - PROPERTY_RELOAD_DB = 926, - SET_PLAYER_TARGET = 927, - GET_PLAYER_TARGET = 928, - LOCK_CAMERA_NETWORKED = 929, - MOVE_CAMERA_NETWORKED = 930, - REBUILD_ACTIVATED = 931, - BOUNCE_NOTIFICATION = 932, - REQUEST_CLIENT_BOUNCE = 934, - GET_RECENT_BOUNCED = 935, - SET_RECENT_BOUNCED = 936, - SET_ACTIVE_STATE = 937, - GET_ACTIVE_STATE = 938, - HAS_COMPONENT_TYPE = 939, - GET_COMPONENT_LIST = 940, - RESPONDS_TO_FACTION = 941, - BOUNCER_ACTIVE_STATUS = 942, - HF_ATTRIBUTES_PUSH = 943, - HF_ATTRIBUTES_PULL = 944, - HF_ATTRIBUTES_PATH_DISPLAY = 945, - HF_CONTROLS_PULL = 946, - HF_OBJECT_SELECTED = 947, - HF_PLACEHOLDER_UPDATE = 948, - HF_PLACEHOLDER_TOGGLE = 949, - HF_GET_ASSOCIATED_PATHS = 950, - HF_GETS_WANT_PATH = 951, - GET_RECENT_MOVEMENT_KEYS = 952, - TRACK_RECENT_MOVEMENT_KEYS = 953, - PHYSICS_MOVEMENT_NOTIFICATION_REQUEST = 954, - PHYSICS_MOVEMENT_NOTIFICATION = 955, - MOVE_INVENTORY_SINGLE = 956, - MOVE_INVENTORY_BATCH = 957, - MINI_GAME_SET_PARAMETERS = 958, - MINI_GAME_GET_TEAM_SKILLS = 961, - MINI_GAME_GET_TEAM_SCORE = 963, - MINI_GAME_GET_PLAYER_SCORE = 967, - MINI_GAME_GET_TEAM_COLOR = 972, - MINI_GAME_GET_TEAM_PLAYERS = 975, - MINI_GAME_UPDATE_CLIENT = 976, - MINI_GAME_GET_TEAM = 977, - MINI_GAME_GET_PARAMETERS = 978, - OBJECT_ACTIVATED_CLIENT = 980, - IS_RESURRECTING = 983, - GET_ITEM_OWNER = 984, - GET_STORED_CONFIG_DATA = 985, - SET_STORED_CONFIG_DATA = 986, - ON_PLAYER_RESSURECTED = 988, - PLAYER_RESURRECTION_FINISHED = 989, - TRANSFORM_CHANGELING_BUILD = 990, - RETURN_CHANGELING_BUILD_ID = 991, - SPEND_BRICK_INVENTORY_FOR_LXFML = 992, - BRICK_INVENTORY_FOR_LXFML_SPENT = 993, - REBUILD_BBB_AUTOSAVE_MSG = 995, - SET_BBB_AUTOSAVE = 996, - USE_BBB_INVENTORY = 998, - UN_USE_BBB_MODEL = 999, - BBB_LOAD_ITEM_REQUEST = 1000, - BBB_SAVE_REQUEST = 1001, - BBBLUP_SAVE_REQUEST = 1002, - BBB_GET_METADATA_SOURCE_ITEM = 1003, - BBB_RESET_METADATA_SOURCE_ITEM = 1004, - BBB_SAVE_RESPONSE = 1005, - PLAYER_EXIT = 1006, - SET_PVP_STATUS = 1008, - GET_PVP_STATUS = 1009, - IS_VALID_PVP_TARGET = 1010, - PVP_RENDER_NAME = 1011, - ATTACH_OBJECT = 1012, - DETACH_OBJECT = 1013, - BOUNCE_SUCCEEDED = 1014, - GET_GAME_OBJECT_POINTER = 1015, - PHANTOM_HKX_LOADED = 1016, - DELAY_CREATE_EFFECT = 1017, - CHOICE_BUILD_SELECTION_CONFIRMED = 1018, - NOTIFY_FADE_UP_VIS_COMPLETE = 1019, - ITEM_HAS_NEW_INFO = 1020, - RESET_SECONDARY_ANIMATION = 1021, - GET_PICK_TYPE = 1022, - SET_PICK_TYPE = 1023, - GET_PRIORITY_PICK_LIST_TYPE = 1024, - REQUEST_PICK_TYPE_UPDATE = 1025, - GET_OVERRIDE_PICK_TYPE = 1026, - REQUEST_DISPLAY_OBJECT_INFO = 1027, - REQUEST_SERVER_OBJECT_INFO = 1028, - REQUEST_OBJECT_INFO_AS_XML = 1029, - GET_OBJECT_REPORT_INFO = 1030, - GET_OBJECT_REPORT_WINDOW_CLOSE = 1031, - GET_OBJECT_REPORT_STATUS = 1032, - GET_MISSION_DATA_FOR_OBJECT_REPORT = 1033, - GET_OBJECT_ROLLOVER_INFO = 1034, - PERFORM_ZONE_ANALYSIS = 1035, - UPDATE_HK_VISUAL_IZATION = 1036, - CLEAR_ITEMS_OWNER = 1037, - APPLY_LINEAR_IMPULSE = 1038, - APPLY_ANGULAR_IMPULSE = 1039, - GET_CONTACT_NORMALS = 1040, - IS_WATCHING_FOR_EMOTE = 1041, - NOTIFY_CLIENT_OBJECT = 1042, - DISPLAY_ZONE_SUMMARY = 1043, - ZONE_SUMMARY_DISMISSED = 1044, - GET_PLAYER_ZONE_STATISTIC = 1045, - MODIFY_PLAYER_ZONE_STATISTIC = 1046, - APPLY_EXTERNAL_FORCE = 1049, - GET_APPLIED_EXTERNAL_FORCE = 1050, - ITEM_EQUIPPED = 1052, - ACTIVITY_STATE_CHANGE_REQUEST = 1053, - OVERRIDE_FRICTION = 1054, - ARRANGE_WITH_ITEM = 1055, - CHECK_CAN_BUILD_WITH_ITEM = 1056, - START_BUILDING_WITH_ITEM = 1057, - START_BUILD_SESSION = 1058, - FINISH_BUILD_SESSION = 1059, - DONE_BUILD_SESSION = 1060, - START_ARRANGING_WITH_ITEM = 1061, - FINISH_ARRANGING_WITH_ITEM = 1062, - DONE_ARRANGING_WITH_ITEM = 1063, - START_ARRANGE_MODE = 1064, - ARRANGE_MODE_WITH_ITEM = 1065, - FINISH_ARRANGE_MODE = 1066, - DONE_ARRANGE_MODE = 1067, - SET_BUILD_MODE = 1068, - BUILD_MODE_SET = 1069, - CONFIRM_BUILD_MODE = 1070, - BUILD_MODE_CONFIRMATION = 1071, - BUILD_EXIT_CONFIRMATION = 1072, - SET_BUILD_MODE_CONFIRMED = 1073, - BUILD_MODE_NOTIFICATION = 1074, - BUILD_MODE_NOTIFICATION_REPORT = 1075, - CLIENT_USE_MODULE_ON = 1076, - SET_MODEL_TO_BUILD = 1077, - SPAWN_MODEL_BRICKS = 1078, - CHECK_PRECONDITION = 1079, - CHECK_ALL_PRECONDITIONS = 1080, - NOTIFY_CLIENT_FAILED_PRECONDITION = 1081, - GET_IS_ITEM_EQUIPPED_BY_LOT = 1082, - GET_IS_ITEM_EQUIPPED_BY_ID = 1083, - GET_OBJECT_DIRECTION_VECTORS = 1084, - GET_CASTABLE_SKILLS = 1085, - CHOICEBUILD_COMPLETE = 1086, - GET_MISSION_CHAT = 1087, - GET_MISSION_AUDIO = 1088, - MODULE_EQUIPPED = 1089, - MODULE_DROPPED = 1090, - MODULE_PICKED_UP = 1091, - MODULE_INFO = 1092, - MOVE_ITEM_BETWEEN_INVENTORY_TYPES = 1093, - MODULAR_BUILD_BEGIN = 1094, - MODULAR_BUILD_END = 1095, - MODULAR_BUILD_MOVE_AND_EQUIP = 1096, - MODULAR_BUILD_FINISH = 1097, - SET_REGISTRATION_FOR_UI_UPDATE = 1114, - GO_TO_WAYPOINT = 1115, - ARRIVED_AT_DESIRED_WAYPOINT = 1116, - CHECK_WITHIN_BOUNDS = 1117, - ATTACH_TO_BUILD_ASSEMBLY = 1118, - SET_BUILD_ASSEMBLY = 1119, - RESET_BUILD_ASSEMBLY = 1120, - GET_INVENTORY_ITEM_INFO = 1125, - GET_ITEM_DETAILS = 1126, - GET_BUILD_ACTIVATOR = 1127, - GET_MISSION_ANIMATION = 1128, - MISSION_DIALOGUE_CANCELLED = 1129, - MODULE_ASSEMBLY_DB_DATA = 1130, - MODULE_ASSEMBLY_DB_DATA_FOR_CLIENT = 1131, - MODULE_ASSEMBLY_QUERY_DATA = 1132, - MODULE_ASSEMBLY_HKX_LOADED = 1133, - MODULE_ASSEMBLY_NIF_LOADED = 1134, - MODULE_ASSEMBLY_MAIN_NIF_LOADED = 1135, - MODULE_ASSEMBLY_KFM_LOADED = 1136, - GET_PRECONDITION_INFO = 1137, - GET_MODEL_LOT = 1138, - ANIMATION_FINISHED_PRELOADING = 1139, - CHILD_BUILD_ASSEMBLY_COMPLETE = 1140, - CHARACTER_UNSERIALIZED = 1141, - CHARACTER_NEEDS_TRANSITION = 1142, - SET_NEEDS_TRANSITION = 1143, - ECHO_SYNC_SKILL = 1144, - SYNC_SKILL = 1145, - GET_BEHAVIOR_HANDLE = 1146, - ADD_OUTSTANDING_BEHAVIOR = 1147, - REQUEST_SERVER_PROJECTILE_IMPACT = 1148, - OFF_WORLD_IMPACT_REQUEST = 1149, - SERVER_IMPACT_REQUEST = 1150, - DO_CLIENT_PROJECTILE_IMPACT = 1151, - MODULE_ASSEMBLY_PART_INFO = 1152, - GET_BUILD_TYPE = 1153, - CHECK_BUILD_TYPE = 1154, - MODULAR_BUILD_CONVERT_MODEL = 1155, - DO_NPC_SHOWCASE_MODEL_SUBMISSION = 1156, - GET_MISSION_I_DS_LIST = 1157, - SET_SHOWCASE_MISSION_NPC_VALS = 1158, - NOTIFY_SHOWCASE_MISSION_NP_COF_SUCCESS = 1159, - SEND_LUA_NOTIFICATION_REQUEST = 1160, - SEND_LUA_NOTIFICATION_CANCEL = 1161, - ACTIVATOR_TOGGLE = 1162, - MAKE_PHYSICS = 1163, - SET_RESPAWN_GROUP = 1164, - SET_PLAYER_ALLOWED_RESPAWN = 1165, - TOGGLE_SENDING_POSITION_UPDATES = 1166, - TOGGLE_RECEIVING_POSITION_UPDATES = 1167, - GET_ENEMY_PRECONDITIONS = 1168, - START_MODEL_VISUALIZATION = 1169, - PLACE_PROPERTY_MODEL = 1170, - PROPERTY_MODEL_PLACED = 1171, - OPEN_EXHIBIT_REPLACE_MODEL_UI = 1172, - REPLACE_SHOWCASEMODEL = 1173, - CLEAR_UI_HOOK_EXHIBIT_REPLACEMENT = 1174, - ATTACH_FLYTO_SCREEN_POS = 1175, - VEHICLE_GET_DEBUG_INFO = 1176, - VEHICLE_GET_MOVEMENT_INPUT_VALUES = 1177, - ACTIVITY_TIMER_SET = 1178, - ACTIVITY_TIMER_UPDATE = 1179, - ACTIVITY_TIMER_GET = 1180, - ACTIVITY_TIMER_STOP = 1181, - ACTIVITY_TIMER_DONE = 1182, - GET_ATTACK_PRIORITY = 1183, - UI_MESSAGE_SERVER_TO_SINGLE_CLIENT = 1184, - UI_MESSAGE_SERVER_TO_ALL_CLIENTS = 1185, - SET_LOSE_COINS_ON_DEATH = 1186, - LOAD_EFFECTS = 1187, - SET_CUSTOM_BUILD = 1188, - ACTIVITY_TIMER_RESET = 1189, - ACTIVITY_TIMER_STOP_ALL_TIMERS = 1190, - ACTIVITY_TIMER_MODIFY = 1191, - SET_KEYFRAM_TRANSFORM = 1192, - ADD_ACTIVITY_OWNER = 1193, - REMOVE_ACTIVITY_OWNER = 1194, - GET_CURRENT_ACTIVITY_OWNERS = 1195, - TOGGLE_SKILL_DEBUGGING = 1196, - PET_TAMING_TRY_BUILD = 1197, - REPORT_BUG = 1198, - REPORT_OFFENSIVE_MODEL = 1199, - REPORT_OFFENSIVE_PROPERTY = 1200, - GET_ACTIVITY_ID = 1201, - REQUEST_SMASH_PLAYER = 1202, - GET_TIMES_REQUESTED_SMASH = 1203, - RESPONSE_SMASH_PLAYER = 1204, - MODIFY_DAMAGE_ABSORPTION = 1205, - UNCAST_SKILL = 1206, - GET_SHOWCASE_MODEL_READY = 1207, - IS_SKILL_NEEDED = 1208, - GET_COMPONENT_DATA = 1209, - VEHICLE_SET_POWERSLIDE_METHOD = 1210, - SHOWS_NAMETAG = 1211, - FIRE_EVENT_CLIENT_SIDE = 1213, - GET_REQUIRES_NAME_RESUBMISSION = 1216, - SET_REQUIRES_NAME_RESUBMISSION = 1217, - TOGGLE_GM_INVIS = 1218, - GET_GM_INVIS = 1219, - KILLED_PLAYER = 1220, - GET_PICKUP_SKILLS = 1221, - GET_FACTION_SKILL = 1222, - CHANGE_OBJECT_WORLD_STATE = 1223, - GET_OBJECT_WORLD_STATE = 1224, - VISIBILITY_CHANGED = 1225, - MOTION_EFFECT_COMPLETE = 1226, - TOGGLE_FREEZE_MODE = 1227, - SHADER_RENDER_MSG_APPLIED = 1228, - PLAYER_RENAME_REQUEST = 1229, - VEHICLE_LOCK_INPUT = 1230, - VEHICLE_UNLOCK_INPUT = 1231, - SET_AIR_MOVEMENT = 1232, - MOVEMENT_STATE_CHANGED = 1233, - SKILL_MOVEMENT_CANCELLED = 1234, - AIR_MOVEMENT_COMPLETE = 1235, - CANCEL_AIR_MOVEMENT = 1236, - FORCE_MINIFIGURE_TEXTURE_UPDATE = 1237, - RESYNC_EQUIPMENT = 1238, - ADD_COMPONENT_TO_OBJECT = 1239, - VEHICLE_GET_MAX_GAME_SPEED = 1240, - VEHICLE_GET_MAX_GAME_SPEED_WITH_BOOST = 1241, - GET_SPEED_FACTOR = 1242, - FREEZE_INVENTORY = 1243, - ADD_STAT_TRIGGER = 1244, - ADD_STAT_TRIGGER_CHILD = 1245, - CHECK_TRIGGERS_AND_FIRE_IF_NEEDED = 1246, - STAT_EVENT_TRIGGERED = 1247, - GET_CURRENT_SPEED = 1248, - RACING_PLAYER_RANK_CHANGED = 1249, - RACING_PLAYER_WRONG_WAY_STATUS_CHANGED = 1250, - RACING_PLAYER_CROSSED_FINISH_LINE = 1251, - RACING_RESET_PLAYER_TO_LAST_RESET = 1252, - RACING_SERVER_SET_PLAYER_LAP_AND_PLANE = 1253, - RACING_SET_PLAYER_RESET_INFO = 1254, - RACING_PLAYER_INFO_RESET_FINISHED = 1255, - RACING_PLAYER_OUT_OF_TRACK_BOUNDS = 1256, - RACING_SYNC_INFO = 1257, - RACING_PLAYER_KEEP_ALIVE = 1258, - RACING_SERVER_KEEP_ALIVE = 1259, - LOCK_NODE_ROTATION = 1260, - GET_PHYSICS_COLLIDABLE = 1261, - SET_PHYSICS_COLOR_FOR_DEBUG = 1262, - GET_PHYSICS_COLOR_FOR_DEBUG = 1263, - SET_PHYSICS_TEXT_AND_STATE_FOR_DEBUG = 1264, - REQUEST_INFO_FOR_PHYSICS_DEBUGGER = 1265, - GET_COLLIDABLE_AT_ADDRESS = 1266, - REQUEST_SERVER_GET_COLLIDABLE_REPORT = 1267, - COLLISION_POINT_ADDED = 1268, - COLLISION_POINT_REMOVED = 1269, - SET_ATTACHED = 1270, - SET_DESTROYABLE_MODEL_BRICKS = 1271, - VEHICLE_SET_POWERSLIDE_LOCK_WHEELS = 1272, - VEHICLE_SET_WHEEL_LOCK_STATE = 1273, - SHOW_HEALTH_BAR = 1274, - GET_SHOWS_HEALTH_BAR = 1275, - NOTIFY_VEHICLE_OF_RACING_OBJECT = 1276, - ENABLE_CLIENT_EQUIP_MODE = 1278, - CLIENT_EQUIP_MODE_WAS_CHANGED = 1279, - VEHICLE_GET_SPAWN_HEIGHT = 1281, - SET_NAME_BILLBOARD_STATE = 1284, - CHECK_TARGETING_REQUIREMENTS = 1285, - VEHICLE_CAN_WRECK = 1286, - ATTACH_RENDER_EFFECT = 1287, - DETACH_RENDER_EFFECT = 1288, - IS_PET_USING_ABILITY = 1289, - SET_BLOCKING = 1290, - GET_BLOCKING = 1291, - UPDATE_BLOCKING = 1292, - CHECK_DAMAGE_RESULTS = 1293, - GET_OBJECT_IS_IN_RENDER_PIPE = 1294, - ATTACH_MOTION_FX_ARC = 1295, - PLAYER_REACHED_RESPAWN_CHECKPOINT = 1296, - GET_LAST_RESPAWN_CHECKPOINT = 1297, - GET_VEHICLE_DEBUG_COLLISIONS = 1298, - VISITING_PROPERTY = 1299, - HANDLE_UGC_POST_DELETE_BASED_ON_EDIT_MODE = 1300, - HANDLE_UGC_POST_CREATE_BASED_ON_EDIT_MODE = 1301, - WORLD_CHECK_RESPONSE = 1302, - ADD_DAMAGE_REDUCTION = 1303, - REMOVE_DAMAGE_REDUCTION = 1304, - PROPERTY_CONTENTS_FROM_CLIENT = 1305, - GET_MODELS_ON_PROPERTY = 1306, - IS_SHOWCASE_DISPLAY_PEDESTAL = 1307, - MATCH_REQUEST = 1308, - MATCH_RESPONSE = 1309, - MATCH_UPDATE = 1310, - IS_DEFAULT_SKILL_ACTIVE = 1311, - PROPERTY_EDITOR_CARRY = 1312, - GET_LOOT_OWNER_ID = 1313, - GET_ENEMY_LOOT_TAG = 1314, - GET_NUM_SPAWNED_BRICKS = 1315, - SET_ITEM_EQUIP_TRANSFORM = 1316, - GET_ITEM_EQUIP_TRANSFORM = 1317, - GET_PROPERTY_BUDGET_INFO = 1318, - CHATBOX_IS_INIT = 1319, - GET_SPAWNED_I_DS = 1320, - GET_IMMUNITY = 1321, - GET_GM_IMMUNITY = 1322, - PROCESS_REMOTE_SLASH_COMMAND = 1323, - IS_FRIEND_MSG = 1324, - RACING_PLAYER_EVENT = 1325, - GET_PROPERTY_EDIT_VALID = 1326, - REFRESH_RENDER_ASSET = 1327, - VEHICLE_APPLY_STAT_CHANGE = 1328, - ZONE_LOADED_INFO = 1329, - B3_INTERFACE_ACTION = 1330, - RACING_STAT_MODIFIERS_FROM_CLIENT = 1332, - GET_RACING_STAT_MODIFIERS = 1333, - SET_RACING_STAT_MODIFIERS = 1334, - GET_RACING_LICENSE_LEVEL = 1335, - ADD_EQUIP_CAST = 1336, - SHOW_BILLBOARD_INTERACT_ICON = 1337, - CHANGE_IDLE_FLAGS = 1338, - GET_ANIMATION_FLAG = 1339, - VEHICLE_ADD_PASSIVE_BOOST_ACTION = 1340, - VEHICLE_REMOVE_PASSIVE_BOOST_ACTION = 1341, - NOTIFY_SERVER_VEHICLE_ADD_PASSIVE_BOOST_ACTION = 1342, - NOTIFY_SERVER_VEHICLE_REMOVE_PASSIVE_BOOST_ACTION = 1343, - VEHICLE_ADD_SLOWDOWN_ACTION = 1344, - VEHICLE_REMOVE_SLOWDOWN_ACTION = 1345, - NOTIFY_SERVER_VEHICLE_ADD_SLOWDOWN_ACTION = 1346, - NOTIFY_SERVER_VEHICLE_REMOVE_SLOWDOWN_ACTION = 1347, - FORCE_UPDATE_ANIMATIONS = 1348, - MATCH_GET_DATA_FOR_PLAYER = 1349, - BUYBACK_FROM_VENDOR = 1350, - SET_INVENTORY_FILTER = 1351, - GET_INVENTORY_FILTER = 1352, - GET_INVENTORY_GROUPS = 1353, - GET_INVENTORY_GROUP = 1354, - UPDATE_INVENTORY_GROUP = 1355, - UPDATE_INVENTORY_UI = 1356, - UPDATE_INVENTORY_GROUP_CONTENTS = 1357, - CAN_REMOVE_ITEM_FROM_INVENTORY = 1362, - DRIVE_THIS_CAR = 1363, - VEHICLE_CAN_ADD_ACTIVE_BOOST = 1364, - VEHICLE_ADD_ACTIVE_BOOST = 1365, - SET_PROPERTY_ACCESS = 1366, - ZONE_PROPERTY_MODEL_PLACED = 1369, - ZONE_PROPERTY_MODEL_ROTATED = 1370, - ZONE_PROPERTY_MODEL_REMOVED_WHILE_EQUIPPED = 1371, - ZONE_PROPERTY_MODEL_EQUIPPED = 1372, - ZONE_PROPERTY_MODEL_PICKED_UP = 1373, - ZONE_PROPERTY_MODEL_REMOVED = 1374, - GET_VERSIONING_INFO = 1381, - OPEN_UG_BEHAVIOR_UI = 1382, - VEHICLE_NOTIFY_HIT_SMASHABLE = 1383, - GET_TETHER_RADIUS = 1384, - VEHICLE_NOTIFY_HIT_EXPLODER = 1385, - CHECK_NEAREST_ROCKET_LAUNCH_PRE_CONDITIONS = 1386, - REQUEST_NEAREST_ROCKET_LAUNCH_PRE_CONDITIONS = 1387, - CONFIGURE_RACING_CONTROL_CLIENT = 1389, - NOTIFY_RACING_CLIENT = 1390, - RACING_PLAYER_HACK_CAR = 1391, - RACING_PLAYER_LOADED = 1392, - RACING_CLIENT_READY = 1393, - POSSESSION_FINISHED_ATTACH = 1394, - UPDATE_CHAT_MODE = 1395, - VEHICLE_NOTIFY_FINISHED_RACE = 1396, - EQUIPPED_ITEM_STARTUP = 1397, - FACTION_TRIGGER_ITEM_EQUIPPED = 1400, - FACTION_TRIGGER_ITEM_UNEQUIPPED = 1401, - TOGGLE_PROPERTY_BEHAVIORS = 1402, - GET_UG_OBJECT_INFO = 1405, - RESET_PROPERTY_BEHAVIORS = 1406, - IS_PROPERTY_MODEL_RESET = 1407, - SET_UG_OBJECT_NAME_AND_DESCRIPTION = 1408, - SET_CONSUMABLE_ITEM = 1409, - VEHICLE_GET_CURRENT_LAP = 1410, - GET_UGID = 1411, - SET_UGID = 1412, - UGID_CHANGED = 1413, - RACING_GET_CURRENT_LAP_FOR_PLAYER = 1414, - SUB_ITEM_UN_EQUIPPED = 1415, - SET_CUSTOM_DROP_SHADOW_TEXTURE = 1416, - GET_PLAYER_KIT_FACTION = 1418, - USED_INFORMATION_PLAQUE = 1419, - RACING_ENABLE_WRONG_WAY_RESET = 1420, - RACING_TOGGLE_RUBBER_BANDING = 1421, - GET_RACING_CONTROL_DEBUG_INFO = 1422, - SET_PROPERTY_BOUNDS_VISIBILITY = 1423, - SET_PROPERTY_VENDOR_VISIBILITY = 1424, - SET_EQUIP_STATE = 1425, - NOTIFY_COMBAT_AI_STATE_CHANGE = 1426, - SET_PROPERTY_MODEL_INTERACTIVE = 1430, - SERVER_STATE_NOTIFY = 1431, - GET_SERVER_STATE = 1432, - GET_ICON_FOR_PROXIMITY = 1433, - GET_LEGO_CLUB_MEMBERSHIP_STATUS = 1434, - SET_STATUS_IMMUNITY = 1435, - GET_STATUS_IMMUNITY = 1436, - TEAM_IS_MEMBER = 1437, - ACTIVATE_BRICK_MODE = 1438, - GET_BUILD_OBJECT_ID = 1439, - SET_ANIMATION_ENABLED = 1444, - PAUSE_COOLDOWNS = 1446, - FORCE_UPDATE_RENDER_NODE = 1447, - SET_PET_NAME_MODERATED = 1448, - TOGGLE_STRAFE_MODE = 1449, - SET_SCHEME_SPEED_SCALE = 1450, - CANCEL_SKILL_CAST = 1451, - CHECK_PLAYER_ASSEMBLY_FOR_UNIQUE_MODULE_BY_LOT = 1454, - MODULE_ASSEMBLY_DB_DATA_TO_LUA = 1455, - IS_ALLY = 1458, - MODIFY_LEGO_SCORE = 1459, - GET_LEGO_SCORE = 1460, - GET_PLAYER_LEVEL = 1461, - NOTIFY_LEGO_SCORE_UPDATE = 1462, - SET_LEGO_SCORE = 1463, - UPDATE_BEHAVIOR_EXECUTION_DETAILS = 1466, - RESTORE_TO_POST_LOAD_STATS = 1468, - PICKUP_OBJECT_ERROR = 1469, - CHECK_AND_SHOW_INVENTORY_FULL_TIP = 1470, - SET_RAIL_MOVEMENT = 1471, - START_RAIL_MOVEMENT = 1472, - SET_UP_VECTOR = 1473, - CANCEL_RAIL_MOVEMENT = 1474, - GET_RAIL_INFO = 1475, - CLIENT_RAIL_MOVEMENT_READY = 1476, - PLAYER_RAIL_ARRIVED_NOTIFICATION = 1477, - NOTIFY_RAIL_ACTOVATOR_STATE_CHANGE = 1478, - REQUEST_RAIL_ACTIVATOR_STATE = 1479, - NOTIFY_REWARD_MAILED = 1480, - UPDATE_PLAYER_STATISTIC = 1481, - IS_IN_COMBAT = 1482, - IS_PRIMITIVE_MODEL_MSG = 1483, - SCALE_PRIMITICE_MODEL_MSG = 1484, - MODIFY_GHOSTING_DISTANCE = 1485, - PRIMITIVE_MODEL_CHANGED_MSG = 1487, - GET_PROPRTY_CLONE_ID = 1488, - REQUEST_LEAVE_PROPERTY = 1489, - REQUERY_PROPERTY_MODELS = 1491, - GET_BEHAVIOR_COUNT = 1492, - UPDATE_BEHAVIOR_CONTROLS = 1493, - MODULE_ASSEMBLY_LXFML_LOADED = 1494, - REQUEST_ASSEMBLED_LXFML = 1495, - ASSEMBLED_LXFML_LOADED = 1496, - GET_REORIENT_UP_VECTOR = 1497, - MODULAR_ASSEMBLY_NIF_COMPLETED = 1498, - CHARACTER_DISCONNECT_BEFORE_CREATE = 1499, - SEND_LAUNCH_TO_PREVIOUS_ZONE_TO_CLIENT = 1500, - ROCKETLAUNCH_REQUEST_DEFAULT_MAP_ID = 1501, - BEGIN_LAUNCH = 1502, - PROCESS_CLAIM_CODES = 1503, - GET_LAST_ZONE_ID = 1504, - ADD_RUN_SPEED_MODIFIER = 1505, - REMOVE_RUN_SPEED_MODIFIER = 1506, - SKILL_EVENT_FIRED = 1507, - SEND_HOT_PROPERTY_DATA = 1510, - GET_HOT_PROPERTY_DATA = 1511, - GET_EQUIPPED_ITEMS_IN_SET = 1512, - IS_ITEM_IN_SET = 1513, - GET_INVENTORY_TYPE_FOR_LOT = 1514, - GET_BANK_TYPE_FOR_LOT = 1515, - NOTIFY_NOT_ENOUGH_INV_SPACE = 1516, - IMPORT_MODEL_TO_BBB = 1517, - SEARCH_NEARBY_OBJECTS = 1518, - SEARCH_NEARBY_OBJECTS_REQUEST_BY_LOT = 1519, - REQUEST_OBJECT_POSITION_BY_ID = 1520, - SEARCH_NEARBY_OBJECTS_REQUEST_BY_COMPONENT = 1521, - SEARCH_NEARBY_OBJECTS_RESPONSE = 1522, - BROADCAST_NON_STANDARD_COLLISIONS = 1523, - GET_REGISTERED_NON_STANDARD_COLLISION_GROUP = 1524, - BROADCAST_CRUSHED_NOTIFICATIONS = 1525, - GET_REGISTERED_CRUSHED_COLLISION_GROUPS = 1526, - IS_BEING_CRUSHED = 1527, - GET_SUPPORTING_OBJECT = 1528, - TREAT_RIGID_BODY_COLLSIONS_AS_FIXED = 1529, - BROADCAST_TELEPORTED_WITHIN_NOTIFICATION = 1530, - GET_REGISTERED_TELEPORTED_WITHIN_OBJECT_GROUP = 1531, - GET_INTERPENTRATING_INFORMATION = 1532, - OBJECT_TELEPORTED_WITHIN = 1533, - SET_PHYSICS_SOLVER_PROPERTIES = 1534, - HAS_BEHAVIORS = 1535, - PLAY_BEHAVIOR_SOUND = 1536, - GET_PLAYER_BEHAVIOR_TIER = 1537, - GET_EMOTE_ANIMATION_TIME = 1538, - GET_CHARACTER_STAT_TRACKING = 1539, - PLAYER_INVENTORY_READY = 1540, - SET_PRECONDITIONS = 1541, - DETACH_SHADOW = 1542, - GET_LOOT_INFO = 1543, - GET_PLAYERS_ON_PROPERTY = 1544, - PROPERTY_SPAWN_BY_BEHAVIOR = 1545, - NOTIFY_PROPERTY_OF_EDIT_MODE = 1546, - UPDATE_PROPERTY_PERFORMANCE_COST = 1547, - GET_PROPERTY_PERFORMANCE_COST = 1548, - GET_INVENTORY_ITEM_WITH_SUBKEY = 1549, - DISPLAY_PROPERTY_SUMMARY_SCREEN = 1550, - VALIDATE_BBB_MODEL = 1551, - BBB_MODEL_VALIDATION = 1552, - PROPERTY_ENTRANCE_BEGIN = 1553, - CHECK_LIST_OF_PRECONDITIONS_FROM_LUA = 1554, - GET_PROPERTYIN_ZONE = 1555, - GET_ZONE_ID_FROM_MULTI_ZONE_ENTRANCE = 1556, - TEAM_SET_LEADER = 1557, - TEAM_INVITE_CONFIRM = 1558, - TEAM_GET_STATUS_RESPONSE = 1559, - MINI_GAME_ENABLE_LOCAL_TEAMS = 1560, - TEAM_INVITE_FINAL_RESPONSE = 1561, - TEAM_ADD_PLAYER = 1562, - TEAM_REMOVE_PLAYER = 1563, - TEAM_CREATE_LOCAL = 1564, - TEAM_GET_LOOT = 1565, - TEAM_SET_LOOT = 1566, - SET_ZERO_IMPULSE_AGAINST_COLLISION_GROUPS = 1567, - SET_CENTER_OF_MASS_TO_PHYSICAL_CENTER = 1568, - SET_INERTIA_INVERSE = 1569, - ADD_REMOVE_CLIMBING_LISTENER = 1570, - GET_INVENTORYITEM_DETAILS = 1571, - PERFORM_CLIENT_SIDE_DEATH = 1572, - LEGO_CLUB_ACCESS_RESULT = 1573, - VEHICLE_GET_IS_REVERSING = 1574, - CHECK_CLAIM_CODE = 1575, - GET_HOLIDAY_EVENT = 1576, - SET_EMOTES_ENABLED = 1577, - GET_EMOTES_ENABLED = 1578, - FREEZE_ANIMATION = 1579, - LOCALIZED_ANNOUNCEMENT_SERVER_TO_SINGLE_CLIENT = 1580, - ANCHOR_FX_NODE = 1581, - WS_GET_FRIEND_LIST_MESSAGE = 1582, - WS_ADD_FRIEND_RESPONSE = 1583, - WS_REMOVE_FRIEND_REPSONSE = 1584, - WS_UPDATE_FRIEND_STATUS = 1585, - WS_UPDATE_FRIEND_NAME = 1586, - IS_BEST_FRIEND = 1587, - TEAM_NOTIFY_UPDATE_MISSION_TASK = 1588, - VEHICLE_ADD_SLIPPERY_ACTION = 1589, - VEHICLE_REMOVE_SLIPPERY_ACTION = 1590, - SET_RESURRECT_RESTORE_VALUES = 1591, - GET_MASS = 1592, - SET_PROPERTY_MODERATION_STATUS = 1593, - UPDATE_PROPERTY_MODEL_DEFAULTS = 1594, - UPDATE_PROPERTYMODEL_COUNT = 1595, - GET_PROPERTY_MODEL_COUNT = 1596, - IS_PLAYER_LOADED = 1597, - ATTACH_RENDER_EFFECT_FROM_LUA = 1598, - DETACH_RENDER_EFFECT_FROM_LUA = 1599, - TEAM_IS_LOCAL = 1600, - CREATE_CAMERA_PARTICLES = 1602, - SET_SMASHABLE_GRAVITY_FACTOR = 1603, - VEHICLE_SET_SURFACE_TYPE_OVERRIDE = 1604, - VEHICLE_NOTIFY_HIT_IMAGINATION = 1605, - VEHICLE_NOTIFY_HIT_IMAGINATION_SERVER = 1606, - GET_SPAWNED_OBJECT_SPAWNER_INFO = 1607, - SAVE_PROPERTY = 1608, - SET_PROPERTY_DIRTY = 1609, - GET_PROPERTY_DIRTY = 1610, - GET_MODEL_LIST_FROM_PLAQUE = 1611, - GET_ORIGINAL_POSITION_AND_ROTATION = 1612, - VEHICLE_SET_MASS_FOR_COLLISION = 1613, - GET_INVENTORY_GROUP_COUNT = 1614, - GET_LATEST_CHAT_CHANNEL_USED = 1615, - SET_SUGGEST_LIST_LANGUAGE = 1616, - VEHICLE_STOP_BOOST = 1617, - START_CELEBRATION_EFFECT = 1618, - LOCK_PLAYER = 1619, - VEHICLE_IS_INPUT_LOCKED = 1620, - GET_MULTI_NODE = 1621, - RENEW_PROPERTY = 1622, - RENEW_PROPERTY_RESULT = 1623, - CHARGE_ACTIVITY_COST = 1624, - CAN_RECEIVE_LOOT = 1625, - JOIN_PLAYER_FACTION = 1626, - SET_PROXIMITY_UPDATE_RATE = 1627, - BBB_MODELS_TO_SAVE = 1628, - BELONGS_TO_FACTION = 1629, - MODIFY_FACTION = 1630, - FACTION_UPDATE = 1631, - CELEBRATION_COMPLETED = 1632, - PLAY_PRIMARY_MODULE_SOUNDS = 1633, - STOP_PRIMARY_MODULE_SOUNDS = 1634, - REQUEST_TEAM_PLAYER_UI_UPDATE = 1635, - SET_LOCAL_TEAM = 1636, - TEAM_GET_WORLD_MEMBERS_IN_RADIUS = 1637, - GET_PARENTAL_LEVEL = 1638, - GET_OBJECTS_MESSAGE_HANDLERS = 1639, - PROPERTY_FEATURED = 1640, - PROPERTY_NOTIFY_MODEL_SPAWNED = 1641, - SERVER_DONE_LOADING_ALL_OBJECTS = 1642, - GET_DONATION_TOTAL = 1643, - UPDATE_DONATION_VALUES = 1644, - DELAYED_DELETE_DROP_EFFECT_BRICK = 1645, - SET_CAMERA_UNLOCK_ROTATION_STATE = 1646, - ADD_BUFF = 1647, - REMOVE_BUFF = 1648, - CHECK_FOR_BUFF = 1649, - TEAM_MEMBERS_DISOWNS_LOOT = 1650, - GET_WHEEL_TEMPLATE = 1651, - ADD_SKILL_IN_PROGRESS = 1652, - REMOVE_SKILL_IN_PROGRESS = 1653, - SET_OVERHEAD_ICON_OFFSET = 1654, - SET_BILLBOARD_OFFSET = 1655, - SET_CHAT_BUBBLE_OFFSET = 1656, - SET_NO_TEAM_INVITES = 1657, - RESET_MODEL_TO_DEFAULTS = 1658, - IS_PROPERTY_IN_EDIT_MODE = 1659, - GET_OBJECTS_IN_PHYSICS_BOUNDS = 1660, - ENABLE_LU_REMOTE = 1661, - SET_IS_USING_FREE_TRIAL = 1662, - GET_IS_USING_FREE_TRIAL = 1663, - GET_ACCOUNT_FREE_TRIAL_MODE = 1664, - TOGGLE_INVENTORY_ITEM_LOCK = 1665, - REQUEST_MOVE_ITEM_BETWEEN_INVENTORY_TYPES = 1666, - RESPONSE_MOVE_ITEM_BETWEEN_INVENTORY_TYPES = 1667, - REMOVE_SUB_COMPONENT = 1668, - TEAM_GET_LOOT_MEMBERS = 1669, - GET_FACTION_TOKEN_TYPE = 1670, - GET_SUBSCRIPTION_PRICING = 1671, - INFORM_AFK = 1672, - OVERHEAD_INDICATOR_CREATED = 1673, - SET_OVERHEAD_INDICATOR_GRID_LOCATION = 1674, - PLAYSTREAM_LOAD_PENDING = 1675, - PLAYER_SET_CAMERA_CYCLING_MODE = 1676, - PLAYER_GET_CAMERA_CYCLING_MODE = 1677, - FORCE_CAMERA_TARGET_CYCLE = 1678, - GET_OBJECT_CONFIG_DATA = 1679, - GET_OBJECT_CONFIG_DATA_NON_CONST = 1680, - SCOPE_CHANGED = 1681, - SET_ALLOW_JUMP_WITHOUT_SUPPORT = 1682, - GET_ALLOW_JUMP_WITHOUT_SUPPORT = 1683, - SET_JUMP_HEIGHT_SCALE = 1684, - GET_JUMP_HEIGHT_SCALE = 1685, - SET_VELOCITY_RESISTANCE = 1686, - GET_VELOCITY_RESISTANCE = 1687, - GATE_RUSH_VEHICLE_HIT_GATE = 1688, - GATE_RUSH_PLAYER_COLLECTED_GATE = 1689, - GATE_RUSH_ADD_GATE = 1690, - GATE_RUSH_REMOVE_GATE = 1691, - NOTIFY_VEHICLE_UPDATED = 1692, - VEHICLE_NOTIFY_HIT_WEAPON_POWERUP = 1693, - VEHICLE_NOTIFY_HIT_WEAPON_POWERUP_SERVER = 1694, - LOCAL_PLAYER_TARGETED = 1696, - SKILL_COUNT_CHANGED = 1697, - DO_YAW_ROTATION = 1698, - DO_PITCH_ROTATION = 1699, - DO_ROLL_ROTATION = 1700, - GET_CURRENT_LOOT_MATRIX = 1701, - SEND_MULTI_MISSION_OFFER_UPDATE_I_DS = 1702, - SET_AIR_SPEED_VALUES = 1703, - USE_LAUNCHER = 1704, - START_LAUNCHER = 1705, - STOP_LAUNCHER = 1706, - CAN_USE_JET_PACK = 1707, - JET_PACK_STATE_CHANGED = 1708, - TURN_OFF_JET_PACK = 1709, - ADD_PLAYER_JET_PACK_PAD = 1710, - SET_JET_PACK_WARNING = 1711, - JET_PACK_DISABLED = 1712, - JET_PACK_PAD_ENTERED = 1713, - UPDATE_RENDER_POSSESSION_FLAG = 1714, - POSSESSABLE_GET_ATTACH_OFFSET = 1715, - ATTEMPT_TO_CRAFT_ITEM = 1718, - CRAFT_ATTEMPT_RESPONSE = 1719, - SET_C_SCORE = 1720, - FILL_IN_RENDERER = 1721, - TOGGLE_CRAFTING_WINDOW = 1722, - REMOVE_TEAM_BUFFS = 1724, - REQUEST_FREE_TRIAL_STATUS_REFRESH = 1725, - REMOVE_BUFFS_APPLIED_BY_OBJECT = 1726, - SET_MOUNT_INVENTORY_ID = 1727, - GET_MOUNT_INVENTORY_ID = 1728, - GET_BUILD_CINEMATIC_TIME_REMAINING = 1730, - JET_PACK_FLYING = 1731, - NOTIFY_SERVER_LEVEL_PROCESSING_COMPLETE = 1734, - NOTIFY_LEVEL_REWARDS = 1735, - CHARACTER_VERSION_CHANGED = 1736, - SET_FREE_TRIAL_RENAME_AVAILABLE = 1737, - SET_PROJECTILE_LAUNCHER_PARAMS = 1738, - RACE_PRECOUNTDOWN_DONE = 1739, - CHECK_INVITE_SPAMMING = 1740, - GET_RESPAWN_VOLUME_INFO = 1741, - INVITE_ACCEPTED = 1742, - TELEPORT_TO_NEAREST_RESPAWN = 1743, - SET_SKILL_CANCEL_ON_MOVE = 1744, - CANCEL_MOVE_SKILL = 1745, - SERVER_CANCEL_MOVE_SKILL = 1746, - CLIENT_CANCEL_MOVE_SKILL = 1747, - END_LAUNCH_SEQUENCE = 1748, - CANCEL_QUEUE = 1749, - UPDATE_PROJECTILE_LAUNCHER_ROTATION = 1750, - GET_CHARACTER_VERSION_INFO = 1751, - GET_CON_INFO = 1753, - GET_SKILLS_FOR_LOT = 1755, - DISMOUNT_COMPLETE = 1756, - MOUNT_FAILURE_RESPONSE = 1757, - CLEAR_BILLBOARD_OFFSET = 1758, - GET_INVENTORY_ITEM_ANIMATION_FLAG = 1759, - SET_JET_PACK_ALLOWED = 1760, - GET_BUILD_TIME_DETAILS = 1761, - USE_SKILL_SET = 1762, - SET_SKILL_SET_POSSESSOR = 1763, - POPULATE_ACTION_BAR = 1764, - GET_COMPONENT_TEMPLATE_ID = 1765, - GET_POSSESSABLE_SKILL_SET = 1766, - MARK_INVENTORY_ITEM_AS_ACTIVE = 1767, - UPDATE_FORGED_ITEM = 1768, - CAN_ITEMS_BE_REFORGED = 1769, - NOTIFY_CLIENT_RAIL_START_FAILED = 1771, - GET_IS_ON_RAIL = 1772 -}; - -template <> -struct magic_enum::customize::enum_range { - static constexpr int min = 0; - static constexpr int max = 1772; -}; - -#endif //!__EGAMEMESSAGETYPE__H__ diff --git a/dCommon/dEnums/eMasterMessageType.h b/dCommon/dEnums/eMasterMessageType.h deleted file mode 100644 index 5c867d70..00000000 --- a/dCommon/dEnums/eMasterMessageType.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef __EMASTERMESSAGETYPE__H__ -#define __EMASTERMESSAGETYPE__H__ - -#include - -enum class eMasterMessageType : uint32_t { - REQUEST_PERSISTENT_ID = 1, - REQUEST_PERSISTENT_ID_RESPONSE, - REQUEST_ZONE_TRANSFER, - REQUEST_ZONE_TRANSFER_RESPONSE, - SERVER_INFO, - REQUEST_SESSION_KEY, - SET_SESSION_KEY, - SESSION_KEY_RESPONSE, - PLAYER_ADDED, - PLAYER_REMOVED, - - CREATE_PRIVATE_ZONE, - REQUEST_PRIVATE_ZONE, - - WORLD_READY, - PREP_ZONE, - - SHUTDOWN, - SHUTDOWN_RESPONSE, - SHUTDOWN_IMMEDIATE, - - SHUTDOWN_UNIVERSE, - - AFFIRM_TRANSFER_REQUEST, - AFFIRM_TRANSFER_RESPONSE, - - NEW_SESSION_ALERT -}; - -#endif //!__EMASTERMESSAGETYPE__H__ diff --git a/dCommon/dEnums/ePropertySortType.h b/dCommon/dEnums/ePropertySortType.h new file mode 100644 index 00000000..f8e9b1cf --- /dev/null +++ b/dCommon/dEnums/ePropertySortType.h @@ -0,0 +1,11 @@ +#ifndef EPROPERTYSORTTYPE_H +#define EPROPERTYSORTTYPE_H + +enum ePropertySortType : int32_t { + SORT_TYPE_FRIENDS = 0, + SORT_TYPE_REPUTATION = 1, + SORT_TYPE_RECENT = 3, + SORT_TYPE_FEATURED = 5 +}; + +#endif //!EPROPERTYSORTTYPE_H diff --git a/dCommon/dEnums/eServerMessageType.h b/dCommon/dEnums/eServerMessageType.h deleted file mode 100644 index 7f211ffb..00000000 --- a/dCommon/dEnums/eServerMessageType.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef __ESERVERMESSAGETYPE__H__ -#define __ESERVERMESSAGETYPE__H__ - -#include -//! The Internal Server Packet Identifiers -enum class eServerMessageType : uint32_t { - VERSION_CONFIRM = 0, - DISCONNECT_NOTIFY, - GENERAL_NOTIFY -}; - -#endif //!__ESERVERMESSAGETYPE__H__ diff --git a/dCommon/dEnums/eWorldMessageType.h b/dCommon/dEnums/eWorldMessageType.h deleted file mode 100644 index 92081055..00000000 --- a/dCommon/dEnums/eWorldMessageType.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef __EWORLDMESSAGETYPE__H__ -#define __EWORLDMESSAGETYPE__H__ - -#include - -#include "magic_enum.hpp" - -enum class eWorldMessageType : uint32_t { - VALIDATION = 1, // Session info - CHARACTER_LIST_REQUEST, - CHARACTER_CREATE_REQUEST, - LOGIN_REQUEST, // Character selected - GAME_MSG, - CHARACTER_DELETE_REQUEST, - CHARACTER_RENAME_REQUEST, - HAPPY_FLOWER_MODE_NOTIFY, - SLASH_RELOAD_MAP, // Reload map cmp - SLASH_PUSH_MAP_REQUEST, // Push map req cmd - SLASH_PUSH_MAP, // Push map cmd - SLASH_PULL_MAP, // Pull map cmd - LOCK_MAP_REQUEST, - GENERAL_CHAT_MESSAGE, // General chat message - HTTP_MONITOR_INFO_REQUEST, - SLASH_DEBUG_SCRIPTS, // Debug scripts cmd - MODELS_CLEAR, - EXHIBIT_INSERT_MODEL, - LEVEL_LOAD_COMPLETE, // Character data request - TMP_GUILD_CREATE, - ROUTE_PACKET, // Social? - POSITION_UPDATE, - MAIL, - WORD_CHECK, // AllowList word check - STRING_CHECK, // AllowList string check - GET_PLAYERS_IN_ZONE, - REQUEST_UGC_MANIFEST_INFO, - BLUEPRINT_GET_ALL_DATA_REQUEST, - CANCEL_MAP_QUEUE, - HANDLE_FUNNESS, - FAKE_PRG_CSR_MESSAGE, - REQUEST_FREE_TRIAL_REFRESH, - GM_SET_FREE_TRIAL_STATUS, - UI_HELP_TOP_5 = 91 -}; - -template <> -struct magic_enum::customize::enum_range { - static constexpr int min = 0; - static constexpr int max = 91; -}; - -#endif //!__EWORLDMESSAGETYPE__H__ diff --git a/dDatabase/GameDatabase/CMakeLists.txt b/dDatabase/GameDatabase/CMakeLists.txt index 09ca7251..32fe414a 100644 --- a/dDatabase/GameDatabase/CMakeLists.txt +++ b/dDatabase/GameDatabase/CMakeLists.txt @@ -8,9 +8,15 @@ foreach(file ${DDATABSE_DATABSES_MYSQL_SOURCES}) set(DDATABASE_GAMEDATABASE_SOURCES ${DDATABASE_GAMEDATABASE_SOURCES} "MySQL/${file}") endforeach() +add_subdirectory(TestSQL) + +foreach(file ${DDATABSE_DATABSES_TEST_SQL_SOURCES}) + set(DDATABASE_GAMEDATABASE_SOURCES ${DDATABASE_GAMEDATABASE_SOURCES} "TestSQL/${file}") +endforeach() + add_library(dDatabaseGame STATIC ${DDATABASE_GAMEDATABASE_SOURCES}) target_include_directories(dDatabaseGame PUBLIC "." - "ITables" PRIVATE "MySQL" + "ITables" PRIVATE "MySQL" "TestSQL" "${PROJECT_SOURCE_DIR}/dCommon" "${PROJECT_SOURCE_DIR}/dCommon/dEnums" ) diff --git a/dDatabase/GameDatabase/Database.cpp b/dDatabase/GameDatabase/Database.cpp index cb4f989a..fef9ab39 100644 --- a/dDatabase/GameDatabase/Database.cpp +++ b/dDatabase/GameDatabase/Database.cpp @@ -38,3 +38,8 @@ void Database::Destroy(std::string source) { LOG("Trying to destroy database when it's not connected!"); } } + +void Database::_setDatabase(GameDatabase* const db) { + if (database) delete database; + database = db; +} diff --git a/dDatabase/GameDatabase/Database.h b/dDatabase/GameDatabase/Database.h index 3eb292d1..65b04722 100644 --- a/dDatabase/GameDatabase/Database.h +++ b/dDatabase/GameDatabase/Database.h @@ -9,4 +9,8 @@ namespace Database { void Connect(); GameDatabase* Get(); void Destroy(std::string source = ""); + + // Used for assigning a test database as the handler for database logic. + // Do not use in production code. + void _setDatabase(GameDatabase* const db); }; diff --git a/dDatabase/GameDatabase/ITables/IProperty.h b/dDatabase/GameDatabase/ITables/IProperty.h index 54994b51..f3437154 100644 --- a/dDatabase/GameDatabase/ITables/IProperty.h +++ b/dDatabase/GameDatabase/ITables/IProperty.h @@ -4,6 +4,8 @@ #include #include +enum ePropertySortType : int32_t; + class IProperty { public: struct Info { @@ -18,11 +20,33 @@ public: uint32_t lastUpdatedTime{}; uint32_t claimedTime{}; uint32_t reputation{}; + float performanceCost{}; + }; + + struct PropertyLookup { + uint32_t mapId{}; + std::string searchString; + ePropertySortType sortChoice{}; + uint32_t playerId{}; + uint32_t numResults{}; + uint32_t startIndex{}; + uint32_t playerSort{}; + }; + + struct PropertyEntranceResult { + int32_t totalEntriesMatchingQuery{}; + // The entries that match the query. This should only contain up to 12 entries. + std::vector entries; }; // Get the property info for the given property id. virtual std::optional GetPropertyInfo(const LWOMAPID mapId, const LWOCLONEID cloneId) = 0; + // Get the properties for the given property lookup params. + // This is expected to return a result set of up to 12 properties + // so as not to transfer too much data at once. + virtual std::optional GetProperties(const PropertyLookup& params) = 0; + // Update the property moderation info for the given property id. virtual void UpdatePropertyModerationInfo(const IProperty::Info& info) = 0; diff --git a/dDatabase/GameDatabase/MySQL/MySQLDatabase.h b/dDatabase/GameDatabase/MySQL/MySQLDatabase.h index a3019bea..f30e33ce 100644 --- a/dDatabase/GameDatabase/MySQL/MySQLDatabase.h +++ b/dDatabase/GameDatabase/MySQL/MySQLDatabase.h @@ -112,6 +112,7 @@ public: std::string GetBehavior(const int32_t behaviorId) override; void RemoveBehavior(const int32_t characterId) override; void UpdateAccountGmLevel(const uint32_t accountId, const eGameMasterLevel gmLevel) override; + std::optional GetProperties(const IProperty::PropertyLookup& params) override; private: // Generic query functions that can be used for any query. diff --git a/dDatabase/GameDatabase/MySQL/Tables/Property.cpp b/dDatabase/GameDatabase/MySQL/Tables/Property.cpp index 5d72a3b5..8aaf93c4 100644 --- a/dDatabase/GameDatabase/MySQL/Tables/Property.cpp +++ b/dDatabase/GameDatabase/MySQL/Tables/Property.cpp @@ -1,8 +1,140 @@ #include "MySQLDatabase.h" +#include "ePropertySortType.h" + +std::optional MySQLDatabase::GetProperties(const IProperty::PropertyLookup& params) { + std::optional result; + std::string query; + std::unique_ptr properties; + + if (params.sortChoice == SORT_TYPE_FEATURED || params.sortChoice == SORT_TYPE_FRIENDS) { + query = R"QUERY( + FROM properties as p + JOIN charinfo as ci + ON ci.prop_clone_id = p.clone_id + where p.zone_id = ? + AND ( + p.description LIKE ? + OR p.name LIKE ? + OR ci.name LIKE ? + ) + AND p.privacy_option >= ? + AND p.owner_id IN ( + SELECT fr.requested_player AS player FROM ( + SELECT CASE + WHEN player_id = ? THEN friend_id + WHEN friend_id = ? THEN player_id + END AS requested_player FROM friends + ) AS fr + JOIN charinfo AS ci ON ci.id = fr.requested_player + WHERE fr.requested_player IS NOT NULL AND fr.requested_player != ? + ) ORDER BY ci.name ASC + )QUERY"; + const auto completeQuery = "SELECT p.* " + query + " LIMIT ? OFFSET ?;"; + properties = ExecuteSelect( + completeQuery, + params.mapId, + "%" + params.searchString + "%", + "%" + params.searchString + "%", + "%" + params.searchString + "%", + params.playerSort, + params.playerId, + params.playerId, + params.playerId, + params.numResults, + params.startIndex + ); + const auto countQuery = "SELECT COUNT(*) as count" + query + ";"; + auto count = ExecuteSelect( + countQuery, + params.mapId, + "%" + params.searchString + "%", + "%" + params.searchString + "%", + "%" + params.searchString + "%", + params.playerSort, + params.playerId, + params.playerId, + params.playerId + ); + if (count->next()) { + result->totalEntriesMatchingQuery = count->getUInt("count"); + } + } else { + if (params.sortChoice == SORT_TYPE_REPUTATION) { + query = R"QUERY( + FROM properties as p + JOIN charinfo as ci + ON ci.prop_clone_id = p.clone_id + where p.zone_id = ? + AND ( + p.description LIKE ? + OR p.name LIKE ? + OR ci.name LIKE ? + ) + AND p.privacy_option >= ? + ORDER BY p.reputation DESC, p.last_updated DESC + )QUERY"; + } else { + query = R"QUERY( + FROM properties as p + JOIN charinfo as ci + ON ci.prop_clone_id = p.clone_id + where p.zone_id = ? + AND ( + p.description LIKE ? + OR p.name LIKE ? + OR ci.name LIKE ? + ) + AND p.privacy_option >= ? + ORDER BY p.last_updated DESC + )QUERY"; + } + const auto completeQuery = "SELECT p.* " + query + " LIMIT ? OFFSET ?;"; + properties = ExecuteSelect( + completeQuery, + params.mapId, + "%" + params.searchString + "%", + "%" + params.searchString + "%", + "%" + params.searchString + "%", + params.playerSort, + params.numResults, + params.startIndex + ); + const auto countQuery = "SELECT COUNT(*) as count" + query + ";"; + auto count = ExecuteSelect( + countQuery, + params.mapId, + "%" + params.searchString + "%", + "%" + params.searchString + "%", + "%" + params.searchString + "%", + params.playerSort + ); + if (count->next()) { + result->totalEntriesMatchingQuery = count->getUInt("count"); + } + } + + while (properties->next()) { + auto& entry = result->entries.emplace_back(); + entry.id = properties->getUInt64("id"); + entry.ownerId = properties->getUInt64("owner_id"); + entry.cloneId = properties->getUInt64("clone_id"); + entry.name = properties->getString("name").c_str(); + entry.description = properties->getString("description").c_str(); + entry.privacyOption = properties->getInt("privacy_option"); + entry.rejectionReason = properties->getString("rejection_reason").c_str(); + entry.lastUpdatedTime = properties->getUInt("last_updated"); + entry.claimedTime = properties->getUInt("time_claimed"); + entry.reputation = properties->getUInt("reputation"); + entry.modApproved = properties->getUInt("mod_approved"); + entry.performanceCost = properties->getFloat("performance_cost"); + } + + return result; +} std::optional MySQLDatabase::GetPropertyInfo(const LWOMAPID mapId, const LWOCLONEID cloneId) { auto propertyEntry = ExecuteSelect( - "SELECT id, owner_id, clone_id, name, description, privacy_option, rejection_reason, last_updated, time_claimed, reputation, mod_approved " + "SELECT id, owner_id, clone_id, name, description, privacy_option, rejection_reason, last_updated, time_claimed, reputation, mod_approved, performance_cost " "FROM properties WHERE zone_id = ? AND clone_id = ?;", mapId, cloneId); if (!propertyEntry->next()) { @@ -21,6 +153,7 @@ std::optional MySQLDatabase::GetPropertyInfo(const LWOMAPID map toReturn.claimedTime = propertyEntry->getUInt("time_claimed"); toReturn.reputation = propertyEntry->getUInt("reputation"); toReturn.modApproved = propertyEntry->getUInt("mod_approved"); + toReturn.performanceCost = propertyEntry->getFloat("performance_cost"); return toReturn; } diff --git a/dDatabase/GameDatabase/TestSQL/CMakeLists.txt b/dDatabase/GameDatabase/TestSQL/CMakeLists.txt new file mode 100644 index 00000000..cf07f419 --- /dev/null +++ b/dDatabase/GameDatabase/TestSQL/CMakeLists.txt @@ -0,0 +1,4 @@ +SET(DDATABSE_DATABSES_TEST_SQL_SOURCES + "TestSQLDatabase.cpp" + PARENT_SCOPE +) diff --git a/dDatabase/GameDatabase/TestSQL/TestSQLDatabase.cpp b/dDatabase/GameDatabase/TestSQL/TestSQLDatabase.cpp new file mode 100644 index 00000000..e44cd1f7 --- /dev/null +++ b/dDatabase/GameDatabase/TestSQL/TestSQLDatabase.cpp @@ -0,0 +1,306 @@ +#include "TestSQLDatabase.h" + +void TestSQLDatabase::Connect() { + +} + +void TestSQLDatabase::Destroy(std::string source) { + +} + +sql::PreparedStatement* TestSQLDatabase::CreatePreppedStmt(const std::string& query) { + return nullptr; +} + +void TestSQLDatabase::Commit() { + +} + +bool TestSQLDatabase::GetAutoCommit() { + return {}; +} + +void TestSQLDatabase::SetAutoCommit(bool value) { + +} + +void TestSQLDatabase::ExecuteCustomQuery(const std::string_view query) { + +} + +std::optional TestSQLDatabase::GetMasterInfo() { + return {}; +} + +std::vector TestSQLDatabase::GetApprovedCharacterNames() { + return {}; +} + +std::vector TestSQLDatabase::GetFriendsList(uint32_t charID) { + return {}; +} + +std::optional TestSQLDatabase::GetBestFriendStatus(const uint32_t playerCharacterId, const uint32_t friendCharacterId) { + return {}; +} + +void TestSQLDatabase::SetBestFriendStatus(const uint32_t playerAccountId, const uint32_t friendAccountId, const uint32_t bestFriendStatus) { + +} + +void TestSQLDatabase::AddFriend(const uint32_t playerAccountId, const uint32_t friendAccountId) { + +} + +void TestSQLDatabase::RemoveFriend(const uint32_t playerAccountId, const uint32_t friendAccountId) { + +} + +void TestSQLDatabase::UpdateActivityLog(const uint32_t characterId, const eActivityType activityType, const LWOMAPID mapId) { + +} + +void TestSQLDatabase::DeleteUgcModelData(const LWOOBJID& modelId) { + +} + +void TestSQLDatabase::UpdateUgcModelData(const LWOOBJID& modelId, std::istringstream& lxfml) { + +} + +std::vector TestSQLDatabase::GetAllUgcModels() { + return {}; +} + +void TestSQLDatabase::CreateMigrationHistoryTable() { + +} + +bool TestSQLDatabase::IsMigrationRun(const std::string_view str) { + return {}; +} + +void TestSQLDatabase::InsertMigration(const std::string_view str) { + +} + +std::optional TestSQLDatabase::GetCharacterInfo(const uint32_t charId) { + return {}; +} + +std::optional TestSQLDatabase::GetCharacterInfo(const std::string_view charId) { + return {}; +} + +std::string TestSQLDatabase::GetCharacterXml(const uint32_t accountId) { + return {}; +} + +void TestSQLDatabase::UpdateCharacterXml(const uint32_t characterId, const std::string_view lxfml) { + +} + +std::optional TestSQLDatabase::GetAccountInfo(const std::string_view username) { + return {}; +} + +void TestSQLDatabase::InsertNewCharacter(const ICharInfo::Info info) { + +} + +void TestSQLDatabase::InsertCharacterXml(const uint32_t accountId, const std::string_view lxfml) { + +} + +std::vector TestSQLDatabase::GetAccountCharacterIds(uint32_t accountId) { + return {}; +} + +void TestSQLDatabase::DeleteCharacter(const uint32_t characterId) { + +} + +void TestSQLDatabase::SetCharacterName(const uint32_t characterId, const std::string_view name) { + +} + +void TestSQLDatabase::SetPendingCharacterName(const uint32_t characterId, const std::string_view name) { + +} + +void TestSQLDatabase::UpdateLastLoggedInCharacter(const uint32_t characterId) { + +} + +void TestSQLDatabase::SetPetNameModerationStatus(const LWOOBJID& petId, const IPetNames::Info& info) { + +} + +std::optional TestSQLDatabase::GetPetNameInfo(const LWOOBJID& petId) { + return {}; +} + +std::optional TestSQLDatabase::GetPropertyInfo(const LWOMAPID mapId, const LWOCLONEID cloneId) { + return {}; +} + +void TestSQLDatabase::UpdatePropertyModerationInfo(const IProperty::Info& info) { + +} + +void TestSQLDatabase::UpdatePropertyDetails(const IProperty::Info& info) { + +} + +void TestSQLDatabase::InsertNewProperty(const IProperty::Info& info, const uint32_t templateId, const LWOZONEID& zoneId) { + +} + +std::vector TestSQLDatabase::GetPropertyModels(const LWOOBJID& propertyId) { + return {}; +} + +void TestSQLDatabase::RemoveUnreferencedUgcModels() { + +} + +void TestSQLDatabase::InsertNewPropertyModel(const LWOOBJID& propertyId, const IPropertyContents::Model& model, const std::string_view name) { + +} + +void TestSQLDatabase::UpdateModel(const LWOOBJID& propertyId, const NiPoint3& position, const NiQuaternion& rotation, const std::array, 5>& behaviors) { + +} + +void TestSQLDatabase::RemoveModel(const LWOOBJID& modelId) { + +} + +void TestSQLDatabase::UpdatePerformanceCost(const LWOZONEID& zoneId, const float performanceCost) { + +} + +void TestSQLDatabase::InsertNewBugReport(const IBugReports::Info& info) { + +} + +void TestSQLDatabase::InsertCheatDetection(const IPlayerCheatDetections::Info& info) { + +} + +void TestSQLDatabase::InsertNewMail(const IMail::MailInfo& mail) { + +} + +void TestSQLDatabase::InsertNewUgcModel(std::istringstream& sd0Data, const uint32_t blueprintId, const uint32_t accountId, const uint32_t characterId) { + +} + +std::vector TestSQLDatabase::GetMailForPlayer(const uint32_t characterId, const uint32_t numberOfMail) { + return {}; +} + +std::optional TestSQLDatabase::GetMail(const uint64_t mailId) { + return {}; +} + +uint32_t TestSQLDatabase::GetUnreadMailCount(const uint32_t characterId) { + return {}; +} + +void TestSQLDatabase::MarkMailRead(const uint64_t mailId) { + +} + +void TestSQLDatabase::DeleteMail(const uint64_t mailId) { + +} + +void TestSQLDatabase::ClaimMailItem(const uint64_t mailId) { + +} + +void TestSQLDatabase::InsertSlashCommandUsage(const uint32_t characterId, const std::string_view command) { + +} + +void TestSQLDatabase::UpdateAccountUnmuteTime(const uint32_t accountId, const uint64_t timeToUnmute) { + +} + +void TestSQLDatabase::UpdateAccountBan(const uint32_t accountId, const bool banned) { + +} + +void TestSQLDatabase::UpdateAccountPassword(const uint32_t accountId, const std::string_view bcryptpassword) { + +} + +void TestSQLDatabase::InsertNewAccount(const std::string_view username, const std::string_view bcryptpassword) { + +} + +void TestSQLDatabase::SetMasterIp(const std::string_view ip, const uint32_t port) { + +} + +std::optional TestSQLDatabase::GetCurrentPersistentId() { + return {}; +} + +void TestSQLDatabase::InsertDefaultPersistentId() { + +} + +void TestSQLDatabase::UpdatePersistentId(const uint32_t id) { + +} + +std::optional TestSQLDatabase::GetDonationTotal(const uint32_t activityId) { + return {}; +} + +std::optional TestSQLDatabase::IsPlaykeyActive(const int32_t playkeyId) { + return {}; +} + +std::vector TestSQLDatabase::GetUgcModels(const LWOOBJID& propertyId) { + return {}; +} + +void TestSQLDatabase::AddIgnore(const uint32_t playerId, const uint32_t ignoredPlayerId) { + +} + +void TestSQLDatabase::RemoveIgnore(const uint32_t playerId, const uint32_t ignoredPlayerId) { + +} + +std::vector TestSQLDatabase::GetIgnoreList(const uint32_t playerId) { + return {}; +} + +void TestSQLDatabase::InsertRewardCode(const uint32_t account_id, const uint32_t reward_code) { + +} + +std::vector TestSQLDatabase::GetRewardCodesByAccountID(const uint32_t account_id) { + return {}; +} + +void TestSQLDatabase::AddBehavior(const IBehaviors::Info& info) { + +} + +std::string TestSQLDatabase::GetBehavior(const int32_t behaviorId) { + return {}; +} + +void TestSQLDatabase::RemoveBehavior(const int32_t behaviorId) { + +} + +void TestSQLDatabase::UpdateAccountGmLevel(const uint32_t accountId, const eGameMasterLevel gmLevel) { + +} + diff --git a/dDatabase/GameDatabase/TestSQL/TestSQLDatabase.h b/dDatabase/GameDatabase/TestSQL/TestSQLDatabase.h new file mode 100644 index 00000000..1fbb1845 --- /dev/null +++ b/dDatabase/GameDatabase/TestSQL/TestSQLDatabase.h @@ -0,0 +1,96 @@ +#ifndef TESTSQLDATABASE_H +#define TESTSQLDATABASE_H + +#include "GameDatabase.h" + +class TestSQLDatabase : public GameDatabase { + void Connect() override; + void Destroy(std::string source = "") override; + + sql::PreparedStatement* CreatePreppedStmt(const std::string& query) override; + void Commit() override; + bool GetAutoCommit() override; + void SetAutoCommit(bool value) override; + void ExecuteCustomQuery(const std::string_view query) override; + + // Overloaded queries + std::optional GetMasterInfo() override; + + std::vector GetApprovedCharacterNames() override; + + std::vector GetFriendsList(uint32_t charID) override; + + std::optional GetBestFriendStatus(const uint32_t playerCharacterId, const uint32_t friendCharacterId) override; + void SetBestFriendStatus(const uint32_t playerAccountId, const uint32_t friendAccountId, const uint32_t bestFriendStatus) override; + void AddFriend(const uint32_t playerAccountId, const uint32_t friendAccountId) override; + void RemoveFriend(const uint32_t playerAccountId, const uint32_t friendAccountId) override; + void UpdateActivityLog(const uint32_t characterId, const eActivityType activityType, const LWOMAPID mapId) override; + void DeleteUgcModelData(const LWOOBJID& modelId) override; + void UpdateUgcModelData(const LWOOBJID& modelId, std::istringstream& lxfml) override; + std::vector GetAllUgcModels() override; + void CreateMigrationHistoryTable() override; + bool IsMigrationRun(const std::string_view str) override; + void InsertMigration(const std::string_view str) override; + std::optional GetCharacterInfo(const uint32_t charId) override; + std::optional GetCharacterInfo(const std::string_view charId) override; + std::string GetCharacterXml(const uint32_t accountId) override; + void UpdateCharacterXml(const uint32_t characterId, const std::string_view lxfml) override; + std::optional GetAccountInfo(const std::string_view username) override; + void InsertNewCharacter(const ICharInfo::Info info) override; + void InsertCharacterXml(const uint32_t accountId, const std::string_view lxfml) override; + std::vector GetAccountCharacterIds(uint32_t accountId) override; + void DeleteCharacter(const uint32_t characterId) override; + void SetCharacterName(const uint32_t characterId, const std::string_view name) override; + void SetPendingCharacterName(const uint32_t characterId, const std::string_view name) override; + void UpdateLastLoggedInCharacter(const uint32_t characterId) override; + void SetPetNameModerationStatus(const LWOOBJID& petId, const IPetNames::Info& info) override; + std::optional GetPetNameInfo(const LWOOBJID& petId) override; + std::optional GetPropertyInfo(const LWOMAPID mapId, const LWOCLONEID cloneId) override; + void UpdatePropertyModerationInfo(const IProperty::Info& info) override; + void UpdatePropertyDetails(const IProperty::Info& info) override; + void InsertNewProperty(const IProperty::Info& info, const uint32_t templateId, const LWOZONEID& zoneId) override; + std::vector GetPropertyModels(const LWOOBJID& propertyId) override; + void RemoveUnreferencedUgcModels() override; + void InsertNewPropertyModel(const LWOOBJID& propertyId, const IPropertyContents::Model& model, const std::string_view name) override; + void UpdateModel(const LWOOBJID& propertyId, const NiPoint3& position, const NiQuaternion& rotation, const std::array, 5>& behaviors) override; + void RemoveModel(const LWOOBJID& modelId) override; + void UpdatePerformanceCost(const LWOZONEID& zoneId, const float performanceCost) override; + void InsertNewBugReport(const IBugReports::Info& info) override; + void InsertCheatDetection(const IPlayerCheatDetections::Info& info) override; + void InsertNewMail(const IMail::MailInfo& mail) override; + void InsertNewUgcModel( + std::istringstream& sd0Data, + const uint32_t blueprintId, + const uint32_t accountId, + const uint32_t characterId) override; + std::vector GetMailForPlayer(const uint32_t characterId, const uint32_t numberOfMail) override; + std::optional GetMail(const uint64_t mailId) override; + uint32_t GetUnreadMailCount(const uint32_t characterId) override; + void MarkMailRead(const uint64_t mailId) override; + void DeleteMail(const uint64_t mailId) override; + void ClaimMailItem(const uint64_t mailId) override; + void InsertSlashCommandUsage(const uint32_t characterId, const std::string_view command) override; + void UpdateAccountUnmuteTime(const uint32_t accountId, const uint64_t timeToUnmute) override; + void UpdateAccountBan(const uint32_t accountId, const bool banned) override; + void UpdateAccountPassword(const uint32_t accountId, const std::string_view bcryptpassword) override; + void InsertNewAccount(const std::string_view username, const std::string_view bcryptpassword) override; + void SetMasterIp(const std::string_view ip, const uint32_t port) override; + std::optional GetCurrentPersistentId() override; + void InsertDefaultPersistentId() override; + void UpdatePersistentId(const uint32_t id) override; + std::optional GetDonationTotal(const uint32_t activityId) override; + std::optional IsPlaykeyActive(const int32_t playkeyId) override; + std::vector GetUgcModels(const LWOOBJID& propertyId) override; + void AddIgnore(const uint32_t playerId, const uint32_t ignoredPlayerId) override; + void RemoveIgnore(const uint32_t playerId, const uint32_t ignoredPlayerId) override; + std::vector GetIgnoreList(const uint32_t playerId) override; + void InsertRewardCode(const uint32_t account_id, const uint32_t reward_code) override; + std::vector GetRewardCodesByAccountID(const uint32_t account_id) override; + void AddBehavior(const IBehaviors::Info& info) override; + std::string GetBehavior(const int32_t behaviorId) override; + void RemoveBehavior(const int32_t behaviorId) override; + void UpdateAccountGmLevel(const uint32_t accountId, const eGameMasterLevel gmLevel) override; + std::optional GetProperties(const IProperty::PropertyLookup& params) override { return {}; }; +}; + +#endif //!TESTSQLDATABASE_H diff --git a/dGame/Character.cpp b/dGame/Character.cpp index 57a951d9..2e62dae8 100644 --- a/dGame/Character.cpp +++ b/dGame/Character.cpp @@ -40,8 +40,8 @@ void Character::UpdateInfoFromDatabase() { auto charInfo = Database::Get()->GetCharacterInfo(m_ID); if (charInfo) { - m_Name = charInfo->name; - m_UnapprovedName = charInfo->pendingName; + m_Name = charInfo->name; + m_UnapprovedName = charInfo->pendingName; m_NameRejected = charInfo->needsRename; m_PropertyCloneID = charInfo->cloneId; m_PermissionMap = charInfo->permissionMap; @@ -76,7 +76,7 @@ void Character::DoQuickXMLDataParse() { if (m_Doc.Parse(m_XMLData.c_str(), m_XMLData.size()) == 0) { LOG("Loaded xmlData for character %s (%i)!", m_Name.c_str(), m_ID); } else { - LOG("Failed to load xmlData!"); + LOG("Failed to load xmlData (%i) (%s) (%s)!", m_Doc.ErrorID(), m_Doc.ErrorIDToName(m_Doc.ErrorID()), m_Doc.ErrorStr()); //Server::rakServer->CloseConnection(m_ParentUser->GetSystemAddress(), true); return; } diff --git a/dGame/Character.h b/dGame/Character.h index 7a83325b..0f41c634 100644 --- a/dGame/Character.h +++ b/dGame/Character.h @@ -38,6 +38,7 @@ public: const std::string& GetXMLData() const { return m_XMLData; } const tinyxml2::XMLDocument& GetXMLDoc() const { return m_Doc; } + void _setXmlDoc(tinyxml2::XMLDocument& doc) { doc.DeepCopy(&m_Doc); } /** * Out of abundance of safety and clarity of what this saves, this is its own function. @@ -459,6 +460,10 @@ public: User* GetParentUser() const { return m_ParentUser; } + void _doQuickXMLDataParse() { DoQuickXMLDataParse(); } + + void _setXmlData(const std::string& xmlData) { m_XMLData = xmlData; } + private: void UpdateInfoFromDatabase(); /** diff --git a/dGame/Entity.cpp b/dGame/Entity.cpp index 6699c595..54629888 100644 --- a/dGame/Entity.cpp +++ b/dGame/Entity.cpp @@ -24,7 +24,7 @@ #include "eTriggerEventType.h" #include "eObjectBits.h" #include "PositionUpdate.h" -#include "eChatMessageType.h" +#include "MessageType/Chat.h" #include "PlayerManager.h" //Component includes: @@ -96,6 +96,8 @@ #include "CDSkillBehaviorTable.h" #include "CDZoneTableTable.h" +Observable Entity::OnPlayerPositionUpdate; + Entity::Entity(const LWOOBJID& objectID, EntityInfo info, User* parentUser, Entity* parentEntity) { m_ObjectID = objectID; m_TemplateID = info.lot; @@ -881,7 +883,7 @@ void Entity::SetGMLevel(eGameMasterLevel value) { // Update the chat server of our GM Level { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::GMLEVEL_UPDATE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::GMLEVEL_UPDATE); bitStream.Write(m_ObjectID); bitStream.Write(m_GMLevel); @@ -1349,11 +1351,6 @@ void Entity::OnCollisionPhantom(const LWOOBJID otherEntity) { callback(other); } - SwitchComponent* switchComp = GetComponent(); - if (switchComp) { - switchComp->EntityEnter(other); - } - TriggerEvent(eTriggerEventType::ENTER, other); // POI system @@ -2133,6 +2130,8 @@ void Entity::ProcessPositionUpdate(PositionUpdate& update) { Game::entityManager->QueueGhostUpdate(GetObjectID()); if (updateChar) Game::entityManager->SerializeEntity(this); + + OnPlayerPositionUpdate.Notify(this, update); } const SystemAddress& Entity::GetSystemAddress() const { diff --git a/dGame/Entity.h b/dGame/Entity.h index ffdcb713..5d2b9527 100644 --- a/dGame/Entity.h +++ b/dGame/Entity.h @@ -11,6 +11,7 @@ #include "NiQuaternion.h" #include "LDFFormat.h" #include "eKillType.h" +#include "Observable.h" namespace Loot { class Info; @@ -299,6 +300,11 @@ public: // Scale will only be communicated to the client when the construction packet is sent void SetScale(const float scale) { m_Scale = scale; }; + /** + * @brief The observable for player entity position updates. + */ + static Observable OnPlayerPositionUpdate; + protected: LWOOBJID m_ObjectID; diff --git a/dGame/User.h b/dGame/User.h index 54e6ad52..662842a8 100644 --- a/dGame/User.h +++ b/dGame/User.h @@ -25,7 +25,7 @@ public: User& operator=(const User& other); bool operator==(const User& other) const; - uint32_t GetAccountID() { return m_AccountID; } + uint32_t GetAccountID() const noexcept { return m_AccountID; } std::string& GetUsername() { return m_Username; } std::string& GetSessionKey() { return m_SessionKey; } SystemAddress& GetSystemAddress() { return m_SystemAddress; } diff --git a/dGame/UserManager.cpp b/dGame/UserManager.cpp index 8579d882..e0e37e7c 100644 --- a/dGame/UserManager.cpp +++ b/dGame/UserManager.cpp @@ -26,7 +26,7 @@ #include "eCharacterCreationResponse.h" #include "eRenameResponse.h" #include "eConnectionType.h" -#include "eChatMessageType.h" +#include "MessageType/Chat.h" #include "BitStreamUtils.h" #include "CheatDetection.h" @@ -216,7 +216,7 @@ void UserManager::RequestCharacterList(const SystemAddress& sysAddr) { } RakNet::BitStream bitStream; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::CHARACTER_LIST_RESPONSE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::CHARACTER_LIST_RESPONSE); std::vector characters = u->GetCharacters(); bitStream.Write(characters.size()); @@ -266,7 +266,7 @@ void UserManager::RequestCharacterList(const SystemAddress& sysAddr) { void UserManager::CreateCharacter(const SystemAddress& sysAddr, Packet* packet) { User* u = GetUser(sysAddr); if (!u) return; - + LUWString LUWStringName; uint32_t firstNameIndex; uint32_t middleNameIndex; @@ -422,7 +422,7 @@ void UserManager::DeleteCharacter(const SystemAddress& sysAddr, Packet* packet) Database::Get()->DeleteCharacter(charID); CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::UNEXPECTED_DISCONNECT); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::UNEXPECTED_DISCONNECT); bitStream.Write(objectID); Game::chatServer->Send(&bitStream, SYSTEM_PRIORITY, RELIABLE, 0, Game::chatSysAddr, false); @@ -439,7 +439,7 @@ void UserManager::RenameCharacter(const SystemAddress& sysAddr, Packet* packet) CINSTREAM_SKIP_HEADER; LWOOBJID objectID; - inStream.Read(objectID); + inStream.Read(objectID); GeneralUtils::ClearBit(objectID, eObjectBits::CHARACTER); GeneralUtils::ClearBit(objectID, eObjectBits::PERSISTENT); diff --git a/dGame/dBehaviors/BehaviorContext.cpp b/dGame/dBehaviors/BehaviorContext.cpp index 95c4c84c..452df3ad 100644 --- a/dGame/dBehaviors/BehaviorContext.cpp +++ b/dGame/dBehaviors/BehaviorContext.cpp @@ -212,7 +212,7 @@ void BehaviorContext::UpdatePlayerSyncs(float deltaTime) { echo.sBitStream.assign(reinterpret_cast(bitStream.GetData()), bitStream.GetNumberOfBytesUsed()); RakNet::BitStream message; - BitStreamUtils::WriteHeader(message, eConnectionType::CLIENT, eClientMessageType::GAME_MSG); + BitStreamUtils::WriteHeader(message, eConnectionType::CLIENT, MessageType::Client::GAME_MSG); message.Write(this->originator); echo.Serialize(message); @@ -285,7 +285,7 @@ bool BehaviorContext::CalculateUpdate(const float deltaTime) { // Write message RakNet::BitStream message; - BitStreamUtils::WriteHeader(message, eConnectionType::CLIENT, eClientMessageType::GAME_MSG); + BitStreamUtils::WriteHeader(message, eConnectionType::CLIENT, MessageType::Client::GAME_MSG); message.Write(this->originator); echo.Serialize(message); diff --git a/dGame/dBehaviors/ChangeIdleFlagsBehavior.h b/dGame/dBehaviors/ChangeIdleFlagsBehavior.h index e40af3cc..cf2d7f01 100644 --- a/dGame/dBehaviors/ChangeIdleFlagsBehavior.h +++ b/dGame/dBehaviors/ChangeIdleFlagsBehavior.h @@ -1,7 +1,7 @@ #pragma once #include "Behavior.h" -#include "eAninmationFlags.h" +#include "eAnimationFlags.h" class ChangeIdleFlagsBehavior final : public Behavior { public: diff --git a/dGame/dComponents/ActivityComponent.cpp b/dGame/dComponents/ActivityComponent.cpp index 1b2fc338..54c7101b 100644 --- a/dGame/dComponents/ActivityComponent.cpp +++ b/dGame/dComponents/ActivityComponent.cpp @@ -21,7 +21,7 @@ #include "eMissionTaskType.h" #include "eMatchUpdate.h" #include "eConnectionType.h" -#include "eChatMessageType.h" +#include "MessageType/Chat.h" #include "CDCurrencyTableTable.h" #include "CDActivityRewardsTable.h" @@ -501,7 +501,7 @@ void ActivityInstance::StartZone() { // only make a team if we have more than one participant if (participants.size() > 1) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::CREATE_TEAM); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::CREATE_TEAM); bitStream.Write(leader->GetObjectID()); bitStream.Write(m_Participants.size()); diff --git a/dGame/dComponents/CharacterComponent.h b/dGame/dComponents/CharacterComponent.h index 7e63b0bd..c8cfa988 100644 --- a/dGame/dComponents/CharacterComponent.h +++ b/dGame/dComponents/CharacterComponent.h @@ -25,6 +25,8 @@ struct ZoneStatistics { uint64_t m_CoinsCollected; uint64_t m_EnemiesSmashed; uint64_t m_QuickBuildsCompleted; + + bool operator==(const ZoneStatistics& rhs) const = default; }; /** @@ -279,9 +281,9 @@ public: */ void UpdateClientMinimap(bool showFaction, std::string ventureVisionType) const; - void SetCurrentInteracting(LWOOBJID objectID) {m_CurrentInteracting = objectID;}; + void SetCurrentInteracting(LWOOBJID objectID) { m_CurrentInteracting = objectID; }; - LWOOBJID GetCurrentInteracting() {return m_CurrentInteracting;}; + LWOOBJID GetCurrentInteracting() { return m_CurrentInteracting; }; /** * Sends a player to another zone with an optional clone ID @@ -307,6 +309,14 @@ public: void SetDroppedCoins(const uint64_t value) { m_DroppedCoins = value; }; + const std::array& GetClaimCodes() const { return m_ClaimCodes; }; + + const std::map& GetZoneStatistics() const { return m_ZoneStatistics; }; + + const std::u16string& GetLastRocketConfig() const { return m_LastRocketConfig; }; + + uint64_t GetTotalTimePlayed() const { return m_TotalTimePlayed; }; + /** * Character info regarding this character, including clothing styles, etc. */ diff --git a/dGame/dComponents/DestroyableComponent.cpp b/dGame/dComponents/DestroyableComponent.cpp index 8ec1e4c9..cb8afd5a 100644 --- a/dGame/dComponents/DestroyableComponent.cpp +++ b/dGame/dComponents/DestroyableComponent.cpp @@ -38,6 +38,9 @@ #include "CDComponentsRegistryTable.h" +Implementation DestroyableComponent::IsEnemyImplentation; +Implementation DestroyableComponent::IsFriendImplentation; + DestroyableComponent::DestroyableComponent(Entity* parent) : Component(parent) { m_iArmor = 0; m_fMaxArmor = 0.0f; @@ -418,6 +421,7 @@ void DestroyableComponent::AddFaction(const int32_t factionID, const bool ignore } bool DestroyableComponent::IsEnemy(const Entity* other) const { + if (IsEnemyImplentation.ExecuteWithDefault(other, false)) return true; if (m_Parent->IsPlayer() && other->IsPlayer()) { auto* thisCharacterComponent = m_Parent->GetComponent(); if (!thisCharacterComponent) return false; @@ -440,6 +444,7 @@ bool DestroyableComponent::IsEnemy(const Entity* other) const { } bool DestroyableComponent::IsFriend(const Entity* other) const { + if (IsFriendImplentation.ExecuteWithDefault(other, false)) return true; const auto* otherDestroyableComponent = other->GetComponent(); if (otherDestroyableComponent != nullptr) { for (const auto enemyFaction : m_EnemyFactionIDs) { diff --git a/dGame/dComponents/DestroyableComponent.h b/dGame/dComponents/DestroyableComponent.h index 56f30103..8b3cd14c 100644 --- a/dGame/dComponents/DestroyableComponent.h +++ b/dGame/dComponents/DestroyableComponent.h @@ -7,6 +7,7 @@ #include "Entity.h" #include "Component.h" #include "eReplicaComponentType.h" +#include "Implementation.h" namespace CppScripts { class Script; @@ -463,6 +464,9 @@ public: // handle hardcode mode drops void DoHardcoreModeDrops(const LWOOBJID source); + static Implementation IsEnemyImplentation; + static Implementation IsFriendImplentation; + private: /** * Whether or not the health should be serialized diff --git a/dGame/dComponents/ModelComponent.cpp b/dGame/dComponents/ModelComponent.cpp index 91680987..3a273c9b 100644 --- a/dGame/dComponents/ModelComponent.cpp +++ b/dGame/dComponents/ModelComponent.cpp @@ -7,6 +7,7 @@ #include "BehaviorStates.h" #include "ControlBehaviorMsgs.h" #include "tinyxml2.h" +#include "SimplePhysicsComponent.h" #include "Database.h" @@ -95,12 +96,24 @@ void ModelComponent::AddBehavior(AddMessage& msg) { for (auto& behavior : m_Behaviors) if (behavior.GetBehaviorId() == msg.GetBehaviorId()) return; m_Behaviors.insert(m_Behaviors.begin() + msg.GetBehaviorIndex(), PropertyBehavior()); m_Behaviors.at(msg.GetBehaviorIndex()).HandleMsg(msg); + auto* const simplePhysComponent = m_Parent->GetComponent(); + if (simplePhysComponent) { + simplePhysComponent->SetPhysicsMotionState(1); + Game::entityManager->SerializeEntity(m_Parent); + } } void ModelComponent::MoveToInventory(MoveToInventoryMessage& msg) { if (msg.GetBehaviorIndex() >= m_Behaviors.size() || m_Behaviors.at(msg.GetBehaviorIndex()).GetBehaviorId() != msg.GetBehaviorId()) return; m_Behaviors.erase(m_Behaviors.begin() + msg.GetBehaviorIndex()); // TODO move to the inventory + if (m_Behaviors.empty()) { + auto* const simplePhysComponent = m_Parent->GetComponent(); + if (simplePhysComponent) { + simplePhysComponent->SetPhysicsMotionState(4); + Game::entityManager->SerializeEntity(m_Parent); + } + } } std::array, 5> ModelComponent::GetBehaviorsForSave() const { diff --git a/dGame/dComponents/ModelComponent.h b/dGame/dComponents/ModelComponent.h index 9e23eafb..12ef7744 100644 --- a/dGame/dComponents/ModelComponent.h +++ b/dGame/dComponents/ModelComponent.h @@ -66,8 +66,8 @@ public: template void HandleControlBehaviorsMsg(const AMFArrayValue& args) { static_assert(std::is_base_of_v, "Msg must be a BehaviorMessageBase"); - Msg msg(args); - for (auto& behavior : m_Behaviors) { + Msg msg{ args }; + for (auto&& behavior : m_Behaviors) { if (behavior.GetBehaviorId() == msg.GetBehaviorId()) { behavior.HandleMsg(msg); return; diff --git a/dGame/dComponents/PetComponent.cpp b/dGame/dComponents/PetComponent.cpp index 2f0df185..c2783a15 100644 --- a/dGame/dComponents/PetComponent.cpp +++ b/dGame/dComponents/PetComponent.cpp @@ -88,7 +88,7 @@ PetComponent::PetComponent(Entity* parentEntity, uint32_t componentId) : Compone m_Ability = ePetAbilityType::Invalid; m_StartPosition = NiPoint3Constant::ZERO; m_MovementAI = nullptr; - m_TresureTime = 0; + m_TreasureTime = 0; std::string checkPreconditions = GeneralUtils::UTF16ToWTF8(parentEntity->GetVar(u"CheckPrecondition")); @@ -319,27 +319,27 @@ void PetComponent::Update(float deltaTime) { return; } - if (m_TresureTime > 0) { - auto* tresure = Game::entityManager->GetEntity(m_Interaction); + if (m_TreasureTime > 0) { + auto* treasure = Game::entityManager->GetEntity(m_Interaction); - if (tresure == nullptr) { - m_TresureTime = 0; + if (treasure == nullptr) { + m_TreasureTime = 0; return; } - m_TresureTime -= deltaTime; + m_TreasureTime -= deltaTime; m_MovementAI->Stop(); - if (m_TresureTime <= 0) { + if (m_TreasureTime <= 0) { m_Parent->SetOwnerOverride(m_Owner); - tresure->Smash(m_Parent->GetObjectID()); + treasure->Smash(m_Parent->GetObjectID()); m_Interaction = LWOOBJID_EMPTY; - m_TresureTime = 0; + m_TreasureTime = 0; } return; @@ -381,7 +381,7 @@ void PetComponent::Update(float deltaTime) { float distance = Vector3::DistanceSquared(position, switchPosition); if (distance < 3 * 3) { m_Interaction = closestSwitch->GetParentEntity()->GetObjectID(); - closestSwitch->EntityEnter(m_Parent); + closestSwitch->OnUse(m_Parent); } else if (distance < 20 * 20) { haltDistance = 1; @@ -396,30 +396,30 @@ void PetComponent::Update(float deltaTime) { // Determine if the "Lost Tags" mission has been completed and digging has been unlocked const bool digUnlocked = missionComponent->GetMissionState(842) == eMissionState::COMPLETE; - Entity* closestTresure = PetDigServer::GetClosestTresure(position); + Entity* closestTreasure = PetDigServer::GetClosestTreasure(position); - if (closestTresure != nullptr && digUnlocked) { + if (closestTreasure != nullptr && digUnlocked) { // Skeleton Dragon Pat special case for bone digging - if (closestTresure->GetLOT() == 12192 && m_Parent->GetLOT() != 13067) { - goto skipTresure; + if (closestTreasure->GetLOT() == 12192 && m_Parent->GetLOT() != 13067) { + goto skipTreasure; } - NiPoint3 tresurePosition = closestTresure->GetPosition(); - float distance = Vector3::DistanceSquared(position, tresurePosition); + NiPoint3 treasurePosition = closestTreasure->GetPosition(); + float distance = Vector3::DistanceSquared(position, treasurePosition); if (distance < 5 * 5) { - m_Interaction = closestTresure->GetObjectID(); + m_Interaction = closestTreasure->GetObjectID(); Command(NiPoint3Constant::ZERO, LWOOBJID_EMPTY, 1, 202, true); - m_TresureTime = 2; + m_TreasureTime = 2; } else if (distance < 10 * 10) { haltDistance = 1; - destination = tresurePosition; + destination = treasurePosition; } } -skipTresure: +skipTreasure: m_MovementAI->SetHaltDistance(haltDistance); diff --git a/dGame/dComponents/PetComponent.h b/dGame/dComponents/PetComponent.h index f02a9d30..fed3f49a 100644 --- a/dGame/dComponents/PetComponent.h +++ b/dGame/dComponents/PetComponent.h @@ -329,7 +329,7 @@ private: * Timer that tracks how long a pet has been digging up some treasure, required to spawn the treasure contents * on time */ - float m_TresureTime; + float m_TreasureTime; /** * The position that this pet was spawned at diff --git a/dGame/dComponents/PossessableComponent.h b/dGame/dComponents/PossessableComponent.h index 6f1968a5..2102f7fe 100644 --- a/dGame/dComponents/PossessableComponent.h +++ b/dGame/dComponents/PossessableComponent.h @@ -5,7 +5,7 @@ #include "Component.h" #include "Item.h" #include "PossessorComponent.h" -#include "eAninmationFlags.h" +#include "eAnimationFlags.h" #include "eReplicaComponentType.h" /** diff --git a/dGame/dComponents/PropertyEntranceComponent.cpp b/dGame/dComponents/PropertyEntranceComponent.cpp index ab3bb5da..783de9a9 100644 --- a/dGame/dComponents/PropertyEntranceComponent.cpp +++ b/dGame/dComponents/PropertyEntranceComponent.cpp @@ -14,6 +14,8 @@ #include "Amf3.h" #include "eObjectBits.h" #include "eGameMasterLevel.h" +#include "ePropertySortType.h" +#include "User.h" PropertyEntranceComponent::PropertyEntranceComponent(Entity* parent, uint32_t componentID) : Component(parent) { this->propertyQueries = {}; @@ -74,261 +76,103 @@ void PropertyEntranceComponent::OnEnterProperty(Entity* entity, uint32_t index, launcher->Launch(entity, launcher->GetTargetZone(), cloneId); } -PropertySelectQueryProperty PropertyEntranceComponent::SetPropertyValues(PropertySelectQueryProperty property, LWOCLONEID cloneId, std::string ownerName, std::string propertyName, std::string propertyDescription, float reputation, bool isBFF, bool isFriend, bool isModeratorApproved, bool isAlt, bool isOwned, uint32_t privacyOption, uint32_t timeLastUpdated, float performanceCost) { - property.CloneId = cloneId; - property.OwnerName = ownerName; - property.Name = propertyName; - property.Description = propertyDescription; - property.Reputation = reputation; - property.IsBestFriend = isBFF; - property.IsFriend = isFriend; - property.IsModeratorApproved = isModeratorApproved; - property.IsAlt = isAlt; - property.IsOwned = isOwned; - property.AccessType = privacyOption; - property.DateLastPublished = timeLastUpdated; - property.PerformanceCost = performanceCost; - - return property; -} - -std::string PropertyEntranceComponent::BuildQuery(Entity* entity, int32_t sortMethod, Character* character, std::string customQuery, bool wantLimits) { - std::string base; - if (customQuery == "") { - base = baseQueryForProperties; - } else { - base = customQuery; - } - std::string orderBy = ""; - if (sortMethod == SORT_TYPE_FEATURED || sortMethod == SORT_TYPE_FRIENDS) { - std::string friendsList = " AND p.owner_id IN ("; - - auto friendsListQuery = Database::Get()->CreatePreppedStmt("SELECT * FROM (SELECT CASE WHEN player_id = ? THEN friend_id WHEN friend_id = ? THEN player_id END AS requested_player FROM friends ) AS fr WHERE requested_player IS NOT NULL ORDER BY requested_player DESC;"); - - friendsListQuery->setUInt(1, character->GetID()); - friendsListQuery->setUInt(2, character->GetID()); - - auto friendsListQueryResult = friendsListQuery->executeQuery(); - - while (friendsListQueryResult->next()) { - auto playerIDToConvert = friendsListQueryResult->getInt(1); - friendsList = friendsList + std::to_string(playerIDToConvert) + ","; - } - // Replace trailing comma with the closing parenthesis. - if (friendsList.at(friendsList.size() - 1) == ',') friendsList.erase(friendsList.size() - 1, 1); - friendsList += ") "; - - // If we have no friends then use a -1 for the query. - if (friendsList.find("()") != std::string::npos) friendsList = " AND p.owner_id IN (-1) "; - - orderBy += friendsList + "ORDER BY ci.name ASC "; - - delete friendsListQueryResult; - friendsListQueryResult = nullptr; - - delete friendsListQuery; - friendsListQuery = nullptr; - } else if (sortMethod == SORT_TYPE_RECENT) { - orderBy = "ORDER BY p.last_updated DESC "; - } else if (sortMethod == SORT_TYPE_REPUTATION) { - orderBy = "ORDER BY p.reputation DESC, p.last_updated DESC "; - } else { - orderBy = "ORDER BY p.last_updated DESC "; - } - return base + orderBy + (wantLimits ? "LIMIT ? OFFSET ?;" : ";"); -} - void PropertyEntranceComponent::OnPropertyEntranceSync(Entity* entity, bool includeNullAddress, bool includeNullDescription, bool playerOwn, bool updateUi, int32_t numResults, int32_t lReputationTime, int32_t sortMethod, int32_t startIndex, std::string filterText, const SystemAddress& sysAddr) { - - std::vector entries{}; - PropertySelectQueryProperty playerEntry{}; - - auto character = entity->GetCharacter(); + const auto* const character = entity->GetCharacter(); if (!character) return; + const auto* const user = character->GetParentUser(); + if (!user) return; + auto& entries = propertyQueries[entity->GetObjectID()]; + entries.clear(); // Player property goes in index 1 of the vector. This is how the client expects it. - auto playerPropertyLookup = Database::Get()->CreatePreppedStmt("SELECT * FROM properties WHERE owner_id = ? AND zone_id = ?"); - - playerPropertyLookup->setInt(1, character->GetID()); - playerPropertyLookup->setInt(2, this->m_MapID); - - auto playerPropertyLookupResults = playerPropertyLookup->executeQuery(); + const auto playerProperty = Database::Get()->GetPropertyInfo(m_MapID, character->GetPropertyCloneID()); // If the player has a property this query will have a single result. - if (playerPropertyLookupResults->next()) { - const auto cloneId = playerPropertyLookupResults->getUInt64(4); - const auto propertyName = std::string(playerPropertyLookupResults->getString(5).c_str()); - const auto propertyDescription = std::string(playerPropertyLookupResults->getString(6).c_str()); - const auto privacyOption = playerPropertyLookupResults->getInt(9); - const auto modApproved = playerPropertyLookupResults->getBoolean(10); - const auto dateLastUpdated = playerPropertyLookupResults->getInt64(11); - const auto reputation = playerPropertyLookupResults->getUInt(14); - const auto performanceCost = playerPropertyLookupResults->getFloat(16); - - playerEntry = SetPropertyValues(playerEntry, cloneId, character->GetName(), propertyName, propertyDescription, reputation, true, true, modApproved, true, true, privacyOption, dateLastUpdated, performanceCost); + auto& playerEntry = entries.emplace_back(); + if (playerProperty.has_value()) { + playerEntry.OwnerName = character->GetName(); + playerEntry.IsBestFriend = true; + playerEntry.IsFriend = true; + playerEntry.IsAlt = true; + playerEntry.IsOwned = true; + playerEntry.CloneId = playerProperty->cloneId; + playerEntry.Name = playerProperty->name; + playerEntry.Description = playerProperty->description; + playerEntry.AccessType = playerProperty->privacyOption; + playerEntry.IsModeratorApproved = playerProperty->modApproved; + playerEntry.DateLastPublished = playerProperty->lastUpdatedTime; + playerEntry.Reputation = playerProperty->reputation; + playerEntry.PerformanceCost = playerProperty->performanceCost; + auto& entry = playerEntry; } else { - playerEntry = SetPropertyValues(playerEntry, character->GetPropertyCloneID(), character->GetName(), "", "", 0, true, true); + playerEntry.OwnerName = character->GetName(); + playerEntry.IsBestFriend = true; + playerEntry.IsFriend = true; + playerEntry.IsAlt = false; + playerEntry.IsOwned = false; + playerEntry.CloneId = character->GetPropertyCloneID(); + playerEntry.Name = ""; + playerEntry.Description = ""; + playerEntry.AccessType = 0; + playerEntry.IsModeratorApproved = false; + playerEntry.DateLastPublished = 0; + playerEntry.Reputation = 0; + playerEntry.PerformanceCost = 0.0f; } - delete playerPropertyLookupResults; - playerPropertyLookupResults = nullptr; + IProperty::PropertyLookup propertyLookup; + propertyLookup.mapId = m_MapID; + propertyLookup.searchString = filterText; + propertyLookup.sortChoice = static_cast(sortMethod); + propertyLookup.playerSort = static_cast(sortMethod == SORT_TYPE_FEATURED || sortMethod == SORT_TYPE_FRIENDS ? PropertyPrivacyOption::Friends : PropertyPrivacyOption::Public); + propertyLookup.playerId = character->GetID(); + propertyLookup.numResults = numResults; + propertyLookup.startIndex = startIndex; - delete playerPropertyLookup; - playerPropertyLookup = nullptr; - - entries.push_back(playerEntry); - - const auto query = BuildQuery(entity, sortMethod, character); - - auto propertyLookup = Database::Get()->CreatePreppedStmt(query); - - const auto searchString = "%" + filterText + "%"; - propertyLookup->setUInt(1, this->m_MapID); - propertyLookup->setString(2, searchString.c_str()); - propertyLookup->setString(3, searchString.c_str()); - propertyLookup->setString(4, searchString.c_str()); - propertyLookup->setInt(5, sortMethod == SORT_TYPE_FEATURED || sortMethod == SORT_TYPE_FRIENDS ? static_cast(PropertyPrivacyOption::Friends) : static_cast(PropertyPrivacyOption::Public)); - propertyLookup->setInt(6, numResults); - propertyLookup->setInt(7, startIndex); - - auto propertyEntry = propertyLookup->executeQuery(); - - while (propertyEntry->next()) { - const auto propertyId = propertyEntry->getUInt64(1); - const auto owner = propertyEntry->getInt(2); - const auto cloneId = propertyEntry->getUInt64(4); - const auto propertyNameFromDb = std::string(propertyEntry->getString(5).c_str()); - const auto propertyDescriptionFromDb = std::string(propertyEntry->getString(6).c_str()); - const auto privacyOption = propertyEntry->getInt(9); - const auto modApproved = propertyEntry->getBoolean(10); - const auto dateLastUpdated = propertyEntry->getInt(11); - const float reputation = propertyEntry->getInt(14); - const auto performanceCost = propertyEntry->getFloat(16); - - PropertySelectQueryProperty entry{}; - - std::string ownerName = ""; - bool isOwned = true; - auto nameLookup = Database::Get()->CreatePreppedStmt("SELECT name FROM charinfo WHERE prop_clone_id = ?;"); - - nameLookup->setUInt64(1, cloneId); - - auto nameResult = nameLookup->executeQuery(); - - if (!nameResult->next()) { - delete nameLookup; - nameLookup = nullptr; - - LOG("Failed to find property owner name for %llu!", cloneId); + const auto lookupResult = Database::Get()->GetProperties(propertyLookup); + for (const auto& propertyEntry : lookupResult->entries) { + const auto owner = propertyEntry.ownerId; + const auto otherCharacter = Database::Get()->GetCharacterInfo(owner); + if (!otherCharacter.has_value()) { + LOG("Failed to find property owner name for %u!", owner); continue; - } else { - isOwned = cloneId == character->GetPropertyCloneID(); - ownerName = std::string(nameResult->getString(1).c_str()); } + auto& entry = entries.emplace_back(); - delete nameResult; - nameResult = nullptr; - - delete nameLookup; - nameLookup = nullptr; - - std::string propertyName = propertyNameFromDb; - std::string propertyDescription = propertyDescriptionFromDb; - - bool isBestFriend = false; - bool isFriend = false; - - // Convert owner char id to LWOOBJID - LWOOBJID ownerObjId = owner; - GeneralUtils::SetBit(ownerObjId, eObjectBits::CHARACTER); - GeneralUtils::SetBit(ownerObjId, eObjectBits::PERSISTENT); - + entry.IsOwned = entry.CloneId == otherCharacter->cloneId; + entry.OwnerName = otherCharacter->name; + entry.CloneId = propertyEntry.cloneId; + entry.Name = propertyEntry.name; + entry.Description = propertyEntry.description; + entry.AccessType = propertyEntry.privacyOption; + entry.IsModeratorApproved = propertyEntry.modApproved; + entry.DateLastPublished = propertyEntry.lastUpdatedTime; + entry.Reputation = propertyEntry.reputation; + entry.PerformanceCost = propertyEntry.performanceCost; + entry.IsBestFriend = false; + entry.IsFriend = false; // Query to get friend and best friend fields - auto friendCheck = Database::Get()->CreatePreppedStmt("SELECT best_friend FROM friends WHERE (player_id = ? AND friend_id = ?) OR (player_id = ? AND friend_id = ?)"); - - friendCheck->setUInt(1, character->GetID()); - friendCheck->setUInt(2, ownerObjId); - friendCheck->setUInt(3, ownerObjId); - friendCheck->setUInt(4, character->GetID()); - - auto friendResult = friendCheck->executeQuery(); - + const auto friendCheck = Database::Get()->GetBestFriendStatus(character->GetID(), owner); // If we got a result than the two players are friends. - if (friendResult->next()) { - isFriend = true; - if (friendResult->getInt(1) == 3) { - isBestFriend = true; - } + if (friendCheck.has_value()) { + entry.IsFriend = true; + entry.IsBestFriend = friendCheck->bestFriendStatus == 3; } - delete friendCheck; - friendCheck = nullptr; - - delete friendResult; - friendResult = nullptr; - - bool isModeratorApproved = propertyEntry->getBoolean(10); - - if (!isModeratorApproved && entity->GetGMLevel() >= eGameMasterLevel::LEAD_MODERATOR) { - propertyName = "[AWAITING APPROVAL]"; - propertyDescription = "[AWAITING APPROVAL]"; - isModeratorApproved = true; + if (!entry.IsModeratorApproved && entity->GetGMLevel() >= eGameMasterLevel::LEAD_MODERATOR) { + entry.Name = "[AWAITING APPROVAL]"; + entry.Description = "[AWAITING APPROVAL]"; + entry.IsModeratorApproved = true; } - bool isAlt = false; // Query to determine whether this property is an alt character of the entity. - auto isAltQuery = Database::Get()->CreatePreppedStmt("SELECT id FROM charinfo where account_id in (SELECT account_id from charinfo WHERE id = ?) AND id = ?;"); - - isAltQuery->setInt(1, character->GetID()); - isAltQuery->setInt(2, owner); - - auto isAltQueryResults = isAltQuery->executeQuery(); - - if (isAltQueryResults->next()) { - isAlt = true; + for (const auto charid : Database::Get()->GetAccountCharacterIds(user->GetAccountID())) { + entry.IsAlt = charid == owner; + if (entry.IsAlt) break; } - - delete isAltQueryResults; - isAltQueryResults = nullptr; - - delete isAltQuery; - isAltQuery = nullptr; - - entry = SetPropertyValues(entry, cloneId, ownerName, propertyName, propertyDescription, reputation, isBestFriend, isFriend, isModeratorApproved, isAlt, isOwned, privacyOption, dateLastUpdated, performanceCost); - - entries.push_back(entry); } - delete propertyEntry; - propertyEntry = nullptr; - - delete propertyLookup; - propertyLookup = nullptr; - - propertyQueries[entity->GetObjectID()] = entries; - // Query here is to figure out whether or not to display the button to go to the next page or not. - int32_t numberOfProperties = 0; - - auto buttonQuery = BuildQuery(entity, sortMethod, character, "SELECT COUNT(*) FROM properties as p JOIN charinfo as ci ON ci.prop_clone_id = p.clone_id where p.zone_id = ? AND (p.description LIKE ? OR p.name LIKE ? OR ci.name LIKE ?) AND p.privacy_option >= ? ", false); - auto propertiesLeft = Database::Get()->CreatePreppedStmt(buttonQuery); - - propertiesLeft->setUInt(1, this->m_MapID); - propertiesLeft->setString(2, searchString.c_str()); - propertiesLeft->setString(3, searchString.c_str()); - propertiesLeft->setString(4, searchString.c_str()); - propertiesLeft->setInt(5, sortMethod == SORT_TYPE_FEATURED || sortMethod == SORT_TYPE_FRIENDS ? 1 : 2); - - auto result = propertiesLeft->executeQuery(); - result->next(); - numberOfProperties = result->getInt(1); - - delete result; - result = nullptr; - - delete propertiesLeft; - propertiesLeft = nullptr; - - GameMessages::SendPropertySelectQuery(m_Parent->GetObjectID(), startIndex, numberOfProperties - (startIndex + numResults) > 0, character->GetPropertyCloneID(), false, true, entries, sysAddr); + GameMessages::SendPropertySelectQuery(m_Parent->GetObjectID(), startIndex, lookupResult->totalEntriesMatchingQuery - (startIndex + numResults) > 0, character->GetPropertyCloneID(), false, true, entries, sysAddr); } diff --git a/dGame/dComponents/PropertyEntranceComponent.h b/dGame/dComponents/PropertyEntranceComponent.h index 510bb489..c0e76dcb 100644 --- a/dGame/dComponents/PropertyEntranceComponent.h +++ b/dGame/dComponents/PropertyEntranceComponent.h @@ -57,11 +57,7 @@ public: * Returns the map ID for this property * @return the map ID for this property */ - [[nodiscard]] LWOMAPID GetMapID() const { return m_MapID; }; - - PropertySelectQueryProperty SetPropertyValues(PropertySelectQueryProperty property, LWOCLONEID cloneId = LWOCLONEID_INVALID, std::string ownerName = "", std::string propertyName = "", std::string propertyDescription = "", float reputation = 0, bool isBFF = false, bool isFriend = false, bool isModeratorApproved = false, bool isAlt = false, bool isOwned = false, uint32_t privacyOption = 0, uint32_t timeLastUpdated = 0, float performanceCost = 0.0f); - - std::string BuildQuery(Entity* entity, int32_t sortMethod, Character* character, std::string customQuery = "", bool wantLimits = true); + [[nodiscard]] LWOMAPID GetMapID() const noexcept { return m_MapID; }; private: /** @@ -78,13 +74,4 @@ private: * The base map ID for this property (Avant Grove, etc). */ LWOMAPID m_MapID; - - enum ePropertySortType : int32_t { - SORT_TYPE_FRIENDS = 0, - SORT_TYPE_REPUTATION = 1, - SORT_TYPE_RECENT = 3, - SORT_TYPE_FEATURED = 5 - }; - - std::string baseQueryForProperties = "SELECT p.* FROM properties as p JOIN charinfo as ci ON ci.prop_clone_id = p.clone_id where p.zone_id = ? AND (p.description LIKE ? OR p.name LIKE ? OR ci.name LIKE ?) AND p.privacy_option >= ? "; }; diff --git a/dGame/dComponents/RocketLaunchpadControlComponent.cpp b/dGame/dComponents/RocketLaunchpadControlComponent.cpp index c0c90581..8fde926b 100644 --- a/dGame/dComponents/RocketLaunchpadControlComponent.cpp +++ b/dGame/dComponents/RocketLaunchpadControlComponent.cpp @@ -18,7 +18,7 @@ #include "BitStreamUtils.h" #include "eObjectWorldState.h" #include "eConnectionType.h" -#include "eMasterMessageType.h" +#include "MessageType/Master.h" RocketLaunchpadControlComponent::RocketLaunchpadControlComponent(Entity* parent, int rocketId) : Component(parent) { auto query = CDClientDatabase::CreatePreppedStmt( @@ -137,7 +137,7 @@ LWOCLONEID RocketLaunchpadControlComponent::GetSelectedCloneId(LWOOBJID player) void RocketLaunchpadControlComponent::TellMasterToPrepZone(int zoneID) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::PREP_ZONE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, MessageType::Master::PREP_ZONE); bitStream.Write(zoneID); Game::server->SendToMaster(bitStream); } diff --git a/dGame/dComponents/SimplePhysicsComponent.cpp b/dGame/dComponents/SimplePhysicsComponent.cpp index 3b52395e..6bc2e2bc 100644 --- a/dGame/dComponents/SimplePhysicsComponent.cpp +++ b/dGame/dComponents/SimplePhysicsComponent.cpp @@ -27,6 +27,7 @@ SimplePhysicsComponent::SimplePhysicsComponent(Entity* parent, uint32_t componen } else { SetClimbableType(eClimbableType::CLIMBABLE_TYPE_NOT); } + m_PhysicsMotionState = m_Parent->GetVarAs(u"motionType"); } SimplePhysicsComponent::~SimplePhysicsComponent() { @@ -47,11 +48,10 @@ void SimplePhysicsComponent::Serialize(RakNet::BitStream& outBitStream, bool bIs } // Physics motion state - if (m_PhysicsMotionState != 0) { - outBitStream.Write1(); + outBitStream.Write(m_DirtyPhysicsMotionState || bIsInitialUpdate); + if (m_DirtyPhysicsMotionState || bIsInitialUpdate) { outBitStream.Write(m_PhysicsMotionState); - } else { - outBitStream.Write0(); + m_DirtyPhysicsMotionState = false; } PhysicsComponent::Serialize(outBitStream, bIsInitialUpdate); } @@ -61,5 +61,6 @@ uint32_t SimplePhysicsComponent::GetPhysicsMotionState() const { } void SimplePhysicsComponent::SetPhysicsMotionState(uint32_t value) { + m_DirtyPhysicsMotionState = m_PhysicsMotionState != value; m_PhysicsMotionState = value; } diff --git a/dGame/dComponents/SimplePhysicsComponent.h b/dGame/dComponents/SimplePhysicsComponent.h index c6ef52a0..b4491e12 100644 --- a/dGame/dComponents/SimplePhysicsComponent.h +++ b/dGame/dComponents/SimplePhysicsComponent.h @@ -102,7 +102,9 @@ private: /** * The current physics motion state */ - uint32_t m_PhysicsMotionState = 0; + uint32_t m_PhysicsMotionState = 5; + + bool m_DirtyPhysicsMotionState = true; /** * Whether or not the entity is climbable diff --git a/dGame/dComponents/SkillComponent.cpp b/dGame/dComponents/SkillComponent.cpp index 58b13dc5..999bf9db 100644 --- a/dGame/dComponents/SkillComponent.cpp +++ b/dGame/dComponents/SkillComponent.cpp @@ -24,7 +24,7 @@ #include "CDClientManager.h" #include "CDSkillBehaviorTable.h" #include "eConnectionType.h" -#include "eClientMessageType.h" +#include "MessageType/Client.h" ProjectileSyncEntry::ProjectileSyncEntry() { } @@ -320,7 +320,7 @@ SkillExecutionResult SkillComponent::CalculateBehavior( // Write message RakNet::BitStream message; - BitStreamUtils::WriteHeader(message, eConnectionType::CLIENT, eClientMessageType::GAME_MSG); + BitStreamUtils::WriteHeader(message, eConnectionType::CLIENT, MessageType::Client::GAME_MSG); message.Write(this->m_Parent->GetObjectID()); start.Serialize(message); @@ -451,7 +451,7 @@ void SkillComponent::SyncProjectileCalculation(const ProjectileSyncEntry& entry) RakNet::BitStream message; - BitStreamUtils::WriteHeader(message, eConnectionType::CLIENT, eClientMessageType::GAME_MSG); + BitStreamUtils::WriteHeader(message, eConnectionType::CLIENT, MessageType::Client::GAME_MSG); message.Write(this->m_Parent->GetObjectID()); projectileImpact.Serialize(message); diff --git a/dGame/dComponents/SwitchComponent.cpp b/dGame/dComponents/SwitchComponent.cpp index e6ad6d00..cb13cc7f 100644 --- a/dGame/dComponents/SwitchComponent.cpp +++ b/dGame/dComponents/SwitchComponent.cpp @@ -2,6 +2,7 @@ #include "EntityManager.h" #include "eTriggerEventType.h" #include "RenderComponent.h" +#include "DestroyableComponent.h" std::vector SwitchComponent::petSwitches; @@ -11,6 +12,13 @@ SwitchComponent::SwitchComponent(Entity* parent) : Component(parent) { m_ResetTime = m_Parent->GetVarAs(u"switch_reset_time"); m_QuickBuild = m_Parent->GetComponent(); + + const auto factions = GeneralUtils::SplitString(m_Parent->GetVar(u"respond_to_faction"), u':'); + for (const auto& faction : factions) { + auto factionID = GeneralUtils::TryParse(GeneralUtils::UTF16ToWTF8(faction)); + if (!factionID) continue; + m_FactionsToRespondTo.push_back(factionID.value()); + } } SwitchComponent::~SwitchComponent() { @@ -25,6 +33,17 @@ void SwitchComponent::Serialize(RakNet::BitStream& outBitStream, bool bIsInitial outBitStream.Write(m_Active); } +void SwitchComponent::OnUse(Entity* originator) { + const auto* const destroyableComponent = originator->GetComponent(); + if (!destroyableComponent) return; + for (const auto faction : m_FactionsToRespondTo) { + if (destroyableComponent->HasFaction(faction)) { + EntityEnter(originator); + break; + } + } +} + void SwitchComponent::SetActive(bool active) { m_Active = active; @@ -63,6 +82,7 @@ void SwitchComponent::EntityEnter(Entity* entity) { RenderComponent::PlayAnimation(m_Parent, u"engaged"); m_PetBouncer->SetPetBouncerEnabled(true); } else { + GameMessages::SendKnockback(entity->GetObjectID(), m_Parent->GetObjectID(), m_Parent->GetObjectID(), 0.0f, NiPoint3(0.0f, 17.0f, 0.0f)); Game::entityManager->SerializeEntity(m_Parent); } diff --git a/dGame/dComponents/SwitchComponent.h b/dGame/dComponents/SwitchComponent.h index 862e5719..49819481 100644 --- a/dGame/dComponents/SwitchComponent.h +++ b/dGame/dComponents/SwitchComponent.h @@ -22,6 +22,7 @@ public: ~SwitchComponent() override; void Update(float deltaTime) override; + void OnUse(Entity* originator) override; Entity* GetParentEntity() const; @@ -101,6 +102,8 @@ private: * Attached pet bouncer */ BouncerComponent* m_PetBouncer = nullptr; + + std::vector m_FactionsToRespondTo{}; }; #endif // SWITCHCOMPONENT_H diff --git a/dGame/dGameMessages/DoClientProjectileImpact.h b/dGame/dGameMessages/DoClientProjectileImpact.h index b8e3b528..c0354e47 100644 --- a/dGame/dGameMessages/DoClientProjectileImpact.h +++ b/dGame/dGameMessages/DoClientProjectileImpact.h @@ -27,7 +27,7 @@ public: } void Serialize(RakNet::BitStream& stream) { - stream.Write(eGameMessageType::DO_CLIENT_PROJECTILE_IMPACT); + stream.Write(MessageType::Game::DO_CLIENT_PROJECTILE_IMPACT); stream.Write(i64OrgID != LWOOBJID_EMPTY); if (i64OrgID != LWOOBJID_EMPTY) stream.Write(i64OrgID); diff --git a/dGame/dGameMessages/EchoStartSkill.h b/dGame/dGameMessages/EchoStartSkill.h index dfb79021..c2c6b1d4 100644 --- a/dGame/dGameMessages/EchoStartSkill.h +++ b/dGame/dGameMessages/EchoStartSkill.h @@ -4,7 +4,7 @@ #include "dCommonVars.h" #include "NiPoint3.h" #include "NiQuaternion.h" -#include "eGameMessageType.h" +#include "MessageType/Game.h" /* Same as start skill but with different network options. An echo down to other clients that need to play the skill. */ class EchoStartSkill { @@ -40,7 +40,7 @@ public: } void Serialize(RakNet::BitStream& stream) { - stream.Write(eGameMessageType::ECHO_START_SKILL); + stream.Write(MessageType::Game::ECHO_START_SKILL); stream.Write(bUsedMouse); diff --git a/dGame/dGameMessages/EchoSyncSkill.h b/dGame/dGameMessages/EchoSyncSkill.h index f65daab7..5ea866f1 100644 --- a/dGame/dGameMessages/EchoSyncSkill.h +++ b/dGame/dGameMessages/EchoSyncSkill.h @@ -4,7 +4,7 @@ #include #include "BitStream.h" -#include "eGameMessageType.h" +#include "MessageType/Game.h" /* Message to synchronize a skill cast */ @@ -29,7 +29,7 @@ public: } void Serialize(RakNet::BitStream& stream) { - stream.Write(eGameMessageType::ECHO_SYNC_SKILL); + stream.Write(MessageType::Game::ECHO_SYNC_SKILL); stream.Write(bDone); uint32_t sBitStreamLength = sBitStream.length(); diff --git a/dGame/dGameMessages/GameMessageHandler.cpp b/dGame/dGameMessages/GameMessageHandler.cpp index 76fabce2..f32d749f 100644 --- a/dGame/dGameMessages/GameMessageHandler.cpp +++ b/dGame/dGameMessages/GameMessageHandler.cpp @@ -33,13 +33,13 @@ #include "eMissionTaskType.h" #include "eReplicaComponentType.h" #include "eConnectionType.h" -#include "eGameMessageType.h" +#include "MessageType/Game.h" #include "ePlayerFlag.h" #include "dConfig.h" #include "GhostComponent.h" #include "StringifiedEnum.h" -void GameMessageHandler::HandleMessage(RakNet::BitStream& inStream, const SystemAddress& sysAddr, LWOOBJID objectID, eGameMessageType messageID) { +void GameMessageHandler::HandleMessage(RakNet::BitStream& inStream, const SystemAddress& sysAddr, LWOOBJID objectID, MessageType::Game messageID) { CBITSTREAM; @@ -53,58 +53,58 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream& inStream, const System return; } - if (messageID != eGameMessageType::READY_FOR_UPDATES) LOG_DEBUG("Received GM with ID and name: %4i, %s", messageID, StringifiedEnum::ToString(messageID).data()); + if (messageID != MessageType::Game::READY_FOR_UPDATES) LOG_DEBUG("Received GM with ID and name: %4i, %s", messageID, StringifiedEnum::ToString(messageID).data()); switch (messageID) { - case eGameMessageType::UN_USE_BBB_MODEL: { + case MessageType::Game::UN_USE_BBB_MODEL: { GameMessages::HandleUnUseModel(inStream, entity, sysAddr); break; } - case eGameMessageType::PLAY_EMOTE: { + case MessageType::Game::PLAY_EMOTE: { GameMessages::HandlePlayEmote(inStream, entity); break; } - case eGameMessageType::MOVE_ITEM_IN_INVENTORY: { + case MessageType::Game::MOVE_ITEM_IN_INVENTORY: { GameMessages::HandleMoveItemInInventory(inStream, entity); break; } - case eGameMessageType::REMOVE_ITEM_FROM_INVENTORY: { + case MessageType::Game::REMOVE_ITEM_FROM_INVENTORY: { GameMessages::HandleRemoveItemFromInventory(inStream, entity, sysAddr); break; } - case eGameMessageType::EQUIP_INVENTORY: + case MessageType::Game::EQUIP_INVENTORY: GameMessages::HandleEquipItem(inStream, entity); break; - case eGameMessageType::UN_EQUIP_INVENTORY: + case MessageType::Game::UN_EQUIP_INVENTORY: GameMessages::HandleUnequipItem(inStream, entity); break; - case eGameMessageType::RESPOND_TO_MISSION: { + case MessageType::Game::RESPOND_TO_MISSION: { GameMessages::HandleRespondToMission(inStream, entity); break; } - case eGameMessageType::REQUEST_USE: { + case MessageType::Game::REQUEST_USE: { GameMessages::HandleRequestUse(inStream, entity, sysAddr); break; } - case eGameMessageType::SET_FLAG: { + case MessageType::Game::SET_FLAG: { GameMessages::HandleSetFlag(inStream, entity); break; } - case eGameMessageType::HAS_BEEN_COLLECTED: { + case MessageType::Game::HAS_BEEN_COLLECTED: { GameMessages::HandleHasBeenCollected(inStream, entity); break; } - case eGameMessageType::PLAYER_LOADED: { + case MessageType::Game::PLAYER_LOADED: { GameMessages::SendRestoreToPostLoadStats(entity, sysAddr); entity->SetPlayerReadyForUpdates(); @@ -183,82 +183,82 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream& inStream, const System break; } - case eGameMessageType::REQUEST_LINKED_MISSION: { + case MessageType::Game::REQUEST_LINKED_MISSION: { GameMessages::HandleRequestLinkedMission(inStream, entity); break; } - case eGameMessageType::MISSION_DIALOGUE_OK: { + case MessageType::Game::MISSION_DIALOGUE_OK: { GameMessages::HandleMissionDialogOK(inStream, entity); break; } - case eGameMessageType::MISSION_DIALOGUE_CANCELLED: { + case MessageType::Game::MISSION_DIALOGUE_CANCELLED: { // This message is pointless for our implementation, as the client just carries on after // rejecting a mission offer. We dont need to do anything. This is just here to remove a warning in our logs :) break; } - case eGameMessageType::REQUEST_PLATFORM_RESYNC: { + case MessageType::Game::REQUEST_PLATFORM_RESYNC: { GameMessages::HandleRequestPlatformResync(inStream, entity, sysAddr); break; } - case eGameMessageType::FIRE_EVENT_SERVER_SIDE: { + case MessageType::Game::FIRE_EVENT_SERVER_SIDE: { GameMessages::HandleFireEventServerSide(inStream, entity, sysAddr); break; } - case eGameMessageType::SEND_ACTIVITY_SUMMARY_LEADERBOARD_DATA: { + case MessageType::Game::SEND_ACTIVITY_SUMMARY_LEADERBOARD_DATA: { GameMessages::HandleActivitySummaryLeaderboardData(inStream, entity, sysAddr); break; } - case eGameMessageType::REQUEST_ACTIVITY_SUMMARY_LEADERBOARD_DATA: { + case MessageType::Game::REQUEST_ACTIVITY_SUMMARY_LEADERBOARD_DATA: { GameMessages::HandleRequestActivitySummaryLeaderboardData(inStream, entity, sysAddr); break; } - case eGameMessageType::ACTIVITY_STATE_CHANGE_REQUEST: { + case MessageType::Game::ACTIVITY_STATE_CHANGE_REQUEST: { GameMessages::HandleActivityStateChangeRequest(inStream, entity); break; } - case eGameMessageType::PARSE_CHAT_MESSAGE: { + case MessageType::Game::PARSE_CHAT_MESSAGE: { GameMessages::HandleParseChatMessage(inStream, entity, sysAddr); break; } - case eGameMessageType::NOTIFY_SERVER_LEVEL_PROCESSING_COMPLETE: { + case MessageType::Game::NOTIFY_SERVER_LEVEL_PROCESSING_COMPLETE: { GameMessages::HandleNotifyServerLevelProcessingComplete(inStream, entity); break; } - case eGameMessageType::PICKUP_CURRENCY: { + case MessageType::Game::PICKUP_CURRENCY: { GameMessages::HandlePickupCurrency(inStream, entity); break; } - case eGameMessageType::PICKUP_ITEM: { + case MessageType::Game::PICKUP_ITEM: { GameMessages::HandlePickupItem(inStream, entity); break; } - case eGameMessageType::RESURRECT: { + case MessageType::Game::RESURRECT: { GameMessages::HandleResurrect(inStream, entity); break; } - case eGameMessageType::REQUEST_RESURRECT: { + case MessageType::Game::REQUEST_RESURRECT: { GameMessages::SendResurrect(entity); break; } - case eGameMessageType::GET_HOT_PROPERTY_DATA: { + case MessageType::Game::GET_HOT_PROPERTY_DATA: { GameMessages::HandleGetHotPropertyData(inStream, entity, sysAddr); break; } - case eGameMessageType::REQUEST_SERVER_PROJECTILE_IMPACT: + case MessageType::Game::REQUEST_SERVER_PROJECTILE_IMPACT: { auto message = RequestServerProjectileImpact(); @@ -275,7 +275,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream& inStream, const System break; } - case eGameMessageType::START_SKILL: { + case MessageType::Game::START_SKILL: { StartSkill startSkill = StartSkill(); startSkill.Deserialize(inStream); // inStream replaces &bitStream @@ -311,7 +311,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream& inStream, const System if (success) { //Broadcast our startSkill: RakNet::BitStream bitStreamLocal; - BitStreamUtils::WriteHeader(bitStreamLocal, eConnectionType::CLIENT, eClientMessageType::GAME_MSG); + BitStreamUtils::WriteHeader(bitStreamLocal, eConnectionType::CLIENT, MessageType::Client::GAME_MSG); bitStreamLocal.Write(entity->GetObjectID()); EchoStartSkill echoStartSkill; @@ -331,9 +331,9 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream& inStream, const System } } break; - case eGameMessageType::SYNC_SKILL: { + case MessageType::Game::SYNC_SKILL: { RakNet::BitStream bitStreamLocal; - BitStreamUtils::WriteHeader(bitStreamLocal, eConnectionType::CLIENT, eClientMessageType::GAME_MSG); + BitStreamUtils::WriteHeader(bitStreamLocal, eConnectionType::CLIENT, MessageType::Client::GAME_MSG); bitStreamLocal.Write(entity->GetObjectID()); SyncSkill sync = SyncSkill(inStream); // inStream replaced &bitStream @@ -365,330 +365,330 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream& inStream, const System Game::server->Send(bitStreamLocal, sysAddr, true); } break; - case eGameMessageType::REQUEST_SMASH_PLAYER: + case MessageType::Game::REQUEST_SMASH_PLAYER: entity->Smash(entity->GetObjectID()); break; - case eGameMessageType::MOVE_ITEM_BETWEEN_INVENTORY_TYPES: + case MessageType::Game::MOVE_ITEM_BETWEEN_INVENTORY_TYPES: GameMessages::HandleMoveItemBetweenInventoryTypes(inStream, entity, sysAddr); break; - case eGameMessageType::MODULAR_BUILD_FINISH: + case MessageType::Game::MODULAR_BUILD_FINISH: GameMessages::HandleModularBuildFinish(inStream, entity, sysAddr); break; - case eGameMessageType::PUSH_EQUIPPED_ITEMS_STATE: + case MessageType::Game::PUSH_EQUIPPED_ITEMS_STATE: GameMessages::HandlePushEquippedItemsState(inStream, entity); break; - case eGameMessageType::POP_EQUIPPED_ITEMS_STATE: + case MessageType::Game::POP_EQUIPPED_ITEMS_STATE: GameMessages::HandlePopEquippedItemsState(inStream, entity); break; - case eGameMessageType::BUY_FROM_VENDOR: + case MessageType::Game::BUY_FROM_VENDOR: GameMessages::HandleBuyFromVendor(inStream, entity, sysAddr); break; - case eGameMessageType::SELL_TO_VENDOR: + case MessageType::Game::SELL_TO_VENDOR: GameMessages::HandleSellToVendor(inStream, entity, sysAddr); break; - case eGameMessageType::BUYBACK_FROM_VENDOR: + case MessageType::Game::BUYBACK_FROM_VENDOR: GameMessages::HandleBuybackFromVendor(inStream, entity, sysAddr); break; - case eGameMessageType::MODULAR_BUILD_MOVE_AND_EQUIP: + case MessageType::Game::MODULAR_BUILD_MOVE_AND_EQUIP: GameMessages::HandleModularBuildMoveAndEquip(inStream, entity, sysAddr); break; - case eGameMessageType::DONE_ARRANGING_WITH_ITEM: + case MessageType::Game::DONE_ARRANGING_WITH_ITEM: GameMessages::HandleDoneArrangingWithItem(inStream, entity, sysAddr); break; - case eGameMessageType::MODULAR_BUILD_CONVERT_MODEL: + case MessageType::Game::MODULAR_BUILD_CONVERT_MODEL: GameMessages::HandleModularBuildConvertModel(inStream, entity, sysAddr); break; - case eGameMessageType::BUILD_MODE_SET: + case MessageType::Game::BUILD_MODE_SET: GameMessages::HandleBuildModeSet(inStream, entity); break; - case eGameMessageType::REBUILD_CANCEL: + case MessageType::Game::REBUILD_CANCEL: GameMessages::HandleQuickBuildCancel(inStream, entity); break; - case eGameMessageType::MATCH_REQUEST: + case MessageType::Game::MATCH_REQUEST: GameMessages::HandleMatchRequest(inStream, entity); break; - case eGameMessageType::USE_NON_EQUIPMENT_ITEM: + case MessageType::Game::USE_NON_EQUIPMENT_ITEM: GameMessages::HandleUseNonEquipmentItem(inStream, entity); break; - case eGameMessageType::CLIENT_ITEM_CONSUMED: + case MessageType::Game::CLIENT_ITEM_CONSUMED: GameMessages::HandleClientItemConsumed(inStream, entity); break; - case eGameMessageType::SET_CONSUMABLE_ITEM: + case MessageType::Game::SET_CONSUMABLE_ITEM: GameMessages::HandleSetConsumableItem(inStream, entity, sysAddr); break; - case eGameMessageType::VERIFY_ACK: + case MessageType::Game::VERIFY_ACK: GameMessages::HandleVerifyAck(inStream, entity, sysAddr); break; // Trading - case eGameMessageType::CLIENT_TRADE_REQUEST: + case MessageType::Game::CLIENT_TRADE_REQUEST: GameMessages::HandleClientTradeRequest(inStream, entity, sysAddr); break; - case eGameMessageType::CLIENT_TRADE_CANCEL: + case MessageType::Game::CLIENT_TRADE_CANCEL: GameMessages::HandleClientTradeCancel(inStream, entity, sysAddr); break; - case eGameMessageType::CLIENT_TRADE_ACCEPT: + case MessageType::Game::CLIENT_TRADE_ACCEPT: GameMessages::HandleClientTradeAccept(inStream, entity, sysAddr); break; - case eGameMessageType::CLIENT_TRADE_UPDATE: + case MessageType::Game::CLIENT_TRADE_UPDATE: GameMessages::HandleClientTradeUpdate(inStream, entity, sysAddr); break; // Pets - case eGameMessageType::PET_TAMING_TRY_BUILD: + case MessageType::Game::PET_TAMING_TRY_BUILD: GameMessages::HandlePetTamingTryBuild(inStream, entity, sysAddr); break; - case eGameMessageType::NOTIFY_TAMING_BUILD_SUCCESS: + case MessageType::Game::NOTIFY_TAMING_BUILD_SUCCESS: GameMessages::HandleNotifyTamingBuildSuccess(inStream, entity, sysAddr); break; - case eGameMessageType::REQUEST_SET_PET_NAME: + case MessageType::Game::REQUEST_SET_PET_NAME: GameMessages::HandleRequestSetPetName(inStream, entity, sysAddr); break; - case eGameMessageType::START_SERVER_PET_MINIGAME_TIMER: + case MessageType::Game::START_SERVER_PET_MINIGAME_TIMER: GameMessages::HandleStartServerPetMinigameTimer(inStream, entity, sysAddr); break; - case eGameMessageType::CLIENT_EXIT_TAMING_MINIGAME: + case MessageType::Game::CLIENT_EXIT_TAMING_MINIGAME: GameMessages::HandleClientExitTamingMinigame(inStream, entity, sysAddr); break; - case eGameMessageType::COMMAND_PET: + case MessageType::Game::COMMAND_PET: GameMessages::HandleCommandPet(inStream, entity, sysAddr); break; - case eGameMessageType::DESPAWN_PET: + case MessageType::Game::DESPAWN_PET: GameMessages::HandleDespawnPet(inStream, entity, sysAddr); break; - case eGameMessageType::MESSAGE_BOX_RESPOND: + case MessageType::Game::MESSAGE_BOX_RESPOND: GameMessages::HandleMessageBoxResponse(inStream, entity, sysAddr); break; - case eGameMessageType::CHOICE_BOX_RESPOND: + case MessageType::Game::CHOICE_BOX_RESPOND: GameMessages::HandleChoiceBoxRespond(inStream, entity, sysAddr); break; // Property - case eGameMessageType::QUERY_PROPERTY_DATA: + case MessageType::Game::QUERY_PROPERTY_DATA: GameMessages::HandleQueryPropertyData(inStream, entity, sysAddr); break; - case eGameMessageType::START_BUILDING_WITH_ITEM: + case MessageType::Game::START_BUILDING_WITH_ITEM: GameMessages::HandleStartBuildingWithItem(inStream, entity, sysAddr); break; - case eGameMessageType::SET_BUILD_MODE: + case MessageType::Game::SET_BUILD_MODE: GameMessages::HandleSetBuildMode(inStream, entity, sysAddr); break; - case eGameMessageType::PROPERTY_EDITOR_BEGIN: + case MessageType::Game::PROPERTY_EDITOR_BEGIN: GameMessages::HandlePropertyEditorBegin(inStream, entity, sysAddr); break; - case eGameMessageType::PROPERTY_EDITOR_END: + case MessageType::Game::PROPERTY_EDITOR_END: GameMessages::HandlePropertyEditorEnd(inStream, entity, sysAddr); break; - case eGameMessageType::PROPERTY_CONTENTS_FROM_CLIENT: + case MessageType::Game::PROPERTY_CONTENTS_FROM_CLIENT: GameMessages::HandlePropertyContentsFromClient(inStream, entity, sysAddr); break; - case eGameMessageType::ZONE_PROPERTY_MODEL_EQUIPPED: + case MessageType::Game::ZONE_PROPERTY_MODEL_EQUIPPED: GameMessages::HandlePropertyModelEquipped(inStream, entity, sysAddr); break; - case eGameMessageType::PLACE_PROPERTY_MODEL: + case MessageType::Game::PLACE_PROPERTY_MODEL: GameMessages::HandlePlacePropertyModel(inStream, entity, sysAddr); break; - case eGameMessageType::UPDATE_MODEL_FROM_CLIENT: + case MessageType::Game::UPDATE_MODEL_FROM_CLIENT: GameMessages::HandleUpdatePropertyModel(inStream, entity, sysAddr); break; - case eGameMessageType::DELETE_MODEL_FROM_CLIENT: + case MessageType::Game::DELETE_MODEL_FROM_CLIENT: GameMessages::HandleDeletePropertyModel(inStream, entity, sysAddr); break; - case eGameMessageType::BBB_LOAD_ITEM_REQUEST: + case MessageType::Game::BBB_LOAD_ITEM_REQUEST: GameMessages::HandleBBBLoadItemRequest(inStream, entity, sysAddr); break; - case eGameMessageType::BBB_SAVE_REQUEST: + case MessageType::Game::BBB_SAVE_REQUEST: GameMessages::HandleBBBSaveRequest(inStream, entity, sysAddr); break; - case eGameMessageType::CONTROL_BEHAVIORS: + case MessageType::Game::CONTROL_BEHAVIORS: GameMessages::HandleControlBehaviors(inStream, entity, sysAddr); break; - case eGameMessageType::PROPERTY_ENTRANCE_SYNC: + case MessageType::Game::PROPERTY_ENTRANCE_SYNC: GameMessages::HandlePropertyEntranceSync(inStream, entity, sysAddr); break; - case eGameMessageType::ENTER_PROPERTY1: + case MessageType::Game::ENTER_PROPERTY1: GameMessages::HandleEnterProperty(inStream, entity, sysAddr); break; - case eGameMessageType::ZONE_PROPERTY_MODEL_ROTATED: + case MessageType::Game::ZONE_PROPERTY_MODEL_ROTATED: Game::entityManager->GetZoneControlEntity()->OnZonePropertyModelRotated(usr->GetLastUsedChar()->GetEntity()); break; - case eGameMessageType::UPDATE_PROPERTY_OR_MODEL_FOR_FILTER_CHECK: + case MessageType::Game::UPDATE_PROPERTY_OR_MODEL_FOR_FILTER_CHECK: GameMessages::HandleUpdatePropertyOrModelForFilterCheck(inStream, entity, sysAddr); break; - case eGameMessageType::SET_PROPERTY_ACCESS: + case MessageType::Game::SET_PROPERTY_ACCESS: GameMessages::HandleSetPropertyAccess(inStream, entity, sysAddr); break; // Racing - case eGameMessageType::MODULE_ASSEMBLY_QUERY_DATA: + case MessageType::Game::MODULE_ASSEMBLY_QUERY_DATA: GameMessages::HandleModuleAssemblyQueryData(inStream, entity, sysAddr); break; - case eGameMessageType::ACKNOWLEDGE_POSSESSION: + case MessageType::Game::ACKNOWLEDGE_POSSESSION: GameMessages::HandleAcknowledgePossession(inStream, entity, sysAddr); break; - case eGameMessageType::VEHICLE_SET_WHEEL_LOCK_STATE: + case MessageType::Game::VEHICLE_SET_WHEEL_LOCK_STATE: GameMessages::HandleVehicleSetWheelLockState(inStream, entity, sysAddr); break; - case eGameMessageType::MODULAR_ASSEMBLY_NIF_COMPLETED: + case MessageType::Game::MODULAR_ASSEMBLY_NIF_COMPLETED: GameMessages::HandleModularAssemblyNIFCompleted(inStream, entity, sysAddr); break; - case eGameMessageType::RACING_CLIENT_READY: + case MessageType::Game::RACING_CLIENT_READY: GameMessages::HandleRacingClientReady(inStream, entity, sysAddr); break; - case eGameMessageType::REQUEST_DIE: + case MessageType::Game::REQUEST_DIE: GameMessages::HandleRequestDie(inStream, entity, sysAddr); break; - case eGameMessageType::NOTIFY_SERVER_VEHICLE_ADD_PASSIVE_BOOST_ACTION: + case MessageType::Game::NOTIFY_SERVER_VEHICLE_ADD_PASSIVE_BOOST_ACTION: GameMessages::HandleVehicleNotifyServerAddPassiveBoostAction(inStream, entity, sysAddr); break; - case eGameMessageType::NOTIFY_SERVER_VEHICLE_REMOVE_PASSIVE_BOOST_ACTION: + case MessageType::Game::NOTIFY_SERVER_VEHICLE_REMOVE_PASSIVE_BOOST_ACTION: GameMessages::HandleVehicleNotifyServerRemovePassiveBoostAction(inStream, entity, sysAddr); break; - case eGameMessageType::RACING_PLAYER_INFO_RESET_FINISHED: + case MessageType::Game::RACING_PLAYER_INFO_RESET_FINISHED: GameMessages::HandleRacingPlayerInfoResetFinished(inStream, entity, sysAddr); break; - case eGameMessageType::VEHICLE_NOTIFY_HIT_IMAGINATION_SERVER: + case MessageType::Game::VEHICLE_NOTIFY_HIT_IMAGINATION_SERVER: GameMessages::HandleVehicleNotifyHitImaginationServer(inStream, entity, sysAddr); break; - case eGameMessageType::UPDATE_PROPERTY_PERFORMANCE_COST: + case MessageType::Game::UPDATE_PROPERTY_PERFORMANCE_COST: GameMessages::HandleUpdatePropertyPerformanceCost(inStream, entity, sysAddr); break; // SG - case eGameMessageType::UPDATE_SHOOTING_GALLERY_ROTATION: + case MessageType::Game::UPDATE_SHOOTING_GALLERY_ROTATION: GameMessages::HandleUpdateShootingGalleryRotation(inStream, entity, sysAddr); break; // NT - case eGameMessageType::REQUEST_MOVE_ITEM_BETWEEN_INVENTORY_TYPES: + case MessageType::Game::REQUEST_MOVE_ITEM_BETWEEN_INVENTORY_TYPES: GameMessages::HandleRequestMoveItemBetweenInventoryTypes(inStream, entity, sysAddr); break; - case eGameMessageType::TOGGLE_GHOST_REFERENCE_OVERRIDE: + case MessageType::Game::TOGGLE_GHOST_REFERENCE_OVERRIDE: GameMessages::HandleToggleGhostReferenceOverride(inStream, entity, sysAddr); break; - case eGameMessageType::SET_GHOST_REFERENCE_POSITION: + case MessageType::Game::SET_GHOST_REFERENCE_POSITION: GameMessages::HandleSetGhostReferencePosition(inStream, entity, sysAddr); break; - case eGameMessageType::READY_FOR_UPDATES: + case MessageType::Game::READY_FOR_UPDATES: //We don't really care about this message, as it's simply here to inform us that the client is done loading an object. //In the event we _do_ send an update to an object that hasn't finished loading, the client will handle it anyway. break; - case eGameMessageType::REPORT_BUG: + case MessageType::Game::REPORT_BUG: GameMessages::HandleReportBug(inStream, entity); break; - case eGameMessageType::CLIENT_RAIL_MOVEMENT_READY: + case MessageType::Game::CLIENT_RAIL_MOVEMENT_READY: GameMessages::HandleClientRailMovementReady(inStream, entity, sysAddr); break; - case eGameMessageType::CANCEL_RAIL_MOVEMENT: + case MessageType::Game::CANCEL_RAIL_MOVEMENT: GameMessages::HandleCancelRailMovement(inStream, entity, sysAddr); break; - case eGameMessageType::PLAYER_RAIL_ARRIVED_NOTIFICATION: + case MessageType::Game::PLAYER_RAIL_ARRIVED_NOTIFICATION: GameMessages::HandlePlayerRailArrivedNotification(inStream, entity, sysAddr); break; - case eGameMessageType::CINEMATIC_UPDATE: + case MessageType::Game::CINEMATIC_UPDATE: GameMessages::HandleCinematicUpdate(inStream, entity, sysAddr); break; - case eGameMessageType::MODIFY_PLAYER_ZONE_STATISTIC: + case MessageType::Game::MODIFY_PLAYER_ZONE_STATISTIC: GameMessages::HandleModifyPlayerZoneStatistic(inStream, entity); break; - case eGameMessageType::UPDATE_PLAYER_STATISTIC: + case MessageType::Game::UPDATE_PLAYER_STATISTIC: GameMessages::HandleUpdatePlayerStatistic(inStream, entity); break; - case eGameMessageType::DISMOUNT_COMPLETE: + case MessageType::Game::DISMOUNT_COMPLETE: GameMessages::HandleDismountComplete(inStream, entity, sysAddr); break; - case eGameMessageType::DECTIVATE_BUBBLE_BUFF: + case MessageType::Game::DECTIVATE_BUBBLE_BUFF: GameMessages::HandleDeactivateBubbleBuff(inStream, entity); break; - case eGameMessageType::ACTIVATE_BUBBLE_BUFF: + case MessageType::Game::ACTIVATE_BUBBLE_BUFF: GameMessages::HandleActivateBubbleBuff(inStream, entity); break; - case eGameMessageType::ZONE_SUMMARY_DISMISSED: + case MessageType::Game::ZONE_SUMMARY_DISMISSED: GameMessages::HandleZoneSummaryDismissed(inStream, entity); break; - case eGameMessageType::REQUEST_ACTIVITY_EXIT: + case MessageType::Game::REQUEST_ACTIVITY_EXIT: GameMessages::HandleRequestActivityExit(inStream, entity); break; - case eGameMessageType::ADD_DONATION_ITEM: + case MessageType::Game::ADD_DONATION_ITEM: GameMessages::HandleAddDonationItem(inStream, entity, sysAddr); break; - case eGameMessageType::REMOVE_DONATION_ITEM: + case MessageType::Game::REMOVE_DONATION_ITEM: GameMessages::HandleRemoveDonationItem(inStream, entity, sysAddr); break; - case eGameMessageType::CONFIRM_DONATION_ON_PLAYER: + case MessageType::Game::CONFIRM_DONATION_ON_PLAYER: GameMessages::HandleConfirmDonationOnPlayer(inStream, entity); break; - case eGameMessageType::CANCEL_DONATION_ON_PLAYER: + case MessageType::Game::CANCEL_DONATION_ON_PLAYER: GameMessages::HandleCancelDonationOnPlayer(inStream, entity); break; - case eGameMessageType::REQUEST_VENDOR_STATUS_UPDATE: + case MessageType::Game::REQUEST_VENDOR_STATUS_UPDATE: GameMessages::SendVendorStatusUpdate(entity, sysAddr, true); break; - case eGameMessageType::UPDATE_INVENTORY_GROUP: + case MessageType::Game::UPDATE_INVENTORY_GROUP: GameMessages::HandleUpdateInventoryGroup(inStream, entity, sysAddr); break; - case eGameMessageType::UPDATE_INVENTORY_GROUP_CONTENTS: + case MessageType::Game::UPDATE_INVENTORY_GROUP_CONTENTS: GameMessages::HandleUpdateInventoryGroupContents(inStream, entity, sysAddr); break; diff --git a/dGame/dGameMessages/GameMessageHandler.h b/dGame/dGameMessages/GameMessageHandler.h index 2fefd008..c8026bb1 100644 --- a/dGame/dGameMessages/GameMessageHandler.h +++ b/dGame/dGameMessages/GameMessageHandler.h @@ -19,10 +19,10 @@ #include "Logger.h" #include "GameMessages.h" #include "CDClientDatabase.h" -#include "eGameMessageType.h" +#include "MessageType/Game.h" namespace GameMessageHandler { - void HandleMessage(RakNet::BitStream& inStream, const SystemAddress& sysAddr, LWOOBJID objectID, eGameMessageType messageID); + void HandleMessage(RakNet::BitStream& inStream, const SystemAddress& sysAddr, LWOOBJID objectID, MessageType::Game messageID); }; #endif // GAMEMESSAGEHANDLER_H diff --git a/dGame/dGameMessages/GameMessages.cpp b/dGame/dGameMessages/GameMessages.cpp index 2fba411b..fc77e690 100644 --- a/dGame/dGameMessages/GameMessages.cpp +++ b/dGame/dGameMessages/GameMessages.cpp @@ -90,11 +90,11 @@ #include "ControlBehaviors.h" #include "AMFDeserialize.h" #include "eBlueprintSaveResponseType.h" -#include "eAninmationFlags.h" +#include "eAnimationFlags.h" #include "AmfSerialize.h" #include "eReplicaComponentType.h" -#include "eClientMessageType.h" -#include "eGameMessageType.h" +#include "MessageType/Client.h" +#include "MessageType/Game.h" #include "ePetAbilityType.h" #include "ActivityManager.h" #include "PlayerManager.h" @@ -110,7 +110,7 @@ void GameMessages::SendFireEventClientSide(const LWOOBJID& objectID, const Syste CMSGHEADER; bitStream.Write(objectID); - bitStream.Write(eGameMessageType::FIRE_EVENT_CLIENT_SIDE); + bitStream.Write(MessageType::Game::FIRE_EVENT_CLIENT_SIDE); //bitStream.Write(args); uint32_t argSize = args.size(); @@ -132,7 +132,7 @@ void GameMessages::SendTeleport(const LWOOBJID& objectID, const NiPoint3& pos, c CBITSTREAM; CMSGHEADER; bitStream.Write(objectID); - bitStream.Write(eGameMessageType::TELEPORT); + bitStream.Write(MessageType::Game::TELEPORT); bool bIgnoreY = (pos.y == 0.0f); bool bUseNavmesh = false; @@ -177,7 +177,7 @@ void GameMessages::SendPlayAnimation(Entity* entity, const std::u16string& anima bool bTriggerOnCompleteMsg = false; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::PLAY_ANIMATION); + bitStream.Write(MessageType::Game::PLAY_ANIMATION); bitStream.Write(animationIDLength); bitStream.Write(LUWString(animationName, animationIDLength)); @@ -201,7 +201,7 @@ void GameMessages::SendPlayerReady(Entity* entity, const SystemAddress& sysAddr) CBITSTREAM; CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::PLAYER_READY); + bitStream.Write(MessageType::Game::PLAYER_READY); SEND_PACKET; } @@ -210,7 +210,7 @@ void GameMessages::SendPlayerAllowedRespawn(LWOOBJID entityID, bool doNotPromptR CMSGHEADER; bitStream.Write(entityID); - bitStream.Write(eGameMessageType::SET_PLAYER_ALLOWED_RESPAWN); + bitStream.Write(MessageType::Game::SET_PLAYER_ALLOWED_RESPAWN); bitStream.Write(doNotPromptRespawn); SEND_PACKET; @@ -221,7 +221,7 @@ void GameMessages::SendInvalidZoneTransferList(Entity* entity, const SystemAddre CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::INVALID_ZONE_TRANSFER_LIST); + bitStream.Write(MessageType::Game::INVALID_ZONE_TRANSFER_LIST); uint32_t CustomerFeedbackURLLength = feedbackURL.size(); bitStream.Write(CustomerFeedbackURLLength); @@ -246,7 +246,7 @@ void GameMessages::SendKnockback(const LWOOBJID& objectID, const LWOOBJID& caste CMSGHEADER; bitStream.Write(objectID); - bitStream.Write(eGameMessageType::KNOCKBACK); + bitStream.Write(MessageType::Game::KNOCKBACK); bool casterFlag = caster != LWOOBJID_EMPTY; bool originatorFlag = originator != LWOOBJID_EMPTY; @@ -282,7 +282,7 @@ void GameMessages::SendStartArrangingWithItem( CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::START_ARRANGING_WITH_ITEM); + bitStream.Write(MessageType::Game::START_ARRANGING_WITH_ITEM); bitStream.Write(bFirstTime); bitStream.Write(buildAreaID != LWOOBJID_EMPTY); @@ -306,7 +306,7 @@ void GameMessages::SendPlayerSetCameraCyclingMode(const LWOOBJID& objectID, cons CMSGHEADER; bitStream.Write(objectID); - bitStream.Write(eGameMessageType::PLAYER_SET_CAMERA_CYCLING_MODE); + bitStream.Write(MessageType::Game::PLAYER_SET_CAMERA_CYCLING_MODE); bitStream.Write(bAllowCyclingWhileDeadOnly); @@ -323,7 +323,7 @@ void GameMessages::SendPlayNDAudioEmitter(Entity* entity, const SystemAddress& s CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::PLAY_ND_AUDIO_EMITTER); + bitStream.Write(MessageType::Game::PLAY_ND_AUDIO_EMITTER); bitStream.Write0(); // callback message data {lwoobjid} bitStream.Write0(); // audio emitterid {uint32_t} @@ -345,7 +345,7 @@ void GameMessages::SendStartPathing(Entity* entity) { CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::START_PATHING); + bitStream.Write(MessageType::Game::START_PATHING); SEND_PACKET_BROADCAST; } @@ -355,7 +355,7 @@ void GameMessages::SendResetMissions(Entity* entity, const SystemAddress& sysAdd CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::RESET_MISSIONS); + bitStream.Write(MessageType::Game::RESET_MISSIONS); bitStream.Write(missionid != -1); if (missionid != -1) bitStream.Write(missionid); @@ -380,7 +380,7 @@ void GameMessages::SendPlatformResync(Entity* entity, const SystemAddress& sysAd } bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::PLATFORM_RESYNC); + bitStream.Write(MessageType::Game::PLATFORM_RESYNC); bool bReverse = false; int eCommand = 0; @@ -422,7 +422,7 @@ void GameMessages::SendRestoreToPostLoadStats(Entity* entity, const SystemAddres CBITSTREAM; CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::RESTORE_TO_POST_LOAD_STATS); + bitStream.Write(MessageType::Game::RESTORE_TO_POST_LOAD_STATS); SEND_PACKET; } @@ -430,7 +430,7 @@ void GameMessages::SendServerDoneLoadingAllObjects(Entity* entity, const SystemA CBITSTREAM; CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::SERVER_DONE_LOADING_ALL_OBJECTS); + bitStream.Write(MessageType::Game::SERVER_DONE_LOADING_ALL_OBJECTS); SEND_PACKET; } @@ -438,7 +438,7 @@ void GameMessages::SendChatModeUpdate(const LWOOBJID& objectID, eGameMasterLevel CBITSTREAM; CMSGHEADER; bitStream.Write(objectID); - bitStream.Write(eGameMessageType::UPDATE_CHAT_MODE); + bitStream.Write(MessageType::Game::UPDATE_CHAT_MODE); bitStream.Write(level); SEND_PACKET_BROADCAST; } @@ -447,7 +447,7 @@ void GameMessages::SendGMLevelBroadcast(const LWOOBJID& objectID, eGameMasterLev CBITSTREAM; CMSGHEADER; bitStream.Write(objectID); - bitStream.Write(eGameMessageType::SET_GM_LEVEL); + bitStream.Write(MessageType::Game::SET_GM_LEVEL); bitStream.Write1(); bitStream.Write(level); SEND_PACKET_BROADCAST; @@ -458,7 +458,7 @@ void GameMessages::SendAddItemToInventoryClientSync(Entity* entity, const System CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::ADD_ITEM_TO_INVENTORY_CLIENT_SYNC); + bitStream.Write(MessageType::Game::ADD_ITEM_TO_INVENTORY_CLIENT_SYNC); bitStream.Write(item->GetBound()); bitStream.Write(item->GetInfo().isBOE); bitStream.Write(item->GetInfo().isBOP); @@ -517,7 +517,7 @@ void GameMessages::SendNotifyClientFlagChange(const LWOOBJID& objectID, uint32_t CMSGHEADER; bitStream.Write(objectID); - bitStream.Write(eGameMessageType::NOTIFY_CLIENT_FLAG_CHANGE); + bitStream.Write(MessageType::Game::NOTIFY_CLIENT_FLAG_CHANGE); bitStream.Write(bFlag); bitStream.Write(iFlagID); @@ -529,7 +529,7 @@ void GameMessages::SendChangeObjectWorldState(const LWOOBJID& objectID, eObjectW CMSGHEADER; bitStream.Write(objectID); - bitStream.Write(eGameMessageType::CHANGE_OBJECT_WORLD_STATE); + bitStream.Write(MessageType::Game::CHANGE_OBJECT_WORLD_STATE); bitStream.Write(state); if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST @@ -547,7 +547,7 @@ void GameMessages::SendOfferMission(const LWOOBJID& entity, const SystemAddress& CMSGHEADER; bitStream.Write(offererID); - bitStream.Write(eGameMessageType::OFFER_MISSION); + bitStream.Write(MessageType::Game::OFFER_MISSION); bitStream.Write(missionID); bitStream.Write(offererID); @@ -558,7 +558,7 @@ void GameMessages::SendOfferMission(const LWOOBJID& entity, const SystemAddress& CMSGHEADER; bitStream.Write(entity); - bitStream.Write(eGameMessageType::OFFER_MISSION); + bitStream.Write(MessageType::Game::OFFER_MISSION); bitStream.Write(missionID); bitStream.Write(offererID); @@ -571,7 +571,7 @@ void GameMessages::SendNotifyMission(Entity* entity, const SystemAddress& sysAdd CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::NOTIFY_MISSION); + bitStream.Write(MessageType::Game::NOTIFY_MISSION); bitStream.Write(missionID); bitStream.Write(missionState); bitStream.Write(sendingRewards); @@ -584,7 +584,7 @@ void GameMessages::SendNotifyMissionTask(Entity* entity, const SystemAddress& sy CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::NOTIFY_MISSION_TASK); + bitStream.Write(MessageType::Game::NOTIFY_MISSION_TASK); bitStream.Write(missionID); bitStream.Write(taskMask); @@ -602,7 +602,7 @@ void GameMessages::SendModifyLEGOScore(Entity* entity, const SystemAddress& sysA CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::MODIFY_LEGO_SCORE); + bitStream.Write(MessageType::Game::MODIFY_LEGO_SCORE); bitStream.Write(score); bitStream.Write(sourceType != eLootSourceType::NONE); @@ -616,7 +616,7 @@ void GameMessages::SendUIMessageServerToSingleClient(Entity* entity, const Syste CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::UI_MESSAGE_SERVER_TO_SINGLE_CLIENT); + bitStream.Write(MessageType::Game::UI_MESSAGE_SERVER_TO_SINGLE_CLIENT); bitStream.Write(args); uint32_t strMessageNameLength = message.size(); @@ -635,7 +635,7 @@ void GameMessages::SendUIMessageServerToSingleClient(const std::string& message, LWOOBJID empty = 0; bitStream.Write(empty); - bitStream.Write(eGameMessageType::UI_MESSAGE_SERVER_TO_ALL_CLIENTS); // This is intentional to allow the server to send a ui message to a client via their system address. + bitStream.Write(MessageType::Game::UI_MESSAGE_SERVER_TO_ALL_CLIENTS); // This is intentional to allow the server to send a ui message to a client via their system address. bitStream.Write(args); uint32_t strMessageNameLength = message.size(); @@ -654,7 +654,7 @@ void GameMessages::SendUIMessageServerToAllClients(const std::string& message, A LWOOBJID empty = 0; bitStream.Write(empty); - bitStream.Write(eGameMessageType::UI_MESSAGE_SERVER_TO_ALL_CLIENTS); + bitStream.Write(MessageType::Game::UI_MESSAGE_SERVER_TO_ALL_CLIENTS); bitStream.Write(args); uint32_t strMessageNameLength = message.size(); @@ -672,7 +672,7 @@ void GameMessages::SendPlayEmbeddedEffectOnAllClientsNearObject(Entity* entity, CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::PLAY_EMBEDDED_EFFECT_ON_ALL_CLIENTS_NEAR_OBJECT); + bitStream.Write(MessageType::Game::PLAY_EMBEDDED_EFFECT_ON_ALL_CLIENTS_NEAR_OBJECT); bitStream.Write(effectName.length()); for (uint32_t k = 0; k < effectName.length(); k++) { @@ -693,7 +693,7 @@ void GameMessages::SendPlayFXEffect(const LWOOBJID& entity, int32_t effectID, co CMSGHEADER; bitStream.Write(entity); - bitStream.Write(eGameMessageType::PLAY_FX_EFFECT); + bitStream.Write(MessageType::Game::PLAY_FX_EFFECT); bitStream.Write(effectID != -1); if (effectID != -1) bitStream.Write(effectID); @@ -727,7 +727,7 @@ void GameMessages::SendStopFXEffect(Entity* entity, bool killImmediate, std::str CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::STOP_FX_EFFECT); + bitStream.Write(MessageType::Game::STOP_FX_EFFECT); bitStream.Write(killImmediate); bitStream.Write(name.size()); @@ -741,7 +741,7 @@ void GameMessages::SendBroadcastTextToChatbox(Entity* entity, const SystemAddres CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::BROADCAST_TEXT_TO_CHATBOX); + bitStream.Write(MessageType::Game::BROADCAST_TEXT_TO_CHATBOX); LWONameValue attribs; attribs.name = attrs; @@ -767,7 +767,7 @@ void GameMessages::SendSetCurrency(Entity* entity, int64_t currency, int lootTyp CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::SET_CURRENCY); + bitStream.Write(MessageType::Game::SET_CURRENCY); bitStream.Write(currency); @@ -797,7 +797,7 @@ void GameMessages::SendQuickBuildNotifyState(Entity* entity, eQuickBuildState pr CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::REBUILD_NOTIFY_STATE); + bitStream.Write(MessageType::Game::REBUILD_NOTIFY_STATE); bitStream.Write(prevState); bitStream.Write(state); @@ -811,7 +811,7 @@ void GameMessages::SendEnableQuickBuild(Entity* entity, bool enable, bool fail, CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::ENABLE_REBUILD); + bitStream.Write(MessageType::Game::ENABLE_REBUILD); bitStream.Write(enable); bitStream.Write(fail); @@ -831,7 +831,7 @@ void GameMessages::SendTerminateInteraction(const LWOOBJID& objectID, eTerminate CMSGHEADER; bitStream.Write(objectID); - bitStream.Write(eGameMessageType::TERMINATE_INTERACTION); + bitStream.Write(MessageType::Game::TERMINATE_INTERACTION); bitStream.Write(terminator); bitStream.Write(type); @@ -844,7 +844,7 @@ void GameMessages::SendDieNoImplCode(Entity* entity, const LWOOBJID& killerID, c CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::DIE); + bitStream.Write(MessageType::Game::DIE); bitStream.Write(bClientDeath); bitStream.Write(bSpawnLoot); bitStream.Write(deathType); @@ -867,7 +867,7 @@ void GameMessages::SendDie(Entity* entity, const LWOOBJID& killerID, const LWOOB bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::DIE); + bitStream.Write(MessageType::Game::DIE); bitStream.Write(bClientDeath); bitStream.Write(bSpawnLoot); @@ -903,7 +903,7 @@ void GameMessages::SendSetInventorySize(Entity* entity, int invType, int size) { CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::SET_INVENTORY_SIZE); + bitStream.Write(MessageType::Game::SET_INVENTORY_SIZE); bitStream.Write(invType); bitStream.Write(size); @@ -916,7 +916,7 @@ void GameMessages::SendSetEmoteLockState(Entity* entity, bool bLock, int emoteID CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::SET_EMOTE_LOCK_STATE); + bitStream.Write(MessageType::Game::SET_EMOTE_LOCK_STATE); bitStream.Write(bLock); bitStream.Write(emoteID); @@ -937,7 +937,7 @@ void GameMessages::SendSetJetPackMode(Entity* entity, bool use, bool bypassCheck CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::SET_JET_PACK_MODE); + bitStream.Write(MessageType::Game::SET_JET_PACK_MODE); bitStream.Write(bypassChecks); bitStream.Write(doHover); @@ -990,7 +990,7 @@ void GameMessages::SendResurrect(Entity* entity) { bool bRezImmediately = false; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::RESURRECT); + bitStream.Write(MessageType::Game::RESURRECT); bitStream.Write(bRezImmediately); SEND_PACKET_BROADCAST; @@ -1001,7 +1001,7 @@ void GameMessages::SendStop2DAmbientSound(Entity* entity, bool force, std::strin CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::STOP2_D_AMBIENT_SOUND); + bitStream.Write(MessageType::Game::STOP2_D_AMBIENT_SOUND); uint32_t audioGUIDSize = audioGUID.size(); @@ -1024,7 +1024,7 @@ void GameMessages::SendPlay2DAmbientSound(Entity* entity, std::string audioGUID, CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::PLAY2_D_AMBIENT_SOUND); + bitStream.Write(MessageType::Game::PLAY2_D_AMBIENT_SOUND); uint32_t audioGUIDSize = audioGUID.size(); bitStream.Write(audioGUIDSize); @@ -1042,7 +1042,7 @@ void GameMessages::SendSetNetworkScriptVar(Entity* entity, const SystemAddress& CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::SCRIPT_NETWORK_VAR_UPDATE); + bitStream.Write(MessageType::Game::SCRIPT_NETWORK_VAR_UPDATE); // FIXME: this is a bad place to need to do a conversion because we have no clue whether data is utf8 or plain ascii // an this has performance implications @@ -1101,7 +1101,7 @@ void GameMessages::SendDropClientLoot(Entity* entity, const LWOOBJID& sourceID, CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::DROP_CLIENT_LOOT); + bitStream.Write(MessageType::Game::DROP_CLIENT_LOOT); bitStream.Write(bUsePosition); @@ -1151,7 +1151,7 @@ void GameMessages::SendSetPlayerControlScheme(Entity* entity, eControlScheme con bool bSwitchCam = true; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::SET_PLAYER_CONTROL_SCHEME); + bitStream.Write(MessageType::Game::SET_PLAYER_CONTROL_SCHEME); bitStream.Write(bDelayCamSwitchIfInCinematic); bitStream.Write(bSwitchCam); @@ -1168,7 +1168,7 @@ void GameMessages::SendPlayerReachedRespawnCheckpoint(Entity* entity, const NiPo CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::PLAYER_REACHED_RESPAWN_CHECKPOINT); + bitStream.Write(MessageType::Game::PLAYER_REACHED_RESPAWN_CHECKPOINT); bitStream.Write(position.x); bitStream.Write(position.y); @@ -1200,7 +1200,7 @@ void GameMessages::SendAddSkill(Entity* entity, TSkillID skillID, BehaviorSlot s CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::ADD_SKILL); + bitStream.Write(MessageType::Game::ADD_SKILL); bitStream.Write(AICombatWeight != 0); if (AICombatWeight != 0) bitStream.Write(AICombatWeight); @@ -1232,7 +1232,7 @@ void GameMessages::SendRemoveSkill(Entity* entity, TSkillID skillID) { CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::REMOVE_SKILL); + bitStream.Write(MessageType::Game::REMOVE_SKILL); bitStream.Write(false); bitStream.Write(skillID); @@ -1261,7 +1261,7 @@ void GameMessages::SendFinishArrangingWithItem(Entity* entity, const LWOOBJID& b bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::FINISH_ARRANGING_WITH_ITEM); + bitStream.Write(MessageType::Game::FINISH_ARRANGING_WITH_ITEM); bitStream.Write(buildAreaID != LWOOBJID_EMPTY); if (buildAreaID != LWOOBJID_EMPTY) bitStream.Write(buildAreaID); @@ -1287,7 +1287,7 @@ void GameMessages::SendModularBuildEnd(Entity* entity) { CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::MODULAR_BUILD_END); + bitStream.Write(MessageType::Game::MODULAR_BUILD_END); SystemAddress sysAddr = entity->GetSystemAddress(); SEND_PACKET; @@ -1298,7 +1298,7 @@ void GameMessages::SendVendorOpenWindow(Entity* entity, const SystemAddress& sys CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::VENDOR_OPEN_WINDOW); + bitStream.Write(MessageType::Game::VENDOR_OPEN_WINDOW); SEND_PACKET; } @@ -1313,7 +1313,7 @@ void GameMessages::SendVendorStatusUpdate(Entity* entity, const SystemAddress& s auto vendorItems = vendor->GetInventory(); bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::VENDOR_STATUS_UPDATE); + bitStream.Write(MessageType::Game::VENDOR_STATUS_UPDATE); bitStream.Write(bUpdateOnly); bitStream.Write(vendorItems.size()); @@ -1334,7 +1334,7 @@ void GameMessages::SendVendorTransactionResult(Entity* entity, const SystemAddre bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::VENDOR_TRANSACTION_RESULT); + bitStream.Write(MessageType::Game::VENDOR_TRANSACTION_RESULT); bitStream.Write(result); SEND_PACKET; @@ -1360,7 +1360,7 @@ void GameMessages::SendRemoveItemFromInventory(Entity* entity, const SystemAddre LWOOBJID iTradeID = LWOOBJID_EMPTY; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::REMOVE_ITEM_FROM_INVENTORY); + bitStream.Write(MessageType::Game::REMOVE_ITEM_FROM_INVENTORY); bitStream.Write(bConfirmed); bitStream.Write(bDeleteItem); bitStream.Write(bOutSuccess); @@ -1392,7 +1392,7 @@ void GameMessages::SendConsumeClientItem(Entity* entity, bool bSuccess, LWOOBJID CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::CONSUME_CLIENT_ITEM); + bitStream.Write(MessageType::Game::CONSUME_CLIENT_ITEM); bitStream.Write(bSuccess); bitStream.Write(item); @@ -1405,7 +1405,7 @@ void GameMessages::SendUseItemResult(Entity* entity, LOT templateID, bool useIte CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::USE_ITEM_RESULT); + bitStream.Write(MessageType::Game::USE_ITEM_RESULT); bitStream.Write(templateID); bitStream.Write(useItemResult); @@ -1418,7 +1418,7 @@ void GameMessages::SendUseItemRequirementsResponse(LWOOBJID objectID, const Syst CMSGHEADER; bitStream.Write(objectID); - bitStream.Write(eGameMessageType::USE_ITEM_REQUIREMENTS_RESPONSE); + bitStream.Write(MessageType::Game::USE_ITEM_REQUIREMENTS_RESPONSE); bitStream.Write(itemResponse); @@ -1480,7 +1480,7 @@ void GameMessages::SendMatchResponse(Entity* entity, const SystemAddress& sysAdd CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::MATCH_RESPONSE); + bitStream.Write(MessageType::Game::MATCH_RESPONSE); bitStream.Write(response); SEND_PACKET; @@ -1491,7 +1491,7 @@ void GameMessages::SendMatchUpdate(Entity* entity, const SystemAddress& sysAddr, CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::MATCH_UPDATE); + bitStream.Write(MessageType::Game::MATCH_UPDATE); bitStream.Write(data.size()); for (char character : data) { bitStream.Write(character); @@ -1510,7 +1510,7 @@ void GameMessages::SendRequestActivitySummaryLeaderboardData(const LWOOBJID& obj CMSGHEADER; bitStream.Write(objectID); - bitStream.Write(eGameMessageType::REQUEST_ACTIVITY_SUMMARY_LEADERBOARD_DATA); + bitStream.Write(MessageType::Game::REQUEST_ACTIVITY_SUMMARY_LEADERBOARD_DATA); bitStream.Write(gameID != 0); if (gameID != 0) { @@ -1543,7 +1543,7 @@ void GameMessages::SendActivityPause(LWOOBJID objectId, bool pause, const System CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::ACTIVITY_PAUSE); + bitStream.Write(MessageType::Game::ACTIVITY_PAUSE); bitStream.Write(pause); if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST; @@ -1555,7 +1555,7 @@ void GameMessages::SendStartActivityTime(LWOOBJID objectId, float_t startTime, c CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::START_ACTIVITY_TIME); + bitStream.Write(MessageType::Game::START_ACTIVITY_TIME); bitStream.Write(startTime); if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST; @@ -1567,7 +1567,7 @@ void GameMessages::SendRequestActivityEnter(LWOOBJID objectId, const SystemAddre CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::REQUEST_ACTIVITY_ENTER); + bitStream.Write(MessageType::Game::REQUEST_ACTIVITY_ENTER); bitStream.Write(bStart); bitStream.Write(userID); @@ -1580,7 +1580,7 @@ void GameMessages::NotifyLevelRewards(LWOOBJID objectID, const SystemAddress& sy CMSGHEADER; bitStream.Write(objectID); - bitStream.Write(eGameMessageType::NOTIFY_LEVEL_REWARDS); + bitStream.Write(MessageType::Game::NOTIFY_LEVEL_REWARDS); bitStream.Write(level); bitStream.Write(sending_rewards); @@ -1601,7 +1601,7 @@ void GameMessages::SendSetShootingGalleryParams(LWOOBJID objectId, const SystemA CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::SET_SHOOTING_GALLERY_PARAMS); + bitStream.Write(MessageType::Game::SET_SHOOTING_GALLERY_PARAMS); /* bitStream.Write(cameraFOV); bitStream.Write(cooldown); @@ -1636,7 +1636,7 @@ void GameMessages::SendNotifyClientShootingGalleryScore(LWOOBJID objectId, const CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::NOTIFY_CLIENT_SHOOTING_GALLERY_SCORE); + bitStream.Write(MessageType::Game::NOTIFY_CLIENT_SHOOTING_GALLERY_SCORE); bitStream.Write(addTime); bitStream.Write(score); bitStream.Write(target); @@ -1667,7 +1667,7 @@ void GameMessages::SendActivitySummaryLeaderboardData(const LWOOBJID& objectID, CMSGHEADER; bitStream.Write(objectID); - bitStream.Write(eGameMessageType::SEND_ACTIVITY_SUMMARY_LEADERBOARD_DATA); + bitStream.Write(MessageType::Game::SEND_ACTIVITY_SUMMARY_LEADERBOARD_DATA); leaderboard->Serialize(bitStream); SEND_PACKET; @@ -1731,7 +1731,7 @@ void GameMessages::SendStartCelebrationEffect(Entity* entity, const SystemAddres CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::START_CELEBRATION_EFFECT); + bitStream.Write(MessageType::Game::START_CELEBRATION_EFFECT); bitStream.Write(0); //animation bitStream.Write0(); //No custom bg obj @@ -1760,7 +1760,7 @@ void GameMessages::SendSetRailMovement(const LWOOBJID& objectID, bool pathGoForw CMSGHEADER; bitStream.Write(objectID); - bitStream.Write(eGameMessageType::SET_RAIL_MOVEMENT); + bitStream.Write(MessageType::Game::SET_RAIL_MOVEMENT); bitStream.Write(pathGoForward); @@ -1794,7 +1794,7 @@ void GameMessages::SendStartRailMovement(const LWOOBJID& objectID, std::u16strin CMSGHEADER; bitStream.Write(objectID); - bitStream.Write(eGameMessageType::START_RAIL_MOVEMENT); + bitStream.Write(MessageType::Game::START_RAIL_MOVEMENT); bitStream.Write(damageImmune); bitStream.Write(noAggro); @@ -1854,7 +1854,7 @@ void GameMessages::SendNotifyClientObject(const LWOOBJID& objectID, std::u16stri CMSGHEADER; bitStream.Write(objectID); - bitStream.Write(eGameMessageType::NOTIFY_CLIENT_OBJECT); + bitStream.Write(MessageType::Game::NOTIFY_CLIENT_OBJECT); bitStream.Write(name.size()); for (auto character : name) { @@ -1883,7 +1883,7 @@ void GameMessages::SendNotifyClientZoneObject(const LWOOBJID& objectID, const st CMSGHEADER; bitStream.Write(objectID); - bitStream.Write(eGameMessageType::NOTIFY_CLIENT_ZONE_OBJECT); + bitStream.Write(MessageType::Game::NOTIFY_CLIENT_ZONE_OBJECT); bitStream.Write(name.size()); for (const auto& character : name) { @@ -1909,7 +1909,7 @@ void GameMessages::SendNotifyClientFailedPrecondition(LWOOBJID objectId, const S CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::NOTIFY_CLIENT_FAILED_PRECONDITION); + bitStream.Write(MessageType::Game::NOTIFY_CLIENT_FAILED_PRECONDITION); bitStream.Write(failedReason.size()); for (uint16_t character : failedReason) { @@ -1927,7 +1927,7 @@ void GameMessages::SendToggleGMInvis(LWOOBJID objectId, bool enabled, const Syst CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::TOGGLE_GM_INVIS); + bitStream.Write(MessageType::Game::TOGGLE_GM_INVIS); bitStream.Write(enabled); // does not matter? if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST; @@ -1939,7 +1939,7 @@ void GameMessages::SendSetName(LWOOBJID objectID, std::u16string name, const Sys CMSGHEADER; bitStream.Write(objectID); - bitStream.Write(eGameMessageType::SET_NAME); + bitStream.Write(MessageType::Game::SET_NAME); bitStream.Write(name.size()); @@ -1955,7 +1955,7 @@ void GameMessages::SendBBBSaveResponse(const LWOOBJID& objectId, const LWOOBJID& CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::BBB_SAVE_RESPONSE); + bitStream.Write(MessageType::Game::BBB_SAVE_RESPONSE); bitStream.Write(localID); @@ -1981,7 +1981,7 @@ void GameMessages::SendOpenPropertyVendor(const LWOOBJID objectId, const SystemA CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::OPEN_PROPERTY_VENDOR); + bitStream.Write(MessageType::Game::OPEN_PROPERTY_VENDOR); if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST; SEND_PACKET; @@ -1992,7 +1992,7 @@ void GameMessages::SendOpenPropertyManagment(const LWOOBJID objectId, const Syst CMSGHEADER; bitStream.Write(PropertyManagementComponent::Instance()->GetParent()->GetObjectID()); - bitStream.Write(eGameMessageType::OPEN_PROPERTY_MANAGEMENT); + bitStream.Write(MessageType::Game::OPEN_PROPERTY_MANAGEMENT); if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST; SEND_PACKET; @@ -2003,7 +2003,7 @@ void GameMessages::SendDownloadPropertyData(const LWOOBJID objectId, const Prope CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::DOWNLOAD_PROPERTY_DATA); + bitStream.Write(MessageType::Game::DOWNLOAD_PROPERTY_DATA); data.Serialize(bitStream); @@ -2018,7 +2018,7 @@ void GameMessages::SendPropertyRentalResponse(const LWOOBJID objectId, const LWO CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::PROPERTY_RENTAL_RESPONSE); + bitStream.Write(MessageType::Game::PROPERTY_RENTAL_RESPONSE); bitStream.Write(cloneId); bitStream.Write(code); @@ -2034,7 +2034,7 @@ void GameMessages::SendLockNodeRotation(Entity* entity, std::string nodeName) { CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::LOCK_NODE_ROTATION); + bitStream.Write(MessageType::Game::LOCK_NODE_ROTATION); bitStream.Write(nodeName.size()); for (char character : nodeName) { @@ -2049,7 +2049,7 @@ void GameMessages::SendSetBuildModeConfirmed(LWOOBJID objectId, const SystemAddr CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::SET_BUILD_MODE_CONFIRMED); + bitStream.Write(MessageType::Game::SET_BUILD_MODE_CONFIRMED); bitStream.Write(start); bitStream.Write(warnVisitors); @@ -2069,7 +2069,7 @@ void GameMessages::SendGetModelsOnProperty(LWOOBJID objectId, std::map(models.size()); @@ -2089,7 +2089,7 @@ void GameMessages::SendZonePropertyModelEquipped(LWOOBJID objectId, LWOOBJID pla CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::ZONE_PROPERTY_MODEL_EQUIPPED); + bitStream.Write(MessageType::Game::ZONE_PROPERTY_MODEL_EQUIPPED); bitStream.Write(playerId); bitStream.Write(propertyId); @@ -2104,7 +2104,7 @@ void GameMessages::SendPlaceModelResponse(LWOOBJID objectId, const SystemAddress CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::PLACE_MODEL_RESPONSE); + bitStream.Write(MessageType::Game::PLACE_MODEL_RESPONSE); bitStream.Write(position != NiPoint3Constant::ZERO); if (position != NiPoint3Constant::ZERO) { @@ -2136,7 +2136,7 @@ void GameMessages::SendUGCEquipPreCreateBasedOnEditMode(LWOOBJID objectId, const CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::HANDLE_UGC_POST_CREATE_BASED_ON_EDIT_MODE); + bitStream.Write(MessageType::Game::HANDLE_UGC_POST_CREATE_BASED_ON_EDIT_MODE); bitStream.Write(modelCount); bitStream.Write(model); @@ -2150,7 +2150,7 @@ void GameMessages::SendUGCEquipPostDeleteBasedOnEditMode(LWOOBJID objectId, cons CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::HANDLE_UGC_POST_DELETE_BASED_ON_EDIT_MODE); + bitStream.Write(MessageType::Game::HANDLE_UGC_POST_DELETE_BASED_ON_EDIT_MODE); bitStream.Write(inventoryItem); @@ -2200,7 +2200,7 @@ void GameMessages::HandleUnUseModel(RakNet::BitStream& inStream, Entity* entity, if (unknown) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::BLUEPRINT_SAVE_RESPONSE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::BLUEPRINT_SAVE_RESPONSE); bitStream.Write(LWOOBJID_EMPTY); //always zero so that a check on the client passes bitStream.Write(eBlueprintSaveResponseType::PlacementFailed); // Sending a non-zero error code here prevents the client from deleting its in progress build for some reason? bitStream.Write(0); @@ -2452,7 +2452,7 @@ void GameMessages::HandleBBBLoadItemRequest(RakNet::BitStream& inStream, Entity* void GameMessages::SendBlueprintLoadItemResponse(const SystemAddress& sysAddr, bool success, LWOOBJID oldItemId, LWOOBJID newItemId) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::BLUEPRINT_LOAD_RESPONSE_ITEMID); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::BLUEPRINT_LOAD_RESPONSE_ITEMID); bitStream.Write(success); bitStream.Write(oldItemId); bitStream.Write(newItemId); @@ -2464,7 +2464,7 @@ void GameMessages::SendSmash(Entity* entity, float force, float ghostOpacity, LW CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::SMASH); + bitStream.Write(MessageType::Game::SMASH); bitStream.Write(ignoreObjectVisibility); bitStream.Write(force); @@ -2479,7 +2479,7 @@ void GameMessages::SendUnSmash(Entity* entity, LWOOBJID builderID, float duratio CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::UN_SMASH); + bitStream.Write(MessageType::Game::UN_SMASH); bitStream.Write(builderID != LWOOBJID_EMPTY); if (builderID != LWOOBJID_EMPTY) bitStream.Write(builderID); @@ -2492,7 +2492,7 @@ void GameMessages::SendUnSmash(Entity* entity, LWOOBJID builderID, float duratio void GameMessages::HandleControlBehaviors(RakNet::BitStream& inStream, Entity* entity, const SystemAddress& sysAddr) { AMFDeserialize reader; - std::unique_ptr amfArguments{ static_cast(reader.Read(inStream)) }; + std::unique_ptr amfArguments{ static_cast(reader.Read(inStream).release()) }; if (amfArguments->GetValueType() != eAmf::Array) return; uint32_t commandLength{}; @@ -2644,7 +2644,7 @@ void GameMessages::HandleBBBSaveRequest(RakNet::BitStream& inStream, Entity* ent //Tell the client their model is saved: (this causes us to actually pop out of our current state): CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::BLUEPRINT_SAVE_RESPONSE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::BLUEPRINT_SAVE_RESPONSE); bitStream.Write(localId); bitStream.Write(eBlueprintSaveResponseType::EverythingWorked); bitStream.Write(1); @@ -2774,7 +2774,7 @@ void GameMessages::SendPlayCinematic(LWOOBJID objectId, std::u16string pathName, CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::PLAY_CINEMATIC); + bitStream.Write(MessageType::Game::PLAY_CINEMATIC); bitStream.Write(allowGhostUpdates); bitStream.Write(bCloseMultiInteract); @@ -2813,7 +2813,7 @@ void GameMessages::SendEndCinematic(LWOOBJID objectId, std::u16string pathName, CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::END_CINEMATIC); + bitStream.Write(MessageType::Game::END_CINEMATIC); bitStream.Write(leadOut != -1); if (leadOut != -1) bitStream.Write(leadOut); @@ -2886,7 +2886,7 @@ void GameMessages::SendSetStunned(LWOOBJID objectId, eStateChangeType stateChang CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::SET_STUNNED); + bitStream.Write(MessageType::Game::SET_STUNNED); bitStream.Write(originator != LWOOBJID_EMPTY); if (originator != LWOOBJID_EMPTY) bitStream.Write(originator); @@ -2935,7 +2935,7 @@ void GameMessages::SendSetStunImmunity(LWOOBJID target, eStateChangeType state, CMSGHEADER; bitStream.Write(target); - bitStream.Write(eGameMessageType::SET_STUN_IMMUNITY); + bitStream.Write(MessageType::Game::SET_STUN_IMMUNITY); bitStream.Write(originator != LWOOBJID_EMPTY); if (originator != LWOOBJID_EMPTY) bitStream.Write(originator); @@ -2968,7 +2968,7 @@ void GameMessages::SendSetStatusImmunity(LWOOBJID objectId, eStateChangeType sta CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::SET_STATUS_IMMUNITY); + bitStream.Write(MessageType::Game::SET_STATUS_IMMUNITY); bitStream.Write(state); @@ -2991,7 +2991,7 @@ void GameMessages::SendOrientToAngle(LWOOBJID objectId, bool bRelativeToCurrent, CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::ORIENT_TO_ANGLE); + bitStream.Write(MessageType::Game::ORIENT_TO_ANGLE); bitStream.Write(bRelativeToCurrent); bitStream.Write(fAngle); @@ -3006,7 +3006,7 @@ void GameMessages::SendAddRunSpeedModifier(LWOOBJID objectId, LWOOBJID caster, u CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::ADD_RUN_SPEED_MODIFIER); + bitStream.Write(MessageType::Game::ADD_RUN_SPEED_MODIFIER); bitStream.Write(caster != LWOOBJID_EMPTY); if (caster != LWOOBJID_EMPTY) bitStream.Write(caster); @@ -3023,7 +3023,7 @@ void GameMessages::SendRemoveRunSpeedModifier(LWOOBJID objectId, uint32_t modifi CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::REMOVE_RUN_SPEED_MODIFIER); + bitStream.Write(MessageType::Game::REMOVE_RUN_SPEED_MODIFIER); bitStream.Write(modifier != 500); if (modifier != 500) bitStream.Write(modifier); @@ -3037,7 +3037,7 @@ void GameMessages::SendPropertyEntranceBegin(LWOOBJID objectId, const SystemAddr CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::PROPERTY_ENTRANCE_BEGIN); + bitStream.Write(MessageType::Game::PROPERTY_ENTRANCE_BEGIN); if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST; SEND_PACKET; @@ -3048,7 +3048,7 @@ void GameMessages::SendPropertySelectQuery(LWOOBJID objectId, int32_t navOffset, CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::PROPERTY_SELECT_QUERY); + bitStream.Write(MessageType::Game::PROPERTY_SELECT_QUERY); bitStream.Write(navOffset); bitStream.Write(thereAreMore); @@ -3071,7 +3071,7 @@ void GameMessages::SendNotifyObject(LWOOBJID objectId, LWOOBJID objIDSender, std CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::NOTIFY_OBJECT); + bitStream.Write(MessageType::Game::NOTIFY_OBJECT); bitStream.Write(objIDSender); bitStream.Write(name.size()); @@ -3111,7 +3111,7 @@ void GameMessages::SendTeamPickupItem(LWOOBJID objectId, LWOOBJID lootID, LWOOBJ CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::TEAM_PICKUP_ITEM); + bitStream.Write(MessageType::Game::TEAM_PICKUP_ITEM); bitStream.Write(lootID); bitStream.Write(lootOwnerID); @@ -3127,7 +3127,7 @@ void GameMessages::SendServerTradeInvite(LWOOBJID objectId, bool bNeedInvitePopU CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::SERVER_TRADE_INVITE); + bitStream.Write(MessageType::Game::SERVER_TRADE_INVITE); bitStream.Write(bNeedInvitePopUp); bitStream.Write(i64Requestor); @@ -3145,7 +3145,7 @@ void GameMessages::SendServerTradeInitialReply(LWOOBJID objectId, LWOOBJID i64In CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::SERVER_TRADE_INITIAL_REPLY); + bitStream.Write(MessageType::Game::SERVER_TRADE_INITIAL_REPLY); bitStream.Write(i64Invitee); bitStream.Write(resultType); @@ -3163,7 +3163,7 @@ void GameMessages::SendServerTradeFinalReply(LWOOBJID objectId, bool bResult, LW CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::SERVER_TRADE_FINAL_REPLY); + bitStream.Write(MessageType::Game::SERVER_TRADE_FINAL_REPLY); bitStream.Write(bResult); bitStream.Write(i64Invitee); @@ -3181,7 +3181,7 @@ void GameMessages::SendServerTradeAccept(LWOOBJID objectId, bool bFirst, const S CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::SERVER_TRADE_ACCEPT); + bitStream.Write(MessageType::Game::SERVER_TRADE_ACCEPT); bitStream.Write(bFirst); @@ -3194,7 +3194,7 @@ void GameMessages::SendServerTradeCancel(LWOOBJID objectId, const SystemAddress& CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::SERVER_TRADE_CANCEL); + bitStream.Write(MessageType::Game::SERVER_TRADE_CANCEL); if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST; SEND_PACKET; @@ -3205,7 +3205,7 @@ void GameMessages::SendServerTradeUpdate(LWOOBJID objectId, uint64_t coins, cons CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::SERVER_TRADE_UPDATE); + bitStream.Write(MessageType::Game::SERVER_TRADE_UPDATE); bitStream.Write(false); bitStream.Write(coins); @@ -3383,7 +3383,7 @@ void GameMessages::SendNotifyPetTamingMinigame(LWOOBJID objectId, LWOOBJID petId CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::NOTIFY_PET_TAMING_MINIGAME); + bitStream.Write(MessageType::Game::NOTIFY_PET_TAMING_MINIGAME); bitStream.Write(petId); bitStream.Write(playerTamingId); @@ -3405,7 +3405,7 @@ void GameMessages::SendNotifyTamingModelLoadedOnServer(LWOOBJID objectId, const CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::NOTIFY_TAMING_MODEL_LOADED_ON_SERVER); + bitStream.Write(MessageType::Game::NOTIFY_TAMING_MODEL_LOADED_ON_SERVER); if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST; SEND_PACKET; @@ -3416,7 +3416,7 @@ void GameMessages::SendNotifyPetTamingPuzzleSelected(LWOOBJID objectId, const st CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::NOTIFY_TAMING_PUZZLE_SELECTED); + bitStream.Write(MessageType::Game::NOTIFY_TAMING_PUZZLE_SELECTED); bitStream.Write(bricks.size()); for (const auto& brick : bricks) { @@ -3433,7 +3433,7 @@ void GameMessages::SendPetTamingTryBuildResult(LWOOBJID objectId, bool bSuccess, CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::PET_TAMING_TRY_BUILD_RESULT); + bitStream.Write(MessageType::Game::PET_TAMING_TRY_BUILD_RESULT); bitStream.Write(bSuccess); bitStream.Write(iNumCorrect != 0); @@ -3448,7 +3448,7 @@ void GameMessages::SendPetResponse(LWOOBJID objectId, LWOOBJID objIDPet, int32_t CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::PET_RESPONSE); + bitStream.Write(MessageType::Game::PET_RESPONSE); bitStream.Write(objIDPet); bitStream.Write(iPetCommandType); @@ -3464,7 +3464,7 @@ void GameMessages::SendAddPetToPlayer(LWOOBJID objectId, int32_t iElementalType, CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::ADD_PET_TO_PLAYER); + bitStream.Write(MessageType::Game::ADD_PET_TO_PLAYER); bitStream.Write(iElementalType); bitStream.Write(name.size()); @@ -3484,7 +3484,7 @@ void GameMessages::SendRegisterPetID(LWOOBJID objectId, LWOOBJID objID, const Sy CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::REGISTER_PET_ID); + bitStream.Write(MessageType::Game::REGISTER_PET_ID); bitStream.Write(objID); @@ -3497,7 +3497,7 @@ void GameMessages::SendRegisterPetDBID(LWOOBJID objectId, LWOOBJID petDBID, cons CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::REGISTER_PET_DBID); + bitStream.Write(MessageType::Game::REGISTER_PET_DBID); bitStream.Write(petDBID); @@ -3510,7 +3510,7 @@ void GameMessages::SendMarkInventoryItemAsActive(LWOOBJID objectId, bool bActive CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::MARK_INVENTORY_ITEM_AS_ACTIVE); + bitStream.Write(MessageType::Game::MARK_INVENTORY_ITEM_AS_ACTIVE); bitStream.Write(bActive); @@ -3529,7 +3529,7 @@ void GameMessages::SendClientExitTamingMinigame(LWOOBJID objectId, bool bVolunta CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::CLIENT_EXIT_TAMING_MINIGAME); + bitStream.Write(MessageType::Game::CLIENT_EXIT_TAMING_MINIGAME); bitStream.Write(bVoluntaryExit); @@ -3542,7 +3542,7 @@ void GameMessages::SendShowPetActionButton(const LWOOBJID objectId, const ePetAb CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::SHOW_PET_ACTION_BUTTON); + bitStream.Write(MessageType::Game::SHOW_PET_ACTION_BUTTON); bitStream.Write(petAbility); bitStream.Write(bShow); @@ -3556,7 +3556,7 @@ void GameMessages::SendPlayEmote(LWOOBJID objectId, int32_t emoteID, LWOOBJID ta CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::PLAY_EMOTE); + bitStream.Write(MessageType::Game::PLAY_EMOTE); bitStream.Write(emoteID); bitStream.Write(target); @@ -3570,7 +3570,7 @@ void GameMessages::SendRemoveBuff(Entity* entity, bool fromUnEquip, bool removeI CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::REMOVE_BUFF); + bitStream.Write(MessageType::Game::REMOVE_BUFF); bitStream.Write(false); // bFromRemoveBehavior but setting this to true makes the GM not do anything on the client? bitStream.Write(fromUnEquip); @@ -3585,7 +3585,7 @@ void GameMessages::SendBouncerActiveStatus(LWOOBJID objectId, bool bActive, cons CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::BOUNCER_ACTIVE_STATUS); + bitStream.Write(MessageType::Game::BOUNCER_ACTIVE_STATUS); bitStream.Write(bActive); @@ -3599,7 +3599,7 @@ void GameMessages::SendSetPetName(LWOOBJID objectId, std::u16string name, LWOOBJ CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::SET_PET_NAME); + bitStream.Write(MessageType::Game::SET_PET_NAME); bitStream.Write(name.size()); for (const auto character : name) { @@ -3619,7 +3619,7 @@ void GameMessages::SendSetPetNameModerated(LWOOBJID objectId, LWOOBJID petDBID, CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::SET_PET_NAME_MODERATED); + bitStream.Write(MessageType::Game::SET_PET_NAME_MODERATED); bitStream.Write(petDBID != LWOOBJID_EMPTY); if (petDBID != LWOOBJID_EMPTY) bitStream.Write(petDBID); @@ -3636,7 +3636,7 @@ void GameMessages::SendPetNameChanged(LWOOBJID objectId, int32_t moderationStatu CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::PET_NAME_CHANGED); + bitStream.Write(MessageType::Game::PET_NAME_CHANGED); bitStream.Write(moderationStatus); @@ -3885,7 +3885,7 @@ void GameMessages::SendDisplayZoneSummary(LWOOBJID objectId, const SystemAddress CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::DISPLAY_ZONE_SUMMARY); + bitStream.Write(MessageType::Game::DISPLAY_ZONE_SUMMARY); bitStream.Write(isPropertyMap); bitStream.Write(isZoneStart); @@ -3903,7 +3903,7 @@ void GameMessages::SendNotifyNotEnoughInvSpace(LWOOBJID objectId, uint32_t freeS CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::VEHICLE_NOTIFY_FINISHED_RACE); + bitStream.Write(MessageType::Game::VEHICLE_NOTIFY_FINISHED_RACE); bitStream.Write(freeSlotsNeeded); bitStream.Write(inventoryType != 0); @@ -3918,7 +3918,7 @@ void GameMessages::SendDisplayMessageBox(LWOOBJID objectId, bool bShow, LWOOBJID CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::DISPLAY_MESSAGE_BOX); + bitStream.Write(MessageType::Game::DISPLAY_MESSAGE_BOX); bitStream.Write(bShow); bitStream.Write(callbackClient); @@ -3945,12 +3945,12 @@ void GameMessages::SendDisplayMessageBox(LWOOBJID objectId, bool bShow, LWOOBJID } void GameMessages::SendDisplayChatBubble(LWOOBJID objectId, const std::u16string& text, const SystemAddress& sysAddr) { - // eGameMessageType::DISPLAY_CHAT_BUBBLE + // MessageType::Game::DISPLAY_CHAT_BUBBLE CBITSTREAM; CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::DISPLAY_CHAT_BUBBLE); + bitStream.Write(MessageType::Game::DISPLAY_CHAT_BUBBLE); bitStream.Write(text.size()); for (const auto character : text) { @@ -3967,7 +3967,7 @@ void GameMessages::SendChangeIdleFlags(LWOOBJID objectId, eAnimationFlags flagsO CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::CHANGE_IDLE_FLAGS); + bitStream.Write(MessageType::Game::CHANGE_IDLE_FLAGS); bitStream.Write(flagsOff != eAnimationFlags::IDLE_NONE); if (flagsOff != eAnimationFlags::IDLE_NONE) bitStream.Write(flagsOff); bitStream.Write(flagsOn != eAnimationFlags::IDLE_NONE); @@ -3981,7 +3981,7 @@ void GameMessages::SendSetMountInventoryID(Entity* entity, const LWOOBJID& objec CBITSTREAM; CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::SET_MOUNT_INVENTORY_ID); + bitStream.Write(MessageType::Game::SET_MOUNT_INVENTORY_ID); bitStream.Write(objectID); SEND_PACKET_BROADCAST; @@ -4190,7 +4190,7 @@ void GameMessages::SendUpdateReputation(const LWOOBJID objectId, const int64_t r CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::UPDATE_REPUTATION); + bitStream.Write(MessageType::Game::UPDATE_REPUTATION); bitStream.Write(reputation); @@ -4256,7 +4256,7 @@ void GameMessages::SendModuleAssemblyDBDataForClient(LWOOBJID objectId, LWOOBJID CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::MODULE_ASSEMBLY_DB_DATA_FOR_CLIENT); + bitStream.Write(MessageType::Game::MODULE_ASSEMBLY_DB_DATA_FOR_CLIENT); bitStream.Write(assemblyID); @@ -4275,7 +4275,7 @@ void GameMessages::SendNotifyVehicleOfRacingObject(LWOOBJID objectId, LWOOBJID r CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::NOTIFY_VEHICLE_OF_RACING_OBJECT); + bitStream.Write(MessageType::Game::NOTIFY_VEHICLE_OF_RACING_OBJECT); bitStream.Write(racingObjectID != LWOOBJID_EMPTY); if (racingObjectID != LWOOBJID_EMPTY) bitStream.Write(racingObjectID); @@ -4290,7 +4290,7 @@ void GameMessages::SendRacingPlayerLoaded(LWOOBJID objectId, LWOOBJID playerID, CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::RACING_PLAYER_LOADED); + bitStream.Write(MessageType::Game::RACING_PLAYER_LOADED); bitStream.Write(playerID); bitStream.Write(vehicleID); @@ -4305,7 +4305,7 @@ void GameMessages::SendVehicleUnlockInput(LWOOBJID objectId, bool bLockWheels, c CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::VEHICLE_UNLOCK_INPUT); + bitStream.Write(MessageType::Game::VEHICLE_UNLOCK_INPUT); bitStream.Write(bLockWheels); @@ -4319,7 +4319,7 @@ void GameMessages::SendVehicleSetWheelLockState(LWOOBJID objectId, bool bExtraFr CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::VEHICLE_SET_WHEEL_LOCK_STATE); + bitStream.Write(MessageType::Game::VEHICLE_SET_WHEEL_LOCK_STATE); bitStream.Write(bExtraFriction); bitStream.Write(bLocked); @@ -4334,7 +4334,7 @@ void GameMessages::SendRacingSetPlayerResetInfo(LWOOBJID objectId, int32_t curre CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::RACING_SET_PLAYER_RESET_INFO); + bitStream.Write(MessageType::Game::RACING_SET_PLAYER_RESET_INFO); bitStream.Write(currentLap); bitStream.Write(furthestResetPlane); @@ -4352,7 +4352,7 @@ void GameMessages::SendRacingResetPlayerToLastReset(LWOOBJID objectId, LWOOBJID CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::RACING_RESET_PLAYER_TO_LAST_RESET); + bitStream.Write(MessageType::Game::RACING_RESET_PLAYER_TO_LAST_RESET); bitStream.Write(playerID); @@ -4365,7 +4365,7 @@ void GameMessages::SendVehicleStopBoost(Entity* targetEntity, const SystemAddres CMSGHEADER; bitStream.Write(targetEntity->GetObjectID()); - bitStream.Write(eGameMessageType::VEHICLE_STOP_BOOST); + bitStream.Write(MessageType::Game::VEHICLE_STOP_BOOST); bitStream.Write(affectPassive); @@ -4377,7 +4377,7 @@ void GameMessages::SendSetResurrectRestoreValues(Entity* targetEntity, int32_t a CMSGHEADER; bitStream.Write(targetEntity->GetObjectID()); - bitStream.Write(eGameMessageType::SET_RESURRECT_RESTORE_VALUES); + bitStream.Write(MessageType::Game::SET_RESURRECT_RESTORE_VALUES); bitStream.Write(armorRestore != -1); if (armorRestore != -1) bitStream.Write(armorRestore); @@ -4396,7 +4396,7 @@ void GameMessages::SendNotifyRacingClient(LWOOBJID objectId, int32_t eventType, CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::NOTIFY_RACING_CLIENT); + bitStream.Write(MessageType::Game::NOTIFY_RACING_CLIENT); bitStream.Write(eventType != 0); if (eventType != 0) bitStream.Write(eventType); @@ -4422,7 +4422,7 @@ void GameMessages::SendActivityEnter(LWOOBJID objectId, const SystemAddress& sys CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::ACTIVITY_ENTER); + bitStream.Write(MessageType::Game::ACTIVITY_ENTER); if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST; SEND_PACKET; @@ -4434,7 +4434,7 @@ void GameMessages::SendActivityStart(LWOOBJID objectId, const SystemAddress& sys CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::ACTIVITY_START); + bitStream.Write(MessageType::Game::ACTIVITY_START); if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST; SEND_PACKET; @@ -4446,7 +4446,7 @@ void GameMessages::SendActivityExit(LWOOBJID objectId, const SystemAddress& sysA CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::ACTIVITY_EXIT); + bitStream.Write(MessageType::Game::ACTIVITY_EXIT); if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST; SEND_PACKET; @@ -4458,7 +4458,7 @@ void GameMessages::SendActivityStop(LWOOBJID objectId, bool bExit, bool bUserCan CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::ACTIVITY_STOP); + bitStream.Write(MessageType::Game::ACTIVITY_STOP); bitStream.Write(bExit); bitStream.Write(bUserCancel); @@ -4473,7 +4473,7 @@ void GameMessages::SendVehicleAddPassiveBoostAction(LWOOBJID objectId, const Sys CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::VEHICLE_ADD_PASSIVE_BOOST_ACTION); + bitStream.Write(MessageType::Game::VEHICLE_ADD_PASSIVE_BOOST_ACTION); if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST; SEND_PACKET; @@ -4485,7 +4485,7 @@ void GameMessages::SendVehicleRemovePassiveBoostAction(LWOOBJID objectId, const CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::VEHICLE_REMOVE_PASSIVE_BOOST_ACTION); + bitStream.Write(MessageType::Game::VEHICLE_REMOVE_PASSIVE_BOOST_ACTION); if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST; SEND_PACKET; @@ -4497,7 +4497,7 @@ void GameMessages::SendVehicleNotifyFinishedRace(LWOOBJID objectId, const System CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::VEHICLE_NOTIFY_FINISHED_RACE); + bitStream.Write(MessageType::Game::VEHICLE_NOTIFY_FINISHED_RACE); if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST; SEND_PACKET; @@ -4511,7 +4511,7 @@ void GameMessages::SendAddBuff(LWOOBJID& objectID, const LWOOBJID& casterID, uin CMSGHEADER; bitStream.Write(objectID); - bitStream.Write(eGameMessageType::ADD_BUFF); + bitStream.Write(MessageType::Game::ADD_BUFF); bitStream.Write(addedByTeammate); // Added by teammate bitStream.Write(applyOnTeammates); // Apply on teammates @@ -4579,13 +4579,13 @@ void GameMessages::HandleRequestMoveItemBetweenInventoryTypes(RakNet::BitStream& if (!item) { SendResponseMoveItemBetweenInventoryTypes(entity->GetObjectID(), sysAddr, invTypeDst, invTypeSrc, eReponseMoveItemBetweenInventoryTypeCode::FAIL_ITEM_NOT_FOUND); return; - } + } if (item->GetLot() == 6086) { // Thinking hat SendResponseMoveItemBetweenInventoryTypes(entity->GetObjectID(), sysAddr, invTypeDst, invTypeSrc, eReponseMoveItemBetweenInventoryTypeCode::FAIL_CANT_MOVE_THINKING_HAT); return; } - + auto* destInv = inventoryComponent->GetInventory(invTypeDst); if (destInv && destInv->GetEmptySlots() == 0) { SendResponseMoveItemBetweenInventoryTypes(entity->GetObjectID(), sysAddr, invTypeDst, invTypeSrc, eReponseMoveItemBetweenInventoryTypeCode::FAIL_INV_FULL); @@ -4611,7 +4611,7 @@ void GameMessages::SendResponseMoveItemBetweenInventoryTypes(LWOOBJID objectId, CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::RESPONSE_MOVE_ITEM_BETWEEN_INVENTORY_TYPES); + bitStream.Write(MessageType::Game::RESPONSE_MOVE_ITEM_BETWEEN_INVENTORY_TYPES); bitStream.Write(inventoryTypeDestination != eInventoryType::ITEMS); if (inventoryTypeDestination != eInventoryType::ITEMS) bitStream.Write(inventoryTypeDestination); @@ -4631,7 +4631,7 @@ void GameMessages::SendShowActivityCountdown(LWOOBJID objectId, bool bPlayAdditi CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::SHOW_ACTIVITY_COUNTDOWN); + bitStream.Write(MessageType::Game::SHOW_ACTIVITY_COUNTDOWN); bitStream.Write(bPlayAdditionalSound); @@ -5412,7 +5412,7 @@ void GameMessages::SendSetGravityScale(const LWOOBJID& target, const float effec CMSGHEADER; bitStream.Write(target); - bitStream.Write(eGameMessageType::SET_GRAVITY_SCALE); + bitStream.Write(MessageType::Game::SET_GRAVITY_SCALE); bitStream.Write(effectScale); @@ -5899,7 +5899,7 @@ void GameMessages::SendGetHotPropertyData(RakNet::BitStream& inStream, Entity* e // TODO This needs to be implemented when reputation is implemented for getting hot properties. /** bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::SEND_HOT_PROPERTY_DATA); + bitStream.Write(MessageType::Game::SEND_HOT_PROPERTY_DATA); std::vector t = {25166, 25188, 25191, 25194}; bitStream.Write(4); for (uint8_t i = 0; i < 4; i++) { @@ -6073,7 +6073,7 @@ void GameMessages::SendActivateBubbleBuffFromServer(LWOOBJID objectId, const Sys CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::ACTIVATE_BUBBLE_BUFF_FROM_SERVER); + bitStream.Write(MessageType::Game::ACTIVATE_BUBBLE_BUFF_FROM_SERVER); if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST; SEND_PACKET; @@ -6084,7 +6084,7 @@ void GameMessages::SendDeactivateBubbleBuffFromServer(LWOOBJID objectId, const S CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::DEACTIVATE_BUBBLE_BUFF_FROM_SERVER); + bitStream.Write(MessageType::Game::DEACTIVATE_BUBBLE_BUFF_FROM_SERVER); if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST; SEND_PACKET; @@ -6102,7 +6102,7 @@ void GameMessages::SendSetNamebillboardState(const SystemAddress& sysAddr, LWOOB CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::SET_NAME_BILLBOARD_STATE); + bitStream.Write(MessageType::Game::SET_NAME_BILLBOARD_STATE); // Technically these bits would be written, however the client does not // contain a deserialize method to actually deserialize, so we are leaving it out. @@ -6120,7 +6120,7 @@ void GameMessages::SendShowBillboardInteractIcon(const SystemAddress& sysAddr, L CMSGHEADER; bitStream.Write(objectId); - bitStream.Write(eGameMessageType::SHOW_BILLBOARD_INTERACT_ICON); + bitStream.Write(MessageType::Game::SHOW_BILLBOARD_INTERACT_ICON); if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST else SEND_PACKET @@ -6244,7 +6244,7 @@ void GameMessages::SendSlashCommandFeedbackText(Entity* entity, std::u16string t CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::SLASH_COMMAND_TEXT_FEEDBACK); + bitStream.Write(MessageType::Game::SLASH_COMMAND_TEXT_FEEDBACK); bitStream.Write(text.size()); bitStream.Write(text); auto sysAddr = entity->GetSystemAddress(); @@ -6319,7 +6319,7 @@ void GameMessages::SendForceCameraTargetCycle(Entity* entity, bool bForceCycling CMSGHEADER; bitStream.Write(entity->GetObjectID()); - bitStream.Write(eGameMessageType::FORCE_CAMERA_TARGET_CYCLE); + bitStream.Write(MessageType::Game::FORCE_CAMERA_TARGET_CYCLE); bitStream.Write(bForceCycling); bitStream.Write(cyclingMode != eCameraTargetCyclingMode::ALLOW_CYCLE_TEAMMATES); if (cyclingMode != eCameraTargetCyclingMode::ALLOW_CYCLE_TEAMMATES) bitStream.Write(cyclingMode); diff --git a/dGame/dGameMessages/PropertySelectQueryProperty.cpp b/dGame/dGameMessages/PropertySelectQueryProperty.cpp index 2a256764..d388a71a 100644 --- a/dGame/dGameMessages/PropertySelectQueryProperty.cpp +++ b/dGame/dGameMessages/PropertySelectQueryProperty.cpp @@ -29,10 +29,10 @@ void PropertySelectQueryProperty::Serialize(RakNet::BitStream& stream) const { stream.Write(IsOwned); stream.Write(AccessType); stream.Write(DateLastPublished); - stream.Write(PerformanceIndex); stream.Write(PerformanceCost); } void PropertySelectQueryProperty::Deserialize(RakNet::BitStream& stream) const { // Do we need this? + // no } diff --git a/dGame/dGameMessages/PropertySelectQueryProperty.h b/dGame/dGameMessages/PropertySelectQueryProperty.h index 47d795a7..85d389dd 100644 --- a/dGame/dGameMessages/PropertySelectQueryProperty.h +++ b/dGame/dGameMessages/PropertySelectQueryProperty.h @@ -5,8 +5,7 @@ #include "Entity.h" -class PropertySelectQueryProperty final -{ +class PropertySelectQueryProperty final { public: void Serialize(RakNet::BitStream& stream) const; @@ -23,9 +22,8 @@ public: bool IsAlt = false; // Whether or not the property is owned by an alt of the account owner bool IsOwned = false; // Whether or not the property is owned uint32_t AccessType = 0; // The privacy option of the property - uint32_t DateLastPublished = 0; // The last day the property was published + uint64_t DateLastPublished = 0; // The last day the property was published float PerformanceCost = 0; // The performance cost of the property - uint32_t PerformanceIndex = 0; // The performance index of the property? Always 0? }; #endif diff --git a/dGame/dGameMessages/RequestServerProjectileImpact.h b/dGame/dGameMessages/RequestServerProjectileImpact.h index c15090c0..394bd9c7 100644 --- a/dGame/dGameMessages/RequestServerProjectileImpact.h +++ b/dGame/dGameMessages/RequestServerProjectileImpact.h @@ -2,7 +2,7 @@ #define __REQUESTSERVERPROJECTILEIMPACT__H__ #include "dCommonVars.h" -#include "eGameMessageType.h" +#include "MessageType/Game.h" /* Notifying the server that a locally owned projectile impacted. Sent to the caster of the projectile should always be the local char. */ @@ -27,7 +27,7 @@ public: } void Serialize(RakNet::BitStream& stream) { - stream.Write(eGameMessageType::REQUEST_SERVER_PROJECTILE_IMPACT); + stream.Write(MessageType::Game::REQUEST_SERVER_PROJECTILE_IMPACT); stream.Write(i64LocalID != LWOOBJID_EMPTY); if (i64LocalID != LWOOBJID_EMPTY) stream.Write(i64LocalID); diff --git a/dGame/dGameMessages/StartSkill.h b/dGame/dGameMessages/StartSkill.h index bc0f18d7..15791039 100644 --- a/dGame/dGameMessages/StartSkill.h +++ b/dGame/dGameMessages/StartSkill.h @@ -4,7 +4,7 @@ #include "dCommonVars.h" #include "NiPoint3.h" #include "NiQuaternion.h" -#include "eGameMessageType.h" +#include "MessageType/Game.h" /** * Same as sync skill but with different network options. An echo down to other clients that need to play the skill. @@ -44,7 +44,7 @@ public: } void Serialize(RakNet::BitStream& stream) { - stream.Write(eGameMessageType::START_SKILL); + stream.Write(MessageType::Game::START_SKILL); stream.Write(bUsedMouse); diff --git a/dGame/dGameMessages/SyncSkill.h b/dGame/dGameMessages/SyncSkill.h index b881d270..fb5525bc 100644 --- a/dGame/dGameMessages/SyncSkill.h +++ b/dGame/dGameMessages/SyncSkill.h @@ -5,7 +5,7 @@ #include #include "BitStream.h" -#include "eGameMessageType.h" +#include "MessageType/Game.h" /* Message to synchronize a skill cast */ class SyncSkill { @@ -29,7 +29,7 @@ public: } void Serialize(RakNet::BitStream& stream) { - stream.Write(eGameMessageType::SYNC_SKILL); + stream.Write(MessageType::Game::SYNC_SKILL); stream.Write(bDone); uint32_t sBitStreamLength = sBitStream.length(); diff --git a/dGame/dPropertyBehaviors/BlockDefinition.cpp b/dGame/dPropertyBehaviors/BlockDefinition.cpp index e67a90d8..17378423 100644 --- a/dGame/dPropertyBehaviors/BlockDefinition.cpp +++ b/dGame/dPropertyBehaviors/BlockDefinition.cpp @@ -2,7 +2,7 @@ BlockDefinition BlockDefinition::blockDefinitionDefault{}; -BlockDefinition::BlockDefinition(const std::string& defaultValue, const float minimumValue, const float maximumValue) +BlockDefinition::BlockDefinition(const std::string_view defaultValue, const float minimumValue, const float maximumValue) : m_DefaultValue{ defaultValue } , m_MinimumValue{ minimumValue } , m_MaximumValue{ maximumValue } { diff --git a/dGame/dPropertyBehaviors/BlockDefinition.h b/dGame/dPropertyBehaviors/BlockDefinition.h index 84722ea2..0822a4f0 100644 --- a/dGame/dPropertyBehaviors/BlockDefinition.h +++ b/dGame/dPropertyBehaviors/BlockDefinition.h @@ -7,13 +7,13 @@ class AMFArrayValue; class BlockDefinition { public: - BlockDefinition(const std::string& defaultValue = "", const float minimumValue = 0.0f, const float maximumValue = 0.0f); + BlockDefinition(const std::string_view defaultValue = "", const float minimumValue = 0.0f, const float maximumValue = 0.0f); static BlockDefinition blockDefinitionDefault; - [[nodiscard]] const std::string& GetDefaultValue() const { return m_DefaultValue; } + [[nodiscard]] std::string_view GetDefaultValue() const { return m_DefaultValue; } [[nodiscard]] float GetMinimumValue() const noexcept { return m_MinimumValue; } [[nodiscard]] float GetMaximumValue() const noexcept { return m_MaximumValue; } - void SetDefaultValue(const std::string& value) { m_DefaultValue = value; } + void SetDefaultValue(const std::string_view value) { m_DefaultValue = std::string{ value }; } void SetMinimumValue(const float value) noexcept { m_MinimumValue = value; } void SetMaximumValue(const float value) noexcept { m_MaximumValue = value; } diff --git a/dGame/dPropertyBehaviors/ControlBehaviorMessages/Action.cpp b/dGame/dPropertyBehaviors/ControlBehaviorMessages/Action.cpp index 6a21be9b..8906cac2 100644 --- a/dGame/dPropertyBehaviors/ControlBehaviorMessages/Action.cpp +++ b/dGame/dPropertyBehaviors/ControlBehaviorMessages/Action.cpp @@ -7,16 +7,16 @@ Action::Action(const AMFArrayValue& arguments) { for (const auto& [paramName, paramValue] : arguments.GetAssociative()) { if (paramName == "Type") { if (paramValue->GetValueType() != eAmf::String) continue; - m_Type = static_cast(paramValue)->GetValue(); + m_Type = static_cast(paramValue.get())->GetValue(); } else { m_ValueParameterName = paramName; // Message is the only known string parameter if (m_ValueParameterName == "Message") { if (paramValue->GetValueType() != eAmf::String) continue; - m_ValueParameterString = static_cast(paramValue)->GetValue(); + m_ValueParameterString = static_cast(paramValue.get())->GetValue(); } else { if (paramValue->GetValueType() != eAmf::Double) continue; - m_ValueParameterDouble = static_cast(paramValue)->GetValue(); + m_ValueParameterDouble = static_cast(paramValue.get())->GetValue(); } } } diff --git a/dGame/dPropertyBehaviors/ControlBehaviorMessages/Action.h b/dGame/dPropertyBehaviors/ControlBehaviorMessages/Action.h index 8146e08d..44b0ce76 100644 --- a/dGame/dPropertyBehaviors/ControlBehaviorMessages/Action.h +++ b/dGame/dPropertyBehaviors/ControlBehaviorMessages/Action.h @@ -17,9 +17,9 @@ class Action { public: Action() = default; Action(const AMFArrayValue& arguments); - [[nodiscard]] const std::string& GetType() const { return m_Type; }; - [[nodiscard]] const std::string& GetValueParameterName() const { return m_ValueParameterName; }; - [[nodiscard]] const std::string& GetValueParameterString() const { return m_ValueParameterString; }; + [[nodiscard]] std::string_view GetType() const { return m_Type; }; + [[nodiscard]] std::string_view GetValueParameterName() const { return m_ValueParameterName; }; + [[nodiscard]] std::string_view GetValueParameterString() const { return m_ValueParameterString; }; [[nodiscard]] double GetValueParameterDouble() const noexcept { return m_ValueParameterDouble; }; void SendBehaviorBlocksToClient(AMFArrayValue& args) const; diff --git a/dGame/dPropertyBehaviors/ControlBehaviorMessages/ActionContext.cpp b/dGame/dPropertyBehaviors/ControlBehaviorMessages/ActionContext.cpp index 36da8d73..9c88acc3 100644 --- a/dGame/dPropertyBehaviors/ControlBehaviorMessages/ActionContext.cpp +++ b/dGame/dPropertyBehaviors/ControlBehaviorMessages/ActionContext.cpp @@ -4,21 +4,21 @@ #include "Amf3.h" -ActionContext::ActionContext(const AMFArrayValue& arguments, const std::string& customStateKey, const std::string& customStripKey) +ActionContext::ActionContext(const AMFArrayValue& arguments, const std::string_view customStateKey, const std::string_view customStripKey) : m_StripId{ GetStripIdFromArgument(arguments, customStripKey) } , m_StateId{ GetBehaviorStateFromArgument(arguments, customStateKey) } { } -BehaviorState ActionContext::GetBehaviorStateFromArgument(const AMFArrayValue& arguments, const std::string& key) const { +BehaviorState ActionContext::GetBehaviorStateFromArgument(const AMFArrayValue& arguments, const std::string_view key) const { const auto* const stateIDValue = arguments.Get(key); - if (!stateIDValue) throw std::invalid_argument("Unable to find behavior state from argument \"" + key + "\""); + if (!stateIDValue) throw std::invalid_argument("Unable to find behavior state from argument \"" + std::string{ key } + "\""); return static_cast(stateIDValue->GetValue()); } -StripId ActionContext::GetStripIdFromArgument(const AMFArrayValue& arguments, const std::string& key) const { +StripId ActionContext::GetStripIdFromArgument(const AMFArrayValue& arguments, const std::string_view key) const { const auto* const stripIdValue = arguments.Get(key); - if (!stripIdValue) throw std::invalid_argument("Unable to find strip ID from argument \"" + key + "\""); + if (!stripIdValue) throw std::invalid_argument("Unable to find strip ID from argument \"" + std::string{ key } + "\""); return static_cast(stripIdValue->GetValue()); } diff --git a/dGame/dPropertyBehaviors/ControlBehaviorMessages/ActionContext.h b/dGame/dPropertyBehaviors/ControlBehaviorMessages/ActionContext.h index 8ecea8a2..d6b84aba 100644 --- a/dGame/dPropertyBehaviors/ControlBehaviorMessages/ActionContext.h +++ b/dGame/dPropertyBehaviors/ControlBehaviorMessages/ActionContext.h @@ -4,6 +4,8 @@ #include "BehaviorStates.h" #include "dCommonVars.h" +#include + class AMFArrayValue; /** @@ -13,13 +15,13 @@ class AMFArrayValue; class ActionContext { public: ActionContext() noexcept = default; - ActionContext(const AMFArrayValue& arguments, const std::string& customStateKey = "stateID", const std::string& customStripKey = "stripID"); + ActionContext(const AMFArrayValue& arguments, const std::string_view customStateKey = "stateID", const std::string_view customStripKey = "stripID"); [[nodiscard]] StripId GetStripId() const noexcept { return m_StripId; }; [[nodiscard]] BehaviorState GetStateId() const noexcept { return m_StateId; }; private: - [[nodiscard]] BehaviorState GetBehaviorStateFromArgument(const AMFArrayValue& arguments, const std::string& key) const; - [[nodiscard]] StripId GetStripIdFromArgument(const AMFArrayValue& arguments, const std::string& key) const; + [[nodiscard]] BehaviorState GetBehaviorStateFromArgument(const AMFArrayValue& arguments, const std::string_view key) const; + [[nodiscard]] StripId GetStripIdFromArgument(const AMFArrayValue& arguments, const std::string_view key) const; StripId m_StripId{ 0 }; BehaviorState m_StateId{ BehaviorState::HOME_STATE }; }; diff --git a/dGame/dPropertyBehaviors/ControlBehaviorMessages/AddActionMessage.cpp b/dGame/dPropertyBehaviors/ControlBehaviorMessages/AddActionMessage.cpp index 35b9cf0d..0b0b9eaf 100644 --- a/dGame/dPropertyBehaviors/ControlBehaviorMessages/AddActionMessage.cpp +++ b/dGame/dPropertyBehaviors/ControlBehaviorMessages/AddActionMessage.cpp @@ -10,5 +10,5 @@ AddActionMessage::AddActionMessage(const AMFArrayValue& arguments) m_Action = Action{ *actionValue }; - LOG_DEBUG("actionIndex %i stripId %i stateId %i type %s valueParameterName %s valueParameterString %s valueParameterDouble %f m_BehaviorId %i", m_ActionIndex, m_ActionContext.GetStripId(), m_ActionContext.GetStateId(), m_Action.GetType().c_str(), m_Action.GetValueParameterName().c_str(), m_Action.GetValueParameterString().c_str(), m_Action.GetValueParameterDouble(), m_BehaviorId); + LOG_DEBUG("actionIndex %i stripId %i stateId %i type %s valueParameterName %s valueParameterString %s valueParameterDouble %f m_BehaviorId %i", m_ActionIndex, m_ActionContext.GetStripId(), m_ActionContext.GetStateId(), m_Action.GetType().data(), m_Action.GetValueParameterName().data(), m_Action.GetValueParameterString().data(), m_Action.GetValueParameterDouble(), m_BehaviorId); } diff --git a/dGame/dPropertyBehaviors/ControlBehaviorMessages/AddStripMessage.cpp b/dGame/dPropertyBehaviors/ControlBehaviorMessages/AddStripMessage.cpp index c7207b33..c2933fbf 100644 --- a/dGame/dPropertyBehaviors/ControlBehaviorMessages/AddStripMessage.cpp +++ b/dGame/dPropertyBehaviors/ControlBehaviorMessages/AddStripMessage.cpp @@ -19,7 +19,7 @@ AddStripMessage::AddStripMessage(const AMFArrayValue& arguments) m_ActionsToAdd.emplace_back(*actionValue); - LOG_DEBUG("xPosition %f yPosition %f stripId %i stateId %i behaviorId %i t %s valueParameterName %s valueParameterString %s valueParameterDouble %f", m_Position.GetX(), m_Position.GetY(), m_ActionContext.GetStripId(), m_ActionContext.GetStateId(), m_BehaviorId, m_ActionsToAdd.back().GetType().c_str(), m_ActionsToAdd.back().GetValueParameterName().c_str(), m_ActionsToAdd.back().GetValueParameterString().c_str(), m_ActionsToAdd.back().GetValueParameterDouble()); + LOG_DEBUG("xPosition %f yPosition %f stripId %i stateId %i behaviorId %i t %s valueParameterName %s valueParameterString %s valueParameterDouble %f", m_Position.GetX(), m_Position.GetY(), m_ActionContext.GetStripId(), m_ActionContext.GetStateId(), m_BehaviorId, m_ActionsToAdd.back().GetType().data(), m_ActionsToAdd.back().GetValueParameterName().data(), m_ActionsToAdd.back().GetValueParameterString().data(), m_ActionsToAdd.back().GetValueParameterDouble()); } LOG_DEBUG("number of actions %i", m_ActionsToAdd.size()); } diff --git a/dGame/dPropertyBehaviors/ControlBehaviorMessages/BehaviorMessageBase.cpp b/dGame/dPropertyBehaviors/ControlBehaviorMessages/BehaviorMessageBase.cpp index a1cbb064..fb26f37f 100644 --- a/dGame/dPropertyBehaviors/ControlBehaviorMessages/BehaviorMessageBase.cpp +++ b/dGame/dPropertyBehaviors/ControlBehaviorMessages/BehaviorMessageBase.cpp @@ -5,7 +5,7 @@ #include "dCommonVars.h" int32_t BehaviorMessageBase::GetBehaviorIdFromArgument(const AMFArrayValue& arguments) { - static constexpr const char* key = "BehaviorID"; + static constexpr std::string_view key = "BehaviorID"; const auto* const behaviorIDValue = arguments.Get(key); int32_t behaviorId = DefaultBehaviorId; @@ -19,7 +19,7 @@ int32_t BehaviorMessageBase::GetBehaviorIdFromArgument(const AMFArrayValue& argu return behaviorId; } -int32_t BehaviorMessageBase::GetActionIndexFromArgument(const AMFArrayValue& arguments, const std::string& keyName) const { +int32_t BehaviorMessageBase::GetActionIndexFromArgument(const AMFArrayValue& arguments, const std::string_view keyName) const { const auto* const actionIndexAmf = arguments.Get(keyName); if (!actionIndexAmf) throw std::invalid_argument("Unable to find actionIndex"); diff --git a/dGame/dPropertyBehaviors/ControlBehaviorMessages/BehaviorMessageBase.h b/dGame/dPropertyBehaviors/ControlBehaviorMessages/BehaviorMessageBase.h index bb251a74..cc8c293d 100644 --- a/dGame/dPropertyBehaviors/ControlBehaviorMessages/BehaviorMessageBase.h +++ b/dGame/dPropertyBehaviors/ControlBehaviorMessages/BehaviorMessageBase.h @@ -22,7 +22,7 @@ public: protected: [[nodiscard]] int32_t GetBehaviorIdFromArgument(const AMFArrayValue& arguments); - [[nodiscard]] int32_t GetActionIndexFromArgument(const AMFArrayValue& arguments, const std::string& keyName = "actionIndex") const; + [[nodiscard]] int32_t GetActionIndexFromArgument(const AMFArrayValue& arguments, const std::string_view keyName = "actionIndex") const; int32_t m_BehaviorId{ DefaultBehaviorId }; }; diff --git a/dGame/dPropertyBehaviors/ControlBehaviorMessages/RenameMessage.h b/dGame/dPropertyBehaviors/ControlBehaviorMessages/RenameMessage.h index 1f4e45c0..68cc83d7 100644 --- a/dGame/dPropertyBehaviors/ControlBehaviorMessages/RenameMessage.h +++ b/dGame/dPropertyBehaviors/ControlBehaviorMessages/RenameMessage.h @@ -11,7 +11,7 @@ class AMFArrayValue; class RenameMessage : public BehaviorMessageBase { public: RenameMessage(const AMFArrayValue& arguments); - [[nodiscard]] const std::string& GetName() const { return m_Name; }; + [[nodiscard]] std::string_view GetName() const { return m_Name; }; private: std::string m_Name; diff --git a/dGame/dPropertyBehaviors/ControlBehaviorMessages/StripUiPosition.cpp b/dGame/dPropertyBehaviors/ControlBehaviorMessages/StripUiPosition.cpp index ae153a5f..5a5592ac 100644 --- a/dGame/dPropertyBehaviors/ControlBehaviorMessages/StripUiPosition.cpp +++ b/dGame/dPropertyBehaviors/ControlBehaviorMessages/StripUiPosition.cpp @@ -3,7 +3,7 @@ #include "Amf3.h" #include "tinyxml2.h" -StripUiPosition::StripUiPosition(const AMFArrayValue& arguments, const std::string& uiKeyName) { +StripUiPosition::StripUiPosition(const AMFArrayValue& arguments, const std::string_view uiKeyName) { const auto* const uiArray = arguments.GetArray(uiKeyName); if (!uiArray) return; diff --git a/dGame/dPropertyBehaviors/ControlBehaviorMessages/StripUiPosition.h b/dGame/dPropertyBehaviors/ControlBehaviorMessages/StripUiPosition.h index 47501ff7..eeeb67bb 100644 --- a/dGame/dPropertyBehaviors/ControlBehaviorMessages/StripUiPosition.h +++ b/dGame/dPropertyBehaviors/ControlBehaviorMessages/StripUiPosition.h @@ -14,7 +14,7 @@ namespace tinyxml2 { class StripUiPosition { public: StripUiPosition() noexcept = default; - StripUiPosition(const AMFArrayValue& arguments, const std::string& uiKeyName = "ui"); + StripUiPosition(const AMFArrayValue& arguments, const std::string_view uiKeyName = "ui"); void SendBehaviorBlocksToClient(AMFArrayValue& args) const; [[nodiscard]] double GetX() const noexcept { return m_XPosition; } [[nodiscard]] double GetY() const noexcept { return m_YPosition; } diff --git a/dGame/dPropertyBehaviors/ControlBehaviorMessages/UpdateActionMessage.cpp b/dGame/dPropertyBehaviors/ControlBehaviorMessages/UpdateActionMessage.cpp index fabf2726..04111a7d 100644 --- a/dGame/dPropertyBehaviors/ControlBehaviorMessages/UpdateActionMessage.cpp +++ b/dGame/dPropertyBehaviors/ControlBehaviorMessages/UpdateActionMessage.cpp @@ -12,5 +12,5 @@ UpdateActionMessage::UpdateActionMessage(const AMFArrayValue& arguments) m_Action = Action{ *actionValue }; - LOG_DEBUG("type %s valueParameterName %s valueParameterString %s valueParameterDouble %f behaviorId %i actionIndex %i stripId %i stateId %i", m_Action.GetType().c_str(), m_Action.GetValueParameterName().c_str(), m_Action.GetValueParameterString().c_str(), m_Action.GetValueParameterDouble(), m_BehaviorId, m_ActionIndex, m_ActionContext.GetStripId(), m_ActionContext.GetStateId()); + LOG_DEBUG("type %s valueParameterName %s valueParameterString %s valueParameterDouble %f behaviorId %i actionIndex %i stripId %i stateId %i", m_Action.GetType().data(), m_Action.GetValueParameterName().data(), m_Action.GetValueParameterString().data(), m_Action.GetValueParameterDouble(), m_BehaviorId, m_ActionIndex, m_ActionContext.GetStripId(), m_ActionContext.GetStateId()); } diff --git a/dGame/dPropertyBehaviors/ControlBehaviors.cpp b/dGame/dPropertyBehaviors/ControlBehaviors.cpp index 2e074409..756a615c 100644 --- a/dGame/dPropertyBehaviors/ControlBehaviors.cpp +++ b/dGame/dPropertyBehaviors/ControlBehaviors.cpp @@ -76,26 +76,26 @@ void ControlBehaviors::UpdateAction(const AMFArrayValue& arguments) { auto blockDefinition = GetBlockInfo(updateActionMessage.GetAction().GetType()); if (!blockDefinition) { - LOG("Received undefined block type %s. Ignoring.", updateActionMessage.GetAction().GetType().c_str()); + LOG("Received undefined block type %s. Ignoring.", updateActionMessage.GetAction().GetType().data()); return; } if (updateActionMessage.GetAction().GetValueParameterString().size() > 0) { if (updateActionMessage.GetAction().GetValueParameterString().size() < blockDefinition->GetMinimumValue() || updateActionMessage.GetAction().GetValueParameterString().size() > blockDefinition->GetMaximumValue()) { - LOG("Updated block %s is out of range. Ignoring update", updateActionMessage.GetAction().GetType().c_str()); + LOG("Updated block %s is out of range. Ignoring update", updateActionMessage.GetAction().GetType().data()); return; } } else { if (updateActionMessage.GetAction().GetValueParameterDouble() < blockDefinition->GetMinimumValue() || updateActionMessage.GetAction().GetValueParameterDouble() > blockDefinition->GetMaximumValue()) { - LOG("Updated block %s is out of range. Ignoring update", updateActionMessage.GetAction().GetType().c_str()); + LOG("Updated block %s is out of range. Ignoring update", updateActionMessage.GetAction().GetType().data()); return; } } } -void ControlBehaviors::ProcessCommand(Entity* const modelEntity, const AMFArrayValue& arguments, const std::string& command, Entity* const modelOwner) { +void ControlBehaviors::ProcessCommand(Entity* const modelEntity, const AMFArrayValue& arguments, const std::string_view command, Entity* const modelOwner) { if (!isInitialized || !modelEntity || !modelOwner) return; auto* const modelComponent = modelEntity->GetComponent(); @@ -157,7 +157,7 @@ void ControlBehaviors::ProcessCommand(Entity* const modelEntity, const AMFArrayV } else if (command == "updateAction") { context.modelComponent->HandleControlBehaviorsMsg(arguments); } else { - LOG("Unknown behavior command (%s)", command.c_str()); + LOG("Unknown behavior command (%s)", command.data()); } } @@ -279,11 +279,11 @@ ControlBehaviors::ControlBehaviors() { isInitialized = true; LOG_DEBUG("Created all base block classes"); for (auto& [name, block] : blockTypes) { - LOG_DEBUG("block name is %s default %s min %f max %f", name.c_str(), block.GetDefaultValue().c_str(), block.GetMinimumValue(), block.GetMaximumValue()); + LOG_DEBUG("block name is %s default %s min %f max %f", name.data(), block.GetDefaultValue().data(), block.GetMinimumValue(), block.GetMaximumValue()); } } -std::optional ControlBehaviors::GetBlockInfo(const std::string& blockName) { +std::optional ControlBehaviors::GetBlockInfo(const std::string_view blockName) { auto blockDefinition = blockTypes.find(blockName); return blockDefinition != blockTypes.end() ? std::optional(blockDefinition->second) : std::nullopt; } diff --git a/dGame/dPropertyBehaviors/ControlBehaviors.h b/dGame/dPropertyBehaviors/ControlBehaviors.h index f176a070..fdb86746 100644 --- a/dGame/dPropertyBehaviors/ControlBehaviors.h +++ b/dGame/dPropertyBehaviors/ControlBehaviors.h @@ -43,7 +43,7 @@ public: * @param command The command to perform * @param modelOwner The owner of the model which sent this command */ - void ProcessCommand(Entity* const modelEntity, const AMFArrayValue& arguments, const std::string& command, Entity* const modelOwner); + void ProcessCommand(Entity* const modelEntity, const AMFArrayValue& arguments, const std::string_view command, Entity* const modelOwner); /** * @brief Gets a blocks parameter values by the name @@ -53,7 +53,7 @@ public: * * @return A pair of the block parameter name to its typing */ - [[nodiscard]] std::optional GetBlockInfo(const std::string& blockName); + [[nodiscard]] std::optional GetBlockInfo(const std::string_view blockName); private: void RequestUpdatedID(ControlBehaviorContext& context); void SendBehaviorListToClient(const ControlBehaviorContext& context); diff --git a/dGame/dUtilities/Mail.cpp b/dGame/dUtilities/Mail.cpp index 677728a6..e2ffbf79 100644 --- a/dGame/dUtilities/Mail.cpp +++ b/dGame/dUtilities/Mail.cpp @@ -152,7 +152,7 @@ void Mail::HandleSendMail(RakNet::BitStream& packet, const SystemAddress& sysAdd LUWString bodyRead(400); packet.Read(bodyRead); - + LUWString recipientRead(32); packet.Read(recipientRead); @@ -245,7 +245,7 @@ void Mail::HandleDataRequest(RakNet::BitStream& packet, const SystemAddress& sys auto playerMail = Database::Get()->GetMailForPlayer(player->GetCharacter()->GetID(), 20); RakNet::BitStream bitStream; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::MAIL); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::MAIL); bitStream.Write(int(MailMessageID::MailData)); bitStream.Write(int(0)); // throttled @@ -348,7 +348,7 @@ void Mail::HandleNotificationRequest(const SystemAddress& sysAddr, uint32_t obje void Mail::SendSendResponse(const SystemAddress& sysAddr, MailSendResponse response) { RakNet::BitStream bitStream; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::MAIL); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::MAIL); bitStream.Write(int(MailMessageID::SendResponse)); bitStream.Write(int(response)); Game::server->Send(bitStream, sysAddr, false); @@ -356,7 +356,7 @@ void Mail::SendSendResponse(const SystemAddress& sysAddr, MailSendResponse respo void Mail::SendNotification(const SystemAddress& sysAddr, int mailCount) { RakNet::BitStream bitStream; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::MAIL); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::MAIL); uint64_t messageType = 2; uint64_t s1 = 0; uint64_t s2 = 0; @@ -375,7 +375,7 @@ void Mail::SendNotification(const SystemAddress& sysAddr, int mailCount) { void Mail::SendAttachmentRemoveConfirm(const SystemAddress& sysAddr, uint64_t mailID) { RakNet::BitStream bitStream; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::MAIL); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::MAIL); bitStream.Write(int(MailMessageID::AttachmentCollectConfirm)); bitStream.Write(int(0)); //unknown bitStream.Write(mailID); @@ -384,7 +384,7 @@ void Mail::SendAttachmentRemoveConfirm(const SystemAddress& sysAddr, uint64_t ma void Mail::SendDeleteConfirm(const SystemAddress& sysAddr, uint64_t mailID, LWOOBJID playerID) { RakNet::BitStream bitStream; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::MAIL); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::MAIL); bitStream.Write(int(MailMessageID::MailDeleteConfirm)); bitStream.Write(int(0)); //unknown bitStream.Write(mailID); @@ -395,7 +395,7 @@ void Mail::SendDeleteConfirm(const SystemAddress& sysAddr, uint64_t mailID, LWOO void Mail::SendReadConfirm(const SystemAddress& sysAddr, uint64_t mailID) { RakNet::BitStream bitStream; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::MAIL); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::MAIL); bitStream.Write(int(MailMessageID::MailReadConfirm)); bitStream.Write(int(0)); //unknown bitStream.Write(mailID); diff --git a/dGame/dUtilities/SlashCommandHandler.cpp b/dGame/dUtilities/SlashCommandHandler.cpp index ca4e03d4..c0966897 100644 --- a/dGame/dUtilities/SlashCommandHandler.cpp +++ b/dGame/dUtilities/SlashCommandHandler.cpp @@ -16,7 +16,7 @@ #include "Amf3.h" #include "Database.h" -#include "eChatMessageType.h" +#include "MessageType/Chat.h" #include "dServer.h" namespace { @@ -153,7 +153,7 @@ void SlashCommandHandler::SendAnnouncement(const std::string& title, const std:: //Notify chat about it CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::GM_ANNOUNCE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::GM_ANNOUNCE); bitStream.Write(title.size()); for (auto character : title) { diff --git a/dGame/dUtilities/SlashCommands/DEVGMCommands.cpp b/dGame/dUtilities/SlashCommands/DEVGMCommands.cpp index 00add608..37fba911 100644 --- a/dGame/dUtilities/SlashCommands/DEVGMCommands.cpp +++ b/dGame/dUtilities/SlashCommands/DEVGMCommands.cpp @@ -45,7 +45,7 @@ // Enums #include "eGameMasterLevel.h" -#include "eMasterMessageType.h" +#include "MessageType/Master.h" #include "eInventoryType.h" #include "ePlayerFlag.h" @@ -503,7 +503,7 @@ namespace DEVGMCommands { void ShutdownUniverse(Entity* entity, const SystemAddress& sysAddr, const std::string args) { //Tell the master server that we're going to be shutting down whole "universe": CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::SHUTDOWN_UNIVERSE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, MessageType::Master::SHUTDOWN_UNIVERSE); Game::server->SendToMaster(bitStream); ChatPackets::SendSystemMessage(sysAddr, u"Sent universe shutdown notification to master."); diff --git a/dGame/dUtilities/SlashCommands/GMGreaterThanZeroCommands.cpp b/dGame/dUtilities/SlashCommands/GMGreaterThanZeroCommands.cpp index b9eaf7bf..3032a33b 100644 --- a/dGame/dUtilities/SlashCommands/GMGreaterThanZeroCommands.cpp +++ b/dGame/dUtilities/SlashCommands/GMGreaterThanZeroCommands.cpp @@ -15,7 +15,7 @@ #include "PropertyManagementComponent.h" // Enums -#include "eChatMessageType.h" +#include "MessageType/Chat.h" #include "eServerDisconnectIdentifiers.h" #include "eObjectBits.h" @@ -197,7 +197,7 @@ namespace GMGreaterThanZeroCommands { //Notify chat about it CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::GM_MUTE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::GM_MUTE); bitStream.Write(characterId); bitStream.Write(expire); @@ -292,7 +292,7 @@ namespace GMGreaterThanZeroCommands { bool displayZoneData = true; bool displayIndividualPlayers = true; const auto splitArgs = GeneralUtils::SplitString(args, ' '); - + if (!splitArgs.empty() && !splitArgs.at(0).empty()) displayZoneData = splitArgs.at(0) == "1"; if (splitArgs.size() > 1) displayIndividualPlayers = splitArgs.at(1) == "1"; diff --git a/dGame/dUtilities/VanityUtilities.cpp b/dGame/dUtilities/VanityUtilities.cpp index 6043fe63..8ae9246d 100644 --- a/dGame/dUtilities/VanityUtilities.cpp +++ b/dGame/dUtilities/VanityUtilities.cpp @@ -102,7 +102,7 @@ void VanityUtilities::SpawnVanity() { } LWOOBJID SpawnSpawner(const VanityObject& object, const VanityObjectLocation& location) { - SceneObject obj; + SceneObject obj{}; obj.lot = object.m_LOT; // guratantee we have no collisions do { @@ -268,7 +268,7 @@ void ParseXml(const std::string& file) { for (auto* location = locations->FirstChildElement("location"); location != nullptr; location = location->NextSiblingElement("location")) { - + // Get the location data auto zoneID = GeneralUtils::TryParse(location->Attribute("zone")); auto x = GeneralUtils::TryParse(location->Attribute("x")); diff --git a/dMasterServer/CMakeLists.txt b/dMasterServer/CMakeLists.txt index 260e4f16..2e2b4dd9 100644 --- a/dMasterServer/CMakeLists.txt +++ b/dMasterServer/CMakeLists.txt @@ -6,7 +6,7 @@ set(DMASTERSERVER_SOURCES add_library(dMasterServer ${DMASTERSERVER_SOURCES}) add_executable(MasterServer "MasterServer.cpp") -add_compile_definitions(MasterServer PRIVATE PROJECT_VERSION="\"${PROJECT_VERSION}\"") +target_compile_definitions(MasterServer PRIVATE PROJECT_VERSION="\"${PROJECT_VERSION}\"") target_include_directories(dMasterServer PUBLIC "." "${PROJECT_SOURCE_DIR}/dZoneManager" # InstanceManager.h uses dZMCommon.h ${PROJECT_SOURCE_DIR}/dServer/ # BinaryPathFinder.h diff --git a/dMasterServer/InstanceManager.cpp b/dMasterServer/InstanceManager.cpp index 3ec42634..5f2672e0 100644 --- a/dMasterServer/InstanceManager.cpp +++ b/dMasterServer/InstanceManager.cpp @@ -10,7 +10,7 @@ #include "MasterPackets.h" #include "BitStreamUtils.h" #include "eConnectionType.h" -#include "eMasterMessageType.h" +#include "MessageType/Master.h" #include "Start.h" @@ -177,7 +177,7 @@ void InstanceManager::RequestAffirmation(Instance* instance, const PendingInstan CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::AFFIRM_TRANSFER_REQUEST); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, MessageType::Master::AFFIRM_TRANSFER_REQUEST); bitStream.Write(request.id); @@ -359,7 +359,7 @@ bool Instance::GetShutdownComplete() const { void Instance::Shutdown() { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::SHUTDOWN); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, MessageType::Master::SHUTDOWN); Game::server->Send(bitStream, this->m_SysAddr, false); diff --git a/dMasterServer/MasterServer.cpp b/dMasterServer/MasterServer.cpp index 05955a85..7edcaced 100644 --- a/dMasterServer/MasterServer.cpp +++ b/dMasterServer/MasterServer.cpp @@ -24,7 +24,7 @@ #include "AssetManager.h" #include "BinaryPathFinder.h" #include "eConnectionType.h" -#include "eMasterMessageType.h" +#include "MessageType/Master.h" //RakNet includes: #include "RakNetDefines.h" @@ -473,8 +473,8 @@ void HandlePacket(Packet* packet) { if (packet->length < 4) return; if (static_cast(packet->data[1]) == eConnectionType::MASTER) { - switch (static_cast(packet->data[3])) { - case eMasterMessageType::REQUEST_PERSISTENT_ID: { + switch (static_cast(packet->data[3])) { + case MessageType::Master::REQUEST_PERSISTENT_ID: { LOG("A persistent ID req"); RakNet::BitStream inStream(packet->data, packet->length, false); uint64_t header = inStream.Read(header); @@ -486,7 +486,7 @@ void HandlePacket(Packet* packet) { break; } - case eMasterMessageType::REQUEST_ZONE_TRANSFER: { + case MessageType::Master::REQUEST_ZONE_TRANSFER: { LOG("Received zone transfer req"); RakNet::BitStream inStream(packet->data, packet->length, false); uint64_t header = inStream.Read(header); @@ -522,7 +522,7 @@ void HandlePacket(Packet* packet) { break; } - case eMasterMessageType::SERVER_INFO: { + case MessageType::Master::SERVER_INFO: { //MasterPackets::HandleServerInfo(packet); //This is here because otherwise we'd have to include IM in @@ -583,7 +583,7 @@ void HandlePacket(Packet* packet) { break; } - case eMasterMessageType::SET_SESSION_KEY: { + case MessageType::Master::SET_SESSION_KEY: { CINSTREAM_SKIP_HEADER; uint32_t sessionKey = 0; inStream.Read(sessionKey); @@ -595,7 +595,7 @@ void HandlePacket(Packet* packet) { activeSessions.erase(it.first); CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::NEW_SESSION_ALERT); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, MessageType::Master::NEW_SESSION_ALERT); bitStream.Write(sessionKey); bitStream.Write(username); SEND_PACKET_BROADCAST; @@ -609,7 +609,7 @@ void HandlePacket(Packet* packet) { break; } - case eMasterMessageType::REQUEST_SESSION_KEY: { + case MessageType::Master::REQUEST_SESSION_KEY: { CINSTREAM_SKIP_HEADER; LUWString username; inStream.Read(username); @@ -617,7 +617,7 @@ void HandlePacket(Packet* packet) { for (auto key : activeSessions) { if (key.second == username.GetAsString()) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::SESSION_KEY_RESPONSE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, MessageType::Master::SESSION_KEY_RESPONSE); bitStream.Write(key.first); bitStream.Write(username); Game::server->Send(bitStream, packet->systemAddress, false); @@ -627,7 +627,7 @@ void HandlePacket(Packet* packet) { break; } - case eMasterMessageType::PLAYER_ADDED: { + case MessageType::Master::PLAYER_ADDED: { RakNet::BitStream inStream(packet->data, packet->length, false); uint64_t header = inStream.Read(header); @@ -647,7 +647,7 @@ void HandlePacket(Packet* packet) { break; } - case eMasterMessageType::PLAYER_REMOVED: { + case MessageType::Master::PLAYER_REMOVED: { RakNet::BitStream inStream(packet->data, packet->length, false); uint64_t header = inStream.Read(header); @@ -665,7 +665,7 @@ void HandlePacket(Packet* packet) { break; } - case eMasterMessageType::CREATE_PRIVATE_ZONE: { + case MessageType::Master::CREATE_PRIVATE_ZONE: { RakNet::BitStream inStream(packet->data, packet->length, false); uint64_t header = inStream.Read(header); @@ -689,7 +689,7 @@ void HandlePacket(Packet* packet) { break; } - case eMasterMessageType::REQUEST_PRIVATE_ZONE: { + case MessageType::Master::REQUEST_PRIVATE_ZONE: { RakNet::BitStream inStream(packet->data, packet->length, false); uint64_t header = inStream.Read(header); @@ -724,7 +724,7 @@ void HandlePacket(Packet* packet) { break; } - case eMasterMessageType::WORLD_READY: { + case MessageType::Master::WORLD_READY: { RakNet::BitStream inStream(packet->data, packet->length, false); uint64_t header = inStream.Read(header); @@ -748,7 +748,7 @@ void HandlePacket(Packet* packet) { break; } - case eMasterMessageType::PREP_ZONE: { + case MessageType::Master::PREP_ZONE: { RakNet::BitStream inStream(packet->data, packet->length, false); uint64_t header = inStream.Read(header); @@ -764,7 +764,7 @@ void HandlePacket(Packet* packet) { break; } - case eMasterMessageType::AFFIRM_TRANSFER_RESPONSE: { + case MessageType::Master::AFFIRM_TRANSFER_RESPONSE: { RakNet::BitStream inStream(packet->data, packet->length, false); uint64_t header = inStream.Read(header); @@ -784,7 +784,7 @@ void HandlePacket(Packet* packet) { break; } - case eMasterMessageType::SHUTDOWN_RESPONSE: { + case MessageType::Master::SHUTDOWN_RESPONSE: { RakNet::BitStream inStream(packet->data, packet->length, false); uint64_t header = inStream.Read(header); @@ -799,7 +799,7 @@ void HandlePacket(Packet* packet) { break; } - case eMasterMessageType::SHUTDOWN_UNIVERSE: { + case MessageType::Master::SHUTDOWN_UNIVERSE: { LOG("Received shutdown universe command, shutting down in 10 minutes."); Game::universeShutdownRequested = true; break; @@ -829,7 +829,7 @@ int ShutdownSequence(int32_t signal) { { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::SHUTDOWN); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, MessageType::Master::SHUTDOWN); Game::server->Send(bitStream, UNASSIGNED_SYSTEM_ADDRESS, true); LOG("Triggered master shutdown"); } diff --git a/dNet/AuthPackets.cpp b/dNet/AuthPackets.cpp index 715188e8..380eb8f0 100644 --- a/dNet/AuthPackets.cpp +++ b/dNet/AuthPackets.cpp @@ -20,8 +20,8 @@ #include "eServerDisconnectIdentifiers.h" #include "eLoginResponse.h" #include "eConnectionType.h" -#include "eServerMessageType.h" -#include "eMasterMessageType.h" +#include "MessageType/Server.h" +#include "MessageType/Master.h" #include "eGameMasterLevel.h" #include "StringifiedEnum.h" namespace { @@ -63,7 +63,7 @@ void AuthPackets::HandleHandshake(dServer* server, Packet* packet) { if (port != packet->systemAddress.port) LOG("WARNING: Port written in packet does not match the port the client is connecting over!"); inStream.IgnoreBytes(33); - + LOG_DEBUG("Client Data [Version: %i, Service: %s, Process: %u, Port: %u, Sysaddr Port: %u]", clientVersion, StringifiedEnum::ToString(serviceId).data(), processID, port, packet->systemAddress.port); SendHandshake(server, packet->systemAddress, server->GetIP(), server->GetPort(), server->GetServerType()); @@ -71,8 +71,8 @@ void AuthPackets::HandleHandshake(dServer* server, Packet* packet) { void AuthPackets::SendHandshake(dServer* server, const SystemAddress& sysAddr, const std::string& nextServerIP, uint16_t nextServerPort, const ServerType serverType) { RakNet::BitStream bitStream; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::SERVER, eServerMessageType::VERSION_CONFIRM); - + BitStreamUtils::WriteHeader(bitStream, eConnectionType::SERVER, MessageType::Server::VERSION_CONFIRM); + const auto clientNetVersionString = Game::config->GetValue("client_net_version"); const uint32_t clientNetVersion = GeneralUtils::TryParse(clientNetVersionString).value_or(171022); @@ -87,6 +87,13 @@ void AuthPackets::SendHandshake(dServer* server, const SystemAddress& sysAddr, c server->Send(bitStream, sysAddr, false); } +std::string CleanReceivedString(const std::string& str) { + std::string toReturn = str; + const auto removed = std::ranges::find_if(toReturn, [](char c) { return isprint(c) == 0 && isblank(c) == 0; }); + toReturn.erase(removed, toReturn.end()); + return toReturn; +} + void AuthPackets::HandleLoginRequest(dServer* server, Packet* packet) { CINSTREAM_SKIP_HEADER; @@ -111,11 +118,11 @@ void AuthPackets::HandleLoginRequest(dServer* server, Packet* packet) { LUWString memoryStats(256); inStream.Read(memoryStats); - LOG_DEBUG("Memory Stats [%s]", memoryStats.GetAsString().c_str()); + LOG_DEBUG("Memory Stats [%s]", CleanReceivedString(memoryStats.GetAsString()).c_str()); LUWString videoCard(128); inStream.Read(videoCard); - LOG_DEBUG("VideoCard Info: [%s]", videoCard.GetAsString().c_str()); + LOG_DEBUG("VideoCard Info: [%s]", CleanReceivedString(videoCard.GetAsString()).c_str()); // Processor/CPU info uint32_t numOfProcessors; @@ -227,7 +234,7 @@ void AuthPackets::HandleLoginRequest(dServer* server, Packet* packet) { void AuthPackets::SendLoginResponse(dServer* server, const SystemAddress& sysAddr, eLoginResponse responseCode, const std::string& errorMsg, const std::string& wServerIP, uint16_t wServerPort, std::string username, std::vector& stamps) { stamps.emplace_back(eStamps::PASSPORT_AUTH_IM_LOGIN_START, 1); RakNet::BitStream loginResponse; - BitStreamUtils::WriteHeader(loginResponse, eConnectionType::CLIENT, eClientMessageType::LOGIN_RESPONSE); + BitStreamUtils::WriteHeader(loginResponse, eConnectionType::CLIENT, MessageType::Client::LOGIN_RESPONSE); loginResponse.Write(responseCode); @@ -297,7 +304,7 @@ void AuthPackets::SendLoginResponse(dServer* server, const SystemAddress& sysAdd //Inform the master server that we've created a session for this user: if (responseCode == eLoginResponse::SUCCESS) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::SET_SESSION_KEY); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, MessageType::Master::SET_SESSION_KEY); bitStream.Write(sessionKey); bitStream.Write(LUString(username)); server->SendToMaster(bitStream); diff --git a/dNet/ChatPackets.cpp b/dNet/ChatPackets.cpp index 6c9b36b7..bf3c9d62 100644 --- a/dNet/ChatPackets.cpp +++ b/dNet/ChatPackets.cpp @@ -10,10 +10,10 @@ #include "BitStreamUtils.h" #include "dServer.h" #include "eConnectionType.h" -#include "eChatMessageType.h" +#include "MessageType/Chat.h" void ShowAllRequest::Serialize(RakNet::BitStream& bitStream) { - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::SHOW_ALL); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::SHOW_ALL); bitStream.Write(this->requestor); bitStream.Write(this->displayZoneData); bitStream.Write(this->displayIndividualPlayers); @@ -26,7 +26,7 @@ void ShowAllRequest::Deserialize(RakNet::BitStream& inStream) { } void FindPlayerRequest::Serialize(RakNet::BitStream& bitStream) { - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::WHO); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::WHO); bitStream.Write(this->requestor); bitStream.Write(this->playerName); } @@ -38,7 +38,7 @@ void FindPlayerRequest::Deserialize(RakNet::BitStream& inStream) { void ChatPackets::SendChatMessage(const SystemAddress& sysAddr, char chatChannel, const std::string& senderName, LWOOBJID playerObjectID, bool senderMythran, const std::u16string& message) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::GENERAL_CHAT_MESSAGE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::GENERAL_CHAT_MESSAGE); bitStream.Write(0); bitStream.Write(chatChannel); @@ -60,7 +60,7 @@ void ChatPackets::SendChatMessage(const SystemAddress& sysAddr, char chatChannel void ChatPackets::SendSystemMessage(const SystemAddress& sysAddr, const std::u16string& message, const bool broadcast) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::GENERAL_CHAT_MESSAGE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::GENERAL_CHAT_MESSAGE); bitStream.Write(0); bitStream.Write(4); @@ -92,7 +92,7 @@ void ChatPackets::SendMessageFail(const SystemAddress& sysAddr) { //0x01 - "Upgrade to a full LEGO Universe Membership to chat with other players." CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::SEND_CANNED_TEXT); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::SEND_CANNED_TEXT); bitStream.Write(0); //response type, options above ^ //docs say there's a wstring here-- no idea what it's for, or if it's even needed so leaving it as is for now. SEND_PACKET; diff --git a/dNet/MasterPackets.cpp b/dNet/MasterPackets.cpp index 7bd8f4a5..e15cab67 100644 --- a/dNet/MasterPackets.cpp +++ b/dNet/MasterPackets.cpp @@ -3,21 +3,21 @@ #include "dCommonVars.h" #include "dServer.h" #include "eConnectionType.h" -#include "eMasterMessageType.h" +#include "MessageType/Master.h" #include "BitStreamUtils.h" #include void MasterPackets::SendPersistentIDRequest(dServer* server, uint64_t requestID) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::REQUEST_PERSISTENT_ID); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, MessageType::Master::REQUEST_PERSISTENT_ID); bitStream.Write(requestID); server->SendToMaster(bitStream); } void MasterPackets::SendPersistentIDResponse(dServer* server, const SystemAddress& sysAddr, uint64_t requestID, uint32_t objID) { RakNet::BitStream bitStream; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::REQUEST_PERSISTENT_ID_RESPONSE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, MessageType::Master::REQUEST_PERSISTENT_ID_RESPONSE); bitStream.Write(requestID); bitStream.Write(objID); @@ -27,7 +27,7 @@ void MasterPackets::SendPersistentIDResponse(dServer* server, const SystemAddres void MasterPackets::SendZoneTransferRequest(dServer* server, uint64_t requestID, bool mythranShift, uint32_t zoneID, uint32_t cloneID) { RakNet::BitStream bitStream; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::REQUEST_ZONE_TRANSFER); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, MessageType::Master::REQUEST_ZONE_TRANSFER); bitStream.Write(requestID); bitStream.Write(mythranShift); @@ -39,7 +39,7 @@ void MasterPackets::SendZoneTransferRequest(dServer* server, uint64_t requestID, void MasterPackets::SendZoneCreatePrivate(dServer* server, uint32_t zoneID, uint32_t cloneID, const std::string& password) { RakNet::BitStream bitStream; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::CREATE_PRIVATE_ZONE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, MessageType::Master::CREATE_PRIVATE_ZONE); bitStream.Write(zoneID); bitStream.Write(cloneID); @@ -54,7 +54,7 @@ void MasterPackets::SendZoneCreatePrivate(dServer* server, uint32_t zoneID, uint void MasterPackets::SendZoneRequestPrivate(dServer* server, uint64_t requestID, bool mythranShift, const std::string& password) { RakNet::BitStream bitStream; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::REQUEST_PRIVATE_ZONE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, MessageType::Master::REQUEST_PRIVATE_ZONE); bitStream.Write(requestID); bitStream.Write(mythranShift); @@ -69,7 +69,7 @@ void MasterPackets::SendZoneRequestPrivate(dServer* server, uint64_t requestID, void MasterPackets::SendWorldReady(dServer* server, LWOMAPID zoneId, LWOINSTANCEID instanceId) { RakNet::BitStream bitStream; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::WORLD_READY); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, MessageType::Master::WORLD_READY); bitStream.Write(zoneId); bitStream.Write(instanceId); @@ -79,7 +79,7 @@ void MasterPackets::SendWorldReady(dServer* server, LWOMAPID zoneId, LWOINSTANCE void MasterPackets::SendZoneTransferResponse(dServer* server, const SystemAddress& sysAddr, uint64_t requestID, bool mythranShift, uint32_t zoneID, uint32_t zoneInstance, uint32_t zoneClone, const std::string& serverIP, uint32_t serverPort) { RakNet::BitStream bitStream; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::REQUEST_ZONE_TRANSFER_RESPONSE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, MessageType::Master::REQUEST_ZONE_TRANSFER_RESPONSE); bitStream.Write(requestID); bitStream.Write(mythranShift); @@ -111,7 +111,7 @@ void MasterPackets::HandleServerInfo(Packet* packet) { void MasterPackets::SendServerInfo(dServer* server, Packet* packet) { RakNet::BitStream bitStream; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::SERVER_INFO); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, MessageType::Master::SERVER_INFO); bitStream.Write(server->GetPort()); bitStream.Write(server->GetZoneID()); diff --git a/dNet/WorldPackets.cpp b/dNet/WorldPackets.cpp index 44dd687e..ddd16c3e 100644 --- a/dNet/WorldPackets.cpp +++ b/dNet/WorldPackets.cpp @@ -23,7 +23,7 @@ void HTTPMonitorInfo::Serialize(RakNet::BitStream &bitStream) const { void WorldPackets::SendLoadStaticZone(const SystemAddress& sysAddr, float x, float y, float z, uint32_t checksum, LWOZONEID zone) { RakNet::BitStream bitStream; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::LOAD_STATIC_ZONE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::LOAD_STATIC_ZONE); bitStream.Write(zone.GetMapID()); bitStream.Write(zone.GetInstanceID()); @@ -44,28 +44,28 @@ void WorldPackets::SendLoadStaticZone(const SystemAddress& sysAddr, float x, flo void WorldPackets::SendCharacterCreationResponse(const SystemAddress& sysAddr, eCharacterCreationResponse response) { RakNet::BitStream bitStream; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::CHARACTER_CREATE_RESPONSE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::CHARACTER_CREATE_RESPONSE); bitStream.Write(response); SEND_PACKET; } void WorldPackets::SendCharacterRenameResponse(const SystemAddress& sysAddr, eRenameResponse response) { RakNet::BitStream bitStream; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::CHARACTER_RENAME_RESPONSE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::CHARACTER_RENAME_RESPONSE); bitStream.Write(response); SEND_PACKET; } void WorldPackets::SendCharacterDeleteResponse(const SystemAddress& sysAddr, bool response) { RakNet::BitStream bitStream; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::DELETE_CHARACTER_RESPONSE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::DELETE_CHARACTER_RESPONSE); bitStream.Write(response); SEND_PACKET; } void WorldPackets::SendTransferToWorld(const SystemAddress& sysAddr, const std::string& serverIP, uint32_t serverPort, bool mythranShift) { RakNet::BitStream bitStream; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::TRANSFER_TO_WORLD); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::TRANSFER_TO_WORLD); bitStream.Write(LUString(serverIP)); bitStream.Write(serverPort); @@ -76,14 +76,14 @@ void WorldPackets::SendTransferToWorld(const SystemAddress& sysAddr, const std:: void WorldPackets::SendServerState(const SystemAddress& sysAddr) { RakNet::BitStream bitStream; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::SERVER_STATES); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::SERVER_STATES); bitStream.Write(1); //If the server is receiving this request, it probably is ready anyway. SEND_PACKET; } void WorldPackets::SendCreateCharacter(const SystemAddress& sysAddr, int64_t reputation, LWOOBJID player, const std::string& xmlData, const std::u16string& username, eGameMasterLevel gm) { RakNet::BitStream bitStream; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::CREATE_CHARACTER); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::CREATE_CHARACTER); RakNet::BitStream data; data.Write(7); //LDF key count @@ -136,7 +136,7 @@ void WorldPackets::SendCreateCharacter(const SystemAddress& sysAddr, int64_t rep void WorldPackets::SendChatModerationResponse(const SystemAddress& sysAddr, bool requestAccepted, uint32_t requestID, const std::string& receiver, std::vector> unacceptedItems) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::CHAT_MODERATION_STRING); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::CHAT_MODERATION_STRING); bitStream.Write(unacceptedItems.empty()); // Is sentence ok? bitStream.Write(0x16); // Source ID, unknown @@ -160,7 +160,7 @@ void WorldPackets::SendChatModerationResponse(const SystemAddress& sysAddr, bool void WorldPackets::SendGMLevelChange(const SystemAddress& sysAddr, bool success, eGameMasterLevel highestLevel, eGameMasterLevel prevLevel, eGameMasterLevel newLevel) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::MAKE_GM_RESPONSE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::MAKE_GM_RESPONSE); bitStream.Write(success); bitStream.Write(static_cast(highestLevel)); @@ -172,14 +172,14 @@ void WorldPackets::SendGMLevelChange(const SystemAddress& sysAddr, bool success, void WorldPackets::SendHTTPMonitorInfo(const SystemAddress& sysAddr, const HTTPMonitorInfo& info) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::HTTP_MONITOR_INFO_RESPONSE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::HTTP_MONITOR_INFO_RESPONSE); info.Serialize(bitStream); SEND_PACKET; } void WorldPackets::SendDebugOuput(const SystemAddress& sysAddr, const std::string& data){ CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::DEBUG_OUTPUT); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::DEBUG_OUTPUT); bitStream.Write(data.size()); bitStream.Write(data); SEND_PACKET; diff --git a/dNet/dServer.cpp b/dNet/dServer.cpp index e504a985..20a21d49 100644 --- a/dNet/dServer.cpp +++ b/dNet/dServer.cpp @@ -7,8 +7,8 @@ #include "RakNetworkFactory.h" #include "MessageIdentifiers.h" #include "eConnectionType.h" -#include "eServerMessageType.h" -#include "eMasterMessageType.h" +#include "MessageType/Server.h" +#include "MessageType/Master.h" #include "BitStreamUtils.h" #include "MasterPackets.h" @@ -124,12 +124,12 @@ Packet* dServer::ReceiveFromMaster() { if (packet->data[0] == ID_USER_PACKET_ENUM) { if (static_cast(packet->data[1]) == eConnectionType::MASTER) { - switch (static_cast(packet->data[3])) { - case eMasterMessageType::REQUEST_ZONE_TRANSFER_RESPONSE: { + switch (static_cast(packet->data[3])) { + case MessageType::Master::REQUEST_ZONE_TRANSFER_RESPONSE: { ZoneInstanceManager::Instance()->HandleRequestZoneTransferResponse(packet); break; } - case eMasterMessageType::SHUTDOWN: + case MessageType::Master::SHUTDOWN: *mShouldShutdown = -2; break; @@ -170,7 +170,7 @@ void dServer::SendToMaster(RakNet::BitStream& bitStream) { void dServer::Disconnect(const SystemAddress& sysAddr, eServerDisconnectIdentifiers disconNotifyID) { RakNet::BitStream bitStream; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::SERVER, eServerMessageType::DISCONNECT_NOTIFY); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::SERVER, MessageType::Server::DISCONNECT_NOTIFY); bitStream.Write(disconNotifyID); mPeer->Send(&bitStream, SYSTEM_PRIORITY, RELIABLE_ORDERED, 0, sysAddr, false); diff --git a/dNet/dServer.h b/dNet/dServer.h index 40f606f1..f958fc40 100644 --- a/dNet/dServer.h +++ b/dNet/dServer.h @@ -86,7 +86,7 @@ private: void SetupForMasterConnection(); bool ConnectToMaster(); -private: +protected: Logger* mLogger = nullptr; dConfig* mConfig = nullptr; RakPeerInterface* mPeer = nullptr; diff --git a/dScripts/02_server/Enemy/AM/AmDarklingDragon.cpp b/dScripts/02_server/Enemy/AM/AmDarklingDragon.cpp index 9895395c..dd3e0bd4 100644 --- a/dScripts/02_server/Enemy/AM/AmDarklingDragon.cpp +++ b/dScripts/02_server/Enemy/AM/AmDarklingDragon.cpp @@ -6,7 +6,7 @@ #include "SkillComponent.h" #include "BaseCombatAIComponent.h" #include "EntityInfo.h" -#include "eAninmationFlags.h" +#include "eAnimationFlags.h" #include "RenderComponent.h" void AmDarklingDragon::OnStartup(Entity* self) { diff --git a/dScripts/02_server/Enemy/FV/FvMaelstromDragon.cpp b/dScripts/02_server/Enemy/FV/FvMaelstromDragon.cpp index d2b3c737..6d80b3ff 100644 --- a/dScripts/02_server/Enemy/FV/FvMaelstromDragon.cpp +++ b/dScripts/02_server/Enemy/FV/FvMaelstromDragon.cpp @@ -3,7 +3,7 @@ #include "SkillComponent.h" #include "BaseCombatAIComponent.h" #include "DestroyableComponent.h" -#include "eAninmationFlags.h" +#include "eAnimationFlags.h" #include "EntityInfo.h" #include "RenderComponent.h" diff --git a/dScripts/02_server/Enemy/General/BaseEnemyApe.cpp b/dScripts/02_server/Enemy/General/BaseEnemyApe.cpp index 07221248..d0f73bd1 100644 --- a/dScripts/02_server/Enemy/General/BaseEnemyApe.cpp +++ b/dScripts/02_server/Enemy/General/BaseEnemyApe.cpp @@ -5,7 +5,7 @@ #include "EntityManager.h" #include "EntityInfo.h" #include "SkillComponent.h" -#include "eAninmationFlags.h" +#include "eAnimationFlags.h" #include "RenderComponent.h" #include "eStateChangeType.h" diff --git a/dScripts/02_server/Map/General/PetDigServer.cpp b/dScripts/02_server/Map/General/PetDigServer.cpp index a55c2f29..77a50e5a 100644 --- a/dScripts/02_server/Map/General/PetDigServer.cpp +++ b/dScripts/02_server/Map/General/PetDigServer.cpp @@ -215,20 +215,20 @@ void PetDigServer::SpawnPet(Entity* self, const Entity* owner, const DigInfo dig Game::entityManager->ConstructEntity(spawnedPet); } -Entity* PetDigServer::GetClosestTresure(NiPoint3 position) { +Entity* PetDigServer::GetClosestTreasure(NiPoint3 position) { float closestDistance = 0; Entity* closest = nullptr; - for (const auto tresureId : treasures) { - auto* tresure = Game::entityManager->GetEntity(tresureId); + for (const auto treasureId : treasures) { + auto* treasure = Game::entityManager->GetEntity(treasureId); - if (tresure == nullptr) continue; + if (treasure == nullptr) continue; - float distance = Vector3::DistanceSquared(tresure->GetPosition(), position); + float distance = Vector3::DistanceSquared(treasure->GetPosition(), position); if (closest == nullptr || distance < closestDistance) { closestDistance = distance; - closest = tresure; + closest = treasure; } } diff --git a/dScripts/02_server/Map/General/PetDigServer.h b/dScripts/02_server/Map/General/PetDigServer.h index 1122517b..4091b165 100644 --- a/dScripts/02_server/Map/General/PetDigServer.h +++ b/dScripts/02_server/Map/General/PetDigServer.h @@ -17,7 +17,7 @@ public: void OnStartup(Entity* self) override; void OnDie(Entity* self, Entity* killer) override; - static Entity* GetClosestTresure(NiPoint3 position); + static Entity* GetClosestTreasure(NiPoint3 position); private: static void ProgressPetDigMissions(const Entity* owner, const Entity* chest); diff --git a/dScripts/ai/ACT/FootRace/BaseFootRaceManager.cpp b/dScripts/ai/ACT/FootRace/BaseFootRaceManager.cpp index c02bf565..c5954c4c 100644 --- a/dScripts/ai/ACT/FootRace/BaseFootRaceManager.cpp +++ b/dScripts/ai/ACT/FootRace/BaseFootRaceManager.cpp @@ -12,7 +12,10 @@ void BaseFootRaceManager::OnFireEventServerSide(Entity* self, Entity* sender, st if (splitArguments.size() > 1) { const auto eventName = splitArguments[0]; - const auto player = Game::entityManager->GetEntity(std::stoull(splitArguments[1])); + auto playerId = GeneralUtils::TryParse(splitArguments[1]); + if (!playerId) return; + + const auto player = Game::entityManager->GetEntity(playerId.value()); if (player != nullptr) { if (eventName == "updatePlayer") { diff --git a/dScripts/ai/MINIGAME/SG_GF/SERVER/SGCannon.cpp b/dScripts/ai/MINIGAME/SG_GF/SERVER/SGCannon.cpp index 56f5b257..5b178e06 100644 --- a/dScripts/ai/MINIGAME/SG_GF/SERVER/SGCannon.cpp +++ b/dScripts/ai/MINIGAME/SG_GF/SERVER/SGCannon.cpp @@ -61,6 +61,7 @@ void SGCannon::OnStartup(Entity* self) { if (simplePhysicsComponent != nullptr) { simplePhysicsComponent->SetPhysicsMotionState(5); } + Game::entityManager->SerializeEntity(self); } void SGCannon::OnPlayerLoaded(Entity* self, Entity* player) { diff --git a/dWorldServer/WorldServer.cpp b/dWorldServer/WorldServer.cpp index e07104d6..c723a01e 100644 --- a/dWorldServer/WorldServer.cpp +++ b/dWorldServer/WorldServer.cpp @@ -65,11 +65,11 @@ #include "eServerDisconnectIdentifiers.h" #include "eObjectBits.h" #include "eConnectionType.h" -#include "eServerMessageType.h" -#include "eChatMessageType.h" -#include "eWorldMessageType.h" -#include "eMasterMessageType.h" -#include "eGameMessageType.h" +#include "MessageType/Server.h" +#include "MessageType/Chat.h" +#include "MessageType/World.h" +#include "MessageType/Master.h" +#include "MessageType/Game.h" #include "ZCompression.h" #include "EntityManager.h" #include "CheatDetection.h" @@ -79,7 +79,9 @@ #include "PositionUpdate.h" #include "PlayerManager.h" #include "eLoginResponse.h" +#include "MissionComponent.h" #include "SlashCommandHandler.h" +#include "InventoryComponent.h" namespace Game { Logger* logger = nullptr; @@ -545,8 +547,8 @@ void HandlePacketChat(Packet* packet) { if (packet->data[0] == ID_USER_PACKET_ENUM && packet->length >= 4) { if (static_cast(packet->data[1]) == eConnectionType::CHAT) { - switch (static_cast(packet->data[3])) { - case eChatMessageType::WORLD_ROUTE_PACKET: { + switch (static_cast(packet->data[3])) { + case MessageType::Chat::WORLD_ROUTE_PACKET: { CINSTREAM_SKIP_HEADER; LWOOBJID playerID; inStream.Read(playerID); @@ -567,7 +569,7 @@ void HandlePacketChat(Packet* packet) { break; } - case eChatMessageType::GM_ANNOUNCE: { + case MessageType::Chat::GM_ANNOUNCE: { CINSTREAM_SKIP_HEADER; std::string title; @@ -600,7 +602,7 @@ void HandlePacketChat(Packet* packet) { break; } - case eChatMessageType::GM_MUTE: { + case MessageType::Chat::GM_MUTE: { CINSTREAM_SKIP_HEADER; LWOOBJID playerId; time_t expire = 0; @@ -619,7 +621,7 @@ void HandlePacketChat(Packet* packet) { break; } - case eChatMessageType::TEAM_GET_STATUS: { + case MessageType::Chat::TEAM_GET_STATUS: { CINSTREAM_SKIP_HEADER; LWOOBJID teamID = 0; @@ -663,8 +665,8 @@ void HandlePacketChat(Packet* packet) { void HandleMasterPacket(Packet* packet) { if (packet->length < 2) return; if (static_cast(packet->data[1]) != eConnectionType::MASTER || packet->length < 4) return; - switch (static_cast(packet->data[3])) { - case eMasterMessageType::REQUEST_PERSISTENT_ID_RESPONSE: { + switch (static_cast(packet->data[3])) { + case MessageType::Master::REQUEST_PERSISTENT_ID_RESPONSE: { CINSTREAM_SKIP_HEADER; uint64_t requestID; inStream.Read(requestID); @@ -674,7 +676,7 @@ void HandleMasterPacket(Packet* packet) { break; } - case eMasterMessageType::SESSION_KEY_RESPONSE: { + case MessageType::Master::SESSION_KEY_RESPONSE: { //Read our session key and to which user it belongs: CINSTREAM_SKIP_HEADER; uint32_t sessionKey = 0; @@ -729,7 +731,7 @@ void HandleMasterPacket(Packet* packet) { //Notify master: { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::PLAYER_ADDED); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, MessageType::Master::PLAYER_ADDED); bitStream.Write(Game::server->GetZoneID()); bitStream.Write(instanceID); Game::server->SendToMaster(bitStream); @@ -738,7 +740,7 @@ void HandleMasterPacket(Packet* packet) { break; } - case eMasterMessageType::AFFIRM_TRANSFER_REQUEST: { + case MessageType::Master::AFFIRM_TRANSFER_REQUEST: { CINSTREAM_SKIP_HEADER; uint64_t requestID; inStream.Read(requestID); @@ -746,20 +748,20 @@ void HandleMasterPacket(Packet* packet) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::AFFIRM_TRANSFER_RESPONSE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, MessageType::Master::AFFIRM_TRANSFER_RESPONSE); bitStream.Write(requestID); Game::server->SendToMaster(bitStream); break; } - case eMasterMessageType::SHUTDOWN: { + case MessageType::Master::SHUTDOWN: { Game::lastSignal = -1; LOG("Got shutdown request from master, zone (%i), instance (%i)", Game::server->GetZoneID(), Game::server->GetInstanceID()); break; } - case eMasterMessageType::NEW_SESSION_ALERT: { + case MessageType::Master::NEW_SESSION_ALERT: { CINSTREAM_SKIP_HEADER; uint32_t sessionKey = inStream.Read(sessionKey); @@ -820,7 +822,7 @@ void HandlePacket(Packet* packet) { { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::UNEXPECTED_DISCONNECT); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::UNEXPECTED_DISCONNECT); bitStream.Write(user->GetLoggedInChar()); Game::chatServer->Send(&bitStream, SYSTEM_PRIORITY, RELIABLE, 0, Game::chatSysAddr, false); } @@ -832,7 +834,7 @@ void HandlePacket(Packet* packet) { } CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::PLAYER_REMOVED); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, MessageType::Master::PLAYER_REMOVED); bitStream.Write(Game::server->GetZoneID()); bitStream.Write(instanceID); Game::server->SendToMaster(bitStream); @@ -840,15 +842,15 @@ void HandlePacket(Packet* packet) { if (packet->data[0] != ID_USER_PACKET_ENUM || packet->length < 4) return; if (static_cast(packet->data[1]) == eConnectionType::SERVER) { - if (static_cast(packet->data[3]) == eServerMessageType::VERSION_CONFIRM) { + if (static_cast(packet->data[3]) == MessageType::Server::VERSION_CONFIRM) { AuthPackets::HandleHandshake(Game::server, packet); } } if (static_cast(packet->data[1]) != eConnectionType::WORLD) return; - switch (static_cast(packet->data[3])) { - case eWorldMessageType::VALIDATION: { + switch (static_cast(packet->data[3])) { + case MessageType::World::VALIDATION: { CINSTREAM_SKIP_HEADER; LUWString username; inStream.Read(username); @@ -896,7 +898,7 @@ void HandlePacket(Packet* packet) { //Request the session info from Master: CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::REQUEST_SESSION_KEY); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, MessageType::Master::REQUEST_SESSION_KEY); bitStream.Write(username); Game::server->SendToMaster(bitStream); @@ -909,7 +911,7 @@ void HandlePacket(Packet* packet) { break; } - case eWorldMessageType::CHARACTER_LIST_REQUEST: { + case MessageType::World::CHARACTER_LIST_REQUEST: { //We need to delete the entity first, otherwise the char list could delete it while it exists in the world! if (Game::server->GetZoneID() != 0) { auto user = UserManager::Instance()->GetUser(packet->systemAddress); @@ -931,12 +933,12 @@ void HandlePacket(Packet* packet) { break; } - case eWorldMessageType::GAME_MSG: { + case MessageType::World::GAME_MSG: { RakNet::BitStream bitStream(packet->data, packet->length, false); uint64_t header; LWOOBJID objectID; - eGameMessageType messageID; + MessageType::Game messageID; bitStream.Read(header); bitStream.Read(objectID); @@ -957,12 +959,12 @@ void HandlePacket(Packet* packet) { break; } - case eWorldMessageType::CHARACTER_CREATE_REQUEST: { + case MessageType::World::CHARACTER_CREATE_REQUEST: { UserManager::Instance()->CreateCharacter(packet->systemAddress, packet); break; } - case eWorldMessageType::LOGIN_REQUEST: { + case MessageType::World::LOGIN_REQUEST: { RakNet::BitStream inStream(packet->data, packet->length, false); uint64_t header = inStream.Read(header); @@ -989,7 +991,7 @@ void HandlePacket(Packet* packet) { // This means we swapped characters and we need to remove the previous player from the container. if (static_cast(lastCharacter) != playerID) { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::UNEXPECTED_DISCONNECT); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::UNEXPECTED_DISCONNECT); bitStream.Write(lastCharacter); Game::chatServer->Send(&bitStream, SYSTEM_PRIORITY, RELIABLE, 0, Game::chatSysAddr, false); } @@ -999,17 +1001,17 @@ void HandlePacket(Packet* packet) { break; } - case eWorldMessageType::CHARACTER_DELETE_REQUEST: { + case MessageType::World::CHARACTER_DELETE_REQUEST: { UserManager::Instance()->DeleteCharacter(packet->systemAddress, packet); break; } - case eWorldMessageType::CHARACTER_RENAME_REQUEST: { + case MessageType::World::CHARACTER_RENAME_REQUEST: { UserManager::Instance()->RenameCharacter(packet->systemAddress, packet); break; } - case eWorldMessageType::LEVEL_LOAD_COMPLETE: { + case MessageType::World::LEVEL_LOAD_COMPLETE: { LOG("Received level load complete from user."); User* user = UserManager::Instance()->GetUser(packet->systemAddress); if (user) { @@ -1042,7 +1044,9 @@ void HandlePacket(Packet* packet) { // Do charxml fixes here auto* levelComponent = player->GetComponent(); - if (!levelComponent) return; + auto* const inventoryComponent = player->GetComponent(); + const auto* const missionComponent = player->GetComponent(); + if (!levelComponent || !missionComponent || !inventoryComponent) return; auto version = levelComponent->GetCharacterVersion(); switch (version) { @@ -1059,7 +1063,23 @@ void HandlePacket(Packet* packet) { case eCharacterVersion::VAULT_SIZE: LOG("Updaing Speedbase"); levelComponent->SetRetroactiveBaseSpeed(); + levelComponent->SetCharacterVersion(eCharacterVersion::SPEED_BASE); + case eCharacterVersion::SPEED_BASE: { + LOG("Removing lots from NJ Jay missions bugged at foss"); + // https://explorer.lu/missions/1789 + const auto* mission = missionComponent->GetMission(1789); + if (mission && mission->IsComplete()) { + inventoryComponent->RemoveItem(14474, 1, eInventoryType::ITEMS); + inventoryComponent->RemoveItem(14474, 1, eInventoryType::VAULT_ITEMS); + } + // https://explorer.lu/missions/1927 + mission = missionComponent->GetMission(1927); + if (mission && mission->IsComplete()) { + inventoryComponent->RemoveItem(14493, 1, eInventoryType::ITEMS); + inventoryComponent->RemoveItem(14493, 1, eInventoryType::VAULT_ITEMS); + } levelComponent->SetCharacterVersion(eCharacterVersion::UP_TO_DATE); + } case eCharacterVersion::UP_TO_DATE: break; } @@ -1102,7 +1122,7 @@ void HandlePacket(Packet* packet) { GeneralUtils::SetBit(blueprintID, eObjectBits::PERSISTENT); CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::BLUEPRINT_SAVE_RESPONSE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, MessageType::Client::BLUEPRINT_SAVE_RESPONSE); bitStream.Write(LWOOBJID_EMPTY); //always zero so that a check on the client passes bitStream.Write(eBlueprintSaveResponseType::EverythingWorked); bitStream.Write(1); @@ -1134,7 +1154,7 @@ void HandlePacket(Packet* packet) { const auto& playerName = character->GetName(); CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::LOGIN_SESSION_NOTIFY); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::LOGIN_SESSION_NOTIFY); bitStream.Write(player->GetObjectID()); bitStream.Write(playerName.size()); for (size_t i = 0; i < playerName.size(); i++) { @@ -1160,7 +1180,7 @@ void HandlePacket(Packet* packet) { break; } - case eWorldMessageType::POSITION_UPDATE: { + case MessageType::World::POSITION_UPDATE: { auto positionUpdate = ClientPackets::HandleClientPositionUpdate(packet); User* user = UserManager::Instance()->GetUser(packet->systemAddress); @@ -1174,7 +1194,7 @@ void HandlePacket(Packet* packet) { break; } - case eWorldMessageType::MAIL: { + case MessageType::World::MAIL: { RakNet::BitStream bitStream(packet->data, packet->length, false); // FIXME: Change this to the macro to skip the header... LWOOBJID space; @@ -1183,7 +1203,7 @@ void HandlePacket(Packet* packet) { break; } - case eWorldMessageType::ROUTE_PACKET: { + case MessageType::World::ROUTE_PACKET: { //Yeet to chat CINSTREAM_SKIP_HEADER; uint32_t size = 0; @@ -1217,7 +1237,7 @@ void HandlePacket(Packet* packet) { break; } - case eWorldMessageType::STRING_CHECK: { + case MessageType::World::STRING_CHECK: { auto request = ClientPackets::HandleChatModerationRequest(packet); // TODO: Find a good home for the logic in this case. @@ -1289,7 +1309,7 @@ void HandlePacket(Packet* packet) { break; } - case eWorldMessageType::GENERAL_CHAT_MESSAGE: { + case MessageType::World::GENERAL_CHAT_MESSAGE: { if (chatDisabled) { ChatPackets::SendMessageFail(packet->systemAddress); } else { @@ -1321,7 +1341,7 @@ void HandlePacket(Packet* packet) { break; } - case eWorldMessageType::HANDLE_FUNNESS: { + case MessageType::World::HANDLE_FUNNESS: { //This means the client is running slower or faster than it should. //Could be insane lag, but I'mma just YEET them as it's usually speedhacking. //This is updated to now count the amount of times we've been caught "speedhacking" to kick with a delay @@ -1340,7 +1360,7 @@ void HandlePacket(Packet* packet) { } - case eWorldMessageType::UI_HELP_TOP_5: { + case MessageType::World::UI_HELP_TOP_5: { auto language = ClientPackets::SendTop5HelpIssues(packet); // TODO: Handle different languages in a nice way // 0: en_US @@ -1376,7 +1396,7 @@ void HandlePacket(Packet* packet) { } default: - const auto messageId = *reinterpret_cast(&packet->data[3]); + const auto messageId = *reinterpret_cast(&packet->data[3]); const std::string_view messageIdString = StringifiedEnum::ToString(messageId); LOG("Unknown world packet received: %4i, %s", messageId, messageIdString.data()); } @@ -1462,6 +1482,6 @@ void FinalizeShutdown() { void SendShutdownMessageToMaster() { CBITSTREAM; - BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::SHUTDOWN_RESPONSE); + BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, MessageType::Master::SHUTDOWN_RESPONSE); Game::server->SendToMaster(bitStream); } diff --git a/dZoneManager/Level.cpp b/dZoneManager/Level.cpp index 5f35b629..d2b67b29 100644 --- a/dZoneManager/Level.cpp +++ b/dZoneManager/Level.cpp @@ -131,12 +131,16 @@ void Level::ReadChunks(std::istream& file) { if (initPos == std::streamoff(0)) { //Really old chunk version file.seekg(0); Header header; - header.id = ChunkTypeID::FileInfo; //I guess? + header.id = ChunkTypeID::FileInfo; BinaryIO::BinaryRead(file, header.chunkVersion); BinaryIO::BinaryRead(file, header.chunkType); - file.ignore(1); - BinaryIO::BinaryRead(file, header.fileInfo.revision); - + uint8_t important = 0; + BinaryIO::BinaryRead(file, important); + // file.ignore(1); //probably used + if (header.chunkVersion > 36) { + BinaryIO::BinaryRead(file, header.fileInfo.revision); + } + // HARDCODED 3 if (header.chunkVersion >= 45) file.ignore(4); file.ignore(4 * (4 * 3)); @@ -170,25 +174,32 @@ void Level::ReadChunks(std::istream& file) { } } - for (uint32_t i = 0; i < 6; ++i) { - uint32_t count = 0; - BinaryIO::BinaryRead(file, count); - file.ignore(count); - } - - file.ignore(4); - + // skydome info uint32_t count = 0; BinaryIO::BinaryRead(file, count); - file.ignore(count * 12); + file.ignore(count); + if (header.chunkVersion >= 33) { + for (uint32_t i = 0; i < 5; ++i) { + uint32_t count = 0; + BinaryIO::BinaryRead(file, count); + file.ignore(count); + } + } + // editor settings + if (!important && header.chunkVersion >= 37){ + file.ignore(4); + + uint32_t count = 0; + BinaryIO::BinaryRead(file, count); + file.ignore(count * 12); + + } + + header.id = ChunkTypeID::SceneObjectData; + header.fileInfo.version = header.chunkVersion; + ReadSceneObjectDataChunk(file, header); m_ChunkHeaders.insert(std::make_pair(header.id, header)); - - //Now pretend to be a normal file and read Objects chunk: - Header hdr; - hdr.id = ChunkTypeID::SceneObjectData; - ReadSceneObjectDataChunk(file, hdr); - m_ChunkHeaders.insert(std::make_pair(hdr.id, hdr)); } break; } } @@ -224,8 +235,14 @@ void Level::ReadSceneObjectDataChunk(std::istream& file, Header& header) { BinaryIO::BinaryRead(file, obj.id); BinaryIO::BinaryRead(file, obj.lot); - /*if (header.fileInfo->version >= 0x26)*/ BinaryIO::BinaryRead(file, obj.nodeType); - /*if (header.fileInfo->version >= 0x20)*/ BinaryIO::BinaryRead(file, obj.glomId); + if (header.fileInfo.version >= 38) { + uint32_t tmp = 1; + BinaryIO::BinaryRead(file, tmp); + if (tmp > -1 && tmp < 11) obj.nodeType = tmp; + } + if (header.fileInfo.version >= 32) { + BinaryIO::BinaryRead(file, obj.glomId); + } BinaryIO::BinaryRead(file, obj.position); BinaryIO::BinaryRead(file, obj.rotation); diff --git a/dZoneManager/Zone.cpp b/dZoneManager/Zone.cpp index 44532fc9..1d657075 100644 --- a/dZoneManager/Zone.cpp +++ b/dZoneManager/Zone.cpp @@ -160,6 +160,7 @@ std::string Zone::GetFilePathForZoneID() { if (zone != nullptr) { std::string toReturn = "maps/" + zone->zoneName; std::transform(toReturn.begin(), toReturn.end(), toReturn.begin(), ::tolower); + std::ranges::replace(toReturn, '\\', '/'); return toReturn; } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e8765191..24adec61 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,8 +4,6 @@ enable_testing() find_package(GoogleTest REQUIRED) include(GoogleTest) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) - if(APPLE) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH True) set(CMAKE_BUILD_WITH_INSTALL_RPATH True) diff --git a/tests/dCommonTests/AMFDeserializeTests.cpp b/tests/dCommonTests/AMFDeserializeTests.cpp index c949ae50..0a8c0ac7 100644 --- a/tests/dCommonTests/AMFDeserializeTests.cpp +++ b/tests/dCommonTests/AMFDeserializeTests.cpp @@ -13,8 +13,7 @@ */ std::unique_ptr ReadFromBitStream(RakNet::BitStream& bitStream) { AMFDeserialize deserializer; - AMFBaseValue* returnValue(deserializer.Read(bitStream)); - return std::unique_ptr{ returnValue }; + return deserializer.Read(bitStream); } /** @@ -176,7 +175,7 @@ TEST(dCommonTests, AMFDeserializeAMFArrayTest) { /** * @brief This test checks that if we recieve an unimplemented eAmf * we correctly throw an error and can actch it. - * Yes this leaks memory. + * Yes this leaks memory. */ TEST(dCommonTests, AMFDeserializeUnimplementedValuesTest) { std::vector unimplementedValues = { @@ -254,7 +253,7 @@ TEST(dCommonTests, AMFDeserializeLivePacketTest) { ASSERT_EQ(strips.size(), 1); - auto* stripsPosition0 = dynamic_cast(strips[0]); + auto* stripsPosition0 = dynamic_cast(strips[0].get()); auto* actionIndex = stripsPosition0->Get("actionIndex"); @@ -272,7 +271,7 @@ TEST(dCommonTests, AMFDeserializeLivePacketTest) { ASSERT_EQ(states.size(), 1); - auto* firstState = dynamic_cast(states[0]); + auto* firstState = dynamic_cast(states[0].get()); auto* stateID = firstState->Get("id"); @@ -282,7 +281,7 @@ TEST(dCommonTests, AMFDeserializeLivePacketTest) { ASSERT_EQ(stripsInState.size(), 1); - auto* firstStrip = dynamic_cast(stripsInState[0]); + auto* firstStrip = dynamic_cast(stripsInState[0].get()); auto& actionsInFirstStrip = firstStrip->GetArray("actions")->GetDense(); @@ -304,7 +303,7 @@ TEST(dCommonTests, AMFDeserializeLivePacketTest) { ASSERT_EQ(stripId->GetValue(), 0.0f); - auto* firstAction = dynamic_cast(actionsInFirstStrip[0]); + auto* firstAction = dynamic_cast(actionsInFirstStrip[0].get()); auto* firstType = firstAction->Get("Type"); @@ -314,7 +313,7 @@ TEST(dCommonTests, AMFDeserializeLivePacketTest) { ASSERT_EQ(firstCallback->GetValue(), ""); - auto* secondAction = dynamic_cast(actionsInFirstStrip[1]); + auto* secondAction = dynamic_cast(actionsInFirstStrip[1].get()); auto* secondType = secondAction->Get("Type"); @@ -328,7 +327,7 @@ TEST(dCommonTests, AMFDeserializeLivePacketTest) { ASSERT_EQ(secondDistance->GetValue(), 25.0f); - auto* thirdAction = dynamic_cast(actionsInFirstStrip[2]); + auto* thirdAction = dynamic_cast(actionsInFirstStrip[2].get()); auto* thirdType = thirdAction->Get("Type"); @@ -363,7 +362,7 @@ TEST(dCommonTests, AMFBadConversionTest) { ASSERT_EQ(result->Get("BehaviorID"), nullptr); // Does not exist in the associative portion - ASSERT_EQ(result->Get("DOES_NOT_EXIST"), nullptr); + ASSERT_EQ(result->Get("DOES_NOT_EXIST"), nullptr); result->Push(true); diff --git a/tests/dCommonTests/Amf3Tests.cpp b/tests/dCommonTests/Amf3Tests.cpp index 5b52cf27..79d0d496 100644 --- a/tests/dCommonTests/Amf3Tests.cpp +++ b/tests/dCommonTests/Amf3Tests.cpp @@ -78,7 +78,7 @@ TEST(dCommonTests, AMF3InsertionAssociativeTest) { ASSERT_EQ(array.Get("Integer")->GetValueType(), eAmf::Integer); ASSERT_EQ(array.Get("Double")->GetValueType(), eAmf::Double); ASSERT_EQ(array.GetArray("Array")->GetValueType(), eAmf::Array); - ASSERT_EQ(array.Get("Null")->GetValueType(), eAmf::Null); + ASSERT_EQ(array.Get("Null")->GetValueType(), eAmf::Null); ASSERT_EQ(array.Get>("Undefined")->GetValueType(), eAmf::Undefined); } @@ -101,6 +101,6 @@ TEST(dCommonTests, AMF3InsertionDenseTest) { ASSERT_EQ(array.Get(4)->GetValueType(), eAmf::Integer); ASSERT_EQ(array.Get(5)->GetValueType(), eAmf::Double); ASSERT_EQ(array.GetArray(6)->GetValueType(), eAmf::Array); - ASSERT_EQ(array.Get(7)->GetValueType(), eAmf::Null); + ASSERT_EQ(array.Get(7)->GetValueType(), eAmf::Null); ASSERT_EQ(array.Get>(8)->GetValueType(), eAmf::Undefined); } diff --git a/tests/dCommonTests/ToUnderlyingTests.cpp b/tests/dCommonTests/ToUnderlyingTests.cpp index 4cbf4635..c062ff78 100644 --- a/tests/dCommonTests/ToUnderlyingTests.cpp +++ b/tests/dCommonTests/ToUnderlyingTests.cpp @@ -3,22 +3,22 @@ #include "GeneralUtils.h" #include "eGameMasterLevel.h" -#include "eGameMessageType.h" -#include "eWorldMessageType.h" +#include "MessageType/Game.h" +#include "MessageType/World.h" #define ASSERT_TYPE_EQ(TYPE, ENUM)\ ASSERT_TRUE(typeid(TYPE) == typeid(GeneralUtils::ToUnderlying(static_cast(0)))); #define ASSERT_TYPE_NE(TYPE, ENUM)\ ASSERT_FALSE(typeid(TYPE) == typeid(GeneralUtils::ToUnderlying(static_cast(0)))); - + // Verify that the underlying enum types are being cast correctly TEST(ToUnderlyingTests, VerifyToUnderlying) { ASSERT_TYPE_EQ(uint8_t, eGameMasterLevel); - ASSERT_TYPE_EQ(uint16_t, eGameMessageType); - ASSERT_TYPE_EQ(uint32_t, eWorldMessageType) + ASSERT_TYPE_EQ(uint16_t, MessageType::Game); + ASSERT_TYPE_EQ(uint32_t, MessageType::World) ASSERT_TYPE_NE(void, eGameMasterLevel); - ASSERT_TYPE_NE(void, eGameMessageType); - ASSERT_TYPE_NE(void, eWorldMessageType) + ASSERT_TYPE_NE(void, MessageType::Game); + ASSERT_TYPE_NE(void, MessageType::World) } diff --git a/tests/dCommonTests/dEnumsTests/MagicEnumTests.cpp b/tests/dCommonTests/dEnumsTests/MagicEnumTests.cpp index c47eb489..fcd517f1 100644 --- a/tests/dCommonTests/dEnumsTests/MagicEnumTests.cpp +++ b/tests/dCommonTests/dEnumsTests/MagicEnumTests.cpp @@ -6,8 +6,8 @@ #include "StringifiedEnum.h" #include "Logger.h" #include "Game.h" -#include "eGameMessageType.h" -#include "eWorldMessageType.h" +#include "MessageType/Game.h" +#include "MessageType/World.h" #include "magic_enum.hpp" #define ENUM_EQ(e, y, z)\ @@ -21,47 +21,47 @@ TEST(MagicEnumTest, eWorldMessageTypeTest) { Game::logger = new Logger("./MagicEnumTest_eWorldMessageTypeTest.log", true, true); - ENUM_EQ(eWorldMessageType, 1, VALIDATION); - ENUM_EQ(eWorldMessageType, 2, CHARACTER_LIST_REQUEST); - ENUM_EQ(eWorldMessageType, 3, CHARACTER_CREATE_REQUEST); - ENUM_EQ(eWorldMessageType, 4, LOGIN_REQUEST); - ENUM_EQ(eWorldMessageType, 5, GAME_MSG); - ENUM_EQ(eWorldMessageType, 6, CHARACTER_DELETE_REQUEST); - ENUM_EQ(eWorldMessageType, 7, CHARACTER_RENAME_REQUEST); - ENUM_EQ(eWorldMessageType, 8, HAPPY_FLOWER_MODE_NOTIFY); - ENUM_EQ(eWorldMessageType, 9, SLASH_RELOAD_MAP); - ENUM_EQ(eWorldMessageType, 10, SLASH_PUSH_MAP_REQUEST); - ENUM_EQ(eWorldMessageType, 11, SLASH_PUSH_MAP); - ENUM_EQ(eWorldMessageType, 12, SLASH_PULL_MAP); - ENUM_EQ(eWorldMessageType, 13, LOCK_MAP_REQUEST); - ENUM_EQ(eWorldMessageType, 14, GENERAL_CHAT_MESSAGE); - ENUM_EQ(eWorldMessageType, 15, HTTP_MONITOR_INFO_REQUEST); - ENUM_EQ(eWorldMessageType, 16, SLASH_DEBUG_SCRIPTS); - ENUM_EQ(eWorldMessageType, 17, MODELS_CLEAR); - ENUM_EQ(eWorldMessageType, 18, EXHIBIT_INSERT_MODEL); - ENUM_EQ(eWorldMessageType, 19, LEVEL_LOAD_COMPLETE); - ENUM_EQ(eWorldMessageType, 20, TMP_GUILD_CREATE); - ENUM_EQ(eWorldMessageType, 21, ROUTE_PACKET); - ENUM_EQ(eWorldMessageType, 22, POSITION_UPDATE); - ENUM_EQ(eWorldMessageType, 23, MAIL); - ENUM_EQ(eWorldMessageType, 24, WORD_CHECK); - ENUM_EQ(eWorldMessageType, 25, STRING_CHECK); - ENUM_EQ(eWorldMessageType, 26, GET_PLAYERS_IN_ZONE); - ENUM_EQ(eWorldMessageType, 27, REQUEST_UGC_MANIFEST_INFO); - ENUM_EQ(eWorldMessageType, 28, BLUEPRINT_GET_ALL_DATA_REQUEST); - ENUM_EQ(eWorldMessageType, 29, CANCEL_MAP_QUEUE); - ENUM_EQ(eWorldMessageType, 30, HANDLE_FUNNESS); - ENUM_EQ(eWorldMessageType, 31, FAKE_PRG_CSR_MESSAGE); - ENUM_EQ(eWorldMessageType, 32, REQUEST_FREE_TRIAL_REFRESH); - ENUM_EQ(eWorldMessageType, 33, GM_SET_FREE_TRIAL_STATUS); - ENUM_EQ(eWorldMessageType, 91, UI_HELP_TOP_5); - ENUM_NE(eWorldMessageType, 37); - ENUM_NE(eWorldMessageType, 123); + ENUM_EQ(MessageType::World, 1, VALIDATION); + ENUM_EQ(MessageType::World, 2, CHARACTER_LIST_REQUEST); + ENUM_EQ(MessageType::World, 3, CHARACTER_CREATE_REQUEST); + ENUM_EQ(MessageType::World, 4, LOGIN_REQUEST); + ENUM_EQ(MessageType::World, 5, GAME_MSG); + ENUM_EQ(MessageType::World, 6, CHARACTER_DELETE_REQUEST); + ENUM_EQ(MessageType::World, 7, CHARACTER_RENAME_REQUEST); + ENUM_EQ(MessageType::World, 8, HAPPY_FLOWER_MODE_NOTIFY); + ENUM_EQ(MessageType::World, 9, SLASH_RELOAD_MAP); + ENUM_EQ(MessageType::World, 10, SLASH_PUSH_MAP_REQUEST); + ENUM_EQ(MessageType::World, 11, SLASH_PUSH_MAP); + ENUM_EQ(MessageType::World, 12, SLASH_PULL_MAP); + ENUM_EQ(MessageType::World, 13, LOCK_MAP_REQUEST); + ENUM_EQ(MessageType::World, 14, GENERAL_CHAT_MESSAGE); + ENUM_EQ(MessageType::World, 15, HTTP_MONITOR_INFO_REQUEST); + ENUM_EQ(MessageType::World, 16, SLASH_DEBUG_SCRIPTS); + ENUM_EQ(MessageType::World, 17, MODELS_CLEAR); + ENUM_EQ(MessageType::World, 18, EXHIBIT_INSERT_MODEL); + ENUM_EQ(MessageType::World, 19, LEVEL_LOAD_COMPLETE); + ENUM_EQ(MessageType::World, 20, TMP_GUILD_CREATE); + ENUM_EQ(MessageType::World, 21, ROUTE_PACKET); + ENUM_EQ(MessageType::World, 22, POSITION_UPDATE); + ENUM_EQ(MessageType::World, 23, MAIL); + ENUM_EQ(MessageType::World, 24, WORD_CHECK); + ENUM_EQ(MessageType::World, 25, STRING_CHECK); + ENUM_EQ(MessageType::World, 26, GET_PLAYERS_IN_ZONE); + ENUM_EQ(MessageType::World, 27, REQUEST_UGC_MANIFEST_INFO); + ENUM_EQ(MessageType::World, 28, BLUEPRINT_GET_ALL_DATA_REQUEST); + ENUM_EQ(MessageType::World, 29, CANCEL_MAP_QUEUE); + ENUM_EQ(MessageType::World, 30, HANDLE_FUNNESS); + ENUM_EQ(MessageType::World, 31, FAKE_PRG_CSR_MESSAGE); + ENUM_EQ(MessageType::World, 32, REQUEST_FREE_TRIAL_REFRESH); + ENUM_EQ(MessageType::World, 33, GM_SET_FREE_TRIAL_STATUS); + ENUM_EQ(MessageType::World, 91, UI_HELP_TOP_5); + ENUM_NE(MessageType::World, 37); + ENUM_NE(MessageType::World, 123); srand(time(NULL)); auto begin = std::chrono::high_resolution_clock::now(); for (int i = 0; i < 10000000; ++i) { - volatile auto f = StringifiedEnum::ToString(static_cast(i)).data(); + volatile auto f = StringifiedEnum::ToString(static_cast(i)).data(); // To ensure the compiler doesn't optimize out the call, I print it at random intervals if (rand() % 100000 == 0) LOG("%i, %s", i, f); @@ -78,34 +78,34 @@ TEST(MagicEnumTest, eGameMessageTypeTest) { Game::logger = new Logger("./MagicEnumTest_eGameMessageTypeTest.log", true, true); // Only doing the first and last 10 for the sake of my sanity - ENUM_EQ(eGameMessageType, 0, GET_POSITION); - ENUM_EQ(eGameMessageType, 1, GET_ROTATION); - ENUM_EQ(eGameMessageType, 2, GET_LINEAR_VELOCITY); - ENUM_EQ(eGameMessageType, 3, GET_ANGULAR_VELOCITY); - ENUM_EQ(eGameMessageType, 4, GET_FORWARD_VELOCITY); - ENUM_EQ(eGameMessageType, 5, GET_PLAYER_FORWARD); - ENUM_EQ(eGameMessageType, 6, GET_FORWARD_VECTOR); - ENUM_EQ(eGameMessageType, 7, SET_POSITION); - ENUM_EQ(eGameMessageType, 8, SET_LOCAL_POSITION); - ENUM_EQ(eGameMessageType, 9, SET_ROTATION); - ENUM_EQ(eGameMessageType, 10, SET_LINEAR_VELOCITY); - ENUM_EQ(eGameMessageType, 1762, USE_SKILL_SET); - ENUM_EQ(eGameMessageType, 1763, SET_SKILL_SET_POSSESSOR); - ENUM_EQ(eGameMessageType, 1764, POPULATE_ACTION_BAR); - ENUM_EQ(eGameMessageType, 1765, GET_COMPONENT_TEMPLATE_ID); - ENUM_EQ(eGameMessageType, 1766, GET_POSSESSABLE_SKILL_SET); - ENUM_EQ(eGameMessageType, 1767, MARK_INVENTORY_ITEM_AS_ACTIVE); - ENUM_EQ(eGameMessageType, 1768, UPDATE_FORGED_ITEM); - ENUM_EQ(eGameMessageType, 1769, CAN_ITEMS_BE_REFORGED); - ENUM_EQ(eGameMessageType, 1771, NOTIFY_CLIENT_RAIL_START_FAILED); - ENUM_EQ(eGameMessageType, 1772, GET_IS_ON_RAIL); - ENUM_NE(eGameMessageType, 32); - ENUM_NE(eGameMessageType, 1776); + ENUM_EQ(MessageType::Game, 0, GET_POSITION); + ENUM_EQ(MessageType::Game, 1, GET_ROTATION); + ENUM_EQ(MessageType::Game, 2, GET_LINEAR_VELOCITY); + ENUM_EQ(MessageType::Game, 3, GET_ANGULAR_VELOCITY); + ENUM_EQ(MessageType::Game, 4, GET_FORWARD_VELOCITY); + ENUM_EQ(MessageType::Game, 5, GET_PLAYER_FORWARD); + ENUM_EQ(MessageType::Game, 6, GET_FORWARD_VECTOR); + ENUM_EQ(MessageType::Game, 7, SET_POSITION); + ENUM_EQ(MessageType::Game, 8, SET_LOCAL_POSITION); + ENUM_EQ(MessageType::Game, 9, SET_ROTATION); + ENUM_EQ(MessageType::Game, 10, SET_LINEAR_VELOCITY); + ENUM_EQ(MessageType::Game, 1762, USE_SKILL_SET); + ENUM_EQ(MessageType::Game, 1763, SET_SKILL_SET_POSSESSOR); + ENUM_EQ(MessageType::Game, 1764, POPULATE_ACTION_BAR); + ENUM_EQ(MessageType::Game, 1765, GET_COMPONENT_TEMPLATE_ID); + ENUM_EQ(MessageType::Game, 1766, GET_POSSESSABLE_SKILL_SET); + ENUM_EQ(MessageType::Game, 1767, MARK_INVENTORY_ITEM_AS_ACTIVE); + ENUM_EQ(MessageType::Game, 1768, UPDATE_FORGED_ITEM); + ENUM_EQ(MessageType::Game, 1769, CAN_ITEMS_BE_REFORGED); + ENUM_EQ(MessageType::Game, 1771, NOTIFY_CLIENT_RAIL_START_FAILED); + ENUM_EQ(MessageType::Game, 1772, GET_IS_ON_RAIL); + ENUM_NE(MessageType::Game, 32); + ENUM_NE(MessageType::Game, 1776); srand(time(NULL)); auto begin = std::chrono::high_resolution_clock::now(); for (int i = 0; i < 10000000; ++i) { - volatile auto f = StringifiedEnum::ToString(static_cast(i)).data(); + volatile auto f = StringifiedEnum::ToString(static_cast(i)).data(); // To ensure the compiler doesn't optimize out the call, I print it at random intervals if (rand() % 100000 == 0) LOG("%i, %s", i, f); @@ -135,10 +135,10 @@ namespace { TEST(MagicEnumTest, ArraysAreSorted) { Game::logger = new Logger("./MagicEnumTest_ArraysAreSorted.log", true, true); - constexpr auto wmArray = &magic_enum::enum_entries(); + constexpr auto wmArray = &magic_enum::enum_entries(); AssertEnumArraySorted(wmArray); - constexpr auto gmArray = &magic_enum::enum_entries(); + constexpr auto gmArray = &magic_enum::enum_entries(); AssertEnumArraySorted(gmArray); delete Game::logger; diff --git a/tests/dGameTests/CMakeLists.txt b/tests/dGameTests/CMakeLists.txt index 58f213e0..e1c29433 100644 --- a/tests/dGameTests/CMakeLists.txt +++ b/tests/dGameTests/CMakeLists.txt @@ -9,6 +9,7 @@ add_subdirectory(dGameMessagesTests) list(APPEND DGAMETEST_SOURCES ${DGAMEMESSAGES_TESTS}) file(COPY ${GAMEMESSAGE_TESTBITSTREAMS} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +file(COPY ${COMPONENT_TEST_DATA} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) # Add the executable. Remember to add all tests above this! add_executable(dGameTests ${DGAMETEST_SOURCES}) diff --git a/tests/dGameTests/GameDependencies.h b/tests/dGameTests/GameDependencies.h index 52e3919a..9f8dbb2b 100644 --- a/tests/dGameTests/GameDependencies.h +++ b/tests/dGameTests/GameDependencies.h @@ -8,6 +8,9 @@ #include "EntityInfo.h" #include "EntityManager.h" #include "dConfig.h" +#include "dZoneManager.h" +#include "GameDatabase/TestSQL/TestSQLDatabase.h" +#include "Database.h" #include class dZoneManager; @@ -20,6 +23,7 @@ public: ~dServerMock() {}; RakNet::BitStream* GetMostRecentBitStream() { return sentBitStream; }; void Send(RakNet::BitStream& bitStream, const SystemAddress& sysAddr, bool broadcast) override { sentBitStream = &bitStream; }; + void SetZoneId(unsigned int zoneId) { mZoneID = zoneId; } }; class GameDependenciesTest : public ::testing::Test { @@ -34,6 +38,9 @@ protected: Game::server = new dServerMock(); Game::config = new dConfig("worldconfig.ini"); Game::entityManager = new EntityManager(); + Game::zoneManager = new dZoneManager(); + Game::zoneManager->LoadZone(LWOZONEID(1, 0, 0)); + Database::_setDatabase(new TestSQLDatabase()); // this new is managed by the Database // Create a CDClientManager instance and load from defaults CDClientManager::LoadValuesFromDefaults(); @@ -42,6 +49,7 @@ protected: void TearDownDependencies() { if (Game::server) delete Game::server; if (Game::entityManager) delete Game::entityManager; + if (Game::zoneManager) delete Game::zoneManager; if (Game::logger) { Game::logger->Flush(); delete Game::logger; diff --git a/tests/dGameTests/dComponentsTests/CMakeLists.txt b/tests/dGameTests/dComponentsTests/CMakeLists.txt index 374095af..f73f1214 100644 --- a/tests/dGameTests/dComponentsTests/CMakeLists.txt +++ b/tests/dGameTests/dComponentsTests/CMakeLists.txt @@ -2,6 +2,7 @@ set(DCOMPONENTS_TESTS "DestroyableComponentTests.cpp" "PetComponentTests.cpp" "SimplePhysicsComponentTests.cpp" + "SavingTests.cpp" ) # Get the folder name and prepend it to the files above @@ -10,3 +11,8 @@ list(TRANSFORM DCOMPONENTS_TESTS PREPEND "${thisFolderName}/") # Export to parent scope set(DCOMPONENTS_TESTS ${DCOMPONENTS_TESTS} PARENT_SCOPE) + +# Copy test files to testing directory +add_subdirectory(TestData) +list(TRANSFORM COMPONENT_TEST_DATA PREPEND "${thisFolderName}/") +set(COMPONENT_TEST_DATA ${COMPONENT_TEST_DATA} PARENT_SCOPE) diff --git a/tests/dGameTests/dComponentsTests/SavingTests.cpp b/tests/dGameTests/dComponentsTests/SavingTests.cpp new file mode 100644 index 00000000..7123b698 --- /dev/null +++ b/tests/dGameTests/dComponentsTests/SavingTests.cpp @@ -0,0 +1,103 @@ +#include "GameDependencies.h" +#include "Character.h" +#include "Entity.h" +#include "tinyxml2.h" +#include "BuffComponent.h" +#include "CharacterComponent.h" + +class SavingTest : public GameDependenciesTest { +protected: + std::unique_ptr entity; + std::unique_ptr character; + tinyxml2::XMLDocument doc; + tinyxml2::XMLPrinter printer{ 0, true, 0 }; + + void SetUp() override { + SetUpDependencies(); + Game::zoneManager->LoadZone(LWOZONEID(1800, 2, 0)); + static_cast(Game::server)->SetZoneId(1800); + + entity = std::make_unique(1, GameDependenciesTest::info); + character = std::make_unique(1, nullptr); + + doc.LoadFile("./test_xml_data.xml"); + + entity->SetCharacter(character.get()); + character->SetEntity(entity.get()); + + doc.Print(&printer); + character->_setXmlData(printer.CStr()); + printer.ClearBuffer(); + + character->_doQuickXMLDataParse(); + character->LoadXmlRespawnCheckpoints(); + + entity->AddComponent(character.get(), UNASSIGNED_SYSTEM_ADDRESS)->LoadFromXml(entity->GetCharacter()->GetXMLDoc()); + } + + void TearDown() override { + entity->SetCharacter(nullptr); + + entity.reset(); + character.reset(); + + TearDownDependencies(); + } +}; + +TEST_F(SavingTest, CharacterComponentTest) { + // Print the original XML data + // character->GetXMLDoc().Print(&printer); + // std::string xmlDataOriginal(printer.CStr()); + // printer.ClearBuffer(); + // std::ofstream oldXml("./test_xml_data_original.xml"); + // oldXml << xmlDataOriginal; + + auto* characterComponent = entity->GetComponent(); + + // Update the xml document so its been run through the saver + character->SaveXMLToDatabase(); + + // Reload the component and character from the now updated xml data + const auto prevTotalTime = characterComponent->GetTotalTimePlayed(); + character->_doQuickXMLDataParse(); + entity->AddComponent(character.get(), UNASSIGNED_SYSTEM_ADDRESS); + characterComponent->LoadFromXml(entity->GetCharacter()->GetXMLDoc()); + + // Check that the buff component is the same as before which means resaving data and loading it back in didn't change anything + ASSERT_EQ("32114;69;343;13;163;2;181;2;388;252;146;24451;25;9022;41898;42186;42524;4404;0;0;0;0;0;0;0;0;0;", characterComponent->StatisticsToString()); + + // need a variable because the macros do not support {} + constexpr std::array correctCodes = { 1073741968, 0, 0, 0 }; + ASSERT_EQ(correctCodes, characterComponent->GetClaimCodes()); + ASSERT_EQ(1, characterComponent->m_Character->GetEyebrows()); + ASSERT_EQ(2, characterComponent->m_Character->GetEyes()); + ASSERT_EQ(9, characterComponent->m_Character->GetHairColor()); + ASSERT_EQ(8, characterComponent->m_Character->GetHairStyle()); + ASSERT_EQ(3, characterComponent->m_Character->GetPantsColor()); + ASSERT_EQ(27634704, characterComponent->m_Character->GetLeftHand()); + ASSERT_EQ(3, characterComponent->m_Character->GetMouth()); + ASSERT_EQ(27187396, characterComponent->m_Character->GetRightHand()); + ASSERT_EQ(13, characterComponent->m_Character->GetShirtColor()); + ASSERT_EQ(7510, characterComponent->GetUScore()); + ASSERT_EQ(300, characterComponent->GetReputation()); + ASSERT_EQ(u"0:1:4719+1:4720+1:4721", characterComponent->GetLastRocketConfig()); + ASSERT_EQ(prevTotalTime, characterComponent->GetTotalTimePlayed()); + + const std::map correctZoneStats = + { + { 1000, { .m_AchievementsCollected = 0, .m_BricksCollected = 0, .m_CoinsCollected = 4, .m_EnemiesSmashed = 0, .m_QuickBuildsCompleted = 0 } }, + { 1100, { .m_AchievementsCollected = 1, .m_BricksCollected = 54, .m_CoinsCollected = 584, .m_EnemiesSmashed = 34, .m_QuickBuildsCompleted = 0 } }, + { 1101, { .m_AchievementsCollected = 7, .m_BricksCollected = 0, .m_CoinsCollected = 750, .m_EnemiesSmashed = 100, .m_QuickBuildsCompleted = 7 } }, + { 1200, { .m_AchievementsCollected = 51, .m_BricksCollected = 9, .m_CoinsCollected = 26724, .m_EnemiesSmashed = 0, .m_QuickBuildsCompleted = 3 } }, + { 1250, { .m_AchievementsCollected = 1, .m_BricksCollected = 1, .m_CoinsCollected = 158, .m_EnemiesSmashed = 15, .m_QuickBuildsCompleted = 1 } }, + { 1800, { .m_AchievementsCollected = 4, .m_BricksCollected = 5, .m_CoinsCollected = 3894, .m_EnemiesSmashed = 14, .m_QuickBuildsCompleted = 2 } }, + }; + + ASSERT_EQ(correctZoneStats, characterComponent->GetZoneStatistics()); + + // Fails currently due to not reading style from xml + // Should the value be fixed, this test will fail and will match the above + // only then will this comment be removed. + ASSERT_NE(27, characterComponent->m_Character->GetShirtStyle()); +} diff --git a/tests/dGameTests/dComponentsTests/TestData/CMakeLists.txt b/tests/dGameTests/dComponentsTests/TestData/CMakeLists.txt new file mode 100644 index 00000000..31e92542 --- /dev/null +++ b/tests/dGameTests/dComponentsTests/TestData/CMakeLists.txt @@ -0,0 +1,10 @@ +set(COMPONENT_TEST_DATA + "test_xml_data.xml" +) + +# Get the folder name and prepend it to the files above +get_filename_component(thisFolderName ${CMAKE_CURRENT_SOURCE_DIR} NAME) +list(TRANSFORM COMPONENT_TEST_DATA PREPEND "${thisFolderName}/") + +# Export our list of files +set(COMPONENT_TEST_DATA ${COMPONENT_TEST_DATA} PARENT_SCOPE) diff --git a/tests/dGameTests/dComponentsTests/TestData/test_xml_data.xml b/tests/dGameTests/dComponentsTests/TestData/test_xml_data.xml new file mode 100644 index 00000000..431c12c9 --- /dev/null +++ b/tests/dGameTests/dComponentsTests/TestData/test_xml_data.xml @@ -0,0 +1 @@ +

diff --git a/tests/dGameTests/dGameMessagesTests/GameMessageTests.cpp b/tests/dGameTests/dGameMessagesTests/GameMessageTests.cpp index 2d37d102..7c33c6d0 100644 --- a/tests/dGameTests/dGameMessagesTests/GameMessageTests.cpp +++ b/tests/dGameTests/dGameMessagesTests/GameMessageTests.cpp @@ -38,11 +38,11 @@ protected: } return readFile; } - const AMFArrayValue& ReadArrayFromBitStream(RakNet::BitStream& inStream) { + std::unique_ptr ReadArrayFromBitStream(RakNet::BitStream& inStream) { AMFDeserialize des; - AMFBaseValue* readArray = des.Read(inStream); + AMFBaseValue* readArray = des.Read(inStream).release(); EXPECT_EQ(readArray->GetValueType(), eAmf::Array); - return static_cast(*readArray); + return std::unique_ptr{ static_cast(readArray) }; } }; @@ -88,7 +88,10 @@ TEST_F(GameMessageTests, SendBlueprintLoadItemResponse) { TEST_F(GameMessageTests, ControlBehaviorAddStrip) { auto data = ReadFromFile("addStrip"); RakNet::BitStream inStream(reinterpret_cast(&data[0]), data.length(), true); - AddStripMessage addStrip(ReadArrayFromBitStream(inStream)); + + const auto arr = ReadArrayFromBitStream(inStream); + AddStripMessage addStrip(*arr); + ASSERT_FLOAT_EQ(addStrip.GetPosition().GetX(), 50.65); ASSERT_FLOAT_EQ(addStrip.GetPosition().GetY(), 178.05); ASSERT_EQ(addStrip.GetActionContext().GetStripId(), 0); @@ -103,7 +106,10 @@ TEST_F(GameMessageTests, ControlBehaviorAddStrip) { TEST_F(GameMessageTests, ControlBehaviorRemoveStrip) { auto data = ReadFromFile("removeStrip"); RakNet::BitStream inStream(reinterpret_cast(&data[0]), data.length(), true); - RemoveStripMessage removeStrip(ReadArrayFromBitStream(inStream)); + + const auto arr = ReadArrayFromBitStream(inStream); + RemoveStripMessage removeStrip(*arr); + ASSERT_EQ(static_cast(removeStrip.GetActionContext().GetStripId()), 1); ASSERT_EQ(static_cast(removeStrip.GetActionContext().GetStateId()), 0); ASSERT_EQ(removeStrip.GetBehaviorId(), BehaviorMessageBase::DefaultBehaviorId); @@ -112,7 +118,10 @@ TEST_F(GameMessageTests, ControlBehaviorRemoveStrip) { TEST_F(GameMessageTests, ControlBehaviorMergeStrips) { auto data = ReadFromFile("mergeStrips"); RakNet::BitStream inStream(reinterpret_cast(&data[0]), data.length(), true); - MergeStripsMessage mergeStrips(ReadArrayFromBitStream(inStream)); + + const auto arr = ReadArrayFromBitStream(inStream); + MergeStripsMessage mergeStrips(*arr); + ASSERT_EQ(mergeStrips.GetSourceActionContext().GetStripId(), 2); ASSERT_EQ(mergeStrips.GetDestinationActionContext().GetStripId(), 0); ASSERT_EQ(static_cast(mergeStrips.GetSourceActionContext().GetStateId()), 0); @@ -124,9 +133,11 @@ TEST_F(GameMessageTests, ControlBehaviorMergeStrips) { TEST_F(GameMessageTests, ControlBehaviorSplitStrip) { auto data = ReadFromFile("splitStrip"); RakNet::BitStream inStream(reinterpret_cast(&data[0]), data.length(), true); - SplitStripMessage splitStrip(ReadArrayFromBitStream(inStream)); - ASSERT_EQ(splitStrip.GetBehaviorId(), -1); + const auto arr = ReadArrayFromBitStream(inStream); + SplitStripMessage splitStrip(*arr); + + ASSERT_EQ(splitStrip.GetBehaviorId(), -1); ASSERT_FLOAT_EQ(splitStrip.GetPosition().GetX(), 275.65); ASSERT_FLOAT_EQ(splitStrip.GetPosition().GetY(), 28.7); ASSERT_EQ(splitStrip.GetSourceActionContext().GetStripId(), 0); @@ -139,7 +150,10 @@ TEST_F(GameMessageTests, ControlBehaviorSplitStrip) { TEST_F(GameMessageTests, ControlBehaviorUpdateStripUI) { auto data = ReadFromFile("updateStripUI"); RakNet::BitStream inStream(reinterpret_cast(&data[0]), data.length(), true); - UpdateStripUiMessage updateStripUi(ReadArrayFromBitStream(inStream)); + + const auto arr = ReadArrayFromBitStream(inStream); + UpdateStripUiMessage updateStripUi(*arr); + ASSERT_FLOAT_EQ(updateStripUi.GetPosition().GetX(), 116.65); ASSERT_FLOAT_EQ(updateStripUi.GetPosition().GetY(), 35.35); ASSERT_EQ(updateStripUi.GetActionContext().GetStripId(), 0); @@ -150,7 +164,10 @@ TEST_F(GameMessageTests, ControlBehaviorUpdateStripUI) { TEST_F(GameMessageTests, ControlBehaviorAddAction) { auto data = ReadFromFile("addAction"); RakNet::BitStream inStream(reinterpret_cast(&data[0]), data.length(), true); - AddActionMessage addAction(ReadArrayFromBitStream(inStream)); + + const auto arr = ReadArrayFromBitStream(inStream); + AddActionMessage addAction(*arr); + ASSERT_EQ(addAction.GetActionIndex(), 3); ASSERT_EQ(addAction.GetActionContext().GetStripId(), 0); ASSERT_EQ(static_cast(addAction.GetActionContext().GetStateId()), 0); @@ -164,7 +181,10 @@ TEST_F(GameMessageTests, ControlBehaviorAddAction) { TEST_F(GameMessageTests, ControlBehaviorMigrateActions) { auto data = ReadFromFile("migrateActions"); RakNet::BitStream inStream(reinterpret_cast(&data[0]), data.length(), true); - MigrateActionsMessage migrateActions(ReadArrayFromBitStream(inStream)); + + const auto arr = ReadArrayFromBitStream(inStream); + MigrateActionsMessage migrateActions(*arr); + ASSERT_EQ(migrateActions.GetSrcActionIndex(), 1); ASSERT_EQ(migrateActions.GetDstActionIndex(), 2); ASSERT_EQ(migrateActions.GetSourceActionContext().GetStripId(), 1); @@ -177,7 +197,10 @@ TEST_F(GameMessageTests, ControlBehaviorMigrateActions) { TEST_F(GameMessageTests, ControlBehaviorRearrangeStrip) { auto data = ReadFromFile("rearrangeStrip"); RakNet::BitStream inStream(reinterpret_cast(&data[0]), data.length(), true); - RearrangeStripMessage rearrangeStrip(ReadArrayFromBitStream(inStream)); + + const auto arr = ReadArrayFromBitStream(inStream); + RearrangeStripMessage rearrangeStrip(*arr); + ASSERT_EQ(rearrangeStrip.GetSrcActionIndex(), 2); ASSERT_EQ(rearrangeStrip.GetDstActionIndex(), 1); ASSERT_EQ(rearrangeStrip.GetActionContext().GetStripId(), 0); @@ -188,7 +211,10 @@ TEST_F(GameMessageTests, ControlBehaviorRearrangeStrip) { TEST_F(GameMessageTests, ControlBehaviorAdd) { auto data = ReadFromFile("add"); RakNet::BitStream inStream(reinterpret_cast(&data[0]), data.length(), true); - AddMessage add(ReadArrayFromBitStream(inStream)); + + const auto arr = ReadArrayFromBitStream(inStream); + AddMessage add(*arr); + ASSERT_EQ(add.GetBehaviorId(), 10446); ASSERT_EQ(add.GetBehaviorIndex(), 0); } @@ -196,7 +222,10 @@ TEST_F(GameMessageTests, ControlBehaviorAdd) { TEST_F(GameMessageTests, ControlBehaviorRemoveActions) { auto data = ReadFromFile("removeActions"); RakNet::BitStream inStream(reinterpret_cast(&data[0]), data.length(), true); - RemoveActionsMessage removeActions(ReadArrayFromBitStream(inStream)); + + const auto arr = ReadArrayFromBitStream(inStream); + RemoveActionsMessage removeActions(*arr); + ASSERT_EQ(removeActions.GetBehaviorId(), -1); ASSERT_EQ(removeActions.GetActionIndex(), 1); ASSERT_EQ(removeActions.GetActionContext().GetStripId(), 0); @@ -206,7 +235,10 @@ TEST_F(GameMessageTests, ControlBehaviorRemoveActions) { TEST_F(GameMessageTests, ControlBehaviorRename) { auto data = ReadFromFile("rename"); RakNet::BitStream inStream(reinterpret_cast(&data[0]), data.length(), true); - RenameMessage rename(ReadArrayFromBitStream(inStream)); + + const auto arr = ReadArrayFromBitStream(inStream); + RenameMessage rename(*arr); + ASSERT_EQ(rename.GetName(), "test"); ASSERT_EQ(rename.GetBehaviorId(), BehaviorMessageBase::DefaultBehaviorId); } @@ -214,7 +246,10 @@ TEST_F(GameMessageTests, ControlBehaviorRename) { TEST_F(GameMessageTests, ControlBehaviorUpdateAction) { auto data = ReadFromFile("updateAction"); RakNet::BitStream inStream(reinterpret_cast(&data[0]), data.length(), true); - UpdateActionMessage updateAction(ReadArrayFromBitStream(inStream)); + + const auto arr = ReadArrayFromBitStream(inStream); + UpdateActionMessage updateAction(*arr); + ASSERT_EQ(updateAction.GetAction().GetType(), "FlyDown"); ASSERT_EQ(updateAction.GetAction().GetValueParameterName(), "Distance"); ASSERT_EQ(updateAction.GetAction().GetValueParameterString(), ""); diff --git a/tests/dGameTests/dGameMessagesTests/LegacyGameMessageTests.cpp b/tests/dGameTests/dGameMessagesTests/LegacyGameMessageTests.cpp index 47b930ed..a1f4bf85 100644 --- a/tests/dGameTests/dGameMessagesTests/LegacyGameMessageTests.cpp +++ b/tests/dGameTests/dGameMessagesTests/LegacyGameMessageTests.cpp @@ -1,298 +1,298 @@ #include -#include "eGameMessageType.h" +#include "MessageType/Game.h" TEST(LegacyGameMessageTests, AssertLegacyGmValues) { - EXPECT_EQ(eGameMessageType::TELEPORT, static_cast(19)); - EXPECT_EQ(eGameMessageType::SET_PLAYER_CONTROL_SCHEME, static_cast(26)); - EXPECT_EQ(eGameMessageType::DROP_CLIENT_LOOT, static_cast(30)); - EXPECT_EQ(eGameMessageType::DIE, static_cast(37)); - EXPECT_EQ(eGameMessageType::REQUEST_DIE, static_cast(38)); - EXPECT_EQ(eGameMessageType::PLAY_EMOTE, static_cast(41)); - EXPECT_EQ(eGameMessageType::PLAY_ANIMATION, static_cast(43)); - EXPECT_EQ(eGameMessageType::CONTROL_BEHAVIORS, static_cast(48)); - EXPECT_EQ(eGameMessageType::SET_NAME, static_cast(72)); - EXPECT_EQ(eGameMessageType::ECHO_START_SKILL, static_cast(118)); - EXPECT_EQ(eGameMessageType::START_SKILL, static_cast(119)); - EXPECT_EQ(eGameMessageType::VERIFY_ACK, static_cast(121)); - EXPECT_EQ(eGameMessageType::ADD_SKILL, static_cast(127)); - EXPECT_EQ(eGameMessageType::REMOVE_SKILL, static_cast(128)); - EXPECT_EQ(eGameMessageType::SET_CURRENCY, static_cast(133)); - EXPECT_EQ(eGameMessageType::PICKUP_CURRENCY, static_cast(137)); - EXPECT_EQ(eGameMessageType::PICKUP_ITEM, static_cast(139)); - EXPECT_EQ(eGameMessageType::TEAM_PICKUP_ITEM, static_cast(140)); - EXPECT_EQ(eGameMessageType::PLAY_FX_EFFECT, static_cast(154)); - EXPECT_EQ(eGameMessageType::STOP_FX_EFFECT, static_cast(155)); - EXPECT_EQ(eGameMessageType::REQUEST_RESURRECT, static_cast(159)); - EXPECT_EQ(eGameMessageType::RESURRECT, static_cast(160)); - EXPECT_EQ(eGameMessageType::PUSH_EQUIPPED_ITEMS_STATE, static_cast(191)); - EXPECT_EQ(eGameMessageType::POP_EQUIPPED_ITEMS_STATE, static_cast(192)); - EXPECT_EQ(eGameMessageType::SET_GM_LEVEL, static_cast(193)); - EXPECT_EQ(eGameMessageType::SET_STUNNED, static_cast(198)); - EXPECT_EQ(eGameMessageType::SET_STUN_IMMUNITY, static_cast(200)); - EXPECT_EQ(eGameMessageType::KNOCKBACK, static_cast(202)); - EXPECT_EQ(eGameMessageType::REBUILD_CANCEL, static_cast(209)); - EXPECT_EQ(eGameMessageType::ENABLE_REBUILD, static_cast(213)); - EXPECT_EQ(eGameMessageType::MOVE_ITEM_IN_INVENTORY, static_cast(224)); - EXPECT_EQ(eGameMessageType::ADD_ITEM_TO_INVENTORY_CLIENT_SYNC, static_cast(227)); - EXPECT_EQ(eGameMessageType::REMOVE_ITEM_FROM_INVENTORY, static_cast(230)); - EXPECT_EQ(eGameMessageType::EQUIP_INVENTORY, static_cast(231)); - EXPECT_EQ(eGameMessageType::UN_EQUIP_INVENTORY, static_cast(233)); - EXPECT_EQ(eGameMessageType::OFFER_MISSION, static_cast(248)); - EXPECT_EQ(eGameMessageType::RESPOND_TO_MISSION, static_cast(249)); - EXPECT_EQ(eGameMessageType::NOTIFY_MISSION, static_cast(254)); - EXPECT_EQ(eGameMessageType::NOTIFY_MISSION_TASK, static_cast(255)); - EXPECT_EQ(eGameMessageType::REBUILD_NOTIFY_STATE, static_cast(336)); - EXPECT_EQ(eGameMessageType::TERMINATE_INTERACTION, static_cast(357)); - EXPECT_EQ(eGameMessageType::SERVER_TERMINATE_INTERACTION, static_cast(358)); - EXPECT_EQ(eGameMessageType::REQUEST_USE, static_cast(364)); - EXPECT_EQ(eGameMessageType::VENDOR_OPEN_WINDOW, static_cast(369)); - EXPECT_EQ(eGameMessageType::BUY_FROM_VENDOR, static_cast(373)); - EXPECT_EQ(eGameMessageType::SELL_TO_VENDOR, static_cast(374)); - EXPECT_EQ(eGameMessageType::TEAM_SET_OFF_WORLD_FLAG, static_cast(383)); - EXPECT_EQ(eGameMessageType::SET_INVENTORY_SIZE, static_cast(389)); - EXPECT_EQ(eGameMessageType::ACKNOWLEDGE_POSSESSION, static_cast(391)); - EXPECT_EQ(eGameMessageType::SET_SHOOTING_GALLERY_PARAMS, static_cast(400)); - EXPECT_EQ(eGameMessageType::REQUEST_ACTIVITY_START_STOP, static_cast(402)); - EXPECT_EQ(eGameMessageType::REQUEST_ACTIVITY_ENTER, static_cast(403)); - EXPECT_EQ(eGameMessageType::REQUEST_ACTIVITY_EXIT, static_cast(404)); - EXPECT_EQ(eGameMessageType::ACTIVITY_ENTER, static_cast(405)); - EXPECT_EQ(eGameMessageType::ACTIVITY_EXIT, static_cast(406)); - EXPECT_EQ(eGameMessageType::ACTIVITY_START, static_cast(407)); - EXPECT_EQ(eGameMessageType::ACTIVITY_STOP, static_cast(408)); - EXPECT_EQ(eGameMessageType::SHOOTING_GALLERY_CLIENT_AIM_UPDATE, static_cast(409)); - EXPECT_EQ(eGameMessageType::SHOOTING_GALLERY_FIRE, static_cast(411)); - EXPECT_EQ(eGameMessageType::REQUEST_VENDOR_STATUS_UPDATE, static_cast(416)); - EXPECT_EQ(eGameMessageType::VENDOR_STATUS_UPDATE, static_cast(417)); - EXPECT_EQ(eGameMessageType::NOTIFY_CLIENT_SHOOTING_GALLERY_SCORE, static_cast(425)); - EXPECT_EQ(eGameMessageType::CONSUME_CLIENT_ITEM, static_cast(427)); - EXPECT_EQ(eGameMessageType::CLIENT_ITEM_CONSUMED, static_cast(428)); - EXPECT_EQ(eGameMessageType::UPDATE_SHOOTING_GALLERY_ROTATION, static_cast(448)); - EXPECT_EQ(eGameMessageType::SET_FLAG, static_cast(471)); - EXPECT_EQ(eGameMessageType::NOTIFY_CLIENT_FLAG_CHANGE, static_cast(472)); - EXPECT_EQ(eGameMessageType::VENDOR_TRANSACTION_RESULT, static_cast(476)); - EXPECT_EQ(eGameMessageType::HAS_BEEN_COLLECTED, static_cast(486)); - EXPECT_EQ(eGameMessageType::DISPLAY_CHAT_BUBBLE, static_cast(495)); - EXPECT_EQ(eGameMessageType::SPAWN_PET, static_cast(498)); - EXPECT_EQ(eGameMessageType::DESPAWN_PET, static_cast(499)); - EXPECT_EQ(eGameMessageType::PLAYER_LOADED, static_cast(505)); - EXPECT_EQ(eGameMessageType::PLAYER_READY, static_cast(509)); - EXPECT_EQ(eGameMessageType::REQUEST_LINKED_MISSION, static_cast(515)); - EXPECT_EQ(eGameMessageType::INVALID_ZONE_TRANSFER_LIST, static_cast(519)); - EXPECT_EQ(eGameMessageType::MISSION_DIALOGUE_OK, static_cast(520)); - EXPECT_EQ(eGameMessageType::DISPLAY_MESSAGE_BOX, static_cast(529)); - EXPECT_EQ(eGameMessageType::MESSAGE_BOX_RESPOND, static_cast(530)); - EXPECT_EQ(eGameMessageType::CHOICE_BOX_RESPOND, static_cast(531)); - EXPECT_EQ(eGameMessageType::SMASH, static_cast(537)); - EXPECT_EQ(eGameMessageType::UN_SMASH, static_cast(538)); - EXPECT_EQ(eGameMessageType::PLACE_MODEL_RESPONSE, static_cast(547)); - EXPECT_EQ(eGameMessageType::SET_SHOOTING_GALLERY_RETICULE_EFFECT, static_cast(546)); - EXPECT_EQ(eGameMessageType::SET_JET_PACK_MODE, static_cast(561)); - EXPECT_EQ(eGameMessageType::REGISTER_PET_ID, static_cast(565)); - EXPECT_EQ(eGameMessageType::REGISTER_PET_DBID, static_cast(566)); - EXPECT_EQ(eGameMessageType::SHOW_ACTIVITY_COUNTDOWN, static_cast(568)); - EXPECT_EQ(eGameMessageType::START_ACTIVITY_TIME, static_cast(576)); - EXPECT_EQ(eGameMessageType::ACTIVITY_PAUSE, static_cast(602)); - EXPECT_EQ(eGameMessageType::USE_NON_EQUIPMENT_ITEM, static_cast(603)); - EXPECT_EQ(eGameMessageType::USE_ITEM_RESULT, static_cast(607)); - EXPECT_EQ(eGameMessageType::COMMAND_PET, static_cast(640)); - EXPECT_EQ(eGameMessageType::PET_RESPONSE, static_cast(641)); - EXPECT_EQ(eGameMessageType::REQUEST_ACTIVITY_SUMMARY_LEADERBOARD_DATA, static_cast(648)); - EXPECT_EQ(eGameMessageType::SEND_ACTIVITY_SUMMARY_LEADERBOARD_DATA, static_cast(649)); - EXPECT_EQ(eGameMessageType::NOTIFY_OBJECT, static_cast(656)); - EXPECT_EQ(eGameMessageType::CLIENT_NOTIFY_PET, static_cast(659)); - EXPECT_EQ(eGameMessageType::NOTIFY_PET, static_cast(660)); - EXPECT_EQ(eGameMessageType::NOTIFY_PET_TAMING_MINIGAME, static_cast(661)); - EXPECT_EQ(eGameMessageType::START_SERVER_PET_MINIGAME_TIMER, static_cast(662)); - EXPECT_EQ(eGameMessageType::CLIENT_EXIT_TAMING_MINIGAME, static_cast(663)); - EXPECT_EQ(eGameMessageType::PET_NAME_CHANGED, static_cast(686)); - EXPECT_EQ(eGameMessageType::PET_TAMING_MINIGAME_RESULT, static_cast(667)); - EXPECT_EQ(eGameMessageType::PET_TAMING_TRY_BUILD_RESULT, static_cast(668)); - EXPECT_EQ(eGameMessageType::NOTIFY_TAMING_BUILD_SUCCESS, static_cast(673)); - EXPECT_EQ(eGameMessageType::NOTIFY_TAMING_MODEL_LOADED_ON_SERVER, static_cast(674)); - EXPECT_EQ(eGameMessageType::ACTIVATE_BUBBLE_BUFF, static_cast(678)); - EXPECT_EQ(eGameMessageType::DECTIVATE_BUBBLE_BUFF, static_cast(679)); - EXPECT_EQ(eGameMessageType::ADD_PET_TO_PLAYER, static_cast(681)); - EXPECT_EQ(eGameMessageType::REQUEST_SET_PET_NAME, static_cast(683)); - EXPECT_EQ(eGameMessageType::SET_PET_NAME, static_cast(684)); - EXPECT_EQ(eGameMessageType::NOTIFY_TAMING_PUZZLE_SELECTED, static_cast(675)); - EXPECT_EQ(eGameMessageType::SHOW_PET_ACTION_BUTTON, static_cast(692)); - EXPECT_EQ(eGameMessageType::SET_EMOTE_LOCK_STATE, static_cast(693)); - EXPECT_EQ(eGameMessageType::USE_ITEM_REQUIREMENTS_RESPONSE, static_cast(703)); - EXPECT_EQ(eGameMessageType::PLAY_EMBEDDED_EFFECT_ON_ALL_CLIENTS_NEAR_OBJECT, static_cast(713)); - EXPECT_EQ(eGameMessageType::DOWNLOAD_PROPERTY_DATA, static_cast(716)); - EXPECT_EQ(eGameMessageType::QUERY_PROPERTY_DATA, static_cast(717)); - EXPECT_EQ(eGameMessageType::PROPERTY_EDITOR_BEGIN, static_cast(724)); - EXPECT_EQ(eGameMessageType::PROPERTY_EDITOR_END, static_cast(725)); - EXPECT_EQ(eGameMessageType::IS_MINIFIG_IN_A_BUBBLE, static_cast(729)); - EXPECT_EQ(eGameMessageType::START_PATHING, static_cast(733)); - EXPECT_EQ(eGameMessageType::ACTIVATE_BUBBLE_BUFF_FROM_SERVER, static_cast(734)); - EXPECT_EQ(eGameMessageType::DEACTIVATE_BUBBLE_BUFF_FROM_SERVER, static_cast(735)); - EXPECT_EQ(eGameMessageType::NOTIFY_CLIENT_ZONE_OBJECT, static_cast(737)); - EXPECT_EQ(eGameMessageType::UPDATE_REPUTATION, static_cast(746)); - EXPECT_EQ(eGameMessageType::PROPERTY_RENTAL_RESPONSE, static_cast(750)); - EXPECT_EQ(eGameMessageType::REQUEST_PLATFORM_RESYNC, static_cast(760)); - EXPECT_EQ(eGameMessageType::PLATFORM_RESYNC, static_cast(761)); - EXPECT_EQ(eGameMessageType::PLAY_CINEMATIC, static_cast(762)); - EXPECT_EQ(eGameMessageType::END_CINEMATIC, static_cast(763)); - EXPECT_EQ(eGameMessageType::CINEMATIC_UPDATE, static_cast(764)); - EXPECT_EQ(eGameMessageType::TOGGLE_GHOST_REFERENCE_OVERRIDE, static_cast(767)); - EXPECT_EQ(eGameMessageType::SET_GHOST_REFERENCE_POSITION, static_cast(768)); - EXPECT_EQ(eGameMessageType::FIRE_EVENT_SERVER_SIDE, static_cast(770)); - EXPECT_EQ(eGameMessageType::SCRIPT_NETWORK_VAR_UPDATE, static_cast(781)); - EXPECT_EQ(eGameMessageType::UPDATE_MODEL_FROM_CLIENT, static_cast(793)); - EXPECT_EQ(eGameMessageType::DELETE_MODEL_FROM_CLIENT, static_cast(794)); - EXPECT_EQ(eGameMessageType::PLAY_ND_AUDIO_EMITTER, static_cast(821)); - EXPECT_EQ(eGameMessageType::PLAY2_D_AMBIENT_SOUND, static_cast(831)); - EXPECT_EQ(eGameMessageType::ENTER_PROPERTY1, static_cast(840)); - EXPECT_EQ(eGameMessageType::ENTER_PROPERTY2, static_cast(841)); - EXPECT_EQ(eGameMessageType::PROPERTY_ENTRANCE_SYNC, static_cast(842)); - EXPECT_EQ(eGameMessageType::PROPERTY_SELECT_QUERY, static_cast(845)); - EXPECT_EQ(eGameMessageType::PARSE_CHAT_MESSAGE, static_cast(850)); - EXPECT_EQ(eGameMessageType::BROADCAST_TEXT_TO_CHATBOX, static_cast(858)); - EXPECT_EQ(eGameMessageType::OPEN_PROPERTY_MANAGEMENT, static_cast(860)); - EXPECT_EQ(eGameMessageType::OPEN_PROPERTY_VENDOR, static_cast(861)); - EXPECT_EQ(eGameMessageType::UPDATE_PROPERTY_OR_MODEL_FOR_FILTER_CHECK, static_cast(863)); - EXPECT_EQ(eGameMessageType::CLIENT_TRADE_REQUEST, static_cast(868)); - EXPECT_EQ(eGameMessageType::SERVER_TRADE_REQUEST, static_cast(869)); - EXPECT_EQ(eGameMessageType::SERVER_TRADE_INVITE, static_cast(870)); - EXPECT_EQ(eGameMessageType::CLIENT_TRADE_REPLY, static_cast(871)); - EXPECT_EQ(eGameMessageType::SERVER_TRADE_REPLY, static_cast(872)); - EXPECT_EQ(eGameMessageType::SERVER_TRADE_INITIAL_REPLY, static_cast(873)); - EXPECT_EQ(eGameMessageType::SERVER_TRADE_FINAL_REPLY, static_cast(874)); - EXPECT_EQ(eGameMessageType::CLIENT_TRADE_UPDATE, static_cast(875)); - EXPECT_EQ(eGameMessageType::SERVER_SIDE_TRADE_UPDATE, static_cast(876)); - EXPECT_EQ(eGameMessageType::SERVER_TRADE_UPDATE, static_cast(877)); - EXPECT_EQ(eGameMessageType::CLIENT_TRADE_CANCEL, static_cast(878)); - EXPECT_EQ(eGameMessageType::CLIENT_SIDE_TRADE_CANCEL, static_cast(879)); - EXPECT_EQ(eGameMessageType::CLIENT_TRADE_ACCEPT, static_cast(880)); - EXPECT_EQ(eGameMessageType::SERVER_SIDE_TRADE_ACCEPT, static_cast(881)); - EXPECT_EQ(eGameMessageType::SERVER_SIDE_TRADE_CANCEL, static_cast(882)); - EXPECT_EQ(eGameMessageType::SERVER_TRADE_CANCEL, static_cast(883)); - EXPECT_EQ(eGameMessageType::SERVER_TRADE_ACCEPT, static_cast(884)); - EXPECT_EQ(eGameMessageType::READY_FOR_UPDATES, static_cast(888)); - EXPECT_EQ(eGameMessageType::ORIENT_TO_OBJECT, static_cast(905)); - EXPECT_EQ(eGameMessageType::ORIENT_TO_POSITION, static_cast(906)); - EXPECT_EQ(eGameMessageType::ORIENT_TO_ANGLE, static_cast(907)); - EXPECT_EQ(eGameMessageType::BOUNCER_ACTIVE_STATUS, static_cast(942)); - EXPECT_EQ(eGameMessageType::UN_USE_BBB_MODEL, static_cast(999)); - EXPECT_EQ(eGameMessageType::BBB_LOAD_ITEM_REQUEST, static_cast(1000)); - EXPECT_EQ(eGameMessageType::BBB_SAVE_REQUEST, static_cast(1001)); - EXPECT_EQ(eGameMessageType::BBB_SAVE_RESPONSE, static_cast(1005)); - EXPECT_EQ(eGameMessageType::NOTIFY_CLIENT_OBJECT, static_cast(1042)); - EXPECT_EQ(eGameMessageType::DISPLAY_ZONE_SUMMARY, static_cast(1043)); - EXPECT_EQ(eGameMessageType::ZONE_SUMMARY_DISMISSED, static_cast(1044)); - EXPECT_EQ(eGameMessageType::ACTIVITY_STATE_CHANGE_REQUEST, static_cast(1053)); - EXPECT_EQ(eGameMessageType::MODIFY_PLAYER_ZONE_STATISTIC, static_cast(1046)); - EXPECT_EQ(eGameMessageType::START_BUILDING_WITH_ITEM, static_cast(1057)); - EXPECT_EQ(eGameMessageType::START_ARRANGING_WITH_ITEM, static_cast(1061)); - EXPECT_EQ(eGameMessageType::FINISH_ARRANGING_WITH_ITEM, static_cast(1062)); - EXPECT_EQ(eGameMessageType::DONE_ARRANGING_WITH_ITEM, static_cast(1063)); - EXPECT_EQ(eGameMessageType::SET_BUILD_MODE, static_cast(1068)); - EXPECT_EQ(eGameMessageType::BUILD_MODE_SET, static_cast(1069)); - EXPECT_EQ(eGameMessageType::SET_BUILD_MODE_CONFIRMED, static_cast(1073)); - EXPECT_EQ(eGameMessageType::NOTIFY_CLIENT_FAILED_PRECONDITION, static_cast(1081)); - EXPECT_EQ(eGameMessageType::MOVE_ITEM_BETWEEN_INVENTORY_TYPES, static_cast(1093)); - EXPECT_EQ(eGameMessageType::MODULAR_BUILD_BEGIN, static_cast(1094)); - EXPECT_EQ(eGameMessageType::MODULAR_BUILD_END, static_cast(1095)); - EXPECT_EQ(eGameMessageType::MODULAR_BUILD_MOVE_AND_EQUIP, static_cast(1096)); - EXPECT_EQ(eGameMessageType::MODULAR_BUILD_FINISH, static_cast(1097)); - EXPECT_EQ(eGameMessageType::REPORT_BUG, static_cast(1198)); - EXPECT_EQ(eGameMessageType::MISSION_DIALOGUE_CANCELLED, static_cast(1129)); - EXPECT_EQ(eGameMessageType::ECHO_SYNC_SKILL, static_cast(1144)); - EXPECT_EQ(eGameMessageType::SYNC_SKILL, static_cast(1145)); - EXPECT_EQ(eGameMessageType::REQUEST_SERVER_PROJECTILE_IMPACT, static_cast(1148)); - EXPECT_EQ(eGameMessageType::DO_CLIENT_PROJECTILE_IMPACT, static_cast(1151)); - EXPECT_EQ(eGameMessageType::MODULAR_BUILD_CONVERT_MODEL, static_cast(1155)); - EXPECT_EQ(eGameMessageType::SET_PLAYER_ALLOWED_RESPAWN, static_cast(1165)); - EXPECT_EQ(eGameMessageType::UI_MESSAGE_SERVER_TO_SINGLE_CLIENT, static_cast(1184)); - EXPECT_EQ(eGameMessageType::UI_MESSAGE_SERVER_TO_ALL_CLIENTS, static_cast(1185)); - EXPECT_EQ(eGameMessageType::PET_TAMING_TRY_BUILD, static_cast(1197)); - EXPECT_EQ(eGameMessageType::REQUEST_SMASH_PLAYER, static_cast(1202)); - EXPECT_EQ(eGameMessageType::FIRE_EVENT_CLIENT_SIDE, static_cast(1213)); - EXPECT_EQ(eGameMessageType::TOGGLE_GM_INVIS, static_cast(1218)); - EXPECT_EQ(eGameMessageType::CHANGE_OBJECT_WORLD_STATE, static_cast(1223)); - EXPECT_EQ(eGameMessageType::VEHICLE_LOCK_INPUT, static_cast(1230)); - EXPECT_EQ(eGameMessageType::VEHICLE_UNLOCK_INPUT, static_cast(1231)); - EXPECT_EQ(eGameMessageType::RACING_RESET_PLAYER_TO_LAST_RESET, static_cast(1252)); - EXPECT_EQ(eGameMessageType::RACING_SERVER_SET_PLAYER_LAP_AND_PLANE, static_cast(1253)); - EXPECT_EQ(eGameMessageType::RACING_SET_PLAYER_RESET_INFO, static_cast(1254)); - EXPECT_EQ(eGameMessageType::RACING_PLAYER_INFO_RESET_FINISHED, static_cast(1255)); - EXPECT_EQ(eGameMessageType::LOCK_NODE_ROTATION, static_cast(1260)); - EXPECT_EQ(eGameMessageType::VEHICLE_SET_WHEEL_LOCK_STATE, static_cast(1273)); - EXPECT_EQ(eGameMessageType::NOTIFY_VEHICLE_OF_RACING_OBJECT, static_cast(1276)); - EXPECT_EQ(eGameMessageType::SET_NAME_BILLBOARD_STATE, static_cast(1284)); - EXPECT_EQ(eGameMessageType::PLAYER_REACHED_RESPAWN_CHECKPOINT, static_cast(1296)); - EXPECT_EQ(eGameMessageType::HANDLE_UGC_POST_DELETE_BASED_ON_EDIT_MODE, static_cast(1300)); - EXPECT_EQ(eGameMessageType::HANDLE_UGC_POST_CREATE_BASED_ON_EDIT_MODE, static_cast(1301)); - EXPECT_EQ(eGameMessageType::PROPERTY_CONTENTS_FROM_CLIENT, static_cast(1305)); - EXPECT_EQ(eGameMessageType::GET_MODELS_ON_PROPERTY, static_cast(1306)); - EXPECT_EQ(eGameMessageType::MATCH_REQUEST, static_cast(1308)); - EXPECT_EQ(eGameMessageType::MATCH_RESPONSE, static_cast(1309)); - EXPECT_EQ(eGameMessageType::MATCH_UPDATE, static_cast(1310)); - EXPECT_EQ(eGameMessageType::MODULE_ASSEMBLY_DB_DATA_FOR_CLIENT, static_cast(1131)); - EXPECT_EQ(eGameMessageType::MODULE_ASSEMBLY_QUERY_DATA, static_cast(1132)); - EXPECT_EQ(eGameMessageType::SHOW_BILLBOARD_INTERACT_ICON, static_cast(1337)); - EXPECT_EQ(eGameMessageType::CHANGE_IDLE_FLAGS, static_cast(1338)); - EXPECT_EQ(eGameMessageType::VEHICLE_ADD_PASSIVE_BOOST_ACTION, static_cast(1340)); - EXPECT_EQ(eGameMessageType::VEHICLE_REMOVE_PASSIVE_BOOST_ACTION, static_cast(1341)); - EXPECT_EQ(eGameMessageType::NOTIFY_SERVER_VEHICLE_ADD_PASSIVE_BOOST_ACTION, static_cast(1342)); - EXPECT_EQ(eGameMessageType::NOTIFY_SERVER_VEHICLE_REMOVE_PASSIVE_BOOST_ACTION, static_cast(1343)); - EXPECT_EQ(eGameMessageType::VEHICLE_ADD_SLOWDOWN_ACTION, static_cast(1344)); - EXPECT_EQ(eGameMessageType::VEHICLE_REMOVE_SLOWDOWN_ACTION, static_cast(1345)); - EXPECT_EQ(eGameMessageType::NOTIFY_SERVER_VEHICLE_ADD_SLOWDOWN_ACTION, static_cast(1346)); - EXPECT_EQ(eGameMessageType::NOTIFY_SERVER_VEHICLE_REMOVE_SLOWDOWN_ACTION, static_cast(1347)); - EXPECT_EQ(eGameMessageType::BUYBACK_FROM_VENDOR, static_cast(1350)); - EXPECT_EQ(eGameMessageType::SET_PROPERTY_ACCESS, static_cast(1366)); - EXPECT_EQ(eGameMessageType::ZONE_PROPERTY_MODEL_PLACED, static_cast(1369)); - EXPECT_EQ(eGameMessageType::ZONE_PROPERTY_MODEL_ROTATED, static_cast(1370)); - EXPECT_EQ(eGameMessageType::ZONE_PROPERTY_MODEL_REMOVED_WHILE_EQUIPPED, static_cast(1371)); - EXPECT_EQ(eGameMessageType::ZONE_PROPERTY_MODEL_EQUIPPED, static_cast(1372)); - EXPECT_EQ(eGameMessageType::ZONE_PROPERTY_MODEL_PICKED_UP, static_cast(1373)); - EXPECT_EQ(eGameMessageType::ZONE_PROPERTY_MODEL_REMOVED, static_cast(1374)); - EXPECT_EQ(eGameMessageType::NOTIFY_RACING_CLIENT, static_cast(1390)); - EXPECT_EQ(eGameMessageType::RACING_PLAYER_HACK_CAR, static_cast(1391)); - EXPECT_EQ(eGameMessageType::RACING_PLAYER_LOADED, static_cast(1392)); - EXPECT_EQ(eGameMessageType::RACING_CLIENT_READY, static_cast(1393)); - EXPECT_EQ(eGameMessageType::UPDATE_CHAT_MODE, static_cast(1395)); - EXPECT_EQ(eGameMessageType::VEHICLE_NOTIFY_FINISHED_RACE, static_cast(1396)); - EXPECT_EQ(eGameMessageType::SET_CONSUMABLE_ITEM, static_cast(1409)); - EXPECT_EQ(eGameMessageType::SET_STATUS_IMMUNITY, static_cast(1435)); - EXPECT_EQ(eGameMessageType::SET_PET_NAME_MODERATED, static_cast(1448)); - EXPECT_EQ(eGameMessageType::MODIFY_LEGO_SCORE, static_cast(1459)); - EXPECT_EQ(eGameMessageType::RESTORE_TO_POST_LOAD_STATS, static_cast(1468)); - EXPECT_EQ(eGameMessageType::SET_RAIL_MOVEMENT, static_cast(1471)); - EXPECT_EQ(eGameMessageType::START_RAIL_MOVEMENT, static_cast(1472)); - EXPECT_EQ(eGameMessageType::CANCEL_RAIL_MOVEMENT, static_cast(1474)); - EXPECT_EQ(eGameMessageType::CLIENT_RAIL_MOVEMENT_READY, static_cast(1476)); - EXPECT_EQ(eGameMessageType::PLAYER_RAIL_ARRIVED_NOTIFICATION, static_cast(1477)); - EXPECT_EQ(eGameMessageType::UPDATE_PLAYER_STATISTIC, static_cast(1481)); - EXPECT_EQ(eGameMessageType::MODULAR_ASSEMBLY_NIF_COMPLETED, static_cast(1498)); - EXPECT_EQ(eGameMessageType::NOTIFY_NOT_ENOUGH_INV_SPACE, static_cast(1516)); - EXPECT_EQ(eGameMessageType::TEAM_SET_LEADER, static_cast(1557)); - EXPECT_EQ(eGameMessageType::TEAM_INVITE_CONFIRM, static_cast(1558)); - EXPECT_EQ(eGameMessageType::TEAM_GET_STATUS_RESPONSE, static_cast(1559)); - EXPECT_EQ(eGameMessageType::TEAM_ADD_PLAYER, static_cast(1562)); - EXPECT_EQ(eGameMessageType::TEAM_REMOVE_PLAYER, static_cast(1563)); - EXPECT_EQ(eGameMessageType::START_CELEBRATION_EFFECT, static_cast(1618)); - EXPECT_EQ(eGameMessageType::ADD_BUFF, static_cast(1647)); - EXPECT_EQ(eGameMessageType::SERVER_DONE_LOADING_ALL_OBJECTS, static_cast(1642)); - EXPECT_EQ(eGameMessageType::PLACE_PROPERTY_MODEL, static_cast(1170)); - EXPECT_EQ(eGameMessageType::VEHICLE_NOTIFY_HIT_IMAGINATION_SERVER, static_cast(1606)); - EXPECT_EQ(eGameMessageType::ADD_RUN_SPEED_MODIFIER, static_cast(1505)); - EXPECT_EQ(eGameMessageType::GET_HOT_PROPERTY_DATA, static_cast(1511)); - EXPECT_EQ(eGameMessageType::SEND_HOT_PROPERTY_DATA, static_cast(1510)); - EXPECT_EQ(eGameMessageType::REMOVE_RUN_SPEED_MODIFIER, static_cast(1506)); - EXPECT_EQ(eGameMessageType::UPDATE_PROPERTY_PERFORMANCE_COST, static_cast(1547)); - EXPECT_EQ(eGameMessageType::PROPERTY_ENTRANCE_BEGIN, static_cast(1553)); - EXPECT_EQ(eGameMessageType::SET_RESURRECT_RESTORE_VALUES, static_cast(1591)); - EXPECT_EQ(eGameMessageType::VEHICLE_STOP_BOOST, static_cast(1617)); - EXPECT_EQ(eGameMessageType::REMOVE_BUFF, static_cast(1648)); - EXPECT_EQ(eGameMessageType::REQUEST_MOVE_ITEM_BETWEEN_INVENTORY_TYPES, static_cast(1666)); - EXPECT_EQ(eGameMessageType::RESPONSE_MOVE_ITEM_BETWEEN_INVENTORY_TYPES, static_cast(1667)); - EXPECT_EQ(eGameMessageType::PLAYER_SET_CAMERA_CYCLING_MODE, static_cast(1676)); - EXPECT_EQ(eGameMessageType::SET_MOUNT_INVENTORY_ID, static_cast(1727)); - EXPECT_EQ(eGameMessageType::NOTIFY_SERVER_LEVEL_PROCESSING_COMPLETE, static_cast(1734)); - EXPECT_EQ(eGameMessageType::NOTIFY_LEVEL_REWARDS, static_cast(1735)); - EXPECT_EQ(eGameMessageType::DISMOUNT_COMPLETE, static_cast(1756)); - EXPECT_EQ(eGameMessageType::MARK_INVENTORY_ITEM_AS_ACTIVE, static_cast(1767)); + EXPECT_EQ(MessageType::Game::TELEPORT, static_cast(19)); + EXPECT_EQ(MessageType::Game::SET_PLAYER_CONTROL_SCHEME, static_cast(26)); + EXPECT_EQ(MessageType::Game::DROP_CLIENT_LOOT, static_cast(30)); + EXPECT_EQ(MessageType::Game::DIE, static_cast(37)); + EXPECT_EQ(MessageType::Game::REQUEST_DIE, static_cast(38)); + EXPECT_EQ(MessageType::Game::PLAY_EMOTE, static_cast(41)); + EXPECT_EQ(MessageType::Game::PLAY_ANIMATION, static_cast(43)); + EXPECT_EQ(MessageType::Game::CONTROL_BEHAVIORS, static_cast(48)); + EXPECT_EQ(MessageType::Game::SET_NAME, static_cast(72)); + EXPECT_EQ(MessageType::Game::ECHO_START_SKILL, static_cast(118)); + EXPECT_EQ(MessageType::Game::START_SKILL, static_cast(119)); + EXPECT_EQ(MessageType::Game::VERIFY_ACK, static_cast(121)); + EXPECT_EQ(MessageType::Game::ADD_SKILL, static_cast(127)); + EXPECT_EQ(MessageType::Game::REMOVE_SKILL, static_cast(128)); + EXPECT_EQ(MessageType::Game::SET_CURRENCY, static_cast(133)); + EXPECT_EQ(MessageType::Game::PICKUP_CURRENCY, static_cast(137)); + EXPECT_EQ(MessageType::Game::PICKUP_ITEM, static_cast(139)); + EXPECT_EQ(MessageType::Game::TEAM_PICKUP_ITEM, static_cast(140)); + EXPECT_EQ(MessageType::Game::PLAY_FX_EFFECT, static_cast(154)); + EXPECT_EQ(MessageType::Game::STOP_FX_EFFECT, static_cast(155)); + EXPECT_EQ(MessageType::Game::REQUEST_RESURRECT, static_cast(159)); + EXPECT_EQ(MessageType::Game::RESURRECT, static_cast(160)); + EXPECT_EQ(MessageType::Game::PUSH_EQUIPPED_ITEMS_STATE, static_cast(191)); + EXPECT_EQ(MessageType::Game::POP_EQUIPPED_ITEMS_STATE, static_cast(192)); + EXPECT_EQ(MessageType::Game::SET_GM_LEVEL, static_cast(193)); + EXPECT_EQ(MessageType::Game::SET_STUNNED, static_cast(198)); + EXPECT_EQ(MessageType::Game::SET_STUN_IMMUNITY, static_cast(200)); + EXPECT_EQ(MessageType::Game::KNOCKBACK, static_cast(202)); + EXPECT_EQ(MessageType::Game::REBUILD_CANCEL, static_cast(209)); + EXPECT_EQ(MessageType::Game::ENABLE_REBUILD, static_cast(213)); + EXPECT_EQ(MessageType::Game::MOVE_ITEM_IN_INVENTORY, static_cast(224)); + EXPECT_EQ(MessageType::Game::ADD_ITEM_TO_INVENTORY_CLIENT_SYNC, static_cast(227)); + EXPECT_EQ(MessageType::Game::REMOVE_ITEM_FROM_INVENTORY, static_cast(230)); + EXPECT_EQ(MessageType::Game::EQUIP_INVENTORY, static_cast(231)); + EXPECT_EQ(MessageType::Game::UN_EQUIP_INVENTORY, static_cast(233)); + EXPECT_EQ(MessageType::Game::OFFER_MISSION, static_cast(248)); + EXPECT_EQ(MessageType::Game::RESPOND_TO_MISSION, static_cast(249)); + EXPECT_EQ(MessageType::Game::NOTIFY_MISSION, static_cast(254)); + EXPECT_EQ(MessageType::Game::NOTIFY_MISSION_TASK, static_cast(255)); + EXPECT_EQ(MessageType::Game::REBUILD_NOTIFY_STATE, static_cast(336)); + EXPECT_EQ(MessageType::Game::TERMINATE_INTERACTION, static_cast(357)); + EXPECT_EQ(MessageType::Game::SERVER_TERMINATE_INTERACTION, static_cast(358)); + EXPECT_EQ(MessageType::Game::REQUEST_USE, static_cast(364)); + EXPECT_EQ(MessageType::Game::VENDOR_OPEN_WINDOW, static_cast(369)); + EXPECT_EQ(MessageType::Game::BUY_FROM_VENDOR, static_cast(373)); + EXPECT_EQ(MessageType::Game::SELL_TO_VENDOR, static_cast(374)); + EXPECT_EQ(MessageType::Game::TEAM_SET_OFF_WORLD_FLAG, static_cast(383)); + EXPECT_EQ(MessageType::Game::SET_INVENTORY_SIZE, static_cast(389)); + EXPECT_EQ(MessageType::Game::ACKNOWLEDGE_POSSESSION, static_cast(391)); + EXPECT_EQ(MessageType::Game::SET_SHOOTING_GALLERY_PARAMS, static_cast(400)); + EXPECT_EQ(MessageType::Game::REQUEST_ACTIVITY_START_STOP, static_cast(402)); + EXPECT_EQ(MessageType::Game::REQUEST_ACTIVITY_ENTER, static_cast(403)); + EXPECT_EQ(MessageType::Game::REQUEST_ACTIVITY_EXIT, static_cast(404)); + EXPECT_EQ(MessageType::Game::ACTIVITY_ENTER, static_cast(405)); + EXPECT_EQ(MessageType::Game::ACTIVITY_EXIT, static_cast(406)); + EXPECT_EQ(MessageType::Game::ACTIVITY_START, static_cast(407)); + EXPECT_EQ(MessageType::Game::ACTIVITY_STOP, static_cast(408)); + EXPECT_EQ(MessageType::Game::SHOOTING_GALLERY_CLIENT_AIM_UPDATE, static_cast(409)); + EXPECT_EQ(MessageType::Game::SHOOTING_GALLERY_FIRE, static_cast(411)); + EXPECT_EQ(MessageType::Game::REQUEST_VENDOR_STATUS_UPDATE, static_cast(416)); + EXPECT_EQ(MessageType::Game::VENDOR_STATUS_UPDATE, static_cast(417)); + EXPECT_EQ(MessageType::Game::NOTIFY_CLIENT_SHOOTING_GALLERY_SCORE, static_cast(425)); + EXPECT_EQ(MessageType::Game::CONSUME_CLIENT_ITEM, static_cast(427)); + EXPECT_EQ(MessageType::Game::CLIENT_ITEM_CONSUMED, static_cast(428)); + EXPECT_EQ(MessageType::Game::UPDATE_SHOOTING_GALLERY_ROTATION, static_cast(448)); + EXPECT_EQ(MessageType::Game::SET_FLAG, static_cast(471)); + EXPECT_EQ(MessageType::Game::NOTIFY_CLIENT_FLAG_CHANGE, static_cast(472)); + EXPECT_EQ(MessageType::Game::VENDOR_TRANSACTION_RESULT, static_cast(476)); + EXPECT_EQ(MessageType::Game::HAS_BEEN_COLLECTED, static_cast(486)); + EXPECT_EQ(MessageType::Game::DISPLAY_CHAT_BUBBLE, static_cast(495)); + EXPECT_EQ(MessageType::Game::SPAWN_PET, static_cast(498)); + EXPECT_EQ(MessageType::Game::DESPAWN_PET, static_cast(499)); + EXPECT_EQ(MessageType::Game::PLAYER_LOADED, static_cast(505)); + EXPECT_EQ(MessageType::Game::PLAYER_READY, static_cast(509)); + EXPECT_EQ(MessageType::Game::REQUEST_LINKED_MISSION, static_cast(515)); + EXPECT_EQ(MessageType::Game::INVALID_ZONE_TRANSFER_LIST, static_cast(519)); + EXPECT_EQ(MessageType::Game::MISSION_DIALOGUE_OK, static_cast(520)); + EXPECT_EQ(MessageType::Game::DISPLAY_MESSAGE_BOX, static_cast(529)); + EXPECT_EQ(MessageType::Game::MESSAGE_BOX_RESPOND, static_cast(530)); + EXPECT_EQ(MessageType::Game::CHOICE_BOX_RESPOND, static_cast(531)); + EXPECT_EQ(MessageType::Game::SMASH, static_cast(537)); + EXPECT_EQ(MessageType::Game::UN_SMASH, static_cast(538)); + EXPECT_EQ(MessageType::Game::PLACE_MODEL_RESPONSE, static_cast(547)); + EXPECT_EQ(MessageType::Game::SET_SHOOTING_GALLERY_RETICULE_EFFECT, static_cast(546)); + EXPECT_EQ(MessageType::Game::SET_JET_PACK_MODE, static_cast(561)); + EXPECT_EQ(MessageType::Game::REGISTER_PET_ID, static_cast(565)); + EXPECT_EQ(MessageType::Game::REGISTER_PET_DBID, static_cast(566)); + EXPECT_EQ(MessageType::Game::SHOW_ACTIVITY_COUNTDOWN, static_cast(568)); + EXPECT_EQ(MessageType::Game::START_ACTIVITY_TIME, static_cast(576)); + EXPECT_EQ(MessageType::Game::ACTIVITY_PAUSE, static_cast(602)); + EXPECT_EQ(MessageType::Game::USE_NON_EQUIPMENT_ITEM, static_cast(603)); + EXPECT_EQ(MessageType::Game::USE_ITEM_RESULT, static_cast(607)); + EXPECT_EQ(MessageType::Game::COMMAND_PET, static_cast(640)); + EXPECT_EQ(MessageType::Game::PET_RESPONSE, static_cast(641)); + EXPECT_EQ(MessageType::Game::REQUEST_ACTIVITY_SUMMARY_LEADERBOARD_DATA, static_cast(648)); + EXPECT_EQ(MessageType::Game::SEND_ACTIVITY_SUMMARY_LEADERBOARD_DATA, static_cast(649)); + EXPECT_EQ(MessageType::Game::NOTIFY_OBJECT, static_cast(656)); + EXPECT_EQ(MessageType::Game::CLIENT_NOTIFY_PET, static_cast(659)); + EXPECT_EQ(MessageType::Game::NOTIFY_PET, static_cast(660)); + EXPECT_EQ(MessageType::Game::NOTIFY_PET_TAMING_MINIGAME, static_cast(661)); + EXPECT_EQ(MessageType::Game::START_SERVER_PET_MINIGAME_TIMER, static_cast(662)); + EXPECT_EQ(MessageType::Game::CLIENT_EXIT_TAMING_MINIGAME, static_cast(663)); + EXPECT_EQ(MessageType::Game::PET_NAME_CHANGED, static_cast(686)); + EXPECT_EQ(MessageType::Game::PET_TAMING_MINIGAME_RESULT, static_cast(667)); + EXPECT_EQ(MessageType::Game::PET_TAMING_TRY_BUILD_RESULT, static_cast(668)); + EXPECT_EQ(MessageType::Game::NOTIFY_TAMING_BUILD_SUCCESS, static_cast(673)); + EXPECT_EQ(MessageType::Game::NOTIFY_TAMING_MODEL_LOADED_ON_SERVER, static_cast(674)); + EXPECT_EQ(MessageType::Game::ACTIVATE_BUBBLE_BUFF, static_cast(678)); + EXPECT_EQ(MessageType::Game::DECTIVATE_BUBBLE_BUFF, static_cast(679)); + EXPECT_EQ(MessageType::Game::ADD_PET_TO_PLAYER, static_cast(681)); + EXPECT_EQ(MessageType::Game::REQUEST_SET_PET_NAME, static_cast(683)); + EXPECT_EQ(MessageType::Game::SET_PET_NAME, static_cast(684)); + EXPECT_EQ(MessageType::Game::NOTIFY_TAMING_PUZZLE_SELECTED, static_cast(675)); + EXPECT_EQ(MessageType::Game::SHOW_PET_ACTION_BUTTON, static_cast(692)); + EXPECT_EQ(MessageType::Game::SET_EMOTE_LOCK_STATE, static_cast(693)); + EXPECT_EQ(MessageType::Game::USE_ITEM_REQUIREMENTS_RESPONSE, static_cast(703)); + EXPECT_EQ(MessageType::Game::PLAY_EMBEDDED_EFFECT_ON_ALL_CLIENTS_NEAR_OBJECT, static_cast(713)); + EXPECT_EQ(MessageType::Game::DOWNLOAD_PROPERTY_DATA, static_cast(716)); + EXPECT_EQ(MessageType::Game::QUERY_PROPERTY_DATA, static_cast(717)); + EXPECT_EQ(MessageType::Game::PROPERTY_EDITOR_BEGIN, static_cast(724)); + EXPECT_EQ(MessageType::Game::PROPERTY_EDITOR_END, static_cast(725)); + EXPECT_EQ(MessageType::Game::IS_MINIFIG_IN_A_BUBBLE, static_cast(729)); + EXPECT_EQ(MessageType::Game::START_PATHING, static_cast(733)); + EXPECT_EQ(MessageType::Game::ACTIVATE_BUBBLE_BUFF_FROM_SERVER, static_cast(734)); + EXPECT_EQ(MessageType::Game::DEACTIVATE_BUBBLE_BUFF_FROM_SERVER, static_cast(735)); + EXPECT_EQ(MessageType::Game::NOTIFY_CLIENT_ZONE_OBJECT, static_cast(737)); + EXPECT_EQ(MessageType::Game::UPDATE_REPUTATION, static_cast(746)); + EXPECT_EQ(MessageType::Game::PROPERTY_RENTAL_RESPONSE, static_cast(750)); + EXPECT_EQ(MessageType::Game::REQUEST_PLATFORM_RESYNC, static_cast(760)); + EXPECT_EQ(MessageType::Game::PLATFORM_RESYNC, static_cast(761)); + EXPECT_EQ(MessageType::Game::PLAY_CINEMATIC, static_cast(762)); + EXPECT_EQ(MessageType::Game::END_CINEMATIC, static_cast(763)); + EXPECT_EQ(MessageType::Game::CINEMATIC_UPDATE, static_cast(764)); + EXPECT_EQ(MessageType::Game::TOGGLE_GHOST_REFERENCE_OVERRIDE, static_cast(767)); + EXPECT_EQ(MessageType::Game::SET_GHOST_REFERENCE_POSITION, static_cast(768)); + EXPECT_EQ(MessageType::Game::FIRE_EVENT_SERVER_SIDE, static_cast(770)); + EXPECT_EQ(MessageType::Game::SCRIPT_NETWORK_VAR_UPDATE, static_cast(781)); + EXPECT_EQ(MessageType::Game::UPDATE_MODEL_FROM_CLIENT, static_cast(793)); + EXPECT_EQ(MessageType::Game::DELETE_MODEL_FROM_CLIENT, static_cast(794)); + EXPECT_EQ(MessageType::Game::PLAY_ND_AUDIO_EMITTER, static_cast(821)); + EXPECT_EQ(MessageType::Game::PLAY2_D_AMBIENT_SOUND, static_cast(831)); + EXPECT_EQ(MessageType::Game::ENTER_PROPERTY1, static_cast(840)); + EXPECT_EQ(MessageType::Game::ENTER_PROPERTY2, static_cast(841)); + EXPECT_EQ(MessageType::Game::PROPERTY_ENTRANCE_SYNC, static_cast(842)); + EXPECT_EQ(MessageType::Game::PROPERTY_SELECT_QUERY, static_cast(845)); + EXPECT_EQ(MessageType::Game::PARSE_CHAT_MESSAGE, static_cast(850)); + EXPECT_EQ(MessageType::Game::BROADCAST_TEXT_TO_CHATBOX, static_cast(858)); + EXPECT_EQ(MessageType::Game::OPEN_PROPERTY_MANAGEMENT, static_cast(860)); + EXPECT_EQ(MessageType::Game::OPEN_PROPERTY_VENDOR, static_cast(861)); + EXPECT_EQ(MessageType::Game::UPDATE_PROPERTY_OR_MODEL_FOR_FILTER_CHECK, static_cast(863)); + EXPECT_EQ(MessageType::Game::CLIENT_TRADE_REQUEST, static_cast(868)); + EXPECT_EQ(MessageType::Game::SERVER_TRADE_REQUEST, static_cast(869)); + EXPECT_EQ(MessageType::Game::SERVER_TRADE_INVITE, static_cast(870)); + EXPECT_EQ(MessageType::Game::CLIENT_TRADE_REPLY, static_cast(871)); + EXPECT_EQ(MessageType::Game::SERVER_TRADE_REPLY, static_cast(872)); + EXPECT_EQ(MessageType::Game::SERVER_TRADE_INITIAL_REPLY, static_cast(873)); + EXPECT_EQ(MessageType::Game::SERVER_TRADE_FINAL_REPLY, static_cast(874)); + EXPECT_EQ(MessageType::Game::CLIENT_TRADE_UPDATE, static_cast(875)); + EXPECT_EQ(MessageType::Game::SERVER_SIDE_TRADE_UPDATE, static_cast(876)); + EXPECT_EQ(MessageType::Game::SERVER_TRADE_UPDATE, static_cast(877)); + EXPECT_EQ(MessageType::Game::CLIENT_TRADE_CANCEL, static_cast(878)); + EXPECT_EQ(MessageType::Game::CLIENT_SIDE_TRADE_CANCEL, static_cast(879)); + EXPECT_EQ(MessageType::Game::CLIENT_TRADE_ACCEPT, static_cast(880)); + EXPECT_EQ(MessageType::Game::SERVER_SIDE_TRADE_ACCEPT, static_cast(881)); + EXPECT_EQ(MessageType::Game::SERVER_SIDE_TRADE_CANCEL, static_cast(882)); + EXPECT_EQ(MessageType::Game::SERVER_TRADE_CANCEL, static_cast(883)); + EXPECT_EQ(MessageType::Game::SERVER_TRADE_ACCEPT, static_cast(884)); + EXPECT_EQ(MessageType::Game::READY_FOR_UPDATES, static_cast(888)); + EXPECT_EQ(MessageType::Game::ORIENT_TO_OBJECT, static_cast(905)); + EXPECT_EQ(MessageType::Game::ORIENT_TO_POSITION, static_cast(906)); + EXPECT_EQ(MessageType::Game::ORIENT_TO_ANGLE, static_cast(907)); + EXPECT_EQ(MessageType::Game::BOUNCER_ACTIVE_STATUS, static_cast(942)); + EXPECT_EQ(MessageType::Game::UN_USE_BBB_MODEL, static_cast(999)); + EXPECT_EQ(MessageType::Game::BBB_LOAD_ITEM_REQUEST, static_cast(1000)); + EXPECT_EQ(MessageType::Game::BBB_SAVE_REQUEST, static_cast(1001)); + EXPECT_EQ(MessageType::Game::BBB_SAVE_RESPONSE, static_cast(1005)); + EXPECT_EQ(MessageType::Game::NOTIFY_CLIENT_OBJECT, static_cast(1042)); + EXPECT_EQ(MessageType::Game::DISPLAY_ZONE_SUMMARY, static_cast(1043)); + EXPECT_EQ(MessageType::Game::ZONE_SUMMARY_DISMISSED, static_cast(1044)); + EXPECT_EQ(MessageType::Game::ACTIVITY_STATE_CHANGE_REQUEST, static_cast(1053)); + EXPECT_EQ(MessageType::Game::MODIFY_PLAYER_ZONE_STATISTIC, static_cast(1046)); + EXPECT_EQ(MessageType::Game::START_BUILDING_WITH_ITEM, static_cast(1057)); + EXPECT_EQ(MessageType::Game::START_ARRANGING_WITH_ITEM, static_cast(1061)); + EXPECT_EQ(MessageType::Game::FINISH_ARRANGING_WITH_ITEM, static_cast(1062)); + EXPECT_EQ(MessageType::Game::DONE_ARRANGING_WITH_ITEM, static_cast(1063)); + EXPECT_EQ(MessageType::Game::SET_BUILD_MODE, static_cast(1068)); + EXPECT_EQ(MessageType::Game::BUILD_MODE_SET, static_cast(1069)); + EXPECT_EQ(MessageType::Game::SET_BUILD_MODE_CONFIRMED, static_cast(1073)); + EXPECT_EQ(MessageType::Game::NOTIFY_CLIENT_FAILED_PRECONDITION, static_cast(1081)); + EXPECT_EQ(MessageType::Game::MOVE_ITEM_BETWEEN_INVENTORY_TYPES, static_cast(1093)); + EXPECT_EQ(MessageType::Game::MODULAR_BUILD_BEGIN, static_cast(1094)); + EXPECT_EQ(MessageType::Game::MODULAR_BUILD_END, static_cast(1095)); + EXPECT_EQ(MessageType::Game::MODULAR_BUILD_MOVE_AND_EQUIP, static_cast(1096)); + EXPECT_EQ(MessageType::Game::MODULAR_BUILD_FINISH, static_cast(1097)); + EXPECT_EQ(MessageType::Game::REPORT_BUG, static_cast(1198)); + EXPECT_EQ(MessageType::Game::MISSION_DIALOGUE_CANCELLED, static_cast(1129)); + EXPECT_EQ(MessageType::Game::ECHO_SYNC_SKILL, static_cast(1144)); + EXPECT_EQ(MessageType::Game::SYNC_SKILL, static_cast(1145)); + EXPECT_EQ(MessageType::Game::REQUEST_SERVER_PROJECTILE_IMPACT, static_cast(1148)); + EXPECT_EQ(MessageType::Game::DO_CLIENT_PROJECTILE_IMPACT, static_cast(1151)); + EXPECT_EQ(MessageType::Game::MODULAR_BUILD_CONVERT_MODEL, static_cast(1155)); + EXPECT_EQ(MessageType::Game::SET_PLAYER_ALLOWED_RESPAWN, static_cast(1165)); + EXPECT_EQ(MessageType::Game::UI_MESSAGE_SERVER_TO_SINGLE_CLIENT, static_cast(1184)); + EXPECT_EQ(MessageType::Game::UI_MESSAGE_SERVER_TO_ALL_CLIENTS, static_cast(1185)); + EXPECT_EQ(MessageType::Game::PET_TAMING_TRY_BUILD, static_cast(1197)); + EXPECT_EQ(MessageType::Game::REQUEST_SMASH_PLAYER, static_cast(1202)); + EXPECT_EQ(MessageType::Game::FIRE_EVENT_CLIENT_SIDE, static_cast(1213)); + EXPECT_EQ(MessageType::Game::TOGGLE_GM_INVIS, static_cast(1218)); + EXPECT_EQ(MessageType::Game::CHANGE_OBJECT_WORLD_STATE, static_cast(1223)); + EXPECT_EQ(MessageType::Game::VEHICLE_LOCK_INPUT, static_cast(1230)); + EXPECT_EQ(MessageType::Game::VEHICLE_UNLOCK_INPUT, static_cast(1231)); + EXPECT_EQ(MessageType::Game::RACING_RESET_PLAYER_TO_LAST_RESET, static_cast(1252)); + EXPECT_EQ(MessageType::Game::RACING_SERVER_SET_PLAYER_LAP_AND_PLANE, static_cast(1253)); + EXPECT_EQ(MessageType::Game::RACING_SET_PLAYER_RESET_INFO, static_cast(1254)); + EXPECT_EQ(MessageType::Game::RACING_PLAYER_INFO_RESET_FINISHED, static_cast(1255)); + EXPECT_EQ(MessageType::Game::LOCK_NODE_ROTATION, static_cast(1260)); + EXPECT_EQ(MessageType::Game::VEHICLE_SET_WHEEL_LOCK_STATE, static_cast(1273)); + EXPECT_EQ(MessageType::Game::NOTIFY_VEHICLE_OF_RACING_OBJECT, static_cast(1276)); + EXPECT_EQ(MessageType::Game::SET_NAME_BILLBOARD_STATE, static_cast(1284)); + EXPECT_EQ(MessageType::Game::PLAYER_REACHED_RESPAWN_CHECKPOINT, static_cast(1296)); + EXPECT_EQ(MessageType::Game::HANDLE_UGC_POST_DELETE_BASED_ON_EDIT_MODE, static_cast(1300)); + EXPECT_EQ(MessageType::Game::HANDLE_UGC_POST_CREATE_BASED_ON_EDIT_MODE, static_cast(1301)); + EXPECT_EQ(MessageType::Game::PROPERTY_CONTENTS_FROM_CLIENT, static_cast(1305)); + EXPECT_EQ(MessageType::Game::GET_MODELS_ON_PROPERTY, static_cast(1306)); + EXPECT_EQ(MessageType::Game::MATCH_REQUEST, static_cast(1308)); + EXPECT_EQ(MessageType::Game::MATCH_RESPONSE, static_cast(1309)); + EXPECT_EQ(MessageType::Game::MATCH_UPDATE, static_cast(1310)); + EXPECT_EQ(MessageType::Game::MODULE_ASSEMBLY_DB_DATA_FOR_CLIENT, static_cast(1131)); + EXPECT_EQ(MessageType::Game::MODULE_ASSEMBLY_QUERY_DATA, static_cast(1132)); + EXPECT_EQ(MessageType::Game::SHOW_BILLBOARD_INTERACT_ICON, static_cast(1337)); + EXPECT_EQ(MessageType::Game::CHANGE_IDLE_FLAGS, static_cast(1338)); + EXPECT_EQ(MessageType::Game::VEHICLE_ADD_PASSIVE_BOOST_ACTION, static_cast(1340)); + EXPECT_EQ(MessageType::Game::VEHICLE_REMOVE_PASSIVE_BOOST_ACTION, static_cast(1341)); + EXPECT_EQ(MessageType::Game::NOTIFY_SERVER_VEHICLE_ADD_PASSIVE_BOOST_ACTION, static_cast(1342)); + EXPECT_EQ(MessageType::Game::NOTIFY_SERVER_VEHICLE_REMOVE_PASSIVE_BOOST_ACTION, static_cast(1343)); + EXPECT_EQ(MessageType::Game::VEHICLE_ADD_SLOWDOWN_ACTION, static_cast(1344)); + EXPECT_EQ(MessageType::Game::VEHICLE_REMOVE_SLOWDOWN_ACTION, static_cast(1345)); + EXPECT_EQ(MessageType::Game::NOTIFY_SERVER_VEHICLE_ADD_SLOWDOWN_ACTION, static_cast(1346)); + EXPECT_EQ(MessageType::Game::NOTIFY_SERVER_VEHICLE_REMOVE_SLOWDOWN_ACTION, static_cast(1347)); + EXPECT_EQ(MessageType::Game::BUYBACK_FROM_VENDOR, static_cast(1350)); + EXPECT_EQ(MessageType::Game::SET_PROPERTY_ACCESS, static_cast(1366)); + EXPECT_EQ(MessageType::Game::ZONE_PROPERTY_MODEL_PLACED, static_cast(1369)); + EXPECT_EQ(MessageType::Game::ZONE_PROPERTY_MODEL_ROTATED, static_cast(1370)); + EXPECT_EQ(MessageType::Game::ZONE_PROPERTY_MODEL_REMOVED_WHILE_EQUIPPED, static_cast(1371)); + EXPECT_EQ(MessageType::Game::ZONE_PROPERTY_MODEL_EQUIPPED, static_cast(1372)); + EXPECT_EQ(MessageType::Game::ZONE_PROPERTY_MODEL_PICKED_UP, static_cast(1373)); + EXPECT_EQ(MessageType::Game::ZONE_PROPERTY_MODEL_REMOVED, static_cast(1374)); + EXPECT_EQ(MessageType::Game::NOTIFY_RACING_CLIENT, static_cast(1390)); + EXPECT_EQ(MessageType::Game::RACING_PLAYER_HACK_CAR, static_cast(1391)); + EXPECT_EQ(MessageType::Game::RACING_PLAYER_LOADED, static_cast(1392)); + EXPECT_EQ(MessageType::Game::RACING_CLIENT_READY, static_cast(1393)); + EXPECT_EQ(MessageType::Game::UPDATE_CHAT_MODE, static_cast(1395)); + EXPECT_EQ(MessageType::Game::VEHICLE_NOTIFY_FINISHED_RACE, static_cast(1396)); + EXPECT_EQ(MessageType::Game::SET_CONSUMABLE_ITEM, static_cast(1409)); + EXPECT_EQ(MessageType::Game::SET_STATUS_IMMUNITY, static_cast(1435)); + EXPECT_EQ(MessageType::Game::SET_PET_NAME_MODERATED, static_cast(1448)); + EXPECT_EQ(MessageType::Game::MODIFY_LEGO_SCORE, static_cast(1459)); + EXPECT_EQ(MessageType::Game::RESTORE_TO_POST_LOAD_STATS, static_cast(1468)); + EXPECT_EQ(MessageType::Game::SET_RAIL_MOVEMENT, static_cast(1471)); + EXPECT_EQ(MessageType::Game::START_RAIL_MOVEMENT, static_cast(1472)); + EXPECT_EQ(MessageType::Game::CANCEL_RAIL_MOVEMENT, static_cast(1474)); + EXPECT_EQ(MessageType::Game::CLIENT_RAIL_MOVEMENT_READY, static_cast(1476)); + EXPECT_EQ(MessageType::Game::PLAYER_RAIL_ARRIVED_NOTIFICATION, static_cast(1477)); + EXPECT_EQ(MessageType::Game::UPDATE_PLAYER_STATISTIC, static_cast(1481)); + EXPECT_EQ(MessageType::Game::MODULAR_ASSEMBLY_NIF_COMPLETED, static_cast(1498)); + EXPECT_EQ(MessageType::Game::NOTIFY_NOT_ENOUGH_INV_SPACE, static_cast(1516)); + EXPECT_EQ(MessageType::Game::TEAM_SET_LEADER, static_cast(1557)); + EXPECT_EQ(MessageType::Game::TEAM_INVITE_CONFIRM, static_cast(1558)); + EXPECT_EQ(MessageType::Game::TEAM_GET_STATUS_RESPONSE, static_cast(1559)); + EXPECT_EQ(MessageType::Game::TEAM_ADD_PLAYER, static_cast(1562)); + EXPECT_EQ(MessageType::Game::TEAM_REMOVE_PLAYER, static_cast(1563)); + EXPECT_EQ(MessageType::Game::START_CELEBRATION_EFFECT, static_cast(1618)); + EXPECT_EQ(MessageType::Game::ADD_BUFF, static_cast(1647)); + EXPECT_EQ(MessageType::Game::SERVER_DONE_LOADING_ALL_OBJECTS, static_cast(1642)); + EXPECT_EQ(MessageType::Game::PLACE_PROPERTY_MODEL, static_cast(1170)); + EXPECT_EQ(MessageType::Game::VEHICLE_NOTIFY_HIT_IMAGINATION_SERVER, static_cast(1606)); + EXPECT_EQ(MessageType::Game::ADD_RUN_SPEED_MODIFIER, static_cast(1505)); + EXPECT_EQ(MessageType::Game::GET_HOT_PROPERTY_DATA, static_cast(1511)); + EXPECT_EQ(MessageType::Game::SEND_HOT_PROPERTY_DATA, static_cast(1510)); + EXPECT_EQ(MessageType::Game::REMOVE_RUN_SPEED_MODIFIER, static_cast(1506)); + EXPECT_EQ(MessageType::Game::UPDATE_PROPERTY_PERFORMANCE_COST, static_cast(1547)); + EXPECT_EQ(MessageType::Game::PROPERTY_ENTRANCE_BEGIN, static_cast(1553)); + EXPECT_EQ(MessageType::Game::SET_RESURRECT_RESTORE_VALUES, static_cast(1591)); + EXPECT_EQ(MessageType::Game::VEHICLE_STOP_BOOST, static_cast(1617)); + EXPECT_EQ(MessageType::Game::REMOVE_BUFF, static_cast(1648)); + EXPECT_EQ(MessageType::Game::REQUEST_MOVE_ITEM_BETWEEN_INVENTORY_TYPES, static_cast(1666)); + EXPECT_EQ(MessageType::Game::RESPONSE_MOVE_ITEM_BETWEEN_INVENTORY_TYPES, static_cast(1667)); + EXPECT_EQ(MessageType::Game::PLAYER_SET_CAMERA_CYCLING_MODE, static_cast(1676)); + EXPECT_EQ(MessageType::Game::SET_MOUNT_INVENTORY_ID, static_cast(1727)); + EXPECT_EQ(MessageType::Game::NOTIFY_SERVER_LEVEL_PROCESSING_COMPLETE, static_cast(1734)); + EXPECT_EQ(MessageType::Game::NOTIFY_LEVEL_REWARDS, static_cast(1735)); + EXPECT_EQ(MessageType::Game::DISMOUNT_COMPLETE, static_cast(1756)); + EXPECT_EQ(MessageType::Game::MARK_INVENTORY_ITEM_AS_ACTIVE, static_cast(1767)); } diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index f6056476..79863a53 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -25,7 +25,7 @@ endif() # Need to define this on Clang and GNU for 'strdup' support if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") - target_compile_definitions(bcrypt PRIVATE "_POSIX_C_SOURCE=200809L") + target_compile_definitions(bcrypt PRIVATE "_POSIX_C_SOURCE=200809L") endif() target_include_directories(bcrypt INTERFACE "libbcrypt/include") diff --git a/thirdparty/SQLite/CMakeLists.txt b/thirdparty/SQLite/CMakeLists.txt index 3aa066a4..e745c46a 100644 --- a/thirdparty/SQLite/CMakeLists.txt +++ b/thirdparty/SQLite/CMakeLists.txt @@ -11,7 +11,7 @@ if(UNIX) # -Wno-unused-result -Wno-unknown-pragmas -fpermissive target_compile_options(sqlite3 PRIVATE) - if(NOT APPLE) + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") target_compile_options(sqlite3 PRIVATE "-Wno-return-local-addr" "-Wno-maybe-uninitialized") else() target_compile_options(sqlite3 PRIVATE "-Wno-return-stack-address" "-Wno-uninitialized" "-Wno-deprecated-declarations")