mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 09:06:46 +00:00
Compare commits
183 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1b15f16e3e | |||
| 983cc1e82a | |||
| fc79614fac | |||
| d767217461 | |||
| 1310c5d528 | |||
| b253fce0d5 | |||
| 421857026d | |||
| 68f40c9255 | |||
| 0bceee5622 | |||
| cd03152550 | |||
| 316fa54bd8 | |||
| 49957e3269 | |||
| 9638d9af3a | |||
| 87c207e862 | |||
| 2df5f3f55a | |||
| e803d3e1e1 | |||
| fccb205a1d | |||
| f70078d62a | |||
| 34ae3094d6 | |||
| c56742a2a8 | |||
| 3e34447172 | |||
| ca25122bfa | |||
| 13a7532ef8 | |||
| e1344039ff | |||
| 98b137154a | |||
| fc9ef2fb7b | |||
| 6dc661032f | |||
| 2586527157 | |||
| 3a51f04291 | |||
| 66af3d2f63 | |||
| 6bcd8fea18 | |||
| 0d1cbecb55 | |||
| e33e076b2a | |||
| e26d17182e | |||
| 7e40c5bac2 | |||
| ca69cc67e8 | |||
| 099c6d657b | |||
| c0a8fd097e | |||
| a80ab75260 | |||
| c87aadbf0c | |||
| 1be86edf20 | |||
| b49b564940 | |||
| d302b9c02e | |||
| d36bc3915d | |||
| d6f1bba96c | |||
| d1c7e45437 | |||
| 257935d33a | |||
| fe136e58e4 | |||
| fddb91794b | |||
| ad3a675222 | |||
| fa733eee50 | |||
| f07c5901f4 | |||
| 6dd061cba2 | |||
| 405d963005 | |||
| 7ad97ce168 | |||
| a71ad416b4 | |||
| 758859eea6 | |||
| aa0e53f5fc | |||
| 34c27ebb2a | |||
| 943274b443 | |||
| c4cda66c3b | |||
| 46f3e50b5c | |||
| f77eec83e5 | |||
| dfd1bfbd49 | |||
| b3538021cc | |||
| 7b19225e48 | |||
| ac8cf326b2 | |||
| 39bb7e1723 | |||
| e268ab18f5 | |||
| 37e21d7757 | |||
| 1529c0f670 | |||
| 1b8922fc14 | |||
| 1e0373a3e3 | |||
| 99612ba7b3 | |||
| 1891c9b6de | |||
| 6b698b5f51 | |||
| 703d2cd1d8 | |||
| 4215a3b9d6 | |||
| fcffc6b3d4 | |||
| 64fefaebe4 | |||
| 7b44745c67 | |||
| c3295d129d | |||
| a565e5f824 | |||
| 5a6e0c9e3d | |||
| 8fa6eab2c2 | |||
| 3f49a656c4 | |||
| ff3e955804 | |||
| 2538ee7976 | |||
| a7bfc5ec92 | |||
| d7d99152ac | |||
| 0d09edf9aa | |||
| 0a3f1d3c41 | |||
| ac12ba153e | |||
| 989d199908 | |||
| 1bc1f71254 | |||
| 41c5369c18 | |||
| d6b5a9d343 | |||
| a5e8a4c2cd | |||
| 9a09d820a5 | |||
| b1d873d1fc | |||
| 043eeced6f | |||
| e9a0c79301 | |||
| dc48c45421 | |||
| d7a8fb8691 | |||
| 3a5381d38a | |||
| e64f03fcc0 | |||
| d77966797e | |||
| 048aad437b | |||
| b2d9de8d96 | |||
| 42bfa4bb2e | |||
| 72ce7c8e91 | |||
| e306c86875 | |||
| 3ae7979a67 | |||
| b638795f9b | |||
| 9e3bf91374 | |||
| cd89926435 | |||
| e19f72f021 | |||
| df1dc5d1e4 | |||
| e11286164f | |||
| b946b800fb | |||
| ab8ac81df6 | |||
| 109940fc0c | |||
| a87496b0cf | |||
| f905ee70e4 | |||
| 52417023f8 | |||
| 20d9417628 | |||
| 4692799677 | |||
| cf7f0f4321 | |||
| 823a5956de | |||
| 6a8bd3c5d6 | |||
| 523ba30d81 | |||
| d7ea290b6b | |||
| 036309ebec | |||
| b400700d81 | |||
| 21cec87ac4 | |||
| abdec39cdd | |||
| d2372de982 | |||
| ea9b7841d4 | |||
| 8826d7b927 | |||
| e4157f0221 | |||
| 66cc947b2a | |||
| 5bfd8f5da2 | |||
| 96830b4a19 | |||
| 4bf60a6522 | |||
| 16cb7364e8 | |||
| f5050ab5dc | |||
| e32cbf19ee | |||
| ee12a7ad2e | |||
| e5bdbc4f1e | |||
| f829a99e6d | |||
| 82aa6a1587 | |||
| 161c13f457 | |||
| b29c26becb | |||
| e48dae2392 | |||
| 4b83a96f64 | |||
| 95cc22ffbb | |||
| 6ca11256c6 | |||
| d94493468c | |||
| 957b4f8821 | |||
| 5013459824 | |||
| 94af2843e3 | |||
| 3bfb148bdc | |||
| 96370e0298 | |||
| fef5108b0d | |||
| 6f883566f6 | |||
| 45b1501c8a | |||
| 7e94f0ac72 | |||
| 2aa19f4cae | |||
| 805829f15d | |||
| 2c2a8cdb63 | |||
| ee3d02bac6 | |||
| b90139bd9a | |||
| e6a3d5e1c5 | |||
| 74f1eac401 | |||
| 1be9b2cdfd | |||
| add0a8dddf | |||
| 8c226054e7 | |||
| b4605f77e3 | |||
| 74a63daf7e | |||
| 8ee7910569 | |||
| b766a79c11 | |||
| 5e3b6d363a | |||
| b2fc59878a |
@@ -0,0 +1,6 @@
|
|||||||
|
!Makefile
|
||||||
|
base/*.sql
|
||||||
|
base/*.zip
|
||||||
|
base/db/
|
||||||
|
base/maps/
|
||||||
|
!base/expansion/Makefile
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# This is a "dev" image for running eqemu in development, also for dev containers
|
||||||
|
ARG USERNAME=user-name-goes-here
|
||||||
|
ARG USER_UID=1000
|
||||||
|
ARG USER_GID=$USER_UID
|
||||||
|
|
||||||
|
FROM --platform=linux/arm64 mcr.microsoft.com/devcontainers/base:debian
|
||||||
|
RUN sudo apt update && sudo apt install -y --no-install-recommends build-essential libtool cmake curl debconf-utils git libluabind-dev libsodium-dev liblua5.2-0 liblua5.2-dev libmariadb-dev libssl-dev minizip make mariadb-client locales nano open-vm-tools unzip uuid-dev iputils-ping wget libcurl4-openssl-dev gdb libyaml-cpp-dev ccache ninja-build pv mariadb-server libperl-dev libjson-perl libio-stringy-perl liblua5.1-dev libluabind-dev libboost-dev mariadb-server valgrind telnet libgoogle-perftools-dev google-perftools
|
||||||
|
|
||||||
|
USER $USERNAME
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# This is a "dev" image for running eqemu in development, also for dev containers
|
||||||
|
ARG USERNAME=user-name-goes-here
|
||||||
|
ARG USER_UID=1000
|
||||||
|
ARG USER_GID=$USER_UID
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/devcontainers/base:debian
|
||||||
|
RUN sudo apt update && sudo apt install -y --no-install-recommends build-essential libtool cmake curl debconf-utils git libluabind-dev libsodium-dev liblua5.2-0 liblua5.2-dev libmariadb-dev libssl-dev minizip make mariadb-client locales nano open-vm-tools unzip uuid-dev iputils-ping wget libcurl4-openssl-dev gdb libyaml-cpp-dev ccache ninja-build pv mariadb-server libperl-dev libjson-perl libio-stringy-perl liblua5.1-dev libluabind-dev libboost-dev mariadb-server valgrind telnet libgoogle-perftools-dev google-perftools
|
||||||
|
|
||||||
|
USER $USERNAME
|
||||||
@@ -0,0 +1,284 @@
|
|||||||
|
NAME := eqemu-server
|
||||||
|
.ONESHELL:
|
||||||
|
|
||||||
|
DOCKER_ARGS := --rm --name ${NAME} -v $$PWD:/src -w /src ${NAME}
|
||||||
|
DOCKER_ARM64_ARGS := --rm --platform linux/arm64 --name ${NAME}-arm64 -v $$PWD:/src -w /src ${NAME}-arm64
|
||||||
|
|
||||||
|
.PHONY: build
|
||||||
|
build:
|
||||||
|
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
|
||||||
|
@make -C ../ -f .devcontainer/Makefile build --no-print-directory
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
cd build$$BUILD_SUFFIX && cmake --build . --config Release --target all --
|
||||||
|
|
||||||
|
.PHONY: cmake
|
||||||
|
cmake:
|
||||||
|
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
|
||||||
|
@make -C ../ -f .devcontainer/Makefile cmake --no-print-directory
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
@echo "working directory: $$PWD"
|
||||||
|
mkdir -p build$$BUILD_SUFFIX
|
||||||
|
@cd build$$BUILD_SUFFIX && cmake -DEQEMU_BUILD_LOGIN=ON \
|
||||||
|
-DEQEMU_BUILD_TESTS=ON \
|
||||||
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -G Ninja ..
|
||||||
|
|
||||||
|
clean:
|
||||||
|
ifneq (,$(findstring .devcontainer,$$PWD))
|
||||||
|
@make -C ../ -f .devcontainer/Makefile clean --no-print-directory
|
||||||
|
endif
|
||||||
|
rm -rf build
|
||||||
|
|
||||||
|
docker-cmake:
|
||||||
|
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
|
||||||
|
@make -C ../ -f .devcontainer/Makefile docker-cmake --no-print-directory
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
@echo "working directory: $$PWD"
|
||||||
|
git submodule update --init --recursive
|
||||||
|
docker run ${DOCKER_ARGS} make cmake
|
||||||
|
|
||||||
|
docker-build:
|
||||||
|
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
|
||||||
|
@make -C ../ -f .devcontainer/Makefile docker-build --no-print-directory
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
docker run ${DOCKER_ARGS} make build
|
||||||
|
|
||||||
|
# Build image if it doesn't exist
|
||||||
|
docker-image-build:
|
||||||
|
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
|
||||||
|
@make -C ../ -f .devcontainer/Makefile docker-image-build --no-print-directory
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
ifeq ($(shell docker images -q ${NAME} 2> /dev/null),)
|
||||||
|
@echo "Docker image not found. Building..."
|
||||||
|
docker build -f Dockerfile.debian.dev -t ${NAME} .
|
||||||
|
endif
|
||||||
|
|
||||||
|
docker-arm-cmake: docker-arm-image-build
|
||||||
|
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
|
||||||
|
@make -C ../ -f .devcontainer/Makefile docker-arm-cmake --no-print-directory
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
git submodule update --init --recursive
|
||||||
|
docker run ${DOCKER_ARM64_ARGS} make cmake BUILD_SUFFIX=arm64
|
||||||
|
|
||||||
|
docker-arm-build: docker-arm-image-build
|
||||||
|
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
|
||||||
|
@make -C ../ -f .devcontainer/Makefile docker-arm-build --no-print-directory
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
docker run ${DOCKER_ARM64_ARGS} make build BUILD_SUFFIX=arm64
|
||||||
|
|
||||||
|
docker-arm-image-build:
|
||||||
|
ifeq ($(shell docker images -q ${NAME}-arm64 2> /dev/null),)
|
||||||
|
@echo "Docker image not found. Building..."
|
||||||
|
docker build -f Dockerfile.debian.arm.dev -t ${NAME}-arm64 .
|
||||||
|
endif
|
||||||
|
|
||||||
|
docker-clean: clean
|
||||||
|
|
||||||
|
.PHONY: prep
|
||||||
|
prep:
|
||||||
|
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
|
||||||
|
@make -C ../ -f .devcontainer/Makefile prep --no-print-directory
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
@echo "Preparing build/bin for usage..."
|
||||||
|
mkdir -p build/bin/assets/patches
|
||||||
|
cp -R -u -p .devcontainer/base/eqemu_config.json build/bin/eqemu_config.json
|
||||||
|
cp -R -u -p .devcontainer/base/login.json build/bin/login.json
|
||||||
|
cp -R -u -p loginserver/login_util/* build/bin/assets/patches/
|
||||||
|
mkdir -p build/bin/assets
|
||||||
|
cp -R -u -p utils/patches build/bin/assets/
|
||||||
|
-unlink build/bin/lua_modules
|
||||||
|
cd build/bin && ln -s quests/lua_modules lua_modules
|
||||||
|
-unlink build/bin/mods
|
||||||
|
cd build/bin && ln -s quests/mods mods
|
||||||
|
-unlink build/bin/maps
|
||||||
|
cd build/bin && ln -s ../../base/maps maps
|
||||||
|
mkdir -p build/bin/logs
|
||||||
|
mkdir -p build/bin/shared
|
||||||
|
@echo "Eqemu is prepared. Edit build/bin/eqemu_config.json to configure."
|
||||||
|
|
||||||
|
maps:
|
||||||
|
@echo "Downloading maps..."
|
||||||
|
@mkdir -p base/maps
|
||||||
|
@cd base/maps && wget -nc https://github.com/Akkadius/eqemu-maps/archive/refs/heads/master.zip
|
||||||
|
@cd base/maps && unzip -o master.zip
|
||||||
|
@cd base/maps && mv eqemu-maps-master/* .
|
||||||
|
@cd base/maps && rm -rf eqemu-maps-master
|
||||||
|
@echo "Maps downloaded."
|
||||||
|
|
||||||
|
quests:
|
||||||
|
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
|
||||||
|
@make -C ../ -f .devcontainer/Makefile quests --no-print-directory
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
@cd build/bin && git clone https://github.com/ProjectEQ/projecteqquests.git quests
|
||||||
|
|
||||||
|
# Runs tests
|
||||||
|
.PHONY: test
|
||||||
|
test:
|
||||||
|
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
|
||||||
|
@make -C ../ -f .devcontainer/Makefile test --no-print-directory
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
cd build/bin && ./tests
|
||||||
|
|
||||||
|
# Runs login binary
|
||||||
|
.PHONY: login
|
||||||
|
login:
|
||||||
|
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
|
||||||
|
@make -C ../ -f .devcontainer/Makefile login --no-print-directory
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
cd build/bin && ./loginserver
|
||||||
|
|
||||||
|
# Runs shared_memory binary
|
||||||
|
.PHONY: shared
|
||||||
|
shared:
|
||||||
|
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
|
||||||
|
@make -C ../ -f .devcontainer/Makefile shared --no-print-directory
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
cd build/bin && ./shared_memory
|
||||||
|
|
||||||
|
# Runs zone binary
|
||||||
|
.PHONY: zone
|
||||||
|
zone:
|
||||||
|
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
|
||||||
|
@make -C ../ -f .devcontainer/Makefile zone --no-print-directory
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
@-rm build/bin/logs/zone/zone*.log
|
||||||
|
cd build/bin && ./zone
|
||||||
|
|
||||||
|
# Runs world binary
|
||||||
|
.PHONY: world
|
||||||
|
world:
|
||||||
|
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
|
||||||
|
@make -C ../ -f .devcontainer/Makefile world --no-print-directory
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
@-rm build/bin/logs/world*.log
|
||||||
|
cd build/bin && ./world
|
||||||
|
|
||||||
|
# Runs ucs binary
|
||||||
|
.PHONY: ucs
|
||||||
|
ucs:
|
||||||
|
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
|
||||||
|
@make -C ../ -f .devcontainer/Makefile ucs --no-print-directory
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
@-rm build/bin/logs/ucs*.log
|
||||||
|
cd build/bin && ./ucs
|
||||||
|
|
||||||
|
# Runs queryserv binary
|
||||||
|
.PHONY: queryserv
|
||||||
|
queryserv:
|
||||||
|
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
|
||||||
|
@make -C ../ -f .devcontainer/Makefile queryserv --no-print-directory
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
@-rm build/bin/logs/query_server*.log
|
||||||
|
cd build/bin && ./queryserv
|
||||||
|
|
||||||
|
valgrind-%:
|
||||||
|
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
|
||||||
|
@make -C ../ -f .devcontainer/Makefile valgrind --no-print-directory
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
cd build/bin && valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --log-file=logs/$*.valgrind.log ./$*
|
||||||
|
|
||||||
|
# Start mariaDB standalone
|
||||||
|
.PHONY: mariadb
|
||||||
|
mariadb:
|
||||||
|
@sudo service mariadb start
|
||||||
|
|
||||||
|
.PHONY: inject-mariadb
|
||||||
|
inject-mariadb:
|
||||||
|
-sudo service mariadb start
|
||||||
|
-mkdir -p base/db/
|
||||||
|
-sudo mariadb -e 'DROP DATABASE IF EXISTS peq;'
|
||||||
|
-sudo mariadb -e 'CREATE DATABASE peq;'
|
||||||
|
-sudo mariadb -e "CREATE USER 'peq'@'127.0.0.1' IDENTIFIED BY 'peqpass';"
|
||||||
|
-sudo mariadb -e "GRANT ALL PRIVILEGES ON *.* TO 'peq'@'127.0.0.1';"
|
||||||
|
ifeq (,$(wildcard base/db/db.sql.zip))
|
||||||
|
@echo "base/db.sql.zip not found. Downloading latest from https://db.projecteq.net/"
|
||||||
|
wget -nc https://db.projecteq.net/latest -O base/db/db.sql.zip
|
||||||
|
-cd base/db && unzip db.sql.zip
|
||||||
|
endif
|
||||||
|
@echo "Sourcing db may take a while, please wait..."
|
||||||
|
@cd base/db/peq-dump && sudo mariadb --database peq -e "source create_all_tables.sql"
|
||||||
|
@echo "MariaDB is now injected."
|
||||||
|
|
||||||
|
.PHONY: gm-%
|
||||||
|
gm-%:
|
||||||
|
sudo mariadb --database peq -e "UPDATE account SET status=255 WHERE name = '$*';"
|
||||||
|
@echo "Account $* is now a GM. /camp to have it go into effect."
|
||||||
|
|
||||||
|
depends:
|
||||||
|
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
|
||||||
|
@make -C ../ -f .devcontainer/Makefile depends --no-print-directory
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
sudo apt install graphviz pip time
|
||||||
|
pip3 install graphviz
|
||||||
|
mkdir -p build/depends
|
||||||
|
@if [ ! -f "build/depends/dependency_graph.py" ]; then \
|
||||||
|
wget https://raw.githubusercontent.com/pvigier/dependency-graph/master/dependency_graph.py -O build/depends/dependency_graph.py; \
|
||||||
|
fi
|
||||||
|
@echo "Generating dependency graphs (This may take a while)..."
|
||||||
|
@echo "Login..."
|
||||||
|
time python3 build/depends/dependency_graph.py -f png login build/depends/login.dot
|
||||||
|
@echo "World..."
|
||||||
|
time python3 build/depends/dependency_graph.py -f png world build/depends/world.dot
|
||||||
|
@echo "Zone..."
|
||||||
|
time python3 build/depends/dependency_graph.py -f png zone build/depends/zone.dot
|
||||||
|
@echo "Common..."
|
||||||
|
time python3 build/depends/dependency_graph.py -f png common build/depends/common.dot
|
||||||
|
|
||||||
|
backup:
|
||||||
|
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
|
||||||
|
@make -C ../ -f .devcontainer/Makefile backup --no-print-directory
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
@mkdir -p build/bin/backup
|
||||||
|
cd build/bin && ./world database:dump --compress --player-tables --state-tables --system-tables --query-serv-tables
|
||||||
|
|
||||||
|
cpu-zone:
|
||||||
|
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
|
||||||
|
@make -C ../ -f .devcontainer/Makefile cpu-zone --no-print-directory
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
@cd build/bin && mkdir -p tmp
|
||||||
|
cd build/bin && CPUPROFILE=prof.out ./zone
|
||||||
|
|
||||||
|
pprof-zone:
|
||||||
|
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
|
||||||
|
@make -C ../ -f .devcontainer/Makefile pprof-zone --no-print-directory
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
cd build/bin && google-pprof --pdf zone prof.out > prof.pdf
|
||||||
|
pprof-web-zone:
|
||||||
|
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
|
||||||
|
@make -C ../ -f .devcontainer/Makefile pprof-web-zone --no-print-directory
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
cd build/bin && google-pprof --web zone prof.out
|
||||||
|
pprof-gv-zone:
|
||||||
|
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
|
||||||
|
@make -C ../ -f .devcontainer/Makefile pprof-gv-zone --no-print-directory
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
cd build/bin && google-pprof --gv zone prof.out > prof.gv
|
||||||
|
heap-zone:
|
||||||
|
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
|
||||||
|
@make -C ../ -f .devcontainer/Makefile heap-zone --no-print-directory
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
@cd build/bin && mkdir -p tmp
|
||||||
|
cd build/bin && HEAPPROFILE=prof.out ./zone
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
{
|
||||||
|
"server": {
|
||||||
|
"zones": {
|
||||||
|
"defaultstatus": "0",
|
||||||
|
"ports": {
|
||||||
|
"low": "7000",
|
||||||
|
"high": "7400"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"qsdatabase": {
|
||||||
|
"host": "127.0.0.1",
|
||||||
|
"port": "3306",
|
||||||
|
"username": "peq",
|
||||||
|
"password": "peqpass",
|
||||||
|
"db": "peq"
|
||||||
|
},
|
||||||
|
"chatserver": {
|
||||||
|
"port": "7778",
|
||||||
|
"host": ""
|
||||||
|
},
|
||||||
|
"mailserver": {
|
||||||
|
"host": "",
|
||||||
|
"port": "7778"
|
||||||
|
},
|
||||||
|
"webinterface": {
|
||||||
|
"port": "9081"
|
||||||
|
},
|
||||||
|
"world": {
|
||||||
|
"longname": "New Devbox",
|
||||||
|
"address": "192.168.1.100",
|
||||||
|
"localaddress": "192.168.1.100",
|
||||||
|
"loginserver1": {
|
||||||
|
"account": "",
|
||||||
|
"password": "",
|
||||||
|
"legacy": 0,
|
||||||
|
"host": "login.projecteq.net",
|
||||||
|
"port": "5998"
|
||||||
|
},
|
||||||
|
"tcp": {
|
||||||
|
"ip": "127.0.0.1",
|
||||||
|
"port": "9001"
|
||||||
|
},
|
||||||
|
"telnet": {
|
||||||
|
"ip": "0.0.0.0",
|
||||||
|
"port": "9000",
|
||||||
|
"enabled": "true"
|
||||||
|
},
|
||||||
|
"key": "random-generate-here",
|
||||||
|
"http": {
|
||||||
|
"port": "9080",
|
||||||
|
"enabled": "true",
|
||||||
|
"mimefile": "mime.types"
|
||||||
|
},
|
||||||
|
"shortname": "dev"
|
||||||
|
},
|
||||||
|
"database": {
|
||||||
|
"db": "peq",
|
||||||
|
"host": "127.0.0.1",
|
||||||
|
"port": "3306",
|
||||||
|
"username": "peq",
|
||||||
|
"password": "peqpass"
|
||||||
|
},
|
||||||
|
"files": {
|
||||||
|
"opcodes": "assets/patches/opcodes.conf",
|
||||||
|
"mail_opcodes": "assets/patches/mail_opcodes.conf"
|
||||||
|
},
|
||||||
|
"directories": {
|
||||||
|
"patches": "assets/patches/",
|
||||||
|
"opcodes": "assets/patches/",
|
||||||
|
"plugins": "quests/plugins/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"database": {
|
||||||
|
"host": "127.0.0.1",
|
||||||
|
"port": "3306",
|
||||||
|
"db": "peq",
|
||||||
|
"user": "peq",
|
||||||
|
"password": "peqpass"
|
||||||
|
},
|
||||||
|
"account": {
|
||||||
|
"auto_create_accounts": true
|
||||||
|
},
|
||||||
|
"worldservers": {
|
||||||
|
"unregistered_allowed": true,
|
||||||
|
"reject_duplicate_servers": false
|
||||||
|
},
|
||||||
|
"web_api": {
|
||||||
|
"enabled": true,
|
||||||
|
"port": 6000
|
||||||
|
},
|
||||||
|
"security": {
|
||||||
|
"mode": 14,
|
||||||
|
"allow_password_login": true,
|
||||||
|
"allow_token_login": true
|
||||||
|
},
|
||||||
|
"logging": {
|
||||||
|
"trace": false,
|
||||||
|
"world_trace": false,
|
||||||
|
"dump_packets_in": false,
|
||||||
|
"dump_packets_out": false
|
||||||
|
},
|
||||||
|
"client_configuration": {
|
||||||
|
"titanium_port": 5998,
|
||||||
|
"titanium_opcodes": "assets/patches/login_opcodes.conf",
|
||||||
|
"sod_port": 5999,
|
||||||
|
"sod_opcodes": "assets/patches/login_opcodes_sod.conf"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||||
|
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
|
||||||
|
{
|
||||||
|
"name": "eqemu",
|
||||||
|
"build": {
|
||||||
|
"dockerfile": "Dockerfile.debian.dev"
|
||||||
|
},
|
||||||
|
"appPort": [
|
||||||
|
"5998:5998/udp",
|
||||||
|
"7000:7000/udp",
|
||||||
|
"7001:7001/udp",
|
||||||
|
"7002:7002/udp",
|
||||||
|
"7003:7003/udp",
|
||||||
|
"7004:7004/udp",
|
||||||
|
"7005:7005/udp",
|
||||||
|
"9000:9000/udp",
|
||||||
|
"9001:9001/udp"
|
||||||
|
],
|
||||||
|
"forwardPorts": [
|
||||||
|
3306
|
||||||
|
],
|
||||||
|
"remoteEnv": {
|
||||||
|
"LOCALWSF": "${localWorkspaceFolder}",
|
||||||
|
"CONTAINERWSF": "${containerWorkspaceFolder}"
|
||||||
|
},
|
||||||
|
"containerUser": "vscode",
|
||||||
|
// add ptrace
|
||||||
|
"runArgs": [
|
||||||
|
"--cap-add=SYS_PTRACE",
|
||||||
|
"--security-opt",
|
||||||
|
"seccomp=unconfined"
|
||||||
|
],
|
||||||
|
"customizations": {
|
||||||
|
"vscode": {
|
||||||
|
"extensions": [
|
||||||
|
"ms-vscode.cpptools-extension-pack",
|
||||||
|
"vilicvane.sensitive-replace",
|
||||||
|
"maattdd.gitless",
|
||||||
|
"bibhasdn.unique-lines",
|
||||||
|
"GitHub.copilot",
|
||||||
|
"xackery.make-magic",
|
||||||
|
"Gruntfuggly.todo-tree",
|
||||||
|
"ms-vscode.cmake-tools"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"workspaceFolder": "/src",
|
||||||
|
"workspaceMount": "source=${localWorkspaceFolder},target=/src,type=bind,consistency=cached"
|
||||||
|
}
|
||||||
@@ -61,9 +61,6 @@ bin/
|
|||||||
compile_flags.txt
|
compile_flags.txt
|
||||||
.cache/
|
.cache/
|
||||||
|
|
||||||
# vscode generated settings
|
|
||||||
.vscode/
|
|
||||||
|
|
||||||
# Build pipeline
|
# Build pipeline
|
||||||
!utils/scripts/build/
|
!utils/scripts/build/
|
||||||
!utils/scripts/build/should-release/should-release
|
!utils/scripts/build/should-release/should-release
|
||||||
|
|||||||
Vendored
+23
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Linux",
|
||||||
|
"includePath": [
|
||||||
|
"${default}",
|
||||||
|
"${workspaceFolder}/submodules/fmt/include",
|
||||||
|
"${workspaceFolder}/submodules/cereal/include",
|
||||||
|
"${workspaceFolder}/submodules/glm",
|
||||||
|
"${workspaceFolder}/submodules/libuv/include"
|
||||||
|
],
|
||||||
|
"defines": [
|
||||||
|
"LUA_EQEMU=1"
|
||||||
|
],
|
||||||
|
"compilerPath": "/usr/bin/gcc",
|
||||||
|
"cStandard": "c17",
|
||||||
|
"cppStandard": "gnu++17",
|
||||||
|
"intelliSenseMode": "linux-gcc-x64",
|
||||||
|
"configurationProvider": "ms-vscode.cmake-tools"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": 4
|
||||||
|
}
|
||||||
Vendored
+173
@@ -0,0 +1,173 @@
|
|||||||
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "(gdb) attach",
|
||||||
|
"type": "cppdbg",
|
||||||
|
"request": "attach",
|
||||||
|
"program": "${workspaceFolder}/build/bin/world",
|
||||||
|
"MIMode": "gdb",
|
||||||
|
"setupCommands": [
|
||||||
|
{
|
||||||
|
"description": "Enable pretty-printing for gdb",
|
||||||
|
"text": "-enable-pretty-printing",
|
||||||
|
"ignoreFailures": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Set Disassembly Flavor to Intel",
|
||||||
|
"text": "-gdb-set disassembly-flavor intel",
|
||||||
|
"ignoreFailures": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "(gdb) shared_memory",
|
||||||
|
"type": "cppdbg",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceFolder}/build/bin/shared_memory",
|
||||||
|
"cwd": "${workspaceFolder}/build/bin",
|
||||||
|
"MIMode": "gdb",
|
||||||
|
"setupCommands": [
|
||||||
|
{
|
||||||
|
"description": "Enable pretty-printing for gdb",
|
||||||
|
"text": "-enable-pretty-printing",
|
||||||
|
"ignoreFailures": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Set Disassembly Flavor to Intel",
|
||||||
|
"text": "-gdb-set disassembly-flavor intel",
|
||||||
|
"ignoreFailures": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "(gdb) world",
|
||||||
|
"type": "cppdbg",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceFolder}/build/bin/world",
|
||||||
|
"cwd": "${workspaceFolder}/build/bin",
|
||||||
|
"MIMode": "gdb",
|
||||||
|
"setupCommands": [
|
||||||
|
{
|
||||||
|
"description": "Enable pretty-printing for gdb",
|
||||||
|
"text": "-enable-pretty-printing",
|
||||||
|
"ignoreFailures": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Set Disassembly Flavor to Intel",
|
||||||
|
"text": "-gdb-set disassembly-flavor intel",
|
||||||
|
"ignoreFailures": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "(gdb) zone",
|
||||||
|
"type": "cppdbg",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceFolder}/build/bin/zone",
|
||||||
|
"cwd": "${workspaceFolder}/build/bin",
|
||||||
|
"args": [
|
||||||
|
"",
|
||||||
|
],
|
||||||
|
"MIMode": "gdb",
|
||||||
|
"setupCommands": [
|
||||||
|
{
|
||||||
|
"description": "Enable pretty-printing for gdb",
|
||||||
|
"text": "-enable-pretty-printing",
|
||||||
|
"ignoreFailures": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Set Disassembly Flavor to Intel",
|
||||||
|
"text": "-gdb-set disassembly-flavor intel",
|
||||||
|
"ignoreFailures": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "(gdb) zone neriakb",
|
||||||
|
"type": "cppdbg",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceFolder}/build/bin/zone",
|
||||||
|
"cwd": "${workspaceFolder}/build/bin",
|
||||||
|
"args": [
|
||||||
|
"neriakb",
|
||||||
|
],
|
||||||
|
"MIMode": "gdb",
|
||||||
|
"setupCommands": [
|
||||||
|
{
|
||||||
|
"description": "Enable pretty-printing for gdb",
|
||||||
|
"text": "-enable-pretty-printing",
|
||||||
|
"ignoreFailures": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Set Disassembly Flavor to Intel",
|
||||||
|
"text": "-gdb-set disassembly-flavor intel",
|
||||||
|
"ignoreFailures": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "(gdb) login",
|
||||||
|
"type": "cppdbg",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceFolder}/build/bin/loginserver",
|
||||||
|
"cwd": "${workspaceFolder}/build/bin",
|
||||||
|
"MIMode": "gdb",
|
||||||
|
"setupCommands": [
|
||||||
|
{
|
||||||
|
"description": "Enable pretty-printing for gdb",
|
||||||
|
"text": "-enable-pretty-printing",
|
||||||
|
"ignoreFailures": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Set Disassembly Flavor to Intel",
|
||||||
|
"text": "-gdb-set disassembly-flavor intel",
|
||||||
|
"ignoreFailures": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "(gdb) ucs",
|
||||||
|
"type": "cppdbg",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceFolder}/build/bin/ucs",
|
||||||
|
"cwd": "${workspaceFolder}/build/bin",
|
||||||
|
"MIMode": "gdb",
|
||||||
|
"setupCommands": [
|
||||||
|
{
|
||||||
|
"description": "Enable pretty-printing for gdb",
|
||||||
|
"text": "-enable-pretty-printing",
|
||||||
|
"ignoreFailures": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Set Disassembly Flavor to Intel",
|
||||||
|
"text": "-gdb-set disassembly-flavor intel",
|
||||||
|
"ignoreFailures": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "(gdb) queryserv",
|
||||||
|
"type": "cppdbg",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceFolder}/build/bin/queryserv",
|
||||||
|
"cwd": "${workspaceFolder}/build/bin",
|
||||||
|
"MIMode": "gdb",
|
||||||
|
"setupCommands": [
|
||||||
|
{
|
||||||
|
"description": "Enable pretty-printing for gdb",
|
||||||
|
"text": "-enable-pretty-printing",
|
||||||
|
"ignoreFailures": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Set Disassembly Flavor to Intel",
|
||||||
|
"text": "-gdb-set disassembly-flavor intel",
|
||||||
|
"ignoreFailures": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Vendored
+136
@@ -0,0 +1,136 @@
|
|||||||
|
{
|
||||||
|
"editor.detectIndentation": false,
|
||||||
|
"editor.insertSpaces": false,
|
||||||
|
"editor.tabSize": 4,
|
||||||
|
"editor.autoIndent": "full",
|
||||||
|
"editor.trimAutoWhitespace": true,
|
||||||
|
"files.trimTrailingWhitespace": true,
|
||||||
|
//"editor.formatOnSave": true,
|
||||||
|
"search.exclude": {
|
||||||
|
"dependencies": false,
|
||||||
|
},
|
||||||
|
"C_Cpp.default.includePath": [
|
||||||
|
"/usr/include/x86_64-linux-gnu",
|
||||||
|
"/usr/include/lua5.2",
|
||||||
|
"/usr/include/mariadb",
|
||||||
|
"${workspaceFolder}/dependencies/curl_x64/include",
|
||||||
|
"${workspaceFolder}/dependencies/fmt/include",
|
||||||
|
"${workspaceFolder}/dependencies/glm",
|
||||||
|
"${workspaceFolder}/dependencies/libuv/include",
|
||||||
|
"${workspaceFolder}/dependencies/sol2",
|
||||||
|
"${workspaceFolder}/dependencies/zlibng"
|
||||||
|
],
|
||||||
|
"telemetry.enableTelemetry": false,
|
||||||
|
"cmake.buildDirectory": "${workspaceFolder}/build",
|
||||||
|
"cmake.configureArgs": [
|
||||||
|
"-DEQEMU_BUILD_LOGIN=ON",
|
||||||
|
"-DEQEMU_BUILD_TESTS=ON",
|
||||||
|
"-DCMAKE_CXX_COMPILER_LAUNCHER=ccache",
|
||||||
|
"-DEQEMU_ADD_PROFILER=ON",
|
||||||
|
"Ninja"
|
||||||
|
],
|
||||||
|
"cmake.skipConfigureIfCachePresent": true,
|
||||||
|
"cmake.configureOnOpen": false,
|
||||||
|
"files.associations": {
|
||||||
|
"*.ipp": "cpp",
|
||||||
|
"functional": "cpp",
|
||||||
|
"string": "cpp",
|
||||||
|
"iostream": "cpp",
|
||||||
|
"map": "cpp",
|
||||||
|
"fstream": "cpp",
|
||||||
|
"type_traits": "cpp",
|
||||||
|
"utility": "cpp",
|
||||||
|
"cstring": "cpp",
|
||||||
|
"*.tcc": "cpp",
|
||||||
|
"cctype": "cpp",
|
||||||
|
"clocale": "cpp",
|
||||||
|
"cmath": "cpp",
|
||||||
|
"csignal": "cpp",
|
||||||
|
"cstdarg": "cpp",
|
||||||
|
"cstddef": "cpp",
|
||||||
|
"cstdio": "cpp",
|
||||||
|
"cstdlib": "cpp",
|
||||||
|
"ctime": "cpp",
|
||||||
|
"cwchar": "cpp",
|
||||||
|
"cwctype": "cpp",
|
||||||
|
"any": "cpp",
|
||||||
|
"array": "cpp",
|
||||||
|
"atomic": "cpp",
|
||||||
|
"strstream": "cpp",
|
||||||
|
"bit": "cpp",
|
||||||
|
"bitset": "cpp",
|
||||||
|
"chrono": "cpp",
|
||||||
|
"codecvt": "cpp",
|
||||||
|
"compare": "cpp",
|
||||||
|
"complex": "cpp",
|
||||||
|
"concepts": "cpp",
|
||||||
|
"condition_variable": "cpp",
|
||||||
|
"coroutine": "cpp",
|
||||||
|
"cstdint": "cpp",
|
||||||
|
"deque": "cpp",
|
||||||
|
"forward_list": "cpp",
|
||||||
|
"list": "cpp",
|
||||||
|
"set": "cpp",
|
||||||
|
"unordered_map": "cpp",
|
||||||
|
"unordered_set": "cpp",
|
||||||
|
"vector": "cpp",
|
||||||
|
"exception": "cpp",
|
||||||
|
"algorithm": "cpp",
|
||||||
|
"iterator": "cpp",
|
||||||
|
"memory": "cpp",
|
||||||
|
"memory_resource": "cpp",
|
||||||
|
"numeric": "cpp",
|
||||||
|
"optional": "cpp",
|
||||||
|
"random": "cpp",
|
||||||
|
"ratio": "cpp",
|
||||||
|
"regex": "cpp",
|
||||||
|
"source_location": "cpp",
|
||||||
|
"string_view": "cpp",
|
||||||
|
"system_error": "cpp",
|
||||||
|
"tuple": "cpp",
|
||||||
|
"future": "cpp",
|
||||||
|
"initializer_list": "cpp",
|
||||||
|
"iomanip": "cpp",
|
||||||
|
"iosfwd": "cpp",
|
||||||
|
"istream": "cpp",
|
||||||
|
"limits": "cpp",
|
||||||
|
"mutex": "cpp",
|
||||||
|
"new": "cpp",
|
||||||
|
"numbers": "cpp",
|
||||||
|
"ostream": "cpp",
|
||||||
|
"semaphore": "cpp",
|
||||||
|
"sstream": "cpp",
|
||||||
|
"stdexcept": "cpp",
|
||||||
|
"stop_token": "cpp",
|
||||||
|
"streambuf": "cpp",
|
||||||
|
"thread": "cpp",
|
||||||
|
"cfenv": "cpp",
|
||||||
|
"cinttypes": "cpp",
|
||||||
|
"typeindex": "cpp",
|
||||||
|
"typeinfo": "cpp",
|
||||||
|
"valarray": "cpp",
|
||||||
|
"variant": "cpp",
|
||||||
|
"csetjmp": "cpp",
|
||||||
|
"charconv": "cpp",
|
||||||
|
"format": "cpp",
|
||||||
|
"ranges": "cpp",
|
||||||
|
"span": "cpp"
|
||||||
|
},
|
||||||
|
"cmake.statusbar.advanced": {
|
||||||
|
"kit": {
|
||||||
|
"visibility": "hidden",
|
||||||
|
},
|
||||||
|
"debug": {
|
||||||
|
"visibility": "hidden",
|
||||||
|
},
|
||||||
|
"buildTarget": {
|
||||||
|
"visibility": "hidden",
|
||||||
|
},
|
||||||
|
"launch": {
|
||||||
|
"visibility": "hidden",
|
||||||
|
},
|
||||||
|
"ctest": {
|
||||||
|
"visibility": "icon",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+395
@@ -1,3 +1,398 @@
|
|||||||
|
## [22.51.0] 5/26/2024
|
||||||
|
|
||||||
|
### Commands
|
||||||
|
|
||||||
|
* #npcspawn Changes ([#4311](https://github.com/EQEmu/Server/pull/4311)) @twincannon 2024-05-16
|
||||||
|
* Cleanup #resetaa Command ([#4310](https://github.com/EQEmu/Server/pull/4310)) @Kinglykrab 2024-05-22
|
||||||
|
|
||||||
|
### Crash
|
||||||
|
|
||||||
|
* Add validation to RemoveXTarget ([#4324](https://github.com/EQEmu/Server/pull/4324)) @Akkadius 2024-05-25
|
||||||
|
* Fix Zone deconstructor crashes ([#4325](https://github.com/EQEmu/Server/pull/4325)) @Akkadius 2024-05-25
|
||||||
|
* Fix crash issue when dividing by zero in CalcHPRegen ([#4320](https://github.com/EQEmu/Server/pull/4320)) @Akkadius 2024-05-25
|
||||||
|
* Fix crash when map name is null ([#4322](https://github.com/EQEmu/Server/pull/4322)) @Akkadius 2024-05-25
|
||||||
|
* Fix player event crash in ITEM_DESTROY ([#4326](https://github.com/EQEmu/Server/pull/4326)) @Akkadius 2024-05-25
|
||||||
|
* Fix player events reload when out of bounds ([#4321](https://github.com/EQEmu/Server/pull/4321)) @Akkadius 2024-05-25
|
||||||
|
* Fix rarer crash in EntityList::MobProcess ([#4319](https://github.com/EQEmu/Server/pull/4319)) @Akkadius 2024-05-25
|
||||||
|
|
||||||
|
### Feature
|
||||||
|
|
||||||
|
* Add RoF2 Bazaar Support ([#4315](https://github.com/EQEmu/Server/pull/4315)) @neckkola 2024-05-26
|
||||||
|
* Add SE_IncreaseArchery and rules to tune archery ([#4335](https://github.com/EQEmu/Server/pull/4335)) @fryguy503 2024-05-26
|
||||||
|
* Add parcel container support ([#4305](https://github.com/EQEmu/Server/pull/4305)) @neckkola 2024-05-17
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Accuracy, Avoidance and Atk adjustments ([#4336](https://github.com/EQEmu/Server/pull/4336)) @fryguy503 2024-05-26
|
||||||
|
* Fix Crash with null Argument in #modifynpcstat ([#4318](https://github.com/EQEmu/Server/pull/4318)) @Kinglykrab 2024-05-24
|
||||||
|
* Fix RemoveAlternateCurrencyValue not updating Client ([#4317](https://github.com/EQEmu/Server/pull/4317)) @Kinglykrab 2024-05-23
|
||||||
|
* Fix Using Bind Wound Above 70% Health ([#4340](https://github.com/EQEmu/Server/pull/4340)) @Kinglykrab 2024-05-26
|
||||||
|
* Fix issue with #hotfix ([#4316](https://github.com/EQEmu/Server/pull/4316)) @Kinglykrab 2024-05-22
|
||||||
|
* Fix issue with #suspend ([#4314](https://github.com/EQEmu/Server/pull/4314)) @Kinglykrab 2024-05-23
|
||||||
|
* Fix issue with KeepOneRecordPerCompletedTask ([#4313](https://github.com/EQEmu/Server/pull/4313)) @Kinglykrab 2024-05-23
|
||||||
|
* Fix mistaken removed RULE_CATEGORY_END() ([#4341](https://github.com/EQEmu/Server/pull/4341)) @fryguy503 2024-05-26
|
||||||
|
* Missed a mob offense section for PR #4328 ([#4331](https://github.com/EQEmu/Server/pull/4331)) @fryguy503 2024-05-26
|
||||||
|
* Raid Targets should not be Blindable as this will break all spell casting AI. ([#4334](https://github.com/EQEmu/Server/pull/4334)) @fryguy503 2024-05-26
|
||||||
|
* When Mounts are allowed to zone, block them from zoning to disallowed zones. ([#4330](https://github.com/EQEmu/Server/pull/4330)) @fryguy503 2024-05-25
|
||||||
|
* When refreshing buffs, attempt to use the same buffslot if the buff still exists. ([#4338](https://github.com/EQEmu/Server/pull/4338)) @fryguy503 2024-05-26
|
||||||
|
|
||||||
|
### Lua Mod
|
||||||
|
|
||||||
|
* Fix issue with SetAAEXP and SetEXP firing when uninitialized ([#4345](https://github.com/EQEmu/Server/pull/4345)) @Akkadius 2024-05-26
|
||||||
|
|
||||||
|
### Merchants
|
||||||
|
|
||||||
|
* Add New Classic Greed/Faction/Charisma Prices Rule ([#4301](https://github.com/EQEmu/Server/pull/4301)) @noudess 2024-05-17
|
||||||
|
|
||||||
|
### Mobs
|
||||||
|
|
||||||
|
* Remove entity type checks from ScanCloseMobs ([#4323](https://github.com/EQEmu/Server/pull/4323)) @Akkadius 2024-05-25
|
||||||
|
|
||||||
|
### NPC Spells
|
||||||
|
|
||||||
|
* Fix an issue where procs wouldn't fire if no spell entries in list ([#4344](https://github.com/EQEmu/Server/pull/4344)) @Akkadius 2024-05-26
|
||||||
|
|
||||||
|
### Perl
|
||||||
|
|
||||||
|
* Linux /opt/eqemu-perl checks when using release binaries ([#4346](https://github.com/EQEmu/Server/pull/4346)) @Akkadius 2024-05-26
|
||||||
|
|
||||||
|
### Quest API
|
||||||
|
|
||||||
|
* Add Zone Uptime Exports to Perl/Lua ([#4339](https://github.com/EQEmu/Server/pull/4339)) @Kinglykrab 2024-05-26
|
||||||
|
|
||||||
|
### Rules
|
||||||
|
|
||||||
|
* Added MeleeMitigation Level Difference Roll Adjusted for level diffs ([#4332](https://github.com/EQEmu/Server/pull/4332)) @fryguy503 2024-05-26
|
||||||
|
* Allow maximum per kill AA amount ([#4329](https://github.com/EQEmu/Server/pull/4329)) @fryguy503 2024-05-25
|
||||||
|
* Allow servers to adjust the filtering threshold for heals from damage (e.g. Mark of Kings). ([#4327](https://github.com/EQEmu/Server/pull/4327)) @fryguy503 2024-05-25
|
||||||
|
* Backstab Haste Correction ([#4337](https://github.com/EQEmu/Server/pull/4337)) @fryguy503 2024-05-26
|
||||||
|
* Mob Offensive and Weapon Skill static tables ([#4328](https://github.com/EQEmu/Server/pull/4328)) @fryguy503 2024-05-25
|
||||||
|
* Remove hard coded initial aggro in favor or an adjustable Rule ([#4333](https://github.com/EQEmu/Server/pull/4333)) @fryguy503 2024-05-26
|
||||||
|
|
||||||
|
### Scripts
|
||||||
|
|
||||||
|
* Fix zone data load ordering issue ([#4343](https://github.com/EQEmu/Server/pull/4343)) @Akkadius 2024-05-26
|
||||||
|
|
||||||
|
### Spells
|
||||||
|
|
||||||
|
* Add content filtering to NPC spells ([#4309](https://github.com/EQEmu/Server/pull/4309)) @Akkadius 2024-05-17
|
||||||
|
|
||||||
|
## [22.50.1] 5/12/2024
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Clear GuildOnlineStatus on world boot ([#4306](https://github.com/EQEmu/Server/pull/4306)) @neckkola 2024-05-12
|
||||||
|
|
||||||
|
## [22.50.0] 5/9/2024
|
||||||
|
|
||||||
|
### Code
|
||||||
|
|
||||||
|
* Fix Message in #find task ([#4270](https://github.com/EQEmu/Server/pull/4270)) @Kinglykrab 2024-04-19
|
||||||
|
|
||||||
|
### Combat
|
||||||
|
|
||||||
|
* Add rule to set stun duration. Add rule to add stun messages. ([#4284](https://github.com/EQEmu/Server/pull/4284)) @noudess 2024-04-25
|
||||||
|
|
||||||
|
### Commands
|
||||||
|
|
||||||
|
* Adjust #kill and #list Commands ([#4271](https://github.com/EQEmu/Server/pull/4271)) @Kinglykrab 2024-05-04
|
||||||
|
|
||||||
|
### Compiling
|
||||||
|
|
||||||
|
* Add profiler flag ([#4293](https://github.com/EQEmu/Server/pull/4293)) @xackery 2024-05-04
|
||||||
|
|
||||||
|
### Corpses
|
||||||
|
|
||||||
|
* Corpse searches for items did not search augs ([#4289](https://github.com/EQEmu/Server/pull/4289)) @noudess 2024-04-27
|
||||||
|
|
||||||
|
### Database
|
||||||
|
|
||||||
|
* Add Extra Haste to Bots/Character Tables ([#4286](https://github.com/EQEmu/Server/pull/4286)) @Kinglykrab 2024-05-04
|
||||||
|
* Break out changes to `npc_types` from parcels ([#4295](https://github.com/EQEmu/Server/pull/4295)) @joligario 2024-05-03
|
||||||
|
* Move pets query to content database ([#4296](https://github.com/EQEmu/Server/pull/4296)) @joligario 2024-05-04
|
||||||
|
|
||||||
|
### Doors
|
||||||
|
|
||||||
|
* Replace magic # in code with a field in doors table for when door closes. ([#4288](https://github.com/EQEmu/Server/pull/4288)) @noudess 2024-04-25
|
||||||
|
|
||||||
|
### Experience
|
||||||
|
|
||||||
|
* Add SetExp/SetAAExp lua mods ([#4292](https://github.com/EQEmu/Server/pull/4292)) @xackery 2024-05-04
|
||||||
|
|
||||||
|
### Feature
|
||||||
|
|
||||||
|
* Add Augmentation Support for Parcels ([#4285](https://github.com/EQEmu/Server/pull/4285)) @neckkola 2024-04-24
|
||||||
|
* Add Character Auto Login ([#4216](https://github.com/EQEmu/Server/pull/4216)) @Kinglykrab 2024-04-15
|
||||||
|
* Add Parcel Feature for RoF2 Clients ([#4198](https://github.com/EQEmu/Server/pull/4198)) @neckkola 2024-04-21
|
||||||
|
* Add `is_parcel_merchant` to #npcedit ([#4290](https://github.com/EQEmu/Server/pull/4290)) @Kinglykrab 2024-05-04
|
||||||
|
* Add devcontainer support ([#4294](https://github.com/EQEmu/Server/pull/4294)) @xackery 2024-05-09
|
||||||
|
* Fix ignore_default on lua mod damage ([#4228](https://github.com/EQEmu/Server/pull/4228)) @xackery 2024-04-15
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* "GM flag" vs "GM Flag" @Akkadius 2024-05-04
|
||||||
|
* All NPC classes could stun with kick/only warriors could be stunned ([#4273](https://github.com/EQEmu/Server/pull/4273)) @noudess 2024-04-24
|
||||||
|
* Fix Account Flags Loading ([#4243](https://github.com/EQEmu/Server/pull/4243)) @Kinglykrab 2024-04-15
|
||||||
|
* Fix Corpses "Disappearing" ([#4275](https://github.com/EQEmu/Server/pull/4275)) @joligario 2024-04-21
|
||||||
|
* Fix Issue With Auto Login ([#4267](https://github.com/EQEmu/Server/pull/4267)) @Kinglykrab 2024-04-21
|
||||||
|
* Fix crash from #4266 @Akkadius 2024-05-05
|
||||||
|
* Fixes Issue 4257 - Double Taunt Message ([#4258](https://github.com/EQEmu/Server/pull/4258)) @fryguy503 2024-04-18
|
||||||
|
* GLAA fix after database.cpp updates ([#4277](https://github.com/EQEmu/Server/pull/4277)) @neckkola 2024-04-21
|
||||||
|
* GetSkill default return 0 @Akkadius 2024-05-05
|
||||||
|
* Hero forge armor bug on login and show helm toggle. ([#4246](https://github.com/EQEmu/Server/pull/4246)) @noudess 2024-04-15
|
||||||
|
* Perl__send_parcel GCC compile error @Akkadius 2024-05-05
|
||||||
|
* Remove food or water GM message @Akkadius 2024-05-05
|
||||||
|
* Revert GetSkill from #4234 @Akkadius 2024-05-05
|
||||||
|
* Fix for world crash with over 1500 guilds ([#4299](https://github.com/EQEmu/Server/pull/4299)) @neckkola 2024-05-09
|
||||||
|
|
||||||
|
### Hot Fix
|
||||||
|
|
||||||
|
* Update database_update_manifest.cpp ([#4291](https://github.com/EQEmu/Server/pull/4291)) @noudess 2024-04-29
|
||||||
|
|
||||||
|
### Loot
|
||||||
|
|
||||||
|
* Add content filtering to lootdrop_entries ([#4229](https://github.com/EQEmu/Server/pull/4229)) @Akkadius 2024-04-15
|
||||||
|
* Consolidate filtering logic ([#4280](https://github.com/EQEmu/Server/pull/4280)) @Akkadius 2024-04-21
|
||||||
|
|
||||||
|
### Lua
|
||||||
|
|
||||||
|
* Add IsImmuneToSpell Lua Mod ([#4278](https://github.com/EQEmu/Server/pull/4278)) @xackery 2024-04-28
|
||||||
|
* Add UpdatePersonalFaction Lua Mod ([#4279](https://github.com/EQEmu/Server/pull/4279)) @xackery 2024-05-04
|
||||||
|
|
||||||
|
### Messages
|
||||||
|
|
||||||
|
* Add GM Status and Invulnerability Messages ([#4266](https://github.com/EQEmu/Server/pull/4266)) @Kinglykrab 2024-05-04
|
||||||
|
* Fix bug where DoT messages stop coming out when mob dies. ([#4249](https://github.com/EQEmu/Server/pull/4249)) @noudess 2024-04-15
|
||||||
|
* Fix multiple errors in spell damage at death. ([#4264](https://github.com/EQEmu/Server/pull/4264)) @noudess 2024-04-28
|
||||||
|
|
||||||
|
### Performance
|
||||||
|
|
||||||
|
* Change skill_cap from vector to map ([#4252](https://github.com/EQEmu/Server/pull/4252)) @xackery 2024-04-15
|
||||||
|
|
||||||
|
### Pets
|
||||||
|
|
||||||
|
* Fix errors in sync with client of sit/stand ([#4245](https://github.com/EQEmu/Server/pull/4245)) @noudess 2024-04-15
|
||||||
|
|
||||||
|
### Quest API
|
||||||
|
|
||||||
|
* Add DescribeSpecialAbilities() to Perl/Lua ([#4269](https://github.com/EQEmu/Server/pull/4269)) @Kinglykrab 2024-04-21
|
||||||
|
* Add GetConsiderColor() to Perl/Lua ([#4253](https://github.com/EQEmu/Server/pull/4253)) @Kinglykrab 2024-04-15
|
||||||
|
* Add Parcel Sending to Perl/Lua ([#4287](https://github.com/EQEmu/Server/pull/4287)) @Kinglykrab 2024-05-04
|
||||||
|
* Add Zone Methods to Perl/Lua ([#4268](https://github.com/EQEmu/Server/pull/4268)) @Kinglykrab 2024-04-21
|
||||||
|
|
||||||
|
### Quests
|
||||||
|
|
||||||
|
* Hot Reload Changes ([#4302](https://github.com/EQEmu/Server/pull/4302)) @Akkadius 2024-05-09
|
||||||
|
* Reload Quests on Bootup, Init earlier ([#4298](https://github.com/EQEmu/Server/pull/4298)) @Akkadius 2024-05-05
|
||||||
|
|
||||||
|
### Spells
|
||||||
|
|
||||||
|
* Implemented SPA 122 SE_ReduceSkill ([#4234](https://github.com/EQEmu/Server/pull/4234)) @KayenEQ 2024-05-04
|
||||||
|
* Normal Group Spells (non-raid) landed twice on caster ([#4240](https://github.com/EQEmu/Server/pull/4240)) @noudess 2024-04-15
|
||||||
|
* SPA69 TotalHP can be used in Worn Slot, Fixes/Updates to Max HP related variables. ([#4244](https://github.com/EQEmu/Server/pull/4244)) @KayenEQ 2024-04-15
|
||||||
|
|
||||||
|
### Zone Instances
|
||||||
|
|
||||||
|
* Handle routing to instances when using evac/succor ([#4297](https://github.com/EQEmu/Server/pull/4297)) @joligario 2024-05-04
|
||||||
|
|
||||||
|
## [22.49.1] 4/15/2024
|
||||||
|
|
||||||
|
### Zoning
|
||||||
|
|
||||||
|
* Fix zone routing edge case ([#4255](https://github.com/EQEmu/Server/pull/4255)) @Akkadius 2024-04-15
|
||||||
|
|
||||||
|
## [22.49.0] 4/15/2024
|
||||||
|
|
||||||
|
### Code
|
||||||
|
|
||||||
|
* Avoid unnecessary copies in database functions ([#4220](https://github.com/EQEmu/Server/pull/4220)) @joligario 2024-03-29
|
||||||
|
* Reference type in `GetRaidLeaderName` ([#4218](https://github.com/EQEmu/Server/pull/4218)) @joligario 2024-03-28
|
||||||
|
* Remove unnecessary reference types ([#4212](https://github.com/EQEmu/Server/pull/4212)) @joligario 2024-03-28
|
||||||
|
|
||||||
|
### Crash
|
||||||
|
|
||||||
|
* Check mob pointer before trying to remove it ([#4230](https://github.com/EQEmu/Server/pull/4230)) @Akkadius 2024-04-01
|
||||||
|
|
||||||
|
### Feature
|
||||||
|
|
||||||
|
* Add Character Auto Login ([#4216](https://github.com/EQEmu/Server/pull/4216)) @Kinglykrab 2024-04-15
|
||||||
|
* Add LuaMod functions for CommonDamage and HealDamage ([#4227](https://github.com/EQEmu/Server/pull/4227)) @xackery 2024-03-31
|
||||||
|
* Add RegisterBug LuaMod ([#4209](https://github.com/EQEmu/Server/pull/4209)) @xackery 2024-03-30
|
||||||
|
* Additive Spell Focus from Worn slot with Limit Checks ([#4208](https://github.com/EQEmu/Server/pull/4208)) @KayenEQ 2024-03-30
|
||||||
|
* Fix ignore_default on lua mod damage ([#4228](https://github.com/EQEmu/Server/pull/4228)) @xackery 2024-04-15
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Client not updating HP bar when an HP Buff with a Heal is applied. ([#4237](https://github.com/EQEmu/Server/pull/4237)) @KayenEQ 2024-04-02
|
||||||
|
* Fix Account Flags Loading ([#4243](https://github.com/EQEmu/Server/pull/4243)) @Kinglykrab 2024-04-15
|
||||||
|
* Fix Auto Login Issue ([#4213](https://github.com/EQEmu/Server/pull/4213)) @Kinglykrab 2024-03-28
|
||||||
|
* Fix Bot Creation Issue ([#4235](https://github.com/EQEmu/Server/pull/4235)) @Kinglykrab 2024-04-02
|
||||||
|
* Fix Bot/Character ID Overlap in Groups ([#4093](https://github.com/EQEmu/Server/pull/4093)) @Kinglykrab 2024-03-23
|
||||||
|
* Fix Group Leadership ([#4214](https://github.com/EQEmu/Server/pull/4214)) @Kinglykrab 2024-03-28
|
||||||
|
* Fix Issue With Bot Raid Aggro ([#4222](https://github.com/EQEmu/Server/pull/4222)) @Kinglykrab 2024-03-31
|
||||||
|
* Fix Lua Crash with Spell Blocked Event ([#4236](https://github.com/EQEmu/Server/pull/4236)) @Kinglykrab 2024-04-01
|
||||||
|
* Fix Luabind Double Class Register ([#4219](https://github.com/EQEmu/Server/pull/4219)) @Kinglykrab 2024-03-29
|
||||||
|
* Fix crash in SendEnterWorld ([#4204](https://github.com/EQEmu/Server/pull/4204)) @Akkadius 2024-03-24
|
||||||
|
* Fix event_consider any_cast error ([#4210](https://github.com/EQEmu/Server/pull/4210)) @xackery 2024-03-27
|
||||||
|
* Fix fishing chances ([#4203](https://github.com/EQEmu/Server/pull/4203)) @joligario 2024-03-24
|
||||||
|
* Fix manifest for skill caps schema type ([#4231](https://github.com/EQEmu/Server/pull/4231)) @Akkadius 2024-04-02
|
||||||
|
* Hero forge armor bug on login and show helm toggle. ([#4246](https://github.com/EQEmu/Server/pull/4246)) @noudess 2024-04-15
|
||||||
|
* Radiant/Ebon Crystals should only extract to 1000 ([#4195](https://github.com/EQEmu/Server/pull/4195)) @fryguy503 2024-03-23
|
||||||
|
* SPA214 SE_MaxHPChange calculation errors corrected. ([#4238](https://github.com/EQEmu/Server/pull/4238)) @KayenEQ 2024-04-02
|
||||||
|
* Shared Tasks - charid is now character_id ([#4233](https://github.com/EQEmu/Server/pull/4233)) @fryguy503 2024-04-01
|
||||||
|
* Using %T in channel messages on fresh corpse yields mob, not corpse name. ([#4168](https://github.com/EQEmu/Server/pull/4168)) @noudess 2024-04-05
|
||||||
|
|
||||||
|
### Hot Fix
|
||||||
|
|
||||||
|
* Fix Group::AddToGroup ([#4201](https://github.com/EQEmu/Server/pull/4201)) @Kinglykrab 2024-03-23
|
||||||
|
* Hot Fix for Group::AddToGroup Hot Fix ([#4202](https://github.com/EQEmu/Server/pull/4202)) @Kinglykrab 2024-03-23
|
||||||
|
|
||||||
|
### Loot
|
||||||
|
|
||||||
|
* Add content filtering to lootdrop_entries ([#4229](https://github.com/EQEmu/Server/pull/4229)) @Akkadius 2024-04-15
|
||||||
|
|
||||||
|
### Lua
|
||||||
|
|
||||||
|
* Add Zone and Language Constants ([#4211](https://github.com/EQEmu/Server/pull/4211)) @fryguy503 2024-03-28
|
||||||
|
|
||||||
|
### Messages
|
||||||
|
|
||||||
|
* Fix bug where DoT messages stop coming out when mob dies. ([#4249](https://github.com/EQEmu/Server/pull/4249)) @noudess 2024-04-15
|
||||||
|
|
||||||
|
### Performance
|
||||||
|
|
||||||
|
* Change skill_cap from vector to map ([#4252](https://github.com/EQEmu/Server/pull/4252)) @xackery 2024-04-15
|
||||||
|
|
||||||
|
### Pets
|
||||||
|
|
||||||
|
* Fix errors in sync with client of sit/stand ([#4245](https://github.com/EQEmu/Server/pull/4245)) @noudess 2024-04-15
|
||||||
|
|
||||||
|
### Quest API
|
||||||
|
|
||||||
|
* Add Archetype Methods to Perl/Lua ([#4181](https://github.com/EQEmu/Server/pull/4181)) @Kinglykrab 2024-03-23
|
||||||
|
* Add Class/Deity/Race Methods to Perl/Lua ([#4215](https://github.com/EQEmu/Server/pull/4215)) @Kinglykrab 2024-03-28
|
||||||
|
* Add GetConsiderColor() to Perl/Lua ([#4253](https://github.com/EQEmu/Server/pull/4253)) @Kinglykrab 2024-04-15
|
||||||
|
* Add Spell Blocked Event to Perl/Lua ([#4217](https://github.com/EQEmu/Server/pull/4217)) @Kinglykrab 2024-04-01
|
||||||
|
|
||||||
|
### Quests
|
||||||
|
|
||||||
|
* Avoid Player and Bot quests in unloaded zone ([#4232](https://github.com/EQEmu/Server/pull/4232)) @hgtw 2024-04-01
|
||||||
|
|
||||||
|
### Repositories
|
||||||
|
|
||||||
|
* Convert database.cpp to Repositories ([#4054](https://github.com/EQEmu/Server/pull/4054)) @Kinglykrab 2024-03-24
|
||||||
|
|
||||||
|
### Skill Caps
|
||||||
|
|
||||||
|
* Further improvements ([#4205](https://github.com/EQEmu/Server/pull/4205)) @Akkadius 2024-03-24
|
||||||
|
* Remove from shared memory and simplify ([#4069](https://github.com/EQEmu/Server/pull/4069)) @Kinglykrab 2024-03-23
|
||||||
|
|
||||||
|
### Spells
|
||||||
|
|
||||||
|
* Implemented SPA 463 SE_SHIELD_TARGET ([#4224](https://github.com/EQEmu/Server/pull/4224)) @KayenEQ 2024-03-30
|
||||||
|
* Normal Group Spells (non-raid) landed twice on caster ([#4240](https://github.com/EQEmu/Server/pull/4240)) @noudess 2024-04-15
|
||||||
|
* SPA148 Stacking Fix ([#4206](https://github.com/EQEmu/Server/pull/4206)) @KayenEQ 2024-03-27
|
||||||
|
* SPA69 TotalHP can be used in Worn Slot, Fixes/Updates to Max HP related variables. ([#4244](https://github.com/EQEmu/Server/pull/4244)) @KayenEQ 2024-04-15
|
||||||
|
|
||||||
|
## [22.48.0] 3/23/2024
|
||||||
|
|
||||||
|
### Bots
|
||||||
|
|
||||||
|
* IsValidTarget Crash Fix ([#4187](https://github.com/EQEmu/Server/pull/4187)) @nytmyr 2024-03-12
|
||||||
|
* Move BotGroupSay to Pet Response ([#4171](https://github.com/EQEmu/Server/pull/4171)) @nytmyr 2024-03-08
|
||||||
|
|
||||||
|
### Code
|
||||||
|
|
||||||
|
* Cleanup Zone Get Methods ([#4169](https://github.com/EQEmu/Server/pull/4169)) @Kinglykrab 2024-03-09
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* An Update to Xtarget to exclude Bot owned Temp/Swarm Pets ([#4172](https://github.com/EQEmu/Server/pull/4172)) @MortimerGreenwald 2024-03-08
|
||||||
|
* Fix #serverrules Command ([#4193](https://github.com/EQEmu/Server/pull/4193)) @Kinglykrab 2024-03-20
|
||||||
|
* Fix Bot Cloning ([#4186](https://github.com/EQEmu/Server/pull/4186)) @Kinglykrab 2024-03-17
|
||||||
|
* Fix Crash in ClientList::GetCLEIP ([#4173](https://github.com/EQEmu/Server/pull/4173)) @Kinglykrab 2024-03-10
|
||||||
|
* Fix Default Value in `rule_values` table ([#4166](https://github.com/EQEmu/Server/pull/4166)) @Kinglykrab 2024-03-07
|
||||||
|
* Fix EVENT_KILLED_MERIT firing before NPC removal ([#4185](https://github.com/EQEmu/Server/pull/4185)) @Kinglykrab 2024-03-17
|
||||||
|
* Fix Empty Groups When Removing Bots ([#4178](https://github.com/EQEmu/Server/pull/4178)) @Kinglykrab 2024-03-14
|
||||||
|
* Fix GetLeaderName() for Groups ([#4184](https://github.com/EQEmu/Server/pull/4184)) @Kinglykrab 2024-03-14
|
||||||
|
* Fix Mob::CalculateDistance(mob) Typo ([#4183](https://github.com/EQEmu/Server/pull/4183)) @Kinglykrab 2024-03-10
|
||||||
|
* Fix Proximity Say ([#4189](https://github.com/EQEmu/Server/pull/4189)) @Kinglykrab 2024-03-15
|
||||||
|
* Fix ScaleNPC() in Perl ([#4196](https://github.com/EQEmu/Server/pull/4196)) @Kinglykrab 2024-03-23
|
||||||
|
* Fix range_percent ([#4197](https://github.com/EQEmu/Server/pull/4197)) @Kinglykrab 2024-03-22
|
||||||
|
* Fix reusing timers ([#4199](https://github.com/EQEmu/Server/pull/4199)) @joligario 2024-03-23
|
||||||
|
|
||||||
|
### Hot Fix
|
||||||
|
|
||||||
|
* Add bool return to fix Client::RemoveAAPoints ([#4176](https://github.com/EQEmu/Server/pull/4176)) @Kinglykrab 2024-03-09
|
||||||
|
|
||||||
|
### Loot
|
||||||
|
|
||||||
|
* Fix issue with nested data being loaded multiple times ([#4192](https://github.com/EQEmu/Server/pull/4192)) @Akkadius 2024-03-23
|
||||||
|
|
||||||
|
### Misc
|
||||||
|
|
||||||
|
* Windows preprocessor define in crash.cpp ([#4191](https://github.com/EQEmu/Server/pull/4191)) @joligario 2024-03-23
|
||||||
|
|
||||||
|
### Quest API
|
||||||
|
|
||||||
|
* Add Buff Support to Perl/Lua ([#4182](https://github.com/EQEmu/Server/pull/4182)) @Kinglykrab 2024-03-14
|
||||||
|
* Add DeleteBot() to Perl/Lua ([#4167](https://github.com/EQEmu/Server/pull/4167)) @nytmyr 2024-03-07
|
||||||
|
* Add GetDeityName() to Perl/Lua ([#4180](https://github.com/EQEmu/Server/pull/4180)) @Kinglykrab 2024-03-14
|
||||||
|
* Add RemoveAAPoints() and AA Loss Event to Perl/Lua ([#4174](https://github.com/EQEmu/Server/pull/4174)) @Kinglykrab 2024-03-09
|
||||||
|
* Add RemoveAlternateCurrencyValue() to Perl/Lua ([#4190](https://github.com/EQEmu/Server/pull/4190)) @Kinglykrab 2024-03-17
|
||||||
|
* Add Restore Methods for Health, Mana, and Endurance to Perl/Lua ([#4179](https://github.com/EQEmu/Server/pull/4179)) @Kinglykrab 2024-03-23
|
||||||
|
* Add Silent Saylink Methods to Perl/Lua ([#4177](https://github.com/EQEmu/Server/pull/4177)) @Kinglykrab 2024-03-14
|
||||||
|
|
||||||
|
### Rules
|
||||||
|
|
||||||
|
* Add World:Rules Rule ([#4194](https://github.com/EQEmu/Server/pull/4194)) @Kinglykrab 2024-03-23
|
||||||
|
|
||||||
|
### Tradeskills
|
||||||
|
|
||||||
|
* Implement learning recipes from books ([#4170](https://github.com/EQEmu/Server/pull/4170)) @hgtw 2024-03-23
|
||||||
|
|
||||||
|
## [22.47.0] 3/5/2024
|
||||||
|
|
||||||
|
### Crash Fix
|
||||||
|
|
||||||
|
* Added a guild_mgr check ([#4163](https://github.com/EQEmu/Server/pull/4163)) @neckkola 2024-03-06
|
||||||
|
* Goto Command could crash using Developer Tools ([#4158](https://github.com/EQEmu/Server/pull/4158)) @neckkola 2024-03-04
|
||||||
|
* Groundspawn Memory Corruption ([#4157](https://github.com/EQEmu/Server/pull/4157)) @neckkola 2024-03-04
|
||||||
|
* Update to location of qGlobals initialization ([#4144](https://github.com/EQEmu/Server/pull/4144)) @neckkola 2024-03-02
|
||||||
|
|
||||||
|
### Feature
|
||||||
|
|
||||||
|
* Adds rules to control level requirements for Double Backstab, Assassinate, and Double Bowshot (#4159) ([#29](https://github.com/EQEmu/Server/pull/29)) @catapultam-habeo 2024-03-04
|
||||||
|
* Adjust String-based Rules Length ([#4138](https://github.com/EQEmu/Server/pull/4138)) @Kinglykrab 2024-03-06
|
||||||
|
* Exempt a zone from IP-limit checks. ([#4137](https://github.com/EQEmu/Server/pull/4137)) @catapultam-habeo 2024-03-02
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Add id to the guild_bank table ([#4155](https://github.com/EQEmu/Server/pull/4155)) @neckkola 2024-03-05
|
||||||
|
* Fix Bots/Bot Pets ending up on XTargets ([#4132](https://github.com/EQEmu/Server/pull/4132)) @Kinglykrab 2024-03-02
|
||||||
|
* Fix Character EXP Modifiers default ([#4161](https://github.com/EQEmu/Server/pull/4161)) @Kinglykrab 2024-03-06
|
||||||
|
* Fix Spawns Not Parsing Quest on Zone Bootup ([#4149](https://github.com/EQEmu/Server/pull/4149)) @Kinglykrab 2024-03-05
|
||||||
|
* Fix typo when updating spawn events in spawn condition manager ([#4160](https://github.com/EQEmu/Server/pull/4160)) @joligario 2024-03-05
|
||||||
|
* GetBotNameByID Temporary Reference Warning ([#4145](https://github.com/EQEmu/Server/pull/4145)) @Kinglykrab 2024-03-02
|
||||||
|
* Prevent NPE when creating DZ using ad-hoc version IDs ([#4141](https://github.com/EQEmu/Server/pull/4141)) @catapultam-habeo 2024-03-05
|
||||||
|
* Update FreeGuildID Routine ([#4143](https://github.com/EQEmu/Server/pull/4143)) @neckkola 2024-03-02
|
||||||
|
|
||||||
|
### Quest API
|
||||||
|
|
||||||
|
* Add Bot Special Attacks for Immune Aggro/Damage ([#4108](https://github.com/EQEmu/Server/pull/4108)) @Kinglykrab 2024-03-02
|
||||||
|
* Add GetHeroicStrikethrough() to Perl/Lua ([#4150](https://github.com/EQEmu/Server/pull/4150)) @Kinglykrab 2024-03-03
|
||||||
|
* Add IsAlwaysAggro() to Perl/Lua ([#4152](https://github.com/EQEmu/Server/pull/4152)) @Kinglykrab 2024-03-04
|
||||||
|
* Add IsBoat()/IsControllableBoat() to Perl/Lua ([#4151](https://github.com/EQEmu/Server/pull/4151)) @Kinglykrab 2024-03-03
|
||||||
|
* Add IsDestructibleObject() to Perl/Lua ([#4153](https://github.com/EQEmu/Server/pull/4153)) @Kinglykrab 2024-03-03
|
||||||
|
|
||||||
|
### Zone
|
||||||
|
|
||||||
|
* Zone Routing Improvements ([#4142](https://github.com/EQEmu/Server/pull/4142)) @Akkadius 2024-03-02
|
||||||
|
|
||||||
|
### Zoning
|
||||||
|
|
||||||
|
* Zone routing adjustment ([#4162](https://github.com/EQEmu/Server/pull/4162)) @Akkadius 2024-03-06
|
||||||
|
|
||||||
## [22.46.1] 3/2/2024
|
## [22.46.1] 3/2/2024
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
|
|||||||
@@ -31,6 +31,13 @@ IF (EQEMU_BUILD_STATIC)
|
|||||||
ENDIF ()
|
ENDIF ()
|
||||||
ENDIF (EQEMU_BUILD_STATIC)
|
ENDIF (EQEMU_BUILD_STATIC)
|
||||||
|
|
||||||
|
|
||||||
|
# Requires libgoogle-perftools-dev google-perftools packages for linux (debian)
|
||||||
|
IF(EQEMU_ADD_PROFILER)
|
||||||
|
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--no-as-needed,-lprofiler,--as-needed")
|
||||||
|
ENDIF(EQEMU_ADD_PROFILER)
|
||||||
|
|
||||||
|
|
||||||
IF(MSVC)
|
IF(MSVC)
|
||||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
|
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
|
||||||
ADD_DEFINITIONS(-DNOMINMAX)
|
ADD_DEFINITIONS(-DNOMINMAX)
|
||||||
|
|||||||
@@ -29,11 +29,15 @@
|
|||||||
#include "../../common/content/world_content_service.h"
|
#include "../../common/content/world_content_service.h"
|
||||||
#include "../../common/zone_store.h"
|
#include "../../common/zone_store.h"
|
||||||
#include "../../common/path_manager.h"
|
#include "../../common/path_manager.h"
|
||||||
|
#include "../../common/repositories/skill_caps_repository.h"
|
||||||
|
#include "../../common/file.h"
|
||||||
|
#include "../../common/events/player_event_logs.h"
|
||||||
|
|
||||||
EQEmuLogSys LogSys;
|
EQEmuLogSys LogSys;
|
||||||
WorldContentService content_service;
|
WorldContentService content_service;
|
||||||
ZoneStore zone_store;
|
ZoneStore zone_store;
|
||||||
PathManager path;
|
PathManager path;
|
||||||
|
PlayerEventLogs player_event_logs;
|
||||||
|
|
||||||
void ExportSpells(SharedDatabase *db);
|
void ExportSpells(SharedDatabase *db);
|
||||||
void ExportSkillCaps(SharedDatabase *db);
|
void ExportSkillCaps(SharedDatabase *db);
|
||||||
@@ -166,79 +170,74 @@ void ExportSpells(SharedDatabase *db)
|
|||||||
|
|
||||||
bool SkillUsable(SharedDatabase* db, int skill_id, int class_id)
|
bool SkillUsable(SharedDatabase* db, int skill_id, int class_id)
|
||||||
{
|
{
|
||||||
|
const auto& l = SkillCapsRepository::GetWhere(
|
||||||
bool res = false;
|
*db,
|
||||||
|
fmt::format(
|
||||||
std::string query = StringFormat(
|
"`class_id` = {} AND `skill_id` = {} ORDER BY `cap` DESC LIMIT 1",
|
||||||
"SELECT max(cap) FROM skill_caps WHERE class=%d AND skillID=%d",
|
class_id,
|
||||||
class_id, skill_id
|
skill_id
|
||||||
|
)
|
||||||
);
|
);
|
||||||
auto results = db->QueryDatabase(query);
|
|
||||||
if (!results.Success()) {
|
return !l.empty();
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (results.RowCount() == 0) {
|
uint32 GetSkill(SharedDatabase* db, int skill_id, int class_id, int level)
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto row = results.begin();
|
|
||||||
if (row[0] && Strings::ToInt(row[0]) > 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level)
|
|
||||||
{
|
{
|
||||||
|
const auto& l = SkillCapsRepository::GetWhere(
|
||||||
std::string query = StringFormat(
|
*db,
|
||||||
"SELECT cap FROM skill_caps WHERE class=%d AND skillID=%d AND level=%d",
|
fmt::format(
|
||||||
class_id, skill_id, level
|
"`class_id` = {} AND `skill_id` = {} AND `level` = {}",
|
||||||
|
class_id,
|
||||||
|
skill_id,
|
||||||
|
level
|
||||||
|
)
|
||||||
);
|
);
|
||||||
auto results = db->QueryDatabase(query);
|
|
||||||
if (!results.Success()) {
|
if (l.empty()) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (results.RowCount() == 0) {
|
auto e = l.front();
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto row = results.begin();
|
return e.cap;
|
||||||
return Strings::ToInt(row[0]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExportSkillCaps(SharedDatabase* db)
|
void ExportSkillCaps(SharedDatabase* db)
|
||||||
{
|
{
|
||||||
LogInfo("Exporting Skill Caps");
|
LogInfo("Exporting Skill Caps");
|
||||||
|
|
||||||
std::string file = fmt::format("{}/export/SkillCaps.txt", path.GetServerPath());
|
std::ofstream file(fmt::format("{}/export/SkillCaps.txt", path.GetServerPath()));
|
||||||
FILE *f = fopen(file.c_str(), "w");
|
if (!file || !file.is_open()) {
|
||||||
if (!f) {
|
|
||||||
LogError("Unable to open export/SkillCaps.txt to write, skipping.");
|
LogError("Unable to open export/SkillCaps.txt to write, skipping.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int cl = 1; cl <= 16; ++cl) {
|
const uint8 skill_cap_max_level = (
|
||||||
for (int skill = 0; skill <= 77; ++skill) {
|
RuleI(Character, SkillCapMaxLevel) > 0 ?
|
||||||
if (SkillUsable(db, skill, cl)) {
|
RuleI(Character, SkillCapMaxLevel) :
|
||||||
int previous_cap = 0;
|
RuleI(Character, MaxLevel)
|
||||||
for (int level = 1; level <= 100; ++level) {
|
);
|
||||||
int cap = GetSkill(db, skill, cl, level);
|
|
||||||
|
for (uint8 class_id = Class::Warrior; class_id <= Class::Berserker; class_id++) {
|
||||||
|
for (uint8 skill_id = EQ::skills::Skill1HBlunt; skill_id <= EQ::skills::Skill2HPiercing; skill_id++) {
|
||||||
|
if (SkillUsable(db, skill_id, class_id)) {
|
||||||
|
uint32 previous_cap = 0;
|
||||||
|
for (uint8 level = 1; level <= skill_cap_max_level; level++) {
|
||||||
|
uint32 cap = GetSkill(db, skill_id, class_id, level);
|
||||||
if (cap < previous_cap) {
|
if (cap < previous_cap) {
|
||||||
cap = previous_cap;
|
cap = previous_cap;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(f, "%d^%d^%d^%d^0\n", cl, skill, level, cap);
|
file << fmt::format("{}^{}^{}^{}^0", class_id, skill_id, level, cap) << std::endl;
|
||||||
|
|
||||||
previous_cap = cap;
|
previous_cap = cap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(f);
|
file.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExportBaseData(SharedDatabase *db)
|
void ExportBaseData(SharedDatabase *db)
|
||||||
|
|||||||
@@ -29,11 +29,13 @@
|
|||||||
#include "../../common/path_manager.h"
|
#include "../../common/path_manager.h"
|
||||||
#include "../../common/repositories/base_data_repository.h"
|
#include "../../common/repositories/base_data_repository.h"
|
||||||
#include "../../common/file.h"
|
#include "../../common/file.h"
|
||||||
|
#include "../../common/events/player_event_logs.h"
|
||||||
|
|
||||||
EQEmuLogSys LogSys;
|
EQEmuLogSys LogSys;
|
||||||
WorldContentService content_service;
|
WorldContentService content_service;
|
||||||
ZoneStore zone_store;
|
ZoneStore zone_store;
|
||||||
PathManager path;
|
PathManager path;
|
||||||
|
PlayerEventLogs player_event_logs;
|
||||||
|
|
||||||
void ImportSpells(SharedDatabase *db);
|
void ImportSpells(SharedDatabase *db);
|
||||||
void ImportSkillCaps(SharedDatabase *db);
|
void ImportSkillCaps(SharedDatabase *db);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.12)
|
|||||||
|
|
||||||
SET(common_sources
|
SET(common_sources
|
||||||
base_packet.cpp
|
base_packet.cpp
|
||||||
|
bazaar.cpp
|
||||||
classes.cpp
|
classes.cpp
|
||||||
cli/eqemu_command_handler.cpp
|
cli/eqemu_command_handler.cpp
|
||||||
compression.cpp
|
compression.cpp
|
||||||
@@ -83,6 +84,7 @@ SET(common_sources
|
|||||||
shared_tasks.cpp
|
shared_tasks.cpp
|
||||||
shareddb.cpp
|
shareddb.cpp
|
||||||
skills.cpp
|
skills.cpp
|
||||||
|
skill_caps.cpp
|
||||||
spdat.cpp
|
spdat.cpp
|
||||||
strings.cpp
|
strings.cpp
|
||||||
struct_strategy.cpp
|
struct_strategy.cpp
|
||||||
@@ -176,6 +178,8 @@ SET(repositories
|
|||||||
repositories/base/base_character_leadership_abilities_repository.h
|
repositories/base/base_character_leadership_abilities_repository.h
|
||||||
repositories/base/base_character_material_repository.h
|
repositories/base/base_character_material_repository.h
|
||||||
repositories/base/base_character_memmed_spells_repository.h
|
repositories/base/base_character_memmed_spells_repository.h
|
||||||
|
repositories/base/base_character_parcels_repository.h
|
||||||
|
repositories/base/base_character_parcels_containers_repository.h
|
||||||
repositories/base/base_character_peqzone_flags_repository.h
|
repositories/base/base_character_peqzone_flags_repository.h
|
||||||
repositories/base/base_character_pet_buffs_repository.h
|
repositories/base/base_character_pet_buffs_repository.h
|
||||||
repositories/base/base_character_pet_info_repository.h
|
repositories/base/base_character_pet_info_repository.h
|
||||||
@@ -356,6 +360,8 @@ SET(repositories
|
|||||||
repositories/character_leadership_abilities_repository.h
|
repositories/character_leadership_abilities_repository.h
|
||||||
repositories/character_material_repository.h
|
repositories/character_material_repository.h
|
||||||
repositories/character_memmed_spells_repository.h
|
repositories/character_memmed_spells_repository.h
|
||||||
|
repositories/character_parcels_repository.h
|
||||||
|
repositories/character_parcels_containers_repository.h
|
||||||
repositories/character_peqzone_flags_repository.h
|
repositories/character_peqzone_flags_repository.h
|
||||||
repositories/character_pet_buffs_repository.h
|
repositories/character_pet_buffs_repository.h
|
||||||
repositories/character_pet_info_repository.h
|
repositories/character_pet_info_repository.h
|
||||||
@@ -496,6 +502,7 @@ SET(repositories
|
|||||||
|
|
||||||
SET(common_headers
|
SET(common_headers
|
||||||
additive_lagged_fibonacci_engine.h
|
additive_lagged_fibonacci_engine.h
|
||||||
|
bazaar.h
|
||||||
base_packet.h
|
base_packet.h
|
||||||
bodytypes.h
|
bodytypes.h
|
||||||
classes.h
|
classes.h
|
||||||
@@ -606,6 +613,7 @@ SET(common_headers
|
|||||||
shared_tasks.h
|
shared_tasks.h
|
||||||
shareddb.h
|
shareddb.h
|
||||||
skills.h
|
skills.h
|
||||||
|
skill_caps.h
|
||||||
spdat.h
|
spdat.h
|
||||||
strings.h
|
strings.h
|
||||||
struct_strategy.h
|
struct_strategy.h
|
||||||
|
|||||||
@@ -0,0 +1,359 @@
|
|||||||
|
#include "bazaar.h"
|
||||||
|
|
||||||
|
#include "../../common/item_instance.h"
|
||||||
|
#include "repositories/trader_repository.h"
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
std::vector<BazaarSearchResultsFromDB_Struct>
|
||||||
|
Bazaar::GetSearchResults(
|
||||||
|
SharedDatabase &db,
|
||||||
|
BazaarSearchCriteria_Struct search,
|
||||||
|
uint32 char_zone_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
LogTrading(
|
||||||
|
"Searching for items with search criteria - item_name [{}] min_cost [{}] max_cost [{}] min_level [{}] "
|
||||||
|
"max_level [{}] max_results [{}] prestige [{}] augment [{}] trader_entity_id [{}] trader_id [{}] "
|
||||||
|
"search_scope [{}] char_zone_id [{}]",
|
||||||
|
search.item_name,
|
||||||
|
search.min_cost,
|
||||||
|
search.max_cost,
|
||||||
|
search.min_level,
|
||||||
|
search.max_level,
|
||||||
|
search.max_results,
|
||||||
|
search.prestige,
|
||||||
|
search.augment,
|
||||||
|
search.trader_entity_id,
|
||||||
|
search.trader_id,
|
||||||
|
search.search_scope,
|
||||||
|
char_zone_id
|
||||||
|
);
|
||||||
|
|
||||||
|
std::string search_criteria_trader("TRUE ");
|
||||||
|
|
||||||
|
if (search.search_scope == NonRoFBazaarSearchScope) {
|
||||||
|
search_criteria_trader.append(
|
||||||
|
fmt::format(
|
||||||
|
" AND trader.char_entity_id = {} AND trader.char_zone_id = {}",
|
||||||
|
search.trader_entity_id,
|
||||||
|
Zones::BAZAAR
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else if (search.search_scope == Local_Scope) {
|
||||||
|
search_criteria_trader.append(fmt::format(" AND trader.char_zone_id = {}", char_zone_id));
|
||||||
|
}
|
||||||
|
else if (search.trader_id > 0) {
|
||||||
|
search_criteria_trader.append(fmt::format(" AND trader.char_id = {}", search.trader_id));
|
||||||
|
}
|
||||||
|
if (search.min_cost != 0) {
|
||||||
|
search_criteria_trader.append(fmt::format(" AND trader.item_cost >= {}", search.min_cost));
|
||||||
|
}
|
||||||
|
if (search.max_cost != 0) {
|
||||||
|
search_criteria_trader.append(fmt::format(" AND trader.item_cost <= {}", (uint64) search.max_cost * 1000));
|
||||||
|
}
|
||||||
|
|
||||||
|
// not yet implemented
|
||||||
|
// if (search.prestige != 0) {
|
||||||
|
// 0xffffffff prestige only, 0xfffffffe non-prestige, 0 all
|
||||||
|
// search_criteria.append(fmt::format(" AND items.type = {} ", search.prestige));
|
||||||
|
// }
|
||||||
|
|
||||||
|
std::string query = fmt::format(
|
||||||
|
"SELECT COUNT(item_id), trader.char_id, trader.item_id, trader.item_sn, trader.item_charges, trader.item_cost, "
|
||||||
|
"trader.slot_id, SUM(trader.item_charges), trader.char_zone_id, trader.char_entity_id, character_data.name, "
|
||||||
|
"aug_slot_1, aug_slot_2, aug_slot_3, aug_slot_4, aug_slot_5, aug_slot_6 "
|
||||||
|
"FROM trader, character_data "
|
||||||
|
"WHERE {} AND trader.char_id = character_data.id "
|
||||||
|
"GROUP BY trader.item_sn, trader.item_charges, trader.char_id",
|
||||||
|
search_criteria_trader.c_str()
|
||||||
|
);
|
||||||
|
|
||||||
|
std::vector<BazaarSearchResultsFromDB_Struct> all_entries;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(query);
|
||||||
|
|
||||||
|
if (!results.Success()) {
|
||||||
|
return all_entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct ItemSearchType {
|
||||||
|
EQ::item::ItemType type;
|
||||||
|
bool condition;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct AddititiveSearchCriteria {
|
||||||
|
bool should_check;
|
||||||
|
bool condition;
|
||||||
|
};
|
||||||
|
|
||||||
|
for (auto row: results) {
|
||||||
|
BazaarSearchResultsFromDB_Struct r{};
|
||||||
|
|
||||||
|
r.item_id = Strings::ToInt(row[2]);
|
||||||
|
r.charges = Strings::ToInt(row[4]);
|
||||||
|
|
||||||
|
auto item = db.GetItem(r.item_id);
|
||||||
|
if (!item) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 aug_slot_1 = Strings::ToUnsignedInt(row[11]);
|
||||||
|
uint32 aug_slot_2 = Strings::ToUnsignedInt(row[12]);
|
||||||
|
uint32 aug_slot_3 = Strings::ToUnsignedInt(row[13]);
|
||||||
|
uint32 aug_slot_4 = Strings::ToUnsignedInt(row[14]);
|
||||||
|
uint32 aug_slot_5 = Strings::ToUnsignedInt(row[15]);
|
||||||
|
uint32 aug_slot_6 = Strings::ToUnsignedInt(row[16]);
|
||||||
|
|
||||||
|
std::unique_ptr<EQ::ItemInstance> inst(
|
||||||
|
db.CreateItem(
|
||||||
|
item,
|
||||||
|
r.charges,
|
||||||
|
aug_slot_1,
|
||||||
|
aug_slot_2,
|
||||||
|
aug_slot_3,
|
||||||
|
aug_slot_4,
|
||||||
|
aug_slot_5,
|
||||||
|
aug_slot_6
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!inst->GetItem()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
r.count = Strings::ToInt(row[0]);
|
||||||
|
r.trader_id = Strings::ToInt(row[1]);
|
||||||
|
r.serial_number = Strings::ToInt(row[3]);
|
||||||
|
r.cost = Strings::ToInt(row[5]);
|
||||||
|
r.slot_id = Strings::ToInt(row[6]);
|
||||||
|
r.sum_charges = Strings::ToInt(row[7]);
|
||||||
|
r.stackable = item->Stackable;
|
||||||
|
r.icon_id = item->Icon;
|
||||||
|
r.trader_zone_id = Strings::ToInt(row[8]);
|
||||||
|
r.trader_entity_id = Strings::ToInt(row[9]);
|
||||||
|
r.serial_number_RoF = fmt::format("{:016}\0", Strings::ToInt(row[3]));
|
||||||
|
r.item_name = fmt::format("{:.63}\0", item->Name);
|
||||||
|
r.trader_name = fmt::format("{:.63}\0", std::string(row[10]).c_str());
|
||||||
|
|
||||||
|
LogTradingDetail(
|
||||||
|
"Searching against item [{}] ({}) for trader [{}]",
|
||||||
|
item->Name,
|
||||||
|
item->ID,
|
||||||
|
r.trader_name
|
||||||
|
);
|
||||||
|
|
||||||
|
// item stat searches
|
||||||
|
std::map<uint32, uint32> item_stat_searches = {
|
||||||
|
|
||||||
|
{STAT_AC, inst->GetItemArmorClass(true)},
|
||||||
|
{STAT_AGI, static_cast<uint32>(inst->GetItemAgi(true))},
|
||||||
|
{STAT_CHA, static_cast<uint32>(inst->GetItemCha(true))},
|
||||||
|
{STAT_DEX, static_cast<uint32>(inst->GetItemDex(true))},
|
||||||
|
{STAT_INT, static_cast<uint32>(inst->GetItemInt(true))},
|
||||||
|
{STAT_STA, static_cast<uint32>(inst->GetItemSta(true))},
|
||||||
|
{STAT_STR, static_cast<uint32>(inst->GetItemStr(true))},
|
||||||
|
{STAT_WIS, static_cast<uint32>(inst->GetItemWis(true))},
|
||||||
|
{STAT_COLD, static_cast<uint32>(inst->GetItemCR(true))},
|
||||||
|
{STAT_DISEASE, static_cast<uint32>(inst->GetItemDR(true))},
|
||||||
|
{STAT_FIRE, static_cast<uint32>(inst->GetItemFR(true))},
|
||||||
|
{STAT_MAGIC, static_cast<uint32>(inst->GetItemMR(true))},
|
||||||
|
{STAT_POISON, static_cast<uint32>(inst->GetItemPR(true))},
|
||||||
|
{STAT_HP, static_cast<uint32>(inst->GetItemHP(true))},
|
||||||
|
{STAT_MANA, static_cast<uint32>(inst->GetItemMana(true))},
|
||||||
|
{STAT_ENDURANCE, static_cast<uint32>(inst->GetItemEndur(true))},
|
||||||
|
{STAT_ATTACK, static_cast<uint32>(inst->GetItemAttack(true))},
|
||||||
|
{STAT_HP_REGEN, static_cast<uint32>(inst->GetItemRegen(true))},
|
||||||
|
{STAT_MANA_REGEN, static_cast<uint32>(inst->GetItemManaRegen(true))},
|
||||||
|
{STAT_HASTE, static_cast<uint32>(inst->GetItemHaste(true))},
|
||||||
|
{STAT_DAMAGE_SHIELD, static_cast<uint32>(inst->GetItemDamageShield(true))},
|
||||||
|
{STAT_DS_MITIGATION, static_cast<uint32>(inst->GetItemDSMitigation(true))},
|
||||||
|
{STAT_HEAL_AMOUNT, static_cast<uint32>(inst->GetItemHealAmt(true))},
|
||||||
|
{STAT_SPELL_DAMAGE, static_cast<uint32>(inst->GetItemSpellDamage(true))},
|
||||||
|
{STAT_CLAIRVOYANCE, static_cast<uint32>(inst->GetItemClairvoyance(true))},
|
||||||
|
{STAT_HEROIC_AGILITY, static_cast<uint32>(inst->GetItemHeroicAgi(true))},
|
||||||
|
{STAT_HEROIC_CHARISMA, static_cast<uint32>(inst->GetItemHeroicCha(true))},
|
||||||
|
{STAT_HEROIC_DEXTERITY, static_cast<uint32>(inst->GetItemHeroicDex(true))},
|
||||||
|
{STAT_HEROIC_INTELLIGENCE, static_cast<uint32>(inst->GetItemHeroicInt(true))},
|
||||||
|
{STAT_HEROIC_STAMINA, static_cast<uint32>(inst->GetItemHeroicSta(true))},
|
||||||
|
{STAT_HEROIC_STRENGTH, static_cast<uint32>(inst->GetItemHeroicStr(true))},
|
||||||
|
{STAT_HEROIC_WISDOM, static_cast<uint32>(inst->GetItemHeroicWis(true))},
|
||||||
|
{STAT_BASH, static_cast<uint32>(inst->GetItemSkillsStat(EQ::skills::SkillBash, true))},
|
||||||
|
{STAT_BACKSTAB, static_cast<uint32>(inst->GetItemBackstabDamage(true))},
|
||||||
|
{STAT_DRAGON_PUNCH, static_cast<uint32>(inst->GetItemSkillsStat(EQ::skills::SkillDragonPunch, true))},
|
||||||
|
{STAT_EAGLE_STRIKE, static_cast<uint32>(inst->GetItemSkillsStat(EQ::skills::SkillEagleStrike, true))},
|
||||||
|
{STAT_FLYING_KICK, static_cast<uint32>(inst->GetItemSkillsStat(EQ::skills::SkillFlyingKick, true))},
|
||||||
|
{STAT_KICK, static_cast<uint32>(inst->GetItemSkillsStat(EQ::skills::SkillKick, true))},
|
||||||
|
{STAT_ROUND_KICK, static_cast<uint32>(inst->GetItemSkillsStat(EQ::skills::SkillRoundKick, true))},
|
||||||
|
{STAT_TIGER_CLAW, static_cast<uint32>(inst->GetItemSkillsStat(EQ::skills::SkillTigerClaw, true))},
|
||||||
|
{STAT_FRENZY, static_cast<uint32>(inst->GetItemSkillsStat(EQ::skills::SkillFrenzy, true))},
|
||||||
|
};
|
||||||
|
|
||||||
|
r.item_stat = item_stat_searches.contains(search.item_stat) ? item_stat_searches[search.item_stat] : 0;
|
||||||
|
if (item_stat_searches.contains(search.item_stat) && item_stat_searches[search.item_stat] <= 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::map<uint8, uint32> item_slot_searches = {
|
||||||
|
{EQ::invslot::slotCharm, 1},
|
||||||
|
{EQ::invslot::slotEar1, 2},
|
||||||
|
{EQ::invslot::slotHead, 4},
|
||||||
|
{EQ::invslot::slotFace, 8},
|
||||||
|
{EQ::invslot::slotEar2, 16},
|
||||||
|
{EQ::invslot::slotNeck, 32},
|
||||||
|
{EQ::invslot::slotShoulders, 64},
|
||||||
|
{EQ::invslot::slotArms, 128},
|
||||||
|
{EQ::invslot::slotBack, 256},
|
||||||
|
{EQ::invslot::slotWrist1, 512},
|
||||||
|
{EQ::invslot::slotWrist2, 1024},
|
||||||
|
{EQ::invslot::slotRange, 2048},
|
||||||
|
{EQ::invslot::slotHands, 4096},
|
||||||
|
{EQ::invslot::slotPrimary, 8192},
|
||||||
|
{EQ::invslot::slotSecondary, 16384},
|
||||||
|
{EQ::invslot::slotFinger1, 32768},
|
||||||
|
{EQ::invslot::slotFinger2, 65536},
|
||||||
|
{EQ::invslot::slotChest, 131072},
|
||||||
|
{EQ::invslot::slotLegs, 262144},
|
||||||
|
{EQ::invslot::slotFeet, 524288},
|
||||||
|
{EQ::invslot::slotWaist, 1048576},
|
||||||
|
{EQ::invslot::slotPowerSource, 2097152},
|
||||||
|
{EQ::invslot::slotAmmo, 4194304},
|
||||||
|
};
|
||||||
|
|
||||||
|
auto GetEquipmentSlotBit = [&](uint32 slot) -> uint32 {
|
||||||
|
return item_slot_searches.contains(slot) ? item_slot_searches[slot] : 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
auto FindItemAugSlot = [&]() -> bool {
|
||||||
|
for (auto const &s: inst->GetItem()->AugSlotType) {
|
||||||
|
return s == search.augment;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
// item type searches
|
||||||
|
std::vector<ItemSearchType> item_search_types = {
|
||||||
|
{EQ::item::ItemType::ItemTypeAll, true},
|
||||||
|
{EQ::item::ItemType::ItemTypeBook, item->ItemClass == EQ::item::ItemType::ItemTypeBook},
|
||||||
|
{EQ::item::ItemType::ItemTypeContainer, item->ItemClass == EQ::item::ItemType::ItemTypeContainer},
|
||||||
|
{EQ::item::ItemType::ItemTypeAllEffects, item->Scroll.Effect > 0 && item->Scroll.Effect < 65000},
|
||||||
|
{EQ::item::ItemType::ItemTypeUnknown9, item->Worn.Effect == 998},
|
||||||
|
{EQ::item::ItemType::ItemTypeUnknown10, item->Worn.Effect >= 1298 && item->Worn.Effect <= 1307},
|
||||||
|
{EQ::item::ItemType::ItemTypeFocusEffect, item->Focus.Effect > 0},
|
||||||
|
{EQ::item::ItemType::ItemTypeArmor, item->ItemType == EQ::item::ItemType::ItemTypeArmor},
|
||||||
|
{EQ::item::ItemType::ItemType1HBlunt, item->ItemType == EQ::item::ItemType::ItemType1HBlunt},
|
||||||
|
{EQ::item::ItemType::ItemType1HPiercing, item->ItemType == EQ::item::ItemType::ItemType1HPiercing},
|
||||||
|
{EQ::item::ItemType::ItemType1HSlash, item->ItemType == EQ::item::ItemType::ItemType1HSlash},
|
||||||
|
{EQ::item::ItemType::ItemType2HBlunt, item->ItemType == EQ::item::ItemType::ItemType2HBlunt},
|
||||||
|
{EQ::item::ItemType::ItemType2HSlash, item->ItemType == EQ::item::ItemType::ItemType2HSlash},
|
||||||
|
{EQ::item::ItemType::ItemTypeBow, item->ItemType == EQ::item::ItemType::ItemTypeBow},
|
||||||
|
{EQ::item::ItemType::ItemTypeShield, item->ItemType == EQ::item::ItemType::ItemTypeShield},
|
||||||
|
{EQ::item::ItemType::ItemTypeMisc, item->ItemType == EQ::item::ItemType::ItemTypeMisc},
|
||||||
|
{EQ::item::ItemType::ItemTypeFood, item->ItemType == EQ::item::ItemType::ItemTypeFood},
|
||||||
|
{EQ::item::ItemType::ItemTypeDrink, item->ItemType == EQ::item::ItemType::ItemTypeDrink},
|
||||||
|
{EQ::item::ItemType::ItemTypeLight, item->ItemType == EQ::item::ItemType::ItemTypeLight},
|
||||||
|
{EQ::item::ItemType::ItemTypeCombinable, item->ItemType == EQ::item::ItemType::ItemTypeCombinable},
|
||||||
|
{EQ::item::ItemType::ItemTypeBandage, item->ItemType == EQ::item::ItemType::ItemTypeBandage},
|
||||||
|
{EQ::item::ItemType::ItemTypeSmallThrowing, item->ItemType == EQ::item::ItemType::ItemTypeSmallThrowing ||
|
||||||
|
item->ItemType == EQ::item::ItemType::ItemTypeLargeThrowing},
|
||||||
|
{EQ::item::ItemType::ItemTypeSpell, item->ItemType == EQ::item::ItemType::ItemTypeSpell},
|
||||||
|
{EQ::item::ItemType::ItemTypePotion, item->ItemType == EQ::item::ItemType::ItemTypePotion},
|
||||||
|
{EQ::item::ItemType::ItemTypeBrassInstrument, item->ItemType == EQ::item::ItemType::ItemTypeBrassInstrument},
|
||||||
|
{EQ::item::ItemType::ItemTypeWindInstrument, item->ItemType == EQ::item::ItemType::ItemTypeWindInstrument},
|
||||||
|
{EQ::item::ItemType::ItemTypeStringedInstrument, item->ItemType == EQ::item::ItemType::ItemTypeStringedInstrument},
|
||||||
|
{EQ::item::ItemType::ItemTypePercussionInstrument, item->ItemType == EQ::item::ItemType::ItemTypePercussionInstrument},
|
||||||
|
{EQ::item::ItemType::ItemTypeArrow, item->ItemType == EQ::item::ItemType::ItemTypeArrow},
|
||||||
|
{EQ::item::ItemType::ItemTypeJewelry, item->ItemType == EQ::item::ItemType::ItemTypeJewelry},
|
||||||
|
{EQ::item::ItemType::ItemTypeNote, item->ItemType == EQ::item::ItemType::ItemTypeNote},
|
||||||
|
{EQ::item::ItemType::ItemTypeKey, item->ItemType == EQ::item::ItemType::ItemTypeKey},
|
||||||
|
{EQ::item::ItemType::ItemType2HPiercing, item->ItemType == EQ::item::ItemType::ItemType2HPiercing},
|
||||||
|
{EQ::item::ItemType::ItemTypeAlcohol, item->ItemType == EQ::item::ItemType::ItemTypeAlcohol},
|
||||||
|
{EQ::item::ItemType::ItemTypeMartial, item->ItemType == EQ::item::ItemType::ItemTypeMartial},
|
||||||
|
{EQ::item::ItemType::ItemTypeAugmentation, item->ItemType == EQ::item::ItemType::ItemTypeAugmentation},
|
||||||
|
{EQ::item::ItemType::ItemTypeAlternateAbility, item->ItemType == EQ::item::ItemType::ItemTypeAlternateAbility},
|
||||||
|
{EQ::item::ItemType::ItemTypeCount, item->ItemType == EQ::item::ItemType::ItemTypeCount},
|
||||||
|
{EQ::item::ItemType::ItemTypeCollectible, item->ItemType == EQ::item::ItemType::ItemTypeCollectible}
|
||||||
|
};
|
||||||
|
|
||||||
|
bool met_filter = false;
|
||||||
|
bool has_filter = false;
|
||||||
|
|
||||||
|
for (auto &i: item_search_types) {
|
||||||
|
if (i.type == search.type) {
|
||||||
|
has_filter = true;
|
||||||
|
if (i.condition) {
|
||||||
|
LogTradingDetail("Item [{}] met search criteria for type [{}]", item->Name, uint8(i.type));
|
||||||
|
met_filter = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (has_filter && !met_filter) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: Add catch-all item type filter for specific item types
|
||||||
|
|
||||||
|
// item additive searches
|
||||||
|
std::vector<AddititiveSearchCriteria> item_additive_searches = {
|
||||||
|
{
|
||||||
|
.should_check = search.min_level != 1 && inst->GetItemRequiredLevel(true) > 0,
|
||||||
|
.condition = inst->GetItemRequiredLevel(true) >= search.min_level
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.should_check = search.max_level != 1 && inst->GetItemRequiredLevel(true) > 0,
|
||||||
|
.condition = inst->GetItemRequiredLevel(true) <= search.max_level
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.should_check = !std::string(search.item_name).empty(),
|
||||||
|
.condition = Strings::ContainsLower(item->Name, search.item_name)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.should_check = search._class != 0xFFFFFFFF,
|
||||||
|
.condition = static_cast<bool>(item->Classes & GetPlayerClassBit(search._class))
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.should_check = search.race != 0xFFFFFFFF,
|
||||||
|
.condition = static_cast<bool>(item->Races & GetPlayerRaceBit(search.race))
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.should_check = search.augment != 0,
|
||||||
|
.condition = FindItemAugSlot()
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.should_check = search.slot != 0xFFFFFFFF,
|
||||||
|
.condition = static_cast<bool>(item->Slots & GetEquipmentSlotBit(search.slot))
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
bool should_add = true;
|
||||||
|
|
||||||
|
for (auto &i: item_additive_searches) {
|
||||||
|
LogTradingDetail(
|
||||||
|
"Checking item [{}] for search criteria - should_check [{}] condition [{}]",
|
||||||
|
item->Name,
|
||||||
|
i.should_check,
|
||||||
|
i.condition
|
||||||
|
);
|
||||||
|
if (i.should_check && !i.condition) {
|
||||||
|
should_add = false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!should_add) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
LogTradingDetail("Found item [{}] meeting search criteria.", r.item_name);
|
||||||
|
all_entries.push_back(r);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (all_entries.size() > search.max_results) {
|
||||||
|
all_entries.resize(search.max_results);
|
||||||
|
}
|
||||||
|
|
||||||
|
LogTrading("Returning [{}] items from search results", all_entries.size());
|
||||||
|
|
||||||
|
return all_entries;
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#ifndef EQEMU_BAZAAR_H
|
||||||
|
#define EQEMU_BAZAAR_H
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
#include "shareddb.h"
|
||||||
|
|
||||||
|
class Bazaar {
|
||||||
|
public:
|
||||||
|
static std::vector<BazaarSearchResultsFromDB_Struct>
|
||||||
|
GetSearchResults(SharedDatabase &db, BazaarSearchCriteria_Struct search, unsigned int char_zone_id);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif //EQEMU_BAZAAR_H
|
||||||
@@ -287,9 +287,14 @@ WorldContentService * WorldContentService::LoadZones()
|
|||||||
// era contextual routing, multiple version of zones, etc
|
// era contextual routing, multiple version of zones, etc
|
||||||
WorldContentService::FindZoneResult WorldContentService::FindZone(uint32 zone_id, uint32 instance_id)
|
WorldContentService::FindZoneResult WorldContentService::FindZone(uint32 zone_id, uint32 instance_id)
|
||||||
{
|
{
|
||||||
// if we're already in a regular instance, we don't want to route the player to another instance
|
// if there's an active dynamic instance, we don't need to route
|
||||||
if (instance_id > RuleI(Instances, ReservedInstances)) {
|
if (instance_id > 0) {
|
||||||
return WorldContentService::FindZoneResult{};
|
auto inst = InstanceListRepository::FindOne(*GetDatabase(), instance_id);
|
||||||
|
if (inst.id != 0 && !inst.is_global && !inst.never_expires) {
|
||||||
|
return WorldContentService::FindZoneResult{
|
||||||
|
.zone_id = 0,
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto &z: m_zones) {
|
for (auto &z: m_zones) {
|
||||||
@@ -349,6 +354,16 @@ WorldContentService::FindZoneResult WorldContentService::FindZone(uint32 zone_id
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return WorldContentService::FindZoneResult{};
|
return WorldContentService::FindZoneResult{.zone_id = 0};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool WorldContentService::IsInPublicStaticInstance(uint32 instance_id)
|
||||||
|
{
|
||||||
|
for (auto &i: m_zone_instances) {
|
||||||
|
if (i.id == instance_id) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|||||||
@@ -178,6 +178,8 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
FindZoneResult FindZone(uint32 zone_id, uint32 instance_id);
|
FindZoneResult FindZone(uint32 zone_id, uint32 instance_id);
|
||||||
|
bool IsInPublicStaticInstance(uint32 instance_id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int current_expansion{};
|
int current_expansion{};
|
||||||
std::vector<ContentFlagsRepository::ContentFlags> content_flags;
|
std::vector<ContentFlagsRepository::ContentFlags> content_flags;
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@
|
|||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#if WINDOWS
|
#ifdef _WINDOWS
|
||||||
#define popen _popen
|
#define popen _popen
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+1105
-1303
File diff suppressed because it is too large
Load Diff
+127
-117
@@ -38,8 +38,7 @@
|
|||||||
class MySQLRequestResult;
|
class MySQLRequestResult;
|
||||||
class Client;
|
class Client;
|
||||||
|
|
||||||
namespace EQ
|
namespace EQ {
|
||||||
{
|
|
||||||
class InventoryProfile;
|
class InventoryProfile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,7 +54,8 @@ struct VarCache_Struct {
|
|||||||
uint32 last_update;
|
uint32 last_update;
|
||||||
VarCache_Struct() : last_update(0) { }
|
VarCache_Struct() : last_update(0) { }
|
||||||
void Add(const std::string& key, const std::string& value) { m_cache[key] = value; }
|
void Add(const std::string& key, const std::string& value) { m_cache[key] = value; }
|
||||||
const std::string *Get(const std::string &key) {
|
const std::string* Get(const std::string& key)
|
||||||
|
{
|
||||||
auto it = m_cache.find(key);
|
auto it = m_cache.find(key);
|
||||||
return (it != m_cache.end() ? &it->second : nullptr);
|
return (it != m_cache.end() ? &it->second : nullptr);
|
||||||
}
|
}
|
||||||
@@ -76,37 +76,33 @@ class PTimerList;
|
|||||||
|
|
||||||
#define SQL(...) #__VA_ARGS__
|
#define SQL(...) #__VA_ARGS__
|
||||||
|
|
||||||
class LogSettings;
|
|
||||||
class Database : public DBcore {
|
class Database : public DBcore {
|
||||||
public:
|
public:
|
||||||
Database();
|
Database();
|
||||||
Database(const char* host, const char* user, const char* passwd, const char* database,uint32 port);
|
Database(
|
||||||
bool Connect(const char* host, const char* user, const char* passwd, const char* database, uint32 port, std::string connection_label = "default");
|
const std::string& host,
|
||||||
|
const std::string& user,
|
||||||
|
const std::string& password,
|
||||||
|
const std::string& database,
|
||||||
|
uint32 port
|
||||||
|
);
|
||||||
|
bool Connect(
|
||||||
|
const std::string& host,
|
||||||
|
const std::string& user,
|
||||||
|
const std::string& password,
|
||||||
|
const std::string& database,
|
||||||
|
uint32 port,
|
||||||
|
std::string connection_label = "default"
|
||||||
|
);
|
||||||
~Database();
|
~Database();
|
||||||
|
|
||||||
/* Character Creation */
|
/* Character Creation */
|
||||||
|
bool DeleteCharacter(const std::string& name);
|
||||||
bool CreateCharacter(
|
bool MoveCharacterToZone(const std::string& name, uint32 zone_id);
|
||||||
uint32 account_id,
|
|
||||||
char *name,
|
|
||||||
uint16 gender,
|
|
||||||
uint16 race,
|
|
||||||
uint16 class_,
|
|
||||||
uint8 str,
|
|
||||||
uint8 sta,
|
|
||||||
uint8 cha,
|
|
||||||
uint8 dex,
|
|
||||||
uint8 int_,
|
|
||||||
uint8 agi,
|
|
||||||
uint8 wis,
|
|
||||||
uint8 face
|
|
||||||
);
|
|
||||||
bool DeleteCharacter(char *character_name);
|
|
||||||
bool MoveCharacterToZone(const char *charname, uint32 zone_id);
|
|
||||||
bool MoveCharacterToZone(uint32 character_id, uint32 zone_id);
|
bool MoveCharacterToZone(uint32 character_id, uint32 zone_id);
|
||||||
bool ReserveName(uint32 account_id, char *name);
|
bool ReserveName(uint32 account_id, const std::string& name);
|
||||||
bool SaveCharacterCreate(uint32 character_id, uint32 account_id, PlayerProfile_Struct* pp);
|
bool SaveCharacterCreate(uint32 character_id, uint32 account_id, PlayerProfile_Struct* pp);
|
||||||
bool UpdateName(const char *oldname, const char *newname);
|
bool UpdateName(const std::string& old_name, const std::string& new_name);
|
||||||
bool CopyCharacter(
|
bool CopyCharacter(
|
||||||
const std::string& source_character_name,
|
const std::string& source_character_name,
|
||||||
const std::string& destination_character_name,
|
const std::string& destination_character_name,
|
||||||
@@ -114,32 +110,29 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
/* General Information Queries */
|
/* General Information Queries */
|
||||||
|
bool AddBannedIP(const std::string& banned_ip, const std::string& notes); //Add IP address to the banned_ips table.
|
||||||
|
bool AddToNameFilter(const std::string& name);
|
||||||
|
bool CheckBannedIPs(const std::string& login_ip); //Check incoming connection against banned IP table.
|
||||||
|
bool CheckGMIPs(const std::string& login_ip, uint32 account_id);
|
||||||
|
bool CheckNameFilter(const std::string& name, bool surname = false);
|
||||||
|
bool IsNameUsed(const std::string& name);
|
||||||
|
|
||||||
bool AddBannedIP(std::string banned_ip, std::string notes); //Add IP address to the banned_ips table.
|
uint32 GetAccountIDByChar(const std::string& name, uint32* character_id = 0);
|
||||||
bool AddToNameFilter(std::string name);
|
uint32 GetAccountIDByChar(uint32 character_id);
|
||||||
bool CheckBannedIPs(std::string login_ip); //Check incoming connection against banned IP table.
|
uint32 GetAccountIDByName(const std::string& account_name, const std::string& loginserver, int16* status = 0, uint32* lsid = 0);
|
||||||
bool CheckGMIPs(std::string login_ip, uint32 account_id);
|
|
||||||
bool CheckNameFilter(std::string name, bool surname = false);
|
|
||||||
bool CheckUsedName(std::string name);
|
|
||||||
|
|
||||||
uint32 GetAccountIDByChar(const char* charname, uint32* oCharID = 0);
|
|
||||||
uint32 GetAccountIDByChar(uint32 char_id);
|
|
||||||
uint32 GetAccountIDByName(std::string account_name, std::string loginserver, int16* status = 0, uint32* lsid = 0);
|
|
||||||
uint32 GetCharacterID(const std::string& name);
|
uint32 GetCharacterID(const std::string& name);
|
||||||
uint32 GetCharacterInfo(std::string character_name, uint32 *account_id, uint32 *zone_id, uint32 *instance_id);
|
uint32 GetGuildIDByCharID(uint32 character_id);
|
||||||
uint32 GetGuildIDByCharID(uint32 char_id);
|
uint32 GetGroupIDByCharID(uint32 character_id);
|
||||||
uint32 GetGroupIDByCharID(uint32 char_id);
|
uint32 GetRaidIDByCharID(uint32 character_id);
|
||||||
uint32 GetRaidIDByCharID(uint32 char_id);
|
|
||||||
|
|
||||||
void GetAccountName(uint32 accountid, char* name, uint32* oLSAccountID = 0);
|
const std::string GetAccountName(uint32 account_id, uint32* lsaccount_id = 0);
|
||||||
void GetCharName(uint32 char_id, char* name);
|
const std::string GetCharName(uint32 character_id);
|
||||||
std::string GetCharNameByID(uint32 char_id);
|
const std::string GetCharNameByID(uint32 character_id);
|
||||||
std::string GetNPCNameByID(uint32 npc_id);
|
const std::string GetNPCNameByID(uint32 npc_id);
|
||||||
std::string GetCleanNPCNameByID(uint32 npc_id);
|
const std::string GetCleanNPCNameByID(uint32 npc_id);
|
||||||
void LoginIP(uint32 account_id, std::string login_ip);
|
void LoginIP(uint32 account_id, const std::string& login_ip);
|
||||||
|
|
||||||
/* Instancing */
|
/* Instancing */
|
||||||
|
|
||||||
bool AddClientToInstance(uint16 instance_id, uint32 character_id);
|
bool AddClientToInstance(uint16 instance_id, uint32 character_id);
|
||||||
bool CheckInstanceByCharID(uint16 instance_id, uint32 character_id);
|
bool CheckInstanceByCharID(uint16 instance_id, uint32 character_id);
|
||||||
bool CheckInstanceExists(uint16 instance_id);
|
bool CheckInstanceExists(uint16 instance_id);
|
||||||
@@ -152,117 +145,134 @@ public:
|
|||||||
bool VerifyInstanceAlive(uint16 instance_id, uint32 character_id);
|
bool VerifyInstanceAlive(uint16 instance_id, uint32 character_id);
|
||||||
bool VerifyZoneInstance(uint32 zone_id, uint16 instance_id);
|
bool VerifyZoneInstance(uint32 zone_id, uint16 instance_id);
|
||||||
|
|
||||||
uint16 GetInstanceID(uint32 zone, uint32 charid, int16 version);
|
uint16 GetInstanceID(uint32 zone, uint32 character_id, int16 version);
|
||||||
std::vector<uint16> GetInstanceIDs(uint32 zone_id, uint32 character_id);
|
std::vector<uint16> GetInstanceIDs(uint32 zone_id, uint32 character_id);
|
||||||
uint8_t GetInstanceVersion(uint16 instance_id);
|
uint8_t GetInstanceVersion(uint16 instance_id);
|
||||||
uint32 GetTimeRemainingInstance(uint16 instance_id, bool& is_perma);
|
uint32 GetTimeRemainingInstance(uint16 instance_id, bool& is_perma);
|
||||||
uint32 GetInstanceZoneID(uint16 instance_id);
|
uint32 GetInstanceZoneID(uint16 instance_id);
|
||||||
|
|
||||||
void AssignGroupToInstance(uint32 gid, uint32 instance_id);
|
void AssignGroupToInstance(uint32 group_id, uint32 instance_id);
|
||||||
void AssignRaidToInstance(uint32 rid, uint32 instance_id);
|
void AssignRaidToInstance(uint32 raid_id, uint32 instance_id);
|
||||||
void DeleteInstance(uint16 instance_id);
|
void DeleteInstance(uint16 instance_id);
|
||||||
void FlagInstanceByGroupLeader(uint32 zone_id, int16 version, uint32 charid, uint32 group_id);
|
void FlagInstanceByGroupLeader(uint32 zone_id, int16 version, uint32 character_id, uint32 group_id);
|
||||||
void FlagInstanceByRaidLeader(uint32 zone_id, int16 version, uint32 charid, uint32 raid_id);
|
void FlagInstanceByRaidLeader(uint32 zone_id, int16 version, uint32 character_id, uint32 raid_id);
|
||||||
void GetCharactersInInstance(uint16 instance_id, std::list<uint32>& character_ids);
|
void GetCharactersInInstance(uint16 instance_id, std::list<uint32>& character_ids);
|
||||||
void PurgeExpiredInstances();
|
void PurgeExpiredInstances();
|
||||||
void SetInstanceDuration(uint16 instance_id, uint32 new_duration);
|
void SetInstanceDuration(uint16 instance_id, uint32 new_duration);
|
||||||
void CleanupInstanceCorpses();
|
void CleanupInstanceCorpses();
|
||||||
|
|
||||||
/* Adventure related. */
|
/* Adventure related. */
|
||||||
|
void UpdateAdventureStatsEntry(uint32 character_id, uint8 theme_id, bool is_win = false, bool is_remove = false);
|
||||||
void UpdateAdventureStatsEntry(uint32 char_id, uint8 theme, bool win = false, bool remove = false);
|
bool GetAdventureStats(uint32 character_id, AdventureStats_Struct* as);
|
||||||
bool GetAdventureStats(uint32 char_id, AdventureStats_Struct *as);
|
|
||||||
|
|
||||||
/* Account Related */
|
/* Account Related */
|
||||||
|
const std::string GetLiveChar(uint32 account_id);
|
||||||
bool DeleteAccount(const char *name, const char* loginserver);
|
|
||||||
bool GetLiveChar(uint32 account_id, char* cname);
|
|
||||||
bool SetAccountStatus(const char* name, int16 status);
|
|
||||||
bool SetAccountStatus(const std::string& account_name, int16 status);
|
bool SetAccountStatus(const std::string& account_name, int16 status);
|
||||||
bool SetLocalPassword(uint32 accid, const char* password);
|
bool SetLocalPassword(uint32 account_id, const std::string& password);
|
||||||
bool UpdateLiveChar(char* charname, uint32 account_id);
|
bool UpdateLiveChar(const std::string& name, uint32 account_id);
|
||||||
|
int16 GetAccountStatus(uint32 account_id);
|
||||||
|
void SetAccountCRCField(uint32 account_id, const std::string& field_name, uint64 checksum);
|
||||||
|
uint32 CheckLogin(const std::string& name, const std::string& password, const std::string& loginserver, int16* status = 0);
|
||||||
|
uint32 CreateAccount(
|
||||||
|
const std::string& name,
|
||||||
|
const std::string& password,
|
||||||
|
int16 status,
|
||||||
|
const std::string& loginserver,
|
||||||
|
uint32 lsaccount_id
|
||||||
|
);
|
||||||
|
uint32 GetAccountIDFromLSID(
|
||||||
|
const std::string& in_loginserver_id,
|
||||||
|
uint32 in_loginserver_account_id,
|
||||||
|
char* in_account_name = 0,
|
||||||
|
int16* in_status = 0
|
||||||
|
);
|
||||||
|
|
||||||
int16 CheckStatus(uint32 account_id);
|
|
||||||
|
|
||||||
void SetAccountCRCField(uint32 account_id, std::string field_name, uint64 checksum);
|
|
||||||
|
|
||||||
uint32 CheckLogin(const char* name, const char* password, const char *loginserver, int16* oStatus = 0);
|
|
||||||
uint32 CreateAccount(const char* name, const char* password, int16 status, const char* loginserver, uint32 lsaccount_id);
|
|
||||||
uint32 GetAccountIDFromLSID(const std::string& in_loginserver_id, uint32 in_loginserver_account_id, char* in_account_name = 0, int16* in_status = 0);
|
|
||||||
uint8 GetAgreementFlag(uint32 account_id);
|
uint8 GetAgreementFlag(uint32 account_id);
|
||||||
|
|
||||||
void GetAccountFromID(uint32 id, char* oAccountName, int16* oStatus);
|
|
||||||
void SetAgreementFlag(uint32 account_id);
|
void SetAgreementFlag(uint32 account_id);
|
||||||
|
|
||||||
int GetIPExemption(std::string account_ip);
|
int GetIPExemption(const std::string& account_ip);
|
||||||
void SetIPExemption(std::string account_ip, int exemption_amount);
|
void SetIPExemption(const std::string& account_ip, int exemption_amount);
|
||||||
|
|
||||||
int GetInstanceID(uint32 char_id, uint32 zone_id);
|
int GetInstanceID(uint32 character_id, uint32 zone_id);
|
||||||
|
|
||||||
|
|
||||||
/* Groups */
|
/* Groups */
|
||||||
|
std::string GetGroupLeaderForLogin(const std::string& character_name);
|
||||||
std::string GetGroupLeaderForLogin(std::string character_name);
|
char* GetGroupLeadershipInfo(
|
||||||
char* GetGroupLeadershipInfo(uint32 gid, char* leaderbuf, char* maintank = nullptr, char* assist = nullptr, char* puller = nullptr, char *marknpc = nullptr, char *mentoree = nullptr, int *mentor_percent = nullptr, GroupLeadershipAA_Struct* GLAA = nullptr);
|
uint32 group_id,
|
||||||
|
char* leaderbuf,
|
||||||
uint32 GetGroupID(const char* name);
|
char* maintank = nullptr,
|
||||||
|
char* assist = nullptr,
|
||||||
void ClearGroup(uint32 gid = 0);
|
char* puller = nullptr,
|
||||||
void ClearGroupLeader(uint32 gid = 0);
|
char* marknpc = nullptr,
|
||||||
void SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ismerc = false);
|
char* mentoree = nullptr,
|
||||||
void SetGroupLeaderName(uint32 gid, const char* name);
|
int* mentor_percent = nullptr,
|
||||||
|
GroupLeadershipAA_Struct* GLAA = nullptr
|
||||||
|
);
|
||||||
|
std::string GetGroupLeaderName(uint32 group_id);
|
||||||
|
uint32 GetGroupID(const std::string& name);
|
||||||
|
void ClearGroup(uint32 group_id = 0);
|
||||||
|
void ClearGroupLeader(uint32 group_id = 0);
|
||||||
|
void SetGroupLeaderName(uint32 group_id, const std::string& name);
|
||||||
|
|
||||||
/* Raids */
|
/* Raids */
|
||||||
|
const std::string GetRaidLeaderName(uint32 raid_id);
|
||||||
const char *GetRaidLeaderName(uint32 rid);
|
uint32 GetRaidID(const std::string& name);
|
||||||
|
void ClearRaid(uint32 raid_id = 0);
|
||||||
uint32 GetRaidID(const char* name);
|
void ClearRaidDetails(uint32 raid_id = 0);
|
||||||
|
void ClearRaidLeader(uint32 group_id = std::numeric_limits<uint32>::max(), uint32 raid_id = 0);
|
||||||
void ClearRaid(uint32 rid = 0);
|
void GetGroupLeadershipInfo(
|
||||||
void ClearRaidDetails(uint32 rid = 0);
|
uint32 group_id,
|
||||||
void ClearRaidLeader(uint32 gid = 0xFFFFFFFF, uint32 rid = 0);
|
uint32 raid_id,
|
||||||
void GetGroupLeadershipInfo(uint32 gid, uint32 rid, char* maintank = nullptr, char* assist = nullptr, char* puller = nullptr, char *marknpc = nullptr, char *mentoree = nullptr, int *mentor_percent = nullptr, GroupLeadershipAA_Struct* GLAA = nullptr);
|
char* maintank = nullptr,
|
||||||
void GetRaidLeadershipInfo(uint32 rid, char* maintank = nullptr, char* assist = nullptr, char* puller = nullptr, char *marknpc = nullptr, RaidLeadershipAA_Struct* RLAA = nullptr);
|
char* assist = nullptr,
|
||||||
void SetRaidGroupLeaderInfo(uint32 gid, uint32 rid);
|
char* puller = nullptr,
|
||||||
|
char* marknpc = nullptr,
|
||||||
|
char* mentoree = nullptr,
|
||||||
|
int* mentor_percent = nullptr,
|
||||||
|
GroupLeadershipAA_Struct* GLAA = nullptr
|
||||||
|
);
|
||||||
|
void GetRaidLeadershipInfo(
|
||||||
|
uint32 raid_id,
|
||||||
|
char* maintank = nullptr,
|
||||||
|
char* assist = nullptr,
|
||||||
|
char* puller = nullptr,
|
||||||
|
char* marknpc = nullptr,
|
||||||
|
RaidLeadershipAA_Struct* RLAA = nullptr
|
||||||
|
);
|
||||||
|
void SetRaidGroupLeaderInfo(uint32 group_id, uint32 raid_id);
|
||||||
|
|
||||||
void PurgeAllDeletedDataBuckets();
|
void PurgeAllDeletedDataBuckets();
|
||||||
|
void ClearGuildOnlineStatus();
|
||||||
|
|
||||||
|
|
||||||
/* Database Variables */
|
/* Database Variables */
|
||||||
|
bool GetVariable(const std::string& name, std::string& value);
|
||||||
bool GetVariable(std::string varname, std::string &varvalue);
|
bool SetVariable(const std::string& name, const std::string& value);
|
||||||
bool SetVariable(const std::string& varname, const std::string &varvalue);
|
|
||||||
bool LoadVariables();
|
bool LoadVariables();
|
||||||
|
|
||||||
/* General Queries */
|
|
||||||
|
|
||||||
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 LoadPTimers(uint32 charid, PTimerList &into);
|
|
||||||
|
|
||||||
uint8 GetPEQZone(uint32 zone_id, uint32 version);
|
uint8 GetPEQZone(uint32 zone_id, uint32 version);
|
||||||
uint8 GetMinStatus(uint32 zone_id, uint32 instance_version);
|
uint32 GetServerType();
|
||||||
uint8 GetRaceSkill(uint8 skillid, uint8 in_race);
|
void AddReport(const std::string& who, const std::string& against, const std::string& lines);
|
||||||
uint8 GetServerType();
|
|
||||||
uint8 GetSkillCap(uint8 skillid, uint8 in_race, uint8 in_class, uint16 in_level);
|
|
||||||
|
|
||||||
void AddReport(std::string who, std::string against, std::string lines);
|
|
||||||
struct TimeOfDay_Struct LoadTime(time_t& realtime);
|
struct TimeOfDay_Struct LoadTime(time_t& realtime);
|
||||||
bool SaveTime(int8 minute, int8 hour, int8 day, int8 month, int16 year);
|
bool SaveTime(int8 minute, int8 hour, int8 day, int8 month, int16 year);
|
||||||
void ClearMerchantTemp();
|
void ClearMerchantTemp();
|
||||||
void ClearPTimers(uint32 charid);
|
void ClearPTimers(uint32 character_id);
|
||||||
void SetFirstLogon(uint32 CharID, uint8 firstlogon);
|
void SetFirstLogon(uint32 character_id, uint8 first_logon);
|
||||||
void SetLFG(uint32 CharID, bool LFG);
|
void SetLFG(uint32 character_id, bool is_lfg);
|
||||||
void SetLFP(uint32 CharID, bool LFP);
|
void SetLFP(uint32 character_id, bool is_lfp);
|
||||||
void SetLoginFlags(uint32 CharID, bool LFP, bool LFG, uint8 firstlogon);
|
void SetLoginFlags(uint32 character_id, bool is_lfp, bool is_lfg, uint8 first_logon);
|
||||||
|
|
||||||
int CountInvSnapshots();
|
int64 CountInvSnapshots();
|
||||||
void ClearInvSnapshots(bool from_now = false);
|
void ClearInvSnapshots(bool from_now = false);
|
||||||
|
|
||||||
void SourceDatabaseTableFromUrl(std::string table_name, std::string url);
|
void SourceDatabaseTableFromUrl(const std::string& table_name, const std::string& url);
|
||||||
void SourceSqlFromUrl(std::string url);
|
void SourceSqlFromUrl(const std::string& url);
|
||||||
|
void PurgeCharacterParcels();
|
||||||
|
void Encode(std::string &in);
|
||||||
|
void Decode(std::string &in);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Mutex Mvarcache;
|
Mutex Mvarcache;
|
||||||
VarCache_Struct varcache;
|
VarCache_Struct varcache;
|
||||||
|
|
||||||
|
|||||||
@@ -5410,6 +5410,257 @@ ADD COLUMN `augment_five` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `augment_fou
|
|||||||
ADD COLUMN `augment_six` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `augment_five`;
|
ADD COLUMN `augment_six` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `augment_five`;
|
||||||
)",
|
)",
|
||||||
.content_schema_update = true
|
.content_schema_update = true
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9265,
|
||||||
|
.description = "2024_03_03_add_id_to_guild_bank.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `guild_bank` LIKE 'id'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `guild_bank`
|
||||||
|
ADD COLUMN `id` INT UNSIGNED NOT NULL AUTO_INCREMENT FIRST,
|
||||||
|
ADD PRIMARY KEY (`id`);
|
||||||
|
)",
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9266,
|
||||||
|
.description = "2024_03_02_rule_values_rule_value_length.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `rule_values` LIKE 'rule_value'",
|
||||||
|
.condition = "contains",
|
||||||
|
.match = "varchar(30)",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `rule_values`
|
||||||
|
MODIFY COLUMN `rule_value` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL AFTER `rule_name`;
|
||||||
|
)"
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9267,
|
||||||
|
.description = "2024_02_18_group_id_bot_id.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `group_id` LIKE 'bot_id'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `group_id`
|
||||||
|
CHANGE COLUMN `groupid` `group_id` int(11) UNSIGNED NOT NULL DEFAULT 0 FIRST,
|
||||||
|
CHANGE COLUMN `charid` `character_id` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `group_id`,
|
||||||
|
CHANGE COLUMN `ismerc` `merc_id` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `name`,
|
||||||
|
ADD COLUMN `bot_id` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `character_id`,
|
||||||
|
MODIFY COLUMN `name` varchar(64) NOT NULL DEFAULT '' AFTER `character_id`,
|
||||||
|
DROP PRIMARY KEY,
|
||||||
|
ADD PRIMARY KEY (`group_id`, `character_id`, `bot_id`, `merc_id`) USING BTREE;
|
||||||
|
ALTER TABLE `group_id`
|
||||||
|
MODIFY COLUMN `character_id` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `name`;
|
||||||
|
)"
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9268,
|
||||||
|
.description = "2024_03_23_skill_caps.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `skill_caps` LIKE 'skill_id'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `skill_caps`
|
||||||
|
CHANGE COLUMN `skillID` `skill_id` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 FIRST,
|
||||||
|
CHANGE COLUMN `class` `class_id` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 AFTER `skill_id`,
|
||||||
|
ADD COLUMN `id` int(3) UNSIGNED NOT NULL AUTO_INCREMENT FIRST,
|
||||||
|
DROP PRIMARY KEY,
|
||||||
|
ADD PRIMARY KEY (`id`) USING BTREE,
|
||||||
|
ADD INDEX `level_skill_cap`(`skill_id`, `class_id`, `level`, `cap`);
|
||||||
|
)",
|
||||||
|
.content_schema_update = true,
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9269,
|
||||||
|
.description = "2024_03_27_account_auto_login_charname.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `account` LIKE 'auto_login_charname'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `account`
|
||||||
|
ADD COLUMN `auto_login_charname` varchar(64) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '' AFTER `charname`;
|
||||||
|
)"
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9270,
|
||||||
|
.description = "2024_04_31_content_flagging_lootdrop_entries.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `lootdrop_entries` LIKE 'content_flags'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `lootdrop_entries` ADD `min_expansion` tinyint(4) NOT NULL DEFAULT -1;
|
||||||
|
ALTER TABLE `lootdrop_entries` ADD `max_expansion` tinyint(4) NOT NULL DEFAULT -1;
|
||||||
|
ALTER TABLE `lootdrop_entries` ADD `content_flags` varchar(100) NULL;
|
||||||
|
ALTER TABLE `lootdrop_entries` ADD `content_flags_disabled` varchar(100) NULL;
|
||||||
|
)",
|
||||||
|
.content_schema_update = true
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9271,
|
||||||
|
.description = "2024_03_10_parcel_implementation.sql",
|
||||||
|
.check = "SHOW TABLES LIKE 'character_parcels'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(CREATE TABLE `character_parcels` (
|
||||||
|
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`char_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`item_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`slot_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`quantity` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`from_name` VARCHAR(64) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
|
||||||
|
`note` VARCHAR(1024) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
|
||||||
|
`sent_date` DATETIME NULL DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
|
UNIQUE INDEX `data_constraint` (`slot_id`, `char_id`) USING BTREE
|
||||||
|
)
|
||||||
|
COLLATE='latin1_swedish_ci'
|
||||||
|
ENGINE=InnoDB
|
||||||
|
AUTO_INCREMENT=1;
|
||||||
|
)"
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9272,
|
||||||
|
.description = "2024_04_23_add_parcel_support_for_augmented_items.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `character_parcels` LIKE 'aug_slot_1'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `character_parcels`
|
||||||
|
ADD COLUMN `aug_slot_1` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `item_id`,
|
||||||
|
ADD COLUMN `aug_slot_2` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `aug_slot_1`,
|
||||||
|
ADD COLUMN `aug_slot_3` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `aug_slot_2`,
|
||||||
|
ADD COLUMN `aug_slot_4` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `aug_slot_3`,
|
||||||
|
ADD COLUMN `aug_slot_5` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `aug_slot_4`,
|
||||||
|
ADD COLUMN `aug_slot_6` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `aug_slot_5`;
|
||||||
|
)"
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9273,
|
||||||
|
.description = "2024_04_24_door_close_timer.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `doors` LIKE 'close_timer_ms'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `doors`
|
||||||
|
ADD COLUMN `close_timer_ms` smallint(8) UNSIGNED NOT NULL DEFAULT 5000 AFTER `is_ldon_door`;
|
||||||
|
)",
|
||||||
|
.content_schema_update = true
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9274,
|
||||||
|
.description = "2024_05_02_parcel_npc_content.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `npc_types` LIKE 'is_parcel_merchant'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `npc_types`
|
||||||
|
ADD COLUMN `is_parcel_merchant` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `keeps_sold_items`;
|
||||||
|
)",
|
||||||
|
.content_schema_update = true
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9275,
|
||||||
|
.description = "2024_04_28_character_extra_haste.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `character_data` LIKE 'extra_haste'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `character_data`
|
||||||
|
ADD COLUMN `extra_haste` int(11) NOT NULL DEFAULT 0 AFTER `wis`;
|
||||||
|
)"
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9276,
|
||||||
|
.description = "2024_05_12_fix_guild_bank_dup_issue.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `guild_bank` WHERE FIELD = 'qty' AND Type LIKE '%unsigned';",
|
||||||
|
.condition = "not_empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `guild_bank`
|
||||||
|
CHANGE COLUMN `qty` `qty` INT(10) NOT NULL DEFAULT '0' AFTER `itemid`;
|
||||||
|
)"
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9277,
|
||||||
|
.description = "2024_05_09_parcel_enable_containers.sql",
|
||||||
|
.check = "SHOW TABLES LIKE 'character_parcels_containers'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
CREATE TABLE `character_parcels_containers` (
|
||||||
|
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`parcels_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`slot_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`item_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`aug_slot_1` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`aug_slot_2` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`aug_slot_3` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`aug_slot_4` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`aug_slot_5` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`aug_slot_6` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`quantity` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
|
INDEX `fk_character_parcels_id` (`parcels_id`) USING BTREE,
|
||||||
|
CONSTRAINT `fk_character_parcels_id` FOREIGN KEY (`parcels_id`) REFERENCES `character_parcels` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE
|
||||||
|
)
|
||||||
|
COLLATE='latin1_swedish_ci'
|
||||||
|
ENGINE=InnoDB
|
||||||
|
AUTO_INCREMENT=1
|
||||||
|
;
|
||||||
|
)"
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9278,
|
||||||
|
.description = "2024_05_06_npc_greed.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `npc_types` LIKE 'greed'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `npc_types`
|
||||||
|
ADD COLUMN `greed` tinyint(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `merchant_id`;
|
||||||
|
)",
|
||||||
|
.content_schema_update = true
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9279,
|
||||||
|
.description = "2024_05_13_content_flagging_npc_spells_entries.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `npc_spells_entries` LIKE 'content_flags'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `npc_spells_entries` ADD `min_expansion` tinyint(4) NOT NULL DEFAULT -1;
|
||||||
|
ALTER TABLE `npc_spells_entries` ADD `max_expansion` tinyint(4) NOT NULL DEFAULT -1;
|
||||||
|
ALTER TABLE `npc_spells_entries` ADD `content_flags` varchar(100) NULL;
|
||||||
|
ALTER TABLE `npc_spells_entries` ADD `content_flags_disabled` varchar(100) NULL;
|
||||||
|
)",
|
||||||
|
.content_schema_update = true
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9280,
|
||||||
|
.description = "2024_05_11_update_trader_support.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `trader` LIKE 'aug_slot_1'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `trader`
|
||||||
|
ADD COLUMN `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT FIRST,
|
||||||
|
CHANGE COLUMN `char_id` `char_id` INT(11) UNSIGNED NOT NULL DEFAULT '0' AFTER `id`,
|
||||||
|
CHANGE COLUMN `item_id` `item_id` INT(11) UNSIGNED NOT NULL DEFAULT '0' AFTER `char_id`,
|
||||||
|
ADD COLUMN `aug_slot_1` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `item_id`,
|
||||||
|
ADD COLUMN `aug_slot_2` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `aug_slot_1`,
|
||||||
|
ADD COLUMN `aug_slot_3` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `aug_slot_2`,
|
||||||
|
ADD COLUMN `aug_slot_4` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `aug_slot_3`,
|
||||||
|
ADD COLUMN `aug_slot_5` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `aug_slot_4`,
|
||||||
|
ADD COLUMN `aug_slot_6` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `aug_slot_5`,
|
||||||
|
CHANGE COLUMN `serialnumber` `item_sn` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `aug_slot_6`,
|
||||||
|
CHANGE COLUMN `charges` `item_charges` INT(11) NOT NULL DEFAULT '0' AFTER `item_sn`,
|
||||||
|
ADD COLUMN `char_entity_id` INT(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `slot_id`,
|
||||||
|
ADD COLUMN `char_zone_id` INT(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `char_entity_id`,
|
||||||
|
ADD COLUMN `active_transaction` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0 AFTER `char_zone_id`,
|
||||||
|
DROP PRIMARY KEY,
|
||||||
|
ADD PRIMARY KEY (`id`),
|
||||||
|
ADD INDEX `charid_slotid` (`char_id`, `slot_id`);
|
||||||
|
)"
|
||||||
}
|
}
|
||||||
// -- template; copy/paste this when you need to create a new entry
|
// -- template; copy/paste this when you need to create a new entry
|
||||||
// ManifestEntry{
|
// ManifestEntry{
|
||||||
|
|||||||
@@ -139,6 +139,17 @@ ADD COLUMN `augment_three` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `augment_tw
|
|||||||
ADD COLUMN `augment_four` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `augment_three`,
|
ADD COLUMN `augment_four` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `augment_three`,
|
||||||
ADD COLUMN `augment_five` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `augment_four`,
|
ADD COLUMN `augment_five` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `augment_four`,
|
||||||
ADD COLUMN `augment_six` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `augment_five`;
|
ADD COLUMN `augment_six` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `augment_five`;
|
||||||
|
)"
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9044,
|
||||||
|
.description = "2024_04_23_bot_extra_haste.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `bot_data` LIKE 'extra_haste'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `bot_data`
|
||||||
|
ADD COLUMN `extra_haste` mediumint(8) NOT NULL DEFAULT 0 AFTER `wis`;
|
||||||
)"
|
)"
|
||||||
}
|
}
|
||||||
// -- template; copy/paste this when you need to create a new entry
|
// -- template; copy/paste this when you need to create a new entry
|
||||||
|
|||||||
@@ -421,20 +421,25 @@ void Database::AssignGroupToInstance(uint32 group_id, uint32 instance_id)
|
|||||||
auto zone_id = GetInstanceZoneID(instance_id);
|
auto zone_id = GetInstanceZoneID(instance_id);
|
||||||
auto version = GetInstanceVersion(instance_id);
|
auto version = GetInstanceVersion(instance_id);
|
||||||
|
|
||||||
auto l = GroupIdRepository::GetWhere(
|
const auto& l = GroupIdRepository::GetWhere(
|
||||||
*this,
|
*this,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"groupid = {}",
|
"`group_id` = {}",
|
||||||
group_id
|
group_id
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (l.empty()) {
|
if (l.empty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& e : l) {
|
for (const auto& e : l) {
|
||||||
if (!GetInstanceID(zone_id, e.charid, version)) {
|
if (!e.character_id) {
|
||||||
AddClientToInstance(instance_id, e.charid);
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!GetInstanceID(zone_id, e.character_id, version)) {
|
||||||
|
AddClientToInstance(instance_id, e.character_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -504,7 +509,7 @@ void Database::FlagInstanceByRaidLeader(uint32 zone_id, int16 version, uint32 ch
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto raid_leader_id = GetCharacterID(GetRaidLeaderName(raid_id));
|
auto raid_leader_id = GetCharacterID(GetRaidLeaderName(raid_id).c_str());
|
||||||
auto raid_leader_instance_id = GetInstanceID(zone_id, raid_leader_id, version);
|
auto raid_leader_instance_id = GetInstanceID(zone_id, raid_leader_id, version);
|
||||||
|
|
||||||
if (!raid_leader_instance_id) {
|
if (!raid_leader_instance_id) {
|
||||||
|
|||||||
@@ -59,6 +59,8 @@ namespace DatabaseSchema {
|
|||||||
{"character_leadership_abilities", "id"},
|
{"character_leadership_abilities", "id"},
|
||||||
{"character_material", "id"},
|
{"character_material", "id"},
|
||||||
{"character_memmed_spells", "id"},
|
{"character_memmed_spells", "id"},
|
||||||
|
{"character_parcels", "char_id"},
|
||||||
|
{"character_parcels_containers", "id"},
|
||||||
{"character_pet_buffs", "char_id"},
|
{"character_pet_buffs", "char_id"},
|
||||||
{"character_pet_info", "char_id"},
|
{"character_pet_info", "char_id"},
|
||||||
{"character_pet_inventory", "char_id"},
|
{"character_pet_inventory", "char_id"},
|
||||||
@@ -128,6 +130,8 @@ namespace DatabaseSchema {
|
|||||||
"character_leadership_abilities",
|
"character_leadership_abilities",
|
||||||
"character_material",
|
"character_material",
|
||||||
"character_memmed_spells",
|
"character_memmed_spells",
|
||||||
|
"character_parcels",
|
||||||
|
"character_parcels_containers",
|
||||||
"character_pet_buffs",
|
"character_pet_buffs",
|
||||||
"character_pet_info",
|
"character_pet_info",
|
||||||
"character_pet_inventory",
|
"character_pet_inventory",
|
||||||
|
|||||||
@@ -714,3 +714,25 @@ std::string EQ::constants::GetSpecialAbilityName(uint32 ability_id)
|
|||||||
|
|
||||||
return std::string();
|
return std::string();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::map<uint32, std::string>& EQ::constants::GetConsiderColorMap()
|
||||||
|
{
|
||||||
|
static const std::map<uint32, std::string> consider_color_map = {
|
||||||
|
{ ConsiderColor::Green, "Green" },
|
||||||
|
{ ConsiderColor::DarkBlue, "Dark Blue" },
|
||||||
|
{ ConsiderColor::Gray, "Gray" },
|
||||||
|
{ ConsiderColor::White, "White" },
|
||||||
|
{ ConsiderColor::Red, "Red" },
|
||||||
|
{ ConsiderColor::Yellow, "Yellow" },
|
||||||
|
{ ConsiderColor::LightBlue, "Light Blue" },
|
||||||
|
{ ConsiderColor::WhiteTitanium, "White" },
|
||||||
|
};
|
||||||
|
|
||||||
|
return consider_color_map;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string EQ::constants::GetConsiderColorName(uint32 consider_color)
|
||||||
|
{
|
||||||
|
const auto& c = EQ::constants::GetConsiderColorMap().find(consider_color);
|
||||||
|
return c != EQ::constants::GetConsiderColorMap().end() ? c->second : std::string();
|
||||||
|
}
|
||||||
|
|||||||
@@ -404,6 +404,9 @@ namespace EQ
|
|||||||
extern const std::map<uint32, std::string>& GetSpecialAbilityMap();
|
extern const std::map<uint32, std::string>& GetSpecialAbilityMap();
|
||||||
std::string GetSpecialAbilityName(uint32 ability_id);
|
std::string GetSpecialAbilityName(uint32 ability_id);
|
||||||
|
|
||||||
|
extern const std::map<uint32, std::string>& GetConsiderColorMap();
|
||||||
|
std::string GetConsiderColorName(uint32 consider_color);
|
||||||
|
|
||||||
const int STANCE_TYPE_FIRST = stancePassive;
|
const int STANCE_TYPE_FIRST = stancePassive;
|
||||||
const int STANCE_TYPE_LAST = stanceBurnAE;
|
const int STANCE_TYPE_LAST = stanceBurnAE;
|
||||||
const int STANCE_TYPE_COUNT = stanceBurnAE;
|
const int STANCE_TYPE_COUNT = stanceBurnAE;
|
||||||
@@ -559,6 +562,17 @@ enum ConsiderLevel : uint8 {
|
|||||||
Scowls
|
Scowls
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace ConsiderColor {
|
||||||
|
constexpr uint32 Green = 2;
|
||||||
|
constexpr uint32 DarkBlue = 4;
|
||||||
|
constexpr uint32 Gray = 6;
|
||||||
|
constexpr uint32 White = 10;
|
||||||
|
constexpr uint32 Red = 13;
|
||||||
|
constexpr uint32 Yellow = 15;
|
||||||
|
constexpr uint32 LightBlue = 18;
|
||||||
|
constexpr uint32 WhiteTitanium = 20;
|
||||||
|
};
|
||||||
|
|
||||||
enum TargetDescriptionType : uint8 {
|
enum TargetDescriptionType : uint8 {
|
||||||
LCSelf,
|
LCSelf,
|
||||||
UCSelf,
|
UCSelf,
|
||||||
|
|||||||
@@ -510,6 +510,11 @@ N(OP_ShopEndConfirm),
|
|||||||
N(OP_ShopItem),
|
N(OP_ShopItem),
|
||||||
N(OP_ShopPlayerBuy),
|
N(OP_ShopPlayerBuy),
|
||||||
N(OP_ShopPlayerSell),
|
N(OP_ShopPlayerSell),
|
||||||
|
N(OP_ShopSendParcel),
|
||||||
|
N(OP_ShopDeleteParcel),
|
||||||
|
N(OP_ShopRespondParcel),
|
||||||
|
N(OP_ShopRetrieveParcel),
|
||||||
|
N(OP_ShopParcelIcon),
|
||||||
N(OP_ShopRequest),
|
N(OP_ShopRequest),
|
||||||
N(OP_SimpleMessage),
|
N(OP_SimpleMessage),
|
||||||
N(OP_SkillUpdate),
|
N(OP_SkillUpdate),
|
||||||
@@ -552,6 +557,7 @@ N(OP_TradeBusy),
|
|||||||
N(OP_TradeCoins),
|
N(OP_TradeCoins),
|
||||||
N(OP_TradeMoneyUpdate),
|
N(OP_TradeMoneyUpdate),
|
||||||
N(OP_Trader),
|
N(OP_Trader),
|
||||||
|
N(OP_TraderBulkSend),
|
||||||
N(OP_TraderBuy),
|
N(OP_TraderBuy),
|
||||||
N(OP_TraderDelItem),
|
N(OP_TraderDelItem),
|
||||||
N(OP_TradeRequest),
|
N(OP_TradeRequest),
|
||||||
|
|||||||
@@ -793,6 +793,26 @@ typedef enum {
|
|||||||
#define STAT_MANA_REGEN 18
|
#define STAT_MANA_REGEN 18
|
||||||
#define STAT_HASTE 19
|
#define STAT_HASTE 19
|
||||||
#define STAT_DAMAGE_SHIELD 20
|
#define STAT_DAMAGE_SHIELD 20
|
||||||
|
#define STAT_DS_MITIGATION 22
|
||||||
|
#define STAT_HEAL_AMOUNT 23
|
||||||
|
#define STAT_SPELL_DAMAGE 24
|
||||||
|
#define STAT_CLAIRVOYANCE 25
|
||||||
|
#define STAT_HEROIC_AGILITY 26
|
||||||
|
#define STAT_HEROIC_CHARISMA 27
|
||||||
|
#define STAT_HEROIC_DEXTERITY 28
|
||||||
|
#define STAT_HEROIC_INTELLIGENCE 29
|
||||||
|
#define STAT_HEROIC_STAMINA 30
|
||||||
|
#define STAT_HEROIC_STRENGTH 31
|
||||||
|
#define STAT_HEROIC_WISDOM 32
|
||||||
|
#define STAT_BASH 33
|
||||||
|
#define STAT_BACKSTAB 34
|
||||||
|
#define STAT_DRAGON_PUNCH 35
|
||||||
|
#define STAT_EAGLE_STRIKE 36
|
||||||
|
#define STAT_FLYING_KICK 37
|
||||||
|
#define STAT_KICK 38
|
||||||
|
#define STAT_ROUND_KICK 39
|
||||||
|
#define STAT_TIGER_CLAW 40
|
||||||
|
#define STAT_FRENZY 41
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Recast timer types. Used as an off set to charProfileStruct timers.
|
** Recast timer types. Used as an off set to charProfileStruct timers.
|
||||||
@@ -1131,4 +1151,22 @@ namespace LeadershipAbilitySlot {
|
|||||||
constexpr uint16 HealthOfTargetsTarget = 14;
|
constexpr uint16 HealthOfTargetsTarget = 14;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum ExpSource
|
||||||
|
{
|
||||||
|
Quest,
|
||||||
|
GM,
|
||||||
|
Kill,
|
||||||
|
Death,
|
||||||
|
Resurrection,
|
||||||
|
LDoNChest,
|
||||||
|
Task,
|
||||||
|
Sacrifice
|
||||||
|
};
|
||||||
|
|
||||||
|
#define PARCEL_SEND_ITEMS 0
|
||||||
|
#define PARCEL_SEND_MONEY 1
|
||||||
|
#define PARCEL_MONEY_ITEM_ID 99990 // item id of money
|
||||||
|
#define PARCEL_LIMIT 5
|
||||||
|
#define PARCEL_BEGIN_SLOT 1
|
||||||
|
|
||||||
#endif /*COMMON_EQ_CONSTANTS_H*/
|
#endif /*COMMON_EQ_CONSTANTS_H*/
|
||||||
|
|||||||
+301
-61
@@ -27,7 +27,9 @@
|
|||||||
#include "../common/version.h"
|
#include "../common/version.h"
|
||||||
#include "emu_constants.h"
|
#include "emu_constants.h"
|
||||||
#include "textures.h"
|
#include "textures.h"
|
||||||
|
#include "../cereal/include/cereal/archives/binary.hpp"
|
||||||
|
#include "../cereal/include/cereal/types/string.hpp"
|
||||||
|
#include "../cereal/include/cereal/types/vector.hpp"
|
||||||
|
|
||||||
static const uint32 BUFF_COUNT = 42;
|
static const uint32 BUFF_COUNT = 42;
|
||||||
static const uint32 PET_BUFF_COUNT = 30;
|
static const uint32 PET_BUFF_COUNT = 30;
|
||||||
@@ -130,6 +132,11 @@ enum CrystalReclaimTypes
|
|||||||
Radiant = 4,
|
Radiant = 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace ItemStackSizeConstraint {
|
||||||
|
constexpr int16 Minimum = 1;
|
||||||
|
constexpr int16 Maximum = 1000;
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
@@ -315,6 +322,7 @@ union
|
|||||||
bool targetable_with_hotkey;
|
bool targetable_with_hotkey;
|
||||||
bool show_name;
|
bool show_name;
|
||||||
bool guild_show;
|
bool guild_show;
|
||||||
|
bool trader;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PlayerState_Struct {
|
struct PlayerState_Struct {
|
||||||
@@ -1111,7 +1119,7 @@ struct PlayerProfile_Struct
|
|||||||
/*19558*/ uint8 guildAutoconsent; // 0=off, 1=on
|
/*19558*/ uint8 guildAutoconsent; // 0=off, 1=on
|
||||||
/*19559*/ uint8 unknown19595[5]; // ***Placeholder (6/29/2005)
|
/*19559*/ uint8 unknown19595[5]; // ***Placeholder (6/29/2005)
|
||||||
/*19564*/ uint32 RestTimer;
|
/*19564*/ uint32 RestTimer;
|
||||||
/*19568*/
|
/*19568*/ uint32 char_id; // Found as part of bazaar revamp (5/15/2024)
|
||||||
|
|
||||||
// All player profile packets are translated and this overhead is ignored in out-bound packets
|
// All player profile packets are translated and this overhead is ignored in out-bound packets
|
||||||
PlayerProfile_Struct() : m_player_profile_version(EQ::versions::MobVersion::Unknown) { }
|
PlayerProfile_Struct() : m_player_profile_version(EQ::versions::MobVersion::Unknown) { }
|
||||||
@@ -1528,8 +1536,7 @@ struct ExpUpdate_Struct
|
|||||||
** Packet Types: See ItemPacketType enum
|
** Packet Types: See ItemPacketType enum
|
||||||
**
|
**
|
||||||
*/
|
*/
|
||||||
enum ItemPacketType
|
enum ItemPacketType {
|
||||||
{
|
|
||||||
ItemPacketViewLink = 0x00,
|
ItemPacketViewLink = 0x00,
|
||||||
ItemPacketMerchant = 0x64,
|
ItemPacketMerchant = 0x64,
|
||||||
ItemPacketTradeView = 0x65,
|
ItemPacketTradeView = 0x65,
|
||||||
@@ -1541,9 +1548,22 @@ enum ItemPacketType
|
|||||||
ItemPacketTributeItem = 0x6C,
|
ItemPacketTributeItem = 0x6C,
|
||||||
ItemPacketGuildTribute = 0x6D,
|
ItemPacketGuildTribute = 0x6D,
|
||||||
ItemPacketCharmUpdate = 0x6E, // noted as incorrect
|
ItemPacketCharmUpdate = 0x6E, // noted as incorrect
|
||||||
|
ItemPacketRecovery = 0x71,
|
||||||
|
ItemPacketParcel = 0x73,
|
||||||
ItemPacketInvalid = 0xFF
|
ItemPacketInvalid = 0xFF
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum MerchantWindowTabDisplay {
|
||||||
|
None = 0x00,
|
||||||
|
SellBuy = 0x01,
|
||||||
|
Recover = 0x02,
|
||||||
|
SellBuyRecover = 0x03,
|
||||||
|
Parcel = 0x04,
|
||||||
|
SellBuyParcel = 0x05,
|
||||||
|
RecoverParcel = 0x06,
|
||||||
|
SellBuyRecoverParcel = 0x07
|
||||||
|
};
|
||||||
|
|
||||||
//enum ItemPacketType
|
//enum ItemPacketType
|
||||||
//{
|
//{
|
||||||
// ItemPacketMerchant = /*100*/ 0x64, // Titanium+
|
// ItemPacketMerchant = /*100*/ 0x64, // Titanium+
|
||||||
@@ -1673,6 +1693,38 @@ struct GuildsList_Struct {
|
|||||||
GuildsListEntry_Struct Guilds[MAX_NUMBER_GUILDS];
|
GuildsListEntry_Struct Guilds[MAX_NUMBER_GUILDS];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct GuildsListMessagingEntry_Struct {
|
||||||
|
/*000*/ uint32 guild_id;
|
||||||
|
/*004*/ std::string guild_name;
|
||||||
|
|
||||||
|
template<class Archive>
|
||||||
|
void serialize(Archive& archive)
|
||||||
|
{
|
||||||
|
archive(
|
||||||
|
CEREAL_NVP(guild_id),
|
||||||
|
CEREAL_NVP(guild_name)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct GuildsListMessaging_Struct {
|
||||||
|
/*000*/ char header[64];
|
||||||
|
/*064*/ uint32 no_of_guilds;
|
||||||
|
/*068*/ uint32 string_length;
|
||||||
|
/*072*/ std::vector<GuildsListMessagingEntry_Struct> guild_detail;
|
||||||
|
|
||||||
|
template<class Archive>
|
||||||
|
void serialize(Archive& archive)
|
||||||
|
{
|
||||||
|
archive(
|
||||||
|
CEREAL_NVP(header),
|
||||||
|
CEREAL_NVP(no_of_guilds),
|
||||||
|
CEREAL_NVP(string_length),
|
||||||
|
CEREAL_NVP(guild_detail)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
struct GuildUpdate_Struct {
|
struct GuildUpdate_Struct {
|
||||||
uint32 guildID;
|
uint32 guildID;
|
||||||
GuildsListEntry_Struct entry;
|
GuildsListEntry_Struct entry;
|
||||||
@@ -2052,12 +2104,75 @@ struct TimeOfDay_Struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Darvik: shopkeeper structs
|
// Darvik: shopkeeper structs
|
||||||
struct Merchant_Click_Struct {
|
struct MerchantClick_Struct
|
||||||
/*000*/ uint32 npcid; // Merchant NPC's entity id
|
{
|
||||||
/*004*/ uint32 playerid;
|
/*000*/ uint32 npc_id; // Merchant NPC's entity id
|
||||||
|
/*004*/ uint32 player_id;
|
||||||
/*008*/ uint32 command; // 1=open, 0=cancel/close
|
/*008*/ uint32 command; // 1=open, 0=cancel/close
|
||||||
/*012*/ float rate; // cost multiplier, dosent work anymore
|
/*012*/ float rate; // cost multiplier, dosent work anymore
|
||||||
|
/*016*/ int32 tab_display; // bitmask b000 none, b001 Purchase/Sell, b010 Recover, b100 Parcels
|
||||||
|
/*020*/ int32 unknown020; // Seen 2592000 from Server or -1 from Client
|
||||||
|
/*024*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum MerchantActions {
|
||||||
|
Close = 0,
|
||||||
|
Open = 1
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Parcel_Struct
|
||||||
|
{
|
||||||
|
/*000*/ uint32 npc_id;
|
||||||
|
/*004*/ uint32 item_slot;
|
||||||
|
/*008*/ uint32 quantity;
|
||||||
|
/*012*/ uint32 money_flag;
|
||||||
|
/*016*/ char send_to[64];
|
||||||
|
/*080*/ char note[128];
|
||||||
|
/*208*/ uint32 unknown_208;
|
||||||
|
/*212*/ uint32 unknown_212;
|
||||||
|
/*216*/ uint32 unknown_216;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ParcelRetrieve_Struct
|
||||||
|
{
|
||||||
|
uint32 merchant_entity_id;
|
||||||
|
uint32 player_entity_id;
|
||||||
|
uint32 parcel_slot_id;
|
||||||
|
uint32 parcel_item_id;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ParcelMessaging_Struct {
|
||||||
|
ItemPacketType packet_type;
|
||||||
|
std::string serialized_item;
|
||||||
|
uint32 sent_time;
|
||||||
|
std::string player_name;
|
||||||
|
std::string note;
|
||||||
|
uint32 slot_id;
|
||||||
|
|
||||||
|
template<class Archive>
|
||||||
|
void serialize(Archive &archive)
|
||||||
|
{
|
||||||
|
archive(
|
||||||
|
CEREAL_NVP(packet_type),
|
||||||
|
CEREAL_NVP(serialized_item),
|
||||||
|
CEREAL_NVP(sent_time),
|
||||||
|
CEREAL_NVP(player_name),
|
||||||
|
CEREAL_NVP(note),
|
||||||
|
CEREAL_NVP(slot_id)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ParcelIcon_Struct {
|
||||||
|
uint32 status; //0 off 1 on 2 overlimit
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ParcelIconActions {
|
||||||
|
IconOff = 0,
|
||||||
|
IconOn = 1,
|
||||||
|
Overlimit = 2
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Unknowns:
|
Unknowns:
|
||||||
0 is e7 from 01 to // MAYBE SLOT IN PURCHASE
|
0 is e7 from 01 to // MAYBE SLOT IN PURCHASE
|
||||||
@@ -2917,31 +3032,41 @@ struct BazaarWindowStart_Struct {
|
|||||||
|
|
||||||
|
|
||||||
struct BazaarWelcome_Struct {
|
struct BazaarWelcome_Struct {
|
||||||
BazaarWindowStart_Struct Beginning;
|
uint32 action;
|
||||||
uint32 Traders;
|
uint32 traders;
|
||||||
uint32 Items;
|
uint32 items;
|
||||||
uint32 Unknown012;
|
uint32 unknown_012;
|
||||||
uint32 Unknown016;
|
uint32 unknown_016;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct BazaarSearch_Struct {
|
struct BazaarSearchCriteria_Struct {
|
||||||
BazaarWindowStart_Struct Beginning;
|
/*000*/ uint32 action{0};
|
||||||
uint32 TraderID;
|
/*004*/ uint32 search_scope{0}; // 1 all traders 0 local traders
|
||||||
uint32 Class_;
|
/*008*/ uint32 unknown_008{0};
|
||||||
uint32 Race;
|
/*012*/ uint32 unknown_012{0};
|
||||||
uint32 ItemStat;
|
/*016*/ uint32 trader_id{0};
|
||||||
uint32 Slot;
|
/*020*/ uint32 _class{0};
|
||||||
uint32 Type;
|
/*024*/ uint32 race{0};
|
||||||
char Name[64];
|
/*028*/ uint32 item_stat{0};
|
||||||
uint32 MinPrice;
|
/*032*/ uint32 slot{0};
|
||||||
uint32 MaxPrice;
|
/*036*/ uint32 type{0};
|
||||||
uint32 Minlevel;
|
/*040*/ char item_name[64]{""};
|
||||||
uint32 MaxLlevel;
|
/*104*/ uint32 min_cost{0};
|
||||||
|
/*108*/ uint32 max_cost{0};
|
||||||
|
/*112*/ uint32 min_level{1};
|
||||||
|
/*116*/ uint32 max_level{0};
|
||||||
|
/*120*/ uint32 max_results{0};
|
||||||
|
/*124*/ uint32 prestige{0};
|
||||||
|
/*128*/ uint32 augment{0};
|
||||||
|
/*132*/ uint32 trader_entity_id{0};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct BazaarInspect_Struct {
|
struct BazaarInspect_Struct {
|
||||||
uint32 ItemID;
|
uint32 action;
|
||||||
uint32 Unknown004;
|
char player_name[64];
|
||||||
char Name[64];
|
uint32 serial_number;
|
||||||
|
uint32 item_id;
|
||||||
|
uint32 trader_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NewBazaarInspect_Struct {
|
struct NewBazaarInspect_Struct {
|
||||||
@@ -2961,6 +3086,14 @@ struct BazaarReturnDone_Struct{
|
|||||||
uint32 Unknown012;
|
uint32 Unknown012;
|
||||||
uint32 Unknown016;
|
uint32 Unknown016;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct BazaarDeliveryCost_Struct {
|
||||||
|
uint32 action;
|
||||||
|
uint16 voucher_delivery_cost;
|
||||||
|
float parcel_deliver_cost; //percentage of item cost
|
||||||
|
uint32 unknown_010;
|
||||||
|
};
|
||||||
|
|
||||||
struct BazaarSearchResults_Struct {
|
struct BazaarSearchResults_Struct {
|
||||||
/*000*/ BazaarWindowStart_Struct Beginning;
|
/*000*/ BazaarWindowStart_Struct Beginning;
|
||||||
/*004*/ uint32 NumItems;
|
/*004*/ uint32 NumItems;
|
||||||
@@ -2973,8 +3106,10 @@ struct BazaarSearchResults_Struct {
|
|||||||
// New fields for SoD+, stripped off when encoding for older clients.
|
// New fields for SoD+, stripped off when encoding for older clients.
|
||||||
char SellerName[64];
|
char SellerName[64];
|
||||||
uint32 ItemID;
|
uint32 ItemID;
|
||||||
|
uint32 ItemID2;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Barter/Buyer
|
// Barter/Buyer
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
@@ -3274,32 +3409,31 @@ struct WhoAllReturnStruct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct Trader_Struct {
|
struct Trader_Struct {
|
||||||
/*000*/ uint32 Code;
|
/*000*/ uint32 action;
|
||||||
/*004*/ uint32 Unknown004;
|
/*004*/ uint32 unknown_004;
|
||||||
/*008*/ uint64 Items[80];
|
/*008*/ uint64 items[EQ::invtype::BAZAAR_SIZE];
|
||||||
/*648*/ uint32 ItemCost[80];
|
/*648*/ uint32 item_cost[EQ::invtype::BAZAAR_SIZE];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ClickTrader_Struct {
|
struct ClickTrader_Struct {
|
||||||
/*000*/ uint32 Code;
|
/*000*/ uint32 action;
|
||||||
/*004*/ uint32 Unknown004;
|
/*004*/ uint32 unknown_004;
|
||||||
/*008*/ int64 SerialNumber[80];
|
/*008*/ int64 serial_number[EQ::invtype::BAZAAR_SIZE] {};
|
||||||
/*648*/ uint32 ItemCost[80];
|
/*648*/ uint32 item_cost[EQ::invtype::BAZAAR_SIZE] {};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GetItems_Struct{
|
struct GetItems_Struct{
|
||||||
uint32 Items[80];
|
uint32 items[EQ::invtype::BAZAAR_SIZE];
|
||||||
int32 SerialNumber[80];
|
int32 serial_number[EQ::invtype::BAZAAR_SIZE];
|
||||||
int32 Charges[80];
|
int32 charges[EQ::invtype::BAZAAR_SIZE];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct BecomeTrader_Struct
|
struct BecomeTrader_Struct {
|
||||||
{
|
uint32 action;
|
||||||
/*000*/ uint32 ID;
|
uint32 zone_id;
|
||||||
/*004*/ uint32 Code;
|
uint32 trader_id;
|
||||||
/*008*/ char Name[64];
|
uint32 entity_id;
|
||||||
/*072*/ uint32 Unknown072; // Observed 0x33,0x91 etc on zone-in, 0x00 when sent for a new trader after zone-in
|
char trader_name[64];
|
||||||
/*076*/
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TraderStatus_Struct{
|
struct TraderStatus_Struct{
|
||||||
@@ -3309,20 +3443,30 @@ struct TraderStatus_Struct{
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct Trader_ShowItems_Struct{
|
struct Trader_ShowItems_Struct{
|
||||||
/*000*/ uint32 Code;
|
/*000*/ uint32 action;
|
||||||
/*004*/ uint32 TraderID;
|
/*004*/ uint32 entity_id;
|
||||||
/*008*/ uint32 Unknown08[3];
|
/*008*/ uint32 Unknown08[3];
|
||||||
/*020*/
|
/*020*/
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TraderBuy_Struct {
|
struct TraderBuy_Struct {
|
||||||
/*000*/ uint32 Action;
|
/*000*/ uint32 action;
|
||||||
/*004*/ uint32 TraderID;
|
/*004*/ uint32 method;
|
||||||
/*008*/ uint32 ItemID;
|
/*008*/ uint32 sub_action;
|
||||||
/*012*/ uint32 AlreadySold;
|
/*012*/ uint32 unknown_012;
|
||||||
/*016*/ uint32 Price;
|
/*016*/ uint32 trader_id;
|
||||||
/*020*/ uint32 Quantity;
|
/*020*/ char buyer_name[64];
|
||||||
/*024*/ char ItemName[64];
|
/*084*/ char seller_name[64];
|
||||||
|
/*148*/ char unknown_148[32];
|
||||||
|
/*180*/ char item_name[64];
|
||||||
|
/*244*/ char serial_number[17];
|
||||||
|
/*261*/ char unknown_261[3];
|
||||||
|
/*264*/ uint32 item_id;
|
||||||
|
/*268*/ uint32 price;
|
||||||
|
/*272*/ uint32 already_sold;
|
||||||
|
/*276*/ uint32 unknown_276;
|
||||||
|
/*280*/ uint32 quantity;
|
||||||
|
/*284*/
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TraderItemUpdate_Struct{
|
struct TraderItemUpdate_Struct{
|
||||||
@@ -3350,15 +3494,15 @@ struct MoneyUpdate_Struct{
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct TraderDelItem_Struct{
|
struct TraderDelItem_Struct{
|
||||||
uint32 Unknown000;
|
uint32 unknown_000;
|
||||||
uint32 TraderID;
|
uint32 trader_id;
|
||||||
uint32 ItemID;
|
uint32 item_id;
|
||||||
uint32 Unknown012;
|
uint32 unknown_012;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TraderClick_Struct{
|
struct TraderClick_Struct{
|
||||||
/*000*/ uint32 TraderID;
|
/*000*/ uint32 Code;
|
||||||
/*004*/ uint32 Code;
|
/*004*/ uint32 TraderID;
|
||||||
/*008*/ uint32 Unknown008;
|
/*008*/ uint32 Unknown008;
|
||||||
/*012*/ uint32 Approval;
|
/*012*/ uint32 Approval;
|
||||||
/*016*/
|
/*016*/
|
||||||
@@ -5876,6 +6020,102 @@ struct UnderWorld {
|
|||||||
/* 16 */
|
/* 16 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum BazaarTraderBarterActions {
|
||||||
|
TraderOff = 0,
|
||||||
|
TraderOn = 1,
|
||||||
|
PriceUpdate = 3,
|
||||||
|
EndTransaction = 4,
|
||||||
|
BazaarSearch = 7,
|
||||||
|
WelcomeMessage = 9,
|
||||||
|
BuyTraderItem = 10,
|
||||||
|
ListTraderItems = 11,
|
||||||
|
CustomerBrowsing = 13,
|
||||||
|
BazaarInspect = 18,
|
||||||
|
ItemMove = 19,
|
||||||
|
TraderAck2 = 22,
|
||||||
|
AddTraderToBazaarWindow = 24,
|
||||||
|
RemoveTraderFromBazaarWindow = 25,
|
||||||
|
ClickTrader = 28,
|
||||||
|
DeliveryCostUpdate = 29
|
||||||
|
};
|
||||||
|
|
||||||
|
enum BazaarPurchaseActions {
|
||||||
|
ByVendor = 0,
|
||||||
|
ByParcel = 1,
|
||||||
|
ByDirectToInventory = 2
|
||||||
|
};
|
||||||
|
|
||||||
|
enum BazaarPurchaseSubActions {
|
||||||
|
Success = 0,
|
||||||
|
Failed = 1,
|
||||||
|
DataOutDated = 3,
|
||||||
|
TooManyParcels = 5,
|
||||||
|
TransactionInProgress = 6,
|
||||||
|
InsufficientFunds = 7
|
||||||
|
};
|
||||||
|
|
||||||
|
enum BazaarSearchScopes {
|
||||||
|
Local_Scope = 0,
|
||||||
|
AllTraders_Scope = 1,
|
||||||
|
NonRoFBazaarSearchScope = 99
|
||||||
|
};
|
||||||
|
|
||||||
|
struct BazaarSearchResultsFromDB_Struct {
|
||||||
|
uint32 count;
|
||||||
|
uint32 trader_id;
|
||||||
|
uint32 item_id;
|
||||||
|
uint32 serial_number;
|
||||||
|
uint32 charges;
|
||||||
|
uint32 cost;
|
||||||
|
uint32 slot_id;
|
||||||
|
uint32 icon_id;
|
||||||
|
uint32 sum_charges;
|
||||||
|
uint32 trader_zone_id;
|
||||||
|
uint32 trader_entity_id;
|
||||||
|
uint32 item_stat;
|
||||||
|
bool stackable;
|
||||||
|
std::string item_name;
|
||||||
|
std::string serial_number_RoF;
|
||||||
|
std::string trader_name;
|
||||||
|
|
||||||
|
template<class Archive>
|
||||||
|
void serialize(Archive &archive)
|
||||||
|
{
|
||||||
|
archive(
|
||||||
|
CEREAL_NVP(count),
|
||||||
|
CEREAL_NVP(trader_id),
|
||||||
|
CEREAL_NVP(item_id),
|
||||||
|
CEREAL_NVP(serial_number),
|
||||||
|
CEREAL_NVP(charges),
|
||||||
|
CEREAL_NVP(cost),
|
||||||
|
CEREAL_NVP(slot_id),
|
||||||
|
CEREAL_NVP(icon_id),
|
||||||
|
CEREAL_NVP(sum_charges),
|
||||||
|
CEREAL_NVP(trader_zone_id),
|
||||||
|
CEREAL_NVP(trader_entity_id),
|
||||||
|
CEREAL_NVP(item_stat),
|
||||||
|
CEREAL_NVP(stackable),
|
||||||
|
CEREAL_NVP(item_name),
|
||||||
|
CEREAL_NVP(serial_number_RoF),
|
||||||
|
CEREAL_NVP(trader_name)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct BazaarSearchMessaging_Struct {
|
||||||
|
uint32 action;
|
||||||
|
char payload[];
|
||||||
|
|
||||||
|
template<class Archive>
|
||||||
|
void serialize(Archive &archive)
|
||||||
|
{
|
||||||
|
archive(
|
||||||
|
CEREAL_NVP(action),
|
||||||
|
CEREAL_NVP(payload)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// Restore structure packing to default
|
// Restore structure packing to default
|
||||||
#pragma pack()
|
#pragma pack()
|
||||||
|
|
||||||
|
|||||||
@@ -642,6 +642,10 @@ void PlayerEventLogs::ProcessRetentionTruncation()
|
|||||||
void PlayerEventLogs::ReloadSettings()
|
void PlayerEventLogs::ReloadSettings()
|
||||||
{
|
{
|
||||||
for (auto &e: PlayerEventLogSettingsRepository::All(*m_database)) {
|
for (auto &e: PlayerEventLogSettingsRepository::All(*m_database)) {
|
||||||
|
if (e.id >= PlayerEvent::MAX || e.id < 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
m_settings[e.id] = e;
|
m_settings[e.id] = e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -699,6 +703,9 @@ void PlayerEventLogs::SetSettingsDefaults()
|
|||||||
m_settings[PlayerEvent::ITEM_CREATION].event_enabled = 1;
|
m_settings[PlayerEvent::ITEM_CREATION].event_enabled = 1;
|
||||||
m_settings[PlayerEvent::GUILD_TRIBUTE_DONATE_ITEM].event_enabled = 1;
|
m_settings[PlayerEvent::GUILD_TRIBUTE_DONATE_ITEM].event_enabled = 1;
|
||||||
m_settings[PlayerEvent::GUILD_TRIBUTE_DONATE_PLAT].event_enabled = 1;
|
m_settings[PlayerEvent::GUILD_TRIBUTE_DONATE_PLAT].event_enabled = 1;
|
||||||
|
m_settings[PlayerEvent::PARCEL_SEND].event_enabled = 1;
|
||||||
|
m_settings[PlayerEvent::PARCEL_RETRIEVE].event_enabled = 1;
|
||||||
|
m_settings[PlayerEvent::PARCEL_DELETE].event_enabled = 1;
|
||||||
|
|
||||||
for (int i = PlayerEvent::GM_COMMAND; i != PlayerEvent::MAX; i++) {
|
for (int i = PlayerEvent::GM_COMMAND; i != PlayerEvent::MAX; i++) {
|
||||||
m_settings[i].retention_days = RETENTION_DAYS_DEFAULT;
|
m_settings[i].retention_days = RETENTION_DAYS_DEFAULT;
|
||||||
|
|||||||
@@ -58,6 +58,9 @@ namespace PlayerEvent {
|
|||||||
ITEM_CREATION,
|
ITEM_CREATION,
|
||||||
GUILD_TRIBUTE_DONATE_ITEM,
|
GUILD_TRIBUTE_DONATE_ITEM,
|
||||||
GUILD_TRIBUTE_DONATE_PLAT,
|
GUILD_TRIBUTE_DONATE_PLAT,
|
||||||
|
PARCEL_SEND,
|
||||||
|
PARCEL_RETRIEVE,
|
||||||
|
PARCEL_DELETE,
|
||||||
MAX // dont remove
|
MAX // dont remove
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -66,7 +69,7 @@ namespace PlayerEvent {
|
|||||||
// If event is unimplemented just tag (Unimplemented) in the name
|
// If event is unimplemented just tag (Unimplemented) in the name
|
||||||
// Events don't get saved to the database if unimplemented or deprecated
|
// Events don't get saved to the database if unimplemented or deprecated
|
||||||
// Events tagged as deprecated will get automatically removed
|
// Events tagged as deprecated will get automatically removed
|
||||||
static const char *EventName[PlayerEvent::MAX] = {
|
static const char *EventName[EventType::MAX] = {
|
||||||
"None",
|
"None",
|
||||||
"GM Command",
|
"GM Command",
|
||||||
"Zoning",
|
"Zoning",
|
||||||
@@ -116,7 +119,10 @@ namespace PlayerEvent {
|
|||||||
"Killed Raid NPC",
|
"Killed Raid NPC",
|
||||||
"Item Creation",
|
"Item Creation",
|
||||||
"Guild Tribute Donate Item",
|
"Guild Tribute Donate Item",
|
||||||
"Guild Tribute Donate Platinum"
|
"Guild Tribute Donate Platinum",
|
||||||
|
"Parcel Item Sent",
|
||||||
|
"Parcel Item Retrieved",
|
||||||
|
"Parcel Prune Routine"
|
||||||
};
|
};
|
||||||
|
|
||||||
// Generic struct used by all events
|
// Generic struct used by all events
|
||||||
@@ -976,6 +982,105 @@ namespace PlayerEvent {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct ParcelRetrieve {
|
||||||
|
uint32 item_id;
|
||||||
|
uint32 quantity;
|
||||||
|
std::string from_player_name;
|
||||||
|
uint32 sent_date;
|
||||||
|
uint32 aug_slot_1;
|
||||||
|
uint32 aug_slot_2;
|
||||||
|
uint32 aug_slot_3;
|
||||||
|
uint32 aug_slot_4;
|
||||||
|
uint32 aug_slot_5;
|
||||||
|
uint32 aug_slot_6;
|
||||||
|
|
||||||
|
// cereal
|
||||||
|
template<class Archive>
|
||||||
|
void serialize(Archive &ar)
|
||||||
|
{
|
||||||
|
ar(
|
||||||
|
CEREAL_NVP(item_id),
|
||||||
|
CEREAL_NVP(quantity),
|
||||||
|
CEREAL_NVP(from_player_name),
|
||||||
|
CEREAL_NVP(sent_date),
|
||||||
|
CEREAL_NVP(aug_slot_1),
|
||||||
|
CEREAL_NVP(aug_slot_2),
|
||||||
|
CEREAL_NVP(aug_slot_3),
|
||||||
|
CEREAL_NVP(aug_slot_4),
|
||||||
|
CEREAL_NVP(aug_slot_5),
|
||||||
|
CEREAL_NVP(aug_slot_6)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ParcelSend {
|
||||||
|
uint32 item_id;
|
||||||
|
uint32 quantity;
|
||||||
|
std::string from_player_name;
|
||||||
|
std::string to_player_name;
|
||||||
|
uint32 sent_date;
|
||||||
|
uint32 aug_slot_1;
|
||||||
|
uint32 aug_slot_2;
|
||||||
|
uint32 aug_slot_3;
|
||||||
|
uint32 aug_slot_4;
|
||||||
|
uint32 aug_slot_5;
|
||||||
|
uint32 aug_slot_6;
|
||||||
|
|
||||||
|
// cereal
|
||||||
|
template<class Archive>
|
||||||
|
void serialize(Archive &ar)
|
||||||
|
{
|
||||||
|
ar(
|
||||||
|
CEREAL_NVP(item_id),
|
||||||
|
CEREAL_NVP(quantity),
|
||||||
|
CEREAL_NVP(from_player_name),
|
||||||
|
CEREAL_NVP(to_player_name),
|
||||||
|
CEREAL_NVP(sent_date),
|
||||||
|
CEREAL_NVP(aug_slot_1),
|
||||||
|
CEREAL_NVP(aug_slot_2),
|
||||||
|
CEREAL_NVP(aug_slot_3),
|
||||||
|
CEREAL_NVP(aug_slot_4),
|
||||||
|
CEREAL_NVP(aug_slot_5),
|
||||||
|
CEREAL_NVP(aug_slot_6)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ParcelDelete {
|
||||||
|
uint32 item_id;
|
||||||
|
uint32 quantity;
|
||||||
|
uint32 char_id;
|
||||||
|
std::string from_name;
|
||||||
|
std::string note;
|
||||||
|
uint32 sent_date;
|
||||||
|
uint32 aug_slot_1;
|
||||||
|
uint32 aug_slot_2;
|
||||||
|
uint32 aug_slot_3;
|
||||||
|
uint32 aug_slot_4;
|
||||||
|
uint32 aug_slot_5;
|
||||||
|
uint32 aug_slot_6;
|
||||||
|
|
||||||
|
// cereal
|
||||||
|
template<class Archive>
|
||||||
|
void serialize(Archive &ar)
|
||||||
|
{
|
||||||
|
ar(
|
||||||
|
CEREAL_NVP(item_id),
|
||||||
|
CEREAL_NVP(quantity),
|
||||||
|
CEREAL_NVP(char_id),
|
||||||
|
CEREAL_NVP(from_name),
|
||||||
|
CEREAL_NVP(note),
|
||||||
|
CEREAL_NVP(sent_date),
|
||||||
|
CEREAL_NVP(aug_slot_1),
|
||||||
|
CEREAL_NVP(aug_slot_2),
|
||||||
|
CEREAL_NVP(aug_slot_3),
|
||||||
|
CEREAL_NVP(aug_slot_4),
|
||||||
|
CEREAL_NVP(aug_slot_5),
|
||||||
|
CEREAL_NVP(aug_slot_6)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //EQEMU_PLAYER_EVENTS_H
|
#endif //EQEMU_PLAYER_EVENTS_H
|
||||||
|
|||||||
+37
-31
@@ -92,10 +92,20 @@ BaseGuildManager::~BaseGuildManager()
|
|||||||
bool BaseGuildManager::LoadGuilds()
|
bool BaseGuildManager::LoadGuilds()
|
||||||
{
|
{
|
||||||
ClearGuilds();
|
ClearGuilds();
|
||||||
auto guilds = GuildsRepository::All(*m_db);
|
auto guilds = GuildsRepository::GetWhere(
|
||||||
auto guilds_ranks = GuildRanksRepository::All(*m_db);
|
*m_db,
|
||||||
auto guilds_permissions = GuildPermissionsRepository::All(*m_db);
|
fmt::format("`id` < '{}'", RoF2::constants::MAX_GUILD_ID)
|
||||||
auto guilds_tributes = GuildTributesRepository::All(*m_db);
|
);
|
||||||
|
auto guilds_ranks = GuildRanksRepository::LoadAll(*m_db);
|
||||||
|
auto guilds_permissions = GuildPermissionsRepository::LoadAll(*m_db);
|
||||||
|
auto guilds_tributes = GuildTributesRepository::GetWhere(
|
||||||
|
*m_db,
|
||||||
|
fmt::format(
|
||||||
|
"`guild_id` < '{}'",
|
||||||
|
RoF2::constants::MAX_GUILD_ID
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
if (guilds.empty()) {
|
if (guilds.empty()) {
|
||||||
LogGuilds("No Guilds found in database.");
|
LogGuilds("No Guilds found in database.");
|
||||||
@@ -108,22 +118,27 @@ bool BaseGuildManager::LoadGuilds()
|
|||||||
|
|
||||||
_CreateGuild(g.id, g.name, g.leader, g.minstatus, g.motd, g.motd_setter, g.channel, g.url, g.favor);
|
_CreateGuild(g.id, g.name, g.leader, g.minstatus, g.motd, g.motd_setter, g.channel, g.url, g.favor);
|
||||||
|
|
||||||
for (auto const &r: guilds_ranks) {
|
for (int i = 1; i <= GUILD_MAX_RANK; i++) {
|
||||||
if (r.guild_id == g.id) {
|
auto key = fmt::format("{}-{}", g.id, i);
|
||||||
m_guilds[g.id]->rank_names[r.rank_] = r.title;
|
|
||||||
|
if (guilds_ranks.contains(key)) {
|
||||||
|
m_guilds[g.id]->rank_names[i] = guilds_ranks.find(key)->second;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto count = 0;
|
auto count = 0;
|
||||||
|
|
||||||
for (auto const &p: guilds_permissions) {
|
for (int i = 1; i <= GUILD_MAX_FUNCTIONS; i++) {
|
||||||
if (p.guild_id == g.id) {
|
auto key = fmt::format("{}-{}", g.id, i);
|
||||||
|
if (guilds_permissions.contains(key)) {
|
||||||
|
auto p = guilds_permissions.find(key)->second;
|
||||||
m_guilds[g.id]->functions[p.perm_id].id = p.id;
|
m_guilds[g.id]->functions[p.perm_id].id = p.id;
|
||||||
m_guilds[g.id]->functions[p.perm_id].guild_id = p.guild_id;
|
m_guilds[g.id]->functions[p.perm_id].guild_id = p.guild_id;
|
||||||
m_guilds[g.id]->functions[p.perm_id].perm_id = p.perm_id;
|
m_guilds[g.id]->functions[p.perm_id].perm_id = p.perm_id;
|
||||||
m_guilds[g.id]->functions[p.perm_id].perm_value = p.permission;
|
m_guilds[g.id]->functions[p.perm_id].perm_value = p.permission;
|
||||||
count++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count < GUILD_MAX_FUNCTIONS) {
|
if (count < GUILD_MAX_FUNCTIONS) {
|
||||||
@@ -929,33 +944,24 @@ bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//returns ownership of the buffer.
|
GuildsListMessaging_Struct BaseGuildManager::MakeGuildList()
|
||||||
uint8 *BaseGuildManager::MakeGuildList(const char *head_name, uint32 &length) const
|
|
||||||
{
|
{
|
||||||
//dynamic structs will make this a lot less painful.
|
GuildsListMessaging_Struct guild_list_messaging{};
|
||||||
|
uint32 string_length = 0;
|
||||||
|
|
||||||
length = sizeof(GuildsList_Struct);
|
for (auto const &g: m_guilds) {
|
||||||
auto buffer = new uint8[length];
|
GuildsListMessagingEntry_Struct guild_entry{};
|
||||||
|
|
||||||
//a bit little better than memsetting the whole thing...
|
guild_entry.guild_id = g.first;
|
||||||
uint32 r, pos;
|
guild_entry.guild_name = g.second->name;
|
||||||
for (r = 0, pos = 0; r <= MAX_NUMBER_GUILDS; r++, pos += 64) {
|
string_length += g.second->name.length() + 1;
|
||||||
//strcpy((char *) buffer+pos, "BAD GUILD");
|
guild_list_messaging.guild_detail.push_back(guild_entry);
|
||||||
// These 'BAD GUILD' entries were showing in the drop-downs for selecting guilds in the LFP window,
|
|
||||||
// so just fill unused entries with an empty string instead.
|
|
||||||
buffer[pos] = '\0';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
strn0cpy((char *) buffer, head_name, 64);
|
guild_list_messaging.no_of_guilds = m_guilds.size();
|
||||||
|
guild_list_messaging.string_length = string_length;
|
||||||
|
|
||||||
std::map<uint32, GuildInfo *>::const_iterator cur, end;
|
return guild_list_messaging;
|
||||||
cur = m_guilds.begin();
|
|
||||||
end = m_guilds.end();
|
|
||||||
for (; cur != end; ++cur) {
|
|
||||||
pos = 64 + (64 * cur->first);
|
|
||||||
strn0cpy((char *) buffer + pos, cur->second->name.c_str(), 64);
|
|
||||||
}
|
|
||||||
return (buffer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *BaseGuildManager::GetRankName(uint32 guild_id, uint8 rank) const
|
const char *BaseGuildManager::GetRankName(uint32 guild_id, uint8 rank) const
|
||||||
|
|||||||
+1
-1
@@ -134,7 +134,7 @@ class BaseGuildManager
|
|||||||
bool CheckGMStatus(uint32 guild_id, uint8 status) const;
|
bool CheckGMStatus(uint32 guild_id, uint8 status) const;
|
||||||
bool CheckPermission(uint32 guild_id, uint8 rank, GuildAction act) const;
|
bool CheckPermission(uint32 guild_id, uint8 rank, GuildAction act) const;
|
||||||
bool UpdateDbBankerFlag(uint32 charid, bool is_banker);
|
bool UpdateDbBankerFlag(uint32 charid, bool is_banker);
|
||||||
uint8* MakeGuildList(const char* head_name, uint32& length) const; //make a guild list packet, returns ownership of the buffer.
|
GuildsListMessaging_Struct MakeGuildList();
|
||||||
uint8 GetDisplayedRank(uint32 guild_id, uint8 rank, uint32 char_id) const;
|
uint8 GetDisplayedRank(uint32 guild_id, uint8 rank, uint32 char_id) const;
|
||||||
uint32 GetGuildIDByName(const char *GuildName);
|
uint32 GetGuildIDByName(const char *GuildName);
|
||||||
uint32 GetGuildIDByCharacterID(uint32 character_id);
|
uint32 GetGuildIDByCharacterID(uint32 character_id);
|
||||||
|
|||||||
+7
-4
@@ -104,10 +104,10 @@ namespace EQ
|
|||||||
/*----*/ ItemTypeUnknown6,
|
/*----*/ ItemTypeUnknown6,
|
||||||
/*----*/ ItemTypeUnknown7,
|
/*----*/ ItemTypeUnknown7,
|
||||||
/*5522*/ ItemTypeMartial, // 45
|
/*5522*/ ItemTypeMartial, // 45
|
||||||
/*----*/ ItemTypeUnknown8,
|
/*----*/ ItemTypeAllEffects,
|
||||||
/*----*/ ItemTypeUnknown9,
|
/*----*/ ItemTypeUnknown9,
|
||||||
/*----*/ ItemTypeUnknown10,
|
/*----*/ ItemTypeUnknown10,
|
||||||
/*----*/ ItemTypeUnknown11,
|
/*----*/ ItemTypeFocusEffect,
|
||||||
/*----*/ ItemTypeSinging, // 50
|
/*----*/ ItemTypeSinging, // 50
|
||||||
/*5750*/ ItemTypeAllInstrumentTypes,
|
/*5750*/ ItemTypeAllInstrumentTypes,
|
||||||
/*5776*/ ItemTypeCharm,
|
/*5776*/ ItemTypeCharm,
|
||||||
@@ -115,7 +115,7 @@ namespace EQ
|
|||||||
/*----*/ ItemTypeAugmentation,
|
/*----*/ ItemTypeAugmentation,
|
||||||
/*----*/ ItemTypeAugmentationSolvent, // 55
|
/*----*/ ItemTypeAugmentationSolvent, // 55
|
||||||
/*----*/ ItemTypeAugmentationDistiller,
|
/*----*/ ItemTypeAugmentationDistiller,
|
||||||
/*----*/ ItemTypeUnknown12,
|
/*----*/ ItemTypeAlternateAbility,
|
||||||
/*----*/ ItemTypeFellowshipKit,
|
/*----*/ ItemTypeFellowshipKit,
|
||||||
/*----*/ ItemTypeUnknown13,
|
/*----*/ ItemTypeUnknown13,
|
||||||
/*----*/ ItemTypeRecipe, // 60
|
/*----*/ ItemTypeRecipe, // 60
|
||||||
@@ -123,7 +123,10 @@ namespace EQ
|
|||||||
/*----*/ ItemTypeJournal, // only one(1) database entry
|
/*----*/ ItemTypeJournal, // only one(1) database entry
|
||||||
/*----*/ ItemTypeAltCurrency, // alt-currency (as opposed to coinage)
|
/*----*/ ItemTypeAltCurrency, // alt-currency (as opposed to coinage)
|
||||||
/*5881*/ ItemTypePerfectedAugmentationDistiller,
|
/*5881*/ ItemTypePerfectedAugmentationDistiller,
|
||||||
/*----*/ ItemTypeCount
|
/*----*/ ItemTypeCount,
|
||||||
|
/*----*/ ItemTypeCollectible,
|
||||||
|
/*----*/ ItemTypeContainer,
|
||||||
|
/*----*/ ItemTypeAll = 0xFF
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Unknowns:
|
Unknowns:
|
||||||
|
|||||||
@@ -1812,6 +1812,142 @@ std::vector<uint32> EQ::ItemInstance::GetAugmentIDs() const
|
|||||||
return augments;
|
return augments;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int EQ::ItemInstance::GetItemRegen(bool augments) const
|
||||||
|
{
|
||||||
|
int stat = 0;
|
||||||
|
const auto item = GetItem();
|
||||||
|
if (item) {
|
||||||
|
stat = item->Regen;
|
||||||
|
if (augments) {
|
||||||
|
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i) {
|
||||||
|
if (GetAugment(i)) {
|
||||||
|
stat += GetAugment(i)->GetItemRegen();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return stat;
|
||||||
|
}
|
||||||
|
|
||||||
|
int EQ::ItemInstance::GetItemManaRegen(bool augments) const
|
||||||
|
{
|
||||||
|
int stat = 0;
|
||||||
|
const auto item = GetItem();
|
||||||
|
if (item) {
|
||||||
|
stat = item->ManaRegen;
|
||||||
|
if (augments) {
|
||||||
|
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i) {
|
||||||
|
if (GetAugment(i)) {
|
||||||
|
stat += GetAugment(i)->GetItemManaRegen();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return stat;
|
||||||
|
}
|
||||||
|
|
||||||
|
int EQ::ItemInstance::GetItemDamageShield(bool augments) const
|
||||||
|
{
|
||||||
|
int stat = 0;
|
||||||
|
const auto item = GetItem();
|
||||||
|
if (item) {
|
||||||
|
stat = item->DamageShield;
|
||||||
|
if (augments) {
|
||||||
|
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i) {
|
||||||
|
if (GetAugment(i)) {
|
||||||
|
stat += GetAugment(i)->GetItemDamageShield();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return stat;
|
||||||
|
}
|
||||||
|
|
||||||
|
int EQ::ItemInstance::GetItemDSMitigation(bool augments) const
|
||||||
|
{
|
||||||
|
int stat = 0;
|
||||||
|
const auto item = GetItem();
|
||||||
|
if (item) {
|
||||||
|
stat = item->DSMitigation;
|
||||||
|
if (augments) {
|
||||||
|
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i) {
|
||||||
|
if (GetAugment(i)) {
|
||||||
|
stat += GetAugment(i)->GetItemDSMitigation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return stat;
|
||||||
|
}
|
||||||
|
|
||||||
|
int EQ::ItemInstance::GetItemHealAmt(bool augments) const
|
||||||
|
{
|
||||||
|
int stat = 0;
|
||||||
|
const auto item = GetItem();
|
||||||
|
if (item) {
|
||||||
|
stat = item->HealAmt;
|
||||||
|
if (augments) {
|
||||||
|
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i) {
|
||||||
|
if (GetAugment(i)) {
|
||||||
|
stat += GetAugment(i)->GetItemHealAmt();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return stat;
|
||||||
|
}
|
||||||
|
|
||||||
|
int EQ::ItemInstance::GetItemSpellDamage(bool augments) const
|
||||||
|
{
|
||||||
|
int stat = 0;
|
||||||
|
const auto item = GetItem();
|
||||||
|
if (item) {
|
||||||
|
stat = item->SpellDmg;
|
||||||
|
if (augments) {
|
||||||
|
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i) {
|
||||||
|
if (GetAugment(i)) {
|
||||||
|
stat += GetAugment(i)->GetItemSpellDamage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return stat;
|
||||||
|
}
|
||||||
|
|
||||||
|
int EQ::ItemInstance::GetItemClairvoyance(bool augments) const
|
||||||
|
{
|
||||||
|
int stat = 0;
|
||||||
|
const auto item = GetItem();
|
||||||
|
if (item) {
|
||||||
|
stat = item->Clairvoyance;
|
||||||
|
if (augments) {
|
||||||
|
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i) {
|
||||||
|
if (GetAugment(i)) {
|
||||||
|
stat += GetAugment(i)->GetItemClairvoyance();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return stat;
|
||||||
|
}
|
||||||
|
|
||||||
|
int EQ::ItemInstance::GetItemSkillsStat(EQ::skills::SkillType skill, bool augments) const
|
||||||
|
{
|
||||||
|
int stat = 0;
|
||||||
|
const auto item = GetItem();
|
||||||
|
if (item) {
|
||||||
|
stat = item->ExtraDmgSkill == skill ? item->ExtraDmgAmt : 0;
|
||||||
|
if (augments) {
|
||||||
|
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i) {
|
||||||
|
if (GetAugment(i)) {
|
||||||
|
stat += GetAugment(i)->GetItemSkillsStat(skill);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return stat;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// class EvolveInfo
|
// class EvolveInfo
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -270,6 +270,7 @@ namespace EQ
|
|||||||
int GetItemMagical(bool augments = false) const;
|
int GetItemMagical(bool augments = false) const;
|
||||||
int GetItemHP(bool augments = false) const;
|
int GetItemHP(bool augments = false) const;
|
||||||
int GetItemMana(bool augments = false) const;
|
int GetItemMana(bool augments = false) const;
|
||||||
|
int GetItemManaRegen(bool augments = false) const;
|
||||||
int GetItemEndur(bool augments = false) const;
|
int GetItemEndur(bool augments = false) const;
|
||||||
int GetItemAttack(bool augments = false) const;
|
int GetItemAttack(bool augments = false) const;
|
||||||
int GetItemStr(bool augments = false) const;
|
int GetItemStr(bool augments = false) const;
|
||||||
@@ -299,6 +300,13 @@ namespace EQ
|
|||||||
int GetItemHeroicDR(bool augments = false) const;
|
int GetItemHeroicDR(bool augments = false) const;
|
||||||
int GetItemHeroicCorrup(bool augments = false) const;
|
int GetItemHeroicCorrup(bool augments = false) const;
|
||||||
int GetItemHaste(bool augments = false) const;
|
int GetItemHaste(bool augments = false) const;
|
||||||
|
int GetItemRegen(bool augments = false) const;
|
||||||
|
int GetItemDamageShield(bool augments = false) const;
|
||||||
|
int GetItemDSMitigation(bool augments = false) const;
|
||||||
|
int GetItemHealAmt(bool augments = false) const;
|
||||||
|
int GetItemSpellDamage(bool augments = false) const;
|
||||||
|
int GetItemClairvoyance(bool augments = false) const;
|
||||||
|
int GetItemSkillsStat(EQ::skills::SkillType skill, bool augments = false) const;
|
||||||
uint32 GetItemGuildFavor() const;
|
uint32 GetItemGuildFavor() const;
|
||||||
std::vector<uint32> GetAugmentIDs() const;
|
std::vector<uint32> GetAugmentIDs() const;
|
||||||
|
|
||||||
|
|||||||
+24
-54
@@ -3089,21 +3089,6 @@ namespace RoF
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_ShopRequest)
|
|
||||||
{
|
|
||||||
ENCODE_LENGTH_EXACT(Merchant_Click_Struct);
|
|
||||||
SETUP_DIRECT_ENCODE(Merchant_Click_Struct, structs::Merchant_Click_Struct);
|
|
||||||
|
|
||||||
OUT(npcid);
|
|
||||||
OUT(playerid);
|
|
||||||
OUT(command);
|
|
||||||
OUT(rate);
|
|
||||||
eq->unknown01 = 3; // Not sure what these values do yet, but list won't display without them
|
|
||||||
eq->unknown02 = 2592000;
|
|
||||||
|
|
||||||
FINISH_ENCODE();
|
|
||||||
}
|
|
||||||
|
|
||||||
ENCODE(OP_SkillUpdate)
|
ENCODE(OP_SkillUpdate)
|
||||||
{
|
{
|
||||||
ENCODE_LENGTH_EXACT(SkillUpdate_Struct);
|
ENCODE_LENGTH_EXACT(SkillUpdate_Struct);
|
||||||
@@ -3509,14 +3494,13 @@ namespace RoF
|
|||||||
ENCODE_LENGTH_EXACT(ClickTrader_Struct);
|
ENCODE_LENGTH_EXACT(ClickTrader_Struct);
|
||||||
SETUP_DIRECT_ENCODE(ClickTrader_Struct, structs::ClickTrader_Struct);
|
SETUP_DIRECT_ENCODE(ClickTrader_Struct, structs::ClickTrader_Struct);
|
||||||
|
|
||||||
eq->Code = emu->Code;
|
eq->Code = emu->action;
|
||||||
// Live actually has 200 items now, but 80 is the most our internal struct supports
|
for (uint32 i = 0; i < RoF::invtype::BAZAAR_SIZE; i++)
|
||||||
for (uint32 i = 0; i < 200; i++)
|
|
||||||
{
|
{
|
||||||
strncpy(eq->items[i].SerialNumber, "0000000000000000", sizeof(eq->items[i].SerialNumber));
|
strncpy(eq->items[i].SerialNumber, "0000000000000000", sizeof(eq->items[i].SerialNumber));
|
||||||
eq->items[i].Unknown18 = 0;
|
eq->items[i].Unknown18 = 0;
|
||||||
if (i < 80) {
|
if (i < 80) {
|
||||||
eq->ItemCost[i] = emu->ItemCost[i];
|
eq->ItemCost[i] = emu->item_cost[i];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
eq->ItemCost[i] = 0;
|
eq->ItemCost[i] = 0;
|
||||||
@@ -3530,9 +3514,9 @@ namespace RoF
|
|||||||
ENCODE_LENGTH_EXACT(Trader_ShowItems_Struct);
|
ENCODE_LENGTH_EXACT(Trader_ShowItems_Struct);
|
||||||
SETUP_DIRECT_ENCODE(Trader_ShowItems_Struct, structs::Trader_ShowItems_Struct);
|
SETUP_DIRECT_ENCODE(Trader_ShowItems_Struct, structs::Trader_ShowItems_Struct);
|
||||||
|
|
||||||
eq->Code = emu->Code;
|
eq->Code = emu->action;
|
||||||
strncpy(eq->SerialNumber, "0000000000000000", sizeof(eq->SerialNumber));
|
strncpy(eq->SerialNumber, "0000000000000000", sizeof(eq->SerialNumber));
|
||||||
eq->TraderID = emu->TraderID;
|
eq->TraderID = emu->entity_id;
|
||||||
eq->Stacksize = 0;
|
eq->Stacksize = 0;
|
||||||
eq->Price = 0;
|
eq->Price = 0;
|
||||||
|
|
||||||
@@ -3558,13 +3542,13 @@ namespace RoF
|
|||||||
ENCODE_LENGTH_EXACT(TraderBuy_Struct);
|
ENCODE_LENGTH_EXACT(TraderBuy_Struct);
|
||||||
SETUP_DIRECT_ENCODE(TraderBuy_Struct, structs::TraderBuy_Struct);
|
SETUP_DIRECT_ENCODE(TraderBuy_Struct, structs::TraderBuy_Struct);
|
||||||
|
|
||||||
OUT(Action);
|
OUT(action);
|
||||||
OUT(Price);
|
OUT(price);
|
||||||
OUT(TraderID);
|
OUT(trader_id);
|
||||||
memcpy(eq->ItemName, emu->ItemName, sizeof(eq->ItemName));
|
memcpy(eq->item_name, emu->item_name, sizeof(eq->item_name));
|
||||||
OUT(ItemID);
|
OUT(item_id);
|
||||||
OUT(Quantity);
|
OUT(quantity);
|
||||||
OUT(AlreadySold);
|
OUT(already_sold);
|
||||||
|
|
||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
@@ -5047,19 +5031,6 @@ namespace RoF
|
|||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
DECODE(OP_ShopRequest)
|
|
||||||
{
|
|
||||||
DECODE_LENGTH_EXACT(structs::Merchant_Click_Struct);
|
|
||||||
SETUP_DIRECT_DECODE(Merchant_Click_Struct, structs::Merchant_Click_Struct);
|
|
||||||
|
|
||||||
IN(npcid);
|
|
||||||
IN(playerid);
|
|
||||||
IN(command);
|
|
||||||
IN(rate);
|
|
||||||
|
|
||||||
FINISH_DIRECT_DECODE();
|
|
||||||
}
|
|
||||||
|
|
||||||
DECODE(OP_Trader)
|
DECODE(OP_Trader)
|
||||||
{
|
{
|
||||||
uint32 psize = __packet->size;
|
uint32 psize = __packet->size;
|
||||||
@@ -5069,12 +5040,11 @@ namespace RoF
|
|||||||
SETUP_DIRECT_DECODE(ClickTrader_Struct, structs::ClickTrader_Struct);
|
SETUP_DIRECT_DECODE(ClickTrader_Struct, structs::ClickTrader_Struct);
|
||||||
MEMSET_IN(ClickTrader_Struct);
|
MEMSET_IN(ClickTrader_Struct);
|
||||||
|
|
||||||
emu->Code = eq->Code;
|
emu->action = eq->Code;
|
||||||
// Live actually has 200 items now, but 80 is the most our internal struct supports
|
for (uint32 i = 0; i < RoF::invtype::BAZAAR_SIZE; i++)
|
||||||
for (uint32 i = 0; i < 80; i++)
|
|
||||||
{
|
{
|
||||||
emu->SerialNumber[i] = 0; // eq->SerialNumber[i];
|
emu->serial_number[i] = 0; // eq->SerialNumber[i];
|
||||||
emu->ItemCost[i] = eq->ItemCost[i];
|
emu->item_cost[i] = eq->ItemCost[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
@@ -5085,8 +5055,8 @@ namespace RoF
|
|||||||
SETUP_DIRECT_DECODE(Trader_ShowItems_Struct, structs::Trader_ShowItems_Struct);
|
SETUP_DIRECT_DECODE(Trader_ShowItems_Struct, structs::Trader_ShowItems_Struct);
|
||||||
MEMSET_IN(Trader_ShowItems_Struct);
|
MEMSET_IN(Trader_ShowItems_Struct);
|
||||||
|
|
||||||
emu->Code = eq->Code;
|
emu->action = eq->Code;
|
||||||
emu->TraderID = eq->TraderID;
|
emu->entity_id = eq->TraderID;
|
||||||
|
|
||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
}
|
}
|
||||||
@@ -5108,12 +5078,12 @@ namespace RoF
|
|||||||
SETUP_DIRECT_DECODE(TraderBuy_Struct, structs::TraderBuy_Struct);
|
SETUP_DIRECT_DECODE(TraderBuy_Struct, structs::TraderBuy_Struct);
|
||||||
MEMSET_IN(TraderBuy_Struct);
|
MEMSET_IN(TraderBuy_Struct);
|
||||||
|
|
||||||
IN(Action);
|
IN(action);
|
||||||
IN(Price);
|
IN(price);
|
||||||
IN(TraderID);
|
IN(trader_id);
|
||||||
memcpy(emu->ItemName, eq->ItemName, sizeof(emu->ItemName));
|
memcpy(emu->item_name, eq->item_name, sizeof(emu->item_name));
|
||||||
IN(ItemID);
|
IN(item_id);
|
||||||
IN(Quantity);
|
IN(quantity);
|
||||||
|
|
||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
}
|
}
|
||||||
|
|||||||
+609
-271
File diff suppressed because it is too large
Load Diff
@@ -271,6 +271,7 @@ namespace RoF2
|
|||||||
const size_t CHARACTER_CREATION_LIMIT = 12;
|
const size_t CHARACTER_CREATION_LIMIT = 12;
|
||||||
|
|
||||||
const size_t SAY_LINK_BODY_SIZE = 56;
|
const size_t SAY_LINK_BODY_SIZE = 56;
|
||||||
|
const uint32 MAX_GUILD_ID = 50000;
|
||||||
|
|
||||||
} /*constants*/
|
} /*constants*/
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ E(OP_ApplyPoison)
|
|||||||
E(OP_AugmentInfo)
|
E(OP_AugmentInfo)
|
||||||
E(OP_Barter)
|
E(OP_Barter)
|
||||||
E(OP_BazaarSearch)
|
E(OP_BazaarSearch)
|
||||||
|
E(OP_BecomeTrader)
|
||||||
E(OP_BeginCast)
|
E(OP_BeginCast)
|
||||||
E(OP_BlockedBuffs)
|
E(OP_BlockedBuffs)
|
||||||
E(OP_Buff)
|
E(OP_Buff)
|
||||||
@@ -116,7 +117,6 @@ E(OP_SendZonepoints)
|
|||||||
E(OP_SetGuildRank)
|
E(OP_SetGuildRank)
|
||||||
E(OP_ShopPlayerBuy)
|
E(OP_ShopPlayerBuy)
|
||||||
E(OP_ShopPlayerSell)
|
E(OP_ShopPlayerSell)
|
||||||
E(OP_ShopRequest)
|
|
||||||
E(OP_SkillUpdate)
|
E(OP_SkillUpdate)
|
||||||
E(OP_SomeItemPacketMaybe)
|
E(OP_SomeItemPacketMaybe)
|
||||||
E(OP_SpawnAppearance)
|
E(OP_SpawnAppearance)
|
||||||
@@ -200,7 +200,7 @@ D(OP_Save)
|
|||||||
D(OP_SetServerFilter)
|
D(OP_SetServerFilter)
|
||||||
D(OP_ShopPlayerBuy)
|
D(OP_ShopPlayerBuy)
|
||||||
D(OP_ShopPlayerSell)
|
D(OP_ShopPlayerSell)
|
||||||
D(OP_ShopRequest)
|
D(OP_ShopSendParcel)
|
||||||
D(OP_Trader)
|
D(OP_Trader)
|
||||||
D(OP_TraderBuy)
|
D(OP_TraderBuy)
|
||||||
D(OP_TradeSkillCombine)
|
D(OP_TradeSkillCombine)
|
||||||
|
|||||||
+142
-98
@@ -2247,15 +2247,17 @@ struct TimeOfDay_Struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Darvik: shopkeeper structs
|
// Darvik: shopkeeper structs
|
||||||
struct Merchant_Click_Struct {
|
struct MerchantClick_Struct
|
||||||
/*000*/ uint32 npcid; // Merchant NPC's entity id
|
{
|
||||||
/*004*/ uint32 playerid;
|
/*000*/ uint32 npc_id; // Merchant NPC's entity id
|
||||||
|
/*004*/ uint32 player_id;
|
||||||
/*008*/ uint32 command; // 1=open, 0=cancel/close
|
/*008*/ uint32 command; // 1=open, 0=cancel/close
|
||||||
/*012*/ float rate; // cost multiplier, dosent work anymore
|
/*012*/ float rate; // cost multiplier, dosent work anymore
|
||||||
/*016*/ int32 unknown01; // Seen 3 from Server or -1 from Client
|
/*016*/ int32 tab_display; // bitmask b000 none, b001 Purchase/Sell, b010 Recover, b100 Parcels
|
||||||
/*020*/ int32 unknown02; // Seen 2592000 from Server or -1 from Client
|
/*020*/ int32 unknown02; // Seen 2592000 from Server or -1 from Client
|
||||||
/*024*/
|
/*024*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Unknowns:
|
Unknowns:
|
||||||
0 is e7 from 01 to // MAYBE SLOT IN PURCHASE
|
0 is e7 from 01 to // MAYBE SLOT IN PURCHASE
|
||||||
@@ -3104,6 +3106,21 @@ struct EnvDamage2_Struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
//Bazaar Stuff
|
//Bazaar Stuff
|
||||||
|
enum RoF2BazaarTraderBuyerActions {
|
||||||
|
Zero = 0,
|
||||||
|
BeginTraderMode = 1,
|
||||||
|
EndTraderMode = 2,
|
||||||
|
PriceUpdate = 3,
|
||||||
|
EndTransaction = 4,
|
||||||
|
BazaarSearch = 7,
|
||||||
|
WelcomeMessage = 9,
|
||||||
|
BuyTraderItem = 10,
|
||||||
|
ListTraderItems = 11,
|
||||||
|
BazaarInspect = 18,
|
||||||
|
ClickTrader = 28,
|
||||||
|
ItemMove = 19,
|
||||||
|
ReconcileItems = 20
|
||||||
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
BazaarTrader_StartTraderMode = 1,
|
BazaarTrader_StartTraderMode = 1,
|
||||||
@@ -3134,34 +3151,51 @@ struct BazaarWindowStart_Struct {
|
|||||||
uint16 Unknown002;
|
uint16 Unknown002;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct BazaarDeliveryCost_Struct {
|
||||||
|
uint32 action;
|
||||||
|
uint32 voucher_delivery_cost;
|
||||||
|
float parcel_deliver_cost; //percentage of item cost
|
||||||
|
uint32 unknown_010;
|
||||||
|
};
|
||||||
|
|
||||||
struct BazaarWelcome_Struct {
|
struct BazaarWelcome_Struct {
|
||||||
uint32 Code;
|
uint32 action;
|
||||||
uint32 EntityID;
|
uint32 unknown_004;
|
||||||
uint32 Traders;
|
uint32 num_of_traders;
|
||||||
uint32 Items;
|
uint32 num_of_items;
|
||||||
uint32 Traders2;
|
|
||||||
uint32 Items2;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct BazaarSearch_Struct {
|
struct BazaarSearch_Struct {
|
||||||
BazaarWindowStart_Struct Beginning;
|
/*000*/ uint32 action;
|
||||||
uint32 TraderID;
|
/*004*/ uint8 search_scope;//1 all traders 0 local traders
|
||||||
uint32 Class_;
|
/*005*/ uint8 unknown_005{0};
|
||||||
uint32 Race;
|
/*006*/ uint16 unknown_006{0};
|
||||||
uint32 ItemStat;
|
/*008*/ uint32 unknown_008{0};
|
||||||
uint32 Slot;
|
/*012*/ uint32 unknown_012{0};
|
||||||
uint32 Type;
|
/*016*/ uint32 trader_id;
|
||||||
char Name[64];
|
/*020*/ uint32 _class;
|
||||||
uint32 MinPrice;
|
/*024*/ uint32 race;
|
||||||
uint32 MaxPrice;
|
/*028*/ uint32 item_stat;
|
||||||
uint32 Minlevel;
|
/*032*/ uint32 slot;
|
||||||
uint32 MaxLlevel;
|
/*036*/ uint32 type;
|
||||||
|
/*040*/ char item_name[64];
|
||||||
|
/*104*/ uint32 min_cost;
|
||||||
|
/*108*/ uint32 max_cost;
|
||||||
|
/*112*/ uint32 min_level;
|
||||||
|
/*116*/ uint32 max_level;
|
||||||
|
/*120*/ uint32 max_results;
|
||||||
|
/*124*/ uint32 prestige;
|
||||||
|
/*128*/ uint32 augment;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct BazaarInspect_Struct {
|
struct BazaarInspect_Struct {
|
||||||
uint32 ItemID;
|
uint32 action;
|
||||||
uint32 Unknown004;
|
uint32 unknown_004;
|
||||||
char Name[64];
|
uint32 trader_id;
|
||||||
|
char serial_number[17];
|
||||||
|
char unknown_029[3];
|
||||||
|
uint32 item_id;
|
||||||
|
uint32 unknown_036;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NewBazaarInspect_Struct {
|
struct NewBazaarInspect_Struct {
|
||||||
@@ -3182,18 +3216,23 @@ struct BazaarReturnDone_Struct{
|
|||||||
uint32 Unknown016;
|
uint32 Unknown016;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct BazaarSearchResults_Struct {
|
struct BazaarSearchDetails_Struct { //24+name+17
|
||||||
/*000*/ BazaarWindowStart_Struct Beginning;
|
/*014*/ uint32 trader_id;
|
||||||
/*004*/ uint32 SellerID;
|
/*018*/ char serial_num[17];
|
||||||
/*008*/ char SellerName[64];
|
/*022*/ uint32 cost;
|
||||||
/*072*/ uint32 NumItems;
|
/*026*/ uint32 quanity;
|
||||||
/*076*/ uint32 ItemID;
|
/*030*/ uint32 id;
|
||||||
/*080*/ uint32 SerialNumber;
|
/*034*/ uint32 icon;
|
||||||
/*084*/ uint32 Unknown084;
|
/*038*/ char name[1];
|
||||||
/*088*/ char ItemName[64];
|
/*039*/ uint32 stat;
|
||||||
/*152*/ uint32 Cost;
|
};
|
||||||
/*156*/ uint32 ItemStat;
|
|
||||||
/*160*/
|
struct BazaarSearchResults_Struct { //14
|
||||||
|
/*000*/ uint32 unknown000;
|
||||||
|
/*004*/ uint16 zone_id;
|
||||||
|
/*006*/ uint32 entity_id;
|
||||||
|
/*010*/ uint32 num_items;
|
||||||
|
/*014*/ BazaarSearchDetails_Struct items[];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ServerSideFilters_Struct {
|
struct ServerSideFilters_Struct {
|
||||||
@@ -3396,21 +3435,26 @@ struct WhoAllPlayerPart4 {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct TraderItemSerial_Struct {
|
struct TraderItemSerial_Struct {
|
||||||
char SerialNumber[17];
|
char serial_number[17];
|
||||||
uint8 Unknown18;
|
uint8 unknown_018;
|
||||||
|
|
||||||
|
void operator=(uint32 a) {
|
||||||
|
auto _tmp = fmt::format("{:016}", a);
|
||||||
|
strn0cpy(this->serial_number, _tmp.c_str(), sizeof(this->serial_number));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Trader_Struct {
|
struct BeginTrader_Struct {
|
||||||
/*0000*/ uint32 Code;
|
/*0000*/ uint32 action;
|
||||||
/*0004*/ TraderItemSerial_Struct items[200];
|
/*0004*/ TraderItemSerial_Struct items[200];
|
||||||
/*3604*/ uint32 ItemCost[200];
|
/*3604*/ uint32 item_cost[200];
|
||||||
/*4404*/
|
/*4404*/
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ClickTrader_Struct {
|
struct ClickTrader_Struct {
|
||||||
/*0000*/ uint32 Code;
|
/*0000*/ uint32 action;
|
||||||
/*0004*/ TraderItemSerial_Struct items[200];
|
/*0004*/ TraderItemSerial_Struct items[200];
|
||||||
/*3604*/ uint32 ItemCost[200];
|
/*3604*/ uint32 item_cost[200];
|
||||||
/*4404*/
|
/*4404*/
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -3419,69 +3463,57 @@ struct GetItems_Struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct BecomeTrader_Struct {
|
struct BecomeTrader_Struct {
|
||||||
uint32 id;
|
uint32 entity_id;
|
||||||
uint32 code;
|
uint32 action;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct BazaarWindowRemoveTrader_Struct {
|
||||||
|
uint32 action;
|
||||||
|
uint32 trader_id;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct TraderPriceUpdate_Struct {
|
||||||
|
uint32 action;
|
||||||
|
char serial_number[17];
|
||||||
|
char unknown_021[3];
|
||||||
|
uint32 unknown_024;
|
||||||
|
uint32 new_price;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Trader_ShowItems_Struct {
|
struct Trader_ShowItems_Struct {
|
||||||
/*000*/ uint32 Code;
|
/*000*/ uint32 action;
|
||||||
/*004*/ uint16 TraderID;
|
/*004*/ uint32 entity_id;
|
||||||
/*008*/ uint32 Unknown08;
|
/*008*/ uint32 unknown_008;
|
||||||
/*012*/
|
/*012*/
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Trader_ShowItems_Struct_WIP {
|
|
||||||
/*000*/ uint32 Code;
|
|
||||||
/*004*/ char SerialNumber[17];
|
|
||||||
/*021*/ uint8 Unknown21;
|
|
||||||
/*022*/ uint16 TraderID;
|
|
||||||
/*026*/ uint32 Stacksize;
|
|
||||||
/*030*/ uint32 Price;
|
|
||||||
/*032*/
|
|
||||||
};
|
|
||||||
|
|
||||||
struct TraderStatus_Struct {
|
struct TraderStatus_Struct {
|
||||||
/*000*/ uint32 Code;
|
/*000*/ uint32 action;
|
||||||
/*004*/ uint32 Uknown04;
|
/*004*/ uint32 sub_action;
|
||||||
/*008*/ uint32 Uknown08;
|
/*008*/ uint32 uknown_008;
|
||||||
/*012*/
|
/*012*/
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TraderBuy_Struct {
|
struct TraderBuy_Struct {
|
||||||
/*000*/ uint32 Action;
|
/*000*/ uint32 action;
|
||||||
/*004*/ uint32 Unknown004;
|
/*004*/ uint32 method;
|
||||||
/*008*/ uint32 Unknown008;
|
/*008*/ uint32 sub_action;
|
||||||
/*012*/ uint32 Unknown012;
|
/*012*/ uint32 unknown_012;
|
||||||
/*016*/ uint32 TraderID;
|
/*016*/ uint32 trader_id;
|
||||||
/*020*/ char BuyerName[64];
|
/*020*/ char buyer_name[64];
|
||||||
/*084*/ char SellerName[64];
|
/*084*/ char seller_name[64];
|
||||||
/*148*/ char Unknown148[32];
|
/*148*/ char unknown_148[32];
|
||||||
/*180*/ char ItemName[64];
|
/*180*/ char item_name[64];
|
||||||
/*244*/ char SerialNumber[16];
|
/*244*/ char serial_number[17];
|
||||||
/*260*/ uint32 Unknown076;
|
/*261*/ char unknown_261[3];
|
||||||
/*264*/ uint32 ItemID;
|
/*264*/ uint32 item_id;
|
||||||
/*268*/ uint32 Price;
|
/*268*/ uint32 price;
|
||||||
/*272*/ uint32 AlreadySold;
|
/*272*/ uint32 already_sold;
|
||||||
/*276*/ uint32 Unknown276;
|
/*276*/ uint32 unknown_276;
|
||||||
/*280*/ uint32 Quantity;
|
/*280*/ uint32 quantity;
|
||||||
/*284*/
|
/*284*/
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TraderBuy_Struct_OLD {
|
|
||||||
/*000*/ uint32 Action;
|
|
||||||
/*004*/ uint32 Unknown004;
|
|
||||||
/*008*/ uint32 Price;
|
|
||||||
/*012*/ uint32 Unknown008; // Probably high order bits of a 64 bit price.
|
|
||||||
/*016*/ uint32 TraderID;
|
|
||||||
/*020*/ char ItemName[64];
|
|
||||||
/*084*/ uint32 Unknown076;
|
|
||||||
/*088*/ uint32 ItemID;
|
|
||||||
/*092*/ uint32 AlreadySold;
|
|
||||||
/*096*/ uint32 Quantity;
|
|
||||||
/*100*/ uint32 Unknown092;
|
|
||||||
/*104*/
|
|
||||||
};
|
|
||||||
|
|
||||||
struct TraderItemUpdate_Struct{
|
struct TraderItemUpdate_Struct{
|
||||||
uint32 unknown0;
|
uint32 unknown0;
|
||||||
uint32 traderid;
|
uint32 traderid;
|
||||||
@@ -3500,15 +3532,15 @@ struct MoneyUpdate_Struct{
|
|||||||
struct TraderDelItem_Struct{
|
struct TraderDelItem_Struct{
|
||||||
/*000*/ uint32 Unknown000;
|
/*000*/ uint32 Unknown000;
|
||||||
/*004*/ uint32 TraderID;
|
/*004*/ uint32 TraderID;
|
||||||
/*008*/ char SerialNumber[16];
|
/*008*/ char SerialNumber[17];
|
||||||
/*024*/ uint32 Unknown012;
|
/*024*/ uint32 Unknown012;
|
||||||
/*028*/
|
/*028*/
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TraderClick_Struct{
|
struct TraderClick_Struct{
|
||||||
/*000*/ uint32 Code;
|
/*000*/ uint32 action;
|
||||||
/*004*/ uint32 TraderID;
|
/*004*/ uint32 trader_id;
|
||||||
/*008*/ uint32 Approval;
|
/*008*/ uint32 unknown_008;
|
||||||
/*012*/
|
/*012*/
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -4583,7 +4615,7 @@ struct ItemSerializationHeader
|
|||||||
/*036*/ uint32 merchant_slot; // 1 if not a merchant item
|
/*036*/ uint32 merchant_slot; // 1 if not a merchant item
|
||||||
/*040*/ uint32 scaled_value; // 0
|
/*040*/ uint32 scaled_value; // 0
|
||||||
/*044*/ uint32 instance_id; // unique instance id if not merchant item, else is merchant slot
|
/*044*/ uint32 instance_id; // unique instance id if not merchant item, else is merchant slot
|
||||||
/*048*/ uint32 unknown028; //0
|
/*048*/ uint32 parcel_item_id;
|
||||||
/*052*/ uint32 last_cast_time; // Unix Time from PP of last cast for this recast type if recast delay > 0
|
/*052*/ uint32 last_cast_time; // Unix Time from PP of last cast for this recast type if recast delay > 0
|
||||||
/*056*/ uint32 charges; // Total Charges an item has (-1 for unlimited)
|
/*056*/ uint32 charges; // Total Charges an item has (-1 for unlimited)
|
||||||
/*060*/ uint32 inst_nodrop; // 1 if the item is no drop (attuned items)
|
/*060*/ uint32 inst_nodrop; // 1 if the item is no drop (attuned items)
|
||||||
@@ -5261,6 +5293,18 @@ struct Checksum_Struct {
|
|||||||
uint8_t data[2048];
|
uint8_t data[2048];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct Parcel_Struct
|
||||||
|
{
|
||||||
|
/*000*/ uint32 npc_id;
|
||||||
|
/*004*/ TypelessInventorySlot_Struct inventory_slot;
|
||||||
|
/*012*/ uint32 quantity;
|
||||||
|
/*016*/ uint32 money_flag;
|
||||||
|
/*020*/ char send_to[64];
|
||||||
|
/*084*/ char note[128];
|
||||||
|
/*212*/ uint32 unknown_212;
|
||||||
|
/*216*/ uint32 unknown_216;
|
||||||
|
/*220*/ uint32 unknown_220;
|
||||||
|
};
|
||||||
}; /*structs*/
|
}; /*structs*/
|
||||||
|
|
||||||
}; /*RoF2*/
|
}; /*RoF2*/
|
||||||
|
|||||||
@@ -101,7 +101,6 @@ E(OP_SendZonepoints)
|
|||||||
E(OP_SetGuildRank)
|
E(OP_SetGuildRank)
|
||||||
E(OP_ShopPlayerBuy)
|
E(OP_ShopPlayerBuy)
|
||||||
E(OP_ShopPlayerSell)
|
E(OP_ShopPlayerSell)
|
||||||
E(OP_ShopRequest)
|
|
||||||
E(OP_SkillUpdate)
|
E(OP_SkillUpdate)
|
||||||
E(OP_SomeItemPacketMaybe)
|
E(OP_SomeItemPacketMaybe)
|
||||||
E(OP_SpawnAppearance)
|
E(OP_SpawnAppearance)
|
||||||
@@ -183,7 +182,6 @@ D(OP_Save)
|
|||||||
D(OP_SetServerFilter)
|
D(OP_SetServerFilter)
|
||||||
D(OP_ShopPlayerBuy)
|
D(OP_ShopPlayerBuy)
|
||||||
D(OP_ShopPlayerSell)
|
D(OP_ShopPlayerSell)
|
||||||
D(OP_ShopRequest)
|
|
||||||
D(OP_Trader)
|
D(OP_Trader)
|
||||||
D(OP_TraderBuy)
|
D(OP_TraderBuy)
|
||||||
D(OP_TradeSkillCombine)
|
D(OP_TradeSkillCombine)
|
||||||
|
|||||||
@@ -2200,15 +2200,17 @@ struct TimeOfDay_Struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Darvik: shopkeeper structs
|
// Darvik: shopkeeper structs
|
||||||
struct Merchant_Click_Struct {
|
struct MerchantClick_Struct
|
||||||
/*000*/ uint32 npcid; // Merchant NPC's entity id
|
{
|
||||||
/*004*/ uint32 playerid;
|
/*000*/ uint32 npc_id; // Merchant NPC's entity id
|
||||||
|
/*004*/ uint32 player_id;
|
||||||
/*008*/ uint32 command; // 1=open, 0=cancel/close
|
/*008*/ uint32 command; // 1=open, 0=cancel/close
|
||||||
/*012*/ float rate; // cost multiplier, dosent work anymore
|
/*012*/ float rate; // cost multiplier, dosent work anymore
|
||||||
/*016*/ int32 unknown01; // Seen 3 from Server or -1 from Client
|
/*016*/ int32 tab_display; // bitmask b000 none, b001 Purchase/Sell, b010 Recover, b100 Parcels
|
||||||
/*020*/ int32 unknown02; // Seen 2592000 from Server or -1 from Client
|
/*020*/ int32 unknown020; // Seen 2592000 from Server or -1 from Client
|
||||||
/*024*/
|
/*024*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Unknowns:
|
Unknowns:
|
||||||
0 is e7 from 01 to // MAYBE SLOT IN PURCHASE
|
0 is e7 from 01 to // MAYBE SLOT IN PURCHASE
|
||||||
@@ -3374,17 +3376,17 @@ struct TraderStatus_Struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct TraderBuy_Struct {
|
struct TraderBuy_Struct {
|
||||||
/*000*/ uint32 Action;
|
/*000*/ uint32 action;
|
||||||
/*004*/ uint32 Unknown004;
|
/*004*/ uint32 unknown_004;
|
||||||
/*008*/ uint32 Price;
|
/*008*/ uint32 price;
|
||||||
/*012*/ uint32 Unknown008; // Probably high order bits of a 64 bit price.
|
/*012*/ uint32 unknown_008; // Probably high order bits of a 64 bit price.
|
||||||
/*016*/ uint32 TraderID;
|
/*016*/ uint32 trader_id;
|
||||||
/*020*/ char ItemName[64];
|
/*020*/ char item_name[64];
|
||||||
/*084*/ uint32 Unknown076;
|
/*084*/ uint32 unknown_076;
|
||||||
/*088*/ uint32 ItemID;
|
/*088*/ uint32 item_id;
|
||||||
/*092*/ uint32 AlreadySold;
|
/*092*/ uint32 already_sold;
|
||||||
/*096*/ uint32 Quantity;
|
/*096*/ uint32 quantity;
|
||||||
/*100*/ uint32 Unknown092;
|
/*100*/ uint32 unknown_092;
|
||||||
/*104*/
|
/*104*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+41
-13
@@ -2026,6 +2026,19 @@ namespace SoD
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ENCODE(OP_ShopRequest)
|
||||||
|
{
|
||||||
|
ENCODE_LENGTH_EXACT(MerchantClick_Struct);
|
||||||
|
SETUP_DIRECT_ENCODE(MerchantClick_Struct, structs::MerchantClick_Struct);
|
||||||
|
|
||||||
|
OUT(npc_id);
|
||||||
|
OUT(player_id);
|
||||||
|
OUT(command);
|
||||||
|
OUT(rate);
|
||||||
|
|
||||||
|
FINISH_ENCODE();
|
||||||
|
}
|
||||||
|
|
||||||
ENCODE(OP_SomeItemPacketMaybe)
|
ENCODE(OP_SomeItemPacketMaybe)
|
||||||
{
|
{
|
||||||
// This Opcode is not named very well. It is used for the animation of arrows leaving the player's bow
|
// This Opcode is not named very well. It is used for the animation of arrows leaving the player's bow
|
||||||
@@ -2273,13 +2286,13 @@ namespace SoD
|
|||||||
ENCODE_LENGTH_EXACT(TraderBuy_Struct);
|
ENCODE_LENGTH_EXACT(TraderBuy_Struct);
|
||||||
SETUP_DIRECT_ENCODE(TraderBuy_Struct, structs::TraderBuy_Struct);
|
SETUP_DIRECT_ENCODE(TraderBuy_Struct, structs::TraderBuy_Struct);
|
||||||
|
|
||||||
OUT(Action);
|
OUT(action);
|
||||||
OUT(Price);
|
OUT(price);
|
||||||
OUT(TraderID);
|
OUT(trader_id);
|
||||||
memcpy(eq->ItemName, emu->ItemName, sizeof(eq->ItemName));
|
memcpy(eq->item_name, emu->item_name, sizeof(eq->item_name));
|
||||||
OUT(ItemID);
|
OUT(item_id);
|
||||||
OUT(Quantity);
|
OUT(quantity);
|
||||||
OUT(AlreadySold);
|
OUT(already_sold);
|
||||||
|
|
||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
@@ -3483,18 +3496,33 @@ namespace SoD
|
|||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DECODE(OP_ShopRequest)
|
||||||
|
{
|
||||||
|
DECODE_LENGTH_EXACT(structs::MerchantClick_Struct);
|
||||||
|
SETUP_DIRECT_DECODE(MerchantClick_Struct, structs::MerchantClick_Struct);
|
||||||
|
|
||||||
|
IN(npc_id);
|
||||||
|
IN(player_id);
|
||||||
|
IN(command);
|
||||||
|
IN(rate);
|
||||||
|
emu->tab_display = 0;
|
||||||
|
emu->unknown020 = 0;
|
||||||
|
|
||||||
|
FINISH_DIRECT_DECODE();
|
||||||
|
}
|
||||||
|
|
||||||
DECODE(OP_TraderBuy)
|
DECODE(OP_TraderBuy)
|
||||||
{
|
{
|
||||||
DECODE_LENGTH_EXACT(structs::TraderBuy_Struct);
|
DECODE_LENGTH_EXACT(structs::TraderBuy_Struct);
|
||||||
SETUP_DIRECT_DECODE(TraderBuy_Struct, structs::TraderBuy_Struct);
|
SETUP_DIRECT_DECODE(TraderBuy_Struct, structs::TraderBuy_Struct);
|
||||||
MEMSET_IN(TraderBuy_Struct);
|
MEMSET_IN(TraderBuy_Struct);
|
||||||
|
|
||||||
IN(Action);
|
IN(action);
|
||||||
IN(Price);
|
IN(price);
|
||||||
IN(TraderID);
|
IN(trader_id);
|
||||||
memcpy(emu->ItemName, eq->ItemName, sizeof(emu->ItemName));
|
memcpy(emu->item_name, eq->item_name, sizeof(emu->item_name));
|
||||||
IN(ItemID);
|
IN(item_id);
|
||||||
IN(Quantity);
|
IN(quantity);
|
||||||
|
|
||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ E(OP_SendCharInfo)
|
|||||||
E(OP_SendZonepoints)
|
E(OP_SendZonepoints)
|
||||||
E(OP_ShopPlayerBuy)
|
E(OP_ShopPlayerBuy)
|
||||||
E(OP_ShopPlayerSell)
|
E(OP_ShopPlayerSell)
|
||||||
|
E(OP_ShopRequest)
|
||||||
E(OP_SomeItemPacketMaybe)
|
E(OP_SomeItemPacketMaybe)
|
||||||
E(OP_SpawnDoor)
|
E(OP_SpawnDoor)
|
||||||
E(OP_SpecialMesg)
|
E(OP_SpecialMesg)
|
||||||
@@ -141,6 +142,7 @@ D(OP_Save)
|
|||||||
D(OP_SetServerFilter)
|
D(OP_SetServerFilter)
|
||||||
D(OP_ShopPlayerBuy)
|
D(OP_ShopPlayerBuy)
|
||||||
D(OP_ShopPlayerSell)
|
D(OP_ShopPlayerSell)
|
||||||
|
D(OP_ShopRequest)
|
||||||
D(OP_TraderBuy)
|
D(OP_TraderBuy)
|
||||||
D(OP_TradeSkillCombine)
|
D(OP_TradeSkillCombine)
|
||||||
D(OP_TributeItem)
|
D(OP_TributeItem)
|
||||||
|
|||||||
@@ -1845,12 +1845,16 @@ struct TimeOfDay_Struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Darvik: shopkeeper structs
|
// Darvik: shopkeeper structs
|
||||||
struct Merchant_Click_Struct {
|
struct MerchantClick_Struct
|
||||||
/*000*/ uint32 npcid; // Merchant NPC's entity id
|
{
|
||||||
/*004*/ uint32 playerid;
|
/*000*/ uint32 npc_id; // Merchant NPC's entity id
|
||||||
|
/*004*/ uint32 player_id;
|
||||||
/*008*/ uint32 command; // 1=open, 0=cancel/close
|
/*008*/ uint32 command; // 1=open, 0=cancel/close
|
||||||
/*012*/ float rate; // cost multiplier, dosent work anymore
|
/*012*/ float rate; // cost multiplier, dosent work anymore
|
||||||
|
/*016*/ int32 tab_display; // bitmask b000 none, b001 Purchase/Sell, b010 Recover, b100 Parcels
|
||||||
|
/*020*/ int32 unknown020; // Seen 2592000 from Server or -1 from Client
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Unknowns:
|
Unknowns:
|
||||||
0 is e7 from 01 to // MAYBE SLOT IN PURCHASE
|
0 is e7 from 01 to // MAYBE SLOT IN PURCHASE
|
||||||
@@ -2875,20 +2879,21 @@ struct Trader_ShowItems_Struct{
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct TraderBuy_Struct {
|
struct TraderBuy_Struct {
|
||||||
/*000*/ uint32 Action;
|
/*000*/ uint32 action;
|
||||||
/*004*/ uint32 Unknown004;
|
/*004*/ uint32 unknown_004;
|
||||||
/*008*/ uint32 Price;
|
/*008*/ uint32 price;
|
||||||
/*012*/ uint32 Unknown008; // Probably high order bits of a 64 bit price.
|
/*012*/ uint32 unknown_008; // Probably high order bits of a 64 bit price.
|
||||||
/*016*/ uint32 TraderID;
|
/*016*/ uint32 trader_id;
|
||||||
/*020*/ char ItemName[64];
|
/*020*/ char item_name[64];
|
||||||
/*084*/ uint32 Unknown076;
|
/*084*/ uint32 unknown_076;
|
||||||
/*088*/ uint32 ItemID;
|
/*088*/ uint32 item_id;
|
||||||
/*092*/ uint32 AlreadySold;
|
/*092*/ uint32 already_sold;
|
||||||
/*096*/ uint32 Quantity;
|
/*096*/ uint32 quantity;
|
||||||
/*100*/ uint32 Unknown092;
|
/*100*/ uint32 unknown_092;
|
||||||
/*104*/
|
/*104*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct TraderItemUpdate_Struct{
|
struct TraderItemUpdate_Struct{
|
||||||
uint32 unknown0;
|
uint32 unknown0;
|
||||||
uint32 traderid;
|
uint32 traderid;
|
||||||
|
|||||||
+43
-15
@@ -270,8 +270,8 @@ namespace SoF
|
|||||||
ENCODE_LENGTH_EXACT(BecomeTrader_Struct);
|
ENCODE_LENGTH_EXACT(BecomeTrader_Struct);
|
||||||
SETUP_DIRECT_ENCODE(BecomeTrader_Struct, structs::BecomeTrader_Struct);
|
SETUP_DIRECT_ENCODE(BecomeTrader_Struct, structs::BecomeTrader_Struct);
|
||||||
|
|
||||||
OUT(ID);
|
OUT(trader_id);
|
||||||
OUT(Code);
|
OUT(action);
|
||||||
|
|
||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
@@ -1683,6 +1683,19 @@ namespace SoF
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ENCODE(OP_ShopRequest)
|
||||||
|
{
|
||||||
|
ENCODE_LENGTH_EXACT(MerchantClick_Struct);
|
||||||
|
SETUP_DIRECT_ENCODE(MerchantClick_Struct, structs::MerchantClick_Struct);
|
||||||
|
|
||||||
|
OUT(npc_id);
|
||||||
|
OUT(player_id);
|
||||||
|
OUT(command);
|
||||||
|
OUT(rate);
|
||||||
|
|
||||||
|
FINISH_ENCODE();
|
||||||
|
}
|
||||||
|
|
||||||
ENCODE(OP_SomeItemPacketMaybe)
|
ENCODE(OP_SomeItemPacketMaybe)
|
||||||
{
|
{
|
||||||
// This Opcode is not named very well. It is used for the animation of arrows leaving the player's bow
|
// This Opcode is not named very well. It is used for the animation of arrows leaving the player's bow
|
||||||
@@ -1889,13 +1902,13 @@ namespace SoF
|
|||||||
ENCODE_LENGTH_EXACT(TraderBuy_Struct);
|
ENCODE_LENGTH_EXACT(TraderBuy_Struct);
|
||||||
SETUP_DIRECT_ENCODE(TraderBuy_Struct, structs::TraderBuy_Struct);
|
SETUP_DIRECT_ENCODE(TraderBuy_Struct, structs::TraderBuy_Struct);
|
||||||
|
|
||||||
OUT(Action);
|
OUT(action);
|
||||||
OUT(Price);
|
OUT(price);
|
||||||
OUT(TraderID);
|
OUT(trader_id);
|
||||||
memcpy(eq->ItemName, emu->ItemName, sizeof(eq->ItemName));
|
memcpy(eq->item_name, emu->item_name, sizeof(eq->item_name));
|
||||||
OUT(ItemID);
|
OUT(item_id);
|
||||||
OUT(Quantity);
|
OUT(quantity);
|
||||||
OUT(AlreadySold);
|
OUT(already_sold);
|
||||||
|
|
||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
@@ -2874,18 +2887,33 @@ namespace SoF
|
|||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DECODE(OP_ShopRequest)
|
||||||
|
{
|
||||||
|
DECODE_LENGTH_EXACT(structs::MerchantClick_Struct);
|
||||||
|
SETUP_DIRECT_DECODE(MerchantClick_Struct, structs::MerchantClick_Struct);
|
||||||
|
|
||||||
|
IN(npc_id);
|
||||||
|
IN(player_id);
|
||||||
|
IN(command);
|
||||||
|
IN(rate);
|
||||||
|
emu->tab_display = 0;
|
||||||
|
emu->unknown020 = 0;
|
||||||
|
|
||||||
|
FINISH_DIRECT_DECODE();
|
||||||
|
}
|
||||||
|
|
||||||
DECODE(OP_TraderBuy)
|
DECODE(OP_TraderBuy)
|
||||||
{
|
{
|
||||||
DECODE_LENGTH_EXACT(structs::TraderBuy_Struct);
|
DECODE_LENGTH_EXACT(structs::TraderBuy_Struct);
|
||||||
SETUP_DIRECT_DECODE(TraderBuy_Struct, structs::TraderBuy_Struct);
|
SETUP_DIRECT_DECODE(TraderBuy_Struct, structs::TraderBuy_Struct);
|
||||||
MEMSET_IN(TraderBuy_Struct);
|
MEMSET_IN(TraderBuy_Struct);
|
||||||
|
|
||||||
IN(Action);
|
IN(action);
|
||||||
IN(Price);
|
IN(price);
|
||||||
IN(TraderID);
|
IN(trader_id);
|
||||||
memcpy(emu->ItemName, eq->ItemName, sizeof(emu->ItemName));
|
memcpy(emu->item_name, eq->item_name, sizeof(emu->item_name));
|
||||||
IN(ItemID);
|
IN(item_id);
|
||||||
IN(Quantity);
|
IN(quantity);
|
||||||
|
|
||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ E(OP_SendAATable)
|
|||||||
E(OP_SendCharInfo)
|
E(OP_SendCharInfo)
|
||||||
E(OP_SendZonepoints)
|
E(OP_SendZonepoints)
|
||||||
E(OP_ShopPlayerSell)
|
E(OP_ShopPlayerSell)
|
||||||
|
E(OP_ShopRequest)
|
||||||
E(OP_SomeItemPacketMaybe)
|
E(OP_SomeItemPacketMaybe)
|
||||||
E(OP_SpawnDoor)
|
E(OP_SpawnDoor)
|
||||||
E(OP_SpecialMesg)
|
E(OP_SpecialMesg)
|
||||||
@@ -128,6 +129,7 @@ D(OP_ReadBook)
|
|||||||
D(OP_Save)
|
D(OP_Save)
|
||||||
D(OP_SetServerFilter)
|
D(OP_SetServerFilter)
|
||||||
D(OP_ShopPlayerSell)
|
D(OP_ShopPlayerSell)
|
||||||
|
D(OP_ShopRequest)
|
||||||
D(OP_TraderBuy)
|
D(OP_TraderBuy)
|
||||||
D(OP_TradeSkillCombine)
|
D(OP_TradeSkillCombine)
|
||||||
D(OP_TributeItem)
|
D(OP_TributeItem)
|
||||||
|
|||||||
@@ -1859,12 +1859,16 @@ struct TimeOfDay_Struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Darvik: shopkeeper structs
|
// Darvik: shopkeeper structs
|
||||||
struct Merchant_Click_Struct {
|
struct MerchantClick_Struct
|
||||||
/*000*/ uint32 npcid; // Merchant NPC's entity id
|
{
|
||||||
/*004*/ uint32 playerid;
|
/*000*/ uint32 npc_id; // Merchant NPC's entity id
|
||||||
|
/*004*/ uint32 player_id;
|
||||||
/*008*/ uint32 command; // 1=open, 0=cancel/close
|
/*008*/ uint32 command; // 1=open, 0=cancel/close
|
||||||
/*012*/ float rate; // cost multiplier, dosent work anymore
|
/*012*/ float rate; // cost multiplier, dosent work anymore
|
||||||
|
/*016*/ int32 tab_display; // bitmask b000 none, b001 Purchase/Sell, b010 Recover, b100 Parcels
|
||||||
|
/*020*/ int32 unknown020; // Seen 2592000 from Server or -1 from Client
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Unknowns:
|
Unknowns:
|
||||||
0 is e7 from 01 to // MAYBE SLOT IN PURCHASE
|
0 is e7 from 01 to // MAYBE SLOT IN PURCHASE
|
||||||
@@ -2767,8 +2771,8 @@ struct GetItems_Struct{
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct BecomeTrader_Struct{
|
struct BecomeTrader_Struct{
|
||||||
uint32 ID;
|
uint32 trader_id;
|
||||||
uint32 Code;
|
uint32 action;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Trader_ShowItems_Struct{
|
struct Trader_ShowItems_Struct{
|
||||||
@@ -2778,15 +2782,15 @@ struct Trader_ShowItems_Struct{
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct TraderBuy_Struct {
|
struct TraderBuy_Struct {
|
||||||
/*000*/ uint32 Action;
|
/*000*/ uint32 action;
|
||||||
/*004*/ uint32 Price;
|
/*004*/ uint32 price;
|
||||||
/*008*/ uint32 TraderID;
|
/*008*/ uint32 trader_id;
|
||||||
/*012*/ char ItemName[64];
|
/*012*/ char item_name[64];
|
||||||
/*076*/ uint32 Unknown076;
|
/*076*/ uint32 unknown_076;
|
||||||
/*080*/ uint32 ItemID;
|
/*080*/ uint32 item_id;
|
||||||
/*084*/ uint32 AlreadySold;
|
/*084*/ uint32 already_sold;
|
||||||
/*088*/ uint32 Quantity;
|
/*088*/ uint32 quantity;
|
||||||
/*092*/ uint32 Unknown092;
|
/*092*/ uint32 unknown_092;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TraderItemUpdate_Struct{
|
struct TraderItemUpdate_Struct{
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
eq_struct *eq = (eq_struct *) __packet->pBuffer; \
|
eq_struct *eq = (eq_struct *) __packet->pBuffer; \
|
||||||
|
|
||||||
#define ALLOC_LEN_ENCODE(len) \
|
#define ALLOC_LEN_ENCODE(len) \
|
||||||
__packet->pBuffer = new unsigned char[len]; \
|
__packet->pBuffer = new unsigned char[len] {}; \
|
||||||
__packet->size = len; \
|
__packet->size = len; \
|
||||||
memset(__packet->pBuffer, 0, len); \
|
memset(__packet->pBuffer, 0, len); \
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@
|
|||||||
#define SETUP_DIRECT_DECODE(emu_struct, eq_struct) \
|
#define SETUP_DIRECT_DECODE(emu_struct, eq_struct) \
|
||||||
unsigned char *__eq_buffer = __packet->pBuffer; \
|
unsigned char *__eq_buffer = __packet->pBuffer; \
|
||||||
__packet->size = sizeof(emu_struct); \
|
__packet->size = sizeof(emu_struct); \
|
||||||
__packet->pBuffer = new unsigned char[__packet->size]; \
|
__packet->pBuffer = new unsigned char[__packet->size] {}; \
|
||||||
emu_struct *emu = (emu_struct *) __packet->pBuffer; \
|
emu_struct *emu = (emu_struct *) __packet->pBuffer; \
|
||||||
eq_struct *eq = (eq_struct *) __eq_buffer;
|
eq_struct *eq = (eq_struct *) __eq_buffer;
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@
|
|||||||
eq_struct* in = (eq_struct*)__packet->pBuffer; \
|
eq_struct* in = (eq_struct*)__packet->pBuffer; \
|
||||||
auto size = strlen(in->var_field); \
|
auto size = strlen(in->var_field); \
|
||||||
__packet->size = sizeof(emu_struct) + size + 1; \
|
__packet->size = sizeof(emu_struct) + size + 1; \
|
||||||
__packet->pBuffer = new unsigned char[__packet->size]; \
|
__packet->pBuffer = new unsigned char[__packet->size] {}; \
|
||||||
emu_struct *emu = (emu_struct *) __packet->pBuffer; \
|
emu_struct *emu = (emu_struct *) __packet->pBuffer; \
|
||||||
eq_struct *eq = (eq_struct *) __eq_buffer;
|
eq_struct *eq = (eq_struct *) __eq_buffer;
|
||||||
|
|
||||||
|
|||||||
+437
-58
@@ -32,6 +32,7 @@
|
|||||||
#include "../strings.h"
|
#include "../strings.h"
|
||||||
#include "../item_instance.h"
|
#include "../item_instance.h"
|
||||||
#include "titanium_structs.h"
|
#include "titanium_structs.h"
|
||||||
|
#include "../rulesys.h"
|
||||||
#include "../path_manager.h"
|
#include "../path_manager.h"
|
||||||
#include "../raid.h"
|
#include "../raid.h"
|
||||||
#include "../guilds.h"
|
#include "../guilds.h"
|
||||||
@@ -197,64 +198,135 @@ namespace Titanium
|
|||||||
|
|
||||||
ENCODE(OP_BazaarSearch)
|
ENCODE(OP_BazaarSearch)
|
||||||
{
|
{
|
||||||
if (((*p)->size == sizeof(BazaarReturnDone_Struct)) || ((*p)->size == sizeof(BazaarWelcome_Struct))) {
|
|
||||||
|
|
||||||
EQApplicationPacket *in = *p;
|
|
||||||
*p = nullptr;
|
|
||||||
dest->FastQueuePacket(&in, ack_req);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//consume the packet
|
|
||||||
EQApplicationPacket *in = *p;
|
EQApplicationPacket *in = *p;
|
||||||
*p = nullptr;
|
*p = nullptr;
|
||||||
|
|
||||||
//store away the emu struct
|
uint32 action = *(uint32 *)in->pBuffer;
|
||||||
unsigned char *__emu_buffer = in->pBuffer;
|
|
||||||
BazaarSearchResults_Struct *emu = (BazaarSearchResults_Struct *)__emu_buffer;
|
|
||||||
|
|
||||||
//determine and verify length
|
switch (action) {
|
||||||
int entrycount = in->size / sizeof(BazaarSearchResults_Struct);
|
case BazaarSearch: {
|
||||||
if (entrycount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) {
|
LogTrading(
|
||||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
"Encode OP_BazaarSearch(Ti) BazaarSearch action <green>[{}]",
|
||||||
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
|
action
|
||||||
delete in;
|
);
|
||||||
return;
|
std::vector<BazaarSearchResultsFromDB_Struct> results {};
|
||||||
|
auto bsms = (BazaarSearchMessaging_Struct *)in->pBuffer;
|
||||||
|
EQ::Util::MemoryStreamReader ss(
|
||||||
|
reinterpret_cast<char *>(bsms->payload),
|
||||||
|
in->size - sizeof(BazaarSearchMessaging_Struct)
|
||||||
|
);
|
||||||
|
cereal::BinaryInputArchive ar(ss);
|
||||||
|
ar(results);
|
||||||
|
|
||||||
|
auto size = results.size() * sizeof(structs::BazaarSearchResults_Struct);
|
||||||
|
auto buffer = new uchar[size];
|
||||||
|
uchar *bufptr = buffer;
|
||||||
|
memset(buffer, 0, size);
|
||||||
|
|
||||||
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
VARSTRUCT_ENCODE_TYPE(uint32, bufptr, structs::TiBazaarTraderBuyerActions::BazaarSearch);
|
||||||
|
VARSTRUCT_ENCODE_TYPE(uint32, bufptr, row->trader_entity_id);
|
||||||
|
bufptr += 4;
|
||||||
|
VARSTRUCT_ENCODE_TYPE(int32, bufptr, row->item_id);
|
||||||
|
VARSTRUCT_ENCODE_TYPE(int32, bufptr, row->serial_number);
|
||||||
|
bufptr += 4;
|
||||||
|
if (row->stackable) {
|
||||||
|
strn0cpy(
|
||||||
|
reinterpret_cast<char *>(bufptr),
|
||||||
|
fmt::format("{}({})", row->item_name.c_str(), row->charges).c_str(),
|
||||||
|
64
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
strn0cpy(
|
||||||
|
reinterpret_cast<char *>(bufptr),
|
||||||
|
fmt::format("{}({})", row->item_name.c_str(), row->count).c_str(),
|
||||||
|
64
|
||||||
|
);
|
||||||
|
}
|
||||||
|
bufptr += 64;
|
||||||
|
VARSTRUCT_ENCODE_TYPE(uint32, bufptr, row->cost);
|
||||||
|
VARSTRUCT_ENCODE_TYPE(uint32, bufptr, row->item_stat);
|
||||||
}
|
}
|
||||||
|
|
||||||
//make the EQ struct.
|
auto outapp = new EQApplicationPacket(OP_BazaarSearch, size);
|
||||||
in->size = sizeof(structs::BazaarSearchResults_Struct)*entrycount;
|
memcpy(outapp->pBuffer, buffer, size);
|
||||||
in->pBuffer = new unsigned char[in->size];
|
dest->FastQueuePacket(&outapp);
|
||||||
structs::BazaarSearchResults_Struct *eq = (structs::BazaarSearchResults_Struct *) in->pBuffer;
|
|
||||||
|
|
||||||
//zero out the packet. We could avoid this memset by setting all fields (including unknowns) in the loop.
|
safe_delete(outapp);
|
||||||
memset(in->pBuffer, 0, in->size);
|
safe_delete_array(buffer);
|
||||||
|
safe_delete(in);
|
||||||
for (int i = 0; i < entrycount; i++, eq++, emu++) {
|
break;
|
||||||
eq->Beginning.Action = emu->Beginning.Action;
|
|
||||||
eq->Beginning.Unknown001 = emu->Beginning.Unknown001;
|
|
||||||
eq->Beginning.Unknown002 = emu->Beginning.Unknown002;
|
|
||||||
eq->NumItems = emu->NumItems;
|
|
||||||
eq->SerialNumber = emu->SerialNumber;
|
|
||||||
eq->SellerID = emu->SellerID;
|
|
||||||
eq->Cost = emu->Cost;
|
|
||||||
eq->ItemStat = emu->ItemStat;
|
|
||||||
strcpy(eq->ItemName, emu->ItemName);
|
|
||||||
}
|
}
|
||||||
|
case BazaarInspect:
|
||||||
delete[] __emu_buffer;
|
case WelcomeMessage: {
|
||||||
|
LogTrading(
|
||||||
|
"Encode OP_BazaarSearch(Ti) BazaarInspect/WelcomeMessage action <green>[{}]",
|
||||||
|
action
|
||||||
|
);
|
||||||
dest->FastQueuePacket(&in, ack_req);
|
dest->FastQueuePacket(&in, ack_req);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
LogTrading(
|
||||||
|
"Encode OP_BazaarSearch(Ti) unhandled action <red>[{}]",
|
||||||
|
action
|
||||||
|
);
|
||||||
|
dest->FastQueuePacket(&in, ack_req);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_BecomeTrader)
|
ENCODE(OP_BecomeTrader)
|
||||||
|
{
|
||||||
|
uint32 action = *(uint32 *)(*p)->pBuffer;
|
||||||
|
|
||||||
|
switch (action)
|
||||||
|
{
|
||||||
|
case TraderOff:
|
||||||
{
|
{
|
||||||
ENCODE_LENGTH_EXACT(BecomeTrader_Struct);
|
ENCODE_LENGTH_EXACT(BecomeTrader_Struct);
|
||||||
SETUP_DIRECT_ENCODE(BecomeTrader_Struct, structs::BecomeTrader_Struct);
|
SETUP_DIRECT_ENCODE(BecomeTrader_Struct, structs::BecomeTrader_Struct);
|
||||||
|
LogTrading(
|
||||||
OUT(ID);
|
"Encode OP_BecomeTrader(Ti) TraderOff action <green>[{}] entity_id <green>[{}] trader_name "
|
||||||
OUT(Code);
|
"<green>[{}]",
|
||||||
|
emu->action,
|
||||||
|
emu->entity_id,
|
||||||
|
emu->trader_name
|
||||||
|
);
|
||||||
|
eq->action = structs::TiBazaarTraderBuyerActions::Zero;
|
||||||
|
eq->entity_id = emu->entity_id;
|
||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case TraderOn:
|
||||||
|
{
|
||||||
|
ENCODE_LENGTH_EXACT(BecomeTrader_Struct);
|
||||||
|
SETUP_DIRECT_ENCODE(BecomeTrader_Struct, structs::BecomeTrader_Struct);
|
||||||
|
LogTrading(
|
||||||
|
"Encode OP_BecomeTrader(Ti) TraderOn action <green>[{}] entity_id <green>[{}] trader_name "
|
||||||
|
"<green>[{}]",
|
||||||
|
emu->action,
|
||||||
|
emu->entity_id,
|
||||||
|
emu->trader_name
|
||||||
|
);
|
||||||
|
eq->action = structs::TiBazaarTraderBuyerActions::BeginTraderMode;
|
||||||
|
eq->entity_id = emu->entity_id;
|
||||||
|
strn0cpy(eq->trader_name, emu->trader_name, sizeof(eq->trader_name));
|
||||||
|
FINISH_ENCODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
LogTrading(
|
||||||
|
"Encode OP_BecomeTrader(Ti) unhandled action <red>[{}] Sending packet as is.",
|
||||||
|
action
|
||||||
|
);
|
||||||
|
EQApplicationPacket *in = *p;
|
||||||
|
*p = nullptr;
|
||||||
|
dest->FastQueuePacket(&in, ack_req);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_Buff)
|
ENCODE(OP_Buff)
|
||||||
@@ -748,6 +820,28 @@ namespace Titanium
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ENCODE(OP_GuildsList)
|
||||||
|
{
|
||||||
|
EQApplicationPacket* in = *p;
|
||||||
|
*p = nullptr;
|
||||||
|
|
||||||
|
GuildsListMessaging_Struct glms{};
|
||||||
|
EQ::Util::MemoryStreamReader ss(reinterpret_cast<char *>(in->pBuffer), in->size);
|
||||||
|
cereal::BinaryInputArchive ar(ss);
|
||||||
|
ar(glms);
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_GuildsList, sizeof(structs::GuildsList_Struct));
|
||||||
|
auto out = (structs::GuildsList_Struct *) outapp->pBuffer;
|
||||||
|
|
||||||
|
for (auto const& g : glms.guild_detail) {
|
||||||
|
if (g.guild_id < Titanium::constants::MAX_GUILD_ID) {
|
||||||
|
strn0cpy(out->Guilds[g.guild_id].name, g.guild_name.c_str(), sizeof(out->Guilds[g.guild_id].name));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
}
|
||||||
|
|
||||||
ENCODE(OP_GuildMemberAdd)
|
ENCODE(OP_GuildMemberAdd)
|
||||||
{
|
{
|
||||||
ENCODE_LENGTH_EXACT(GuildMemberAdd_Struct)
|
ENCODE_LENGTH_EXACT(GuildMemberAdd_Struct)
|
||||||
@@ -1858,6 +1952,19 @@ namespace Titanium
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ENCODE(OP_ShopRequest)
|
||||||
|
{
|
||||||
|
ENCODE_LENGTH_EXACT(MerchantClick_Struct);
|
||||||
|
SETUP_DIRECT_ENCODE(MerchantClick_Struct, structs::MerchantClick_Struct);
|
||||||
|
|
||||||
|
OUT(npc_id);
|
||||||
|
OUT(player_id);
|
||||||
|
OUT(command);
|
||||||
|
OUT(rate);
|
||||||
|
|
||||||
|
FINISH_ENCODE();
|
||||||
|
}
|
||||||
|
|
||||||
ENCODE(OP_SpecialMesg)
|
ENCODE(OP_SpecialMesg)
|
||||||
{
|
{
|
||||||
EQApplicationPacket *in = *p;
|
EQApplicationPacket *in = *p;
|
||||||
@@ -1975,32 +2082,170 @@ namespace Titanium
|
|||||||
|
|
||||||
ENCODE(OP_Trader)
|
ENCODE(OP_Trader)
|
||||||
{
|
{
|
||||||
if ((*p)->size != sizeof(TraderBuy_Struct)) {
|
auto action = *(uint32 *) (*p)->pBuffer;
|
||||||
|
|
||||||
|
switch (action) {
|
||||||
|
case TraderOn: {
|
||||||
|
ENCODE_LENGTH_EXACT(Trader_ShowItems_Struct);
|
||||||
|
SETUP_DIRECT_ENCODE(Trader_ShowItems_Struct, structs::Trader_ShowItems_Struct);
|
||||||
|
LogTrading(
|
||||||
|
"Encode OP_Trader BeginTraderMode action <green>[{}]",
|
||||||
|
action
|
||||||
|
);
|
||||||
|
|
||||||
|
eq->action = structs::TiBazaarTraderBuyerActions::BeginTraderMode;
|
||||||
|
OUT(entity_id);
|
||||||
|
|
||||||
|
FINISH_ENCODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case TraderOff: {
|
||||||
|
ENCODE_LENGTH_EXACT(Trader_ShowItems_Struct);
|
||||||
|
SETUP_DIRECT_ENCODE(Trader_ShowItems_Struct, structs::Trader_ShowItems_Struct);
|
||||||
|
LogTrading(
|
||||||
|
"Encode OP_Trader EndTraderMode action <green>[{}]",
|
||||||
|
action
|
||||||
|
);
|
||||||
|
|
||||||
|
eq->action = structs::TiBazaarTraderBuyerActions::EndTraderMode;
|
||||||
|
OUT(entity_id);
|
||||||
|
|
||||||
|
FINISH_ENCODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ListTraderItems: {
|
||||||
|
ENCODE_LENGTH_EXACT(Trader_Struct);
|
||||||
|
SETUP_DIRECT_ENCODE(Trader_Struct, structs::Trader_Struct);
|
||||||
|
LogTrading(
|
||||||
|
"Encode OP_Trader ListTraderItems action <green>[{}]",
|
||||||
|
action
|
||||||
|
);
|
||||||
|
|
||||||
|
eq->action = structs::TiBazaarTraderBuyerActions::ListTraderItems;
|
||||||
|
std::copy_n(emu->items, UF::invtype::BAZAAR_SIZE, eq->item_id);
|
||||||
|
std::copy_n(emu->item_cost, UF::invtype::BAZAAR_SIZE, eq->item_cost);
|
||||||
|
|
||||||
|
FINISH_ENCODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case BuyTraderItem: {
|
||||||
|
ENCODE_LENGTH_EXACT(TraderBuy_Struct);
|
||||||
|
SETUP_DIRECT_ENCODE(TraderBuy_Struct, structs::TraderBuy_Struct);
|
||||||
|
LogTrading(
|
||||||
|
"Encode OP_Trader item_id <green>[{}] price <green>[{}] quantity <green>[{}] trader_id <green>[{}]",
|
||||||
|
eq->item_id,
|
||||||
|
eq->price,
|
||||||
|
eq->quantity,
|
||||||
|
eq->trader_id
|
||||||
|
);
|
||||||
|
|
||||||
|
eq->action = structs::TiBazaarTraderBuyerActions::BuyTraderItem;
|
||||||
|
OUT(price);
|
||||||
|
OUT(trader_id);
|
||||||
|
OUT(item_id);
|
||||||
|
OUT(already_sold);
|
||||||
|
OUT(quantity);
|
||||||
|
strn0cpy(eq->item_name, emu->item_name, sizeof(eq->item_name));
|
||||||
|
|
||||||
|
FINISH_ENCODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ItemMove: {
|
||||||
|
LogTrading(
|
||||||
|
"Encode OP_Trader ItemMove action <green>[{}]",
|
||||||
|
action
|
||||||
|
);
|
||||||
EQApplicationPacket *in = *p;
|
EQApplicationPacket *in = *p;
|
||||||
*p = nullptr;
|
*p = nullptr;
|
||||||
dest->FastQueuePacket(&in, ack_req);
|
dest->FastQueuePacket(&in, ack_req);
|
||||||
return;
|
break;
|
||||||
}
|
}
|
||||||
|
default: {
|
||||||
|
EQApplicationPacket *in = *p;
|
||||||
|
*p = nullptr;
|
||||||
|
|
||||||
ENCODE_FORWARD(OP_TraderBuy);
|
dest->FastQueuePacket(&in, ack_req);
|
||||||
|
LogError("Unknown Encode OP_Trader action <red>{} received. Unhandled.", action);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_TraderBuy)
|
ENCODE(OP_TraderBuy)
|
||||||
{
|
{
|
||||||
ENCODE_LENGTH_EXACT(TraderBuy_Struct);
|
ENCODE_LENGTH_EXACT(TraderBuy_Struct);
|
||||||
SETUP_DIRECT_ENCODE(TraderBuy_Struct, structs::TraderBuy_Struct);
|
SETUP_DIRECT_ENCODE(TraderBuy_Struct, structs::TraderBuy_Struct);
|
||||||
|
LogTrading(
|
||||||
|
"Encode OP_TraderBuy item_id <green>[{}] price <green>[{}] quantity <green>[{}] trader_id <green>[{}]",
|
||||||
|
emu->item_id,
|
||||||
|
emu->price,
|
||||||
|
emu->quantity,
|
||||||
|
emu->trader_id
|
||||||
|
);
|
||||||
|
|
||||||
OUT(Action);
|
OUT(action);
|
||||||
OUT(Price);
|
OUT(price);
|
||||||
OUT(TraderID);
|
OUT(trader_id);
|
||||||
memcpy(eq->ItemName, emu->ItemName, sizeof(eq->ItemName));
|
OUT(item_id);
|
||||||
OUT(ItemID);
|
OUT(already_sold);
|
||||||
OUT(Quantity);
|
OUT(quantity);
|
||||||
OUT(AlreadySold);
|
OUT_str(item_name);
|
||||||
|
|
||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ENCODE(OP_TraderShop)
|
||||||
|
{
|
||||||
|
auto action = *(uint32 *)(*p)->pBuffer;
|
||||||
|
|
||||||
|
switch (action) {
|
||||||
|
case ClickTrader: {
|
||||||
|
ENCODE_LENGTH_EXACT(TraderClick_Struct);
|
||||||
|
SETUP_DIRECT_ENCODE(TraderClick_Struct, structs::TraderClick_Struct);
|
||||||
|
LogTrading(
|
||||||
|
"ClickTrader action <green>[{}] trader_id <green>[{}]",
|
||||||
|
action,
|
||||||
|
emu->TraderID
|
||||||
|
);
|
||||||
|
|
||||||
|
eq->action = 0;
|
||||||
|
eq->trader_id = emu->TraderID;
|
||||||
|
eq->approval = emu->Approval;
|
||||||
|
|
||||||
|
FINISH_ENCODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case BuyTraderItem: {
|
||||||
|
ENCODE_LENGTH_EXACT(TraderBuy_Struct);
|
||||||
|
SETUP_DIRECT_ENCODE(TraderBuy_Struct, structs::TraderBuy_Struct);
|
||||||
|
LogTrading(
|
||||||
|
"Encode OP_TraderShop item_id <green>[{}] price <green>[{}] quantity <green>[{}] trader_id <green>[{}]",
|
||||||
|
eq->item_id,
|
||||||
|
eq->price,
|
||||||
|
eq->quantity,
|
||||||
|
eq->trader_id
|
||||||
|
);
|
||||||
|
|
||||||
|
eq->action = structs::TiBazaarTraderBuyerActions::BuyTraderItem;
|
||||||
|
OUT(price);
|
||||||
|
OUT(trader_id);
|
||||||
|
OUT(item_id);
|
||||||
|
OUT(already_sold);
|
||||||
|
OUT(quantity);
|
||||||
|
strn0cpy(eq->item_name, emu->item_name, sizeof(eq->item_name));
|
||||||
|
|
||||||
|
FINISH_ENCODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
EQApplicationPacket *in = *p;
|
||||||
|
*p = nullptr;
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&in, ack_req);
|
||||||
|
LogError("Unknown Encode OP_TraderShop action <red>[{}] received. Unhandled.", action);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ENCODE(OP_TributeItem)
|
ENCODE(OP_TributeItem)
|
||||||
{
|
{
|
||||||
ENCODE_LENGTH_EXACT(TributeItem_Struct);
|
ENCODE_LENGTH_EXACT(TributeItem_Struct);
|
||||||
@@ -2251,6 +2496,53 @@ namespace Titanium
|
|||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DECODE(OP_BazaarSearch)
|
||||||
|
{
|
||||||
|
uint32 action = *(uint32 *) __packet->pBuffer;
|
||||||
|
|
||||||
|
switch (action) {
|
||||||
|
case structs::TiBazaarTraderBuyerActions::BazaarSearch: {
|
||||||
|
DECODE_LENGTH_EXACT(structs::BazaarSearch_Struct);
|
||||||
|
SETUP_DIRECT_DECODE(BazaarSearchCriteria_Struct, structs::BazaarSearch_Struct);
|
||||||
|
|
||||||
|
emu->action = eq->Beginning.Action;
|
||||||
|
emu->item_stat = eq->ItemStat;
|
||||||
|
emu->max_cost = eq->MaxPrice;
|
||||||
|
emu->min_cost = eq->MinPrice;
|
||||||
|
emu->max_level = eq->MaxLlevel;
|
||||||
|
emu->min_level = eq->Minlevel;
|
||||||
|
emu->race = eq->Race;
|
||||||
|
emu->slot = eq->Slot;
|
||||||
|
emu->type = eq->Type == UINT32_MAX ? UINT8_MAX : eq->Type;
|
||||||
|
emu->trader_entity_id = eq->TraderID;
|
||||||
|
emu->trader_id = 0;
|
||||||
|
emu->_class = eq->Class_;
|
||||||
|
emu->search_scope = eq->TraderID > 0 ? NonRoFBazaarSearchScope : Local_Scope;
|
||||||
|
emu->max_results = RuleI(Bazaar, MaxSearchResults);
|
||||||
|
strn0cpy(emu->item_name, eq->Name, sizeof(emu->item_name));
|
||||||
|
|
||||||
|
FINISH_DIRECT_DECODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case structs::TiBazaarTraderBuyerActions::BazaarInspect: {
|
||||||
|
SETUP_DIRECT_DECODE(BazaarInspect_Struct, structs::BazaarInspect_Struct);
|
||||||
|
|
||||||
|
IN(action);
|
||||||
|
memcpy(emu->player_name, eq->player_name, sizeof(emu->player_name));
|
||||||
|
IN(serial_number);
|
||||||
|
|
||||||
|
FINISH_DIRECT_DECODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case structs::TiBazaarTraderBuyerActions::WelcomeMessage: {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
LogTrading("(Ti) Unhandled action <red>[{}]", action);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DECODE(OP_Buff)
|
DECODE(OP_Buff)
|
||||||
{
|
{
|
||||||
DECODE_LENGTH_EXACT(structs::SpellBuffPacket_Struct);
|
DECODE_LENGTH_EXACT(structs::SpellBuffPacket_Struct);
|
||||||
@@ -2875,18 +3167,105 @@ namespace Titanium
|
|||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DECODE(OP_ShopRequest)
|
||||||
|
{
|
||||||
|
DECODE_LENGTH_EXACT(structs::MerchantClick_Struct);
|
||||||
|
SETUP_DIRECT_DECODE(MerchantClick_Struct, structs::MerchantClick_Struct);
|
||||||
|
|
||||||
|
IN(npc_id);
|
||||||
|
IN(player_id);
|
||||||
|
IN(command);
|
||||||
|
IN(rate);
|
||||||
|
emu->tab_display = 0;
|
||||||
|
emu->unknown020 = 0;
|
||||||
|
|
||||||
|
FINISH_DIRECT_DECODE();
|
||||||
|
}
|
||||||
|
|
||||||
|
DECODE(OP_Trader)
|
||||||
|
{
|
||||||
|
auto action = (uint32) __packet->pBuffer[0];
|
||||||
|
|
||||||
|
switch (action) {
|
||||||
|
case structs::TiBazaarTraderBuyerActions::BeginTraderMode: {
|
||||||
|
DECODE_LENGTH_EXACT(structs::BeginTrader_Struct);
|
||||||
|
SETUP_DIRECT_DECODE(ClickTrader_Struct, structs::BeginTrader_Struct);
|
||||||
|
LogTrading(
|
||||||
|
"Decode OP_Trader BeginTraderMode action <red>[{}]",
|
||||||
|
action
|
||||||
|
);
|
||||||
|
|
||||||
|
emu->action = TraderOn;
|
||||||
|
emu->unknown_004 = 0;
|
||||||
|
std::copy_n(eq->serial_number, Titanium::invtype::BAZAAR_SIZE, emu->serial_number);
|
||||||
|
std::copy_n(eq->cost, Titanium::invtype::BAZAAR_SIZE, emu->item_cost);
|
||||||
|
|
||||||
|
FINISH_DIRECT_DECODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case structs::TiBazaarTraderBuyerActions::EndTraderMode: {
|
||||||
|
DECODE_LENGTH_EXACT(structs::Trader_ShowItems_Struct);
|
||||||
|
SETUP_DIRECT_DECODE(Trader_ShowItems_Struct, structs::Trader_ShowItems_Struct);
|
||||||
|
LogTrading(
|
||||||
|
"Decode OP_Trader(Ti) EndTraderMode action <red>[{}]",
|
||||||
|
action
|
||||||
|
);
|
||||||
|
|
||||||
|
emu->action = TraderOff;
|
||||||
|
IN(entity_id);
|
||||||
|
|
||||||
|
FINISH_DIRECT_DECODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case structs::TiBazaarTraderBuyerActions::PriceUpdate:
|
||||||
|
case structs::TiBazaarTraderBuyerActions::ItemMove:
|
||||||
|
case structs::TiBazaarTraderBuyerActions::EndTransaction:
|
||||||
|
case structs::TiBazaarTraderBuyerActions::ListTraderItems: {
|
||||||
|
LogTrading(
|
||||||
|
"Decode OP_Trader(Ti) Price/ItemMove/EndTransaction/ListTraderItems action <red>[{}]",
|
||||||
|
action
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case structs::TiBazaarTraderBuyerActions::ReconcileItems: {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
LogError("Unhandled(Ti) action <red>[{}] received.", action);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DECODE(OP_TraderBuy)
|
DECODE(OP_TraderBuy)
|
||||||
{
|
{
|
||||||
DECODE_LENGTH_EXACT(structs::TraderBuy_Struct);
|
DECODE_LENGTH_EXACT(structs::TraderBuy_Struct);
|
||||||
SETUP_DIRECT_DECODE(TraderBuy_Struct, structs::TraderBuy_Struct);
|
SETUP_DIRECT_DECODE(TraderBuy_Struct, structs::TraderBuy_Struct);
|
||||||
MEMSET_IN(TraderBuy_Struct);
|
MEMSET_IN(TraderBuy_Struct);
|
||||||
|
|
||||||
IN(Action);
|
IN(action);
|
||||||
IN(Price);
|
IN(price);
|
||||||
IN(TraderID);
|
IN(trader_id);
|
||||||
memcpy(emu->ItemName, eq->ItemName, sizeof(emu->ItemName));
|
memcpy(emu->item_name, eq->item_name, sizeof(emu->item_name));
|
||||||
IN(ItemID);
|
IN(item_id);
|
||||||
IN(Quantity);
|
IN(quantity);
|
||||||
|
|
||||||
|
FINISH_DIRECT_DECODE();
|
||||||
|
}
|
||||||
|
|
||||||
|
DECODE(OP_TraderShop)
|
||||||
|
{
|
||||||
|
DECODE_LENGTH_EXACT(structs::TraderClick_Struct);
|
||||||
|
SETUP_DIRECT_DECODE(TraderClick_Struct, structs::TraderClick_Struct);
|
||||||
|
LogTrading(
|
||||||
|
"(Ti) action <green>[{}] trader_id <green>[{}] approval <green>[{}]",
|
||||||
|
eq->action,
|
||||||
|
eq->trader_id,
|
||||||
|
eq->approval
|
||||||
|
);
|
||||||
|
|
||||||
|
emu->Code = ClickTrader;
|
||||||
|
emu->TraderID = eq->trader_id;
|
||||||
|
emu->Approval = eq->approval;
|
||||||
|
|
||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -287,6 +287,7 @@ namespace Titanium
|
|||||||
const size_t CHARACTER_CREATION_LIMIT = 8; // Hard-coded in client - DO NOT ALTER
|
const size_t CHARACTER_CREATION_LIMIT = 8; // Hard-coded in client - DO NOT ALTER
|
||||||
|
|
||||||
const size_t SAY_LINK_BODY_SIZE = 45;
|
const size_t SAY_LINK_BODY_SIZE = 45;
|
||||||
|
const uint32 MAX_GUILD_ID = 1500;
|
||||||
|
|
||||||
} /*constants*/
|
} /*constants*/
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ E(OP_Emote)
|
|||||||
E(OP_FormattedMessage)
|
E(OP_FormattedMessage)
|
||||||
E(OP_GroundSpawn)
|
E(OP_GroundSpawn)
|
||||||
E(OP_SetGuildRank)
|
E(OP_SetGuildRank)
|
||||||
|
E(OP_GuildsList)
|
||||||
E(OP_GuildMemberLevelUpdate)
|
E(OP_GuildMemberLevelUpdate)
|
||||||
E(OP_GuildMemberList)
|
E(OP_GuildMemberList)
|
||||||
E(OP_GuildMemberAdd)
|
E(OP_GuildMemberAdd)
|
||||||
@@ -74,12 +75,14 @@ E(OP_SendCharInfo)
|
|||||||
E(OP_SendAATable)
|
E(OP_SendAATable)
|
||||||
E(OP_SetFace)
|
E(OP_SetFace)
|
||||||
E(OP_ShopPlayerSell)
|
E(OP_ShopPlayerSell)
|
||||||
|
E(OP_ShopRequest)
|
||||||
E(OP_SpawnAppearance)
|
E(OP_SpawnAppearance)
|
||||||
E(OP_SpecialMesg)
|
E(OP_SpecialMesg)
|
||||||
E(OP_TaskDescription)
|
E(OP_TaskDescription)
|
||||||
E(OP_Track)
|
E(OP_Track)
|
||||||
E(OP_Trader)
|
E(OP_Trader)
|
||||||
E(OP_TraderBuy)
|
E(OP_TraderBuy)
|
||||||
|
E(OP_TraderShop)
|
||||||
E(OP_TributeItem)
|
E(OP_TributeItem)
|
||||||
E(OP_VetRewardsAvaliable)
|
E(OP_VetRewardsAvaliable)
|
||||||
E(OP_WearChange)
|
E(OP_WearChange)
|
||||||
@@ -90,6 +93,7 @@ E(OP_ZoneSpawns)
|
|||||||
D(OP_AdventureMerchantSell)
|
D(OP_AdventureMerchantSell)
|
||||||
D(OP_ApplyPoison)
|
D(OP_ApplyPoison)
|
||||||
D(OP_AugmentItem)
|
D(OP_AugmentItem)
|
||||||
|
D(OP_BazaarSearch)
|
||||||
D(OP_Buff)
|
D(OP_Buff)
|
||||||
D(OP_Bug)
|
D(OP_Bug)
|
||||||
D(OP_CastSpell)
|
D(OP_CastSpell)
|
||||||
@@ -120,7 +124,10 @@ D(OP_RaidInvite)
|
|||||||
D(OP_ReadBook)
|
D(OP_ReadBook)
|
||||||
D(OP_SetServerFilter)
|
D(OP_SetServerFilter)
|
||||||
D(OP_ShopPlayerSell)
|
D(OP_ShopPlayerSell)
|
||||||
|
D(OP_ShopRequest)
|
||||||
|
D(OP_Trader)
|
||||||
D(OP_TraderBuy)
|
D(OP_TraderBuy)
|
||||||
|
D(OP_TraderShop)
|
||||||
D(OP_TradeSkillCombine)
|
D(OP_TradeSkillCombine)
|
||||||
D(OP_TributeItem)
|
D(OP_TributeItem)
|
||||||
D(OP_WearChange)
|
D(OP_WearChange)
|
||||||
|
|||||||
@@ -1669,9 +1669,9 @@ struct TimeOfDay_Struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Darvik: shopkeeper structs
|
// Darvik: shopkeeper structs
|
||||||
struct Merchant_Click_Struct {
|
struct MerchantClick_Struct {
|
||||||
/*000*/ uint32 npcid; // Merchant NPC's entity id
|
/*000*/ uint32 npc_id; // Merchant NPC's entity id
|
||||||
/*004*/ uint32 playerid;
|
/*004*/ uint32 player_id;
|
||||||
/*008*/ uint32 command; //1=open, 0=cancel/close
|
/*008*/ uint32 command; //1=open, 0=cancel/close
|
||||||
/*012*/ float rate; //cost multiplier, dosent work anymore
|
/*012*/ float rate; //cost multiplier, dosent work anymore
|
||||||
};
|
};
|
||||||
@@ -2273,24 +2273,29 @@ struct BazaarWelcome_Struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct BazaarSearch_Struct {
|
struct BazaarSearch_Struct {
|
||||||
BazaarWindowStart_Struct beginning;
|
BazaarWindowStart_Struct Beginning;
|
||||||
uint32 traderid;
|
uint32 TraderID;
|
||||||
uint32 class_;
|
uint32 Class_;
|
||||||
uint32 race;
|
uint32 Race;
|
||||||
uint32 stat;
|
uint32 ItemStat;
|
||||||
uint32 slot;
|
uint32 Slot;
|
||||||
uint32 type;
|
uint32 Type;
|
||||||
char name[64];
|
char Name[64];
|
||||||
uint32 minprice;
|
uint32 MinPrice;
|
||||||
uint32 maxprice;
|
uint32 MaxPrice;
|
||||||
uint32 minlevel;
|
uint32 Minlevel;
|
||||||
uint32 maxlevel;
|
uint32 MaxLlevel;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct BazaarInspect_Struct {
|
struct BazaarInspect_Struct {
|
||||||
|
uint32 action;
|
||||||
|
char player_name[64];
|
||||||
|
uint32 unknown_068;
|
||||||
|
uint32 serial_number;
|
||||||
|
uint32 unknown_076;
|
||||||
uint32 item_id;
|
uint32 item_id;
|
||||||
uint32 unknown;
|
|
||||||
char name[64];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct BazaarReturnDone_Struct{
|
struct BazaarReturnDone_Struct{
|
||||||
uint32 type;
|
uint32 type;
|
||||||
uint32 traderid;
|
uint32 traderid;
|
||||||
@@ -2298,16 +2303,17 @@ struct BazaarReturnDone_Struct{
|
|||||||
uint32 unknown12;
|
uint32 unknown12;
|
||||||
uint32 unknown16;
|
uint32 unknown16;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct BazaarSearchResults_Struct {
|
struct BazaarSearchResults_Struct {
|
||||||
BazaarWindowStart_Struct Beginning;
|
BazaarWindowStart_Struct Beginning;
|
||||||
uint32 SellerID;
|
uint32 entity_id;
|
||||||
uint32 NumItems; // Don't know. Don't know the significance of this field.
|
uint32 unknown_008;
|
||||||
uint32 SerialNumber;
|
uint32 item_id;
|
||||||
uint32 Unknown016;
|
uint32 serial_number;
|
||||||
uint32 Unknown020; // Something to do with stats as well
|
uint32 unknown_020;
|
||||||
char ItemName[64];
|
char item_name[64];
|
||||||
uint32 Cost;
|
uint32 item_cost;
|
||||||
uint32 ItemStat;
|
uint32 item_stat;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ServerSideFilters_Struct {
|
struct ServerSideFilters_Struct {
|
||||||
@@ -2454,11 +2460,18 @@ struct WhoAllReturnStruct {
|
|||||||
struct WhoAllPlayer player[0];
|
struct WhoAllPlayer player[0];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct BeginTrader_Struct {
|
||||||
|
uint32 action;
|
||||||
|
uint32 unknown04;
|
||||||
|
uint64 serial_number[80];
|
||||||
|
uint32 cost[80];
|
||||||
|
};
|
||||||
|
|
||||||
struct Trader_Struct {
|
struct Trader_Struct {
|
||||||
uint32 code;
|
uint32 action;
|
||||||
uint32 itemid[160];
|
uint32 unknown004;
|
||||||
uint32 unknown;
|
uint64 item_id[80];
|
||||||
uint32 itemcost[80];
|
uint32 item_cost[80];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ClickTrader_Struct {
|
struct ClickTrader_Struct {
|
||||||
@@ -2472,26 +2485,27 @@ struct GetItems_Struct{
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct BecomeTrader_Struct {
|
struct BecomeTrader_Struct {
|
||||||
uint32 ID;
|
uint32 entity_id;
|
||||||
uint32 Code;
|
uint32 action;
|
||||||
|
char trader_name[64];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Trader_ShowItems_Struct{
|
struct Trader_ShowItems_Struct{
|
||||||
uint32 code;
|
uint32 action;
|
||||||
uint32 traderid;
|
uint32 entity_id;
|
||||||
uint32 unknown08[3];
|
uint32 unknown08[3];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TraderBuy_Struct {
|
struct TraderBuy_Struct {
|
||||||
/*000*/ uint32 Action;
|
/*000*/ uint32 action;
|
||||||
/*004*/ uint32 Price;
|
/*004*/ uint32 price;
|
||||||
/*008*/ uint32 TraderID;
|
/*008*/ uint32 trader_id;
|
||||||
/*012*/ char ItemName[64];
|
/*012*/ char item_name[64];
|
||||||
/*076*/ uint32 Unknown076;
|
/*076*/ uint32 unknown_076;
|
||||||
/*080*/ uint32 ItemID;
|
/*080*/ uint32 item_id;
|
||||||
/*084*/ uint32 AlreadySold;
|
/*084*/ uint32 already_sold;
|
||||||
/*088*/ uint32 Quantity;
|
/*088*/ uint32 quantity;
|
||||||
/*092*/ uint32 Unknown092;
|
/*092*/ uint32 unknown_092;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -2517,8 +2531,9 @@ struct TraderDelItem_Struct{
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct TraderClick_Struct{
|
struct TraderClick_Struct{
|
||||||
uint32 traderid;
|
uint32 trader_id;
|
||||||
uint32 unknown4[2];
|
uint32 action;
|
||||||
|
uint32 unknown_004;
|
||||||
uint32 approval;
|
uint32 approval;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -3744,6 +3759,21 @@ struct GuildMemberRank_Struct {
|
|||||||
/*076*/ uint32 alt_banker; //Banker/Alt bit 00 - none 10 - Alt 11 - Alt and Banker 01 - Banker. Banker not functional for RoF2+
|
/*076*/ uint32 alt_banker; //Banker/Alt bit 00 - none 10 - Alt 11 - Alt and Banker 01 - Banker. Banker not functional for RoF2+
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum TiBazaarTraderBuyerActions {
|
||||||
|
Zero = 0,
|
||||||
|
BeginTraderMode = 1,
|
||||||
|
EndTraderMode = 2,
|
||||||
|
PriceUpdate = 3,
|
||||||
|
EndTransaction = 4,
|
||||||
|
BazaarSearch = 7,
|
||||||
|
WelcomeMessage = 9,
|
||||||
|
BuyTraderItem = 10,
|
||||||
|
ListTraderItems = 11,
|
||||||
|
BazaarInspect = 18,
|
||||||
|
ItemMove = 19,
|
||||||
|
ReconcileItems = 20
|
||||||
|
};
|
||||||
|
|
||||||
}; /*structs*/
|
}; /*structs*/
|
||||||
|
|
||||||
}; /*Titanium*/
|
}; /*Titanium*/
|
||||||
|
|||||||
+448
-104
@@ -37,6 +37,8 @@
|
|||||||
#include "../races.h"
|
#include "../races.h"
|
||||||
#include "../raid.h"
|
#include "../raid.h"
|
||||||
#include "../guilds.h"
|
#include "../guilds.h"
|
||||||
|
//#include "../repositories/trader_repository.h"
|
||||||
|
#include "../cereal/include/cereal/types/vector.hpp"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@@ -307,51 +309,135 @@ namespace UF
|
|||||||
EQApplicationPacket *in = *p;
|
EQApplicationPacket *in = *p;
|
||||||
*p = nullptr;
|
*p = nullptr;
|
||||||
|
|
||||||
char *Buffer = (char *)in->pBuffer;
|
uint32 action = *(uint32 *)in->pBuffer;
|
||||||
|
|
||||||
uint8 SubAction = VARSTRUCT_DECODE_TYPE(uint8, Buffer);
|
switch (action) {
|
||||||
|
case BazaarSearch: {
|
||||||
|
LogTrading(
|
||||||
|
"Encode OP_BazaarSearch(UF) BazaarSearch action <green>[{}]",
|
||||||
|
action
|
||||||
|
);
|
||||||
|
std::vector<BazaarSearchResultsFromDB_Struct> results {};
|
||||||
|
auto bsms = (BazaarSearchMessaging_Struct *)in->pBuffer;
|
||||||
|
EQ::Util::MemoryStreamReader ss(
|
||||||
|
reinterpret_cast<char *>(bsms->payload),
|
||||||
|
in->size - sizeof(BazaarSearchMessaging_Struct)
|
||||||
|
);
|
||||||
|
cereal::BinaryInputArchive ar(ss);
|
||||||
|
ar(results);
|
||||||
|
|
||||||
if (SubAction != BazaarSearchResults)
|
auto size = results.size() * sizeof(BazaarSearchResults_Struct);
|
||||||
{
|
auto buffer = new uchar[size];
|
||||||
|
uchar *bufptr = buffer;
|
||||||
|
memset(buffer, 0, size);
|
||||||
|
|
||||||
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
VARSTRUCT_ENCODE_TYPE(uint32, bufptr, structs::UFBazaarTraderBuyerActions::BazaarSearch);
|
||||||
|
VARSTRUCT_ENCODE_TYPE(uint32, bufptr, row->trader_entity_id);
|
||||||
|
strn0cpy(reinterpret_cast<char *>(bufptr), row->trader_name.c_str(), 64);
|
||||||
|
bufptr += 64;
|
||||||
|
VARSTRUCT_ENCODE_TYPE(uint32, bufptr, 1);
|
||||||
|
VARSTRUCT_ENCODE_TYPE(int32, bufptr, row->item_id);
|
||||||
|
VARSTRUCT_ENCODE_TYPE(int32, bufptr, row->serial_number);
|
||||||
|
bufptr += 4;
|
||||||
|
if (row->stackable) {
|
||||||
|
strn0cpy(
|
||||||
|
reinterpret_cast<char *>(bufptr),
|
||||||
|
fmt::format("{}({})", row->item_name.c_str(), row->charges).c_str(),
|
||||||
|
64
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
strn0cpy(
|
||||||
|
reinterpret_cast<char *>(bufptr),
|
||||||
|
fmt::format("{}({})", row->item_name.c_str(), row->count).c_str(),
|
||||||
|
64
|
||||||
|
);
|
||||||
|
}
|
||||||
|
bufptr += 64;
|
||||||
|
VARSTRUCT_ENCODE_TYPE(uint32, bufptr, row->cost);
|
||||||
|
VARSTRUCT_ENCODE_TYPE(uint32, bufptr, row->item_stat);
|
||||||
|
}
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_BazaarSearch, size);
|
||||||
|
memcpy(outapp->pBuffer, buffer, size);
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
|
||||||
|
safe_delete(outapp);
|
||||||
|
safe_delete_array(buffer);
|
||||||
|
safe_delete(in);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case BazaarInspect:
|
||||||
|
case WelcomeMessage: {
|
||||||
|
LogTrading(
|
||||||
|
"Encode OP_BazaarSearch(UF) BazaarInspect/WelcomeMessage action <green>[{}]",
|
||||||
|
action
|
||||||
|
);
|
||||||
dest->FastQueuePacket(&in, ack_req);
|
dest->FastQueuePacket(&in, ack_req);
|
||||||
return;
|
break;
|
||||||
}
|
}
|
||||||
|
default: {
|
||||||
unsigned char *__emu_buffer = in->pBuffer;
|
LogTrading(
|
||||||
|
"Encode OP_BazaarSearch(UF) unhandled action <red>[{}]",
|
||||||
BazaarSearchResults_Struct *emu = (BazaarSearchResults_Struct *)__emu_buffer;
|
action
|
||||||
|
);
|
||||||
int EntryCount = in->size / sizeof(BazaarSearchResults_Struct);
|
|
||||||
|
|
||||||
if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0)
|
|
||||||
{
|
|
||||||
LogNetcode("[STRUCTS] Wrong size on outbound [{}]: Got [{}], expected multiple of [{}]", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
|
|
||||||
delete in;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
in->size = EntryCount * sizeof(structs::BazaarSearchResults_Struct);
|
|
||||||
in->pBuffer = new unsigned char[in->size];
|
|
||||||
memset(in->pBuffer, 0, in->size);
|
|
||||||
|
|
||||||
structs::BazaarSearchResults_Struct *eq = (structs::BazaarSearchResults_Struct *)in->pBuffer;
|
|
||||||
|
|
||||||
for (int i = 0; i < EntryCount; ++i, ++emu, ++eq)
|
|
||||||
{
|
|
||||||
OUT(Beginning.Action);
|
|
||||||
OUT(SellerID);
|
|
||||||
memcpy(eq->SellerName, emu->SellerName, sizeof(eq->SellerName));
|
|
||||||
OUT(NumItems);
|
|
||||||
OUT(ItemID);
|
|
||||||
OUT(SerialNumber);
|
|
||||||
memcpy(eq->ItemName, emu->ItemName, sizeof(eq->ItemName));
|
|
||||||
OUT(Cost);
|
|
||||||
OUT(ItemStat);
|
|
||||||
}
|
|
||||||
|
|
||||||
delete[] __emu_buffer;
|
|
||||||
dest->FastQueuePacket(&in, ack_req);
|
dest->FastQueuePacket(&in, ack_req);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ENCODE(OP_BecomeTrader)
|
||||||
|
{
|
||||||
|
uint32 action = *(uint32 *)(*p)->pBuffer;
|
||||||
|
|
||||||
|
switch (action)
|
||||||
|
{
|
||||||
|
case TraderOff:
|
||||||
|
{
|
||||||
|
ENCODE_LENGTH_EXACT(BecomeTrader_Struct);
|
||||||
|
SETUP_DIRECT_ENCODE(BecomeTrader_Struct, structs::BecomeTrader_Struct);
|
||||||
|
LogTrading(
|
||||||
|
"Encode OP_BecomeTrader(UF) TraderOff action <green>[{}] entity_id <green>[{}] trader_name "
|
||||||
|
"<green>[{}]",
|
||||||
|
emu->action,
|
||||||
|
emu->entity_id,
|
||||||
|
emu->trader_name
|
||||||
|
);
|
||||||
|
eq->action = structs::UFBazaarTraderBuyerActions::Zero;
|
||||||
|
eq->entity_id = emu->entity_id;
|
||||||
|
FINISH_ENCODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case TraderOn:
|
||||||
|
{
|
||||||
|
ENCODE_LENGTH_EXACT(BecomeTrader_Struct);
|
||||||
|
SETUP_DIRECT_ENCODE(BecomeTrader_Struct, structs::BecomeTrader_Struct);
|
||||||
|
LogTrading(
|
||||||
|
"Encode OP_BecomeTrader(UF) TraderOn action <green>[{}] entity_id <green>[{}] trader_name "
|
||||||
|
"<green>[{}]",
|
||||||
|
emu->action,
|
||||||
|
emu->entity_id,
|
||||||
|
emu->trader_name
|
||||||
|
);
|
||||||
|
eq->action = structs::UFBazaarTraderBuyerActions::BeginTraderMode;
|
||||||
|
eq->entity_id = emu->entity_id;
|
||||||
|
strn0cpy(eq->trader_name, emu->trader_name, sizeof(eq->trader_name));
|
||||||
|
FINISH_ENCODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
LogTrading(
|
||||||
|
"Encode OP_BecomeTrader(UF) unhandled action <red>[{}] Sending packet as is.",
|
||||||
|
action
|
||||||
|
);
|
||||||
|
EQApplicationPacket *in = *p;
|
||||||
|
*p = nullptr;
|
||||||
|
dest->FastQueuePacket(&in, ack_req);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ENCODE(OP_Buff)
|
ENCODE(OP_Buff)
|
||||||
{
|
{
|
||||||
@@ -1185,50 +1271,34 @@ namespace UF
|
|||||||
EQApplicationPacket* in = *p;
|
EQApplicationPacket* in = *p;
|
||||||
*p = nullptr;
|
*p = nullptr;
|
||||||
|
|
||||||
uint32 NumberOfGuilds = in->size / 64;
|
GuildsListMessaging_Struct glms{};
|
||||||
uint32 PacketSize = 68; // 64 x 0x00 + a uint32 that I am guessing is the highest guild ID in use.
|
EQ::Util::MemoryStreamReader ss(reinterpret_cast<char *>(in->pBuffer), in->size);
|
||||||
|
cereal::BinaryInputArchive ar(ss);
|
||||||
|
ar(glms);
|
||||||
|
|
||||||
unsigned char *__emu_buffer = in->pBuffer;
|
auto packet_size = 64 + 4 + glms.guild_detail.size() * 4 + glms.string_length;
|
||||||
char *InBuffer = (char *)__emu_buffer;
|
auto buffer = new uchar[packet_size];
|
||||||
uint32 actual_no_guilds = 0;
|
auto buf_pos = buffer;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < NumberOfGuilds; ++i)
|
memset(buf_pos, 0, 64);
|
||||||
{
|
buf_pos += 64;
|
||||||
if (InBuffer[0])
|
|
||||||
{
|
VARSTRUCT_ENCODE_TYPE(uint32, buf_pos, glms.no_of_guilds);
|
||||||
PacketSize += (5 + strlen(InBuffer));
|
|
||||||
actual_no_guilds++;
|
for (auto const& g : glms.guild_detail) {
|
||||||
|
if (g.guild_id < UF::constants::MAX_GUILD_ID) {
|
||||||
|
VARSTRUCT_ENCODE_TYPE(uint32, buf_pos, g.guild_id);
|
||||||
|
strn0cpy((char *) buf_pos, g.guild_name.c_str(), g.guild_name.length() + 1);
|
||||||
|
buf_pos += g.guild_name.length() + 1;
|
||||||
}
|
}
|
||||||
InBuffer += 64;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PacketSize++; // Appears to be an extra 0x00 at the very end.
|
auto outapp = new EQApplicationPacket(OP_GuildsList);
|
||||||
in->size = PacketSize;
|
|
||||||
in->pBuffer = new unsigned char[in->size];
|
|
||||||
InBuffer = (char *)__emu_buffer;
|
|
||||||
char *OutBuffer = (char *)in->pBuffer;
|
|
||||||
|
|
||||||
// Init the first 64 bytes to zero, as per live.
|
outapp->size = packet_size;
|
||||||
//
|
outapp->pBuffer = buffer;
|
||||||
memset(OutBuffer, 0, 64);
|
|
||||||
OutBuffer += 64;
|
|
||||||
|
|
||||||
VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, actual_no_guilds);
|
dest->FastQueuePacket(&outapp);
|
||||||
|
|
||||||
for (unsigned int i = 0; i < NumberOfGuilds; ++i)
|
|
||||||
{
|
|
||||||
if (InBuffer[0])
|
|
||||||
{
|
|
||||||
VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, i - 1);
|
|
||||||
VARSTRUCT_ENCODE_STRING(OutBuffer, InBuffer);
|
|
||||||
}
|
|
||||||
InBuffer += 64;
|
|
||||||
}
|
|
||||||
|
|
||||||
VARSTRUCT_ENCODE_TYPE(uint8, OutBuffer, 0x00);
|
|
||||||
|
|
||||||
delete[] __emu_buffer;
|
|
||||||
dest->FastQueuePacket(&in, ack_req);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_GuildMemberAdd)
|
ENCODE(OP_GuildMemberAdd)
|
||||||
@@ -2454,6 +2524,19 @@ namespace UF
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ENCODE(OP_ShopRequest)
|
||||||
|
{
|
||||||
|
ENCODE_LENGTH_EXACT(MerchantClick_Struct);
|
||||||
|
SETUP_DIRECT_ENCODE(MerchantClick_Struct, structs::MerchantClick_Struct);
|
||||||
|
|
||||||
|
OUT(npc_id);
|
||||||
|
OUT(player_id);
|
||||||
|
OUT(command);
|
||||||
|
OUT(rate);
|
||||||
|
|
||||||
|
FINISH_ENCODE();
|
||||||
|
}
|
||||||
|
|
||||||
ENCODE(OP_SomeItemPacketMaybe)
|
ENCODE(OP_SomeItemPacketMaybe)
|
||||||
{
|
{
|
||||||
// This Opcode is not named very well. It is used for the animation of arrows leaving the player's bow
|
// This Opcode is not named very well. It is used for the animation of arrows leaving the player's bow
|
||||||
@@ -2746,32 +2829,170 @@ namespace UF
|
|||||||
|
|
||||||
ENCODE(OP_Trader)
|
ENCODE(OP_Trader)
|
||||||
{
|
{
|
||||||
if ((*p)->size != sizeof(TraderBuy_Struct)) {
|
auto action = *(uint32 *) (*p)->pBuffer;
|
||||||
|
|
||||||
|
switch (action) {
|
||||||
|
case TraderOn: {
|
||||||
|
ENCODE_LENGTH_EXACT(Trader_ShowItems_Struct);
|
||||||
|
SETUP_DIRECT_ENCODE(Trader_ShowItems_Struct, structs::Trader_ShowItems_Struct);
|
||||||
|
LogTrading(
|
||||||
|
"Encode OP_Trader BeginTraderMode action <green>[{}]",
|
||||||
|
action
|
||||||
|
);
|
||||||
|
|
||||||
|
eq->action = structs::UFBazaarTraderBuyerActions::BeginTraderMode;
|
||||||
|
OUT(entity_id);
|
||||||
|
|
||||||
|
FINISH_ENCODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case TraderOff: {
|
||||||
|
ENCODE_LENGTH_EXACT(Trader_ShowItems_Struct);
|
||||||
|
SETUP_DIRECT_ENCODE(Trader_ShowItems_Struct, structs::Trader_ShowItems_Struct);
|
||||||
|
LogTrading(
|
||||||
|
"Encode OP_Trader EndTraderMode action <green>[{}]",
|
||||||
|
action
|
||||||
|
);
|
||||||
|
|
||||||
|
eq->action = structs::UFBazaarTraderBuyerActions::EndTraderMode;
|
||||||
|
OUT(entity_id);
|
||||||
|
|
||||||
|
FINISH_ENCODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ListTraderItems: {
|
||||||
|
ENCODE_LENGTH_EXACT(Trader_Struct);
|
||||||
|
SETUP_DIRECT_ENCODE(Trader_Struct, structs::Trader_Struct);
|
||||||
|
LogTrading(
|
||||||
|
"Encode OP_Trader ListTraderItems action <green>[{}]",
|
||||||
|
action
|
||||||
|
);
|
||||||
|
|
||||||
|
eq->action = structs::UFBazaarTraderBuyerActions::ListTraderItems;
|
||||||
|
std::copy_n(emu->items, UF::invtype::BAZAAR_SIZE, eq->item_id);
|
||||||
|
std::copy_n(emu->item_cost, UF::invtype::BAZAAR_SIZE, eq->item_cost);
|
||||||
|
|
||||||
|
FINISH_ENCODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case BuyTraderItem: {
|
||||||
|
ENCODE_LENGTH_EXACT(TraderBuy_Struct);
|
||||||
|
SETUP_DIRECT_ENCODE(TraderBuy_Struct, structs::TraderBuy_Struct);
|
||||||
|
LogTrading(
|
||||||
|
"Encode OP_Trader item_id <green>[{}] price <green>[{}] quantity <green>[{}] trader_id <green>[{}]",
|
||||||
|
eq->item_id,
|
||||||
|
eq->price,
|
||||||
|
eq->quantity,
|
||||||
|
eq->trader_id
|
||||||
|
);
|
||||||
|
|
||||||
|
eq->action = structs::UFBazaarTraderBuyerActions::BuyTraderItem;
|
||||||
|
OUT(price);
|
||||||
|
OUT(trader_id);
|
||||||
|
OUT(item_id);
|
||||||
|
OUT(already_sold);
|
||||||
|
OUT(quantity);
|
||||||
|
strn0cpy(eq->item_name, emu->item_name, sizeof(eq->item_name));
|
||||||
|
|
||||||
|
FINISH_ENCODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ItemMove: {
|
||||||
|
LogTrading(
|
||||||
|
"Encode OP_Trader ItemMove action <green>[{}]",
|
||||||
|
action
|
||||||
|
);
|
||||||
EQApplicationPacket *in = *p;
|
EQApplicationPacket *in = *p;
|
||||||
*p = nullptr;
|
*p = nullptr;
|
||||||
dest->FastQueuePacket(&in, ack_req);
|
dest->FastQueuePacket(&in, ack_req);
|
||||||
return;
|
break;
|
||||||
}
|
}
|
||||||
|
default: {
|
||||||
|
EQApplicationPacket *in = *p;
|
||||||
|
*p = nullptr;
|
||||||
|
|
||||||
ENCODE_FORWARD(OP_TraderBuy);
|
dest->FastQueuePacket(&in, ack_req);
|
||||||
|
LogError("Unknown Encode OP_Trader action <red>{} received. Unhandled.", action);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_TraderBuy)
|
ENCODE(OP_TraderBuy)
|
||||||
{
|
{
|
||||||
ENCODE_LENGTH_EXACT(TraderBuy_Struct);
|
ENCODE_LENGTH_EXACT(TraderBuy_Struct);
|
||||||
SETUP_DIRECT_ENCODE(TraderBuy_Struct, structs::TraderBuy_Struct);
|
SETUP_DIRECT_ENCODE(TraderBuy_Struct, structs::TraderBuy_Struct);
|
||||||
|
LogTrading(
|
||||||
|
"Encode OP_TraderBuy item_id <green>[{}] price <green>[{}] quantity <green>[{}] trader_id <green>[{}]",
|
||||||
|
emu->item_id,
|
||||||
|
emu->price,
|
||||||
|
emu->quantity,
|
||||||
|
emu->trader_id
|
||||||
|
);
|
||||||
|
|
||||||
OUT(Action);
|
OUT(action);
|
||||||
OUT(Price);
|
OUT(price);
|
||||||
OUT(TraderID);
|
OUT(trader_id);
|
||||||
memcpy(eq->ItemName, emu->ItemName, sizeof(eq->ItemName));
|
OUT(item_id);
|
||||||
OUT(ItemID);
|
OUT(already_sold);
|
||||||
OUT(Quantity);
|
OUT(quantity);
|
||||||
OUT(AlreadySold);
|
OUT_str(item_name);
|
||||||
|
|
||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ENCODE(OP_TraderShop)
|
||||||
|
{
|
||||||
|
auto action = *(uint32 *)(*p)->pBuffer;
|
||||||
|
|
||||||
|
switch (action) {
|
||||||
|
case ClickTrader: {
|
||||||
|
ENCODE_LENGTH_EXACT(TraderClick_Struct);
|
||||||
|
SETUP_DIRECT_ENCODE(TraderClick_Struct, structs::TraderClick_Struct);
|
||||||
|
LogTrading(
|
||||||
|
"ClickTrader action <green>[{}] trader_id <green>[{}]",
|
||||||
|
action,
|
||||||
|
emu->TraderID
|
||||||
|
);
|
||||||
|
|
||||||
|
eq->action = 0;
|
||||||
|
eq->trader_id = emu->TraderID;
|
||||||
|
eq->approval = emu->Approval;
|
||||||
|
|
||||||
|
FINISH_ENCODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case BuyTraderItem: {
|
||||||
|
ENCODE_LENGTH_EXACT(TraderBuy_Struct);
|
||||||
|
SETUP_DIRECT_ENCODE(TraderBuy_Struct, structs::TraderBuy_Struct);
|
||||||
|
LogTrading(
|
||||||
|
"Encode OP_TraderShop item_id <green>[{}] price <green>[{}] quantity <green>[{}] trader_id <green>[{}]",
|
||||||
|
eq->item_id,
|
||||||
|
eq->price,
|
||||||
|
eq->quantity,
|
||||||
|
eq->trader_id
|
||||||
|
);
|
||||||
|
|
||||||
|
eq->action = structs::UFBazaarTraderBuyerActions::BuyTraderItem;
|
||||||
|
OUT(price);
|
||||||
|
OUT(trader_id);
|
||||||
|
OUT(item_id);
|
||||||
|
OUT(already_sold);
|
||||||
|
OUT(quantity);
|
||||||
|
strn0cpy(eq->item_name, emu->item_name, sizeof(eq->item_name));
|
||||||
|
|
||||||
|
FINISH_ENCODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
EQApplicationPacket *in = *p;
|
||||||
|
*p = nullptr;
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&in, ack_req);
|
||||||
|
LogError("Unknown Encode OP_TraderShop action <red>[{}] received. Unhandled.", action);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ENCODE(OP_TributeItem)
|
ENCODE(OP_TributeItem)
|
||||||
{
|
{
|
||||||
ENCODE_LENGTH_EXACT(TributeItem_Struct);
|
ENCODE_LENGTH_EXACT(TributeItem_Struct);
|
||||||
@@ -3043,7 +3264,7 @@ namespace UF
|
|||||||
Bitfields->targetable = 1;
|
Bitfields->targetable = 1;
|
||||||
Bitfields->targetable_with_hotkey = emu->targetable_with_hotkey ? 1 : 0;
|
Bitfields->targetable_with_hotkey = emu->targetable_with_hotkey ? 1 : 0;
|
||||||
Bitfields->statue = 0;
|
Bitfields->statue = 0;
|
||||||
Bitfields->trader = 0;
|
Bitfields->trader = emu->trader ? 1 : 0;
|
||||||
Bitfields->buyer = 0;
|
Bitfields->buyer = 0;
|
||||||
|
|
||||||
Bitfields->showname = ShowName;
|
Bitfields->showname = ShowName;
|
||||||
@@ -3366,20 +3587,49 @@ namespace UF
|
|||||||
|
|
||||||
DECODE(OP_BazaarSearch)
|
DECODE(OP_BazaarSearch)
|
||||||
{
|
{
|
||||||
char *Buffer = (char *)__packet->pBuffer;
|
uint32 action = *(uint32 *) __packet->pBuffer;
|
||||||
|
|
||||||
uint8 SubAction = VARSTRUCT_DECODE_TYPE(uint8, Buffer);
|
switch (action) {
|
||||||
|
case structs::UFBazaarTraderBuyerActions::BazaarSearch: {
|
||||||
|
DECODE_LENGTH_EXACT(structs::BazaarSearch_Struct);
|
||||||
|
SETUP_DIRECT_DECODE(BazaarSearchCriteria_Struct, structs::BazaarSearch_Struct);
|
||||||
|
|
||||||
if ((SubAction != BazaarInspectItem) || (__packet->size != sizeof(structs::NewBazaarInspect_Struct)))
|
emu->action = eq->Beginning.Action;
|
||||||
return;
|
emu->item_stat = eq->ItemStat;
|
||||||
|
emu->max_cost = eq->MaxPrice;
|
||||||
SETUP_DIRECT_DECODE(NewBazaarInspect_Struct, structs::NewBazaarInspect_Struct);
|
emu->min_cost = eq->MinPrice;
|
||||||
MEMSET_IN(structs::NewBazaarInspect_Struct);
|
emu->max_level = eq->MaxLlevel;
|
||||||
IN(Beginning.Action);
|
emu->min_level = eq->Minlevel;
|
||||||
memcpy(emu->Name, eq->Name, sizeof(emu->Name));
|
emu->race = eq->Race;
|
||||||
IN(SerialNumber);
|
emu->slot = eq->Slot;
|
||||||
|
emu->type = eq->Type == UINT32_MAX ? UINT8_MAX : eq->Type;
|
||||||
|
emu->trader_entity_id = eq->TraderID;
|
||||||
|
emu->trader_id = 0;
|
||||||
|
emu->_class = eq->Class_;
|
||||||
|
emu->search_scope = eq->TraderID > 0 ? NonRoFBazaarSearchScope : Local_Scope;
|
||||||
|
emu->max_results = RuleI(Bazaar, MaxSearchResults);
|
||||||
|
strn0cpy(emu->item_name, eq->Name, sizeof(emu->item_name));
|
||||||
|
|
||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case structs::UFBazaarTraderBuyerActions::BazaarInspect: {
|
||||||
|
SETUP_DIRECT_DECODE(BazaarInspect_Struct, structs::BazaarInspect_Struct);
|
||||||
|
|
||||||
|
IN(action);
|
||||||
|
memcpy(emu->player_name, eq->player_name, sizeof(emu->player_name));
|
||||||
|
IN(serial_number);
|
||||||
|
|
||||||
|
FINISH_DIRECT_DECODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case structs::UFBazaarTraderBuyerActions::WelcomeMessage: {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
LogTrading("(UF) Unhandled action <red>[{}]", action);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DECODE(OP_BookButton)
|
DECODE(OP_BookButton)
|
||||||
@@ -4047,18 +4297,112 @@ namespace UF
|
|||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DECODE(OP_ShopRequest)
|
||||||
|
{
|
||||||
|
DECODE_LENGTH_EXACT(structs::MerchantClick_Struct);
|
||||||
|
SETUP_DIRECT_DECODE(MerchantClick_Struct, structs::MerchantClick_Struct);
|
||||||
|
|
||||||
|
IN(npc_id);
|
||||||
|
IN(player_id);
|
||||||
|
IN(command);
|
||||||
|
IN(rate);
|
||||||
|
emu->tab_display = 0;
|
||||||
|
emu->unknown020 = 0;
|
||||||
|
|
||||||
|
FINISH_DIRECT_DECODE();
|
||||||
|
}
|
||||||
|
|
||||||
|
DECODE(OP_Trader)
|
||||||
|
{
|
||||||
|
auto action = (uint32) __packet->pBuffer[0];
|
||||||
|
|
||||||
|
switch (action) {
|
||||||
|
case structs::UFBazaarTraderBuyerActions::BeginTraderMode: {
|
||||||
|
DECODE_LENGTH_EXACT(structs::BeginTrader_Struct);
|
||||||
|
SETUP_DIRECT_DECODE(ClickTrader_Struct, structs::BeginTrader_Struct);
|
||||||
|
LogTrading(
|
||||||
|
"Decode OP_Trader BeginTraderMode action <red>[{}]",
|
||||||
|
action
|
||||||
|
);
|
||||||
|
|
||||||
|
emu->action = TraderOn;
|
||||||
|
emu->unknown_004 = 0;
|
||||||
|
std::copy_n(eq->serial_number, UF::invtype::BAZAAR_SIZE, emu->serial_number);
|
||||||
|
std::copy_n(eq->cost, UF::invtype::BAZAAR_SIZE, emu->item_cost);
|
||||||
|
|
||||||
|
FINISH_DIRECT_DECODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case structs::UFBazaarTraderBuyerActions::EndTraderMode: {
|
||||||
|
DECODE_LENGTH_EXACT(structs::Trader_ShowItems_Struct);
|
||||||
|
SETUP_DIRECT_DECODE(Trader_ShowItems_Struct, structs::Trader_ShowItems_Struct);
|
||||||
|
LogTrading(
|
||||||
|
"Decode OP_Trader(UF) EndTraderMode action <red>[{}]",
|
||||||
|
action
|
||||||
|
);
|
||||||
|
|
||||||
|
emu->action = TraderOff;
|
||||||
|
IN(entity_id);
|
||||||
|
|
||||||
|
FINISH_DIRECT_DECODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case structs::UFBazaarTraderBuyerActions::PriceUpdate:
|
||||||
|
case structs::UFBazaarTraderBuyerActions::ItemMove:
|
||||||
|
case structs::UFBazaarTraderBuyerActions::EndTransaction:
|
||||||
|
case structs::UFBazaarTraderBuyerActions::ListTraderItems: {
|
||||||
|
LogTrading(
|
||||||
|
"Decode OP_Trader(UF) Price/ItemMove/EndTransaction/ListTraderItems action <red>[{}]",
|
||||||
|
action
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case structs::UFBazaarTraderBuyerActions::ReconcileItems: {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
LogError("Unhandled(UF) action <red>[{}] received.", action);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DECODE(OP_TraderBuy)
|
DECODE(OP_TraderBuy)
|
||||||
{
|
{
|
||||||
DECODE_LENGTH_EXACT(structs::TraderBuy_Struct);
|
DECODE_LENGTH_EXACT(structs::TraderBuy_Struct);
|
||||||
SETUP_DIRECT_DECODE(TraderBuy_Struct, structs::TraderBuy_Struct);
|
SETUP_DIRECT_DECODE(TraderBuy_Struct, structs::TraderBuy_Struct);
|
||||||
MEMSET_IN(TraderBuy_Struct);
|
LogTrading(
|
||||||
|
"Decode OP_TraderBuy(UF) item_id <green>[{}] price <green>[{}] quantity <green>[{}] trader_id <green>[{}]",
|
||||||
|
eq->item_id,
|
||||||
|
eq->price,
|
||||||
|
eq->quantity,
|
||||||
|
eq->trader_id
|
||||||
|
);
|
||||||
|
|
||||||
IN(Action);
|
emu->action = BuyTraderItem;
|
||||||
IN(Price);
|
IN(price);
|
||||||
IN(TraderID);
|
IN(trader_id);
|
||||||
memcpy(emu->ItemName, eq->ItemName, sizeof(emu->ItemName));
|
IN(item_id);
|
||||||
IN(ItemID);
|
IN(quantity);
|
||||||
IN(Quantity);
|
IN(already_sold);
|
||||||
|
strn0cpy(emu->item_name, eq->item_name, sizeof(eq->item_name));
|
||||||
|
|
||||||
|
FINISH_DIRECT_DECODE();
|
||||||
|
}
|
||||||
|
|
||||||
|
DECODE(OP_TraderShop)
|
||||||
|
{
|
||||||
|
DECODE_LENGTH_EXACT(structs::TraderClick_Struct);
|
||||||
|
SETUP_DIRECT_DECODE(TraderClick_Struct, structs::TraderClick_Struct);
|
||||||
|
LogTrading(
|
||||||
|
"(UF) action <green>[{}] trader_id <green>[{}] approval <green>[{}]",
|
||||||
|
eq->action,
|
||||||
|
eq->trader_id,
|
||||||
|
eq->approval
|
||||||
|
);
|
||||||
|
|
||||||
|
emu->Code = ClickTrader;
|
||||||
|
emu->TraderID = eq->trader_id;
|
||||||
|
emu->Approval = eq->approval;
|
||||||
|
|
||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -289,6 +289,7 @@ namespace UF
|
|||||||
const size_t CHARACTER_CREATION_LIMIT = 12;
|
const size_t CHARACTER_CREATION_LIMIT = 12;
|
||||||
|
|
||||||
const size_t SAY_LINK_BODY_SIZE = 50;
|
const size_t SAY_LINK_BODY_SIZE = 50;
|
||||||
|
const uint32 MAX_GUILD_ID = 50000;
|
||||||
|
|
||||||
} /*constants*/
|
} /*constants*/
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ E(OP_ApplyPoison)
|
|||||||
E(OP_AugmentInfo)
|
E(OP_AugmentInfo)
|
||||||
E(OP_Barter)
|
E(OP_Barter)
|
||||||
E(OP_BazaarSearch)
|
E(OP_BazaarSearch)
|
||||||
|
E(OP_BecomeTrader)
|
||||||
E(OP_Buff)
|
E(OP_Buff)
|
||||||
E(OP_BuffCreate)
|
E(OP_BuffCreate)
|
||||||
E(OP_CancelTrade)
|
E(OP_CancelTrade)
|
||||||
@@ -89,6 +90,7 @@ E(OP_SendZonepoints)
|
|||||||
E(OP_SetGuildRank)
|
E(OP_SetGuildRank)
|
||||||
E(OP_ShopPlayerBuy)
|
E(OP_ShopPlayerBuy)
|
||||||
E(OP_ShopPlayerSell)
|
E(OP_ShopPlayerSell)
|
||||||
|
E(OP_ShopRequest)
|
||||||
E(OP_SomeItemPacketMaybe)
|
E(OP_SomeItemPacketMaybe)
|
||||||
E(OP_SpawnAppearance)
|
E(OP_SpawnAppearance)
|
||||||
E(OP_SpawnDoor)
|
E(OP_SpawnDoor)
|
||||||
@@ -99,6 +101,7 @@ E(OP_TaskDescription)
|
|||||||
E(OP_Track)
|
E(OP_Track)
|
||||||
E(OP_Trader)
|
E(OP_Trader)
|
||||||
E(OP_TraderBuy)
|
E(OP_TraderBuy)
|
||||||
|
E(OP_TraderShop)
|
||||||
E(OP_TributeItem)
|
E(OP_TributeItem)
|
||||||
E(OP_VetRewardsAvaliable)
|
E(OP_VetRewardsAvaliable)
|
||||||
E(OP_WearChange)
|
E(OP_WearChange)
|
||||||
@@ -158,7 +161,10 @@ D(OP_Save)
|
|||||||
D(OP_SetServerFilter)
|
D(OP_SetServerFilter)
|
||||||
D(OP_ShopPlayerBuy)
|
D(OP_ShopPlayerBuy)
|
||||||
D(OP_ShopPlayerSell)
|
D(OP_ShopPlayerSell)
|
||||||
|
D(OP_ShopRequest)
|
||||||
|
D(OP_Trader)
|
||||||
D(OP_TraderBuy)
|
D(OP_TraderBuy)
|
||||||
|
D(OP_TraderShop)
|
||||||
D(OP_TradeSkillCombine)
|
D(OP_TradeSkillCombine)
|
||||||
D(OP_TributeItem)
|
D(OP_TributeItem)
|
||||||
D(OP_WearChange)
|
D(OP_WearChange)
|
||||||
|
|||||||
+64
-28
@@ -1916,9 +1916,9 @@ struct TimeOfDay_Struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Darvik: shopkeeper structs
|
// Darvik: shopkeeper structs
|
||||||
struct Merchant_Click_Struct {
|
struct MerchantClick_Struct {
|
||||||
/*000*/ uint32 npcid; // Merchant NPC's entity id
|
/*000*/ uint32 npc_id; // Merchant NPC's entity id
|
||||||
/*004*/ uint32 playerid;
|
/*004*/ uint32 player_id;
|
||||||
/*008*/ uint32 command; //1=open, 0=cancel/close
|
/*008*/ uint32 command; //1=open, 0=cancel/close
|
||||||
/*012*/ float rate; //cost multiplier, dosent work anymore
|
/*012*/ float rate; //cost multiplier, dosent work anymore
|
||||||
};
|
};
|
||||||
@@ -2687,10 +2687,14 @@ struct BazaarSearch_Struct {
|
|||||||
uint32 Minlevel;
|
uint32 Minlevel;
|
||||||
uint32 MaxLlevel;
|
uint32 MaxLlevel;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct BazaarInspect_Struct {
|
struct BazaarInspect_Struct {
|
||||||
uint32 ItemID;
|
uint32 action;
|
||||||
uint32 Unknown004;
|
char player_name[64];
|
||||||
char Name[64];
|
uint32 unknown_068;
|
||||||
|
uint32 serial_number;
|
||||||
|
uint32 unknown_076;
|
||||||
|
uint32 item_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NewBazaarInspect_Struct {
|
struct NewBazaarInspect_Struct {
|
||||||
@@ -2929,10 +2933,17 @@ struct WhoAllPlayerPart4 {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct Trader_Struct {
|
struct Trader_Struct {
|
||||||
uint32 code;
|
uint32 action;
|
||||||
uint32 itemid[160];
|
uint32 unknown004;
|
||||||
uint32 unknown;
|
uint64 item_id[80];
|
||||||
uint32 itemcost[80];
|
uint32 item_cost[80];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct BeginTrader_Struct {
|
||||||
|
uint32 action;
|
||||||
|
uint32 unknown04;
|
||||||
|
uint64 serial_number[80];
|
||||||
|
uint32 cost[80];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ClickTrader_Struct {
|
struct ClickTrader_Struct {
|
||||||
@@ -2946,29 +2957,29 @@ struct GetItems_Struct{
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct BecomeTrader_Struct {
|
struct BecomeTrader_Struct {
|
||||||
uint32 id;
|
uint32 entity_id;
|
||||||
uint32 code;
|
uint32 action;
|
||||||
|
char trader_name[64];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Trader_ShowItems_Struct{
|
struct Trader_ShowItems_Struct{
|
||||||
uint32 code;
|
uint32 action;
|
||||||
uint32 traderid;
|
uint32 entity_id;
|
||||||
uint32 unknown08[3];
|
uint32 unknown08[3];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TraderBuy_Struct {
|
struct TraderBuy_Struct {
|
||||||
/*000*/ uint32 Action;
|
uint32 action;
|
||||||
/*004*/ uint32 Unknown004;
|
uint32 unknown_004;
|
||||||
/*008*/ uint32 Price;
|
uint32 price;
|
||||||
/*012*/ uint32 Unknown008; // Probably high order bits of a 64 bit price.
|
uint32 unknown_008; // Probably high order bits of a 64 bit price.
|
||||||
/*016*/ uint32 TraderID;
|
uint32 trader_id;
|
||||||
/*020*/ char ItemName[64];
|
char item_name[64];
|
||||||
/*084*/ uint32 Unknown076;
|
uint32 unknown_076;
|
||||||
/*088*/ uint32 ItemID;
|
uint32 item_id;
|
||||||
/*092*/ uint32 AlreadySold;
|
uint32 already_sold;
|
||||||
/*096*/ uint32 Quantity;
|
uint32 quantity;
|
||||||
/*100*/ uint32 Unknown092;
|
uint32 unknown_092;
|
||||||
/*104*/
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TraderItemUpdate_Struct{
|
struct TraderItemUpdate_Struct{
|
||||||
@@ -3002,8 +3013,9 @@ struct TraderDelItem_Struct{
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct TraderClick_Struct{
|
struct TraderClick_Struct{
|
||||||
uint32 traderid;
|
uint32 trader_id;
|
||||||
uint32 unknown4[2];
|
uint32 action;
|
||||||
|
uint32 unknown_004;
|
||||||
uint32 approval;
|
uint32 approval;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -4674,6 +4686,30 @@ struct SayLinkBodyFrame_Struct {
|
|||||||
/*050*/
|
/*050*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct TraderPriceUpdate_Struct {
|
||||||
|
/*000*/ uint32 action;
|
||||||
|
/*004*/ uint32 sub_action;
|
||||||
|
/*008*/ int32 serial_number;
|
||||||
|
/*012*/ uint32 unknown_012;
|
||||||
|
/*016*/ uint32 new_price;
|
||||||
|
/*020*/ uint32 unknown_016;
|
||||||
|
};
|
||||||
|
|
||||||
|
enum UFBazaarTraderBuyerActions {
|
||||||
|
Zero = 0,
|
||||||
|
BeginTraderMode = 1,
|
||||||
|
EndTraderMode = 2,
|
||||||
|
PriceUpdate = 3,
|
||||||
|
EndTransaction = 4,
|
||||||
|
BazaarSearch = 7,
|
||||||
|
WelcomeMessage = 9,
|
||||||
|
BuyTraderItem = 10,
|
||||||
|
ListTraderItems = 11,
|
||||||
|
BazaarInspect = 18,
|
||||||
|
ItemMove = 19,
|
||||||
|
ReconcileItems = 20
|
||||||
|
};
|
||||||
|
|
||||||
}; /*structs*/
|
}; /*structs*/
|
||||||
|
|
||||||
}; /*UF*/
|
}; /*UF*/
|
||||||
|
|||||||
+1
-1
@@ -1379,7 +1379,7 @@ uint32 GetPlayerRaceValue(uint16 race_id) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 GetPlayerRaceBit(uint16 race_id) {
|
uint16 GetPlayerRaceBit(uint16 race_id) {
|
||||||
switch (race_id) {
|
switch (race_id) {
|
||||||
case HUMAN:
|
case HUMAN:
|
||||||
return PLAYER_RACE_HUMAN_BIT;
|
return PLAYER_RACE_HUMAN_BIT;
|
||||||
|
|||||||
+1
-1
@@ -124,7 +124,7 @@ bool IsPlayerRace(uint16 race_id);
|
|||||||
const std::string GetPlayerRaceAbbreviation(uint16 race_id);
|
const std::string GetPlayerRaceAbbreviation(uint16 race_id);
|
||||||
|
|
||||||
uint32 GetPlayerRaceValue(uint16 race_id);
|
uint32 GetPlayerRaceValue(uint16 race_id);
|
||||||
uint32 GetPlayerRaceBit(uint16 race_id);
|
uint16 GetPlayerRaceBit(uint16 race_id);
|
||||||
|
|
||||||
uint16 GetRaceIDFromPlayerRaceValue(uint32 player_race_value);
|
uint16 GetRaceIDFromPlayerRaceValue(uint32 player_race_value);
|
||||||
uint16 GetRaceIDFromPlayerRaceBit(uint32 player_race_bit);
|
uint16 GetRaceIDFromPlayerRaceBit(uint32 player_race_bit);
|
||||||
|
|||||||
@@ -44,7 +44,69 @@ public:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Custom extended repository methods here
|
// Custom extended repository methods here
|
||||||
|
static int16 GetAccountStatus(Database& db, const uint32 account_id)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"SELECT `status`, TIMESTAMPDIFF(SECOND, NOW(), `suspendeduntil`) FROM `{}` WHERE `{}` = {}",
|
||||||
|
TableName(),
|
||||||
|
PrimaryKey(),
|
||||||
|
account_id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!results.Success() || !results.RowCount()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto row = results.begin();
|
||||||
|
|
||||||
|
int16 status = static_cast<int16>(Strings::ToInt(row[0]));
|
||||||
|
int date_diff = 0;
|
||||||
|
|
||||||
|
if (row[1]) {
|
||||||
|
date_diff = Strings::ToInt(row[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (date_diff > 0) {
|
||||||
|
status = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool UpdatePassword(Database& db, const uint32 account_id, const std::string& password)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"UPDATE `{}` SET `password` = MD5('{}') WHERE `{}` = {}",
|
||||||
|
TableName(),
|
||||||
|
password,
|
||||||
|
PrimaryKey(),
|
||||||
|
account_id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return results.Success();
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string GetAutoLoginCharacterNameByAccountID(Database& db, const uint32 account_id)
|
||||||
|
{
|
||||||
|
return AccountRepository::FindOne(db, account_id).auto_login_charname;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool SetAutoLoginCharacterNameByAccountID(Database& db, const uint32 account_id, const std::string& character_name)
|
||||||
|
{
|
||||||
|
auto e = AccountRepository::FindOne(db, account_id);
|
||||||
|
|
||||||
|
if (!e.id) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.auto_login_charname = character_name;
|
||||||
|
|
||||||
|
return AccountRepository::UpdateOne(db, e);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //EQEMU_ACCOUNT_REPOSITORY_H
|
#endif //EQEMU_ACCOUNT_REPOSITORY_H
|
||||||
|
|||||||
@@ -44,7 +44,65 @@ public:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Custom extended repository methods here
|
// Custom extended repository methods here
|
||||||
|
static void UpdateAdventureStatsEntry(Database& db, uint32 character_id, uint8 theme_id, bool is_win, bool is_remove)
|
||||||
|
{
|
||||||
|
std::string field;
|
||||||
|
|
||||||
|
switch (theme_id) {
|
||||||
|
case LDoNThemes::GUK: {
|
||||||
|
field = "guk_";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case LDoNThemes::MIR: {
|
||||||
|
field = "mir_";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case LDoNThemes::MMC: {
|
||||||
|
field = "mmc_";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case LDoNThemes::RUJ: {
|
||||||
|
field = "ruj_";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case LDoNThemes::TAK: {
|
||||||
|
field = "tak_";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
field += is_win ? "wins" : "losses";
|
||||||
|
|
||||||
|
auto e = FindOne(db, character_id);
|
||||||
|
|
||||||
|
if (!e.player_id && !is_remove) {
|
||||||
|
const std::string& query = fmt::format(
|
||||||
|
"INSERT INTO `{}` SET `{}` = 1, `{}` = {}",
|
||||||
|
TableName(),
|
||||||
|
field,
|
||||||
|
PrimaryKey(),
|
||||||
|
character_id
|
||||||
|
);
|
||||||
|
|
||||||
|
db.QueryDatabase(query);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::string& field_operation = is_remove ? "-" : "+";
|
||||||
|
|
||||||
|
const std::string& query = fmt::format(
|
||||||
|
"UPDATE `{}` SET `{}` = {} {} 1 WHERE `{}` = {}",
|
||||||
|
TableName(),
|
||||||
|
field,
|
||||||
|
field,
|
||||||
|
field_operation,
|
||||||
|
PrimaryKey(),
|
||||||
|
character_id
|
||||||
|
);
|
||||||
|
|
||||||
|
db.QueryDatabase(query);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //EQEMU_ADVENTURE_STATS_REPOSITORY_H
|
#endif //EQEMU_ADVENTURE_STATS_REPOSITORY_H
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public:
|
|||||||
int32_t accid;
|
int32_t accid;
|
||||||
std::string ip;
|
std::string ip;
|
||||||
int32_t count;
|
int32_t count;
|
||||||
std::string lastused;
|
time_t lastused;
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::string PrimaryKey()
|
static std::string PrimaryKey()
|
||||||
@@ -46,7 +46,7 @@ public:
|
|||||||
"accid",
|
"accid",
|
||||||
"ip",
|
"ip",
|
||||||
"count",
|
"count",
|
||||||
"lastused",
|
"UNIX_TIMESTAMP(lastused)",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ public:
|
|||||||
e.accid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
e.accid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
||||||
e.ip = row[1] ? row[1] : "";
|
e.ip = row[1] ? row[1] : "";
|
||||||
e.count = row[2] ? static_cast<int32_t>(atoi(row[2])) : 1;
|
e.count = row[2] ? static_cast<int32_t>(atoi(row[2])) : 1;
|
||||||
e.lastused = row[3] ? row[3] : std::time(nullptr);
|
e.lastused = strtoll(row[3] ? row[3] : "-1", nullptr, 10);
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -167,7 +167,7 @@ public:
|
|||||||
v.push_back(columns[0] + " = " + std::to_string(e.accid));
|
v.push_back(columns[0] + " = " + std::to_string(e.accid));
|
||||||
v.push_back(columns[1] + " = '" + Strings::Escape(e.ip) + "'");
|
v.push_back(columns[1] + " = '" + Strings::Escape(e.ip) + "'");
|
||||||
v.push_back(columns[2] + " = " + std::to_string(e.count));
|
v.push_back(columns[2] + " = " + std::to_string(e.count));
|
||||||
v.push_back(columns[3] + " = '" + Strings::Escape(e.lastused) + "'");
|
v.push_back(columns[3] + " = FROM_UNIXTIME(" + (e.lastused > 0 ? std::to_string(e.lastused) : "null") + ")");
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -192,7 +192,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.accid));
|
v.push_back(std::to_string(e.accid));
|
||||||
v.push_back("'" + Strings::Escape(e.ip) + "'");
|
v.push_back("'" + Strings::Escape(e.ip) + "'");
|
||||||
v.push_back(std::to_string(e.count));
|
v.push_back(std::to_string(e.count));
|
||||||
v.push_back("'" + Strings::Escape(e.lastused) + "'");
|
v.push_back("FROM_UNIXTIME(" + (e.lastused > 0 ? std::to_string(e.lastused) : "null") + ")");
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -225,7 +225,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.accid));
|
v.push_back(std::to_string(e.accid));
|
||||||
v.push_back("'" + Strings::Escape(e.ip) + "'");
|
v.push_back("'" + Strings::Escape(e.ip) + "'");
|
||||||
v.push_back(std::to_string(e.count));
|
v.push_back(std::to_string(e.count));
|
||||||
v.push_back("'" + Strings::Escape(e.lastused) + "'");
|
v.push_back("FROM_UNIXTIME(" + (e.lastused > 0 ? std::to_string(e.lastused) : "null") + ")");
|
||||||
|
|
||||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
}
|
}
|
||||||
@@ -262,7 +262,7 @@ public:
|
|||||||
e.accid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
e.accid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
||||||
e.ip = row[1] ? row[1] : "";
|
e.ip = row[1] ? row[1] : "";
|
||||||
e.count = row[2] ? static_cast<int32_t>(atoi(row[2])) : 1;
|
e.count = row[2] ? static_cast<int32_t>(atoi(row[2])) : 1;
|
||||||
e.lastused = row[3] ? row[3] : std::time(nullptr);
|
e.lastused = strtoll(row[3] ? row[3] : "-1", nullptr, 10);
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -290,7 +290,7 @@ public:
|
|||||||
e.accid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
e.accid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
||||||
e.ip = row[1] ? row[1] : "";
|
e.ip = row[1] ? row[1] : "";
|
||||||
e.count = row[2] ? static_cast<int32_t>(atoi(row[2])) : 1;
|
e.count = row[2] ? static_cast<int32_t>(atoi(row[2])) : 1;
|
||||||
e.lastused = row[3] ? row[3] : std::time(nullptr);
|
e.lastused = strtoll(row[3] ? row[3] : "-1", nullptr, 10);
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -368,7 +368,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.accid));
|
v.push_back(std::to_string(e.accid));
|
||||||
v.push_back("'" + Strings::Escape(e.ip) + "'");
|
v.push_back("'" + Strings::Escape(e.ip) + "'");
|
||||||
v.push_back(std::to_string(e.count));
|
v.push_back(std::to_string(e.count));
|
||||||
v.push_back("'" + Strings::Escape(e.lastused) + "'");
|
v.push_back("FROM_UNIXTIME(" + (e.lastused > 0 ? std::to_string(e.lastused) : "null") + ")");
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -394,7 +394,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.accid));
|
v.push_back(std::to_string(e.accid));
|
||||||
v.push_back("'" + Strings::Escape(e.ip) + "'");
|
v.push_back("'" + Strings::Escape(e.ip) + "'");
|
||||||
v.push_back(std::to_string(e.count));
|
v.push_back(std::to_string(e.count));
|
||||||
v.push_back("'" + Strings::Escape(e.lastused) + "'");
|
v.push_back("FROM_UNIXTIME(" + (e.lastused > 0 ? std::to_string(e.lastused) : "null") + ")");
|
||||||
|
|
||||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ public:
|
|||||||
int32_t id;
|
int32_t id;
|
||||||
std::string name;
|
std::string name;
|
||||||
std::string charname;
|
std::string charname;
|
||||||
|
std::string auto_login_charname;
|
||||||
uint32_t sharedplat;
|
uint32_t sharedplat;
|
||||||
std::string password;
|
std::string password;
|
||||||
int32_t status;
|
int32_t status;
|
||||||
@@ -56,6 +57,7 @@ public:
|
|||||||
"id",
|
"id",
|
||||||
"name",
|
"name",
|
||||||
"charname",
|
"charname",
|
||||||
|
"auto_login_charname",
|
||||||
"sharedplat",
|
"sharedplat",
|
||||||
"password",
|
"password",
|
||||||
"status",
|
"status",
|
||||||
@@ -86,6 +88,7 @@ public:
|
|||||||
"id",
|
"id",
|
||||||
"name",
|
"name",
|
||||||
"charname",
|
"charname",
|
||||||
|
"auto_login_charname",
|
||||||
"sharedplat",
|
"sharedplat",
|
||||||
"password",
|
"password",
|
||||||
"status",
|
"status",
|
||||||
@@ -150,6 +153,7 @@ public:
|
|||||||
e.id = 0;
|
e.id = 0;
|
||||||
e.name = "";
|
e.name = "";
|
||||||
e.charname = "";
|
e.charname = "";
|
||||||
|
e.auto_login_charname = "";
|
||||||
e.sharedplat = 0;
|
e.sharedplat = 0;
|
||||||
e.password = "";
|
e.password = "";
|
||||||
e.status = 0;
|
e.status = 0;
|
||||||
@@ -210,27 +214,28 @@ public:
|
|||||||
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
||||||
e.name = row[1] ? row[1] : "";
|
e.name = row[1] ? row[1] : "";
|
||||||
e.charname = row[2] ? row[2] : "";
|
e.charname = row[2] ? row[2] : "";
|
||||||
e.sharedplat = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
e.auto_login_charname = row[3] ? row[3] : "";
|
||||||
e.password = row[4] ? row[4] : "";
|
e.sharedplat = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
e.status = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
|
e.password = row[5] ? row[5] : "";
|
||||||
e.ls_id = row[6] ? row[6] : "eqemu";
|
e.status = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
|
||||||
e.lsaccount_id = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
e.ls_id = row[7] ? row[7] : "eqemu";
|
||||||
e.gmspeed = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 0;
|
e.lsaccount_id = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||||
e.invulnerable = row[9] ? static_cast<int8_t>(atoi(row[9])) : 0;
|
e.gmspeed = row[9] ? static_cast<uint8_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||||
e.flymode = row[10] ? static_cast<int8_t>(atoi(row[10])) : 0;
|
e.invulnerable = row[10] ? static_cast<int8_t>(atoi(row[10])) : 0;
|
||||||
e.ignore_tells = row[11] ? static_cast<int8_t>(atoi(row[11])) : 0;
|
e.flymode = row[11] ? static_cast<int8_t>(atoi(row[11])) : 0;
|
||||||
e.revoked = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
|
e.ignore_tells = row[12] ? static_cast<int8_t>(atoi(row[12])) : 0;
|
||||||
e.karma = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
|
e.revoked = row[13] ? static_cast<uint8_t>(strtoul(row[13], nullptr, 10)) : 0;
|
||||||
e.minilogin_ip = row[14] ? row[14] : "";
|
e.karma = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
|
||||||
e.hideme = row[15] ? static_cast<int8_t>(atoi(row[15])) : 0;
|
e.minilogin_ip = row[15] ? row[15] : "";
|
||||||
e.rulesflag = row[16] ? static_cast<uint8_t>(strtoul(row[16], nullptr, 10)) : 0;
|
e.hideme = row[16] ? static_cast<int8_t>(atoi(row[16])) : 0;
|
||||||
e.suspendeduntil = strtoll(row[17] ? row[17] : "-1", nullptr, 10);
|
e.rulesflag = row[17] ? static_cast<uint8_t>(strtoul(row[17], nullptr, 10)) : 0;
|
||||||
e.time_creation = row[18] ? static_cast<uint32_t>(strtoul(row[18], nullptr, 10)) : 0;
|
e.suspendeduntil = strtoll(row[18] ? row[18] : "-1", nullptr, 10);
|
||||||
e.ban_reason = row[19] ? row[19] : "";
|
e.time_creation = row[19] ? static_cast<uint32_t>(strtoul(row[19], nullptr, 10)) : 0;
|
||||||
e.suspend_reason = row[20] ? row[20] : "";
|
e.ban_reason = row[20] ? row[20] : "";
|
||||||
e.crc_eqgame = row[21] ? row[21] : "";
|
e.suspend_reason = row[21] ? row[21] : "";
|
||||||
e.crc_skillcaps = row[22] ? row[22] : "";
|
e.crc_eqgame = row[22] ? row[22] : "";
|
||||||
e.crc_basedata = row[23] ? row[23] : "";
|
e.crc_skillcaps = row[23] ? row[23] : "";
|
||||||
|
e.crc_basedata = row[24] ? row[24] : "";
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -266,27 +271,28 @@ public:
|
|||||||
|
|
||||||
v.push_back(columns[1] + " = '" + Strings::Escape(e.name) + "'");
|
v.push_back(columns[1] + " = '" + Strings::Escape(e.name) + "'");
|
||||||
v.push_back(columns[2] + " = '" + Strings::Escape(e.charname) + "'");
|
v.push_back(columns[2] + " = '" + Strings::Escape(e.charname) + "'");
|
||||||
v.push_back(columns[3] + " = " + std::to_string(e.sharedplat));
|
v.push_back(columns[3] + " = '" + Strings::Escape(e.auto_login_charname) + "'");
|
||||||
v.push_back(columns[4] + " = '" + Strings::Escape(e.password) + "'");
|
v.push_back(columns[4] + " = " + std::to_string(e.sharedplat));
|
||||||
v.push_back(columns[5] + " = " + std::to_string(e.status));
|
v.push_back(columns[5] + " = '" + Strings::Escape(e.password) + "'");
|
||||||
v.push_back(columns[6] + " = '" + Strings::Escape(e.ls_id) + "'");
|
v.push_back(columns[6] + " = " + std::to_string(e.status));
|
||||||
v.push_back(columns[7] + " = " + std::to_string(e.lsaccount_id));
|
v.push_back(columns[7] + " = '" + Strings::Escape(e.ls_id) + "'");
|
||||||
v.push_back(columns[8] + " = " + std::to_string(e.gmspeed));
|
v.push_back(columns[8] + " = " + std::to_string(e.lsaccount_id));
|
||||||
v.push_back(columns[9] + " = " + std::to_string(e.invulnerable));
|
v.push_back(columns[9] + " = " + std::to_string(e.gmspeed));
|
||||||
v.push_back(columns[10] + " = " + std::to_string(e.flymode));
|
v.push_back(columns[10] + " = " + std::to_string(e.invulnerable));
|
||||||
v.push_back(columns[11] + " = " + std::to_string(e.ignore_tells));
|
v.push_back(columns[11] + " = " + std::to_string(e.flymode));
|
||||||
v.push_back(columns[12] + " = " + std::to_string(e.revoked));
|
v.push_back(columns[12] + " = " + std::to_string(e.ignore_tells));
|
||||||
v.push_back(columns[13] + " = " + std::to_string(e.karma));
|
v.push_back(columns[13] + " = " + std::to_string(e.revoked));
|
||||||
v.push_back(columns[14] + " = '" + Strings::Escape(e.minilogin_ip) + "'");
|
v.push_back(columns[14] + " = " + std::to_string(e.karma));
|
||||||
v.push_back(columns[15] + " = " + std::to_string(e.hideme));
|
v.push_back(columns[15] + " = '" + Strings::Escape(e.minilogin_ip) + "'");
|
||||||
v.push_back(columns[16] + " = " + std::to_string(e.rulesflag));
|
v.push_back(columns[16] + " = " + std::to_string(e.hideme));
|
||||||
v.push_back(columns[17] + " = FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "null") + ")");
|
v.push_back(columns[17] + " = " + std::to_string(e.rulesflag));
|
||||||
v.push_back(columns[18] + " = " + std::to_string(e.time_creation));
|
v.push_back(columns[18] + " = FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "null") + ")");
|
||||||
v.push_back(columns[19] + " = '" + Strings::Escape(e.ban_reason) + "'");
|
v.push_back(columns[19] + " = " + std::to_string(e.time_creation));
|
||||||
v.push_back(columns[20] + " = '" + Strings::Escape(e.suspend_reason) + "'");
|
v.push_back(columns[20] + " = '" + Strings::Escape(e.ban_reason) + "'");
|
||||||
v.push_back(columns[21] + " = '" + Strings::Escape(e.crc_eqgame) + "'");
|
v.push_back(columns[21] + " = '" + Strings::Escape(e.suspend_reason) + "'");
|
||||||
v.push_back(columns[22] + " = '" + Strings::Escape(e.crc_skillcaps) + "'");
|
v.push_back(columns[22] + " = '" + Strings::Escape(e.crc_eqgame) + "'");
|
||||||
v.push_back(columns[23] + " = '" + Strings::Escape(e.crc_basedata) + "'");
|
v.push_back(columns[23] + " = '" + Strings::Escape(e.crc_skillcaps) + "'");
|
||||||
|
v.push_back(columns[24] + " = '" + Strings::Escape(e.crc_basedata) + "'");
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -311,6 +317,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.id));
|
v.push_back(std::to_string(e.id));
|
||||||
v.push_back("'" + Strings::Escape(e.name) + "'");
|
v.push_back("'" + Strings::Escape(e.name) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.charname) + "'");
|
v.push_back("'" + Strings::Escape(e.charname) + "'");
|
||||||
|
v.push_back("'" + Strings::Escape(e.auto_login_charname) + "'");
|
||||||
v.push_back(std::to_string(e.sharedplat));
|
v.push_back(std::to_string(e.sharedplat));
|
||||||
v.push_back("'" + Strings::Escape(e.password) + "'");
|
v.push_back("'" + Strings::Escape(e.password) + "'");
|
||||||
v.push_back(std::to_string(e.status));
|
v.push_back(std::to_string(e.status));
|
||||||
@@ -364,6 +371,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.id));
|
v.push_back(std::to_string(e.id));
|
||||||
v.push_back("'" + Strings::Escape(e.name) + "'");
|
v.push_back("'" + Strings::Escape(e.name) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.charname) + "'");
|
v.push_back("'" + Strings::Escape(e.charname) + "'");
|
||||||
|
v.push_back("'" + Strings::Escape(e.auto_login_charname) + "'");
|
||||||
v.push_back(std::to_string(e.sharedplat));
|
v.push_back(std::to_string(e.sharedplat));
|
||||||
v.push_back("'" + Strings::Escape(e.password) + "'");
|
v.push_back("'" + Strings::Escape(e.password) + "'");
|
||||||
v.push_back(std::to_string(e.status));
|
v.push_back(std::to_string(e.status));
|
||||||
@@ -421,27 +429,28 @@ public:
|
|||||||
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
||||||
e.name = row[1] ? row[1] : "";
|
e.name = row[1] ? row[1] : "";
|
||||||
e.charname = row[2] ? row[2] : "";
|
e.charname = row[2] ? row[2] : "";
|
||||||
e.sharedplat = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
e.auto_login_charname = row[3] ? row[3] : "";
|
||||||
e.password = row[4] ? row[4] : "";
|
e.sharedplat = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
e.status = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
|
e.password = row[5] ? row[5] : "";
|
||||||
e.ls_id = row[6] ? row[6] : "eqemu";
|
e.status = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
|
||||||
e.lsaccount_id = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
e.ls_id = row[7] ? row[7] : "eqemu";
|
||||||
e.gmspeed = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 0;
|
e.lsaccount_id = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||||
e.invulnerable = row[9] ? static_cast<int8_t>(atoi(row[9])) : 0;
|
e.gmspeed = row[9] ? static_cast<uint8_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||||
e.flymode = row[10] ? static_cast<int8_t>(atoi(row[10])) : 0;
|
e.invulnerable = row[10] ? static_cast<int8_t>(atoi(row[10])) : 0;
|
||||||
e.ignore_tells = row[11] ? static_cast<int8_t>(atoi(row[11])) : 0;
|
e.flymode = row[11] ? static_cast<int8_t>(atoi(row[11])) : 0;
|
||||||
e.revoked = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
|
e.ignore_tells = row[12] ? static_cast<int8_t>(atoi(row[12])) : 0;
|
||||||
e.karma = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
|
e.revoked = row[13] ? static_cast<uint8_t>(strtoul(row[13], nullptr, 10)) : 0;
|
||||||
e.minilogin_ip = row[14] ? row[14] : "";
|
e.karma = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
|
||||||
e.hideme = row[15] ? static_cast<int8_t>(atoi(row[15])) : 0;
|
e.minilogin_ip = row[15] ? row[15] : "";
|
||||||
e.rulesflag = row[16] ? static_cast<uint8_t>(strtoul(row[16], nullptr, 10)) : 0;
|
e.hideme = row[16] ? static_cast<int8_t>(atoi(row[16])) : 0;
|
||||||
e.suspendeduntil = strtoll(row[17] ? row[17] : "-1", nullptr, 10);
|
e.rulesflag = row[17] ? static_cast<uint8_t>(strtoul(row[17], nullptr, 10)) : 0;
|
||||||
e.time_creation = row[18] ? static_cast<uint32_t>(strtoul(row[18], nullptr, 10)) : 0;
|
e.suspendeduntil = strtoll(row[18] ? row[18] : "-1", nullptr, 10);
|
||||||
e.ban_reason = row[19] ? row[19] : "";
|
e.time_creation = row[19] ? static_cast<uint32_t>(strtoul(row[19], nullptr, 10)) : 0;
|
||||||
e.suspend_reason = row[20] ? row[20] : "";
|
e.ban_reason = row[20] ? row[20] : "";
|
||||||
e.crc_eqgame = row[21] ? row[21] : "";
|
e.suspend_reason = row[21] ? row[21] : "";
|
||||||
e.crc_skillcaps = row[22] ? row[22] : "";
|
e.crc_eqgame = row[22] ? row[22] : "";
|
||||||
e.crc_basedata = row[23] ? row[23] : "";
|
e.crc_skillcaps = row[23] ? row[23] : "";
|
||||||
|
e.crc_basedata = row[24] ? row[24] : "";
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -469,27 +478,28 @@ public:
|
|||||||
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
||||||
e.name = row[1] ? row[1] : "";
|
e.name = row[1] ? row[1] : "";
|
||||||
e.charname = row[2] ? row[2] : "";
|
e.charname = row[2] ? row[2] : "";
|
||||||
e.sharedplat = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
e.auto_login_charname = row[3] ? row[3] : "";
|
||||||
e.password = row[4] ? row[4] : "";
|
e.sharedplat = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
e.status = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
|
e.password = row[5] ? row[5] : "";
|
||||||
e.ls_id = row[6] ? row[6] : "eqemu";
|
e.status = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
|
||||||
e.lsaccount_id = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
e.ls_id = row[7] ? row[7] : "eqemu";
|
||||||
e.gmspeed = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 0;
|
e.lsaccount_id = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||||
e.invulnerable = row[9] ? static_cast<int8_t>(atoi(row[9])) : 0;
|
e.gmspeed = row[9] ? static_cast<uint8_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||||
e.flymode = row[10] ? static_cast<int8_t>(atoi(row[10])) : 0;
|
e.invulnerable = row[10] ? static_cast<int8_t>(atoi(row[10])) : 0;
|
||||||
e.ignore_tells = row[11] ? static_cast<int8_t>(atoi(row[11])) : 0;
|
e.flymode = row[11] ? static_cast<int8_t>(atoi(row[11])) : 0;
|
||||||
e.revoked = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
|
e.ignore_tells = row[12] ? static_cast<int8_t>(atoi(row[12])) : 0;
|
||||||
e.karma = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
|
e.revoked = row[13] ? static_cast<uint8_t>(strtoul(row[13], nullptr, 10)) : 0;
|
||||||
e.minilogin_ip = row[14] ? row[14] : "";
|
e.karma = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
|
||||||
e.hideme = row[15] ? static_cast<int8_t>(atoi(row[15])) : 0;
|
e.minilogin_ip = row[15] ? row[15] : "";
|
||||||
e.rulesflag = row[16] ? static_cast<uint8_t>(strtoul(row[16], nullptr, 10)) : 0;
|
e.hideme = row[16] ? static_cast<int8_t>(atoi(row[16])) : 0;
|
||||||
e.suspendeduntil = strtoll(row[17] ? row[17] : "-1", nullptr, 10);
|
e.rulesflag = row[17] ? static_cast<uint8_t>(strtoul(row[17], nullptr, 10)) : 0;
|
||||||
e.time_creation = row[18] ? static_cast<uint32_t>(strtoul(row[18], nullptr, 10)) : 0;
|
e.suspendeduntil = strtoll(row[18] ? row[18] : "-1", nullptr, 10);
|
||||||
e.ban_reason = row[19] ? row[19] : "";
|
e.time_creation = row[19] ? static_cast<uint32_t>(strtoul(row[19], nullptr, 10)) : 0;
|
||||||
e.suspend_reason = row[20] ? row[20] : "";
|
e.ban_reason = row[20] ? row[20] : "";
|
||||||
e.crc_eqgame = row[21] ? row[21] : "";
|
e.suspend_reason = row[21] ? row[21] : "";
|
||||||
e.crc_skillcaps = row[22] ? row[22] : "";
|
e.crc_eqgame = row[22] ? row[22] : "";
|
||||||
e.crc_basedata = row[23] ? row[23] : "";
|
e.crc_skillcaps = row[23] ? row[23] : "";
|
||||||
|
e.crc_basedata = row[24] ? row[24] : "";
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -567,6 +577,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.id));
|
v.push_back(std::to_string(e.id));
|
||||||
v.push_back("'" + Strings::Escape(e.name) + "'");
|
v.push_back("'" + Strings::Escape(e.name) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.charname) + "'");
|
v.push_back("'" + Strings::Escape(e.charname) + "'");
|
||||||
|
v.push_back("'" + Strings::Escape(e.auto_login_charname) + "'");
|
||||||
v.push_back(std::to_string(e.sharedplat));
|
v.push_back(std::to_string(e.sharedplat));
|
||||||
v.push_back("'" + Strings::Escape(e.password) + "'");
|
v.push_back("'" + Strings::Escape(e.password) + "'");
|
||||||
v.push_back(std::to_string(e.status));
|
v.push_back(std::to_string(e.status));
|
||||||
@@ -613,6 +624,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.id));
|
v.push_back(std::to_string(e.id));
|
||||||
v.push_back("'" + Strings::Escape(e.name) + "'");
|
v.push_back("'" + Strings::Escape(e.name) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.charname) + "'");
|
v.push_back("'" + Strings::Escape(e.charname) + "'");
|
||||||
|
v.push_back("'" + Strings::Escape(e.auto_login_charname) + "'");
|
||||||
v.push_back(std::to_string(e.sharedplat));
|
v.push_back(std::to_string(e.sharedplat));
|
||||||
v.push_back("'" + Strings::Escape(e.password) + "'");
|
v.push_back("'" + Strings::Escape(e.password) + "'");
|
||||||
v.push_back(std::to_string(e.status));
|
v.push_back(std::to_string(e.status));
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ public:
|
|||||||
int32_t int_;
|
int32_t int_;
|
||||||
int32_t agi;
|
int32_t agi;
|
||||||
int32_t wis;
|
int32_t wis;
|
||||||
|
int32_t extra_haste;
|
||||||
int16_t fire;
|
int16_t fire;
|
||||||
int16_t cold;
|
int16_t cold;
|
||||||
int16_t magic;
|
int16_t magic;
|
||||||
@@ -118,6 +119,7 @@ public:
|
|||||||
"`int`",
|
"`int`",
|
||||||
"agi",
|
"agi",
|
||||||
"wis",
|
"wis",
|
||||||
|
"extra_haste",
|
||||||
"fire",
|
"fire",
|
||||||
"cold",
|
"cold",
|
||||||
"magic",
|
"magic",
|
||||||
@@ -175,6 +177,7 @@ public:
|
|||||||
"`int`",
|
"`int`",
|
||||||
"agi",
|
"agi",
|
||||||
"wis",
|
"wis",
|
||||||
|
"extra_haste",
|
||||||
"fire",
|
"fire",
|
||||||
"cold",
|
"cold",
|
||||||
"magic",
|
"magic",
|
||||||
@@ -266,6 +269,7 @@ public:
|
|||||||
e.int_ = 75;
|
e.int_ = 75;
|
||||||
e.agi = 75;
|
e.agi = 75;
|
||||||
e.wis = 75;
|
e.wis = 75;
|
||||||
|
e.extra_haste = 0;
|
||||||
e.fire = 0;
|
e.fire = 0;
|
||||||
e.cold = 0;
|
e.cold = 0;
|
||||||
e.magic = 0;
|
e.magic = 0;
|
||||||
@@ -353,19 +357,20 @@ public:
|
|||||||
e.int_ = row[35] ? static_cast<int32_t>(atoi(row[35])) : 75;
|
e.int_ = row[35] ? static_cast<int32_t>(atoi(row[35])) : 75;
|
||||||
e.agi = row[36] ? static_cast<int32_t>(atoi(row[36])) : 75;
|
e.agi = row[36] ? static_cast<int32_t>(atoi(row[36])) : 75;
|
||||||
e.wis = row[37] ? static_cast<int32_t>(atoi(row[37])) : 75;
|
e.wis = row[37] ? static_cast<int32_t>(atoi(row[37])) : 75;
|
||||||
e.fire = row[38] ? static_cast<int16_t>(atoi(row[38])) : 0;
|
e.extra_haste = row[38] ? static_cast<int32_t>(atoi(row[38])) : 0;
|
||||||
e.cold = row[39] ? static_cast<int16_t>(atoi(row[39])) : 0;
|
e.fire = row[39] ? static_cast<int16_t>(atoi(row[39])) : 0;
|
||||||
e.magic = row[40] ? static_cast<int16_t>(atoi(row[40])) : 0;
|
e.cold = row[40] ? static_cast<int16_t>(atoi(row[40])) : 0;
|
||||||
e.poison = row[41] ? static_cast<int16_t>(atoi(row[41])) : 0;
|
e.magic = row[41] ? static_cast<int16_t>(atoi(row[41])) : 0;
|
||||||
e.disease = row[42] ? static_cast<int16_t>(atoi(row[42])) : 0;
|
e.poison = row[42] ? static_cast<int16_t>(atoi(row[42])) : 0;
|
||||||
e.corruption = row[43] ? static_cast<int16_t>(atoi(row[43])) : 0;
|
e.disease = row[43] ? static_cast<int16_t>(atoi(row[43])) : 0;
|
||||||
e.show_helm = row[44] ? static_cast<uint32_t>(strtoul(row[44], nullptr, 10)) : 0;
|
e.corruption = row[44] ? static_cast<int16_t>(atoi(row[44])) : 0;
|
||||||
e.follow_distance = row[45] ? static_cast<uint32_t>(strtoul(row[45], nullptr, 10)) : 200;
|
e.show_helm = row[45] ? static_cast<uint32_t>(strtoul(row[45], nullptr, 10)) : 0;
|
||||||
e.stop_melee_level = row[46] ? static_cast<uint8_t>(strtoul(row[46], nullptr, 10)) : 255;
|
e.follow_distance = row[46] ? static_cast<uint32_t>(strtoul(row[46], nullptr, 10)) : 200;
|
||||||
e.expansion_bitmask = row[47] ? static_cast<int32_t>(atoi(row[47])) : -1;
|
e.stop_melee_level = row[47] ? static_cast<uint8_t>(strtoul(row[47], nullptr, 10)) : 255;
|
||||||
e.enforce_spell_settings = row[48] ? static_cast<uint8_t>(strtoul(row[48], nullptr, 10)) : 0;
|
e.expansion_bitmask = row[48] ? static_cast<int32_t>(atoi(row[48])) : -1;
|
||||||
e.archery_setting = row[49] ? static_cast<uint8_t>(strtoul(row[49], nullptr, 10)) : 0;
|
e.enforce_spell_settings = row[49] ? static_cast<uint8_t>(strtoul(row[49], nullptr, 10)) : 0;
|
||||||
e.caster_range = row[50] ? static_cast<uint32_t>(strtoul(row[50], nullptr, 10)) : 300;
|
e.archery_setting = row[50] ? static_cast<uint8_t>(strtoul(row[50], nullptr, 10)) : 0;
|
||||||
|
e.caster_range = row[51] ? static_cast<uint32_t>(strtoul(row[51], nullptr, 10)) : 300;
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -436,19 +441,20 @@ public:
|
|||||||
v.push_back(columns[35] + " = " + std::to_string(e.int_));
|
v.push_back(columns[35] + " = " + std::to_string(e.int_));
|
||||||
v.push_back(columns[36] + " = " + std::to_string(e.agi));
|
v.push_back(columns[36] + " = " + std::to_string(e.agi));
|
||||||
v.push_back(columns[37] + " = " + std::to_string(e.wis));
|
v.push_back(columns[37] + " = " + std::to_string(e.wis));
|
||||||
v.push_back(columns[38] + " = " + std::to_string(e.fire));
|
v.push_back(columns[38] + " = " + std::to_string(e.extra_haste));
|
||||||
v.push_back(columns[39] + " = " + std::to_string(e.cold));
|
v.push_back(columns[39] + " = " + std::to_string(e.fire));
|
||||||
v.push_back(columns[40] + " = " + std::to_string(e.magic));
|
v.push_back(columns[40] + " = " + std::to_string(e.cold));
|
||||||
v.push_back(columns[41] + " = " + std::to_string(e.poison));
|
v.push_back(columns[41] + " = " + std::to_string(e.magic));
|
||||||
v.push_back(columns[42] + " = " + std::to_string(e.disease));
|
v.push_back(columns[42] + " = " + std::to_string(e.poison));
|
||||||
v.push_back(columns[43] + " = " + std::to_string(e.corruption));
|
v.push_back(columns[43] + " = " + std::to_string(e.disease));
|
||||||
v.push_back(columns[44] + " = " + std::to_string(e.show_helm));
|
v.push_back(columns[44] + " = " + std::to_string(e.corruption));
|
||||||
v.push_back(columns[45] + " = " + std::to_string(e.follow_distance));
|
v.push_back(columns[45] + " = " + std::to_string(e.show_helm));
|
||||||
v.push_back(columns[46] + " = " + std::to_string(e.stop_melee_level));
|
v.push_back(columns[46] + " = " + std::to_string(e.follow_distance));
|
||||||
v.push_back(columns[47] + " = " + std::to_string(e.expansion_bitmask));
|
v.push_back(columns[47] + " = " + std::to_string(e.stop_melee_level));
|
||||||
v.push_back(columns[48] + " = " + std::to_string(e.enforce_spell_settings));
|
v.push_back(columns[48] + " = " + std::to_string(e.expansion_bitmask));
|
||||||
v.push_back(columns[49] + " = " + std::to_string(e.archery_setting));
|
v.push_back(columns[49] + " = " + std::to_string(e.enforce_spell_settings));
|
||||||
v.push_back(columns[50] + " = " + std::to_string(e.caster_range));
|
v.push_back(columns[50] + " = " + std::to_string(e.archery_setting));
|
||||||
|
v.push_back(columns[51] + " = " + std::to_string(e.caster_range));
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -508,6 +514,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.int_));
|
v.push_back(std::to_string(e.int_));
|
||||||
v.push_back(std::to_string(e.agi));
|
v.push_back(std::to_string(e.agi));
|
||||||
v.push_back(std::to_string(e.wis));
|
v.push_back(std::to_string(e.wis));
|
||||||
|
v.push_back(std::to_string(e.extra_haste));
|
||||||
v.push_back(std::to_string(e.fire));
|
v.push_back(std::to_string(e.fire));
|
||||||
v.push_back(std::to_string(e.cold));
|
v.push_back(std::to_string(e.cold));
|
||||||
v.push_back(std::to_string(e.magic));
|
v.push_back(std::to_string(e.magic));
|
||||||
@@ -588,6 +595,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.int_));
|
v.push_back(std::to_string(e.int_));
|
||||||
v.push_back(std::to_string(e.agi));
|
v.push_back(std::to_string(e.agi));
|
||||||
v.push_back(std::to_string(e.wis));
|
v.push_back(std::to_string(e.wis));
|
||||||
|
v.push_back(std::to_string(e.extra_haste));
|
||||||
v.push_back(std::to_string(e.fire));
|
v.push_back(std::to_string(e.fire));
|
||||||
v.push_back(std::to_string(e.cold));
|
v.push_back(std::to_string(e.cold));
|
||||||
v.push_back(std::to_string(e.magic));
|
v.push_back(std::to_string(e.magic));
|
||||||
@@ -672,19 +680,20 @@ public:
|
|||||||
e.int_ = row[35] ? static_cast<int32_t>(atoi(row[35])) : 75;
|
e.int_ = row[35] ? static_cast<int32_t>(atoi(row[35])) : 75;
|
||||||
e.agi = row[36] ? static_cast<int32_t>(atoi(row[36])) : 75;
|
e.agi = row[36] ? static_cast<int32_t>(atoi(row[36])) : 75;
|
||||||
e.wis = row[37] ? static_cast<int32_t>(atoi(row[37])) : 75;
|
e.wis = row[37] ? static_cast<int32_t>(atoi(row[37])) : 75;
|
||||||
e.fire = row[38] ? static_cast<int16_t>(atoi(row[38])) : 0;
|
e.extra_haste = row[38] ? static_cast<int32_t>(atoi(row[38])) : 0;
|
||||||
e.cold = row[39] ? static_cast<int16_t>(atoi(row[39])) : 0;
|
e.fire = row[39] ? static_cast<int16_t>(atoi(row[39])) : 0;
|
||||||
e.magic = row[40] ? static_cast<int16_t>(atoi(row[40])) : 0;
|
e.cold = row[40] ? static_cast<int16_t>(atoi(row[40])) : 0;
|
||||||
e.poison = row[41] ? static_cast<int16_t>(atoi(row[41])) : 0;
|
e.magic = row[41] ? static_cast<int16_t>(atoi(row[41])) : 0;
|
||||||
e.disease = row[42] ? static_cast<int16_t>(atoi(row[42])) : 0;
|
e.poison = row[42] ? static_cast<int16_t>(atoi(row[42])) : 0;
|
||||||
e.corruption = row[43] ? static_cast<int16_t>(atoi(row[43])) : 0;
|
e.disease = row[43] ? static_cast<int16_t>(atoi(row[43])) : 0;
|
||||||
e.show_helm = row[44] ? static_cast<uint32_t>(strtoul(row[44], nullptr, 10)) : 0;
|
e.corruption = row[44] ? static_cast<int16_t>(atoi(row[44])) : 0;
|
||||||
e.follow_distance = row[45] ? static_cast<uint32_t>(strtoul(row[45], nullptr, 10)) : 200;
|
e.show_helm = row[45] ? static_cast<uint32_t>(strtoul(row[45], nullptr, 10)) : 0;
|
||||||
e.stop_melee_level = row[46] ? static_cast<uint8_t>(strtoul(row[46], nullptr, 10)) : 255;
|
e.follow_distance = row[46] ? static_cast<uint32_t>(strtoul(row[46], nullptr, 10)) : 200;
|
||||||
e.expansion_bitmask = row[47] ? static_cast<int32_t>(atoi(row[47])) : -1;
|
e.stop_melee_level = row[47] ? static_cast<uint8_t>(strtoul(row[47], nullptr, 10)) : 255;
|
||||||
e.enforce_spell_settings = row[48] ? static_cast<uint8_t>(strtoul(row[48], nullptr, 10)) : 0;
|
e.expansion_bitmask = row[48] ? static_cast<int32_t>(atoi(row[48])) : -1;
|
||||||
e.archery_setting = row[49] ? static_cast<uint8_t>(strtoul(row[49], nullptr, 10)) : 0;
|
e.enforce_spell_settings = row[49] ? static_cast<uint8_t>(strtoul(row[49], nullptr, 10)) : 0;
|
||||||
e.caster_range = row[50] ? static_cast<uint32_t>(strtoul(row[50], nullptr, 10)) : 300;
|
e.archery_setting = row[50] ? static_cast<uint8_t>(strtoul(row[50], nullptr, 10)) : 0;
|
||||||
|
e.caster_range = row[51] ? static_cast<uint32_t>(strtoul(row[51], nullptr, 10)) : 300;
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -747,19 +756,20 @@ public:
|
|||||||
e.int_ = row[35] ? static_cast<int32_t>(atoi(row[35])) : 75;
|
e.int_ = row[35] ? static_cast<int32_t>(atoi(row[35])) : 75;
|
||||||
e.agi = row[36] ? static_cast<int32_t>(atoi(row[36])) : 75;
|
e.agi = row[36] ? static_cast<int32_t>(atoi(row[36])) : 75;
|
||||||
e.wis = row[37] ? static_cast<int32_t>(atoi(row[37])) : 75;
|
e.wis = row[37] ? static_cast<int32_t>(atoi(row[37])) : 75;
|
||||||
e.fire = row[38] ? static_cast<int16_t>(atoi(row[38])) : 0;
|
e.extra_haste = row[38] ? static_cast<int32_t>(atoi(row[38])) : 0;
|
||||||
e.cold = row[39] ? static_cast<int16_t>(atoi(row[39])) : 0;
|
e.fire = row[39] ? static_cast<int16_t>(atoi(row[39])) : 0;
|
||||||
e.magic = row[40] ? static_cast<int16_t>(atoi(row[40])) : 0;
|
e.cold = row[40] ? static_cast<int16_t>(atoi(row[40])) : 0;
|
||||||
e.poison = row[41] ? static_cast<int16_t>(atoi(row[41])) : 0;
|
e.magic = row[41] ? static_cast<int16_t>(atoi(row[41])) : 0;
|
||||||
e.disease = row[42] ? static_cast<int16_t>(atoi(row[42])) : 0;
|
e.poison = row[42] ? static_cast<int16_t>(atoi(row[42])) : 0;
|
||||||
e.corruption = row[43] ? static_cast<int16_t>(atoi(row[43])) : 0;
|
e.disease = row[43] ? static_cast<int16_t>(atoi(row[43])) : 0;
|
||||||
e.show_helm = row[44] ? static_cast<uint32_t>(strtoul(row[44], nullptr, 10)) : 0;
|
e.corruption = row[44] ? static_cast<int16_t>(atoi(row[44])) : 0;
|
||||||
e.follow_distance = row[45] ? static_cast<uint32_t>(strtoul(row[45], nullptr, 10)) : 200;
|
e.show_helm = row[45] ? static_cast<uint32_t>(strtoul(row[45], nullptr, 10)) : 0;
|
||||||
e.stop_melee_level = row[46] ? static_cast<uint8_t>(strtoul(row[46], nullptr, 10)) : 255;
|
e.follow_distance = row[46] ? static_cast<uint32_t>(strtoul(row[46], nullptr, 10)) : 200;
|
||||||
e.expansion_bitmask = row[47] ? static_cast<int32_t>(atoi(row[47])) : -1;
|
e.stop_melee_level = row[47] ? static_cast<uint8_t>(strtoul(row[47], nullptr, 10)) : 255;
|
||||||
e.enforce_spell_settings = row[48] ? static_cast<uint8_t>(strtoul(row[48], nullptr, 10)) : 0;
|
e.expansion_bitmask = row[48] ? static_cast<int32_t>(atoi(row[48])) : -1;
|
||||||
e.archery_setting = row[49] ? static_cast<uint8_t>(strtoul(row[49], nullptr, 10)) : 0;
|
e.enforce_spell_settings = row[49] ? static_cast<uint8_t>(strtoul(row[49], nullptr, 10)) : 0;
|
||||||
e.caster_range = row[50] ? static_cast<uint32_t>(strtoul(row[50], nullptr, 10)) : 300;
|
e.archery_setting = row[50] ? static_cast<uint8_t>(strtoul(row[50], nullptr, 10)) : 0;
|
||||||
|
e.caster_range = row[51] ? static_cast<uint32_t>(strtoul(row[51], nullptr, 10)) : 300;
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -872,6 +882,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.int_));
|
v.push_back(std::to_string(e.int_));
|
||||||
v.push_back(std::to_string(e.agi));
|
v.push_back(std::to_string(e.agi));
|
||||||
v.push_back(std::to_string(e.wis));
|
v.push_back(std::to_string(e.wis));
|
||||||
|
v.push_back(std::to_string(e.extra_haste));
|
||||||
v.push_back(std::to_string(e.fire));
|
v.push_back(std::to_string(e.fire));
|
||||||
v.push_back(std::to_string(e.cold));
|
v.push_back(std::to_string(e.cold));
|
||||||
v.push_back(std::to_string(e.magic));
|
v.push_back(std::to_string(e.magic));
|
||||||
@@ -945,6 +956,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.int_));
|
v.push_back(std::to_string(e.int_));
|
||||||
v.push_back(std::to_string(e.agi));
|
v.push_back(std::to_string(e.agi));
|
||||||
v.push_back(std::to_string(e.wis));
|
v.push_back(std::to_string(e.wis));
|
||||||
|
v.push_back(std::to_string(e.extra_haste));
|
||||||
v.push_back(std::to_string(e.fire));
|
v.push_back(std::to_string(e.fire));
|
||||||
v.push_back(std::to_string(e.cold));
|
v.push_back(std::to_string(e.cold));
|
||||||
v.push_back(std::to_string(e.magic));
|
v.push_back(std::to_string(e.magic));
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ public:
|
|||||||
uint32_t int_;
|
uint32_t int_;
|
||||||
uint32_t agi;
|
uint32_t agi;
|
||||||
uint32_t wis;
|
uint32_t wis;
|
||||||
|
int32_t extra_haste;
|
||||||
uint32_t zone_change_count;
|
uint32_t zone_change_count;
|
||||||
uint32_t toxicity;
|
uint32_t toxicity;
|
||||||
uint32_t hunger_level;
|
uint32_t hunger_level;
|
||||||
@@ -190,6 +191,7 @@ public:
|
|||||||
"`int`",
|
"`int`",
|
||||||
"agi",
|
"agi",
|
||||||
"wis",
|
"wis",
|
||||||
|
"extra_haste",
|
||||||
"zone_change_count",
|
"zone_change_count",
|
||||||
"toxicity",
|
"toxicity",
|
||||||
"hunger_level",
|
"hunger_level",
|
||||||
@@ -299,6 +301,7 @@ public:
|
|||||||
"`int`",
|
"`int`",
|
||||||
"agi",
|
"agi",
|
||||||
"wis",
|
"wis",
|
||||||
|
"extra_haste",
|
||||||
"zone_change_count",
|
"zone_change_count",
|
||||||
"toxicity",
|
"toxicity",
|
||||||
"hunger_level",
|
"hunger_level",
|
||||||
@@ -442,6 +445,7 @@ public:
|
|||||||
e.int_ = 0;
|
e.int_ = 0;
|
||||||
e.agi = 0;
|
e.agi = 0;
|
||||||
e.wis = 0;
|
e.wis = 0;
|
||||||
|
e.extra_haste = 0;
|
||||||
e.zone_change_count = 0;
|
e.zone_change_count = 0;
|
||||||
e.toxicity = 0;
|
e.toxicity = 0;
|
||||||
e.hunger_level = 0;
|
e.hunger_level = 0;
|
||||||
@@ -581,51 +585,52 @@ public:
|
|||||||
e.int_ = row[55] ? static_cast<uint32_t>(strtoul(row[55], nullptr, 10)) : 0;
|
e.int_ = row[55] ? static_cast<uint32_t>(strtoul(row[55], nullptr, 10)) : 0;
|
||||||
e.agi = row[56] ? static_cast<uint32_t>(strtoul(row[56], nullptr, 10)) : 0;
|
e.agi = row[56] ? static_cast<uint32_t>(strtoul(row[56], nullptr, 10)) : 0;
|
||||||
e.wis = row[57] ? static_cast<uint32_t>(strtoul(row[57], nullptr, 10)) : 0;
|
e.wis = row[57] ? static_cast<uint32_t>(strtoul(row[57], nullptr, 10)) : 0;
|
||||||
e.zone_change_count = row[58] ? static_cast<uint32_t>(strtoul(row[58], nullptr, 10)) : 0;
|
e.extra_haste = row[58] ? static_cast<int32_t>(atoi(row[58])) : 0;
|
||||||
e.toxicity = row[59] ? static_cast<uint32_t>(strtoul(row[59], nullptr, 10)) : 0;
|
e.zone_change_count = row[59] ? static_cast<uint32_t>(strtoul(row[59], nullptr, 10)) : 0;
|
||||||
e.hunger_level = row[60] ? static_cast<uint32_t>(strtoul(row[60], nullptr, 10)) : 0;
|
e.toxicity = row[60] ? static_cast<uint32_t>(strtoul(row[60], nullptr, 10)) : 0;
|
||||||
e.thirst_level = row[61] ? static_cast<uint32_t>(strtoul(row[61], nullptr, 10)) : 0;
|
e.hunger_level = row[61] ? static_cast<uint32_t>(strtoul(row[61], nullptr, 10)) : 0;
|
||||||
e.ability_up = row[62] ? static_cast<uint32_t>(strtoul(row[62], nullptr, 10)) : 0;
|
e.thirst_level = row[62] ? static_cast<uint32_t>(strtoul(row[62], nullptr, 10)) : 0;
|
||||||
e.ldon_points_guk = row[63] ? static_cast<uint32_t>(strtoul(row[63], nullptr, 10)) : 0;
|
e.ability_up = row[63] ? static_cast<uint32_t>(strtoul(row[63], nullptr, 10)) : 0;
|
||||||
e.ldon_points_mir = row[64] ? static_cast<uint32_t>(strtoul(row[64], nullptr, 10)) : 0;
|
e.ldon_points_guk = row[64] ? static_cast<uint32_t>(strtoul(row[64], nullptr, 10)) : 0;
|
||||||
e.ldon_points_mmc = row[65] ? static_cast<uint32_t>(strtoul(row[65], nullptr, 10)) : 0;
|
e.ldon_points_mir = row[65] ? static_cast<uint32_t>(strtoul(row[65], nullptr, 10)) : 0;
|
||||||
e.ldon_points_ruj = row[66] ? static_cast<uint32_t>(strtoul(row[66], nullptr, 10)) : 0;
|
e.ldon_points_mmc = row[66] ? static_cast<uint32_t>(strtoul(row[66], nullptr, 10)) : 0;
|
||||||
e.ldon_points_tak = row[67] ? static_cast<uint32_t>(strtoul(row[67], nullptr, 10)) : 0;
|
e.ldon_points_ruj = row[67] ? static_cast<uint32_t>(strtoul(row[67], nullptr, 10)) : 0;
|
||||||
e.ldon_points_available = row[68] ? static_cast<uint32_t>(strtoul(row[68], nullptr, 10)) : 0;
|
e.ldon_points_tak = row[68] ? static_cast<uint32_t>(strtoul(row[68], nullptr, 10)) : 0;
|
||||||
e.tribute_time_remaining = row[69] ? static_cast<uint32_t>(strtoul(row[69], nullptr, 10)) : 0;
|
e.ldon_points_available = row[69] ? static_cast<uint32_t>(strtoul(row[69], nullptr, 10)) : 0;
|
||||||
e.career_tribute_points = row[70] ? static_cast<uint32_t>(strtoul(row[70], nullptr, 10)) : 0;
|
e.tribute_time_remaining = row[70] ? static_cast<uint32_t>(strtoul(row[70], nullptr, 10)) : 0;
|
||||||
e.tribute_points = row[71] ? static_cast<uint32_t>(strtoul(row[71], nullptr, 10)) : 0;
|
e.career_tribute_points = row[71] ? static_cast<uint32_t>(strtoul(row[71], nullptr, 10)) : 0;
|
||||||
e.tribute_active = row[72] ? static_cast<uint32_t>(strtoul(row[72], nullptr, 10)) : 0;
|
e.tribute_points = row[72] ? static_cast<uint32_t>(strtoul(row[72], nullptr, 10)) : 0;
|
||||||
e.pvp_status = row[73] ? static_cast<uint8_t>(strtoul(row[73], nullptr, 10)) : 0;
|
e.tribute_active = row[73] ? static_cast<uint32_t>(strtoul(row[73], nullptr, 10)) : 0;
|
||||||
e.pvp_kills = row[74] ? static_cast<uint32_t>(strtoul(row[74], nullptr, 10)) : 0;
|
e.pvp_status = row[74] ? static_cast<uint8_t>(strtoul(row[74], nullptr, 10)) : 0;
|
||||||
e.pvp_deaths = row[75] ? static_cast<uint32_t>(strtoul(row[75], nullptr, 10)) : 0;
|
e.pvp_kills = row[75] ? static_cast<uint32_t>(strtoul(row[75], nullptr, 10)) : 0;
|
||||||
e.pvp_current_points = row[76] ? static_cast<uint32_t>(strtoul(row[76], nullptr, 10)) : 0;
|
e.pvp_deaths = row[76] ? static_cast<uint32_t>(strtoul(row[76], nullptr, 10)) : 0;
|
||||||
e.pvp_career_points = row[77] ? static_cast<uint32_t>(strtoul(row[77], nullptr, 10)) : 0;
|
e.pvp_current_points = row[77] ? static_cast<uint32_t>(strtoul(row[77], nullptr, 10)) : 0;
|
||||||
e.pvp_best_kill_streak = row[78] ? static_cast<uint32_t>(strtoul(row[78], nullptr, 10)) : 0;
|
e.pvp_career_points = row[78] ? static_cast<uint32_t>(strtoul(row[78], nullptr, 10)) : 0;
|
||||||
e.pvp_worst_death_streak = row[79] ? static_cast<uint32_t>(strtoul(row[79], nullptr, 10)) : 0;
|
e.pvp_best_kill_streak = row[79] ? static_cast<uint32_t>(strtoul(row[79], nullptr, 10)) : 0;
|
||||||
e.pvp_current_kill_streak = row[80] ? static_cast<uint32_t>(strtoul(row[80], nullptr, 10)) : 0;
|
e.pvp_worst_death_streak = row[80] ? static_cast<uint32_t>(strtoul(row[80], nullptr, 10)) : 0;
|
||||||
e.pvp2 = row[81] ? static_cast<uint32_t>(strtoul(row[81], nullptr, 10)) : 0;
|
e.pvp_current_kill_streak = row[81] ? static_cast<uint32_t>(strtoul(row[81], nullptr, 10)) : 0;
|
||||||
e.pvp_type = row[82] ? static_cast<uint32_t>(strtoul(row[82], nullptr, 10)) : 0;
|
e.pvp2 = row[82] ? static_cast<uint32_t>(strtoul(row[82], nullptr, 10)) : 0;
|
||||||
e.show_helm = row[83] ? static_cast<uint32_t>(strtoul(row[83], nullptr, 10)) : 0;
|
e.pvp_type = row[83] ? static_cast<uint32_t>(strtoul(row[83], nullptr, 10)) : 0;
|
||||||
e.group_auto_consent = row[84] ? static_cast<uint8_t>(strtoul(row[84], nullptr, 10)) : 0;
|
e.show_helm = row[84] ? static_cast<uint32_t>(strtoul(row[84], nullptr, 10)) : 0;
|
||||||
e.raid_auto_consent = row[85] ? static_cast<uint8_t>(strtoul(row[85], nullptr, 10)) : 0;
|
e.group_auto_consent = row[85] ? static_cast<uint8_t>(strtoul(row[85], nullptr, 10)) : 0;
|
||||||
e.guild_auto_consent = row[86] ? static_cast<uint8_t>(strtoul(row[86], nullptr, 10)) : 0;
|
e.raid_auto_consent = row[86] ? static_cast<uint8_t>(strtoul(row[86], nullptr, 10)) : 0;
|
||||||
e.leadership_exp_on = row[87] ? static_cast<uint8_t>(strtoul(row[87], nullptr, 10)) : 0;
|
e.guild_auto_consent = row[87] ? static_cast<uint8_t>(strtoul(row[87], nullptr, 10)) : 0;
|
||||||
e.RestTimer = row[88] ? static_cast<uint32_t>(strtoul(row[88], nullptr, 10)) : 0;
|
e.leadership_exp_on = row[88] ? static_cast<uint8_t>(strtoul(row[88], nullptr, 10)) : 0;
|
||||||
e.air_remaining = row[89] ? static_cast<uint32_t>(strtoul(row[89], nullptr, 10)) : 0;
|
e.RestTimer = row[89] ? static_cast<uint32_t>(strtoul(row[89], nullptr, 10)) : 0;
|
||||||
e.autosplit_enabled = row[90] ? static_cast<uint32_t>(strtoul(row[90], nullptr, 10)) : 0;
|
e.air_remaining = row[90] ? static_cast<uint32_t>(strtoul(row[90], nullptr, 10)) : 0;
|
||||||
e.lfp = row[91] ? static_cast<uint8_t>(strtoul(row[91], nullptr, 10)) : 0;
|
e.autosplit_enabled = row[91] ? static_cast<uint32_t>(strtoul(row[91], nullptr, 10)) : 0;
|
||||||
e.lfg = row[92] ? static_cast<uint8_t>(strtoul(row[92], nullptr, 10)) : 0;
|
e.lfp = row[92] ? static_cast<uint8_t>(strtoul(row[92], nullptr, 10)) : 0;
|
||||||
e.mailkey = row[93] ? row[93] : "";
|
e.lfg = row[93] ? static_cast<uint8_t>(strtoul(row[93], nullptr, 10)) : 0;
|
||||||
e.xtargets = row[94] ? static_cast<uint8_t>(strtoul(row[94], nullptr, 10)) : 5;
|
e.mailkey = row[94] ? row[94] : "";
|
||||||
e.firstlogon = row[95] ? static_cast<int8_t>(atoi(row[95])) : 0;
|
e.xtargets = row[95] ? static_cast<uint8_t>(strtoul(row[95], nullptr, 10)) : 5;
|
||||||
e.e_aa_effects = row[96] ? static_cast<uint32_t>(strtoul(row[96], nullptr, 10)) : 0;
|
e.firstlogon = row[96] ? static_cast<int8_t>(atoi(row[96])) : 0;
|
||||||
e.e_percent_to_aa = row[97] ? static_cast<uint32_t>(strtoul(row[97], nullptr, 10)) : 0;
|
e.e_aa_effects = row[97] ? static_cast<uint32_t>(strtoul(row[97], nullptr, 10)) : 0;
|
||||||
e.e_expended_aa_spent = row[98] ? static_cast<uint32_t>(strtoul(row[98], nullptr, 10)) : 0;
|
e.e_percent_to_aa = row[98] ? static_cast<uint32_t>(strtoul(row[98], nullptr, 10)) : 0;
|
||||||
e.aa_points_spent_old = row[99] ? static_cast<uint32_t>(strtoul(row[99], nullptr, 10)) : 0;
|
e.e_expended_aa_spent = row[99] ? static_cast<uint32_t>(strtoul(row[99], nullptr, 10)) : 0;
|
||||||
e.aa_points_old = row[100] ? static_cast<uint32_t>(strtoul(row[100], nullptr, 10)) : 0;
|
e.aa_points_spent_old = row[100] ? static_cast<uint32_t>(strtoul(row[100], nullptr, 10)) : 0;
|
||||||
e.e_last_invsnapshot = row[101] ? static_cast<uint32_t>(strtoul(row[101], nullptr, 10)) : 0;
|
e.aa_points_old = row[101] ? static_cast<uint32_t>(strtoul(row[101], nullptr, 10)) : 0;
|
||||||
e.deleted_at = strtoll(row[102] ? row[102] : "-1", nullptr, 10);
|
e.e_last_invsnapshot = row[102] ? static_cast<uint32_t>(strtoul(row[102], nullptr, 10)) : 0;
|
||||||
|
e.deleted_at = strtoll(row[103] ? row[103] : "-1", nullptr, 10);
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -716,51 +721,52 @@ public:
|
|||||||
v.push_back(columns[55] + " = " + std::to_string(e.int_));
|
v.push_back(columns[55] + " = " + std::to_string(e.int_));
|
||||||
v.push_back(columns[56] + " = " + std::to_string(e.agi));
|
v.push_back(columns[56] + " = " + std::to_string(e.agi));
|
||||||
v.push_back(columns[57] + " = " + std::to_string(e.wis));
|
v.push_back(columns[57] + " = " + std::to_string(e.wis));
|
||||||
v.push_back(columns[58] + " = " + std::to_string(e.zone_change_count));
|
v.push_back(columns[58] + " = " + std::to_string(e.extra_haste));
|
||||||
v.push_back(columns[59] + " = " + std::to_string(e.toxicity));
|
v.push_back(columns[59] + " = " + std::to_string(e.zone_change_count));
|
||||||
v.push_back(columns[60] + " = " + std::to_string(e.hunger_level));
|
v.push_back(columns[60] + " = " + std::to_string(e.toxicity));
|
||||||
v.push_back(columns[61] + " = " + std::to_string(e.thirst_level));
|
v.push_back(columns[61] + " = " + std::to_string(e.hunger_level));
|
||||||
v.push_back(columns[62] + " = " + std::to_string(e.ability_up));
|
v.push_back(columns[62] + " = " + std::to_string(e.thirst_level));
|
||||||
v.push_back(columns[63] + " = " + std::to_string(e.ldon_points_guk));
|
v.push_back(columns[63] + " = " + std::to_string(e.ability_up));
|
||||||
v.push_back(columns[64] + " = " + std::to_string(e.ldon_points_mir));
|
v.push_back(columns[64] + " = " + std::to_string(e.ldon_points_guk));
|
||||||
v.push_back(columns[65] + " = " + std::to_string(e.ldon_points_mmc));
|
v.push_back(columns[65] + " = " + std::to_string(e.ldon_points_mir));
|
||||||
v.push_back(columns[66] + " = " + std::to_string(e.ldon_points_ruj));
|
v.push_back(columns[66] + " = " + std::to_string(e.ldon_points_mmc));
|
||||||
v.push_back(columns[67] + " = " + std::to_string(e.ldon_points_tak));
|
v.push_back(columns[67] + " = " + std::to_string(e.ldon_points_ruj));
|
||||||
v.push_back(columns[68] + " = " + std::to_string(e.ldon_points_available));
|
v.push_back(columns[68] + " = " + std::to_string(e.ldon_points_tak));
|
||||||
v.push_back(columns[69] + " = " + std::to_string(e.tribute_time_remaining));
|
v.push_back(columns[69] + " = " + std::to_string(e.ldon_points_available));
|
||||||
v.push_back(columns[70] + " = " + std::to_string(e.career_tribute_points));
|
v.push_back(columns[70] + " = " + std::to_string(e.tribute_time_remaining));
|
||||||
v.push_back(columns[71] + " = " + std::to_string(e.tribute_points));
|
v.push_back(columns[71] + " = " + std::to_string(e.career_tribute_points));
|
||||||
v.push_back(columns[72] + " = " + std::to_string(e.tribute_active));
|
v.push_back(columns[72] + " = " + std::to_string(e.tribute_points));
|
||||||
v.push_back(columns[73] + " = " + std::to_string(e.pvp_status));
|
v.push_back(columns[73] + " = " + std::to_string(e.tribute_active));
|
||||||
v.push_back(columns[74] + " = " + std::to_string(e.pvp_kills));
|
v.push_back(columns[74] + " = " + std::to_string(e.pvp_status));
|
||||||
v.push_back(columns[75] + " = " + std::to_string(e.pvp_deaths));
|
v.push_back(columns[75] + " = " + std::to_string(e.pvp_kills));
|
||||||
v.push_back(columns[76] + " = " + std::to_string(e.pvp_current_points));
|
v.push_back(columns[76] + " = " + std::to_string(e.pvp_deaths));
|
||||||
v.push_back(columns[77] + " = " + std::to_string(e.pvp_career_points));
|
v.push_back(columns[77] + " = " + std::to_string(e.pvp_current_points));
|
||||||
v.push_back(columns[78] + " = " + std::to_string(e.pvp_best_kill_streak));
|
v.push_back(columns[78] + " = " + std::to_string(e.pvp_career_points));
|
||||||
v.push_back(columns[79] + " = " + std::to_string(e.pvp_worst_death_streak));
|
v.push_back(columns[79] + " = " + std::to_string(e.pvp_best_kill_streak));
|
||||||
v.push_back(columns[80] + " = " + std::to_string(e.pvp_current_kill_streak));
|
v.push_back(columns[80] + " = " + std::to_string(e.pvp_worst_death_streak));
|
||||||
v.push_back(columns[81] + " = " + std::to_string(e.pvp2));
|
v.push_back(columns[81] + " = " + std::to_string(e.pvp_current_kill_streak));
|
||||||
v.push_back(columns[82] + " = " + std::to_string(e.pvp_type));
|
v.push_back(columns[82] + " = " + std::to_string(e.pvp2));
|
||||||
v.push_back(columns[83] + " = " + std::to_string(e.show_helm));
|
v.push_back(columns[83] + " = " + std::to_string(e.pvp_type));
|
||||||
v.push_back(columns[84] + " = " + std::to_string(e.group_auto_consent));
|
v.push_back(columns[84] + " = " + std::to_string(e.show_helm));
|
||||||
v.push_back(columns[85] + " = " + std::to_string(e.raid_auto_consent));
|
v.push_back(columns[85] + " = " + std::to_string(e.group_auto_consent));
|
||||||
v.push_back(columns[86] + " = " + std::to_string(e.guild_auto_consent));
|
v.push_back(columns[86] + " = " + std::to_string(e.raid_auto_consent));
|
||||||
v.push_back(columns[87] + " = " + std::to_string(e.leadership_exp_on));
|
v.push_back(columns[87] + " = " + std::to_string(e.guild_auto_consent));
|
||||||
v.push_back(columns[88] + " = " + std::to_string(e.RestTimer));
|
v.push_back(columns[88] + " = " + std::to_string(e.leadership_exp_on));
|
||||||
v.push_back(columns[89] + " = " + std::to_string(e.air_remaining));
|
v.push_back(columns[89] + " = " + std::to_string(e.RestTimer));
|
||||||
v.push_back(columns[90] + " = " + std::to_string(e.autosplit_enabled));
|
v.push_back(columns[90] + " = " + std::to_string(e.air_remaining));
|
||||||
v.push_back(columns[91] + " = " + std::to_string(e.lfp));
|
v.push_back(columns[91] + " = " + std::to_string(e.autosplit_enabled));
|
||||||
v.push_back(columns[92] + " = " + std::to_string(e.lfg));
|
v.push_back(columns[92] + " = " + std::to_string(e.lfp));
|
||||||
v.push_back(columns[93] + " = '" + Strings::Escape(e.mailkey) + "'");
|
v.push_back(columns[93] + " = " + std::to_string(e.lfg));
|
||||||
v.push_back(columns[94] + " = " + std::to_string(e.xtargets));
|
v.push_back(columns[94] + " = '" + Strings::Escape(e.mailkey) + "'");
|
||||||
v.push_back(columns[95] + " = " + std::to_string(e.firstlogon));
|
v.push_back(columns[95] + " = " + std::to_string(e.xtargets));
|
||||||
v.push_back(columns[96] + " = " + std::to_string(e.e_aa_effects));
|
v.push_back(columns[96] + " = " + std::to_string(e.firstlogon));
|
||||||
v.push_back(columns[97] + " = " + std::to_string(e.e_percent_to_aa));
|
v.push_back(columns[97] + " = " + std::to_string(e.e_aa_effects));
|
||||||
v.push_back(columns[98] + " = " + std::to_string(e.e_expended_aa_spent));
|
v.push_back(columns[98] + " = " + std::to_string(e.e_percent_to_aa));
|
||||||
v.push_back(columns[99] + " = " + std::to_string(e.aa_points_spent_old));
|
v.push_back(columns[99] + " = " + std::to_string(e.e_expended_aa_spent));
|
||||||
v.push_back(columns[100] + " = " + std::to_string(e.aa_points_old));
|
v.push_back(columns[100] + " = " + std::to_string(e.aa_points_spent_old));
|
||||||
v.push_back(columns[101] + " = " + std::to_string(e.e_last_invsnapshot));
|
v.push_back(columns[101] + " = " + std::to_string(e.aa_points_old));
|
||||||
v.push_back(columns[102] + " = FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");
|
v.push_back(columns[102] + " = " + std::to_string(e.e_last_invsnapshot));
|
||||||
|
v.push_back(columns[103] + " = FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -840,6 +846,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.int_));
|
v.push_back(std::to_string(e.int_));
|
||||||
v.push_back(std::to_string(e.agi));
|
v.push_back(std::to_string(e.agi));
|
||||||
v.push_back(std::to_string(e.wis));
|
v.push_back(std::to_string(e.wis));
|
||||||
|
v.push_back(std::to_string(e.extra_haste));
|
||||||
v.push_back(std::to_string(e.zone_change_count));
|
v.push_back(std::to_string(e.zone_change_count));
|
||||||
v.push_back(std::to_string(e.toxicity));
|
v.push_back(std::to_string(e.toxicity));
|
||||||
v.push_back(std::to_string(e.hunger_level));
|
v.push_back(std::to_string(e.hunger_level));
|
||||||
@@ -972,6 +979,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.int_));
|
v.push_back(std::to_string(e.int_));
|
||||||
v.push_back(std::to_string(e.agi));
|
v.push_back(std::to_string(e.agi));
|
||||||
v.push_back(std::to_string(e.wis));
|
v.push_back(std::to_string(e.wis));
|
||||||
|
v.push_back(std::to_string(e.extra_haste));
|
||||||
v.push_back(std::to_string(e.zone_change_count));
|
v.push_back(std::to_string(e.zone_change_count));
|
||||||
v.push_back(std::to_string(e.toxicity));
|
v.push_back(std::to_string(e.toxicity));
|
||||||
v.push_back(std::to_string(e.hunger_level));
|
v.push_back(std::to_string(e.hunger_level));
|
||||||
@@ -1108,51 +1116,52 @@ public:
|
|||||||
e.int_ = row[55] ? static_cast<uint32_t>(strtoul(row[55], nullptr, 10)) : 0;
|
e.int_ = row[55] ? static_cast<uint32_t>(strtoul(row[55], nullptr, 10)) : 0;
|
||||||
e.agi = row[56] ? static_cast<uint32_t>(strtoul(row[56], nullptr, 10)) : 0;
|
e.agi = row[56] ? static_cast<uint32_t>(strtoul(row[56], nullptr, 10)) : 0;
|
||||||
e.wis = row[57] ? static_cast<uint32_t>(strtoul(row[57], nullptr, 10)) : 0;
|
e.wis = row[57] ? static_cast<uint32_t>(strtoul(row[57], nullptr, 10)) : 0;
|
||||||
e.zone_change_count = row[58] ? static_cast<uint32_t>(strtoul(row[58], nullptr, 10)) : 0;
|
e.extra_haste = row[58] ? static_cast<int32_t>(atoi(row[58])) : 0;
|
||||||
e.toxicity = row[59] ? static_cast<uint32_t>(strtoul(row[59], nullptr, 10)) : 0;
|
e.zone_change_count = row[59] ? static_cast<uint32_t>(strtoul(row[59], nullptr, 10)) : 0;
|
||||||
e.hunger_level = row[60] ? static_cast<uint32_t>(strtoul(row[60], nullptr, 10)) : 0;
|
e.toxicity = row[60] ? static_cast<uint32_t>(strtoul(row[60], nullptr, 10)) : 0;
|
||||||
e.thirst_level = row[61] ? static_cast<uint32_t>(strtoul(row[61], nullptr, 10)) : 0;
|
e.hunger_level = row[61] ? static_cast<uint32_t>(strtoul(row[61], nullptr, 10)) : 0;
|
||||||
e.ability_up = row[62] ? static_cast<uint32_t>(strtoul(row[62], nullptr, 10)) : 0;
|
e.thirst_level = row[62] ? static_cast<uint32_t>(strtoul(row[62], nullptr, 10)) : 0;
|
||||||
e.ldon_points_guk = row[63] ? static_cast<uint32_t>(strtoul(row[63], nullptr, 10)) : 0;
|
e.ability_up = row[63] ? static_cast<uint32_t>(strtoul(row[63], nullptr, 10)) : 0;
|
||||||
e.ldon_points_mir = row[64] ? static_cast<uint32_t>(strtoul(row[64], nullptr, 10)) : 0;
|
e.ldon_points_guk = row[64] ? static_cast<uint32_t>(strtoul(row[64], nullptr, 10)) : 0;
|
||||||
e.ldon_points_mmc = row[65] ? static_cast<uint32_t>(strtoul(row[65], nullptr, 10)) : 0;
|
e.ldon_points_mir = row[65] ? static_cast<uint32_t>(strtoul(row[65], nullptr, 10)) : 0;
|
||||||
e.ldon_points_ruj = row[66] ? static_cast<uint32_t>(strtoul(row[66], nullptr, 10)) : 0;
|
e.ldon_points_mmc = row[66] ? static_cast<uint32_t>(strtoul(row[66], nullptr, 10)) : 0;
|
||||||
e.ldon_points_tak = row[67] ? static_cast<uint32_t>(strtoul(row[67], nullptr, 10)) : 0;
|
e.ldon_points_ruj = row[67] ? static_cast<uint32_t>(strtoul(row[67], nullptr, 10)) : 0;
|
||||||
e.ldon_points_available = row[68] ? static_cast<uint32_t>(strtoul(row[68], nullptr, 10)) : 0;
|
e.ldon_points_tak = row[68] ? static_cast<uint32_t>(strtoul(row[68], nullptr, 10)) : 0;
|
||||||
e.tribute_time_remaining = row[69] ? static_cast<uint32_t>(strtoul(row[69], nullptr, 10)) : 0;
|
e.ldon_points_available = row[69] ? static_cast<uint32_t>(strtoul(row[69], nullptr, 10)) : 0;
|
||||||
e.career_tribute_points = row[70] ? static_cast<uint32_t>(strtoul(row[70], nullptr, 10)) : 0;
|
e.tribute_time_remaining = row[70] ? static_cast<uint32_t>(strtoul(row[70], nullptr, 10)) : 0;
|
||||||
e.tribute_points = row[71] ? static_cast<uint32_t>(strtoul(row[71], nullptr, 10)) : 0;
|
e.career_tribute_points = row[71] ? static_cast<uint32_t>(strtoul(row[71], nullptr, 10)) : 0;
|
||||||
e.tribute_active = row[72] ? static_cast<uint32_t>(strtoul(row[72], nullptr, 10)) : 0;
|
e.tribute_points = row[72] ? static_cast<uint32_t>(strtoul(row[72], nullptr, 10)) : 0;
|
||||||
e.pvp_status = row[73] ? static_cast<uint8_t>(strtoul(row[73], nullptr, 10)) : 0;
|
e.tribute_active = row[73] ? static_cast<uint32_t>(strtoul(row[73], nullptr, 10)) : 0;
|
||||||
e.pvp_kills = row[74] ? static_cast<uint32_t>(strtoul(row[74], nullptr, 10)) : 0;
|
e.pvp_status = row[74] ? static_cast<uint8_t>(strtoul(row[74], nullptr, 10)) : 0;
|
||||||
e.pvp_deaths = row[75] ? static_cast<uint32_t>(strtoul(row[75], nullptr, 10)) : 0;
|
e.pvp_kills = row[75] ? static_cast<uint32_t>(strtoul(row[75], nullptr, 10)) : 0;
|
||||||
e.pvp_current_points = row[76] ? static_cast<uint32_t>(strtoul(row[76], nullptr, 10)) : 0;
|
e.pvp_deaths = row[76] ? static_cast<uint32_t>(strtoul(row[76], nullptr, 10)) : 0;
|
||||||
e.pvp_career_points = row[77] ? static_cast<uint32_t>(strtoul(row[77], nullptr, 10)) : 0;
|
e.pvp_current_points = row[77] ? static_cast<uint32_t>(strtoul(row[77], nullptr, 10)) : 0;
|
||||||
e.pvp_best_kill_streak = row[78] ? static_cast<uint32_t>(strtoul(row[78], nullptr, 10)) : 0;
|
e.pvp_career_points = row[78] ? static_cast<uint32_t>(strtoul(row[78], nullptr, 10)) : 0;
|
||||||
e.pvp_worst_death_streak = row[79] ? static_cast<uint32_t>(strtoul(row[79], nullptr, 10)) : 0;
|
e.pvp_best_kill_streak = row[79] ? static_cast<uint32_t>(strtoul(row[79], nullptr, 10)) : 0;
|
||||||
e.pvp_current_kill_streak = row[80] ? static_cast<uint32_t>(strtoul(row[80], nullptr, 10)) : 0;
|
e.pvp_worst_death_streak = row[80] ? static_cast<uint32_t>(strtoul(row[80], nullptr, 10)) : 0;
|
||||||
e.pvp2 = row[81] ? static_cast<uint32_t>(strtoul(row[81], nullptr, 10)) : 0;
|
e.pvp_current_kill_streak = row[81] ? static_cast<uint32_t>(strtoul(row[81], nullptr, 10)) : 0;
|
||||||
e.pvp_type = row[82] ? static_cast<uint32_t>(strtoul(row[82], nullptr, 10)) : 0;
|
e.pvp2 = row[82] ? static_cast<uint32_t>(strtoul(row[82], nullptr, 10)) : 0;
|
||||||
e.show_helm = row[83] ? static_cast<uint32_t>(strtoul(row[83], nullptr, 10)) : 0;
|
e.pvp_type = row[83] ? static_cast<uint32_t>(strtoul(row[83], nullptr, 10)) : 0;
|
||||||
e.group_auto_consent = row[84] ? static_cast<uint8_t>(strtoul(row[84], nullptr, 10)) : 0;
|
e.show_helm = row[84] ? static_cast<uint32_t>(strtoul(row[84], nullptr, 10)) : 0;
|
||||||
e.raid_auto_consent = row[85] ? static_cast<uint8_t>(strtoul(row[85], nullptr, 10)) : 0;
|
e.group_auto_consent = row[85] ? static_cast<uint8_t>(strtoul(row[85], nullptr, 10)) : 0;
|
||||||
e.guild_auto_consent = row[86] ? static_cast<uint8_t>(strtoul(row[86], nullptr, 10)) : 0;
|
e.raid_auto_consent = row[86] ? static_cast<uint8_t>(strtoul(row[86], nullptr, 10)) : 0;
|
||||||
e.leadership_exp_on = row[87] ? static_cast<uint8_t>(strtoul(row[87], nullptr, 10)) : 0;
|
e.guild_auto_consent = row[87] ? static_cast<uint8_t>(strtoul(row[87], nullptr, 10)) : 0;
|
||||||
e.RestTimer = row[88] ? static_cast<uint32_t>(strtoul(row[88], nullptr, 10)) : 0;
|
e.leadership_exp_on = row[88] ? static_cast<uint8_t>(strtoul(row[88], nullptr, 10)) : 0;
|
||||||
e.air_remaining = row[89] ? static_cast<uint32_t>(strtoul(row[89], nullptr, 10)) : 0;
|
e.RestTimer = row[89] ? static_cast<uint32_t>(strtoul(row[89], nullptr, 10)) : 0;
|
||||||
e.autosplit_enabled = row[90] ? static_cast<uint32_t>(strtoul(row[90], nullptr, 10)) : 0;
|
e.air_remaining = row[90] ? static_cast<uint32_t>(strtoul(row[90], nullptr, 10)) : 0;
|
||||||
e.lfp = row[91] ? static_cast<uint8_t>(strtoul(row[91], nullptr, 10)) : 0;
|
e.autosplit_enabled = row[91] ? static_cast<uint32_t>(strtoul(row[91], nullptr, 10)) : 0;
|
||||||
e.lfg = row[92] ? static_cast<uint8_t>(strtoul(row[92], nullptr, 10)) : 0;
|
e.lfp = row[92] ? static_cast<uint8_t>(strtoul(row[92], nullptr, 10)) : 0;
|
||||||
e.mailkey = row[93] ? row[93] : "";
|
e.lfg = row[93] ? static_cast<uint8_t>(strtoul(row[93], nullptr, 10)) : 0;
|
||||||
e.xtargets = row[94] ? static_cast<uint8_t>(strtoul(row[94], nullptr, 10)) : 5;
|
e.mailkey = row[94] ? row[94] : "";
|
||||||
e.firstlogon = row[95] ? static_cast<int8_t>(atoi(row[95])) : 0;
|
e.xtargets = row[95] ? static_cast<uint8_t>(strtoul(row[95], nullptr, 10)) : 5;
|
||||||
e.e_aa_effects = row[96] ? static_cast<uint32_t>(strtoul(row[96], nullptr, 10)) : 0;
|
e.firstlogon = row[96] ? static_cast<int8_t>(atoi(row[96])) : 0;
|
||||||
e.e_percent_to_aa = row[97] ? static_cast<uint32_t>(strtoul(row[97], nullptr, 10)) : 0;
|
e.e_aa_effects = row[97] ? static_cast<uint32_t>(strtoul(row[97], nullptr, 10)) : 0;
|
||||||
e.e_expended_aa_spent = row[98] ? static_cast<uint32_t>(strtoul(row[98], nullptr, 10)) : 0;
|
e.e_percent_to_aa = row[98] ? static_cast<uint32_t>(strtoul(row[98], nullptr, 10)) : 0;
|
||||||
e.aa_points_spent_old = row[99] ? static_cast<uint32_t>(strtoul(row[99], nullptr, 10)) : 0;
|
e.e_expended_aa_spent = row[99] ? static_cast<uint32_t>(strtoul(row[99], nullptr, 10)) : 0;
|
||||||
e.aa_points_old = row[100] ? static_cast<uint32_t>(strtoul(row[100], nullptr, 10)) : 0;
|
e.aa_points_spent_old = row[100] ? static_cast<uint32_t>(strtoul(row[100], nullptr, 10)) : 0;
|
||||||
e.e_last_invsnapshot = row[101] ? static_cast<uint32_t>(strtoul(row[101], nullptr, 10)) : 0;
|
e.aa_points_old = row[101] ? static_cast<uint32_t>(strtoul(row[101], nullptr, 10)) : 0;
|
||||||
e.deleted_at = strtoll(row[102] ? row[102] : "-1", nullptr, 10);
|
e.e_last_invsnapshot = row[102] ? static_cast<uint32_t>(strtoul(row[102], nullptr, 10)) : 0;
|
||||||
|
e.deleted_at = strtoll(row[103] ? row[103] : "-1", nullptr, 10);
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -1235,51 +1244,52 @@ public:
|
|||||||
e.int_ = row[55] ? static_cast<uint32_t>(strtoul(row[55], nullptr, 10)) : 0;
|
e.int_ = row[55] ? static_cast<uint32_t>(strtoul(row[55], nullptr, 10)) : 0;
|
||||||
e.agi = row[56] ? static_cast<uint32_t>(strtoul(row[56], nullptr, 10)) : 0;
|
e.agi = row[56] ? static_cast<uint32_t>(strtoul(row[56], nullptr, 10)) : 0;
|
||||||
e.wis = row[57] ? static_cast<uint32_t>(strtoul(row[57], nullptr, 10)) : 0;
|
e.wis = row[57] ? static_cast<uint32_t>(strtoul(row[57], nullptr, 10)) : 0;
|
||||||
e.zone_change_count = row[58] ? static_cast<uint32_t>(strtoul(row[58], nullptr, 10)) : 0;
|
e.extra_haste = row[58] ? static_cast<int32_t>(atoi(row[58])) : 0;
|
||||||
e.toxicity = row[59] ? static_cast<uint32_t>(strtoul(row[59], nullptr, 10)) : 0;
|
e.zone_change_count = row[59] ? static_cast<uint32_t>(strtoul(row[59], nullptr, 10)) : 0;
|
||||||
e.hunger_level = row[60] ? static_cast<uint32_t>(strtoul(row[60], nullptr, 10)) : 0;
|
e.toxicity = row[60] ? static_cast<uint32_t>(strtoul(row[60], nullptr, 10)) : 0;
|
||||||
e.thirst_level = row[61] ? static_cast<uint32_t>(strtoul(row[61], nullptr, 10)) : 0;
|
e.hunger_level = row[61] ? static_cast<uint32_t>(strtoul(row[61], nullptr, 10)) : 0;
|
||||||
e.ability_up = row[62] ? static_cast<uint32_t>(strtoul(row[62], nullptr, 10)) : 0;
|
e.thirst_level = row[62] ? static_cast<uint32_t>(strtoul(row[62], nullptr, 10)) : 0;
|
||||||
e.ldon_points_guk = row[63] ? static_cast<uint32_t>(strtoul(row[63], nullptr, 10)) : 0;
|
e.ability_up = row[63] ? static_cast<uint32_t>(strtoul(row[63], nullptr, 10)) : 0;
|
||||||
e.ldon_points_mir = row[64] ? static_cast<uint32_t>(strtoul(row[64], nullptr, 10)) : 0;
|
e.ldon_points_guk = row[64] ? static_cast<uint32_t>(strtoul(row[64], nullptr, 10)) : 0;
|
||||||
e.ldon_points_mmc = row[65] ? static_cast<uint32_t>(strtoul(row[65], nullptr, 10)) : 0;
|
e.ldon_points_mir = row[65] ? static_cast<uint32_t>(strtoul(row[65], nullptr, 10)) : 0;
|
||||||
e.ldon_points_ruj = row[66] ? static_cast<uint32_t>(strtoul(row[66], nullptr, 10)) : 0;
|
e.ldon_points_mmc = row[66] ? static_cast<uint32_t>(strtoul(row[66], nullptr, 10)) : 0;
|
||||||
e.ldon_points_tak = row[67] ? static_cast<uint32_t>(strtoul(row[67], nullptr, 10)) : 0;
|
e.ldon_points_ruj = row[67] ? static_cast<uint32_t>(strtoul(row[67], nullptr, 10)) : 0;
|
||||||
e.ldon_points_available = row[68] ? static_cast<uint32_t>(strtoul(row[68], nullptr, 10)) : 0;
|
e.ldon_points_tak = row[68] ? static_cast<uint32_t>(strtoul(row[68], nullptr, 10)) : 0;
|
||||||
e.tribute_time_remaining = row[69] ? static_cast<uint32_t>(strtoul(row[69], nullptr, 10)) : 0;
|
e.ldon_points_available = row[69] ? static_cast<uint32_t>(strtoul(row[69], nullptr, 10)) : 0;
|
||||||
e.career_tribute_points = row[70] ? static_cast<uint32_t>(strtoul(row[70], nullptr, 10)) : 0;
|
e.tribute_time_remaining = row[70] ? static_cast<uint32_t>(strtoul(row[70], nullptr, 10)) : 0;
|
||||||
e.tribute_points = row[71] ? static_cast<uint32_t>(strtoul(row[71], nullptr, 10)) : 0;
|
e.career_tribute_points = row[71] ? static_cast<uint32_t>(strtoul(row[71], nullptr, 10)) : 0;
|
||||||
e.tribute_active = row[72] ? static_cast<uint32_t>(strtoul(row[72], nullptr, 10)) : 0;
|
e.tribute_points = row[72] ? static_cast<uint32_t>(strtoul(row[72], nullptr, 10)) : 0;
|
||||||
e.pvp_status = row[73] ? static_cast<uint8_t>(strtoul(row[73], nullptr, 10)) : 0;
|
e.tribute_active = row[73] ? static_cast<uint32_t>(strtoul(row[73], nullptr, 10)) : 0;
|
||||||
e.pvp_kills = row[74] ? static_cast<uint32_t>(strtoul(row[74], nullptr, 10)) : 0;
|
e.pvp_status = row[74] ? static_cast<uint8_t>(strtoul(row[74], nullptr, 10)) : 0;
|
||||||
e.pvp_deaths = row[75] ? static_cast<uint32_t>(strtoul(row[75], nullptr, 10)) : 0;
|
e.pvp_kills = row[75] ? static_cast<uint32_t>(strtoul(row[75], nullptr, 10)) : 0;
|
||||||
e.pvp_current_points = row[76] ? static_cast<uint32_t>(strtoul(row[76], nullptr, 10)) : 0;
|
e.pvp_deaths = row[76] ? static_cast<uint32_t>(strtoul(row[76], nullptr, 10)) : 0;
|
||||||
e.pvp_career_points = row[77] ? static_cast<uint32_t>(strtoul(row[77], nullptr, 10)) : 0;
|
e.pvp_current_points = row[77] ? static_cast<uint32_t>(strtoul(row[77], nullptr, 10)) : 0;
|
||||||
e.pvp_best_kill_streak = row[78] ? static_cast<uint32_t>(strtoul(row[78], nullptr, 10)) : 0;
|
e.pvp_career_points = row[78] ? static_cast<uint32_t>(strtoul(row[78], nullptr, 10)) : 0;
|
||||||
e.pvp_worst_death_streak = row[79] ? static_cast<uint32_t>(strtoul(row[79], nullptr, 10)) : 0;
|
e.pvp_best_kill_streak = row[79] ? static_cast<uint32_t>(strtoul(row[79], nullptr, 10)) : 0;
|
||||||
e.pvp_current_kill_streak = row[80] ? static_cast<uint32_t>(strtoul(row[80], nullptr, 10)) : 0;
|
e.pvp_worst_death_streak = row[80] ? static_cast<uint32_t>(strtoul(row[80], nullptr, 10)) : 0;
|
||||||
e.pvp2 = row[81] ? static_cast<uint32_t>(strtoul(row[81], nullptr, 10)) : 0;
|
e.pvp_current_kill_streak = row[81] ? static_cast<uint32_t>(strtoul(row[81], nullptr, 10)) : 0;
|
||||||
e.pvp_type = row[82] ? static_cast<uint32_t>(strtoul(row[82], nullptr, 10)) : 0;
|
e.pvp2 = row[82] ? static_cast<uint32_t>(strtoul(row[82], nullptr, 10)) : 0;
|
||||||
e.show_helm = row[83] ? static_cast<uint32_t>(strtoul(row[83], nullptr, 10)) : 0;
|
e.pvp_type = row[83] ? static_cast<uint32_t>(strtoul(row[83], nullptr, 10)) : 0;
|
||||||
e.group_auto_consent = row[84] ? static_cast<uint8_t>(strtoul(row[84], nullptr, 10)) : 0;
|
e.show_helm = row[84] ? static_cast<uint32_t>(strtoul(row[84], nullptr, 10)) : 0;
|
||||||
e.raid_auto_consent = row[85] ? static_cast<uint8_t>(strtoul(row[85], nullptr, 10)) : 0;
|
e.group_auto_consent = row[85] ? static_cast<uint8_t>(strtoul(row[85], nullptr, 10)) : 0;
|
||||||
e.guild_auto_consent = row[86] ? static_cast<uint8_t>(strtoul(row[86], nullptr, 10)) : 0;
|
e.raid_auto_consent = row[86] ? static_cast<uint8_t>(strtoul(row[86], nullptr, 10)) : 0;
|
||||||
e.leadership_exp_on = row[87] ? static_cast<uint8_t>(strtoul(row[87], nullptr, 10)) : 0;
|
e.guild_auto_consent = row[87] ? static_cast<uint8_t>(strtoul(row[87], nullptr, 10)) : 0;
|
||||||
e.RestTimer = row[88] ? static_cast<uint32_t>(strtoul(row[88], nullptr, 10)) : 0;
|
e.leadership_exp_on = row[88] ? static_cast<uint8_t>(strtoul(row[88], nullptr, 10)) : 0;
|
||||||
e.air_remaining = row[89] ? static_cast<uint32_t>(strtoul(row[89], nullptr, 10)) : 0;
|
e.RestTimer = row[89] ? static_cast<uint32_t>(strtoul(row[89], nullptr, 10)) : 0;
|
||||||
e.autosplit_enabled = row[90] ? static_cast<uint32_t>(strtoul(row[90], nullptr, 10)) : 0;
|
e.air_remaining = row[90] ? static_cast<uint32_t>(strtoul(row[90], nullptr, 10)) : 0;
|
||||||
e.lfp = row[91] ? static_cast<uint8_t>(strtoul(row[91], nullptr, 10)) : 0;
|
e.autosplit_enabled = row[91] ? static_cast<uint32_t>(strtoul(row[91], nullptr, 10)) : 0;
|
||||||
e.lfg = row[92] ? static_cast<uint8_t>(strtoul(row[92], nullptr, 10)) : 0;
|
e.lfp = row[92] ? static_cast<uint8_t>(strtoul(row[92], nullptr, 10)) : 0;
|
||||||
e.mailkey = row[93] ? row[93] : "";
|
e.lfg = row[93] ? static_cast<uint8_t>(strtoul(row[93], nullptr, 10)) : 0;
|
||||||
e.xtargets = row[94] ? static_cast<uint8_t>(strtoul(row[94], nullptr, 10)) : 5;
|
e.mailkey = row[94] ? row[94] : "";
|
||||||
e.firstlogon = row[95] ? static_cast<int8_t>(atoi(row[95])) : 0;
|
e.xtargets = row[95] ? static_cast<uint8_t>(strtoul(row[95], nullptr, 10)) : 5;
|
||||||
e.e_aa_effects = row[96] ? static_cast<uint32_t>(strtoul(row[96], nullptr, 10)) : 0;
|
e.firstlogon = row[96] ? static_cast<int8_t>(atoi(row[96])) : 0;
|
||||||
e.e_percent_to_aa = row[97] ? static_cast<uint32_t>(strtoul(row[97], nullptr, 10)) : 0;
|
e.e_aa_effects = row[97] ? static_cast<uint32_t>(strtoul(row[97], nullptr, 10)) : 0;
|
||||||
e.e_expended_aa_spent = row[98] ? static_cast<uint32_t>(strtoul(row[98], nullptr, 10)) : 0;
|
e.e_percent_to_aa = row[98] ? static_cast<uint32_t>(strtoul(row[98], nullptr, 10)) : 0;
|
||||||
e.aa_points_spent_old = row[99] ? static_cast<uint32_t>(strtoul(row[99], nullptr, 10)) : 0;
|
e.e_expended_aa_spent = row[99] ? static_cast<uint32_t>(strtoul(row[99], nullptr, 10)) : 0;
|
||||||
e.aa_points_old = row[100] ? static_cast<uint32_t>(strtoul(row[100], nullptr, 10)) : 0;
|
e.aa_points_spent_old = row[100] ? static_cast<uint32_t>(strtoul(row[100], nullptr, 10)) : 0;
|
||||||
e.e_last_invsnapshot = row[101] ? static_cast<uint32_t>(strtoul(row[101], nullptr, 10)) : 0;
|
e.aa_points_old = row[101] ? static_cast<uint32_t>(strtoul(row[101], nullptr, 10)) : 0;
|
||||||
e.deleted_at = strtoll(row[102] ? row[102] : "-1", nullptr, 10);
|
e.e_last_invsnapshot = row[102] ? static_cast<uint32_t>(strtoul(row[102], nullptr, 10)) : 0;
|
||||||
|
e.deleted_at = strtoll(row[103] ? row[103] : "-1", nullptr, 10);
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -1412,6 +1422,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.int_));
|
v.push_back(std::to_string(e.int_));
|
||||||
v.push_back(std::to_string(e.agi));
|
v.push_back(std::to_string(e.agi));
|
||||||
v.push_back(std::to_string(e.wis));
|
v.push_back(std::to_string(e.wis));
|
||||||
|
v.push_back(std::to_string(e.extra_haste));
|
||||||
v.push_back(std::to_string(e.zone_change_count));
|
v.push_back(std::to_string(e.zone_change_count));
|
||||||
v.push_back(std::to_string(e.toxicity));
|
v.push_back(std::to_string(e.toxicity));
|
||||||
v.push_back(std::to_string(e.hunger_level));
|
v.push_back(std::to_string(e.hunger_level));
|
||||||
@@ -1537,6 +1548,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.int_));
|
v.push_back(std::to_string(e.int_));
|
||||||
v.push_back(std::to_string(e.agi));
|
v.push_back(std::to_string(e.agi));
|
||||||
v.push_back(std::to_string(e.wis));
|
v.push_back(std::to_string(e.wis));
|
||||||
|
v.push_back(std::to_string(e.extra_haste));
|
||||||
v.push_back(std::to_string(e.zone_change_count));
|
v.push_back(std::to_string(e.zone_change_count));
|
||||||
v.push_back(std::to_string(e.toxicity));
|
v.push_back(std::to_string(e.toxicity));
|
||||||
v.push_back(std::to_string(e.hunger_level));
|
v.push_back(std::to_string(e.hunger_level));
|
||||||
|
|||||||
@@ -0,0 +1,499 @@
|
|||||||
|
/**
|
||||||
|
* DO NOT MODIFY THIS FILE
|
||||||
|
*
|
||||||
|
* 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://docs.eqemu.io/developer/repositories
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef EQEMU_BASE_CHARACTER_PARCELS_CONTAINERS_REPOSITORY_H
|
||||||
|
#define EQEMU_BASE_CHARACTER_PARCELS_CONTAINERS_REPOSITORY_H
|
||||||
|
|
||||||
|
#include "../../database.h"
|
||||||
|
#include "../../strings.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
|
class BaseCharacterParcelsContainersRepository {
|
||||||
|
public:
|
||||||
|
struct CharacterParcelsContainers {
|
||||||
|
uint32_t id;
|
||||||
|
uint32_t parcels_id;
|
||||||
|
uint32_t slot_id;
|
||||||
|
uint32_t item_id;
|
||||||
|
uint32_t aug_slot_1;
|
||||||
|
uint32_t aug_slot_2;
|
||||||
|
uint32_t aug_slot_3;
|
||||||
|
uint32_t aug_slot_4;
|
||||||
|
uint32_t aug_slot_5;
|
||||||
|
uint32_t aug_slot_6;
|
||||||
|
uint32_t quantity;
|
||||||
|
};
|
||||||
|
|
||||||
|
static std::string PrimaryKey()
|
||||||
|
{
|
||||||
|
return std::string("id");
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> Columns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"parcels_id",
|
||||||
|
"slot_id",
|
||||||
|
"item_id",
|
||||||
|
"aug_slot_1",
|
||||||
|
"aug_slot_2",
|
||||||
|
"aug_slot_3",
|
||||||
|
"aug_slot_4",
|
||||||
|
"aug_slot_5",
|
||||||
|
"aug_slot_6",
|
||||||
|
"quantity",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"parcels_id",
|
||||||
|
"slot_id",
|
||||||
|
"item_id",
|
||||||
|
"aug_slot_1",
|
||||||
|
"aug_slot_2",
|
||||||
|
"aug_slot_3",
|
||||||
|
"aug_slot_4",
|
||||||
|
"aug_slot_5",
|
||||||
|
"aug_slot_6",
|
||||||
|
"quantity",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string ColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(Strings::Implode(", ", Columns()));
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(Strings::Implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string TableName()
|
||||||
|
{
|
||||||
|
return std::string("character_parcels_containers");
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string BaseSelect()
|
||||||
|
{
|
||||||
|
return fmt::format(
|
||||||
|
"SELECT {} FROM {}",
|
||||||
|
SelectColumnsRaw(),
|
||||||
|
TableName()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string BaseInsert()
|
||||||
|
{
|
||||||
|
return fmt::format(
|
||||||
|
"INSERT INTO {} ({}) ",
|
||||||
|
TableName(),
|
||||||
|
ColumnsRaw()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static CharacterParcelsContainers NewEntity()
|
||||||
|
{
|
||||||
|
CharacterParcelsContainers e{};
|
||||||
|
|
||||||
|
e.id = 0;
|
||||||
|
e.parcels_id = 0;
|
||||||
|
e.slot_id = 0;
|
||||||
|
e.item_id = 0;
|
||||||
|
e.aug_slot_1 = 0;
|
||||||
|
e.aug_slot_2 = 0;
|
||||||
|
e.aug_slot_3 = 0;
|
||||||
|
e.aug_slot_4 = 0;
|
||||||
|
e.aug_slot_5 = 0;
|
||||||
|
e.aug_slot_6 = 0;
|
||||||
|
e.quantity = 0;
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
static CharacterParcelsContainers GetCharacterParcelsContainers(
|
||||||
|
const std::vector<CharacterParcelsContainers> &character_parcels_containerss,
|
||||||
|
int character_parcels_containers_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
for (auto &character_parcels_containers : character_parcels_containerss) {
|
||||||
|
if (character_parcels_containers.id == character_parcels_containers_id) {
|
||||||
|
return character_parcels_containers;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NewEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
static CharacterParcelsContainers FindOne(
|
||||||
|
Database& db,
|
||||||
|
int character_parcels_containers_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} WHERE {} = {} LIMIT 1",
|
||||||
|
BaseSelect(),
|
||||||
|
PrimaryKey(),
|
||||||
|
character_parcels_containers_id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
auto row = results.begin();
|
||||||
|
if (results.RowCount() == 1) {
|
||||||
|
CharacterParcelsContainers e{};
|
||||||
|
|
||||||
|
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||||
|
e.parcels_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||||
|
e.slot_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
|
e.item_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_1 = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_2 = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_3 = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_4 = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_5 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_6 = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||||
|
e.quantity = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NewEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
static int DeleteOne(
|
||||||
|
Database& db,
|
||||||
|
int character_parcels_containers_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"DELETE FROM {} WHERE {} = {}",
|
||||||
|
TableName(),
|
||||||
|
PrimaryKey(),
|
||||||
|
character_parcels_containers_id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int UpdateOne(
|
||||||
|
Database& db,
|
||||||
|
const CharacterParcelsContainers &e
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
auto columns = Columns();
|
||||||
|
|
||||||
|
v.push_back(columns[1] + " = " + std::to_string(e.parcels_id));
|
||||||
|
v.push_back(columns[2] + " = " + std::to_string(e.slot_id));
|
||||||
|
v.push_back(columns[3] + " = " + std::to_string(e.item_id));
|
||||||
|
v.push_back(columns[4] + " = " + std::to_string(e.aug_slot_1));
|
||||||
|
v.push_back(columns[5] + " = " + std::to_string(e.aug_slot_2));
|
||||||
|
v.push_back(columns[6] + " = " + std::to_string(e.aug_slot_3));
|
||||||
|
v.push_back(columns[7] + " = " + std::to_string(e.aug_slot_4));
|
||||||
|
v.push_back(columns[8] + " = " + std::to_string(e.aug_slot_5));
|
||||||
|
v.push_back(columns[9] + " = " + std::to_string(e.aug_slot_6));
|
||||||
|
v.push_back(columns[10] + " = " + std::to_string(e.quantity));
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"UPDATE {} SET {} WHERE {} = {}",
|
||||||
|
TableName(),
|
||||||
|
Strings::Implode(", ", v),
|
||||||
|
PrimaryKey(),
|
||||||
|
e.id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static CharacterParcelsContainers InsertOne(
|
||||||
|
Database& db,
|
||||||
|
CharacterParcelsContainers e
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.id));
|
||||||
|
v.push_back(std::to_string(e.parcels_id));
|
||||||
|
v.push_back(std::to_string(e.slot_id));
|
||||||
|
v.push_back(std::to_string(e.item_id));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_1));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_2));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_3));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_4));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_5));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_6));
|
||||||
|
v.push_back(std::to_string(e.quantity));
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} VALUES ({})",
|
||||||
|
BaseInsert(),
|
||||||
|
Strings::Implode(",", v)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (results.Success()) {
|
||||||
|
e.id = results.LastInsertedID();
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
e = NewEntity();
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int InsertMany(
|
||||||
|
Database& db,
|
||||||
|
const std::vector<CharacterParcelsContainers> &entries
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> insert_chunks;
|
||||||
|
|
||||||
|
for (auto &e: entries) {
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.id));
|
||||||
|
v.push_back(std::to_string(e.parcels_id));
|
||||||
|
v.push_back(std::to_string(e.slot_id));
|
||||||
|
v.push_back(std::to_string(e.item_id));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_1));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_2));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_3));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_4));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_5));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_6));
|
||||||
|
v.push_back(std::to_string(e.quantity));
|
||||||
|
|
||||||
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} VALUES {}",
|
||||||
|
BaseInsert(),
|
||||||
|
Strings::Implode(",", insert_chunks)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<CharacterParcelsContainers> All(Database& db)
|
||||||
|
{
|
||||||
|
std::vector<CharacterParcelsContainers> all_entries;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{}",
|
||||||
|
BaseSelect()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
all_entries.reserve(results.RowCount());
|
||||||
|
|
||||||
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
CharacterParcelsContainers e{};
|
||||||
|
|
||||||
|
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||||
|
e.parcels_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||||
|
e.slot_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
|
e.item_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_1 = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_2 = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_3 = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_4 = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_5 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_6 = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||||
|
e.quantity = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
|
||||||
|
|
||||||
|
all_entries.push_back(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return all_entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<CharacterParcelsContainers> GetWhere(Database& db, const std::string &where_filter)
|
||||||
|
{
|
||||||
|
std::vector<CharacterParcelsContainers> all_entries;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} WHERE {}",
|
||||||
|
BaseSelect(),
|
||||||
|
where_filter
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
all_entries.reserve(results.RowCount());
|
||||||
|
|
||||||
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
CharacterParcelsContainers e{};
|
||||||
|
|
||||||
|
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||||
|
e.parcels_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||||
|
e.slot_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
|
e.item_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_1 = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_2 = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_3 = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_4 = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_5 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_6 = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||||
|
e.quantity = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
|
||||||
|
|
||||||
|
all_entries.push_back(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return all_entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int DeleteWhere(Database& db, const std::string &where_filter)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"DELETE FROM {} WHERE {}",
|
||||||
|
TableName(),
|
||||||
|
where_filter
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int Truncate(Database& db)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"TRUNCATE TABLE {}",
|
||||||
|
TableName()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int64 GetMaxId(Database& db)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"SELECT COALESCE(MAX({}), 0) FROM {}",
|
||||||
|
PrimaryKey(),
|
||||||
|
TableName()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int64 Count(Database& db, const std::string &where_filter = "")
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"SELECT COUNT(*) FROM {} {}",
|
||||||
|
TableName(),
|
||||||
|
(where_filter.empty() ? "" : "WHERE " + where_filter)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string BaseReplace()
|
||||||
|
{
|
||||||
|
return fmt::format(
|
||||||
|
"REPLACE INTO {} ({}) ",
|
||||||
|
TableName(),
|
||||||
|
ColumnsRaw()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int ReplaceOne(
|
||||||
|
Database& db,
|
||||||
|
const CharacterParcelsContainers &e
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.id));
|
||||||
|
v.push_back(std::to_string(e.parcels_id));
|
||||||
|
v.push_back(std::to_string(e.slot_id));
|
||||||
|
v.push_back(std::to_string(e.item_id));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_1));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_2));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_3));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_4));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_5));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_6));
|
||||||
|
v.push_back(std::to_string(e.quantity));
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} VALUES ({})",
|
||||||
|
BaseReplace(),
|
||||||
|
Strings::Implode(",", v)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int ReplaceMany(
|
||||||
|
Database& db,
|
||||||
|
const std::vector<CharacterParcelsContainers> &entries
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> insert_chunks;
|
||||||
|
|
||||||
|
for (auto &e: entries) {
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.id));
|
||||||
|
v.push_back(std::to_string(e.parcels_id));
|
||||||
|
v.push_back(std::to_string(e.slot_id));
|
||||||
|
v.push_back(std::to_string(e.item_id));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_1));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_2));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_3));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_4));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_5));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_6));
|
||||||
|
v.push_back(std::to_string(e.quantity));
|
||||||
|
|
||||||
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} VALUES {}",
|
||||||
|
BaseReplace(),
|
||||||
|
Strings::Implode(",", insert_chunks)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //EQEMU_BASE_CHARACTER_PARCELS_CONTAINERS_REPOSITORY_H
|
||||||
@@ -0,0 +1,535 @@
|
|||||||
|
/**
|
||||||
|
* DO NOT MODIFY THIS FILE
|
||||||
|
*
|
||||||
|
* 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://docs.eqemu.io/developer/repositories
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef EQEMU_BASE_CHARACTER_PARCELS_REPOSITORY_H
|
||||||
|
#define EQEMU_BASE_CHARACTER_PARCELS_REPOSITORY_H
|
||||||
|
|
||||||
|
#include "../../database.h"
|
||||||
|
#include "../../strings.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
|
class BaseCharacterParcelsRepository {
|
||||||
|
public:
|
||||||
|
struct CharacterParcels {
|
||||||
|
uint32_t id;
|
||||||
|
uint32_t char_id;
|
||||||
|
uint32_t item_id;
|
||||||
|
uint32_t aug_slot_1;
|
||||||
|
uint32_t aug_slot_2;
|
||||||
|
uint32_t aug_slot_3;
|
||||||
|
uint32_t aug_slot_4;
|
||||||
|
uint32_t aug_slot_5;
|
||||||
|
uint32_t aug_slot_6;
|
||||||
|
uint32_t slot_id;
|
||||||
|
uint32_t quantity;
|
||||||
|
std::string from_name;
|
||||||
|
std::string note;
|
||||||
|
time_t sent_date;
|
||||||
|
};
|
||||||
|
|
||||||
|
static std::string PrimaryKey()
|
||||||
|
{
|
||||||
|
return std::string("id");
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> Columns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"char_id",
|
||||||
|
"item_id",
|
||||||
|
"aug_slot_1",
|
||||||
|
"aug_slot_2",
|
||||||
|
"aug_slot_3",
|
||||||
|
"aug_slot_4",
|
||||||
|
"aug_slot_5",
|
||||||
|
"aug_slot_6",
|
||||||
|
"slot_id",
|
||||||
|
"quantity",
|
||||||
|
"from_name",
|
||||||
|
"note",
|
||||||
|
"sent_date",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"char_id",
|
||||||
|
"item_id",
|
||||||
|
"aug_slot_1",
|
||||||
|
"aug_slot_2",
|
||||||
|
"aug_slot_3",
|
||||||
|
"aug_slot_4",
|
||||||
|
"aug_slot_5",
|
||||||
|
"aug_slot_6",
|
||||||
|
"slot_id",
|
||||||
|
"quantity",
|
||||||
|
"from_name",
|
||||||
|
"note",
|
||||||
|
"UNIX_TIMESTAMP(sent_date)",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string ColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(Strings::Implode(", ", Columns()));
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(Strings::Implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string TableName()
|
||||||
|
{
|
||||||
|
return std::string("character_parcels");
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string BaseSelect()
|
||||||
|
{
|
||||||
|
return fmt::format(
|
||||||
|
"SELECT {} FROM {}",
|
||||||
|
SelectColumnsRaw(),
|
||||||
|
TableName()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string BaseInsert()
|
||||||
|
{
|
||||||
|
return fmt::format(
|
||||||
|
"INSERT INTO {} ({}) ",
|
||||||
|
TableName(),
|
||||||
|
ColumnsRaw()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static CharacterParcels NewEntity()
|
||||||
|
{
|
||||||
|
CharacterParcels e{};
|
||||||
|
|
||||||
|
e.id = 0;
|
||||||
|
e.char_id = 0;
|
||||||
|
e.item_id = 0;
|
||||||
|
e.aug_slot_1 = 0;
|
||||||
|
e.aug_slot_2 = 0;
|
||||||
|
e.aug_slot_3 = 0;
|
||||||
|
e.aug_slot_4 = 0;
|
||||||
|
e.aug_slot_5 = 0;
|
||||||
|
e.aug_slot_6 = 0;
|
||||||
|
e.slot_id = 0;
|
||||||
|
e.quantity = 0;
|
||||||
|
e.from_name = "";
|
||||||
|
e.note = "";
|
||||||
|
e.sent_date = 0;
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
static CharacterParcels GetCharacterParcels(
|
||||||
|
const std::vector<CharacterParcels> &character_parcelss,
|
||||||
|
int character_parcels_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
for (auto &character_parcels : character_parcelss) {
|
||||||
|
if (character_parcels.id == character_parcels_id) {
|
||||||
|
return character_parcels;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NewEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
static CharacterParcels FindOne(
|
||||||
|
Database& db,
|
||||||
|
int character_parcels_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} WHERE {} = {} LIMIT 1",
|
||||||
|
BaseSelect(),
|
||||||
|
PrimaryKey(),
|
||||||
|
character_parcels_id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
auto row = results.begin();
|
||||||
|
if (results.RowCount() == 1) {
|
||||||
|
CharacterParcels e{};
|
||||||
|
|
||||||
|
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||||
|
e.char_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||||
|
e.item_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_1 = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_2 = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_3 = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_4 = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_5 = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_6 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||||
|
e.slot_id = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||||
|
e.quantity = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
|
||||||
|
e.from_name = row[11] ? row[11] : "";
|
||||||
|
e.note = row[12] ? row[12] : "";
|
||||||
|
e.sent_date = strtoll(row[13] ? row[13] : "-1", nullptr, 10);
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NewEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
static int DeleteOne(
|
||||||
|
Database& db,
|
||||||
|
int character_parcels_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"DELETE FROM {} WHERE {} = {}",
|
||||||
|
TableName(),
|
||||||
|
PrimaryKey(),
|
||||||
|
character_parcels_id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int UpdateOne(
|
||||||
|
Database& db,
|
||||||
|
const CharacterParcels &e
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
auto columns = Columns();
|
||||||
|
|
||||||
|
v.push_back(columns[1] + " = " + std::to_string(e.char_id));
|
||||||
|
v.push_back(columns[2] + " = " + std::to_string(e.item_id));
|
||||||
|
v.push_back(columns[3] + " = " + std::to_string(e.aug_slot_1));
|
||||||
|
v.push_back(columns[4] + " = " + std::to_string(e.aug_slot_2));
|
||||||
|
v.push_back(columns[5] + " = " + std::to_string(e.aug_slot_3));
|
||||||
|
v.push_back(columns[6] + " = " + std::to_string(e.aug_slot_4));
|
||||||
|
v.push_back(columns[7] + " = " + std::to_string(e.aug_slot_5));
|
||||||
|
v.push_back(columns[8] + " = " + std::to_string(e.aug_slot_6));
|
||||||
|
v.push_back(columns[9] + " = " + std::to_string(e.slot_id));
|
||||||
|
v.push_back(columns[10] + " = " + std::to_string(e.quantity));
|
||||||
|
v.push_back(columns[11] + " = '" + Strings::Escape(e.from_name) + "'");
|
||||||
|
v.push_back(columns[12] + " = '" + Strings::Escape(e.note) + "'");
|
||||||
|
v.push_back(columns[13] + " = FROM_UNIXTIME(" + (e.sent_date > 0 ? std::to_string(e.sent_date) : "null") + ")");
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"UPDATE {} SET {} WHERE {} = {}",
|
||||||
|
TableName(),
|
||||||
|
Strings::Implode(", ", v),
|
||||||
|
PrimaryKey(),
|
||||||
|
e.id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static CharacterParcels InsertOne(
|
||||||
|
Database& db,
|
||||||
|
CharacterParcels e
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.id));
|
||||||
|
v.push_back(std::to_string(e.char_id));
|
||||||
|
v.push_back(std::to_string(e.item_id));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_1));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_2));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_3));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_4));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_5));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_6));
|
||||||
|
v.push_back(std::to_string(e.slot_id));
|
||||||
|
v.push_back(std::to_string(e.quantity));
|
||||||
|
v.push_back("'" + Strings::Escape(e.from_name) + "'");
|
||||||
|
v.push_back("'" + Strings::Escape(e.note) + "'");
|
||||||
|
v.push_back("FROM_UNIXTIME(" + (e.sent_date > 0 ? std::to_string(e.sent_date) : "null") + ")");
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} VALUES ({})",
|
||||||
|
BaseInsert(),
|
||||||
|
Strings::Implode(",", v)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (results.Success()) {
|
||||||
|
e.id = results.LastInsertedID();
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
e = NewEntity();
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int InsertMany(
|
||||||
|
Database& db,
|
||||||
|
const std::vector<CharacterParcels> &entries
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> insert_chunks;
|
||||||
|
|
||||||
|
for (auto &e: entries) {
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.id));
|
||||||
|
v.push_back(std::to_string(e.char_id));
|
||||||
|
v.push_back(std::to_string(e.item_id));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_1));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_2));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_3));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_4));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_5));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_6));
|
||||||
|
v.push_back(std::to_string(e.slot_id));
|
||||||
|
v.push_back(std::to_string(e.quantity));
|
||||||
|
v.push_back("'" + Strings::Escape(e.from_name) + "'");
|
||||||
|
v.push_back("'" + Strings::Escape(e.note) + "'");
|
||||||
|
v.push_back("FROM_UNIXTIME(" + (e.sent_date > 0 ? std::to_string(e.sent_date) : "null") + ")");
|
||||||
|
|
||||||
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} VALUES {}",
|
||||||
|
BaseInsert(),
|
||||||
|
Strings::Implode(",", insert_chunks)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<CharacterParcels> All(Database& db)
|
||||||
|
{
|
||||||
|
std::vector<CharacterParcels> all_entries;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{}",
|
||||||
|
BaseSelect()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
all_entries.reserve(results.RowCount());
|
||||||
|
|
||||||
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
CharacterParcels e{};
|
||||||
|
|
||||||
|
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||||
|
e.char_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||||
|
e.item_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_1 = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_2 = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_3 = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_4 = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_5 = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_6 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||||
|
e.slot_id = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||||
|
e.quantity = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
|
||||||
|
e.from_name = row[11] ? row[11] : "";
|
||||||
|
e.note = row[12] ? row[12] : "";
|
||||||
|
e.sent_date = strtoll(row[13] ? row[13] : "-1", nullptr, 10);
|
||||||
|
|
||||||
|
all_entries.push_back(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return all_entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<CharacterParcels> GetWhere(Database& db, const std::string &where_filter)
|
||||||
|
{
|
||||||
|
std::vector<CharacterParcels> all_entries;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} WHERE {}",
|
||||||
|
BaseSelect(),
|
||||||
|
where_filter
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
all_entries.reserve(results.RowCount());
|
||||||
|
|
||||||
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
CharacterParcels e{};
|
||||||
|
|
||||||
|
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||||
|
e.char_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||||
|
e.item_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_1 = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_2 = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_3 = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_4 = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_5 = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_6 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||||
|
e.slot_id = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||||
|
e.quantity = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
|
||||||
|
e.from_name = row[11] ? row[11] : "";
|
||||||
|
e.note = row[12] ? row[12] : "";
|
||||||
|
e.sent_date = strtoll(row[13] ? row[13] : "-1", nullptr, 10);
|
||||||
|
|
||||||
|
all_entries.push_back(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return all_entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int DeleteWhere(Database& db, const std::string &where_filter)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"DELETE FROM {} WHERE {}",
|
||||||
|
TableName(),
|
||||||
|
where_filter
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int Truncate(Database& db)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"TRUNCATE TABLE {}",
|
||||||
|
TableName()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int64 GetMaxId(Database& db)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"SELECT COALESCE(MAX({}), 0) FROM {}",
|
||||||
|
PrimaryKey(),
|
||||||
|
TableName()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int64 Count(Database& db, const std::string &where_filter = "")
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"SELECT COUNT(*) FROM {} {}",
|
||||||
|
TableName(),
|
||||||
|
(where_filter.empty() ? "" : "WHERE " + where_filter)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string BaseReplace()
|
||||||
|
{
|
||||||
|
return fmt::format(
|
||||||
|
"REPLACE INTO {} ({}) ",
|
||||||
|
TableName(),
|
||||||
|
ColumnsRaw()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int ReplaceOne(
|
||||||
|
Database& db,
|
||||||
|
const CharacterParcels &e
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.id));
|
||||||
|
v.push_back(std::to_string(e.char_id));
|
||||||
|
v.push_back(std::to_string(e.item_id));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_1));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_2));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_3));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_4));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_5));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_6));
|
||||||
|
v.push_back(std::to_string(e.slot_id));
|
||||||
|
v.push_back(std::to_string(e.quantity));
|
||||||
|
v.push_back("'" + Strings::Escape(e.from_name) + "'");
|
||||||
|
v.push_back("'" + Strings::Escape(e.note) + "'");
|
||||||
|
v.push_back("FROM_UNIXTIME(" + (e.sent_date > 0 ? std::to_string(e.sent_date) : "null") + ")");
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} VALUES ({})",
|
||||||
|
BaseReplace(),
|
||||||
|
Strings::Implode(",", v)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int ReplaceMany(
|
||||||
|
Database& db,
|
||||||
|
const std::vector<CharacterParcels> &entries
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> insert_chunks;
|
||||||
|
|
||||||
|
for (auto &e: entries) {
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.id));
|
||||||
|
v.push_back(std::to_string(e.char_id));
|
||||||
|
v.push_back(std::to_string(e.item_id));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_1));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_2));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_3));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_4));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_5));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_6));
|
||||||
|
v.push_back(std::to_string(e.slot_id));
|
||||||
|
v.push_back(std::to_string(e.quantity));
|
||||||
|
v.push_back("'" + Strings::Escape(e.from_name) + "'");
|
||||||
|
v.push_back("'" + Strings::Escape(e.note) + "'");
|
||||||
|
v.push_back("FROM_UNIXTIME(" + (e.sent_date > 0 ? std::to_string(e.sent_date) : "null") + ")");
|
||||||
|
|
||||||
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} VALUES {}",
|
||||||
|
BaseReplace(),
|
||||||
|
Strings::Implode(",", insert_chunks)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //EQEMU_BASE_CHARACTER_PARCELS_REPOSITORY_H
|
||||||
@@ -50,6 +50,7 @@ public:
|
|||||||
float buffer;
|
float buffer;
|
||||||
uint32_t client_version_mask;
|
uint32_t client_version_mask;
|
||||||
int16_t is_ldon_door;
|
int16_t is_ldon_door;
|
||||||
|
int16_t close_timer_ms;
|
||||||
int32_t dz_switch_id;
|
int32_t dz_switch_id;
|
||||||
int8_t min_expansion;
|
int8_t min_expansion;
|
||||||
int8_t max_expansion;
|
int8_t max_expansion;
|
||||||
@@ -96,6 +97,7 @@ public:
|
|||||||
"buffer",
|
"buffer",
|
||||||
"client_version_mask",
|
"client_version_mask",
|
||||||
"is_ldon_door",
|
"is_ldon_door",
|
||||||
|
"close_timer_ms",
|
||||||
"dz_switch_id",
|
"dz_switch_id",
|
||||||
"min_expansion",
|
"min_expansion",
|
||||||
"max_expansion",
|
"max_expansion",
|
||||||
@@ -138,6 +140,7 @@ public:
|
|||||||
"buffer",
|
"buffer",
|
||||||
"client_version_mask",
|
"client_version_mask",
|
||||||
"is_ldon_door",
|
"is_ldon_door",
|
||||||
|
"close_timer_ms",
|
||||||
"dz_switch_id",
|
"dz_switch_id",
|
||||||
"min_expansion",
|
"min_expansion",
|
||||||
"max_expansion",
|
"max_expansion",
|
||||||
@@ -214,6 +217,7 @@ public:
|
|||||||
e.buffer = 0;
|
e.buffer = 0;
|
||||||
e.client_version_mask = 4294967295;
|
e.client_version_mask = 4294967295;
|
||||||
e.is_ldon_door = 0;
|
e.is_ldon_door = 0;
|
||||||
|
e.close_timer_ms = 5000;
|
||||||
e.dz_switch_id = 0;
|
e.dz_switch_id = 0;
|
||||||
e.min_expansion = -1;
|
e.min_expansion = -1;
|
||||||
e.max_expansion = -1;
|
e.max_expansion = -1;
|
||||||
@@ -286,11 +290,12 @@ public:
|
|||||||
e.buffer = row[28] ? strtof(row[28], nullptr) : 0;
|
e.buffer = row[28] ? strtof(row[28], nullptr) : 0;
|
||||||
e.client_version_mask = row[29] ? static_cast<uint32_t>(strtoul(row[29], nullptr, 10)) : 4294967295;
|
e.client_version_mask = row[29] ? static_cast<uint32_t>(strtoul(row[29], nullptr, 10)) : 4294967295;
|
||||||
e.is_ldon_door = row[30] ? static_cast<int16_t>(atoi(row[30])) : 0;
|
e.is_ldon_door = row[30] ? static_cast<int16_t>(atoi(row[30])) : 0;
|
||||||
e.dz_switch_id = row[31] ? static_cast<int32_t>(atoi(row[31])) : 0;
|
e.close_timer_ms = row[31] ? static_cast<int16_t>(atoi(row[31])) : 5000;
|
||||||
e.min_expansion = row[32] ? static_cast<int8_t>(atoi(row[32])) : -1;
|
e.dz_switch_id = row[32] ? static_cast<int32_t>(atoi(row[32])) : 0;
|
||||||
e.max_expansion = row[33] ? static_cast<int8_t>(atoi(row[33])) : -1;
|
e.min_expansion = row[33] ? static_cast<int8_t>(atoi(row[33])) : -1;
|
||||||
e.content_flags = row[34] ? row[34] : "";
|
e.max_expansion = row[34] ? static_cast<int8_t>(atoi(row[34])) : -1;
|
||||||
e.content_flags_disabled = row[35] ? row[35] : "";
|
e.content_flags = row[35] ? row[35] : "";
|
||||||
|
e.content_flags_disabled = row[36] ? row[36] : "";
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -354,11 +359,12 @@ public:
|
|||||||
v.push_back(columns[28] + " = " + std::to_string(e.buffer));
|
v.push_back(columns[28] + " = " + std::to_string(e.buffer));
|
||||||
v.push_back(columns[29] + " = " + std::to_string(e.client_version_mask));
|
v.push_back(columns[29] + " = " + std::to_string(e.client_version_mask));
|
||||||
v.push_back(columns[30] + " = " + std::to_string(e.is_ldon_door));
|
v.push_back(columns[30] + " = " + std::to_string(e.is_ldon_door));
|
||||||
v.push_back(columns[31] + " = " + std::to_string(e.dz_switch_id));
|
v.push_back(columns[31] + " = " + std::to_string(e.close_timer_ms));
|
||||||
v.push_back(columns[32] + " = " + std::to_string(e.min_expansion));
|
v.push_back(columns[32] + " = " + std::to_string(e.dz_switch_id));
|
||||||
v.push_back(columns[33] + " = " + std::to_string(e.max_expansion));
|
v.push_back(columns[33] + " = " + std::to_string(e.min_expansion));
|
||||||
v.push_back(columns[34] + " = '" + Strings::Escape(e.content_flags) + "'");
|
v.push_back(columns[34] + " = " + std::to_string(e.max_expansion));
|
||||||
v.push_back(columns[35] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
|
v.push_back(columns[35] + " = '" + Strings::Escape(e.content_flags) + "'");
|
||||||
|
v.push_back(columns[36] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -411,6 +417,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.buffer));
|
v.push_back(std::to_string(e.buffer));
|
||||||
v.push_back(std::to_string(e.client_version_mask));
|
v.push_back(std::to_string(e.client_version_mask));
|
||||||
v.push_back(std::to_string(e.is_ldon_door));
|
v.push_back(std::to_string(e.is_ldon_door));
|
||||||
|
v.push_back(std::to_string(e.close_timer_ms));
|
||||||
v.push_back(std::to_string(e.dz_switch_id));
|
v.push_back(std::to_string(e.dz_switch_id));
|
||||||
v.push_back(std::to_string(e.min_expansion));
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
v.push_back(std::to_string(e.max_expansion));
|
v.push_back(std::to_string(e.max_expansion));
|
||||||
@@ -476,6 +483,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.buffer));
|
v.push_back(std::to_string(e.buffer));
|
||||||
v.push_back(std::to_string(e.client_version_mask));
|
v.push_back(std::to_string(e.client_version_mask));
|
||||||
v.push_back(std::to_string(e.is_ldon_door));
|
v.push_back(std::to_string(e.is_ldon_door));
|
||||||
|
v.push_back(std::to_string(e.close_timer_ms));
|
||||||
v.push_back(std::to_string(e.dz_switch_id));
|
v.push_back(std::to_string(e.dz_switch_id));
|
||||||
v.push_back(std::to_string(e.min_expansion));
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
v.push_back(std::to_string(e.max_expansion));
|
v.push_back(std::to_string(e.max_expansion));
|
||||||
@@ -545,11 +553,12 @@ public:
|
|||||||
e.buffer = row[28] ? strtof(row[28], nullptr) : 0;
|
e.buffer = row[28] ? strtof(row[28], nullptr) : 0;
|
||||||
e.client_version_mask = row[29] ? static_cast<uint32_t>(strtoul(row[29], nullptr, 10)) : 4294967295;
|
e.client_version_mask = row[29] ? static_cast<uint32_t>(strtoul(row[29], nullptr, 10)) : 4294967295;
|
||||||
e.is_ldon_door = row[30] ? static_cast<int16_t>(atoi(row[30])) : 0;
|
e.is_ldon_door = row[30] ? static_cast<int16_t>(atoi(row[30])) : 0;
|
||||||
e.dz_switch_id = row[31] ? static_cast<int32_t>(atoi(row[31])) : 0;
|
e.close_timer_ms = row[31] ? static_cast<int16_t>(atoi(row[31])) : 5000;
|
||||||
e.min_expansion = row[32] ? static_cast<int8_t>(atoi(row[32])) : -1;
|
e.dz_switch_id = row[32] ? static_cast<int32_t>(atoi(row[32])) : 0;
|
||||||
e.max_expansion = row[33] ? static_cast<int8_t>(atoi(row[33])) : -1;
|
e.min_expansion = row[33] ? static_cast<int8_t>(atoi(row[33])) : -1;
|
||||||
e.content_flags = row[34] ? row[34] : "";
|
e.max_expansion = row[34] ? static_cast<int8_t>(atoi(row[34])) : -1;
|
||||||
e.content_flags_disabled = row[35] ? row[35] : "";
|
e.content_flags = row[35] ? row[35] : "";
|
||||||
|
e.content_flags_disabled = row[36] ? row[36] : "";
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -605,11 +614,12 @@ public:
|
|||||||
e.buffer = row[28] ? strtof(row[28], nullptr) : 0;
|
e.buffer = row[28] ? strtof(row[28], nullptr) : 0;
|
||||||
e.client_version_mask = row[29] ? static_cast<uint32_t>(strtoul(row[29], nullptr, 10)) : 4294967295;
|
e.client_version_mask = row[29] ? static_cast<uint32_t>(strtoul(row[29], nullptr, 10)) : 4294967295;
|
||||||
e.is_ldon_door = row[30] ? static_cast<int16_t>(atoi(row[30])) : 0;
|
e.is_ldon_door = row[30] ? static_cast<int16_t>(atoi(row[30])) : 0;
|
||||||
e.dz_switch_id = row[31] ? static_cast<int32_t>(atoi(row[31])) : 0;
|
e.close_timer_ms = row[31] ? static_cast<int16_t>(atoi(row[31])) : 5000;
|
||||||
e.min_expansion = row[32] ? static_cast<int8_t>(atoi(row[32])) : -1;
|
e.dz_switch_id = row[32] ? static_cast<int32_t>(atoi(row[32])) : 0;
|
||||||
e.max_expansion = row[33] ? static_cast<int8_t>(atoi(row[33])) : -1;
|
e.min_expansion = row[33] ? static_cast<int8_t>(atoi(row[33])) : -1;
|
||||||
e.content_flags = row[34] ? row[34] : "";
|
e.max_expansion = row[34] ? static_cast<int8_t>(atoi(row[34])) : -1;
|
||||||
e.content_flags_disabled = row[35] ? row[35] : "";
|
e.content_flags = row[35] ? row[35] : "";
|
||||||
|
e.content_flags_disabled = row[36] ? row[36] : "";
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -715,6 +725,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.buffer));
|
v.push_back(std::to_string(e.buffer));
|
||||||
v.push_back(std::to_string(e.client_version_mask));
|
v.push_back(std::to_string(e.client_version_mask));
|
||||||
v.push_back(std::to_string(e.is_ldon_door));
|
v.push_back(std::to_string(e.is_ldon_door));
|
||||||
|
v.push_back(std::to_string(e.close_timer_ms));
|
||||||
v.push_back(std::to_string(e.dz_switch_id));
|
v.push_back(std::to_string(e.dz_switch_id));
|
||||||
v.push_back(std::to_string(e.min_expansion));
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
v.push_back(std::to_string(e.max_expansion));
|
v.push_back(std::to_string(e.max_expansion));
|
||||||
@@ -773,6 +784,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.buffer));
|
v.push_back(std::to_string(e.buffer));
|
||||||
v.push_back(std::to_string(e.client_version_mask));
|
v.push_back(std::to_string(e.client_version_mask));
|
||||||
v.push_back(std::to_string(e.is_ldon_door));
|
v.push_back(std::to_string(e.is_ldon_door));
|
||||||
|
v.push_back(std::to_string(e.close_timer_ms));
|
||||||
v.push_back(std::to_string(e.dz_switch_id));
|
v.push_back(std::to_string(e.dz_switch_id));
|
||||||
v.push_back(std::to_string(e.min_expansion));
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
v.push_back(std::to_string(e.max_expansion));
|
v.push_back(std::to_string(e.max_expansion));
|
||||||
|
|||||||
@@ -19,34 +19,37 @@
|
|||||||
class BaseGroupIdRepository {
|
class BaseGroupIdRepository {
|
||||||
public:
|
public:
|
||||||
struct GroupId {
|
struct GroupId {
|
||||||
int32_t groupid;
|
uint32_t group_id;
|
||||||
int32_t charid;
|
|
||||||
std::string name;
|
std::string name;
|
||||||
int8_t ismerc;
|
uint32_t character_id;
|
||||||
|
uint32_t bot_id;
|
||||||
|
uint32_t merc_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::string PrimaryKey()
|
static std::string PrimaryKey()
|
||||||
{
|
{
|
||||||
return std::string("groupid");
|
return std::string("group_id");
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::vector<std::string> Columns()
|
static std::vector<std::string> Columns()
|
||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
"groupid",
|
"group_id",
|
||||||
"charid",
|
|
||||||
"name",
|
"name",
|
||||||
"ismerc",
|
"character_id",
|
||||||
|
"bot_id",
|
||||||
|
"merc_id",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::vector<std::string> SelectColumns()
|
static std::vector<std::string> SelectColumns()
|
||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
"groupid",
|
"group_id",
|
||||||
"charid",
|
|
||||||
"name",
|
"name",
|
||||||
"ismerc",
|
"character_id",
|
||||||
|
"bot_id",
|
||||||
|
"merc_id",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,10 +90,11 @@ public:
|
|||||||
{
|
{
|
||||||
GroupId e{};
|
GroupId e{};
|
||||||
|
|
||||||
e.groupid = 0;
|
e.group_id = 0;
|
||||||
e.charid = 0;
|
|
||||||
e.name = "";
|
e.name = "";
|
||||||
e.ismerc = 0;
|
e.character_id = 0;
|
||||||
|
e.bot_id = 0;
|
||||||
|
e.merc_id = 0;
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -101,7 +105,7 @@ public:
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
for (auto &group_id : group_ids) {
|
for (auto &group_id : group_ids) {
|
||||||
if (group_id.groupid == group_id_id) {
|
if (group_id.group_id == group_id_id) {
|
||||||
return group_id;
|
return group_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -127,10 +131,11 @@ public:
|
|||||||
if (results.RowCount() == 1) {
|
if (results.RowCount() == 1) {
|
||||||
GroupId e{};
|
GroupId e{};
|
||||||
|
|
||||||
e.groupid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
e.group_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||||
e.charid = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
|
e.name = row[1] ? row[1] : "";
|
||||||
e.name = row[2] ? row[2] : "";
|
e.character_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
e.ismerc = row[3] ? static_cast<int8_t>(atoi(row[3])) : 0;
|
e.bot_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
|
e.merc_id = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -164,10 +169,11 @@ public:
|
|||||||
|
|
||||||
auto columns = Columns();
|
auto columns = Columns();
|
||||||
|
|
||||||
v.push_back(columns[0] + " = " + std::to_string(e.groupid));
|
v.push_back(columns[0] + " = " + std::to_string(e.group_id));
|
||||||
v.push_back(columns[1] + " = " + std::to_string(e.charid));
|
v.push_back(columns[1] + " = '" + Strings::Escape(e.name) + "'");
|
||||||
v.push_back(columns[2] + " = '" + Strings::Escape(e.name) + "'");
|
v.push_back(columns[2] + " = " + std::to_string(e.character_id));
|
||||||
v.push_back(columns[3] + " = " + std::to_string(e.ismerc));
|
v.push_back(columns[3] + " = " + std::to_string(e.bot_id));
|
||||||
|
v.push_back(columns[4] + " = " + std::to_string(e.merc_id));
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -175,7 +181,7 @@ public:
|
|||||||
TableName(),
|
TableName(),
|
||||||
Strings::Implode(", ", v),
|
Strings::Implode(", ", v),
|
||||||
PrimaryKey(),
|
PrimaryKey(),
|
||||||
e.groupid
|
e.group_id
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -189,10 +195,11 @@ public:
|
|||||||
{
|
{
|
||||||
std::vector<std::string> v;
|
std::vector<std::string> v;
|
||||||
|
|
||||||
v.push_back(std::to_string(e.groupid));
|
v.push_back(std::to_string(e.group_id));
|
||||||
v.push_back(std::to_string(e.charid));
|
|
||||||
v.push_back("'" + Strings::Escape(e.name) + "'");
|
v.push_back("'" + Strings::Escape(e.name) + "'");
|
||||||
v.push_back(std::to_string(e.ismerc));
|
v.push_back(std::to_string(e.character_id));
|
||||||
|
v.push_back(std::to_string(e.bot_id));
|
||||||
|
v.push_back(std::to_string(e.merc_id));
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -203,7 +210,7 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (results.Success()) {
|
if (results.Success()) {
|
||||||
e.groupid = results.LastInsertedID();
|
e.group_id = results.LastInsertedID();
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,10 +229,11 @@ public:
|
|||||||
for (auto &e: entries) {
|
for (auto &e: entries) {
|
||||||
std::vector<std::string> v;
|
std::vector<std::string> v;
|
||||||
|
|
||||||
v.push_back(std::to_string(e.groupid));
|
v.push_back(std::to_string(e.group_id));
|
||||||
v.push_back(std::to_string(e.charid));
|
|
||||||
v.push_back("'" + Strings::Escape(e.name) + "'");
|
v.push_back("'" + Strings::Escape(e.name) + "'");
|
||||||
v.push_back(std::to_string(e.ismerc));
|
v.push_back(std::to_string(e.character_id));
|
||||||
|
v.push_back(std::to_string(e.bot_id));
|
||||||
|
v.push_back(std::to_string(e.merc_id));
|
||||||
|
|
||||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
}
|
}
|
||||||
@@ -259,10 +267,11 @@ public:
|
|||||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
GroupId e{};
|
GroupId e{};
|
||||||
|
|
||||||
e.groupid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
e.group_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||||
e.charid = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
|
e.name = row[1] ? row[1] : "";
|
||||||
e.name = row[2] ? row[2] : "";
|
e.character_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
e.ismerc = row[3] ? static_cast<int8_t>(atoi(row[3])) : 0;
|
e.bot_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
|
e.merc_id = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -287,10 +296,11 @@ public:
|
|||||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
GroupId e{};
|
GroupId e{};
|
||||||
|
|
||||||
e.groupid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
e.group_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||||
e.charid = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
|
e.name = row[1] ? row[1] : "";
|
||||||
e.name = row[2] ? row[2] : "";
|
e.character_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
e.ismerc = row[3] ? static_cast<int8_t>(atoi(row[3])) : 0;
|
e.bot_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
|
e.merc_id = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -365,10 +375,11 @@ public:
|
|||||||
{
|
{
|
||||||
std::vector<std::string> v;
|
std::vector<std::string> v;
|
||||||
|
|
||||||
v.push_back(std::to_string(e.groupid));
|
v.push_back(std::to_string(e.group_id));
|
||||||
v.push_back(std::to_string(e.charid));
|
|
||||||
v.push_back("'" + Strings::Escape(e.name) + "'");
|
v.push_back("'" + Strings::Escape(e.name) + "'");
|
||||||
v.push_back(std::to_string(e.ismerc));
|
v.push_back(std::to_string(e.character_id));
|
||||||
|
v.push_back(std::to_string(e.bot_id));
|
||||||
|
v.push_back(std::to_string(e.merc_id));
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -391,10 +402,11 @@ public:
|
|||||||
for (auto &e: entries) {
|
for (auto &e: entries) {
|
||||||
std::vector<std::string> v;
|
std::vector<std::string> v;
|
||||||
|
|
||||||
v.push_back(std::to_string(e.groupid));
|
v.push_back(std::to_string(e.group_id));
|
||||||
v.push_back(std::to_string(e.charid));
|
|
||||||
v.push_back("'" + Strings::Escape(e.name) + "'");
|
v.push_back("'" + Strings::Escape(e.name) + "'");
|
||||||
v.push_back(std::to_string(e.ismerc));
|
v.push_back(std::to_string(e.character_id));
|
||||||
|
v.push_back(std::to_string(e.bot_id));
|
||||||
|
v.push_back(std::to_string(e.merc_id));
|
||||||
|
|
||||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ public:
|
|||||||
e.gid = 0;
|
e.gid = 0;
|
||||||
e.leadername = "";
|
e.leadername = "";
|
||||||
e.marknpc = "";
|
e.marknpc = "";
|
||||||
e.leadershipaa = 0;
|
e.leadershipaa = "";
|
||||||
e.maintank = "";
|
e.maintank = "";
|
||||||
e.assist = "";
|
e.assist = "";
|
||||||
e.puller = "";
|
e.puller = "";
|
||||||
@@ -150,7 +150,7 @@ public:
|
|||||||
e.gid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
e.gid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
||||||
e.leadername = row[1] ? row[1] : "";
|
e.leadername = row[1] ? row[1] : "";
|
||||||
e.marknpc = row[2] ? row[2] : "";
|
e.marknpc = row[2] ? row[2] : "";
|
||||||
e.leadershipaa = row[3] ? row[3] : 0;
|
e.leadershipaa = row[3] ? row[3] : "";
|
||||||
e.maintank = row[4] ? row[4] : "";
|
e.maintank = row[4] ? row[4] : "";
|
||||||
e.assist = row[5] ? row[5] : "";
|
e.assist = row[5] ? row[5] : "";
|
||||||
e.puller = row[6] ? row[6] : "";
|
e.puller = row[6] ? row[6] : "";
|
||||||
@@ -192,7 +192,7 @@ public:
|
|||||||
v.push_back(columns[0] + " = " + std::to_string(e.gid));
|
v.push_back(columns[0] + " = " + std::to_string(e.gid));
|
||||||
v.push_back(columns[1] + " = '" + Strings::Escape(e.leadername) + "'");
|
v.push_back(columns[1] + " = '" + Strings::Escape(e.leadername) + "'");
|
||||||
v.push_back(columns[2] + " = '" + Strings::Escape(e.marknpc) + "'");
|
v.push_back(columns[2] + " = '" + Strings::Escape(e.marknpc) + "'");
|
||||||
v.push_back(columns[3] + " = '" + Strings::Escape(e.leadershipaa) + "'");
|
v.push_back(columns[3] + " = '" + e.leadershipaa + "'");
|
||||||
v.push_back(columns[4] + " = '" + Strings::Escape(e.maintank) + "'");
|
v.push_back(columns[4] + " = '" + Strings::Escape(e.maintank) + "'");
|
||||||
v.push_back(columns[5] + " = '" + Strings::Escape(e.assist) + "'");
|
v.push_back(columns[5] + " = '" + Strings::Escape(e.assist) + "'");
|
||||||
v.push_back(columns[6] + " = '" + Strings::Escape(e.puller) + "'");
|
v.push_back(columns[6] + " = '" + Strings::Escape(e.puller) + "'");
|
||||||
@@ -222,7 +222,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.gid));
|
v.push_back(std::to_string(e.gid));
|
||||||
v.push_back("'" + Strings::Escape(e.leadername) + "'");
|
v.push_back("'" + Strings::Escape(e.leadername) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.marknpc) + "'");
|
v.push_back("'" + Strings::Escape(e.marknpc) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.leadershipaa) + "'");
|
v.push_back("'" + e.leadershipaa + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.maintank) + "'");
|
v.push_back("'" + Strings::Escape(e.maintank) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.assist) + "'");
|
v.push_back("'" + Strings::Escape(e.assist) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.puller) + "'");
|
v.push_back("'" + Strings::Escape(e.puller) + "'");
|
||||||
@@ -260,7 +260,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.gid));
|
v.push_back(std::to_string(e.gid));
|
||||||
v.push_back("'" + Strings::Escape(e.leadername) + "'");
|
v.push_back("'" + Strings::Escape(e.leadername) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.marknpc) + "'");
|
v.push_back("'" + Strings::Escape(e.marknpc) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.leadershipaa) + "'");
|
v.push_back("'" + e.leadershipaa + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.maintank) + "'");
|
v.push_back("'" + Strings::Escape(e.maintank) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.assist) + "'");
|
v.push_back("'" + Strings::Escape(e.assist) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.puller) + "'");
|
v.push_back("'" + Strings::Escape(e.puller) + "'");
|
||||||
@@ -302,7 +302,7 @@ public:
|
|||||||
e.gid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
e.gid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
||||||
e.leadername = row[1] ? row[1] : "";
|
e.leadername = row[1] ? row[1] : "";
|
||||||
e.marknpc = row[2] ? row[2] : "";
|
e.marknpc = row[2] ? row[2] : "";
|
||||||
e.leadershipaa = row[3] ? row[3] : 0;
|
e.leadershipaa = row[3] ? row[3] : "";
|
||||||
e.maintank = row[4] ? row[4] : "";
|
e.maintank = row[4] ? row[4] : "";
|
||||||
e.assist = row[5] ? row[5] : "";
|
e.assist = row[5] ? row[5] : "";
|
||||||
e.puller = row[6] ? row[6] : "";
|
e.puller = row[6] ? row[6] : "";
|
||||||
@@ -335,7 +335,7 @@ public:
|
|||||||
e.gid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
e.gid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
||||||
e.leadername = row[1] ? row[1] : "";
|
e.leadername = row[1] ? row[1] : "";
|
||||||
e.marknpc = row[2] ? row[2] : "";
|
e.marknpc = row[2] ? row[2] : "";
|
||||||
e.leadershipaa = row[3] ? row[3] : 0;
|
e.leadershipaa = row[3] ? row[3] : "";
|
||||||
e.maintank = row[4] ? row[4] : "";
|
e.maintank = row[4] ? row[4] : "";
|
||||||
e.assist = row[5] ? row[5] : "";
|
e.assist = row[5] ? row[5] : "";
|
||||||
e.puller = row[6] ? row[6] : "";
|
e.puller = row[6] ? row[6] : "";
|
||||||
@@ -418,7 +418,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.gid));
|
v.push_back(std::to_string(e.gid));
|
||||||
v.push_back("'" + Strings::Escape(e.leadername) + "'");
|
v.push_back("'" + Strings::Escape(e.leadername) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.marknpc) + "'");
|
v.push_back("'" + Strings::Escape(e.marknpc) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.leadershipaa) + "'");
|
v.push_back("'" + e.leadershipaa + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.maintank) + "'");
|
v.push_back("'" + Strings::Escape(e.maintank) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.assist) + "'");
|
v.push_back("'" + Strings::Escape(e.assist) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.puller) + "'");
|
v.push_back("'" + Strings::Escape(e.puller) + "'");
|
||||||
@@ -449,7 +449,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.gid));
|
v.push_back(std::to_string(e.gid));
|
||||||
v.push_back("'" + Strings::Escape(e.leadername) + "'");
|
v.push_back("'" + Strings::Escape(e.leadername) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.marknpc) + "'");
|
v.push_back("'" + Strings::Escape(e.marknpc) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.leadershipaa) + "'");
|
v.push_back("'" + e.leadershipaa + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.maintank) + "'");
|
v.push_back("'" + Strings::Escape(e.maintank) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.assist) + "'");
|
v.push_back("'" + Strings::Escape(e.assist) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.puller) + "'");
|
v.push_back("'" + Strings::Escape(e.puller) + "'");
|
||||||
|
|||||||
@@ -30,6 +30,10 @@ public:
|
|||||||
uint8_t multiplier;
|
uint8_t multiplier;
|
||||||
uint16_t npc_min_level;
|
uint16_t npc_min_level;
|
||||||
uint16_t npc_max_level;
|
uint16_t npc_max_level;
|
||||||
|
int8_t min_expansion;
|
||||||
|
int8_t max_expansion;
|
||||||
|
std::string content_flags;
|
||||||
|
std::string content_flags_disabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::string PrimaryKey()
|
static std::string PrimaryKey()
|
||||||
@@ -51,6 +55,10 @@ public:
|
|||||||
"multiplier",
|
"multiplier",
|
||||||
"npc_min_level",
|
"npc_min_level",
|
||||||
"npc_max_level",
|
"npc_max_level",
|
||||||
|
"min_expansion",
|
||||||
|
"max_expansion",
|
||||||
|
"content_flags",
|
||||||
|
"content_flags_disabled",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,6 +76,10 @@ public:
|
|||||||
"multiplier",
|
"multiplier",
|
||||||
"npc_min_level",
|
"npc_min_level",
|
||||||
"npc_max_level",
|
"npc_max_level",
|
||||||
|
"min_expansion",
|
||||||
|
"max_expansion",
|
||||||
|
"content_flags",
|
||||||
|
"content_flags_disabled",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,6 +131,10 @@ public:
|
|||||||
e.multiplier = 1;
|
e.multiplier = 1;
|
||||||
e.npc_min_level = 0;
|
e.npc_min_level = 0;
|
||||||
e.npc_max_level = 0;
|
e.npc_max_level = 0;
|
||||||
|
e.min_expansion = -1;
|
||||||
|
e.max_expansion = -1;
|
||||||
|
e.content_flags = "";
|
||||||
|
e.content_flags_disabled = "";
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -166,6 +182,10 @@ public:
|
|||||||
e.multiplier = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 1;
|
e.multiplier = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 1;
|
||||||
e.npc_min_level = row[9] ? static_cast<uint16_t>(strtoul(row[9], nullptr, 10)) : 0;
|
e.npc_min_level = row[9] ? static_cast<uint16_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||||
e.npc_max_level = row[10] ? static_cast<uint16_t>(strtoul(row[10], nullptr, 10)) : 0;
|
e.npc_max_level = row[10] ? static_cast<uint16_t>(strtoul(row[10], nullptr, 10)) : 0;
|
||||||
|
e.min_expansion = row[11] ? static_cast<int8_t>(atoi(row[11])) : -1;
|
||||||
|
e.max_expansion = row[12] ? static_cast<int8_t>(atoi(row[12])) : -1;
|
||||||
|
e.content_flags = row[13] ? row[13] : "";
|
||||||
|
e.content_flags_disabled = row[14] ? row[14] : "";
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -210,6 +230,10 @@ public:
|
|||||||
v.push_back(columns[8] + " = " + std::to_string(e.multiplier));
|
v.push_back(columns[8] + " = " + std::to_string(e.multiplier));
|
||||||
v.push_back(columns[9] + " = " + std::to_string(e.npc_min_level));
|
v.push_back(columns[9] + " = " + std::to_string(e.npc_min_level));
|
||||||
v.push_back(columns[10] + " = " + std::to_string(e.npc_max_level));
|
v.push_back(columns[10] + " = " + std::to_string(e.npc_max_level));
|
||||||
|
v.push_back(columns[11] + " = " + std::to_string(e.min_expansion));
|
||||||
|
v.push_back(columns[12] + " = " + std::to_string(e.max_expansion));
|
||||||
|
v.push_back(columns[13] + " = '" + Strings::Escape(e.content_flags) + "'");
|
||||||
|
v.push_back(columns[14] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -242,6 +266,10 @@ public:
|
|||||||
v.push_back(std::to_string(e.multiplier));
|
v.push_back(std::to_string(e.multiplier));
|
||||||
v.push_back(std::to_string(e.npc_min_level));
|
v.push_back(std::to_string(e.npc_min_level));
|
||||||
v.push_back(std::to_string(e.npc_max_level));
|
v.push_back(std::to_string(e.npc_max_level));
|
||||||
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
|
v.push_back(std::to_string(e.max_expansion));
|
||||||
|
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
|
||||||
|
v.push_back("'" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -282,6 +310,10 @@ public:
|
|||||||
v.push_back(std::to_string(e.multiplier));
|
v.push_back(std::to_string(e.multiplier));
|
||||||
v.push_back(std::to_string(e.npc_min_level));
|
v.push_back(std::to_string(e.npc_min_level));
|
||||||
v.push_back(std::to_string(e.npc_max_level));
|
v.push_back(std::to_string(e.npc_max_level));
|
||||||
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
|
v.push_back(std::to_string(e.max_expansion));
|
||||||
|
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
|
||||||
|
v.push_back("'" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||||
|
|
||||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
}
|
}
|
||||||
@@ -326,6 +358,10 @@ public:
|
|||||||
e.multiplier = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 1;
|
e.multiplier = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 1;
|
||||||
e.npc_min_level = row[9] ? static_cast<uint16_t>(strtoul(row[9], nullptr, 10)) : 0;
|
e.npc_min_level = row[9] ? static_cast<uint16_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||||
e.npc_max_level = row[10] ? static_cast<uint16_t>(strtoul(row[10], nullptr, 10)) : 0;
|
e.npc_max_level = row[10] ? static_cast<uint16_t>(strtoul(row[10], nullptr, 10)) : 0;
|
||||||
|
e.min_expansion = row[11] ? static_cast<int8_t>(atoi(row[11])) : -1;
|
||||||
|
e.max_expansion = row[12] ? static_cast<int8_t>(atoi(row[12])) : -1;
|
||||||
|
e.content_flags = row[13] ? row[13] : "";
|
||||||
|
e.content_flags_disabled = row[14] ? row[14] : "";
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -361,6 +397,10 @@ public:
|
|||||||
e.multiplier = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 1;
|
e.multiplier = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 1;
|
||||||
e.npc_min_level = row[9] ? static_cast<uint16_t>(strtoul(row[9], nullptr, 10)) : 0;
|
e.npc_min_level = row[9] ? static_cast<uint16_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||||
e.npc_max_level = row[10] ? static_cast<uint16_t>(strtoul(row[10], nullptr, 10)) : 0;
|
e.npc_max_level = row[10] ? static_cast<uint16_t>(strtoul(row[10], nullptr, 10)) : 0;
|
||||||
|
e.min_expansion = row[11] ? static_cast<int8_t>(atoi(row[11])) : -1;
|
||||||
|
e.max_expansion = row[12] ? static_cast<int8_t>(atoi(row[12])) : -1;
|
||||||
|
e.content_flags = row[13] ? row[13] : "";
|
||||||
|
e.content_flags_disabled = row[14] ? row[14] : "";
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -446,6 +486,10 @@ public:
|
|||||||
v.push_back(std::to_string(e.multiplier));
|
v.push_back(std::to_string(e.multiplier));
|
||||||
v.push_back(std::to_string(e.npc_min_level));
|
v.push_back(std::to_string(e.npc_min_level));
|
||||||
v.push_back(std::to_string(e.npc_max_level));
|
v.push_back(std::to_string(e.npc_max_level));
|
||||||
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
|
v.push_back(std::to_string(e.max_expansion));
|
||||||
|
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
|
||||||
|
v.push_back("'" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -479,6 +523,10 @@ public:
|
|||||||
v.push_back(std::to_string(e.multiplier));
|
v.push_back(std::to_string(e.multiplier));
|
||||||
v.push_back(std::to_string(e.npc_min_level));
|
v.push_back(std::to_string(e.npc_min_level));
|
||||||
v.push_back(std::to_string(e.npc_max_level));
|
v.push_back(std::to_string(e.npc_max_level));
|
||||||
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
|
v.push_back(std::to_string(e.max_expansion));
|
||||||
|
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
|
||||||
|
v.push_back("'" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||||
|
|
||||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,10 @@ public:
|
|||||||
int32_t resist_adjust;
|
int32_t resist_adjust;
|
||||||
int16_t min_hp;
|
int16_t min_hp;
|
||||||
int16_t max_hp;
|
int16_t max_hp;
|
||||||
|
int8_t min_expansion;
|
||||||
|
int8_t max_expansion;
|
||||||
|
std::string content_flags;
|
||||||
|
std::string content_flags_disabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::string PrimaryKey()
|
static std::string PrimaryKey()
|
||||||
@@ -53,6 +57,10 @@ public:
|
|||||||
"resist_adjust",
|
"resist_adjust",
|
||||||
"min_hp",
|
"min_hp",
|
||||||
"max_hp",
|
"max_hp",
|
||||||
|
"min_expansion",
|
||||||
|
"max_expansion",
|
||||||
|
"content_flags",
|
||||||
|
"content_flags_disabled",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,6 +79,10 @@ public:
|
|||||||
"resist_adjust",
|
"resist_adjust",
|
||||||
"min_hp",
|
"min_hp",
|
||||||
"max_hp",
|
"max_hp",
|
||||||
|
"min_expansion",
|
||||||
|
"max_expansion",
|
||||||
|
"content_flags",
|
||||||
|
"content_flags_disabled",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,6 +135,10 @@ public:
|
|||||||
e.resist_adjust = 0;
|
e.resist_adjust = 0;
|
||||||
e.min_hp = 0;
|
e.min_hp = 0;
|
||||||
e.max_hp = 0;
|
e.max_hp = 0;
|
||||||
|
e.min_expansion = -1;
|
||||||
|
e.max_expansion = -1;
|
||||||
|
e.content_flags = "";
|
||||||
|
e.content_flags_disabled = "";
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -171,6 +187,10 @@ public:
|
|||||||
e.resist_adjust = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
|
e.resist_adjust = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
|
||||||
e.min_hp = row[10] ? static_cast<int16_t>(atoi(row[10])) : 0;
|
e.min_hp = row[10] ? static_cast<int16_t>(atoi(row[10])) : 0;
|
||||||
e.max_hp = row[11] ? static_cast<int16_t>(atoi(row[11])) : 0;
|
e.max_hp = row[11] ? static_cast<int16_t>(atoi(row[11])) : 0;
|
||||||
|
e.min_expansion = row[12] ? static_cast<int8_t>(atoi(row[12])) : -1;
|
||||||
|
e.max_expansion = row[13] ? static_cast<int8_t>(atoi(row[13])) : -1;
|
||||||
|
e.content_flags = row[14] ? row[14] : "";
|
||||||
|
e.content_flags_disabled = row[15] ? row[15] : "";
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -215,6 +235,10 @@ public:
|
|||||||
v.push_back(columns[9] + " = " + std::to_string(e.resist_adjust));
|
v.push_back(columns[9] + " = " + std::to_string(e.resist_adjust));
|
||||||
v.push_back(columns[10] + " = " + std::to_string(e.min_hp));
|
v.push_back(columns[10] + " = " + std::to_string(e.min_hp));
|
||||||
v.push_back(columns[11] + " = " + std::to_string(e.max_hp));
|
v.push_back(columns[11] + " = " + std::to_string(e.max_hp));
|
||||||
|
v.push_back(columns[12] + " = " + std::to_string(e.min_expansion));
|
||||||
|
v.push_back(columns[13] + " = " + std::to_string(e.max_expansion));
|
||||||
|
v.push_back(columns[14] + " = '" + Strings::Escape(e.content_flags) + "'");
|
||||||
|
v.push_back(columns[15] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -248,6 +272,10 @@ public:
|
|||||||
v.push_back(std::to_string(e.resist_adjust));
|
v.push_back(std::to_string(e.resist_adjust));
|
||||||
v.push_back(std::to_string(e.min_hp));
|
v.push_back(std::to_string(e.min_hp));
|
||||||
v.push_back(std::to_string(e.max_hp));
|
v.push_back(std::to_string(e.max_hp));
|
||||||
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
|
v.push_back(std::to_string(e.max_expansion));
|
||||||
|
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
|
||||||
|
v.push_back("'" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -289,6 +317,10 @@ public:
|
|||||||
v.push_back(std::to_string(e.resist_adjust));
|
v.push_back(std::to_string(e.resist_adjust));
|
||||||
v.push_back(std::to_string(e.min_hp));
|
v.push_back(std::to_string(e.min_hp));
|
||||||
v.push_back(std::to_string(e.max_hp));
|
v.push_back(std::to_string(e.max_hp));
|
||||||
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
|
v.push_back(std::to_string(e.max_expansion));
|
||||||
|
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
|
||||||
|
v.push_back("'" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||||
|
|
||||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
}
|
}
|
||||||
@@ -334,6 +366,10 @@ public:
|
|||||||
e.resist_adjust = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
|
e.resist_adjust = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
|
||||||
e.min_hp = row[10] ? static_cast<int16_t>(atoi(row[10])) : 0;
|
e.min_hp = row[10] ? static_cast<int16_t>(atoi(row[10])) : 0;
|
||||||
e.max_hp = row[11] ? static_cast<int16_t>(atoi(row[11])) : 0;
|
e.max_hp = row[11] ? static_cast<int16_t>(atoi(row[11])) : 0;
|
||||||
|
e.min_expansion = row[12] ? static_cast<int8_t>(atoi(row[12])) : -1;
|
||||||
|
e.max_expansion = row[13] ? static_cast<int8_t>(atoi(row[13])) : -1;
|
||||||
|
e.content_flags = row[14] ? row[14] : "";
|
||||||
|
e.content_flags_disabled = row[15] ? row[15] : "";
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -370,6 +406,10 @@ public:
|
|||||||
e.resist_adjust = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
|
e.resist_adjust = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
|
||||||
e.min_hp = row[10] ? static_cast<int16_t>(atoi(row[10])) : 0;
|
e.min_hp = row[10] ? static_cast<int16_t>(atoi(row[10])) : 0;
|
||||||
e.max_hp = row[11] ? static_cast<int16_t>(atoi(row[11])) : 0;
|
e.max_hp = row[11] ? static_cast<int16_t>(atoi(row[11])) : 0;
|
||||||
|
e.min_expansion = row[12] ? static_cast<int8_t>(atoi(row[12])) : -1;
|
||||||
|
e.max_expansion = row[13] ? static_cast<int8_t>(atoi(row[13])) : -1;
|
||||||
|
e.content_flags = row[14] ? row[14] : "";
|
||||||
|
e.content_flags_disabled = row[15] ? row[15] : "";
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -456,6 +496,10 @@ public:
|
|||||||
v.push_back(std::to_string(e.resist_adjust));
|
v.push_back(std::to_string(e.resist_adjust));
|
||||||
v.push_back(std::to_string(e.min_hp));
|
v.push_back(std::to_string(e.min_hp));
|
||||||
v.push_back(std::to_string(e.max_hp));
|
v.push_back(std::to_string(e.max_hp));
|
||||||
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
|
v.push_back(std::to_string(e.max_expansion));
|
||||||
|
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
|
||||||
|
v.push_back("'" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -490,6 +534,10 @@ public:
|
|||||||
v.push_back(std::to_string(e.resist_adjust));
|
v.push_back(std::to_string(e.resist_adjust));
|
||||||
v.push_back(std::to_string(e.min_hp));
|
v.push_back(std::to_string(e.min_hp));
|
||||||
v.push_back(std::to_string(e.max_hp));
|
v.push_back(std::to_string(e.max_hp));
|
||||||
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
|
v.push_back(std::to_string(e.max_expansion));
|
||||||
|
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
|
||||||
|
v.push_back("'" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||||
|
|
||||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -19,8 +19,9 @@
|
|||||||
class BaseSkillCapsRepository {
|
class BaseSkillCapsRepository {
|
||||||
public:
|
public:
|
||||||
struct SkillCaps {
|
struct SkillCaps {
|
||||||
uint8_t skillID;
|
uint32_t id;
|
||||||
uint8_t class_;
|
uint8_t skill_id;
|
||||||
|
uint8_t class_id;
|
||||||
uint8_t level;
|
uint8_t level;
|
||||||
uint32_t cap;
|
uint32_t cap;
|
||||||
uint8_t class_;
|
uint8_t class_;
|
||||||
@@ -28,14 +29,15 @@ public:
|
|||||||
|
|
||||||
static std::string PrimaryKey()
|
static std::string PrimaryKey()
|
||||||
{
|
{
|
||||||
return std::string("skillID");
|
return std::string("id");
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::vector<std::string> Columns()
|
static std::vector<std::string> Columns()
|
||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
"skillID",
|
"id",
|
||||||
"`class`",
|
"skill_id",
|
||||||
|
"class_id",
|
||||||
"level",
|
"level",
|
||||||
"cap",
|
"cap",
|
||||||
"class_",
|
"class_",
|
||||||
@@ -45,8 +47,9 @@ public:
|
|||||||
static std::vector<std::string> SelectColumns()
|
static std::vector<std::string> SelectColumns()
|
||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
"skillID",
|
"id",
|
||||||
"`class`",
|
"skill_id",
|
||||||
|
"class_id",
|
||||||
"level",
|
"level",
|
||||||
"cap",
|
"cap",
|
||||||
"class_",
|
"class_",
|
||||||
@@ -90,8 +93,9 @@ public:
|
|||||||
{
|
{
|
||||||
SkillCaps e{};
|
SkillCaps e{};
|
||||||
|
|
||||||
e.skillID = 0;
|
e.id = 0;
|
||||||
e.class_ = 0;
|
e.skill_id = 0;
|
||||||
|
e.class_id = 0;
|
||||||
e.level = 0;
|
e.level = 0;
|
||||||
e.cap = 0;
|
e.cap = 0;
|
||||||
e.class_ = 0;
|
e.class_ = 0;
|
||||||
@@ -105,7 +109,7 @@ public:
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
for (auto &skill_caps : skill_capss) {
|
for (auto &skill_caps : skill_capss) {
|
||||||
if (skill_caps.skillID == skill_caps_id) {
|
if (skill_caps.id == skill_caps_id) {
|
||||||
return skill_caps;
|
return skill_caps;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -131,11 +135,12 @@ public:
|
|||||||
if (results.RowCount() == 1) {
|
if (results.RowCount() == 1) {
|
||||||
SkillCaps e{};
|
SkillCaps e{};
|
||||||
|
|
||||||
e.skillID = row[0] ? static_cast<uint8_t>(strtoul(row[0], nullptr, 10)) : 0;
|
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||||
e.class_ = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
|
e.skill_id = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||||
e.level = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
|
e.class_id = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
e.cap = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
e.level = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
e.class_ = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
|
e.cap = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
|
e.class_ = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -169,11 +174,11 @@ public:
|
|||||||
|
|
||||||
auto columns = Columns();
|
auto columns = Columns();
|
||||||
|
|
||||||
v.push_back(columns[0] + " = " + std::to_string(e.skillID));
|
v.push_back(columns[1] + " = " + std::to_string(e.skill_id));
|
||||||
v.push_back(columns[1] + " = " + std::to_string(e.class_));
|
v.push_back(columns[2] + " = " + std::to_string(e.class_id));
|
||||||
v.push_back(columns[2] + " = " + std::to_string(e.level));
|
v.push_back(columns[3] + " = " + std::to_string(e.level));
|
||||||
v.push_back(columns[3] + " = " + std::to_string(e.cap));
|
v.push_back(columns[4] + " = " + std::to_string(e.cap));
|
||||||
v.push_back(columns[4] + " = " + std::to_string(e.class_));
|
v.push_back(columns[5] + " = " + std::to_string(e.class_));
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -181,7 +186,7 @@ public:
|
|||||||
TableName(),
|
TableName(),
|
||||||
Strings::Implode(", ", v),
|
Strings::Implode(", ", v),
|
||||||
PrimaryKey(),
|
PrimaryKey(),
|
||||||
e.skillID
|
e.id
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -195,8 +200,9 @@ public:
|
|||||||
{
|
{
|
||||||
std::vector<std::string> v;
|
std::vector<std::string> v;
|
||||||
|
|
||||||
v.push_back(std::to_string(e.skillID));
|
v.push_back(std::to_string(e.id));
|
||||||
v.push_back(std::to_string(e.class_));
|
v.push_back(std::to_string(e.skill_id));
|
||||||
|
v.push_back(std::to_string(e.class_id));
|
||||||
v.push_back(std::to_string(e.level));
|
v.push_back(std::to_string(e.level));
|
||||||
v.push_back(std::to_string(e.cap));
|
v.push_back(std::to_string(e.cap));
|
||||||
v.push_back(std::to_string(e.class_));
|
v.push_back(std::to_string(e.class_));
|
||||||
@@ -210,7 +216,7 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (results.Success()) {
|
if (results.Success()) {
|
||||||
e.skillID = results.LastInsertedID();
|
e.id = results.LastInsertedID();
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,8 +235,9 @@ public:
|
|||||||
for (auto &e: entries) {
|
for (auto &e: entries) {
|
||||||
std::vector<std::string> v;
|
std::vector<std::string> v;
|
||||||
|
|
||||||
v.push_back(std::to_string(e.skillID));
|
v.push_back(std::to_string(e.id));
|
||||||
v.push_back(std::to_string(e.class_));
|
v.push_back(std::to_string(e.skill_id));
|
||||||
|
v.push_back(std::to_string(e.class_id));
|
||||||
v.push_back(std::to_string(e.level));
|
v.push_back(std::to_string(e.level));
|
||||||
v.push_back(std::to_string(e.cap));
|
v.push_back(std::to_string(e.cap));
|
||||||
v.push_back(std::to_string(e.class_));
|
v.push_back(std::to_string(e.class_));
|
||||||
@@ -267,11 +274,12 @@ public:
|
|||||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
SkillCaps e{};
|
SkillCaps e{};
|
||||||
|
|
||||||
e.skillID = row[0] ? static_cast<uint8_t>(strtoul(row[0], nullptr, 10)) : 0;
|
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||||
e.class_ = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
|
e.skill_id = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||||
e.level = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
|
e.class_id = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
e.cap = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
e.level = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
e.class_ = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
|
e.cap = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
|
e.class_ = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -296,11 +304,12 @@ public:
|
|||||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
SkillCaps e{};
|
SkillCaps e{};
|
||||||
|
|
||||||
e.skillID = row[0] ? static_cast<uint8_t>(strtoul(row[0], nullptr, 10)) : 0;
|
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||||
e.class_ = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
|
e.skill_id = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||||
e.level = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
|
e.class_id = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
e.cap = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
e.level = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
e.class_ = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
|
e.cap = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
|
e.class_ = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -375,8 +384,9 @@ public:
|
|||||||
{
|
{
|
||||||
std::vector<std::string> v;
|
std::vector<std::string> v;
|
||||||
|
|
||||||
v.push_back(std::to_string(e.skillID));
|
v.push_back(std::to_string(e.id));
|
||||||
v.push_back(std::to_string(e.class_));
|
v.push_back(std::to_string(e.skill_id));
|
||||||
|
v.push_back(std::to_string(e.class_id));
|
||||||
v.push_back(std::to_string(e.level));
|
v.push_back(std::to_string(e.level));
|
||||||
v.push_back(std::to_string(e.cap));
|
v.push_back(std::to_string(e.cap));
|
||||||
v.push_back(std::to_string(e.class_));
|
v.push_back(std::to_string(e.class_));
|
||||||
@@ -402,8 +412,9 @@ public:
|
|||||||
for (auto &e: entries) {
|
for (auto &e: entries) {
|
||||||
std::vector<std::string> v;
|
std::vector<std::string> v;
|
||||||
|
|
||||||
v.push_back(std::to_string(e.skillID));
|
v.push_back(std::to_string(e.id));
|
||||||
v.push_back(std::to_string(e.class_));
|
v.push_back(std::to_string(e.skill_id));
|
||||||
|
v.push_back(std::to_string(e.class_id));
|
||||||
v.push_back(std::to_string(e.level));
|
v.push_back(std::to_string(e.level));
|
||||||
v.push_back(std::to_string(e.cap));
|
v.push_back(std::to_string(e.cap));
|
||||||
v.push_back(std::to_string(e.class_));
|
v.push_back(std::to_string(e.class_));
|
||||||
|
|||||||
@@ -19,40 +19,70 @@
|
|||||||
class BaseTraderRepository {
|
class BaseTraderRepository {
|
||||||
public:
|
public:
|
||||||
struct Trader {
|
struct Trader {
|
||||||
|
uint64_t id;
|
||||||
uint32_t char_id;
|
uint32_t char_id;
|
||||||
uint32_t item_id;
|
uint32_t item_id;
|
||||||
uint32_t serialnumber;
|
uint32_t aug_slot_1;
|
||||||
int32_t charges;
|
uint32_t aug_slot_2;
|
||||||
uint32_t item_cost;
|
uint32_t aug_slot_3;
|
||||||
|
uint32_t aug_slot_4;
|
||||||
|
uint32_t aug_slot_5;
|
||||||
|
uint32_t aug_slot_6;
|
||||||
|
int32_t item_sn;
|
||||||
|
int32_t item_charges;
|
||||||
|
uint64_t item_cost;
|
||||||
uint8_t slot_id;
|
uint8_t slot_id;
|
||||||
|
uint32_t char_entity_id;
|
||||||
|
uint32_t char_zone_id;
|
||||||
|
int8_t active_transaction;
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::string PrimaryKey()
|
static std::string PrimaryKey()
|
||||||
{
|
{
|
||||||
return std::string("char_id");
|
return std::string("id");
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::vector<std::string> Columns()
|
static std::vector<std::string> Columns()
|
||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
|
"id",
|
||||||
"char_id",
|
"char_id",
|
||||||
"item_id",
|
"item_id",
|
||||||
"serialnumber",
|
"aug_slot_1",
|
||||||
"charges",
|
"aug_slot_2",
|
||||||
|
"aug_slot_3",
|
||||||
|
"aug_slot_4",
|
||||||
|
"aug_slot_5",
|
||||||
|
"aug_slot_6",
|
||||||
|
"item_sn",
|
||||||
|
"item_charges",
|
||||||
"item_cost",
|
"item_cost",
|
||||||
"slot_id",
|
"slot_id",
|
||||||
|
"char_entity_id",
|
||||||
|
"char_zone_id",
|
||||||
|
"active_transaction",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::vector<std::string> SelectColumns()
|
static std::vector<std::string> SelectColumns()
|
||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
|
"id",
|
||||||
"char_id",
|
"char_id",
|
||||||
"item_id",
|
"item_id",
|
||||||
"serialnumber",
|
"aug_slot_1",
|
||||||
"charges",
|
"aug_slot_2",
|
||||||
|
"aug_slot_3",
|
||||||
|
"aug_slot_4",
|
||||||
|
"aug_slot_5",
|
||||||
|
"aug_slot_6",
|
||||||
|
"item_sn",
|
||||||
|
"item_charges",
|
||||||
"item_cost",
|
"item_cost",
|
||||||
"slot_id",
|
"slot_id",
|
||||||
|
"char_entity_id",
|
||||||
|
"char_zone_id",
|
||||||
|
"active_transaction",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,12 +123,22 @@ public:
|
|||||||
{
|
{
|
||||||
Trader e{};
|
Trader e{};
|
||||||
|
|
||||||
|
e.id = 0;
|
||||||
e.char_id = 0;
|
e.char_id = 0;
|
||||||
e.item_id = 0;
|
e.item_id = 0;
|
||||||
e.serialnumber = 0;
|
e.aug_slot_1 = 0;
|
||||||
e.charges = 0;
|
e.aug_slot_2 = 0;
|
||||||
|
e.aug_slot_3 = 0;
|
||||||
|
e.aug_slot_4 = 0;
|
||||||
|
e.aug_slot_5 = 0;
|
||||||
|
e.aug_slot_6 = 0;
|
||||||
|
e.item_sn = 0;
|
||||||
|
e.item_charges = 0;
|
||||||
e.item_cost = 0;
|
e.item_cost = 0;
|
||||||
e.slot_id = 0;
|
e.slot_id = 0;
|
||||||
|
e.char_entity_id = 0;
|
||||||
|
e.char_zone_id = 0;
|
||||||
|
e.active_transaction = 0;
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -109,7 +149,7 @@ public:
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
for (auto &trader : traders) {
|
for (auto &trader : traders) {
|
||||||
if (trader.char_id == trader_id) {
|
if (trader.id == trader_id) {
|
||||||
return trader;
|
return trader;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -135,12 +175,22 @@ public:
|
|||||||
if (results.RowCount() == 1) {
|
if (results.RowCount() == 1) {
|
||||||
Trader e{};
|
Trader e{};
|
||||||
|
|
||||||
e.char_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
e.id = row[0] ? strtoull(row[0], nullptr, 10) : 0;
|
||||||
e.item_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
e.char_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||||
e.serialnumber = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
e.item_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
e.charges = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
|
e.aug_slot_1 = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
e.item_cost = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
e.aug_slot_2 = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
e.slot_id = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0;
|
e.aug_slot_3 = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_4 = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_5 = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_6 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||||
|
e.item_sn = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
|
||||||
|
e.item_charges = row[10] ? static_cast<int32_t>(atoi(row[10])) : 0;
|
||||||
|
e.item_cost = row[11] ? strtoull(row[11], nullptr, 10) : 0;
|
||||||
|
e.slot_id = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
|
||||||
|
e.char_entity_id = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
|
||||||
|
e.char_zone_id = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
|
||||||
|
e.active_transaction = row[15] ? static_cast<int8_t>(atoi(row[15])) : 0;
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -174,12 +224,21 @@ public:
|
|||||||
|
|
||||||
auto columns = Columns();
|
auto columns = Columns();
|
||||||
|
|
||||||
v.push_back(columns[0] + " = " + std::to_string(e.char_id));
|
v.push_back(columns[1] + " = " + std::to_string(e.char_id));
|
||||||
v.push_back(columns[1] + " = " + std::to_string(e.item_id));
|
v.push_back(columns[2] + " = " + std::to_string(e.item_id));
|
||||||
v.push_back(columns[2] + " = " + std::to_string(e.serialnumber));
|
v.push_back(columns[3] + " = " + std::to_string(e.aug_slot_1));
|
||||||
v.push_back(columns[3] + " = " + std::to_string(e.charges));
|
v.push_back(columns[4] + " = " + std::to_string(e.aug_slot_2));
|
||||||
v.push_back(columns[4] + " = " + std::to_string(e.item_cost));
|
v.push_back(columns[5] + " = " + std::to_string(e.aug_slot_3));
|
||||||
v.push_back(columns[5] + " = " + std::to_string(e.slot_id));
|
v.push_back(columns[6] + " = " + std::to_string(e.aug_slot_4));
|
||||||
|
v.push_back(columns[7] + " = " + std::to_string(e.aug_slot_5));
|
||||||
|
v.push_back(columns[8] + " = " + std::to_string(e.aug_slot_6));
|
||||||
|
v.push_back(columns[9] + " = " + std::to_string(e.item_sn));
|
||||||
|
v.push_back(columns[10] + " = " + std::to_string(e.item_charges));
|
||||||
|
v.push_back(columns[11] + " = " + std::to_string(e.item_cost));
|
||||||
|
v.push_back(columns[12] + " = " + std::to_string(e.slot_id));
|
||||||
|
v.push_back(columns[13] + " = " + std::to_string(e.char_entity_id));
|
||||||
|
v.push_back(columns[14] + " = " + std::to_string(e.char_zone_id));
|
||||||
|
v.push_back(columns[15] + " = " + std::to_string(e.active_transaction));
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -187,7 +246,7 @@ public:
|
|||||||
TableName(),
|
TableName(),
|
||||||
Strings::Implode(", ", v),
|
Strings::Implode(", ", v),
|
||||||
PrimaryKey(),
|
PrimaryKey(),
|
||||||
e.char_id
|
e.id
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -201,12 +260,22 @@ public:
|
|||||||
{
|
{
|
||||||
std::vector<std::string> v;
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.id));
|
||||||
v.push_back(std::to_string(e.char_id));
|
v.push_back(std::to_string(e.char_id));
|
||||||
v.push_back(std::to_string(e.item_id));
|
v.push_back(std::to_string(e.item_id));
|
||||||
v.push_back(std::to_string(e.serialnumber));
|
v.push_back(std::to_string(e.aug_slot_1));
|
||||||
v.push_back(std::to_string(e.charges));
|
v.push_back(std::to_string(e.aug_slot_2));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_3));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_4));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_5));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_6));
|
||||||
|
v.push_back(std::to_string(e.item_sn));
|
||||||
|
v.push_back(std::to_string(e.item_charges));
|
||||||
v.push_back(std::to_string(e.item_cost));
|
v.push_back(std::to_string(e.item_cost));
|
||||||
v.push_back(std::to_string(e.slot_id));
|
v.push_back(std::to_string(e.slot_id));
|
||||||
|
v.push_back(std::to_string(e.char_entity_id));
|
||||||
|
v.push_back(std::to_string(e.char_zone_id));
|
||||||
|
v.push_back(std::to_string(e.active_transaction));
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -217,7 +286,7 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (results.Success()) {
|
if (results.Success()) {
|
||||||
e.char_id = results.LastInsertedID();
|
e.id = results.LastInsertedID();
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,12 +305,22 @@ public:
|
|||||||
for (auto &e: entries) {
|
for (auto &e: entries) {
|
||||||
std::vector<std::string> v;
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.id));
|
||||||
v.push_back(std::to_string(e.char_id));
|
v.push_back(std::to_string(e.char_id));
|
||||||
v.push_back(std::to_string(e.item_id));
|
v.push_back(std::to_string(e.item_id));
|
||||||
v.push_back(std::to_string(e.serialnumber));
|
v.push_back(std::to_string(e.aug_slot_1));
|
||||||
v.push_back(std::to_string(e.charges));
|
v.push_back(std::to_string(e.aug_slot_2));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_3));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_4));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_5));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_6));
|
||||||
|
v.push_back(std::to_string(e.item_sn));
|
||||||
|
v.push_back(std::to_string(e.item_charges));
|
||||||
v.push_back(std::to_string(e.item_cost));
|
v.push_back(std::to_string(e.item_cost));
|
||||||
v.push_back(std::to_string(e.slot_id));
|
v.push_back(std::to_string(e.slot_id));
|
||||||
|
v.push_back(std::to_string(e.char_entity_id));
|
||||||
|
v.push_back(std::to_string(e.char_zone_id));
|
||||||
|
v.push_back(std::to_string(e.active_transaction));
|
||||||
|
|
||||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
}
|
}
|
||||||
@@ -275,12 +354,22 @@ public:
|
|||||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
Trader e{};
|
Trader e{};
|
||||||
|
|
||||||
e.char_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
e.id = row[0] ? strtoull(row[0], nullptr, 10) : 0;
|
||||||
e.item_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
e.char_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||||
e.serialnumber = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
e.item_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
e.charges = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
|
e.aug_slot_1 = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
e.item_cost = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
e.aug_slot_2 = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
e.slot_id = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0;
|
e.aug_slot_3 = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_4 = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_5 = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_6 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||||
|
e.item_sn = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
|
||||||
|
e.item_charges = row[10] ? static_cast<int32_t>(atoi(row[10])) : 0;
|
||||||
|
e.item_cost = row[11] ? strtoull(row[11], nullptr, 10) : 0;
|
||||||
|
e.slot_id = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
|
||||||
|
e.char_entity_id = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
|
||||||
|
e.char_zone_id = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
|
||||||
|
e.active_transaction = row[15] ? static_cast<int8_t>(atoi(row[15])) : 0;
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -305,12 +394,22 @@ public:
|
|||||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
Trader e{};
|
Trader e{};
|
||||||
|
|
||||||
e.char_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
e.id = row[0] ? strtoull(row[0], nullptr, 10) : 0;
|
||||||
e.item_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
e.char_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||||
e.serialnumber = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
e.item_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
e.charges = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
|
e.aug_slot_1 = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
e.item_cost = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
e.aug_slot_2 = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
e.slot_id = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0;
|
e.aug_slot_3 = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_4 = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_5 = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_6 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||||
|
e.item_sn = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
|
||||||
|
e.item_charges = row[10] ? static_cast<int32_t>(atoi(row[10])) : 0;
|
||||||
|
e.item_cost = row[11] ? strtoull(row[11], nullptr, 10) : 0;
|
||||||
|
e.slot_id = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
|
||||||
|
e.char_entity_id = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
|
||||||
|
e.char_zone_id = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
|
||||||
|
e.active_transaction = row[15] ? static_cast<int8_t>(atoi(row[15])) : 0;
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -385,12 +484,22 @@ public:
|
|||||||
{
|
{
|
||||||
std::vector<std::string> v;
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.id));
|
||||||
v.push_back(std::to_string(e.char_id));
|
v.push_back(std::to_string(e.char_id));
|
||||||
v.push_back(std::to_string(e.item_id));
|
v.push_back(std::to_string(e.item_id));
|
||||||
v.push_back(std::to_string(e.serialnumber));
|
v.push_back(std::to_string(e.aug_slot_1));
|
||||||
v.push_back(std::to_string(e.charges));
|
v.push_back(std::to_string(e.aug_slot_2));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_3));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_4));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_5));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_6));
|
||||||
|
v.push_back(std::to_string(e.item_sn));
|
||||||
|
v.push_back(std::to_string(e.item_charges));
|
||||||
v.push_back(std::to_string(e.item_cost));
|
v.push_back(std::to_string(e.item_cost));
|
||||||
v.push_back(std::to_string(e.slot_id));
|
v.push_back(std::to_string(e.slot_id));
|
||||||
|
v.push_back(std::to_string(e.char_entity_id));
|
||||||
|
v.push_back(std::to_string(e.char_zone_id));
|
||||||
|
v.push_back(std::to_string(e.active_transaction));
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -413,12 +522,22 @@ public:
|
|||||||
for (auto &e: entries) {
|
for (auto &e: entries) {
|
||||||
std::vector<std::string> v;
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.id));
|
||||||
v.push_back(std::to_string(e.char_id));
|
v.push_back(std::to_string(e.char_id));
|
||||||
v.push_back(std::to_string(e.item_id));
|
v.push_back(std::to_string(e.item_id));
|
||||||
v.push_back(std::to_string(e.serialnumber));
|
v.push_back(std::to_string(e.aug_slot_1));
|
||||||
v.push_back(std::to_string(e.charges));
|
v.push_back(std::to_string(e.aug_slot_2));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_3));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_4));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_5));
|
||||||
|
v.push_back(std::to_string(e.aug_slot_6));
|
||||||
|
v.push_back(std::to_string(e.item_sn));
|
||||||
|
v.push_back(std::to_string(e.item_charges));
|
||||||
v.push_back(std::to_string(e.item_cost));
|
v.push_back(std::to_string(e.item_cost));
|
||||||
v.push_back(std::to_string(e.slot_id));
|
v.push_back(std::to_string(e.slot_id));
|
||||||
|
v.push_back(std::to_string(e.char_entity_id));
|
||||||
|
v.push_back(std::to_string(e.char_zone_id));
|
||||||
|
v.push_back(std::to_string(e.active_transaction));
|
||||||
|
|
||||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public:
|
|||||||
std::string varname;
|
std::string varname;
|
||||||
std::string value;
|
std::string value;
|
||||||
std::string information;
|
std::string information;
|
||||||
std::string ts;
|
time_t ts;
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::string PrimaryKey()
|
static std::string PrimaryKey()
|
||||||
@@ -49,7 +49,7 @@ public:
|
|||||||
"varname",
|
"varname",
|
||||||
"value",
|
"value",
|
||||||
"information",
|
"information",
|
||||||
"ts",
|
"UNIX_TIMESTAMP(ts)",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ public:
|
|||||||
e.varname = row[1] ? row[1] : "";
|
e.varname = row[1] ? row[1] : "";
|
||||||
e.value = row[2] ? row[2] : "";
|
e.value = row[2] ? row[2] : "";
|
||||||
e.information = row[3] ? row[3] : "";
|
e.information = row[3] ? row[3] : "";
|
||||||
e.ts = row[4] ? row[4] : std::time(nullptr);
|
e.ts = strtoll(row[4] ? row[4] : "-1", nullptr, 10);
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -172,7 +172,7 @@ public:
|
|||||||
v.push_back(columns[1] + " = '" + Strings::Escape(e.varname) + "'");
|
v.push_back(columns[1] + " = '" + Strings::Escape(e.varname) + "'");
|
||||||
v.push_back(columns[2] + " = '" + Strings::Escape(e.value) + "'");
|
v.push_back(columns[2] + " = '" + Strings::Escape(e.value) + "'");
|
||||||
v.push_back(columns[3] + " = '" + Strings::Escape(e.information) + "'");
|
v.push_back(columns[3] + " = '" + Strings::Escape(e.information) + "'");
|
||||||
v.push_back(columns[4] + " = '" + Strings::Escape(e.ts) + "'");
|
v.push_back(columns[4] + " = FROM_UNIXTIME(" + (e.ts > 0 ? std::to_string(e.ts) : "null") + ")");
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -198,7 +198,7 @@ public:
|
|||||||
v.push_back("'" + Strings::Escape(e.varname) + "'");
|
v.push_back("'" + Strings::Escape(e.varname) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.value) + "'");
|
v.push_back("'" + Strings::Escape(e.value) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.information) + "'");
|
v.push_back("'" + Strings::Escape(e.information) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.ts) + "'");
|
v.push_back("FROM_UNIXTIME(" + (e.ts > 0 ? std::to_string(e.ts) : "null") + ")");
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -232,7 +232,7 @@ public:
|
|||||||
v.push_back("'" + Strings::Escape(e.varname) + "'");
|
v.push_back("'" + Strings::Escape(e.varname) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.value) + "'");
|
v.push_back("'" + Strings::Escape(e.value) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.information) + "'");
|
v.push_back("'" + Strings::Escape(e.information) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.ts) + "'");
|
v.push_back("FROM_UNIXTIME(" + (e.ts > 0 ? std::to_string(e.ts) : "null") + ")");
|
||||||
|
|
||||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
}
|
}
|
||||||
@@ -270,7 +270,7 @@ public:
|
|||||||
e.varname = row[1] ? row[1] : "";
|
e.varname = row[1] ? row[1] : "";
|
||||||
e.value = row[2] ? row[2] : "";
|
e.value = row[2] ? row[2] : "";
|
||||||
e.information = row[3] ? row[3] : "";
|
e.information = row[3] ? row[3] : "";
|
||||||
e.ts = row[4] ? row[4] : std::time(nullptr);
|
e.ts = strtoll(row[4] ? row[4] : "-1", nullptr, 10);
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -299,7 +299,7 @@ public:
|
|||||||
e.varname = row[1] ? row[1] : "";
|
e.varname = row[1] ? row[1] : "";
|
||||||
e.value = row[2] ? row[2] : "";
|
e.value = row[2] ? row[2] : "";
|
||||||
e.information = row[3] ? row[3] : "";
|
e.information = row[3] ? row[3] : "";
|
||||||
e.ts = row[4] ? row[4] : std::time(nullptr);
|
e.ts = strtoll(row[4] ? row[4] : "-1", nullptr, 10);
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -378,7 +378,7 @@ public:
|
|||||||
v.push_back("'" + Strings::Escape(e.varname) + "'");
|
v.push_back("'" + Strings::Escape(e.varname) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.value) + "'");
|
v.push_back("'" + Strings::Escape(e.value) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.information) + "'");
|
v.push_back("'" + Strings::Escape(e.information) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.ts) + "'");
|
v.push_back("FROM_UNIXTIME(" + (e.ts > 0 ? std::to_string(e.ts) : "null") + ")");
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -405,7 +405,7 @@ public:
|
|||||||
v.push_back("'" + Strings::Escape(e.varname) + "'");
|
v.push_back("'" + Strings::Escape(e.varname) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.value) + "'");
|
v.push_back("'" + Strings::Escape(e.value) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.information) + "'");
|
v.push_back("'" + Strings::Escape(e.information) + "'");
|
||||||
v.push_back("'" + Strings::Escape(e.ts) + "'");
|
v.push_back("FROM_UNIXTIME(" + (e.ts > 0 ? std::to_string(e.ts) : "null") + ")");
|
||||||
|
|
||||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,24 @@ public:
|
|||||||
return NewEntity();
|
return NewEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// insert with ON DUPLICATE KEY UPDATE to leave rows that exist unchanged
|
||||||
|
static int InsertUpdateMany(Database& db, const std::vector<CharRecipeList>& entries)
|
||||||
|
{
|
||||||
|
std::vector<std::string> values;
|
||||||
|
values.reserve(entries.size());
|
||||||
|
|
||||||
|
for (const auto& e: entries)
|
||||||
|
{
|
||||||
|
values.emplace_back(fmt::format("({},{},{})", e.char_id, e.recipe_id, e.madecount));
|
||||||
|
}
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(fmt::format(
|
||||||
|
"INSERT INTO {0} (char_id, recipe_id, madecount) VALUES {1} ON DUPLICATE KEY UPDATE {2}={2}",
|
||||||
|
TableName(), fmt::join(values, ","), PrimaryKey()));
|
||||||
|
|
||||||
|
return results.Success() ? results.RowsAffected() : 0;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //EQEMU_CHAR_RECIPE_LIST_REPOSITORY_H
|
#endif //EQEMU_CHAR_RECIPE_LIST_REPOSITORY_H
|
||||||
|
|||||||
@@ -64,6 +64,22 @@ public:
|
|||||||
|
|
||||||
return Strings::ToUnsignedInt(row[0]);
|
return Strings::ToUnsignedInt(row[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static CharacterData FindByName(
|
||||||
|
Database& db,
|
||||||
|
const std::string& character_name
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto l = CharacterDataRepository::GetWhere(
|
||||||
|
db,
|
||||||
|
fmt::format(
|
||||||
|
"`name` = '{}' LIMIT 1",
|
||||||
|
Strings::Escape(character_name)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return l.empty() ? CharacterDataRepository::NewEntity() : l.front();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //EQEMU_CHARACTER_DATA_REPOSITORY_H
|
#endif //EQEMU_CHARACTER_DATA_REPOSITORY_H
|
||||||
|
|||||||
@@ -74,9 +74,11 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto& m = l.front();
|
||||||
|
|
||||||
return EXPModifier{
|
return EXPModifier{
|
||||||
.aa_modifier = l[0].aa_modifier,
|
.aa_modifier = m.aa_modifier,
|
||||||
.exp_modifier = l[0].exp_modifier
|
.exp_modifier = m.exp_modifier
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
#ifndef EQEMU_CHARACTER_PARCELS_CONTAINERS_REPOSITORY_H
|
||||||
|
#define EQEMU_CHARACTER_PARCELS_CONTAINERS_REPOSITORY_H
|
||||||
|
|
||||||
|
#include "../database.h"
|
||||||
|
#include "../strings.h"
|
||||||
|
#include "base/base_character_parcels_containers_repository.h"
|
||||||
|
|
||||||
|
class CharacterParcelsContainersRepository: public BaseCharacterParcelsContainersRepository {
|
||||||
|
public:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was auto generated and can be modified and extended upon
|
||||||
|
*
|
||||||
|
* Base repository methods are automatically
|
||||||
|
* generated in the "base" version of this repository. The base repository
|
||||||
|
* is immutable and to be left untouched, while methods in this class
|
||||||
|
* are used as extension methods for more specific persistence-layer
|
||||||
|
* accessors or mutators.
|
||||||
|
*
|
||||||
|
* Base Methods (Subject to be expanded upon in time)
|
||||||
|
*
|
||||||
|
* Note: Not all tables are designed appropriately to fit functionality with all base methods
|
||||||
|
*
|
||||||
|
* InsertOne
|
||||||
|
* UpdateOne
|
||||||
|
* DeleteOne
|
||||||
|
* FindOne
|
||||||
|
* GetWhere(std::string where_filter)
|
||||||
|
* DeleteWhere(std::string where_filter)
|
||||||
|
* InsertMany
|
||||||
|
* All
|
||||||
|
*
|
||||||
|
* Example custom methods in a repository
|
||||||
|
*
|
||||||
|
* CharacterParcelsContainersRepository::GetByZoneAndVersion(int zone_id, int zone_version)
|
||||||
|
* CharacterParcelsContainersRepository::GetWhereNeverExpires()
|
||||||
|
* CharacterParcelsContainersRepository::GetWhereXAndY()
|
||||||
|
* CharacterParcelsContainersRepository::DeleteWhereXAndY()
|
||||||
|
*
|
||||||
|
* Most of the above could be covered by base methods, but if you as a developer
|
||||||
|
* find yourself re-using logic for other parts of the code, its best to just make a
|
||||||
|
* method that can be re-used easily elsewhere especially if it can use a base repository
|
||||||
|
* method and encapsulate filters there
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Custom extended repository methods here
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //EQEMU_CHARACTER_PARCELS_CONTAINERS_REPOSITORY_H
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
#ifndef EQEMU_CHARACTER_PARCELS_REPOSITORY_H
|
||||||
|
#define EQEMU_CHARACTER_PARCELS_REPOSITORY_H
|
||||||
|
|
||||||
|
#include "../database.h"
|
||||||
|
#include "../strings.h"
|
||||||
|
#include "base/base_character_parcels_repository.h"
|
||||||
|
|
||||||
|
class CharacterParcelsRepository: public BaseCharacterParcelsRepository {
|
||||||
|
public:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was auto generated and can be modified and extended upon
|
||||||
|
*
|
||||||
|
* Base repository methods are automatically
|
||||||
|
* generated in the "base" version of this repository. The base repository
|
||||||
|
* is immutable and to be left untouched, while methods in this class
|
||||||
|
* are used as extension methods for more specific persistence-layer
|
||||||
|
* accessors or mutators.
|
||||||
|
*
|
||||||
|
* Base Methods (Subject to be expanded upon in time)
|
||||||
|
*
|
||||||
|
* Note: Not all tables are designed appropriately to fit functionality with all base methods
|
||||||
|
*
|
||||||
|
* InsertOne
|
||||||
|
* UpdateOne
|
||||||
|
* DeleteOne
|
||||||
|
* FindOne
|
||||||
|
* GetWhere(std::string where_filter)
|
||||||
|
* DeleteWhere(std::string where_filter)
|
||||||
|
* InsertMany
|
||||||
|
* All
|
||||||
|
*
|
||||||
|
* Example custom methods in a repository
|
||||||
|
*
|
||||||
|
* ParcelsRepository::GetByZoneAndVersion(int zone_id, int zone_version)
|
||||||
|
* ParcelsRepository::GetWhereNeverExpires()
|
||||||
|
* ParcelsRepository::GetWhereXAndY()
|
||||||
|
* ParcelsRepository::DeleteWhereXAndY()
|
||||||
|
*
|
||||||
|
* Most of the above could be covered by base methods, but if you as a developer
|
||||||
|
* find yourself re-using logic for other parts of the code, its best to just make a
|
||||||
|
* method that can be re-used easily elsewhere especially if it can use a base repository
|
||||||
|
* method and encapsulate filters there
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Custom extended repository methods here
|
||||||
|
struct ParcelCountAndCharacterName
|
||||||
|
{
|
||||||
|
std::string character_name;
|
||||||
|
uint32 char_id;
|
||||||
|
uint32 parcel_count;
|
||||||
|
};
|
||||||
|
|
||||||
|
static std::vector<ParcelCountAndCharacterName> GetParcelCountAndCharacterName(Database &db, const std::string &character_name)
|
||||||
|
{
|
||||||
|
std::vector<ParcelCountAndCharacterName> all_entries;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"SELECT c.name, COUNT(p.id), c.id FROM character_data c "
|
||||||
|
"LEFT JOIN character_parcels p ON p.char_id = c.id "
|
||||||
|
"WHERE c.name = '{}' "
|
||||||
|
"LIMIT 1",
|
||||||
|
character_name)
|
||||||
|
);
|
||||||
|
|
||||||
|
all_entries.reserve(results.RowCount());
|
||||||
|
|
||||||
|
for(auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
ParcelCountAndCharacterName e {};
|
||||||
|
|
||||||
|
e.character_name = row[0] ? row[0] : "";
|
||||||
|
e.parcel_count = row[1] ? Strings::ToUnsignedInt(row[1]) : 0;
|
||||||
|
e.char_id = row[2] ? Strings::ToUnsignedInt(row[2]) : 0;
|
||||||
|
|
||||||
|
all_entries.push_back(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return all_entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int GetNextFreeParcelSlot(Database& db, const uint32 character_id, const uint32 max_slots)
|
||||||
|
{
|
||||||
|
const auto& l = CharacterParcelsRepository::GetWhere(
|
||||||
|
db,
|
||||||
|
fmt::format(
|
||||||
|
"char_id = '{}' ORDER BY slot_id ASC",
|
||||||
|
character_id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (l.empty()) {
|
||||||
|
return PARCEL_BEGIN_SLOT;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (uint32 i = PARCEL_BEGIN_SLOT; i <= max_slots; i++) {
|
||||||
|
auto it = std::find_if(
|
||||||
|
l.cbegin(),
|
||||||
|
l.cend(),
|
||||||
|
[&](const auto &x) {
|
||||||
|
return x.slot_id == i;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if (it == l.end()) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return INVALID_INDEX;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //EQEMU_CHARACTER_PARCELS_REPOSITORY_H
|
||||||
@@ -70,6 +70,7 @@ public:
|
|||||||
{.parent_command = "set", .sub_command = "alternate_currency", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "setaltcurrency"},
|
{.parent_command = "set", .sub_command = "alternate_currency", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "setaltcurrency"},
|
||||||
{.parent_command = "set", .sub_command = "animation", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "setanim"},
|
{.parent_command = "set", .sub_command = "animation", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "setanim"},
|
||||||
{.parent_command = "set", .sub_command = "anon", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "setanon"},
|
{.parent_command = "set", .sub_command = "anon", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "setanon"},
|
||||||
|
{.parent_command = "set", .sub_command = "auto_login", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "setautologin"},
|
||||||
{.parent_command = "set", .sub_command = "bind", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "bind"},
|
{.parent_command = "set", .sub_command = "bind", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "bind"},
|
||||||
{.parent_command = "set", .sub_command = "checksum", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "updatechecksum"},
|
{.parent_command = "set", .sub_command = "checksum", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "updatechecksum"},
|
||||||
{.parent_command = "set", .sub_command = "class_permanent", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "permaclass"},
|
{.parent_command = "set", .sub_command = "class_permanent", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "permaclass"},
|
||||||
@@ -122,6 +123,7 @@ public:
|
|||||||
{.parent_command = "set", .sub_command = "zone", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "zclip|zcolor|zheader|zonelock|zsafecoords|zsky|zunderworld"},
|
{.parent_command = "set", .sub_command = "zone", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "zclip|zcolor|zheader|zonelock|zsafecoords|zsky|zunderworld"},
|
||||||
{.parent_command = "show", .sub_command = "aas", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "showaas"},
|
{.parent_command = "show", .sub_command = "aas", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "showaas"},
|
||||||
{.parent_command = "show", .sub_command = "aa_points", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "showaapoints|showaapts"},
|
{.parent_command = "show", .sub_command = "aa_points", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "showaapoints|showaapts"},
|
||||||
|
{.parent_command = "show", .sub_command = "auto_login", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "showautologin"},
|
||||||
{.parent_command = "show", .sub_command = "aggro", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "aggro"},
|
{.parent_command = "show", .sub_command = "aggro", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "aggro"},
|
||||||
{.parent_command = "show", .sub_command = "buffs", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "showbuffs"},
|
{.parent_command = "show", .sub_command = "buffs", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "showbuffs"},
|
||||||
{.parent_command = "show", .sub_command = "buried_corpse_count", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "getplayerburiedcorpsecount"},
|
{.parent_command = "show", .sub_command = "buried_corpse_count", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "getplayerburiedcorpsecount"},
|
||||||
|
|||||||
@@ -44,7 +44,15 @@ public:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Custom extended repository methods here
|
// Custom extended repository methods here
|
||||||
|
static void ClearAllGroups(Database& db)
|
||||||
|
{
|
||||||
|
db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"DELETE FROM `{}`",
|
||||||
|
TableName()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //EQEMU_GROUP_ID_REPOSITORY_H
|
#endif //EQEMU_GROUP_ID_REPOSITORY_H
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
class GroupLeadersRepository: public BaseGroupLeadersRepository {
|
class GroupLeadersRepository: public BaseGroupLeadersRepository {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file was auto generated and can be modified and extended upon
|
* This file was auto generated and can be modified and extended upon
|
||||||
*
|
*
|
||||||
@@ -44,7 +43,29 @@ public:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Custom extended repository methods here
|
// Custom extended repository methods here
|
||||||
|
static void ClearAllGroupLeaders(Database& db)
|
||||||
|
{
|
||||||
|
db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"DELETE FROM `{}`",
|
||||||
|
TableName()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int UpdateLeadershipAA(Database &db, std::string &aa, uint32 group_id)
|
||||||
|
{
|
||||||
|
const auto group_leader = GetWhere(db, fmt::format("gid = '{}' LIMIT 1", group_id));
|
||||||
|
if(group_leader.empty()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
db.Encode(aa);
|
||||||
|
auto m = group_leader[0];
|
||||||
|
m.leadershipaa = aa;
|
||||||
|
|
||||||
|
return UpdateOne(db, m);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //EQEMU_GROUP_LEADERS_REPOSITORY_H
|
#endif //EQEMU_GROUP_LEADERS_REPOSITORY_H
|
||||||
|
|||||||
@@ -190,5 +190,17 @@ public:
|
|||||||
|
|
||||||
return UpdateOne(db, m);
|
return UpdateOne(db, m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ClearOnlineStatus(Database &db)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"UPDATE {} SET `online` = 0 "
|
||||||
|
"WHERE `online` = 1;",
|
||||||
|
TableName()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //EQEMU_GUILD_MEMBERS_REPOSITORY_H
|
#endif //EQEMU_GUILD_MEMBERS_REPOSITORY_H
|
||||||
|
|||||||
@@ -45,6 +45,31 @@ public:
|
|||||||
|
|
||||||
// Custom extended repository methods here
|
// Custom extended repository methods here
|
||||||
|
|
||||||
|
static std::map<std::string, GuildPermissions> LoadAll(Database &db)
|
||||||
|
{
|
||||||
|
std::map<std::string, GuildPermissions> all_entries;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} WHERE `guild_id` < {}",
|
||||||
|
BaseSelect(),
|
||||||
|
RoF2::constants::MAX_GUILD_ID
|
||||||
|
));
|
||||||
|
|
||||||
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
GuildPermissions e{};
|
||||||
|
|
||||||
|
e.id = static_cast<int32_t>(atoi(row[0]));
|
||||||
|
e.perm_id = static_cast<int32_t>(atoi(row[1]));
|
||||||
|
e.guild_id = static_cast<int32_t>(atoi(row[2]));
|
||||||
|
e.permission = static_cast<int32_t>(atoi(row[3]));
|
||||||
|
|
||||||
|
auto key = fmt::format("{}-{}", e.guild_id, e.perm_id);
|
||||||
|
all_entries.emplace(key, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return all_entries;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //EQEMU_GUILD_PERMISSIONS_REPOSITORY_H
|
#endif //EQEMU_GUILD_PERMISSIONS_REPOSITORY_H
|
||||||
|
|||||||
@@ -60,6 +60,30 @@ public:
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::map<std::string, std::string> LoadAll(Database &db)
|
||||||
|
{
|
||||||
|
std::map<std::string, std::string> all_entries;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(fmt::format(
|
||||||
|
"{} WHERE `guild_id` < {}",
|
||||||
|
BaseSelect(),
|
||||||
|
RoF2::constants::MAX_GUILD_ID)
|
||||||
|
);
|
||||||
|
|
||||||
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
GuildRanks e{};
|
||||||
|
|
||||||
|
e.guild_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||||
|
e.rank_ = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||||
|
e.title = row[2] ? row[2] : "";
|
||||||
|
|
||||||
|
auto key = fmt::format("{}-{}", e.guild_id, e.rank_);
|
||||||
|
all_entries.emplace(key, e.title);
|
||||||
|
}
|
||||||
|
|
||||||
|
return all_entries;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //EQEMU_GUILD_RANKS_REPOSITORY_H
|
#endif //EQEMU_GUILD_RANKS_REPOSITORY_H
|
||||||
|
|||||||
@@ -44,7 +44,30 @@ public:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Custom extended repository methods here
|
// Custom extended repository methods here
|
||||||
|
static int64 CountInventorySnapshots(Database& db)
|
||||||
|
{
|
||||||
|
const std::string& query = "SELECT COUNT(*) FROM (SELECT * FROM `inventory_snapshots` a GROUP BY `charid`, `time_index`) b";
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(query);
|
||||||
|
|
||||||
|
if (!results.Success() || !results.RowCount()) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto row = results.begin();
|
||||||
|
|
||||||
|
const int64 count = Strings::ToBigInt(row[0]);
|
||||||
|
|
||||||
|
if (count > std::numeric_limits<int>::max()) {
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count < 0) {
|
||||||
|
return -3;
|
||||||
|
}
|
||||||
|
|
||||||
|
return count;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //EQEMU_INVENTORY_SNAPSHOTS_REPOSITORY_H
|
#endif //EQEMU_INVENTORY_SNAPSHOTS_REPOSITORY_H
|
||||||
|
|||||||
@@ -7,43 +7,6 @@
|
|||||||
|
|
||||||
class ItemsRepository: public BaseItemsRepository {
|
class ItemsRepository: public BaseItemsRepository {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
|
||||||
* This file was auto generated and can be modified and extended upon
|
|
||||||
*
|
|
||||||
* Base repository methods are automatically
|
|
||||||
* generated in the "base" version of this repository. The base repository
|
|
||||||
* is immutable and to be left untouched, while methods in this class
|
|
||||||
* are used as extension methods for more specific persistence-layer
|
|
||||||
* accessors or mutators.
|
|
||||||
*
|
|
||||||
* Base Methods (Subject to be expanded upon in time)
|
|
||||||
*
|
|
||||||
* Note: Not all tables are designed appropriately to fit functionality with all base methods
|
|
||||||
*
|
|
||||||
* InsertOne
|
|
||||||
* UpdateOne
|
|
||||||
* DeleteOne
|
|
||||||
* FindOne
|
|
||||||
* GetWhere(std::string where_filter)
|
|
||||||
* DeleteWhere(std::string where_filter)
|
|
||||||
* InsertMany
|
|
||||||
* All
|
|
||||||
*
|
|
||||||
* Example custom methods in a repository
|
|
||||||
*
|
|
||||||
* ItemsRepository::GetByZoneAndVersion(int zone_id, int zone_version)
|
|
||||||
* ItemsRepository::GetWhereNeverExpires()
|
|
||||||
* ItemsRepository::GetWhereXAndY()
|
|
||||||
* ItemsRepository::DeleteWhereXAndY()
|
|
||||||
*
|
|
||||||
* Most of the above could be covered by base methods, but if you as a developer
|
|
||||||
* find yourself re-using logic for other parts of the code, its best to just make a
|
|
||||||
* method that can be re-used easily elsewhere especially if it can use a base repository
|
|
||||||
* method and encapsulate filters there
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Custom extended repository methods here
|
|
||||||
static std::vector<int32> GetItemIDsBySearchCriteria(
|
static std::vector<int32> GetItemIDsBySearchCriteria(
|
||||||
Database& db,
|
Database& db,
|
||||||
std::string search_string,
|
std::string search_string,
|
||||||
@@ -73,6 +36,8 @@ public:
|
|||||||
|
|
||||||
return item_id_list;
|
return item_id_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //EQEMU_ITEMS_REPOSITORY_H
|
#endif //EQEMU_ITEMS_REPOSITORY_H
|
||||||
|
|||||||
@@ -66,6 +66,16 @@ public:
|
|||||||
|
|
||||||
return results.Success() ? results.RowsAffected() : 0;
|
return results.Success() ? results.RowsAffected() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ClearAllRaidDetails(Database& db)
|
||||||
|
{
|
||||||
|
db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"DELETE FROM `{}`",
|
||||||
|
TableName()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //EQEMU_RAID_DETAILS_REPOSITORY_H
|
#endif //EQEMU_RAID_DETAILS_REPOSITORY_H
|
||||||
|
|||||||
@@ -1,297 +0,0 @@
|
|||||||
#ifndef EQEMU_RAID_LEADERS_REPOSITORY_H
|
|
||||||
#define EQEMU_RAID_LEADERS_REPOSITORY_H
|
|
||||||
|
|
||||||
#include "../database.h"
|
|
||||||
#include "../strings.h"
|
|
||||||
|
|
||||||
class RaidLeadersRepository {
|
|
||||||
public:
|
|
||||||
struct RaidLeaders {
|
|
||||||
int gid;
|
|
||||||
int rid;
|
|
||||||
std::string marknpc;
|
|
||||||
std::string maintank;
|
|
||||||
std::string assist;
|
|
||||||
std::string puller;
|
|
||||||
std::string leadershipaa;
|
|
||||||
std::string mentoree;
|
|
||||||
int mentor_percent;
|
|
||||||
};
|
|
||||||
|
|
||||||
static std::string PrimaryKey()
|
|
||||||
{
|
|
||||||
return std::string("");
|
|
||||||
}
|
|
||||||
|
|
||||||
static std::vector<std::string> Columns()
|
|
||||||
{
|
|
||||||
return {
|
|
||||||
"gid",
|
|
||||||
"rid",
|
|
||||||
"marknpc",
|
|
||||||
"maintank",
|
|
||||||
"assist",
|
|
||||||
"puller",
|
|
||||||
"leadershipaa",
|
|
||||||
"mentoree",
|
|
||||||
"mentor_percent",
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
|
||||||
{
|
|
||||||
return std::string(Strings::Implode(", ", Columns()));
|
|
||||||
}
|
|
||||||
|
|
||||||
static std::string InsertColumnsRaw()
|
|
||||||
{
|
|
||||||
std::vector<std::string> insert_columns;
|
|
||||||
|
|
||||||
for (auto &column : Columns()) {
|
|
||||||
if (column == PrimaryKey()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
insert_columns.push_back(column);
|
|
||||||
}
|
|
||||||
|
|
||||||
return std::string(Strings::Implode(", ", insert_columns));
|
|
||||||
}
|
|
||||||
|
|
||||||
static std::string TableName()
|
|
||||||
{
|
|
||||||
return std::string("raid_leaders");
|
|
||||||
}
|
|
||||||
|
|
||||||
static std::string BaseSelect()
|
|
||||||
{
|
|
||||||
return fmt::format(
|
|
||||||
"SELECT {} FROM {}",
|
|
||||||
ColumnsRaw(),
|
|
||||||
TableName()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
static std::string BaseInsert()
|
|
||||||
{
|
|
||||||
return fmt::format(
|
|
||||||
"INSERT INTO {} ({}) ",
|
|
||||||
TableName(),
|
|
||||||
InsertColumnsRaw()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
static RaidLeaders NewEntity()
|
|
||||||
{
|
|
||||||
RaidLeaders entry{};
|
|
||||||
|
|
||||||
entry.gid = 0;
|
|
||||||
entry.rid = 0;
|
|
||||||
entry.marknpc = "";
|
|
||||||
entry.maintank = "";
|
|
||||||
entry.assist = "";
|
|
||||||
entry.puller = "";
|
|
||||||
entry.leadershipaa = 0;
|
|
||||||
entry.mentoree = "";
|
|
||||||
entry.mentor_percent = 0;
|
|
||||||
|
|
||||||
return entry;
|
|
||||||
}
|
|
||||||
|
|
||||||
static RaidLeaders GetRaidLeadersEntry(
|
|
||||||
const std::vector<RaidLeaders> &raid_leaderss,
|
|
||||||
int raid_leaders_id
|
|
||||||
)
|
|
||||||
{
|
|
||||||
for (auto &raid_leaders : raid_leaderss) {
|
|
||||||
if (raid_leaders. == raid_leaders_id) {
|
|
||||||
return raid_leaders;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return NewEntity();
|
|
||||||
}
|
|
||||||
|
|
||||||
static RaidLeaders FindOne(
|
|
||||||
int raid_leaders_id
|
|
||||||
)
|
|
||||||
{
|
|
||||||
auto results = database.QueryDatabase(
|
|
||||||
fmt::format(
|
|
||||||
"{} WHERE id = {} LIMIT 1",
|
|
||||||
BaseSelect(),
|
|
||||||
raid_leaders_id
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
auto row = results.begin();
|
|
||||||
if (results.RowCount() == 1) {
|
|
||||||
RaidLeaders entry{};
|
|
||||||
|
|
||||||
entry.gid = atoi(row[0]);
|
|
||||||
entry.rid = atoi(row[1]);
|
|
||||||
entry.marknpc = row[2];
|
|
||||||
entry.maintank = row[3];
|
|
||||||
entry.assist = row[4];
|
|
||||||
entry.puller = row[5];
|
|
||||||
entry.leadershipaa = row[6];
|
|
||||||
entry.mentoree = row[7];
|
|
||||||
entry.mentor_percent = atoi(row[8]);
|
|
||||||
|
|
||||||
return entry;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NewEntity();
|
|
||||||
}
|
|
||||||
|
|
||||||
static int DeleteOne(
|
|
||||||
int raid_leaders_id
|
|
||||||
)
|
|
||||||
{
|
|
||||||
auto results = database.QueryDatabase(
|
|
||||||
fmt::format(
|
|
||||||
"DELETE FROM {} WHERE {} = {}",
|
|
||||||
TableName(),
|
|
||||||
PrimaryKey(),
|
|
||||||
raid_leaders_id
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
return (results.Success() ? results.RowsAffected() : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int UpdateOne(
|
|
||||||
RaidLeaders raid_leaders_entry
|
|
||||||
)
|
|
||||||
{
|
|
||||||
std::vector<std::string> update_values;
|
|
||||||
|
|
||||||
auto columns = Columns();
|
|
||||||
|
|
||||||
update_values.push_back(columns[0] + " = " + std::to_string(raid_leaders_entry.gid));
|
|
||||||
update_values.push_back(columns[1] + " = " + std::to_string(raid_leaders_entry.rid));
|
|
||||||
update_values.push_back(columns[2] + " = '" + Strings::Escape(raid_leaders_entry.marknpc) + "'");
|
|
||||||
update_values.push_back(columns[3] + " = '" + Strings::Escape(raid_leaders_entry.maintank) + "'");
|
|
||||||
update_values.push_back(columns[4] + " = '" + Strings::Escape(raid_leaders_entry.assist) + "'");
|
|
||||||
update_values.push_back(columns[5] + " = '" + Strings::Escape(raid_leaders_entry.puller) + "'");
|
|
||||||
update_values.push_back(columns[6] + " = '" + Strings::Escape(raid_leaders_entry.leadershipaa) + "'");
|
|
||||||
update_values.push_back(columns[7] + " = '" + Strings::Escape(raid_leaders_entry.mentoree) + "'");
|
|
||||||
update_values.push_back(columns[8] + " = " + std::to_string(raid_leaders_entry.mentor_percent));
|
|
||||||
|
|
||||||
auto results = database.QueryDatabase(
|
|
||||||
fmt::format(
|
|
||||||
"UPDATE {} SET {} WHERE {} = {}",
|
|
||||||
TableName(),
|
|
||||||
Strings::Implode(", ", update_values),
|
|
||||||
PrimaryKey(),
|
|
||||||
raid_leaders_entry.
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
return (results.Success() ? results.RowsAffected() : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static RaidLeaders InsertOne(
|
|
||||||
RaidLeaders raid_leaders_entry
|
|
||||||
)
|
|
||||||
{
|
|
||||||
std::vector<std::string> insert_values;
|
|
||||||
|
|
||||||
insert_values.push_back(std::to_string(raid_leaders_entry.gid));
|
|
||||||
insert_values.push_back(std::to_string(raid_leaders_entry.rid));
|
|
||||||
insert_values.push_back("'" + Strings::Escape(raid_leaders_entry.marknpc) + "'");
|
|
||||||
insert_values.push_back("'" + Strings::Escape(raid_leaders_entry.maintank) + "'");
|
|
||||||
insert_values.push_back("'" + Strings::Escape(raid_leaders_entry.assist) + "'");
|
|
||||||
insert_values.push_back("'" + Strings::Escape(raid_leaders_entry.puller) + "'");
|
|
||||||
insert_values.push_back("'" + Strings::Escape(raid_leaders_entry.leadershipaa) + "'");
|
|
||||||
insert_values.push_back("'" + Strings::Escape(raid_leaders_entry.mentoree) + "'");
|
|
||||||
insert_values.push_back(std::to_string(raid_leaders_entry.mentor_percent));
|
|
||||||
|
|
||||||
auto results = database.QueryDatabase(
|
|
||||||
fmt::format(
|
|
||||||
"{} VALUES ({})",
|
|
||||||
BaseInsert(),
|
|
||||||
Strings::Implode(",", insert_values)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (results.Success()) {
|
|
||||||
raid_leaders_entry.id = results.LastInsertedID();
|
|
||||||
return raid_leaders_entry;
|
|
||||||
}
|
|
||||||
|
|
||||||
raid_leaders_entry = InstanceListRepository::NewEntity();
|
|
||||||
|
|
||||||
return raid_leaders_entry;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int InsertMany(
|
|
||||||
std::vector<RaidLeaders> raid_leaders_entries
|
|
||||||
)
|
|
||||||
{
|
|
||||||
std::vector<std::string> insert_chunks;
|
|
||||||
|
|
||||||
for (auto &raid_leaders_entry: raid_leaders_entries) {
|
|
||||||
std::vector<std::string> insert_values;
|
|
||||||
|
|
||||||
insert_values.push_back(std::to_string(raid_leaders_entry.gid));
|
|
||||||
insert_values.push_back(std::to_string(raid_leaders_entry.rid));
|
|
||||||
insert_values.push_back("'" + Strings::Escape(raid_leaders_entry.marknpc) + "'");
|
|
||||||
insert_values.push_back("'" + Strings::Escape(raid_leaders_entry.maintank) + "'");
|
|
||||||
insert_values.push_back("'" + Strings::Escape(raid_leaders_entry.assist) + "'");
|
|
||||||
insert_values.push_back("'" + Strings::Escape(raid_leaders_entry.puller) + "'");
|
|
||||||
insert_values.push_back("'" + Strings::Escape(raid_leaders_entry.leadershipaa) + "'");
|
|
||||||
insert_values.push_back("'" + Strings::Escape(raid_leaders_entry.mentoree) + "'");
|
|
||||||
insert_values.push_back(std::to_string(raid_leaders_entry.mentor_percent));
|
|
||||||
|
|
||||||
insert_chunks.push_back("(" + Strings::Implode(",", insert_values) + ")");
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<std::string> insert_values;
|
|
||||||
|
|
||||||
auto results = database.QueryDatabase(
|
|
||||||
fmt::format(
|
|
||||||
"{} VALUES {}",
|
|
||||||
BaseInsert(),
|
|
||||||
Strings::Implode(",", insert_chunks)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
return (results.Success() ? results.RowsAffected() : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static std::vector<RaidLeaders> All()
|
|
||||||
{
|
|
||||||
std::vector<RaidLeaders> all_entries;
|
|
||||||
|
|
||||||
auto results = database.QueryDatabase(
|
|
||||||
fmt::format(
|
|
||||||
"{}",
|
|
||||||
BaseSelect()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
all_entries.reserve(results.RowCount());
|
|
||||||
|
|
||||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
|
||||||
RaidLeaders entry{};
|
|
||||||
|
|
||||||
entry.gid = atoi(row[0]);
|
|
||||||
entry.rid = atoi(row[1]);
|
|
||||||
entry.marknpc = row[2];
|
|
||||||
entry.maintank = row[3];
|
|
||||||
entry.assist = row[4];
|
|
||||||
entry.puller = row[5];
|
|
||||||
entry.leadershipaa = row[6];
|
|
||||||
entry.mentoree = row[7];
|
|
||||||
entry.mentor_percent = atoi(row[8]);
|
|
||||||
|
|
||||||
all_entries.push_back(entry);
|
|
||||||
}
|
|
||||||
|
|
||||||
return all_entries;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //EQEMU_RAID_LEADERS_REPOSITORY_H
|
|
||||||
@@ -98,5 +98,15 @@ public:
|
|||||||
|
|
||||||
return results.Success() ? results.RowsAffected() : 0;
|
return results.Success() ? results.RowsAffected() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ClearAllRaids(Database& db)
|
||||||
|
{
|
||||||
|
db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"DELETE FROM `{}`",
|
||||||
|
TableName()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
#endif //EQEMU_RAID_MEMBERS_REPOSITORY_H
|
#endif //EQEMU_RAID_MEMBERS_REPOSITORY_H
|
||||||
|
|||||||
@@ -1,50 +1,224 @@
|
|||||||
#ifndef EQEMU_TRADER_REPOSITORY_H
|
#ifndef EQEMU_TRADER_REPOSITORY_H
|
||||||
#define EQEMU_TRADER_REPOSITORY_H
|
#define EQEMU_TRADER_REPOSITORY_H
|
||||||
|
|
||||||
#include "../database.h"
|
#include "../../common/shareddb.h"
|
||||||
#include "../strings.h"
|
#include "../strings.h"
|
||||||
#include "base/base_trader_repository.h"
|
#include "base/base_trader_repository.h"
|
||||||
|
#include "items_repository.h"
|
||||||
|
#include "../../common/item_data.h"
|
||||||
|
#include "../../common/races.h"
|
||||||
|
#include "../cereal/include/cereal/archives/binary.hpp"
|
||||||
|
#include "../cereal/include/cereal/types/string.hpp"
|
||||||
|
|
||||||
class TraderRepository : public BaseTraderRepository {
|
class TraderRepository : public BaseTraderRepository {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
struct DistinctTraders_Struct {
|
||||||
* This file was auto generated and can be modified and extended upon
|
uint32 trader_id;
|
||||||
*
|
uint32 zone_id;
|
||||||
* Base repository methods are automatically
|
uint32 entity_id;
|
||||||
* generated in the "base" version of this repository. The base repository
|
std::string trader_name;
|
||||||
* is immutable and to be left untouched, while methods in this class
|
};
|
||||||
* are used as extension methods for more specific persistence-layer
|
|
||||||
* accessors or mutators.
|
|
||||||
*
|
|
||||||
* Base Methods (Subject to be expanded upon in time)
|
|
||||||
*
|
|
||||||
* Note: Not all tables are designed appropriately to fit functionality with all base methods
|
|
||||||
*
|
|
||||||
* InsertOne
|
|
||||||
* UpdateOne
|
|
||||||
* DeleteOne
|
|
||||||
* FindOne
|
|
||||||
* GetWhere(std::string where_filter)
|
|
||||||
* DeleteWhere(std::string where_filter)
|
|
||||||
* InsertMany
|
|
||||||
* All
|
|
||||||
*
|
|
||||||
* Example custom methods in a repository
|
|
||||||
*
|
|
||||||
* TraderRepository::GetByZoneAndVersion(int zone_id, int zone_version)
|
|
||||||
* TraderRepository::GetWhereNeverExpires()
|
|
||||||
* TraderRepository::GetWhereXAndY()
|
|
||||||
* TraderRepository::DeleteWhereXAndY()
|
|
||||||
*
|
|
||||||
* Most of the above could be covered by base methods, but if you as a developer
|
|
||||||
* find yourself re-using logic for other parts of the code, its best to just make a
|
|
||||||
* method that can be re-used easily elsewhere especially if it can use a base repository
|
|
||||||
* method and encapsulate filters there
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Custom extended repository methods here
|
struct BulkTraders_Struct {
|
||||||
|
uint32 count{0};
|
||||||
|
uint32 name_length{0};
|
||||||
|
std::vector<DistinctTraders_Struct> traders{};
|
||||||
|
};
|
||||||
|
|
||||||
|
struct WelcomeData_Struct {
|
||||||
|
uint32 count_of_traders;
|
||||||
|
uint32 count_of_items;
|
||||||
|
};
|
||||||
|
|
||||||
|
static std::vector<BazaarSearchResultsFromDB_Struct>
|
||||||
|
GetBazaarSearchResults(
|
||||||
|
SharedDatabase &db,
|
||||||
|
BazaarSearchCriteria_Struct search,
|
||||||
|
uint32 char_zone_id
|
||||||
|
);
|
||||||
|
|
||||||
|
static BulkTraders_Struct GetDistinctTraders(Database &db)
|
||||||
|
{
|
||||||
|
BulkTraders_Struct all_entries{};
|
||||||
|
std::vector<DistinctTraders_Struct> distinct_traders;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
"SELECT DISTINCT(t.char_id), t.char_zone_id, t.char_entity_id, c.name "
|
||||||
|
"FROM trader AS t "
|
||||||
|
"JOIN character_data AS c ON t.char_id = c.id;"
|
||||||
|
);
|
||||||
|
|
||||||
|
distinct_traders.reserve(results.RowCount());
|
||||||
|
|
||||||
|
for (auto row: results) {
|
||||||
|
DistinctTraders_Struct e{};
|
||||||
|
|
||||||
|
e.trader_id = Strings::ToInt(row[0]);
|
||||||
|
e.zone_id = Strings::ToInt(row[1]);
|
||||||
|
e.entity_id = Strings::ToInt(row[2]);
|
||||||
|
e.trader_name = row[3] ? row[3] : "";
|
||||||
|
all_entries.name_length += e.trader_name.length() + 1;
|
||||||
|
|
||||||
|
all_entries.traders.push_back(e);
|
||||||
|
}
|
||||||
|
all_entries.count = results.RowCount();
|
||||||
|
return all_entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
static WelcomeData_Struct GetWelcomeData(Database &db)
|
||||||
|
{
|
||||||
|
WelcomeData_Struct e{};
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase("SELECT COUNT(DISTINCT char_id), count(char_id) FROM trader;");
|
||||||
|
|
||||||
|
if (!results.RowCount()) {
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto r = results.begin();
|
||||||
|
e.count_of_traders = Strings::ToInt(r[0]);
|
||||||
|
e.count_of_items = Strings::ToInt(r[1]);
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int UpdateItem(Database &db, uint32 char_id, uint32 new_price, uint32 item_id, uint32 item_charges)
|
||||||
|
{
|
||||||
|
std::vector<BaseTraderRepository::Trader> items{};
|
||||||
|
if (item_charges == 0) {
|
||||||
|
items = GetWhere(
|
||||||
|
db,
|
||||||
|
fmt::format(
|
||||||
|
"char_id = '{}' AND item_id = '{}'",
|
||||||
|
char_id,
|
||||||
|
item_id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
items = GetWhere(
|
||||||
|
db,
|
||||||
|
fmt::format(
|
||||||
|
"char_id = '{}' AND item_id = '{}' AND item_charges = '{}'",
|
||||||
|
char_id,
|
||||||
|
item_id,
|
||||||
|
item_charges
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (items.empty()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto &i: items) {
|
||||||
|
i.item_cost = new_price;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ReplaceMany(db, items);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Trader GetTraderItem(Database &db, uint32 trader_id, uint32 item_id, uint32 item_cost)
|
||||||
|
{
|
||||||
|
Trader item{};
|
||||||
|
|
||||||
|
auto query = fmt::format(
|
||||||
|
"SELECT t.char_id, t.item_id, t.serialnumber, t.charges, t.item_cost, t.slot_id, t.entity_id FROM trader AS t "
|
||||||
|
"WHERE t.entity_id = {} AND t.item_id = {} AND t.item_cost = {} "
|
||||||
|
"LIMIT 1;",
|
||||||
|
trader_id,
|
||||||
|
item_id,
|
||||||
|
item_cost
|
||||||
|
);
|
||||||
|
auto results = db.QueryDatabase(query);
|
||||||
|
|
||||||
|
if (results.RowCount() == 0) {
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto row = results.begin();
|
||||||
|
item.char_id = Strings::ToInt(row[0]);
|
||||||
|
item.item_id = Strings::ToInt(row[1]);
|
||||||
|
item.item_sn = Strings::ToInt(row[2]);
|
||||||
|
item.item_charges = Strings::ToInt(row[3]);
|
||||||
|
item.item_cost = Strings::ToInt(row[4]);
|
||||||
|
item.slot_id = Strings::ToInt(row[5]);
|
||||||
|
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int UpdateQuantity(Database &db, uint32 char_id, uint32 serial_number, int16 quantity)
|
||||||
|
{
|
||||||
|
const auto trader_item = GetWhere(
|
||||||
|
db,
|
||||||
|
fmt::format("char_id = '{}' AND item_sn = '{}' ", char_id, serial_number)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (trader_item.empty() || trader_item.size() > 1) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto m = trader_item[0];
|
||||||
|
m.item_charges = quantity;
|
||||||
|
|
||||||
|
return UpdateOne(db, m);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Trader GetItemBySerialNumber(Database &db, uint32 serial_number)
|
||||||
|
{
|
||||||
|
Trader e{};
|
||||||
|
const auto trader_item = GetWhere(
|
||||||
|
db,
|
||||||
|
fmt::format("`item_sn` = '{}' LIMIT 1", serial_number)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (trader_item.empty()) {
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return trader_item.at(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static Trader GetItemBySerialNumber(Database &db, std::string serial_number)
|
||||||
|
{
|
||||||
|
Trader e{};
|
||||||
|
auto sn = Strings::ToUnsignedBigInt(serial_number);
|
||||||
|
const auto trader_item = GetWhere(
|
||||||
|
db,
|
||||||
|
fmt::format("`item_sn` = '{}' LIMIT 1", sn)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (trader_item.empty()) {
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return trader_item.at(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static int UpdateActiveTransaction(Database &db, uint32 id, bool status)
|
||||||
|
{
|
||||||
|
auto e = FindOne(db, id);
|
||||||
|
if (!e.id) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.active_transaction = status == true ? 1 : 0;
|
||||||
|
|
||||||
|
return UpdateOne(db, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int DeleteMany(Database &db, const std::vector<Trader> &entries)
|
||||||
|
{
|
||||||
|
std::vector<std::string> delete_ids;
|
||||||
|
|
||||||
|
for (auto const &e: entries) {
|
||||||
|
delete_ids.push_back(std::to_string(e.id));
|
||||||
|
}
|
||||||
|
|
||||||
|
return DeleteWhere(db, fmt::format("`id` IN({})", Strings::Implode(",", delete_ids)));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //EQEMU_TRADER_REPOSITORY_H
|
#endif //EQEMU_TRADER_REPOSITORY_H
|
||||||
|
|||||||
+41
-2
@@ -329,6 +329,8 @@ RULE_BOOL(World, UseItemLinksForKeyRing, false, "Uses item links for Key Ring Li
|
|||||||
RULE_BOOL(World, UseOldShadowKnightClassExport, true, "Disable to have Shadowknight show as Shadow Knight (live-like)")
|
RULE_BOOL(World, UseOldShadowKnightClassExport, true, "Disable to have Shadowknight show as Shadow Knight (live-like)")
|
||||||
RULE_STRING(World, IPExemptionZones, "", "Comma-delimited list of zones to exclude from IP-limit checks. Empty string to disable.")
|
RULE_STRING(World, IPExemptionZones, "", "Comma-delimited list of zones to exclude from IP-limit checks. Empty string to disable.")
|
||||||
RULE_STRING(World, MOTD, "", "Server MOTD sent on login, change from empty to have this be used instead of variables table 'motd' value")
|
RULE_STRING(World, MOTD, "", "Server MOTD sent on login, change from empty to have this be used instead of variables table 'motd' value")
|
||||||
|
RULE_STRING(World, Rules, "", "Server Rules, change from empty to have this be used instead of variables table 'rules' value, lines are pipe (|) separated, example: A|B|C")
|
||||||
|
RULE_BOOL(World, EnableAutoLogin, false, "Enables or disables auto login of characters, allowing people to log characters in directly from loginserver to ingame")
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
RULE_CATEGORY(Zone)
|
RULE_CATEGORY(Zone)
|
||||||
@@ -354,6 +356,7 @@ RULE_INT(Zone, GlobalLootMultiplier, 1, "Sets Global Loot drop multiplier for da
|
|||||||
RULE_BOOL(Zone, KillProcessOnDynamicShutdown, true, "When process has booted a zone and has hit its zone shut down timer, it will hard kill the process to free memory back to the OS")
|
RULE_BOOL(Zone, KillProcessOnDynamicShutdown, true, "When process has booted a zone and has hit its zone shut down timer, it will hard kill the process to free memory back to the OS")
|
||||||
RULE_INT(Zone, SpawnEventMin, 3, "When strict is set in spawn_events, specifies the max EQ minutes into the trigger hour a spawn_event will fire. Going below 3 may cause the spawn_event to not fire.")
|
RULE_INT(Zone, SpawnEventMin, 3, "When strict is set in spawn_events, specifies the max EQ minutes into the trigger hour a spawn_event will fire. Going below 3 may cause the spawn_event to not fire.")
|
||||||
RULE_INT(Zone, ForageChance, 25, "Chance of foraging from zone table vs global table")
|
RULE_INT(Zone, ForageChance, 25, "Chance of foraging from zone table vs global table")
|
||||||
|
RULE_INT(Zone, FishingChance, 399, "Chance of fishing from zone table vs global table")
|
||||||
RULE_BOOL(Zone, AllowCrossZoneSpellsOnBots, false, "Set to true to allow cross zone spells (cast/remove) to affect bots")
|
RULE_BOOL(Zone, AllowCrossZoneSpellsOnBots, false, "Set to true to allow cross zone spells (cast/remove) to affect bots")
|
||||||
RULE_BOOL(Zone, AllowCrossZoneSpellsOnMercs, false, "Set to true to allow cross zone spells (cast/remove) to affect mercenaries")
|
RULE_BOOL(Zone, AllowCrossZoneSpellsOnMercs, false, "Set to true to allow cross zone spells (cast/remove) to affect mercenaries")
|
||||||
RULE_BOOL(Zone, AllowCrossZoneSpellsOnPets, false, "Set to true to allow cross zone spells (cast/remove) to affect pets")
|
RULE_BOOL(Zone, AllowCrossZoneSpellsOnPets, false, "Set to true to allow cross zone spells (cast/remove) to affect pets")
|
||||||
@@ -449,7 +452,8 @@ RULE_BOOL(Spells, Jun182014HundredHandsRevamp, false, "This should be true for i
|
|||||||
RULE_BOOL(Spells, SwarmPetTargetLock, false, "Use old method of swarm pets target locking till target dies then despawning")
|
RULE_BOOL(Spells, SwarmPetTargetLock, false, "Use old method of swarm pets target locking till target dies then despawning")
|
||||||
RULE_BOOL(Spells, NPC_UseFocusFromSpells, true, "Allow NPC to use most spell derived focus effects")
|
RULE_BOOL(Spells, NPC_UseFocusFromSpells, true, "Allow NPC to use most spell derived focus effects")
|
||||||
RULE_BOOL(Spells, NPC_UseFocusFromItems, false, "Allow NPC to use most item derived focus effects")
|
RULE_BOOL(Spells, NPC_UseFocusFromItems, false, "Allow NPC to use most item derived focus effects")
|
||||||
RULE_BOOL(Spells, UseAdditiveFocusFromWornSlot, false, "Allows an additive focus effect to be calculated from worn slot")
|
RULE_BOOL(Spells, UseAdditiveFocusFromWornSlot, false, "Allows an additive focus effect to be calculated from worn slot. Does not apply limits checks. Can only have one additive focus rule be true.")
|
||||||
|
RULE_BOOL(Spells, UseAdditiveFocusFromWornSlotWithLimits, false, "Allows an additive focus effect to be calculated from worn slot. Applies normal limit checks. Can only have one additive focus rule be true.")
|
||||||
RULE_BOOL(Spells, AlwaysSendTargetsBuffs, false, "Ignore Leadership Alternate Abilities level if true")
|
RULE_BOOL(Spells, AlwaysSendTargetsBuffs, false, "Ignore Leadership Alternate Abilities level if true")
|
||||||
RULE_BOOL(Spells, FlatItemExtraSpellAmt, false, "Allow SpellDmg stat to affect all spells, regardless of cast time/cooldown/etc")
|
RULE_BOOL(Spells, FlatItemExtraSpellAmt, false, "Allow SpellDmg stat to affect all spells, regardless of cast time/cooldown/etc")
|
||||||
RULE_BOOL(Spells, IgnoreSpellDmgLvlRestriction, false, "Ignore the 5 level spread on applying SpellDmg")
|
RULE_BOOL(Spells, IgnoreSpellDmgLvlRestriction, false, "Ignore the 5 level spread on applying SpellDmg")
|
||||||
@@ -501,12 +505,15 @@ RULE_BOOL(Spells, ManaTapsRequireNPCMana, false, "Enabling will require target t
|
|||||||
RULE_INT(Spells, HarmTouchCritRatio, 200, "Harmtouch crit bonus, on top of BaseCritRatio")
|
RULE_INT(Spells, HarmTouchCritRatio, 200, "Harmtouch crit bonus, on top of BaseCritRatio")
|
||||||
RULE_BOOL(Spells, UseClassicSpellFocus, false, "Enabling will tell the server to handle random focus damage as classic spell imports lack the limit values.")
|
RULE_BOOL(Spells, UseClassicSpellFocus, false, "Enabling will tell the server to handle random focus damage as classic spell imports lack the limit values.")
|
||||||
RULE_BOOL(Spells, ManaTapsOnAnyClass, false, "Enabling this will allow you to cast mana taps on any class, this will bypass ManaTapsRequireNPCMana rule.")
|
RULE_BOOL(Spells, ManaTapsOnAnyClass, false, "Enabling this will allow you to cast mana taps on any class, this will bypass ManaTapsRequireNPCMana rule.")
|
||||||
|
RULE_INT(Spells, HealAmountMessageFilterThreshold, 100, "Lifetaps below this threshold will not have a message sent to the client (Heal will still process) 0 to Disable.")
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
RULE_CATEGORY(Combat)
|
RULE_CATEGORY(Combat)
|
||||||
RULE_REAL(Combat, AERampageMaxDistance, 70, "Max AERampage range (% of max combat distance)")
|
RULE_REAL(Combat, AERampageMaxDistance, 70, "Max AERampage range (% of max combat distance)")
|
||||||
RULE_INT(Combat, PetBaseCritChance, 0, "Pet base crit chance")
|
RULE_INT(Combat, PetBaseCritChance, 0, "Pet base crit chance")
|
||||||
RULE_INT(Combat, NPCBashKickLevel, 6, "The level that NPCcan KICK/BASH")
|
RULE_INT(Combat, NPCBashKickLevel, 6, "The level that NPCcan KICK/BASH")
|
||||||
|
RULE_INT(Combat, NPCKickStunLevel, 1, "The level that NPC has a chance to stun with kick.")
|
||||||
|
RULE_INT(Combat, PCKickStunLevel, 56, "The level that PC has a chance to stun with kick.")
|
||||||
RULE_INT(Combat, MeleeCritDifficulty, 8900, "Value against which is rolled to check if a melee crit is triggered. Lower is easier")
|
RULE_INT(Combat, MeleeCritDifficulty, 8900, "Value against which is rolled to check if a melee crit is triggered. Lower is easier")
|
||||||
RULE_INT(Combat, ArcheryCritDifficulty, 3400, "Value against which is rolled to check if an archery crit is triggered. Lower is easier")
|
RULE_INT(Combat, ArcheryCritDifficulty, 3400, "Value against which is rolled to check if an archery crit is triggered. Lower is easier")
|
||||||
RULE_INT(Combat, ThrowingCritDifficulty, 1100, "Value against which is rolled to check if a throwing crit is triggered. Lower is easier")
|
RULE_INT(Combat, ThrowingCritDifficulty, 1100, "Value against which is rolled to check if a throwing crit is triggered. Lower is easier")
|
||||||
@@ -514,6 +521,8 @@ RULE_BOOL(Combat, NPCCanCrit, false, "Setting whether an NPC can land critical h
|
|||||||
RULE_BOOL(Combat, UseIntervalAC, true, "Switch whether bonuses, armour class, multipliers, classes and caps should be considered in the calculation of damage values")
|
RULE_BOOL(Combat, UseIntervalAC, true, "Switch whether bonuses, armour class, multipliers, classes and caps should be considered in the calculation of damage values")
|
||||||
RULE_INT(Combat, PetAttackMagicLevel, 10, "Level at which pets can cause magic damage, no longer used")
|
RULE_INT(Combat, PetAttackMagicLevel, 10, "Level at which pets can cause magic damage, no longer used")
|
||||||
RULE_INT(Combat, NPCAttackMagicLevel, 10, "Level at which NPC and pets can cause magic damage")
|
RULE_INT(Combat, NPCAttackMagicLevel, 10, "Level at which NPC and pets can cause magic damage")
|
||||||
|
RULE_INT(Combat, LevelDifferenceRollCheck, -1, "Level Difference to enable LeverDifferenceRollBonus for MeleeMitigation - Default: -1 is disabled, 20 is common")
|
||||||
|
RULE_REAL(Combat, LevelDifferenceRollBonus, 0.5, "Roll Bonus/Detrement if using LevelDifferenceRollCheck")
|
||||||
RULE_BOOL(Combat, EnableFearPathing, true, "Setting whether to use pathing during fear")
|
RULE_BOOL(Combat, EnableFearPathing, true, "Setting whether to use pathing during fear")
|
||||||
RULE_BOOL(Combat, FleeGray, true, "If true FleeGrayHPRatio will be used")
|
RULE_BOOL(Combat, FleeGray, true, "If true FleeGrayHPRatio will be used")
|
||||||
RULE_INT(Combat, FleeGrayHPRatio, 50, "HP percentage when a Gray NPC begins to flee")
|
RULE_INT(Combat, FleeGrayHPRatio, 50, "HP percentage when a Gray NPC begins to flee")
|
||||||
@@ -527,6 +536,7 @@ RULE_REAL(Combat, BaseProcChance, 0.035, "Base chance for procs")
|
|||||||
RULE_REAL(Combat, ProcDexDivideBy, 11000, "Divisor for the probability of a proc increased by dexterity")
|
RULE_REAL(Combat, ProcDexDivideBy, 11000, "Divisor for the probability of a proc increased by dexterity")
|
||||||
RULE_INT(Combat, MinRangedAttackDist, 25, "Minimum Distance to use Ranged Attacks")
|
RULE_INT(Combat, MinRangedAttackDist, 25, "Minimum Distance to use Ranged Attacks")
|
||||||
RULE_BOOL(Combat, ArcheryBonusRequiresStationary, true, "does the 2x archery bonus chance require a stationary npc")
|
RULE_BOOL(Combat, ArcheryBonusRequiresStationary, true, "does the 2x archery bonus chance require a stationary npc")
|
||||||
|
RULE_INT(Combat, ArcheryBonusLevelRequirement, 51, "Level requirement when the 2x archery bonus will be enabled. The default is 51.")
|
||||||
RULE_REAL(Combat, ArcheryNPCMultiplier, 1.0, "Value is multiplied by the regular dmg to get the archery dmg")
|
RULE_REAL(Combat, ArcheryNPCMultiplier, 1.0, "Value is multiplied by the regular dmg to get the archery dmg")
|
||||||
RULE_BOOL(Combat, AssistNoTargetSelf, true, "When assisting a target that does not have a target: true = target self, false = leave target as was before assist (false = live like)")
|
RULE_BOOL(Combat, AssistNoTargetSelf, true, "When assisting a target that does not have a target: true = target self, false = leave target as was before assist (false = live like)")
|
||||||
RULE_INT(Combat, MaxRampageTargets, 3, "Maximum number of people hit with rampage")
|
RULE_INT(Combat, MaxRampageTargets, 3, "Maximum number of people hit with rampage")
|
||||||
@@ -575,11 +585,15 @@ RULE_BOOL(Combat, NPCsUseFrontalStunImmunityClasses, false, "Enable or disable N
|
|||||||
RULE_INT(Combat, FrontalStunImmunityRaces, 512, "Bitmask for Races than have frontal stun immunity, Ogre (512) only by default.")
|
RULE_INT(Combat, FrontalStunImmunityRaces, 512, "Bitmask for Races than have frontal stun immunity, Ogre (512) only by default.")
|
||||||
RULE_BOOL(Combat, NPCsUseFrontalStunImmunityRaces, true, "Enable or disable NPCs using frontal stun immunity Races from Combat:FrontalStunImmunityRaces, true by default.")
|
RULE_BOOL(Combat, NPCsUseFrontalStunImmunityRaces, true, "Enable or disable NPCs using frontal stun immunity Races from Combat:FrontalStunImmunityRaces, true by default.")
|
||||||
RULE_BOOL(Combat, AssassinateOnlyHumanoids, true, "Enable or disable Assassinate only being allowed on Humanoids, true by default.")
|
RULE_BOOL(Combat, AssassinateOnlyHumanoids, true, "Enable or disable Assassinate only being allowed on Humanoids, true by default.")
|
||||||
|
RULE_INT(Combat, AssassinateLevelRequirement, 60, "Level requirement to enable assassinate attempts on backstabs. The default is 60.")
|
||||||
RULE_BOOL(Combat, HeadshotOnlyHumanoids, true, "Enable or disable Headshot only being allowed on Humanoids, true by default.")
|
RULE_BOOL(Combat, HeadshotOnlyHumanoids, true, "Enable or disable Headshot only being allowed on Humanoids, true by default.")
|
||||||
RULE_BOOL(Combat, EnableWarriorShielding, true, "Enable or disable Warrior Shielding Ability (/shield), true by default.")
|
RULE_BOOL(Combat, EnableWarriorShielding, true, "Enable or disable Warrior Shielding Ability (/shield), true by default.")
|
||||||
RULE_BOOL(Combat, BackstabIgnoresElemental, false, "Enable or disable Elemental weapon damage affecting backstab damage, false by default.")
|
RULE_BOOL(Combat, BackstabIgnoresElemental, false, "Enable or disable Elemental weapon damage affecting backstab damage, false by default.")
|
||||||
RULE_BOOL(Combat, BackstabIgnoresBane, false, "Enable or disable Bane weapon damage affecting backstab damage, false by default.")
|
RULE_BOOL(Combat, BackstabIgnoresBane, false, "Enable or disable Bane weapon damage affecting backstab damage, false by default.")
|
||||||
|
RULE_INT(Combat, DoubleBackstabLevelRequirement, 55, "Level requirement to enable double backstab attempts. The default is 55.")
|
||||||
RULE_BOOL(Combat, SummonMeleeRange, true, "Enable or disable summoning of a player when already in melee range of the summoner.")
|
RULE_BOOL(Combat, SummonMeleeRange, true, "Enable or disable summoning of a player when already in melee range of the summoner.")
|
||||||
|
RULE_REAL(Combat, ArcheryHitPenalty, 0, "Archery has a hit penalty to try to help balance it with the plethora of long term +hit modifiers for it - Default: 0")
|
||||||
|
RULE_REAL(Combat, ArcheryBaseDamageBonus, 1, "Percentage modifier to base archery Damage 0.5=50% base damage, 1=100%,2=200% - Default: 1")
|
||||||
RULE_BOOL(Combat, WaterMatchRequiredForAutoFireLoS, true, "Enable/Disable the requirement of both the attacker/victim being both in or out of water for AutoFire LoS to pass.")
|
RULE_BOOL(Combat, WaterMatchRequiredForAutoFireLoS, true, "Enable/Disable the requirement of both the attacker/victim being both in or out of water for AutoFire LoS to pass.")
|
||||||
RULE_INT(Combat, ExtraAllowedKickClassesBitmask, 0, "Bitmask for allowing extra classes beyond Warrior, Ranger, Beastlord, and Berserker to kick, No Extra Classes (0) by default")
|
RULE_INT(Combat, ExtraAllowedKickClassesBitmask, 0, "Bitmask for allowing extra classes beyond Warrior, Ranger, Beastlord, and Berserker to kick, No Extra Classes (0) by default")
|
||||||
RULE_INT(Combat, MaxProcs, 4, "Adjustable maximum number of procs per round, the hard cap is MAX_PROCS (11). Requires mob repop or client zone when changed")
|
RULE_INT(Combat, MaxProcs, 4, "Adjustable maximum number of procs per round, the hard cap is MAX_PROCS (11). Requires mob repop or client zone when changed")
|
||||||
@@ -590,8 +604,16 @@ RULE_INT(Combat, ClassicTripleAttackChanceMonk, 100, "Innate Chance for Monk to
|
|||||||
RULE_INT(Combat, ClassicTripleAttackChanceBerserker, 100, "Innate Chance for Berserker to Triple Attack after a Double Attack (200 = 20%). DEFAULT: 100")
|
RULE_INT(Combat, ClassicTripleAttackChanceBerserker, 100, "Innate Chance for Berserker to Triple Attack after a Double Attack (200 = 20%). DEFAULT: 100")
|
||||||
RULE_INT(Combat, ClassicTripleAttackChanceRanger, 100, "Innate Chance for Ranger to Triple Attack after a Double Attack (200 = 20%). DEFAULT: 100")
|
RULE_INT(Combat, ClassicTripleAttackChanceRanger, 100, "Innate Chance for Ranger to Triple Attack after a Double Attack (200 = 20%). DEFAULT: 100")
|
||||||
RULE_INT(Combat, StunChance, 12, "Percent chance that client will be stunned when mob is behind player. DEFAULT: 12")
|
RULE_INT(Combat, StunChance, 12, "Percent chance that client will be stunned when mob is behind player. DEFAULT: 12")
|
||||||
|
RULE_INT(Combat, StunDuration, 2000, "Duration of stuns in ms. DEFAULT: 2000")
|
||||||
|
RULE_BOOL(Combat, ClientStunMessage, false, "Client stunning NPC produces message. DEFAULT false")
|
||||||
RULE_BOOL(Combat, BashTwoHanderUseShoulderAC, false, "Enable to use shoulder AC for bash calculations when two hander is equipped. Unproven if accurate DEFAULT: false")
|
RULE_BOOL(Combat, BashTwoHanderUseShoulderAC, false, "Enable to use shoulder AC for bash calculations when two hander is equipped. Unproven if accurate DEFAULT: false")
|
||||||
RULE_REAL(Combat, BashACBonusDivisor, 25.0, "this divides the AC value contribution to bash damage, lower to increase damage")
|
RULE_REAL(Combat, BashACBonusDivisor, 25.0, "this divides the AC value contribution to bash damage, lower to increase damage")
|
||||||
|
RULE_BOOL(Combat, UseMobStaticOffenseSkill, false, "Toggle to enabled the use of a static offense skill for Mobs. DEFAULT: false")
|
||||||
|
RULE_BOOL(Combat, UseEnhancedMobStaticWeaponSkill, false, "Toggle to enabled the use of an enhanced (slightly higher hit rate) static weapon skill for Mobs. DEFAULT: false")
|
||||||
|
RULE_INT(Combat, PCAttackPowerScaling, 100, "Applies scaling to PC Attack Power (75 = 75%). DEFAULT: 100 to not adjust existing Servers")
|
||||||
|
RULE_INT(Combat, PCAccuracyAvoidanceMod2Scale, 100, "Scale Factor for PC Accuracy and Avoidance (Mod2, found on items). Found a value of 100 to make both too strong (75 = x0.75). DEFAULT: 100 to not adjust existing Servers")
|
||||||
|
RULE_BOOL(Combat, AllowRaidTargetBlind, false, "Toggle to allow raid targets to be blinded, default is false (Live-like)")
|
||||||
|
RULE_BOOL(Combat, RogueBackstabHasteCorrection, false, "Toggle to enable correction for Haste impacting Backstab DPS too much. DEFAULT: false")
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
RULE_CATEGORY(NPC)
|
RULE_CATEGORY(NPC)
|
||||||
@@ -650,6 +672,8 @@ RULE_BOOL(Aggro, NPCAggroMaxDistanceEnabled, true, "If enabled, NPC's will drop
|
|||||||
RULE_BOOL(Aggro, AggroPlayerPets, false, "If enabled, NPCs will aggro player pets")
|
RULE_BOOL(Aggro, AggroPlayerPets, false, "If enabled, NPCs will aggro player pets")
|
||||||
RULE_BOOL(Aggro, UndeadAlwaysAggro, true, "should undead always aggro?")
|
RULE_BOOL(Aggro, UndeadAlwaysAggro, true, "should undead always aggro?")
|
||||||
RULE_INT(Aggro, BardAggroCap, 40, "per song bard aggro cap.")
|
RULE_INT(Aggro, BardAggroCap, 40, "per song bard aggro cap.")
|
||||||
|
RULE_INT(Aggro, InitialAggroBonus, 100, "Initial Aggro Bonus, Default: 100")
|
||||||
|
RULE_INT(Aggro, InitialPetAggroBonus, 100, "Initial Pet Aggro Bonus, Default 100")
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
RULE_CATEGORY(TaskSystem)
|
RULE_CATEGORY(TaskSystem)
|
||||||
@@ -714,7 +738,7 @@ RULE_BOOL(Bots, BotHealOnLevel, false, "Setting whether a bot should heal comple
|
|||||||
RULE_INT(Bots, AutosaveIntervalSeconds, 300, "Number of seconds after which a timer is triggered which stores the bot data. The value 0 means no periodic automatic saving.")
|
RULE_INT(Bots, AutosaveIntervalSeconds, 300, "Number of seconds after which a timer is triggered which stores the bot data. The value 0 means no periodic automatic saving.")
|
||||||
RULE_BOOL(Bots, CazicTouchBotsOwner, true, "Default True. Cazic Touch/DT will hit bot owner rather than bot.")
|
RULE_BOOL(Bots, CazicTouchBotsOwner, true, "Default True. Cazic Touch/DT will hit bot owner rather than bot.")
|
||||||
RULE_INT(Bots, BotsClickItemsMinLvl, 1, "Minimum level for bots to be able to use ^clickitem. Default 1.")
|
RULE_INT(Bots, BotsClickItemsMinLvl, 1, "Minimum level for bots to be able to use ^clickitem. Default 1.")
|
||||||
RULE_BOOL(Bots, BotsCanClickItems, true, "Enabled the ability for bots to click items they have equipped. Default TRUE")
|
RULE_BOOL(Bots, BotsCanClickItems, true, "Enables the ability for bots to click items they have equipped. Default TRUE")
|
||||||
RULE_BOOL(Bots, CanClickMageEpicV1, true, "Whether or not bots are allowed to click Mage Epic 1.0. Default TRUE")
|
RULE_BOOL(Bots, CanClickMageEpicV1, true, "Whether or not bots are allowed to click Mage Epic 1.0. Default TRUE")
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
@@ -743,6 +767,7 @@ RULE_CATEGORY_END()
|
|||||||
|
|
||||||
RULE_CATEGORY(Merchant)
|
RULE_CATEGORY(Merchant)
|
||||||
RULE_BOOL(Merchant, UsePriceMod, true, "Use faction/charisma price modifiers")
|
RULE_BOOL(Merchant, UsePriceMod, true, "Use faction/charisma price modifiers")
|
||||||
|
RULE_BOOL(Merchant, UseClassicPriceMod, false, "Must also set UsePriceMod. Negates other rules for vendor price mods.")
|
||||||
RULE_REAL(Merchant, SellCostMod, 1.05, "Modifier for NPC sell price")
|
RULE_REAL(Merchant, SellCostMod, 1.05, "Modifier for NPC sell price")
|
||||||
RULE_REAL(Merchant, BuyCostMod, 0.95, "Modifier for NPC buy price")
|
RULE_REAL(Merchant, BuyCostMod, 0.95, "Modifier for NPC buy price")
|
||||||
RULE_INT(Merchant, PriceBonusPct, 4, "Determines maximum price bonus from having good faction/CHA. Value is a percent")
|
RULE_INT(Merchant, PriceBonusPct, 4, "Determines maximum price bonus from having good faction/CHA. Value is a percent")
|
||||||
@@ -758,6 +783,9 @@ RULE_BOOL(Bazaar, AuditTrail, false, "Setting whether a path to the trader shoul
|
|||||||
RULE_INT(Bazaar, MaxSearchResults, 50, "Maximum number of search results in Bazaar")
|
RULE_INT(Bazaar, MaxSearchResults, 50, "Maximum number of search results in Bazaar")
|
||||||
RULE_BOOL(Bazaar, EnableWarpToTrader, true, "Setting whether teleport to the selected trader should be active")
|
RULE_BOOL(Bazaar, EnableWarpToTrader, true, "Setting whether teleport to the selected trader should be active")
|
||||||
RULE_INT(Bazaar, MaxBarterSearchResults, 200, "The maximum results returned in the /barter search")
|
RULE_INT(Bazaar, MaxBarterSearchResults, 200, "The maximum results returned in the /barter search")
|
||||||
|
RULE_REAL(Bazaar, ParcelDeliveryCostMod, 0.20, "Cost of parcel delivery for a bazaar purchase as a percentage of item cost. Default is 20% of item cost. RoF+ Only.")
|
||||||
|
RULE_INT(Bazaar, VoucherDeliveryCost, 200, "Number of vouchers for direct delivery for a bazaar purchase. Default is 200 vouchers. RoF+ Only.")
|
||||||
|
RULE_BOOL(Bazaar, EnableParcelDelivery, true, "Enable bazaar purchases via parcel delivery. Default is True.")
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
RULE_CATEGORY(Mail)
|
RULE_CATEGORY(Mail)
|
||||||
@@ -802,6 +830,7 @@ RULE_INT(AA, ModernAAScalingAAMinimum, 0, "The minimum number of earned AA befor
|
|||||||
RULE_INT(AA, ModernAAScalingAALimit, 4000, "The number of earned AA when AA experience scaling ends")
|
RULE_INT(AA, ModernAAScalingAALimit, 4000, "The number of earned AA when AA experience scaling ends")
|
||||||
RULE_BOOL(AA, SoundForAAEarned, false, "Play sound when AA point earned")
|
RULE_BOOL(AA, SoundForAAEarned, false, "Play sound when AA point earned")
|
||||||
RULE_INT(AA, UnusedAAPointCap, -1, "Cap for Unused AA Points. Default: -1. NOTE: DO NOT LOWER THIS WITHOUT KNOWING WHAT YOU ARE DOING. MAY RESULT IN PLAYERS LOSING AAs.")
|
RULE_INT(AA, UnusedAAPointCap, -1, "Cap for Unused AA Points. Default: -1. NOTE: DO NOT LOWER THIS WITHOUT KNOWING WHAT YOU ARE DOING. MAY RESULT IN PLAYERS LOSING AAs.")
|
||||||
|
RULE_INT(AA, MaxAAEXPPerKill, -1, "Maximum AA EXP per Kill (3425214 is about 7%) - Default: -1 will disable the check")
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
RULE_CATEGORY(Console)
|
RULE_CATEGORY(Console)
|
||||||
@@ -952,6 +981,16 @@ RULE_BOOL(Items, DisablePotionBelt, false, "Enable this to disable Potion Belt I
|
|||||||
RULE_BOOL(Items, DisableSpellFocusEffects, false, "Enable this to disable Spell Focus Effects on Items")
|
RULE_BOOL(Items, DisableSpellFocusEffects, false, "Enable this to disable Spell Focus Effects on Items")
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
|
RULE_CATEGORY(Parcel)
|
||||||
|
RULE_BOOL(Parcel, EnableParcelMerchants, true, "Enable or Disable Parcel Merchants. Requires RoF+ Clients.")
|
||||||
|
RULE_BOOL(Parcel, EnableDirectToInventoryDelivery, false, "Enable or Disable RoF2 bazaar purchases to be delivered directly to the buyer's inventory.")
|
||||||
|
RULE_BOOL(Parcel, DeleteOnDuplicate, false, "Delete retrieved item if it creates a lore conflict.")
|
||||||
|
RULE_BOOL(Parcel, EnablePruning, false, "Enable the automatic pruning of sent parcels. Uses rule ParcelPruneDelay for prune delay.")
|
||||||
|
RULE_INT(Parcel, ParcelDeliveryDelay, 30000, "Sets the time that a player must wait between sending parcels.")
|
||||||
|
RULE_INT(Parcel, ParcelMaxItems, 50, "The maximum number of parcels a player is allowed to have in their mailbox.")
|
||||||
|
RULE_INT(Parcel, ParcelPruneDelay, 30, "The number of days after which a parcel is deleted. Items are lost!")
|
||||||
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
#undef RULE_CATEGORY
|
#undef RULE_CATEGORY
|
||||||
#undef RULE_INT
|
#undef RULE_INT
|
||||||
#undef RULE_REAL
|
#undef RULE_REAL
|
||||||
|
|||||||
+3
-2
@@ -348,7 +348,7 @@ std::string EQ::SayLinkEngine::InjectSaylinksIfNotExist(const char *message)
|
|||||||
if (ch != startpos)
|
if (ch != startpos)
|
||||||
{
|
{
|
||||||
std::string str(startpos, ch - startpos);
|
std::string str(startpos, ch - startpos);
|
||||||
new_message += EQ::SayLinkEngine::GenerateQuestSaylink(str, false, str);
|
new_message += Saylink::Create(str);
|
||||||
}
|
}
|
||||||
in_bracket_state = false;
|
in_bracket_state = false;
|
||||||
}
|
}
|
||||||
@@ -422,6 +422,7 @@ std::string Saylink::Create(const std::string &saylink_text, bool silent, const
|
|||||||
return EQ::SayLinkEngine::GenerateQuestSaylink(saylink_text, silent, (link_name.empty() ? saylink_text : link_name));
|
return EQ::SayLinkEngine::GenerateQuestSaylink(saylink_text, silent, (link_name.empty() ? saylink_text : link_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Saylink::Silent(const std::string &saylink_text, const std::string &link_name) {
|
std::string Saylink::Silent(const std::string& saylink_text, const std::string& link_name)
|
||||||
|
{
|
||||||
return EQ::SayLinkEngine::GenerateQuestSaylink(saylink_text, true, (link_name.empty() ? saylink_text : link_name));
|
return EQ::SayLinkEngine::GenerateQuestSaylink(saylink_text, true, (link_name.empty() ? saylink_text : link_name));
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -130,7 +130,7 @@ namespace EQ
|
|||||||
|
|
||||||
class Saylink {
|
class Saylink {
|
||||||
public:
|
public:
|
||||||
static std::string Create(const std::string &saylink_text, bool silent, const std::string &link_name = "");
|
static std::string Create(const std::string &saylink_text, bool silent = false, const std::string &link_name = "");
|
||||||
static std::string Silent(const std::string &saylink_text, const std::string &link_name = "");
|
static std::string Silent(const std::string &saylink_text, const std::string &link_name = "");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user