diff --git a/.drone.yml b/.drone.yml
deleted file mode 100644
index 749ab62c5..000000000
--- a/.drone.yml
+++ /dev/null
@@ -1,16 +0,0 @@
----
-kind: pipeline
-type: docker
-name: EQEmulator Server Linux CI
-
-# Limits how many of these builds can run on the drone runner at a time, this isn't about cores
-concurrency:
- limit: 1
-
-steps:
- - name: server-build
- # Source build script https://github.com/Akkadius/akk-stack/blob/master/containers/eqemu-server/Dockerfile#L20
- image: akkadius/eqemu-server:latest
- commands:
- - sudo chown eqemu:eqemu /drone/src/ * -R
- - git submodule init && git submodule update && mkdir -p build && cd build && cmake -DEQEMU_BUILD_LOGIN=ON -DEQEMU_BUILD_BOTS=ON -DEQEMU_BUILD_LUA=ON -G 'Unix Makefiles' .. && make -j$((`nproc`-4))
\ No newline at end of file
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index a955aa60c..1c6e5c871 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -6,7 +6,7 @@
{
"label": "make",
"type": "shell",
- "command": "cd bin && make",
+ "command": "cd build && make",
"group": {
"kind": "build",
"isDefault": true
@@ -18,7 +18,7 @@
{
"label": "make clean",
"type": "shell",
- "command": "cd bin && make clean",
+ "command": "cd build && make clean",
"group": {
"kind": "build",
"isDefault": true
@@ -30,7 +30,7 @@
{
"label": "cmake",
"type": "shell",
- "command": "mkdir -p bin && cd bin && rm CMakeCache.txt && cmake -DEQEMU_BUILD_LOGIN=ON -DEQEMU_BUILD_LUA=ON -G 'Unix Makefiles' ..",
+ "command": "mkdir -p build && cd build && rm CMakeCache.txt && cmake -DEQEMU_BUILD_LOGIN=ON -DEQEMU_BUILD_LUA=ON -G 'Unix Makefiles' ..",
"group": {
"kind": "build",
"isDefault": true
@@ -52,7 +52,7 @@
{
"label": "download maps",
"type": "shell",
- "command": "mkdir -p bin && cd bin && wget https://codeload.github.com/Akkadius/EQEmuMaps/zip/master -O maps.zip && unzip -o maps.zip && rm ./maps -rf && mv EQEmuMaps-master maps && rm maps.zip",
+ "command": "mkdir -p build/bin && cd build/bin && wget https://codeload.github.com/Akkadius/EQEmuMaps/zip/master -O maps.zip && unzip -o maps.zip && rm ./maps -rf && mv EQEmuMaps-master maps && rm maps.zip",
"group": {
"kind": "build",
"isDefault": true
@@ -64,7 +64,7 @@
{
"label": "download quests",
"type": "shell",
- "command": "mkdir -p bin && cd bin && cd server && git -C ./quests pull 2> /dev/null || git clone https://github.com/ProjectEQ/projecteqquests.git quests",
+ "command": "mkdir -p build/bin && cd build/bin && cd server && git -C ./quests pull 2> /dev/null || git clone https://github.com/ProjectEQ/projecteqquests.git quests",
"group": {
"kind": "build",
"isDefault": true
@@ -76,7 +76,7 @@
{
"label": "download eqemu_config",
"type": "shell",
- "command": "mkdir -p bin && cd bin && wget --no-check-certificate https://raw.githubusercontent.com/Akkadius/EQEmuInstall/master/eqemu_config_docker.json -O eqemu_config.json",
+ "command": "mkdir -p build/bin && cd build/bin && wget --no-check-certificate https://raw.githubusercontent.com/Akkadius/EQEmuInstall/master/eqemu_config_docker.json -O eqemu_config.json",
"group": {
"kind": "build",
"isDefault": true
@@ -88,7 +88,7 @@
{
"label": "rebuild database (mariadb must be started)",
"type": "shell",
- "command": "mkdir -p bin && cd bin && docker run -i --rm --privileged -v ${HOST_PROJECT_PATH}/bin:/src --network=eqemu -it eqemu/server:0.0.3 bash -c './eqemu_server.pl source_peq_db && ./eqemu_server.pl check_db_updates && ./eqemu_server.pl linux_login_server_setup'",
+ "command": "mkdir -p build/bin && cd build/bin && docker run -i --rm --privileged -v ${HOST_PROJECT_PATH}/build/bin:/src --network=eqemu -it eqemu/server:0.0.3 bash -c './eqemu_server.pl source_peq_db && ./eqemu_server.pl check_db_updates && ./eqemu_server.pl linux_login_server_setup'",
"group": {
"kind": "build",
"isDefault": true
@@ -100,7 +100,7 @@
{
"label": "zone 7000",
"type": "shell",
- "command": "docker stop zone7000 | true && docker network create eqemu | true && docker run -i --rm --name zone7000 --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged -v ${HOST_PROJECT_PATH}/bin:/src --ulimit core=10000000 --network=eqemu -p 7000:7000/udp -e LD_LIBRARY_PATH=/src/ eqemu/server:0.0.3 gdb -ex run --args ./zone dynamic_zone7000:7000",
+ "command": "docker stop zone7000 | true && docker network create eqemu | true && docker run -i --rm --name zone7000 --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged -v ${HOST_PROJECT_PATH}/build/bin:/src --ulimit core=10000000 --network=eqemu -p 7000:7000/udp -e LD_LIBRARY_PATH=/src/ eqemu/server:0.0.3 gdb -ex run --args ./zone dynamic_zone7000:7000",
"group": {
"kind": "test",
"isDefault": true
@@ -109,7 +109,7 @@
{
"label": "zone 7001",
"type": "shell",
- "command": "docker stop zone7001 | true && docker network create eqemu | true && docker run -i --rm --name zone7001 --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged -v ${HOST_PROJECT_PATH}/bin:/src --ulimit core=10000000 --network=eqemu -p 7001:7001/udp -e LD_LIBRARY_PATH=/src/ eqemu/server:0.0.3 gdb -ex run --args ./zone dynamic_zone7001:7001",
+ "command": "docker stop zone7001 | true && docker network create eqemu | true && docker run -i --rm --name zone7001 --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged -v ${HOST_PROJECT_PATH}/build/bin:/src --ulimit core=10000000 --network=eqemu -p 7001:7001/udp -e LD_LIBRARY_PATH=/src/ eqemu/server:0.0.3 gdb -ex run --args ./zone dynamic_zone7001:7001",
"group": {
"kind": "test",
"isDefault": true
@@ -118,7 +118,7 @@
{
"label": "loginserver",
"type": "shell",
- "command": "docker stop loginserver | true && docker network create eqemu | true && docker run -i --rm --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged -v ${HOST_PROJECT_PATH}/bin:/src --ulimit core=10000000 --network=eqemu --name loginserver -p 5999:5999/udp -p 5998:5998/udp -e LD_LIBRARY_PATH=/src/ eqemu/server:0.0.3 gdb -ex run --args ./loginserver",
+ "command": "docker stop loginserver | true && docker network create eqemu | true && docker run -i --rm --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged -v ${HOST_PROJECT_PATH}/build/bin:/src --ulimit core=10000000 --network=eqemu --name loginserver -p 5999:5999/udp -p 5998:5998/udp -e LD_LIBRARY_PATH=/src/ eqemu/server:0.0.3 gdb -ex run --args ./loginserver",
"group": {
"kind": "test",
"isDefault": true
@@ -127,7 +127,7 @@
{
"label": "shared_memory, world",
"type": "shell",
- "command": "docker stop sharedmemory | true && docker stop world | true && docker network create eqemu | true && docker run --rm -v ${HOST_PROJECT_PATH}/bin:/src --network=eqemu --name sharedmemory eqemu/server:0.0.3 ./shared_memory && docker run --rm -v ${HOST_PROJECT_PATH}/bin:/src --ulimit core=10000000 -e LD_LIBRARY_PATH=/src/ --network=eqemu --name world -p 9000:9000 -p 9000:9000/udp -p 9001:9001 -p 9080:9080 eqemu/server:0.0.3 gdb -ex run ./world",
+ "command": "docker stop sharedmemory | true && docker stop world | true && docker network create eqemu | true && docker run --rm -v ${HOST_PROJECT_PATH}/build/bin:/src --network=eqemu --name sharedmemory eqemu/server:0.0.3 ./shared_memory && docker run --rm -v ${HOST_PROJECT_PATH}/build/bin:/src --ulimit core=10000000 -e LD_LIBRARY_PATH=/src/ --network=eqemu --name world -p 9000:9000 -p 9000:9000/udp -p 9001:9001 -p 9080:9080 eqemu/server:0.0.3 gdb -ex run ./world",
"group": {
"kind": "test",
"isDefault": true
@@ -136,7 +136,7 @@
{
"label": "queryserv",
"type": "shell",
- "command": "docker stop queryserv | true && docker run --rm -v ${HOST_PROJECT_PATH}/bin:/src --ulimit core=10000000 -e LD_LIBRARY_PATH=/src/ --network=eqemu --name queryserv eqemu/server:0.0.3 gdb -ex run ./queryserv",
+ "command": "docker stop queryserv | true && docker run --rm -v ${HOST_PROJECT_PATH}/build/bin:/src --ulimit core=10000000 -e LD_LIBRARY_PATH=/src/ --network=eqemu --name queryserv eqemu/server:0.0.3 gdb -ex run ./queryserv",
"group": {
"kind": "test",
"isDefault": true
@@ -145,16 +145,7 @@
{
"label": "mariadb",
"type": "shell",
- "command": "docker stop mariadb | true && cd bin && docker network create eqemu | true && docker run --rm -v ${HOST_PROJECT_PATH}/bin/db:/bitnami/mariadb -p 3306:3306 -e MARIADB_DATABASE=peq -e MARIADB_USER=eqemu -e MARIADB_PASSWORD=eqemupass -e ALLOW_EMPTY_PASSWORD=yes --name mariadb --network=eqemu bitnami/mariadb:latest",
- "group": {
- "kind": "test",
- "isDefault": true
- }
- },
- {
- "label": "ucs",
- "type": "shell",
- "command": "docker stop ucs | true && cd bin && docker network create eqemu | true && docker run --rm -v ${HOST_PROJECT_PATH}/bin:/src -p 7778:7778 --name ucs --network=eqemu eqemu/server:0.0.3 gdb -ex run ./ucs",
+ "command": "docker stop mariadb | true && cd build/bin && docker network create eqemu | true && docker run --rm -v ${HOST_PROJECT_PATH}/build/bin/db:/bitnami/mariadb -p 3306:3306 -e MARIADB_DATABASE=peq -e MARIADB_USER=eqemu -e MARIADB_PASSWORD=eqemupass -e ALLOW_EMPTY_PASSWORD=yes --name mariadb --network=eqemu bitnami/mariadb:latest",
"group": {
"kind": "test",
"isDefault": true
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 526d68099..24816a323 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,7 +12,7 @@ IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)
-SET(CMAKE_CXX_STANDARD 14)
+SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
SET(CMAKE_CXX_EXTENSIONS OFF)
@@ -55,7 +55,6 @@ FIND_PACKAGE(MariaDB)
FIND_PACKAGE(ZLIB)
FIND_PACKAGE(OpenSSL)
FIND_PACKAGE(Lua51)
-FIND_PACKAGE(LuaJit)
FIND_PACKAGE(PerlLibs)
FIND_PACKAGE(Sodium)
FIND_PACKAGE(mbedTLS)
@@ -88,12 +87,6 @@ ELSE()
MESSAGE(STATUS "* Lua: MISSING *")
ENDIF()
-IF(LuaJit_FOUND)
- MESSAGE(STATUS "* LuaJIT: FOUND *")
-ELSE()
- MESSAGE(STATUS "* LuaJIT: MISSING *")
-ENDIF()
-
IF(PerlLibs_FOUND)
MESSAGE(STATUS "* Perl: FOUND *")
ELSE()
@@ -129,7 +122,6 @@ OPTION(EQEMU_BUILD_LOGIN "Build the login server." ON)
OPTION(EQEMU_BUILD_HC "Build the headless client." OFF)
OPTION(EQEMU_BUILD_TESTS "Build utility tests." OFF)
OPTION(EQEMU_BUILD_CLIENT_FILES "Build Client Import/Export Data Programs." ON)
-OPTION(EQEMU_PREFER_LUA "Build with normal Lua even if LuaJIT is found." OFF)
IF(EQEMU_COMMANDS_LOGGING)
ADD_DEFINITIONS(-DCOMMANDS_LOGGING)
@@ -220,12 +212,7 @@ ELSE()
SET(SODIUM_LIBRARY_ENABLED OFF)
ENDIF()
-IF(LUAJIT_FOUND AND NOT (EQEMU_PREFER_LUA AND Lua51_FOUND))
- SET(LUA_LIBRARY_TYPE " LuaJIT")
- SET(LUA_LIBRARY_ENABLED ON)
- SET(LUA_LIBRARY_LIBS ${LUAJIT_LIBRARY} luabind)
- SET(LUA_LIBRARY_INCLUDE ${LUAJIT_INCLUDE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/libs/luabind")
-ELSEIF(Lua51_FOUND )
+IF(Lua51_FOUND)
SET(LUA_LIBRARY_TYPE " Lua 5.1")
SET(LUA_LIBRARY_ENABLED ON)
SET(LUA_LIBRARY_LIBS ${LUA_LIBRARY} luabind)
@@ -252,7 +239,6 @@ IF(ZLIB_FOUND)
SET(ZLIB_LIBRARY_TYPE "zlib-ng")
SET(ZLIB_LIBRARY_LIBS "zlibstatic")
SET(ZLIB_LIBRARY_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/libs/zlibng")
- INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_BINARY_DIR}/libs/zlibng")
ELSE()
SET(ZLIB_LIBRARY_TYPE " zlib")
SET(ZLIB_LIBRARY_LIBS ${ZLIB_LIBRARY})
@@ -313,7 +299,7 @@ IF(LUA_LIBRARY_ENABLED)
IF(EQEMU_BUILD_LUA)
ADD_DEFINITIONS(-DLUA_EQEMU)
- SET(ZONE_LIBS ${LUA_LIBRARY_LIBS})
+ SET(SERVER_LIBS ${SERVER_LIBS} ${LUA_LIBRARY_LIBS})
INCLUDE_DIRECTORIES(SYSTEM "${LUA_LIBRARY_INCLUDE}")
OPTION(EQEMU_SANITIZE_LUA_LIBS "Sanitize Lua Libraries (Remove OS and IO standard libraries from being able to run)." ON)
@@ -348,8 +334,6 @@ IF(UNIX)
ENDIF()
ENDIF()
-SET(ZONE_LIBS ${ZONE_LIBS} ${SERVER_LIBS})
-
IF(EQEMU_BUILD_LOGIN AND NOT TLS_LIBRARY_ENABLED)
MESSAGE(FATAL_ERROR "Login server requires a TLS Library to build.")
ENDIF()
diff --git a/README.md b/README.md
index fea2c23a4..e999b7050 100644
--- a/README.md
+++ b/README.md
@@ -80,4 +80,3 @@ forum, although pull requests will be much quicker and easier on all parties.
-
diff --git a/appveyor-bots.yml b/appveyor-bots.yml
index 540d9b3df..9edb00593 100644
--- a/appveyor-bots.yml
+++ b/appveyor-bots.yml
@@ -16,6 +16,6 @@ build:
verbosity: minimal
after_build:
- cmd: >-
- 7z a build_x64-bots.zip C:\projects\eqemu\build\bin\RelWithDebInfo\*.exe C:\projects\eqemu\build\bin\RelWithDebInfo\*.dll C:\projects\eqemu\build\bin\RelWithDebInfo\*.pdb C:\projects\eqemu\build\libs\zlibng\RelWithDebInfo\*.dll
+ 7z a build_x64-bots.zip C:\projects\eqemu\build\bin\RelWithDebInfo\*.exe C:\projects\eqemu\build\bin\RelWithDebInfo\*.dll C:\projects\eqemu\build\bin\RelWithDebInfo\*.pdb
- appveyor PushArtifact build_x64-bots.zip
+ appveyor PushArtifact build_x64-bots.zip
\ No newline at end of file
diff --git a/appveyor-no-bots.yml b/appveyor-no-bots.yml
index 0b0f5b8a2..7aea00332 100644
--- a/appveyor-no-bots.yml
+++ b/appveyor-no-bots.yml
@@ -16,6 +16,6 @@ build:
verbosity: minimal
after_build:
- cmd: >-
- 7z a build_x64-no-bots.zip C:\projects\eqemu\build\bin\RelWithDebInfo\*.exe C:\projects\eqemu\build\bin\RelWithDebInfo\*.dll C:\projects\eqemu\build\bin\RelWithDebInfo\*.pdb C:\projects\eqemu\build\libs\zlibng\RelWithDebInfo\*.dll
+ 7z a build_x64-no-bots.zip C:\projects\eqemu\build\bin\RelWithDebInfo\*.exe C:\projects\eqemu\build\bin\RelWithDebInfo\*.dll C:\projects\eqemu\build\bin\RelWithDebInfo\*.pdb
- appveyor PushArtifact build_x64-no-bots.zip
+ appveyor PushArtifact build_x64-no-bots.zip
\ No newline at end of file
diff --git a/cmake/FindLua51.cmake b/cmake/FindLua51.cmake
index 0aab2bb82..47fa0aaae 100644
--- a/cmake/FindLua51.cmake
+++ b/cmake/FindLua51.cmake
@@ -38,7 +38,7 @@ locations other than lua/
find_path(LUA_INCLUDE_DIR lua.h
HINTS
ENV LUA_DIR
- PATH_SUFFIXES include/lua51 include/lua5.1 include/lua-5.1 include/lua include
+ PATH_SUFFIXES include/lua51 include/lua5.1 include/lua-5.1 include/lua include/luajit include
PATHS
~/Library/Frameworks
/Library/Frameworks
@@ -49,7 +49,7 @@ find_path(LUA_INCLUDE_DIR lua.h
)
find_library(LUA_LIBRARY
- NAMES lua51 lua5.1 lua-5.1 lua
+ NAMES lua51 lua5.1 lua-5.1 lua luajit
HINTS
ENV LUA_DIR
PATH_SUFFIXES lib
diff --git a/cmake/FindLuaJit.cmake b/cmake/FindLuaJit.cmake
deleted file mode 100644
index a7376dee1..000000000
--- a/cmake/FindLuaJit.cmake
+++ /dev/null
@@ -1,91 +0,0 @@
-# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
-# file Copyright.txt or https://cmake.org/licensing for details.
-# Modified from the FindLua51 that comes with CMake
-
-#[=======================================================================[.rst:
-FindLuaJit
----------
-
-
-
-Locate LuaJit library This module defines
-
-::
-
- LUAJIT_FOUND, if false, do not try to link to Lua
- LUAJIT_LIBRARIES
- LUAJIT_INCLUDE_DIR, where to find lua.h
- LUAJIT_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
-
-
-
-Note that the expected include convention is
-
-::
-
- #include "lua.h"
-
-and not
-
-::
-
- #include
-
-This is because, the lua location is not standardized and may exist in
-locations other than lua/
-#]=======================================================================]
-
-find_path(LUAJIT_INCLUDE_DIR lua.h
- HINTS
- ENV LUA_DIR
- PATH_SUFFIXES include/luajit include/luajit-2.0 include/luajit-2.1 include
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /sw # Fink
- /opt/local # DarwinPorts
- /opt/csw # Blastwave
- /opt
-)
-
-find_library(LUAJIT_LIBRARY
- NAMES luajit51 luajit5.1 luajit-5.1 luajit lua51
- HINTS
- ENV LUA_DIR
- PATH_SUFFIXES lib
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /sw
- /opt/local
- /opt/csw
- /opt
-)
-
-if(LUAJIT_LIBRARY)
- # include the math library for Unix
- if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU)
- find_library(LUAJIT_MATH_LIBRARY m)
- set( LUAJIT_LIBRARIES "${LUAJIT_LIBRARY};${LUAJIT_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
- # For Windows and Mac, don't need to explicitly include the math library
- else()
- set( LUAJIT_LIBRARIES "${LUAJIT_LIBRARY}" CACHE STRING "Lua Libraries")
- endif()
-endif()
-
-if(LUAJIT_INCLUDE_DIR AND EXISTS "${LUAJIT_INCLUDE_DIR}/lua.h")
- file(STRINGS "${LUAJIT_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
-
- string(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUAJIT_VERSION_STRING "${lua_version_str}")
- unset(lua_version_str)
-endif()
-
-include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
-# handle the QUIETLY and REQUIRED arguments and set LUAJIT_FOUND to TRUE if
-# all listed variables are TRUE
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LuaJit
- REQUIRED_VARS LUAJIT_LIBRARIES LUAJIT_INCLUDE_DIR
- VERSION_VAR LUAJIT_VERSION_STRING)
-
-mark_as_advanced(LUAJIT_INCLUDE_DIR LUAJIT_LIBRARIES LUAJIT_LIBRARY LUAJIT_MATH_LIBRARY)
-
diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
index 08db08585..702f2c867 100644
--- a/common/CMakeLists.txt
+++ b/common/CMakeLists.txt
@@ -16,7 +16,6 @@ SET(common_sources
database_instances.cpp
dbcore.cpp
deity.cpp
- dynamic_zone_base.cpp
emu_constants.cpp
emu_limits.cpp
emu_opcodes.cpp
@@ -32,8 +31,6 @@ SET(common_sources
eq_stream_proxy.cpp
eqtime.cpp
event_sub.cpp
- expedition_base.cpp
- expedition_lockout_timer.cpp
extprofile.cpp
faction.cpp
file_util.cpp
@@ -70,7 +67,6 @@ SET(common_sources
rulesys.cpp
say_link.cpp
serialize_buffer.cpp
- server_event_scheduler.cpp
serverinfo.cpp
shareddb.cpp
skills.cpp
@@ -152,7 +148,6 @@ SET(repositories
repositories/base/base_character_currency_repository.h
repositories/base/base_character_data_repository.h
repositories/base/base_character_disciplines_repository.h
- repositories/base/base_character_expedition_lockouts_repository.h
repositories/base/base_character_inspect_messages_repository.h
repositories/base/base_character_item_recast_repository.h
repositories/base/base_character_languages_repository.h
@@ -171,16 +166,11 @@ SET(repositories
repositories/base/base_char_recipe_list_repository.h
repositories/base/base_completed_tasks_repository.h
repositories/base/base_content_flags_repository.h
- repositories/base/base_damageshieldtypes_repository.h
repositories/base/base_data_buckets_repository.h
repositories/base/base_db_str_repository.h
repositories/base/base_discovered_items_repository.h
repositories/base/base_doors_repository.h
- repositories/base/base_dynamic_zones_repository.h
repositories/base/base_eventlog_repository.h
- repositories/base/base_expeditions_repository.h
- repositories/base/base_expedition_lockouts_repository.h
- repositories/base/base_expedition_members_repository.h
repositories/base/base_faction_base_data_repository.h
repositories/base/base_faction_list_repository.h
repositories/base/base_faction_list_mod_repository.h
@@ -254,7 +244,6 @@ SET(repositories
repositories/base/base_rule_sets_repository.h
repositories/base/base_rule_values_repository.h
repositories/base/base_saylink_repository.h
- repositories/base/base_server_scheduled_events_repository.h
repositories/base/base_skill_caps_repository.h
repositories/base/base_spawn2_repository.h
repositories/base/base_spawnentry_repository.h
@@ -278,6 +267,7 @@ SET(repositories
repositories/base/base_traps_repository.h
repositories/base/base_tributes_repository.h
repositories/base/base_tribute_levels_repository.h
+ repositories/base/base_variables_repository.h
repositories/base/base_veteran_reward_templates_repository.h
repositories/base/base_zone_repository.h
repositories/base/base_zone_points_repository.h
@@ -316,7 +306,6 @@ SET(repositories
repositories/character_currency_repository.h
repositories/character_data_repository.h
repositories/character_disciplines_repository.h
- repositories/character_expedition_lockouts_repository.h
repositories/character_inspect_messages_repository.h
repositories/character_item_recast_repository.h
repositories/character_languages_repository.h
@@ -335,16 +324,11 @@ SET(repositories
repositories/char_recipe_list_repository.h
repositories/completed_tasks_repository.h
repositories/content_flags_repository.h
- repositories/damageshieldtypes_repository.h
repositories/data_buckets_repository.h
repositories/db_str_repository.h
repositories/discovered_items_repository.h
repositories/doors_repository.h
- repositories/dynamic_zones_repository.h
repositories/eventlog_repository.h
- repositories/expeditions_repository.h
- repositories/expedition_lockouts_repository.h
- repositories/expedition_members_repository.h
repositories/faction_base_data_repository.h
repositories/faction_list_repository.h
repositories/faction_list_mod_repository.h
@@ -418,7 +402,6 @@ SET(repositories
repositories/rule_sets_repository.h
repositories/rule_values_repository.h
repositories/saylink_repository.h
- repositories/server_scheduled_events_repository.h
repositories/skill_caps_repository.h
repositories/spawn2_repository.h
repositories/spawnentry_repository.h
@@ -442,6 +425,7 @@ SET(repositories
repositories/traps_repository.h
repositories/tributes_repository.h
repositories/tribute_levels_repository.h
+ repositories/variables_repository.h
repositories/veteran_reward_templates_repository.h
repositories/zone_repository.h
repositories/zone_points_repository.h
@@ -465,14 +449,12 @@ SET(common_headers
cli/argh.h
cli/eqemu_command_handler.h
cli/terminal_color.hpp
- cron/croncpp.h
database/database_dump_service.h
data_verification.h
database.h
database_schema.h
dbcore.h
deity.h
- dynamic_zone_base.h
emu_constants.h
emu_limits.h
emu_opcodes.h
@@ -496,8 +478,6 @@ SET(common_headers
eqtime.h
errmsg.h
event_sub.h
- expedition_base.h
- expedition_lockout_timer.h
extprofile.h
faction.h
file_util.h
@@ -549,7 +529,6 @@ SET(common_headers
say_link.h
seperator.h
serialize_buffer.h
- server_event_scheduler.h
serverinfo.h
servertalk.h
shareddb.h
diff --git a/common/classes.cpp b/common/classes.cpp
index b9445443f..3aaeeded3 100644
--- a/common/classes.cpp
+++ b/common/classes.cpp
@@ -378,8 +378,6 @@ const char *GetClassIDName(uint8 class_id, uint8 level)
return "Berserker Guildmaster";
case MERCHANT:
return "Merchant";
- case DISCORD_MERCHANT:
- return "Discord Merchant";
case ADVENTURERECRUITER:
return "Adventure Recruiter";
case ADVENTUREMERCHANT:
@@ -390,18 +388,6 @@ const char *GetClassIDName(uint8 class_id, uint8 level)
return "Tribute Master";
case GUILD_TRIBUTE_MASTER:
return "Guild Tribute Master";
- case GUILD_BANKER:
- return "Guild Banker";
- case NORRATHS_KEEPERS_MERCHANT:
- return "Radiant Crystal Merchant";
- case DARK_REIGN_MERCHANT:
- return "Ebon Crystal Merchant";
- case FELLOWSHIP_MASTER:
- return "Fellowship Master";
- case ALT_CURRENCY_MERCHANT:
- return "Alternate Currency Merchant";
- case MERCERNARY_MASTER:
- return "Mercenary Liaison";
default:
return "Unknown";
}
diff --git a/common/classes.h b/common/classes.h
index a35014d94..f63758937 100644
--- a/common/classes.h
+++ b/common/classes.h
@@ -61,7 +61,6 @@
#define CORPSE_CLASS 62 // only seen on Danvi's Corpse in Akheva so far..
#define TRIBUTE_MASTER 63
#define GUILD_TRIBUTE_MASTER 64 // not sure
-#define GUILD_BANKER 66
#define NORRATHS_KEEPERS_MERCHANT 67
#define DARK_REIGN_MERCHANT 68
#define FELLOWSHIP_MASTER 69
diff --git a/common/content/world_content_service.cpp b/common/content/world_content_service.cpp
index feb0f5b76..949ebcc0d 100644
--- a/common/content/world_content_service.cpp
+++ b/common/content/world_content_service.cpp
@@ -22,7 +22,6 @@
#include "../database.h"
#include "../rulesys.h"
#include "../eqemu_logsys.h"
-#include "../repositories/content_flags_repository.h"
WorldContentService::WorldContentService()
@@ -100,21 +99,3 @@ bool WorldContentService::IsContentFlagEnabled(const std::string& content_flag)
return false;
}
-
-void WorldContentService::ReloadContentFlags(Database &db)
-{
- std::vector set_content_flags;
- auto content_flags = ContentFlagsRepository::GetWhere(db, "enabled = 1");
-
- set_content_flags.reserve(content_flags.size());
- for (auto &flags: content_flags) {
- set_content_flags.push_back(flags.flag_name);
- }
-
- LogInfo(
- "Enabled content flags [{}]",
- implode(", ", set_content_flags)
- );
-
- SetContentFlags(set_content_flags);
-}
diff --git a/common/content/world_content_service.h b/common/content/world_content_service.h
index 47220b349..662ec20cc 100644
--- a/common/content/world_content_service.h
+++ b/common/content/world_content_service.h
@@ -24,8 +24,6 @@
#include
#include
-class Database;
-
namespace Expansion {
static const int EXPANSION_ALL = -1;
static const int EXPANSION_FILTER_MAX = 99;
@@ -104,33 +102,33 @@ public:
int GetCurrentExpansion() const;
void SetCurrentExpansion(int current_expansion);
- bool IsClassicEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::Classic || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsTheRuinsOfKunarkEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheRuinsOfKunark || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsTheScarsOfVeliousEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheScarsOfVelious || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsTheShadowsOfLuclinEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheShadowsOfLuclin || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsThePlanesOfPowerEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::ThePlanesOfPower || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsTheLegacyOfYkeshaEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheLegacyOfYkesha || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsLostDungeonsOfNorrathEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::LostDungeonsOfNorrath || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsGatesOfDiscordEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::GatesOfDiscord || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsOmensOfWarEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::OmensOfWar || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsDragonsOfNorrathEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::DragonsOfNorrath || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsDepthsOfDarkhollowEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::DepthsOfDarkhollow || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsProphecyOfRoEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::ProphecyOfRo || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsTheSerpentsSpineEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheSerpentsSpine || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsTheBuriedSeaEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheBuriedSea || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsSecretsOfFaydwerEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::SecretsOfFaydwer || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsSeedsOfDestructionEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::SeedsOfDestruction || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsUnderfootEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::Underfoot || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsHouseOfThuleEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::HouseOfThule || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsVeilOfAlarisEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::VeilOfAlaris || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsRainOfFearEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::RainOfFear || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsCallOfTheForsakenEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::CallOfTheForsaken || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsTheDarkendSeaEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheDarkendSea || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsTheBrokenMirrorEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheBrokenMirror || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsEmpiresOfKunarkEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::EmpiresOfKunark || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsRingOfScaleEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::RingOfScale || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsTheBurningLandsEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheBurningLands || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
- bool IsTormentOfVeliousEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TormentOfVelious || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
+ bool IsClassicEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::Classic; }
+ bool IsTheRuinsOfKunarkEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheRuinsOfKunark; }
+ bool IsTheScarsOfVeliousEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheScarsOfVelious; }
+ bool IsTheShadowsOfLuclinEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheShadowsOfLuclin; }
+ bool IsThePlanesOfPowerEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::ThePlanesOfPower; }
+ bool IsTheLegacyOfYkeshaEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheLegacyOfYkesha; }
+ bool IsLostDungeonsOfNorrathEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::LostDungeonsOfNorrath; }
+ bool IsGatesOfDiscordEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::GatesOfDiscord; }
+ bool IsOmensOfWarEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::OmensOfWar; }
+ bool IsDragonsOfNorrathEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::DragonsOfNorrath; }
+ bool IsDepthsOfDarkhollowEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::DepthsOfDarkhollow; }
+ bool IsProphecyOfRoEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::ProphecyOfRo; }
+ bool IsTheSerpentsSpineEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheSerpentsSpine; }
+ bool IsTheBuriedSeaEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheBuriedSea; }
+ bool IsSecretsOfFaydwerEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::SecretsOfFaydwer; }
+ bool IsSeedsOfDestructionEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::SeedsOfDestruction; }
+ bool IsUnderfootEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::Underfoot; }
+ bool IsHouseOfThuleEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::HouseOfThule; }
+ bool IsVeilOfAlarisEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::VeilOfAlaris; }
+ bool IsRainOfFearEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::RainOfFear; }
+ bool IsCallOfTheForsakenEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::CallOfTheForsaken; }
+ bool IsTheDarkendSeaEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheDarkendSea; }
+ bool IsTheBrokenMirrorEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheBrokenMirror; }
+ bool IsEmpiresOfKunarkEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::EmpiresOfKunark; }
+ bool IsRingOfScaleEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::RingOfScale; }
+ bool IsTheBurningLandsEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheBurningLands; }
+ bool IsTormentOfVeliousEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TormentOfVelious; }
bool IsCurrentExpansionClassic() { return current_expansion == Expansion::ExpansionNumber::Classic; }
bool IsCurrentExpansionTheRuinsOfKunark() { return current_expansion == Expansion::ExpansionNumber::TheRuinsOfKunark; }
@@ -167,7 +165,6 @@ public:
const std::vector &GetContentFlags() const;
bool IsContentFlagEnabled(const std::string& content_flag);
void SetContentFlags(std::vector content_flags);
- void ReloadContentFlags(Database &db);
void SetExpansionContext();
};
diff --git a/common/cron/croncpp.h b/common/cron/croncpp.h
deleted file mode 100644
index 5a22a7f72..000000000
--- a/common/cron/croncpp.h
+++ /dev/null
@@ -1,876 +0,0 @@
-#pragma once
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#if __cplusplus > 201402L
-#include
-#define CRONCPP_IS_CPP17
-#endif
-
-namespace cron
-{
-#ifdef CRONCPP_IS_CPP17
- #define HAS_STRING_VIEW
- #define STRING_VIEW std::string_view
- #define STRING_VIEW_NPOS std::string_view::npos
- #define CONSTEXPTR constexpr
-#else
-#define STRING_VIEW std::string const &
-#define STRING_VIEW_NPOS std::string::npos
-#define CONSTEXPTR
-#endif
-
- using cron_int = uint8_t;
-
- constexpr std::time_t INVALID_TIME = static_cast(-1);
-
- constexpr size_t INVALID_CRON_INDEX = static_cast(-1);
-
- class cronexpr;
-
- namespace detail
- {
- enum class cron_field
- {
- second,
- minute,
- hour_of_day,
- day_of_week,
- day_of_month,
- month,
- year
- };
-
- template
- static bool find_next(cronexpr const & cex,
- std::tm& date,
- size_t const dot);
- }
-
- struct bad_cronexpr : public std::runtime_error
- {
- public:
- explicit bad_cronexpr(STRING_VIEW message) :
- std::runtime_error(message.data())
- {}
- };
-
-
- struct cron_standard_traits
- {
- static const cron_int CRON_MIN_SECONDS = 0;
- static const cron_int CRON_MAX_SECONDS = 59;
-
- static const cron_int CRON_MIN_MINUTES = 0;
- static const cron_int CRON_MAX_MINUTES = 59;
-
- static const cron_int CRON_MIN_HOURS = 0;
- static const cron_int CRON_MAX_HOURS = 23;
-
- static const cron_int CRON_MIN_DAYS_OF_WEEK = 0;
- static const cron_int CRON_MAX_DAYS_OF_WEEK = 6;
-
- static const cron_int CRON_MIN_DAYS_OF_MONTH = 1;
- static const cron_int CRON_MAX_DAYS_OF_MONTH = 31;
-
- static const cron_int CRON_MIN_MONTHS = 1;
- static const cron_int CRON_MAX_MONTHS = 12;
-
- static const cron_int CRON_MAX_YEARS_DIFF = 4;
-
-#ifdef CRONCPP_IS_CPP17
- static const inline std::vector DAYS = { "SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT" };
- static const inline std::vector MONTHS = { "NIL", "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC" };
-#else
- static std::vector& DAYS()
- {
- static std::vector days = { "SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT" };
- return days;
- }
-
- static std::vector& MONTHS()
- {
- static std::vector months = { "NIL", "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC" };
- return months;
- }
-#endif
- };
-
- struct cron_oracle_traits
- {
- static const cron_int CRON_MIN_SECONDS = 0;
- static const cron_int CRON_MAX_SECONDS = 59;
-
- static const cron_int CRON_MIN_MINUTES = 0;
- static const cron_int CRON_MAX_MINUTES = 59;
-
- static const cron_int CRON_MIN_HOURS = 0;
- static const cron_int CRON_MAX_HOURS = 23;
-
- static const cron_int CRON_MIN_DAYS_OF_WEEK = 1;
- static const cron_int CRON_MAX_DAYS_OF_WEEK = 7;
-
- static const cron_int CRON_MIN_DAYS_OF_MONTH = 1;
- static const cron_int CRON_MAX_DAYS_OF_MONTH = 31;
-
- static const cron_int CRON_MIN_MONTHS = 0;
- static const cron_int CRON_MAX_MONTHS = 11;
-
- static const cron_int CRON_MAX_YEARS_DIFF = 4;
-
-#ifdef CRONCPP_IS_CPP17
- static const inline std::vector DAYS = { "NIL", "SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT" };
- static const inline std::vector MONTHS = { "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC" };
-#else
-
- static std::vector& DAYS()
- {
- static std::vector days = { "NIL", "SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT" };
- return days;
- }
-
- static std::vector& MONTHS()
- {
- static std::vector months = { "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC" };
- return months;
- }
-#endif
- };
-
- struct cron_quartz_traits
- {
- static const cron_int CRON_MIN_SECONDS = 0;
- static const cron_int CRON_MAX_SECONDS = 59;
-
- static const cron_int CRON_MIN_MINUTES = 0;
- static const cron_int CRON_MAX_MINUTES = 59;
-
- static const cron_int CRON_MIN_HOURS = 0;
- static const cron_int CRON_MAX_HOURS = 23;
-
- static const cron_int CRON_MIN_DAYS_OF_WEEK = 1;
- static const cron_int CRON_MAX_DAYS_OF_WEEK = 7;
-
- static const cron_int CRON_MIN_DAYS_OF_MONTH = 1;
- static const cron_int CRON_MAX_DAYS_OF_MONTH = 31;
-
- static const cron_int CRON_MIN_MONTHS = 1;
- static const cron_int CRON_MAX_MONTHS = 12;
-
- static const cron_int CRON_MAX_YEARS_DIFF = 4;
-
-#ifdef CRONCPP_IS_CPP17
- static const inline std::vector DAYS = { "NIL", "SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT" };
- static const inline std::vector MONTHS = { "NIL", "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC" };
-#else
- static std::vector& DAYS()
- {
- static std::vector days = { "NIL", "SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT" };
- return days;
- }
-
- static std::vector& MONTHS()
- {
- static std::vector months = { "NIL", "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC" };
- return months;
- }
-#endif
- };
-
- class cronexpr;
-
- template
- static cronexpr make_cron(STRING_VIEW expr);
-
- class cronexpr
- {
- std::bitset<60> seconds;
- std::bitset<60> minutes;
- std::bitset<24> hours;
- std::bitset<7> days_of_week;
- std::bitset<31> days_of_month;
- std::bitset<12> months;
-
- friend bool operator==(cronexpr const & e1, cronexpr const & e2);
- friend bool operator!=(cronexpr const & e1, cronexpr const & e2);
-
- template
- friend bool detail::find_next(cronexpr const & cex,
- std::tm& date,
- size_t const dot);
-
- friend std::string to_string(cronexpr const & cex);
-
- template
- friend cronexpr make_cron(STRING_VIEW expr);
- };
-
- inline bool operator==(cronexpr const & e1, cronexpr const & e2)
- {
- return
- e1.seconds == e2.seconds &&
- e1.minutes == e2.minutes &&
- e1.hours == e2.hours &&
- e1.days_of_week == e2.days_of_week &&
- e1.days_of_month == e2.days_of_month &&
- e1.months == e2.months;
- }
-
- inline bool operator!=(cronexpr const & e1, cronexpr const & e2)
- {
- return !(e1 == e2);
- }
-
- inline std::string to_string(cronexpr const & cex)
- {
- return
- cex.seconds.to_string() + " " +
- cex.minutes.to_string() + " " +
- cex.hours.to_string() + " " +
- cex.days_of_month.to_string() + " " +
- cex.months.to_string() + " " +
- cex.days_of_week.to_string();
- }
-
- namespace utils
- {
- inline std::time_t tm_to_time(std::tm& date)
- {
- return std::mktime(&date);
- }
-
- inline std::tm* time_to_tm(std::time_t const * date, std::tm* const out)
- {
-#ifdef _WIN32
- errno_t err = localtime_s(out, date);
- return 0 == err ? out : nullptr;
-#else
- return localtime_r(date, out);
-#endif
- }
-
- inline std::tm to_tm(STRING_VIEW time)
- {
- std::istringstream str(time.data());
- str.imbue(std::locale(setlocale(LC_ALL, nullptr)));
-
- std::tm result;
- str >> std::get_time(&result, "%Y-%m-%d %H:%M:%S");
- if (str.fail()) throw std::runtime_error("Parsing date failed!");
-
- result.tm_isdst = -1; // DST info not available
-
- return result;
- }
-
- inline std::string to_string(std::tm const & tm)
- {
- std::ostringstream str;
- str.imbue(std::locale(setlocale(LC_ALL, nullptr)));
- str << std::put_time(&tm, "%Y-%m-%d %H:%M:%S");
- if (str.fail()) throw std::runtime_error("Writing date failed!");
-
- return str.str();
- }
-
- inline std::string to_upper(std::string text)
- {
- std::transform(std::begin(text), std::end(text),
- std::begin(text), static_cast(std::toupper));
-
- return text;
- }
-
- static std::vector split(STRING_VIEW text, char const delimiter)
- {
- std::vector tokens;
- std::string token;
- std::istringstream tokenStream(text.data());
- while (std::getline(tokenStream, token, delimiter))
- {
- tokens.push_back(token);
- }
- return tokens;
- }
-
- CONSTEXPTR inline bool contains(STRING_VIEW text, char const ch) noexcept
- {
- return STRING_VIEW_NPOS != text.find_first_of(ch);
- }
- }
-
- namespace detail
- {
-
- inline cron_int to_cron_int(STRING_VIEW text)
- {
- try
- {
- return static_cast(std::stoul(text.data()));
- }
- catch (std::exception const & ex)
- {
- throw bad_cronexpr(ex.what());
- }
- }
-
- static std::string replace_ordinals(
- std::string text,
- std::vector const & replacement)
- {
- for (size_t i = 0; i < replacement.size(); ++i)
- {
- auto pos = text.find(replacement[i]);
- if (std::string::npos != pos)
- text.replace(pos, 3 ,std::to_string(i));
- }
-
- return text;
- }
-
- static std::pair make_range(
- STRING_VIEW field,
- cron_int const minval,
- cron_int const maxval)
- {
- cron_int first = 0;
- cron_int last = 0;
- if (field.size() == 1 && field[0] == '*')
- {
- first = minval;
- last = maxval;
- }
- else if (!utils::contains(field, '-'))
- {
- first = to_cron_int(field);
- last = first;
- }
- else
- {
- auto parts = utils::split(field, '-');
- if (parts.size() != 2)
- throw bad_cronexpr("Specified range requires two fields");
-
- first = to_cron_int(parts[0]);
- last = to_cron_int(parts[1]);
- }
-
- if (first > maxval || last > maxval)
- {
- throw bad_cronexpr("Specified range exceeds maximum");
- }
- if (first < minval || last < minval)
- {
- throw bad_cronexpr("Specified range is less than minimum");
- }
- if (first > last)
- {
- throw bad_cronexpr("Specified range start exceeds range end");
- }
-
- return { first, last };
- }
-
- template
- static void set_cron_field(
- STRING_VIEW value,
- std::bitset& target,
- cron_int const minval,
- cron_int const maxval)
- {
- if(value.length() > 0 && value[value.length()-1] == ',')
- throw bad_cronexpr("Value cannot end with comma");
-
- auto fields = utils::split(value, ',');
- if (fields.empty())
- throw bad_cronexpr("Expression parsing error");
-
- for (auto const & field : fields)
- {
- if (!utils::contains(field, '/'))
- {
-#ifdef CRONCPP_IS_CPP17
- auto[first, last] = detail::make_range(field, minval, maxval);
-#else
- auto range = detail::make_range(field, minval, maxval);
- auto first = range.first;
- auto last = range.second;
-#endif
- for (cron_int i = first - minval; i <= last - minval; ++i)
- {
- target.set(i);
- }
- }
- else
- {
- auto parts = utils::split(field, '/');
- if (parts.size() != 2)
- throw bad_cronexpr("Incrementer must have two fields");
-
-#ifdef CRONCPP_IS_CPP17
- auto[first, last] = detail::make_range(parts[0], minval, maxval);
-#else
- auto range = detail::make_range(parts[0], minval, maxval);
- auto first = range.first;
- auto last = range.second;
-#endif
-
- if (!utils::contains(parts[0], '-'))
- {
- last = maxval;
- }
-
- auto delta = detail::to_cron_int(parts[1]);
- if(delta <= 0)
- throw bad_cronexpr("Incrementer must be a positive value");
-
- for (cron_int i = first - minval; i <= last - minval; i += delta)
- {
- target.set(i);
- }
- }
- }
- }
-
- template
- static void set_cron_days_of_week(
- std::string value,
- std::bitset<7>& target)
- {
- auto days = utils::to_upper(value);
- auto days_replaced = detail::replace_ordinals(
- days,
-#ifdef CRONCPP_IS_CPP17
- Traits::DAYS
-#else
- Traits::DAYS()
-#endif
- );
-
- if (days_replaced.size() == 1 && days_replaced[0] == '?')
- days_replaced[0] = '*';
-
- set_cron_field(
- days_replaced,
- target,
- Traits::CRON_MIN_DAYS_OF_WEEK,
- Traits::CRON_MAX_DAYS_OF_WEEK);
- }
-
- template
- static void set_cron_days_of_month(
- std::string value,
- std::bitset<31>& target)
- {
- if (value.size() == 1 && value[0] == '?')
- value[0] = '*';
-
- set_cron_field(
- value,
- target,
- Traits::CRON_MIN_DAYS_OF_MONTH,
- Traits::CRON_MAX_DAYS_OF_MONTH);
- }
-
- template
- static void set_cron_month(
- std::string value,
- std::bitset<12>& target)
- {
- auto month = utils::to_upper(value);
- auto month_replaced = replace_ordinals(
- month,
-#ifdef CRONCPP_IS_CPP17
- Traits::MONTHS
-#else
- Traits::MONTHS()
-#endif
- );
-
- set_cron_field(
- month_replaced,
- target,
- Traits::CRON_MIN_MONTHS,
- Traits::CRON_MAX_MONTHS);
- }
-
- template
- inline size_t next_set_bit(
- std::bitset const & target,
- size_t /*minimum*/,
- size_t /*maximum*/,
- size_t offset)
- {
- for (auto i = offset; i < N; ++i)
- {
- if (target.test(i)) return i;
- }
-
- return INVALID_CRON_INDEX;
- }
-
- inline void add_to_field(
- std::tm& date,
- cron_field const field,
- int const val)
- {
- switch (field)
- {
- case cron_field::second:
- date.tm_sec += val;
- break;
- case cron_field::minute:
- date.tm_min += val;
- break;
- case cron_field::hour_of_day:
- date.tm_hour += val;
- break;
- case cron_field::day_of_week:
- case cron_field::day_of_month:
- date.tm_mday += val;
- break;
- case cron_field::month:
- date.tm_mon += val;
- break;
- case cron_field::year:
- date.tm_year += val;
- break;
- }
-
- if (INVALID_TIME == utils::tm_to_time(date))
- throw bad_cronexpr("Invalid time expression");
- }
-
- inline void set_field(
- std::tm& date,
- cron_field const field,
- int const val)
- {
- switch (field)
- {
- case cron_field::second:
- date.tm_sec = val;
- break;
- case cron_field::minute:
- date.tm_min = val;
- break;
- case cron_field::hour_of_day:
- date.tm_hour = val;
- break;
- case cron_field::day_of_week:
- date.tm_wday = val;
- break;
- case cron_field::day_of_month:
- date.tm_mday = val;
- break;
- case cron_field::month:
- date.tm_mon = val;
- break;
- case cron_field::year:
- date.tm_year = val;
- break;
- }
-
- if (INVALID_TIME == utils::tm_to_time(date))
- throw bad_cronexpr("Invalid time expression");
- }
-
- inline void reset_field(
- std::tm& date,
- cron_field const field)
- {
- switch (field)
- {
- case cron_field::second:
- date.tm_sec = 0;
- break;
- case cron_field::minute:
- date.tm_min = 0;
- break;
- case cron_field::hour_of_day:
- date.tm_hour = 0;
- break;
- case cron_field::day_of_week:
- date.tm_wday = 0;
- break;
- case cron_field::day_of_month:
- date.tm_mday = 1;
- break;
- case cron_field::month:
- date.tm_mon = 0;
- break;
- case cron_field::year:
- date.tm_year = 0;
- break;
- }
-
- if (INVALID_TIME == utils::tm_to_time(date))
- throw bad_cronexpr("Invalid time expression");
- }
-
- inline void reset_all_fields(
- std::tm& date,
- std::bitset<7> const & marked_fields)
- {
- for (size_t i = 0; i < marked_fields.size(); ++i)
- {
- if (marked_fields.test(i))
- reset_field(date, static_cast(i));
- }
- }
-
- inline void mark_field(
- std::bitset<7> & orders,
- cron_field const field)
- {
- if (!orders.test(static_cast(field)))
- orders.set(static_cast(field));
- }
-
- template
- static size_t find_next(
- std::bitset const & target,
- std::tm& date,
- unsigned int const minimum,
- unsigned int const maximum,
- unsigned int const value,
- cron_field const field,
- cron_field const next_field,
- std::bitset<7> const & marked_fields)
- {
- auto next_value = next_set_bit(target, minimum, maximum, value);
- if (INVALID_CRON_INDEX == next_value)
- {
- add_to_field(date, next_field, 1);
- reset_field(date, field);
- next_value = next_set_bit(target, minimum, maximum, 0);
- }
-
- if (INVALID_CRON_INDEX == next_value || next_value != value)
- {
- set_field(date, field, static_cast(next_value));
- reset_all_fields(date, marked_fields);
- }
-
- return next_value;
- }
-
- template
- static size_t find_next_day(
- std::tm& date,
- std::bitset<31> const & days_of_month,
- size_t day_of_month,
- std::bitset<7> const & days_of_week,
- size_t day_of_week,
- std::bitset<7> const & marked_fields)
- {
- unsigned int count = 0;
- unsigned int maximum = 366;
- while (
- (!days_of_month.test(day_of_month - Traits::CRON_MIN_DAYS_OF_MONTH) ||
- !days_of_week.test(day_of_week - Traits::CRON_MIN_DAYS_OF_WEEK))
- && count++ < maximum)
- {
- add_to_field(date, cron_field::day_of_month, 1);
-
- day_of_month = date.tm_mday;
- day_of_week = date.tm_wday;
-
- reset_all_fields(date, marked_fields);
- }
-
- return day_of_month;
- }
-
- template
- static bool find_next(cronexpr const & cex,
- std::tm& date,
- size_t const dot)
- {
- bool res = true;
-
- std::bitset<7> marked_fields{ 0 };
- std::bitset<7> empty_list{ 0 };
-
- unsigned int second = date.tm_sec;
- auto updated_second = find_next(
- cex.seconds,
- date,
- Traits::CRON_MIN_SECONDS,
- Traits::CRON_MAX_SECONDS,
- second,
- cron_field::second,
- cron_field::minute,
- empty_list);
-
- if (second == updated_second)
- {
- mark_field(marked_fields, cron_field::second);
- }
-
- unsigned int minute = date.tm_min;
- auto update_minute = find_next(
- cex.minutes,
- date,
- Traits::CRON_MIN_MINUTES,
- Traits::CRON_MAX_MINUTES,
- minute,
- cron_field::minute,
- cron_field::hour_of_day,
- marked_fields);
- if (minute == update_minute)
- {
- mark_field(marked_fields, cron_field::minute);
- }
- else
- {
- res = find_next(cex, date, dot);
- if (!res) return res;
- }
-
- unsigned int hour = date.tm_hour;
- auto updated_hour = find_next(
- cex.hours,
- date,
- Traits::CRON_MIN_HOURS,
- Traits::CRON_MAX_HOURS,
- hour,
- cron_field::hour_of_day,
- cron_field::day_of_week,
- marked_fields);
- if (hour == updated_hour)
- {
- mark_field(marked_fields, cron_field::hour_of_day);
- }
- else
- {
- res = find_next(cex, date, dot);
- if (!res) return res;
- }
-
- unsigned int day_of_week = date.tm_wday;
- unsigned int day_of_month = date.tm_mday;
- auto updated_day_of_month = find_next_day(
- date,
- cex.days_of_month,
- day_of_month,
- cex.days_of_week,
- day_of_week,
- marked_fields);
- if (day_of_month == updated_day_of_month)
- {
- mark_field(marked_fields, cron_field::day_of_month);
- }
- else
- {
- res = find_next(cex, date, dot);
- if (!res) return res;
- }
-
- unsigned int month = date.tm_mon;
- auto updated_month = find_next(
- cex.months,
- date,
- Traits::CRON_MIN_MONTHS,
- Traits::CRON_MAX_MONTHS,
- month,
- cron_field::month,
- cron_field::year,
- marked_fields);
- if (month != updated_month)
- {
- if (date.tm_year - dot > Traits::CRON_MAX_YEARS_DIFF)
- return false;
-
- res = find_next(cex, date, dot);
- if (!res) return res;
- }
-
- return res;
- }
- }
-
- template
- static cronexpr make_cron(STRING_VIEW expr)
- {
- cronexpr cex;
-
- if (expr.empty())
- throw bad_cronexpr("Invalid empty cron expression");
-
- auto fields = utils::split(expr, ' ');
- fields.erase(
- std::remove_if(std::begin(fields), std::end(fields),
- [](STRING_VIEW s) {return s.empty(); }),
- std::end(fields));
- if (fields.size() != 6)
- throw bad_cronexpr("cron expression must have six fields");
-
- detail::set_cron_field(fields[0], cex.seconds, Traits::CRON_MIN_SECONDS, Traits::CRON_MAX_SECONDS);
- detail::set_cron_field(fields[1], cex.minutes, Traits::CRON_MIN_MINUTES, Traits::CRON_MAX_MINUTES);
- detail::set_cron_field(fields[2], cex.hours, Traits::CRON_MIN_HOURS, Traits::CRON_MAX_HOURS);
-
- detail::set_cron_days_of_week(fields[5], cex.days_of_week);
-
- detail::set_cron_days_of_month(fields[3], cex.days_of_month);
-
- detail::set_cron_month(fields[4], cex.months);
-
- return cex;
- }
-
- template
- static std::tm cron_next(cronexpr const & cex, std::tm date)
- {
- time_t original = utils::tm_to_time(date);
- if (INVALID_TIME == original) return {};
-
- if (!detail::find_next(cex, date, date.tm_year))
- return {};
-
- time_t calculated = utils::tm_to_time(date);
- if (INVALID_TIME == calculated) return {};
-
- if (calculated == original)
- {
- add_to_field(date, detail::cron_field::second, 1);
- if (!detail::find_next(cex, date, date.tm_year))
- return {};
- }
-
- return date;
- }
-
- template
- static std::time_t cron_next(cronexpr const & cex, std::time_t const & date)
- {
- std::tm val;
- std::tm* dt = utils::time_to_tm(&date, &val);
- if (dt == nullptr) return INVALID_TIME;
-
- time_t original = utils::tm_to_time(*dt);
- if (INVALID_TIME == original) return INVALID_TIME;
-
- if(!detail::find_next(cex, *dt, dt->tm_year))
- return INVALID_TIME;
-
- time_t calculated = utils::tm_to_time(*dt);
- if (INVALID_TIME == calculated) return calculated;
-
- if (calculated == original)
- {
- add_to_field(*dt, detail::cron_field::second, 1);
- if(!detail::find_next(cex, *dt, dt->tm_year))
- return INVALID_TIME;
- }
-
- return utils::tm_to_time(*dt);
- }
-}
diff --git a/common/database.cpp b/common/database.cpp
index 385f07c18..01520d5a3 100644
--- a/common/database.cpp
+++ b/common/database.cpp
@@ -703,11 +703,11 @@ bool Database::SaveCharacterCreate(uint32 character_id, uint32 account_id, Playe
"(%u, %u, %u, %f, %f, %f, %f, %i), "
"(%u, %u, %u, %f, %f, %f, %f, %i), "
"(%u, %u, %u, %f, %f, %f, %f, %i)",
- character_id, pp->binds[0].zone_id, 0, pp->binds[0].x, pp->binds[0].y, pp->binds[0].z, pp->binds[0].heading, 0,
- character_id, pp->binds[1].zone_id, 0, pp->binds[1].x, pp->binds[1].y, pp->binds[1].z, pp->binds[1].heading, 1,
- character_id, pp->binds[2].zone_id, 0, pp->binds[2].x, pp->binds[2].y, pp->binds[2].z, pp->binds[2].heading, 2,
- character_id, pp->binds[3].zone_id, 0, pp->binds[3].x, pp->binds[3].y, pp->binds[3].z, pp->binds[3].heading, 3,
- character_id, pp->binds[4].zone_id, 0, pp->binds[4].x, pp->binds[4].y, pp->binds[4].z, pp->binds[4].heading, 4
+ character_id, pp->binds[0].zoneId, 0, pp->binds[0].x, pp->binds[0].y, pp->binds[0].z, pp->binds[0].heading, 0,
+ character_id, pp->binds[1].zoneId, 0, pp->binds[1].x, pp->binds[1].y, pp->binds[1].z, pp->binds[1].heading, 1,
+ character_id, pp->binds[2].zoneId, 0, pp->binds[2].x, pp->binds[2].y, pp->binds[2].z, pp->binds[2].heading, 2,
+ character_id, pp->binds[3].zoneId, 0, pp->binds[3].x, pp->binds[3].y, pp->binds[3].z, pp->binds[3].heading, 3,
+ character_id, pp->binds[4].zoneId, 0, pp->binds[4].x, pp->binds[4].y, pp->binds[4].z, pp->binds[4].heading, 4
); results = QueryDatabase(query);
/* HoTT Ability */
@@ -870,40 +870,36 @@ void Database::GetCharName(uint32 char_id, char* name) {
}
}
-std::string Database::GetCharNameByID(uint32 char_id) {
+const char* Database::GetCharNameByID(uint32 char_id) {
std::string query = fmt::format("SELECT `name` FROM `character_data` WHERE id = {}", char_id);
auto results = QueryDatabase(query);
- std::string res;
if (!results.Success()) {
- return res;
+ return "";
}
if (results.RowCount() == 0) {
- return res;
+ return "";
}
auto row = results.begin();
- res = row[0];
- return res;
+ return row[0];
}
-std::string Database::GetNPCNameByID(uint32 npc_id) {
+const char* Database::GetNPCNameByID(uint32 npc_id) {
std::string query = fmt::format("SELECT `name` FROM `npc_types` WHERE id = {}", npc_id);
auto results = QueryDatabase(query);
- std::string res;
if (!results.Success()) {
- return res;
+ return "";
}
if (results.RowCount() == 0) {
- return res;
+ return "";
}
auto row = results.begin();
- res = row[0];
- return res;
+ return row[0];
}
bool Database::LoadVariables() {
@@ -975,24 +971,10 @@ bool Database::SetVariable(const std::string varname, const std::string &varvalu
}
// Get zone starting points from DB
-bool Database::GetSafePoints(const char* zone_short_name, uint32 instance_version, float* safe_x, float* safe_y, float* safe_z, float* safe_heading, int16* min_status, uint8* min_level, char *flag_needed) {
+bool Database::GetSafePoints(const char* short_name, uint32 version, float* safe_x, float* safe_y, float* safe_z, int16* minstatus, uint8* minlevel, char *flag_needed) {
- if (zone_short_name == nullptr)
- return false;
-
- std::string query = fmt::format(
- SQL(
- SELECT
- `safe_x`, `safe_y`, `safe_z`, `safe_heading`, `min_status`, `min_level`, `flag_needed`
- FROM
- zone
- WHERE
- `short_name` = '{}'
- AND
- (`version` = {} OR `version` = 0)
- ORDER BY `version` DESC
- ), zone_short_name, instance_version
- );
+ std::string query = StringFormat("SELECT safe_x, safe_y, safe_z, min_status, min_level, flag_needed FROM zone "
+ " WHERE short_name='%s' AND (version=%i OR version=0) ORDER BY version DESC", short_name, version);
auto results = QueryDatabase(query);
if (!results.Success())
@@ -1005,24 +987,16 @@ bool Database::GetSafePoints(const char* zone_short_name, uint32 instance_versio
if (safe_x != nullptr)
*safe_x = atof(row[0]);
-
if (safe_y != nullptr)
*safe_y = atof(row[1]);
-
if (safe_z != nullptr)
*safe_z = atof(row[2]);
-
- if (safe_heading != nullptr)
- *safe_heading = atof(row[3]);
-
- if (min_status != nullptr)
- *min_status = atoi(row[4]);
-
- if (min_level != nullptr)
- *min_level = atoi(row[5]);
-
+ if (minstatus != nullptr)
+ *minstatus = atoi(row[3]);
+ if (minlevel != nullptr)
+ *minlevel = atoi(row[4]);
if (flag_needed != nullptr)
- strcpy(flag_needed, row[6]);
+ strcpy(flag_needed, row[5]);
return true;
}
@@ -1382,20 +1356,6 @@ bool Database::SetMQDetectionFlag(const char* accountname, const char* character
return results.RowsAffected() != 0;
}
-bool Database::SetMQDetectionFlag(const char* accountname, const char* charactername, const std::string &hacked, const char* zone) {
- //Utilize the "hacker" table, but also give zone information.
- auto query = fmt::format("INSERT INTO hackers(account, name, hacked, zone) values('{}', '{}', '{}', '{}')",
- accountname, charactername, hacked, zone);
- auto results = QueryDatabase(query);
-
- if (!results.Success())
- {
- return false;
- }
-
- return results.RowsAffected() != 0;
-}
-
uint8 Database::GetRaceSkill(uint8 skillid, uint8 in_race)
{
uint16 race_cap = 0;
diff --git a/common/database.h b/common/database.h
index f6d93d5aa..74566f4fd 100644
--- a/common/database.h
+++ b/common/database.h
@@ -45,6 +45,24 @@ namespace EQ
class InventoryProfile;
}
+struct EventLogDetails_Struct {
+ uint32 id;
+ char accountname[64];
+ uint32 account_id;
+ int16 status;
+ char charactername[64];
+ char targetname[64];
+ char timestamp[64];
+ char descriptiontype[64];
+ char details[128];
+};
+
+struct CharacterEventLog_Struct {
+ uint32 count;
+ uint8 eventid;
+ EventLogDetails_Struct eld[255];
+};
+
struct npcDecayTimes_Struct {
uint16 minlvl;
uint16 maxlvl;
@@ -110,7 +128,6 @@ public:
bool SaveCharacterCreate(uint32 character_id, uint32 account_id, PlayerProfile_Struct *pp);
bool SetHackerFlag(const char *accountname, const char *charactername, const char *hacked);
bool SetMQDetectionFlag(const char *accountname, const char *charactername, const char *hacked, const char *zone);
- bool SetMQDetectionFlag(const char *accountname, const char *charactername, const std::string &hacked, const char *zone);
bool UpdateName(const char *oldname, const char *newname);
bool CopyCharacter(
std::string source_character_name,
@@ -138,8 +155,8 @@ public:
void GetAccountName(uint32 accountid, char* name, uint32* oLSAccountID = 0);
void GetCharName(uint32 char_id, char* name);
- std::string GetCharNameByID(uint32 char_id);
- std::string GetNPCNameByID(uint32 npc_id);
+ const char *GetCharNameByID(uint32 char_id);
+ const char *GetNPCNameByID(uint32 npc_id);
void LoginIP(uint32 AccountID, const char* LoginIP);
/* Instancing */
@@ -242,7 +259,7 @@ public:
/* General Queries */
- bool GetSafePoints(const char* zone_short_name, uint32 instance_version, float* safe_x = 0, float* safe_y = 0, float* safe_z = 0, float* safe_heading = 0, int16* minstatus = 0, uint8* minlevel = 0, char *flag_needed = nullptr);
+ bool GetSafePoints(const char* short_name, uint32 version, float* safe_x = 0, float* safe_y = 0, float* safe_z = 0, int16* minstatus = 0, uint8* minlevel = 0, char *flag_needed = nullptr);
bool GetZoneGraveyard(const uint32 graveyard_id, uint32* graveyard_zoneid = 0, float* graveyard_x = 0, float* graveyard_y = 0, float* graveyard_z = 0, float* graveyard_heading = 0);
bool GetZoneLongName(const char* short_name, char** long_name, char* file_name = 0, float* safe_x = 0, float* safe_y = 0, float* safe_z = 0, uint32* graveyard_id = 0, uint32* maxclients = 0);
bool LoadPTimers(uint32 charid, PTimerList &into);
diff --git a/common/database/database_dump_service.cpp b/common/database/database_dump_service.cpp
index 7efd80f83..df083901d 100644
--- a/common/database/database_dump_service.cpp
+++ b/common/database/database_dump_service.cpp
@@ -300,7 +300,8 @@ void DatabaseDumpService::Dump()
config->DatabaseUsername
);
- std::string options = "--allow-keywords --extended-insert --max-allowed-packet=1G --net-buffer-length=32704";
+ std::string options = "--allow-keywords --extended-insert";
+
if (IsDumpWithNoData()) {
options += " --no-data";
}
diff --git a/common/database_conversions.cpp b/common/database_conversions.cpp
index 561e1679b..d49651f4d 100644
--- a/common/database_conversions.cpp
+++ b/common/database_conversions.cpp
@@ -48,7 +48,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
namespace Convert {
struct BindStruct {
- /*000*/ uint32 zone_id;
+ /*000*/ uint32 zoneId;
/*004*/ float x;
/*008*/ float y;
/*012*/ float z;
@@ -1320,18 +1320,18 @@ bool Database::CheckDatabaseConvertPPDeblob(){
if (rquery != ""){ results = QueryDatabase(rquery); }
/* Run Bind Home Convert */
- if (pp->binds[4].zone_id < 999 && !_ISNAN_(pp->binds[4].x) && !_ISNAN_(pp->binds[4].y) && !_ISNAN_(pp->binds[4].z) && !_ISNAN_(pp->binds[4].heading)) {
+ if (pp->binds[4].zoneId < 999 && !_ISNAN_(pp->binds[4].x) && !_ISNAN_(pp->binds[4].y) && !_ISNAN_(pp->binds[4].z) && !_ISNAN_(pp->binds[4].heading)) {
rquery = StringFormat("REPLACE INTO `character_bind` (id, zone_id, instance_id, x, y, z, heading, is_home)"
" VALUES (%u, %u, %u, %f, %f, %f, %f, 1)",
- character_id, pp->binds[4].zone_id, 0, pp->binds[4].x, pp->binds[4].y, pp->binds[4].z, pp->binds[4].heading);
+ character_id, pp->binds[4].zoneId, 0, pp->binds[4].x, pp->binds[4].y, pp->binds[4].z, pp->binds[4].heading);
if (rquery != ""){ results = QueryDatabase(rquery); }
}
/* Run Bind Convert */
- if (pp->binds[0].zone_id < 999 && !_ISNAN_(pp->binds[0].x) && !_ISNAN_(pp->binds[0].y) && !_ISNAN_(pp->binds[0].z) && !_ISNAN_(pp->binds[0].heading)) {
+ if (pp->binds[0].zoneId < 999 && !_ISNAN_(pp->binds[0].x) && !_ISNAN_(pp->binds[0].y) && !_ISNAN_(pp->binds[0].z) && !_ISNAN_(pp->binds[0].heading)) {
rquery = StringFormat("REPLACE INTO `character_bind` (id, zone_id, instance_id, x, y, z, heading, is_home)"
" VALUES (%u, %u, %u, %f, %f, %f, %f, 0)",
- character_id, pp->binds[0].zone_id, 0, pp->binds[0].x, pp->binds[0].y, pp->binds[0].z, pp->binds[0].heading);
+ character_id, pp->binds[0].zoneId, 0, pp->binds[0].x, pp->binds[0].y, pp->binds[0].z, pp->binds[0].heading);
if (rquery != ""){ results = QueryDatabase(rquery); }
}
/* Run Language Convert */
diff --git a/common/database_instances.cpp b/common/database_instances.cpp
index 0c4be4bd6..372c6751f 100644
--- a/common/database_instances.cpp
+++ b/common/database_instances.cpp
@@ -493,9 +493,6 @@ void Database::DeleteInstance(uint16 instance_id)
query = StringFormat("DELETE FROM spawn_condition_values WHERE instance_id=%u", instance_id);
QueryDatabase(query);
- query = fmt::format("DELETE FROM dynamic_zones WHERE instance_id={}", instance_id);
- QueryDatabase(query);
-
BuryCorpsesInInstance(instance_id);
}
@@ -507,7 +504,7 @@ void Database::FlagInstanceByGroupLeader(uint32 zone, int16 version, uint32 char
char ln[128];
memset(ln, 0, 128);
- GetGroupLeadershipInfo(gid, ln);
+ strcpy(ln, GetGroupLeadershipInfo(gid, ln));
uint32 l_charid = GetCharacterID((const char*)ln);
uint16 l_id = GetInstanceID(zone, l_charid, version);
@@ -585,7 +582,8 @@ void Database::PurgeExpiredInstances()
QueryDatabase(fmt::format("DELETE FROM respawn_times WHERE instance_id IN ({})", imploded_instance_ids));
QueryDatabase(fmt::format("DELETE FROM spawn_condition_values WHERE instance_id IN ({})", imploded_instance_ids));
QueryDatabase(fmt::format("UPDATE character_corpses SET is_buried = 1, instance_id = 0 WHERE instance_id IN ({})", imploded_instance_ids));
- QueryDatabase(fmt::format("DELETE FROM dynamic_zones WHERE instance_id IN ({})", imploded_instance_ids));
+
+
}
void Database::SetInstanceDuration(uint16 instance_id, uint32 new_duration)
diff --git a/common/database_schema.h b/common/database_schema.h
index 8d8e81441..0b6536d96 100644
--- a/common/database_schema.h
+++ b/common/database_schema.h
@@ -50,8 +50,6 @@ namespace DatabaseSchema {
{"character_data", "id"},
{"character_disciplines", "id"},
{"character_enabledtasks", "charid"},
- {"character_expedition_lockouts", "character_id"},
- {"character_exp_modifiers", "character_id"},
{"character_inspect_messages", "id"},
{"character_item_recast", "id"},
{"character_languages", "id"},
@@ -116,8 +114,6 @@ namespace DatabaseSchema {
"character_data",
"character_disciplines",
"character_enabledtasks",
- "character_expedition_lockouts",
- "character_exp_modifiers",
"character_inspect_messages",
"character_item_recast",
"character_languages",
@@ -309,11 +305,7 @@ namespace DatabaseSchema {
"banned_ips",
"bug_reports",
"bugs",
- "dynamic_zones",
"eventlog",
- "expedition_lockouts",
- "expedition_members",
- "expeditions",
"gm_ips",
"group_id",
"group_leaders",
@@ -330,7 +322,7 @@ namespace DatabaseSchema {
"reports",
"respawn_times",
"saylink",
- "server_scheduled_events",
+
};
}
diff --git a/common/dbcore.cpp b/common/dbcore.cpp
index 7f1f52363..dae05b14b 100644
--- a/common/dbcore.cpp
+++ b/common/dbcore.cpp
@@ -223,10 +223,10 @@ bool DBcore::Open(
)
{
LockMutex lock(&MDatabase);
- safe_delete_array(pHost);
- safe_delete_array(pUser);
- safe_delete_array(pPassword);
- safe_delete_array(pDatabase);
+ safe_delete(pHost);
+ safe_delete(pUser);
+ safe_delete(pPassword);
+ safe_delete(pDatabase);
pHost = strcpy(new char[strlen(iHost) + 1], iHost);
pUser = strcpy(new char[strlen(iUser) + 1], iUser);
pPassword = strcpy(new char[strlen(iPassword) + 1], iPassword);
diff --git a/common/dynamic_zone_base.cpp b/common/dynamic_zone_base.cpp
deleted file mode 100644
index 8e29722d3..000000000
--- a/common/dynamic_zone_base.cpp
+++ /dev/null
@@ -1,289 +0,0 @@
-#include "dynamic_zone_base.h"
-#include "database.h"
-#include "eqemu_logsys.h"
-#include "repositories/instance_list_repository.h"
-#include "repositories/instance_list_player_repository.h"
-#include "servertalk.h"
-
-DynamicZoneBase::DynamicZoneBase(DynamicZonesRepository::DynamicZoneInstance&& entry)
-{
- LoadRepositoryResult(std::move(entry));
-}
-
-uint32_t DynamicZoneBase::Create()
-{
- if (m_id != 0)
- {
- return m_id;
- }
-
- if (GetInstanceID() == 0)
- {
- CreateInstance();
- }
-
- m_id = SaveToDatabase();
-
- return m_id;
-}
-
-uint32_t DynamicZoneBase::CreateInstance()
-{
- if (m_instance_id)
- {
- LogDynamicZones("CreateInstance failed, instance id [{}] already created", m_instance_id);
- return 0;
- }
-
- if (!m_zone_id)
- {
- LogDynamicZones("CreateInstance failed, invalid zone id [{}]", m_zone_id);
- return 0;
- }
-
- uint16_t unused_instance_id = 0;
- if (!GetDatabase().GetUnusedInstanceID(unused_instance_id)) // todo: doesn't this race with insert?
- {
- LogDynamicZones("Failed to find unused instance id");
- return 0;
- }
-
- m_start_time = std::chrono::system_clock::now();
- m_expire_time = m_start_time + m_duration;
-
- auto insert_instance = InstanceListRepository::NewEntity();
- insert_instance.id = unused_instance_id;
- insert_instance.zone = m_zone_id;
- insert_instance.version = m_zone_version;
- insert_instance.start_time = static_cast(std::chrono::system_clock::to_time_t(m_start_time));
- insert_instance.duration = static_cast(m_duration.count());
- insert_instance.never_expires = m_never_expires;
-
- auto instance = InstanceListRepository::InsertOne(GetDatabase(), insert_instance);
- if (instance.id == 0)
- {
- LogDynamicZones("Failed to create instance [{}] for zone [{}]", unused_instance_id, m_zone_id);
- return 0;
- }
-
- m_instance_id = instance.id;
-
- return m_instance_id;
-}
-
-void DynamicZoneBase::LoadRepositoryResult(DynamicZonesRepository::DynamicZoneInstance&& dz_entry)
-{
- m_id = dz_entry.id;
- m_instance_id = dz_entry.instance_id;
- m_type = static_cast(dz_entry.type);
- m_compass.zone_id = dz_entry.compass_zone_id;
- m_compass.x = dz_entry.compass_x;
- m_compass.y = dz_entry.compass_y;
- m_compass.z = dz_entry.compass_z;
- m_safereturn.zone_id = dz_entry.safe_return_zone_id;
- m_safereturn.x = dz_entry.safe_return_x;
- m_safereturn.y = dz_entry.safe_return_y;
- m_safereturn.z = dz_entry.safe_return_z;
- m_safereturn.heading = dz_entry.safe_return_heading;
- m_zonein.x = dz_entry.zone_in_x;
- m_zonein.y = dz_entry.zone_in_y;
- m_zonein.z = dz_entry.zone_in_z;
- m_zonein.heading = dz_entry.zone_in_heading;
- m_has_zonein = (dz_entry.has_zone_in != 0);
- // instance_list portion
- m_zone_id = dz_entry.zone;
- m_zone_version = dz_entry.version;
- m_start_time = std::chrono::system_clock::from_time_t(dz_entry.start_time);
- m_duration = std::chrono::seconds(dz_entry.duration);
- m_never_expires = (dz_entry.never_expires != 0);
- m_expire_time = m_start_time + m_duration;
-}
-
-uint32_t DynamicZoneBase::SaveToDatabase()
-{
- LogDynamicZonesDetail("Saving dz instance [{}] to database", m_instance_id);
-
- if (m_instance_id != 0)
- {
- auto insert_dz = DynamicZonesRepository::NewEntity();
- insert_dz.instance_id = m_instance_id,
- insert_dz.type = static_cast(m_type);
- insert_dz.compass_zone_id = m_compass.zone_id;
- insert_dz.compass_x = m_compass.x;
- insert_dz.compass_y = m_compass.y;
- insert_dz.compass_z = m_compass.z;
- insert_dz.safe_return_zone_id = m_safereturn.zone_id;
- insert_dz.safe_return_x = m_safereturn.x;
- insert_dz.safe_return_y = m_safereturn.y;
- insert_dz.safe_return_z = m_safereturn.z;
- insert_dz.safe_return_heading = m_safereturn.heading;
- insert_dz.zone_in_x = m_zonein.x;
- insert_dz.zone_in_y = m_zonein.y;
- insert_dz.zone_in_z = m_zonein.z;
- insert_dz.zone_in_heading = m_zonein.heading;
- insert_dz.has_zone_in = m_has_zonein;
-
- auto inserted_dz = DynamicZonesRepository::InsertOne(GetDatabase(), insert_dz);
- return inserted_dz.id;
- }
- return 0;
-}
-
-void DynamicZoneBase::AddCharacter(uint32_t character_id)
-{
- GetDatabase().AddClientToInstance(m_instance_id, character_id);
- SendInstanceAddRemoveCharacter(character_id, false); // stops client kick timer
-}
-
-void DynamicZoneBase::RemoveCharacter(uint32_t character_id)
-{
- GetDatabase().RemoveClientFromInstance(m_instance_id, character_id);
- SendInstanceAddRemoveCharacter(character_id, true); // start client kick timer
-}
-
-void DynamicZoneBase::RemoveAllCharacters(bool enable_removal_timers)
-{
- if (GetInstanceID() == 0)
- {
- return;
- }
-
- if (enable_removal_timers)
- {
- SendInstanceRemoveAllCharacters();
- }
-
- GetDatabase().RemoveClientsFromInstance(GetInstanceID());
-}
-
-void DynamicZoneBase::SaveInstanceMembersToDatabase(const std::vector& character_ids)
-{
- LogDynamicZonesDetail("Saving [{}] members for instance [{}]", character_ids.size(), m_instance_id);
-
- std::vector insert_players;
-
- for (const auto& character_id : character_ids)
- {
- InstanceListPlayerRepository::InstanceListPlayer entry{};
- entry.id = static_cast(m_instance_id);
- entry.charid = static_cast(character_id);
- insert_players.emplace_back(entry);
- }
-
- InstanceListPlayerRepository::InsertMany(GetDatabase(), insert_players);
-}
-
-void DynamicZoneBase::SetCompass(const DynamicZoneLocation& location, bool update_db)
-{
- ProcessCompassChange(location);
-
- if (update_db)
- {
- LogDynamicZonesDetail("Saving [{}] compass zone: [{}] xyz: ([{}], [{}], [{}])",
- m_id, m_compass.zone_id, m_compass.x, m_compass.y, m_compass.z);
-
- DynamicZonesRepository::UpdateCompass(GetDatabase(),
- m_id, m_compass.zone_id, m_compass.x, m_compass.y, m_compass.z);
-
- SendGlobalLocationChange(ServerOP_DzSetCompass, location);
- }
-}
-
-void DynamicZoneBase::SetCompass(uint32_t zone_id, float x, float y, float z, bool update_db)
-{
- SetCompass({ zone_id, x, y, z, 0.0f }, update_db);
-}
-
-void DynamicZoneBase::SetSafeReturn(const DynamicZoneLocation& location, bool update_db)
-{
- m_safereturn = location;
-
- if (update_db)
- {
- LogDynamicZonesDetail("Saving [{}] safereturn zone: [{}] xyzh: ([{}], [{}], [{}], [{}])",
- m_id, m_safereturn.zone_id, m_safereturn.x, m_safereturn.y, m_safereturn.z, m_safereturn.heading);
-
- DynamicZonesRepository::UpdateSafeReturn(GetDatabase(), m_id, m_safereturn.zone_id,
- m_safereturn.x, m_safereturn.y, m_safereturn.z, m_safereturn.heading);
-
- SendGlobalLocationChange(ServerOP_DzSetSafeReturn, location);
- }
-}
-
-void DynamicZoneBase::SetSafeReturn(uint32_t zone_id, float x, float y, float z, float heading, bool update_db)
-{
- SetSafeReturn({ zone_id, x, y, z, heading }, update_db);
-}
-
-void DynamicZoneBase::SetZoneInLocation(const DynamicZoneLocation& location, bool update_db)
-{
- m_zonein = location;
- m_has_zonein = true;
-
- if (update_db)
- {
- LogDynamicZonesDetail("Saving [{}] zonein zone: [{}] xyzh: ([{}], [{}], [{}], [{}])",
- m_id, m_zone_id, m_zonein.x, m_zonein.y, m_zonein.z, m_zonein.heading);
-
- DynamicZonesRepository::UpdateZoneIn(GetDatabase(), m_id, m_zone_id,
- m_zonein.x, m_zonein.y, m_zonein.z, m_zonein.heading, m_has_zonein);
-
- SendGlobalLocationChange(ServerOP_DzSetZoneIn, location);
- }
-}
-
-void DynamicZoneBase::SetZoneInLocation(float x, float y, float z, float heading, bool update_db)
-{
- SetZoneInLocation({ 0, x, y, z, heading }, update_db);
-}
-
-uint32_t DynamicZoneBase::GetSecondsRemaining() const
-{
- auto remaining = std::chrono::duration_cast(GetDurationRemaining()).count();
- return std::max(0, static_cast(remaining));
-}
-
-std::unique_ptr DynamicZoneBase::CreateServerAddRemoveCharacterPacket(
- uint32_t character_id, bool removed)
-{
- constexpr uint32_t pack_size = sizeof(ServerDzCharacter_Struct);
- auto pack = std::make_unique(ServerOP_DzAddRemoveCharacter, pack_size);
- auto buf = reinterpret_cast(pack->pBuffer);
- buf->zone_id = GetZoneID();
- buf->instance_id = GetInstanceID();
- buf->remove = removed;
- buf->character_id = character_id;
-
- return pack;
-}
-
-std::unique_ptr DynamicZoneBase::CreateServerRemoveAllCharactersPacket()
-{
- constexpr uint32_t pack_size = sizeof(ServerDzCharacter_Struct);
- auto pack = std::make_unique(ServerOP_DzRemoveAllCharacters, pack_size);
- auto buf = reinterpret_cast(pack->pBuffer);
- buf->zone_id = GetZoneID();
- buf->instance_id = GetInstanceID();
- buf->remove = true;
- buf->character_id = 0;
-
- return pack;
-}
-
-std::unique_ptr DynamicZoneBase::CreateServerDzLocationPacket(
- uint16_t server_opcode, const DynamicZoneLocation& location)
-{
- constexpr uint32_t pack_size = sizeof(ServerDzLocation_Struct);
- auto pack = std::make_unique(server_opcode, pack_size);
- auto buf = reinterpret_cast(pack->pBuffer);
- buf->dz_id = GetID();
- buf->sender_zone_id = GetCurrentZoneID();
- buf->sender_instance_id = GetCurrentInstanceID();
- buf->zone_id = location.zone_id;
- buf->x = location.x;
- buf->y = location.y;
- buf->z = location.z;
- buf->heading = location.heading;
-
- return pack;
-}
diff --git a/common/dynamic_zone_base.h b/common/dynamic_zone_base.h
deleted file mode 100644
index 5a84fa8fa..000000000
--- a/common/dynamic_zone_base.h
+++ /dev/null
@@ -1,135 +0,0 @@
-#ifndef COMMON_DYNAMIC_ZONE_BASE_H
-#define COMMON_DYNAMIC_ZONE_BASE_H
-
-#include "eq_constants.h"
-#include "repositories/dynamic_zones_repository.h"
-#include
-#include
-#include
-#include
-#include
-#include
-
-class Database;
-class ServerPacket;
-
-struct DynamicZoneMember
-{
- uint32_t id = 0;
- std::string name;
- DynamicZoneMemberStatus status = DynamicZoneMemberStatus::Online;
-
- DynamicZoneMember() = default;
- DynamicZoneMember(uint32_t id, std::string name_)
- : id(id), name{std::move(name_)} {}
- DynamicZoneMember(uint32_t id, std::string name_, DynamicZoneMemberStatus status_)
- : id(id), name{std::move(name_)}, status(status_) {}
-
- bool IsOnline() const { return status == DynamicZoneMemberStatus::Online ||
- status == DynamicZoneMemberStatus::InDynamicZone; }
- bool IsValid() const { return id != 0 && !name.empty(); }
-};
-
-struct DynamicZoneLocation
-{
- uint32_t zone_id = 0;
- float x = 0.0f;
- float y = 0.0f;
- float z = 0.0f;
- float heading = 0.0f;
-
- DynamicZoneLocation() = default;
- DynamicZoneLocation(uint32_t zone_id_, float x_, float y_, float z_, float heading_)
- : zone_id(zone_id_), x(x_), y(y_), z(z_), heading(heading_) {}
-};
-
-class DynamicZoneBase
-{
-public:
- virtual ~DynamicZoneBase() = default;
- DynamicZoneBase(const DynamicZoneBase&) = default;
- DynamicZoneBase(DynamicZoneBase&&) = default;
- DynamicZoneBase& operator=(const DynamicZoneBase&) = default;
- DynamicZoneBase& operator=(DynamicZoneBase&&) = default;
- DynamicZoneBase() = default;
- DynamicZoneBase(uint32_t dz_id) : m_id(dz_id) {}
- DynamicZoneBase(DynamicZoneType type) : m_type(type) {}
- DynamicZoneBase(DynamicZonesRepository::DynamicZoneInstance&& entry);
-
- virtual void SetSecondsRemaining(uint32_t seconds_remaining) = 0;
-
- uint64_t GetExpireTime() const { return std::chrono::system_clock::to_time_t(m_expire_time); }
- uint32_t GetID() const { return m_id; }
- uint16_t GetInstanceID() const { return static_cast(m_instance_id); }
- uint32_t GetMaxPlayers() const { return m_max_players; }
- uint32_t GetMinPlayers() const { return m_min_players; }
- uint32_t GetSecondsRemaining() const;
- uint16_t GetZoneID() const { return static_cast(m_zone_id); }
- uint32_t GetZoneIndex() const { return (m_instance_id << 16) | (m_zone_id & 0xffff); }
- uint32_t GetZoneVersion() const { return m_zone_version; }
- DynamicZoneType GetType() const { return m_type; }
- const std::string& GetLeaderName() const { return m_leader_name; }
- const std::string& GetName() const { return m_name; }
- const DynamicZoneLocation& GetCompassLocation() const { return m_compass; }
- const DynamicZoneLocation& GetSafeReturnLocation() const { return m_safereturn; }
- const DynamicZoneLocation& GetZoneInLocation() const { return m_zonein; }
- std::chrono::system_clock::duration GetDurationRemaining() const { return m_expire_time - std::chrono::system_clock::now(); }
-
- void AddCharacter(uint32_t character_id);
- uint32_t Create();
- bool HasZoneInLocation() const { return m_has_zonein; }
- bool IsExpired() const { return m_expire_time < std::chrono::system_clock::now(); }
- bool IsInstanceID(uint32_t instance_id) const { return (m_instance_id != 0 && m_instance_id == instance_id); }
- bool IsValid() const { return m_instance_id != 0; }
- bool IsSameDz(uint32_t zone_id, uint32_t instance_id) const { return zone_id == m_zone_id && instance_id == m_instance_id; }
- void RemoveAllCharacters(bool enable_removal_timers = true);
- void RemoveCharacter(uint32_t character_id);
- void SaveInstanceMembersToDatabase(const std::vector& character_ids);
- void SetCompass(const DynamicZoneLocation& location, bool update_db = false);
- void SetCompass(uint32_t zone_id, float x, float y, float z, bool update_db = false);
- void SetLeaderName(const std::string& leader_name) { m_leader_name = leader_name; }
- void SetMaxPlayers(uint32_t max_players) { m_max_players = max_players; }
- void SetMinPlayers(uint32_t min_players) { m_min_players = min_players; }
- void SetName(const std::string& name) { m_name = name; }
- void SetSafeReturn(const DynamicZoneLocation& location, bool update_db = false);
- void SetSafeReturn(uint32_t zone_id, float x, float y, float z, float heading, bool update_db = false);
- void SetZoneInLocation(const DynamicZoneLocation& location, bool update_db = false);
- void SetZoneInLocation(float x, float y, float z, float heading, bool update_db = false);
-
-protected:
- virtual uint16_t GetCurrentInstanceID() { return 0; }
- virtual uint16_t GetCurrentZoneID() { return 0; }
- virtual Database& GetDatabase() = 0;
- virtual void ProcessCompassChange(const DynamicZoneLocation& location) { m_compass = location; }
- virtual void SendInstanceAddRemoveCharacter(uint32_t character_id, bool remove) = 0;
- virtual void SendInstanceRemoveAllCharacters() = 0;
- virtual void SendGlobalLocationChange(uint16_t server_opcode, const DynamicZoneLocation& location) = 0;
-
- uint32_t CreateInstance();
- void LoadRepositoryResult(DynamicZonesRepository::DynamicZoneInstance&& dz_entry);
- uint32_t SaveToDatabase();
-
- std::unique_ptr CreateServerAddRemoveCharacterPacket(uint32_t character_id, bool removed);
- std::unique_ptr CreateServerRemoveAllCharactersPacket();
- std::unique_ptr CreateServerDzLocationPacket(uint16_t server_opcode, const DynamicZoneLocation& location);
-
- uint32_t m_id = 0;
- uint32_t m_zone_id = 0;
- uint32_t m_instance_id = 0;
- uint32_t m_zone_version = 0;
- uint32_t m_min_players = 0;
- uint32_t m_max_players = 0;
- bool m_never_expires = false;
- bool m_has_zonein = false;
- std::string m_name;
- std::string m_leader_name;
- DynamicZoneType m_type{ DynamicZoneType::None };
- DynamicZoneLocation m_compass;
- DynamicZoneLocation m_safereturn;
- DynamicZoneLocation m_zonein;
- std::chrono::seconds m_duration;
- std::chrono::time_point m_start_time;
- std::chrono::time_point m_expire_time;
-};
-
-#endif
diff --git a/common/emu_oplist.h b/common/emu_oplist.h
index 46fd564e6..5078cca68 100644
--- a/common/emu_oplist.h
+++ b/common/emu_oplist.h
@@ -136,22 +136,20 @@ N(OP_Dye),
N(OP_DynamicWall),
N(OP_DzAddPlayer),
N(OP_DzChooseZone),
-N(OP_DzChooseZoneReply),
N(OP_DzCompass),
N(OP_DzExpeditionEndsWarning),
N(OP_DzExpeditionInfo),
-N(OP_DzExpeditionInvite),
-N(OP_DzExpeditionInviteResponse),
-N(OP_DzExpeditionLockoutTimers),
+N(OP_DzExpeditionList),
+N(OP_DzJoinExpeditionConfirm),
+N(OP_DzJoinExpeditionReply),
+N(OP_DzLeaderStatus),
N(OP_DzListTimers),
N(OP_DzMakeLeader),
N(OP_DzMemberList),
-N(OP_DzMemberListName),
-N(OP_DzMemberListStatus),
+N(OP_DzMemberStatus),
N(OP_DzPlayerList),
N(OP_DzQuit),
N(OP_DzRemovePlayer),
-N(OP_DzSetLeaderName),
N(OP_DzSwapPlayer),
N(OP_Emote),
N(OP_EndLootRequest),
@@ -273,7 +271,6 @@ N(OP_ItemVerifyRequest),
N(OP_ItemViewUnknown),
N(OP_Jump),
N(OP_KeyRing),
-N(OP_KickPlayers),
N(OP_KnowledgeBase),
N(OP_LDoNButton),
N(OP_LDoNDisarmTraps),
diff --git a/common/eq_constants.h b/common/eq_constants.h
index a585bdd87..1a0c517bd 100644
--- a/common/eq_constants.h
+++ b/common/eq_constants.h
@@ -464,23 +464,4 @@ namespace ZoneBlockedSpellTypes {
const uint8 Region = 2;
};
-enum class DynamicZoneType
-{
- None = 0,
- Expedition,
- Tutorial,
- Task,
- Mission, // Shared Task
- Quest
-};
-
-enum class DynamicZoneMemberStatus : uint8_t
-{
- Unknown = 0,
- Online,
- Offline,
- InDynamicZone,
- LinkDead
-};
-
#endif /*COMMON_EQ_CONSTANTS_H*/
diff --git a/common/eq_limits.cpp b/common/eq_limits.cpp
index 188c8f888..72c82f450 100644
--- a/common/eq_limits.cpp
+++ b/common/eq_limits.cpp
@@ -794,7 +794,7 @@ void EQ::inventory::InitializeDynamicLookups() {
continue;
// direct manipulation of lookup indices is safe so long as (int)ClientVersion:: == (int)MobVersion::
- inventory_dynamic_nongm_lookup_entries[iter] = std::make_unique(inventory_static_lookup_entries[iter]);
+ inventory_dynamic_nongm_lookup_entries[iter] = std::unique_ptr(new LookupEntry(inventory_static_lookup_entries[iter]));
// clamp affected fields to the lowest standard
inventory_dynamic_nongm_lookup_entries[iter]->InventoryTypeSize.Bank = Titanium::invtype::BANK_SIZE; // bank size
@@ -864,7 +864,7 @@ void EQ::inventory::InitializeDynamicLookups() {
}
// direct manipulation of lookup indices is safe so long as (int)ClientVersion:: == (int)MobVersion::
- inventory_dynamic_gm_lookup_entries[iter] = std::make_unique(inventory_static_lookup_entries[iter]);
+ inventory_dynamic_gm_lookup_entries[iter] = std::unique_ptr(new LookupEntry(inventory_static_lookup_entries[iter]));
inventory_dynamic_gm_lookup_entries[iter]->PossessionsBitmask = 0; // we'll fix later
inventory_dynamic_gm_lookup_entries[iter]->CorpseBitmask = 0; // we'll fix later
diff --git a/common/eq_packet_structs.h b/common/eq_packet_structs.h
index f5d47546e..d6e8b0c97 100644
--- a/common/eq_packet_structs.h
+++ b/common/eq_packet_structs.h
@@ -375,16 +375,13 @@ struct NewZone_Struct {
/*0686*/ uint16 zone_instance;
/*0688*/ uint32 unknown688;
/*0692*/ uint8 unknown692[8];
-// Titanium doesn't have a translator, but we can still safely add stuff under here without issues since client memcpy's only what it knows
-// Just wastes some bandwidth sending to tit clients /shrug
/*0700*/ float fog_density;
/*0704*/ uint32 SuspendBuffs;
/*0708*/ uint32 FastRegenHP;
/*0712*/ uint32 FastRegenMana;
/*0716*/ uint32 FastRegenEndurance;
/*0720*/ uint32 NPCAggroMaxDist;
-/*0724*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, if this value is 0, it prevents you from running off edges that would end up underworld
-/*0728*/
+/*0724*/
};
/*
@@ -829,7 +826,7 @@ struct LeadershipAA_Struct {
* Size: 20 Octets
*/
struct BindStruct {
- /*000*/ uint32 zone_id;
+ /*000*/ uint32 zoneId;
/*004*/ float x;
/*008*/ float y;
/*012*/ float z;
@@ -1772,7 +1769,7 @@ struct GMZoneRequest_Struct {
/*0068*/ float x;
/*0072*/ float y;
/*0076*/ float z;
-/*0080*/ float heading;
+/*0080*/ char unknown0080[4];
/*0084*/ uint32 success; // 0 if command failed, 1 if succeeded?
/*0088*/
// /*072*/ int8 success; // =0 client->server, =1 server->client, -X=specific error
@@ -3247,7 +3244,7 @@ struct TraderClick_Struct{
};
struct FormattedMessage_Struct{
- uint32 unknown0; // 1 means from world server
+ uint32 unknown0;
uint32 string_id;
uint32 type;
char message[0];
@@ -3255,7 +3252,7 @@ struct FormattedMessage_Struct{
struct SimpleMessage_Struct{
uint32 string_id;
uint32 color;
- uint32 unknown8; // 1 means from world server
+ uint32 unknown8;
};
struct GuildMemberUpdate_Struct {
@@ -4835,99 +4832,17 @@ struct BuffIcon_Struct
BuffIconEntry_Struct entries[0];
};
-struct ExpeditionInvite_Struct
+struct ExpeditionInfo_Struct
{
-/*000*/ uint32 client_id; // unique character id
-/*004*/ uint32 unknown004; // added after titanium
-/*008*/ char inviter_name[64];
-/*072*/ char expedition_name[128];
-/*200*/ uint8 swapping; // 0: adding 1: swapping
-/*201*/ char swap_name[64]; // if swapping, swap name being removed
-/*265*/ uint8 padding[3];
-/*268*/ uint16 dz_zone_id; // dz_id zone/instance pair, sent back in reply
-/*270*/ uint16 dz_instance_id;
+/*000*/ uint32 max_players;
+/*004*/ char expedition_name[128];
+/*132*/ char leader_name[64];
};
-struct ExpeditionInviteResponse_Struct
+struct ExpeditionJoinPrompt_Struct
{
-/*000*/ uint32 unknown000;
-/*004*/ uint32 unknown004; // added after titanium
-/*008*/ uint16 dz_zone_id; // dz_id pair sent in invite
-/*010*/ uint16 dz_instance_id;
-/*012*/ uint8 accepted; // 0: declined 1: accepted
-/*013*/ uint8 swapping; // 0: adding 1: swapping (sent in invite)
-/*014*/ char swap_name[64]; // swap name sent in invite
-/*078*/ uint8 unknown078; // padding garbage?
-/*079*/ uint8 unknown079; // padding garbage?
-};
-
-struct DynamicZoneInfo_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 unknown004; // added after titanium
-/*008*/ uint32 assigned; // padded bool, 0: clear info, 1: fill window info
-/*012*/ uint32 max_players;
-/*016*/ char dz_name[128];
-/*144*/ char leader_name[64];
-//*208*/ uint32 dz_type; // only in newer clients, if not 1 (expedition type) window does not auto show when dz info assigned
-};
-
-struct DynamicZoneMemberEntry_Struct
-{
-/*000*/ char name[64]; // variable length, null terminated, max 0x40 (64)
-/*064*/ uint8 online_status; // 0: unknown, 1: Online, 2: Offline, 3: In Dynamic Zone, 4: Link Dead
-};
-
-struct DynamicZoneMemberList_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 member_count;
-/*008*/ DynamicZoneMemberEntry_Struct members[0]; // variable length
-};
-
-struct DynamicZoneMemberListName_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 unknown004;
-/*008*/ uint32 add_name; // padded bool, 0: remove name, 1: add name with unknown status
-/*012*/ char name[64];
-};
-
-struct ExpeditionLockoutTimerEntry_Struct
-{
-/*000*/ char expedition_name[128]; // variable length, null terminated, max 0x80 (128)
-/*000*/ uint32 seconds_remaining;
-/*000*/ int32 event_type; // seen -1 (0xffffffff) for replay timers and 1 for event timers
-/*000*/ char event_name[256]; // variable length, null terminated, max 0x100 (256)
-};
-
-struct ExpeditionLockoutTimers_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 count;
-/*008*/ ExpeditionLockoutTimerEntry_Struct timers[0];
-};
-
-struct DynamicZoneLeaderName_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 unknown004;
-/*008*/ char leader_name[64];
-};
-
-struct ExpeditionCommand_Struct
-{
-/*000*/ uint32 unknown000;
-/*004*/ uint32 unknown004;
-/*008*/ char name[64];
-};
-
-struct ExpeditionCommandSwap_Struct
-{
-/*000*/ uint32 unknown000;
-/*004*/ uint32 unknown004;
-/*008*/ char add_player_name[64]; // swap to (player must confirm)
-/*072*/ char rem_player_name[64]; // swap from
+/*000*/ char player_name[64];
+/*064*/ char expedition_name[64];
};
struct ExpeditionExpireWarning
@@ -4935,67 +4850,48 @@ struct ExpeditionExpireWarning
/*008*/ uint32 minutes_remaining;
};
-struct DynamicZoneCompassEntry_Struct
+struct ExpeditionCompassEntry_Struct
{
-/*000*/ uint16 dz_zone_id; // target dz id pair
-/*002*/ uint16 dz_instance_id;
-/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
-/*008*/ uint32 unknown008;
-/*012*/ float y;
-/*016*/ float x;
-/*020*/ float z;
+/*000*/ uint32 enabled; //guess
+/*004*/ float y;
+/*008*/ float x;
+/*012*/ float z;
};
-struct DynamicZoneCompass_Struct
+struct ExpeditionCompass_Struct
{
-/*000*/ uint32 client_id;
/*000*/ uint32 count;
-/*004*/ DynamicZoneCompassEntry_Struct entries[0];
+/*004*/ ExpeditionCompassEntry_Struct entries[0];
};
-struct DynamicZoneChooseZoneEntry_Struct
+struct ExpeditionMemberEntry_Struct
{
-/*000*/ uint16 dz_zone_id; // dz_id pair
-/*002*/ uint16 dz_instance_id;
-/*004*/ uint32 unknown_id1; // seen 28 00 00 00 (40), sent back in reply
-/*008*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest -- sent back in reply
-/*012*/ uint32 unknown_id2; // possibly an id based on dz type, for expeditions this was same as dz_id (zone|instance) but task dz was different
-/*016*/ char description[128]; // variable length, null terminated
-/*144*/ char leader_name[64]; // variable length, null terminated
+ char name[64];
+ char status;
};
-struct DynamicZoneChooseZone_Struct
+struct ExpeditionMemberList_Struct
{
-/*000*/ uint32 client_id;
-/*004*/ uint32 count;
-/*008*/ DynamicZoneChooseZoneEntry_Struct choices[0];
+/*000*/ uint32 count;
+/*004*/ ExpeditionMemberEntry_Struct entries[0];
};
-struct DynamicZoneChooseZoneReply_Struct
+struct ExpeditionLockoutEntry_Struct
{
-/*000*/ uint32 unknown000; // ff ff ff ff
-/*004*/ uint32 unknown004; // seen 69 00 00 00
-/*008*/ uint32 unknown008; // ff ff ff ff
-/*012*/ uint32 unknown_id1; // from choose zone entry message
-/*016*/ uint16 dz_zone_id; // dz_id pair
-/*018*/ uint16 dz_instance_id;
-/*020*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest
-/*024*/ uint32 unknown_id2; // from choose zone entry message
-/*028*/ uint32 unknown028; // 00 00 00 00
-/*032*/ uint32 unknown032; // always same as unknown044
-/*036*/ uint32 unknown036;
-/*040*/ uint32 unknown040;
-/*044*/ uint32 unknown044; // always same as unknown032
-/*048*/ uint32 unknown048; // seen 01 00 00 00 and 02 00 00 00
+/*000*/ uint32 time_left;
+/*004*/ char expedition[128];
+/*132*/ char expedition_event[128];
};
-struct KickPlayers_Struct
+struct ExpeditionLockoutList_Struct
{
-/*000*/ char char_name[64];
-/*064*/ uint32 unknown064; // always 0
-/*068*/ uint8 kick_expedition; // true if /kickplayers exp
-/*069*/ uint8 kick_task; // true if /kickplayers task
-/*070*/ uint8 padding[2];
+/*000*/ uint32 count;
+/*004*/ ExpeditionLockoutEntry_Struct entries[0];
+};
+
+struct ExpeditionLeaderSet_Struct
+{
+/*000*/ char leader_name[64];
};
struct CorpseDrag_Struct
diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp
index ad43ee61d..368d8fbec 100644
--- a/common/eqemu_logsys.cpp
+++ b/common/eqemu_logsys.cpp
@@ -127,7 +127,6 @@ void EQEmuLogSys::LoadLogSettingsDefaults()
log_settings[Logs::HotReload].log_to_gmsay = static_cast(Logs::General);
log_settings[Logs::HotReload].log_to_console = static_cast(Logs::General);
log_settings[Logs::Loot].log_to_gmsay = static_cast(Logs::General);
- log_settings[Logs::Scheduler].log_to_console = static_cast(Logs::General);
/**
* RFC 5424
@@ -207,7 +206,11 @@ std::string EQEmuLogSys::FormatOutMessageString(
const std::string &in_message
)
{
- std::string return_string = "[" + GetPlatformName() + "] ";
+ std::string return_string;
+
+ if (IsRfc5424LogCategory(log_category)) {
+ return_string = "[" + GetPlatformName() + "] ";
+ }
return return_string + "[" + Logs::LogCategoryName[log_category] + "] " + in_message;
}
diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h
index 0b33b55a3..80cf9851f 100644
--- a/common/eqemu_logsys.h
+++ b/common/eqemu_logsys.h
@@ -118,9 +118,6 @@ namespace Logs {
Merchants,
ZonePoints,
Loot,
- Expeditions,
- DynamicZones,
- Scheduler,
MaxCategoryID /* Don't Remove this */
};
@@ -197,10 +194,7 @@ namespace Logs {
"HotReload",
"Merchants",
"ZonePoints",
- "Loot",
- "Expeditions",
- "DynamicZones",
- "Scheduler",
+ "Loot"
};
}
diff --git a/common/eqemu_logsys_log_aliases.h b/common/eqemu_logsys_log_aliases.h
index ddd27335f..514f37e21 100644
--- a/common/eqemu_logsys_log_aliases.h
+++ b/common/eqemu_logsys_log_aliases.h
@@ -161,16 +161,6 @@
OutF(LogSys, Logs::Detail, Logs::Doors, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
-#define LogGroup(message, ...) do {\
- if (LogSys.log_settings[Logs::Group].is_category_enabled == 1)\
- OutF(LogSys, Logs::General, Logs::Group, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
-} while (0)
-
-#define LogGroupDetail(message, ...) do {\
- if (LogSys.log_settings[Logs::Group].is_category_enabled == 1)\
- OutF(LogSys, Logs::Detail, Logs::Group, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
-} while (0)
-
#define LogGuilds(message, ...) do {\
if (LogSys.log_settings[Logs::Guilds].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Guilds, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
@@ -611,41 +601,6 @@
OutF(LogSys, Logs::Detail, Logs::Loot, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
-#define LogExpeditions(message, ...) do {\
- if (LogSys.log_settings[Logs::Expeditions].is_category_enabled == 1)\
- OutF(LogSys, Logs::General, Logs::Expeditions, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
-} while (0)
-
-#define LogExpeditionsModerate(message, ...) do {\
- if (LogSys.log_settings[Logs::Expeditions].is_category_enabled == 1)\
- OutF(LogSys, Logs::Moderate, Logs::Expeditions, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
-} while (0)
-
-#define LogExpeditionsDetail(message, ...) do {\
- if (LogSys.log_settings[Logs::Expeditions].is_category_enabled == 1)\
- OutF(LogSys, Logs::Detail, Logs::Expeditions, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
-} while (0)
-
-#define LogDynamicZones(message, ...) do {\
- if (LogSys.log_settings[Logs::DynamicZones].is_category_enabled == 1)\
- OutF(LogSys, Logs::General, Logs::DynamicZones, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
-} while (0)
-
-#define LogDynamicZonesDetail(message, ...) do {\
- if (LogSys.log_settings[Logs::DynamicZones].is_category_enabled == 1)\
- OutF(LogSys, Logs::Detail, Logs::DynamicZones, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
-} while (0)
-
-#define LogScheduler(message, ...) do {\
- if (LogSys.log_settings[Logs::Scheduler].is_category_enabled == 1)\
- OutF(LogSys, Logs::General, Logs::Scheduler, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
-} while (0)
-
-#define LogSchedulerDetail(message, ...) do {\
- if (LogSys.log_settings[Logs::Scheduler].is_category_enabled == 1)\
- OutF(LogSys, Logs::Detail, Logs::Scheduler, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
-} while (0)
-
#define Log(debug_level, log_category, message, ...) do {\
if (LogSys.log_settings[log_category].is_category_enabled == 1)\
LogSys.Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
@@ -739,12 +694,6 @@
#define LogDoorsDetail(message, ...) do {\
} while (0)
-#define LogGroup(message, ...) do {\
-} while (0)
-
-#define LogGroupDetail(message, ...) do {\
-} while (0)
-
#define LogGuilds(message, ...) do {\
} while (0)
@@ -1003,21 +952,6 @@
#define LogZonePointsDetail(message, ...) do {\
} while (0)
-#define LogExpeditions(message, ...) do {\
-} while (0)
-
-#define LogExpeditionsModerate(message, ...) do {\
-} while (0)
-
-#define LogExpeditionsDetail(message, ...) do {\
-} while (0)
-
-#define LogDynamicZones(message, ...) do {\
-} while (0)
-
-#define LogDynamicZonesDetail(message, ...) do {\
-} while (0)
-
#define Log(debug_level, log_category, message, ...) do {\
} while (0)
diff --git a/common/event/timer.h b/common/event/timer.h
index 73ac7af35..e71459630 100644
--- a/common/event/timer.h
+++ b/common/event/timer.h
@@ -51,7 +51,7 @@ namespace EQ {
void Stop() {
if (m_timer) {
uv_close((uv_handle_t*)m_timer, [](uv_handle_t* handle) {
- delete (uv_timer_t *)handle;
+ delete handle;
});
m_timer = nullptr;
}
diff --git a/common/expedition_base.cpp b/common/expedition_base.cpp
deleted file mode 100644
index a5f890204..000000000
--- a/common/expedition_base.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-#include "expedition_base.h"
-#include "repositories/expeditions_repository.h"
-#include "rulesys.h"
-
-ExpeditionBase::ExpeditionBase(uint32_t id, const std::string& uuid,
- const std::string& expedition_name, const DynamicZoneMember& leader
-) :
- m_id(id),
- m_uuid(uuid),
- m_expedition_name(expedition_name),
- m_leader(leader)
-{
-}
-
-void ExpeditionBase::LoadRepositoryResult(ExpeditionsRepository::ExpeditionWithLeader&& entry)
-{
- m_id = entry.id;
- m_uuid = std::move(entry.uuid);
- m_expedition_name = std::move(entry.expedition_name);
- m_add_replay_on_join = entry.add_replay_on_join;
- m_is_locked = entry.is_locked;
- m_leader.id = entry.leader_id;
- m_leader.name = std::move(entry.leader_name);
-}
-
-void ExpeditionBase::AddMemberFromRepositoryResult(
- ExpeditionMembersRepository::MemberWithName&& entry)
-{
- auto status = DynamicZoneMemberStatus::Unknown;
- AddInternalMember({ entry.character_id, std::move(entry.character_name), status });
-}
-
-void ExpeditionBase::AddInternalMember(const DynamicZoneMember& member)
-{
- if (!HasMember(member.id))
- {
- m_members.emplace_back(member);
- }
-}
-
-void ExpeditionBase::RemoveInternalMember(uint32_t character_id)
-{
- m_members.erase(std::remove_if(m_members.begin(), m_members.end(),
- [&](const DynamicZoneMember& member) { return member.id == character_id; }
- ), m_members.end());
-}
-
-
-bool ExpeditionBase::HasMember(uint32_t character_id)
-{
- return std::any_of(m_members.begin(), m_members.end(), [&](const DynamicZoneMember& member) {
- return member.id == character_id;
- });
-}
-
-bool ExpeditionBase::HasMember(const std::string& character_name)
-{
- return std::any_of(m_members.begin(), m_members.end(), [&](const DynamicZoneMember& member) {
- return (strcasecmp(member.name.c_str(), character_name.c_str()) == 0);
- });
-}
-
-DynamicZoneMember ExpeditionBase::GetMemberData(uint32_t character_id)
-{
- auto it = std::find_if(m_members.begin(), m_members.end(), [&](const DynamicZoneMember& member) {
- return member.id == character_id;
- });
-
- DynamicZoneMember member_data;
- if (it != m_members.end())
- {
- member_data = *it;
- }
- return member_data;
-}
-
-DynamicZoneMember ExpeditionBase::GetMemberData(const std::string& character_name)
-{
- auto it = std::find_if(m_members.begin(), m_members.end(), [&](const DynamicZoneMember& member) {
- return (strcasecmp(member.name.c_str(), character_name.c_str()) == 0);
- });
-
- DynamicZoneMember member_data;
- if (it != m_members.end())
- {
- member_data = *it;
- }
- return member_data;
-}
-
-bool ExpeditionBase::SetInternalMemberStatus(uint32_t character_id, DynamicZoneMemberStatus status)
-{
- if (status == DynamicZoneMemberStatus::InDynamicZone && !RuleB(Expedition, EnableInDynamicZoneStatus))
- {
- status = DynamicZoneMemberStatus::Online;
- }
-
- if (character_id == m_leader.id)
- {
- m_leader.status = status;
- }
-
- auto it = std::find_if(m_members.begin(), m_members.end(),
- [&](const DynamicZoneMember& member) { return member.id == character_id; });
-
- if (it != m_members.end() && it->status != status)
- {
- it->status = status;
- return true;
- }
-
- return false;
-}
diff --git a/common/expedition_base.h b/common/expedition_base.h
deleted file mode 100644
index e93c707b5..000000000
--- a/common/expedition_base.h
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef COMMON_EXPEDITION_BASE_H
-#define COMMON_EXPEDITION_BASE_H
-
-#include "dynamic_zone_base.h"
-#include "repositories/expeditions_repository.h"
-#include "repositories/expedition_members_repository.h"
-#include
-#include
-#include
-
-class ExpeditionBase
-{
-public:
- virtual ~ExpeditionBase() = default;
- ExpeditionBase(const ExpeditionBase&) = default;
- ExpeditionBase(ExpeditionBase&&) = default;
- ExpeditionBase& operator=(const ExpeditionBase&) = default;
- ExpeditionBase& operator=(ExpeditionBase&&) = default;
-
- uint32_t GetID() const { return m_id; }
- uint32_t GetLeaderID() const { return m_leader.id; }
- uint32_t GetMemberCount() const { return static_cast(m_members.size()); }
- const std::string& GetName() const { return m_expedition_name; }
- const std::string& GetLeaderName() const { return m_leader.name; }
- const std::string& GetUUID() const { return m_uuid; }
- const std::vector& GetMembers() const { return m_members; }
-
- void AddInternalMember(const DynamicZoneMember& member);
- void ClearInternalMembers() { m_members.clear(); }
- bool HasMember(const std::string& character_name);
- bool HasMember(uint32_t character_id);
- bool IsEmpty() const { return m_members.empty(); }
- void RemoveInternalMember(uint32_t character_id);
- bool SetInternalMemberStatus(uint32_t character_id, DynamicZoneMemberStatus status);
-
- void LoadRepositoryResult(ExpeditionsRepository::ExpeditionWithLeader&& entry);
- void AddMemberFromRepositoryResult(ExpeditionMembersRepository::MemberWithName&& entry);
-
-protected:
- ExpeditionBase() = default;
- ExpeditionBase(uint32_t id, const std::string& uuid, const std::string& expedition_name,
- const DynamicZoneMember& leader);
-
- DynamicZoneMember GetMemberData(uint32_t character_id);
- DynamicZoneMember GetMemberData(const std::string& character_name);
-
- uint32_t m_id = 0;
- bool m_is_locked = false;
- bool m_add_replay_on_join = true;
- std::string m_uuid;
- std::string m_expedition_name;
- DynamicZoneMember m_leader;
- std::vector m_members;
-};
-
-#endif
diff --git a/common/expedition_lockout_timer.cpp b/common/expedition_lockout_timer.cpp
deleted file mode 100644
index dc4cb97c6..000000000
--- a/common/expedition_lockout_timer.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-/**
- * EQEmulator: Everquest Server Emulator
- * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY except by those people which sell it, which
- * are required to give you total support for your newly bought product;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "expedition_lockout_timer.h"
-#include "../common/string_util.h"
-#include "../common/rulesys.h"
-#include "../common/util/uuid.h"
-#include
-
-const char* const DZ_REPLAY_TIMER_NAME = "Replay Timer"; // see December 14, 2016 patch notes
-
-ExpeditionLockoutTimer::ExpeditionLockoutTimer(
- std::string expedition_uuid, std::string expedition_name,
- std::string event_name, uint64_t expire_time, uint32_t duration
-) :
- m_expedition_uuid{std::move(expedition_uuid)},
- m_expedition_name{std::move(expedition_name)},
- m_event_name{std::move(event_name)},
- m_expire_time(std::chrono::system_clock::from_time_t(expire_time)),
- m_duration(duration)
-{
- if (m_event_name == DZ_REPLAY_TIMER_NAME)
- {
- m_is_replay_timer = true;
- }
-}
-
-ExpeditionLockoutTimer ExpeditionLockoutTimer::CreateLockout(
- const std::string& expedition_name, const std::string& event_name, uint32_t seconds, std::string uuid)
-{
- seconds = static_cast(seconds * RuleR(Expedition, LockoutDurationMultiplier));
-
- if (uuid.empty())
- {
- uuid = EQ::Util::UUID::Generate().ToString();
- }
-
- ExpeditionLockoutTimer lockout{uuid, expedition_name, event_name, 0, seconds};
- lockout.Reset(); // sets expire time
- return lockout;
-}
-
-uint32_t ExpeditionLockoutTimer::GetSecondsRemaining() const
-{
- auto now = std::chrono::system_clock::now();
- if (m_expire_time > now)
- {
- auto remaining = m_expire_time - now;
- return static_cast(std::chrono::duration_cast(remaining).count());
- }
- return 0;
-}
-
-ExpeditionLockoutTimer::DaysHoursMinutes ExpeditionLockoutTimer::GetDaysHoursMinutesRemaining() const
-{
- auto seconds = GetSecondsRemaining();
- return ExpeditionLockoutTimer::DaysHoursMinutes{
- fmt::format_int(seconds / 86400).str(), // days
- fmt::format_int((seconds / 3600) % 24).str(), // hours
- fmt::format_int((seconds / 60) % 60).str() // minutes
- };
-}
-
-bool ExpeditionLockoutTimer::IsSameLockout(const ExpeditionLockoutTimer& compare_lockout) const
-{
- return compare_lockout.IsSameLockout(GetExpeditionName(), GetEventName());
-}
-
-bool ExpeditionLockoutTimer::IsSameLockout(
- const std::string& expedition_name, const std::string& event_name) const
-{
- return GetExpeditionName() == expedition_name && GetEventName() == event_name;
-}
-
-void ExpeditionLockoutTimer::AddLockoutTime(int seconds)
-{
- seconds = static_cast(seconds * RuleR(Expedition, LockoutDurationMultiplier));
-
- auto new_duration = std::max(0, static_cast(m_duration.count()) + seconds);
-
- auto start_time = m_expire_time - m_duration;
- m_duration = std::chrono::seconds(new_duration);
- m_expire_time = start_time + m_duration;
-}
diff --git a/common/expedition_lockout_timer.h b/common/expedition_lockout_timer.h
deleted file mode 100644
index 8cbf3da54..000000000
--- a/common/expedition_lockout_timer.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * EQEmulator: Everquest Server Emulator
- * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY except by those people which sell it, which
- * are required to give you total support for your newly bought product;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#ifndef EXPEDITION_LOCKOUT_TIMER_H
-#define EXPEDITION_LOCKOUT_TIMER_H
-
-#include
-#include
-
-extern const char* const DZ_REPLAY_TIMER_NAME;
-
-class ExpeditionLockoutTimer
-{
-public:
- ExpeditionLockoutTimer() = default;
- ExpeditionLockoutTimer(
- std::string expedition_uuid, std::string expedition_name,
- std::string event_name, uint64_t expire_time, uint32_t duration);
-
- static ExpeditionLockoutTimer CreateLockout(
- const std::string& expedition_name, const std::string& event_name,
- uint32_t seconds, std::string uuid = {});
-
- struct DaysHoursMinutes
- {
- std::string days;
- std::string hours;
- std::string mins;
- };
-
- void AddLockoutTime(int seconds);
- uint32_t GetDuration() const { return static_cast(m_duration.count()); }
- uint64_t GetExpireTime() const { return std::chrono::system_clock::to_time_t(m_expire_time); }
- uint64_t GetStartTime() const { return std::chrono::system_clock::to_time_t(m_expire_time - m_duration); }
- uint32_t GetSecondsRemaining() const;
- DaysHoursMinutes GetDaysHoursMinutesRemaining() const;
- const std::string& GetExpeditionName() const { return m_expedition_name; }
- const std::string& GetExpeditionUUID() const { return m_expedition_uuid; }
- const std::string& GetEventName() const { return m_event_name; }
- bool IsExpired() const { return GetSecondsRemaining() == 0; }
- bool IsFromExpedition(const std::string& uuid) const { return uuid == m_expedition_uuid; }
- bool IsReplayTimer() const { return m_is_replay_timer; }
- bool IsSameLockout(const ExpeditionLockoutTimer& compare_lockout) const;
- bool IsSameLockout(const std::string& expedition_name, const std::string& event_name) const;
- void Reset() { m_expire_time = std::chrono::system_clock::now() + m_duration; }
- void SetDuration(uint32_t seconds) { m_duration = std::chrono::seconds(seconds); }
- void SetExpireTime(uint64_t expire_time) { m_expire_time = std::chrono::system_clock::from_time_t(expire_time); }
- void SetUUID(const std::string& uuid) { m_expedition_uuid = uuid; }
-
-private:
- bool m_is_replay_timer = false;
- std::string m_expedition_uuid; // expedition received in
- std::string m_expedition_name;
- std::string m_event_name;
- std::chrono::seconds m_duration;
- std::chrono::time_point m_expire_time;
-};
-
-#endif
diff --git a/common/net/console_server.cpp b/common/net/console_server.cpp
index 31b597bfb..ab420bd42 100644
--- a/common/net/console_server.cpp
+++ b/common/net/console_server.cpp
@@ -4,7 +4,7 @@
EQ::Net::ConsoleServer::ConsoleServer(const std::string &addr, int port)
{
- m_server = std::make_unique();
+ m_server.reset(new EQ::Net::TCPServer());
m_server->Listen(addr, port, false, [this](std::shared_ptr connection) {
ConsoleServerConnection *c = new ConsoleServerConnection(this, connection);
m_connections.insert(std::make_pair(c->GetUUID(), std::unique_ptr(c)));
diff --git a/common/net/servertalk_client_connection.cpp b/common/net/servertalk_client_connection.cpp
index 88cfc021a..0a5dceac6 100644
--- a/common/net/servertalk_client_connection.cpp
+++ b/common/net/servertalk_client_connection.cpp
@@ -3,7 +3,7 @@
#include "../eqemu_logsys.h"
EQ::Net::ServertalkClient::ServertalkClient(const std::string &addr, int port, bool ipv6, const std::string &identifier, const std::string &credentials)
- : m_timer(std::make_unique(100, true, std::bind(&EQ::Net::ServertalkClient::Connect, this)))
+ : m_timer(std::unique_ptr(new EQ::Timer(100, true, std::bind(&EQ::Net::ServertalkClient::Connect, this))))
{
m_port = port;
m_ipv6 = ipv6;
diff --git a/common/net/servertalk_legacy_client_connection.cpp b/common/net/servertalk_legacy_client_connection.cpp
index 8be329e65..3cbe1c85a 100644
--- a/common/net/servertalk_legacy_client_connection.cpp
+++ b/common/net/servertalk_legacy_client_connection.cpp
@@ -3,7 +3,7 @@
#include "../eqemu_logsys.h"
EQ::Net::ServertalkLegacyClient::ServertalkLegacyClient(const std::string &addr, int port, bool ipv6)
- : m_timer(std::make_unique(100, true, std::bind(&EQ::Net::ServertalkLegacyClient::Connect, this)))
+ : m_timer(std::unique_ptr(new EQ::Timer(100, true, std::bind(&EQ::Net::ServertalkLegacyClient::Connect, this))))
{
m_port = port;
m_ipv6 = ipv6;
diff --git a/common/net/servertalk_server.cpp b/common/net/servertalk_server.cpp
index 297d4cd31..fcbea917c 100644
--- a/common/net/servertalk_server.cpp
+++ b/common/net/servertalk_server.cpp
@@ -13,7 +13,7 @@ void EQ::Net::ServertalkServer::Listen(const ServertalkServerOptions& opts)
m_encrypted = opts.encrypted;
m_credentials = opts.credentials;
m_allow_downgrade = opts.allow_downgrade;
- m_server = std::make_unique();
+ m_server.reset(new EQ::Net::TCPServer());
m_server->Listen(opts.port, opts.ipv6, [this](std::shared_ptr connection) {
m_unident_connections.push_back(std::make_shared(connection, this, m_encrypted, m_allow_downgrade));
});
diff --git a/common/net/tcp_connection.cpp b/common/net/tcp_connection.cpp
index 372442c7d..695ac7643 100644
--- a/common/net/tcp_connection.cpp
+++ b/common/net/tcp_connection.cpp
@@ -2,7 +2,7 @@
#include "../event/event_loop.h"
void on_close_handle(uv_handle_t* handle) {
- delete (uv_tcp_t *)handle;
+ delete handle;
}
EQ::Net::TCPConnection::TCPConnection(uv_tcp_t *socket)
@@ -115,7 +115,7 @@ void EQ::Net::TCPConnection::Disconnect()
connection->m_on_disconnect_cb(connection);
}
- delete (uv_tcp_t *)handle;
+ delete handle;
});
m_socket = nullptr;
}
diff --git a/common/net/tcp_server.cpp b/common/net/tcp_server.cpp
index 777c92be5..ed68d54dc 100644
--- a/common/net/tcp_server.cpp
+++ b/common/net/tcp_server.cpp
@@ -2,7 +2,7 @@
#include "../event/event_loop.h"
void on_close_tcp_server_handle(uv_handle_t* handle) {
- delete (uv_tcp_t *)handle;
+ delete handle;
}
EQ::Net::TCPServer::TCPServer()
diff --git a/common/net/websocket_server.cpp b/common/net/websocket_server.cpp
index dda1a4a96..b46fc7953 100644
--- a/common/net/websocket_server.cpp
+++ b/common/net/websocket_server.cpp
@@ -34,8 +34,8 @@ struct EQ::Net::WebsocketServer::Impl
EQ::Net::WebsocketServer::WebsocketServer(const std::string &addr, int port)
{
- _impl = std::make_unique();
- _impl->server = std::make_unique();
+ _impl.reset(new Impl());
+ _impl->server.reset(new EQ::Net::TCPServer());
_impl->server->Listen(addr, port, false, [this](std::shared_ptr connection) {
auto wsc = _impl->ws_server.get_connection();
WebsocketServerConnection *c = new WebsocketServerConnection(this, connection, wsc);
@@ -53,7 +53,7 @@ EQ::Net::WebsocketServer::WebsocketServer(const std::string &addr, int port)
return websocketpp::lib::error_code();
});
- _impl->ping_timer = std::make_unique(5000, true, [this](EQ::Timer *t) {
+ _impl->ping_timer.reset(new EQ::Timer(5000, true, [this](EQ::Timer *t) {
auto iter = _impl->connections.begin();
while (iter != _impl->connections.end()) {
@@ -67,7 +67,7 @@ EQ::Net::WebsocketServer::WebsocketServer(const std::string &addr, int port)
iter++;
}
- });
+ }));
_impl->methods.insert(std::make_pair("login", MethodHandlerEntry(std::bind(&WebsocketServer::Login, this, std::placeholders::_1, std::placeholders::_2), 0)));
_impl->methods.insert(std::make_pair("subscribe", MethodHandlerEntry(std::bind(&WebsocketServer::Subscribe, this, std::placeholders::_1, std::placeholders::_2), 0)));
diff --git a/common/net/websocket_server_connection.cpp b/common/net/websocket_server_connection.cpp
index 3c1271518..50b117062 100644
--- a/common/net/websocket_server_connection.cpp
+++ b/common/net/websocket_server_connection.cpp
@@ -20,7 +20,7 @@ EQ::Net::WebsocketServerConnection::WebsocketServerConnection(WebsocketServer *p
std::shared_ptr connection,
std::shared_ptr ws_connection)
{
- _impl = std::make_unique();
+ _impl.reset(new Impl());
_impl->parent = parent;
_impl->connection = connection;
_impl->id = EQ::Util::UUID::Generate().ToString();
diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp
index 38b109677..c9e80a0f1 100644
--- a/common/patches/rof.cpp
+++ b/common/patches/rof.cpp
@@ -710,48 +710,15 @@ namespace RoF
FINISH_ENCODE();
}
- ENCODE(OP_DzChooseZone)
- {
- SETUP_VAR_ENCODE(DynamicZoneChooseZone_Struct);
-
- SerializeBuffer buf;
- buf.WriteUInt32(emu->client_id);
- buf.WriteUInt32(emu->count);
-
- for (uint32 i = 0; i < emu->count; ++i)
- {
- buf.WriteUInt16(emu->choices[i].dz_zone_id);
- buf.WriteUInt16(emu->choices[i].dz_instance_id);
- buf.WriteUInt32(emu->choices[i].unknown_id1);
- buf.WriteUInt32(emu->choices[i].dz_type);
- buf.WriteUInt32(emu->choices[i].unknown_id2);
- buf.WriteString(emu->choices[i].description);
- buf.WriteString(emu->choices[i].leader_name);
- }
-
- __packet->size = buf.size();
- __packet->pBuffer = new unsigned char[__packet->size];
- memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
-
- FINISH_ENCODE();
- }
-
ENCODE(OP_DzCompass)
{
- SETUP_VAR_ENCODE(DynamicZoneCompass_Struct);
- ALLOC_VAR_ENCODE(structs::DynamicZoneCompass_Struct,
- sizeof(structs::DynamicZoneCompass_Struct) +
- sizeof(structs::DynamicZoneCompassEntry_Struct) * emu->count
- );
+ SETUP_VAR_ENCODE(ExpeditionCompass_Struct);
+ ALLOC_VAR_ENCODE(structs::ExpeditionCompass_Struct, sizeof(structs::ExpeditionInfo_Struct) + sizeof(structs::ExpeditionCompassEntry_Struct) * emu->count);
- OUT(client_id);
OUT(count);
for (uint32 i = 0; i < emu->count; ++i)
{
- OUT(entries[i].dz_zone_id);
- OUT(entries[i].dz_instance_id);
- OUT(entries[i].dz_type);
OUT(entries[i].x);
OUT(entries[i].y);
OUT(entries[i].z);
@@ -772,108 +739,112 @@ namespace RoF
ENCODE(OP_DzExpeditionInfo)
{
- ENCODE_LENGTH_EXACT(DynamicZoneInfo_Struct);
- SETUP_DIRECT_ENCODE(DynamicZoneInfo_Struct, structs::DynamicZoneInfo_Struct);
+ ENCODE_LENGTH_EXACT(ExpeditionInfo_Struct);
+ SETUP_DIRECT_ENCODE(ExpeditionInfo_Struct, structs::ExpeditionInfo_Struct);
- OUT(client_id);
- OUT(assigned);
OUT(max_players);
- strn0cpy(eq->dz_name, emu->dz_name, sizeof(eq->dz_name));
- strn0cpy(eq->leader_name, emu->leader_name, sizeof(eq->leader_name));
+ eq->unknown004 = 785316192;
+ eq->unknown008 = 435601;
+ strncpy(eq->expedition_name, emu->expedition_name, sizeof(eq->expedition_name));
+ strncpy(eq->leader_name, emu->leader_name, sizeof(eq->leader_name));
FINISH_ENCODE();
}
- ENCODE(OP_DzExpeditionInvite)
+ ENCODE(OP_DzExpeditionList)
{
- ENCODE_LENGTH_EXACT(ExpeditionInvite_Struct);
- SETUP_DIRECT_ENCODE(ExpeditionInvite_Struct, structs::ExpeditionInvite_Struct);
+ SETUP_VAR_ENCODE(ExpeditionLockoutList_Struct);
- OUT(client_id);
- strn0cpy(eq->inviter_name, emu->inviter_name, sizeof(eq->inviter_name));
- strn0cpy(eq->expedition_name, emu->expedition_name, sizeof(eq->expedition_name));
- OUT(swapping);
- strn0cpy(eq->swap_name, emu->swap_name, sizeof(eq->swap_name));
- OUT(dz_zone_id);
- OUT(dz_instance_id);
-
- FINISH_ENCODE();
- }
-
- ENCODE(OP_DzExpeditionLockoutTimers)
- {
- SETUP_VAR_ENCODE(ExpeditionLockoutTimers_Struct);
-
- SerializeBuffer buf;
- buf.WriteUInt32(emu->client_id);
- buf.WriteUInt32(emu->count);
+ std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
+ uint32 client_id = 0;
+ uint8 null_term = 0;
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&emu->count, sizeof(uint32));
for (uint32 i = 0; i < emu->count; ++i)
{
- buf.WriteString(emu->timers[i].expedition_name);
- buf.WriteUInt32(emu->timers[i].seconds_remaining);
- buf.WriteInt32(emu->timers[i].event_type);
- buf.WriteString(emu->timers[i].event_name);
+ ss.write(emu->entries[i].expedition, strlen(emu->entries[i].expedition));
+ ss.write((const char*)&null_term, sizeof(char));
+ ss.write((const char*)&emu->entries[i].time_left, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write(emu->entries[i].expedition_event, strlen(emu->entries[i].expedition_event));
+ ss.write((const char*)&null_term, sizeof(char));
}
- __packet->size = buf.size();
+ __packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
- memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
+ memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
FINISH_ENCODE();
}
- ENCODE(OP_DzSetLeaderName)
+ ENCODE(OP_DzJoinExpeditionConfirm)
{
- ENCODE_LENGTH_EXACT(DynamicZoneLeaderName_Struct);
- SETUP_DIRECT_ENCODE(DynamicZoneLeaderName_Struct, structs::DynamicZoneLeaderName_Struct);
+ ENCODE_LENGTH_EXACT(ExpeditionJoinPrompt_Struct);
+ SETUP_DIRECT_ENCODE(ExpeditionJoinPrompt_Struct, structs::ExpeditionJoinPrompt_Struct);
- OUT(client_id);
- strn0cpy(eq->leader_name, emu->leader_name, sizeof(eq->leader_name));
+ strncpy(eq->expedition_name, emu->expedition_name, sizeof(eq->expedition_name));
+ strncpy(eq->player_name, emu->player_name, sizeof(eq->player_name));
+
+ FINISH_ENCODE();
+ }
+
+ ENCODE(OP_DzLeaderStatus)
+ {
+ SETUP_VAR_ENCODE(ExpeditionLeaderSet_Struct);
+
+ std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
+ uint32 client_id = 0;
+ uint8 null_term = 0;
+
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write(emu->leader_name, strlen(emu->leader_name));
+ ss.write((const char*)&null_term, sizeof(char));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));//0xffffffff
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));//1
+ ss.write((const char*)&client_id, sizeof(uint32));
+
+ __packet->size = ss.str().length();
+ __packet->pBuffer = new unsigned char[__packet->size];
+ memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
FINISH_ENCODE();
}
ENCODE(OP_DzMemberList)
{
- SETUP_VAR_ENCODE(DynamicZoneMemberList_Struct);
+ SETUP_VAR_ENCODE(ExpeditionMemberList_Struct);
- SerializeBuffer buf;
- buf.WriteUInt32(emu->client_id);
- buf.WriteUInt32(emu->member_count);
- for (uint32 i = 0; i < emu->member_count; ++i)
+ std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
+
+ uint32 client_id = 0;
+ uint8 null_term = 0;
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&emu->count, sizeof(uint32));
+ for (uint32 i = 0; i < emu->count; ++i)
{
- buf.WriteString(emu->members[i].name);
- buf.WriteUInt8(emu->members[i].online_status);
+ ss.write(emu->entries[i].name, strlen(emu->entries[i].name));
+ ss.write((const char*)&null_term, sizeof(char));
+ ss.write((const char*)&emu->entries[i].status, sizeof(char));
}
- __packet->size = buf.size();
+ __packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
- memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
+ memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
FINISH_ENCODE();
}
- ENCODE(OP_DzMemberListName)
- {
- ENCODE_LENGTH_EXACT(DynamicZoneMemberListName_Struct);
- SETUP_DIRECT_ENCODE(DynamicZoneMemberListName_Struct, structs::DynamicZoneMemberListName_Struct);
-
- OUT(client_id);
- OUT(add_name);
- strn0cpy(eq->name, emu->name, sizeof(eq->name));
-
- FINISH_ENCODE();
- }
-
- ENCODE(OP_DzMemberListStatus)
- {
- auto emu = reinterpret_cast((*p)->pBuffer);
- if (emu->member_count == 1)
- {
- ENCODE_FORWARD(OP_DzMemberList);
- }
- }
-
ENCODE(OP_Emote)
{
EQApplicationPacket *in = *p;
@@ -1856,7 +1827,6 @@ namespace RoF
OUT(FastRegenHP);
OUT(FastRegenMana);
OUT(FastRegenEndurance);
- OUT(underworld_teleport_index);
eq->FogDensity = emu->fog_density;
@@ -1968,7 +1938,7 @@ namespace RoF
for (int r = 0; r < 5; r++)
{
- outapp->WriteUInt32(emu->binds[r].zone_id);
+ outapp->WriteUInt32(emu->binds[r].zoneId);
outapp->WriteFloat(emu->binds[r].x);
outapp->WriteFloat(emu->binds[r].y);
outapp->WriteFloat(emu->binds[r].z);
@@ -4417,84 +4387,6 @@ namespace RoF
FINISH_DIRECT_DECODE();
}
- DECODE(OP_DzAddPlayer)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
- SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
-
- strn0cpy(emu->name, eq->name, sizeof(emu->name));
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzChooseZoneReply)
- {
- DECODE_LENGTH_EXACT(structs::DynamicZoneChooseZoneReply_Struct);
- SETUP_DIRECT_DECODE(DynamicZoneChooseZoneReply_Struct, structs::DynamicZoneChooseZoneReply_Struct);
-
- IN(unknown000);
- IN(unknown004);
- IN(unknown008);
- IN(unknown_id1);
- IN(dz_zone_id);
- IN(dz_instance_id);
- IN(dz_type);
- IN(unknown_id2);
- IN(unknown028);
- IN(unknown032);
- IN(unknown036);
- IN(unknown040);
- IN(unknown044);
- IN(unknown048);
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzExpeditionInviteResponse)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionInviteResponse_Struct);
- SETUP_DIRECT_DECODE(ExpeditionInviteResponse_Struct, structs::ExpeditionInviteResponse_Struct);
-
- IN(dz_zone_id);
- IN(dz_instance_id);
- IN(accepted);
- IN(swapping);
- strn0cpy(emu->swap_name, eq->swap_name, sizeof(emu->swap_name));
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzMakeLeader)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
- SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
-
- strn0cpy(emu->name, eq->name, sizeof(emu->name));
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzRemovePlayer)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
- SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
-
- strn0cpy(emu->name, eq->name, sizeof(emu->name));
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzSwapPlayer)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionCommandSwap_Struct);
- SETUP_DIRECT_DECODE(ExpeditionCommandSwap_Struct, structs::ExpeditionCommandSwap_Struct);
-
- strn0cpy(emu->add_player_name, eq->add_player_name, sizeof(emu->add_player_name));
- strn0cpy(emu->rem_player_name, eq->rem_player_name, sizeof(emu->rem_player_name));
-
- FINISH_DIRECT_DECODE();
- }
-
DECODE(OP_Emote)
{
unsigned char *__eq_buffer = __packet->pBuffer;
diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp
index 55fbfe2c8..1b3827984 100644
--- a/common/patches/rof2.cpp
+++ b/common/patches/rof2.cpp
@@ -759,48 +759,15 @@ namespace RoF2
FINISH_ENCODE();
}
- ENCODE(OP_DzChooseZone)
- {
- SETUP_VAR_ENCODE(DynamicZoneChooseZone_Struct);
-
- SerializeBuffer buf;
- buf.WriteUInt32(emu->client_id);
- buf.WriteUInt32(emu->count);
-
- for (uint32 i = 0; i < emu->count; ++i)
- {
- buf.WriteUInt16(emu->choices[i].dz_zone_id);
- buf.WriteUInt16(emu->choices[i].dz_instance_id);
- buf.WriteUInt32(emu->choices[i].unknown_id1);
- buf.WriteUInt32(emu->choices[i].dz_type);
- buf.WriteUInt32(emu->choices[i].unknown_id2);
- buf.WriteString(emu->choices[i].description);
- buf.WriteString(emu->choices[i].leader_name);
- }
-
- __packet->size = buf.size();
- __packet->pBuffer = new unsigned char[__packet->size];
- memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
-
- FINISH_ENCODE();
- }
-
ENCODE(OP_DzCompass)
{
- SETUP_VAR_ENCODE(DynamicZoneCompass_Struct);
- ALLOC_VAR_ENCODE(structs::DynamicZoneCompass_Struct,
- sizeof(structs::DynamicZoneCompass_Struct) +
- sizeof(structs::DynamicZoneCompassEntry_Struct) * emu->count
- );
+ SETUP_VAR_ENCODE(ExpeditionCompass_Struct);
+ ALLOC_VAR_ENCODE(structs::ExpeditionCompass_Struct, sizeof(structs::ExpeditionInfo_Struct) + sizeof(structs::ExpeditionCompassEntry_Struct) * emu->count);
- OUT(client_id);
OUT(count);
for (uint32 i = 0; i < emu->count; ++i)
{
- OUT(entries[i].dz_zone_id);
- OUT(entries[i].dz_instance_id);
- OUT(entries[i].dz_type);
OUT(entries[i].x);
OUT(entries[i].y);
OUT(entries[i].z);
@@ -821,108 +788,112 @@ namespace RoF2
ENCODE(OP_DzExpeditionInfo)
{
- ENCODE_LENGTH_EXACT(DynamicZoneInfo_Struct);
- SETUP_DIRECT_ENCODE(DynamicZoneInfo_Struct, structs::DynamicZoneInfo_Struct);
+ ENCODE_LENGTH_EXACT(ExpeditionInfo_Struct);
+ SETUP_DIRECT_ENCODE(ExpeditionInfo_Struct, structs::ExpeditionInfo_Struct);
- OUT(client_id);
- OUT(assigned);
OUT(max_players);
- strn0cpy(eq->dz_name, emu->dz_name, sizeof(eq->dz_name));
- strn0cpy(eq->leader_name, emu->leader_name, sizeof(eq->leader_name));
+ eq->unknown004 = 785316192;
+ eq->unknown008 = 435601;
+ strncpy(eq->expedition_name, emu->expedition_name, sizeof(eq->expedition_name));
+ strncpy(eq->leader_name, emu->leader_name, sizeof(eq->leader_name));
FINISH_ENCODE();
}
- ENCODE(OP_DzExpeditionInvite)
+ ENCODE(OP_DzExpeditionList)
{
- ENCODE_LENGTH_EXACT(ExpeditionInvite_Struct);
- SETUP_DIRECT_ENCODE(ExpeditionInvite_Struct, structs::ExpeditionInvite_Struct);
+ SETUP_VAR_ENCODE(ExpeditionLockoutList_Struct);
- OUT(client_id);
- strn0cpy(eq->inviter_name, emu->inviter_name, sizeof(eq->inviter_name));
- strn0cpy(eq->expedition_name, emu->expedition_name, sizeof(eq->expedition_name));
- OUT(swapping);
- strn0cpy(eq->swap_name, emu->swap_name, sizeof(eq->swap_name));
- OUT(dz_zone_id);
- OUT(dz_instance_id);
-
- FINISH_ENCODE();
- }
-
- ENCODE(OP_DzExpeditionLockoutTimers)
- {
- SETUP_VAR_ENCODE(ExpeditionLockoutTimers_Struct);
-
- SerializeBuffer buf;
- buf.WriteUInt32(emu->client_id);
- buf.WriteUInt32(emu->count);
+ std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
+ uint32 client_id = 0;
+ uint8 null_term = 0;
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&emu->count, sizeof(uint32));
for (uint32 i = 0; i < emu->count; ++i)
{
- buf.WriteString(emu->timers[i].expedition_name);
- buf.WriteUInt32(emu->timers[i].seconds_remaining);
- buf.WriteInt32(emu->timers[i].event_type);
- buf.WriteString(emu->timers[i].event_name);
+ ss.write(emu->entries[i].expedition, strlen(emu->entries[i].expedition));
+ ss.write((const char*)&null_term, sizeof(char));
+ ss.write((const char*)&emu->entries[i].time_left, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write(emu->entries[i].expedition_event, strlen(emu->entries[i].expedition_event));
+ ss.write((const char*)&null_term, sizeof(char));
}
- __packet->size = buf.size();
+ __packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
- memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
+ memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
FINISH_ENCODE();
}
- ENCODE(OP_DzSetLeaderName)
+ ENCODE(OP_DzJoinExpeditionConfirm)
{
- ENCODE_LENGTH_EXACT(DynamicZoneLeaderName_Struct);
- SETUP_DIRECT_ENCODE(DynamicZoneLeaderName_Struct, structs::DynamicZoneLeaderName_Struct);
+ ENCODE_LENGTH_EXACT(ExpeditionJoinPrompt_Struct);
+ SETUP_DIRECT_ENCODE(ExpeditionJoinPrompt_Struct, structs::ExpeditionJoinPrompt_Struct);
- OUT(client_id);
- strn0cpy(eq->leader_name, emu->leader_name, sizeof(eq->leader_name));
+ strncpy(eq->expedition_name, emu->expedition_name, sizeof(eq->expedition_name));
+ strncpy(eq->player_name, emu->player_name, sizeof(eq->player_name));
+
+ FINISH_ENCODE();
+ }
+
+ ENCODE(OP_DzLeaderStatus)
+ {
+ SETUP_VAR_ENCODE(ExpeditionLeaderSet_Struct);
+
+ std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
+ uint32 client_id = 0;
+ uint8 null_term = 0;
+
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write(emu->leader_name, strlen(emu->leader_name));
+ ss.write((const char*)&null_term, sizeof(char));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));//0xffffffff
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));//1
+ ss.write((const char*)&client_id, sizeof(uint32));
+
+ __packet->size = ss.str().length();
+ __packet->pBuffer = new unsigned char[__packet->size];
+ memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
FINISH_ENCODE();
}
ENCODE(OP_DzMemberList)
{
- SETUP_VAR_ENCODE(DynamicZoneMemberList_Struct);
+ SETUP_VAR_ENCODE(ExpeditionMemberList_Struct);
- SerializeBuffer buf;
- buf.WriteUInt32(emu->client_id);
- buf.WriteUInt32(emu->member_count);
- for (uint32 i = 0; i < emu->member_count; ++i)
+ std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
+
+ uint32 client_id = 0;
+ uint8 null_term = 0;
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&emu->count, sizeof(uint32));
+ for (uint32 i = 0; i < emu->count; ++i)
{
- buf.WriteString(emu->members[i].name);
- buf.WriteUInt8(emu->members[i].online_status);
+ ss.write(emu->entries[i].name, strlen(emu->entries[i].name));
+ ss.write((const char*)&null_term, sizeof(char));
+ ss.write((const char*)&emu->entries[i].status, sizeof(char));
}
- __packet->size = buf.size();
+ __packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
- memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
+ memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
FINISH_ENCODE();
}
- ENCODE(OP_DzMemberListName)
- {
- ENCODE_LENGTH_EXACT(DynamicZoneMemberListName_Struct);
- SETUP_DIRECT_ENCODE(DynamicZoneMemberListName_Struct, structs::DynamicZoneMemberListName_Struct);
-
- OUT(client_id);
- OUT(add_name);
- strn0cpy(eq->name, emu->name, sizeof(eq->name));
-
- FINISH_ENCODE();
- }
-
- ENCODE(OP_DzMemberListStatus)
- {
- auto emu = reinterpret_cast((*p)->pBuffer);
- if (emu->member_count == 1)
- {
- ENCODE_FORWARD(OP_DzMemberList);
- }
- }
-
ENCODE(OP_Emote)
{
EQApplicationPacket *in = *p;
@@ -1905,7 +1876,6 @@ namespace RoF2
OUT(FastRegenHP);
OUT(FastRegenMana);
OUT(FastRegenEndurance);
- OUT(underworld_teleport_index);
eq->FogDensity = emu->fog_density;
@@ -2025,7 +1995,7 @@ namespace RoF2
for (int r = 0; r < 5; r++)
{
- outapp->WriteUInt32(emu->binds[r].zone_id);
+ outapp->WriteUInt32(emu->binds[r].zoneId);
outapp->WriteFloat(emu->binds[r].x);
outapp->WriteFloat(emu->binds[r].y);
outapp->WriteFloat(emu->binds[r].z);
@@ -4614,84 +4584,6 @@ namespace RoF2
FINISH_DIRECT_DECODE();
}
- DECODE(OP_DzAddPlayer)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
- SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
-
- strn0cpy(emu->name, eq->name, sizeof(emu->name));
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzChooseZoneReply)
- {
- DECODE_LENGTH_EXACT(structs::DynamicZoneChooseZoneReply_Struct);
- SETUP_DIRECT_DECODE(DynamicZoneChooseZoneReply_Struct, structs::DynamicZoneChooseZoneReply_Struct);
-
- IN(unknown000);
- IN(unknown004);
- IN(unknown008);
- IN(unknown_id1);
- IN(dz_zone_id);
- IN(dz_instance_id);
- IN(dz_type);
- IN(unknown_id2);
- IN(unknown028);
- IN(unknown032);
- IN(unknown036);
- IN(unknown040);
- IN(unknown044);
- IN(unknown048);
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzExpeditionInviteResponse)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionInviteResponse_Struct);
- SETUP_DIRECT_DECODE(ExpeditionInviteResponse_Struct, structs::ExpeditionInviteResponse_Struct);
-
- IN(dz_zone_id);
- IN(dz_instance_id);
- IN(accepted);
- IN(swapping);
- strn0cpy(emu->swap_name, eq->swap_name, sizeof(emu->swap_name));
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzMakeLeader)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
- SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
-
- strn0cpy(emu->name, eq->name, sizeof(emu->name));
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzRemovePlayer)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
- SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
-
- strn0cpy(emu->name, eq->name, sizeof(emu->name));
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzSwapPlayer)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionCommandSwap_Struct);
- SETUP_DIRECT_DECODE(ExpeditionCommandSwap_Struct, structs::ExpeditionCommandSwap_Struct);
-
- strn0cpy(emu->add_player_name, eq->add_player_name, sizeof(emu->add_player_name));
- strn0cpy(emu->rem_player_name, eq->rem_player_name, sizeof(emu->rem_player_name));
-
- FINISH_DIRECT_DECODE();
- }
-
DECODE(OP_Emote)
{
unsigned char *__eq_buffer = __packet->pBuffer;
diff --git a/common/patches/rof2_ops.h b/common/patches/rof2_ops.h
index 22b6e6662..32798fef5 100644
--- a/common/patches/rof2_ops.h
+++ b/common/patches/rof2_ops.h
@@ -58,16 +58,13 @@ E(OP_DeleteCharge)
E(OP_DeleteItem)
E(OP_DeleteSpawn)
E(OP_DisciplineUpdate)
-E(OP_DzChooseZone)
E(OP_DzCompass)
E(OP_DzExpeditionEndsWarning)
E(OP_DzExpeditionInfo)
-E(OP_DzExpeditionInvite)
-E(OP_DzExpeditionLockoutTimers)
+E(OP_DzExpeditionList)
+E(OP_DzJoinExpeditionConfirm)
+E(OP_DzLeaderStatus)
E(OP_DzMemberList)
-E(OP_DzMemberListName)
-E(OP_DzMemberListStatus)
-E(OP_DzSetLeaderName)
E(OP_Emote)
E(OP_ExpansionInfo)
E(OP_FormattedMessage)
@@ -162,12 +159,6 @@ D(OP_ConsiderCorpse)
D(OP_Consume)
D(OP_Damage)
D(OP_DeleteItem)
-D(OP_DzAddPlayer)
-D(OP_DzChooseZoneReply)
-D(OP_DzExpeditionInviteResponse)
-D(OP_DzMakeLeader)
-D(OP_DzRemovePlayer)
-D(OP_DzSwapPlayer)
D(OP_Emote)
D(OP_EnvDamage)
D(OP_FaceChange)
diff --git a/common/patches/rof2_structs.h b/common/patches/rof2_structs.h
index a37e25d61..67947d57f 100644
--- a/common/patches/rof2_structs.h
+++ b/common/patches/rof2_structs.h
@@ -628,7 +628,7 @@ struct NewZone_Struct {
/*0856*/ uint32 scriptNPCReceivedanItem;
/*0860*/ uint32 bCheck; // padded bool
/*0864*/ uint32 scriptIDSomething;
- /*0868*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, -1 affects some collisions
+ /*0868*/ uint32 scriptIDSomething2;
/*0872*/ uint32 scriptIDSomething3;
/*0876*/ uint32 SuspendBuffs; // padded bool
/*0880*/ uint32 LavaDamage; // LavaDamage value
@@ -1053,7 +1053,7 @@ struct LeadershipAA_Struct {
* Size: 20 Octets
*/
struct BindStruct {
- /*000*/ uint32 zone_id;
+ /*000*/ uint32 zoneId;
/*004*/ float x;
/*008*/ float y;
/*012*/ float z;
@@ -2084,7 +2084,7 @@ struct GMZoneRequest_Struct {
/*0068*/ float x;
/*0072*/ float y;
/*0076*/ float z;
-/*0080*/ float heading;
+/*0080*/ char unknown0080[4];
/*0084*/ uint32 success; // 0 if command failed, 1 if succeeded?
/*0088*/
// /*072*/ int8 success; // =0 client->server, =1 server->client, -X=specific error
@@ -4882,169 +4882,52 @@ struct VeteranClaim
/*076*/ uint32 action;
};
-struct ExpeditionInvite_Struct
-{
-/*000*/ uint32 client_id; // unique character id
-/*004*/ uint32 unknown004;
-/*008*/ char inviter_name[64];
-/*072*/ char expedition_name[128];
-/*200*/ uint8 swapping; // 0: adding 1: swapping
-/*201*/ char swap_name[64]; // if swapping, swap name being removed
-/*265*/ uint8 padding[3];
-/*268*/ uint16 dz_zone_id; // dz_id zone/instance pair, sent back in reply
-/*270*/ uint16 dz_instance_id;
-};
-
-struct ExpeditionInviteResponse_Struct
+struct ExpeditionEntryHeader_Struct
{
/*000*/ uint32 unknown000;
+/*000*/ uint32 number_of_entries;
+};
+
+struct ExpeditionJoinPrompt_Struct
+{
+/*000*/ uint32 clientid;
/*004*/ uint32 unknown004;
-/*008*/ uint16 dz_zone_id; // dz_id pair sent in invite
-/*010*/ uint16 dz_instance_id;
-/*012*/ uint8 accepted; // 0: declined 1: accepted
-/*013*/ uint8 swapping; // 0: adding 1: swapping (sent in invite)
-/*014*/ char swap_name[64]; // swap name sent in invite
-/*078*/ uint8 unknown078; // padding garbage?
-/*079*/ uint8 unknown079; // padding garbage?
-};
-
-struct DynamicZoneInfo_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 unknown004;
-/*008*/ uint32 assigned; // padded bool, 0: clear info, 1: fill window info
-/*012*/ uint32 max_players;
-/*016*/ char dz_name[128];
-/*144*/ char leader_name[64];
-//*208*/ uint32 dz_type; // only in newer clients, if not 1 (expedition type) window does not auto show when dz info assigned
-};
-
-struct DynamicZoneMemberEntry_Struct
-{
-/*000*/ char name[1]; // variable length, null terminated, max 0x40 (64)
-/*000*/ uint8 online_status; // 0: unknown 1: Online, 2: Offline, 3: In Dynamic Zone, 4: Link Dead
-};
-
-struct DynamicZoneMemberList_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 member_count; // number of players in window
-/*008*/ DynamicZoneMemberEntry_Struct members[0]; // variable length
-};
-
-struct DynamicZoneMemberListName_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 unknown004;
-/*008*/ uint32 add_name; // padded bool, 0: remove name, 1: add name with unknown status
-/*012*/ char name[64];
-};
-
-struct ExpeditionLockoutTimerEntry_Struct
-{
-/*000*/ char expedition_name[1]; // variable length, null terminated, max 0x80 (128)
-/*000*/ uint32 seconds_remaining;
-/*000*/ int32 event_type; // seen -1 (0xffffffff) for replay timers and 1 for event timers
-/*000*/ char event_name[1]; // variable length, null terminated, max 0x100 (256)
-};
-
-struct ExpeditionLockoutTimers_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 count;
-/*008*/ ExpeditionLockoutTimerEntry_Struct timers[0];
-};
-
-struct DynamicZoneLeaderName_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 unknown004;
-/*008*/ char leader_name[64];
-};
-
-struct ExpeditionCommand_Struct
-{
-/*000*/ uint32 unknown000;
-/*004*/ uint32 unknown004;
-/*008*/ char name[64];
-};
-
-struct ExpeditionCommandSwap_Struct
-{
-/*000*/ uint32 unknown000;
-/*004*/ uint32 unknown004;
-/*008*/ char add_player_name[64]; // swap to (player must confirm)
-/*072*/ char rem_player_name[64]; // swap from
+/*008*/ char player_name[64];
+/*072*/ char expedition_name[64];
};
struct ExpeditionExpireWarning
{
-/*000*/ uint32 client_id;
+/*000*/ uint32 clientid;
/*004*/ uint32 unknown004;
/*008*/ uint32 minutes_remaining;
};
-struct DynamicZoneCompassEntry_Struct
+struct ExpeditionInfo_Struct
{
-/*000*/ uint16 dz_zone_id; // target dz id pair
-/*002*/ uint16 dz_instance_id;
-/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
+/*000*/ uint32 clientid;
+/*004*/ uint32 unknown004;
/*008*/ uint32 unknown008;
+/*012*/ uint32 max_players;
+/*016*/ char expedition_name[128];
+/*142*/ char leader_name[64];
+};
+
+struct ExpeditionCompassEntry_Struct
+{
+/*000*/ float unknown000; //seen *((uint32*)) = 1584791871
+/*004*/ uint32 enabled; //guess
+/*008*/ uint32 unknown008; //seen 1019
/*012*/ float y;
/*016*/ float x;
/*020*/ float z;
};
-struct DynamicZoneCompass_Struct
+struct ExpeditionCompass_Struct
{
-/*000*/ uint32 client_id;
+/*000*/ uint32 clientid;
/*004*/ uint32 count;
-/*008*/ DynamicZoneCompassEntry_Struct entries[0];
-};
-
-struct DynamicZoneChooseZoneEntry_Struct
-{
-/*000*/ uint16 dz_zone_id; // dz_id pair
-/*002*/ uint16 dz_instance_id;
-/*004*/ uint32 unknown_id1; // seen 28 00 00 00 (40), sent back in reply
-/*008*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest -- sent back in reply
-/*012*/ uint32 unknown_id2; // possibly an id based on dz type, for expeditions this was same as dz_id (zone|instance) but task dz was different
-/*016*/ char description[1]; // variable length, null terminated, max 0x80 (128)
-/*000*/ char leader_name[1]; // variable length, null terminated, max 0x40 (64)
-};
-
-struct DynamicZoneChooseZone_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 count;
-/*008*/ DynamicZoneChooseZoneEntry_Struct choices[0];
-};
-
-struct DynamicZoneChooseZoneReply_Struct
-{
-/*000*/ uint32 unknown000; // ff ff ff ff
-/*004*/ uint32 unknown004; // seen 69 00 00 00
-/*008*/ uint32 unknown008; // ff ff ff ff
-/*012*/ uint32 unknown_id1; // from choose zone entry message
-/*016*/ uint16 dz_zone_id; // dz_id pair
-/*018*/ uint16 dz_instance_id;
-/*020*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest
-/*024*/ uint32 unknown_id2; // from choose zone entry message
-/*028*/ uint32 unknown028; // 00 00 00 00
-/*032*/ uint32 unknown032; // always same as unknown044
-/*036*/ uint32 unknown036;
-/*040*/ uint32 unknown040;
-/*044*/ uint32 unknown044; // always same as unknown032
-/*048*/ uint32 unknown048; // seen 01 00 00 00 and 02 00 00 00
-};
-
-struct KickPlayers_Struct
-{
-/*000*/ char char_name[64];
-/*064*/ uint32 unknown064; // always 0
-/*068*/ uint8 kick_expedition; // true if /kickplayers exp
-/*069*/ uint8 kick_task; // true if /kickplayers task
-/*070*/ uint8 padding[2];
+/*008*/ ExpeditionCompassEntry_Struct entries[0];
};
struct MaxCharacters_Struct
diff --git a/common/patches/rof_ops.h b/common/patches/rof_ops.h
index f06834d21..11fd83f51 100644
--- a/common/patches/rof_ops.h
+++ b/common/patches/rof_ops.h
@@ -44,16 +44,13 @@ E(OP_DeleteCharge)
E(OP_DeleteItem)
E(OP_DeleteSpawn)
E(OP_DisciplineUpdate)
-E(OP_DzChooseZone)
E(OP_DzCompass)
E(OP_DzExpeditionEndsWarning)
E(OP_DzExpeditionInfo)
-E(OP_DzExpeditionInvite)
-E(OP_DzExpeditionLockoutTimers)
+E(OP_DzExpeditionList)
+E(OP_DzJoinExpeditionConfirm)
+E(OP_DzLeaderStatus)
E(OP_DzMemberList)
-E(OP_DzMemberListName)
-E(OP_DzMemberListStatus)
-E(OP_DzSetLeaderName)
E(OP_Emote)
E(OP_ExpansionInfo)
E(OP_FormattedMessage)
@@ -148,12 +145,6 @@ D(OP_ConsiderCorpse)
D(OP_Consume)
D(OP_Damage)
D(OP_DeleteItem)
-D(OP_DzAddPlayer)
-D(OP_DzChooseZoneReply)
-D(OP_DzExpeditionInviteResponse)
-D(OP_DzMakeLeader)
-D(OP_DzRemovePlayer)
-D(OP_DzSwapPlayer)
D(OP_Emote)
D(OP_EnvDamage)
D(OP_FaceChange)
diff --git a/common/patches/rof_structs.h b/common/patches/rof_structs.h
index a8297b2ea..76324d59b 100644
--- a/common/patches/rof_structs.h
+++ b/common/patches/rof_structs.h
@@ -575,11 +575,7 @@ struct NewZone_Struct {
/*0848*/ int32 unknown848;
/*0852*/ uint16 zone_id;
/*0854*/ uint16 zone_instance;
-/*0856*/ uint32 scriptNPCReceivedanItem;
-/*0860*/ uint32 bCheck; // padded bool
-/*0864*/ uint32 scriptIDSomething;
-/*0868*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, -1 affects some collisions
-/*0872*/ uint32 scriptIDSomething3;
+/*0856*/ char unknown856[20];
/*0876*/ uint32 SuspendBuffs;
/*0880*/ uint32 unknown880; // Seen 50
/*0884*/ uint32 unknown884; // Seen 10
@@ -998,7 +994,7 @@ struct LeadershipAA_Struct {
* Size: 20 Octets
*/
struct BindStruct {
- /*000*/ uint32 zone_id;
+ /*000*/ uint32 zoneId;
/*004*/ float x;
/*008*/ float y;
/*012*/ float z;
@@ -2062,7 +2058,7 @@ struct GMZoneRequest_Struct {
/*0068*/ float x;
/*0072*/ float y;
/*0076*/ float z;
-/*0080*/ float heading;
+/*0080*/ char unknown0080[4];
/*0084*/ uint32 success; // 0 if command failed, 1 if succeeded?
/*0088*/
// /*072*/ int8 success; // =0 client->server, =1 server->client, -X=specific error
@@ -4815,159 +4811,52 @@ struct VeteranClaim
/*076*/ uint32 action;
};
-struct ExpeditionInvite_Struct
-{
-/*000*/ uint32 client_id; // unique character id
-/*004*/ uint32 unknown004;
-/*008*/ char inviter_name[64];
-/*072*/ char expedition_name[128];
-/*200*/ uint8 swapping; // 0: adding 1: swapping
-/*201*/ char swap_name[64]; // if swapping, swap name being removed
-/*265*/ uint8 padding[3];
-/*268*/ uint16 dz_zone_id; // dz_id zone/instance pair, sent back in reply
-/*270*/ uint16 dz_instance_id;
-};
-
-struct ExpeditionInviteResponse_Struct
+struct ExpeditionEntryHeader_Struct
{
/*000*/ uint32 unknown000;
+/*000*/ uint32 number_of_entries;
+};
+
+struct ExpeditionJoinPrompt_Struct
+{
+/*000*/ uint32 clientid;
/*004*/ uint32 unknown004;
-/*008*/ uint16 dz_zone_id; // dz_id pair sent in invite
-/*010*/ uint16 dz_instance_id;
-/*012*/ uint8 accepted; // 0: declined 1: accepted
-/*013*/ uint8 swapping; // 0: adding 1: swapping (sent in invite)
-/*014*/ char swap_name[64]; // swap name sent in invite
-/*078*/ uint8 unknown078; // padding garbage?
-/*079*/ uint8 unknown079; // padding garbage?
-};
-
-struct DynamicZoneInfo_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 unknown004;
-/*008*/ uint32 assigned; // padded bool
-/*012*/ uint32 max_players;
-/*016*/ char dz_name[128];
-/*144*/ char leader_name[64];
-};
-
-struct DynamicZoneMemberEntry_Struct
-{
-/*000*/ char name[1]; // variable length, null terminated, max 0x40 (64)
-/*000*/ uint8 online_status; // 0: unknown 1: Online, 2: Offline, 3: In Dynamic Zone, 4: Link Dead
-};
-
-struct DynamicZoneMemberList_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 member_count; // number of players in window
-/*008*/ DynamicZoneMemberEntry_Struct members[0]; // variable length
-};
-
-struct DynamicZoneMemberListName_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 unknown004;
-/*008*/ uint32 add_name; // padded bool, 0: remove name, 1: add name with unknown status
-/*012*/ char name[64];
-};
-
-struct ExpeditionLockoutTimerEntry_Struct
-{
-/*000*/ char expedition_name[1]; // variable length, null terminated, max 0x80 (128)
-/*000*/ uint32 seconds_remaining;
-/*000*/ int32 event_type; // seen -1 (0xffffffff) for replay timers and 1 for event timers
-/*000*/ char event_name[1]; // variable length, null terminated, max 0x100 (256)
-};
-
-struct ExpeditionLockoutTimers_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 count;
-/*008*/ ExpeditionLockoutTimerEntry_Struct timers[0];
-};
-
-struct DynamicZoneLeaderName_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 unknown004;
-/*008*/ char leader_name[64];
-};
-
-struct ExpeditionCommand_Struct
-{
-/*000*/ uint32 unknown000;
-/*004*/ uint32 unknown004;
-/*008*/ char name[64];
-};
-
-struct ExpeditionCommandSwap_Struct
-{
-/*000*/ uint32 unknown000;
-/*004*/ uint32 unknown004;
-/*008*/ char add_player_name[64]; // swap to (player must confirm)
-/*072*/ char rem_player_name[64]; // swap from
+/*008*/ char player_name[64];
+/*072*/ char expedition_name[64];
};
struct ExpeditionExpireWarning
{
-/*000*/ uint32 client_id;
+/*000*/ uint32 clientid;
/*004*/ uint32 unknown004;
/*008*/ uint32 minutes_remaining;
};
-struct DynamicZoneCompassEntry_Struct
+struct ExpeditionInfo_Struct
{
-/*000*/ uint16 dz_zone_id; // target dz id pair
-/*002*/ uint16 dz_instance_id;
-/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
+/*000*/ uint32 clientid;
+/*004*/ uint32 unknown004;
/*008*/ uint32 unknown008;
+/*012*/ uint32 max_players;
+/*016*/ char expedition_name[128];
+/*142*/ char leader_name[64];
+};
+
+struct ExpeditionCompassEntry_Struct
+{
+/*000*/ float unknown000; //seen *((uint32*)) = 1584791871
+/*004*/ uint32 enabled; //guess
+/*008*/ uint32 unknown008; //seen 1019
/*012*/ float y;
/*016*/ float x;
/*020*/ float z;
};
-struct DynamicZoneCompass_Struct
+struct ExpeditionCompass_Struct
{
-/*000*/ uint32 client_id;
+/*000*/ uint32 clientid;
/*004*/ uint32 count;
-/*008*/ DynamicZoneCompassEntry_Struct entries[0];
-};
-
-struct DynamicZoneChooseZoneEntry_Struct
-{
-/*000*/ uint16 dz_zone_id; // dz_id pair
-/*002*/ uint16 dz_instance_id;
-/*004*/ uint32 unknown_id1; // sent back in reply
-/*008*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest -- sent back in reply
-/*012*/ uint32 unknown_id2; // possibly an id based on dz type, for expeditions this was same as dz_id (zone|instance) but task dz was different
-/*016*/ char description[1]; // variable length, null terminated, max 0x80 (128)
-/*000*/ char leader_name[1]; // variable length, null terminated, max 0x40 (64)
-};
-
-struct DynamicZoneChooseZone_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 count;
-/*008*/ DynamicZoneChooseZoneEntry_Struct choices[0];
-};
-
-struct DynamicZoneChooseZoneReply_Struct
-{
-/*000*/ uint32 unknown000; // ff ff ff ff
-/*004*/ uint32 unknown004; // seen 69 00 00 00
-/*008*/ uint32 unknown008; // ff ff ff ff
-/*012*/ uint32 unknown_id1; // from choose zone entry message
-/*016*/ uint16 dz_zone_id; // dz_id pair
-/*018*/ uint16 dz_instance_id;
-/*020*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest
-/*024*/ uint32 unknown_id2; // from choose zone entry message
-/*028*/ uint32 unknown028; // 00 00 00 00
-/*032*/ uint32 unknown032; // always same as unknown044
-/*036*/ uint32 unknown036;
-/*040*/ uint32 unknown040;
-/*044*/ uint32 unknown044; // always same as unknown032
-/*048*/ uint32 unknown048; // seen 01 00 00 00 and 02 00 00 00
+/*008*/ ExpeditionCompassEntry_Struct entries[0];
};
struct MaxCharacters_Struct
diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp
index 404190d09..6e3f274e7 100644
--- a/common/patches/sod.cpp
+++ b/common/patches/sod.cpp
@@ -483,48 +483,15 @@ namespace SoD
FINISH_ENCODE();
}
- ENCODE(OP_DzChooseZone)
- {
- SETUP_VAR_ENCODE(DynamicZoneChooseZone_Struct);
-
- SerializeBuffer buf;
- buf.WriteUInt32(emu->client_id);
- buf.WriteUInt32(emu->count);
-
- for (uint32 i = 0; i < emu->count; ++i)
- {
- buf.WriteUInt16(emu->choices[i].dz_zone_id);
- buf.WriteUInt16(emu->choices[i].dz_instance_id);
- buf.WriteUInt32(emu->choices[i].unknown_id1);
- buf.WriteUInt32(emu->choices[i].dz_type);
- buf.WriteUInt32(emu->choices[i].unknown_id2);
- buf.WriteString(emu->choices[i].description);
- buf.WriteString(emu->choices[i].leader_name);
- }
-
- __packet->size = buf.size();
- __packet->pBuffer = new unsigned char[__packet->size];
- memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
-
- FINISH_ENCODE();
- }
-
ENCODE(OP_DzCompass)
{
- SETUP_VAR_ENCODE(DynamicZoneCompass_Struct);
- ALLOC_VAR_ENCODE(structs::DynamicZoneCompass_Struct,
- sizeof(structs::DynamicZoneCompass_Struct) +
- sizeof(structs::DynamicZoneCompassEntry_Struct) * emu->count
- );
+ SETUP_VAR_ENCODE(ExpeditionCompass_Struct);
+ ALLOC_VAR_ENCODE(structs::ExpeditionCompass_Struct, sizeof(structs::ExpeditionInfo_Struct) + sizeof(structs::ExpeditionCompassEntry_Struct) * emu->count);
- OUT(client_id);
OUT(count);
for (uint32 i = 0; i < emu->count; ++i)
{
- OUT(entries[i].dz_zone_id);
- OUT(entries[i].dz_instance_id);
- OUT(entries[i].dz_type);
OUT(entries[i].x);
OUT(entries[i].y);
OUT(entries[i].z);
@@ -545,109 +512,112 @@ namespace SoD
ENCODE(OP_DzExpeditionInfo)
{
- ENCODE_LENGTH_EXACT(DynamicZoneInfo_Struct);
- SETUP_DIRECT_ENCODE(DynamicZoneInfo_Struct, structs::DynamicZoneInfo_Struct);
+ ENCODE_LENGTH_EXACT(ExpeditionInfo_Struct);
+ SETUP_DIRECT_ENCODE(ExpeditionInfo_Struct, structs::ExpeditionInfo_Struct);
- OUT(client_id);
- OUT(assigned);
OUT(max_players);
- strn0cpy(eq->dz_name, emu->dz_name, sizeof(eq->dz_name));
- strn0cpy(eq->leader_name, emu->leader_name, sizeof(eq->leader_name));
+ eq->unknown004 = 785316192;
+ eq->unknown008 = 435601;
+ strcpy(eq->expedition_name, emu->expedition_name);
+ strcpy(eq->leader_name, emu->leader_name);
FINISH_ENCODE();
}
- ENCODE(OP_DzExpeditionInvite)
+ ENCODE(OP_DzExpeditionList)
{
- ENCODE_LENGTH_EXACT(ExpeditionInvite_Struct);
- SETUP_DIRECT_ENCODE(ExpeditionInvite_Struct, structs::ExpeditionInvite_Struct);
+ SETUP_VAR_ENCODE(ExpeditionLockoutList_Struct);
- OUT(client_id);
- strn0cpy(eq->inviter_name, emu->inviter_name, sizeof(eq->inviter_name));
- strn0cpy(eq->expedition_name, emu->expedition_name, sizeof(eq->expedition_name));
- OUT(swapping);
- strn0cpy(eq->swap_name, emu->swap_name, sizeof(eq->swap_name));
- OUT(dz_zone_id);
- OUT(dz_instance_id);
-
- FINISH_ENCODE();
- }
-
- ENCODE(OP_DzExpeditionLockoutTimers)
- {
- SETUP_VAR_ENCODE(ExpeditionLockoutTimers_Struct);
-
- SerializeBuffer buf;
- buf.WriteUInt32(emu->client_id);
- buf.WriteUInt32(emu->count);
+ std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
+ uint32 client_id = 0;
+ uint8 null_term = 0;
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&emu->count, sizeof(uint32));
for (uint32 i = 0; i < emu->count; ++i)
{
- buf.WriteString(emu->timers[i].expedition_name);
- buf.WriteUInt32(emu->timers[i].seconds_remaining);
- buf.WriteInt32(emu->timers[i].event_type);
- buf.WriteString(emu->timers[i].event_name);
+ ss.write(emu->entries[i].expedition, strlen(emu->entries[i].expedition));
+ ss.write((const char*)&null_term, sizeof(char));
+ ss.write((const char*)&emu->entries[i].time_left, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write(emu->entries[i].expedition_event, strlen(emu->entries[i].expedition_event));
+ ss.write((const char*)&null_term, sizeof(char));
}
- __packet->size = buf.size();
+ __packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
- memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
+ memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
FINISH_ENCODE();
}
- ENCODE(OP_DzSetLeaderName)
+ ENCODE(OP_DzJoinExpeditionConfirm)
{
- ENCODE_LENGTH_EXACT(DynamicZoneLeaderName_Struct);
- SETUP_DIRECT_ENCODE(DynamicZoneLeaderName_Struct, structs::DynamicZoneLeaderName_Struct);
+ ENCODE_LENGTH_EXACT(ExpeditionJoinPrompt_Struct);
+ SETUP_DIRECT_ENCODE(ExpeditionJoinPrompt_Struct, structs::ExpeditionJoinPrompt_Struct);
- OUT(client_id);
- strn0cpy(eq->leader_name, emu->leader_name, sizeof(eq->leader_name));
+ strcpy(eq->expedition_name, emu->expedition_name);
+ strcpy(eq->player_name, emu->player_name);
+
+ FINISH_ENCODE();
+ }
+
+ ENCODE(OP_DzLeaderStatus)
+ {
+ SETUP_VAR_ENCODE(ExpeditionLeaderSet_Struct);
+
+ std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
+ uint32 client_id = 0;
+ uint8 null_term = 0;
+
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write(emu->leader_name, strlen(emu->leader_name));
+ ss.write((const char*)&null_term, sizeof(char));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));//0xffffffff
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));//1
+ ss.write((const char*)&client_id, sizeof(uint32));
+
+ __packet->size = ss.str().length();
+ __packet->pBuffer = new unsigned char[__packet->size];
+ memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
FINISH_ENCODE();
}
ENCODE(OP_DzMemberList)
{
- SETUP_VAR_ENCODE(DynamicZoneMemberList_Struct);
+ SETUP_VAR_ENCODE(ExpeditionMemberList_Struct);
- SerializeBuffer buf;
- buf.WriteUInt32(emu->client_id);
- buf.WriteUInt32(emu->member_count);
- for (uint32 i = 0; i < emu->member_count; ++i)
+ std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
+
+ uint32 client_id = 0;
+ uint8 null_term = 0;
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&emu->count, sizeof(uint32));
+ for (uint32 i = 0; i < emu->count; ++i)
{
- buf.WriteString(emu->members[i].name);
- buf.WriteUInt8(emu->members[i].online_status);
+ ss.write(emu->entries[i].name, strlen(emu->entries[i].name));
+ ss.write((const char*)&null_term, sizeof(char));
+ ss.write((const char*)&emu->entries[i].status, sizeof(char));
}
- __packet->size = buf.size();
+ __packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
- memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
+ memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
FINISH_ENCODE();
}
- ENCODE(OP_DzMemberListName)
- {
- ENCODE_LENGTH_EXACT(DynamicZoneMemberListName_Struct);
- SETUP_DIRECT_ENCODE(DynamicZoneMemberListName_Struct, structs::DynamicZoneMemberListName_Struct);
-
- OUT(client_id);
- OUT(add_name);
- strn0cpy(eq->name, emu->name, sizeof(eq->name));
-
- FINISH_ENCODE();
- }
-
- ENCODE(OP_DzMemberListStatus)
- {
- auto emu = reinterpret_cast((*p)->pBuffer);
- if (emu->member_count == 1)
- {
- ENCODE_FORWARD(OP_DzMemberList);
- }
- }
-
-
ENCODE(OP_Emote)
{
EQApplicationPacket *in = *p;
@@ -1383,7 +1353,6 @@ namespace SoD
OUT(FastRegenHP);
OUT(FastRegenMana);
OUT(FastRegenEndurance);
- OUT(underworld_teleport_index);
/*fill in some unknowns with observed values, hopefully it will help */
eq->unknown800 = -1;
@@ -1475,7 +1444,7 @@ namespace SoD
eq->level1 = emu->level;
// OUT(unknown00022[2]);
for (r = 0; r < 5; r++) {
- OUT(binds[r].zone_id);
+ OUT(binds[r].zoneId);
OUT(binds[r].x);
OUT(binds[r].y);
OUT(binds[r].z);
@@ -3004,84 +2973,6 @@ namespace SoD
FINISH_DIRECT_DECODE();
}
- DECODE(OP_DzAddPlayer)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
- SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
-
- strn0cpy(emu->name, eq->name, sizeof(emu->name));
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzChooseZoneReply)
- {
- DECODE_LENGTH_EXACT(structs::DynamicZoneChooseZoneReply_Struct);
- SETUP_DIRECT_DECODE(DynamicZoneChooseZoneReply_Struct, structs::DynamicZoneChooseZoneReply_Struct);
-
- IN(unknown000);
- IN(unknown004);
- IN(unknown008);
- IN(unknown_id1);
- IN(dz_zone_id);
- IN(dz_instance_id);
- IN(dz_type);
- IN(unknown_id2);
- IN(unknown028);
- IN(unknown032);
- IN(unknown036);
- IN(unknown040);
- IN(unknown044);
- IN(unknown048);
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzExpeditionInviteResponse)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionInviteResponse_Struct);
- SETUP_DIRECT_DECODE(ExpeditionInviteResponse_Struct, structs::ExpeditionInviteResponse_Struct);
-
- IN(dz_zone_id);
- IN(dz_instance_id);
- IN(accepted);
- IN(swapping);
- strn0cpy(emu->swap_name, eq->swap_name, sizeof(emu->swap_name));
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzMakeLeader)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
- SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
-
- strn0cpy(emu->name, eq->name, sizeof(emu->name));
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzRemovePlayer)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
- SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
-
- strn0cpy(emu->name, eq->name, sizeof(emu->name));
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzSwapPlayer)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionCommandSwap_Struct);
- SETUP_DIRECT_DECODE(ExpeditionCommandSwap_Struct, structs::ExpeditionCommandSwap_Struct);
-
- strn0cpy(emu->add_player_name, eq->add_player_name, sizeof(emu->add_player_name));
- strn0cpy(emu->rem_player_name, eq->rem_player_name, sizeof(emu->rem_player_name));
-
- FINISH_DIRECT_DECODE();
- }
-
DECODE(OP_Emote)
{
unsigned char *__eq_buffer = __packet->pBuffer;
diff --git a/common/patches/sod_ops.h b/common/patches/sod_ops.h
index 5216a77ce..6909e1f28 100644
--- a/common/patches/sod_ops.h
+++ b/common/patches/sod_ops.h
@@ -35,16 +35,13 @@ E(OP_Consider)
E(OP_Damage)
E(OP_DeleteCharge)
E(OP_DeleteItem)
-E(OP_DzChooseZone)
E(OP_DzCompass)
E(OP_DzExpeditionEndsWarning)
E(OP_DzExpeditionInfo)
-E(OP_DzExpeditionInvite)
-E(OP_DzExpeditionLockoutTimers)
+E(OP_DzExpeditionList)
+E(OP_DzJoinExpeditionConfirm)
+E(OP_DzLeaderStatus)
E(OP_DzMemberList)
-E(OP_DzMemberListName)
-E(OP_DzMemberListStatus)
-E(OP_DzSetLeaderName)
E(OP_Emote)
E(OP_ExpansionInfo)
E(OP_FormattedMessage)
@@ -114,12 +111,6 @@ D(OP_Consider)
D(OP_ConsiderCorpse)
D(OP_Consume)
D(OP_DeleteItem)
-D(OP_DzAddPlayer)
-D(OP_DzChooseZoneReply)
-D(OP_DzExpeditionInviteResponse)
-D(OP_DzMakeLeader)
-D(OP_DzRemovePlayer)
-D(OP_DzSwapPlayer)
D(OP_Emote)
D(OP_FaceChange)
D(OP_FindPersonRequest)
diff --git a/common/patches/sod_structs.h b/common/patches/sod_structs.h
index 70866db8f..2a8b0cec8 100644
--- a/common/patches/sod_structs.h
+++ b/common/patches/sod_structs.h
@@ -444,11 +444,7 @@ struct NewZone_Struct {
/*0848*/ int32 unknown848;
/*0852*/ uint16 zone_id;
/*0854*/ uint16 zone_instance;
-/*0856*/ uint32 scriptNPCReceivedanItem;
-/*0860*/ uint32 bCheck; // padded bool
-/*0864*/ uint32 scriptIDSomething;
-/*0868*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, -1 affects some collisions
-/*0872*/ uint32 scriptIDSomething3;
+/*0856*/ char unknown856[20];
/*0876*/ uint32 SuspendBuffs;
/*0880*/ uint32 unknown880; //seen 50
/*0884*/ uint32 unknown884; //seen 10
@@ -803,7 +799,7 @@ struct LeadershipAA_Struct {
* Size: 20 Octets
*/
struct BindStruct {
- /*000*/ uint32 zone_id;
+ /*000*/ uint32 zoneId;
/*004*/ float x;
/*008*/ float y;
/*012*/ float z;
@@ -1714,7 +1710,7 @@ struct GMZoneRequest_Struct {
/*0068*/ float x;
/*0072*/ float y;
/*0076*/ float z;
-/*0080*/ float heading;
+/*0080*/ char unknown0080[4];
/*0084*/ uint32 success; // 0 if command failed, 1 if succeeded?
/*0088*/
// /*072*/ int8 success; // =0 client->server, =1 server->client, -X=specific error
@@ -4169,160 +4165,52 @@ struct VeteranReward
/*012*/ VeteranRewardItem items[8];
};
-
-struct ExpeditionInvite_Struct
-{
-/*000*/ uint32 client_id; // unique character id
-/*004*/ uint32 unknown004;
-/*008*/ char inviter_name[64];
-/*072*/ char expedition_name[128];
-/*200*/ uint8 swapping; // 0: adding 1: swapping
-/*201*/ char swap_name[64]; // if swapping, swap name being removed
-/*265*/ uint8 padding[3];
-/*268*/ uint16 dz_zone_id; // dz_id zone/instance pair, sent back in reply
-/*270*/ uint16 dz_instance_id;
-};
-
-struct ExpeditionInviteResponse_Struct
+struct ExpeditionEntryHeader_Struct
{
/*000*/ uint32 unknown000;
+/*000*/ uint32 number_of_entries;
+};
+
+struct ExpeditionJoinPrompt_Struct
+{
+/*000*/ uint32 clientid;
/*004*/ uint32 unknown004;
-/*008*/ uint16 dz_zone_id; // dz_id pair sent in invite
-/*010*/ uint16 dz_instance_id;
-/*012*/ uint8 accepted; // 0: declined 1: accepted
-/*013*/ uint8 swapping; // 0: adding 1: swapping (sent in invite)
-/*014*/ char swap_name[64]; // swap name sent in invite
-/*078*/ uint8 unknown078; // padding garbage?
-/*079*/ uint8 unknown079; // padding garbage?
-};
-
-struct DynamicZoneInfo_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 unknown004;
-/*008*/ uint32 assigned; // padded bool
-/*012*/ uint32 max_players;
-/*016*/ char dz_name[128];
-/*144*/ char leader_name[64];
-};
-
-struct DynamicZoneMemberEntry_Struct
-{
-/*000*/ char name[1]; // variable length, null terminated, max 0x40 (64)
-/*000*/ uint8 online_status; // 0: unknown 1: Online, 2: Offline, 3: In Dynamic Zone, 4: Link Dead
-};
-
-struct DynamicZoneMemberList_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 member_count; // number of players in window
-/*008*/ DynamicZoneMemberEntry_Struct members[0]; // variable length
-};
-
-struct DynamicZoneMemberListName_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 unknown004;
-/*008*/ uint32 add_name; // padded bool, 0: remove name, 1: add name with unknown status
-/*012*/ char name[64];
-};
-
-struct ExpeditionLockoutTimerEntry_Struct
-{
-/*000*/ char expedition_name[1]; // variable length, null terminated, max 0x80 (128)
-/*000*/ uint32 seconds_remaining;
-/*000*/ int32 event_type; // seen -1 (0xffffffff) for replay timers and 1 for event timers
-/*000*/ char event_name[1]; // variable length, null terminated, max 0x100 (256)
-};
-
-struct ExpeditionLockoutTimers_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 count;
-/*008*/ ExpeditionLockoutTimerEntry_Struct timers[0];
-};
-
-struct DynamicZoneLeaderName_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 unknown004;
-/*008*/ char leader_name[64];
-};
-
-struct ExpeditionCommand_Struct
-{
-/*000*/ uint32 unknown000;
-/*004*/ uint32 unknown004;
-/*008*/ char name[64];
-};
-
-struct ExpeditionCommandSwap_Struct
-{
-/*000*/ uint32 unknown000;
-/*004*/ uint32 unknown004;
-/*008*/ char add_player_name[64]; // swap to (player must confirm)
-/*072*/ char rem_player_name[64]; // swap from
+/*008*/ char player_name[64];
+/*072*/ char expedition_name[64];
};
struct ExpeditionExpireWarning
{
-/*000*/ uint32 client_id;
+/*000*/ uint32 clientid;
/*004*/ uint32 unknown004;
/*008*/ uint32 minutes_remaining;
};
-struct DynamicZoneCompassEntry_Struct
+struct ExpeditionInfo_Struct
{
-/*000*/ uint16 dz_zone_id; // target dz id pair
-/*002*/ uint16 dz_instance_id;
-/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
+/*000*/ uint32 clientid;
+/*004*/ uint32 unknown004;
/*008*/ uint32 unknown008;
+/*012*/ uint32 max_players;
+/*016*/ char expedition_name[128];
+/*142*/ char leader_name[64];
+};
+
+struct ExpeditionCompassEntry_Struct
+{
+/*000*/ float unknown000; //seen *((uint32*)) = 1584791871
+/*004*/ uint32 enabled; //guess
+/*008*/ uint32 unknown008; //seen 1019
/*012*/ float y;
/*016*/ float x;
/*020*/ float z;
};
-struct DynamicZoneCompass_Struct
+struct ExpeditionCompass_Struct
{
-/*000*/ uint32 client_id;
+/*000*/ uint32 clientid;
/*004*/ uint32 count;
-/*008*/ DynamicZoneCompassEntry_Struct entries[0];
-};
-
-struct DynamicZoneChooseZoneEntry_Struct
-{
-/*000*/ uint16 dz_zone_id; // dz_id pair
-/*002*/ uint16 dz_instance_id;
-/*004*/ uint32 unknown_id1; // sent back in reply
-/*008*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest -- sent back in reply
-/*012*/ uint32 unknown_id2; // possibly an id based on dz type, for expeditions this was same as dz_id (zone|instance) but task dz was different
-/*016*/ char description[1]; // variable length, null terminated, max 0x80 (128)
-/*000*/ char leader_name[1]; // variable length, null terminated, max 0x40 (64)
-};
-
-struct DynamicZoneChooseZone_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 count;
-/*008*/ DynamicZoneChooseZoneEntry_Struct choices[0];
-};
-
-struct DynamicZoneChooseZoneReply_Struct
-{
-/*000*/ uint32 unknown000; // ff ff ff ff
-/*004*/ uint32 unknown004; // seen 69 00 00 00
-/*008*/ uint32 unknown008; // ff ff ff ff
-/*012*/ uint32 unknown_id1; // from choose zone entry message
-/*016*/ uint16 dz_zone_id; // dz_id pair
-/*018*/ uint16 dz_instance_id;
-/*020*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest
-/*024*/ uint32 unknown_id2; // from choose zone entry message
-/*028*/ uint32 unknown028; // 00 00 00 00
-/*032*/ uint32 unknown032; // always same as unknown044
-/*036*/ uint32 unknown036;
-/*040*/ uint32 unknown040;
-/*044*/ uint32 unknown044; // always same as unknown032
-/*048*/ uint32 unknown048; // seen 01 00 00 00 and 02 00 00 00
+/*008*/ ExpeditionCompassEntry_Struct entries[0];
};
struct AltCurrencySelectItem_Struct {
diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp
index 07758bba6..94e94f946 100644
--- a/common/patches/sof.cpp
+++ b/common/patches/sof.cpp
@@ -471,48 +471,14 @@ namespace SoF
FINISH_ENCODE();
}
- ENCODE(OP_DzChooseZone)
- {
- SETUP_VAR_ENCODE(DynamicZoneChooseZone_Struct);
-
- SerializeBuffer buf;
- buf.WriteUInt32(emu->client_id);
- buf.WriteUInt32(emu->count);
-
- for (uint32 i = 0; i < emu->count; ++i)
- {
- buf.WriteUInt16(emu->choices[i].dz_zone_id);
- buf.WriteUInt16(emu->choices[i].dz_instance_id);
- buf.WriteUInt32(emu->choices[i].unknown_id1);
- buf.WriteUInt32(emu->choices[i].dz_type);
- buf.WriteUInt32(emu->choices[i].unknown_id2);
- buf.WriteString(emu->choices[i].description);
- buf.WriteString(emu->choices[i].leader_name);
- }
-
- __packet->size = buf.size();
- __packet->pBuffer = new unsigned char[__packet->size];
- memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
-
- FINISH_ENCODE();
- }
-
ENCODE(OP_DzCompass)
{
- SETUP_VAR_ENCODE(DynamicZoneCompass_Struct);
- ALLOC_VAR_ENCODE(structs::DynamicZoneCompass_Struct,
- sizeof(structs::DynamicZoneCompass_Struct) +
- sizeof(structs::DynamicZoneCompassEntry_Struct) * emu->count
- );
-
- OUT(client_id);
+ SETUP_VAR_ENCODE(ExpeditionCompass_Struct);
+ ALLOC_VAR_ENCODE(structs::ExpeditionCompass_Struct, sizeof(structs::ExpeditionInfo_Struct) + sizeof(structs::ExpeditionCompassEntry_Struct) * emu->count);
OUT(count);
for (uint32 i = 0; i < emu->count; ++i)
{
- OUT(entries[i].dz_zone_id);
- OUT(entries[i].dz_instance_id);
- OUT(entries[i].dz_type);
OUT(entries[i].x);
OUT(entries[i].y);
OUT(entries[i].z);
@@ -533,108 +499,111 @@ namespace SoF
ENCODE(OP_DzExpeditionInfo)
{
- ENCODE_LENGTH_EXACT(DynamicZoneInfo_Struct);
- SETUP_DIRECT_ENCODE(DynamicZoneInfo_Struct, structs::DynamicZoneInfo_Struct);
+ ENCODE_LENGTH_EXACT(ExpeditionInfo_Struct);
+ SETUP_DIRECT_ENCODE(ExpeditionInfo_Struct, structs::ExpeditionInfo_Struct);
- OUT(client_id);
- OUT(assigned);
OUT(max_players);
- strn0cpy(eq->dz_name, emu->dz_name, sizeof(eq->dz_name));
- strn0cpy(eq->leader_name, emu->leader_name, sizeof(eq->leader_name));
+ eq->enabled_max = 1;
+ strcpy(eq->expedition_name, emu->expedition_name);
+ strcpy(eq->leader_name, emu->leader_name);
FINISH_ENCODE();
}
- ENCODE(OP_DzExpeditionInvite)
+ ENCODE(OP_DzExpeditionList)
{
- ENCODE_LENGTH_EXACT(ExpeditionInvite_Struct);
- SETUP_DIRECT_ENCODE(ExpeditionInvite_Struct, structs::ExpeditionInvite_Struct);
+ SETUP_VAR_ENCODE(ExpeditionLockoutList_Struct);
- OUT(client_id);
- strn0cpy(eq->inviter_name, emu->inviter_name, sizeof(eq->inviter_name));
- strn0cpy(eq->expedition_name, emu->expedition_name, sizeof(eq->expedition_name));
- OUT(swapping);
- strn0cpy(eq->swap_name, emu->swap_name, sizeof(eq->swap_name));
- OUT(dz_zone_id);
- OUT(dz_instance_id);
-
- FINISH_ENCODE();
- }
-
- ENCODE(OP_DzExpeditionLockoutTimers)
- {
- SETUP_VAR_ENCODE(ExpeditionLockoutTimers_Struct);
-
- SerializeBuffer buf;
- buf.WriteUInt32(emu->client_id);
- buf.WriteUInt32(emu->count);
- for (uint32 i = 0; i < emu->count; ++i)
+ std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
+ uint32 client_id = 0;
+ uint8 null_term = 0;
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&emu->count, sizeof(uint32));
+ for (int i = 0; i < emu->count; ++i)
{
- buf.WriteString(emu->timers[i].expedition_name);
- buf.WriteUInt32(emu->timers[i].seconds_remaining);
- buf.WriteInt32(emu->timers[i].event_type);
- buf.WriteString(emu->timers[i].event_name);
+ ss.write(emu->entries[i].expedition, strlen(emu->entries[i].expedition));
+ ss.write((const char*)&null_term, sizeof(char));
+ ss.write((const char*)&emu->entries[i].time_left, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write(emu->entries[i].expedition_event, strlen(emu->entries[i].expedition_event));
+ ss.write((const char*)&null_term, sizeof(char));
}
- __packet->size = buf.size();
+ __packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
- memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
+ memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
FINISH_ENCODE();
}
- ENCODE(OP_DzSetLeaderName)
+ ENCODE(OP_DzJoinExpeditionConfirm)
{
- ENCODE_LENGTH_EXACT(DynamicZoneLeaderName_Struct);
- SETUP_DIRECT_ENCODE(DynamicZoneLeaderName_Struct, structs::DynamicZoneLeaderName_Struct);
+ ENCODE_LENGTH_EXACT(ExpeditionJoinPrompt_Struct);
+ SETUP_DIRECT_ENCODE(ExpeditionJoinPrompt_Struct, structs::ExpeditionJoinPrompt_Struct);
- OUT(client_id);
- strn0cpy(eq->leader_name, emu->leader_name, sizeof(eq->leader_name));
+ strcpy(eq->expedition_name, emu->expedition_name);
+ strcpy(eq->player_name, emu->player_name);
+
+ FINISH_ENCODE();
+ }
+
+ ENCODE(OP_DzLeaderStatus)
+ {
+ SETUP_VAR_ENCODE(ExpeditionLeaderSet_Struct);
+
+ std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
+ uint32 client_id = 0;
+ uint8 null_term = 0;
+
+ ss.write((const char*)&client_id, sizeof(uint32));
+ //ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write(emu->leader_name, strlen(emu->leader_name));
+ ss.write((const char*)&null_term, sizeof(char));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));//0xffffffff
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));//1
+ ss.write((const char*)&client_id, sizeof(uint32));
+
+ __packet->size = ss.str().length();
+ __packet->pBuffer = new unsigned char[__packet->size];
+ memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
FINISH_ENCODE();
}
ENCODE(OP_DzMemberList)
{
- SETUP_VAR_ENCODE(DynamicZoneMemberList_Struct);
+ SETUP_VAR_ENCODE(ExpeditionMemberList_Struct);
- SerializeBuffer buf;
- buf.WriteUInt32(emu->client_id);
- buf.WriteUInt32(emu->member_count);
- for (uint32 i = 0; i < emu->member_count; ++i)
+ std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
+
+ uint32 client_id = 0;
+ uint8 null_term = 0;
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&emu->count, sizeof(uint32));
+ for (uint32 i = 0; i < emu->count; ++i)
{
- buf.WriteString(emu->members[i].name);
- buf.WriteUInt8(emu->members[i].online_status);
+ ss.write(emu->entries[i].name, strlen(emu->entries[i].name));
+ ss.write((const char*)&null_term, sizeof(char));
+ ss.write((const char*)&emu->entries[i].status, sizeof(char));
}
- __packet->size = buf.size();
+ __packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
- memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
+ memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
FINISH_ENCODE();
}
- ENCODE(OP_DzMemberListName)
- {
- ENCODE_LENGTH_EXACT(DynamicZoneMemberListName_Struct);
- SETUP_DIRECT_ENCODE(DynamicZoneMemberListName_Struct, structs::DynamicZoneMemberListName_Struct);
-
- OUT(client_id);
- OUT(add_name);
- strn0cpy(eq->name, emu->name, sizeof(eq->name));
-
- FINISH_ENCODE();
- }
-
- ENCODE(OP_DzMemberListStatus)
- {
- auto emu = reinterpret_cast((*p)->pBuffer);
- if (emu->member_count == 1)
- {
- ENCODE_FORWARD(OP_DzMemberList);
- }
- }
-
ENCODE(OP_Emote)
{
EQApplicationPacket *in = *p;
@@ -1061,7 +1030,6 @@ namespace SoF
OUT(FastRegenHP);
OUT(FastRegenMana);
OUT(FastRegenEndurance);
- OUT(underworld_teleport_index);
/*fill in some unknowns with observed values, hopefully it will help */
eq->unknown796 = -1;
@@ -1140,7 +1108,7 @@ namespace SoF
eq->level1 = emu->level;
// OUT(unknown00022[2]);
for (r = 0; r < 5; r++) {
- OUT(binds[r].zone_id);
+ OUT(binds[r].zoneId);
OUT(binds[r].x);
OUT(binds[r].y);
OUT(binds[r].z);
@@ -2466,83 +2434,6 @@ namespace SoF
FINISH_DIRECT_DECODE();
}
- DECODE(OP_DzAddPlayer)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
- SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
-
- strn0cpy(emu->name, eq->name, sizeof(emu->name));
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzChooseZoneReply)
- {
- DECODE_LENGTH_EXACT(structs::DynamicZoneChooseZoneReply_Struct);
- SETUP_DIRECT_DECODE(DynamicZoneChooseZoneReply_Struct, structs::DynamicZoneChooseZoneReply_Struct);
-
- emu->unknown000 = eq->unknown000;
- emu->unknown008 = eq->unknown004;
- IN(unknown_id1);
- IN(dz_zone_id);
- IN(dz_instance_id);
- IN(dz_type);
- IN(unknown_id2);
- emu->unknown028 = eq->unknown024;
- emu->unknown032 = eq->unknown028;
- emu->unknown036 = eq->unknown032;
- emu->unknown040 = eq->unknown036;
- emu->unknown044 = eq->unknown040;
- emu->unknown048 = eq->unknown044;
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzExpeditionInviteResponse)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionInviteResponse_Struct);
- SETUP_DIRECT_DECODE(ExpeditionInviteResponse_Struct, structs::ExpeditionInviteResponse_Struct);
-
- IN(dz_zone_id);
- IN(dz_instance_id);
- IN(accepted);
- IN(swapping);
- strn0cpy(emu->swap_name, eq->swap_name, sizeof(emu->swap_name));
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzMakeLeader)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
- SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
-
- strn0cpy(emu->name, eq->name, sizeof(emu->name));
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzRemovePlayer)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
- SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
-
- strn0cpy(emu->name, eq->name, sizeof(emu->name));
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzSwapPlayer)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionCommandSwap_Struct);
- SETUP_DIRECT_DECODE(ExpeditionCommandSwap_Struct, structs::ExpeditionCommandSwap_Struct);
-
- strn0cpy(emu->add_player_name, eq->add_player_name, sizeof(emu->add_player_name));
- strn0cpy(emu->rem_player_name, eq->rem_player_name, sizeof(emu->rem_player_name));
-
- FINISH_DIRECT_DECODE();
- }
-
DECODE(OP_Emote)
{
unsigned char *__eq_buffer = __packet->pBuffer;
diff --git a/common/patches/sof_ops.h b/common/patches/sof_ops.h
index 653bb5979..0ff2cfd2f 100644
--- a/common/patches/sof_ops.h
+++ b/common/patches/sof_ops.h
@@ -36,16 +36,13 @@ E(OP_Damage)
E(OP_DeleteCharge)
E(OP_DeleteItem)
E(OP_DeleteSpawn)
-E(OP_DzChooseZone)
E(OP_DzCompass)
E(OP_DzExpeditionEndsWarning)
E(OP_DzExpeditionInfo)
-E(OP_DzExpeditionInvite)
-E(OP_DzExpeditionLockoutTimers)
+E(OP_DzExpeditionList)
+E(OP_DzJoinExpeditionConfirm)
+E(OP_DzLeaderStatus)
E(OP_DzMemberList)
-E(OP_DzMemberListName)
-E(OP_DzMemberListStatus)
-E(OP_DzSetLeaderName)
E(OP_Emote)
E(OP_ExpansionInfo)
E(OP_FormattedMessage)
@@ -106,12 +103,6 @@ D(OP_Consider)
D(OP_ConsiderCorpse)
D(OP_Consume)
D(OP_DeleteItem)
-D(OP_DzAddPlayer)
-D(OP_DzChooseZoneReply)
-D(OP_DzExpeditionInviteResponse)
-D(OP_DzMakeLeader)
-D(OP_DzRemovePlayer)
-D(OP_DzSwapPlayer)
D(OP_Emote)
D(OP_FaceChange)
D(OP_FindPersonRequest)
diff --git a/common/patches/sof_structs.h b/common/patches/sof_structs.h
index 97b200a91..c76ef0b96 100644
--- a/common/patches/sof_structs.h
+++ b/common/patches/sof_structs.h
@@ -448,11 +448,7 @@ struct NewZone_Struct {
/*0844*/ int32 unknown844;
/*0848*/ uint16 zone_id;
/*0850*/ uint16 zone_instance;
-/*0852*/ uint32 scriptNPCReceivedanItem;
-/*0856*/ uint32 bCheck; // padded bool
-/*0860*/ uint32 scriptIDSomething;
-/*0864*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, -1 affects some collisions
-/*0868*/ uint32 scriptIDSomething3;
+/*0852*/ char unknown852[20];
/*0872*/ uint32 SuspendBuffs;
/*0876*/ uint32 unknown876; //seen 50
/*0880*/ uint32 unknown880; //seen 10
@@ -804,7 +800,7 @@ struct LeadershipAA_Struct {
* Size: 20 Octets
*/
struct BindStruct {
- /*000*/ uint32 zone_id;
+ /*000*/ uint32 zoneId;
/*004*/ float x;
/*008*/ float y;
/*012*/ float z;
@@ -1742,7 +1738,7 @@ struct GMZoneRequest_Struct {
/*0068*/ float x;
/*0072*/ float y;
/*0076*/ float z;
-/*0080*/ float heading;
+/*0080*/ char unknown0080[4];
/*0084*/ uint32 success; // 0 if command failed, 1 if succeeded?
/*0088*/
// /*072*/ int8 success; // =0 client->server, =1 server->client, -X=specific error
@@ -4088,150 +4084,43 @@ struct VeteranReward
/*012*/ VeteranRewardItem items[8];
};
-struct ExpeditionInvite_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ char inviter_name[64];
-/*068*/ char expedition_name[128];
-/*196*/ uint8 swapping; // 0: adding 1: swapping
-/*197*/ char swap_name[64]; // if swapping, swap name being removed
-/*261*/ uint8 padding[3];
-/*264*/ uint16 dz_zone_id; // dz_id zone/instance pair, sent back in reply
-/*268*/ uint16 dz_instance_id;
-};
-
-struct ExpeditionInviteResponse_Struct
-{
-/*000*/ uint32 unknown000;
-/*004*/ uint16 dz_zone_id; // dz_id pair sent in invite
-/*006*/ uint16 dz_instance_id;
-/*008*/ uint8 accepted; // 0: declined 1: accepted
-/*009*/ uint8 swapping; // 0: adding 1: swapping (sent in invite)
-/*010*/ char swap_name[64]; // swap name sent in invite
-/*074*/ uint8 unknown078; // padding/garbage?
-/*075*/ uint8 unknown079; // padding/garbage?
-};
-
-struct DynamicZoneInfo_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 assigned; // padded bool
-/*008*/ uint32 max_players;
-/*012*/ char dz_name[128];
-/*140*/ char leader_name[64];
-};
-
-struct DynamicZoneMemberEntry_Struct
-{
-/*000*/ char name[1]; // variable length, null terminated, max 0x40 (64)
-/*000*/ uint8 online_status; // 0: unknown 1: Online, 2: Offline, 3: In Dynamic Zone, 4: Link Dead
-};
-
-struct DynamicZoneMemberList_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 member_count;
-/*008*/ DynamicZoneMemberEntry_Struct members[0]; // variable length
-};
-
-struct DynamicZoneMemberListName_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 add_name; // padded bool, 0: remove name, 1: add name with unknown status
-/*008*/ char name[64];
-};
-
-struct ExpeditionLockoutTimerEntry_Struct
-{
-/*000*/ char expedition_name[1]; // variable length, null terminated, max 0x80 (128)
-/*000*/ uint32 seconds_remaining;
-/*000*/ int32 event_type; // seen -1 (0xffffffff) for replay timers and 1 for event timers
-/*000*/ char event_name[1]; // variable length, null terminated, max 0x100 (256)
-};
-
-struct ExpeditionLockoutTimers_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 count;
-/*008*/ ExpeditionLockoutTimerEntry_Struct timers[0];
-};
-
-struct DynamicZoneLeaderName_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ char leader_name[64];
-};
-
-struct ExpeditionCommand_Struct
-{
-/*000*/ uint32 unknown000;
-/*004*/ char name[64];
-};
-
-struct ExpeditionCommandSwap_Struct
-{
-/*000*/ uint32 unknown000;
-/*004*/ char add_player_name[64]; // swap to (player must confirm)
-/*068*/ char rem_player_name[64]; // swap from
-};
-
struct ExpeditionExpireWarning
{
-/*000*/ uint32 client_id;
+/*000*/ uint32 unknown000;
/*004*/ uint32 minutes_remaining;
};
-struct DynamicZoneCompassEntry_Struct
+struct ExpeditionInfo_Struct
{
-/*000*/ uint16 dz_zone_id; // target dz id pair
-/*002*/ uint16 dz_instance_id;
-/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
-/*008*/ uint32 unknown008;
+/*000*/ uint32 clientid;
+/*004*/ uint32 enabled_max;
+/*008*/ uint32 max_players;
+/*012*/ char expedition_name[128];
+/*142*/ char leader_name[64];
+};
+
+struct ExpeditionCompassEntry_Struct
+{
+/*000*/ float unknown000; //seen *((uint32*)) = 1584791871
+/*004*/ uint32 enabled; //guess
+/*008*/ uint32 unknown008; //seen 1019
/*012*/ float y;
/*016*/ float x;
/*020*/ float z;
};
-struct DynamicZoneCompass_Struct
+struct ExpeditionCompass_Struct
{
-/*000*/ uint32 client_id;
+/*000*/ uint32 clientid;
/*004*/ uint32 count;
-/*008*/ DynamicZoneCompassEntry_Struct entries[0];
+/*008*/ ExpeditionCompassEntry_Struct entries[0];
};
-struct DynamicZoneChooseZoneEntry_Struct
+struct ExpeditionJoinPrompt_Struct
{
-/*000*/ uint16 dz_zone_id; // dz_id pair
-/*002*/ uint16 dz_instance_id;
-/*004*/ uint32 unknown_id1; // sent back in reply
-/*008*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest -- sent back in reply
-/*012*/ uint32 unknown_id2; // possibly an id based on dz type, for expeditions this was same as dz_id (zone|instance) but task dz was different
-/*016*/ char description[1]; // variable length, null terminated, max 0x80 (128)
-/*000*/ char leader_name[1]; // variable length, null terminated, max 0x40 (64)
-};
-
-struct DynamicZoneChooseZone_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 count;
-/*008*/ DynamicZoneChooseZoneEntry_Struct choices[0];
-};
-
-struct DynamicZoneChooseZoneReply_Struct
-{
-/*000*/ uint32 unknown000;
-/*004*/ uint32 unknown004;
-/*008*/ uint32 unknown_id1;
-/*012*/ uint16 dz_zone_id;
-/*014*/ uint16 dz_instance_id;
-/*016*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest
-/*020*/ uint32 unknown_id2;
-/*024*/ uint32 unknown024;
-/*028*/ uint32 unknown028; // always same as unknown040
-/*032*/ uint32 unknown032;
-/*036*/ uint32 unknown036;
-/*040*/ uint32 unknown040; // always same as unknown028
-/*044*/ uint32 unknown044;
+/*000*/ uint32 clientid;
+/*004*/ char player_name[64];
+/*068*/ char expedition_name[64];
};
struct AltCurrencySelectItem_Struct {
diff --git a/common/patches/titanium.cpp b/common/patches/titanium.cpp
index bb35d9f87..505bca10c 100644
--- a/common/patches/titanium.cpp
+++ b/common/patches/titanium.cpp
@@ -414,48 +414,15 @@ namespace Titanium
FINISH_ENCODE();
}
- ENCODE(OP_DzChooseZone)
- {
- SETUP_VAR_ENCODE(DynamicZoneChooseZone_Struct);
-
- SerializeBuffer buf;
- buf.WriteUInt32(emu->client_id);
- buf.WriteUInt32(emu->count);
-
- for (uint32 i = 0; i < emu->count; ++i)
- {
- buf.WriteUInt16(emu->choices[i].dz_zone_id);
- buf.WriteUInt16(emu->choices[i].dz_instance_id);
- buf.WriteUInt32(emu->choices[i].unknown_id1);
- buf.WriteUInt32(emu->choices[i].dz_type);
- buf.WriteUInt32(emu->choices[i].unknown_id2);
- buf.WriteString(emu->choices[i].description);
- buf.WriteString(emu->choices[i].leader_name);
- }
-
- __packet->size = buf.size();
- __packet->pBuffer = new unsigned char[__packet->size];
- memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
-
- FINISH_ENCODE();
- }
-
ENCODE(OP_DzCompass)
{
- SETUP_VAR_ENCODE(DynamicZoneCompass_Struct);
- ALLOC_VAR_ENCODE(structs::DynamicZoneCompass_Struct,
- sizeof(structs::DynamicZoneCompass_Struct) +
- sizeof(structs::DynamicZoneCompassEntry_Struct) * emu->count
- );
+ SETUP_VAR_ENCODE(ExpeditionCompass_Struct);
+ ALLOC_VAR_ENCODE(structs::ExpeditionCompass_Struct, sizeof(structs::ExpeditionInfo_Struct) + sizeof(structs::ExpeditionCompassEntry_Struct) * emu->count);
- OUT(client_id);
OUT(count);
for (uint32 i = 0; i < emu->count; ++i)
{
- OUT(entries[i].dz_zone_id);
- OUT(entries[i].dz_instance_id);
- OUT(entries[i].dz_type);
OUT(entries[i].x);
OUT(entries[i].y);
OUT(entries[i].z);
@@ -476,108 +443,111 @@ namespace Titanium
ENCODE(OP_DzExpeditionInfo)
{
- ENCODE_LENGTH_EXACT(DynamicZoneInfo_Struct);
- SETUP_DIRECT_ENCODE(DynamicZoneInfo_Struct, structs::DynamicZoneInfo_Struct);
+ ENCODE_LENGTH_EXACT(ExpeditionInfo_Struct);
+ SETUP_DIRECT_ENCODE(ExpeditionInfo_Struct, structs::ExpeditionInfo_Struct);
- OUT(client_id);
- OUT(assigned);
OUT(max_players);
- strn0cpy(eq->dz_name, emu->dz_name, sizeof(eq->dz_name));
- strn0cpy(eq->leader_name, emu->leader_name, sizeof(eq->leader_name));
+ eq->enabled_max = 1;
+ strcpy(eq->expedition_name, emu->expedition_name);
+ strcpy(eq->leader_name, emu->leader_name);
FINISH_ENCODE();
}
- ENCODE(OP_DzExpeditionInvite)
+ ENCODE(OP_DzExpeditionList)
{
- ENCODE_LENGTH_EXACT(ExpeditionInvite_Struct);
- SETUP_DIRECT_ENCODE(ExpeditionInvite_Struct, structs::ExpeditionInvite_Struct);
+ SETUP_VAR_ENCODE(ExpeditionLockoutList_Struct);
- OUT(client_id);
- strn0cpy(eq->inviter_name, emu->inviter_name, sizeof(eq->inviter_name));
- strn0cpy(eq->expedition_name, emu->expedition_name, sizeof(eq->expedition_name));
- OUT(swapping);
- strn0cpy(eq->swap_name, emu->swap_name, sizeof(eq->swap_name));
- OUT(dz_zone_id);
- OUT(dz_instance_id);
-
- FINISH_ENCODE();
- }
-
- ENCODE(OP_DzExpeditionLockoutTimers)
- {
- SETUP_VAR_ENCODE(ExpeditionLockoutTimers_Struct);
-
- SerializeBuffer buf;
- buf.WriteUInt32(emu->client_id);
- buf.WriteUInt32(emu->count);
+ std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
+ uint32 client_id = 0;
+ uint8 null_term = 0;
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&emu->count, sizeof(uint32));
for (uint32 i = 0; i < emu->count; ++i)
{
- buf.WriteString(emu->timers[i].expedition_name);
- buf.WriteUInt32(emu->timers[i].seconds_remaining);
- buf.WriteInt32(emu->timers[i].event_type);
- buf.WriteString(emu->timers[i].event_name);
+ ss.write(emu->entries[i].expedition, strlen(emu->entries[i].expedition));
+ ss.write((const char*)&null_term, sizeof(char));
+ ss.write((const char*)&emu->entries[i].time_left, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write(emu->entries[i].expedition_event, strlen(emu->entries[i].expedition_event));
+ ss.write((const char*)&null_term, sizeof(char));
}
- __packet->size = buf.size();
+ __packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
- memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
+ memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
FINISH_ENCODE();
}
- ENCODE(OP_DzSetLeaderName)
+ ENCODE(OP_DzJoinExpeditionConfirm)
{
- ENCODE_LENGTH_EXACT(DynamicZoneLeaderName_Struct);
- SETUP_DIRECT_ENCODE(DynamicZoneLeaderName_Struct, structs::DynamicZoneLeaderName_Struct);
+ ENCODE_LENGTH_EXACT(ExpeditionJoinPrompt_Struct);
+ SETUP_DIRECT_ENCODE(ExpeditionJoinPrompt_Struct, structs::ExpeditionJoinPrompt_Struct);
- OUT(client_id);
- strn0cpy(eq->leader_name, emu->leader_name, sizeof(eq->leader_name));
+ strcpy(eq->expedition_name, emu->expedition_name);
+ strcpy(eq->player_name, emu->player_name);
+
+ FINISH_ENCODE();
+ }
+
+ ENCODE(OP_DzLeaderStatus)
+ {
+ SETUP_VAR_ENCODE(ExpeditionLeaderSet_Struct);
+
+ std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
+ uint32 client_id = 0;
+ uint8 null_term = 0;
+
+ ss.write((const char*)&client_id, sizeof(uint32));
+ //ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write(emu->leader_name, strlen(emu->leader_name));
+ ss.write((const char*)&null_term, sizeof(char));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));//0xffffffff
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));//1
+ ss.write((const char*)&client_id, sizeof(uint32));
+
+ __packet->size = ss.str().length();
+ __packet->pBuffer = new unsigned char[__packet->size];
+ memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
FINISH_ENCODE();
}
ENCODE(OP_DzMemberList)
{
- SETUP_VAR_ENCODE(DynamicZoneMemberList_Struct);
+ SETUP_VAR_ENCODE(ExpeditionMemberList_Struct);
- SerializeBuffer buf;
- buf.WriteUInt32(emu->client_id);
- buf.WriteUInt32(emu->member_count);
- for (uint32 i = 0; i < emu->member_count; ++i)
+ std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
+
+ uint32 client_id = 0;
+ uint8 null_term = 0;
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&emu->count, sizeof(uint32));
+ for (uint32 i = 0; i < emu->count; ++i)
{
- buf.WriteString(emu->members[i].name);
- buf.WriteUInt8(emu->members[i].online_status);
+ ss.write(emu->entries[i].name, strlen(emu->entries[i].name));
+ ss.write((const char*)&null_term, sizeof(char));
+ ss.write((const char*)&emu->entries[i].status, sizeof(char));
}
- __packet->size = buf.size();
+ __packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
- memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
+ memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
FINISH_ENCODE();
}
- ENCODE(OP_DzMemberListName)
- {
- ENCODE_LENGTH_EXACT(DynamicZoneMemberListName_Struct);
- SETUP_DIRECT_ENCODE(DynamicZoneMemberListName_Struct, structs::DynamicZoneMemberListName_Struct);
-
- OUT(client_id);
- OUT(add_name);
- strn0cpy(eq->name, emu->name, sizeof(eq->name));
-
- FINISH_ENCODE();
- }
-
- ENCODE(OP_DzMemberListStatus)
- {
- auto emu = reinterpret_cast((*p)->pBuffer);
- if (emu->member_count == 1)
- {
- ENCODE_FORWARD(OP_DzMemberList);
- }
- }
-
ENCODE(OP_Emote)
{
EQApplicationPacket *in = *p;
@@ -1022,7 +992,7 @@ namespace Titanium
eq->level1 = emu->level;
// OUT(unknown00022[2]);
for (r = 0; r < 5; r++) {
- OUT(binds[r].zone_id);
+ OUT(binds[r].zoneId);
OUT(binds[r].x);
OUT(binds[r].y);
OUT(binds[r].z);
@@ -1973,83 +1943,6 @@ namespace Titanium
FINISH_DIRECT_DECODE();
}
- DECODE(OP_DzAddPlayer)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
- SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
-
- strn0cpy(emu->name, eq->name, sizeof(emu->name));
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzChooseZoneReply)
- {
- DECODE_LENGTH_EXACT(structs::DynamicZoneChooseZoneReply_Struct);
- SETUP_DIRECT_DECODE(DynamicZoneChooseZoneReply_Struct, structs::DynamicZoneChooseZoneReply_Struct);
-
- emu->unknown000 = eq->unknown000;
- emu->unknown008 = eq->unknown004;
- IN(unknown_id1);
- IN(dz_zone_id);
- IN(dz_instance_id);
- IN(dz_type);
- IN(unknown_id2);
- emu->unknown028 = eq->unknown024;
- emu->unknown032 = eq->unknown028;
- emu->unknown036 = eq->unknown032;
- emu->unknown040 = eq->unknown036;
- emu->unknown044 = eq->unknown040;
- emu->unknown048 = eq->unknown044;
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzExpeditionInviteResponse)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionInviteResponse_Struct);
- SETUP_DIRECT_DECODE(ExpeditionInviteResponse_Struct, structs::ExpeditionInviteResponse_Struct);
-
- IN(dz_zone_id);
- IN(dz_instance_id);
- IN(accepted);
- IN(swapping);
- strn0cpy(emu->swap_name, eq->swap_name, sizeof(emu->swap_name));
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzMakeLeader)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
- SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
-
- strn0cpy(emu->name, eq->name, sizeof(emu->name));
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzRemovePlayer)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
- SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
-
- strn0cpy(emu->name, eq->name, sizeof(emu->name));
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzSwapPlayer)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionCommandSwap_Struct);
- SETUP_DIRECT_DECODE(ExpeditionCommandSwap_Struct, structs::ExpeditionCommandSwap_Struct);
-
- strn0cpy(emu->add_player_name, eq->add_player_name, sizeof(emu->add_player_name));
- strn0cpy(emu->rem_player_name, eq->rem_player_name, sizeof(emu->rem_player_name));
-
- FINISH_DIRECT_DECODE();
- }
-
DECODE(OP_Emote)
{
unsigned char *__eq_buffer = __packet->pBuffer;
diff --git a/common/patches/titanium_ops.h b/common/patches/titanium_ops.h
index 961c850fe..d3c8c1dde 100644
--- a/common/patches/titanium_ops.h
+++ b/common/patches/titanium_ops.h
@@ -32,16 +32,13 @@ E(OP_Damage)
E(OP_DeleteCharge)
E(OP_DeleteItem)
E(OP_DeleteSpawn)
-E(OP_DzChooseZone)
E(OP_DzCompass)
E(OP_DzExpeditionEndsWarning)
E(OP_DzExpeditionInfo)
-E(OP_DzExpeditionInvite)
-E(OP_DzExpeditionLockoutTimers)
+E(OP_DzExpeditionList)
+E(OP_DzJoinExpeditionConfirm)
+E(OP_DzLeaderStatus)
E(OP_DzMemberList)
-E(OP_DzMemberListName)
-E(OP_DzMemberListStatus)
-E(OP_DzSetLeaderName)
E(OP_Emote)
E(OP_FormattedMessage)
E(OP_GroundSpawn)
@@ -89,12 +86,6 @@ D(OP_CharacterCreate)
D(OP_ClientUpdate)
D(OP_Consume)
D(OP_DeleteItem)
-D(OP_DzAddPlayer)
-D(OP_DzChooseZoneReply)
-D(OP_DzExpeditionInviteResponse)
-D(OP_DzMakeLeader)
-D(OP_DzRemovePlayer)
-D(OP_DzSwapPlayer)
D(OP_Emote)
D(OP_FaceChange)
D(OP_InspectAnswer)
diff --git a/common/patches/titanium_structs.h b/common/patches/titanium_structs.h
index 2846288bc..f620089d6 100644
--- a/common/patches/titanium_structs.h
+++ b/common/patches/titanium_structs.h
@@ -738,7 +738,7 @@ struct LeadershipAA_Struct {
* Size: 20 Octets
*/
struct BindStruct {
- /*000*/ uint32 zone_id;
+ /*000*/ uint32 zoneId;
/*004*/ float x;
/*008*/ float y;
/*012*/ float z;
@@ -1509,7 +1509,7 @@ struct GMZoneRequest_Struct {
/*0068*/ float x;
/*0072*/ float y;
/*0076*/ float z;
-/*0080*/ float heading;
+/*0080*/ char unknown0080[4];
/*0084*/ uint32 success; // 0 if command failed, 1 if succeeded?
/*0088*/
// /*072*/ int8 success; // =0 client->server, =1 server->client, -X=specific error
@@ -3299,150 +3299,43 @@ struct VeteranReward
/*004*/ VeteranRewardItem item;
};
-struct ExpeditionInvite_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ char inviter_name[64];
-/*068*/ char expedition_name[128];
-/*196*/ uint8 swapping; // 0: adding 1: swapping
-/*197*/ char swap_name[64]; // if swapping, swap name being removed
-/*261*/ uint8 padding[3];
-/*264*/ uint16 dz_zone_id; // dz_id zone/instance pair, sent back in reply
-/*268*/ uint16 dz_instance_id;
-};
-
-struct ExpeditionInviteResponse_Struct
-{
-/*000*/ uint32 unknown000;
-/*004*/ uint16 dz_zone_id; // dz_id pair sent in invite
-/*006*/ uint16 dz_instance_id;
-/*008*/ uint8 accepted; // 0: declined 1: accepted
-/*009*/ uint8 swapping; // 0: adding 1: swapping (sent in invite)
-/*010*/ char swap_name[64]; // swap name sent in invite
-/*074*/ uint8 unknown078; // padding/garbage?
-/*075*/ uint8 unknown079; // padding/garbage?
-};
-
-struct DynamicZoneInfo_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 assigned; // padded bool
-/*008*/ uint32 max_players;
-/*012*/ char dz_name[128];
-/*140*/ char leader_name[64];
-};
-
-struct DynamicZoneMemberEntry_Struct
-{
-/*000*/ char name[1]; // variable length, null terminated, max 0x40 (64)
-/*000*/ uint8 online_status; // 0: unknown 1: Online, 2: Offline, 3: In Dynamic Zone, 4: Link Dead
-};
-
-struct DynamicZoneMemberList_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 member_count;
-/*008*/ DynamicZoneMemberEntry_Struct members[0]; // variable length
-};
-
-struct DynamicZoneMemberListName_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 add_name; // padded bool, 0: remove name, 1: add name with unknown status
-/*008*/ char name[64];
-};
-
-struct ExpeditionLockoutTimerEntry_Struct
-{
-/*000*/ char expedition_name[1]; // variable length, null terminated, max 0x80 (128)
-/*000*/ uint32 seconds_remaining;
-/*000*/ int32 event_type; // seen -1 (0xffffffff) for replay timers and 1 for event timers
-/*000*/ char event_name[1]; // variable length, null terminated, max 0x100 (256)
-};
-
-struct ExpeditionLockoutTimers_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 count;
-/*008*/ ExpeditionLockoutTimerEntry_Struct timers[0];
-};
-
-struct DynamicZoneLeaderName_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ char leader_name[64];
-};
-
-struct ExpeditionCommand_Struct
-{
-/*000*/ uint32 unknown000;
-/*004*/ char name[64];
-};
-
-struct ExpeditionCommandSwap_Struct
-{
-/*000*/ uint32 unknown000;
-/*004*/ char add_player_name[64]; // swap to (player must confirm)
-/*068*/ char rem_player_name[64]; // swap from
-};
-
struct ExpeditionExpireWarning
{
-/*000*/ uint32 client_id;
+/*000*/ uint32 unknown000;
/*004*/ uint32 minutes_remaining;
};
-struct DynamicZoneCompassEntry_Struct
+struct ExpeditionInfo_Struct
{
-/*000*/ uint16 dz_zone_id; // target dz id pair
-/*002*/ uint16 dz_instance_id;
-/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
-/*008*/ uint32 unknown008;
+/*000*/ uint32 clientid;
+/*004*/ uint32 enabled_max;
+/*008*/ uint32 max_players;
+/*012*/ char expedition_name[128];
+/*142*/ char leader_name[64];
+};
+
+struct ExpeditionCompassEntry_Struct
+{
+/*000*/ float unknown000; //seen *((uint32*)) = 1584791871
+/*004*/ uint32 enabled; //guess
+/*008*/ uint32 unknown008; //seen 1019
/*012*/ float y;
/*016*/ float x;
/*020*/ float z;
};
-struct DynamicZoneCompass_Struct
+struct ExpeditionCompass_Struct
{
-/*000*/ uint32 client_id;
+/*000*/ uint32 clientid;
/*004*/ uint32 count;
-/*008*/ DynamicZoneCompassEntry_Struct entries[0];
+/*008*/ ExpeditionCompassEntry_Struct entries[0];
};
-struct DynamicZoneChooseZoneEntry_Struct
+struct ExpeditionJoinPrompt_Struct
{
-/*000*/ uint16 dz_zone_id; // dz_id pair
-/*002*/ uint16 dz_instance_id;
-/*004*/ uint32 unknown_id1; // sent back in reply
-/*008*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest -- sent back in reply
-/*012*/ uint32 unknown_id2; // possibly an id based on dz type, for expeditions this was same as dz_id (zone|instance) but task dz was different
-/*016*/ char description[1]; // variable length, null terminated, max 0x80 (128)
-/*000*/ char leader_name[1]; // variable length, null terminated, max 0x40 (64)
-};
-
-struct DynamicZoneChooseZone_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 count;
-/*008*/ DynamicZoneChooseZoneEntry_Struct choices[0];
-};
-
-struct DynamicZoneChooseZoneReply_Struct
-{
-/*000*/ uint32 unknown000;
-/*004*/ uint32 unknown004;
-/*008*/ uint32 unknown_id1;
-/*012*/ uint16 dz_zone_id;
-/*014*/ uint16 dz_instance_id;
-/*016*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest
-/*020*/ uint32 unknown_id2;
-/*024*/ uint32 unknown024;
-/*028*/ uint32 unknown028; // always same as unknown040
-/*032*/ uint32 unknown032;
-/*036*/ uint32 unknown036;
-/*040*/ uint32 unknown040; // always same as unknown028
-/*044*/ uint32 unknown044;
+/*000*/ uint32 clientid;
+/*004*/ char player_name[64];
+/*068*/ char expedition_name[64];
};
struct LFGuild_SearchPlayer_Struct
diff --git a/common/patches/uf.cpp b/common/patches/uf.cpp
index c23415737..49c13833d 100644
--- a/common/patches/uf.cpp
+++ b/common/patches/uf.cpp
@@ -613,48 +613,14 @@ namespace UF
FINISH_ENCODE();
}
- ENCODE(OP_DzChooseZone)
- {
- SETUP_VAR_ENCODE(DynamicZoneChooseZone_Struct);
-
- SerializeBuffer buf;
- buf.WriteUInt32(emu->client_id);
- buf.WriteUInt32(emu->count);
-
- for (uint32 i = 0; i < emu->count; ++i)
- {
- buf.WriteUInt16(emu->choices[i].dz_zone_id);
- buf.WriteUInt16(emu->choices[i].dz_instance_id);
- buf.WriteUInt32(emu->choices[i].unknown_id1);
- buf.WriteUInt32(emu->choices[i].dz_type);
- buf.WriteUInt32(emu->choices[i].unknown_id2);
- buf.WriteString(emu->choices[i].description);
- buf.WriteString(emu->choices[i].leader_name);
- }
-
- __packet->size = buf.size();
- __packet->pBuffer = new unsigned char[__packet->size];
- memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
-
- FINISH_ENCODE();
- }
-
ENCODE(OP_DzCompass)
{
- SETUP_VAR_ENCODE(DynamicZoneCompass_Struct);
- ALLOC_VAR_ENCODE(structs::DynamicZoneCompass_Struct,
- sizeof(structs::DynamicZoneCompass_Struct) +
- sizeof(structs::DynamicZoneCompassEntry_Struct) * emu->count
- );
-
- OUT(client_id);
+ SETUP_VAR_ENCODE(ExpeditionCompass_Struct);
+ ALLOC_VAR_ENCODE(structs::ExpeditionCompass_Struct, sizeof(structs::ExpeditionInfo_Struct) + sizeof(structs::ExpeditionCompassEntry_Struct) * emu->count);
OUT(count);
for (uint32 i = 0; i < emu->count; ++i)
{
- OUT(entries[i].dz_zone_id);
- OUT(entries[i].dz_instance_id);
- OUT(entries[i].dz_type);
OUT(entries[i].x);
OUT(entries[i].y);
OUT(entries[i].z);
@@ -675,108 +641,112 @@ namespace UF
ENCODE(OP_DzExpeditionInfo)
{
- ENCODE_LENGTH_EXACT(DynamicZoneInfo_Struct);
- SETUP_DIRECT_ENCODE(DynamicZoneInfo_Struct, structs::DynamicZoneInfo_Struct);
+ ENCODE_LENGTH_EXACT(ExpeditionInfo_Struct);
+ SETUP_DIRECT_ENCODE(ExpeditionInfo_Struct, structs::ExpeditionInfo_Struct);
- OUT(client_id);
- OUT(assigned);
OUT(max_players);
- strn0cpy(eq->dz_name, emu->dz_name, sizeof(eq->dz_name));
- strn0cpy(eq->leader_name, emu->leader_name, sizeof(eq->leader_name));
+ eq->unknown004 = 785316192;
+ eq->unknown008 = 435601;
+ strcpy(eq->expedition_name, emu->expedition_name);
+ strcpy(eq->leader_name, emu->leader_name);
FINISH_ENCODE();
}
- ENCODE(OP_DzExpeditionInvite)
+ ENCODE(OP_DzExpeditionList)
{
- ENCODE_LENGTH_EXACT(ExpeditionInvite_Struct);
- SETUP_DIRECT_ENCODE(ExpeditionInvite_Struct, structs::ExpeditionInvite_Struct);
+ SETUP_VAR_ENCODE(ExpeditionLockoutList_Struct);
- OUT(client_id);
- strn0cpy(eq->inviter_name, emu->inviter_name, sizeof(eq->inviter_name));
- strn0cpy(eq->expedition_name, emu->expedition_name, sizeof(eq->expedition_name));
- OUT(swapping);
- strn0cpy(eq->swap_name, emu->swap_name, sizeof(eq->swap_name));
- OUT(dz_zone_id);
- OUT(dz_instance_id);
-
- FINISH_ENCODE();
- }
-
- ENCODE(OP_DzExpeditionLockoutTimers)
- {
- SETUP_VAR_ENCODE(ExpeditionLockoutTimers_Struct);
-
- SerializeBuffer buf;
- buf.WriteUInt32(emu->client_id);
- buf.WriteUInt32(emu->count);
+ std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
+ uint32 client_id = 0;
+ uint8 null_term = 0;
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&emu->count, sizeof(uint32));
for (uint32 i = 0; i < emu->count; ++i)
{
- buf.WriteString(emu->timers[i].expedition_name);
- buf.WriteUInt32(emu->timers[i].seconds_remaining);
- buf.WriteInt32(emu->timers[i].event_type);
- buf.WriteString(emu->timers[i].event_name);
+ ss.write(emu->entries[i].expedition, strlen(emu->entries[i].expedition));
+ ss.write((const char*)&null_term, sizeof(char));
+ ss.write((const char*)&emu->entries[i].time_left, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write(emu->entries[i].expedition_event, strlen(emu->entries[i].expedition_event));
+ ss.write((const char*)&null_term, sizeof(char));
}
- __packet->size = buf.size();
+ __packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
- memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
+ memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
FINISH_ENCODE();
}
- ENCODE(OP_DzSetLeaderName)
+ ENCODE(OP_DzJoinExpeditionConfirm)
{
- ENCODE_LENGTH_EXACT(DynamicZoneLeaderName_Struct);
- SETUP_DIRECT_ENCODE(DynamicZoneLeaderName_Struct, structs::DynamicZoneLeaderName_Struct);
+ ENCODE_LENGTH_EXACT(ExpeditionJoinPrompt_Struct);
+ SETUP_DIRECT_ENCODE(ExpeditionJoinPrompt_Struct, structs::ExpeditionJoinPrompt_Struct);
- OUT(client_id);
- strn0cpy(eq->leader_name, emu->leader_name, sizeof(eq->leader_name));
+ strcpy(eq->expedition_name, emu->expedition_name);
+ strcpy(eq->player_name, emu->player_name);
+
+ FINISH_ENCODE();
+ }
+
+ ENCODE(OP_DzLeaderStatus)
+ {
+ SETUP_VAR_ENCODE(ExpeditionLeaderSet_Struct);
+
+ std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
+ uint32 client_id = 0;
+ uint8 null_term = 0;
+
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write(emu->leader_name, strlen(emu->leader_name));
+ ss.write((const char*)&null_term, sizeof(char));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));//0xffffffff
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&client_id, sizeof(uint32));//1
+ ss.write((const char*)&client_id, sizeof(uint32));
+
+ __packet->size = ss.str().length();
+ __packet->pBuffer = new unsigned char[__packet->size];
+ memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
FINISH_ENCODE();
}
ENCODE(OP_DzMemberList)
{
- SETUP_VAR_ENCODE(DynamicZoneMemberList_Struct);
+ SETUP_VAR_ENCODE(ExpeditionMemberList_Struct);
- SerializeBuffer buf;
- buf.WriteUInt32(emu->client_id);
- buf.WriteUInt32(emu->member_count);
- for (uint32 i = 0; i < emu->member_count; ++i)
+ std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
+
+ uint32 client_id = 0;
+ uint8 null_term = 0;
+ ss.write((const char*)&client_id, sizeof(uint32));
+ ss.write((const char*)&emu->count, sizeof(uint32));
+ for (uint32 i = 0; i < emu->count; ++i)
{
- buf.WriteString(emu->members[i].name);
- buf.WriteUInt8(emu->members[i].online_status);
+ ss.write(emu->entries[i].name, strlen(emu->entries[i].name));
+ ss.write((const char*)&null_term, sizeof(char));
+ ss.write((const char*)&emu->entries[i].status, sizeof(char));
}
- __packet->size = buf.size();
+ __packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
- memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
+ memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
FINISH_ENCODE();
}
- ENCODE(OP_DzMemberListName)
- {
- ENCODE_LENGTH_EXACT(DynamicZoneMemberListName_Struct);
- SETUP_DIRECT_ENCODE(DynamicZoneMemberListName_Struct, structs::DynamicZoneMemberListName_Struct);
-
- OUT(client_id);
- OUT(add_name);
- strn0cpy(eq->name, emu->name, sizeof(eq->name));
-
- FINISH_ENCODE();
- }
-
- ENCODE(OP_DzMemberListStatus)
- {
- auto emu = reinterpret_cast((*p)->pBuffer);
- if (emu->member_count == 1)
- {
- ENCODE_FORWARD(OP_DzMemberList);
- }
- }
-
ENCODE(OP_Emote)
{
EQApplicationPacket *in = *p;
@@ -1607,7 +1577,6 @@ namespace UF
OUT(FastRegenHP);
OUT(FastRegenMana);
OUT(FastRegenEndurance);
- OUT(underworld_teleport_index);
eq->FogDensity = emu->fog_density;
@@ -1705,7 +1674,7 @@ namespace UF
eq->level1 = emu->level;
// OUT(unknown00022[2]);
for (r = 0; r < 5; r++) {
- OUT(binds[r].zone_id);
+ OUT(binds[r].zoneId);
OUT(binds[r].x);
OUT(binds[r].y);
OUT(binds[r].z);
@@ -3345,84 +3314,6 @@ namespace UF
FINISH_DIRECT_DECODE();
}
- DECODE(OP_DzAddPlayer)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
- SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
-
- strn0cpy(emu->name, eq->name, sizeof(emu->name));
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzChooseZoneReply)
- {
- DECODE_LENGTH_EXACT(structs::DynamicZoneChooseZoneReply_Struct);
- SETUP_DIRECT_DECODE(DynamicZoneChooseZoneReply_Struct, structs::DynamicZoneChooseZoneReply_Struct);
-
- IN(unknown000);
- IN(unknown004);
- IN(unknown008);
- IN(unknown_id1);
- IN(dz_zone_id);
- IN(dz_instance_id);
- IN(dz_type);
- IN(unknown_id2);
- IN(unknown028);
- IN(unknown032);
- IN(unknown036);
- IN(unknown040);
- IN(unknown044);
- IN(unknown048);
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzExpeditionInviteResponse)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionInviteResponse_Struct);
- SETUP_DIRECT_DECODE(ExpeditionInviteResponse_Struct, structs::ExpeditionInviteResponse_Struct);
-
- IN(dz_zone_id);
- IN(dz_instance_id);
- IN(accepted);
- IN(swapping);
- strn0cpy(emu->swap_name, eq->swap_name, sizeof(emu->swap_name));
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzMakeLeader)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
- SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
-
- strn0cpy(emu->name, eq->name, sizeof(emu->name));
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzRemovePlayer)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
- SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
-
- strn0cpy(emu->name, eq->name, sizeof(emu->name));
-
- FINISH_DIRECT_DECODE();
- }
-
- DECODE(OP_DzSwapPlayer)
- {
- DECODE_LENGTH_EXACT(structs::ExpeditionCommandSwap_Struct);
- SETUP_DIRECT_DECODE(ExpeditionCommandSwap_Struct, structs::ExpeditionCommandSwap_Struct);
-
- strn0cpy(emu->add_player_name, eq->add_player_name, sizeof(emu->add_player_name));
- strn0cpy(emu->rem_player_name, eq->rem_player_name, sizeof(emu->rem_player_name));
-
- FINISH_DIRECT_DECODE();
- }
-
DECODE(OP_Emote)
{
unsigned char *__eq_buffer = __packet->pBuffer;
diff --git a/common/patches/uf_ops.h b/common/patches/uf_ops.h
index 76b7e014b..9d7742cf0 100644
--- a/common/patches/uf_ops.h
+++ b/common/patches/uf_ops.h
@@ -38,16 +38,13 @@ E(OP_Damage)
E(OP_DeleteCharge)
E(OP_DeleteItem)
E(OP_DisciplineUpdate)
-E(OP_DzChooseZone)
E(OP_DzCompass)
E(OP_DzExpeditionEndsWarning)
E(OP_DzExpeditionInfo)
-E(OP_DzExpeditionInvite)
-E(OP_DzExpeditionLockoutTimers)
+E(OP_DzExpeditionList)
+E(OP_DzJoinExpeditionConfirm)
+E(OP_DzLeaderStatus)
E(OP_DzMemberList)
-E(OP_DzMemberListName)
-E(OP_DzMemberListStatus)
-E(OP_DzSetLeaderName)
E(OP_Emote)
E(OP_ExpansionInfo)
E(OP_FormattedMessage)
@@ -123,12 +120,6 @@ D(OP_ConsiderCorpse)
D(OP_Consume)
D(OP_Damage)
D(OP_DeleteItem)
-D(OP_DzAddPlayer)
-D(OP_DzChooseZoneReply)
-D(OP_DzExpeditionInviteResponse)
-D(OP_DzMakeLeader)
-D(OP_DzRemovePlayer)
-D(OP_DzSwapPlayer)
D(OP_Emote)
D(OP_EnvDamage)
D(OP_FaceChange)
diff --git a/common/patches/uf_structs.h b/common/patches/uf_structs.h
index 6c1b4a4ed..a87ab7a07 100644
--- a/common/patches/uf_structs.h
+++ b/common/patches/uf_structs.h
@@ -444,11 +444,7 @@ struct NewZone_Struct {
/*0848*/ int32 unknown848;
/*0852*/ uint16 zone_id;
/*0854*/ uint16 zone_instance;
-/*0856*/ uint32 scriptNPCReceivedanItem;
-/*0860*/ uint32 bCheck; // padded bool
-/*0864*/ uint32 scriptIDSomething;
-/*0868*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, -1 affects some collisions
-/*0872*/ uint32 scriptIDSomething3;
+/*0856*/ char unknown856[20];
/*0876*/ uint32 SuspendBuffs;
/*0880*/ uint32 unknown880; //seen 50
/*0884*/ uint32 unknown884; //seen 10
@@ -833,7 +829,7 @@ struct LeadershipAA_Struct {
* Size: 20 Octets
*/
struct BindStruct {
- /*000*/ uint32 zone_id;
+ /*000*/ uint32 zoneId;
/*004*/ float x;
/*008*/ float y;
/*012*/ float z;
@@ -1755,7 +1751,7 @@ struct GMZoneRequest_Struct {
/*0068*/ float x;
/*0072*/ float y;
/*0076*/ float z;
-/*0080*/ float heading;
+/*0080*/ char unknown0080[4];
/*0084*/ uint32 success; // 0 if command failed, 1 if succeeded?
/*0088*/
// /*072*/ int8 success; // =0 client->server, =1 server->client, -X=specific error
@@ -4250,160 +4246,52 @@ struct VeteranReward
/*012*/ VeteranRewardItem items[8];
};
-
-struct ExpeditionInvite_Struct
-{
-/*000*/ uint32 client_id; // unique character id
-/*004*/ uint32 unknown004;
-/*008*/ char inviter_name[64];
-/*072*/ char expedition_name[128];
-/*200*/ uint8 swapping; // 0: adding 1: swapping
-/*201*/ char swap_name[64]; // if swapping, swap name being removed
-/*265*/ uint8 padding[3];
-/*268*/ uint16 dz_zone_id; // dz_id zone/instance pair, sent back in reply
-/*270*/ uint16 dz_instance_id;
-};
-
-struct ExpeditionInviteResponse_Struct
+struct ExpeditionEntryHeader_Struct
{
/*000*/ uint32 unknown000;
+/*000*/ uint32 number_of_entries;
+};
+
+struct ExpeditionJoinPrompt_Struct
+{
+/*000*/ uint32 clientid;
/*004*/ uint32 unknown004;
-/*008*/ uint16 dz_zone_id; // dz_id pair sent in invite
-/*010*/ uint16 dz_instance_id;
-/*012*/ uint8 accepted; // 0: declined 1: accepted
-/*013*/ uint8 swapping; // 0: adding 1: swapping (sent in invite)
-/*014*/ char swap_name[64]; // swap name sent in invite
-/*078*/ uint8 unknown078; // padding garbage?
-/*079*/ uint8 unknown079; // padding garbage?
-};
-
-struct DynamicZoneInfo_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 unknown004;
-/*008*/ uint32 assigned; // padded bool
-/*012*/ uint32 max_players;
-/*016*/ char dz_name[128];
-/*144*/ char leader_name[64];
-};
-
-struct DynamicZoneMemberEntry_Struct
-{
-/*000*/ char name[1]; // variable length, null terminated, max 0x40 (64)
-/*000*/ uint8 online_status; // 0: unknown 1: Online, 2: Offline, 3: In Dynamic Zone, 4: Link Dead
-};
-
-struct DynamicZoneMemberList_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 member_count; // number of players in window
-/*008*/ DynamicZoneMemberEntry_Struct members[0]; // variable length
-};
-
-struct DynamicZoneMemberListName_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 unknown004;
-/*008*/ uint32 add_name; // padded bool, 0: remove name, 1: add name with unknown status
-/*012*/ char name[64];
-};
-
-struct ExpeditionLockoutTimerEntry_Struct
-{
-/*000*/ char expedition_name[1]; // variable length, null terminated, max 0x80 (128)
-/*000*/ uint32 seconds_remaining;
-/*000*/ int32 event_type; // seen -1 (0xffffffff) for replay timers and 1 for event timers
-/*000*/ char event_name[1]; // variable length, null terminated, max 0x100 (256)
-};
-
-struct ExpeditionLockoutTimers_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 count;
-/*008*/ ExpeditionLockoutTimerEntry_Struct timers[0];
-};
-
-struct DynamicZoneLeaderName_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 unknown004;
-/*008*/ char leader_name[64];
-};
-
-struct ExpeditionCommand_Struct
-{
-/*000*/ uint32 unknown000;
-/*004*/ uint32 unknown004;
-/*008*/ char name[64];
-};
-
-struct ExpeditionCommandSwap_Struct
-{
-/*000*/ uint32 unknown000;
-/*004*/ uint32 unknown004;
-/*008*/ char add_player_name[64]; // swap to (player must confirm)
-/*072*/ char rem_player_name[64]; // swap from
+/*008*/ char player_name[64];
+/*072*/ char expedition_name[64];
};
struct ExpeditionExpireWarning
{
-/*000*/ uint32 client_id;
+/*000*/ uint32 clientid;
/*004*/ uint32 unknown004;
/*008*/ uint32 minutes_remaining;
};
-struct DynamicZoneCompassEntry_Struct
+struct ExpeditionInfo_Struct
{
-/*000*/ uint16 dz_zone_id; // target dz id pair
-/*002*/ uint16 dz_instance_id;
-/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
+/*000*/ uint32 clientid;
+/*004*/ uint32 unknown004;
/*008*/ uint32 unknown008;
+/*012*/ uint32 max_players;
+/*016*/ char expedition_name[128];
+/*142*/ char leader_name[64];
+};
+
+struct ExpeditionCompassEntry_Struct
+{
+/*000*/ float unknown000; //seen *((uint32*)) = 1584791871
+/*004*/ uint32 enabled; //guess
+/*008*/ uint32 unknown008; //seen 1019
/*012*/ float y;
/*016*/ float x;
/*020*/ float z;
};
-struct DynamicZoneCompass_Struct
+struct ExpeditionCompass_Struct
{
-/*000*/ uint32 client_id;
+/*000*/ uint32 clientid;
/*004*/ uint32 count;
-/*008*/ DynamicZoneCompassEntry_Struct entries[0];
-};
-
-struct DynamicZoneChooseZoneEntry_Struct
-{
-/*000*/ uint16 dz_zone_id; // dz_id pair
-/*002*/ uint16 dz_instance_id;
-/*004*/ uint32 unknown_id1; // sent back in reply
-/*008*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest -- sent back in reply
-/*012*/ uint32 unknown_id2; // possibly an id based on dz type, for expeditions this was same as dz_id (zone|instance) but task dz was different
-/*016*/ char description[1]; // variable length, null terminated, max 0x80 (128)
-/*000*/ char leader_name[1]; // variable length, null terminated, max 0x40 (64)
-};
-
-struct DynamicZoneChooseZone_Struct
-{
-/*000*/ uint32 client_id;
-/*004*/ uint32 count;
-/*008*/ DynamicZoneChooseZoneEntry_Struct choices[0];
-};
-
-struct DynamicZoneChooseZoneReply_Struct
-{
-/*000*/ uint32 unknown000; // ff ff ff ff
-/*004*/ uint32 unknown004; // seen 69 00 00 00
-/*008*/ uint32 unknown008; // ff ff ff ff
-/*012*/ uint32 unknown_id1; // from choose zone entry message
-/*016*/ uint16 dz_zone_id; // dz_id pair
-/*018*/ uint16 dz_instance_id;
-/*020*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest
-/*024*/ uint32 unknown_id2; // from choose zone entry message
-/*028*/ uint32 unknown028; // 00 00 00 00
-/*032*/ uint32 unknown032; // always same as unknown044
-/*036*/ uint32 unknown036;
-/*040*/ uint32 unknown040;
-/*044*/ uint32 unknown044; // always same as unknown032
-/*048*/ uint32 unknown048; // seen 01 00 00 00 and 02 00 00 00
+/*008*/ ExpeditionCompassEntry_Struct entries[0];
};
struct AltCurrencySelectItem_Struct {
diff --git a/common/platform.cpp b/common/platform.cpp
index e5481c339..b67267155 100644
--- a/common/platform.cpp
+++ b/common/platform.cpp
@@ -46,15 +46,15 @@ std::string GetPlatformName()
{
switch (GetExecutablePlatformInt()) {
case EQEmuExePlatform::ExePlatformWorld:
- return "World";
+ return "WorldServer";
case EQEmuExePlatform::ExePlatformQueryServ:
- return "QS";
+ return "QueryServer";
case EQEmuExePlatform::ExePlatformZone:
- return "Zone";
+ return "ZoneServer";
case EQEmuExePlatform::ExePlatformUCS:
return "UCS";
case EQEmuExePlatform::ExePlatformLogin:
- return "Login";
+ return "LoginServer";
case EQEmuExePlatform::ExePlatformSocket_Server:
return "SocketServer";
case EQEmuExePlatform::ExePlatformSharedMemory:
@@ -70,4 +70,4 @@ std::string GetPlatformName()
default:
return "";
}
-}
+}
\ No newline at end of file
diff --git a/common/repositories/base/base_aa_ability_repository.h b/common/repositories/base/base_aa_ability_repository.h
index fbf16f0ba..49f83e61d 100644
--- a/common/repositories/base/base_aa_ability_repository.h
+++ b/common/repositories/base/base_aa_ability_repository.h
@@ -1,12 +1,29 @@
/**
- * DO NOT MODIFY THIS FILE
+ * EQEmulator: Everquest Server Emulator
+ * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY except by those people which sell it, which
+ * are required to give you total support for your newly bought product;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *
+ */
+
+/**
* This repository was automatically generated and is NOT to be modified directly.
- * Any repository modifications are meant to be made to the repository extending the base.
- * Any modifications to base repositories are to be made by the generator only
- *
- * @generator ./utils/scripts/generators/repository-generator.pl
- * @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
+ * Any repository modifications are meant to be made to
+ * the repository extending the base. Any modifications to base repositories are to
+ * be made by the generator only
*/
#ifndef EQEMU_BASE_AA_ABILITY_REPOSITORY_H
@@ -64,6 +81,21 @@ public:
return std::string(implode(", ", Columns()));
}
+ static std::string InsertColumnsRaw()
+ {
+ std::vector insert_columns;
+
+ for (auto &column : Columns()) {
+ if (column == PrimaryKey()) {
+ continue;
+ }
+
+ insert_columns.push_back(column);
+ }
+
+ return std::string(implode(", ", insert_columns));
+ }
+
static std::string TableName()
{
return std::string("aa_ability");
@@ -83,7 +115,7 @@ public:
return fmt::format(
"INSERT INTO {} ({}) ",
TableName(),
- ColumnsRaw()
+ InsertColumnsRaw()
);
}
@@ -124,11 +156,10 @@ public:
}
static AaAbility FindOne(
- Database& db,
int aa_ability_id
)
{
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"{} WHERE id = {} LIMIT 1",
BaseSelect(),
@@ -162,11 +193,10 @@ public:
}
static int DeleteOne(
- Database& db,
int aa_ability_id
)
{
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {} = {}",
TableName(),
@@ -179,7 +209,6 @@ public:
}
static int UpdateOne(
- Database& db,
AaAbility aa_ability_entry
)
{
@@ -202,7 +231,7 @@ public:
update_values.push_back(columns[12] + " = " + std::to_string(aa_ability_entry.enabled));
update_values.push_back(columns[13] + " = " + std::to_string(aa_ability_entry.reset_on_death));
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"UPDATE {} SET {} WHERE {} = {}",
TableName(),
@@ -216,7 +245,6 @@ public:
}
static AaAbility InsertOne(
- Database& db,
AaAbility aa_ability_entry
)
{
@@ -237,7 +265,7 @@ public:
insert_values.push_back(std::to_string(aa_ability_entry.enabled));
insert_values.push_back(std::to_string(aa_ability_entry.reset_on_death));
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"{} VALUES ({})",
BaseInsert(),
@@ -256,7 +284,6 @@ public:
}
static int InsertMany(
- Database& db,
std::vector aa_ability_entries
)
{
@@ -285,7 +312,7 @@ public:
std::vector insert_values;
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"{} VALUES {}",
BaseInsert(),
@@ -296,11 +323,11 @@ public:
return (results.Success() ? results.RowsAffected() : 0);
}
- static std::vector All(Database& db)
+ static std::vector All()
{
std::vector all_entries;
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"{}",
BaseSelect()
@@ -333,11 +360,11 @@ public:
return all_entries;
}
- static std::vector GetWhere(Database& db, std::string where_filter)
+ static std::vector GetWhere(std::string where_filter)
{
std::vector all_entries;
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"{} WHERE {}",
BaseSelect(),
@@ -371,9 +398,9 @@ public:
return all_entries;
}
- static int DeleteWhere(Database& db, std::string where_filter)
+ static int DeleteWhere(std::string where_filter)
{
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {}",
TableName(),
@@ -384,9 +411,9 @@ public:
return (results.Success() ? results.RowsAffected() : 0);
}
- static int Truncate(Database& db)
+ static int Truncate()
{
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"TRUNCATE TABLE {}",
TableName()
diff --git a/common/repositories/base/base_aa_rank_effects_repository.h b/common/repositories/base/base_aa_rank_effects_repository.h
index fa0eebcd1..0d31f8688 100644
--- a/common/repositories/base/base_aa_rank_effects_repository.h
+++ b/common/repositories/base/base_aa_rank_effects_repository.h
@@ -1,12 +1,29 @@
/**
- * DO NOT MODIFY THIS FILE
+ * EQEmulator: Everquest Server Emulator
+ * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY except by those people which sell it, which
+ * are required to give you total support for your newly bought product;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *
+ */
+
+/**
* This repository was automatically generated and is NOT to be modified directly.
- * Any repository modifications are meant to be made to the repository extending the base.
- * Any modifications to base repositories are to be made by the generator only
- *
- * @generator ./utils/scripts/generators/repository-generator.pl
- * @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
+ * Any repository modifications are meant to be made to
+ * the repository extending the base. Any modifications to base repositories are to
+ * be made by the generator only
*/
#ifndef EQEMU_BASE_AA_RANK_EFFECTS_REPOSITORY_H
@@ -46,6 +63,21 @@ public:
return std::string(implode(", ", Columns()));
}
+ static std::string InsertColumnsRaw()
+ {
+ std::vector insert_columns;
+
+ for (auto &column : Columns()) {
+ if (column == PrimaryKey()) {
+ continue;
+ }
+
+ insert_columns.push_back(column);
+ }
+
+ return std::string(implode(", ", insert_columns));
+ }
+
static std::string TableName()
{
return std::string("aa_rank_effects");
@@ -65,7 +97,7 @@ public:
return fmt::format(
"INSERT INTO {} ({}) ",
TableName(),
- ColumnsRaw()
+ InsertColumnsRaw()
);
}
@@ -97,11 +129,10 @@ public:
}
static AaRankEffects FindOne(
- Database& db,
int aa_rank_effects_id
)
{
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"{} WHERE id = {} LIMIT 1",
BaseSelect(),
@@ -126,11 +157,10 @@ public:
}
static int DeleteOne(
- Database& db,
int aa_rank_effects_id
)
{
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {} = {}",
TableName(),
@@ -143,7 +173,6 @@ public:
}
static int UpdateOne(
- Database& db,
AaRankEffects aa_rank_effects_entry
)
{
@@ -157,7 +186,7 @@ public:
update_values.push_back(columns[3] + " = " + std::to_string(aa_rank_effects_entry.base1));
update_values.push_back(columns[4] + " = " + std::to_string(aa_rank_effects_entry.base2));
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"UPDATE {} SET {} WHERE {} = {}",
TableName(),
@@ -171,7 +200,6 @@ public:
}
static AaRankEffects InsertOne(
- Database& db,
AaRankEffects aa_rank_effects_entry
)
{
@@ -183,7 +211,7 @@ public:
insert_values.push_back(std::to_string(aa_rank_effects_entry.base1));
insert_values.push_back(std::to_string(aa_rank_effects_entry.base2));
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"{} VALUES ({})",
BaseInsert(),
@@ -202,7 +230,6 @@ public:
}
static int InsertMany(
- Database& db,
std::vector aa_rank_effects_entries
)
{
@@ -222,7 +249,7 @@ public:
std::vector insert_values;
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"{} VALUES {}",
BaseInsert(),
@@ -233,11 +260,11 @@ public:
return (results.Success() ? results.RowsAffected() : 0);
}
- static std::vector All(Database& db)
+ static std::vector All()
{
std::vector all_entries;
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"{}",
BaseSelect()
@@ -261,11 +288,11 @@ public:
return all_entries;
}
- static std::vector GetWhere(Database& db, std::string where_filter)
+ static std::vector GetWhere(std::string where_filter)
{
std::vector all_entries;
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"{} WHERE {}",
BaseSelect(),
@@ -290,9 +317,9 @@ public:
return all_entries;
}
- static int DeleteWhere(Database& db, std::string where_filter)
+ static int DeleteWhere(std::string where_filter)
{
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {}",
TableName(),
@@ -303,9 +330,9 @@ public:
return (results.Success() ? results.RowsAffected() : 0);
}
- static int Truncate(Database& db)
+ static int Truncate()
{
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"TRUNCATE TABLE {}",
TableName()
diff --git a/common/repositories/base/base_aa_rank_prereqs_repository.h b/common/repositories/base/base_aa_rank_prereqs_repository.h
index 04b1a0a38..5432b5a19 100644
--- a/common/repositories/base/base_aa_rank_prereqs_repository.h
+++ b/common/repositories/base/base_aa_rank_prereqs_repository.h
@@ -1,12 +1,29 @@
/**
- * DO NOT MODIFY THIS FILE
+ * EQEmulator: Everquest Server Emulator
+ * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY except by those people which sell it, which
+ * are required to give you total support for your newly bought product;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *
+ */
+
+/**
* This repository was automatically generated and is NOT to be modified directly.
- * Any repository modifications are meant to be made to the repository extending the base.
- * Any modifications to base repositories are to be made by the generator only
- *
- * @generator ./utils/scripts/generators/repository-generator.pl
- * @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
+ * Any repository modifications are meant to be made to
+ * the repository extending the base. Any modifications to base repositories are to
+ * be made by the generator only
*/
#ifndef EQEMU_BASE_AA_RANK_PREREQS_REPOSITORY_H
@@ -42,6 +59,21 @@ public:
return std::string(implode(", ", Columns()));
}
+ static std::string InsertColumnsRaw()
+ {
+ std::vector insert_columns;
+
+ for (auto &column : Columns()) {
+ if (column == PrimaryKey()) {
+ continue;
+ }
+
+ insert_columns.push_back(column);
+ }
+
+ return std::string(implode(", ", insert_columns));
+ }
+
static std::string TableName()
{
return std::string("aa_rank_prereqs");
@@ -61,7 +93,7 @@ public:
return fmt::format(
"INSERT INTO {} ({}) ",
TableName(),
- ColumnsRaw()
+ InsertColumnsRaw()
);
}
@@ -91,11 +123,10 @@ public:
}
static AaRankPrereqs FindOne(
- Database& db,
int aa_rank_prereqs_id
)
{
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"{} WHERE id = {} LIMIT 1",
BaseSelect(),
@@ -118,11 +149,10 @@ public:
}
static int DeleteOne(
- Database& db,
int aa_rank_prereqs_id
)
{
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {} = {}",
TableName(),
@@ -135,7 +165,6 @@ public:
}
static int UpdateOne(
- Database& db,
AaRankPrereqs aa_rank_prereqs_entry
)
{
@@ -147,7 +176,7 @@ public:
update_values.push_back(columns[1] + " = " + std::to_string(aa_rank_prereqs_entry.aa_id));
update_values.push_back(columns[2] + " = " + std::to_string(aa_rank_prereqs_entry.points));
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"UPDATE {} SET {} WHERE {} = {}",
TableName(),
@@ -161,7 +190,6 @@ public:
}
static AaRankPrereqs InsertOne(
- Database& db,
AaRankPrereqs aa_rank_prereqs_entry
)
{
@@ -171,7 +199,7 @@ public:
insert_values.push_back(std::to_string(aa_rank_prereqs_entry.aa_id));
insert_values.push_back(std::to_string(aa_rank_prereqs_entry.points));
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"{} VALUES ({})",
BaseInsert(),
@@ -190,7 +218,6 @@ public:
}
static int InsertMany(
- Database& db,
std::vector aa_rank_prereqs_entries
)
{
@@ -208,7 +235,7 @@ public:
std::vector insert_values;
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"{} VALUES {}",
BaseInsert(),
@@ -219,11 +246,11 @@ public:
return (results.Success() ? results.RowsAffected() : 0);
}
- static std::vector All(Database& db)
+ static std::vector All()
{
std::vector all_entries;
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"{}",
BaseSelect()
@@ -245,11 +272,11 @@ public:
return all_entries;
}
- static std::vector GetWhere(Database& db, std::string where_filter)
+ static std::vector GetWhere(std::string where_filter)
{
std::vector all_entries;
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"{} WHERE {}",
BaseSelect(),
@@ -272,9 +299,9 @@ public:
return all_entries;
}
- static int DeleteWhere(Database& db, std::string where_filter)
+ static int DeleteWhere(std::string where_filter)
{
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {}",
TableName(),
@@ -285,9 +312,9 @@ public:
return (results.Success() ? results.RowsAffected() : 0);
}
- static int Truncate(Database& db)
+ static int Truncate()
{
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"TRUNCATE TABLE {}",
TableName()
diff --git a/common/repositories/base/base_aa_ranks_repository.h b/common/repositories/base/base_aa_ranks_repository.h
index 8145e3e96..dca90f694 100644
--- a/common/repositories/base/base_aa_ranks_repository.h
+++ b/common/repositories/base/base_aa_ranks_repository.h
@@ -1,12 +1,29 @@
/**
- * DO NOT MODIFY THIS FILE
+ * EQEmulator: Everquest Server Emulator
+ * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY except by those people which sell it, which
+ * are required to give you total support for your newly bought product;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *
+ */
+
+/**
* This repository was automatically generated and is NOT to be modified directly.
- * Any repository modifications are meant to be made to the repository extending the base.
- * Any modifications to base repositories are to be made by the generator only
- *
- * @generator ./utils/scripts/generators/repository-generator.pl
- * @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
+ * Any repository modifications are meant to be made to
+ * the repository extending the base. Any modifications to base repositories are to
+ * be made by the generator only
*/
#ifndef EQEMU_BASE_AA_RANKS_REPOSITORY_H
@@ -62,6 +79,21 @@ public:
return std::string(implode(", ", Columns()));
}
+ static std::string InsertColumnsRaw()
+ {
+ std::vector insert_columns;
+
+ for (auto &column : Columns()) {
+ if (column == PrimaryKey()) {
+ continue;
+ }
+
+ insert_columns.push_back(column);
+ }
+
+ return std::string(implode(", ", insert_columns));
+ }
+
static std::string TableName()
{
return std::string("aa_ranks");
@@ -81,7 +113,7 @@ public:
return fmt::format(
"INSERT INTO {} ({}) ",
TableName(),
- ColumnsRaw()
+ InsertColumnsRaw()
);
}
@@ -121,11 +153,10 @@ public:
}
static AaRanks FindOne(
- Database& db,
int aa_ranks_id
)
{
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"{} WHERE id = {} LIMIT 1",
BaseSelect(),
@@ -158,11 +189,10 @@ public:
}
static int DeleteOne(
- Database& db,
int aa_ranks_id
)
{
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {} = {}",
TableName(),
@@ -175,7 +205,6 @@ public:
}
static int UpdateOne(
- Database& db,
AaRanks aa_ranks_entry
)
{
@@ -197,7 +226,7 @@ public:
update_values.push_back(columns[11] + " = " + std::to_string(aa_ranks_entry.prev_id));
update_values.push_back(columns[12] + " = " + std::to_string(aa_ranks_entry.next_id));
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"UPDATE {} SET {} WHERE {} = {}",
TableName(),
@@ -211,7 +240,6 @@ public:
}
static AaRanks InsertOne(
- Database& db,
AaRanks aa_ranks_entry
)
{
@@ -231,7 +259,7 @@ public:
insert_values.push_back(std::to_string(aa_ranks_entry.prev_id));
insert_values.push_back(std::to_string(aa_ranks_entry.next_id));
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"{} VALUES ({})",
BaseInsert(),
@@ -250,7 +278,6 @@ public:
}
static int InsertMany(
- Database& db,
std::vector aa_ranks_entries
)
{
@@ -278,7 +305,7 @@ public:
std::vector insert_values;
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"{} VALUES {}",
BaseInsert(),
@@ -289,11 +316,11 @@ public:
return (results.Success() ? results.RowsAffected() : 0);
}
- static std::vector All(Database& db)
+ static std::vector All()
{
std::vector all_entries;
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"{}",
BaseSelect()
@@ -325,11 +352,11 @@ public:
return all_entries;
}
- static std::vector GetWhere(Database& db, std::string where_filter)
+ static std::vector GetWhere(std::string where_filter)
{
std::vector all_entries;
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"{} WHERE {}",
BaseSelect(),
@@ -362,9 +389,9 @@ public:
return all_entries;
}
- static int DeleteWhere(Database& db, std::string where_filter)
+ static int DeleteWhere(std::string where_filter)
{
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {}",
TableName(),
@@ -375,9 +402,9 @@ public:
return (results.Success() ? results.RowsAffected() : 0);
}
- static int Truncate(Database& db)
+ static int Truncate()
{
- auto results = db.QueryDatabase(
+ auto results = content_db.QueryDatabase(
fmt::format(
"TRUNCATE TABLE {}",
TableName()
diff --git a/common/repositories/base/base_account_flags_repository.h b/common/repositories/base/base_account_flags_repository.h
index af9c9b223..5d67e14ec 100644
--- a/common/repositories/base/base_account_flags_repository.h
+++ b/common/repositories/base/base_account_flags_repository.h
@@ -1,12 +1,29 @@
/**
- * DO NOT MODIFY THIS FILE
+ * EQEmulator: Everquest Server Emulator
+ * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY except by those people which sell it, which
+ * are required to give you total support for your newly bought product;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *
+ */
+
+/**
* This repository was automatically generated and is NOT to be modified directly.
- * Any repository modifications are meant to be made to the repository extending the base.
- * Any modifications to base repositories are to be made by the generator only
- *
- * @generator ./utils/scripts/generators/repository-generator.pl
- * @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
+ * Any repository modifications are meant to be made to
+ * the repository extending the base. Any modifications to base repositories are to
+ * be made by the generator only
*/
#ifndef EQEMU_BASE_ACCOUNT_FLAGS_REPOSITORY_H
@@ -42,6 +59,21 @@ public:
return std::string(implode(", ", Columns()));
}
+ static std::string InsertColumnsRaw()
+ {
+ std::vector insert_columns;
+
+ for (auto &column : Columns()) {
+ if (column == PrimaryKey()) {
+ continue;
+ }
+
+ insert_columns.push_back(column);
+ }
+
+ return std::string(implode(", ", insert_columns));
+ }
+
static std::string TableName()
{
return std::string("account_flags");
@@ -61,7 +93,7 @@ public:
return fmt::format(
"INSERT INTO {} ({}) ",
TableName(),
- ColumnsRaw()
+ InsertColumnsRaw()
);
}
@@ -91,11 +123,10 @@ public:
}
static AccountFlags FindOne(
- Database& db,
int account_flags_id
)
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} WHERE id = {} LIMIT 1",
BaseSelect(),
@@ -118,11 +149,10 @@ public:
}
static int DeleteOne(
- Database& db,
int account_flags_id
)
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {} = {}",
TableName(),
@@ -135,7 +165,6 @@ public:
}
static int UpdateOne(
- Database& db,
AccountFlags account_flags_entry
)
{
@@ -147,7 +176,7 @@ public:
update_values.push_back(columns[1] + " = '" + EscapeString(account_flags_entry.p_flag) + "'");
update_values.push_back(columns[2] + " = '" + EscapeString(account_flags_entry.p_value) + "'");
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"UPDATE {} SET {} WHERE {} = {}",
TableName(),
@@ -161,7 +190,6 @@ public:
}
static AccountFlags InsertOne(
- Database& db,
AccountFlags account_flags_entry
)
{
@@ -171,7 +199,7 @@ public:
insert_values.push_back("'" + EscapeString(account_flags_entry.p_flag) + "'");
insert_values.push_back("'" + EscapeString(account_flags_entry.p_value) + "'");
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} VALUES ({})",
BaseInsert(),
@@ -190,7 +218,6 @@ public:
}
static int InsertMany(
- Database& db,
std::vector account_flags_entries
)
{
@@ -208,7 +235,7 @@ public:
std::vector insert_values;
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} VALUES {}",
BaseInsert(),
@@ -219,11 +246,11 @@ public:
return (results.Success() ? results.RowsAffected() : 0);
}
- static std::vector All(Database& db)
+ static std::vector All()
{
std::vector all_entries;
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{}",
BaseSelect()
@@ -245,11 +272,11 @@ public:
return all_entries;
}
- static std::vector GetWhere(Database& db, std::string where_filter)
+ static std::vector GetWhere(std::string where_filter)
{
std::vector all_entries;
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} WHERE {}",
BaseSelect(),
@@ -272,9 +299,9 @@ public:
return all_entries;
}
- static int DeleteWhere(Database& db, std::string where_filter)
+ static int DeleteWhere(std::string where_filter)
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {}",
TableName(),
@@ -285,9 +312,9 @@ public:
return (results.Success() ? results.RowsAffected() : 0);
}
- static int Truncate(Database& db)
+ static int Truncate()
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"TRUNCATE TABLE {}",
TableName()
diff --git a/common/repositories/base/base_account_ip_repository.h b/common/repositories/base/base_account_ip_repository.h
index 1384c4ef2..127c8c80e 100644
--- a/common/repositories/base/base_account_ip_repository.h
+++ b/common/repositories/base/base_account_ip_repository.h
@@ -1,12 +1,29 @@
/**
- * DO NOT MODIFY THIS FILE
+ * EQEmulator: Everquest Server Emulator
+ * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY except by those people which sell it, which
+ * are required to give you total support for your newly bought product;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *
+ */
+
+/**
* This repository was automatically generated and is NOT to be modified directly.
- * Any repository modifications are meant to be made to the repository extending the base.
- * Any modifications to base repositories are to be made by the generator only
- *
- * @generator ./utils/scripts/generators/repository-generator.pl
- * @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
+ * Any repository modifications are meant to be made to
+ * the repository extending the base. Any modifications to base repositories are to
+ * be made by the generator only
*/
#ifndef EQEMU_BASE_ACCOUNT_IP_REPOSITORY_H
@@ -44,6 +61,21 @@ public:
return std::string(implode(", ", Columns()));
}
+ static std::string InsertColumnsRaw()
+ {
+ std::vector insert_columns;
+
+ for (auto &column : Columns()) {
+ if (column == PrimaryKey()) {
+ continue;
+ }
+
+ insert_columns.push_back(column);
+ }
+
+ return std::string(implode(", ", insert_columns));
+ }
+
static std::string TableName()
{
return std::string("account_ip");
@@ -63,7 +95,7 @@ public:
return fmt::format(
"INSERT INTO {} ({}) ",
TableName(),
- ColumnsRaw()
+ InsertColumnsRaw()
);
}
@@ -94,11 +126,10 @@ public:
}
static AccountIp FindOne(
- Database& db,
int account_ip_id
)
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} WHERE id = {} LIMIT 1",
BaseSelect(),
@@ -122,11 +153,10 @@ public:
}
static int DeleteOne(
- Database& db,
int account_ip_id
)
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {} = {}",
TableName(),
@@ -139,7 +169,6 @@ public:
}
static int UpdateOne(
- Database& db,
AccountIp account_ip_entry
)
{
@@ -152,7 +181,7 @@ public:
update_values.push_back(columns[2] + " = " + std::to_string(account_ip_entry.count));
update_values.push_back(columns[3] + " = '" + EscapeString(account_ip_entry.lastused) + "'");
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"UPDATE {} SET {} WHERE {} = {}",
TableName(),
@@ -166,7 +195,6 @@ public:
}
static AccountIp InsertOne(
- Database& db,
AccountIp account_ip_entry
)
{
@@ -177,7 +205,7 @@ public:
insert_values.push_back(std::to_string(account_ip_entry.count));
insert_values.push_back("'" + EscapeString(account_ip_entry.lastused) + "'");
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} VALUES ({})",
BaseInsert(),
@@ -196,7 +224,6 @@ public:
}
static int InsertMany(
- Database& db,
std::vector account_ip_entries
)
{
@@ -215,7 +242,7 @@ public:
std::vector insert_values;
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} VALUES {}",
BaseInsert(),
@@ -226,11 +253,11 @@ public:
return (results.Success() ? results.RowsAffected() : 0);
}
- static std::vector All(Database& db)
+ static std::vector All()
{
std::vector all_entries;
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{}",
BaseSelect()
@@ -253,11 +280,11 @@ public:
return all_entries;
}
- static std::vector GetWhere(Database& db, std::string where_filter)
+ static std::vector GetWhere(std::string where_filter)
{
std::vector all_entries;
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} WHERE {}",
BaseSelect(),
@@ -281,9 +308,9 @@ public:
return all_entries;
}
- static int DeleteWhere(Database& db, std::string where_filter)
+ static int DeleteWhere(std::string where_filter)
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {}",
TableName(),
@@ -294,9 +321,9 @@ public:
return (results.Success() ? results.RowsAffected() : 0);
}
- static int Truncate(Database& db)
+ static int Truncate()
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"TRUNCATE TABLE {}",
TableName()
diff --git a/common/repositories/base/base_account_repository.h b/common/repositories/base/base_account_repository.h
index 6283caf13..e2f0b5ec2 100644
--- a/common/repositories/base/base_account_repository.h
+++ b/common/repositories/base/base_account_repository.h
@@ -1,12 +1,29 @@
/**
- * DO NOT MODIFY THIS FILE
+ * EQEmulator: Everquest Server Emulator
+ * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY except by those people which sell it, which
+ * are required to give you total support for your newly bought product;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *
+ */
+
+/**
* This repository was automatically generated and is NOT to be modified directly.
- * Any repository modifications are meant to be made to the repository extending the base.
- * Any modifications to base repositories are to be made by the generator only
- *
- * @generator ./utils/scripts/generators/repository-generator.pl
- * @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
+ * Any repository modifications are meant to be made to
+ * the repository extending the base. Any modifications to base repositories are to
+ * be made by the generator only
*/
#ifndef EQEMU_BASE_ACCOUNT_REPOSITORY_H
@@ -74,6 +91,21 @@ public:
return std::string(implode(", ", Columns()));
}
+ static std::string InsertColumnsRaw()
+ {
+ std::vector insert_columns;
+
+ for (auto &column : Columns()) {
+ if (column == PrimaryKey()) {
+ continue;
+ }
+
+ insert_columns.push_back(column);
+ }
+
+ return std::string(implode(", ", insert_columns));
+ }
+
static std::string TableName()
{
return std::string("account");
@@ -93,7 +125,7 @@ public:
return fmt::format(
"INSERT INTO {} ({}) ",
TableName(),
- ColumnsRaw()
+ InsertColumnsRaw()
);
}
@@ -139,11 +171,10 @@ public:
}
static Account FindOne(
- Database& db,
int account_id
)
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} WHERE id = {} LIMIT 1",
BaseSelect(),
@@ -182,11 +213,10 @@ public:
}
static int DeleteOne(
- Database& db,
int account_id
)
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {} = {}",
TableName(),
@@ -199,7 +229,6 @@ public:
}
static int UpdateOne(
- Database& db,
Account account_entry
)
{
@@ -226,7 +255,7 @@ public:
update_values.push_back(columns[17] + " = '" + EscapeString(account_entry.ban_reason) + "'");
update_values.push_back(columns[18] + " = '" + EscapeString(account_entry.suspend_reason) + "'");
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"UPDATE {} SET {} WHERE {} = {}",
TableName(),
@@ -240,13 +269,11 @@ public:
}
static Account InsertOne(
- Database& db,
Account account_entry
)
{
std::vector insert_values;
- insert_values.push_back(std::to_string(account_entry.id));
insert_values.push_back("'" + EscapeString(account_entry.name) + "'");
insert_values.push_back("'" + EscapeString(account_entry.charname) + "'");
insert_values.push_back(std::to_string(account_entry.sharedplat));
@@ -266,7 +293,7 @@ public:
insert_values.push_back("'" + EscapeString(account_entry.ban_reason) + "'");
insert_values.push_back("'" + EscapeString(account_entry.suspend_reason) + "'");
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} VALUES ({})",
BaseInsert(),
@@ -285,7 +312,6 @@ public:
}
static int InsertMany(
- Database& db,
std::vector account_entries
)
{
@@ -294,7 +320,6 @@ public:
for (auto &account_entry: account_entries) {
std::vector insert_values;
- insert_values.push_back(std::to_string(account_entry.id));
insert_values.push_back("'" + EscapeString(account_entry.name) + "'");
insert_values.push_back("'" + EscapeString(account_entry.charname) + "'");
insert_values.push_back(std::to_string(account_entry.sharedplat));
@@ -319,7 +344,7 @@ public:
std::vector insert_values;
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} VALUES {}",
BaseInsert(),
@@ -330,11 +355,11 @@ public:
return (results.Success() ? results.RowsAffected() : 0);
}
- static std::vector All(Database& db)
+ static std::vector All()
{
std::vector all_entries;
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{}",
BaseSelect()
@@ -372,11 +397,11 @@ public:
return all_entries;
}
- static std::vector GetWhere(Database& db, std::string where_filter)
+ static std::vector GetWhere(std::string where_filter)
{
std::vector all_entries;
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} WHERE {}",
BaseSelect(),
@@ -415,9 +440,9 @@ public:
return all_entries;
}
- static int DeleteWhere(Database& db, std::string where_filter)
+ static int DeleteWhere(std::string where_filter)
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {}",
TableName(),
@@ -428,9 +453,9 @@ public:
return (results.Success() ? results.RowsAffected() : 0);
}
- static int Truncate(Database& db)
+ static int Truncate()
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"TRUNCATE TABLE {}",
TableName()
diff --git a/common/repositories/base/base_account_rewards_repository.h b/common/repositories/base/base_account_rewards_repository.h
index ee6213e16..c7faa48e6 100644
--- a/common/repositories/base/base_account_rewards_repository.h
+++ b/common/repositories/base/base_account_rewards_repository.h
@@ -1,12 +1,29 @@
/**
- * DO NOT MODIFY THIS FILE
+ * EQEmulator: Everquest Server Emulator
+ * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY except by those people which sell it, which
+ * are required to give you total support for your newly bought product;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *
+ */
+
+/**
* This repository was automatically generated and is NOT to be modified directly.
- * Any repository modifications are meant to be made to the repository extending the base.
- * Any modifications to base repositories are to be made by the generator only
- *
- * @generator ./utils/scripts/generators/repository-generator.pl
- * @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
+ * Any repository modifications are meant to be made to
+ * the repository extending the base. Any modifications to base repositories are to
+ * be made by the generator only
*/
#ifndef EQEMU_BASE_ACCOUNT_REWARDS_REPOSITORY_H
@@ -42,6 +59,21 @@ public:
return std::string(implode(", ", Columns()));
}
+ static std::string InsertColumnsRaw()
+ {
+ std::vector insert_columns;
+
+ for (auto &column : Columns()) {
+ if (column == PrimaryKey()) {
+ continue;
+ }
+
+ insert_columns.push_back(column);
+ }
+
+ return std::string(implode(", ", insert_columns));
+ }
+
static std::string TableName()
{
return std::string("account_rewards");
@@ -61,7 +93,7 @@ public:
return fmt::format(
"INSERT INTO {} ({}) ",
TableName(),
- ColumnsRaw()
+ InsertColumnsRaw()
);
}
@@ -91,11 +123,10 @@ public:
}
static AccountRewards FindOne(
- Database& db,
int account_rewards_id
)
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} WHERE id = {} LIMIT 1",
BaseSelect(),
@@ -118,11 +149,10 @@ public:
}
static int DeleteOne(
- Database& db,
int account_rewards_id
)
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {} = {}",
TableName(),
@@ -135,7 +165,6 @@ public:
}
static int UpdateOne(
- Database& db,
AccountRewards account_rewards_entry
)
{
@@ -147,7 +176,7 @@ public:
update_values.push_back(columns[1] + " = " + std::to_string(account_rewards_entry.reward_id));
update_values.push_back(columns[2] + " = " + std::to_string(account_rewards_entry.amount));
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"UPDATE {} SET {} WHERE {} = {}",
TableName(),
@@ -161,7 +190,6 @@ public:
}
static AccountRewards InsertOne(
- Database& db,
AccountRewards account_rewards_entry
)
{
@@ -171,7 +199,7 @@ public:
insert_values.push_back(std::to_string(account_rewards_entry.reward_id));
insert_values.push_back(std::to_string(account_rewards_entry.amount));
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} VALUES ({})",
BaseInsert(),
@@ -190,7 +218,6 @@ public:
}
static int InsertMany(
- Database& db,
std::vector account_rewards_entries
)
{
@@ -208,7 +235,7 @@ public:
std::vector insert_values;
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} VALUES {}",
BaseInsert(),
@@ -219,11 +246,11 @@ public:
return (results.Success() ? results.RowsAffected() : 0);
}
- static std::vector All(Database& db)
+ static std::vector All()
{
std::vector all_entries;
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{}",
BaseSelect()
@@ -245,11 +272,11 @@ public:
return all_entries;
}
- static std::vector GetWhere(Database& db, std::string where_filter)
+ static std::vector GetWhere(std::string where_filter)
{
std::vector all_entries;
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} WHERE {}",
BaseSelect(),
@@ -272,9 +299,9 @@ public:
return all_entries;
}
- static int DeleteWhere(Database& db, std::string where_filter)
+ static int DeleteWhere(std::string where_filter)
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {}",
TableName(),
@@ -285,9 +312,9 @@ public:
return (results.Success() ? results.RowsAffected() : 0);
}
- static int Truncate(Database& db)
+ static int Truncate()
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"TRUNCATE TABLE {}",
TableName()
diff --git a/common/repositories/base/base_adventure_details_repository.h b/common/repositories/base/base_adventure_details_repository.h
index 656ba8908..5ce8b68ef 100644
--- a/common/repositories/base/base_adventure_details_repository.h
+++ b/common/repositories/base/base_adventure_details_repository.h
@@ -1,12 +1,29 @@
/**
- * DO NOT MODIFY THIS FILE
+ * EQEmulator: Everquest Server Emulator
+ * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY except by those people which sell it, which
+ * are required to give you total support for your newly bought product;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *
+ */
+
+/**
* This repository was automatically generated and is NOT to be modified directly.
- * Any repository modifications are meant to be made to the repository extending the base.
- * Any modifications to base repositories are to be made by the generator only
- *
- * @generator ./utils/scripts/generators/repository-generator.pl
- * @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
+ * Any repository modifications are meant to be made to
+ * the repository extending the base. Any modifications to base repositories are to
+ * be made by the generator only
*/
#ifndef EQEMU_BASE_ADVENTURE_DETAILS_REPOSITORY_H
@@ -54,6 +71,21 @@ public:
return std::string(implode(", ", Columns()));
}
+ static std::string InsertColumnsRaw()
+ {
+ std::vector insert_columns;
+
+ for (auto &column : Columns()) {
+ if (column == PrimaryKey()) {
+ continue;
+ }
+
+ insert_columns.push_back(column);
+ }
+
+ return std::string(implode(", ", insert_columns));
+ }
+
static std::string TableName()
{
return std::string("adventure_details");
@@ -73,7 +105,7 @@ public:
return fmt::format(
"INSERT INTO {} ({}) ",
TableName(),
- ColumnsRaw()
+ InsertColumnsRaw()
);
}
@@ -109,11 +141,10 @@ public:
}
static AdventureDetails FindOne(
- Database& db,
int adventure_details_id
)
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} WHERE id = {} LIMIT 1",
BaseSelect(),
@@ -142,11 +173,10 @@ public:
}
static int DeleteOne(
- Database& db,
int adventure_details_id
)
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {} = {}",
TableName(),
@@ -159,7 +189,6 @@ public:
}
static int UpdateOne(
- Database& db,
AdventureDetails adventure_details_entry
)
{
@@ -176,7 +205,7 @@ public:
update_values.push_back(columns[7] + " = " + std::to_string(adventure_details_entry.time_zoned));
update_values.push_back(columns[8] + " = " + std::to_string(adventure_details_entry.time_completed));
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"UPDATE {} SET {} WHERE {} = {}",
TableName(),
@@ -190,13 +219,11 @@ public:
}
static AdventureDetails InsertOne(
- Database& db,
AdventureDetails adventure_details_entry
)
{
std::vector insert_values;
- insert_values.push_back(std::to_string(adventure_details_entry.id));
insert_values.push_back(std::to_string(adventure_details_entry.adventure_id));
insert_values.push_back(std::to_string(adventure_details_entry.instance_id));
insert_values.push_back(std::to_string(adventure_details_entry.count));
@@ -206,7 +233,7 @@ public:
insert_values.push_back(std::to_string(adventure_details_entry.time_zoned));
insert_values.push_back(std::to_string(adventure_details_entry.time_completed));
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} VALUES ({})",
BaseInsert(),
@@ -225,7 +252,6 @@ public:
}
static int InsertMany(
- Database& db,
std::vector adventure_details_entries
)
{
@@ -234,7 +260,6 @@ public:
for (auto &adventure_details_entry: adventure_details_entries) {
std::vector insert_values;
- insert_values.push_back(std::to_string(adventure_details_entry.id));
insert_values.push_back(std::to_string(adventure_details_entry.adventure_id));
insert_values.push_back(std::to_string(adventure_details_entry.instance_id));
insert_values.push_back(std::to_string(adventure_details_entry.count));
@@ -249,7 +274,7 @@ public:
std::vector insert_values;
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} VALUES {}",
BaseInsert(),
@@ -260,11 +285,11 @@ public:
return (results.Success() ? results.RowsAffected() : 0);
}
- static std::vector All(Database& db)
+ static std::vector All()
{
std::vector all_entries;
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{}",
BaseSelect()
@@ -292,11 +317,11 @@ public:
return all_entries;
}
- static std::vector GetWhere(Database& db, std::string where_filter)
+ static std::vector GetWhere(std::string where_filter)
{
std::vector all_entries;
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} WHERE {}",
BaseSelect(),
@@ -325,9 +350,9 @@ public:
return all_entries;
}
- static int DeleteWhere(Database& db, std::string where_filter)
+ static int DeleteWhere(std::string where_filter)
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {}",
TableName(),
@@ -338,9 +363,9 @@ public:
return (results.Success() ? results.RowsAffected() : 0);
}
- static int Truncate(Database& db)
+ static int Truncate()
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"TRUNCATE TABLE {}",
TableName()
diff --git a/common/repositories/base/base_adventure_members_repository.h b/common/repositories/base/base_adventure_members_repository.h
index 4cdc357fd..6994df694 100644
--- a/common/repositories/base/base_adventure_members_repository.h
+++ b/common/repositories/base/base_adventure_members_repository.h
@@ -1,12 +1,29 @@
/**
- * DO NOT MODIFY THIS FILE
+ * EQEmulator: Everquest Server Emulator
+ * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY except by those people which sell it, which
+ * are required to give you total support for your newly bought product;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *
+ */
+
+/**
* This repository was automatically generated and is NOT to be modified directly.
- * Any repository modifications are meant to be made to the repository extending the base.
- * Any modifications to base repositories are to be made by the generator only
- *
- * @generator ./utils/scripts/generators/repository-generator.pl
- * @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
+ * Any repository modifications are meant to be made to
+ * the repository extending the base. Any modifications to base repositories are to
+ * be made by the generator only
*/
#ifndef EQEMU_BASE_ADVENTURE_MEMBERS_REPOSITORY_H
@@ -40,6 +57,21 @@ public:
return std::string(implode(", ", Columns()));
}
+ static std::string InsertColumnsRaw()
+ {
+ std::vector insert_columns;
+
+ for (auto &column : Columns()) {
+ if (column == PrimaryKey()) {
+ continue;
+ }
+
+ insert_columns.push_back(column);
+ }
+
+ return std::string(implode(", ", insert_columns));
+ }
+
static std::string TableName()
{
return std::string("adventure_members");
@@ -59,7 +91,7 @@ public:
return fmt::format(
"INSERT INTO {} ({}) ",
TableName(),
- ColumnsRaw()
+ InsertColumnsRaw()
);
}
@@ -88,11 +120,10 @@ public:
}
static AdventureMembers FindOne(
- Database& db,
int adventure_members_id
)
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} WHERE id = {} LIMIT 1",
BaseSelect(),
@@ -114,11 +145,10 @@ public:
}
static int DeleteOne(
- Database& db,
int adventure_members_id
)
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {} = {}",
TableName(),
@@ -131,7 +161,6 @@ public:
}
static int UpdateOne(
- Database& db,
AdventureMembers adventure_members_entry
)
{
@@ -142,7 +171,7 @@ public:
update_values.push_back(columns[0] + " = " + std::to_string(adventure_members_entry.id));
update_values.push_back(columns[1] + " = " + std::to_string(adventure_members_entry.charid));
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"UPDATE {} SET {} WHERE {} = {}",
TableName(),
@@ -156,7 +185,6 @@ public:
}
static AdventureMembers InsertOne(
- Database& db,
AdventureMembers adventure_members_entry
)
{
@@ -165,7 +193,7 @@ public:
insert_values.push_back(std::to_string(adventure_members_entry.id));
insert_values.push_back(std::to_string(adventure_members_entry.charid));
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} VALUES ({})",
BaseInsert(),
@@ -184,7 +212,6 @@ public:
}
static int InsertMany(
- Database& db,
std::vector adventure_members_entries
)
{
@@ -201,7 +228,7 @@ public:
std::vector insert_values;
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} VALUES {}",
BaseInsert(),
@@ -212,11 +239,11 @@ public:
return (results.Success() ? results.RowsAffected() : 0);
}
- static std::vector All(Database& db)
+ static std::vector All()
{
std::vector all_entries;
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{}",
BaseSelect()
@@ -237,11 +264,11 @@ public:
return all_entries;
}
- static std::vector GetWhere(Database& db, std::string where_filter)
+ static std::vector GetWhere(std::string where_filter)
{
std::vector all_entries;
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} WHERE {}",
BaseSelect(),
@@ -263,9 +290,9 @@ public:
return all_entries;
}
- static int DeleteWhere(Database& db, std::string where_filter)
+ static int DeleteWhere(std::string where_filter)
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {}",
TableName(),
@@ -276,9 +303,9 @@ public:
return (results.Success() ? results.RowsAffected() : 0);
}
- static int Truncate(Database& db)
+ static int Truncate()
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"TRUNCATE TABLE {}",
TableName()
diff --git a/common/repositories/base/base_adventure_stats_repository.h b/common/repositories/base/base_adventure_stats_repository.h
index b1634c080..b1f622c7e 100644
--- a/common/repositories/base/base_adventure_stats_repository.h
+++ b/common/repositories/base/base_adventure_stats_repository.h
@@ -1,12 +1,29 @@
/**
- * DO NOT MODIFY THIS FILE
+ * EQEmulator: Everquest Server Emulator
+ * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY except by those people which sell it, which
+ * are required to give you total support for your newly bought product;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *
+ */
+
+/**
* This repository was automatically generated and is NOT to be modified directly.
- * Any repository modifications are meant to be made to the repository extending the base.
- * Any modifications to base repositories are to be made by the generator only
- *
- * @generator ./utils/scripts/generators/repository-generator.pl
- * @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
+ * Any repository modifications are meant to be made to
+ * the repository extending the base. Any modifications to base repositories are to
+ * be made by the generator only
*/
#ifndef EQEMU_BASE_ADVENTURE_STATS_REPOSITORY_H
@@ -58,6 +75,21 @@ public:
return std::string(implode(", ", Columns()));
}
+ static std::string InsertColumnsRaw()
+ {
+ std::vector insert_columns;
+
+ for (auto &column : Columns()) {
+ if (column == PrimaryKey()) {
+ continue;
+ }
+
+ insert_columns.push_back(column);
+ }
+
+ return std::string(implode(", ", insert_columns));
+ }
+
static std::string TableName()
{
return std::string("adventure_stats");
@@ -77,7 +109,7 @@ public:
return fmt::format(
"INSERT INTO {} ({}) ",
TableName(),
- ColumnsRaw()
+ InsertColumnsRaw()
);
}
@@ -115,11 +147,10 @@ public:
}
static AdventureStats FindOne(
- Database& db,
int adventure_stats_id
)
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} WHERE id = {} LIMIT 1",
BaseSelect(),
@@ -150,11 +181,10 @@ public:
}
static int DeleteOne(
- Database& db,
int adventure_stats_id
)
{
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {} = {}",
TableName(),
@@ -167,7 +197,6 @@ public:
}
static int UpdateOne(
- Database& db,
AdventureStats adventure_stats_entry
)
{
@@ -187,7 +216,7 @@ public:
update_values.push_back(columns[9] + " = " + std::to_string(adventure_stats_entry.ruj_losses));
update_values.push_back(columns[10] + " = " + std::to_string(adventure_stats_entry.tak_losses));
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"UPDATE {} SET {} WHERE {} = {}",
TableName(),
@@ -201,7 +230,6 @@ public:
}
static AdventureStats InsertOne(
- Database& db,
AdventureStats adventure_stats_entry
)
{
@@ -219,7 +247,7 @@ public:
insert_values.push_back(std::to_string(adventure_stats_entry.ruj_losses));
insert_values.push_back(std::to_string(adventure_stats_entry.tak_losses));
- auto results = db.QueryDatabase(
+ auto results = database.QueryDatabase(
fmt::format(
"{} VALUES ({})",
BaseInsert(),
@@ -238,7 +266,6 @@ public:
}
static int InsertMany(
- Database& db,
std::vector