mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-23 13:12:28 +00:00
Compare commits
533 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0b24d4ff84 | |||
| c330904695 | |||
| 2fbd5aaccc | |||
| 06104b624a | |||
| ee55755c85 | |||
| d042b0831a | |||
| 5f0d3e9026 | |||
| ea48acbf0b | |||
| b37c75630b | |||
| fb1228946a | |||
| 94606504af | |||
| c799267c86 | |||
| 5e0ab3e37c | |||
| e64526920c | |||
| dc9bd031ff | |||
| 7113c9236e | |||
| 13d4bbcae2 | |||
| 857b24727c | |||
| 4d93406176 | |||
| 0e6a0b5a70 | |||
| 12c4b20169 | |||
| 90e6bb8a8a | |||
| 518bcb58d3 | |||
| 0aa8d90e9e | |||
| e453f3e6ed | |||
| e719992267 | |||
| e2a7d4f33f | |||
| 8b999a63a4 | |||
| 914ea27406 | |||
| 7f3e4e3438 | |||
| 5471774b4c | |||
| 572ad1b6ab | |||
| 0a42ded33f | |||
| ca50013334 | |||
| 0b03f27660 | |||
| 263ed3913b | |||
| 2bcaf2a476 | |||
| 855e592d22 | |||
| 954247956e | |||
| 387e1668a5 | |||
| 5989edb6ec | |||
| 54d494da36 | |||
| d6af1b566f | |||
| 89f5b0b71e | |||
| 5ce1fef9ec | |||
| 874ca053f7 | |||
| 21ed02ca52 | |||
| 5d4e53bb25 | |||
| b8e7e5bb0d | |||
| 15f3697df1 | |||
| 16cfad1966 | |||
| bffeee8d1a | |||
| d29c0fc332 | |||
| a031c20e7e | |||
| 67d3cab80b | |||
| b41f2dac66 | |||
| b5b473f25d | |||
| 0dc3e5ba35 | |||
| 499fe153ab | |||
| d1349e5ac9 | |||
| bd8e94ff17 | |||
| d89b2f11b5 | |||
| 88ff56b2f2 | |||
| 1728923bbb | |||
| cbd1f42a08 | |||
| f8735cf9ba | |||
| eb00667eab | |||
| cbc0ada454 | |||
| 54b33f959e | |||
| c6e4b5647f | |||
| 928070e994 | |||
| 40ef4c799b | |||
| 8ba7ddd054 | |||
| 973fd376e5 | |||
| b5575133cd | |||
| 6f846dc4ff | |||
| 0461fc1789 | |||
| aa6264266e | |||
| c3cbe90575 | |||
| c2c6282cc7 | |||
| fab071d9da | |||
| 358bd60716 | |||
| 03ca345b37 | |||
| 6ddcc2bb8a | |||
| 02cac686b6 | |||
| 4c348baabd | |||
| 035bac1044 | |||
| 5a8d467d25 | |||
| ae959be5ac | |||
| 4157a03f32 | |||
| 41d0b1a947 | |||
| 3c71e2c91d | |||
| 80d1601754 | |||
| cfcbfea3ab | |||
| 7aa8db76f4 | |||
| 561433902e | |||
| abeb93f1e6 | |||
| ef0b29dc8e | |||
| 42f959329d | |||
| a898a1d07b | |||
| 803c3aabe4 | |||
| 15dde4778a | |||
| f2b68e6783 | |||
| 8193b04627 | |||
| 47e56f9381 | |||
| 58b9b719f4 | |||
| a4bf484c74 | |||
| 4712b56078 | |||
| 9362890d26 | |||
| 6d3848b2c7 | |||
| 8974059577 | |||
| 963735e7dd | |||
| c94a2496ca | |||
| ceb8b31bc0 | |||
| 51b31b5e53 | |||
| 6fb6d8891d | |||
| d4ea9bbee0 | |||
| 3a7908b1de | |||
| 99c1c826a8 | |||
| 1b888784eb | |||
| 52a25c3b78 | |||
| 4b08ce1237 | |||
| b94fdda429 | |||
| a48153baa1 | |||
| e26b159efe | |||
| a2b381bc9e | |||
| 60e194e32b | |||
| 1cdf507b9f | |||
| 3e98e60877 | |||
| af5022b3db | |||
| 52d2469da2 | |||
| e431c56f7c | |||
| 0ab7291625 | |||
| e384cf6149 | |||
| 463c0d9e0e | |||
| 0f92287c02 | |||
| 6a61fd5df9 | |||
| dac7541d89 | |||
| e7266943e2 | |||
| 7f25f8a235 | |||
| 240d5c2a66 | |||
| 785804a936 | |||
| e451dad94e | |||
| 08414bda55 | |||
| c39978d3d8 | |||
| f3d8271066 | |||
| 431a325414 | |||
| c42d6dcd1b | |||
| fa12b146a3 | |||
| e7fab67d8a | |||
| 6438a37fb5 | |||
| 899e2d3397 | |||
| 53be04c39c | |||
| bfecd6ad14 | |||
| dd1470892d | |||
| d4a1ea82dc | |||
| 8d252dfd9a | |||
| 1577f2823b | |||
| cede38f562 | |||
| 201757567c | |||
| 2a9248697e | |||
| 3708efd8df | |||
| 1d907564e9 | |||
| 1b15ee141d | |||
| d838ac9582 | |||
| dce5dea609 | |||
| 581d5b1289 | |||
| 4915e86aba | |||
| 09e9c0b504 | |||
| a3eb74b855 | |||
| fb396e9f60 | |||
| d85469dff9 | |||
| 3f7ce5df72 | |||
| d5b3dc7c0a | |||
| ac3b4ade10 | |||
| 482584f95a | |||
| 57e7b4a2b8 | |||
| 7f6414d685 | |||
| 81e91d7956 | |||
| 3875485567 | |||
| eb104e40de | |||
| bec33e22da | |||
| ac104ed4e0 | |||
| 0ffb5c46a5 | |||
| 92638504db | |||
| 08002eacea | |||
| 79248cffec | |||
| 8787f51b58 | |||
| 69f4d90737 | |||
| 1371e1e7ed | |||
| 81ff7f5d57 | |||
| 8376ed5d3f | |||
| fe4a0cfdba | |||
| 0043f56984 | |||
| 6ddc5ea8e8 | |||
| be38a62d70 | |||
| fdc38315d3 | |||
| e7c000813f | |||
| 6fb0042e3f | |||
| 0a4429c0c0 | |||
| a63dc7d5e0 | |||
| 67449de27e | |||
| 10e5f0e949 | |||
| 141ecca2bc | |||
| bd4fa4fb6b | |||
| 5901df4485 | |||
| 8cda4257b4 | |||
| 709a25ba9e | |||
| ed09d4ae54 | |||
| 952fd43301 | |||
| 5f8d193d6a | |||
| a4a70cf225 | |||
| 29fccd9239 | |||
| cdc82f0ba7 | |||
| 78756f27b6 | |||
| 2f5909d4cb | |||
| 13c2df7eb1 | |||
| 16ac6f624b | |||
| 501204a4d2 | |||
| 8bcef6c2e7 | |||
| 2db47adf7b | |||
| 916c88939c | |||
| 1528e7cb09 | |||
| 8dacadb4f9 | |||
| e19db3b7f4 | |||
| e1adffc4be | |||
| 7eb71c5902 | |||
| da397606b6 | |||
| 6b27e88315 | |||
| 4accb4ea2a | |||
| c419df52ff | |||
| 46ff09f438 | |||
| b4f42c150f | |||
| 49134644bc | |||
| 861b879a94 | |||
| 929e4c1317 | |||
| 138cb80b19 | |||
| 86b6f543b9 | |||
| d7138e84c0 | |||
| 2d24cdf5e4 | |||
| 4416e774c2 | |||
| 342012c4f4 | |||
| 34005cd2ed | |||
| 6bc6b659d5 | |||
| ad1f18306b | |||
| 6a984a53b5 | |||
| f9b3b7aecf | |||
| 5fefdfcc17 | |||
| 00f118cfb4 | |||
| a7633f4ddf | |||
| f742d6427b | |||
| d65a97e556 | |||
| b8229c8459 | |||
| 424b669cbb | |||
| e09b0ae1e9 | |||
| c2300d514c | |||
| f195820854 | |||
| 59903313e4 | |||
| b351d3718a | |||
| ab3d65b2ea | |||
| b02e87cce7 | |||
| 50a39057e4 | |||
| c8e6d031cf | |||
| 158d8a011f | |||
| 14c070f845 | |||
| 6dee837f67 | |||
| 83ad9c86db | |||
| bcb08f99f0 | |||
| f968d0df4c | |||
| 712366293d | |||
| 9689787e56 | |||
| 92d32feb0d | |||
| 371265d143 | |||
| 43da07fb55 | |||
| f880663528 | |||
| 63b8df72b2 | |||
| c82d08cf11 | |||
| c6ba29f2e5 | |||
| 6514ccc41c | |||
| 2f49266d08 | |||
| ff897dc90a | |||
| f73f72b2b2 | |||
| c2b3e85272 | |||
| c590cf7c35 | |||
| 453bee511a | |||
| 1baeb01e65 | |||
| 8b37ef5e67 | |||
| caceae1028 | |||
| 8e6dd638ff | |||
| 51fb7d8b77 | |||
| f6ed4bb888 | |||
| 9cc73f2b4a | |||
| 6f73278cf8 | |||
| 6c91786cfb | |||
| 8eb60302a2 | |||
| 43df845233 | |||
| feefd7a23b | |||
| 5a1eac010b | |||
| d47bf6a73b | |||
| daa9c04e89 | |||
| a9ef2474d4 | |||
| e1408ede6b | |||
| 4241fba7e2 | |||
| 139b6c34e5 | |||
| baf4cc62eb | |||
| 14402c9c41 | |||
| e4c4e5edb2 | |||
| e6a14beb2e | |||
| 945ca1278c | |||
| a307747c29 | |||
| 099da513ff | |||
| 607379110b | |||
| 7ce88b30ad | |||
| 28b0526857 | |||
| d5067c4c3a | |||
| 79db824a3c | |||
| 331032f4f4 | |||
| 61790ef195 | |||
| 9bdb70b2f0 | |||
| c438819ed6 | |||
| 7a791dda3c | |||
| 6366a3fa38 | |||
| 306a08b9ac | |||
| 467f8d7867 | |||
| 6c2100a650 | |||
| 9dacd0bd7a | |||
| 3c6cdd0905 | |||
| d1fb74ff5f | |||
| f81b9d8244 | |||
| b9e87abb3c | |||
| 451b0180c9 | |||
| 77ae4f0c3f | |||
| 852d951b65 | |||
| 4e8aec136e | |||
| eed4a648b4 | |||
| 720d314bb8 | |||
| e5ec277b5e | |||
| 47aa23e21e | |||
| 8ad11d0f85 | |||
| 6243a31644 | |||
| 958a6d939e | |||
| e27c4f4f7c | |||
| 662048cedc | |||
| 9dda9098a0 | |||
| 3a10131a00 | |||
| a94072e3ea | |||
| 40595de46b | |||
| d6d361f5eb | |||
| c48e8d8823 | |||
| 61d1c2d75c | |||
| 69d887b421 | |||
| e7ad57a37e | |||
| d50e5855c4 | |||
| 689493610f | |||
| 406b193206 | |||
| 6e4d9a915d | |||
| 3e0ded6c39 | |||
| 9a08b1be93 | |||
| d71afda954 | |||
| a9e4d1212e | |||
| a7479a628c | |||
| 67562e3e42 | |||
| 53a289a6bc | |||
| a5d41b02b7 | |||
| 0232a8a188 | |||
| 78d63165cb | |||
| ccce630cb2 | |||
| 59b2d18a95 | |||
| 54f73d7420 | |||
| 0f9c34cf3c | |||
| e531e68b6d | |||
| 233f26996b | |||
| ec5faea9b1 | |||
| 6b465c576d | |||
| 9481e9eb2d | |||
| b11528fbcc | |||
| 2f564d9651 | |||
| 4b6a1242f5 | |||
| 5fee9b2b3e | |||
| f9e822072f | |||
| 0643df3dbe | |||
| 8cb51eb253 | |||
| 07fd803d41 | |||
| 255c755169 | |||
| 77feaa9ac1 | |||
| fe18033b5d | |||
| 995fb6914e | |||
| 6c35611cd0 | |||
| 8a038e17e5 | |||
| 7678a905c8 | |||
| 80d8736276 | |||
| 20538e91a1 | |||
| 72f4f10dbb | |||
| c173936e32 | |||
| 71a1142f6b | |||
| f542913041 | |||
| 4695aa30ad | |||
| b222a619d7 | |||
| d23dccec82 | |||
| 25bd285be5 | |||
| af80b51bd3 | |||
| 4fa14e44aa | |||
| 4b69f56a65 | |||
| 2ab0ce19a7 | |||
| 8ef6feac9f | |||
| bc4e09cea4 | |||
| 81acd797b4 | |||
| c87b4f2ad4 | |||
| e050534378 | |||
| 2c8b51fcda | |||
| 0cb425b6dd | |||
| bd6e06aadb | |||
| ed67b461ea | |||
| 4e6018e3e8 | |||
| 1196abfda8 | |||
| efd710855e | |||
| ab35c3ed90 | |||
| e306e9ad0c | |||
| 08b8deaa4b | |||
| 326e1be09f | |||
| 7e724568a6 | |||
| 9910b07a4e | |||
| 35fe27eb5d | |||
| 86593798a9 | |||
| b8623bf6df | |||
| c90326f585 | |||
| a0de61a781 | |||
| a325a9978b | |||
| 40747ae5a3 | |||
| 598204d75c | |||
| 5fbda48c54 | |||
| b56bc29388 | |||
| b567e57971 | |||
| 9ced3270a0 | |||
| 0fcaf82038 | |||
| 05b3c89729 | |||
| e46fcdd48a | |||
| ea414a279e | |||
| 1553e44efb | |||
| 4437eef957 | |||
| 6b201fcbef | |||
| 8f3689e023 | |||
| c646942ed1 | |||
| 7de655ba76 | |||
| 6f83a39765 | |||
| 0bbf9d518e | |||
| 06ca5b009d | |||
| e788779be0 | |||
| 5f3d3a3539 | |||
| f402e96b96 | |||
| f012d13f0c | |||
| 147be47088 | |||
| 397619e2f9 | |||
| cd7584f512 | |||
| ed7ce38fe0 | |||
| dff23793c6 | |||
| 10c383fd86 | |||
| 2a8ab28551 | |||
| 769df9ce7b | |||
| b1704377da | |||
| c90bed9f69 | |||
| 40c835c576 | |||
| 15609ab1e8 | |||
| 316507adaf | |||
| 384b1b89c7 | |||
| 01b3b41bae | |||
| e2630d2b20 | |||
| dadeb01045 | |||
| 31914eb0b6 | |||
| a7bcc12eb6 | |||
| 566e6ea307 | |||
| 96e5adc8de | |||
| 6609728188 | |||
| 74ca949a5b | |||
| 194c61a467 | |||
| 3e50332c23 | |||
| 454a5c4527 | |||
| 135eaae402 | |||
| 8f5bd52e24 | |||
| 62be0c475e | |||
| 1c6971da4a | |||
| ff59255e63 | |||
| 653801a54b | |||
| 6a393afdf3 | |||
| b0efe88a03 | |||
| 7eb2e834b1 | |||
| 754ed71f9a | |||
| 4f538fbdad | |||
| 99ee4e04d9 | |||
| 7989451c36 | |||
| 4c9c070d67 | |||
| 058a722569 | |||
| 1d460bd636 | |||
| 47ee5b5afb | |||
| 7edfdbd9db | |||
| b9f57f1f28 | |||
| 579471afcc | |||
| 04e7238a6e | |||
| 0e9fae3181 | |||
| 37d4371acd | |||
| bcf0af0a8d | |||
| abd14f556a | |||
| 3c345b9a9c | |||
| 895c8626b6 | |||
| 2965ab28e2 | |||
| 259bce9509 | |||
| 316d645f33 | |||
| 135b4aac34 | |||
| 8ae76bc217 | |||
| 3128453eb6 | |||
| bd64d8e6b3 | |||
| 276804604c | |||
| 836f842f23 | |||
| 4fbce7d5d6 | |||
| 34cb51c449 | |||
| 5ce71b7923 | |||
| 9520499103 | |||
| 5a852d4780 | |||
| 712e403528 | |||
| 581a0ec212 | |||
| bb02af2548 | |||
| 852cc9119e | |||
| 72a922f2ba | |||
| 6da0f84e18 | |||
| b2dd3df1e2 | |||
| 3ec500244e | |||
| 4425e3ab49 | |||
| 413c006785 | |||
| ae3052fbd1 | |||
| f6c8d9532e | |||
| 5f23a72a16 | |||
| 26eb4fb6e0 | |||
| 8be23a1214 |
@@ -0,0 +1,21 @@
|
||||
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
|
||||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.101.1/containers/ubuntu-18.04-git
|
||||
{
|
||||
"name": "Ubuntu 18.04 EQEMU",
|
||||
// Moved from dockerfile to image so it builds faster
|
||||
"image": "eqemu/devcontainer:0.0.2",
|
||||
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/bash"
|
||||
},
|
||||
|
||||
"runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],
|
||||
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": ["ms-vscode.cpptools", "ms-azuretools.vscode-docker"],
|
||||
"mounts": ["source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"],
|
||||
"remoteEnv": {
|
||||
"HOST_PROJECT_PATH": "${localWorkspaceFolder}"
|
||||
}
|
||||
}
|
||||
+22
-1
@@ -17,6 +17,8 @@
|
||||
*.out
|
||||
*.app
|
||||
|
||||
.bash_history
|
||||
|
||||
# CMake
|
||||
CMakeCache.txt
|
||||
CMakeFiles
|
||||
@@ -27,9 +29,28 @@ install_manifest.txt
|
||||
log/
|
||||
logs/
|
||||
vcpkg/
|
||||
perl/
|
||||
|
||||
.idea/*
|
||||
*cbp
|
||||
|
||||
submodules/*
|
||||
cmake-build-debug/
|
||||
cmake-build-debug/
|
||||
|
||||
.nfs.*
|
||||
|
||||
# Visual Studio and CMAKE Generated Files
|
||||
/.vs/
|
||||
*.vcxproj
|
||||
*.vcxproj.filters
|
||||
*.vcxproj.user
|
||||
*.cmake
|
||||
*.ilk
|
||||
*.pdb
|
||||
*.sln
|
||||
*.dir/
|
||||
libs/
|
||||
bin/
|
||||
/Win32
|
||||
/x64
|
||||
/client_files/**/CMakeFiles/
|
||||
|
||||
+11
-19
@@ -1,26 +1,18 @@
|
||||
language: cpp
|
||||
compiler: gcc
|
||||
dist: trusty
|
||||
dist: bionic
|
||||
|
||||
before_install:
|
||||
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
||||
- sudo apt-get update -qq
|
||||
- mkdir $HOME/usr
|
||||
- export PATH="$HOME/usr/bin:$PATH"
|
||||
- wget https://cmake.org/files/v3.11/cmake-3.11.2-Linux-x86_64.sh
|
||||
- chmod +x cmake-3.11.2-Linux-x86_64.sh
|
||||
- ./cmake-3.11.2-Linux-x86_64.sh --prefix=$HOME/usr --exclude-subdir --skip-license
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libmysqlclient-dev
|
||||
- libperl-dev
|
||||
- libboost-dev
|
||||
- liblua5.1-0-dev
|
||||
- zlib1g-dev
|
||||
- uuid-dev
|
||||
- libssl-dev
|
||||
|
||||
install:
|
||||
- sudo apt-get install -qq g++-7
|
||||
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 90
|
||||
- sudo apt-get install libmysqlclient-dev
|
||||
- sudo apt-get install libperl-dev
|
||||
- sudo apt-get install libboost-dev
|
||||
- sudo apt-get install liblua5.1-0-dev
|
||||
- sudo apt-get install zlib1g-dev
|
||||
- sudo apt-get install uuid-dev
|
||||
- sudo apt-get install libssl-dev
|
||||
script:
|
||||
- cmake -G "Unix Makefiles" -DEQEMU_BUILD_TESTS=ON -DEQEMU_ENABLE_BOTS=ON -DEQEMU_BUILD_LOGIN=ON
|
||||
- make -j2
|
||||
|
||||
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Linux",
|
||||
"includePath": [
|
||||
"${workspaceFolder}/**",
|
||||
"/usr/include/mysql"
|
||||
],
|
||||
"defines": [],
|
||||
"compilerPath": "/usr/bin/gcc",
|
||||
"cStandard": "c11",
|
||||
"cppStandard": "c++17"
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
Vendored
+155
@@ -0,0 +1,155 @@
|
||||
{
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||
// for the documentation about the tasks.json format
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "make",
|
||||
"type": "shell",
|
||||
"command": "cd build && make",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"problemMatcher": [
|
||||
"$gcc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "make clean",
|
||||
"type": "shell",
|
||||
"command": "cd build && make clean",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"problemMatcher": [
|
||||
"$gcc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "cmake",
|
||||
"type": "shell",
|
||||
"command": "mkdir -p build && cd build && rm CMakeCache.txt && cmake -DEQEMU_BUILD_LOGIN=ON -DEQEMU_BUILD_LUA=ON -G 'Unix Makefiles' ..",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"problemMatcher":{
|
||||
"owner": "cpp",
|
||||
"fileLocation": "relative",
|
||||
"pattern":[
|
||||
{
|
||||
"regexp": "([\\w+|\\\\]*\\.\\w+)\\((\\d+)\\)\\: (warning|error) (.*)$",
|
||||
"file": 1,
|
||||
"location": 2,
|
||||
"severity": 3,
|
||||
"message": 4
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "download maps",
|
||||
"type": "shell",
|
||||
"command": "mkdir -p build/bin && cd build/bin && wget https://codeload.github.com/Akkadius/EQEmuMaps/zip/master -O maps.zip && unzip -o maps.zip && rm ./maps -rf && mv EQEmuMaps-master maps && rm maps.zip",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"problemMatcher": [
|
||||
"$gcc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "download quests",
|
||||
"type": "shell",
|
||||
"command": "mkdir -p build/bin && cd build/bin && cd server && git -C ./quests pull 2> /dev/null || git clone https://github.com/ProjectEQ/projecteqquests.git quests",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"problemMatcher": [
|
||||
"$gcc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "download eqemu_config",
|
||||
"type": "shell",
|
||||
"command": "mkdir -p build/bin && cd build/bin && wget --no-check-certificate https://raw.githubusercontent.com/Akkadius/EQEmuInstall/master/eqemu_config_docker.json -O eqemu_config.json",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"problemMatcher": [
|
||||
"$gcc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "rebuild database (mariadb must be started)",
|
||||
"type": "shell",
|
||||
"command": "mkdir -p build/bin && cd build/bin && docker run -i --rm --privileged -v ${HOST_PROJECT_PATH}/build/bin:/src --network=eqemu -it eqemu/server:0.0.3 bash -c './eqemu_server.pl source_peq_db && ./eqemu_server.pl check_db_updates && ./eqemu_server.pl linux_login_server_setup'",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"problemMatcher": [
|
||||
"$gcc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "zone 7000",
|
||||
"type": "shell",
|
||||
"command": "docker stop zone7000 | true && docker network create eqemu | true && docker run -i --rm --name zone7000 --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged -v ${HOST_PROJECT_PATH}/build/bin:/src --ulimit core=10000000 --network=eqemu -p 7000:7000/udp -e LD_LIBRARY_PATH=/src/ eqemu/server:0.0.3 gdb -ex run --args ./zone dynamic_zone7000:7000",
|
||||
"group": {
|
||||
"kind": "test",
|
||||
"isDefault": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "zone 7001",
|
||||
"type": "shell",
|
||||
"command": "docker stop zone7001 | true && docker network create eqemu | true && docker run -i --rm --name zone7001 --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged -v ${HOST_PROJECT_PATH}/build/bin:/src --ulimit core=10000000 --network=eqemu -p 7001:7001/udp -e LD_LIBRARY_PATH=/src/ eqemu/server:0.0.3 gdb -ex run --args ./zone dynamic_zone7001:7001",
|
||||
"group": {
|
||||
"kind": "test",
|
||||
"isDefault": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "loginserver",
|
||||
"type": "shell",
|
||||
"command": "docker stop loginserver | true && docker network create eqemu | true && docker run -i --rm --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged -v ${HOST_PROJECT_PATH}/build/bin:/src --ulimit core=10000000 --network=eqemu --name loginserver -p 5999:5999/udp -p 5998:5998/udp -e LD_LIBRARY_PATH=/src/ eqemu/server:0.0.3 gdb -ex run --args ./loginserver",
|
||||
"group": {
|
||||
"kind": "test",
|
||||
"isDefault": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "shared_memory, world",
|
||||
"type": "shell",
|
||||
"command": "docker stop sharedmemory | true && docker stop world | true && docker network create eqemu | true && docker run --rm -v ${HOST_PROJECT_PATH}/build/bin:/src --network=eqemu --name sharedmemory eqemu/server:0.0.3 ./shared_memory && docker run --rm -v ${HOST_PROJECT_PATH}/build/bin:/src --ulimit core=10000000 -e LD_LIBRARY_PATH=/src/ --network=eqemu --name world -p 9000:9000 -p 9000:9000/udp -p 9001:9001 -p 9080:9080 eqemu/server:0.0.3 gdb -ex run ./world",
|
||||
"group": {
|
||||
"kind": "test",
|
||||
"isDefault": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "queryserv",
|
||||
"type": "shell",
|
||||
"command": "docker stop queryserv | true && docker run --rm -v ${HOST_PROJECT_PATH}/build/bin:/src --ulimit core=10000000 -e LD_LIBRARY_PATH=/src/ --network=eqemu --name queryserv eqemu/server:0.0.3 gdb -ex run ./queryserv",
|
||||
"group": {
|
||||
"kind": "test",
|
||||
"isDefault": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "mariadb",
|
||||
"type": "shell",
|
||||
"command": "docker stop mariadb | true && cd build/bin && docker network create eqemu | true && docker run --rm -v ${HOST_PROJECT_PATH}/build/bin/db:/bitnami/mariadb -p 3306:3306 -e MARIADB_DATABASE=peq -e MARIADB_USER=eqemu -e MARIADB_PASSWORD=eqemupass -e ALLOW_EMPTY_PASSWORD=yes --name mariadb --network=eqemu bitnami/mariadb:latest",
|
||||
"group": {
|
||||
"kind": "test",
|
||||
"isDefault": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
# Guide To Building From Source Without Installer
|
||||
|
||||
This guide is far from exhaustive, you should expect to have some experience with building C++ code before considering compiling the code from scratch. You should instead consider using the installer scripts if you don't want to hack on the code directly.
|
||||
|
||||
### CMake
|
||||
|
||||
EQEmu uses CMake as the build system on all platforms. You will need CMake 3.2 or higher to build from source.
|
||||
|
||||
### Dependencies
|
||||
|
||||
The following libraries are required to build from source:
|
||||
- [boost](https://www.boost.org/ "boost")
|
||||
- [zlib](https://www.zlib.net/ "zlib") (If not included the source will build [zlib-ng](https://github.com/zlib-ng/zlib-ng "zlib-ng") instead)
|
||||
- [libmysql](https://dev.mysql.com/downloads/connector/c/ "libmysql") or [libmariadb](https://github.com/MariaDB/mariadb-connector-c "libmariadb")
|
||||
|
||||
The following libraries are not strictly required but in many cased recommended.
|
||||
- [OpenSSL](https://www.openssl.org/ "OpenSSL") or [mbedTLS](https://tls.mbed.org/ "mbedTLS") (Required for the loginserver and headless client)
|
||||
- [libsodium](https://github.com/jedisct1/libsodium "libsodium") (Required for strong password hashing on the loginserver)
|
||||
- [Lua 5.1](https://www.lua.org/ "Lua 5.1") or [LuaJit](http://luajit.org/ "LuaJit") (Required for Lua Quest Scripting)
|
||||
- [Perl](https://www.perl.org/ "Perl") (Required for Perl Quest Scripting)
|
||||
|
||||
##### Windows
|
||||
For windows it is suggested you make use of [vcpkg](https://github.com/microsoft/vcpkg "vcpkg") if you wish to build your own dependencies.
|
||||
|
||||
If you wish to use Perl then you should use whichever version of Perl you have installed on the target system.
|
||||
|
||||
You can also download a vcpkg export from our releases section for Visual Studio [x86](https://github.com/EQEmu/Server/releases/download/v1.2/vcpkg-export-x86.zip "x86") or [x64](https://github.com/EQEmu/Server/releases/download/v1.2/vcpkg-export-x64.zip "x64") that includes a toolchain file you can pass to CMake.
|
||||
|
||||
##### Linux
|
||||
For Linux you simply can install the dependencies from your package manager, below is an example of doing it on Ubuntu using apt-get.
|
||||
|
||||
sudo apt-get install libmysqlclient-dev libperl-dev libboost-dev liblua5.1-0-dev zlib1g-dev uuid-dev libssl-dev
|
||||
|
||||
### Running CMake
|
||||
|
||||
##### Windows
|
||||
The following is a modified command our automated build server uses to run CMake via the release vcpkg export and its toolchain file.
|
||||
|
||||
Assuming it is starting in c:/projects/eqemu and the x64 dependencies were extracted to c:/projects/eqemu/vcpkg.
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "Visual Studio 15 2017 Win64" -DEQEMU_BUILD_TESTS=ON -DEQEMU_BUILD_LOGIN=ON -DEQEMU_BUILD_ZLIB=ON -DEQEMU_ENABLE_BOTS=ON -DCMAKE_TOOLCHAIN_FILE="c:/projects/eqemu/vcpkg/vcpkg-export-20180828-145455/scripts/buildsystems/vcpkg.cmake" ..
|
||||
|
||||
##### Linux
|
||||
Similarly to Windows running CMake on Linux is simple it just omits the toolchain file and uses a different generator.
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "Unix Makefiles" -DEQEMU_BUILD_TESTS=ON -DEQEMU_ENABLE_BOTS=ON -DEQEMU_BUILD_LOGIN=ON ..
|
||||
|
||||
### Building
|
||||
|
||||
##### Windows
|
||||
Inside the build directory a file EQEmu.sln should be produced by a successful run of the CMake command. You can either open this with Visual Studio or build it directly with MSBuild via the command line.
|
||||
|
||||
msbuild EQEmu.sln /p:Configuration=Release
|
||||
|
||||
##### Linux
|
||||
From the build directory you can simply call make to build.
|
||||
|
||||
For example.
|
||||
|
||||
make -j4
|
||||
+285
-237
@@ -1,120 +1,28 @@
|
||||
#EQEmu CMake
|
||||
#Variables used:
|
||||
#EQEMU_DISABLE_CRT_SECURE_WARNINGS
|
||||
#EQEMU_FAST_FLOATINGPOINT
|
||||
#EQEMU_ENABLE_CRASH_LOGGING
|
||||
#EQEMU_DISABLE_SAFESEH
|
||||
#EQEMU_BUILD_MSVC_MP
|
||||
#EQEMU_DEBUG_LEVEL
|
||||
#EQEMU_LOG_LEVEL_DEBUG
|
||||
#EQEMU_ENABLE_BOTS
|
||||
#EQEMU_COMMANDS_LOGGING
|
||||
#EQEMU_BUILD_SERVER
|
||||
#EQEMU_BUILD_LOGIN
|
||||
#EQEMU_BUILD_TESTS
|
||||
#EQEMU_BUILD_PERL
|
||||
#EQEMU_BUILD_LUA
|
||||
#EQEMU_SANITIZE_LUA_LIBS
|
||||
#EQEMU_BUILD_CLIENT_FILES
|
||||
#EQEMU_USE_MAP_MMFS
|
||||
#EQEMU_MAP_DIR
|
||||
#EQEMU_ARCH
|
||||
#EQEMU_ARCH_ALT
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.8)
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||
IF(POLICY CMP0074)
|
||||
cmake_policy(SET CMP0074 NEW)
|
||||
ENDIF()
|
||||
|
||||
#FindMySQL is located here so lets make it so CMake can find it
|
||||
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/" ${CMAKE_MODULE_PATH})
|
||||
|
||||
#Our project name is EQEmu
|
||||
IF(POLICY CMP0074)
|
||||
CMAKE_POLICY(SET CMP0074 NEW)
|
||||
ENDIF()
|
||||
|
||||
PROJECT(EQEmu)
|
||||
|
||||
#Default build type is set to RelWithDebInfo for generators that honor that like makefiles
|
||||
IF(NOT CMAKE_BUILD_TYPE)
|
||||
SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE)
|
||||
ENDIF(NOT CMAKE_BUILD_TYPE)
|
||||
|
||||
SET(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/dependencies" "${CMAKE_PREFIX_PATH}")
|
||||
|
||||
#Add our various windows definitions
|
||||
IF(MSVC OR MINGW)
|
||||
ADD_DEFINITIONS(-D_WINDOWS)
|
||||
IF(CMAKE_CL_64)
|
||||
ADD_DEFINITIONS(-DWIN64)
|
||||
ELSE(CMAKE_CL_64)
|
||||
ADD_DEFINITIONS(-DWIN32)
|
||||
ENDIF(CMAKE_CL_64)
|
||||
ENDIF(MSVC OR MINGW)
|
||||
SET(CMAKE_CXX_STANDARD 17)
|
||||
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
SET(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
IF(MSVC)
|
||||
IF(CMAKE_CL_64)
|
||||
SET(EQEMU_ARCH "x64")
|
||||
SET(EQEMU_ARCH_ALT "x64")
|
||||
ELSE(CMAKE_CL_64)
|
||||
SET(EQEMU_ARCH "x86")
|
||||
SET(EQEMU_ARCH_ALT "Win32")
|
||||
ENDIF(CMAKE_CL_64)
|
||||
|
||||
SET(MYSQL_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/mysql_${EQEMU_ARCH}")
|
||||
|
||||
IF(VCPKG_TOOLCHAIN)
|
||||
IF(NOT MSVC_VERSION GREATER 1800)
|
||||
SET(SODIUM_INCLUDE_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/include")
|
||||
ENDIF()
|
||||
ELSE(VCPKG_TOOLCHAIN)
|
||||
SET(ZLIB_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/zlib_${EQEMU_ARCH}")
|
||||
SET(LUA_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/luaj_${EQEMU_ARCH}")
|
||||
SET(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/openssl_${EQEMU_ARCH}")
|
||||
|
||||
SET(SODIUM_INCLUDE_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/include")
|
||||
ENDIF(VCPKG_TOOLCHAIN)
|
||||
|
||||
IF(SODIUM_INCLUDE_HINTS)
|
||||
IF(MSVC_VERSION GREATER 1800)
|
||||
SET(SODIUM_LIBRARY_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/${EQEMU_ARCH_ALT}/Release/v140/dynamic")
|
||||
ELSEIF(MSVC_VERSION EQUAL 1800)
|
||||
SET(SODIUM_LIBRARY_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/${EQEMU_ARCH_ALT}/Release/v120/dynamic")
|
||||
ELSE()
|
||||
SET(SODIUM_LIBRARY_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/${EQEMU_ARCH_ALT}/Release/v110/dynamic")
|
||||
ENDIF()
|
||||
ENDIF(SODIUM_INCLUDE_HINTS)
|
||||
|
||||
#disable CRT warnings on windows cause they're annoying as shit and we use C functions everywhere
|
||||
OPTION(EQEMU_DISABLE_CRT_SECURE_WARNINGS "Disable Secure CRT Warnings" ON)
|
||||
IF(EQEMU_DISABLE_CRT_SECURE_WARNINGS)
|
||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
|
||||
ENDIF(EQEMU_DISABLE_CRT_SECURE_WARNINGS)
|
||||
|
||||
#fast FP if you'd like it
|
||||
OPTION(EQEMU_FAST_FLOATINGPOINT "Use MSVC /fp:fast option" ON)
|
||||
IF(EQEMU_FAST_FLOATINGPOINT)
|
||||
ADD_DEFINITIONS(/fp:fast)
|
||||
ENDIF(EQEMU_FAST_FLOATINGPOINT)
|
||||
|
||||
#crash logging currently only works on windows x86/x64
|
||||
OPTION(EQEMU_ENABLE_CRASH_LOGGING "Enable crash logging" ON)
|
||||
IF(EQEMU_ENABLE_CRASH_LOGGING)
|
||||
ADD_DEFINITIONS(-DCRASH_LOGGING)
|
||||
ENDIF(EQEMU_ENABLE_CRASH_LOGGING)
|
||||
|
||||
OPTION(EQEMU_BUILD_MSVC_MP "Enable build with multiple processes." ON)
|
||||
IF(EQEMU_BUILD_MSVC_MP)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||
ENDIF(EQEMU_BUILD_MSVC_MP)
|
||||
|
||||
#We want to compile /MT not /MD so we change that
|
||||
FOREACH(flag_var CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO)
|
||||
IF(${flag_var} MATCHES "/MD")
|
||||
STRING(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
|
||||
ENDIF(${flag_var} MATCHES "/MD")
|
||||
ENDFOREACH(flag_var)
|
||||
|
||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
|
||||
ADD_DEFINITIONS(-DNOMINMAX)
|
||||
ADD_DEFINITIONS(-DCRASH_LOGGING)
|
||||
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||
ELSE(MSVC)
|
||||
#Normally set by perl but we don't use the perl flags anymore so we set it.
|
||||
ADD_DEFINITIONS(-DHAS_UNION_SEMUN)
|
||||
ENDIF(MSVC)
|
||||
|
||||
@@ -131,160 +39,235 @@ IF(UNIX)
|
||||
ENDIF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
ENDIF(UNIX)
|
||||
|
||||
#debug level, 5 is default. Most people wont ever change this but it's there if you want to
|
||||
SET(EQEMU_DEBUG_LEVEL 5 CACHE STRING "EQEmu debug level:
|
||||
0 - Quiet mode Errors to file Status and Normal ignored
|
||||
1 - Status and Normal to console, Errors to logfile
|
||||
2 - Status, Normal, and Error to console and logfile
|
||||
3 - Light debug release errors and status
|
||||
4 - Moderate debug release errors and status
|
||||
5 - Maximum debug release errors and status
|
||||
10 - More errors than you ever wanted to see"
|
||||
)
|
||||
ADD_DEFINITIONS(-DGLM_FORCE_RADIANS)
|
||||
ADD_DEFINITIONS(-DGLM_FORCE_CTOR_INIT)
|
||||
ADD_DEFINITIONS(-DGLM_ENABLE_EXPERIMENTAL)
|
||||
|
||||
SET(EQEMU_LOG_LEVEL_DEBUG 3 CACHE STRING "EQEmu logging level for [Debug]:
|
||||
0 - Disabled
|
||||
1 - Ouput to File Enabled
|
||||
2 - Output to stdout Enabled
|
||||
3 - Output to File and stdout Enabled
|
||||
8 - Output to stderr Enabled
|
||||
9 - Output to File and stderr Enabled
|
||||
11 - Output to File, stdout and stderr Enabled"
|
||||
)
|
||||
#MSVC can fetch dependencies automatically.
|
||||
IF(MSVC)
|
||||
INCLUDE("${CMAKE_SOURCE_DIR}/cmake/DependencyHelperMSVC.cmake")
|
||||
ENDIF()
|
||||
|
||||
OPTION(EQEMU_LSPX "" OFF)
|
||||
MARK_AS_ADVANCED(EQEMU_LSPX)
|
||||
#Find everything we need
|
||||
FIND_PACKAGE(Boost REQUIRED)
|
||||
FIND_PACKAGE(MySQL)
|
||||
FIND_PACKAGE(MariaDB)
|
||||
FIND_PACKAGE(ZLIB)
|
||||
FIND_PACKAGE(OpenSSL)
|
||||
FIND_PACKAGE(Lua51)
|
||||
FIND_PACKAGE(PerlLibs)
|
||||
FIND_PACKAGE(Sodium)
|
||||
FIND_PACKAGE(mbedTLS)
|
||||
|
||||
MARK_AS_ADVANCED(EQEMU_LOG_LEVEL_DEBUG)
|
||||
MESSAGE(STATUS "**************************************************")
|
||||
MESSAGE(STATUS "* Library Detection *")
|
||||
MESSAGE(STATUS "**************************************************")
|
||||
|
||||
#Bots are a compile time option so on/off
|
||||
IF(MYSQL_FOUND)
|
||||
MESSAGE(STATUS "* MySQL: FOUND *")
|
||||
ELSE()
|
||||
MESSAGE(STATUS "* MySQL: MISSING *")
|
||||
ENDIF()
|
||||
|
||||
IF(MARIADB_FOUND)
|
||||
MESSAGE(STATUS "* MariaDB: FOUND *")
|
||||
ELSE()
|
||||
MESSAGE(STATUS "* MariaDB: MISSING *")
|
||||
ENDIF()
|
||||
|
||||
IF(ZLIB_FOUND)
|
||||
MESSAGE(STATUS "* ZLIB: FOUND *")
|
||||
ELSE()
|
||||
MESSAGE(STATUS "* ZLIB: MISSING *")
|
||||
ENDIF()
|
||||
|
||||
IF(Lua51_FOUND)
|
||||
MESSAGE(STATUS "* Lua: FOUND *")
|
||||
ELSE()
|
||||
MESSAGE(STATUS "* Lua: MISSING *")
|
||||
ENDIF()
|
||||
|
||||
IF(PerlLibs_FOUND)
|
||||
MESSAGE(STATUS "* Perl: FOUND *")
|
||||
ELSE()
|
||||
MESSAGE(STATUS "* Perl: MISSING *")
|
||||
ENDIF()
|
||||
|
||||
IF(SODIUM_FOUND)
|
||||
MESSAGE(STATUS "* libsodium: FOUND *")
|
||||
ELSE()
|
||||
MESSAGE(STATUS "* libsodium: MISSING *")
|
||||
ENDIF()
|
||||
|
||||
IF(OpenSSL_FOUND)
|
||||
MESSAGE(STATUS "* OpenSSL: FOUND *")
|
||||
ELSE()
|
||||
MESSAGE(STATUS "* OpenSSL: MISSING *")
|
||||
ENDIF()
|
||||
|
||||
IF(MBEDTLS_FOUND)
|
||||
MESSAGE(STATUS "* mbedTLS: FOUND *")
|
||||
ELSE()
|
||||
MESSAGE(STATUS "* mbedTLS: MISSING *")
|
||||
ENDIF()
|
||||
|
||||
MESSAGE(STATUS "**************************************************")
|
||||
|
||||
#options
|
||||
OPTION(EQEMU_DEPOP_INVALIDATES_CACHE "#repop invalidates the npc_types cache (will cause a larger database hit on #repop but is more convienent)." ON)
|
||||
OPTION(EQEMU_ENABLE_BOTS "Enable Bots" OFF)
|
||||
|
||||
#Enable GM Command log system
|
||||
OPTION(EQEMU_COMMANDS_LOGGING "Enable GM Command logs" ON)
|
||||
OPTION(EQEMU_BUILD_SERVER "Build the game server." ON)
|
||||
OPTION(EQEMU_BUILD_LOGIN "Build the login server." ON)
|
||||
OPTION(EQEMU_BUILD_HC "Build the headless client." OFF)
|
||||
OPTION(EQEMU_BUILD_TESTS "Build utility tests." OFF)
|
||||
OPTION(EQEMU_BUILD_CLIENT_FILES "Build Client Import/Export Data Programs." ON)
|
||||
|
||||
IF(EQEMU_COMMANDS_LOGGING)
|
||||
ADD_DEFINITIONS(-DCOMMANDS_LOGGING)
|
||||
ENDIF(EQEMU_COMMANDS_LOGGING)
|
||||
|
||||
IF(EQEMU_LSPX)
|
||||
ADD_DEFINITIONS(-DLSPX=ON)
|
||||
ENDIF(EQEMU_LSPX)
|
||||
|
||||
IF(EQEMU_ENABLE_BOTS)
|
||||
ADD_DEFINITIONS(-DBOTS)
|
||||
ENDIF(EQEMU_ENABLE_BOTS)
|
||||
|
||||
#What to build
|
||||
OPTION(EQEMU_BUILD_SERVER "Build the game server." ON)
|
||||
OPTION(EQEMU_BUILD_LOGIN "Build the login server." OFF)
|
||||
OPTION(EQEMU_BUILD_HC "Build the headless client." OFF)
|
||||
OPTION(EQEMU_BUILD_TESTS "Build utility tests." OFF)
|
||||
OPTION(EQEMU_BUILD_PERL "Build Perl parser." ON)
|
||||
OPTION(EQEMU_BUILD_LUA "Build Lua parser." ON)
|
||||
OPTION(EQEMU_BUILD_CLIENT_FILES "Build Client Import/Export Data Programs." ON)
|
||||
|
||||
#C++11 stuff
|
||||
IF(NOT MSVC)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
||||
IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-reserved-user-defined-literal")
|
||||
ENDIF()
|
||||
ENDIF(NOT MSVC)
|
||||
|
||||
#Various definitions
|
||||
IF(EQEMU_BUILD_PERL)
|
||||
ADD_DEFINITIONS(-DEMBPERL)
|
||||
ADD_DEFINITIONS(-DEMBPERL_PLUGIN)
|
||||
ENDIF(EQEMU_BUILD_PERL)
|
||||
IF(EQEMU_BUILD_LUA)
|
||||
ADD_DEFINITIONS(-DLUA_EQEMU)
|
||||
ENDIF(EQEMU_BUILD_LUA)
|
||||
|
||||
#Disabled until reevaluation performed
|
||||
#OPTION(EQEMU_USE_MAP_MMFS "Create and use Zone Map MMF files." OFF)
|
||||
#IF(EQEMU_USE_MAP_MMFS)
|
||||
# ADD_DEFINITIONS(-DUSE_MAP_MMFS)
|
||||
#ENDIF(EQEMU_USE_MAP_MMFS)
|
||||
|
||||
SET(EQEMU_MAP_DIR "./Maps" CACHE STRING "The dir that maps, water maps, and paths are located in.")
|
||||
|
||||
ADD_DEFINITIONS(-DEQDEBUG=${EQEMU_DEBUG_LEVEL})
|
||||
ADD_DEFINITIONS(-DINVERSEXY)
|
||||
ADD_DEFINITIONS(-DFIELD_ITEMS)
|
||||
ADD_DEFINITIONS(-DMAP_DIR="${EQEMU_MAP_DIR}")
|
||||
ADD_DEFINITIONS(-DLOG_LEVEL_DEBUG=${EQEMU_LOG_LEVEL_DEBUG})
|
||||
ADD_DEFINITIONS(-DGLM_FORCE_RADIANS)
|
||||
ADD_DEFINITIONS(-DGLM_FORCE_CTOR_INIT)
|
||||
ADD_DEFINITIONS(-DGLM_ENABLE_EXPERIMENTAL)
|
||||
|
||||
#Find everything we need
|
||||
FIND_PACKAGE(ZLIB)
|
||||
FIND_PACKAGE(MySQL REQUIRED)
|
||||
IF(EQEMU_BUILD_PERL)
|
||||
FIND_PACKAGE(PerlLibs REQUIRED)
|
||||
INCLUDE_DIRECTORIES(SYSTEM "${PERL_INCLUDE_PATH}")
|
||||
ENDIF(EQEMU_BUILD_PERL)
|
||||
|
||||
SET(SERVER_LIBS common debug ${MySQL_LIBRARY_DEBUG} optimized ${MySQL_LIBRARY_RELEASE} uv_a fmt RecastNavigation::Detour)
|
||||
|
||||
FIND_PACKAGE(Sodium REQUIRED)
|
||||
IF(SODIUM_FOUND)
|
||||
OPTION(EQEMU_ENABLE_SECURITY "Use Encryption For TCP Connections" ON)
|
||||
IF(EQEMU_ENABLE_SECURITY)
|
||||
INCLUDE_DIRECTORIES(SYSTEM "${SODIUM_INCLUDE_DIRS}")
|
||||
ADD_DEFINITIONS(-DENABLE_SECURITY)
|
||||
SET(SERVER_LIBS ${SERVER_LIBS} ${SODIUM_LIBRARIES})
|
||||
#database
|
||||
IF(MySQL_FOUND AND MariaDB_FOUND)
|
||||
SET(DATABASE_LIBRARY_SELECTION MySQL CACHE STRING "Database library to use:
|
||||
MySQL
|
||||
MariaDB"
|
||||
)
|
||||
|
||||
IF(DATABASE_LIBRARY_SELECTION STREQUAL "MySQL")
|
||||
SET(DATABASE_LIBRARY_TYPE " MySQL")
|
||||
SET(DATABASE_LIBRARY_LIBS ${MySQL_LIBRARIES})
|
||||
SET(DATABASE_LIBRARY_INCLUDE ${MySQL_INCLUDE_DIR})
|
||||
ELSEIF(DATABASE_LIBRARY_SELECTION STREQUAL "MariaDB")
|
||||
SET(DATABASE_LIBRARY_TYPE "MariaDB")
|
||||
SET(DATABASE_LIBRARY_LIBS ${MariaDB_LIBRARIES})
|
||||
SET(DATABASE_LIBRARY_INCLUDE ${MariaDB_INCLUDE_DIR})
|
||||
ELSE()
|
||||
MESSAGE(FATAL_ERROR "Unknown database library set, should be one of: MySQL, MariaDB")
|
||||
ENDIF()
|
||||
ELSEIF(MariaDB_FOUND)
|
||||
SET(DATABASE_LIBRARY_TYPE "MariaDB")
|
||||
SET(DATABASE_LIBRARY_LIBS ${MariaDB_LIBRARIES})
|
||||
SET(DATABASE_LIBRARY_INCLUDE ${MariaDB_INCLUDE_DIR})
|
||||
ELSEIF(MySQL_FOUND)
|
||||
SET(DATABASE_LIBRARY_TYPE " MySQL")
|
||||
SET(DATABASE_LIBRARY_LIBS ${MySQL_LIBRARIES})
|
||||
SET(DATABASE_LIBRARY_INCLUDE ${MySQL_INCLUDE_DIR})
|
||||
ELSE()
|
||||
MESSAGE(FATAL_ERROR "One of MySQL or MariaDB is a required dependency.")
|
||||
ENDIF()
|
||||
|
||||
IF(ZLIB_FOUND)
|
||||
OPTION(EQEMU_BUILD_ZLIB "Build internal version of zlib." OFF)
|
||||
#security
|
||||
#prefer openssl to mbedtls (arbitrary)
|
||||
IF(OpenSSL_FOUND AND MBEDTLS_FOUND)
|
||||
SET(TLS_LIBRARY_SELECTION OpenSSL CACHE STRING "TLS library to use:
|
||||
OpenSSL
|
||||
mbedTLS"
|
||||
)
|
||||
|
||||
IF(EQEMU_BUILD_ZLIB)
|
||||
INCLUDE_DIRECTORIES(BEFORE SYSTEM "${CMAKE_CURRENT_BINARY_DIR}/libs/zlibng" "${CMAKE_CURRENT_SOURCE_DIR}/libs/zlibng")
|
||||
SET(SERVER_LIBS ${SERVER_LIBS} "zlibstatic")
|
||||
IF(TLS_LIBRARY_SELECTION STREQUAL "OpenSSL")
|
||||
SET(TLS_LIBRARY_TYPE " OpenSSL")
|
||||
SET(TLS_LIBRARY_ENABLED ON)
|
||||
SET(TLS_LIBRARY_LIBS ${OPENSSL_LIBRARIES})
|
||||
SET(TLS_LIBRARY_INCLUDE ${OPENSSL_INCLUDE_DIR})
|
||||
ADD_DEFINITIONS(-DEQEMU_USE_OPENSSL)
|
||||
ELSEIF(TLS_LIBRARY_SELECTION STREQUAL "mbedTLS")
|
||||
SET(TLS_LIBRARY_TYPE " mbedTLS")
|
||||
SET(TLS_LIBRARY_ENABLED ON)
|
||||
SET(TLS_LIBRARY_LIBS ${MBEDTLS_LIBRARY} ${MBEDX509_LIBRARY} ${MBEDCRYPTO_LIBRARY})
|
||||
SET(TLS_LIBRARY_INCLUDE ${MBEDTLS_INCLUDE_DIR})
|
||||
ADD_DEFINITIONS(-DEQEMU_USE_MBEDTLS)
|
||||
ELSE()
|
||||
INCLUDE_DIRECTORIES(SYSTEM "${ZLIB_INCLUDE_DIRS}")
|
||||
SET(SERVER_LIBS ${SERVER_LIBS} ${ZLIB_LIBRARY})
|
||||
MESSAGE(FATAL_ERROR "Unknown TLS library set, should be one of: OpenSSL, mbedTLS")
|
||||
ENDIF()
|
||||
ELSEIF(OpenSSL_FOUND)
|
||||
SET(TLS_LIBRARY_TYPE " OpenSSL")
|
||||
SET(TLS_LIBRARY_ENABLED ON)
|
||||
SET(TLS_LIBRARY_LIBS ${OPENSSL_LIBRARIES})
|
||||
SET(TLS_LIBRARY_INCLUDE ${OPENSSL_INCLUDE_DIR})
|
||||
ADD_DEFINITIONS(-DEQEMU_USE_OPENSSL)
|
||||
ELSEIF(MBEDTLS_FOUND)
|
||||
SET(TLS_LIBRARY_TYPE " mbedTLS")
|
||||
SET(TLS_LIBRARY_ENABLED ON)
|
||||
SET(TLS_LIBRARY_LIBS ${MBEDTLS_LIBRARY} ${MBEDX509_LIBRARY} ${MBEDCRYPTO_LIBRARY})
|
||||
SET(TLS_LIBRARY_INCLUDE ${MBEDTLS_INCLUDE_DIR})
|
||||
ADD_DEFINITIONS(-DEQEMU_USE_MBEDTLS)
|
||||
ELSE()
|
||||
SET(TLS_LIBRARY_TYPE "Disabled")
|
||||
SET(TLS_LIBRARY_ENABLED OFF)
|
||||
ENDIF()
|
||||
|
||||
IF(SODIUM_FOUND)
|
||||
SET(SODIUM_LIBRARY_TYPE "Libsodium")
|
||||
SET(SODIUM_LIBRARY_ENABLED ON)
|
||||
SET(SODIUM_LIBRARY_LIBS ${SODIUM_LIBRARIES})
|
||||
SET(SODIUM_LIBRARY_INCLUDE ${SODIUM_INCLUDE_DIRS})
|
||||
ADD_DEFINITIONS(-DENABLE_SECURITY)
|
||||
ELSE()
|
||||
SET(SODIUM_LIBRARY_TYPE " Disabled")
|
||||
SET(SODIUM_LIBRARY_ENABLED OFF)
|
||||
ENDIF()
|
||||
|
||||
IF(Lua51_FOUND)
|
||||
SET(LUA_LIBRARY_TYPE " Lua 5.1")
|
||||
SET(LUA_LIBRARY_ENABLED ON)
|
||||
SET(LUA_LIBRARY_LIBS ${LUA_LIBRARY} luabind)
|
||||
SET(LUA_LIBRARY_INCLUDE ${LUA_INCLUDE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/libs/luabind")
|
||||
ELSE()
|
||||
SET(LUA_LIBRARY_TYPE "Disabled")
|
||||
SET(LUA_LIBRARY_ENABLED OFF)
|
||||
ENDIF()
|
||||
|
||||
IF(PerlLibs_FOUND)
|
||||
SET(PERL_LIBRARY_TYPE " Perl")
|
||||
SET(PERL_LIBRARY_ENABLED ON)
|
||||
SET(PERL_LIBRARY_LIBS ${PERL_LIBRARY})
|
||||
SET(PERL_LIBRARY_INCLUDE ${PERL_INCLUDE_PATH})
|
||||
ELSE()
|
||||
SET(PERL_LIBRARY_TYPE "Disabled")
|
||||
SET(PERL_LIBRARY_ENABLED OFF)
|
||||
ENDIF()
|
||||
|
||||
#use zlib if exists
|
||||
IF(ZLIB_FOUND)
|
||||
OPTION(EQEMU_BUILD_ZLIB "Build internal version of zlib." ON)
|
||||
IF(EQEMU_BUILD_ZLIB)
|
||||
SET(ZLIB_LIBRARY_TYPE "zlib-ng")
|
||||
SET(ZLIB_LIBRARY_LIBS "zlibstatic")
|
||||
SET(ZLIB_LIBRARY_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/libs/zlibng")
|
||||
ELSE()
|
||||
SET(ZLIB_LIBRARY_TYPE " zlib")
|
||||
SET(ZLIB_LIBRARY_LIBS ${ZLIB_LIBRARY})
|
||||
SET(ZLIB_LIBRARY_INCLUDE ${ZLIB_INCLUDE_DIRS})
|
||||
ENDIF()
|
||||
ELSE()
|
||||
MESSAGE(STATUS "Could NOT find ZLIB - using ZLIBSTATIC package.")
|
||||
SET(EQEMU_BUILD_ZLIB ON)
|
||||
INCLUDE_DIRECTORIES(BEFORE SYSTEM "${CMAKE_CURRENT_BINARY_DIR}/libs/zlibng" "${CMAKE_CURRENT_SOURCE_DIR}/libs/zlibng")
|
||||
SET(SERVER_LIBS ${SERVER_LIBS} "zlibstatic")
|
||||
SET(ZLIB_LIBRARY_TYPE "zlib-ng")
|
||||
SET(ZLIB_LIBRARY_LIBS "zlibstatic")
|
||||
SET(ZLIB_LIBRARY_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/libs/zlibng")
|
||||
ENDIF()
|
||||
|
||||
IF(WIN32)
|
||||
SET(SERVER_LIBS ${SERVER_LIBS} "ws2_32" "psapi" "iphlpapi" "userenv")
|
||||
ENDIF()
|
||||
MESSAGE(STATUS "")
|
||||
MESSAGE(STATUS "**************************************************")
|
||||
MESSAGE(STATUS "* Library Usage *")
|
||||
MESSAGE(STATUS "**************************************************")
|
||||
MESSAGE(STATUS "* Database: ${DATABASE_LIBRARY_TYPE} *")
|
||||
MESSAGE(STATUS "* TLS: ${TLS_LIBRARY_TYPE} *")
|
||||
MESSAGE(STATUS "* Sodium: ${SODIUM_LIBRARY_TYPE} *")
|
||||
MESSAGE(STATUS "* Lua: ${LUA_LIBRARY_TYPE} *")
|
||||
MESSAGE(STATUS "* Perl: ${PERL_LIBRARY_TYPE} *")
|
||||
MESSAGE(STATUS "* zlib: ${ZLIB_LIBRARY_TYPE} *")
|
||||
MESSAGE(STATUS "**************************************************")
|
||||
|
||||
IF(UNIX)
|
||||
SET(SERVER_LIBS ${SERVER_LIBS} ${CMAKE_DL_LIBS} "z" "m" "pthread")
|
||||
IF(NOT DARWIN)
|
||||
SET(SERVER_LIBS ${SERVER_LIBS} "rt")
|
||||
ENDIF()
|
||||
SET(SERVER_LIBS ${SERVER_LIBS} "uuid")
|
||||
ENDIF()
|
||||
#setup server libs and headers
|
||||
SET(SERVER_LIBS common ${DATABASE_LIBRARY_LIBS} ${ZLIB_LIBRARY_LIBS} ${Boost_LIBRARIES} uv_a fmt RecastNavigation::Detour)
|
||||
|
||||
IF(EQEMU_BUILD_LUA)
|
||||
FIND_PACKAGE(EQLua51 REQUIRED)
|
||||
SET(Boost_USE_STATIC_LIBS OFF)
|
||||
SET(Boost_USE_MULTITHREADED ON)
|
||||
SET(Boost_USE_STATIC_RUNTIME OFF)
|
||||
SET(BOOST_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/boost")
|
||||
|
||||
FIND_PACKAGE(Boost REQUIRED)
|
||||
INCLUDE_DIRECTORIES(SYSTEM "${LUA_INCLUDE_DIR}" "${Boost_INCLUDE_DIRS}")
|
||||
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/libs/luabind")
|
||||
|
||||
OPTION(EQEMU_SANITIZE_LUA_LIBS "Sanitize Lua Libraries (Remove OS and IO standard libraries from being able to run)." ON)
|
||||
IF(EQEMU_SANITIZE_LUA_LIBS)
|
||||
ADD_DEFINITIONS(-DSANITIZE_LUA_LIBS)
|
||||
ENDIF(EQEMU_SANITIZE_LUA_LIBS)
|
||||
ENDIF(EQEMU_BUILD_LUA)
|
||||
|
||||
INCLUDE_DIRECTORIES(SYSTEM "${MySQL_INCLUDE_DIR}")
|
||||
INCLUDE_DIRECTORIES(SYSTEM "${DATABASE_LIBRARY_INCLUDE}")
|
||||
INCLUDE_DIRECTORIES(SYSTEM "${ZLIB_LIBRARY_INCLUDE}")
|
||||
INCLUDE_DIRECTORIES(SYSTEM "${Boost_INCLUDE_DIRS}")
|
||||
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/submodules/glm")
|
||||
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/submodules/cereal/include")
|
||||
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/submodules/fmt/include")
|
||||
@@ -296,23 +279,87 @@ INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/submodules/recastnavigat
|
||||
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/submodules/recastnavigation/Recast/Include")
|
||||
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/submodules/websocketpp")
|
||||
|
||||
OPTION(EQEMU_BUILD_LOGGING "Build Logging (To speed up compilation)" ON)
|
||||
IF(EQEMU_BUILD_LOGGING)
|
||||
ADD_DEFINITIONS(-DBUILD_LOGGING)
|
||||
ENDIF()
|
||||
|
||||
IF(TLS_LIBRARY_ENABLED)
|
||||
SET(SERVER_LIBS ${SERVER_LIBS} ${TLS_LIBRARY_LIBS})
|
||||
INCLUDE_DIRECTORIES(SYSTEM "${TLS_LIBRARY_INCLUDE}")
|
||||
ENDIF()
|
||||
|
||||
IF(SODIUM_LIBRARY_ENABLED)
|
||||
SET(SERVER_LIBS ${SERVER_LIBS} ${SODIUM_LIBRARY_LIBS})
|
||||
INCLUDE_DIRECTORIES(SYSTEM "${SODIUM_LIBRARY_INCLUDE}")
|
||||
ENDIF()
|
||||
|
||||
IF(LUA_LIBRARY_ENABLED)
|
||||
OPTION(EQEMU_BUILD_LUA "Build Lua parser." ON)
|
||||
|
||||
IF(EQEMU_BUILD_LUA)
|
||||
ADD_DEFINITIONS(-DLUA_EQEMU)
|
||||
SET(SERVER_LIBS ${SERVER_LIBS} ${LUA_LIBRARY_LIBS})
|
||||
INCLUDE_DIRECTORIES(SYSTEM "${LUA_LIBRARY_INCLUDE}")
|
||||
|
||||
OPTION(EQEMU_SANITIZE_LUA_LIBS "Sanitize Lua Libraries (Remove OS and IO standard libraries from being able to run)." ON)
|
||||
IF(EQEMU_SANITIZE_LUA_LIBS)
|
||||
ADD_DEFINITIONS(-DSANITIZE_LUA_LIBS)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(PERL_LIBRARY_ENABLED)
|
||||
OPTION(EQEMU_BUILD_PERL "Build Perl parser." ON)
|
||||
IF(EQEMU_BUILD_PERL)
|
||||
SET(SERVER_LIBS ${SERVER_LIBS} ${PERL_LIBRARY_LIBS})
|
||||
INCLUDE_DIRECTORIES(SYSTEM "${PERL_LIBRARY_INCLUDE}")
|
||||
ADD_DEFINITIONS(-DEMBPERL)
|
||||
ADD_DEFINITIONS(-DEMBPERL_PLUGIN)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(WIN32)
|
||||
SET(SERVER_LIBS ${SERVER_LIBS} "ws2_32" "psapi" "iphlpapi" "userenv")
|
||||
ENDIF()
|
||||
|
||||
IF(UNIX)
|
||||
SET(SERVER_LIBS ${SERVER_LIBS} ${CMAKE_DL_LIBS} "z" "m" "pthread")
|
||||
IF(NOT DARWIN)
|
||||
SET(SERVER_LIBS ${SERVER_LIBS} "rt")
|
||||
ENDIF()
|
||||
# Freebsd provides uuids in the C library
|
||||
IF(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||
SET(SERVER_LIBS ${SERVER_LIBS} "uuid")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(EQEMU_BUILD_LOGIN AND NOT TLS_LIBRARY_ENABLED)
|
||||
MESSAGE(FATAL_ERROR "Login server requires a TLS Library to build.")
|
||||
ENDIF()
|
||||
|
||||
IF(EQEMU_BUILD_HC AND NOT TLS_LIBRARY_ENABLED)
|
||||
MESSAGE(FATAL_ERROR "Headless client requires a TLS Library to build.")
|
||||
ENDIF()
|
||||
|
||||
IF(EQEMU_BUILD_SERVER OR EQEMU_BUILD_LOGIN OR EQEMU_BUILD_TESTS OR EQEMU_BUILD_HC)
|
||||
ADD_SUBDIRECTORY(common)
|
||||
ADD_SUBDIRECTORY(libs)
|
||||
ADD_SUBDIRECTORY(submodules/fmt)
|
||||
ADD_SUBDIRECTORY(submodules/libuv)
|
||||
|
||||
SET(RECASTNAVIGATION_DEMO OFF CACHE BOOL "Build demo")
|
||||
SET(RECASTNAVIGATION_TESTS OFF CACHE BOOL "Build tests")
|
||||
SET(RECASTNAVIGATION_EXAMPLES OFF CACHE BOOL "Build examples")
|
||||
ADD_SUBDIRECTORY(submodules/recastnavigation)
|
||||
|
||||
IF(EQEMU_BUILD_ZLIB)
|
||||
SET(ZLIB_COMPAT ON CACHE BOOL "Compile with zlib compatible API")
|
||||
SET(ZLIB_ENABLE_TESTS OFF CACHE BOOL "Build test binaries")
|
||||
ADD_SUBDIRECTORY(libs/zlibng)
|
||||
ENDIF()
|
||||
|
||||
SET(RECASTNAVIGATION_DEMO OFF CACHE BOOL "Build demo")
|
||||
SET(RECASTNAVIGATION_TESTS OFF CACHE BOOL "Build tests")
|
||||
SET(RECASTNAVIGATION_EXAMPLES OFF CACHE BOOL "Build examples")
|
||||
ADD_SUBDIRECTORY(submodules/recastnavigation)
|
||||
ENDIF(EQEMU_BUILD_SERVER OR EQEMU_BUILD_LOGIN OR EQEMU_BUILD_TESTS OR EQEMU_BUILD_HC)
|
||||
|
||||
IF(EQEMU_BUILD_SERVER)
|
||||
ADD_SUBDIRECTORY(shared_memory)
|
||||
ADD_SUBDIRECTORY(world)
|
||||
@@ -321,6 +368,7 @@ IF(EQEMU_BUILD_SERVER)
|
||||
ADD_SUBDIRECTORY(queryserv)
|
||||
ADD_SUBDIRECTORY(eqlaunch)
|
||||
ENDIF(EQEMU_BUILD_SERVER)
|
||||
|
||||
IF(EQEMU_BUILD_LOGIN)
|
||||
ADD_SUBDIRECTORY(loginserver)
|
||||
ENDIF(EQEMU_BUILD_LOGIN)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# EQEmulator Core Server
|
||||
|Travis CI (Linux)|Appveyor w/ Bots (Windows) |Appveyor w/o Bots (Windows) |
|
||||
|Travis CI (Linux)|Appveyor (Windows x86) |Appveyor (Windows x64) |
|
||||
|:---:|:---:|:---:|
|
||||
|[](https://travis-ci.org/EQEmu/Server) |[](https://ci.appveyor.com/project/KimLS/server-87crp/branch/master) |[](https://ci.appveyor.com/project/KimLS/server-w0pq2/branch/master) |
|
||||
|[](https://travis-ci.org/EQEmu/Server) |[](https://ci.appveyor.com/project/KimLS/server) |[](https://ci.appveyor.com/project/KimLS/server-87crp) |
|
||||
|
||||
***
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|:---:|:---:|:---:|
|
||||
|**Install Count**|||
|
||||
### > Windows
|
||||
* [Install](https://github.com/EQEmu/Server/wiki/Windows-Server)
|
||||
* [Install](https://eqemu.gitbook.io/server/categories/how-to-guides/installation/server-installation-windows)
|
||||
|
||||
### > Debian/Ubuntu/CentOS/Fedora
|
||||
* You can use curl or wget to kick off the installer (whichever your OS has)
|
||||
@@ -52,7 +52,7 @@ forum, although pull requests will be much quicker and easier on all parties.
|
||||
|
||||
## Resources
|
||||
- [EQEmulator Forums](http://www.eqemulator.org/forums)
|
||||
- [EQEmulator Wiki](https://github.com/EQEmu/Server/wiki)
|
||||
- [EQEmulator Wiki](https://eqemu.gitbook.io/)
|
||||
|
||||
## Related Repositories
|
||||
* [ProjectEQ Quests](https://github.com/ProjectEQ/projecteqquests)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.2)
|
||||
|
||||
add_subdirectory(import)
|
||||
add_subdirectory(export)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.2)
|
||||
|
||||
SET(export_sources
|
||||
main.cpp
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.2)
|
||||
|
||||
SET(import_sources
|
||||
main.cpp
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
OPTION(EQEMU_FETCH_MSVC_DEPENDENCIES_VCPKG "Automatically fetch vcpkg dependencies for MSCV" ON)
|
||||
OPTION(EQEMU_FETCH_MSVC_DEPENDENCIES_PERL "Automatically fetch perl dependencies for MSCV" ON)
|
||||
|
||||
MARK_AS_ADVANCED(EQEMU_FETCH_MSVC_DEPENDENCIES_VCPKG)
|
||||
MARK_AS_ADVANCED(EQEMU_FETCH_MSVC_DEPENDENCIES_PERL)
|
||||
|
||||
SET(EQEMU_MSVC_DEPENDENCIES_VCPKG_X86 "https://github.com/EQEmu/Server/releases/download/v1.2/vcpkg-export-x86.zip")
|
||||
SET(EQEMU_MSVC_DEPENDENCIES_VCPKG_X64 "https://github.com/EQEmu/Server/releases/download/v1.2/vcpkg-export-x64.zip")
|
||||
SET(EQEMU_MSVC_DEPENDENCIES_PERL_X86 "http://strawberryperl.com/download/5.24.4.1/strawberry-perl-5.24.4.1-32bit-portable.zip")
|
||||
SET(EQEMU_MSVC_DEPENDENCIES_PERL_X64 "http://strawberryperl.com/download/5.24.4.1/strawberry-perl-5.24.4.1-64bit-portable.zip")
|
||||
SET(EQEMU_MSVC_DEPENDENCIES_VCPKG_X86_ZIP "vcpkg-export-x86.zip")
|
||||
SET(EQEMU_MSVC_DEPENDENCIES_VCPKG_X64_ZIP "vcpkg-export-x64.zip")
|
||||
SET(EQEMU_MSVC_DEPENDENCIES_VCPKG_X86_DIR "vcpkg-export-x86")
|
||||
SET(EQEMU_MSVC_DEPENDENCIES_VCPKG_X64_DIR "vcpkg-export-x64")
|
||||
SET(EQEMU_MSVC_DEPENDENCIES_PERL_X86_ZIP "strawberry-perl-5.24.4.1-32bit-portable.zip")
|
||||
SET(EQEMU_MSVC_DEPENDENCIES_PERL_X64_ZIP "strawberry-perl-5.24.4.1-64bit-portable.zip")
|
||||
SET(EQEMU_MSVC_DEPENDENCIES_PERL_X86_DIR "x86")
|
||||
SET(EQEMU_MSVC_DEPENDENCIES_PERL_X64_DIR "x64")
|
||||
|
||||
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
SET(EQEMU_VCPKG_URL ${EQEMU_MSVC_DEPENDENCIES_VCPKG_X64})
|
||||
SET(EQEMU_PERL_URL ${EQEMU_MSVC_DEPENDENCIES_PERL_X64})
|
||||
SET(EQEMU_VCPKG_ZIP ${EQEMU_MSVC_DEPENDENCIES_VCPKG_X64_ZIP})
|
||||
SET(EQEMU_VCPKG_DIR ${EQEMU_MSVC_DEPENDENCIES_VCPKG_X64_DIR})
|
||||
SET(EQEMU_PERL_ZIP ${EQEMU_MSVC_DEPENDENCIES_PERL_X64_ZIP})
|
||||
SET(EQEMU_PERL_DIR ${EQEMU_MSVC_DEPENDENCIES_PERL_X64_DIR})
|
||||
ELSE()
|
||||
SET(EQEMU_VCPKG_URL ${EQEMU_MSVC_DEPENDENCIES_VCPKG_X86})
|
||||
SET(EQEMU_PERL_URL ${EQEMU_MSVC_DEPENDENCIES_PERL_X86})
|
||||
SET(EQEMU_VCPKG_ZIP ${EQEMU_MSVC_DEPENDENCIES_VCPKG_X86_ZIP})
|
||||
SET(EQEMU_VCPKG_DIR ${EQEMU_MSVC_DEPENDENCIES_VCPKG_X86_DIR})
|
||||
SET(EQEMU_PERL_ZIP ${EQEMU_MSVC_DEPENDENCIES_PERL_X86_ZIP})
|
||||
SET(EQEMU_PERL_DIR ${EQEMU_MSVC_DEPENDENCIES_PERL_X86_DIR})
|
||||
ENDIF()
|
||||
|
||||
IF(EQEMU_FETCH_MSVC_DEPENDENCIES_VCPKG)
|
||||
MESSAGE(STATUS "Resolving vcpkg dependencies...")
|
||||
|
||||
IF(NOT EXISTS ${PROJECT_SOURCE_DIR}/vcpkg/${EQEMU_VCPKG_ZIP})
|
||||
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_SOURCE_DIR}/vcpkg)
|
||||
|
||||
MESSAGE(STATUS "Downloading existing vcpkg dependencies from releases...")
|
||||
FILE(DOWNLOAD ${EQEMU_VCPKG_URL} ${PROJECT_SOURCE_DIR}/vcpkg/${EQEMU_VCPKG_ZIP}
|
||||
SHOW_PROGRESS
|
||||
STATUS DOWNLOAD_STATUS)
|
||||
|
||||
LIST(GET DOWNLOAD_STATUS 0 STATUS_CODE)
|
||||
IF(NOT STATUS_CODE EQUAL 0)
|
||||
MESSAGE(FATAL_ERROR "Was unable to download dependencies from ${EQEMU_VCPKG_URL}")
|
||||
ENDIF()
|
||||
|
||||
MESSAGE(STATUS "Extracting files...")
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ${CMAKE_COMMAND} -E tar xzf ${PROJECT_SOURCE_DIR}/vcpkg/${EQEMU_VCPKG_ZIP}
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/vcpkg
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
INCLUDE(${PROJECT_SOURCE_DIR}/vcpkg/${EQEMU_VCPKG_DIR}/scripts/buildsystems/vcpkg.cmake)
|
||||
ENDIF()
|
||||
|
||||
IF(EQEMU_FETCH_MSVC_DEPENDENCIES_PERL)
|
||||
#Try to find perl first, (so you can use your active install first)
|
||||
FIND_PACKAGE(PerlLibs)
|
||||
|
||||
IF(NOT PerlLibs_FOUND)
|
||||
MESSAGE(STATUS "Resolving perl dependencies...")
|
||||
|
||||
IF(NOT EXISTS ${PROJECT_SOURCE_DIR}/perl/${EQEMU_PERL_ZIP})
|
||||
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_SOURCE_DIR}/perl)
|
||||
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_SOURCE_DIR}/perl/${EQEMU_PERL_DIR})
|
||||
|
||||
MESSAGE(STATUS "Downloading portable perl...")
|
||||
FILE(DOWNLOAD ${EQEMU_PERL_URL} ${PROJECT_SOURCE_DIR}/perl/${EQEMU_PERL_ZIP}
|
||||
SHOW_PROGRESS
|
||||
STATUS DOWNLOAD_STATUS)
|
||||
|
||||
LIST(GET DOWNLOAD_STATUS 0 STATUS_CODE)
|
||||
IF(NOT STATUS_CODE EQUAL 0)
|
||||
MESSAGE(FATAL_ERROR "Was unable to download dependencies from ${EQEMU_PERL_URL}")
|
||||
ENDIF()
|
||||
|
||||
MESSAGE(STATUS "Extracting files...")
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ${CMAKE_COMMAND} -E tar xzf ${PROJECT_SOURCE_DIR}/perl/${EQEMU_PERL_ZIP}
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/perl/${EQEMU_PERL_DIR}
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
SET(PERL_EXECUTABLE ${PROJECT_SOURCE_DIR}/perl/${EQEMU_PERL_DIR}/perl/bin/perl.exe CACHE FILEPATH "Path to perl program" FORCE)
|
||||
SET(PERL_INCLUDE_PATH ${PROJECT_SOURCE_DIR}/perl/${EQEMU_PERL_DIR}/perl/lib/CORE CACHE PATH "Path to perl include files" FORCE)
|
||||
SET(PERL_LIBRARY ${PROJECT_SOURCE_DIR}/perl/${EQEMU_PERL_DIR}/perl/lib/CORE/libperl524.a CACHE FILEPATH "Path to perl library" FORCE)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
@@ -1,124 +0,0 @@
|
||||
#CMake - Cross Platform Makefile Generator
|
||||
#Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
|
||||
#All rights reserved.
|
||||
#
|
||||
#Redistribution and use in source and binary forms, with or without
|
||||
#modification, are permitted provided that the following conditions
|
||||
#are met:
|
||||
#
|
||||
#* Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
#* Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
#* Neither the names of Kitware, Inc., the Insight Software Consortium,
|
||||
# nor the names of their contributors may be used to endorse or promote
|
||||
# products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
#A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
#HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
#SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
#LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
#DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
#THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
#(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
#OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# This module defines
|
||||
# LUA51_FOUND, if false, do not try to link to Lua
|
||||
# LUA_LIBRARIES
|
||||
# LUA_INCLUDE_DIR, where to find lua.h
|
||||
# LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
|
||||
|
||||
IF(LUA_ROOT)
|
||||
FIND_PATH(LUA_INCLUDE_DIR
|
||||
NAMES lua.h
|
||||
HINTS
|
||||
ENV LUA_DIR
|
||||
PATHS
|
||||
${LUA_ROOT}
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw
|
||||
/opt/local
|
||||
/opt/csw
|
||||
/opt
|
||||
PATH_SUFFIXES include/lua51 include/lua5.1 include/lua include src
|
||||
)
|
||||
|
||||
FIND_LIBRARY(LUA_LIBRARY
|
||||
NAMES lua51 lua5.1 lua-5.1 lua
|
||||
HINTS
|
||||
ENV LUA_DIR
|
||||
PATHS
|
||||
${LUA_ROOT}
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw
|
||||
/opt/local
|
||||
/opt/csw
|
||||
/opt
|
||||
PATH_SUFFIXES lib bin
|
||||
)
|
||||
ELSE(LUA_ROOT)
|
||||
FIND_PATH(LUA_INCLUDE_DIR
|
||||
NAMES lua.h
|
||||
HINTS
|
||||
ENV LUA_DIR
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw
|
||||
/opt/local
|
||||
/opt/csw
|
||||
/opt
|
||||
PATH_SUFFIXES include/lua51 include/lua5.1 include/lua include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(LUA_LIBRARY
|
||||
NAMES lua51 lua5.1 lua-5.1 lua
|
||||
HINTS
|
||||
ENV LUA_DIR
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw
|
||||
/opt/local
|
||||
/opt/csw
|
||||
/opt
|
||||
PATH_SUFFIXES lib bin
|
||||
)
|
||||
ENDIF(LUA_ROOT)
|
||||
|
||||
IF(LUA_LIBRARY)
|
||||
# include the math library for Unix
|
||||
IF(UNIX AND NOT APPLE)
|
||||
FIND_LIBRARY(LUA_MATH_LIBRARY m)
|
||||
SET(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
|
||||
# For Windows and Mac, don't need to explicitly include the math library
|
||||
ELSE()
|
||||
SET( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
|
||||
FILE(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
|
||||
|
||||
STRING(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}")
|
||||
UNSET(lua_version_str)
|
||||
ENDIF()
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua51
|
||||
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
|
||||
VERSION_VAR LUA_VERSION_STRING)
|
||||
|
||||
MARK_AS_ADVANCED(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)
|
||||
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
# Modified from the FindLua51 that comes with CMake
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindLua51
|
||||
---------
|
||||
|
||||
|
||||
|
||||
Locate Lua51 library This module defines
|
||||
|
||||
::
|
||||
|
||||
LUA51_FOUND, if false, do not try to link to Lua
|
||||
LUA_LIBRARIES
|
||||
LUA_INCLUDE_DIR, where to find lua.h
|
||||
LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
|
||||
|
||||
|
||||
|
||||
Note that the expected include convention is
|
||||
|
||||
::
|
||||
|
||||
#include "lua.h"
|
||||
|
||||
and not
|
||||
|
||||
::
|
||||
|
||||
#include <lua/lua.h>
|
||||
|
||||
This is because, the lua location is not standardized and may exist in
|
||||
locations other than lua/
|
||||
#]=======================================================================]
|
||||
|
||||
find_path(LUA_INCLUDE_DIR lua.h
|
||||
HINTS
|
||||
ENV LUA_DIR
|
||||
PATH_SUFFIXES include/lua51 include/lua5.1 include/lua-5.1 include/lua include/luajit include
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
/opt
|
||||
)
|
||||
|
||||
find_library(LUA_LIBRARY
|
||||
NAMES lua51 lua5.1 lua-5.1 lua luajit
|
||||
HINTS
|
||||
ENV LUA_DIR
|
||||
PATH_SUFFIXES lib
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw
|
||||
/opt/local
|
||||
/opt/csw
|
||||
/opt
|
||||
)
|
||||
|
||||
if(LUA_LIBRARY)
|
||||
# include the math library for Unix
|
||||
if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU)
|
||||
find_library(LUA_MATH_LIBRARY m)
|
||||
set( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
|
||||
# For Windows and Mac, don't need to explicitly include the math library
|
||||
else()
|
||||
set( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
|
||||
file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
|
||||
|
||||
string(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}")
|
||||
unset(lua_version_str)
|
||||
endif()
|
||||
|
||||
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
|
||||
# handle the QUIETLY and REQUIRED arguments and set LUA51_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua51
|
||||
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
|
||||
VERSION_VAR LUA_VERSION_STRING)
|
||||
|
||||
mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
# - Find mariadbclient
|
||||
#
|
||||
# -*- cmake -*-
|
||||
#
|
||||
# Find the native MariaDB includes and library
|
||||
#
|
||||
# MariaDB_INCLUDE_DIR - where to find mysql.h, etc.
|
||||
# MariaDB_LIBRARIES - List of libraries when using MariaDB.
|
||||
# MariaDB_FOUND - True if MariaDB found.
|
||||
# The following can be used as a hint as to where to search:
|
||||
# MARIADB_ROOT
|
||||
|
||||
IF (MariaDB_INCLUDE_DIR AND MariaDB_LIBRARIES)
|
||||
# Already in cache, be silent
|
||||
SET(MariaDB_FIND_QUIETLY TRUE)
|
||||
ENDIF (MariaDB_INCLUDE_DIR AND MariaDB_LIBRARIES)
|
||||
|
||||
# Include dir
|
||||
IF(MARIADB_ROOT)
|
||||
FIND_PATH(MariaDB_INCLUDE_DIR
|
||||
NAMES mariadb_version.h
|
||||
PATHS ${MARIADB_ROOT}/include
|
||||
PATH_SUFFIXES mysql mariadb
|
||||
NO_DEFAULT_PATH
|
||||
NO_SYSTEM_ENVIRONMENT_PATH
|
||||
)
|
||||
FIND_PATH(MariaDB_INCLUDE_DIR
|
||||
NAMES mariadb_version.h
|
||||
PATH_SUFFIXES mysql mariadb
|
||||
)
|
||||
ELSE(MARIADB_ROOT)
|
||||
FIND_PATH(MariaDB_INCLUDE_DIR
|
||||
NAMES mariadb_version.h
|
||||
PATH_SUFFIXES mysql mariadb
|
||||
)
|
||||
ENDIF(MARIADB_ROOT)
|
||||
|
||||
# Library
|
||||
SET(MariaDB_NAMES libmariadb)
|
||||
IF(MARIADB_ROOT)
|
||||
FIND_LIBRARY(MariaDB_LIBRARY
|
||||
NAMES ${MariaDB_NAMES}
|
||||
PATHS ${MARIADB_ROOT}/lib
|
||||
PATH_SUFFIXES mysql mariadb
|
||||
NO_DEFAULT_PATH
|
||||
NO_SYSTEM_ENVIRONMENT_PATH
|
||||
)
|
||||
|
||||
FIND_LIBRARY(MariaDB_LIBRARY
|
||||
NAMES ${MariaDB_NAMES}
|
||||
PATH_SUFFIXES mysql mariadb
|
||||
)
|
||||
ELSE(MARIADB_ROOT)
|
||||
FIND_LIBRARY(MariaDB_LIBRARY
|
||||
NAMES ${MariaDB_NAMES} mariadbclient_r mariadbclient
|
||||
PATHS /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64
|
||||
PATH_SUFFIXES mysql mariadb
|
||||
)
|
||||
ENDIF(MARIADB_ROOT)
|
||||
|
||||
IF (MariaDB_INCLUDE_DIR AND MariaDB_LIBRARY)
|
||||
SET(MariaDB_FOUND TRUE)
|
||||
SET(MariaDB_LIBRARIES ${MariaDB_LIBRARY})
|
||||
ELSE (MariaDB_INCLUDE_DIR AND MariaDB_LIBRARY)
|
||||
SET(MariaDB_FOUND FALSE)
|
||||
SET(MariaDB_LIBRARIES)
|
||||
ENDIF (MariaDB_INCLUDE_DIR AND MariaDB_LIBRARY)
|
||||
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set MariaDB_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MariaDB DEFAULT_MSG MariaDB_LIBRARY MariaDB_INCLUDE_DIR)
|
||||
|
||||
IF(MariaDB_FOUND)
|
||||
SET( MariaDB_LIBRARY_RELEASE ${MariaDB_LIBRARY} )
|
||||
SET( MariaDB_LIBRARY_DEBUG ${MariaDB_LIBRARY} )
|
||||
SET( MariaDB_LIBRARIES ${MariaDB_LIBRARY_RELEASE} ${MariaDB_LIBRARY_DEBUG} )
|
||||
ELSE(MariaDB_FOUND)
|
||||
SET( MariaDB_LIBRARIES )
|
||||
ENDIF(MariaDB_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
MariaDB_LIBRARY_DEBUG
|
||||
MariaDB_LIBRARY_RELEASE
|
||||
MariaDB_INCLUDE_DIR
|
||||
)
|
||||
@@ -0,0 +1,93 @@
|
||||
# - Try to find mbedTLS
|
||||
# Once done this will define
|
||||
#
|
||||
# Read-Only variables
|
||||
# MBEDTLS_FOUND - system has mbedTLS
|
||||
# MBEDTLS_INCLUDE_DIR - the mbedTLS include directory
|
||||
# MBEDTLS_LIBRARY_DIR - the mbedTLS library directory
|
||||
# MBEDTLS_LIBRARIES - Link these to use mbedTLS
|
||||
# MBEDTLS_LIBRARY - path to mbedTLS library
|
||||
# MBEDX509_LIBRARY - path to mbedTLS X.509 library
|
||||
# MBEDCRYPTO_LIBRARY - path to mbedTLS Crypto library
|
||||
#
|
||||
# Hint
|
||||
# MBEDTLS_ROOT_DIR can be pointed to a local mbedTLS installation.
|
||||
|
||||
SET(_MBEDTLS_ROOT_HINTS
|
||||
${MBEDTLS_ROOT_DIR}
|
||||
ENV MBEDTLS_ROOT_DIR
|
||||
)
|
||||
|
||||
SET(_MBEDTLS_ROOT_HINTS_AND_PATHS
|
||||
HINTS ${_MBEDTLS_ROOT_HINTS}
|
||||
PATHS ${_MBEDTLS_ROOT_PATHS}
|
||||
)
|
||||
|
||||
FIND_PATH(MBEDTLS_INCLUDE_DIR
|
||||
NAMES mbedtls/version.h
|
||||
${_MBEDTLS_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES include
|
||||
)
|
||||
|
||||
IF(MBEDTLS_INCLUDE_DIR AND MBEDTLS_LIBRARIES)
|
||||
# Already in cache, be silent
|
||||
SET(MBEDTLS_FIND_QUIETLY TRUE)
|
||||
ENDIF()
|
||||
|
||||
FIND_LIBRARY(MBEDTLS_LIBRARY
|
||||
NAMES mbedtls libmbedtls
|
||||
${_MBEDTLS_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES library
|
||||
)
|
||||
FIND_LIBRARY(MBEDX509_LIBRARY
|
||||
NAMES mbedx509 libmbedx509
|
||||
${_MBEDTLS_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES library
|
||||
)
|
||||
FIND_LIBRARY(MBEDCRYPTO_LIBRARY
|
||||
NAMES mbedcrypto libmbedcrypto
|
||||
${_MBEDTLS_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES library
|
||||
)
|
||||
|
||||
IF(MBEDTLS_INCLUDE_DIR AND MBEDTLS_LIBRARY AND MBEDX509_LIBRARY AND MBEDCRYPTO_LIBRARY)
|
||||
SET(MBEDTLS_FOUND TRUE)
|
||||
ENDIF()
|
||||
|
||||
IF(MBEDTLS_FOUND)
|
||||
# split mbedTLS into -L and -l linker options, so we can set them for pkg-config
|
||||
GET_FILENAME_COMPONENT(MBEDTLS_LIBRARY_DIR ${MBEDTLS_LIBRARY} PATH)
|
||||
GET_FILENAME_COMPONENT(MBEDTLS_LIBRARY_FILE ${MBEDTLS_LIBRARY} NAME_WE)
|
||||
GET_FILENAME_COMPONENT(MBEDX509_LIBRARY_FILE ${MBEDX509_LIBRARY} NAME_WE)
|
||||
GET_FILENAME_COMPONENT(MBEDCRYPTO_LIBRARY_FILE ${MBEDCRYPTO_LIBRARY} NAME_WE)
|
||||
STRING(REGEX REPLACE "^lib" "" MBEDTLS_LIBRARY_FILE ${MBEDTLS_LIBRARY_FILE})
|
||||
STRING(REGEX REPLACE "^lib" "" MBEDX509_LIBRARY_FILE ${MBEDX509_LIBRARY_FILE})
|
||||
STRING(REGEX REPLACE "^lib" "" MBEDCRYPTO_LIBRARY_FILE ${MBEDCRYPTO_LIBRARY_FILE})
|
||||
SET(MBEDTLS_LIBRARIES "-L${MBEDTLS_LIBRARY_DIR} -l${MBEDTLS_LIBRARY_FILE} -l${MBEDX509_LIBRARY_FILE} -l${MBEDCRYPTO_LIBRARY_FILE}")
|
||||
|
||||
IF(NOT MBEDTLS_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found mbedTLS:")
|
||||
FILE(READ ${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h MBEDTLSCONTENT)
|
||||
STRING(REGEX MATCH "MBEDTLS_VERSION_STRING +\"[0-9|.]+\"" MBEDTLSMATCH ${MBEDTLSCONTENT})
|
||||
IF (MBEDTLSMATCH)
|
||||
STRING(REGEX REPLACE "MBEDTLS_VERSION_STRING +\"([0-9|.]+)\"" "\\1" MBEDTLS_VERSION ${MBEDTLSMATCH})
|
||||
MESSAGE(STATUS " version ${MBEDTLS_VERSION}")
|
||||
ENDIF(MBEDTLSMATCH)
|
||||
MESSAGE(STATUS " TLS: ${MBEDTLS_LIBRARY}")
|
||||
MESSAGE(STATUS " X509: ${MBEDX509_LIBRARY}")
|
||||
MESSAGE(STATUS " Crypto: ${MBEDCRYPTO_LIBRARY}")
|
||||
ENDIF(NOT MBEDTLS_FIND_QUIETLY)
|
||||
ELSE(MBEDTLS_FOUND)
|
||||
IF(MBEDTLS_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Could not find mbedTLS")
|
||||
ENDIF(MBEDTLS_FIND_REQUIRED)
|
||||
ENDIF(MBEDTLS_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
MBEDTLS_INCLUDE_DIR
|
||||
MBEDTLS_LIBRARY_DIR
|
||||
MBEDTLS_LIBRARIES
|
||||
MBEDTLS_LIBRARY
|
||||
MBEDX509_LIBRARY
|
||||
MBEDCRYPTO_LIBRARY
|
||||
)
|
||||
@@ -1,4 +1,4 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.2)
|
||||
|
||||
SET(common_sources
|
||||
base_packet.cpp
|
||||
@@ -9,6 +9,7 @@ SET(common_sources
|
||||
crash.cpp
|
||||
crc16.cpp
|
||||
crc32.cpp
|
||||
database/database_dump_service.cpp
|
||||
database.cpp
|
||||
database_conversions.cpp
|
||||
database_instances.cpp
|
||||
@@ -31,6 +32,7 @@ SET(common_sources
|
||||
event_sub.cpp
|
||||
extprofile.cpp
|
||||
faction.cpp
|
||||
file_util.cpp
|
||||
guild_base.cpp
|
||||
guilds.cpp
|
||||
inventory_profile.cpp
|
||||
@@ -120,8 +122,10 @@ SET(common_headers
|
||||
cli/argh.h
|
||||
cli/eqemu_command_handler.h
|
||||
cli/terminal_color.hpp
|
||||
database/database_dump_service.h
|
||||
data_verification.h
|
||||
database.h
|
||||
database_schema.h
|
||||
dbcore.h
|
||||
deity.h
|
||||
emu_constants.h
|
||||
@@ -149,6 +153,7 @@ SET(common_headers
|
||||
event_sub.h
|
||||
extprofile.h
|
||||
faction.h
|
||||
file_util.h
|
||||
features.h
|
||||
fixed_memory_hash_set.h
|
||||
fixed_memory_variable_hash_set.h
|
||||
|
||||
+2
-2
@@ -24,7 +24,7 @@
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
// EQEmu::Any is a modified version of Boost::Any and as such retains the Boost licensing.
|
||||
// EQ::Any is a modified version of Boost::Any and as such retains the Boost licensing.
|
||||
|
||||
#ifndef EQEMU_COMMON_ANY_H
|
||||
#define EQEMU_COMMON_ANY_H
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <algorithm>
|
||||
#include <typeinfo>
|
||||
|
||||
namespace EQEmu
|
||||
namespace EQ
|
||||
{
|
||||
class Any
|
||||
{
|
||||
|
||||
@@ -573,6 +573,20 @@ bool IsNonSpellFighterClass(uint8 class_id)
|
||||
}
|
||||
}
|
||||
|
||||
bool IsHybridClass(uint8 class_id)
|
||||
{
|
||||
switch (class_id) {
|
||||
case PALADIN:
|
||||
case RANGER:
|
||||
case SHADOWKNIGHT:
|
||||
case BARD:
|
||||
case BEASTLORD:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool IsCasterClass(uint8 class_id)
|
||||
{
|
||||
switch (class_id) {
|
||||
|
||||
@@ -135,6 +135,7 @@ uint8 GetClassIDFromPlayerClassBit(uint32 player_class_bit);
|
||||
bool IsFighterClass(uint8 class_id);
|
||||
bool IsSpellFighterClass(uint8 class_id);
|
||||
bool IsNonSpellFighterClass(uint8 class_id);
|
||||
bool IsHybridClass(uint8 class_id);
|
||||
bool IsCasterClass(uint8 class_id);
|
||||
bool IsINTCasterClass(uint8 class_id);
|
||||
bool IsWISCasterClass(uint8 class_id);
|
||||
|
||||
@@ -38,10 +38,6 @@ namespace EQEmuCommand {
|
||||
void DisplayDebug(argh::parser &cmd)
|
||||
{
|
||||
if (cmd[{"-d", "--debug"}]) {
|
||||
std::cout << "Positional args:\n";
|
||||
for (auto &pos_arg : cmd)
|
||||
std::cout << '\t' << pos_arg << std::endl;
|
||||
|
||||
std::cout << "Positional args:\n";
|
||||
for (auto &pos_arg : cmd.pos_args())
|
||||
std::cout << '\t' << pos_arg << std::endl;
|
||||
@@ -73,29 +69,37 @@ namespace EQEmuCommand {
|
||||
{
|
||||
bool arguments_filled = true;
|
||||
|
||||
int index = 2;
|
||||
for (auto &arg : arguments) {
|
||||
if (cmd(arg).str().empty()) {
|
||||
if (cmd(arg).str().empty() && cmd(index).str().empty()) {
|
||||
arguments_filled = false;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
|
||||
if (!arguments_filled || argc == 2) {
|
||||
std::string arguments_string;
|
||||
for (auto &arg : arguments) {
|
||||
arguments_string += " " + arg + "=*\n";
|
||||
arguments_string += " " + arg;
|
||||
}
|
||||
|
||||
std::string options_string;
|
||||
for (auto &opt : options) {
|
||||
for (auto &opt : options) {
|
||||
options_string += " " + opt + "\n";
|
||||
}
|
||||
|
||||
std::cout << fmt::format(
|
||||
"Command\n\n{0} \n\nArgs\n{1}\nOptions\n{2}",
|
||||
argv[1],
|
||||
arguments_string,
|
||||
options_string
|
||||
) << std::endl;
|
||||
std::stringstream command_string;
|
||||
|
||||
command_string <<
|
||||
termcolor::colorize <<
|
||||
termcolor::yellow <<
|
||||
"\nCommand" <<
|
||||
termcolor::reset << "\n\n" <<
|
||||
termcolor::green << argv[1] << arguments_string << termcolor::reset << "\n" <<
|
||||
termcolor::yellow << (!options_string.empty() ? "\nOptions\n\n" : "") <<
|
||||
termcolor::reset << termcolor::cyan << options_string << termcolor::reset;
|
||||
|
||||
std::cout << command_string.str() << std::endl;
|
||||
|
||||
exit(1);
|
||||
}
|
||||
@@ -123,10 +127,6 @@ namespace EQEmuCommand {
|
||||
bool ran_command = false;
|
||||
for (auto &it: in_function_map) {
|
||||
if (it.first == argv[1]) {
|
||||
std::cout << std::endl;
|
||||
std::cout << "> " << termcolor::cyan << "Executing CLI Command" << termcolor::reset << std::endl;
|
||||
std::cout << std::endl;
|
||||
|
||||
(it.second)(argc, argv, cmd, description);
|
||||
ran_command = true;
|
||||
}
|
||||
@@ -182,12 +182,13 @@ namespace EQEmuCommand {
|
||||
}
|
||||
|
||||
std::cout << std::endl;
|
||||
}
|
||||
else if (!ran_command) {
|
||||
std::cerr << "Unknown command [" << argv[1] << "] ! Try --help" << std::endl;
|
||||
|
||||
std::exit(1);
|
||||
}
|
||||
|
||||
exit(1);
|
||||
if (ran_command) {
|
||||
std::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <string.h>
|
||||
#include <zlib.h>
|
||||
|
||||
namespace EQEmu
|
||||
namespace EQ
|
||||
{
|
||||
uint32 EstimateDeflateBuffer(uint32 len) {
|
||||
z_stream zstream;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace EQEmu
|
||||
namespace EQ
|
||||
{
|
||||
uint32 EstimateDeflateBuffer(uint32 len);
|
||||
uint32 DeflateData(const char *buffer, uint32 len, char *out_buffer, uint32 out_len_max);
|
||||
|
||||
@@ -118,6 +118,11 @@ void set_exception_handler() {
|
||||
#include <unistd.h>
|
||||
#include <sys/fcntl.h>
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#include <signal.h>
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
void print_trace()
|
||||
{
|
||||
auto uid = geteuid();
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
namespace EQEmu {
|
||||
namespace EQ {
|
||||
template<typename T>
|
||||
T Clamp(const T &value, const T &lower, const T &upper)
|
||||
{
|
||||
|
||||
+182
-67
@@ -45,6 +45,7 @@
|
||||
#include "eq_packet_structs.h"
|
||||
#include "extprofile.h"
|
||||
#include "string_util.h"
|
||||
#include "database_schema.h"
|
||||
|
||||
extern Client client;
|
||||
|
||||
@@ -97,7 +98,7 @@ uint32 Database::CheckLogin(const char* name, const char* password, const char *
|
||||
DoEscapeString(tmpUN, name, strlen(name));
|
||||
DoEscapeString(tmpPW, password, strlen(password));
|
||||
|
||||
std::string query = StringFormat("SELECT id, status FROM account WHERE name='%s' AND ls_id='%s' AND password is not null "
|
||||
std::string query = StringFormat("SELECT id, status FROM account WHERE `name`='%s' AND ls_id='%s' AND password is not null "
|
||||
"and length(password) > 0 and (password='%s' or password=MD5('%s'))",
|
||||
tmpUN, EscapeString(loginserver).c_str(), tmpPW, tmpPW);
|
||||
|
||||
@@ -124,7 +125,7 @@ uint32 Database::CheckLogin(const char* name, const char* password, const char *
|
||||
//Get Banned IP Address List - Only return false if the incoming connection's IP address is not present in the banned_ips table.
|
||||
bool Database::CheckBannedIPs(const char* loginIP)
|
||||
{
|
||||
std::string query = StringFormat("SELECT ip_address FROM Banned_IPs WHERE ip_address='%s'", loginIP);
|
||||
std::string query = StringFormat("SELECT ip_address FROM banned_ips WHERE ip_address='%s'", loginIP);
|
||||
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
@@ -140,7 +141,7 @@ bool Database::CheckBannedIPs(const char* loginIP)
|
||||
}
|
||||
|
||||
bool Database::AddBannedIP(char* bannedIP, const char* notes) {
|
||||
std::string query = StringFormat("INSERT into Banned_IPs SET ip_address='%s', notes='%s'", bannedIP, notes);
|
||||
std::string query = StringFormat("INSERT into banned_ips SET ip_address='%s', notes='%s'", bannedIP, notes);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
return false;
|
||||
@@ -251,7 +252,7 @@ uint32 Database::CreateAccount(
|
||||
}
|
||||
|
||||
bool Database::DeleteAccount(const char* name, const char *loginserver) {
|
||||
std::string query = StringFormat("DELETE FROM account WHERE name='%s' AND ls_id='%s'", name, loginserver);
|
||||
std::string query = StringFormat("DELETE FROM account WHERE `name`='%s' AND ls_id='%s'", name, loginserver);
|
||||
LogInfo("Account Attempting to be deleted:'[{}]:[{}]'", loginserver, name);
|
||||
|
||||
auto results = QueryDatabase(query);
|
||||
@@ -293,6 +294,37 @@ bool Database::SetAccountStatus(const char* name, int16 status) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param account_name
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
bool Database::SetAccountStatus(const std::string& account_name, int16 status)
|
||||
{
|
||||
LogInfo("Account [{}] is attempting to be set to status [{}]", account_name, status);
|
||||
|
||||
std::string query = fmt::format(
|
||||
SQL(
|
||||
UPDATE account SET status = {} WHERE name = '{}'
|
||||
),
|
||||
status,
|
||||
account_name
|
||||
);
|
||||
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
if (!results.Success()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (results.RowsAffected() == 0) {
|
||||
LogWarning("Account [{}] does not exist!", account_name);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* This initially creates the character during character create */
|
||||
bool Database::ReserveName(uint32 account_id, char* name) {
|
||||
std::string query = StringFormat("SELECT `account_id`, `name` FROM `character_data` WHERE `name` = '%s'", name);
|
||||
@@ -307,70 +339,81 @@ bool Database::ReserveName(uint32 account_id, char* name) {
|
||||
query = StringFormat("INSERT INTO `character_data` SET `account_id` = %i, `name` = '%s'", account_id, name);
|
||||
results = QueryDatabase(query);
|
||||
if (!results.Success() || results.ErrorMessage() != ""){ return false; }
|
||||
|
||||
// Put character into the default guild if rule is being used.
|
||||
int guild_id = RuleI(Character, DefaultGuild);
|
||||
|
||||
if (guild_id != 0) {
|
||||
int character_id=results.LastInsertedID();
|
||||
if (character_id > -1) {
|
||||
query = StringFormat("INSERT INTO `guild_members` SET `char_id` = %i, `guild_id` = '%i'", character_id, guild_id);
|
||||
results = QueryDatabase(query);
|
||||
if (!results.Success() || results.ErrorMessage() != ""){
|
||||
LogInfo("Could not put character [{}] into default Guild", name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
Delete the character with the name "name"
|
||||
returns false on failure, true otherwise
|
||||
*/
|
||||
bool Database::DeleteCharacter(char *name) {
|
||||
uint32 charid = 0;
|
||||
if(!name || !strlen(name)) {
|
||||
/**
|
||||
* @param character_name
|
||||
* @return
|
||||
*/
|
||||
bool Database::DeleteCharacter(char *character_name) {
|
||||
uint32 character_id = 0;
|
||||
if(!character_name || !strlen(character_name)) {
|
||||
LogInfo("DeleteCharacter: request to delete without a name (empty char slot)");
|
||||
return false;
|
||||
}
|
||||
LogInfo("Database::DeleteCharacter name : [{}]", name);
|
||||
|
||||
/* Get id from character_data before deleting record so we can clean up the rest of the tables */
|
||||
std::string query = StringFormat("SELECT `id` from `character_data` WHERE `name` = '%s'", name);
|
||||
auto results = QueryDatabase(query);
|
||||
for (auto row = results.begin(); row != results.end(); ++row) { charid = atoi(row[0]); }
|
||||
if (charid <= 0){
|
||||
LogError("Database::DeleteCharacter :: Character ({}) not found, stopping delete...", name);
|
||||
std::string query = StringFormat("SELECT `id` from `character_data` WHERE `name` = '%s'", character_name);
|
||||
auto results = QueryDatabase(query);
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
character_id = atoi(row[0]);
|
||||
}
|
||||
|
||||
if (character_id <= 0) {
|
||||
LogError("DeleteCharacter | Invalid Character ID [{}]", character_name);
|
||||
return false;
|
||||
}
|
||||
|
||||
query = StringFormat("DELETE FROM `quest_globals` WHERE `charid` = '%d'", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `character_activities` WHERE `charid` = '%d'", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `character_enabledtasks` WHERE `charid` = '%d'", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `character_tasks` WHERE `charid` = '%d'", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `completed_tasks` WHERE `charid` = '%d'", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `friends` WHERE `charid` = '%d'", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `mail` WHERE `charid` = '%d'", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `timers` WHERE `char_id` = '%d'", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `inventory` WHERE `charid` = '%d'", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `char_recipe_list` WHERE `char_id` = '%d'", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `adventure_stats` WHERE `player_id` ='%d'", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `zone_flags` WHERE `charID` = '%d'", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `titles` WHERE `char_id` = '%d'", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `player_titlesets` WHERE `char_id` = '%d'", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `keyring` WHERE `char_id` = '%d'", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `faction_values` WHERE `char_id` = '%d'", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `instance_list_player` WHERE `charid` = '%d'", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `character_data` WHERE `id` = '%d'", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `character_skills` WHERE `id` = %u", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `character_languages` WHERE `id` = %u", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `character_bind` WHERE `id` = %u", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `character_alternate_abilities` WHERE `id` = %u", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `character_currency` WHERE `id` = %u", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `character_data` WHERE `id` = %u", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `character_spells` WHERE `id` = %u", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `character_memmed_spells` WHERE `id` = %u", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `character_disciplines` WHERE `id` = %u", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `character_material` WHERE `id` = %u", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `character_tribute` WHERE `id` = %u", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `character_bandolier` WHERE `id` = %u", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `character_potionbelt` WHERE `id` = %u", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `character_inspect_messages` WHERE `id` = %u", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `character_leadership_abilities` WHERE `id` = %u", charid); QueryDatabase(query);
|
||||
query = StringFormat("DELETE FROM `character_alt_currency` WHERE `char_id` = '%d'", charid); QueryDatabase(query);
|
||||
std::string delete_type = "hard-deleted";
|
||||
if (RuleB(Character, SoftDeletes)) {
|
||||
delete_type = "soft-deleted";
|
||||
std::string query = fmt::format(
|
||||
SQL(
|
||||
UPDATE
|
||||
character_data
|
||||
SET
|
||||
name = SUBSTRING(CONCAT(name, '-deleted-', UNIX_TIMESTAMP()), 1, 64),
|
||||
deleted_at = NOW()
|
||||
WHERE
|
||||
id = '{}'
|
||||
),
|
||||
character_id
|
||||
);
|
||||
|
||||
QueryDatabase(query);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
LogInfo("DeleteCharacter | Character [{}] ({}) is being [{}]", character_name, character_id, delete_type);
|
||||
|
||||
for (const auto& iter : DatabaseSchema::GetCharacterTables()) {
|
||||
std::string table_name = iter.first;
|
||||
std::string character_id_column_name = iter.second;
|
||||
|
||||
QueryDatabase(fmt::format("DELETE FROM {} WHERE {} = {}", table_name, character_id_column_name, character_id));
|
||||
}
|
||||
|
||||
#ifdef BOTS
|
||||
query = StringFormat("DELETE FROM `guild_members` WHERE `char_id` = '%d' AND GetMobTypeById(%i) = 'C'", charid); // note: only use of GetMobTypeById()
|
||||
#else
|
||||
query = StringFormat("DELETE FROM `guild_members` WHERE `char_id` = '%d'", charid);
|
||||
#endif
|
||||
query = StringFormat("DELETE FROM `guild_members` WHERE `char_id` = '%d' AND GetMobTypeById(%i) = 'C'", character_id); // note: only use of GetMobTypeById()
|
||||
QueryDatabase(query);
|
||||
#endif
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -652,6 +695,7 @@ bool Database::SaveCharacterCreate(uint32 character_id, uint32 account_id, Playe
|
||||
pp->RestTimer // " RestTimer) "
|
||||
);
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
/* Save Bind Points */
|
||||
query = StringFormat("REPLACE INTO `character_bind` (id, zone_id, instance_id, x, y, z, heading, slot)"
|
||||
" VALUES (%u, %u, %u, %f, %f, %f, %f, %i), "
|
||||
@@ -707,7 +751,7 @@ bool Database::SaveCharacterCreate(uint32 character_id, uint32 account_id, Playe
|
||||
}
|
||||
|
||||
/* This only for new Character creation storing */
|
||||
bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, EQEmu::InventoryProfile* inv) {
|
||||
bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, EQ::InventoryProfile* inv) {
|
||||
uint32 charid = 0;
|
||||
char zone[50];
|
||||
float x, y, z;
|
||||
@@ -735,8 +779,8 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, EQEmu
|
||||
|
||||
/* Insert starting inventory... */
|
||||
std::string invquery;
|
||||
for (int16 i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= EQEmu::invbag::BANK_BAGS_END;) {
|
||||
const EQEmu::ItemInstance* newinv = inv->GetItem(i);
|
||||
for (int16 i = EQ::invslot::EQUIPMENT_BEGIN; i <= EQ::invbag::BANK_BAGS_END;) {
|
||||
const EQ::ItemInstance* newinv = inv->GetItem(i);
|
||||
if (newinv) {
|
||||
invquery = StringFormat("INSERT INTO `inventory` (charid, slotid, itemid, charges, color) VALUES (%u, %i, %u, %i, %u)",
|
||||
charid, i, newinv->GetItem()->ID, newinv->GetCharges(), newinv->GetColor());
|
||||
@@ -744,16 +788,16 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, EQEmu
|
||||
auto results = QueryDatabase(invquery);
|
||||
}
|
||||
|
||||
if (i == EQEmu::invslot::slotCursor) {
|
||||
i = EQEmu::invbag::GENERAL_BAGS_BEGIN;
|
||||
if (i == EQ::invslot::slotCursor) {
|
||||
i = EQ::invbag::GENERAL_BAGS_BEGIN;
|
||||
continue;
|
||||
}
|
||||
else if (i == EQEmu::invbag::CURSOR_BAG_END) {
|
||||
i = EQEmu::invslot::BANK_BEGIN;
|
||||
else if (i == EQ::invbag::CURSOR_BAG_END) {
|
||||
i = EQ::invslot::BANK_BEGIN;
|
||||
continue;
|
||||
}
|
||||
else if (i == EQEmu::invslot::BANK_END) {
|
||||
i = EQEmu::invbag::BANK_BAGS_BEGIN;
|
||||
else if (i == EQ::invslot::BANK_END) {
|
||||
i = EQ::invbag::BANK_BAGS_BEGIN;
|
||||
continue;
|
||||
}
|
||||
i++;
|
||||
@@ -881,6 +925,38 @@ void Database::GetCharName(uint32 char_id, char* name) {
|
||||
}
|
||||
}
|
||||
|
||||
const char* Database::GetCharNameByID(uint32 char_id) {
|
||||
std::string query = fmt::format("SELECT `name` FROM `character_data` WHERE id = {}", char_id);
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
if (!results.Success()) {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (results.RowCount() == 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
auto row = results.begin();
|
||||
return row[0];
|
||||
}
|
||||
|
||||
const char* Database::GetNPCNameByID(uint32 npc_id) {
|
||||
std::string query = fmt::format("SELECT `name` FROM `npc_types` WHERE id = {}", npc_id);
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
if (!results.Success()) {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (results.RowCount() == 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
auto row = results.begin();
|
||||
return row[0];
|
||||
}
|
||||
|
||||
bool Database::LoadVariables() {
|
||||
auto results = QueryDatabase(StringFormat("SELECT varname, value, unix_timestamp() FROM variables where unix_timestamp(ts) >= %d", varcache.last_update));
|
||||
|
||||
@@ -1226,7 +1302,7 @@ uint32 Database::GetAccountIDFromLSID(
|
||||
{
|
||||
uint32 account_id = 0;
|
||||
auto query = fmt::format(
|
||||
"SELECT id, name, status FROM account WHERE lsaccount_id = {0} AND ls_id = '{1}'",
|
||||
"SELECT id, `name`, status FROM account WHERE lsaccount_id = {0} AND ls_id = '{1}'",
|
||||
in_loginserver_account_id,
|
||||
in_loginserver_id
|
||||
);
|
||||
@@ -1257,7 +1333,7 @@ uint32 Database::GetAccountIDFromLSID(
|
||||
|
||||
void Database::GetAccountFromID(uint32 id, char* oAccountName, int16* oStatus) {
|
||||
|
||||
std::string query = StringFormat("SELECT name, status FROM account WHERE id=%i", id);
|
||||
std::string query = StringFormat("SELECT `name`, status FROM account WHERE id=%i", id);
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
if (!results.Success()){
|
||||
@@ -2114,6 +2190,44 @@ uint32 Database::GetGuildIDByCharID(uint32 character_id)
|
||||
return atoi(row[0]);
|
||||
}
|
||||
|
||||
uint32 Database::GetGroupIDByCharID(uint32 character_id)
|
||||
{
|
||||
std::string query = fmt::format(
|
||||
SQL(
|
||||
SELECT groupid
|
||||
FROM group_id
|
||||
WHERE charid = '{}'
|
||||
),
|
||||
character_id
|
||||
);
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
if (!results.Success())
|
||||
return 0;
|
||||
|
||||
if (results.RowCount() == 0)
|
||||
return 0;
|
||||
|
||||
auto row = results.begin();
|
||||
return atoi(row[0]);
|
||||
}
|
||||
|
||||
uint32 Database::GetRaidIDByCharID(uint32 character_id) {
|
||||
std::string query = fmt::format(
|
||||
SQL(
|
||||
SELECT raidid
|
||||
FROM raid_members
|
||||
WHERE charid = '{}'
|
||||
),
|
||||
character_id
|
||||
);
|
||||
auto results = QueryDatabase(query);
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
return atoi(row[0]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param log_settings
|
||||
*/
|
||||
@@ -2291,3 +2405,4 @@ int Database::GetInstanceID(uint32 char_id, uint32 zone_id) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+13
-8
@@ -40,7 +40,7 @@
|
||||
class MySQLRequestResult;
|
||||
class Client;
|
||||
|
||||
namespace EQEmu
|
||||
namespace EQ
|
||||
{
|
||||
class InventoryProfile;
|
||||
}
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
|
||||
bool AddToNameFilter(const char* name);
|
||||
bool CreateCharacter(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* name);
|
||||
bool DeleteCharacter(char* character_name);
|
||||
bool MoveCharacterToZone(const char* charname, const char* zonename);
|
||||
bool MoveCharacterToZone(const char* charname, const char* zonename,uint32 zoneid);
|
||||
bool MoveCharacterToZone(uint32 iCharID, const char* iZonename);
|
||||
@@ -115,12 +115,12 @@ public:
|
||||
bool SaveCharacterCreate(uint32 character_id, uint32 account_id, PlayerProfile_Struct* pp);
|
||||
bool SetHackerFlag(const char* accountname, const char* charactername, const char* hacked);
|
||||
bool SetMQDetectionFlag(const char* accountname, const char* charactername, const char* hacked, const char* zone);
|
||||
bool StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, EQEmu::InventoryProfile* inv);
|
||||
bool StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, EQ::InventoryProfile* inv);
|
||||
bool UpdateName(const char* oldname, const char* newname);
|
||||
|
||||
/* General Information Queries */
|
||||
|
||||
bool AddBannedIP(char* bannedIP, const char* notes); //Add IP address to the Banned_IPs table.
|
||||
bool AddBannedIP(char* bannedIP, const char* notes); //Add IP address to the banned_ips table.
|
||||
bool AddGMIP(char* ip_address, char* name);
|
||||
bool CheckBannedIPs(const char* loginIP); //Check incoming connection against banned IP table.
|
||||
bool CheckGMIPs(const char* loginIP, uint32 account_id);
|
||||
@@ -133,9 +133,13 @@ public:
|
||||
uint32 GetCharacterID(const char *name);
|
||||
uint32 GetCharacterInfo(const char* iName, uint32* oAccID = 0, uint32* oZoneID = 0, uint32* oInstanceID = 0, float* oX = 0, float* oY = 0, float* oZ = 0);
|
||||
uint32 GetGuildIDByCharID(uint32 char_id);
|
||||
uint32 GetGroupIDByCharID(uint32 char_id);
|
||||
uint32 GetRaidIDByCharID(uint32 char_id);
|
||||
|
||||
void GetAccountName(uint32 accountid, char* name, uint32* oLSAccountID = 0);
|
||||
void GetCharName(uint32 char_id, char* name);
|
||||
const char *GetCharNameByID(uint32 char_id);
|
||||
const char *GetNPCNameByID(uint32 npc_id);
|
||||
void LoginIP(uint32 AccountID, const char* LoginIP);
|
||||
|
||||
/* Instancing */
|
||||
@@ -179,6 +183,7 @@ public:
|
||||
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 SetLocalPassword(uint32 accid, const char* password);
|
||||
bool UpdateLiveChar(char* charname, uint32 account_id);
|
||||
|
||||
@@ -191,19 +196,19 @@ public:
|
||||
|
||||
void GetAccountFromID(uint32 id, char* oAccountName, int16* oStatus);
|
||||
void SetAgreementFlag(uint32 acctid);
|
||||
|
||||
|
||||
int GetIPExemption(std::string account_ip);
|
||||
|
||||
int GetInstanceID(uint32 char_id, uint32 zone_id);
|
||||
|
||||
|
||||
/* Groups */
|
||||
|
||||
|
||||
char* GetGroupLeaderForLogin(const char* name,char* leaderbuf);
|
||||
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 GetGroupID(const char* name);
|
||||
|
||||
|
||||
void ClearGroup(uint32 gid = 0);
|
||||
void ClearGroupLeader(uint32 gid = 0);
|
||||
void SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ismerc = false);
|
||||
|
||||
@@ -0,0 +1,569 @@
|
||||
/**
|
||||
* EQEmulator: Everquest Server Emulator
|
||||
* Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
* are required to give you total support for your newly bought product;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
#include <cstdio>
|
||||
#include <iterator>
|
||||
#include "database_dump_service.h"
|
||||
#include "../eqemu_logsys.h"
|
||||
#include "../string_util.h"
|
||||
#include "../eqemu_config.h"
|
||||
#include "../database_schema.h"
|
||||
#include "../file_util.h"
|
||||
|
||||
#include <ctime>
|
||||
|
||||
#if _WIN32
|
||||
#include <windows.h>
|
||||
#else
|
||||
|
||||
#include <sys/time.h>
|
||||
|
||||
#endif
|
||||
|
||||
#define DATABASE_DUMP_PATH "backups/"
|
||||
|
||||
/**
|
||||
* @param cmd
|
||||
* @param return_result
|
||||
* @return
|
||||
*/
|
||||
std::string DatabaseDumpService::execute(const std::string &cmd, bool return_result = true)
|
||||
{
|
||||
const char *file_name = "db-exec-result.txt";
|
||||
|
||||
if (return_result) {
|
||||
#ifdef _WINDOWS
|
||||
std::system((cmd + " > " + file_name + " 2>&1").c_str());
|
||||
#else
|
||||
std::system((cmd + " > " + file_name).c_str());
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
std::system((cmd).c_str());
|
||||
}
|
||||
|
||||
std::string result;
|
||||
|
||||
if (return_result) {
|
||||
std::ifstream file(file_name);
|
||||
result = {std::istreambuf_iterator<char>(file), std::istreambuf_iterator<char>()};
|
||||
std::remove(file_name);
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
bool DatabaseDumpService::IsMySQLInstalled()
|
||||
{
|
||||
std::string version_output = GetMySQLVersion();
|
||||
|
||||
return version_output.find("mysql") != std::string::npos && version_output.find("Ver") != std::string::npos;
|
||||
}
|
||||
|
||||
/**
|
||||
* Linux
|
||||
* @return bool
|
||||
*/
|
||||
bool DatabaseDumpService::IsTarAvailable()
|
||||
{
|
||||
std::string version_output = execute("tar --version");
|
||||
|
||||
return version_output.find("GNU tar") != std::string::npos;
|
||||
}
|
||||
|
||||
/**
|
||||
* Windows
|
||||
* @return bool
|
||||
*/
|
||||
bool DatabaseDumpService::Is7ZipAvailable()
|
||||
{
|
||||
std::string version_output = execute("7z --help");
|
||||
|
||||
return version_output.find("7-Zip") != std::string::npos;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
bool DatabaseDumpService::HasCompressionBinary()
|
||||
{
|
||||
return IsTarAvailable() || Is7ZipAvailable();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
std::string DatabaseDumpService::GetMySQLVersion()
|
||||
{
|
||||
std::string version_output = execute("mysql --version");
|
||||
|
||||
return trim(version_output);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
std::string DatabaseDumpService::GetBaseMySQLDumpCommand()
|
||||
{
|
||||
auto config = EQEmuConfig::get();
|
||||
|
||||
return fmt::format(
|
||||
"mysqldump -u {} -p{} -h {} {}",
|
||||
config->DatabaseUsername,
|
||||
config->DatabasePassword,
|
||||
config->DatabaseHost,
|
||||
config->DatabaseDB
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
std::string DatabaseDumpService::GetPlayerTablesList()
|
||||
{
|
||||
std::string tables_list;
|
||||
std::vector<std::string> tables = DatabaseSchema::GetPlayerTables();
|
||||
for (const auto &table : tables) {
|
||||
tables_list += table + " ";
|
||||
}
|
||||
|
||||
return trim(tables_list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
std::string DatabaseDumpService::GetLoginTableList()
|
||||
{
|
||||
std::string tables_list;
|
||||
std::vector<std::string> tables = DatabaseSchema::GetLoginTables();
|
||||
for (const auto &table : tables) {
|
||||
tables_list += table + " ";
|
||||
}
|
||||
|
||||
return trim(tables_list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
std::string DatabaseDumpService::GetQueryServTables()
|
||||
{
|
||||
std::string tables_list;
|
||||
std::vector<std::string> tables = DatabaseSchema::GetQueryServerTables();
|
||||
for (const auto &table : tables) {
|
||||
tables_list += table + " ";
|
||||
}
|
||||
|
||||
return trim(tables_list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
std::string DatabaseDumpService::GetSystemTablesList()
|
||||
{
|
||||
std::string tables_list;
|
||||
|
||||
std::vector<std::string> tables = DatabaseSchema::GetServerTables();
|
||||
for (const auto &table : tables) {
|
||||
tables_list += table + " ";
|
||||
}
|
||||
|
||||
tables = DatabaseSchema::GetVersionTables();
|
||||
for (const auto &table : tables) {
|
||||
tables_list += table + " ";
|
||||
}
|
||||
|
||||
return trim(tables_list);
|
||||
}
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
std::string DatabaseDumpService::GetStateTablesList()
|
||||
{
|
||||
std::string tables_list;
|
||||
|
||||
std::vector<std::string> tables = DatabaseSchema::GetStateTables();
|
||||
for (const auto &table : tables) {
|
||||
tables_list += table + " ";
|
||||
}
|
||||
|
||||
return trim(tables_list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
std::string DatabaseDumpService::GetContentTablesList()
|
||||
{
|
||||
std::string tables_list;
|
||||
|
||||
std::vector<std::string> tables = DatabaseSchema::GetContentTables();
|
||||
for (const auto &table : tables) {
|
||||
tables_list += table + " ";
|
||||
}
|
||||
|
||||
return trim(tables_list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
std::string GetDumpDate()
|
||||
{
|
||||
|
||||
time_t now = time(nullptr);
|
||||
struct tm time_struct{};
|
||||
char buf[80];
|
||||
time_struct = *localtime(&now);
|
||||
strftime(buf, sizeof(buf), "%Y-%m-%d", &time_struct);
|
||||
|
||||
std::string time = buf;
|
||||
|
||||
return time;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
std::string DatabaseDumpService::GetSetDumpPath()
|
||||
{
|
||||
return !GetDumpPath().empty() ? GetDumpPath() : DATABASE_DUMP_PATH;
|
||||
}
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
std::string DatabaseDumpService::GetDumpFileNameWithPath()
|
||||
{
|
||||
return GetSetDumpPath() + GetDumpFileName();
|
||||
}
|
||||
|
||||
void DatabaseDumpService::Dump()
|
||||
{
|
||||
if (!IsMySQLInstalled()) {
|
||||
LogError("MySQL is not installed; Please check your PATH for a valid MySQL installation");
|
||||
return;
|
||||
}
|
||||
|
||||
if (IsDumpDropTableSyntaxOnly()) {
|
||||
SetDumpOutputToConsole(true);
|
||||
}
|
||||
|
||||
if (IsDumpOutputToConsole()) {
|
||||
LogSys.SilenceConsoleLogging();
|
||||
}
|
||||
|
||||
LogInfo("MySQL installed [{}]", GetMySQLVersion());
|
||||
|
||||
SetDumpFileName(EQEmuConfig::get()->DatabaseDB + '-' + GetDumpDate());
|
||||
|
||||
auto config = EQEmuConfig::get();
|
||||
|
||||
LogInfo(
|
||||
"Database [{}] Host [{}] Username [{}]",
|
||||
config->DatabaseDB,
|
||||
config->DatabaseHost,
|
||||
config->DatabaseUsername
|
||||
);
|
||||
|
||||
std::string options = "--allow-keywords --extended-insert";
|
||||
|
||||
if (IsDumpWithNoData()) {
|
||||
options += " --no-data";
|
||||
}
|
||||
|
||||
if (!IsDumpTableLock()) {
|
||||
options += " --skip-lock-tables";
|
||||
}
|
||||
|
||||
std::string tables_to_dump;
|
||||
std::string dump_descriptor;
|
||||
|
||||
if (!IsDumpAllTables()) {
|
||||
if (IsDumpPlayerTables()) {
|
||||
tables_to_dump += GetPlayerTablesList() + " ";
|
||||
dump_descriptor += "-player";
|
||||
}
|
||||
|
||||
if (IsDumpSystemTables()) {
|
||||
tables_to_dump += GetSystemTablesList() + " ";
|
||||
dump_descriptor += "-system";
|
||||
}
|
||||
|
||||
if (IsDumpStateTables()) {
|
||||
tables_to_dump += GetStateTablesList() + " ";
|
||||
dump_descriptor += "-state";
|
||||
}
|
||||
|
||||
if (IsDumpContentTables()) {
|
||||
tables_to_dump += GetContentTablesList() + " ";
|
||||
dump_descriptor += "-content";
|
||||
}
|
||||
|
||||
if (IsDumpLoginServerTables()) {
|
||||
tables_to_dump += GetLoginTableList() + " ";
|
||||
dump_descriptor += "-login";
|
||||
}
|
||||
|
||||
if (IsDumpQueryServerTables()) {
|
||||
tables_to_dump += GetQueryServTables();
|
||||
dump_descriptor += "-queryserv";
|
||||
}
|
||||
}
|
||||
|
||||
if (!dump_descriptor.empty()) {
|
||||
SetDumpFileName(GetDumpFileName() + dump_descriptor);
|
||||
}
|
||||
|
||||
/**
|
||||
* If we are dumping to stdout then we don't generate a file
|
||||
*/
|
||||
std::string pipe_file;
|
||||
if (!IsDumpOutputToConsole()) {
|
||||
pipe_file = fmt::format(" > {}.sql", GetDumpFileNameWithPath());
|
||||
}
|
||||
|
||||
std::string execute_command = fmt::format(
|
||||
"{} {} {} {}",
|
||||
GetBaseMySQLDumpCommand(),
|
||||
options,
|
||||
tables_to_dump,
|
||||
pipe_file
|
||||
);
|
||||
|
||||
if (!FileUtil::exists(GetSetDumpPath()) && !IsDumpOutputToConsole()) {
|
||||
FileUtil::mkdir(GetSetDumpPath());
|
||||
}
|
||||
|
||||
if (IsDumpDropTableSyntaxOnly()) {
|
||||
std::vector<std::string> tables = SplitString(tables_to_dump, ' ');
|
||||
|
||||
for (auto &table : tables) {
|
||||
std::cout << "DROP TABLE IF EXISTS `" << table << "`;" << std::endl;
|
||||
}
|
||||
|
||||
if (tables_to_dump.empty()) {
|
||||
std::cerr << "No tables were specified" << std::endl;
|
||||
}
|
||||
}
|
||||
else {
|
||||
std::string execution_result = execute(execute_command, IsDumpOutputToConsole());
|
||||
if (!execution_result.empty()) {
|
||||
std::cout << execution_result;
|
||||
}
|
||||
}
|
||||
|
||||
if (!tables_to_dump.empty()) {
|
||||
LogInfo("Dumping Tables [{}]", tables_to_dump);
|
||||
}
|
||||
|
||||
LogInfo("Database dump created at [{}.sql]", GetDumpFileNameWithPath());
|
||||
|
||||
if (IsDumpWithCompression() && !IsDumpOutputToConsole()) {
|
||||
if (HasCompressionBinary()) {
|
||||
LogInfo("Compression requested... Compressing dump [{}.sql]", GetDumpFileNameWithPath());
|
||||
|
||||
if (IsTarAvailable()) {
|
||||
execute(
|
||||
fmt::format(
|
||||
"tar -zcvf {}.tar.gz -C {} {}.sql",
|
||||
GetDumpFileNameWithPath(),
|
||||
GetSetDumpPath(),
|
||||
GetDumpFileName()
|
||||
)
|
||||
);
|
||||
LogInfo("Compressed dump created at [{}.tar.gz]", GetDumpFileNameWithPath());
|
||||
}
|
||||
else if (Is7ZipAvailable()) {
|
||||
execute(
|
||||
fmt::format(
|
||||
"7z a -t7z {}.zip {}.sql",
|
||||
GetDumpFileNameWithPath(),
|
||||
GetDumpFileNameWithPath()
|
||||
)
|
||||
);
|
||||
LogInfo("Compressed dump created at [{}.zip]", GetDumpFileNameWithPath());
|
||||
}
|
||||
else {
|
||||
LogInfo("Compression requested, but no available compression binary was found");
|
||||
}
|
||||
}
|
||||
else {
|
||||
LogWarning("Compression requested but binary not found... Skipping...");
|
||||
}
|
||||
}
|
||||
|
||||
// LogDebug("[{}] dump-to-console", IsDumpOutputToConsole());
|
||||
// LogDebug("[{}] dump-path", GetSetDumpPath());
|
||||
// LogDebug("[{}] compression", (IsDumpWithCompression() ? "true" : "false"));
|
||||
// LogDebug("[{}] query-serv", (IsDumpQueryServerTables() ? "true" : "false"));
|
||||
// LogDebug("[{}] has-compression-binary", (HasCompressionBinary() ? "true" : "false"));
|
||||
// LogDebug("[{}] content", (IsDumpContentTables() ? "true" : "false"));
|
||||
// LogDebug("[{}] no-data", (IsDumpWithNoData() ? "true" : "false"));
|
||||
// LogDebug("[{}] login", (IsDumpLoginServerTables() ? "true" : "false"));
|
||||
// LogDebug("[{}] player", (IsDumpPlayerTables() ? "true" : "false"));
|
||||
// LogDebug("[{}] system", (IsDumpSystemTables() ? "true" : "false"));
|
||||
}
|
||||
|
||||
bool DatabaseDumpService::IsDumpSystemTables() const
|
||||
{
|
||||
return dump_system_tables;
|
||||
}
|
||||
|
||||
void DatabaseDumpService::SetDumpSystemTables(bool dump_system_tables)
|
||||
{
|
||||
DatabaseDumpService::dump_system_tables = dump_system_tables;
|
||||
}
|
||||
|
||||
bool DatabaseDumpService::IsDumpContentTables() const
|
||||
{
|
||||
return dump_content_tables;
|
||||
}
|
||||
|
||||
void DatabaseDumpService::SetDumpContentTables(bool dump_content_tables)
|
||||
{
|
||||
DatabaseDumpService::dump_content_tables = dump_content_tables;
|
||||
}
|
||||
|
||||
bool DatabaseDumpService::IsDumpPlayerTables() const
|
||||
{
|
||||
return dump_player_tables;
|
||||
}
|
||||
|
||||
void DatabaseDumpService::SetDumpPlayerTables(bool dump_player_tables)
|
||||
{
|
||||
DatabaseDumpService::dump_player_tables = dump_player_tables;
|
||||
}
|
||||
|
||||
bool DatabaseDumpService::IsDumpLoginServerTables() const
|
||||
{
|
||||
return dump_login_server_tables;
|
||||
}
|
||||
|
||||
void DatabaseDumpService::SetDumpLoginServerTables(bool dump_login_server_tables)
|
||||
{
|
||||
DatabaseDumpService::dump_login_server_tables = dump_login_server_tables;
|
||||
}
|
||||
|
||||
bool DatabaseDumpService::IsDumpWithNoData() const
|
||||
{
|
||||
return dump_with_no_data;
|
||||
}
|
||||
|
||||
void DatabaseDumpService::SetDumpWithNoData(bool dump_with_no_data)
|
||||
{
|
||||
DatabaseDumpService::dump_with_no_data = dump_with_no_data;
|
||||
}
|
||||
|
||||
bool DatabaseDumpService::IsDumpAllTables() const
|
||||
{
|
||||
return dump_all_tables;
|
||||
}
|
||||
|
||||
void DatabaseDumpService::SetDumpAllTables(bool dump_all_tables)
|
||||
{
|
||||
DatabaseDumpService::dump_all_tables = dump_all_tables;
|
||||
}
|
||||
|
||||
bool DatabaseDumpService::IsDumpTableLock() const
|
||||
{
|
||||
return dump_table_lock;
|
||||
}
|
||||
|
||||
void DatabaseDumpService::SetDumpTableLock(bool dump_table_lock)
|
||||
{
|
||||
DatabaseDumpService::dump_table_lock = dump_table_lock;
|
||||
}
|
||||
|
||||
bool DatabaseDumpService::IsDumpWithCompression() const
|
||||
{
|
||||
return dump_with_compression;
|
||||
}
|
||||
|
||||
void DatabaseDumpService::SetDumpWithCompression(bool dump_with_compression)
|
||||
{
|
||||
DatabaseDumpService::dump_with_compression = dump_with_compression;
|
||||
}
|
||||
|
||||
const std::string &DatabaseDumpService::GetDumpPath() const
|
||||
{
|
||||
return dump_path;
|
||||
}
|
||||
|
||||
void DatabaseDumpService::SetDumpPath(const std::string &dump_path)
|
||||
{
|
||||
DatabaseDumpService::dump_path = dump_path;
|
||||
}
|
||||
|
||||
void DatabaseDumpService::SetDumpFileName(const std::string &dump_file_name)
|
||||
{
|
||||
DatabaseDumpService::dump_file_name = dump_file_name;
|
||||
}
|
||||
|
||||
const std::string &DatabaseDumpService::GetDumpFileName() const
|
||||
{
|
||||
return dump_file_name;
|
||||
}
|
||||
|
||||
bool DatabaseDumpService::IsDumpQueryServerTables() const
|
||||
{
|
||||
return dump_query_server_tables;
|
||||
}
|
||||
|
||||
void DatabaseDumpService::SetDumpQueryServerTables(bool dump_query_server_tables)
|
||||
{
|
||||
DatabaseDumpService::dump_query_server_tables = dump_query_server_tables;
|
||||
}
|
||||
|
||||
bool DatabaseDumpService::IsDumpOutputToConsole() const
|
||||
{
|
||||
return dump_output_to_console;
|
||||
}
|
||||
|
||||
void DatabaseDumpService::SetDumpOutputToConsole(bool dump_output_to_console)
|
||||
{
|
||||
DatabaseDumpService::dump_output_to_console = dump_output_to_console;
|
||||
}
|
||||
|
||||
bool DatabaseDumpService::IsDumpDropTableSyntaxOnly() const
|
||||
{
|
||||
return dump_drop_table_syntax_only;
|
||||
}
|
||||
|
||||
void DatabaseDumpService::SetDumpDropTableSyntaxOnly(bool dump_drop_table_syntax_only)
|
||||
{
|
||||
DatabaseDumpService::dump_drop_table_syntax_only = dump_drop_table_syntax_only;
|
||||
}
|
||||
|
||||
bool DatabaseDumpService::IsDumpStateTables() const
|
||||
{
|
||||
return dump_state_tables;
|
||||
}
|
||||
|
||||
void DatabaseDumpService::SetDumpStateTables(bool dump_state_tables)
|
||||
{
|
||||
DatabaseDumpService::dump_state_tables = dump_state_tables;
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
/**
|
||||
* EQEmulator: Everquest Server Emulator
|
||||
* Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
* are required to give you total support for your newly bought product;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_DATABASE_DUMP_SERVICE_H
|
||||
#define EQEMU_DATABASE_DUMP_SERVICE_H
|
||||
|
||||
|
||||
class DatabaseDumpService {
|
||||
public:
|
||||
void Dump();
|
||||
bool IsDumpAllTables() const;
|
||||
void SetDumpAllTables(bool dump_all_tables);
|
||||
bool IsDumpWithNoData() const;
|
||||
void SetDumpWithNoData(bool dump_with_no_data);
|
||||
bool IsDumpSystemTables() const;
|
||||
void SetDumpSystemTables(bool dump_system_tables);
|
||||
bool IsDumpContentTables() const;
|
||||
void SetDumpContentTables(bool dump_content_tables);
|
||||
bool IsDumpPlayerTables() const;
|
||||
void SetDumpPlayerTables(bool dump_player_tables);
|
||||
bool IsDumpLoginServerTables() const;
|
||||
void SetDumpLoginServerTables(bool dump_login_server_tables);
|
||||
bool IsDumpTableLock() const;
|
||||
void SetDumpTableLock(bool dump_table_lock);
|
||||
bool IsDumpWithCompression() const;
|
||||
void SetDumpWithCompression(bool dump_with_compression);
|
||||
const std::string &GetDumpPath() const;
|
||||
void SetDumpPath(const std::string &dump_path);
|
||||
const std::string &GetDumpFileName() const;
|
||||
void SetDumpFileName(const std::string &dump_file_name);
|
||||
bool IsDumpQueryServerTables() const;
|
||||
void SetDumpQueryServerTables(bool dump_query_server_tables);
|
||||
bool IsDumpOutputToConsole() const;
|
||||
void SetDumpOutputToConsole(bool dump_output_to_console);
|
||||
bool IsDumpDropTableSyntaxOnly() const;
|
||||
void SetDumpDropTableSyntaxOnly(bool dump_drop_table_syntax_only);
|
||||
bool IsDumpStateTables() const;
|
||||
void SetDumpStateTables(bool dump_state_tables);
|
||||
|
||||
private:
|
||||
bool dump_all_tables = false;
|
||||
bool dump_state_tables = false;
|
||||
bool dump_system_tables = false;
|
||||
bool dump_content_tables = false;
|
||||
bool dump_player_tables = false;
|
||||
bool dump_query_server_tables = false;
|
||||
bool dump_login_server_tables = false;
|
||||
bool dump_with_no_data = false;
|
||||
bool dump_table_lock = false;
|
||||
bool dump_with_compression = false;
|
||||
bool dump_output_to_console = false;
|
||||
bool dump_drop_table_syntax_only = false;
|
||||
std::string dump_path;
|
||||
std::string dump_file_name;
|
||||
|
||||
std::string execute(const std::string &cmd, bool return_result);
|
||||
bool IsMySQLInstalled();
|
||||
std::string GetMySQLVersion();
|
||||
std::string GetBaseMySQLDumpCommand();
|
||||
std::string GetPlayerTablesList();
|
||||
std::string GetSystemTablesList();
|
||||
std::string GetStateTablesList();
|
||||
std::string GetContentTablesList();
|
||||
std::string GetLoginTableList();
|
||||
bool IsTarAvailable();
|
||||
bool Is7ZipAvailable();
|
||||
bool HasCompressionBinary();
|
||||
std::string GetDumpFileNameWithPath();
|
||||
std::string GetSetDumpPath();
|
||||
std::string GetQueryServTables();
|
||||
};
|
||||
|
||||
|
||||
#endif //EQEMU_DATABASE_DUMP_SERVICE_H
|
||||
@@ -189,7 +189,7 @@ namespace Convert {
|
||||
/*002*/ uint32 HP;
|
||||
/*006*/ uint32 Mana;
|
||||
/*010*/ Convert::SpellBuff_Struct Buffs[BUFF_COUNT];
|
||||
/*510*/ uint32 Items[EQEmu::textures::materialCount];
|
||||
/*510*/ uint32 Items[EQ::textures::materialCount];
|
||||
/*546*/ char Name[64];
|
||||
/*610*/
|
||||
};
|
||||
@@ -230,9 +230,9 @@ namespace Convert {
|
||||
/*0304*/ uint8 ability_time_minutes;
|
||||
/*0305*/ uint8 ability_time_hours; //place holder
|
||||
/*0306*/ uint8 unknown0306[6]; // @bp Spacer/Flag?
|
||||
/*0312*/ uint32 item_material[EQEmu::textures::materialCount]; // Item texture/material of worn/held items
|
||||
/*0312*/ uint32 item_material[EQ::textures::materialCount]; // Item texture/material of worn/held items
|
||||
/*0348*/ uint8 unknown0348[44];
|
||||
/*0392*/ Convert::Color_Struct item_tint[EQEmu::textures::materialCount];
|
||||
/*0392*/ Convert::Color_Struct item_tint[EQ::textures::materialCount];
|
||||
/*0428*/ Convert::AA_Array aa_array[MAX_PP_AA_ARRAY];
|
||||
/*2348*/ float unknown2384; //seen ~128, ~47
|
||||
/*2352*/ char servername[32]; // length probably not right
|
||||
@@ -1396,7 +1396,7 @@ bool Database::CheckDatabaseConvertPPDeblob(){
|
||||
if (rquery != ""){ results = QueryDatabase(rquery); }
|
||||
/* Run Material Color Convert */
|
||||
first_entry = 0; rquery = "";
|
||||
for (i = EQEmu::textures::textureBegin; i < EQEmu::textures::materialCount; i++){
|
||||
for (i = EQ::textures::textureBegin; i < EQ::textures::materialCount; i++){
|
||||
if (pp->item_tint[i].color > 0){
|
||||
if (first_entry != 1){
|
||||
rquery = StringFormat("REPLACE INTO `character_material` (id, slot, blue, green, red, use_tint, color) VALUES (%u, %u, %u, %u, %u, %u, %u)", character_id, i, pp->item_tint[i].rgb.blue, pp->item_tint[i].rgb.green, pp->item_tint[i].rgb.red, pp->item_tint[i].rgb.use_tint, pp->item_tint[i].color);
|
||||
|
||||
@@ -97,42 +97,53 @@ bool Database::CheckInstanceExists(uint16 instance_id) {
|
||||
bool Database::CheckInstanceExpired(uint16 instance_id)
|
||||
{
|
||||
|
||||
int32 start_time = 0;
|
||||
int32 duration = 0;
|
||||
int32 start_time = 0;
|
||||
int32 duration = 0;
|
||||
uint32 never_expires = 0;
|
||||
|
||||
std::string query = StringFormat("SELECT start_time, duration, never_expires FROM instance_list WHERE id=%u", instance_id);
|
||||
std::string query = StringFormat(
|
||||
"SELECT start_time, duration, never_expires FROM instance_list WHERE id=%u",
|
||||
instance_id
|
||||
);
|
||||
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
if (!results.Success())
|
||||
if (!results.Success()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (results.RowCount() == 0)
|
||||
if (results.RowCount() == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
start_time = atoi(row[0]);
|
||||
duration = atoi(row[1]);
|
||||
start_time = atoi(row[0]);
|
||||
duration = atoi(row[1]);
|
||||
never_expires = atoi(row[2]);
|
||||
|
||||
if (never_expires == 1)
|
||||
if (never_expires == 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
timeval tv;
|
||||
timeval tv{};
|
||||
gettimeofday(&tv, nullptr);
|
||||
|
||||
if ((start_time + duration) <= tv.tv_sec)
|
||||
return true;
|
||||
return (start_time + duration) <= tv.tv_sec;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Database::CreateInstance(uint16 instance_id, uint32 zone_id, uint32 version, uint32 duration)
|
||||
{
|
||||
std::string query = StringFormat("INSERT INTO instance_list (id, zone, version, start_time, duration)"
|
||||
" values(%lu, %lu, %lu, UNIX_TIMESTAMP(), %lu)",
|
||||
(unsigned long)instance_id, (unsigned long)zone_id, (unsigned long)version, (unsigned long)duration);
|
||||
std::string query = StringFormat(
|
||||
"INSERT INTO instance_list (id, zone, version, start_time, duration)"
|
||||
" values (%u, %u, %u, UNIX_TIMESTAMP(), %u)",
|
||||
instance_id,
|
||||
zone_id,
|
||||
version,
|
||||
duration
|
||||
);
|
||||
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
return results.Success();
|
||||
@@ -140,66 +151,84 @@ bool Database::CreateInstance(uint16 instance_id, uint32 zone_id, uint32 version
|
||||
|
||||
bool Database::GetUnusedInstanceID(uint16 &instance_id)
|
||||
{
|
||||
uint32 count = RuleI(Zone, ReservedInstances);
|
||||
uint32 max = 65535;
|
||||
uint32 max_reserved_instance_id = RuleI(Instances, ReservedInstances);
|
||||
uint32 max = 32000;
|
||||
|
||||
std::string query = StringFormat(
|
||||
"SELECT IFNULL(MAX(id),%u)+1 FROM instance_list WHERE id > %u",
|
||||
max_reserved_instance_id,
|
||||
max_reserved_instance_id
|
||||
);
|
||||
|
||||
if (RuleB(Instances, RecycleInstanceIds)) {
|
||||
query = (
|
||||
SQL(
|
||||
SELECT i.id + 1 AS next_available
|
||||
FROM instance_list i
|
||||
LEFT JOIN instance_list i2 ON i2.id = i.id + 1
|
||||
WHERE i2.id IS NULL
|
||||
ORDER BY i.id
|
||||
LIMIT 0, 1;
|
||||
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
std::string query = StringFormat("SELECT IFNULL(MAX(id),%u)+1 FROM instance_list WHERE id > %u", count, count);
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
if (!results.Success())
|
||||
{
|
||||
if (!results.Success()) {
|
||||
instance_id = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (results.RowCount() == 0)
|
||||
{
|
||||
instance_id = 0;
|
||||
return false;
|
||||
if (results.RowCount() == 0) {
|
||||
instance_id = max_reserved_instance_id;
|
||||
return true;
|
||||
}
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
if (atoi(row[0]) <= max)
|
||||
{
|
||||
if (atoi(row[0]) <= max) {
|
||||
instance_id = atoi(row[0]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
query = StringFormat("SELECT id FROM instance_list where id > %u ORDER BY id", count);
|
||||
if (instance_id < max_reserved_instance_id) {
|
||||
instance_id = max_reserved_instance_id;
|
||||
return true;
|
||||
}
|
||||
|
||||
query = StringFormat("SELECT id FROM instance_list where id > %u ORDER BY id", max_reserved_instance_id);
|
||||
results = QueryDatabase(query);
|
||||
|
||||
if (!results.Success())
|
||||
{
|
||||
if (!results.Success()) {
|
||||
instance_id = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (results.RowCount() == 0)
|
||||
{
|
||||
if (results.RowCount() == 0) {
|
||||
instance_id = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
count++;
|
||||
for (auto row = results.begin(); row != results.end(); ++row)
|
||||
{
|
||||
if (count < atoi(row[0]))
|
||||
{
|
||||
instance_id = count;
|
||||
max_reserved_instance_id++;
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
if (max_reserved_instance_id < atoi(row[0])) {
|
||||
instance_id = max_reserved_instance_id;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (count > max)
|
||||
{
|
||||
if (max_reserved_instance_id > max) {
|
||||
instance_id = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
count++;
|
||||
max_reserved_instance_id++;
|
||||
}
|
||||
|
||||
instance_id = count;
|
||||
instance_id = max_reserved_instance_id;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -486,8 +515,7 @@ void Database::BuryCorpsesInInstance(uint16 instance_id) {
|
||||
void Database::DeleteInstance(uint16 instance_id)
|
||||
{
|
||||
|
||||
std::string query = StringFormat("DELETE FROM instance_list WHERE id=%u", instance_id);
|
||||
QueryDatabase(query);
|
||||
std::string query;
|
||||
|
||||
query = StringFormat("DELETE FROM instance_list_player WHERE id=%u", instance_id);
|
||||
QueryDatabase(query);
|
||||
@@ -548,17 +576,36 @@ void Database::GetCharactersInInstance(uint16 instance_id, std::list<uint32> &ch
|
||||
|
||||
void Database::PurgeExpiredInstances()
|
||||
{
|
||||
std::string query("SELECT id FROM instance_list where (start_time+duration) <= UNIX_TIMESTAMP() and never_expires = 0");
|
||||
|
||||
/**
|
||||
* Delay purging by a day so that we can continue using adjacent free instance id's
|
||||
* from the table without risking the chance we immediately re-allocate a zone that freshly expired but
|
||||
* has not been fully de-allocated
|
||||
*/
|
||||
std::string query =
|
||||
SQL(
|
||||
SELECT
|
||||
id
|
||||
FROM
|
||||
instance_list
|
||||
where
|
||||
(start_time + duration) <= (UNIX_TIMESTAMP() - 86400)
|
||||
and never_expires = 0
|
||||
);
|
||||
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
if (!results.Success())
|
||||
if (!results.Success()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (results.RowCount() == 0)
|
||||
if (results.RowCount() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row)
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
DeleteInstance(atoi(row[0]));
|
||||
}
|
||||
}
|
||||
|
||||
void Database::SetInstanceDuration(uint16 instance_id, uint32 new_duration)
|
||||
@@ -566,4 +613,4 @@ void Database::SetInstanceDuration(uint16 instance_id, uint32 new_duration)
|
||||
std::string query = StringFormat("UPDATE `instance_list` SET start_time=UNIX_TIMESTAMP(), "
|
||||
"duration=%u WHERE id=%u", new_duration, instance_id);
|
||||
auto results = QueryDatabase(query);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,369 @@
|
||||
/**
|
||||
* EQEmulator: Everquest Server Emulator
|
||||
* Copyright (C) 2001-2019 EQEmulator Development Team (https://github.com/EQEmu/Server)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
* are required to give you total support for your newly bought product;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_DATABASE_SCHEMA_H
|
||||
#define EQEMU_DATABASE_SCHEMA_H
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace DatabaseSchema {
|
||||
|
||||
/**
|
||||
* Character-specific tables
|
||||
*
|
||||
* Does not included related meta-data tables such as 'guilds', 'accounts'
|
||||
* @return
|
||||
*/
|
||||
static std::map<std::string, std::string> GetCharacterTables()
|
||||
{
|
||||
return {
|
||||
{"adventure_stats", "player_id"},
|
||||
{"buyer", "charid"},
|
||||
{"char_recipe_list", "char_id"},
|
||||
{"character_activities", "charid"},
|
||||
{"character_alt_currency", "char_id"},
|
||||
{"character_alternate_abilities", "id"},
|
||||
{"character_auras", "id"},
|
||||
{"character_bandolier", "id"},
|
||||
{"character_bind", "id"},
|
||||
{"character_buffs", "character_id"},
|
||||
{"character_corpses", "id"},
|
||||
{"character_currency", "id"},
|
||||
{"character_data", "id"},
|
||||
{"character_disciplines", "id"},
|
||||
{"character_enabledtasks", "charid"},
|
||||
{"character_inspect_messages", "id"},
|
||||
{"character_item_recast", "id"},
|
||||
{"character_languages", "id"},
|
||||
{"character_leadership_abilities", "id"},
|
||||
{"character_material", "id"},
|
||||
{"character_memmed_spells", "id"},
|
||||
{"character_pet_buffs", "char_id"},
|
||||
{"character_pet_info", "char_id"},
|
||||
{"character_pet_inventory", "char_id"},
|
||||
{"character_potionbelt", "id"},
|
||||
{"character_skills", "id"},
|
||||
{"character_spells", "id"},
|
||||
{"character_tasks", "charid"},
|
||||
{"character_tribute", "id"},
|
||||
{"completed_tasks", "charid"},
|
||||
{"data_buckets", "id"},
|
||||
{"faction_values", "char_id"},
|
||||
{"friends", "charid"},
|
||||
{"guild_members", "char_id"},
|
||||
{"guilds", "id"},
|
||||
{"instance_list_player", "id"},
|
||||
{"inventory", "charid"},
|
||||
{"inventory_snapshots", "charid"},
|
||||
{"keyring", "char_id"},
|
||||
{"mail", "charid"},
|
||||
{"player_titlesets", "char_id"},
|
||||
{"quest_globals", "charid"},
|
||||
{"timers", "char_id"},
|
||||
{"titles", "char_id"},
|
||||
{"trader", "char_id"},
|
||||
{"zone_flags", "charID"}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Gets all player and meta-data tables
|
||||
* @note These tables have no content in the PEQ daily dump
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
static std::vector<std::string> GetPlayerTables()
|
||||
{
|
||||
return {
|
||||
"account",
|
||||
"account_ip",
|
||||
"account_flags",
|
||||
"account_rewards",
|
||||
"adventure_details",
|
||||
"adventure_stats",
|
||||
"buyer",
|
||||
"char_recipe_list",
|
||||
"character_activities",
|
||||
"character_alt_currency",
|
||||
"character_alternate_abilities",
|
||||
"character_auras",
|
||||
"character_bandolier",
|
||||
"character_bind",
|
||||
"character_buffs",
|
||||
"character_corpse_items",
|
||||
"character_corpses",
|
||||
"character_currency",
|
||||
"character_data",
|
||||
"character_disciplines",
|
||||
"character_enabledtasks",
|
||||
"character_inspect_messages",
|
||||
"character_item_recast",
|
||||
"character_languages",
|
||||
"character_leadership_abilities",
|
||||
"character_material",
|
||||
"character_memmed_spells",
|
||||
"character_pet_buffs",
|
||||
"character_pet_info",
|
||||
"character_pet_inventory",
|
||||
"character_potionbelt",
|
||||
"character_skills",
|
||||
"character_spells",
|
||||
"character_tasks",
|
||||
"character_tribute",
|
||||
"completed_tasks",
|
||||
"data_buckets",
|
||||
"discovered_items",
|
||||
"faction_values",
|
||||
"friends",
|
||||
"guild_bank",
|
||||
"guild_members",
|
||||
"guild_ranks",
|
||||
"guild_relations",
|
||||
"guilds",
|
||||
"instance_list_player",
|
||||
"inventory",
|
||||
"inventory_snapshots",
|
||||
"keyring",
|
||||
"mail",
|
||||
"petitions",
|
||||
"player_titlesets",
|
||||
"quest_globals",
|
||||
"sharedbank",
|
||||
"spell_buckets",
|
||||
"spell_globals",
|
||||
"timers",
|
||||
"titles",
|
||||
"trader",
|
||||
"trader_audit",
|
||||
"zone_flags"
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets content tables
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
static std::vector<std::string> GetContentTables()
|
||||
{
|
||||
return {
|
||||
"aa_ability",
|
||||
"aa_actions",
|
||||
"aa_effects",
|
||||
"aa_rank_effects",
|
||||
"aa_rank_prereqs",
|
||||
"aa_ranks",
|
||||
"aa_required_level_cost",
|
||||
"adventure_template",
|
||||
"adventure_template_entry",
|
||||
"adventure_template_entry_flavor",
|
||||
"altadv_vars",
|
||||
"alternate_currency",
|
||||
"auras",
|
||||
"base_data",
|
||||
"blocked_spells",
|
||||
"books",
|
||||
"char_create_combinations",
|
||||
"char_create_point_allocations",
|
||||
"class_skill",
|
||||
"damageshieldtypes",
|
||||
"doors",
|
||||
"faction_base_data",
|
||||
"faction_list",
|
||||
"faction_list_mod",
|
||||
"fear_hints",
|
||||
"fishing",
|
||||
"forage",
|
||||
"global_loot",
|
||||
"goallists",
|
||||
"graveyard",
|
||||
"grid",
|
||||
"grid_entries",
|
||||
"ground_spawns",
|
||||
"horses",
|
||||
"instance_list",
|
||||
"items",
|
||||
"ldon_trap_entries",
|
||||
"ldon_trap_templates",
|
||||
"lootdrop",
|
||||
"lootdrop_entries",
|
||||
"loottable",
|
||||
"loottable_entries",
|
||||
"merchantlist",
|
||||
"npc_emotes",
|
||||
"npc_faction",
|
||||
"npc_faction_entries",
|
||||
"npc_scale_global_base",
|
||||
"npc_spells",
|
||||
"npc_spells_effects",
|
||||
"npc_spells_effects_entries",
|
||||
"npc_spells_entries",
|
||||
"npc_types",
|
||||
"npc_types_metadata",
|
||||
"npc_types_tint",
|
||||
"object",
|
||||
"pets",
|
||||
"pets_equipmentset",
|
||||
"pets_equipmentset_entries",
|
||||
"proximities",
|
||||
"races",
|
||||
"skill_caps",
|
||||
"spawn2",
|
||||
"spawn_condition_values",
|
||||
"spawn_conditions",
|
||||
"spawn_events",
|
||||
"spawnentry",
|
||||
"spawngroup",
|
||||
"spells_new",
|
||||
"start_zones",
|
||||
"starting_items",
|
||||
"task_activities",
|
||||
"tasks",
|
||||
"tasksets",
|
||||
"tradeskill_recipe",
|
||||
"tradeskill_recipe_entries",
|
||||
"traps",
|
||||
"tribute_levels",
|
||||
"tributes",
|
||||
"veteran_reward_templates",
|
||||
"zone",
|
||||
"zone_points",
|
||||
"zone_server",
|
||||
"zoneserver_auth",
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets server tables
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
static std::vector<std::string> GetServerTables()
|
||||
{
|
||||
return {
|
||||
"chatchannels",
|
||||
"command_settings",
|
||||
"db_str",
|
||||
"eqtime",
|
||||
"launcher",
|
||||
"launcher_zones",
|
||||
"level_exp_mods",
|
||||
"logsys_categories",
|
||||
"name_filter",
|
||||
"perl_event_export_settings",
|
||||
"profanity_list",
|
||||
"rule_sets",
|
||||
"rule_values",
|
||||
"variables",
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets QueryServer tables
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
static std::vector<std::string> GetQueryServerTables()
|
||||
{
|
||||
return {
|
||||
"qs_merchant_transaction_record",
|
||||
"qs_merchant_transaction_record_entries",
|
||||
"qs_player_aa_rate_hourly",
|
||||
"qs_player_delete_record",
|
||||
"qs_player_delete_record_entries",
|
||||
"qs_player_events",
|
||||
"qs_player_handin_record",
|
||||
"qs_player_handin_record_entries",
|
||||
"qs_player_move_record",
|
||||
"qs_player_move_record_entries",
|
||||
"qs_player_npc_kill_record",
|
||||
"qs_player_npc_kill_record_entries",
|
||||
"qs_player_speech",
|
||||
"qs_player_trade_record",
|
||||
"qs_player_trade_record_entries",
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets state tables
|
||||
* Tables that keep track of server state
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
static std::vector<std::string> GetStateTables()
|
||||
{
|
||||
return {
|
||||
"adventure_members",
|
||||
"banned_ips",
|
||||
"bug_reports",
|
||||
"bugs",
|
||||
"eventlog",
|
||||
"gm_ips",
|
||||
"group_id",
|
||||
"group_leaders",
|
||||
"hackers",
|
||||
"ip_exemptions",
|
||||
"item_tick",
|
||||
"lfguild",
|
||||
"merchantlist_temp",
|
||||
"object_contents",
|
||||
"raid_details",
|
||||
"raid_leaders",
|
||||
"raid_members",
|
||||
"reports",
|
||||
"respawn_times",
|
||||
"saylink",
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets login tables
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
static std::vector<std::string> GetLoginTables()
|
||||
{
|
||||
return {
|
||||
"login_accounts",
|
||||
"login_api_tokens",
|
||||
"login_server_admins",
|
||||
"login_server_list_types",
|
||||
"login_world_servers",
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets login tables
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
static std::vector<std::string> GetVersionTables()
|
||||
{
|
||||
return {
|
||||
"db_version",
|
||||
"inventory_versions",
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif //EQEMU_DATABASE_SCHEMA_H
|
||||
+8
-12
@@ -115,14 +115,14 @@ MySQLRequestResult DBcore::QueryDatabase(const char *query, uint32 querylen, boo
|
||||
auto errorBuffer = new char[MYSQL_ERRMSG_SIZE];
|
||||
snprintf(errorBuffer, MYSQL_ERRMSG_SIZE, "#%i: %s", mysql_errno(&mysql), mysql_error(&mysql));
|
||||
|
||||
/* Implement Logging at the Root */
|
||||
/**
|
||||
* Error logging
|
||||
*/
|
||||
if (mysql_errno(&mysql) > 0 && strlen(query) > 0) {
|
||||
if (LogSys.log_settings[Logs::MySQLError].is_category_enabled == 1)
|
||||
Log(Logs::General, Logs::MySQLError, "%i: %s \n %s", mysql_errno(&mysql), mysql_error(&mysql), query);
|
||||
LogMySQLError("[{}] [{}]\n[{}]", mysql_errno(&mysql), mysql_error(&mysql), query);
|
||||
}
|
||||
|
||||
return MySQLRequestResult(nullptr, 0, 0, 0, 0, mysql_errno(&mysql), errorBuffer);
|
||||
|
||||
}
|
||||
|
||||
// successful query. get results.
|
||||
@@ -143,10 +143,8 @@ MySQLRequestResult DBcore::QueryDatabase(const char *query, uint32 querylen, boo
|
||||
|
||||
if (LogSys.log_settings[Logs::MySQLQuery].is_category_enabled == 1) {
|
||||
if ((strncasecmp(query, "select", 6) == 0)) {
|
||||
LogF(
|
||||
Logs::General,
|
||||
Logs::MySQLQuery,
|
||||
"{0} ({1} row{2} returned) ({3}ms)",
|
||||
LogMySQLQuery(
|
||||
"{0} ({1} row{2} returned) ({3}s)",
|
||||
query,
|
||||
requestResult.RowCount(),
|
||||
requestResult.RowCount() == 1 ? "" : "s",
|
||||
@@ -154,10 +152,8 @@ MySQLRequestResult DBcore::QueryDatabase(const char *query, uint32 querylen, boo
|
||||
);
|
||||
}
|
||||
else {
|
||||
LogF(
|
||||
Logs::General,
|
||||
Logs::MySQLQuery,
|
||||
"{0} ({1} row{2} affected) ({3}ms)",
|
||||
LogMySQLQuery(
|
||||
"{0} ({1} row{2} affected) ({3}s)",
|
||||
query,
|
||||
requestResult.RowsAffected(),
|
||||
requestResult.RowsAffected() == 1 ? "" : "s",
|
||||
|
||||
+3
-3
@@ -20,7 +20,7 @@
|
||||
#include "deity.h"
|
||||
|
||||
|
||||
EQEmu::deity::DeityTypeBit EQEmu::deity::ConvertDeityTypeToDeityTypeBit(DeityType deity_type)
|
||||
EQ::deity::DeityTypeBit EQ::deity::ConvertDeityTypeToDeityTypeBit(DeityType deity_type)
|
||||
{
|
||||
switch (deity_type) {
|
||||
case DeityBertoxxulous:
|
||||
@@ -63,7 +63,7 @@ EQEmu::deity::DeityTypeBit EQEmu::deity::ConvertDeityTypeToDeityTypeBit(DeityTyp
|
||||
};
|
||||
}
|
||||
|
||||
EQEmu::deity::DeityType EQEmu::deity::ConvertDeityTypeBitToDeityType(DeityTypeBit deity_type_bit)
|
||||
EQ::deity::DeityType EQ::deity::ConvertDeityTypeBitToDeityType(DeityTypeBit deity_type_bit)
|
||||
{
|
||||
switch (deity_type_bit) {
|
||||
case bit_DeityAgnostic:
|
||||
@@ -105,7 +105,7 @@ EQEmu::deity::DeityType EQEmu::deity::ConvertDeityTypeBitToDeityType(DeityTypeBi
|
||||
};
|
||||
}
|
||||
|
||||
const char* EQEmu::deity::DeityName(DeityType deity_type)
|
||||
const char* EQ::deity::DeityName(DeityType deity_type)
|
||||
{
|
||||
switch (deity_type) {
|
||||
case DeityBertoxxulous:
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@
|
||||
#include "types.h"
|
||||
|
||||
|
||||
namespace EQEmu
|
||||
namespace EQ
|
||||
{
|
||||
namespace deity {
|
||||
enum DeityType {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "emu_constants.h"
|
||||
|
||||
|
||||
int16 EQEmu::invtype::GetInvTypeSize(int16 inv_type) {
|
||||
int16 EQ::invtype::GetInvTypeSize(int16 inv_type) {
|
||||
static const int16 local_array[] = {
|
||||
POSSESSIONS_SIZE,
|
||||
BANK_SIZE,
|
||||
@@ -55,7 +55,7 @@ int16 EQEmu::invtype::GetInvTypeSize(int16 inv_type) {
|
||||
return local_array[inv_type];
|
||||
}
|
||||
|
||||
const char* EQEmu::bug::CategoryIDToCategoryName(CategoryID category_id) {
|
||||
const char* EQ::bug::CategoryIDToCategoryName(CategoryID category_id) {
|
||||
switch (category_id) {
|
||||
case catVideo:
|
||||
return "Video";
|
||||
@@ -87,7 +87,7 @@ const char* EQEmu::bug::CategoryIDToCategoryName(CategoryID category_id) {
|
||||
}
|
||||
}
|
||||
|
||||
EQEmu::bug::CategoryID EQEmu::bug::CategoryNameToCategoryID(const char* category_name) {
|
||||
EQ::bug::CategoryID EQ::bug::CategoryNameToCategoryID(const char* category_name) {
|
||||
if (!category_name)
|
||||
return catOther;
|
||||
|
||||
@@ -119,7 +119,7 @@ EQEmu::bug::CategoryID EQEmu::bug::CategoryNameToCategoryID(const char* category
|
||||
return catOther;
|
||||
}
|
||||
|
||||
const char *EQEmu::constants::GetStanceName(StanceType stance_type) {
|
||||
const char *EQ::constants::GetStanceName(StanceType stance_type) {
|
||||
switch (stance_type) {
|
||||
case stanceUnknown:
|
||||
return "Unknown";
|
||||
@@ -146,9 +146,9 @@ const char *EQEmu::constants::GetStanceName(StanceType stance_type) {
|
||||
}
|
||||
}
|
||||
|
||||
int EQEmu::constants::ConvertStanceTypeToIndex(StanceType stance_type) {
|
||||
if (stance_type >= EQEmu::constants::stancePassive && stance_type <= EQEmu::constants::stanceBurnAE)
|
||||
return (stance_type - EQEmu::constants::stancePassive);
|
||||
int EQ::constants::ConvertStanceTypeToIndex(StanceType stance_type) {
|
||||
if (stance_type >= EQ::constants::stancePassive && stance_type <= EQ::constants::stanceBurnAE)
|
||||
return (stance_type - EQ::constants::stancePassive);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+12
-3
@@ -27,7 +27,7 @@
|
||||
|
||||
|
||||
// local definitions are the result of using hybrid-client or server-only values and methods
|
||||
namespace EQEmu
|
||||
namespace EQ
|
||||
{
|
||||
using RoF2::IINVALID;
|
||||
using RoF2::INULL;
|
||||
@@ -193,7 +193,7 @@ namespace EQEmu
|
||||
} // namespace invaug
|
||||
|
||||
namespace constants {
|
||||
const EQEmu::versions::ClientVersion CHARACTER_CREATION_CLIENT = EQEmu::versions::ClientVersion::Titanium;
|
||||
const EQ::versions::ClientVersion CHARACTER_CREATION_CLIENT = EQ::versions::ClientVersion::Titanium;
|
||||
|
||||
using RoF2::constants::EXPANSION;
|
||||
using RoF2::constants::EXPANSION_BIT;
|
||||
@@ -317,12 +317,21 @@ namespace EQEmu
|
||||
QuestControlGrid = -1
|
||||
};
|
||||
|
||||
namespace consent {
|
||||
enum eConsentType : uint8 {
|
||||
Normal = 0,
|
||||
Group,
|
||||
Raid,
|
||||
Guild
|
||||
};
|
||||
}; // namespace consent
|
||||
|
||||
} /*EQEmu*/
|
||||
|
||||
#endif /*COMMON_EMU_CONSTANTS_H*/
|
||||
|
||||
/* hack list to prevent circular references
|
||||
|
||||
eq_limits.h:EQEmu::inventory::LookupEntry::InventoryTypeSize[n];
|
||||
eq_limits.h:EQ::inventory::LookupEntry::InventoryTypeSize[n];
|
||||
|
||||
*/
|
||||
|
||||
+31
-31
@@ -21,7 +21,7 @@
|
||||
#include "emu_constants.h"
|
||||
|
||||
|
||||
bool EQEmu::versions::IsValidClientVersion(ClientVersion client_version)
|
||||
bool EQ::versions::IsValidClientVersion(ClientVersion client_version)
|
||||
{
|
||||
if (client_version <= ClientVersion::Unknown || client_version > LastClientVersion)
|
||||
return false;
|
||||
@@ -29,7 +29,7 @@ bool EQEmu::versions::IsValidClientVersion(ClientVersion client_version)
|
||||
return true;
|
||||
}
|
||||
|
||||
EQEmu::versions::ClientVersion EQEmu::versions::ValidateClientVersion(ClientVersion client_version)
|
||||
EQ::versions::ClientVersion EQ::versions::ValidateClientVersion(ClientVersion client_version)
|
||||
{
|
||||
if (client_version <= ClientVersion::Unknown || client_version > LastClientVersion)
|
||||
return ClientVersion::Unknown;
|
||||
@@ -37,7 +37,7 @@ EQEmu::versions::ClientVersion EQEmu::versions::ValidateClientVersion(ClientVers
|
||||
return client_version;
|
||||
}
|
||||
|
||||
const char* EQEmu::versions::ClientVersionName(ClientVersion client_version)
|
||||
const char* EQ::versions::ClientVersionName(ClientVersion client_version)
|
||||
{
|
||||
switch (client_version) {
|
||||
case ClientVersion::Unknown:
|
||||
@@ -61,7 +61,7 @@ const char* EQEmu::versions::ClientVersionName(ClientVersion client_version)
|
||||
};
|
||||
}
|
||||
|
||||
uint32 EQEmu::versions::ConvertClientVersionToClientVersionBit(ClientVersion client_version)
|
||||
uint32 EQ::versions::ConvertClientVersionToClientVersionBit(ClientVersion client_version)
|
||||
{
|
||||
switch (client_version) {
|
||||
case ClientVersion::Titanium:
|
||||
@@ -81,7 +81,7 @@ uint32 EQEmu::versions::ConvertClientVersionToClientVersionBit(ClientVersion cli
|
||||
}
|
||||
}
|
||||
|
||||
EQEmu::versions::ClientVersion EQEmu::versions::ConvertClientVersionBitToClientVersion(uint32 client_version_bit)
|
||||
EQ::versions::ClientVersion EQ::versions::ConvertClientVersionBitToClientVersion(uint32 client_version_bit)
|
||||
{
|
||||
switch (client_version_bit) {
|
||||
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::Titanium) - 1)) :
|
||||
@@ -101,7 +101,7 @@ EQEmu::versions::ClientVersion EQEmu::versions::ConvertClientVersionBitToClientV
|
||||
}
|
||||
}
|
||||
|
||||
bool EQEmu::versions::IsValidMobVersion(MobVersion mob_version)
|
||||
bool EQ::versions::IsValidMobVersion(MobVersion mob_version)
|
||||
{
|
||||
if (mob_version <= MobVersion::Unknown || mob_version > LastMobVersion)
|
||||
return false;
|
||||
@@ -109,7 +109,7 @@ bool EQEmu::versions::IsValidMobVersion(MobVersion mob_version)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EQEmu::versions::IsValidPCMobVersion(MobVersion mob_version)
|
||||
bool EQ::versions::IsValidPCMobVersion(MobVersion mob_version)
|
||||
{
|
||||
if (mob_version <= MobVersion::Unknown || mob_version > LastPCMobVersion)
|
||||
return false;
|
||||
@@ -117,7 +117,7 @@ bool EQEmu::versions::IsValidPCMobVersion(MobVersion mob_version)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EQEmu::versions::IsValidNonPCMobVersion(MobVersion mob_version)
|
||||
bool EQ::versions::IsValidNonPCMobVersion(MobVersion mob_version)
|
||||
{
|
||||
if (mob_version <= LastPCMobVersion || mob_version > LastNonPCMobVersion)
|
||||
return false;
|
||||
@@ -125,7 +125,7 @@ bool EQEmu::versions::IsValidNonPCMobVersion(MobVersion mob_version)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EQEmu::versions::IsValidOfflinePCMobVersion(MobVersion mob_version)
|
||||
bool EQ::versions::IsValidOfflinePCMobVersion(MobVersion mob_version)
|
||||
{
|
||||
if (mob_version <= LastNonPCMobVersion || mob_version > LastOfflinePCMobVersion)
|
||||
return false;
|
||||
@@ -133,7 +133,7 @@ bool EQEmu::versions::IsValidOfflinePCMobVersion(MobVersion mob_version)
|
||||
return true;
|
||||
}
|
||||
|
||||
EQEmu::versions::MobVersion EQEmu::versions::ValidateMobVersion(MobVersion mob_version)
|
||||
EQ::versions::MobVersion EQ::versions::ValidateMobVersion(MobVersion mob_version)
|
||||
{
|
||||
if (mob_version <= MobVersion::Unknown || mob_version > LastMobVersion)
|
||||
return MobVersion::Unknown;
|
||||
@@ -141,7 +141,7 @@ EQEmu::versions::MobVersion EQEmu::versions::ValidateMobVersion(MobVersion mob_v
|
||||
return mob_version;
|
||||
}
|
||||
|
||||
EQEmu::versions::MobVersion EQEmu::versions::ValidatePCMobVersion(MobVersion mob_version)
|
||||
EQ::versions::MobVersion EQ::versions::ValidatePCMobVersion(MobVersion mob_version)
|
||||
{
|
||||
if (mob_version <= MobVersion::Unknown || mob_version > LastPCMobVersion)
|
||||
return MobVersion::Unknown;
|
||||
@@ -149,7 +149,7 @@ EQEmu::versions::MobVersion EQEmu::versions::ValidatePCMobVersion(MobVersion mob
|
||||
return mob_version;
|
||||
}
|
||||
|
||||
EQEmu::versions::MobVersion EQEmu::versions::ValidateNonPCMobVersion(MobVersion mob_version)
|
||||
EQ::versions::MobVersion EQ::versions::ValidateNonPCMobVersion(MobVersion mob_version)
|
||||
{
|
||||
if (mob_version <= LastPCMobVersion || mob_version > LastNonPCMobVersion)
|
||||
return MobVersion::Unknown;
|
||||
@@ -157,7 +157,7 @@ EQEmu::versions::MobVersion EQEmu::versions::ValidateNonPCMobVersion(MobVersion
|
||||
return mob_version;
|
||||
}
|
||||
|
||||
EQEmu::versions::MobVersion EQEmu::versions::ValidateOfflinePCMobVersion(MobVersion mob_version)
|
||||
EQ::versions::MobVersion EQ::versions::ValidateOfflinePCMobVersion(MobVersion mob_version)
|
||||
{
|
||||
if (mob_version <= LastNonPCMobVersion || mob_version > LastOfflinePCMobVersion)
|
||||
return MobVersion::Unknown;
|
||||
@@ -165,7 +165,7 @@ EQEmu::versions::MobVersion EQEmu::versions::ValidateOfflinePCMobVersion(MobVers
|
||||
return mob_version;
|
||||
}
|
||||
|
||||
const char* EQEmu::versions::MobVersionName(MobVersion mob_version)
|
||||
const char* EQ::versions::MobVersionName(MobVersion mob_version)
|
||||
{
|
||||
switch (mob_version) {
|
||||
case MobVersion::Unknown:
|
||||
@@ -217,7 +217,7 @@ const char* EQEmu::versions::MobVersionName(MobVersion mob_version)
|
||||
};
|
||||
}
|
||||
|
||||
EQEmu::versions::ClientVersion EQEmu::versions::ConvertMobVersionToClientVersion(MobVersion mob_version)
|
||||
EQ::versions::ClientVersion EQ::versions::ConvertMobVersionToClientVersion(MobVersion mob_version)
|
||||
{
|
||||
switch (mob_version) {
|
||||
case MobVersion::Unknown:
|
||||
@@ -240,7 +240,7 @@ EQEmu::versions::ClientVersion EQEmu::versions::ConvertMobVersionToClientVersion
|
||||
}
|
||||
}
|
||||
|
||||
EQEmu::versions::MobVersion EQEmu::versions::ConvertClientVersionToMobVersion(ClientVersion client_version)
|
||||
EQ::versions::MobVersion EQ::versions::ConvertClientVersionToMobVersion(ClientVersion client_version)
|
||||
{
|
||||
switch (client_version) {
|
||||
case ClientVersion::Unknown:
|
||||
@@ -263,7 +263,7 @@ EQEmu::versions::MobVersion EQEmu::versions::ConvertClientVersionToMobVersion(Cl
|
||||
}
|
||||
}
|
||||
|
||||
EQEmu::versions::MobVersion EQEmu::versions::ConvertPCMobVersionToOfflinePCMobVersion(MobVersion mob_version)
|
||||
EQ::versions::MobVersion EQ::versions::ConvertPCMobVersionToOfflinePCMobVersion(MobVersion mob_version)
|
||||
{
|
||||
switch (mob_version) {
|
||||
case MobVersion::Titanium:
|
||||
@@ -283,7 +283,7 @@ EQEmu::versions::MobVersion EQEmu::versions::ConvertPCMobVersionToOfflinePCMobVe
|
||||
}
|
||||
}
|
||||
|
||||
EQEmu::versions::MobVersion EQEmu::versions::ConvertOfflinePCMobVersionToPCMobVersion(MobVersion mob_version)
|
||||
EQ::versions::MobVersion EQ::versions::ConvertOfflinePCMobVersionToPCMobVersion(MobVersion mob_version)
|
||||
{
|
||||
switch (mob_version) {
|
||||
case MobVersion::OfflineTitanium:
|
||||
@@ -303,7 +303,7 @@ EQEmu::versions::MobVersion EQEmu::versions::ConvertOfflinePCMobVersionToPCMobVe
|
||||
}
|
||||
}
|
||||
|
||||
EQEmu::versions::ClientVersion EQEmu::versions::ConvertOfflinePCMobVersionToClientVersion(MobVersion mob_version)
|
||||
EQ::versions::ClientVersion EQ::versions::ConvertOfflinePCMobVersionToClientVersion(MobVersion mob_version)
|
||||
{
|
||||
switch (mob_version) {
|
||||
case MobVersion::OfflineTitanium:
|
||||
@@ -323,7 +323,7 @@ EQEmu::versions::ClientVersion EQEmu::versions::ConvertOfflinePCMobVersionToClie
|
||||
}
|
||||
}
|
||||
|
||||
EQEmu::versions::MobVersion EQEmu::versions::ConvertClientVersionToOfflinePCMobVersion(ClientVersion client_version)
|
||||
EQ::versions::MobVersion EQ::versions::ConvertClientVersionToOfflinePCMobVersion(ClientVersion client_version)
|
||||
{
|
||||
switch (client_version) {
|
||||
case ClientVersion::Titanium:
|
||||
@@ -343,7 +343,7 @@ EQEmu::versions::MobVersion EQEmu::versions::ConvertClientVersionToOfflinePCMobV
|
||||
}
|
||||
}
|
||||
|
||||
const char* EQEmu::expansions::ExpansionName(Expansion expansion)
|
||||
const char* EQ::expansions::ExpansionName(Expansion expansion)
|
||||
{
|
||||
switch (expansion) {
|
||||
case Expansion::EverQuest:
|
||||
@@ -393,12 +393,12 @@ const char* EQEmu::expansions::ExpansionName(Expansion expansion)
|
||||
}
|
||||
}
|
||||
|
||||
const char* EQEmu::expansions::ExpansionName(uint32 expansion_bit)
|
||||
const char* EQ::expansions::ExpansionName(uint32 expansion_bit)
|
||||
{
|
||||
return ExpansionName(ConvertExpansionBitToExpansion(expansion_bit));
|
||||
}
|
||||
|
||||
uint32 EQEmu::expansions::ConvertExpansionToExpansionBit(Expansion expansion)
|
||||
uint32 EQ::expansions::ConvertExpansionToExpansionBit(Expansion expansion)
|
||||
{
|
||||
switch (expansion) {
|
||||
case Expansion::RoK:
|
||||
@@ -446,7 +446,7 @@ uint32 EQEmu::expansions::ConvertExpansionToExpansionBit(Expansion expansion)
|
||||
}
|
||||
}
|
||||
|
||||
EQEmu::expansions::Expansion EQEmu::expansions::ConvertExpansionBitToExpansion(uint32 expansion_bit)
|
||||
EQ::expansions::Expansion EQ::expansions::ConvertExpansionBitToExpansion(uint32 expansion_bit)
|
||||
{
|
||||
switch (expansion_bit) {
|
||||
case bitRoK:
|
||||
@@ -494,7 +494,7 @@ EQEmu::expansions::Expansion EQEmu::expansions::ConvertExpansionBitToExpansion(u
|
||||
}
|
||||
}
|
||||
|
||||
uint32 EQEmu::expansions::ConvertExpansionToExpansionsMask(Expansion expansion)
|
||||
uint32 EQ::expansions::ConvertExpansionToExpansionsMask(Expansion expansion)
|
||||
{
|
||||
switch (expansion) {
|
||||
case Expansion::RoK:
|
||||
@@ -542,17 +542,17 @@ uint32 EQEmu::expansions::ConvertExpansionToExpansionsMask(Expansion expansion)
|
||||
}
|
||||
}
|
||||
|
||||
EQEmu::expansions::Expansion EQEmu::expansions::ConvertClientVersionToExpansion(versions::ClientVersion client_version)
|
||||
EQ::expansions::Expansion EQ::expansions::ConvertClientVersionToExpansion(versions::ClientVersion client_version)
|
||||
{
|
||||
return EQEmu::constants::StaticLookup(client_version)->Expansion;
|
||||
return EQ::constants::StaticLookup(client_version)->Expansion;
|
||||
}
|
||||
|
||||
uint32 EQEmu::expansions::ConvertClientVersionToExpansionBit(versions::ClientVersion client_version)
|
||||
uint32 EQ::expansions::ConvertClientVersionToExpansionBit(versions::ClientVersion client_version)
|
||||
{
|
||||
return EQEmu::constants::StaticLookup(client_version)->ExpansionBit;
|
||||
return EQ::constants::StaticLookup(client_version)->ExpansionBit;
|
||||
}
|
||||
|
||||
uint32 EQEmu::expansions::ConvertClientVersionToExpansionsMask(versions::ClientVersion client_version)
|
||||
uint32 EQ::expansions::ConvertClientVersionToExpansionsMask(versions::ClientVersion client_version)
|
||||
{
|
||||
return EQEmu::constants::StaticLookup(client_version)->ExpansionsMask;
|
||||
return EQ::constants::StaticLookup(client_version)->ExpansionsMask;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
namespace EQEmu
|
||||
namespace EQ
|
||||
{
|
||||
namespace versions {
|
||||
enum class ClientVersion : uint32 {
|
||||
|
||||
@@ -318,7 +318,7 @@ static const uint8 DamageTypeUnknown = 0xFF;
|
||||
**
|
||||
** (indexed by 'Skill' of SkillUseTypes)
|
||||
*/
|
||||
static const uint8 SkillDamageTypes[EQEmu::skills::HIGHEST_SKILL + 1] = // change to _SkillServerArraySize once activated
|
||||
static const uint8 SkillDamageTypes[EQ::skills::HIGHEST_SKILL + 1] = // change to _SkillServerArraySize once activated
|
||||
{
|
||||
/*1HBlunt*/ 0,
|
||||
/*1HSlashing*/ 1,
|
||||
|
||||
+168
-168
@@ -25,7 +25,7 @@
|
||||
|
||||
|
||||
static bool global_dictionary_init = false;
|
||||
void EQEmu::InitializeDynamicLookups() {
|
||||
void EQ::InitializeDynamicLookups() {
|
||||
if (global_dictionary_init == true)
|
||||
return;
|
||||
|
||||
@@ -37,12 +37,12 @@ void EQEmu::InitializeDynamicLookups() {
|
||||
global_dictionary_init = true;
|
||||
}
|
||||
|
||||
static std::unique_ptr<EQEmu::constants::LookupEntry> constants_dynamic_nongm_lookup_entries[EQEmu::versions::ClientVersionCount];
|
||||
static std::unique_ptr<EQEmu::constants::LookupEntry> constants_dynamic_gm_lookup_entries[EQEmu::versions::ClientVersionCount];
|
||||
static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu::versions::ClientVersionCount] =
|
||||
static std::unique_ptr<EQ::constants::LookupEntry> constants_dynamic_nongm_lookup_entries[EQ::versions::ClientVersionCount];
|
||||
static std::unique_ptr<EQ::constants::LookupEntry> constants_dynamic_gm_lookup_entries[EQ::versions::ClientVersionCount];
|
||||
static const EQ::constants::LookupEntry constants_static_lookup_entries[EQ::versions::ClientVersionCount] =
|
||||
{
|
||||
/*[ClientVersion::Unknown] =*/
|
||||
EQEmu::constants::LookupEntry(
|
||||
EQ::constants::LookupEntry(
|
||||
ClientUnknown::constants::EXPANSION,
|
||||
ClientUnknown::constants::EXPANSION_BIT,
|
||||
ClientUnknown::constants::EXPANSIONS_MASK,
|
||||
@@ -50,7 +50,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
|
||||
ClientUnknown::INULL
|
||||
),
|
||||
/*[ClientVersion::Client62] =*/
|
||||
EQEmu::constants::LookupEntry(
|
||||
EQ::constants::LookupEntry(
|
||||
Client62::constants::EXPANSION,
|
||||
Client62::constants::EXPANSION_BIT,
|
||||
Client62::constants::EXPANSIONS_MASK,
|
||||
@@ -58,7 +58,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
|
||||
Client62::INULL
|
||||
),
|
||||
/*[ClientVersion::Titanium] =*/
|
||||
EQEmu::constants::LookupEntry(
|
||||
EQ::constants::LookupEntry(
|
||||
Titanium::constants::EXPANSION,
|
||||
Titanium::constants::EXPANSION_BIT,
|
||||
Titanium::constants::EXPANSIONS_MASK,
|
||||
@@ -66,7 +66,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
|
||||
Titanium::constants::SAY_LINK_BODY_SIZE
|
||||
),
|
||||
/*[ClientVersion::SoF] =*/
|
||||
EQEmu::constants::LookupEntry(
|
||||
EQ::constants::LookupEntry(
|
||||
SoF::constants::EXPANSION,
|
||||
SoF::constants::EXPANSION_BIT,
|
||||
SoF::constants::EXPANSIONS_MASK,
|
||||
@@ -74,7 +74,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
|
||||
SoF::constants::SAY_LINK_BODY_SIZE
|
||||
),
|
||||
/*[ClientVersion::SoD] =*/
|
||||
EQEmu::constants::LookupEntry(
|
||||
EQ::constants::LookupEntry(
|
||||
SoD::constants::EXPANSION,
|
||||
SoD::constants::EXPANSION_BIT,
|
||||
SoD::constants::EXPANSIONS_MASK,
|
||||
@@ -82,7 +82,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
|
||||
SoD::constants::SAY_LINK_BODY_SIZE
|
||||
),
|
||||
/*[ClientVersion::UF] =*/
|
||||
EQEmu::constants::LookupEntry(
|
||||
EQ::constants::LookupEntry(
|
||||
UF::constants::EXPANSION,
|
||||
UF::constants::EXPANSION_BIT,
|
||||
UF::constants::EXPANSIONS_MASK,
|
||||
@@ -90,7 +90,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
|
||||
UF::constants::SAY_LINK_BODY_SIZE
|
||||
),
|
||||
/*[ClientVersion::RoF] =*/
|
||||
EQEmu::constants::LookupEntry(
|
||||
EQ::constants::LookupEntry(
|
||||
RoF::constants::EXPANSION,
|
||||
RoF::constants::EXPANSION_BIT,
|
||||
RoF::constants::EXPANSIONS_MASK,
|
||||
@@ -98,7 +98,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
|
||||
RoF::constants::SAY_LINK_BODY_SIZE
|
||||
),
|
||||
/*[ClientVersion::RoF2] =*/
|
||||
EQEmu::constants::LookupEntry(
|
||||
EQ::constants::LookupEntry(
|
||||
RoF2::constants::EXPANSION,
|
||||
RoF2::constants::EXPANSION_BIT,
|
||||
RoF2::constants::EXPANSIONS_MASK,
|
||||
@@ -108,7 +108,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
|
||||
};
|
||||
|
||||
static bool constants_dictionary_init = false;
|
||||
void EQEmu::constants::InitializeDynamicLookups() {
|
||||
void EQ::constants::InitializeDynamicLookups() {
|
||||
if (constants_dictionary_init == true)
|
||||
return;
|
||||
constants_dictionary_init = true;
|
||||
@@ -119,7 +119,7 @@ void EQEmu::constants::InitializeDynamicLookups() {
|
||||
// use static references for now
|
||||
}
|
||||
|
||||
const EQEmu::constants::LookupEntry* EQEmu::constants::DynamicLookup(versions::ClientVersion client_version, bool gm_flag)
|
||||
const EQ::constants::LookupEntry* EQ::constants::DynamicLookup(versions::ClientVersion client_version, bool gm_flag)
|
||||
{
|
||||
if (gm_flag)
|
||||
return DynamicGMLookup(client_version);
|
||||
@@ -127,7 +127,7 @@ const EQEmu::constants::LookupEntry* EQEmu::constants::DynamicLookup(versions::C
|
||||
return DynamicNonGMLookup(client_version);
|
||||
}
|
||||
|
||||
const EQEmu::constants::LookupEntry* EQEmu::constants::DynamicNonGMLookup(versions::ClientVersion client_version)
|
||||
const EQ::constants::LookupEntry* EQ::constants::DynamicNonGMLookup(versions::ClientVersion client_version)
|
||||
{
|
||||
client_version = versions::ValidateClientVersion(client_version);
|
||||
if (constants_dynamic_nongm_lookup_entries[static_cast<int>(client_version)])
|
||||
@@ -136,7 +136,7 @@ const EQEmu::constants::LookupEntry* EQEmu::constants::DynamicNonGMLookup(versio
|
||||
return &constants_static_lookup_entries[static_cast<int>(client_version)];
|
||||
}
|
||||
|
||||
const EQEmu::constants::LookupEntry* EQEmu::constants::DynamicGMLookup(versions::ClientVersion client_version)
|
||||
const EQ::constants::LookupEntry* EQ::constants::DynamicGMLookup(versions::ClientVersion client_version)
|
||||
{
|
||||
client_version = versions::ValidateClientVersion(client_version);
|
||||
if (constants_dynamic_gm_lookup_entries[static_cast<int>(client_version)])
|
||||
@@ -145,18 +145,18 @@ const EQEmu::constants::LookupEntry* EQEmu::constants::DynamicGMLookup(versions:
|
||||
return &constants_static_lookup_entries[static_cast<int>(client_version)];
|
||||
}
|
||||
|
||||
const EQEmu::constants::LookupEntry* EQEmu::constants::StaticLookup(versions::ClientVersion client_version)
|
||||
const EQ::constants::LookupEntry* EQ::constants::StaticLookup(versions::ClientVersion client_version)
|
||||
{
|
||||
return &constants_static_lookup_entries[static_cast<int>(versions::ValidateClientVersion(client_version))];
|
||||
}
|
||||
|
||||
static std::unique_ptr<EQEmu::inventory::LookupEntry> inventory_dynamic_nongm_lookup_entries[EQEmu::versions::MobVersionCount];
|
||||
static std::unique_ptr<EQEmu::inventory::LookupEntry> inventory_dynamic_gm_lookup_entries[EQEmu::versions::MobVersionCount];
|
||||
static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu::versions::MobVersionCount] =
|
||||
static std::unique_ptr<EQ::inventory::LookupEntry> inventory_dynamic_nongm_lookup_entries[EQ::versions::MobVersionCount];
|
||||
static std::unique_ptr<EQ::inventory::LookupEntry> inventory_dynamic_gm_lookup_entries[EQ::versions::MobVersionCount];
|
||||
static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::versions::MobVersionCount] =
|
||||
{
|
||||
/*[MobVersion::Unknown] =*/
|
||||
EQEmu::inventory::LookupEntry(
|
||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQ::inventory::LookupEntry(
|
||||
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
ClientUnknown::INULL, ClientUnknown::INULL, ClientUnknown::INULL,
|
||||
ClientUnknown::INULL, ClientUnknown::INULL, ClientUnknown::INULL,
|
||||
ClientUnknown::INULL, ClientUnknown::INULL, ClientUnknown::INULL,
|
||||
@@ -182,8 +182,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
false
|
||||
),
|
||||
/*[MobVersion::Client62] =*/
|
||||
EQEmu::inventory::LookupEntry(
|
||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQ::inventory::LookupEntry(
|
||||
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
Client62::INULL, Client62::INULL, Client62::INULL,
|
||||
Client62::INULL, Client62::INULL, Client62::INULL,
|
||||
Client62::INULL, Client62::INULL, Client62::INULL,
|
||||
@@ -209,9 +209,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
false
|
||||
),
|
||||
/*[MobVersion::Titanium] =*/
|
||||
EQEmu::inventory::LookupEntry(
|
||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQEmu::invtype::POSSESSIONS_SIZE, Titanium::invtype::BANK_SIZE, Titanium::invtype::SHARED_BANK_SIZE,
|
||||
EQ::inventory::LookupEntry(
|
||||
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQ::invtype::POSSESSIONS_SIZE, Titanium::invtype::BANK_SIZE, Titanium::invtype::SHARED_BANK_SIZE,
|
||||
Titanium::invtype::TRADE_SIZE, Titanium::invtype::WORLD_SIZE, Titanium::invtype::LIMBO_SIZE,
|
||||
Titanium::invtype::TRIBUTE_SIZE, Titanium::INULL, Titanium::invtype::GUILD_TRIBUTE_SIZE,
|
||||
Titanium::invtype::MERCHANT_SIZE, Titanium::INULL, Titanium::invtype::CORPSE_SIZE,
|
||||
@@ -236,9 +236,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
Titanium::inventory::AllowOverLevelEquipment
|
||||
),
|
||||
/*[MobVersion::SoF] =*/
|
||||
EQEmu::inventory::LookupEntry(
|
||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQEmu::invtype::POSSESSIONS_SIZE, SoF::invtype::BANK_SIZE, SoF::invtype::SHARED_BANK_SIZE,
|
||||
EQ::inventory::LookupEntry(
|
||||
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQ::invtype::POSSESSIONS_SIZE, SoF::invtype::BANK_SIZE, SoF::invtype::SHARED_BANK_SIZE,
|
||||
SoF::invtype::TRADE_SIZE, SoF::invtype::WORLD_SIZE, SoF::invtype::LIMBO_SIZE,
|
||||
SoF::invtype::TRIBUTE_SIZE, SoF::INULL, SoF::invtype::GUILD_TRIBUTE_SIZE,
|
||||
SoF::invtype::MERCHANT_SIZE, SoF::INULL, SoF::invtype::CORPSE_SIZE,
|
||||
@@ -263,9 +263,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
SoF::inventory::AllowOverLevelEquipment
|
||||
),
|
||||
/*[MobVersion::SoD] =*/
|
||||
EQEmu::inventory::LookupEntry(
|
||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQEmu::invtype::POSSESSIONS_SIZE, SoD::invtype::BANK_SIZE, SoD::invtype::SHARED_BANK_SIZE,
|
||||
EQ::inventory::LookupEntry(
|
||||
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQ::invtype::POSSESSIONS_SIZE, SoD::invtype::BANK_SIZE, SoD::invtype::SHARED_BANK_SIZE,
|
||||
SoD::invtype::TRADE_SIZE, SoD::invtype::WORLD_SIZE, SoD::invtype::LIMBO_SIZE,
|
||||
SoD::invtype::TRIBUTE_SIZE, SoD::INULL, SoD::invtype::GUILD_TRIBUTE_SIZE,
|
||||
SoD::invtype::MERCHANT_SIZE, SoD::INULL, SoD::invtype::CORPSE_SIZE,
|
||||
@@ -290,9 +290,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
SoD::inventory::AllowOverLevelEquipment
|
||||
),
|
||||
/*[MobVersion::UF] =*/
|
||||
EQEmu::inventory::LookupEntry(
|
||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQEmu::invtype::POSSESSIONS_SIZE, UF::invtype::BANK_SIZE, UF::invtype::SHARED_BANK_SIZE,
|
||||
EQ::inventory::LookupEntry(
|
||||
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQ::invtype::POSSESSIONS_SIZE, UF::invtype::BANK_SIZE, UF::invtype::SHARED_BANK_SIZE,
|
||||
UF::invtype::TRADE_SIZE, UF::invtype::WORLD_SIZE, UF::invtype::LIMBO_SIZE,
|
||||
UF::invtype::TRIBUTE_SIZE, UF::INULL, UF::invtype::GUILD_TRIBUTE_SIZE,
|
||||
UF::invtype::MERCHANT_SIZE, UF::INULL, UF::invtype::CORPSE_SIZE,
|
||||
@@ -317,9 +317,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
UF::inventory::AllowOverLevelEquipment
|
||||
),
|
||||
/*[MobVersion::RoF] =*/
|
||||
EQEmu::inventory::LookupEntry(
|
||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQEmu::invtype::POSSESSIONS_SIZE, RoF::invtype::BANK_SIZE, RoF::invtype::SHARED_BANK_SIZE,
|
||||
EQ::inventory::LookupEntry(
|
||||
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQ::invtype::POSSESSIONS_SIZE, RoF::invtype::BANK_SIZE, RoF::invtype::SHARED_BANK_SIZE,
|
||||
RoF::invtype::TRADE_SIZE, RoF::invtype::WORLD_SIZE, RoF::invtype::LIMBO_SIZE,
|
||||
RoF::invtype::TRIBUTE_SIZE, RoF::invtype::TROPHY_TRIBUTE_SIZE, RoF::invtype::GUILD_TRIBUTE_SIZE,
|
||||
RoF::invtype::MERCHANT_SIZE, RoF::invtype::DELETED_SIZE, RoF::invtype::CORPSE_SIZE,
|
||||
@@ -344,9 +344,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
RoF::inventory::AllowOverLevelEquipment
|
||||
),
|
||||
/*[MobVersion::RoF2] =*/
|
||||
EQEmu::inventory::LookupEntry(
|
||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQEmu::invtype::POSSESSIONS_SIZE, RoF2::invtype::BANK_SIZE, RoF2::invtype::SHARED_BANK_SIZE,
|
||||
EQ::inventory::LookupEntry(
|
||||
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQ::invtype::POSSESSIONS_SIZE, RoF2::invtype::BANK_SIZE, RoF2::invtype::SHARED_BANK_SIZE,
|
||||
RoF2::invtype::TRADE_SIZE, RoF2::invtype::WORLD_SIZE, RoF2::invtype::LIMBO_SIZE,
|
||||
RoF2::invtype::TRIBUTE_SIZE, RoF2::invtype::TROPHY_TRIBUTE_SIZE, RoF2::invtype::GUILD_TRIBUTE_SIZE,
|
||||
RoF2::invtype::MERCHANT_SIZE, RoF2::invtype::DELETED_SIZE, RoF2::invtype::CORPSE_SIZE,
|
||||
@@ -371,9 +371,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
RoF2::inventory::AllowOverLevelEquipment
|
||||
),
|
||||
/*[MobVersion::NPC] =*/
|
||||
EQEmu::inventory::LookupEntry(
|
||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQEmu::invtype::POSSESSIONS_SIZE, EntityLimits::NPC::INULL, EntityLimits::NPC::INULL,
|
||||
EQ::inventory::LookupEntry(
|
||||
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQ::invtype::POSSESSIONS_SIZE, EntityLimits::NPC::INULL, EntityLimits::NPC::INULL,
|
||||
EntityLimits::NPC::invtype::TRADE_SIZE, EntityLimits::NPC::INULL, EntityLimits::NPC::INULL,
|
||||
EntityLimits::NPC::INULL, EntityLimits::NPC::INULL, EntityLimits::NPC::INULL,
|
||||
EntityLimits::NPC::INULL, EntityLimits::NPC::INULL, EntityLimits::NPC::INULL, /*InvTypeCorpseSize,*/
|
||||
@@ -389,8 +389,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
EntityLimits::NPC::INULL,
|
||||
EntityLimits::NPC::INULL,
|
||||
EntityLimits::NPC::INULL,
|
||||
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
|
||||
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
|
||||
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
|
||||
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
|
||||
|
||||
false,
|
||||
false,
|
||||
@@ -398,9 +398,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
false
|
||||
),
|
||||
/*[MobVersion::NPCMerchant] =*/
|
||||
EQEmu::inventory::LookupEntry(
|
||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL,
|
||||
EQ::inventory::LookupEntry(
|
||||
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL,
|
||||
EntityLimits::NPCMerchant::invtype::TRADE_SIZE, EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL,
|
||||
EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL,
|
||||
EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL, /*InvTypeCorpseSize,*/
|
||||
@@ -416,8 +416,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
EntityLimits::NPCMerchant::INULL,
|
||||
EntityLimits::NPCMerchant::INULL,
|
||||
EntityLimits::NPCMerchant::INULL,
|
||||
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
|
||||
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
|
||||
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
|
||||
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
|
||||
|
||||
false,
|
||||
false,
|
||||
@@ -425,9 +425,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
false
|
||||
),
|
||||
/*[MobVersion::Merc] =*/
|
||||
EQEmu::inventory::LookupEntry(
|
||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::Merc::INULL, EntityLimits::Merc::INULL,
|
||||
EQ::inventory::LookupEntry(
|
||||
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::Merc::INULL, EntityLimits::Merc::INULL,
|
||||
EntityLimits::Merc::invtype::TRADE_SIZE, EntityLimits::Merc::INULL, EntityLimits::Merc::INULL,
|
||||
EntityLimits::Merc::INULL, EntityLimits::Merc::INULL, EntityLimits::Merc::INULL,
|
||||
EntityLimits::Merc::INULL, EntityLimits::Merc::INULL, EntityLimits::Merc::INULL, /*InvTypeCorpseSize,*/
|
||||
@@ -443,8 +443,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
EntityLimits::Merc::INULL,
|
||||
EntityLimits::Merc::INULL,
|
||||
EntityLimits::Merc::INULL,
|
||||
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
|
||||
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
|
||||
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
|
||||
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
|
||||
|
||||
false,
|
||||
false,
|
||||
@@ -452,9 +452,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
false
|
||||
),
|
||||
/*[MobVersion::Bot] =*/
|
||||
EQEmu::inventory::LookupEntry(
|
||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::Bot::INULL, EntityLimits::Bot::INULL,
|
||||
EQ::inventory::LookupEntry(
|
||||
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::Bot::INULL, EntityLimits::Bot::INULL,
|
||||
EntityLimits::Bot::invtype::TRADE_SIZE, EntityLimits::Bot::INULL, EntityLimits::Bot::INULL,
|
||||
EntityLimits::Bot::INULL, EntityLimits::Bot::INULL, EntityLimits::Bot::INULL,
|
||||
EntityLimits::Bot::INULL, EntityLimits::Bot::INULL, EntityLimits::Bot::INULL, /*InvTypeCorpseSize,*/
|
||||
@@ -470,8 +470,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
EntityLimits::Bot::invslot::CURSOR_BITMASK,
|
||||
EntityLimits::Bot::invslot::POSSESSIONS_BITMASK,
|
||||
EntityLimits::Bot::INULL,
|
||||
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
|
||||
EQEmu::invaug::SOCKET_COUNT, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
|
||||
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
|
||||
EQ::invaug::SOCKET_COUNT, //EQ::inventory::SocketCount, /*ItemAugSize,*/
|
||||
|
||||
false,
|
||||
false,
|
||||
@@ -479,9 +479,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
false
|
||||
),
|
||||
/*[MobVersion::ClientPet] =*/
|
||||
EQEmu::inventory::LookupEntry(
|
||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL,
|
||||
EQ::inventory::LookupEntry(
|
||||
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL,
|
||||
EntityLimits::ClientPet::invtype::TRADE_SIZE, EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL,
|
||||
EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL,
|
||||
EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL, /*InvTypeCorpseSize,*/
|
||||
@@ -497,8 +497,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
EntityLimits::ClientPet::INULL,
|
||||
EntityLimits::ClientPet::INULL,
|
||||
EntityLimits::ClientPet::INULL,
|
||||
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
|
||||
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
|
||||
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
|
||||
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
|
||||
|
||||
false,
|
||||
false,
|
||||
@@ -506,9 +506,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
false
|
||||
),
|
||||
/*[MobVersion::NPCPet] =*/
|
||||
EQEmu::inventory::LookupEntry(
|
||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL,
|
||||
EQ::inventory::LookupEntry(
|
||||
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL,
|
||||
EntityLimits::NPCPet::invtype::TRADE_SIZE, EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL,
|
||||
EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL,
|
||||
EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL, /*InvTypeCorpseSize,*/
|
||||
@@ -524,8 +524,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
EntityLimits::NPCPet::INULL,
|
||||
EntityLimits::NPCPet::INULL,
|
||||
EntityLimits::NPCPet::INULL,
|
||||
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
|
||||
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
|
||||
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
|
||||
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
|
||||
|
||||
false,
|
||||
false,
|
||||
@@ -533,9 +533,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
false
|
||||
),
|
||||
/*[MobVersion::MercPet] =*/
|
||||
EQEmu::inventory::LookupEntry(
|
||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL,
|
||||
EQ::inventory::LookupEntry(
|
||||
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL,
|
||||
EntityLimits::MercPet::invtype::TRADE_SIZE, EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL,
|
||||
EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL,
|
||||
EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL, /*InvTypeCorpseSize,*/
|
||||
@@ -551,8 +551,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
EntityLimits::MercPet::INULL,
|
||||
EntityLimits::MercPet::INULL,
|
||||
EntityLimits::MercPet::INULL,
|
||||
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
|
||||
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
|
||||
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
|
||||
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
|
||||
|
||||
false,
|
||||
false,
|
||||
@@ -560,9 +560,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
false
|
||||
),
|
||||
/*[MobVersion::BotPet] =*/
|
||||
EQEmu::inventory::LookupEntry(
|
||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL,
|
||||
EQ::inventory::LookupEntry(
|
||||
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL,
|
||||
EntityLimits::BotPet::invtype::TRADE_SIZE, EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL,
|
||||
EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL,
|
||||
EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL, /*InvTypeCorpseSize,*/
|
||||
@@ -578,8 +578,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
EntityLimits::BotPet::INULL,
|
||||
EntityLimits::BotPet::INULL,
|
||||
EntityLimits::BotPet::INULL,
|
||||
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
|
||||
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
|
||||
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
|
||||
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
|
||||
|
||||
false,
|
||||
false,
|
||||
@@ -587,8 +587,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
false
|
||||
),
|
||||
/*[MobVersion::OfflineTitanium] =*/
|
||||
EQEmu::inventory::LookupEntry(
|
||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQ::inventory::LookupEntry(
|
||||
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
Titanium::INULL, Titanium::INULL, Titanium::INULL,
|
||||
Titanium::invtype::TRADE_SIZE, Titanium::INULL, Titanium::INULL,
|
||||
Titanium::INULL, Titanium::INULL, Titanium::INULL,
|
||||
@@ -614,8 +614,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
false
|
||||
),
|
||||
/*[MobVersion::OfflineSoF] =*/
|
||||
EQEmu::inventory::LookupEntry(
|
||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQ::inventory::LookupEntry(
|
||||
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
SoF::INULL, SoF::INULL, SoF::INULL,
|
||||
SoF::invtype::TRADE_SIZE, SoF::INULL, SoF::INULL,
|
||||
SoF::INULL, SoF::INULL, SoF::INULL,
|
||||
@@ -641,8 +641,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
false
|
||||
),
|
||||
/*[MobVersion::OfflineSoD] =*/
|
||||
EQEmu::inventory::LookupEntry(
|
||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQ::inventory::LookupEntry(
|
||||
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
SoD::INULL, SoD::INULL, SoD::INULL,
|
||||
SoD::invtype::TRADE_SIZE, SoD::INULL, SoD::INULL,
|
||||
SoD::INULL, SoD::INULL, SoD::INULL,
|
||||
@@ -668,8 +668,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
false
|
||||
),
|
||||
/*[MobVersion::OfflineUF] =*/
|
||||
EQEmu::inventory::LookupEntry(
|
||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQ::inventory::LookupEntry(
|
||||
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
UF::INULL, UF::INULL, UF::INULL,
|
||||
UF::invtype::TRADE_SIZE, UF::INULL, UF::INULL,
|
||||
UF::INULL, UF::INULL, UF::INULL,
|
||||
@@ -695,8 +695,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
false
|
||||
),
|
||||
/*[MobVersion::OfflineRoF] =*/
|
||||
EQEmu::inventory::LookupEntry(
|
||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQ::inventory::LookupEntry(
|
||||
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
RoF::INULL, RoF::INULL, RoF::INULL,
|
||||
RoF::invtype::TRADE_SIZE, RoF::INULL, RoF::INULL,
|
||||
RoF::INULL, RoF::INULL, RoF::INULL,
|
||||
@@ -722,8 +722,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
false
|
||||
),
|
||||
/*[MobVersion::OfflineRoF2] =*/
|
||||
EQEmu::inventory::LookupEntry(
|
||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
EQ::inventory::LookupEntry(
|
||||
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||
RoF2::INULL, RoF2::INULL, RoF2::INULL,
|
||||
RoF2::invtype::TRADE_SIZE, RoF2::INULL, RoF2::INULL,
|
||||
RoF2::INULL, RoF2::INULL, RoF2::INULL,
|
||||
@@ -751,7 +751,7 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
||||
};
|
||||
|
||||
static bool inventory_dictionary_init = false;
|
||||
void EQEmu::inventory::InitializeDynamicLookups() {
|
||||
void EQ::inventory::InitializeDynamicLookups() {
|
||||
if (inventory_dictionary_init == true)
|
||||
return;
|
||||
inventory_dictionary_init = true;
|
||||
@@ -774,9 +774,9 @@ void EQEmu::inventory::InitializeDynamicLookups() {
|
||||
|
||||
const uint32 dynamic_check_mask =
|
||||
(
|
||||
EQEmu::expansions::bitPoR |
|
||||
EQEmu::expansions::bitTBS |
|
||||
EQEmu::expansions::bitHoT
|
||||
EQ::expansions::bitPoR |
|
||||
EQ::expansions::bitTBS |
|
||||
EQ::expansions::bitHoT
|
||||
);
|
||||
|
||||
// if all of the above expansion bits are present, then static references will suffice
|
||||
@@ -784,7 +784,7 @@ void EQEmu::inventory::InitializeDynamicLookups() {
|
||||
return;
|
||||
|
||||
// Dynamic Lookups (promotive methodology) (all mob versions allowed)
|
||||
for (uint32 iter = static_cast<uint32>(EQEmu::versions::MobVersion::Unknown); iter <= static_cast<uint32>(EQEmu::versions::LastPCMobVersion); ++iter) {
|
||||
for (uint32 iter = static_cast<uint32>(EQ::versions::MobVersion::Unknown); iter <= static_cast<uint32>(EQ::versions::LastPCMobVersion); ++iter) {
|
||||
// no need to dynamic this condition since it is the lowest compatibility standard
|
||||
if ((dynamic_check_mask & ~constants_static_lookup_entries[iter].ExpansionsMask) == dynamic_check_mask)
|
||||
continue;
|
||||
@@ -803,21 +803,21 @@ void EQEmu::inventory::InitializeDynamicLookups() {
|
||||
inventory_dynamic_nongm_lookup_entries[iter]->PossessionsBitmask = 0; // we'll fix later
|
||||
inventory_dynamic_nongm_lookup_entries[iter]->CorpseBitmask = 0; // we'll fix later
|
||||
|
||||
if (RuleI(World, ExpansionSettings) & EQEmu::expansions::bitPoR) {
|
||||
if (RuleI(World, ExpansionSettings) & EQ::expansions::bitPoR) {
|
||||
// update bank size
|
||||
if (constants_static_lookup_entries[iter].ExpansionsMask & EQEmu::expansions::bitPoR)
|
||||
if (constants_static_lookup_entries[iter].ExpansionsMask & EQ::expansions::bitPoR)
|
||||
inventory_dynamic_nongm_lookup_entries[iter]->InventoryTypeSize.Bank = SoF::invtype::BANK_SIZE;
|
||||
}
|
||||
|
||||
if (RuleI(World, ExpansionSettings) & EQEmu::expansions::bitTBS) {
|
||||
if (RuleI(World, ExpansionSettings) & EQ::expansions::bitTBS) {
|
||||
// update power source
|
||||
if (constants_static_lookup_entries[iter].ExpansionsMask & EQEmu::expansions::bitTBS)
|
||||
if (constants_static_lookup_entries[iter].ExpansionsMask & EQ::expansions::bitTBS)
|
||||
inventory_dynamic_nongm_lookup_entries[iter]->EquipmentBitmask = SoF::invslot::EQUIPMENT_BITMASK;
|
||||
}
|
||||
|
||||
if (RuleI(World, ExpansionSettings) & EQEmu::expansions::bitHoT) {
|
||||
if (RuleI(World, ExpansionSettings) & EQ::expansions::bitHoT) {
|
||||
// update general size
|
||||
if (constants_static_lookup_entries[iter].ExpansionsMask & EQEmu::expansions::bitHoT)
|
||||
if (constants_static_lookup_entries[iter].ExpansionsMask & EQ::expansions::bitHoT)
|
||||
inventory_dynamic_nongm_lookup_entries[iter]->GeneralBitmask = RoF::invslot::GENERAL_BITMASK;
|
||||
}
|
||||
|
||||
@@ -841,7 +841,7 @@ void EQEmu::inventory::InitializeDynamicLookups() {
|
||||
}
|
||||
|
||||
// Dynamic GM Lookups (demotive methodology) (client-linked mob versions only)
|
||||
for (uint32 iter = static_cast<uint32>(EQEmu::versions::MobVersion::Unknown); iter <= static_cast<uint32>(EQEmu::versions::LastPCMobVersion); ++iter) {
|
||||
for (uint32 iter = static_cast<uint32>(EQ::versions::MobVersion::Unknown); iter <= static_cast<uint32>(EQ::versions::LastPCMobVersion); ++iter) {
|
||||
// no need to dynamic this condition since it is the lowest compatibility standard
|
||||
if ((dynamic_check_mask & ~constants_static_lookup_entries[iter].ExpansionsMask) == dynamic_check_mask)
|
||||
continue;
|
||||
@@ -869,13 +869,13 @@ void EQEmu::inventory::InitializeDynamicLookups() {
|
||||
inventory_dynamic_gm_lookup_entries[iter]->PossessionsBitmask = 0; // we'll fix later
|
||||
inventory_dynamic_gm_lookup_entries[iter]->CorpseBitmask = 0; // we'll fix later
|
||||
|
||||
if (~RuleI(World, ExpansionSettings) & EQEmu::expansions::bitPoR) {
|
||||
if (~RuleI(World, ExpansionSettings) & EQ::expansions::bitPoR) {
|
||||
// update bank size
|
||||
if (constants_static_lookup_entries[iter].ExpansionsMask & EQEmu::expansions::bitPoR)
|
||||
if (constants_static_lookup_entries[iter].ExpansionsMask & EQ::expansions::bitPoR)
|
||||
inventory_dynamic_gm_lookup_entries[iter]->InventoryTypeSize.Bank = Titanium::invtype::BANK_SIZE;
|
||||
}
|
||||
|
||||
if (~RuleI(World, ExpansionSettings) & EQEmu::expansions::bitTBS) {
|
||||
if (~RuleI(World, ExpansionSettings) & EQ::expansions::bitTBS) {
|
||||
// update power source
|
||||
switch (iter) {
|
||||
case versions::bitUF:
|
||||
@@ -890,7 +890,7 @@ void EQEmu::inventory::InitializeDynamicLookups() {
|
||||
}
|
||||
}
|
||||
|
||||
if (~RuleI(World, ExpansionSettings) & EQEmu::expansions::bitHoT) {
|
||||
if (~RuleI(World, ExpansionSettings) & EQ::expansions::bitHoT) {
|
||||
// update general size
|
||||
switch (iter) {
|
||||
case versions::bitUF:
|
||||
@@ -927,7 +927,7 @@ void EQEmu::inventory::InitializeDynamicLookups() {
|
||||
// only client versions that require a change from their static definitions have been given a dynamic (gm) lookup entry
|
||||
}
|
||||
|
||||
const EQEmu::inventory::LookupEntry* EQEmu::inventory::DynamicLookup(versions::MobVersion mob_version, bool gm_flag)
|
||||
const EQ::inventory::LookupEntry* EQ::inventory::DynamicLookup(versions::MobVersion mob_version, bool gm_flag)
|
||||
{
|
||||
if (gm_flag)
|
||||
return DynamicGMLookup(mob_version);
|
||||
@@ -935,7 +935,7 @@ const EQEmu::inventory::LookupEntry* EQEmu::inventory::DynamicLookup(versions::M
|
||||
return DynamicNonGMLookup(mob_version);
|
||||
}
|
||||
|
||||
const EQEmu::inventory::LookupEntry* EQEmu::inventory::DynamicNonGMLookup(versions::MobVersion mob_version)
|
||||
const EQ::inventory::LookupEntry* EQ::inventory::DynamicNonGMLookup(versions::MobVersion mob_version)
|
||||
{
|
||||
mob_version = versions::ValidateMobVersion(mob_version);
|
||||
if (inventory_dynamic_nongm_lookup_entries[static_cast<int>(mob_version)])
|
||||
@@ -944,7 +944,7 @@ const EQEmu::inventory::LookupEntry* EQEmu::inventory::DynamicNonGMLookup(versio
|
||||
return &inventory_static_lookup_entries[static_cast<int>(mob_version)];
|
||||
}
|
||||
|
||||
const EQEmu::inventory::LookupEntry* EQEmu::inventory::DynamicGMLookup(versions::MobVersion mob_version)
|
||||
const EQ::inventory::LookupEntry* EQ::inventory::DynamicGMLookup(versions::MobVersion mob_version)
|
||||
{
|
||||
mob_version = versions::ValidateMobVersion(mob_version);
|
||||
if (inventory_dynamic_gm_lookup_entries[static_cast<int>(mob_version)])
|
||||
@@ -953,107 +953,107 @@ const EQEmu::inventory::LookupEntry* EQEmu::inventory::DynamicGMLookup(versions:
|
||||
return &inventory_static_lookup_entries[static_cast<int>(mob_version)];
|
||||
}
|
||||
|
||||
const EQEmu::inventory::LookupEntry* EQEmu::inventory::StaticLookup(versions::MobVersion mob_version)
|
||||
const EQ::inventory::LookupEntry* EQ::inventory::StaticLookup(versions::MobVersion mob_version)
|
||||
{
|
||||
return &inventory_static_lookup_entries[static_cast<int>(versions::ValidateMobVersion(mob_version))];
|
||||
}
|
||||
|
||||
static std::unique_ptr<EQEmu::behavior::LookupEntry> behavior_dynamic_nongm_lookup_entries[EQEmu::versions::MobVersionCount];
|
||||
static std::unique_ptr<EQEmu::behavior::LookupEntry> behavior_dynamic_gm_lookup_entries[EQEmu::versions::MobVersionCount];
|
||||
static const EQEmu::behavior::LookupEntry behavior_static_lookup_entries[EQEmu::versions::MobVersionCount] =
|
||||
static std::unique_ptr<EQ::behavior::LookupEntry> behavior_dynamic_nongm_lookup_entries[EQ::versions::MobVersionCount];
|
||||
static std::unique_ptr<EQ::behavior::LookupEntry> behavior_dynamic_gm_lookup_entries[EQ::versions::MobVersionCount];
|
||||
static const EQ::behavior::LookupEntry behavior_static_lookup_entries[EQ::versions::MobVersionCount] =
|
||||
{
|
||||
/*[MobVersion::Unknown] =*/
|
||||
EQEmu::behavior::LookupEntry(
|
||||
EQ::behavior::LookupEntry(
|
||||
true
|
||||
),
|
||||
/*[MobVersion::Client62] =*/
|
||||
EQEmu::behavior::LookupEntry(
|
||||
EQ::behavior::LookupEntry(
|
||||
true
|
||||
),
|
||||
/*[MobVersion::Titanium] =*/
|
||||
EQEmu::behavior::LookupEntry(
|
||||
EQ::behavior::LookupEntry(
|
||||
Titanium::behavior::CoinHasWeight
|
||||
),
|
||||
/*[MobVersion::SoF] =*/
|
||||
EQEmu::behavior::LookupEntry(
|
||||
EQ::behavior::LookupEntry(
|
||||
SoF::behavior::CoinHasWeight
|
||||
),
|
||||
/*[MobVersion::SoD] =*/
|
||||
EQEmu::behavior::LookupEntry(
|
||||
EQ::behavior::LookupEntry(
|
||||
SoD::behavior::CoinHasWeight
|
||||
),
|
||||
/*[MobVersion::UF] =*/
|
||||
EQEmu::behavior::LookupEntry(
|
||||
EQ::behavior::LookupEntry(
|
||||
UF::behavior::CoinHasWeight
|
||||
),
|
||||
/*[MobVersion::RoF] =*/
|
||||
EQEmu::behavior::LookupEntry(
|
||||
EQ::behavior::LookupEntry(
|
||||
RoF::behavior::CoinHasWeight
|
||||
),
|
||||
/*[MobVersion::RoF2] =*/
|
||||
EQEmu::behavior::LookupEntry(
|
||||
EQ::behavior::LookupEntry(
|
||||
RoF2::behavior::CoinHasWeight
|
||||
),
|
||||
/*[MobVersion::NPC] =*/
|
||||
EQEmu::behavior::LookupEntry(
|
||||
EQEmu::behavior::CoinHasWeight
|
||||
EQ::behavior::LookupEntry(
|
||||
EQ::behavior::CoinHasWeight
|
||||
),
|
||||
/*[MobVersion::NPCMerchant] =*/
|
||||
EQEmu::behavior::LookupEntry(
|
||||
EQEmu::behavior::CoinHasWeight
|
||||
EQ::behavior::LookupEntry(
|
||||
EQ::behavior::CoinHasWeight
|
||||
),
|
||||
/*[MobVersion::Merc] =*/
|
||||
EQEmu::behavior::LookupEntry(
|
||||
EQEmu::behavior::CoinHasWeight
|
||||
EQ::behavior::LookupEntry(
|
||||
EQ::behavior::CoinHasWeight
|
||||
),
|
||||
/*[MobVersion::Bot] =*/
|
||||
EQEmu::behavior::LookupEntry(
|
||||
EQEmu::behavior::CoinHasWeight
|
||||
EQ::behavior::LookupEntry(
|
||||
EQ::behavior::CoinHasWeight
|
||||
),
|
||||
/*[MobVersion::ClientPet] =*/
|
||||
EQEmu::behavior::LookupEntry(
|
||||
EQEmu::behavior::CoinHasWeight
|
||||
EQ::behavior::LookupEntry(
|
||||
EQ::behavior::CoinHasWeight
|
||||
),
|
||||
/*[MobVersion::NPCPet] =*/
|
||||
EQEmu::behavior::LookupEntry(
|
||||
EQEmu::behavior::CoinHasWeight
|
||||
EQ::behavior::LookupEntry(
|
||||
EQ::behavior::CoinHasWeight
|
||||
),
|
||||
/*[MobVersion::MercPet] =*/
|
||||
EQEmu::behavior::LookupEntry(
|
||||
EQEmu::behavior::CoinHasWeight
|
||||
EQ::behavior::LookupEntry(
|
||||
EQ::behavior::CoinHasWeight
|
||||
),
|
||||
/*[MobVersion::BotPet] =*/
|
||||
EQEmu::behavior::LookupEntry(
|
||||
EQEmu::behavior::CoinHasWeight
|
||||
EQ::behavior::LookupEntry(
|
||||
EQ::behavior::CoinHasWeight
|
||||
),
|
||||
/*[MobVersion::OfflineTitanium] =*/
|
||||
EQEmu::behavior::LookupEntry(
|
||||
EQ::behavior::LookupEntry(
|
||||
Titanium::behavior::CoinHasWeight
|
||||
),
|
||||
/*[MobVersion::OfflineSoF] =*/
|
||||
EQEmu::behavior::LookupEntry(
|
||||
EQ::behavior::LookupEntry(
|
||||
SoF::behavior::CoinHasWeight
|
||||
),
|
||||
/*[MobVersion::OfflineSoD] =*/
|
||||
EQEmu::behavior::LookupEntry(
|
||||
EQ::behavior::LookupEntry(
|
||||
SoD::behavior::CoinHasWeight
|
||||
),
|
||||
/*[MobVersion::OfflineUF] =*/
|
||||
EQEmu::behavior::LookupEntry(
|
||||
EQ::behavior::LookupEntry(
|
||||
UF::behavior::CoinHasWeight
|
||||
),
|
||||
/*[MobVersion::OfflineRoF] =*/
|
||||
EQEmu::behavior::LookupEntry(
|
||||
EQ::behavior::LookupEntry(
|
||||
RoF::behavior::CoinHasWeight
|
||||
),
|
||||
/*[MobVersion::OfflineRoF2] =*/
|
||||
EQEmu::behavior::LookupEntry(
|
||||
EQ::behavior::LookupEntry(
|
||||
RoF2::behavior::CoinHasWeight
|
||||
)
|
||||
};
|
||||
|
||||
static bool behavior_dictionary_init = false;
|
||||
void EQEmu::behavior::InitializeDynamicLookups() {
|
||||
void EQ::behavior::InitializeDynamicLookups() {
|
||||
if (behavior_dictionary_init == true)
|
||||
return;
|
||||
behavior_dictionary_init = true;
|
||||
@@ -1064,7 +1064,7 @@ void EQEmu::behavior::InitializeDynamicLookups() {
|
||||
// use static references for now
|
||||
}
|
||||
|
||||
const EQEmu::behavior::LookupEntry* EQEmu::behavior::DynamicLookup(versions::MobVersion mob_version, bool gm_flag)
|
||||
const EQ::behavior::LookupEntry* EQ::behavior::DynamicLookup(versions::MobVersion mob_version, bool gm_flag)
|
||||
{
|
||||
if (gm_flag)
|
||||
return DynamicGMLookup(mob_version);
|
||||
@@ -1072,7 +1072,7 @@ const EQEmu::behavior::LookupEntry* EQEmu::behavior::DynamicLookup(versions::Mob
|
||||
return DynamicNonGMLookup(mob_version);
|
||||
}
|
||||
|
||||
const EQEmu::behavior::LookupEntry* EQEmu::behavior::DynamicNonGMLookup(versions::MobVersion mob_version)
|
||||
const EQ::behavior::LookupEntry* EQ::behavior::DynamicNonGMLookup(versions::MobVersion mob_version)
|
||||
{
|
||||
mob_version = versions::ValidateMobVersion(mob_version);
|
||||
if (behavior_dynamic_nongm_lookup_entries[static_cast<int>(mob_version)])
|
||||
@@ -1081,7 +1081,7 @@ const EQEmu::behavior::LookupEntry* EQEmu::behavior::DynamicNonGMLookup(versions
|
||||
return &behavior_static_lookup_entries[static_cast<int>(mob_version)];
|
||||
}
|
||||
|
||||
const EQEmu::behavior::LookupEntry* EQEmu::behavior::DynamicGMLookup(versions::MobVersion mob_version)
|
||||
const EQ::behavior::LookupEntry* EQ::behavior::DynamicGMLookup(versions::MobVersion mob_version)
|
||||
{
|
||||
mob_version = versions::ValidateMobVersion(mob_version);
|
||||
if (behavior_dynamic_gm_lookup_entries[static_cast<int>(mob_version)])
|
||||
@@ -1090,17 +1090,17 @@ const EQEmu::behavior::LookupEntry* EQEmu::behavior::DynamicGMLookup(versions::M
|
||||
return &behavior_static_lookup_entries[static_cast<int>(mob_version)];
|
||||
}
|
||||
|
||||
const EQEmu::behavior::LookupEntry* EQEmu::behavior::StaticLookup(versions::MobVersion mob_version)
|
||||
const EQ::behavior::LookupEntry* EQ::behavior::StaticLookup(versions::MobVersion mob_version)
|
||||
{
|
||||
return &behavior_static_lookup_entries[static_cast<int>(versions::ValidateMobVersion(mob_version))];
|
||||
}
|
||||
|
||||
static std::unique_ptr<EQEmu::spells::LookupEntry> spells_dynamic_nongm_lookup_entries[EQEmu::versions::ClientVersionCount];
|
||||
static std::unique_ptr<EQEmu::spells::LookupEntry> spells_dynamic_gm_lookup_entries[EQEmu::versions::ClientVersionCount];
|
||||
static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::versions::ClientVersionCount] =
|
||||
static std::unique_ptr<EQ::spells::LookupEntry> spells_dynamic_nongm_lookup_entries[EQ::versions::ClientVersionCount];
|
||||
static std::unique_ptr<EQ::spells::LookupEntry> spells_dynamic_gm_lookup_entries[EQ::versions::ClientVersionCount];
|
||||
static const EQ::spells::LookupEntry spells_static_lookup_entries[EQ::versions::ClientVersionCount] =
|
||||
{
|
||||
/*[ClientVersion::Unknown] =*/
|
||||
EQEmu::spells::LookupEntry(
|
||||
EQ::spells::LookupEntry(
|
||||
ClientUnknown::INULL,
|
||||
ClientUnknown::INULL,
|
||||
ClientUnknown::INULL,
|
||||
@@ -1113,7 +1113,7 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
|
||||
ClientUnknown::INULL
|
||||
),
|
||||
/*[ClientVersion::Client62] =*/
|
||||
EQEmu::spells::LookupEntry(
|
||||
EQ::spells::LookupEntry(
|
||||
Client62::INULL,
|
||||
Client62::INULL,
|
||||
Client62::INULL,
|
||||
@@ -1126,7 +1126,7 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
|
||||
Client62::INULL
|
||||
),
|
||||
/*[ClientVersion::Titanium] =*/
|
||||
EQEmu::spells::LookupEntry(
|
||||
EQ::spells::LookupEntry(
|
||||
Titanium::spells::SPELL_ID_MAX,
|
||||
Titanium::spells::SPELLBOOK_SIZE,
|
||||
Titanium::spells::SPELL_GEM_COUNT,
|
||||
@@ -1139,7 +1139,7 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
|
||||
Titanium::spells::MERC_BUFFS
|
||||
),
|
||||
/*[ClientVersion::SoF] =*/
|
||||
EQEmu::spells::LookupEntry(
|
||||
EQ::spells::LookupEntry(
|
||||
SoF::spells::SPELL_ID_MAX,
|
||||
SoF::spells::SPELLBOOK_SIZE,
|
||||
SoF::spells::SPELL_GEM_COUNT,
|
||||
@@ -1152,7 +1152,7 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
|
||||
SoF::spells::MERC_BUFFS
|
||||
),
|
||||
/*[ClientVersion::SoD] =*/
|
||||
EQEmu::spells::LookupEntry(
|
||||
EQ::spells::LookupEntry(
|
||||
SoD::spells::SPELL_ID_MAX,
|
||||
SoD::spells::SPELLBOOK_SIZE,
|
||||
SoD::spells::SPELL_GEM_COUNT,
|
||||
@@ -1165,7 +1165,7 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
|
||||
SoD::spells::MERC_BUFFS
|
||||
),
|
||||
/*[ClientVersion::UF] =*/
|
||||
EQEmu::spells::LookupEntry(
|
||||
EQ::spells::LookupEntry(
|
||||
UF::spells::SPELL_ID_MAX,
|
||||
UF::spells::SPELLBOOK_SIZE,
|
||||
UF::spells::SPELL_GEM_COUNT,
|
||||
@@ -1178,7 +1178,7 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
|
||||
UF::spells::MERC_BUFFS
|
||||
),
|
||||
/*[ClientVersion::RoF] =*/
|
||||
EQEmu::spells::LookupEntry(
|
||||
EQ::spells::LookupEntry(
|
||||
RoF::spells::SPELL_ID_MAX,
|
||||
RoF::spells::SPELLBOOK_SIZE,
|
||||
UF::spells::SPELL_GEM_COUNT, // client translators are setup to allow the max value a client supports..however, the top 4 indices are not valid in this case
|
||||
@@ -1191,7 +1191,7 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
|
||||
RoF::spells::MERC_BUFFS
|
||||
),
|
||||
/*[ClientVersion::RoF2] =*/
|
||||
EQEmu::spells::LookupEntry(
|
||||
EQ::spells::LookupEntry(
|
||||
RoF2::spells::SPELL_ID_MAX,
|
||||
RoF2::spells::SPELLBOOK_SIZE,
|
||||
UF::spells::SPELL_GEM_COUNT, // client translators are setup to allow the max value a client supports..however, the top 4 indices are not valid in this case
|
||||
@@ -1206,7 +1206,7 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
|
||||
};
|
||||
|
||||
static bool spells_dictionary_init = false;
|
||||
void EQEmu::spells::InitializeDynamicLookups() {
|
||||
void EQ::spells::InitializeDynamicLookups() {
|
||||
if (spells_dictionary_init == true)
|
||||
return;
|
||||
spells_dictionary_init = true;
|
||||
@@ -1217,7 +1217,7 @@ void EQEmu::spells::InitializeDynamicLookups() {
|
||||
// use static references for now
|
||||
}
|
||||
|
||||
const EQEmu::spells::LookupEntry* EQEmu::spells::DynamicLookup(versions::ClientVersion client_version, bool gm_flag)
|
||||
const EQ::spells::LookupEntry* EQ::spells::DynamicLookup(versions::ClientVersion client_version, bool gm_flag)
|
||||
{
|
||||
if (gm_flag)
|
||||
return DynamicGMLookup(client_version);
|
||||
@@ -1225,7 +1225,7 @@ const EQEmu::spells::LookupEntry* EQEmu::spells::DynamicLookup(versions::ClientV
|
||||
return DynamicNonGMLookup(client_version);
|
||||
}
|
||||
|
||||
const EQEmu::spells::LookupEntry* EQEmu::spells::DynamicNonGMLookup(versions::ClientVersion client_version)
|
||||
const EQ::spells::LookupEntry* EQ::spells::DynamicNonGMLookup(versions::ClientVersion client_version)
|
||||
{
|
||||
client_version = versions::ValidateClientVersion(client_version);
|
||||
if (spells_dynamic_nongm_lookup_entries[static_cast<int>(client_version)])
|
||||
@@ -1234,7 +1234,7 @@ const EQEmu::spells::LookupEntry* EQEmu::spells::DynamicNonGMLookup(versions::Cl
|
||||
return &spells_static_lookup_entries[static_cast<int>(client_version)];
|
||||
}
|
||||
|
||||
const EQEmu::spells::LookupEntry* EQEmu::spells::DynamicGMLookup(versions::ClientVersion client_version)
|
||||
const EQ::spells::LookupEntry* EQ::spells::DynamicGMLookup(versions::ClientVersion client_version)
|
||||
{
|
||||
client_version = versions::ValidateClientVersion(client_version);
|
||||
if (spells_dynamic_gm_lookup_entries[static_cast<int>(client_version)])
|
||||
@@ -1243,7 +1243,7 @@ const EQEmu::spells::LookupEntry* EQEmu::spells::DynamicGMLookup(versions::Clien
|
||||
return &spells_static_lookup_entries[static_cast<int>(client_version)];
|
||||
}
|
||||
|
||||
const EQEmu::spells::LookupEntry* EQEmu::spells::StaticLookup(versions::ClientVersion client_version)
|
||||
const EQ::spells::LookupEntry* EQ::spells::StaticLookup(versions::ClientVersion client_version)
|
||||
{
|
||||
return &spells_static_lookup_entries[static_cast<int>(versions::ValidateClientVersion(client_version))];
|
||||
}
|
||||
|
||||
+10
-10
@@ -31,13 +31,13 @@
|
||||
#include "../common/patches/rof2_limits.h"
|
||||
|
||||
|
||||
namespace EQEmu
|
||||
namespace EQ
|
||||
{
|
||||
void InitializeDynamicLookups();
|
||||
|
||||
namespace constants {
|
||||
struct LookupEntry {
|
||||
EQEmu::expansions::Expansion Expansion;
|
||||
EQ::expansions::Expansion Expansion;
|
||||
uint32 ExpansionBit;
|
||||
uint32 ExpansionsMask;
|
||||
int16 CharacterCreationLimit;
|
||||
@@ -45,7 +45,7 @@ namespace EQEmu
|
||||
|
||||
LookupEntry(const LookupEntry *lookup_entry) { }
|
||||
LookupEntry(
|
||||
EQEmu::expansions::Expansion Expansion,
|
||||
EQ::expansions::Expansion Expansion,
|
||||
uint32 ExpansionBit,
|
||||
uint32 ExpansionsMask,
|
||||
int16 CharacterCreationLimit,
|
||||
@@ -111,7 +111,7 @@ namespace EQEmu
|
||||
|
||||
union {
|
||||
InventoryTypeSize_Struct InventoryTypeSize;
|
||||
int16 InventoryTypeSizeArray[25]; // should reflect EQEmu::invtype::TYPE_COUNT referenced in emu_constants.h
|
||||
int16 InventoryTypeSizeArray[25]; // should reflect EQ::invtype::TYPE_COUNT referenced in emu_constants.h
|
||||
};
|
||||
|
||||
uint64 EquipmentBitmask;
|
||||
@@ -244,9 +244,9 @@ namespace ClientUnknown
|
||||
const int16 INULL = 0;
|
||||
|
||||
namespace constants {
|
||||
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::EverQuest;
|
||||
const uint32 EXPANSION_BIT = EQEmu::expansions::bitEverQuest;
|
||||
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskEverQuest;
|
||||
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::EverQuest;
|
||||
const uint32 EXPANSION_BIT = EQ::expansions::bitEverQuest;
|
||||
const uint32 EXPANSIONS_MASK = EQ::expansions::maskEverQuest;
|
||||
|
||||
} // namespace constants
|
||||
|
||||
@@ -258,9 +258,9 @@ namespace Client62
|
||||
const int16 INULL = 0;
|
||||
|
||||
namespace constants {
|
||||
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::EverQuest;
|
||||
const uint32 EXPANSION_BIT = EQEmu::expansions::bitEverQuest;
|
||||
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskEverQuest;
|
||||
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::EverQuest;
|
||||
const uint32 EXPANSION_BIT = EQ::expansions::bitEverQuest;
|
||||
const uint32 EXPANSIONS_MASK = EQ::expansions::maskEverQuest;
|
||||
|
||||
} // namespace constants
|
||||
|
||||
|
||||
+69
-63
@@ -35,6 +35,8 @@ static const uint32 MAX_MERC = 100;
|
||||
static const uint32 MAX_MERC_GRADES = 10;
|
||||
static const uint32 MAX_MERC_STANCES = 10;
|
||||
static const uint32 BLOCKED_BUFF_COUNT = 20;
|
||||
static const uint32 QUESTREWARD_COUNT = 8;
|
||||
static const uint32 ADVANCED_LORE_LENGTH = 8192;
|
||||
|
||||
|
||||
/*
|
||||
@@ -127,7 +129,7 @@ struct LDoNTrapTemplate
|
||||
|
||||
// All clients translate the character select information to some degree
|
||||
|
||||
struct CharSelectEquip : EQEmu::textures::Texture_Struct, EQEmu::textures::Tint_Struct {};
|
||||
struct CharSelectEquip : EQ::textures::Texture_Struct, EQ::textures::Tint_Struct {};
|
||||
|
||||
// RoF2-based hybrid struct
|
||||
struct CharacterSelectEntry_Struct
|
||||
@@ -142,7 +144,7 @@ struct CharacterSelectEntry_Struct
|
||||
uint16 Instance;
|
||||
uint8 Gender;
|
||||
uint8 Face;
|
||||
CharSelectEquip Equip[EQEmu::textures::materialCount];
|
||||
CharSelectEquip Equip[EQ::textures::materialCount];
|
||||
uint8 Unknown15; // Seen FF
|
||||
uint8 Unknown19; // Seen FF
|
||||
uint32 DrakkinTattoo;
|
||||
@@ -251,7 +253,7 @@ struct Spawn_Struct {
|
||||
/*0189*/ uint32 petOwnerId; // If this is a pet, the spawn id of owner
|
||||
/*0193*/ uint8 guildrank; // 0=normal, 1=officer, 2=leader
|
||||
/*0194*/ uint8 unknown0194[3];
|
||||
/*0197*/ EQEmu::TextureProfile equipment;
|
||||
/*0197*/ EQ::TextureProfile equipment;
|
||||
/*0233*/ float runspeed; // Speed when running
|
||||
/*0036*/ uint8 afk; // 0=no, 1=afk
|
||||
/*0238*/ uint32 guildID; // Current guild
|
||||
@@ -282,7 +284,7 @@ union
|
||||
/*0340*/ uint32 spawnId; // Spawn Id
|
||||
/*0344*/ float bounding_radius; // used in melee, overrides calc
|
||||
/*0347*/ uint8 IsMercenary;
|
||||
/*0348*/ EQEmu::TintProfile equipment_tint;
|
||||
/*0348*/ EQ::TintProfile equipment_tint;
|
||||
/*0384*/ uint8 lfg; // 0=off, 1=lfg on
|
||||
/*0385*/
|
||||
|
||||
@@ -734,7 +736,7 @@ struct BandolierItem_Struct
|
||||
struct Bandolier_Struct
|
||||
{
|
||||
char Name[32];
|
||||
BandolierItem_Struct Items[EQEmu::profile::BANDOLIER_ITEM_COUNT];
|
||||
BandolierItem_Struct Items[EQ::profile::BANDOLIER_ITEM_COUNT];
|
||||
};
|
||||
|
||||
//len = 72
|
||||
@@ -748,7 +750,7 @@ struct PotionBeltItem_Struct
|
||||
//len = 288
|
||||
struct PotionBelt_Struct
|
||||
{
|
||||
PotionBeltItem_Struct Items[EQEmu::profile::POTION_BELT_SIZE];
|
||||
PotionBeltItem_Struct Items[EQ::profile::POTION_BELT_SIZE];
|
||||
};
|
||||
|
||||
struct MovePotionToBelt_Struct
|
||||
@@ -839,7 +841,7 @@ struct SuspendedMinion_Struct
|
||||
/*002*/ uint32 HP;
|
||||
/*006*/ uint32 Mana;
|
||||
/*010*/ SpellBuff_Struct Buffs[BUFF_COUNT];
|
||||
/*510*/ EQEmu::TextureMaterialProfile Items;
|
||||
/*510*/ EQ::TextureMaterialProfile Items;
|
||||
/*546*/ char Name[64];
|
||||
/*610*/
|
||||
};
|
||||
@@ -931,7 +933,7 @@ struct PlayerProfile_Struct
|
||||
/*0245*/ uint8 guildbanker;
|
||||
/*0246*/ uint8 unknown0246[6]; //
|
||||
/*0252*/ uint32 intoxication;
|
||||
/*0256*/ uint32 spellSlotRefresh[EQEmu::spells::SPELL_GEM_COUNT]; //in ms
|
||||
/*0256*/ uint32 spellSlotRefresh[EQ::spells::SPELL_GEM_COUNT]; //in ms
|
||||
/*0292*/ uint32 abilitySlotRefresh;
|
||||
/*0296*/ uint8 haircolor; // Player hair color
|
||||
/*0297*/ uint8 beardcolor; // Player beard color
|
||||
@@ -944,9 +946,9 @@ struct PlayerProfile_Struct
|
||||
/*0304*/ uint8 ability_time_minutes;
|
||||
/*0305*/ uint8 ability_time_hours; //place holder
|
||||
/*0306*/ uint8 unknown0306[6]; // @bp Spacer/Flag?
|
||||
/*0312*/ EQEmu::TextureMaterialProfile item_material; // Item texture/material of worn/held items
|
||||
/*0312*/ EQ::TextureMaterialProfile item_material; // Item texture/material of worn/held items
|
||||
/*0348*/ uint8 unknown0348[44];
|
||||
/*0392*/ EQEmu::TintProfile item_tint;
|
||||
/*0392*/ EQ::TintProfile item_tint;
|
||||
/*0428*/ AA_Array aa_array[MAX_PP_AA_ARRAY];
|
||||
/*2348*/ float unknown2384; //seen ~128, ~47
|
||||
/*2352*/ char servername[32]; // length probably not right
|
||||
@@ -970,9 +972,9 @@ struct PlayerProfile_Struct
|
||||
/*2505*/ uint8 unknown2541[47]; // ?
|
||||
/*2552*/ uint8 languages[MAX_PP_LANGUAGE];
|
||||
/*2580*/ uint8 unknown2616[4];
|
||||
/*2584*/ uint32 spell_book[EQEmu::spells::SPELLBOOK_SIZE];
|
||||
/*2584*/ uint32 spell_book[EQ::spells::SPELLBOOK_SIZE];
|
||||
/*4504*/ uint8 unknown4540[128]; // Was [428] all 0xff
|
||||
/*4632*/ uint32 mem_spells[EQEmu::spells::SPELL_GEM_COUNT];
|
||||
/*4632*/ uint32 mem_spells[EQ::spells::SPELL_GEM_COUNT];
|
||||
/*4668*/ uint8 unknown4704[32]; //
|
||||
/*4700*/ float y; // Player y position
|
||||
/*4704*/ float x; // Player x position
|
||||
@@ -1048,7 +1050,7 @@ struct PlayerProfile_Struct
|
||||
/*7212*/ uint32 tribute_points;
|
||||
/*7216*/ uint32 unknown7252;
|
||||
/*7220*/ uint32 tribute_active; //1=active
|
||||
/*7224*/ Tribute_Struct tributes[EQEmu::invtype::TRIBUTE_SIZE];
|
||||
/*7224*/ Tribute_Struct tributes[EQ::invtype::TRIBUTE_SIZE];
|
||||
/*7264*/ Disciplines_Struct disciplines;
|
||||
/*7664*/ uint32 recastTimers[MAX_RECAST_TYPES]; // Timers (GMT of last use)
|
||||
/*7744*/ char unknown7780[160];
|
||||
@@ -1075,7 +1077,7 @@ struct PlayerProfile_Struct
|
||||
/*12800*/ uint32 expAA;
|
||||
/*12804*/ uint32 aapoints; //avaliable, unspent
|
||||
/*12808*/ uint8 unknown12844[36];
|
||||
/*12844*/ Bandolier_Struct bandoliers[EQEmu::profile::BANDOLIERS_SIZE];
|
||||
/*12844*/ Bandolier_Struct bandoliers[EQ::profile::BANDOLIERS_SIZE];
|
||||
/*14124*/ uint8 unknown14160[4506];
|
||||
/*18630*/ SuspendedMinion_Struct SuspendedMinion; // No longer in use
|
||||
/*19240*/ uint32 timeentitledonaccount;
|
||||
@@ -1093,16 +1095,16 @@ struct PlayerProfile_Struct
|
||||
/*19568*/
|
||||
|
||||
// All player profile packets are translated and this overhead is ignored in out-bound packets
|
||||
PlayerProfile_Struct() : m_player_profile_version(EQEmu::versions::MobVersion::Unknown) { }
|
||||
PlayerProfile_Struct() : m_player_profile_version(EQ::versions::MobVersion::Unknown) { }
|
||||
|
||||
EQEmu::versions::MobVersion PlayerProfileVersion() { return m_player_profile_version; }
|
||||
void SetPlayerProfileVersion(EQEmu::versions::MobVersion mob_version) { m_player_profile_version = EQEmu::versions::ValidateMobVersion(mob_version); }
|
||||
void SetPlayerProfileVersion(EQEmu::versions::ClientVersion client_version) { SetPlayerProfileVersion(EQEmu::versions::ConvertClientVersionToMobVersion(client_version)); }
|
||||
EQ::versions::MobVersion PlayerProfileVersion() { return m_player_profile_version; }
|
||||
void SetPlayerProfileVersion(EQ::versions::MobVersion mob_version) { m_player_profile_version = EQ::versions::ValidateMobVersion(mob_version); }
|
||||
void SetPlayerProfileVersion(EQ::versions::ClientVersion client_version) { SetPlayerProfileVersion(EQ::versions::ConvertClientVersionToMobVersion(client_version)); }
|
||||
|
||||
private:
|
||||
// No need for gm flag since pp already has one
|
||||
// No need for lookup pointer since this struct is not tied to any one system
|
||||
EQEmu::versions::MobVersion m_player_profile_version;
|
||||
EQ::versions::MobVersion m_player_profile_version;
|
||||
};
|
||||
|
||||
|
||||
@@ -1213,7 +1215,7 @@ struct WearChange_Struct {
|
||||
/*010*/ uint32 elite_material; // 1 for Drakkin Elite Material
|
||||
/*014*/ uint32 hero_forge_model; // New to VoA
|
||||
/*018*/ uint32 unknown18; // New to RoF
|
||||
/*022*/ EQEmu::textures::Tint_Struct color;
|
||||
/*022*/ EQ::textures::Tint_Struct color;
|
||||
/*026*/ uint8 wear_slot_id;
|
||||
/*027*/
|
||||
};
|
||||
@@ -1358,21 +1360,24 @@ struct BecomeCorpse_Struct {
|
||||
*/
|
||||
struct PlayerPositionUpdateServer_Struct
|
||||
{
|
||||
/*0000*/ uint16 spawn_id;
|
||||
/*0002*/ int32 delta_heading:10, // change in heading
|
||||
x_pos:19, // x coord
|
||||
padding0002:3; // ***Placeholder
|
||||
/*0006*/ int32 y_pos:19, // y coord
|
||||
animation:10, // animation
|
||||
padding0006:3; // ***Placeholder
|
||||
/*0010*/ int32 z_pos:19, // z coord
|
||||
delta_y:13; // change in y
|
||||
/*0014*/ int32 delta_x:13, // change in x
|
||||
heading:12, // heading
|
||||
padding0014:7; // ***Placeholder
|
||||
/*0018*/ int32 delta_z:13, // change in z
|
||||
padding0018:19; // ***Placeholder
|
||||
/*0022*/
|
||||
/*0000*/ uint16 spawn_id;
|
||||
/*0002*/ uint16 vehicle_id;
|
||||
/*0004*/ signed padding0004 : 12;
|
||||
signed y_pos : 19; // y coord
|
||||
unsigned padding : 1;
|
||||
/*0008*/ signed delta_z : 13; // change in z
|
||||
signed delta_x : 13; // change in x
|
||||
signed padding0008 : 6;
|
||||
/*0012*/ signed x_pos : 19; // x coord
|
||||
unsigned heading : 12; // heading
|
||||
signed padding0016 : 1;
|
||||
/*0016*/ signed delta_heading : 10; // change in heading
|
||||
signed z_pos : 19; // z coord
|
||||
signed padding0020 : 3;
|
||||
/*0020*/ signed animation : 10; // animation
|
||||
signed delta_y : 13; // change in y
|
||||
signed padding0024 : 9;
|
||||
/*0024*/
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -1383,21 +1388,23 @@ struct PlayerPositionUpdateServer_Struct
|
||||
*/
|
||||
struct PlayerPositionUpdateClient_Struct
|
||||
{
|
||||
/*0000*/ uint16 spawn_id;
|
||||
/*0002*/ uint16 sequence; //increments one each packet
|
||||
/*0004*/ float y_pos; // y coord
|
||||
/*0008*/ float delta_z; // Change in z
|
||||
/*0012*/ float delta_x; // Change in x
|
||||
/*0016*/ float delta_y; // Change in y
|
||||
/*0020*/ int32 animation:10, // animation
|
||||
delta_heading:10, // change in heading
|
||||
padding0020:12; // ***Placeholder (mostly 1)
|
||||
/*0024*/ float x_pos; // x coord
|
||||
/*0028*/ float z_pos; // z coord
|
||||
/*0032*/ uint16 heading:12, // Directional heading
|
||||
padding0004:4; // ***Placeholder
|
||||
/*0034*/ uint8 unknown0006[2]; // ***Placeholder
|
||||
/*0036*/
|
||||
/*0000*/ uint16 sequence; // increments one each packet - Verified
|
||||
/*0002*/ uint16 spawn_id; // Player's spawn id
|
||||
/*0004*/ uint16 vehicle_id; // Player's vehicle spawn id
|
||||
/*0006*/ uint8 unknown0004[4]; // ***Placeholder
|
||||
/*0010*/ float delta_x; // Change in x
|
||||
/*0014*/ unsigned heading : 12; // Directional heading
|
||||
unsigned padding0040 : 20; // ***Placeholder
|
||||
/*0018*/ float x_pos; // x coord (2nd loc value)
|
||||
/*0022*/ float delta_z; // Change in z
|
||||
/*0026*/ float z_pos; // z coord (3rd loc value)
|
||||
/*0030*/ float y_pos; // y coord (1st loc value)
|
||||
/*0034*/ unsigned animation : 10; // ***Placeholder
|
||||
unsigned padding0024 : 22; // animation
|
||||
/*0038*/ float delta_y; // Change in y
|
||||
/*0042*/ signed delta_heading : 10; // change in heading
|
||||
unsigned padding0041 : 22; // ***Placeholder
|
||||
/*0046*/
|
||||
};
|
||||
|
||||
struct SpawnPositionUpdate_Struct
|
||||
@@ -2116,7 +2123,7 @@ struct AdventureLeaderboard_Struct
|
||||
/*struct Item_Shop_Struct {
|
||||
uint16 merchantid;
|
||||
uint8 itemtype;
|
||||
EQEmu::ItemData item;
|
||||
EQ::ItemData item;
|
||||
uint8 iss_unknown001[6];
|
||||
};*/
|
||||
|
||||
@@ -2142,7 +2149,7 @@ struct Illusion_Struct { //size: 256 - SoF
|
||||
/*092*/ uint32 drakkin_heritage; //
|
||||
/*096*/ uint32 drakkin_tattoo; //
|
||||
/*100*/ uint32 drakkin_details; //
|
||||
/*104*/ EQEmu::TintProfile armor_tint; //
|
||||
/*104*/ EQ::TintProfile armor_tint; //
|
||||
/*140*/ uint8 eyecolor1; // Field Not Identified in any Illusion Struct
|
||||
/*141*/ uint8 eyecolor2; // Field Not Identified in any Illusion Struct
|
||||
/*142*/ uint8 unknown138[114]; //
|
||||
@@ -2175,14 +2182,7 @@ struct QuestReward_Struct
|
||||
/*024*/ uint32 silver; // Gives silver to the client
|
||||
/*028*/ uint32 gold; // Gives gold to the client
|
||||
/*032*/ uint32 platinum; // Gives platinum to the client
|
||||
/*036*/ uint32 item_id;
|
||||
/*040*/ uint32 unknown040;
|
||||
/*044*/ uint32 unknown044;
|
||||
/*048*/ uint32 unknown048;
|
||||
/*052*/ uint32 unknown052;
|
||||
/*056*/ uint32 unknown056;
|
||||
/*060*/ uint32 unknown060;
|
||||
/*064*/ uint32 unknown064;
|
||||
/*036*/ int32 item_id[QUESTREWARD_COUNT]; // -1 for nothing
|
||||
/*068*/
|
||||
};
|
||||
|
||||
@@ -2967,6 +2967,12 @@ struct ItemViewRequest_Struct {
|
||||
/*046*/ char unknown046[2];
|
||||
};
|
||||
|
||||
struct ItemAdvancedLoreText_Struct {
|
||||
int32 item_id;
|
||||
char item_name[64];
|
||||
char advanced_lore[ADVANCED_LORE_LENGTH];
|
||||
};
|
||||
|
||||
struct LDONItemViewRequest_Struct {
|
||||
uint32 item_id;
|
||||
uint8 unknown004[4];
|
||||
@@ -3483,8 +3489,8 @@ struct SelectTributeReply_Struct {
|
||||
|
||||
struct TributeInfo_Struct {
|
||||
uint32 active; //0 == inactive, 1 == active
|
||||
uint32 tributes[EQEmu::invtype::TRIBUTE_SIZE]; //-1 == NONE
|
||||
uint32 tiers[EQEmu::invtype::TRIBUTE_SIZE]; //all 00's
|
||||
uint32 tributes[EQ::invtype::TRIBUTE_SIZE]; //-1 == NONE
|
||||
uint32 tiers[EQ::invtype::TRIBUTE_SIZE]; //all 00's
|
||||
uint32 tribute_master_id;
|
||||
};
|
||||
|
||||
@@ -4395,7 +4401,7 @@ struct AnnoyingZoneUnknown_Struct {
|
||||
};
|
||||
|
||||
struct LoadSpellSet_Struct {
|
||||
uint32 spell[EQEmu::spells::SPELL_GEM_COUNT]; // 0xFFFFFFFF if no action, slot number if to unmem starting at 0
|
||||
uint32 spell[EQ::spells::SPELL_GEM_COUNT]; // 0xFFFFFFFF if no action, slot number if to unmem starting at 0
|
||||
uint32 unknown; //there seems to be an extra field in this packet...
|
||||
};
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
virtual MatchState CheckSignature(const Signature *sig) { return MatchFailed; }
|
||||
virtual EQStreamState GetState() = 0;
|
||||
virtual void SetOpcodeManager(OpcodeManager **opm) = 0;
|
||||
virtual const EQEmu::versions::ClientVersion ClientVersion() const { return EQEmu::versions::ClientVersion::Unknown; }
|
||||
virtual const EQ::versions::ClientVersion ClientVersion() const { return EQ::versions::ClientVersion::Unknown; }
|
||||
virtual Stats GetStats() const = 0;
|
||||
virtual void ResetStats() = 0;
|
||||
virtual EQStreamManagerInterface* GetManager() const = 0;
|
||||
|
||||
@@ -22,7 +22,7 @@ std::string EQStreamProxy::Describe() const {
|
||||
return(m_structs->Describe());
|
||||
}
|
||||
|
||||
const EQEmu::versions::ClientVersion EQStreamProxy::ClientVersion() const
|
||||
const EQ::versions::ClientVersion EQStreamProxy::ClientVersion() const
|
||||
{
|
||||
return m_structs->ClientVersion();
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public:
|
||||
virtual void RemoveData();
|
||||
virtual bool CheckState(EQStreamState state);
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
|
||||
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
||||
virtual EQStreamState GetState();
|
||||
virtual void SetOpcodeManager(OpcodeManager **opm);
|
||||
virtual Stats GetStats() const;
|
||||
|
||||
@@ -165,7 +165,7 @@ class EQEmuConfig
|
||||
fconfig >> _config->_root;
|
||||
_config->parse_config();
|
||||
}
|
||||
catch (std::exception) {
|
||||
catch (std::exception &) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#include "eqemu_exception.h"
|
||||
|
||||
namespace EQEmu
|
||||
namespace EQ
|
||||
{
|
||||
Exception::Exception(const char* name, const std::string& description, const char* file, long line)
|
||||
: line_(line),
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <sstream>
|
||||
#include <exception>
|
||||
|
||||
namespace EQEmu
|
||||
namespace EQ
|
||||
{
|
||||
//! EQEmu Exception Class
|
||||
/*!
|
||||
@@ -104,7 +104,7 @@ namespace EQEmu
|
||||
} // EQEmu
|
||||
|
||||
#ifndef EQ_EXCEPT
|
||||
#define EQ_EXCEPT(n, d) throw EQEmu::Exception(n, d, __FILE__, __LINE__)
|
||||
#define EQ_EXCEPT(n, d) throw EQ::Exception(n, d, __FILE__, __LINE__)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -124,6 +124,8 @@ void EQEmuLogSys::LoadLogSettingsDefaults()
|
||||
log_settings[Logs::Loginserver].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::HeadlessClient].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::NPCScaling].log_to_gmsay = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::HotReload].log_to_gmsay = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::HotReload].log_to_console = static_cast<uint8>(Logs::General);
|
||||
|
||||
/**
|
||||
* RFC 5424
|
||||
@@ -579,3 +581,25 @@ void EQEmuLogSys::StartFileLogs(const std::string &log_name)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Silence console logging
|
||||
*/
|
||||
void EQEmuLogSys::SilenceConsoleLogging()
|
||||
{
|
||||
for (int log_index = Logs::AA; log_index != Logs::MaxCategoryID; log_index++) {
|
||||
log_settings[log_index].log_to_console = 0;
|
||||
log_settings[log_index].is_category_enabled = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables console logging
|
||||
*/
|
||||
void EQEmuLogSys::EnableConsoleLogging()
|
||||
{
|
||||
for (int log_index = Logs::AA; log_index != Logs::MaxCategoryID; log_index++) {
|
||||
log_settings[log_index].log_to_console = Logs::General;
|
||||
log_settings[log_index].is_category_enabled = 1;
|
||||
}
|
||||
}
|
||||
|
||||
+27
-1
@@ -107,6 +107,14 @@ namespace Logs {
|
||||
Emergency,
|
||||
Alert,
|
||||
Notice,
|
||||
AIScanClose,
|
||||
AIYellForHelp,
|
||||
AICastBeneficialClose,
|
||||
AoeCast,
|
||||
EntityManagement,
|
||||
Flee,
|
||||
Aura,
|
||||
HotReload,
|
||||
MaxCategoryID /* Don't Remove this */
|
||||
};
|
||||
|
||||
@@ -172,7 +180,15 @@ namespace Logs {
|
||||
"Critical",
|
||||
"Emergency",
|
||||
"Alert",
|
||||
"Notice"
|
||||
"Notice",
|
||||
"AI Scan Close",
|
||||
"AI Yell For Help",
|
||||
"AI Cast Beneficial Close",
|
||||
"AOE Cast",
|
||||
"Entity Management",
|
||||
"Flee",
|
||||
"Aura",
|
||||
"HotReload",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -279,6 +295,16 @@ public:
|
||||
*/
|
||||
void SetConsoleHandler(std::function<void(uint16 debug_level, uint16 log_type, const std::string&)> f) { on_log_console_hook = f; }
|
||||
|
||||
/**
|
||||
* Silence console logging
|
||||
*/
|
||||
void SilenceConsoleLogging();
|
||||
|
||||
/**
|
||||
* Turn on all console logging
|
||||
*/
|
||||
void EnableConsoleLogging();
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
#ifndef EQEMU_EQEMU_LOGSYS_LOG_ALIASES_H
|
||||
#define EQEMU_EQEMU_LOGSYS_LOG_ALIASES_H
|
||||
|
||||
#ifdef BUILD_LOGGING
|
||||
|
||||
/**
|
||||
* RFC 5424
|
||||
*/
|
||||
@@ -489,9 +491,85 @@
|
||||
OutF(LogSys, Logs::Detail, Logs::Status, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* Misc
|
||||
*/
|
||||
#define LogAIScanClose(message, ...) do {\
|
||||
if (LogSys.log_settings[Logs::AIScanClose].is_category_enabled == 1)\
|
||||
OutF(LogSys, Logs::General, Logs::AIScanClose, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogAIScanCloseDetail(message, ...) do {\
|
||||
if (LogSys.log_settings[Logs::AIScanClose].is_category_enabled == 1)\
|
||||
OutF(LogSys, Logs::Detail, Logs::AIScanClose, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogAIYellForHelp(message, ...) do {\
|
||||
if (LogSys.log_settings[Logs::AIYellForHelp].is_category_enabled == 1)\
|
||||
OutF(LogSys, Logs::General, Logs::AIYellForHelp, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogAIYellForHelpDetail(message, ...) do {\
|
||||
if (LogSys.log_settings[Logs::AIYellForHelp].is_category_enabled == 1)\
|
||||
OutF(LogSys, Logs::Detail, Logs::AIYellForHelp, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogAICastBeneficialClose(message, ...) do {\
|
||||
if (LogSys.log_settings[Logs::AICastBeneficialClose].is_category_enabled == 1)\
|
||||
OutF(LogSys, Logs::General, Logs::AICastBeneficialClose, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogAICastBeneficialCloseDetail(message, ...) do {\
|
||||
if (LogSys.log_settings[Logs::AICastBeneficialClose].is_category_enabled == 1)\
|
||||
OutF(LogSys, Logs::Detail, Logs::AICastBeneficialClose, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogAoeCast(message, ...) do {\
|
||||
if (LogSys.log_settings[Logs::AoeCast].is_category_enabled == 1)\
|
||||
OutF(LogSys, Logs::General, Logs::AoeCast, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogAoeCastDetail(message, ...) do {\
|
||||
if (LogSys.log_settings[Logs::AoeCast].is_category_enabled == 1)\
|
||||
OutF(LogSys, Logs::Detail, Logs::AoeCast, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogEntityManagement(message, ...) do {\
|
||||
if (LogSys.log_settings[Logs::EntityManagement].is_category_enabled == 1)\
|
||||
OutF(LogSys, Logs::General, Logs::EntityManagement, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogEntityManagementDetail(message, ...) do {\
|
||||
if (LogSys.log_settings[Logs::EntityManagement].is_category_enabled == 1)\
|
||||
OutF(LogSys, Logs::Detail, Logs::EntityManagement, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogFlee(message, ...) do {\
|
||||
if (LogSys.log_settings[Logs::Flee].is_category_enabled == 1)\
|
||||
OutF(LogSys, Logs::General, Logs::Flee, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogFleeDetail(message, ...) do {\
|
||||
if (LogSys.log_settings[Logs::Flee].is_category_enabled == 1)\
|
||||
OutF(LogSys, Logs::Detail, Logs::Flee, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogAura(message, ...) do {\
|
||||
if (LogSys.log_settings[Logs::Aura].is_category_enabled == 1)\
|
||||
OutF(LogSys, Logs::General, Logs::Aura, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogAuraDetail(message, ...) do {\
|
||||
if (LogSys.log_settings[Logs::Aura].is_category_enabled == 1)\
|
||||
OutF(LogSys, Logs::Detail, Logs::Aura, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogHotReload(message, ...) do {\
|
||||
if (LogSys.log_settings[Logs::HotReload].is_category_enabled == 1)\
|
||||
OutF(LogSys, Logs::General, Logs::HotReload, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogHotReloadDetail(message, ...) do {\
|
||||
if (LogSys.log_settings[Logs::HotReload].is_category_enabled == 1)\
|
||||
OutF(LogSys, Logs::Detail, Logs::HotReload, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define Log(debug_level, log_category, message, ...) do {\
|
||||
if (LogSys.log_settings[log_category].is_category_enabled == 1)\
|
||||
@@ -503,5 +581,340 @@
|
||||
OutF(LogSys, debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#else
|
||||
#define LogEmergency(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogAlert(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogCritical(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogError(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogWarning(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogNotice(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogInfo(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogDebug(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* Category
|
||||
*/
|
||||
|
||||
#define LogAA(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogAADetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogAI(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogAIDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogAggro(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogAggroDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogAttack(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogAttackDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogPacketClientServer(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogPacketClientServerDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogCombat(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogCombatDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogCommands(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogCommandsDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogCrash(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogCrashDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogDoors(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogDoorsDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogGuilds(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogGuildsDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogInventory(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogInventoryDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogLauncher(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogLauncherDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogNetcode(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogNetcodeDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogNormal(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogNormalDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogObject(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogObjectDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogPathing(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogPathingDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogQSServer(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogQSServerDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogQuests(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogQuestsDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogRules(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogRulesDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogSkills(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogSkillsDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogSpawns(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogSpawnsDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogSpells(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogSpellsDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogTCPConnection(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogTCPConnectionDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogTasks(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogTasksDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogTradeskills(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogTradeskillsDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogTrading(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogTradingDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogTribute(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogTributeDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogMySQLError(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogMySQLErrorDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogMySQLQuery(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogMySQLQueryDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogMercenaries(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogMercenariesDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogQuestDebug(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogQuestDebugDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogLoginserver(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogLoginserverDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogClientLogin(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogClientLoginDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogHeadlessClient(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogHeadlessClientDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogHPUpdate(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogHPUpdateDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogFixZ(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogFixZDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogFood(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogFoodDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogTraps(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogTrapsDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogNPCRoamBox(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogNPCRoamBoxDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogNPCScaling(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogNPCScalingDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogMobAppearance(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogMobAppearanceDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogStatus(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogStatusDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogAIScanClose(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogAIScanCloseDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogAIYellForHelp(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogAIYellForHelpDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogAICastBeneficialClose(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogAICastBeneficialCloseDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogAoeCast(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogAoeCastDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogEntityManagement(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogEntityManagementDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogFlee(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogFleeDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogAura(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogAuraDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogHotReload(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogHotReloadDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define Log(debug_level, log_category, message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogF(debug_level, log_category, message, ...) do {\
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#endif //EQEMU_EQEMU_LOGSYS_LOG_ALIASES_H
|
||||
@@ -21,6 +21,14 @@ namespace EQ
|
||||
uv_run(&m_loop, UV_RUN_NOWAIT);
|
||||
}
|
||||
|
||||
void Run() {
|
||||
uv_run(&m_loop, UV_RUN_DEFAULT);
|
||||
}
|
||||
|
||||
void Shutdown() {
|
||||
uv_stop(&m_loop);
|
||||
}
|
||||
|
||||
uv_loop_t* Handle() { return &m_loop; }
|
||||
|
||||
private:
|
||||
|
||||
+3
-3
@@ -8,7 +8,7 @@ namespace EQ {
|
||||
class Task
|
||||
{
|
||||
public:
|
||||
typedef std::function<void(const EQEmu::Any&)> ResolveFn;
|
||||
typedef std::function<void(const EQ::Any&)> ResolveFn;
|
||||
typedef std::function<void(const std::exception&)> RejectFn;
|
||||
typedef std::function<void()> FinallyFn;
|
||||
typedef std::function<void(ResolveFn, RejectFn)> TaskFn;
|
||||
@@ -19,7 +19,7 @@ namespace EQ {
|
||||
RejectFn on_catch;
|
||||
FinallyFn on_finally;
|
||||
bool has_result;
|
||||
EQEmu::Any result;
|
||||
EQ::Any result;
|
||||
bool has_error;
|
||||
std::exception error;
|
||||
};
|
||||
@@ -63,7 +63,7 @@ namespace EQ {
|
||||
uv_queue_work(EventLoop::Get().Handle(), m_work, [](uv_work_t* req) {
|
||||
TaskBaton *baton = (TaskBaton*)req->data;
|
||||
|
||||
baton->fn([baton](const EQEmu::Any& result) {
|
||||
baton->fn([baton](const EQ::Any& result) {
|
||||
baton->has_error = false;
|
||||
baton->has_result = true;
|
||||
baton->result = result;
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ struct ExtendedProfile_Struct {
|
||||
uint16 old_pet_hp; /* Not Used */
|
||||
uint16 old_pet_mana; /* Not Used */
|
||||
SpellBuff_Struct pet_buffs[BUFF_COUNT]; /* Not Used */
|
||||
EQEmu::TextureMaterialProfile pet_items; /* Not Used */
|
||||
EQ::TextureMaterialProfile pet_items; /* Not Used */
|
||||
char merc_name[64]; /* Used */
|
||||
|
||||
uint32 aa_effects; /* Used */
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
/**
|
||||
* EQEmulator: Everquest Server Emulator
|
||||
* Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
* are required to give you total support for your newly bought product;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include <fstream>
|
||||
#include "file_util.h"
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#include <direct.h>
|
||||
#include <conio.h>
|
||||
#include <iostream>
|
||||
#include <dos.h>
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
#else
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
bool FileUtil::exists(const std::string &name)
|
||||
{
|
||||
std::ifstream f(name.c_str());
|
||||
|
||||
return f.good();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param directory_name
|
||||
*/
|
||||
void FileUtil::mkdir(const std::string& directory_name)
|
||||
{
|
||||
|
||||
#ifdef _WINDOWS
|
||||
struct _stat st;
|
||||
if (_stat(directory_name.c_str(), &st) == 0) // exists
|
||||
return;
|
||||
_mkdir(directory_name.c_str());
|
||||
#else
|
||||
struct stat st{};
|
||||
if (stat(directory_name.c_str(), &st) == 0) { // exists
|
||||
return;
|
||||
}
|
||||
::mkdir(directory_name.c_str(), 0755);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* EQEmulator: Everquest Server Emulator
|
||||
* Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
* are required to give you total support for your newly bought product;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_FILE_UTIL_H
|
||||
#define EQEMU_FILE_UTIL_H
|
||||
|
||||
|
||||
class FileUtil {
|
||||
public:
|
||||
static bool exists(const std::string &name);
|
||||
static void mkdir(const std::string& directory_name);
|
||||
};
|
||||
|
||||
|
||||
#endif //EQEMU_FILE_UTIL_H
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "eqemu_exception.h"
|
||||
#include "types.h"
|
||||
|
||||
namespace EQEmu {
|
||||
namespace EQ {
|
||||
|
||||
/*! Simple HashSet designed to be used in fixed memory that may be difficult to use an
|
||||
allocator for (shared memory), we assume all keys are unsigned int
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "eqemu_exception.h"
|
||||
#include "types.h"
|
||||
|
||||
namespace EQEmu {
|
||||
namespace EQ {
|
||||
|
||||
/*! Simple HashSet designed to be used in fixed memory that may be difficult to use an
|
||||
allocator for (shared memory), we assume all keys are unsigned int, values are a pointer and size
|
||||
|
||||
@@ -912,7 +912,7 @@ bool BaseGuildManager::GetEntireGuild(uint32 guild_id, std::vector<CharGuildInfo
|
||||
return(false);
|
||||
|
||||
//load up the rank info for each guild.
|
||||
std::string query = StringFormat(GuildMemberBaseQuery " WHERE g.guild_id=%d", guild_id);
|
||||
std::string query = StringFormat(GuildMemberBaseQuery " WHERE g.guild_id=%d AND c.deleted_at IS NULL", guild_id);
|
||||
auto results = m_db->QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
return false;
|
||||
@@ -941,7 +941,7 @@ bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) {
|
||||
m_db->DoEscapeString(esc, char_name, nl);
|
||||
|
||||
//load up the rank info for each guild.
|
||||
std::string query = StringFormat(GuildMemberBaseQuery " WHERE c.name='%s'", esc);
|
||||
std::string query = StringFormat(GuildMemberBaseQuery " WHERE c.name='%s' AND c.deleted_at IS NULL", esc);
|
||||
safe_delete_array(esc);
|
||||
auto results = m_db->QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
@@ -969,9 +969,9 @@ bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) {
|
||||
//load up the rank info for each guild.
|
||||
std::string query;
|
||||
#ifdef BOTS
|
||||
query = StringFormat(GuildMemberBaseQuery " WHERE c.id=%d AND c.mob_type = 'C'", char_id);
|
||||
query = StringFormat(GuildMemberBaseQuery " WHERE c.id=%d AND c.mob_type = 'C' AND c.deleted_at IS NULL", char_id);
|
||||
#else
|
||||
query = StringFormat(GuildMemberBaseQuery " WHERE c.id=%d", char_id);
|
||||
query = StringFormat(GuildMemberBaseQuery " WHERE c.id=%d AND c.deleted_at IS NULL", char_id);
|
||||
#endif
|
||||
auto results = m_db->QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
std::list<EQEmu::ItemInstance*> dirty_inst;
|
||||
std::list<EQ::ItemInstance*> dirty_inst;
|
||||
|
||||
|
||||
//
|
||||
@@ -48,50 +48,50 @@ ItemInstQueue::~ItemInstQueue()
|
||||
}
|
||||
|
||||
// Put item onto back of queue
|
||||
void ItemInstQueue::push(EQEmu::ItemInstance* inst)
|
||||
void ItemInstQueue::push(EQ::ItemInstance* inst)
|
||||
{
|
||||
m_list.push_back(inst);
|
||||
}
|
||||
|
||||
// Put item onto front of queue
|
||||
void ItemInstQueue::push_front(EQEmu::ItemInstance* inst)
|
||||
void ItemInstQueue::push_front(EQ::ItemInstance* inst)
|
||||
{
|
||||
m_list.push_front(inst);
|
||||
}
|
||||
|
||||
// Remove item from front of queue
|
||||
EQEmu::ItemInstance* ItemInstQueue::pop()
|
||||
EQ::ItemInstance* ItemInstQueue::pop()
|
||||
{
|
||||
if (m_list.empty())
|
||||
return nullptr;
|
||||
|
||||
EQEmu::ItemInstance* inst = m_list.front();
|
||||
EQ::ItemInstance* inst = m_list.front();
|
||||
m_list.pop_front();
|
||||
return inst;
|
||||
}
|
||||
|
||||
// Remove item from back of queue
|
||||
EQEmu::ItemInstance* ItemInstQueue::pop_back()
|
||||
EQ::ItemInstance* ItemInstQueue::pop_back()
|
||||
{
|
||||
if (m_list.empty())
|
||||
return nullptr;
|
||||
|
||||
EQEmu::ItemInstance* inst = m_list.back();
|
||||
EQ::ItemInstance* inst = m_list.back();
|
||||
m_list.pop_back();
|
||||
return inst;
|
||||
}
|
||||
|
||||
// Look at item at front of queue
|
||||
EQEmu::ItemInstance* ItemInstQueue::peek_front() const
|
||||
EQ::ItemInstance* ItemInstQueue::peek_front() const
|
||||
{
|
||||
return (m_list.empty()) ? nullptr : m_list.front();
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// class EQEmu::InventoryProfile
|
||||
// class EQ::InventoryProfile
|
||||
//
|
||||
EQEmu::InventoryProfile::~InventoryProfile()
|
||||
EQ::InventoryProfile::~InventoryProfile()
|
||||
{
|
||||
for (auto iter = m_worn.begin(); iter != m_worn.end(); ++iter) {
|
||||
safe_delete(iter->second);
|
||||
@@ -119,18 +119,18 @@ EQEmu::InventoryProfile::~InventoryProfile()
|
||||
m_trade.clear();
|
||||
}
|
||||
|
||||
void EQEmu::InventoryProfile::SetInventoryVersion(versions::MobVersion inventory_version) {
|
||||
void EQ::InventoryProfile::SetInventoryVersion(versions::MobVersion inventory_version) {
|
||||
m_mob_version = versions::ValidateMobVersion(inventory_version);
|
||||
SetGMInventory(m_gm_inventory);
|
||||
}
|
||||
|
||||
void EQEmu::InventoryProfile::SetGMInventory(bool gmi_flag) {
|
||||
void EQ::InventoryProfile::SetGMInventory(bool gmi_flag) {
|
||||
m_gm_inventory = gmi_flag;
|
||||
|
||||
m_lookup = inventory::DynamicLookup(m_mob_version, gmi_flag);
|
||||
}
|
||||
|
||||
void EQEmu::InventoryProfile::CleanDirty() {
|
||||
void EQ::InventoryProfile::CleanDirty() {
|
||||
auto iter = dirty_inst.begin();
|
||||
while (iter != dirty_inst.end()) {
|
||||
delete (*iter);
|
||||
@@ -139,14 +139,14 @@ void EQEmu::InventoryProfile::CleanDirty() {
|
||||
dirty_inst.clear();
|
||||
}
|
||||
|
||||
void EQEmu::InventoryProfile::MarkDirty(ItemInstance *inst) {
|
||||
void EQ::InventoryProfile::MarkDirty(ItemInstance *inst) {
|
||||
if (inst) {
|
||||
dirty_inst.push_back(inst);
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieve item at specified slot; returns false if item not found
|
||||
EQEmu::ItemInstance* EQEmu::InventoryProfile::GetItem(int16 slot_id) const
|
||||
EQ::ItemInstance* EQ::InventoryProfile::GetItem(int16 slot_id) const
|
||||
{
|
||||
ItemInstance* result = nullptr;
|
||||
|
||||
@@ -219,31 +219,31 @@ EQEmu::ItemInstance* EQEmu::InventoryProfile::GetItem(int16 slot_id) const
|
||||
}
|
||||
|
||||
// Retrieve item at specified position within bag
|
||||
EQEmu::ItemInstance* EQEmu::InventoryProfile::GetItem(int16 slot_id, uint8 bagidx) const
|
||||
EQ::ItemInstance* EQ::InventoryProfile::GetItem(int16 slot_id, uint8 bagidx) const
|
||||
{
|
||||
return GetItem(InventoryProfile::CalcSlotId(slot_id, bagidx));
|
||||
}
|
||||
|
||||
// Put an item snto specified slot
|
||||
int16 EQEmu::InventoryProfile::PutItem(int16 slot_id, const ItemInstance& inst)
|
||||
int16 EQ::InventoryProfile::PutItem(int16 slot_id, const ItemInstance& inst)
|
||||
{
|
||||
if (slot_id <= EQEmu::invslot::POSSESSIONS_END && slot_id >= EQEmu::invslot::POSSESSIONS_BEGIN) {
|
||||
if (slot_id <= EQ::invslot::POSSESSIONS_END && slot_id >= EQ::invslot::POSSESSIONS_BEGIN) {
|
||||
if ((((uint64)1 << slot_id) & m_lookup->PossessionsBitmask) == 0)
|
||||
return EQEmu::invslot::SLOT_INVALID;
|
||||
return EQ::invslot::SLOT_INVALID;
|
||||
}
|
||||
else if (slot_id <= EQEmu::invbag::GENERAL_BAGS_END && slot_id >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
|
||||
auto temp_slot = EQEmu::invslot::GENERAL_BEGIN + ((slot_id - EQEmu::invbag::GENERAL_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT);
|
||||
else if (slot_id <= EQ::invbag::GENERAL_BAGS_END && slot_id >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
||||
auto temp_slot = EQ::invslot::GENERAL_BEGIN + ((slot_id - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT);
|
||||
if ((((uint64)1 << temp_slot) & m_lookup->PossessionsBitmask) == 0)
|
||||
return EQEmu::invslot::SLOT_INVALID;
|
||||
return EQ::invslot::SLOT_INVALID;
|
||||
}
|
||||
else if (slot_id <= EQEmu::invslot::BANK_END && slot_id >= EQEmu::invslot::BANK_BEGIN) {
|
||||
if ((slot_id - EQEmu::invslot::BANK_BEGIN) >= m_lookup->InventoryTypeSize.Bank)
|
||||
return EQEmu::invslot::SLOT_INVALID;
|
||||
else if (slot_id <= EQ::invslot::BANK_END && slot_id >= EQ::invslot::BANK_BEGIN) {
|
||||
if ((slot_id - EQ::invslot::BANK_BEGIN) >= m_lookup->InventoryTypeSize.Bank)
|
||||
return EQ::invslot::SLOT_INVALID;
|
||||
}
|
||||
else if (slot_id <= EQEmu::invbag::BANK_BAGS_END && slot_id >= EQEmu::invbag::BANK_BAGS_BEGIN) {
|
||||
auto temp_slot = (slot_id - EQEmu::invbag::BANK_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT;
|
||||
else if (slot_id <= EQ::invbag::BANK_BAGS_END && slot_id >= EQ::invbag::BANK_BAGS_BEGIN) {
|
||||
auto temp_slot = (slot_id - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT;
|
||||
if (temp_slot >= m_lookup->InventoryTypeSize.Bank)
|
||||
return EQEmu::invslot::SLOT_INVALID;
|
||||
return EQ::invslot::SLOT_INVALID;
|
||||
}
|
||||
|
||||
// Clean up item already in slot (if exists)
|
||||
@@ -259,17 +259,17 @@ int16 EQEmu::InventoryProfile::PutItem(int16 slot_id, const ItemInstance& inst)
|
||||
return _PutItem(slot_id, inst.Clone());
|
||||
}
|
||||
|
||||
int16 EQEmu::InventoryProfile::PushCursor(const ItemInstance &inst) {
|
||||
int16 EQ::InventoryProfile::PushCursor(const ItemInstance &inst) {
|
||||
m_cursor.push(inst.Clone());
|
||||
return invslot::slotCursor;
|
||||
}
|
||||
|
||||
EQEmu::ItemInstance* EQEmu::InventoryProfile::GetCursorItem() {
|
||||
EQ::ItemInstance* EQ::InventoryProfile::GetCursorItem() {
|
||||
return m_cursor.peek_front();
|
||||
}
|
||||
|
||||
// Swap items in inventory
|
||||
bool EQEmu::InventoryProfile::SwapItem(
|
||||
bool EQ::InventoryProfile::SwapItem(
|
||||
int16 source_slot,
|
||||
int16 destination_slot,
|
||||
SwapItemFailState &fail_state,
|
||||
@@ -280,54 +280,54 @@ bool EQEmu::InventoryProfile::SwapItem(
|
||||
) {
|
||||
fail_state = swapInvalid;
|
||||
|
||||
if (source_slot <= EQEmu::invslot::POSSESSIONS_END && source_slot >= EQEmu::invslot::POSSESSIONS_BEGIN) {
|
||||
if (source_slot <= EQ::invslot::POSSESSIONS_END && source_slot >= EQ::invslot::POSSESSIONS_BEGIN) {
|
||||
if ((((uint64) 1 << source_slot) & m_lookup->PossessionsBitmask) == 0) {
|
||||
fail_state = swapNotAllowed;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (source_slot <= EQEmu::invbag::GENERAL_BAGS_END && source_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
|
||||
auto temp_slot = EQEmu::invslot::GENERAL_BEGIN + ((source_slot - EQEmu::invbag::GENERAL_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT);
|
||||
else if (source_slot <= EQ::invbag::GENERAL_BAGS_END && source_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
||||
auto temp_slot = EQ::invslot::GENERAL_BEGIN + ((source_slot - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT);
|
||||
if ((((uint64)1 << temp_slot) & m_lookup->PossessionsBitmask) == 0) {
|
||||
fail_state = swapNotAllowed;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (source_slot <= EQEmu::invslot::BANK_END && source_slot >= EQEmu::invslot::BANK_BEGIN) {
|
||||
if ((source_slot - EQEmu::invslot::BANK_BEGIN) >= m_lookup->InventoryTypeSize.Bank) {
|
||||
else if (source_slot <= EQ::invslot::BANK_END && source_slot >= EQ::invslot::BANK_BEGIN) {
|
||||
if ((source_slot - EQ::invslot::BANK_BEGIN) >= m_lookup->InventoryTypeSize.Bank) {
|
||||
fail_state = swapNotAllowed;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (source_slot <= EQEmu::invbag::BANK_BAGS_END && source_slot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
|
||||
auto temp_slot = (source_slot - EQEmu::invbag::BANK_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT;
|
||||
else if (source_slot <= EQ::invbag::BANK_BAGS_END && source_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
|
||||
auto temp_slot = (source_slot - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT;
|
||||
if (temp_slot >= m_lookup->InventoryTypeSize.Bank) {
|
||||
fail_state = swapNotAllowed;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (destination_slot <= EQEmu::invslot::POSSESSIONS_END && destination_slot >= EQEmu::invslot::POSSESSIONS_BEGIN) {
|
||||
if (destination_slot <= EQ::invslot::POSSESSIONS_END && destination_slot >= EQ::invslot::POSSESSIONS_BEGIN) {
|
||||
if ((((uint64)1 << destination_slot) & m_lookup->PossessionsBitmask) == 0) {
|
||||
fail_state = swapNotAllowed;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (destination_slot <= EQEmu::invbag::GENERAL_BAGS_END && destination_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
|
||||
auto temp_slot = EQEmu::invslot::GENERAL_BEGIN + ((destination_slot - EQEmu::invbag::GENERAL_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT);
|
||||
else if (destination_slot <= EQ::invbag::GENERAL_BAGS_END && destination_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
||||
auto temp_slot = EQ::invslot::GENERAL_BEGIN + ((destination_slot - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT);
|
||||
if ((((uint64)1 << temp_slot) & m_lookup->PossessionsBitmask) == 0) {
|
||||
fail_state = swapNotAllowed;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (destination_slot <= EQEmu::invslot::BANK_END && destination_slot >= EQEmu::invslot::BANK_BEGIN) {
|
||||
if ((destination_slot - EQEmu::invslot::BANK_BEGIN) >= m_lookup->InventoryTypeSize.Bank) {
|
||||
else if (destination_slot <= EQ::invslot::BANK_END && destination_slot >= EQ::invslot::BANK_BEGIN) {
|
||||
if ((destination_slot - EQ::invslot::BANK_BEGIN) >= m_lookup->InventoryTypeSize.Bank) {
|
||||
fail_state = swapNotAllowed;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (destination_slot <= EQEmu::invbag::BANK_BAGS_END && destination_slot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
|
||||
auto temp_slot = (destination_slot - EQEmu::invbag::BANK_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT;
|
||||
else if (destination_slot <= EQ::invbag::BANK_BAGS_END && destination_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
|
||||
auto temp_slot = (destination_slot - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT;
|
||||
if (temp_slot >= m_lookup->InventoryTypeSize.Bank) {
|
||||
fail_state = swapNotAllowed;
|
||||
return false;
|
||||
@@ -399,7 +399,7 @@ bool EQEmu::InventoryProfile::SwapItem(
|
||||
}
|
||||
|
||||
// Remove item from inventory (with memory delete)
|
||||
bool EQEmu::InventoryProfile::DeleteItem(int16 slot_id, uint8 quantity) {
|
||||
bool EQ::InventoryProfile::DeleteItem(int16 slot_id, uint8 quantity) {
|
||||
// Pop item out of inventory map (or queue)
|
||||
ItemInstance *item_to_delete = PopItem(slot_id);
|
||||
|
||||
@@ -434,7 +434,7 @@ bool EQEmu::InventoryProfile::DeleteItem(int16 slot_id, uint8 quantity) {
|
||||
}
|
||||
|
||||
// Checks All items in a bag for No Drop
|
||||
bool EQEmu::InventoryProfile::CheckNoDrop(int16 slot_id, bool recurse)
|
||||
bool EQ::InventoryProfile::CheckNoDrop(int16 slot_id, bool recurse)
|
||||
{
|
||||
ItemInstance* inst = GetItem(slot_id);
|
||||
if (!inst)
|
||||
@@ -445,7 +445,7 @@ bool EQEmu::InventoryProfile::CheckNoDrop(int16 slot_id, bool recurse)
|
||||
|
||||
// Remove item from bucket without memory delete
|
||||
// Returns item pointer if full delete was successful
|
||||
EQEmu::ItemInstance* EQEmu::InventoryProfile::PopItem(int16 slot_id)
|
||||
EQ::ItemInstance* EQ::InventoryProfile::PopItem(int16 slot_id)
|
||||
{
|
||||
ItemInstance* p = nullptr;
|
||||
|
||||
@@ -488,7 +488,7 @@ EQEmu::ItemInstance* EQEmu::InventoryProfile::PopItem(int16 slot_id)
|
||||
return p;
|
||||
}
|
||||
|
||||
bool EQEmu::InventoryProfile::HasSpaceForItem(const ItemData *ItemToTry, int16 Quantity) {
|
||||
bool EQ::InventoryProfile::HasSpaceForItem(const ItemData *ItemToTry, int16 Quantity) {
|
||||
|
||||
if (ItemToTry->Stackable) {
|
||||
|
||||
@@ -592,7 +592,7 @@ bool EQEmu::InventoryProfile::HasSpaceForItem(const ItemData *ItemToTry, int16 Q
|
||||
|
||||
//This function has a flaw in that it only returns the last stack that it looked at
|
||||
//when quantity is greater than 1 and not all of quantity can be found in 1 stack.
|
||||
int16 EQEmu::InventoryProfile::HasItem(uint32 item_id, uint8 quantity, uint8 where)
|
||||
int16 EQ::InventoryProfile::HasItem(uint32 item_id, uint8 quantity, uint8 where)
|
||||
{
|
||||
int16 slot_id = INVALID_INDEX;
|
||||
|
||||
@@ -642,7 +642,7 @@ int16 EQEmu::InventoryProfile::HasItem(uint32 item_id, uint8 quantity, uint8 whe
|
||||
}
|
||||
|
||||
//this function has the same quantity flaw mentioned above in HasItem()
|
||||
int16 EQEmu::InventoryProfile::HasItemByUse(uint8 use, uint8 quantity, uint8 where)
|
||||
int16 EQ::InventoryProfile::HasItemByUse(uint8 use, uint8 quantity, uint8 where)
|
||||
{
|
||||
int16 slot_id = INVALID_INDEX;
|
||||
|
||||
@@ -688,7 +688,7 @@ int16 EQEmu::InventoryProfile::HasItemByUse(uint8 use, uint8 quantity, uint8 whe
|
||||
return slot_id;
|
||||
}
|
||||
|
||||
int16 EQEmu::InventoryProfile::HasItemByLoreGroup(uint32 loregroup, uint8 where)
|
||||
int16 EQ::InventoryProfile::HasItemByLoreGroup(uint32 loregroup, uint8 where)
|
||||
{
|
||||
int16 slot_id = INVALID_INDEX;
|
||||
|
||||
@@ -736,7 +736,7 @@ int16 EQEmu::InventoryProfile::HasItemByLoreGroup(uint32 loregroup, uint8 where)
|
||||
|
||||
// Locate an available inventory slot
|
||||
// Returns slot_id when there's one available, else SLOT_INVALID
|
||||
int16 EQEmu::InventoryProfile::FindFreeSlot(bool for_bag, bool try_cursor, uint8 min_size, bool is_arrow)
|
||||
int16 EQ::InventoryProfile::FindFreeSlot(bool for_bag, bool try_cursor, uint8 min_size, bool is_arrow)
|
||||
{
|
||||
// Check basic inventory
|
||||
for (int16 i = invslot::GENERAL_BEGIN; i <= invslot::GENERAL_END; i++) {
|
||||
@@ -786,7 +786,7 @@ int16 EQEmu::InventoryProfile::FindFreeSlot(bool for_bag, bool try_cursor, uint8
|
||||
}
|
||||
|
||||
// This is a mix of HasSpaceForItem and FindFreeSlot..due to existing coding behavior, it was better to add a new helper function...
|
||||
int16 EQEmu::InventoryProfile::FindFreeSlotForTradeItem(const ItemInstance* inst, int16 general_start, uint8 bag_start) {
|
||||
int16 EQ::InventoryProfile::FindFreeSlotForTradeItem(const ItemInstance* inst, int16 general_start, uint8 bag_start) {
|
||||
// Do not arbitrarily use this function..it is designed for use with Client::ResetTrade() and Client::FinishTrade().
|
||||
// If you have a need, use it..but, understand it is not a suitable replacement for InventoryProfile::FindFreeSlot().
|
||||
//
|
||||
@@ -924,7 +924,7 @@ int16 EQEmu::InventoryProfile::FindFreeSlotForTradeItem(const ItemInstance* inst
|
||||
}
|
||||
|
||||
// Opposite of below: Get parent bag slot_id from a slot inside of bag
|
||||
int16 EQEmu::InventoryProfile::CalcSlotId(int16 slot_id) {
|
||||
int16 EQ::InventoryProfile::CalcSlotId(int16 slot_id) {
|
||||
int16 parent_slot_id = INVALID_INDEX;
|
||||
|
||||
// this is not a bag range... using this risks over-writing existing items
|
||||
@@ -952,7 +952,7 @@ int16 EQEmu::InventoryProfile::CalcSlotId(int16 slot_id) {
|
||||
}
|
||||
|
||||
// Calculate slot_id for an item within a bag
|
||||
int16 EQEmu::InventoryProfile::CalcSlotId(int16 bagslot_id, uint8 bagidx) {
|
||||
int16 EQ::InventoryProfile::CalcSlotId(int16 bagslot_id, uint8 bagidx) {
|
||||
if (!InventoryProfile::SupportsContainers(bagslot_id))
|
||||
return INVALID_INDEX;
|
||||
|
||||
@@ -977,7 +977,7 @@ int16 EQEmu::InventoryProfile::CalcSlotId(int16 bagslot_id, uint8 bagidx) {
|
||||
return slot_id;
|
||||
}
|
||||
|
||||
uint8 EQEmu::InventoryProfile::CalcBagIdx(int16 slot_id) {
|
||||
uint8 EQ::InventoryProfile::CalcBagIdx(int16 slot_id) {
|
||||
uint8 index = 0;
|
||||
|
||||
// this is not a bag range... using this risks over-writing existing items
|
||||
@@ -1006,7 +1006,7 @@ uint8 EQEmu::InventoryProfile::CalcBagIdx(int16 slot_id) {
|
||||
return index;
|
||||
}
|
||||
|
||||
int16 EQEmu::InventoryProfile::CalcSlotFromMaterial(uint8 material)
|
||||
int16 EQ::InventoryProfile::CalcSlotFromMaterial(uint8 material)
|
||||
{
|
||||
switch (material)
|
||||
{
|
||||
@@ -1033,7 +1033,7 @@ int16 EQEmu::InventoryProfile::CalcSlotFromMaterial(uint8 material)
|
||||
}
|
||||
}
|
||||
|
||||
uint8 EQEmu::InventoryProfile::CalcMaterialFromSlot(int16 equipslot)
|
||||
uint8 EQ::InventoryProfile::CalcMaterialFromSlot(int16 equipslot)
|
||||
{
|
||||
switch (equipslot)
|
||||
{
|
||||
@@ -1061,7 +1061,7 @@ uint8 EQEmu::InventoryProfile::CalcMaterialFromSlot(int16 equipslot)
|
||||
}
|
||||
}
|
||||
|
||||
bool EQEmu::InventoryProfile::CanItemFitInContainer(const ItemData *ItemToTry, const ItemData *Container) {
|
||||
bool EQ::InventoryProfile::CanItemFitInContainer(const ItemData *ItemToTry, const ItemData *Container) {
|
||||
|
||||
if (!ItemToTry || !Container)
|
||||
return false;
|
||||
@@ -1078,7 +1078,7 @@ bool EQEmu::InventoryProfile::CanItemFitInContainer(const ItemData *ItemToTry, c
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EQEmu::InventoryProfile::SupportsClickCasting(int16 slot_id)
|
||||
bool EQ::InventoryProfile::SupportsClickCasting(int16 slot_id)
|
||||
{
|
||||
// there are a few non-potion items that identify as ItemTypePotion..so, we still need to ubiquitously include the equipment range
|
||||
if (slot_id >= invslot::EQUIPMENT_BEGIN && slot_id <= invslot::EQUIPMENT_END) {
|
||||
@@ -1095,7 +1095,7 @@ bool EQEmu::InventoryProfile::SupportsClickCasting(int16 slot_id)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool EQEmu::InventoryProfile::SupportsPotionBeltCasting(int16 slot_id)
|
||||
bool EQ::InventoryProfile::SupportsPotionBeltCasting(int16 slot_id)
|
||||
{
|
||||
// does this have the same criteria as 'SupportsClickCasting' above? (bag clicking per client)
|
||||
if (slot_id >= invslot::EQUIPMENT_BEGIN && slot_id <= invslot::EQUIPMENT_END) {
|
||||
@@ -1112,7 +1112,7 @@ bool EQEmu::InventoryProfile::SupportsPotionBeltCasting(int16 slot_id)
|
||||
}
|
||||
|
||||
// Test whether a given slot can support a container item
|
||||
bool EQEmu::InventoryProfile::SupportsContainers(int16 slot_id)
|
||||
bool EQ::InventoryProfile::SupportsContainers(int16 slot_id)
|
||||
{
|
||||
if ((slot_id == invslot::slotCursor) ||
|
||||
(slot_id >= invslot::GENERAL_BEGIN && slot_id <= invslot::GENERAL_END) ||
|
||||
@@ -1126,7 +1126,7 @@ bool EQEmu::InventoryProfile::SupportsContainers(int16 slot_id)
|
||||
return false;
|
||||
}
|
||||
|
||||
int EQEmu::InventoryProfile::GetSlotByItemInst(ItemInstance *inst) {
|
||||
int EQ::InventoryProfile::GetSlotByItemInst(ItemInstance *inst) {
|
||||
if (!inst)
|
||||
return INVALID_INDEX;
|
||||
|
||||
@@ -1162,7 +1162,7 @@ int EQEmu::InventoryProfile::GetSlotByItemInst(ItemInstance *inst) {
|
||||
return INVALID_INDEX;
|
||||
}
|
||||
|
||||
uint8 EQEmu::InventoryProfile::FindBrightestLightType()
|
||||
uint8 EQ::InventoryProfile::FindBrightestLightType()
|
||||
{
|
||||
uint8 brightest_light_type = 0;
|
||||
|
||||
@@ -1213,7 +1213,7 @@ uint8 EQEmu::InventoryProfile::FindBrightestLightType()
|
||||
return brightest_light_type;
|
||||
}
|
||||
|
||||
void EQEmu::InventoryProfile::dumpEntireInventory() {
|
||||
void EQ::InventoryProfile::dumpEntireInventory() {
|
||||
|
||||
dumpWornItems();
|
||||
dumpInventory();
|
||||
@@ -1223,29 +1223,29 @@ void EQEmu::InventoryProfile::dumpEntireInventory() {
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
void EQEmu::InventoryProfile::dumpWornItems() {
|
||||
void EQ::InventoryProfile::dumpWornItems() {
|
||||
std::cout << "Worn items:" << std::endl;
|
||||
dumpItemCollection(m_worn);
|
||||
}
|
||||
|
||||
void EQEmu::InventoryProfile::dumpInventory() {
|
||||
void EQ::InventoryProfile::dumpInventory() {
|
||||
std::cout << "Inventory items:" << std::endl;
|
||||
dumpItemCollection(m_inv);
|
||||
}
|
||||
|
||||
void EQEmu::InventoryProfile::dumpBankItems() {
|
||||
void EQ::InventoryProfile::dumpBankItems() {
|
||||
|
||||
std::cout << "Bank items:" << std::endl;
|
||||
dumpItemCollection(m_bank);
|
||||
}
|
||||
|
||||
void EQEmu::InventoryProfile::dumpSharedBankItems() {
|
||||
void EQ::InventoryProfile::dumpSharedBankItems() {
|
||||
|
||||
std::cout << "Shared Bank items:" << std::endl;
|
||||
dumpItemCollection(m_shbank);
|
||||
}
|
||||
|
||||
int EQEmu::InventoryProfile::GetSlotByItemInstCollection(const std::map<int16, ItemInstance*> &collection, ItemInstance *inst) {
|
||||
int EQ::InventoryProfile::GetSlotByItemInstCollection(const std::map<int16, ItemInstance*> &collection, ItemInstance *inst) {
|
||||
for (auto iter = collection.begin(); iter != collection.end(); ++iter) {
|
||||
ItemInstance *t_inst = iter->second;
|
||||
if (t_inst == inst) {
|
||||
@@ -1261,10 +1261,10 @@ int EQEmu::InventoryProfile::GetSlotByItemInstCollection(const std::map<int16, I
|
||||
}
|
||||
}
|
||||
|
||||
return EQEmu::invslot::SLOT_INVALID;
|
||||
return EQ::invslot::SLOT_INVALID;
|
||||
}
|
||||
|
||||
void EQEmu::InventoryProfile::dumpItemCollection(const std::map<int16, ItemInstance*> &collection)
|
||||
void EQ::InventoryProfile::dumpItemCollection(const std::map<int16, ItemInstance*> &collection)
|
||||
{
|
||||
for (auto it = collection.cbegin(); it != collection.cend(); ++it) {
|
||||
auto inst = it->second;
|
||||
@@ -1278,7 +1278,7 @@ void EQEmu::InventoryProfile::dumpItemCollection(const std::map<int16, ItemInsta
|
||||
}
|
||||
}
|
||||
|
||||
void EQEmu::InventoryProfile::dumpBagContents(ItemInstance *inst, std::map<int16, ItemInstance*>::const_iterator *it)
|
||||
void EQ::InventoryProfile::dumpBagContents(ItemInstance *inst, std::map<int16, ItemInstance*>::const_iterator *it)
|
||||
{
|
||||
if (!inst || !inst->IsClassBag())
|
||||
return;
|
||||
@@ -1297,14 +1297,14 @@ void EQEmu::InventoryProfile::dumpBagContents(ItemInstance *inst, std::map<int16
|
||||
}
|
||||
|
||||
// Internal Method: Retrieves item within an inventory bucket
|
||||
EQEmu::ItemInstance* EQEmu::InventoryProfile::_GetItem(const std::map<int16, ItemInstance*>& bucket, int16 slot_id) const
|
||||
EQ::ItemInstance* EQ::InventoryProfile::_GetItem(const std::map<int16, ItemInstance*>& bucket, int16 slot_id) const
|
||||
{
|
||||
if (slot_id <= EQEmu::invslot::POSSESSIONS_END && slot_id >= EQEmu::invslot::POSSESSIONS_BEGIN) {
|
||||
if (slot_id <= EQ::invslot::POSSESSIONS_END && slot_id >= EQ::invslot::POSSESSIONS_BEGIN) {
|
||||
if ((((uint64)1 << slot_id) & m_lookup->PossessionsBitmask) == 0)
|
||||
return nullptr;
|
||||
}
|
||||
else if (slot_id <= EQEmu::invslot::BANK_END && slot_id >= EQEmu::invslot::BANK_BEGIN) {
|
||||
if (slot_id - EQEmu::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
|
||||
else if (slot_id <= EQ::invslot::BANK_END && slot_id >= EQ::invslot::BANK_BEGIN) {
|
||||
if (slot_id - EQ::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -1319,7 +1319,7 @@ EQEmu::ItemInstance* EQEmu::InventoryProfile::_GetItem(const std::map<int16, Ite
|
||||
|
||||
// Internal Method: "put" item into bucket, without regard for what is currently in bucket
|
||||
// Assumes item has already been allocated
|
||||
int16 EQEmu::InventoryProfile::_PutItem(int16 slot_id, ItemInstance* inst)
|
||||
int16 EQ::InventoryProfile::_PutItem(int16 slot_id, ItemInstance* inst)
|
||||
{
|
||||
// What happens here when we _PutItem(MainCursor)? Bad things..really bad things...
|
||||
//
|
||||
@@ -1356,7 +1356,7 @@ int16 EQEmu::InventoryProfile::_PutItem(int16 slot_id, ItemInstance* inst)
|
||||
result = slot_id;
|
||||
}
|
||||
else if (slot_id >= invslot::BANK_BEGIN && slot_id <= invslot::BANK_END) {
|
||||
if (slot_id - EQEmu::invslot::BANK_BEGIN < m_lookup->InventoryTypeSize.Bank) {
|
||||
if (slot_id - EQ::invslot::BANK_BEGIN < m_lookup->InventoryTypeSize.Bank) {
|
||||
m_bank[slot_id] = inst;
|
||||
result = slot_id;
|
||||
}
|
||||
@@ -1389,17 +1389,17 @@ int16 EQEmu::InventoryProfile::_PutItem(int16 slot_id, ItemInstance* inst)
|
||||
}
|
||||
|
||||
// Internal Method: Checks an inventory bucket for a particular item
|
||||
int16 EQEmu::InventoryProfile::_HasItem(std::map<int16, ItemInstance*>& bucket, uint32 item_id, uint8 quantity)
|
||||
int16 EQ::InventoryProfile::_HasItem(std::map<int16, ItemInstance*>& bucket, uint32 item_id, uint8 quantity)
|
||||
{
|
||||
uint32 quantity_found = 0;
|
||||
|
||||
for (auto iter = bucket.begin(); iter != bucket.end(); ++iter) {
|
||||
if (iter->first <= EQEmu::invslot::POSSESSIONS_END && iter->first >= EQEmu::invslot::POSSESSIONS_BEGIN) {
|
||||
if (iter->first <= EQ::invslot::POSSESSIONS_END && iter->first >= EQ::invslot::POSSESSIONS_BEGIN) {
|
||||
if ((((uint64)1 << iter->first) & m_lookup->PossessionsBitmask) == 0)
|
||||
continue;
|
||||
}
|
||||
else if (iter->first <= EQEmu::invslot::BANK_END && iter->first >= EQEmu::invslot::BANK_BEGIN) {
|
||||
if (iter->first - EQEmu::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
|
||||
else if (iter->first <= EQ::invslot::BANK_END && iter->first >= EQ::invslot::BANK_BEGIN) {
|
||||
if (iter->first - EQ::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1440,7 +1440,7 @@ int16 EQEmu::InventoryProfile::_HasItem(std::map<int16, ItemInstance*>& bucket,
|
||||
}
|
||||
|
||||
// Internal Method: Checks an inventory queue type bucket for a particular item
|
||||
int16 EQEmu::InventoryProfile::_HasItem(ItemInstQueue& iqueue, uint32 item_id, uint8 quantity)
|
||||
int16 EQ::InventoryProfile::_HasItem(ItemInstQueue& iqueue, uint32 item_id, uint8 quantity)
|
||||
{
|
||||
// The downfall of this (these) queue procedure is that callers presume that when an item is
|
||||
// found, it is presented as being available on the cursor. In cases of a parity check, this
|
||||
@@ -1491,17 +1491,17 @@ int16 EQEmu::InventoryProfile::_HasItem(ItemInstQueue& iqueue, uint32 item_id, u
|
||||
}
|
||||
|
||||
// Internal Method: Checks an inventory bucket for a particular item
|
||||
int16 EQEmu::InventoryProfile::_HasItemByUse(std::map<int16, ItemInstance*>& bucket, uint8 use, uint8 quantity)
|
||||
int16 EQ::InventoryProfile::_HasItemByUse(std::map<int16, ItemInstance*>& bucket, uint8 use, uint8 quantity)
|
||||
{
|
||||
uint32 quantity_found = 0;
|
||||
|
||||
for (auto iter = bucket.begin(); iter != bucket.end(); ++iter) {
|
||||
if (iter->first <= EQEmu::invslot::POSSESSIONS_END && iter->first >= EQEmu::invslot::POSSESSIONS_BEGIN) {
|
||||
if (iter->first <= EQ::invslot::POSSESSIONS_END && iter->first >= EQ::invslot::POSSESSIONS_BEGIN) {
|
||||
if ((((uint64)1 << iter->first) & m_lookup->PossessionsBitmask) == 0)
|
||||
continue;
|
||||
}
|
||||
else if (iter->first <= EQEmu::invslot::BANK_END && iter->first >= EQEmu::invslot::BANK_BEGIN) {
|
||||
if (iter->first - EQEmu::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
|
||||
else if (iter->first <= EQ::invslot::BANK_END && iter->first >= EQ::invslot::BANK_BEGIN) {
|
||||
if (iter->first - EQ::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1532,7 +1532,7 @@ int16 EQEmu::InventoryProfile::_HasItemByUse(std::map<int16, ItemInstance*>& buc
|
||||
}
|
||||
|
||||
// Internal Method: Checks an inventory queue type bucket for a particular item
|
||||
int16 EQEmu::InventoryProfile::_HasItemByUse(ItemInstQueue& iqueue, uint8 use, uint8 quantity)
|
||||
int16 EQ::InventoryProfile::_HasItemByUse(ItemInstQueue& iqueue, uint8 use, uint8 quantity)
|
||||
{
|
||||
uint32 quantity_found = 0;
|
||||
|
||||
@@ -1566,15 +1566,15 @@ int16 EQEmu::InventoryProfile::_HasItemByUse(ItemInstQueue& iqueue, uint8 use, u
|
||||
return INVALID_INDEX;
|
||||
}
|
||||
|
||||
int16 EQEmu::InventoryProfile::_HasItemByLoreGroup(std::map<int16, ItemInstance*>& bucket, uint32 loregroup)
|
||||
int16 EQ::InventoryProfile::_HasItemByLoreGroup(std::map<int16, ItemInstance*>& bucket, uint32 loregroup)
|
||||
{
|
||||
for (auto iter = bucket.begin(); iter != bucket.end(); ++iter) {
|
||||
if (iter->first <= EQEmu::invslot::POSSESSIONS_END && iter->first >= EQEmu::invslot::POSSESSIONS_BEGIN) {
|
||||
if (iter->first <= EQ::invslot::POSSESSIONS_END && iter->first >= EQ::invslot::POSSESSIONS_BEGIN) {
|
||||
if ((((uint64)1 << iter->first) & m_lookup->PossessionsBitmask) == 0)
|
||||
continue;
|
||||
}
|
||||
else if (iter->first <= EQEmu::invslot::BANK_END && iter->first >= EQEmu::invslot::BANK_BEGIN) {
|
||||
if (iter->first - EQEmu::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
|
||||
else if (iter->first <= EQ::invslot::BANK_END && iter->first >= EQ::invslot::BANK_BEGIN) {
|
||||
if (iter->first - EQ::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1611,11 +1611,11 @@ int16 EQEmu::InventoryProfile::_HasItemByLoreGroup(std::map<int16, ItemInstance*
|
||||
}
|
||||
}
|
||||
|
||||
return EQEmu::invslot::SLOT_INVALID;
|
||||
return EQ::invslot::SLOT_INVALID;
|
||||
}
|
||||
|
||||
// Internal Method: Checks an inventory queue type bucket for a particular item
|
||||
int16 EQEmu::InventoryProfile::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup)
|
||||
int16 EQ::InventoryProfile::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup)
|
||||
{
|
||||
for (auto iter = iqueue.cbegin(); iter != iqueue.cend(); ++iter) {
|
||||
auto inst = *iter;
|
||||
@@ -1654,5 +1654,5 @@ int16 EQEmu::InventoryProfile::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32
|
||||
break;
|
||||
}
|
||||
|
||||
return EQEmu::invslot::SLOT_INVALID;
|
||||
return EQ::invslot::SLOT_INVALID;
|
||||
}
|
||||
|
||||
+10
-10
@@ -52,30 +52,30 @@ public:
|
||||
// Public Methods
|
||||
/////////////////////////
|
||||
|
||||
inline std::list<EQEmu::ItemInstance*>::const_iterator cbegin() { return m_list.cbegin(); }
|
||||
inline std::list<EQEmu::ItemInstance*>::const_iterator cend() { return m_list.cend(); }
|
||||
inline std::list<EQ::ItemInstance*>::const_iterator cbegin() { return m_list.cbegin(); }
|
||||
inline std::list<EQ::ItemInstance*>::const_iterator cend() { return m_list.cend(); }
|
||||
|
||||
inline int size() { return static_cast<int>(m_list.size()); } // TODO: change to size_t
|
||||
inline bool empty() { return m_list.empty(); }
|
||||
|
||||
void push(EQEmu::ItemInstance* inst);
|
||||
void push_front(EQEmu::ItemInstance* inst);
|
||||
EQEmu::ItemInstance* pop();
|
||||
EQEmu::ItemInstance* pop_back();
|
||||
EQEmu::ItemInstance* peek_front() const;
|
||||
void push(EQ::ItemInstance* inst);
|
||||
void push_front(EQ::ItemInstance* inst);
|
||||
EQ::ItemInstance* pop();
|
||||
EQ::ItemInstance* pop_back();
|
||||
EQ::ItemInstance* peek_front() const;
|
||||
|
||||
protected:
|
||||
/////////////////////////
|
||||
// Protected Members
|
||||
/////////////////////////
|
||||
|
||||
std::list<EQEmu::ItemInstance*> m_list;
|
||||
std::list<EQ::ItemInstance*> m_list;
|
||||
};
|
||||
|
||||
// ########################################
|
||||
// Class: EQEmu::InventoryProfile
|
||||
// Class: EQ::InventoryProfile
|
||||
// Character inventory
|
||||
namespace EQEmu
|
||||
namespace EQ
|
||||
{
|
||||
class InventoryProfile
|
||||
{
|
||||
|
||||
+31
-31
@@ -22,7 +22,7 @@
|
||||
#include "string_util.h"
|
||||
|
||||
|
||||
int8 EQEmu::inventory::ConvertEquipmentIndexToTextureIndex(int16 slot_index)
|
||||
int8 EQ::inventory::ConvertEquipmentIndexToTextureIndex(int16 slot_index)
|
||||
{
|
||||
switch (slot_index) {
|
||||
case invslot::slotHead:
|
||||
@@ -48,7 +48,7 @@ int8 EQEmu::inventory::ConvertEquipmentIndexToTextureIndex(int16 slot_index)
|
||||
}
|
||||
}
|
||||
|
||||
int8 EQEmu::inventory::ConvertEquipmentSlotToTextureIndex(const InventorySlot& inventory_slot)
|
||||
int8 EQ::inventory::ConvertEquipmentSlotToTextureIndex(const InventorySlot& inventory_slot)
|
||||
{
|
||||
if ((!inventory_slot.Typeless() && !inventory_slot.IsTypeIndex(invtype::typePossessions)) || !inventory_slot.IsContainerIndex(invbag::SLOT_INVALID) || !inventory_slot.IsSocketIndex(invaug::SOCKET_INVALID))
|
||||
return textures::textureInvalid;
|
||||
@@ -56,7 +56,7 @@ int8 EQEmu::inventory::ConvertEquipmentSlotToTextureIndex(const InventorySlot& i
|
||||
return ConvertEquipmentIndexToTextureIndex(inventory_slot.SlotIndex());
|
||||
}
|
||||
|
||||
int16 EQEmu::inventory::ConvertTextureIndexToEquipmentIndex(int8 texture_index)
|
||||
int16 EQ::inventory::ConvertTextureIndexToEquipmentIndex(int8 texture_index)
|
||||
{
|
||||
switch (texture_index) {
|
||||
case textures::armorHead:
|
||||
@@ -82,7 +82,7 @@ int16 EQEmu::inventory::ConvertTextureIndexToEquipmentIndex(int8 texture_index)
|
||||
}
|
||||
}
|
||||
|
||||
bool EQEmu::InventorySlot::IsValidSlot() const
|
||||
bool EQ::InventorySlot::IsValidSlot() const
|
||||
{
|
||||
if (_typeless)
|
||||
return false;
|
||||
@@ -100,7 +100,7 @@ bool EQEmu::InventorySlot::IsValidSlot() const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EQEmu::InventorySlot::IsDeleteSlot() const
|
||||
bool EQ::InventorySlot::IsDeleteSlot() const
|
||||
{
|
||||
if (_typeless)
|
||||
return (_slot_index == invslot::SLOT_INVALID && _container_index == invbag::SLOT_INVALID && _socket_index == invaug::SOCKET_INVALID);
|
||||
@@ -108,7 +108,7 @@ bool EQEmu::InventorySlot::IsDeleteSlot() const
|
||||
return (_type_index == invtype::TYPE_INVALID && _slot_index == invslot::SLOT_INVALID && _container_index == invbag::SLOT_INVALID && _socket_index == invaug::SOCKET_INVALID);
|
||||
}
|
||||
|
||||
bool EQEmu::InventorySlot::IsEquipmentIndex(int16 slot_index)
|
||||
bool EQ::InventorySlot::IsEquipmentIndex(int16 slot_index)
|
||||
{
|
||||
if (slot_index < invslot::EQUIPMENT_BEGIN || slot_index > invslot::EQUIPMENT_END)
|
||||
return false;
|
||||
@@ -116,7 +116,7 @@ bool EQEmu::InventorySlot::IsEquipmentIndex(int16 slot_index)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EQEmu::InventorySlot::IsGeneralIndex(int16 slot_index)
|
||||
bool EQ::InventorySlot::IsGeneralIndex(int16 slot_index)
|
||||
{
|
||||
if (slot_index < invslot::GENERAL_BEGIN || slot_index > invslot::GENERAL_END)
|
||||
return false;
|
||||
@@ -124,7 +124,7 @@ bool EQEmu::InventorySlot::IsGeneralIndex(int16 slot_index)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EQEmu::InventorySlot::IsCursorIndex(int16 slot_index)
|
||||
bool EQ::InventorySlot::IsCursorIndex(int16 slot_index)
|
||||
{
|
||||
if (slot_index == invslot::slotCursor)
|
||||
return true;
|
||||
@@ -132,7 +132,7 @@ bool EQEmu::InventorySlot::IsCursorIndex(int16 slot_index)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool EQEmu::InventorySlot::IsWeaponIndex(int16 slot_index)
|
||||
bool EQ::InventorySlot::IsWeaponIndex(int16 slot_index)
|
||||
{
|
||||
if (slot_index == invslot::slotPrimary || slot_index == invslot::slotSecondary || slot_index == invslot::slotRange)
|
||||
return true;
|
||||
@@ -140,7 +140,7 @@ bool EQEmu::InventorySlot::IsWeaponIndex(int16 slot_index)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool EQEmu::InventorySlot::IsTextureIndex(int16 slot_index)
|
||||
bool EQ::InventorySlot::IsTextureIndex(int16 slot_index)
|
||||
{
|
||||
switch (slot_index) {
|
||||
case invslot::slotHead:
|
||||
@@ -158,7 +158,7 @@ bool EQEmu::InventorySlot::IsTextureIndex(int16 slot_index)
|
||||
}
|
||||
}
|
||||
|
||||
bool EQEmu::InventorySlot::IsTintableIndex(int16 slot_index)
|
||||
bool EQ::InventorySlot::IsTintableIndex(int16 slot_index)
|
||||
{
|
||||
switch (slot_index) {
|
||||
case invslot::slotHead:
|
||||
@@ -174,7 +174,7 @@ bool EQEmu::InventorySlot::IsTintableIndex(int16 slot_index)
|
||||
}
|
||||
}
|
||||
|
||||
bool EQEmu::InventorySlot::IsEquipmentSlot() const
|
||||
bool EQ::InventorySlot::IsEquipmentSlot() const
|
||||
{
|
||||
if (!_typeless && (_type_index != invtype::typePossessions))
|
||||
return false;
|
||||
@@ -185,7 +185,7 @@ bool EQEmu::InventorySlot::IsEquipmentSlot() const
|
||||
return IsEquipmentIndex(_slot_index);
|
||||
}
|
||||
|
||||
bool EQEmu::InventorySlot::IsGeneralSlot() const
|
||||
bool EQ::InventorySlot::IsGeneralSlot() const
|
||||
{
|
||||
if (!_typeless && (_type_index != invtype::typePossessions))
|
||||
return false;
|
||||
@@ -196,7 +196,7 @@ bool EQEmu::InventorySlot::IsGeneralSlot() const
|
||||
return IsGeneralIndex(_socket_index);
|
||||
}
|
||||
|
||||
bool EQEmu::InventorySlot::IsCursorSlot() const
|
||||
bool EQ::InventorySlot::IsCursorSlot() const
|
||||
{
|
||||
if (!_typeless && (_type_index != invtype::typePossessions))
|
||||
return false;
|
||||
@@ -207,7 +207,7 @@ bool EQEmu::InventorySlot::IsCursorSlot() const
|
||||
return IsCursorIndex(_slot_index);
|
||||
}
|
||||
|
||||
bool EQEmu::InventorySlot::IsWeaponSlot() const
|
||||
bool EQ::InventorySlot::IsWeaponSlot() const
|
||||
{
|
||||
if (!_typeless && (_type_index != invtype::typePossessions))
|
||||
return false;
|
||||
@@ -218,7 +218,7 @@ bool EQEmu::InventorySlot::IsWeaponSlot() const
|
||||
return IsWeaponIndex(_slot_index);
|
||||
}
|
||||
|
||||
bool EQEmu::InventorySlot::IsTextureSlot() const
|
||||
bool EQ::InventorySlot::IsTextureSlot() const
|
||||
{
|
||||
if (!_typeless && (_type_index != invtype::typePossessions))
|
||||
return false;
|
||||
@@ -229,7 +229,7 @@ bool EQEmu::InventorySlot::IsTextureSlot() const
|
||||
return IsTextureIndex(_slot_index);
|
||||
}
|
||||
|
||||
bool EQEmu::InventorySlot::IsTintableSlot() const
|
||||
bool EQ::InventorySlot::IsTintableSlot() const
|
||||
{
|
||||
if (!_typeless && (_type_index != invtype::typePossessions))
|
||||
return false;
|
||||
@@ -240,7 +240,7 @@ bool EQEmu::InventorySlot::IsTintableSlot() const
|
||||
return IsTintableIndex(_slot_index);
|
||||
}
|
||||
|
||||
bool EQEmu::InventorySlot::IsSlot() const
|
||||
bool EQ::InventorySlot::IsSlot() const
|
||||
{
|
||||
if (!_typeless && (_type_index == invtype::TYPE_INVALID))
|
||||
return false;
|
||||
@@ -254,7 +254,7 @@ bool EQEmu::InventorySlot::IsSlot() const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EQEmu::InventorySlot::IsSlotSocket() const
|
||||
bool EQ::InventorySlot::IsSlotSocket() const
|
||||
{
|
||||
if (!_typeless && (_type_index == invtype::TYPE_INVALID))
|
||||
return false;
|
||||
@@ -268,7 +268,7 @@ bool EQEmu::InventorySlot::IsSlotSocket() const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EQEmu::InventorySlot::IsContainer() const
|
||||
bool EQ::InventorySlot::IsContainer() const
|
||||
{
|
||||
if (!_typeless && (_type_index == invtype::TYPE_INVALID))
|
||||
return false;
|
||||
@@ -282,7 +282,7 @@ bool EQEmu::InventorySlot::IsContainer() const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EQEmu::InventorySlot::IsContainerSocket() const
|
||||
bool EQ::InventorySlot::IsContainerSocket() const
|
||||
{
|
||||
if (!_typeless && (_type_index == invtype::TYPE_INVALID))
|
||||
return false;
|
||||
@@ -296,12 +296,12 @@ bool EQEmu::InventorySlot::IsContainerSocket() const
|
||||
return true;
|
||||
}
|
||||
|
||||
EQEmu::InventorySlot EQEmu::InventorySlot::ToTopOwner() const
|
||||
EQ::InventorySlot EQ::InventorySlot::ToTopOwner() const
|
||||
{
|
||||
return InventorySlot(_type_index, _slot_index);
|
||||
}
|
||||
|
||||
EQEmu::InventorySlot EQEmu::InventorySlot::ToOwner() const
|
||||
EQ::InventorySlot EQ::InventorySlot::ToOwner() const
|
||||
{
|
||||
if (IsSlot() || IsSlotSocket() || IsContainer())
|
||||
return InventorySlot(_type_index, _slot_index);
|
||||
@@ -312,17 +312,17 @@ EQEmu::InventorySlot EQEmu::InventorySlot::ToOwner() const
|
||||
return InventorySlot();
|
||||
}
|
||||
|
||||
const std::string EQEmu::InventorySlot::ToString() const
|
||||
const std::string EQ::InventorySlot::ToString() const
|
||||
{
|
||||
return StringFormat("(%i%s, %i, %i, %i)", _type_index, (_typeless ? " [typeless]" : ""), _slot_index, _container_index, _socket_index);
|
||||
}
|
||||
|
||||
const std::string EQEmu::InventorySlot::ToName() const
|
||||
const std::string EQ::InventorySlot::ToName() const
|
||||
{
|
||||
return StringFormat("InventorySlot - _type_index: %i%s, _slot_index: %i, _container_index: %i, _socket_index: %i", _type_index, (_typeless ? " [typeless]" : ""), _slot_index, _container_index, _socket_index);
|
||||
}
|
||||
|
||||
void EQEmu::InventorySlot::SetInvalidSlot()
|
||||
void EQ::InventorySlot::SetInvalidSlot()
|
||||
{
|
||||
_type_index = invtype::TYPE_INVALID;
|
||||
_slot_index = invslot::SLOT_INVALID;
|
||||
@@ -330,7 +330,7 @@ void EQEmu::InventorySlot::SetInvalidSlot()
|
||||
_socket_index = invaug::SOCKET_INVALID;
|
||||
}
|
||||
|
||||
//bool EQEmu::InventorySlot::IsBonusIndex(int16 slot_index)
|
||||
//bool EQ::InventorySlot::IsBonusIndex(int16 slot_index)
|
||||
//{
|
||||
// if ((slot_index >= inventory::EquipmentBegin) && (slot_index <= inventory::EquipmentEnd) && (slot_index != inventory::slotAmmo))
|
||||
// return true;
|
||||
@@ -338,7 +338,7 @@ void EQEmu::InventorySlot::SetInvalidSlot()
|
||||
// return false;
|
||||
//}
|
||||
|
||||
//bool EQEmu::InventorySlot::IsBonusSlot() const
|
||||
//bool EQ::InventorySlot::IsBonusSlot() const
|
||||
//{
|
||||
// if ((_type_index != inventory::typePossessions) || (_container_index != inventory::containerInvalid) || (_socket_index != inventory::socketInvalid))
|
||||
// return false;
|
||||
@@ -346,7 +346,7 @@ void EQEmu::InventorySlot::SetInvalidSlot()
|
||||
// return IsBonusIndex(_slot_index);
|
||||
//}
|
||||
|
||||
bool inventory_slot_typeless_lessthan(const EQEmu::InventorySlot& lhs, const EQEmu::InventorySlot& rhs)
|
||||
bool inventory_slot_typeless_lessthan(const EQ::InventorySlot& lhs, const EQ::InventorySlot& rhs)
|
||||
{
|
||||
if (lhs.SlotIndex() < rhs.SlotIndex())
|
||||
return true;
|
||||
@@ -360,7 +360,7 @@ bool inventory_slot_typeless_lessthan(const EQEmu::InventorySlot& lhs, const EQE
|
||||
return false;
|
||||
}
|
||||
|
||||
bool EQEmu::InventorySlot::operator<(const InventorySlot& rhs) const
|
||||
bool EQ::InventorySlot::operator<(const InventorySlot& rhs) const
|
||||
{
|
||||
if (Typeless() || rhs.Typeless())
|
||||
return inventory_slot_typeless_lessthan(*this, rhs);
|
||||
@@ -380,7 +380,7 @@ bool EQEmu::InventorySlot::operator<(const InventorySlot& rhs) const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool EQEmu::operator==(const InventorySlot& lhs, const InventorySlot& rhs)
|
||||
bool EQ::operator==(const InventorySlot& lhs, const InventorySlot& rhs)
|
||||
{
|
||||
if (lhs.Typeless() || rhs.Typeless())
|
||||
return ((lhs.SlotIndex() == rhs.SlotIndex()) && (lhs.ContainerIndex() == rhs.ContainerIndex()) && (lhs.SocketIndex() == rhs.SocketIndex()));
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "emu_constants.h"
|
||||
|
||||
|
||||
namespace EQEmu
|
||||
namespace EQ
|
||||
{
|
||||
class InventorySlot;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "eqemu_exception.h"
|
||||
#include "eqemu_config.h"
|
||||
|
||||
namespace EQEmu {
|
||||
namespace EQ {
|
||||
struct IPCMutex::Implementation {
|
||||
#ifdef _WINDOWS
|
||||
HANDLE mut_;
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace EQEmu {
|
||||
namespace EQ {
|
||||
|
||||
//! Interprocess Named Binary Semaphore (Mutex)
|
||||
/*!
|
||||
|
||||
+10
-10
@@ -23,7 +23,7 @@
|
||||
//#include "deity.h"
|
||||
|
||||
|
||||
uint32 EQEmu::item::ConvertAugTypeToAugTypeBit(uint8 aug_type)
|
||||
uint32 EQ::item::ConvertAugTypeToAugTypeBit(uint8 aug_type)
|
||||
{
|
||||
switch (aug_type) {
|
||||
case AugTypeGeneralSingleStat:
|
||||
@@ -95,7 +95,7 @@ uint32 EQEmu::item::ConvertAugTypeToAugTypeBit(uint8 aug_type)
|
||||
}
|
||||
}
|
||||
|
||||
uint8 EQEmu::item::ConvertAugTypeBitToAugType(uint32 aug_type_bit)
|
||||
uint8 EQ::item::ConvertAugTypeBitToAugType(uint32 aug_type_bit)
|
||||
{
|
||||
switch (aug_type_bit) {
|
||||
case bit_AugTypeGeneralSingleStat:
|
||||
@@ -167,7 +167,7 @@ uint8 EQEmu::item::ConvertAugTypeBitToAugType(uint32 aug_type_bit)
|
||||
}
|
||||
}
|
||||
|
||||
bool EQEmu::ItemData::IsEquipable(uint16 race_id, uint16 class_id) const
|
||||
bool EQ::ItemData::IsEquipable(uint16 race_id, uint16 class_id) const
|
||||
{
|
||||
if (!(Races & GetPlayerRaceBit(race_id)))
|
||||
return false;
|
||||
@@ -178,37 +178,37 @@ bool EQEmu::ItemData::IsEquipable(uint16 race_id, uint16 class_id) const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EQEmu::ItemData::IsClassCommon() const
|
||||
bool EQ::ItemData::IsClassCommon() const
|
||||
{
|
||||
return (ItemClass == item::ItemClassCommon);
|
||||
}
|
||||
|
||||
bool EQEmu::ItemData::IsClassBag() const
|
||||
bool EQ::ItemData::IsClassBag() const
|
||||
{
|
||||
return (ItemClass == item::ItemClassBag);
|
||||
}
|
||||
|
||||
bool EQEmu::ItemData::IsClassBook() const
|
||||
bool EQ::ItemData::IsClassBook() const
|
||||
{
|
||||
return (ItemClass == item::ItemClassBook);
|
||||
}
|
||||
|
||||
bool EQEmu::ItemData::IsType1HWeapon() const
|
||||
bool EQ::ItemData::IsType1HWeapon() const
|
||||
{
|
||||
return ((ItemType == item::ItemType1HBlunt) || (ItemType == item::ItemType1HSlash) || (ItemType == item::ItemType1HPiercing) || (ItemType == item::ItemTypeMartial));
|
||||
}
|
||||
|
||||
bool EQEmu::ItemData::IsType2HWeapon() const
|
||||
bool EQ::ItemData::IsType2HWeapon() const
|
||||
{
|
||||
return ((ItemType == item::ItemType2HBlunt) || (ItemType == item::ItemType2HSlash) || (ItemType == item::ItemType2HPiercing));
|
||||
}
|
||||
|
||||
bool EQEmu::ItemData::IsTypeShield() const
|
||||
bool EQ::ItemData::IsTypeShield() const
|
||||
{
|
||||
return (ItemType == item::ItemTypeShield);
|
||||
}
|
||||
|
||||
bool EQEmu::ItemData::CheckLoreConflict(const ItemData* l_item, const ItemData* r_item)
|
||||
bool EQ::ItemData::CheckLoreConflict(const ItemData* l_item, const ItemData* r_item)
|
||||
{
|
||||
if (!l_item || !r_item)
|
||||
return false;
|
||||
|
||||
+2
-1
@@ -47,7 +47,7 @@
|
||||
#include "emu_constants.h"
|
||||
|
||||
|
||||
namespace EQEmu
|
||||
namespace EQ
|
||||
{
|
||||
namespace item {
|
||||
enum ItemClass {
|
||||
@@ -434,6 +434,7 @@ namespace EQEmu
|
||||
//uint32 Unk054;
|
||||
int16 MaxCharges; // Maximum charges items can hold: -1 if not a chargeable item
|
||||
uint8 ItemType; // Item Type/Skill (itemClass* from above)
|
||||
int32 SubType; // Some items have sub types that can be used for other things (unbreakable fishing poles, SE_FFItemClass)
|
||||
uint8 Material; // Item material type
|
||||
uint32 HerosForgeModel;// Hero's Forge Armor Model Type (2-13?)
|
||||
float SellRate; // Sell rate
|
||||
|
||||
@@ -203,3 +203,4 @@ F(procname)
|
||||
F(wornname)
|
||||
F(focusname)
|
||||
F(scrollname)
|
||||
F(subtype)
|
||||
|
||||
+109
-109
@@ -54,9 +54,9 @@ static inline int32 GetNextItemInstSerialNumber() {
|
||||
}
|
||||
|
||||
//
|
||||
// class EQEmu::ItemInstance
|
||||
// class EQ::ItemInstance
|
||||
//
|
||||
EQEmu::ItemInstance::ItemInstance(const ItemData* item, int16 charges) {
|
||||
EQ::ItemInstance::ItemInstance(const ItemData* item, int16 charges) {
|
||||
m_use_type = ItemInstNormal;
|
||||
if(item) {
|
||||
m_item = new ItemData(*item);
|
||||
@@ -87,7 +87,7 @@ EQEmu::ItemInstance::ItemInstance(const ItemData* item, int16 charges) {
|
||||
m_new_id_file = 0;
|
||||
}
|
||||
|
||||
EQEmu::ItemInstance::ItemInstance(SharedDatabase *db, uint32 item_id, int16 charges) {
|
||||
EQ::ItemInstance::ItemInstance(SharedDatabase *db, uint32 item_id, int16 charges) {
|
||||
m_use_type = ItemInstNormal;
|
||||
m_item = db->GetItem(item_id);
|
||||
if(m_item) {
|
||||
@@ -121,7 +121,7 @@ EQEmu::ItemInstance::ItemInstance(SharedDatabase *db, uint32 item_id, int16 char
|
||||
m_new_id_file = 0;
|
||||
}
|
||||
|
||||
EQEmu::ItemInstance::ItemInstance(ItemInstTypes use_type) {
|
||||
EQ::ItemInstance::ItemInstance(ItemInstTypes use_type) {
|
||||
m_use_type = use_type;
|
||||
m_item = nullptr;
|
||||
m_charges = 0;
|
||||
@@ -143,8 +143,8 @@ EQEmu::ItemInstance::ItemInstance(ItemInstTypes use_type) {
|
||||
m_new_id_file = 0;
|
||||
}
|
||||
|
||||
// Make a copy of an EQEmu::ItemInstance object
|
||||
EQEmu::ItemInstance::ItemInstance(const ItemInstance& copy)
|
||||
// Make a copy of an EQ::ItemInstance object
|
||||
EQ::ItemInstance::ItemInstance(const ItemInstance& copy)
|
||||
{
|
||||
m_use_type=copy.m_use_type;
|
||||
if(copy.m_item)
|
||||
@@ -202,7 +202,7 @@ EQEmu::ItemInstance::ItemInstance(const ItemInstance& copy)
|
||||
}
|
||||
|
||||
// Clean up container contents
|
||||
EQEmu::ItemInstance::~ItemInstance()
|
||||
EQ::ItemInstance::~ItemInstance()
|
||||
{
|
||||
Clear();
|
||||
safe_delete(m_item);
|
||||
@@ -211,7 +211,7 @@ EQEmu::ItemInstance::~ItemInstance()
|
||||
}
|
||||
|
||||
// Query item type
|
||||
bool EQEmu::ItemInstance::IsType(item::ItemClass item_class) const
|
||||
bool EQ::ItemInstance::IsType(item::ItemClass item_class) const
|
||||
{
|
||||
// IsType(<ItemClassTypes>) does not protect against 'm_item = nullptr'
|
||||
|
||||
@@ -225,23 +225,23 @@ bool EQEmu::ItemInstance::IsType(item::ItemClass item_class) const
|
||||
return (m_item->ItemClass == item_class);
|
||||
}
|
||||
|
||||
bool EQEmu::ItemInstance::IsClassCommon() const
|
||||
bool EQ::ItemInstance::IsClassCommon() const
|
||||
{
|
||||
return (m_item && m_item->IsClassCommon());
|
||||
}
|
||||
|
||||
bool EQEmu::ItemInstance::IsClassBag() const
|
||||
bool EQ::ItemInstance::IsClassBag() const
|
||||
{
|
||||
return (m_item && m_item->IsClassBag());
|
||||
}
|
||||
|
||||
bool EQEmu::ItemInstance::IsClassBook() const
|
||||
bool EQ::ItemInstance::IsClassBook() const
|
||||
{
|
||||
return (m_item && m_item->IsClassBook());
|
||||
}
|
||||
|
||||
// Is item stackable?
|
||||
bool EQEmu::ItemInstance::IsStackable() const
|
||||
bool EQ::ItemInstance::IsStackable() const
|
||||
{
|
||||
if (!m_item)
|
||||
return false;
|
||||
@@ -249,7 +249,7 @@ bool EQEmu::ItemInstance::IsStackable() const
|
||||
return m_item->Stackable;
|
||||
}
|
||||
|
||||
bool EQEmu::ItemInstance::IsCharged() const
|
||||
bool EQ::ItemInstance::IsCharged() const
|
||||
{
|
||||
if (!m_item)
|
||||
return false;
|
||||
@@ -261,7 +261,7 @@ bool EQEmu::ItemInstance::IsCharged() const
|
||||
}
|
||||
|
||||
// Can item be equipped?
|
||||
bool EQEmu::ItemInstance::IsEquipable(uint16 race, uint16 class_) const
|
||||
bool EQ::ItemInstance::IsEquipable(uint16 race, uint16 class_) const
|
||||
{
|
||||
if (!m_item || (m_item->Slots == 0))
|
||||
return false;
|
||||
@@ -270,18 +270,18 @@ bool EQEmu::ItemInstance::IsEquipable(uint16 race, uint16 class_) const
|
||||
}
|
||||
|
||||
// Can equip at this slot?
|
||||
bool EQEmu::ItemInstance::IsEquipable(int16 slot_id) const
|
||||
bool EQ::ItemInstance::IsEquipable(int16 slot_id) const
|
||||
{
|
||||
if (!m_item)
|
||||
return false;
|
||||
|
||||
if (slot_id < EQEmu::invslot::EQUIPMENT_BEGIN || slot_id > EQEmu::invslot::EQUIPMENT_END)
|
||||
if (slot_id < EQ::invslot::EQUIPMENT_BEGIN || slot_id > EQ::invslot::EQUIPMENT_END)
|
||||
return false;
|
||||
|
||||
return ((m_item->Slots & (1 << slot_id)) != 0);
|
||||
}
|
||||
|
||||
bool EQEmu::ItemInstance::IsAugmentable() const
|
||||
bool EQ::ItemInstance::IsAugmentable() const
|
||||
{
|
||||
if (!m_item)
|
||||
return false;
|
||||
@@ -294,7 +294,7 @@ bool EQEmu::ItemInstance::IsAugmentable() const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool EQEmu::ItemInstance::AvailableWearSlot(uint32 aug_wear_slots) const {
|
||||
bool EQ::ItemInstance::AvailableWearSlot(uint32 aug_wear_slots) const {
|
||||
if (!m_item || !m_item->IsClassCommon())
|
||||
return false;
|
||||
|
||||
@@ -306,10 +306,10 @@ bool EQEmu::ItemInstance::AvailableWearSlot(uint32 aug_wear_slots) const {
|
||||
}
|
||||
}
|
||||
|
||||
return (index <= EQEmu::invslot::EQUIPMENT_END);
|
||||
return (index <= EQ::invslot::EQUIPMENT_END);
|
||||
}
|
||||
|
||||
int8 EQEmu::ItemInstance::AvailableAugmentSlot(int32 augtype) const
|
||||
int8 EQ::ItemInstance::AvailableAugmentSlot(int32 augtype) const
|
||||
{
|
||||
if (!m_item || !m_item->IsClassCommon())
|
||||
return INVALID_INDEX;
|
||||
@@ -324,7 +324,7 @@ int8 EQEmu::ItemInstance::AvailableAugmentSlot(int32 augtype) const
|
||||
return (index <= invaug::SOCKET_END) ? index : INVALID_INDEX;
|
||||
}
|
||||
|
||||
bool EQEmu::ItemInstance::IsAugmentSlotAvailable(int32 augtype, uint8 slot) const
|
||||
bool EQ::ItemInstance::IsAugmentSlotAvailable(int32 augtype, uint8 slot) const
|
||||
{
|
||||
if (!m_item || !m_item->IsClassCommon())
|
||||
return false;
|
||||
@@ -336,7 +336,7 @@ bool EQEmu::ItemInstance::IsAugmentSlotAvailable(int32 augtype, uint8 slot) cons
|
||||
}
|
||||
|
||||
// Retrieve item inside container
|
||||
EQEmu::ItemInstance* EQEmu::ItemInstance::GetItem(uint8 index) const
|
||||
EQ::ItemInstance* EQ::ItemInstance::GetItem(uint8 index) const
|
||||
{
|
||||
auto it = m_contents.find(index);
|
||||
if (it != m_contents.end()) {
|
||||
@@ -346,7 +346,7 @@ EQEmu::ItemInstance* EQEmu::ItemInstance::GetItem(uint8 index) const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32 EQEmu::ItemInstance::GetItemID(uint8 slot) const
|
||||
uint32 EQ::ItemInstance::GetItemID(uint8 slot) const
|
||||
{
|
||||
ItemInstance *item = GetItem(slot);
|
||||
if (item)
|
||||
@@ -355,7 +355,7 @@ uint32 EQEmu::ItemInstance::GetItemID(uint8 slot) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EQEmu::ItemInstance::PutItem(uint8 index, const ItemInstance& inst)
|
||||
void EQ::ItemInstance::PutItem(uint8 index, const ItemInstance& inst)
|
||||
{
|
||||
// Clean up item already in slot (if exists)
|
||||
DeleteItem(index);
|
||||
@@ -365,7 +365,7 @@ void EQEmu::ItemInstance::PutItem(uint8 index, const ItemInstance& inst)
|
||||
}
|
||||
|
||||
// Remove item inside container
|
||||
void EQEmu::ItemInstance::DeleteItem(uint8 index)
|
||||
void EQ::ItemInstance::DeleteItem(uint8 index)
|
||||
{
|
||||
ItemInstance* inst = PopItem(index);
|
||||
safe_delete(inst);
|
||||
@@ -373,7 +373,7 @@ void EQEmu::ItemInstance::DeleteItem(uint8 index)
|
||||
|
||||
// Remove item from container without memory delete
|
||||
// Hands over memory ownership to client of this function call
|
||||
EQEmu::ItemInstance* EQEmu::ItemInstance::PopItem(uint8 index)
|
||||
EQ::ItemInstance* EQ::ItemInstance::PopItem(uint8 index)
|
||||
{
|
||||
auto iter = m_contents.find(index);
|
||||
if (iter != m_contents.end()) {
|
||||
@@ -386,7 +386,7 @@ EQEmu::ItemInstance* EQEmu::ItemInstance::PopItem(uint8 index)
|
||||
}
|
||||
|
||||
// Remove all items from container
|
||||
void EQEmu::ItemInstance::Clear()
|
||||
void EQ::ItemInstance::Clear()
|
||||
{
|
||||
// Destroy container contents
|
||||
for (auto iter = m_contents.begin(); iter != m_contents.end(); ++iter) {
|
||||
@@ -396,7 +396,7 @@ void EQEmu::ItemInstance::Clear()
|
||||
}
|
||||
|
||||
// Remove all items from container
|
||||
void EQEmu::ItemInstance::ClearByFlags(byFlagSetting is_nodrop, byFlagSetting is_norent)
|
||||
void EQ::ItemInstance::ClearByFlags(byFlagSetting is_nodrop, byFlagSetting is_norent)
|
||||
{
|
||||
// TODO: This needs work...
|
||||
|
||||
@@ -458,7 +458,7 @@ void EQEmu::ItemInstance::ClearByFlags(byFlagSetting is_nodrop, byFlagSetting is
|
||||
}
|
||||
}
|
||||
|
||||
uint8 EQEmu::ItemInstance::FirstOpenSlot() const
|
||||
uint8 EQ::ItemInstance::FirstOpenSlot() const
|
||||
{
|
||||
if (!m_item)
|
||||
return INVALID_INDEX;
|
||||
@@ -472,7 +472,7 @@ uint8 EQEmu::ItemInstance::FirstOpenSlot() const
|
||||
return (i < slots) ? i : INVALID_INDEX;
|
||||
}
|
||||
|
||||
uint8 EQEmu::ItemInstance::GetTotalItemCount() const
|
||||
uint8 EQ::ItemInstance::GetTotalItemCount() const
|
||||
{
|
||||
if (!m_item)
|
||||
return 0;
|
||||
@@ -486,7 +486,7 @@ uint8 EQEmu::ItemInstance::GetTotalItemCount() const
|
||||
return item_count;
|
||||
}
|
||||
|
||||
bool EQEmu::ItemInstance::IsNoneEmptyContainer()
|
||||
bool EQ::ItemInstance::IsNoneEmptyContainer()
|
||||
{
|
||||
if (!m_item || !m_item->IsClassBag())
|
||||
return false;
|
||||
@@ -500,7 +500,7 @@ bool EQEmu::ItemInstance::IsNoneEmptyContainer()
|
||||
}
|
||||
|
||||
// Retrieve augment inside item
|
||||
EQEmu::ItemInstance* EQEmu::ItemInstance::GetAugment(uint8 slot) const
|
||||
EQ::ItemInstance* EQ::ItemInstance::GetAugment(uint8 slot) const
|
||||
{
|
||||
if (m_item && m_item->IsClassCommon())
|
||||
return GetItem(slot);
|
||||
@@ -508,7 +508,7 @@ EQEmu::ItemInstance* EQEmu::ItemInstance::GetAugment(uint8 slot) const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
EQEmu::ItemInstance* EQEmu::ItemInstance::GetOrnamentationAug(int32 ornamentationAugtype) const
|
||||
EQ::ItemInstance* EQ::ItemInstance::GetOrnamentationAug(int32 ornamentationAugtype) const
|
||||
{
|
||||
if (!m_item || !m_item->IsClassCommon()) { return nullptr; }
|
||||
if (ornamentationAugtype == 0) { return nullptr; }
|
||||
@@ -533,7 +533,7 @@ EQEmu::ItemInstance* EQEmu::ItemInstance::GetOrnamentationAug(int32 ornamentatio
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32 EQEmu::ItemInstance::GetOrnamentHeroModel(int32 material_slot) const {
|
||||
uint32 EQ::ItemInstance::GetOrnamentHeroModel(int32 material_slot) const {
|
||||
// Not a Hero Forge item.
|
||||
if (m_ornament_hero_model == 0 || material_slot < 0)
|
||||
return 0;
|
||||
@@ -546,7 +546,7 @@ uint32 EQEmu::ItemInstance::GetOrnamentHeroModel(int32 material_slot) const {
|
||||
return (m_ornament_hero_model * 100) + material_slot;
|
||||
}
|
||||
|
||||
bool EQEmu::ItemInstance::UpdateOrnamentationInfo() {
|
||||
bool EQ::ItemInstance::UpdateOrnamentationInfo() {
|
||||
if (!m_item || !m_item->IsClassCommon())
|
||||
return false;
|
||||
|
||||
@@ -582,7 +582,7 @@ bool EQEmu::ItemInstance::UpdateOrnamentationInfo() {
|
||||
return ornamentSet;
|
||||
}
|
||||
|
||||
bool EQEmu::ItemInstance::CanTransform(const ItemData *ItemToTry, const ItemData *Container, bool AllowAll) {
|
||||
bool EQ::ItemInstance::CanTransform(const ItemData *ItemToTry, const ItemData *Container, bool AllowAll) {
|
||||
if (!ItemToTry || !Container) return false;
|
||||
|
||||
if (ItemToTry->ItemType == item::ItemTypeArrow || strnlen(Container->CharmFile, 30) == 0)
|
||||
@@ -629,7 +629,7 @@ bool EQEmu::ItemInstance::CanTransform(const ItemData *ItemToTry, const ItemData
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 EQEmu::ItemInstance::GetAugmentItemID(uint8 slot) const
|
||||
uint32 EQ::ItemInstance::GetAugmentItemID(uint8 slot) const
|
||||
{
|
||||
if (!m_item || !m_item->IsClassCommon())
|
||||
return 0;
|
||||
@@ -638,7 +638,7 @@ uint32 EQEmu::ItemInstance::GetAugmentItemID(uint8 slot) const
|
||||
}
|
||||
|
||||
// Add an augment to the item
|
||||
void EQEmu::ItemInstance::PutAugment(uint8 slot, const ItemInstance& augment)
|
||||
void EQ::ItemInstance::PutAugment(uint8 slot, const ItemInstance& augment)
|
||||
{
|
||||
if (!m_item || !m_item->IsClassCommon())
|
||||
return;
|
||||
@@ -646,7 +646,7 @@ void EQEmu::ItemInstance::PutAugment(uint8 slot, const ItemInstance& augment)
|
||||
PutItem(slot, augment);
|
||||
}
|
||||
|
||||
void EQEmu::ItemInstance::PutAugment(SharedDatabase *db, uint8 slot, uint32 item_id)
|
||||
void EQ::ItemInstance::PutAugment(SharedDatabase *db, uint8 slot, uint32 item_id)
|
||||
{
|
||||
if (item_id == 0) { return; }
|
||||
if (db == nullptr) { return; /* TODO: add log message for nullptr */ }
|
||||
@@ -659,7 +659,7 @@ void EQEmu::ItemInstance::PutAugment(SharedDatabase *db, uint8 slot, uint32 item
|
||||
}
|
||||
|
||||
// Remove augment from item and destroy it
|
||||
void EQEmu::ItemInstance::DeleteAugment(uint8 index)
|
||||
void EQ::ItemInstance::DeleteAugment(uint8 index)
|
||||
{
|
||||
if (!m_item || !m_item->IsClassCommon())
|
||||
return;
|
||||
@@ -668,7 +668,7 @@ void EQEmu::ItemInstance::DeleteAugment(uint8 index)
|
||||
}
|
||||
|
||||
// Remove augment from item and return it
|
||||
EQEmu::ItemInstance* EQEmu::ItemInstance::RemoveAugment(uint8 index)
|
||||
EQ::ItemInstance* EQ::ItemInstance::RemoveAugment(uint8 index)
|
||||
{
|
||||
if (!m_item || !m_item->IsClassCommon())
|
||||
return nullptr;
|
||||
@@ -676,7 +676,7 @@ EQEmu::ItemInstance* EQEmu::ItemInstance::RemoveAugment(uint8 index)
|
||||
return PopItem(index);
|
||||
}
|
||||
|
||||
bool EQEmu::ItemInstance::IsAugmented()
|
||||
bool EQ::ItemInstance::IsAugmented()
|
||||
{
|
||||
if (!m_item || !m_item->IsClassCommon())
|
||||
return false;
|
||||
@@ -690,7 +690,7 @@ bool EQEmu::ItemInstance::IsAugmented()
|
||||
}
|
||||
|
||||
// Has attack/delay?
|
||||
bool EQEmu::ItemInstance::IsWeapon() const
|
||||
bool EQ::ItemInstance::IsWeapon() const
|
||||
{
|
||||
if (!m_item || !m_item->IsClassCommon())
|
||||
return false;
|
||||
@@ -701,7 +701,7 @@ bool EQEmu::ItemInstance::IsWeapon() const
|
||||
return ((m_item->Damage != 0) && (m_item->Delay != 0));
|
||||
}
|
||||
|
||||
bool EQEmu::ItemInstance::IsAmmo() const
|
||||
bool EQ::ItemInstance::IsAmmo() const
|
||||
{
|
||||
if (!m_item)
|
||||
return false;
|
||||
@@ -717,7 +717,7 @@ bool EQEmu::ItemInstance::IsAmmo() const
|
||||
|
||||
}
|
||||
|
||||
const EQEmu::ItemData* EQEmu::ItemInstance::GetItem() const
|
||||
const EQ::ItemData* EQ::ItemInstance::GetItem() const
|
||||
{
|
||||
if (!m_item)
|
||||
return nullptr;
|
||||
@@ -728,13 +728,13 @@ const EQEmu::ItemData* EQEmu::ItemInstance::GetItem() const
|
||||
return m_item;
|
||||
}
|
||||
|
||||
const EQEmu::ItemData* EQEmu::ItemInstance::GetUnscaledItem() const
|
||||
const EQ::ItemData* EQ::ItemInstance::GetUnscaledItem() const
|
||||
{
|
||||
// No operator calls and defaults to nullptr
|
||||
return m_item;
|
||||
}
|
||||
|
||||
std::string EQEmu::ItemInstance::GetCustomDataString() const {
|
||||
std::string EQ::ItemInstance::GetCustomDataString() const {
|
||||
std::string ret_val;
|
||||
auto iter = m_custom_data.begin();
|
||||
while (iter != m_custom_data.end()) {
|
||||
@@ -753,7 +753,7 @@ std::string EQEmu::ItemInstance::GetCustomDataString() const {
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
std::string EQEmu::ItemInstance::GetCustomData(std::string identifier) {
|
||||
std::string EQ::ItemInstance::GetCustomData(std::string identifier) {
|
||||
std::map<std::string, std::string>::const_iterator iter = m_custom_data.find(identifier);
|
||||
if (iter != m_custom_data.end()) {
|
||||
return iter->second;
|
||||
@@ -762,49 +762,49 @@ std::string EQEmu::ItemInstance::GetCustomData(std::string identifier) {
|
||||
return "";
|
||||
}
|
||||
|
||||
void EQEmu::ItemInstance::SetCustomData(std::string identifier, std::string value) {
|
||||
void EQ::ItemInstance::SetCustomData(std::string identifier, std::string value) {
|
||||
DeleteCustomData(identifier);
|
||||
m_custom_data[identifier] = value;
|
||||
}
|
||||
|
||||
void EQEmu::ItemInstance::SetCustomData(std::string identifier, int value) {
|
||||
void EQ::ItemInstance::SetCustomData(std::string identifier, int value) {
|
||||
DeleteCustomData(identifier);
|
||||
std::stringstream ss;
|
||||
ss << value;
|
||||
m_custom_data[identifier] = ss.str();
|
||||
}
|
||||
|
||||
void EQEmu::ItemInstance::SetCustomData(std::string identifier, float value) {
|
||||
void EQ::ItemInstance::SetCustomData(std::string identifier, float value) {
|
||||
DeleteCustomData(identifier);
|
||||
std::stringstream ss;
|
||||
ss << value;
|
||||
m_custom_data[identifier] = ss.str();
|
||||
}
|
||||
|
||||
void EQEmu::ItemInstance::SetCustomData(std::string identifier, bool value) {
|
||||
void EQ::ItemInstance::SetCustomData(std::string identifier, bool value) {
|
||||
DeleteCustomData(identifier);
|
||||
std::stringstream ss;
|
||||
ss << value;
|
||||
m_custom_data[identifier] = ss.str();
|
||||
}
|
||||
|
||||
void EQEmu::ItemInstance::DeleteCustomData(std::string identifier) {
|
||||
void EQ::ItemInstance::DeleteCustomData(std::string identifier) {
|
||||
auto iter = m_custom_data.find(identifier);
|
||||
if (iter != m_custom_data.end()) {
|
||||
m_custom_data.erase(iter);
|
||||
}
|
||||
}
|
||||
|
||||
// Clone a type of EQEmu::ItemInstance object
|
||||
// Clone a type of EQ::ItemInstance object
|
||||
// c++ doesn't allow a polymorphic copy constructor,
|
||||
// so we have to resort to a polymorphic Clone()
|
||||
EQEmu::ItemInstance* EQEmu::ItemInstance::Clone() const
|
||||
EQ::ItemInstance* EQ::ItemInstance::Clone() const
|
||||
{
|
||||
// Pseudo-polymorphic copy constructor
|
||||
return new ItemInstance(*this);
|
||||
}
|
||||
|
||||
bool EQEmu::ItemInstance::IsSlotAllowed(int16 slot_id) const {
|
||||
bool EQ::ItemInstance::IsSlotAllowed(int16 slot_id) const {
|
||||
if (!m_item) { return false; }
|
||||
else if (InventoryProfile::SupportsContainers(slot_id)) { return true; }
|
||||
else if (m_item->Slots & (1 << slot_id)) { return true; }
|
||||
@@ -812,7 +812,7 @@ bool EQEmu::ItemInstance::IsSlotAllowed(int16 slot_id) const {
|
||||
else { return false; }
|
||||
}
|
||||
|
||||
bool EQEmu::ItemInstance::IsDroppable(bool recurse) const
|
||||
bool EQ::ItemInstance::IsDroppable(bool recurse) const
|
||||
{
|
||||
if (!m_item)
|
||||
return false;
|
||||
@@ -838,7 +838,7 @@ bool EQEmu::ItemInstance::IsDroppable(bool recurse) const
|
||||
return true;
|
||||
}
|
||||
|
||||
void EQEmu::ItemInstance::Initialize(SharedDatabase *db) {
|
||||
void EQ::ItemInstance::Initialize(SharedDatabase *db) {
|
||||
// if there's no actual item, don't do anything
|
||||
if (!m_item)
|
||||
return;
|
||||
@@ -855,7 +855,7 @@ void EQEmu::ItemInstance::Initialize(SharedDatabase *db) {
|
||||
}
|
||||
}
|
||||
|
||||
void EQEmu::ItemInstance::ScaleItem() {
|
||||
void EQ::ItemInstance::ScaleItem() {
|
||||
if (!m_item)
|
||||
return;
|
||||
|
||||
@@ -939,18 +939,18 @@ void EQEmu::ItemInstance::ScaleItem() {
|
||||
m_scaledItem->CharmFileID = 0; // this stops the client from trying to scale the item itself.
|
||||
}
|
||||
|
||||
bool EQEmu::ItemInstance::EvolveOnAllKills() const {
|
||||
bool EQ::ItemInstance::EvolveOnAllKills() const {
|
||||
return (m_evolveInfo && m_evolveInfo->AllKills);
|
||||
}
|
||||
|
||||
int8 EQEmu::ItemInstance::GetMaxEvolveLvl() const {
|
||||
int8 EQ::ItemInstance::GetMaxEvolveLvl() const {
|
||||
if (m_evolveInfo)
|
||||
return m_evolveInfo->MaxLvl;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32 EQEmu::ItemInstance::GetKillsNeeded(uint8 currentlevel) {
|
||||
uint32 EQ::ItemInstance::GetKillsNeeded(uint8 currentlevel) {
|
||||
uint32 kills = -1; // default to -1 (max uint32 value) because this value is usually divided by, so we don't want to ever return zero.
|
||||
if (m_evolveInfo)
|
||||
if (currentlevel != m_evolveInfo->MaxLvl)
|
||||
@@ -962,24 +962,24 @@ uint32 EQEmu::ItemInstance::GetKillsNeeded(uint8 currentlevel) {
|
||||
return kills;
|
||||
}
|
||||
|
||||
void EQEmu::ItemInstance::SetTimer(std::string name, uint32 time) {
|
||||
void EQ::ItemInstance::SetTimer(std::string name, uint32 time) {
|
||||
Timer t(time);
|
||||
t.Start(time, false);
|
||||
m_timers[name] = t;
|
||||
}
|
||||
|
||||
void EQEmu::ItemInstance::StopTimer(std::string name) {
|
||||
void EQ::ItemInstance::StopTimer(std::string name) {
|
||||
auto iter = m_timers.find(name);
|
||||
if(iter != m_timers.end()) {
|
||||
m_timers.erase(iter);
|
||||
}
|
||||
}
|
||||
|
||||
void EQEmu::ItemInstance::ClearTimers() {
|
||||
void EQ::ItemInstance::ClearTimers() {
|
||||
m_timers.clear();
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemArmorClass(bool augments) const
|
||||
int EQ::ItemInstance::GetItemArmorClass(bool augments) const
|
||||
{
|
||||
int ac = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -993,7 +993,7 @@ int EQEmu::ItemInstance::GetItemArmorClass(bool augments) const
|
||||
return ac;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemElementalDamage(int &magic, int &fire, int &cold, int &poison, int &disease, int &chromatic, int &prismatic, int &physical, int &corruption, bool augments) const
|
||||
int EQ::ItemInstance::GetItemElementalDamage(int &magic, int &fire, int &cold, int &poison, int &disease, int &chromatic, int &prismatic, int &physical, int &corruption, bool augments) const
|
||||
{
|
||||
const auto item = GetItem();
|
||||
if (item) {
|
||||
@@ -1035,7 +1035,7 @@ int EQEmu::ItemInstance::GetItemElementalDamage(int &magic, int &fire, int &cold
|
||||
return magic + fire + cold + poison + disease + chromatic + prismatic + physical + corruption;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemElementalFlag(bool augments) const
|
||||
int EQ::ItemInstance::GetItemElementalFlag(bool augments) const
|
||||
{
|
||||
int flag = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1056,7 +1056,7 @@ int EQEmu::ItemInstance::GetItemElementalFlag(bool augments) const
|
||||
return flag;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemElementalDamage(bool augments) const
|
||||
int EQ::ItemInstance::GetItemElementalDamage(bool augments) const
|
||||
{
|
||||
int damage = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1077,7 +1077,7 @@ int EQEmu::ItemInstance::GetItemElementalDamage(bool augments) const
|
||||
return damage;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemRecommendedLevel(bool augments) const
|
||||
int EQ::ItemInstance::GetItemRecommendedLevel(bool augments) const
|
||||
{
|
||||
int level = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1099,7 +1099,7 @@ int EQEmu::ItemInstance::GetItemRecommendedLevel(bool augments) const
|
||||
return level;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemRequiredLevel(bool augments) const
|
||||
int EQ::ItemInstance::GetItemRequiredLevel(bool augments) const
|
||||
{
|
||||
int level = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1121,7 +1121,7 @@ int EQEmu::ItemInstance::GetItemRequiredLevel(bool augments) const
|
||||
return level;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemWeaponDamage(bool augments) const
|
||||
int EQ::ItemInstance::GetItemWeaponDamage(bool augments) const
|
||||
{
|
||||
int damage = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1137,7 +1137,7 @@ int EQEmu::ItemInstance::GetItemWeaponDamage(bool augments) const
|
||||
return damage;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemBackstabDamage(bool augments) const
|
||||
int EQ::ItemInstance::GetItemBackstabDamage(bool augments) const
|
||||
{
|
||||
int damage = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1153,7 +1153,7 @@ int EQEmu::ItemInstance::GetItemBackstabDamage(bool augments) const
|
||||
return damage;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemBaneDamageBody(bool augments) const
|
||||
int EQ::ItemInstance::GetItemBaneDamageBody(bool augments) const
|
||||
{
|
||||
int body = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1174,7 +1174,7 @@ int EQEmu::ItemInstance::GetItemBaneDamageBody(bool augments) const
|
||||
return body;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemBaneDamageRace(bool augments) const
|
||||
int EQ::ItemInstance::GetItemBaneDamageRace(bool augments) const
|
||||
{
|
||||
int race = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1195,7 +1195,7 @@ int EQEmu::ItemInstance::GetItemBaneDamageRace(bool augments) const
|
||||
return race;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemBaneDamageBody(bodyType against, bool augments) const
|
||||
int EQ::ItemInstance::GetItemBaneDamageBody(bodyType against, bool augments) const
|
||||
{
|
||||
int damage = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1212,7 +1212,7 @@ int EQEmu::ItemInstance::GetItemBaneDamageBody(bodyType against, bool augments)
|
||||
return damage;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemBaneDamageRace(uint16 against, bool augments) const
|
||||
int EQ::ItemInstance::GetItemBaneDamageRace(uint16 against, bool augments) const
|
||||
{
|
||||
int damage = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1229,7 +1229,7 @@ int EQEmu::ItemInstance::GetItemBaneDamageRace(uint16 against, bool augments) co
|
||||
return damage;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemMagical(bool augments) const
|
||||
int EQ::ItemInstance::GetItemMagical(bool augments) const
|
||||
{
|
||||
const auto item = GetItem();
|
||||
if (item) {
|
||||
@@ -1245,7 +1245,7 @@ int EQEmu::ItemInstance::GetItemMagical(bool augments) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemHP(bool augments) const
|
||||
int EQ::ItemInstance::GetItemHP(bool augments) const
|
||||
{
|
||||
int hp = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1259,7 +1259,7 @@ int EQEmu::ItemInstance::GetItemHP(bool augments) const
|
||||
return hp;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemMana(bool augments) const
|
||||
int EQ::ItemInstance::GetItemMana(bool augments) const
|
||||
{
|
||||
int mana = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1273,7 +1273,7 @@ int EQEmu::ItemInstance::GetItemMana(bool augments) const
|
||||
return mana;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemEndur(bool augments) const
|
||||
int EQ::ItemInstance::GetItemEndur(bool augments) const
|
||||
{
|
||||
int endur = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1287,7 +1287,7 @@ int EQEmu::ItemInstance::GetItemEndur(bool augments) const
|
||||
return endur;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemAttack(bool augments) const
|
||||
int EQ::ItemInstance::GetItemAttack(bool augments) const
|
||||
{
|
||||
int atk = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1301,7 +1301,7 @@ int EQEmu::ItemInstance::GetItemAttack(bool augments) const
|
||||
return atk;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemStr(bool augments) const
|
||||
int EQ::ItemInstance::GetItemStr(bool augments) const
|
||||
{
|
||||
int str = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1315,7 +1315,7 @@ int EQEmu::ItemInstance::GetItemStr(bool augments) const
|
||||
return str;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemSta(bool augments) const
|
||||
int EQ::ItemInstance::GetItemSta(bool augments) const
|
||||
{
|
||||
int sta = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1329,7 +1329,7 @@ int EQEmu::ItemInstance::GetItemSta(bool augments) const
|
||||
return sta;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemDex(bool augments) const
|
||||
int EQ::ItemInstance::GetItemDex(bool augments) const
|
||||
{
|
||||
int total = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1343,7 +1343,7 @@ int EQEmu::ItemInstance::GetItemDex(bool augments) const
|
||||
return total;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemAgi(bool augments) const
|
||||
int EQ::ItemInstance::GetItemAgi(bool augments) const
|
||||
{
|
||||
int total = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1357,7 +1357,7 @@ int EQEmu::ItemInstance::GetItemAgi(bool augments) const
|
||||
return total;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemInt(bool augments) const
|
||||
int EQ::ItemInstance::GetItemInt(bool augments) const
|
||||
{
|
||||
int total = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1371,7 +1371,7 @@ int EQEmu::ItemInstance::GetItemInt(bool augments) const
|
||||
return total;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemWis(bool augments) const
|
||||
int EQ::ItemInstance::GetItemWis(bool augments) const
|
||||
{
|
||||
int total = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1385,7 +1385,7 @@ int EQEmu::ItemInstance::GetItemWis(bool augments) const
|
||||
return total;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemCha(bool augments) const
|
||||
int EQ::ItemInstance::GetItemCha(bool augments) const
|
||||
{
|
||||
int total = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1399,7 +1399,7 @@ int EQEmu::ItemInstance::GetItemCha(bool augments) const
|
||||
return total;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemMR(bool augments) const
|
||||
int EQ::ItemInstance::GetItemMR(bool augments) const
|
||||
{
|
||||
int total = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1413,7 +1413,7 @@ int EQEmu::ItemInstance::GetItemMR(bool augments) const
|
||||
return total;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemFR(bool augments) const
|
||||
int EQ::ItemInstance::GetItemFR(bool augments) const
|
||||
{
|
||||
int total = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1427,7 +1427,7 @@ int EQEmu::ItemInstance::GetItemFR(bool augments) const
|
||||
return total;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemCR(bool augments) const
|
||||
int EQ::ItemInstance::GetItemCR(bool augments) const
|
||||
{
|
||||
int total = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1441,7 +1441,7 @@ int EQEmu::ItemInstance::GetItemCR(bool augments) const
|
||||
return total;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemPR(bool augments) const
|
||||
int EQ::ItemInstance::GetItemPR(bool augments) const
|
||||
{
|
||||
int total = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1455,7 +1455,7 @@ int EQEmu::ItemInstance::GetItemPR(bool augments) const
|
||||
return total;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemDR(bool augments) const
|
||||
int EQ::ItemInstance::GetItemDR(bool augments) const
|
||||
{
|
||||
int total = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1469,7 +1469,7 @@ int EQEmu::ItemInstance::GetItemDR(bool augments) const
|
||||
return total;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemCorrup(bool augments) const
|
||||
int EQ::ItemInstance::GetItemCorrup(bool augments) const
|
||||
{
|
||||
int total = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1483,7 +1483,7 @@ int EQEmu::ItemInstance::GetItemCorrup(bool augments) const
|
||||
return total;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemHeroicStr(bool augments) const
|
||||
int EQ::ItemInstance::GetItemHeroicStr(bool augments) const
|
||||
{
|
||||
int total = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1497,7 +1497,7 @@ int EQEmu::ItemInstance::GetItemHeroicStr(bool augments) const
|
||||
return total;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemHeroicSta(bool augments) const
|
||||
int EQ::ItemInstance::GetItemHeroicSta(bool augments) const
|
||||
{
|
||||
int total = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1511,7 +1511,7 @@ int EQEmu::ItemInstance::GetItemHeroicSta(bool augments) const
|
||||
return total;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemHeroicDex(bool augments) const
|
||||
int EQ::ItemInstance::GetItemHeroicDex(bool augments) const
|
||||
{
|
||||
int total = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1525,7 +1525,7 @@ int EQEmu::ItemInstance::GetItemHeroicDex(bool augments) const
|
||||
return total;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemHeroicAgi(bool augments) const
|
||||
int EQ::ItemInstance::GetItemHeroicAgi(bool augments) const
|
||||
{
|
||||
int total = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1539,7 +1539,7 @@ int EQEmu::ItemInstance::GetItemHeroicAgi(bool augments) const
|
||||
return total;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemHeroicInt(bool augments) const
|
||||
int EQ::ItemInstance::GetItemHeroicInt(bool augments) const
|
||||
{
|
||||
int total = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1553,7 +1553,7 @@ int EQEmu::ItemInstance::GetItemHeroicInt(bool augments) const
|
||||
return total;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemHeroicWis(bool augments) const
|
||||
int EQ::ItemInstance::GetItemHeroicWis(bool augments) const
|
||||
{
|
||||
int total = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1567,7 +1567,7 @@ int EQEmu::ItemInstance::GetItemHeroicWis(bool augments) const
|
||||
return total;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemHeroicCha(bool augments) const
|
||||
int EQ::ItemInstance::GetItemHeroicCha(bool augments) const
|
||||
{
|
||||
int total = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1581,7 +1581,7 @@ int EQEmu::ItemInstance::GetItemHeroicCha(bool augments) const
|
||||
return total;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemHeroicMR(bool augments) const
|
||||
int EQ::ItemInstance::GetItemHeroicMR(bool augments) const
|
||||
{
|
||||
int total = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1595,7 +1595,7 @@ int EQEmu::ItemInstance::GetItemHeroicMR(bool augments) const
|
||||
return total;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemHeroicFR(bool augments) const
|
||||
int EQ::ItemInstance::GetItemHeroicFR(bool augments) const
|
||||
{
|
||||
int total = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1609,7 +1609,7 @@ int EQEmu::ItemInstance::GetItemHeroicFR(bool augments) const
|
||||
return total;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemHeroicCR(bool augments) const
|
||||
int EQ::ItemInstance::GetItemHeroicCR(bool augments) const
|
||||
{
|
||||
int total = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1623,7 +1623,7 @@ int EQEmu::ItemInstance::GetItemHeroicCR(bool augments) const
|
||||
return total;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemHeroicPR(bool augments) const
|
||||
int EQ::ItemInstance::GetItemHeroicPR(bool augments) const
|
||||
{
|
||||
int total = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1637,7 +1637,7 @@ int EQEmu::ItemInstance::GetItemHeroicPR(bool augments) const
|
||||
return total;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemHeroicDR(bool augments) const
|
||||
int EQ::ItemInstance::GetItemHeroicDR(bool augments) const
|
||||
{
|
||||
int total = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1651,7 +1651,7 @@ int EQEmu::ItemInstance::GetItemHeroicDR(bool augments) const
|
||||
return total;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemHeroicCorrup(bool augments) const
|
||||
int EQ::ItemInstance::GetItemHeroicCorrup(bool augments) const
|
||||
{
|
||||
int total = 0;
|
||||
const auto item = GetItem();
|
||||
@@ -1665,7 +1665,7 @@ int EQEmu::ItemInstance::GetItemHeroicCorrup(bool augments) const
|
||||
return total;
|
||||
}
|
||||
|
||||
int EQEmu::ItemInstance::GetItemHaste(bool augments) const
|
||||
int EQ::ItemInstance::GetItemHaste(bool augments) const
|
||||
{
|
||||
int total = 0;
|
||||
const auto item = GetItem();
|
||||
|
||||
@@ -38,7 +38,7 @@ class EvolveInfo; // Stores information about an evolving item family
|
||||
#include <map>
|
||||
|
||||
|
||||
// Specifies usage type for item inside EQEmu::ItemInstance
|
||||
// Specifies usage type for item inside EQ::ItemInstance
|
||||
enum ItemInstTypes
|
||||
{
|
||||
ItemInstNormal = 0,
|
||||
@@ -54,11 +54,11 @@ typedef enum {
|
||||
class SharedDatabase;
|
||||
|
||||
// ########################################
|
||||
// Class: EQEmu::ItemInstance
|
||||
// Class: EQ::ItemInstance
|
||||
// Base class for an instance of an item
|
||||
// An item instance encapsulates item data + data specific
|
||||
// to an item instance (includes dye, augments, charges, etc)
|
||||
namespace EQEmu
|
||||
namespace EQ
|
||||
{
|
||||
class InventoryProfile;
|
||||
|
||||
@@ -222,7 +222,7 @@ namespace EQEmu
|
||||
inline int32 GetSerialNumber() const { return m_SerialNumber; }
|
||||
inline void SetSerialNumber(int32 id) { m_SerialNumber = id; }
|
||||
|
||||
std::map<std::string, Timer>& GetTimers() { return m_timers; }
|
||||
std::map<std::string, ::Timer>& GetTimers() { return m_timers; }
|
||||
void SetTimer(std::string name, uint32 time);
|
||||
void StopTimer(std::string name);
|
||||
void ClearTimers();
|
||||
@@ -316,13 +316,13 @@ namespace EQEmu
|
||||
// Items inside of this item (augs or contents);
|
||||
std::map<uint8, ItemInstance*> m_contents; // Zero-based index: min=0, max=9
|
||||
std::map<std::string, std::string> m_custom_data;
|
||||
std::map<std::string, Timer> m_timers;
|
||||
std::map<std::string, ::Timer> m_timers;
|
||||
};
|
||||
}
|
||||
|
||||
class EvolveInfo {
|
||||
public:
|
||||
friend class EQEmu::ItemInstance;
|
||||
friend class EQ::ItemInstance;
|
||||
//temporary
|
||||
uint16 LvlKills[9];
|
||||
uint32 FirstItem;
|
||||
|
||||
@@ -5277,7 +5277,7 @@ void StreamWriterBuilder::setDefaults(Json::Value* settings)
|
||||
{
|
||||
//! [StreamWriterBuilderDefaults]
|
||||
(*settings)["commentStyle"] = "All";
|
||||
(*settings)["indentation"] = "\t";
|
||||
(*settings)["indentation"] = " ";
|
||||
(*settings)["enableYAMLCompatibility"] = false;
|
||||
(*settings)["dropNullPlaceholders"] = false;
|
||||
(*settings)["useSpecialFloats"] = false;
|
||||
|
||||
@@ -32,7 +32,7 @@ EQ::JsonConfigFile EQ::JsonConfigFile::Load(
|
||||
try {
|
||||
ifs >> ret.m_root;
|
||||
}
|
||||
catch (std::exception) {
|
||||
catch (std::exception &) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ std::string EQ::JsonConfigFile::GetVariableString(
|
||||
return m_root[title][parameter].asString();
|
||||
}
|
||||
}
|
||||
catch (std::exception) {
|
||||
catch (std::exception &) {
|
||||
return default_value;
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ int EQ::JsonConfigFile::GetVariableInt(
|
||||
return m_root[title][parameter].asInt();
|
||||
}
|
||||
}
|
||||
catch (std::exception) {
|
||||
catch (std::exception &) {
|
||||
return default_value;
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ bool EQ::JsonConfigFile::GetVariableBool(
|
||||
return m_root[title][parameter].asBool();
|
||||
}
|
||||
}
|
||||
catch (std::exception) {
|
||||
catch (std::exception &) {
|
||||
return default_value;
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ double EQ::JsonConfigFile::GetVariableDouble(
|
||||
return m_root[title][parameter].asDouble();
|
||||
}
|
||||
}
|
||||
catch (std::exception) {
|
||||
catch (std::exception &) {
|
||||
return default_value;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <string.h>
|
||||
|
||||
|
||||
uint8 EQEmu::lightsource::TypeToLevel(uint8 light_type)
|
||||
uint8 EQ::lightsource::TypeToLevel(uint8 light_type)
|
||||
{
|
||||
switch (light_type) {
|
||||
case LightTypeGlobeOfStars:
|
||||
@@ -55,7 +55,7 @@ uint8 EQEmu::lightsource::TypeToLevel(uint8 light_type)
|
||||
}
|
||||
}
|
||||
|
||||
bool EQEmu::lightsource::IsLevelGreater(uint8 left_type, uint8 right_type)
|
||||
bool EQ::lightsource::IsLevelGreater(uint8 left_type, uint8 right_type)
|
||||
{
|
||||
static const uint8 light_levels[LightTypeCount] = {
|
||||
LightLevelUnlit, /* LightTypeNone */
|
||||
@@ -82,17 +82,17 @@ bool EQEmu::lightsource::IsLevelGreater(uint8 left_type, uint8 right_type)
|
||||
return (light_levels[left_type] > light_levels[right_type]);
|
||||
}
|
||||
|
||||
EQEmu::LightSource_Struct::LightSource_Struct()
|
||||
EQ::LightSource_Struct::LightSource_Struct()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
void EQEmu::LightSource_Struct::Clear()
|
||||
void EQ::LightSource_Struct::Clear()
|
||||
{
|
||||
memset(&Slot, 0, (sizeof(uint8) * lightsource::LightCount));
|
||||
}
|
||||
|
||||
void EQEmu::LightSourceProfile::Clear()
|
||||
void EQ::LightSourceProfile::Clear()
|
||||
{
|
||||
Type.Clear();
|
||||
Level.Clear();
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "types.h"
|
||||
|
||||
|
||||
namespace EQEmu
|
||||
namespace EQ
|
||||
{
|
||||
namespace lightsource {
|
||||
enum LightSlot {
|
||||
|
||||
@@ -278,12 +278,6 @@ void LinkedListIterator<TYPE>::Replace(const TYPE& new_data)
|
||||
template<class TYPE>
|
||||
void LinkedListIterator<TYPE>::Reset()
|
||||
{
|
||||
if (!(&list))
|
||||
{
|
||||
current_element=0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (dir == FORWARD)
|
||||
{
|
||||
current_element = list.first;
|
||||
|
||||
+24
-24
@@ -20,7 +20,7 @@
|
||||
#include "memory_buffer.h"
|
||||
|
||||
|
||||
EQEmu::MemoryBuffer::MemoryBuffer()
|
||||
EQ::MemoryBuffer::MemoryBuffer()
|
||||
{
|
||||
buffer_ = nullptr;
|
||||
size_ = 0;
|
||||
@@ -29,7 +29,7 @@ EQEmu::MemoryBuffer::MemoryBuffer()
|
||||
write_pos_ = 0;
|
||||
}
|
||||
|
||||
EQEmu::MemoryBuffer::MemoryBuffer(size_t sz)
|
||||
EQ::MemoryBuffer::MemoryBuffer(size_t sz)
|
||||
{
|
||||
buffer_ = nullptr;
|
||||
size_ = 0;
|
||||
@@ -39,7 +39,7 @@ EQEmu::MemoryBuffer::MemoryBuffer(size_t sz)
|
||||
Resize(sz);
|
||||
}
|
||||
|
||||
EQEmu::MemoryBuffer::MemoryBuffer(const MemoryBuffer &other)
|
||||
EQ::MemoryBuffer::MemoryBuffer(const MemoryBuffer &other)
|
||||
{
|
||||
if(other.capacity_) {
|
||||
buffer_ = new uchar[other.capacity_];
|
||||
@@ -54,7 +54,7 @@ EQEmu::MemoryBuffer::MemoryBuffer(const MemoryBuffer &other)
|
||||
read_pos_ = other.read_pos_;
|
||||
}
|
||||
|
||||
EQEmu::MemoryBuffer::MemoryBuffer(MemoryBuffer &&other)
|
||||
EQ::MemoryBuffer::MemoryBuffer(MemoryBuffer &&other)
|
||||
{
|
||||
uchar *tbuf = other.buffer_;
|
||||
size_t tsz = other.size_;
|
||||
@@ -75,7 +75,7 @@ EQEmu::MemoryBuffer::MemoryBuffer(MemoryBuffer &&other)
|
||||
read_pos_ = tread_pos;
|
||||
}
|
||||
|
||||
EQEmu::MemoryBuffer& EQEmu::MemoryBuffer::operator=(const MemoryBuffer &other)
|
||||
EQ::MemoryBuffer& EQ::MemoryBuffer::operator=(const MemoryBuffer &other)
|
||||
{
|
||||
if(this == &other) {
|
||||
return *this;
|
||||
@@ -100,7 +100,7 @@ EQEmu::MemoryBuffer& EQEmu::MemoryBuffer::operator=(const MemoryBuffer &other)
|
||||
return *this;
|
||||
}
|
||||
|
||||
EQEmu::MemoryBuffer& EQEmu::MemoryBuffer::operator=(MemoryBuffer &&other)
|
||||
EQ::MemoryBuffer& EQ::MemoryBuffer::operator=(MemoryBuffer &&other)
|
||||
{
|
||||
uchar *tbuf = other.buffer_;
|
||||
size_t tsz = other.size_;
|
||||
@@ -122,7 +122,7 @@ EQEmu::MemoryBuffer& EQEmu::MemoryBuffer::operator=(MemoryBuffer &&other)
|
||||
return *this;
|
||||
}
|
||||
|
||||
EQEmu::MemoryBuffer& EQEmu::MemoryBuffer::operator+=(const MemoryBuffer &rhs)
|
||||
EQ::MemoryBuffer& EQ::MemoryBuffer::operator+=(const MemoryBuffer &rhs)
|
||||
{
|
||||
if(!rhs.buffer_) {
|
||||
return *this;
|
||||
@@ -142,52 +142,52 @@ EQEmu::MemoryBuffer& EQEmu::MemoryBuffer::operator+=(const MemoryBuffer &rhs)
|
||||
return *this;
|
||||
}
|
||||
|
||||
EQEmu::MemoryBuffer::~MemoryBuffer()
|
||||
EQ::MemoryBuffer::~MemoryBuffer()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
uchar& EQEmu::MemoryBuffer::operator[](size_t pos)
|
||||
uchar& EQ::MemoryBuffer::operator[](size_t pos)
|
||||
{
|
||||
return buffer_[pos];
|
||||
}
|
||||
|
||||
const uchar& EQEmu::MemoryBuffer::operator[](size_t pos) const
|
||||
const uchar& EQ::MemoryBuffer::operator[](size_t pos) const
|
||||
{
|
||||
return buffer_[pos];
|
||||
}
|
||||
|
||||
bool EQEmu::MemoryBuffer::Empty()
|
||||
bool EQ::MemoryBuffer::Empty()
|
||||
{
|
||||
return size_ == 0;
|
||||
}
|
||||
|
||||
bool EQEmu::MemoryBuffer::Empty() const
|
||||
bool EQ::MemoryBuffer::Empty() const
|
||||
{
|
||||
return size_ == 0;
|
||||
}
|
||||
|
||||
size_t EQEmu::MemoryBuffer::Size()
|
||||
size_t EQ::MemoryBuffer::Size()
|
||||
{
|
||||
return size_;
|
||||
}
|
||||
|
||||
size_t EQEmu::MemoryBuffer::Size() const
|
||||
size_t EQ::MemoryBuffer::Size() const
|
||||
{
|
||||
return size_;
|
||||
}
|
||||
|
||||
size_t EQEmu::MemoryBuffer::Capacity()
|
||||
size_t EQ::MemoryBuffer::Capacity()
|
||||
{
|
||||
return capacity_;
|
||||
}
|
||||
|
||||
size_t EQEmu::MemoryBuffer::Capacity() const
|
||||
size_t EQ::MemoryBuffer::Capacity() const
|
||||
{
|
||||
return capacity_;
|
||||
}
|
||||
|
||||
void EQEmu::MemoryBuffer::Resize(size_t sz)
|
||||
void EQ::MemoryBuffer::Resize(size_t sz)
|
||||
{
|
||||
if(!buffer_) {
|
||||
size_t new_size = sz + 64;
|
||||
@@ -213,7 +213,7 @@ void EQEmu::MemoryBuffer::Resize(size_t sz)
|
||||
}
|
||||
}
|
||||
|
||||
void EQEmu::MemoryBuffer::Clear()
|
||||
void EQ::MemoryBuffer::Clear()
|
||||
{
|
||||
if(buffer_) {
|
||||
delete[] buffer_;
|
||||
@@ -226,14 +226,14 @@ void EQEmu::MemoryBuffer::Clear()
|
||||
read_pos_ = 0;
|
||||
}
|
||||
|
||||
void EQEmu::MemoryBuffer::Zero()
|
||||
void EQ::MemoryBuffer::Zero()
|
||||
{
|
||||
if(buffer_) {
|
||||
memset(buffer_, 0, capacity_);
|
||||
}
|
||||
}
|
||||
|
||||
void EQEmu::MemoryBuffer::Write(const char *val, size_t len)
|
||||
void EQ::MemoryBuffer::Write(const char *val, size_t len)
|
||||
{
|
||||
size_t size_needed = write_pos_ + len;
|
||||
Resize(size_needed);
|
||||
@@ -242,20 +242,20 @@ void EQEmu::MemoryBuffer::Write(const char *val, size_t len)
|
||||
write_pos_ += len;
|
||||
}
|
||||
|
||||
void EQEmu::MemoryBuffer::Read(uchar *buf, size_t len)
|
||||
void EQ::MemoryBuffer::Read(uchar *buf, size_t len)
|
||||
{
|
||||
memcpy(buf, &buffer_[read_pos_], len);
|
||||
read_pos_ += len;
|
||||
}
|
||||
|
||||
void EQEmu::MemoryBuffer::Read(char *str)
|
||||
void EQ::MemoryBuffer::Read(char *str)
|
||||
{
|
||||
size_t len = strlen((const char*)&buffer_[read_pos_]);
|
||||
memcpy(str, &buffer_[read_pos_], len);
|
||||
read_pos_ += len;
|
||||
}
|
||||
|
||||
void EQEmu::OutBuffer::overwrite(OutBuffer::pos_type position, const char *_Str, std::streamsize _Count)
|
||||
void EQ::OutBuffer::overwrite(OutBuffer::pos_type position, const char *_Str, std::streamsize _Count)
|
||||
{
|
||||
auto last_pos = tellp();
|
||||
seekp(position);
|
||||
@@ -263,7 +263,7 @@ void EQEmu::OutBuffer::overwrite(OutBuffer::pos_type position, const char *_Str,
|
||||
seekp(last_pos);
|
||||
}
|
||||
|
||||
uchar* EQEmu::OutBuffer::detach()
|
||||
uchar* EQ::OutBuffer::detach()
|
||||
{
|
||||
size_t buffer_size = tellp();
|
||||
if (buffer_size == 0)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <sstream>
|
||||
|
||||
|
||||
namespace EQEmu
|
||||
namespace EQ
|
||||
{
|
||||
class MemoryBuffer {
|
||||
public:
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
namespace EQEmu {
|
||||
namespace EQ {
|
||||
|
||||
struct MemoryMappedFile::Implementation {
|
||||
#ifdef _WINDOWS
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <string>
|
||||
#include "types.h"
|
||||
|
||||
namespace EQEmu {
|
||||
namespace EQ {
|
||||
|
||||
//! Memory Backed Shared Memory
|
||||
/*!
|
||||
|
||||
@@ -19,9 +19,6 @@
|
||||
#include "types.h"
|
||||
#include <cstring>
|
||||
|
||||
#define ENC(c) (((c) & 0x3f) + ' ')
|
||||
#define DEC(c) (((c) - ' ') & 0x3f)
|
||||
|
||||
std::map<int,std::string> DBFieldNames;
|
||||
|
||||
#ifndef WIN32
|
||||
@@ -333,64 +330,6 @@ void LoadItemDBFieldNames() {
|
||||
DBFieldNames[113]="unknown115"; // ? (end quote)
|
||||
}
|
||||
|
||||
void encode_length(unsigned long length, char *out)
|
||||
{
|
||||
char buf[4];
|
||||
memcpy(buf,&length,sizeof(unsigned long));
|
||||
encode_chunk(buf,3,out);
|
||||
}
|
||||
|
||||
unsigned long encode(char *in, unsigned long length, char *out)
|
||||
{
|
||||
unsigned long used=0,len=0;
|
||||
while(used<length) {
|
||||
encode_chunk(in+used,length-used,out+len);
|
||||
used+=3;
|
||||
len+=4;
|
||||
}
|
||||
*(out+len)=0;
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
unsigned long decode_length(char *in)
|
||||
{
|
||||
int length;
|
||||
char buf[4];
|
||||
decode_chunk(in,&buf[0]);
|
||||
buf[3]=0;
|
||||
memcpy(&length,buf,sizeof(unsigned long));
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
void decode(char *in, char *out)
|
||||
{
|
||||
char *ptr=in;
|
||||
char *outptr=out;
|
||||
while(*ptr) {
|
||||
decode_chunk(ptr,outptr);
|
||||
ptr+=4;
|
||||
outptr+=3;
|
||||
}
|
||||
*outptr=0;
|
||||
}
|
||||
|
||||
void encode_chunk(char *in, int len, char *out)
|
||||
{
|
||||
*out=ENC(in[0] >> 2);
|
||||
*(out+1)=ENC((in[0] << 4)|(((len<2 ? 0 : in[1]) >> 4) & 0xF));
|
||||
*(out+2)=ENC(((len<2 ? 0 : in[1]) << 2)|(((len<3 ? 0 : in[2]) >> 6) & 0x3));
|
||||
*(out+3)=ENC((len<3 ? 0 : in[2]));
|
||||
}
|
||||
|
||||
void decode_chunk(char *in, char *out)
|
||||
{
|
||||
*out = DEC(*in) << 2 | DEC(in[1]) >> 4;
|
||||
*(out+1) = DEC(in[1]) << 4 | DEC(in[2]) >> 2;
|
||||
*(out+2) = DEC(in[2]) << 6 | DEC(in[3]);
|
||||
}
|
||||
|
||||
void dump_message_column(unsigned char *buffer, unsigned long length, std::string leader, FILE *to)
|
||||
{
|
||||
unsigned long i,j;
|
||||
|
||||
@@ -17,13 +17,6 @@ int Tokenize(std::string s, std::map<int,std::string> & tokens, char delim='|');
|
||||
|
||||
void LoadItemDBFieldNames();
|
||||
|
||||
void encode_length(unsigned long length, char *out);
|
||||
unsigned long decode_length(char *in);
|
||||
unsigned long encode(char *in, unsigned long length, char *out);
|
||||
void decode(char *in, char *out);
|
||||
void encode_chunk(char *in, int len, char *out);
|
||||
void decode_chunk(char *in, char *out);
|
||||
|
||||
#ifndef WIN32
|
||||
int print_stacktrace();
|
||||
#endif
|
||||
|
||||
@@ -116,17 +116,21 @@ bool EQ::Net::ConsoleServerConnection::SendChannelMessage(const ServerChannelMes
|
||||
}
|
||||
|
||||
switch (scm->chan_num) {
|
||||
if (RuleB(Chat, ServerWideAuction)) {
|
||||
case 4: {
|
||||
case 4: {
|
||||
if (RuleB(Chat, ServerWideAuction)) {
|
||||
QueueMessage(fmt::format("{0} auctions, '{1}'", scm->from, scm->message));
|
||||
break;
|
||||
} else { // I think we want default action in this case?
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (RuleB(Chat, ServerWideOOC)) {
|
||||
case 5: {
|
||||
case 5: {
|
||||
if (RuleB(Chat, ServerWideOOC)) {
|
||||
QueueMessage(fmt::format("{0} says ooc, '{1}'", scm->from, scm->message));
|
||||
break;
|
||||
} else { // I think we want default action in this case?
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -399,7 +399,7 @@ void EQ::Net::DaybreakConnection::Process()
|
||||
|
||||
ProcessQueue();
|
||||
}
|
||||
catch (std::exception ex) {
|
||||
catch (std::exception &ex) {
|
||||
if (m_owner->m_on_error_message) {
|
||||
m_owner->m_on_error_message(fmt::format("Error processing connection: {0}", ex.what()));
|
||||
}
|
||||
@@ -605,6 +605,8 @@ void EQ::Net::DaybreakConnection::ProcessDecodedPacket(const Packet &p)
|
||||
ProcessDecodedPacket(StaticPacket(current, subpacket_length));
|
||||
current += subpacket_length;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case OP_SessionRequest:
|
||||
@@ -1047,12 +1049,14 @@ void EQ::Net::DaybreakConnection::Compress(Packet &p, size_t offset, size_t leng
|
||||
uint8_t new_buffer[2048] = { 0 };
|
||||
uint8_t *buffer = (uint8_t*)p.Data() + offset;
|
||||
uint32_t new_length = 0;
|
||||
bool send_uncompressed = true;
|
||||
|
||||
if (length > 30) {
|
||||
new_length = Deflate(buffer, (uint32_t)length, new_buffer + 1, 2048) + 1;
|
||||
new_buffer[0] = 0x5a;
|
||||
send_uncompressed = (new_length > length);
|
||||
}
|
||||
else {
|
||||
if (send_uncompressed) {
|
||||
memcpy(new_buffer + 1, buffer, length);
|
||||
new_buffer[0] = 0xa5;
|
||||
new_length = length + 1;
|
||||
@@ -1099,7 +1103,7 @@ void EQ::Net::DaybreakConnection::ProcessResend(int stream)
|
||||
InternalBufferedSend(p);
|
||||
entry.second.last_sent = now;
|
||||
entry.second.times_resent++;
|
||||
entry.second.resend_delay = EQEmu::Clamp(entry.second.resend_delay * 2, m_owner->m_options.resend_delay_min, m_owner->m_options.resend_delay_max);
|
||||
entry.second.resend_delay = EQ::Clamp(entry.second.resend_delay * 2, m_owner->m_options.resend_delay_min, m_owner->m_options.resend_delay_max);
|
||||
resends++;
|
||||
}
|
||||
}
|
||||
@@ -1128,7 +1132,7 @@ void EQ::Net::DaybreakConnection::ProcessResend(int stream)
|
||||
InternalBufferedSend(p);
|
||||
entry.second.last_sent = now;
|
||||
entry.second.times_resent++;
|
||||
entry.second.resend_delay = EQEmu::Clamp(entry.second.resend_delay * 2, m_owner->m_options.resend_delay_min, m_owner->m_options.resend_delay_max);
|
||||
entry.second.resend_delay = EQ::Clamp(entry.second.resend_delay * 2, m_owner->m_options.resend_delay_min, m_owner->m_options.resend_delay_max);
|
||||
resends++;
|
||||
}
|
||||
}
|
||||
@@ -1180,7 +1184,7 @@ void EQ::Net::DaybreakConnection::OutOfOrderAck(int stream, uint16_t seq)
|
||||
void EQ::Net::DaybreakConnection::UpdateDataBudget(double budget_add)
|
||||
{
|
||||
auto outgoing_data_rate = m_owner->m_options.outgoing_data_rate;
|
||||
m_outgoing_budget = EQEmu::ClampUpper(m_outgoing_budget + budget_add, outgoing_data_rate);
|
||||
m_outgoing_budget = EQ::ClampUpper(m_outgoing_budget + budget_add, outgoing_data_rate);
|
||||
}
|
||||
|
||||
void EQ::Net::DaybreakConnection::SendAck(int stream_id, uint16_t seq)
|
||||
@@ -1380,7 +1384,7 @@ void EQ::Net::DaybreakConnection::InternalQueuePacket(Packet &p, int stream_id,
|
||||
}
|
||||
|
||||
auto stream = &m_streams[stream_id];
|
||||
auto max_raw_size = m_max_packet_size - m_crc_bytes - DaybreakReliableHeader::size();
|
||||
auto max_raw_size = m_max_packet_size - m_crc_bytes - DaybreakReliableHeader::size() - 1; // -1 for compress flag
|
||||
size_t length = p.Length();
|
||||
if (length > max_raw_size) {
|
||||
DaybreakReliableFragmentHeader first_header;
|
||||
@@ -1401,7 +1405,7 @@ void EQ::Net::DaybreakConnection::InternalQueuePacket(Packet &p, int stream_id,
|
||||
sent.last_sent = Clock::now();
|
||||
sent.first_sent = Clock::now();
|
||||
sent.times_resent = 0;
|
||||
sent.resend_delay = EQEmu::Clamp(
|
||||
sent.resend_delay = EQ::Clamp(
|
||||
static_cast<size_t>((m_rolling_ping * m_owner->m_options.resend_delay_factor) + m_owner->m_options.resend_delay_ms),
|
||||
m_owner->m_options.resend_delay_min,
|
||||
m_owner->m_options.resend_delay_max);
|
||||
@@ -1433,7 +1437,7 @@ void EQ::Net::DaybreakConnection::InternalQueuePacket(Packet &p, int stream_id,
|
||||
sent.last_sent = Clock::now();
|
||||
sent.first_sent = Clock::now();
|
||||
sent.times_resent = 0;
|
||||
sent.resend_delay = EQEmu::Clamp(
|
||||
sent.resend_delay = EQ::Clamp(
|
||||
static_cast<size_t>((m_rolling_ping * m_owner->m_options.resend_delay_factor) + m_owner->m_options.resend_delay_ms),
|
||||
m_owner->m_options.resend_delay_min,
|
||||
m_owner->m_options.resend_delay_max);
|
||||
@@ -1457,7 +1461,7 @@ void EQ::Net::DaybreakConnection::InternalQueuePacket(Packet &p, int stream_id,
|
||||
sent.last_sent = Clock::now();
|
||||
sent.first_sent = Clock::now();
|
||||
sent.times_resent = 0;
|
||||
sent.resend_delay = EQEmu::Clamp(
|
||||
sent.resend_delay = EQ::Clamp(
|
||||
static_cast<size_t>((m_rolling_ping * m_owner->m_options.resend_delay_factor) + m_owner->m_options.resend_delay_ms),
|
||||
m_owner->m_options.resend_delay_min,
|
||||
m_owner->m_options.resend_delay_max);
|
||||
|
||||
@@ -318,7 +318,7 @@ namespace EQ
|
||||
void Attach(uv_loop_t *loop);
|
||||
void Detach();
|
||||
|
||||
EQEmu::Random m_rand;
|
||||
EQ::Random m_rand;
|
||||
uv_timer_t m_timer;
|
||||
uv_udp_t m_socket;
|
||||
uv_loop_t *m_attached;
|
||||
|
||||
+4
-4
@@ -89,9 +89,9 @@ namespace EQ {
|
||||
public:
|
||||
StaticPacket(void *data, size_t size) { m_data = data; m_data_length = size; m_max_data_length = size; }
|
||||
virtual ~StaticPacket() { }
|
||||
StaticPacket(const StaticPacket &o) { m_data = o.m_data; m_data_length = o.m_data_length; }
|
||||
StaticPacket(const StaticPacket &o) { m_data = o.m_data; m_data_length = o.m_data_length; m_max_data_length = o.m_max_data_length; }
|
||||
StaticPacket& operator=(const StaticPacket &o) { m_data = o.m_data; m_data_length = o.m_data_length; return *this; }
|
||||
StaticPacket(StaticPacket &&o) { m_data = o.m_data; m_data_length = o.m_data_length; }
|
||||
StaticPacket(StaticPacket &&o) noexcept { m_data = o.m_data; m_data_length = o.m_data_length; }
|
||||
|
||||
virtual const void *Data() const { return m_data; }
|
||||
virtual void *Data() { return m_data; }
|
||||
@@ -112,7 +112,7 @@ namespace EQ {
|
||||
public:
|
||||
DynamicPacket() { }
|
||||
virtual ~DynamicPacket() { }
|
||||
DynamicPacket(DynamicPacket &&o) { m_data = std::move(o.m_data); }
|
||||
DynamicPacket(DynamicPacket &&o) noexcept { m_data = std::move(o.m_data); }
|
||||
DynamicPacket(const DynamicPacket &o) { m_data = o.m_data; }
|
||||
DynamicPacket& operator=(const DynamicPacket &o) { m_data = o.m_data; return *this; }
|
||||
|
||||
@@ -127,4 +127,4 @@ namespace EQ {
|
||||
std::vector<char> m_data;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,6 +203,10 @@ int EQ::Net::TCPConnection::LocalPort() const
|
||||
|
||||
std::string EQ::Net::TCPConnection::RemoteIP() const
|
||||
{
|
||||
if (!m_socket) {
|
||||
return "";
|
||||
}
|
||||
|
||||
sockaddr_storage addr;
|
||||
int addr_len = sizeof(addr);
|
||||
uv_tcp_getpeername(m_socket, (sockaddr*)&addr, &addr_len);
|
||||
@@ -220,6 +224,10 @@ std::string EQ::Net::TCPConnection::RemoteIP() const
|
||||
|
||||
int EQ::Net::TCPConnection::RemotePort() const
|
||||
{
|
||||
if (!m_socket) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
sockaddr_storage addr;
|
||||
int addr_len = sizeof(addr);
|
||||
uv_tcp_getpeername(m_socket, (sockaddr*)&addr, &addr_len);
|
||||
@@ -236,3 +244,11 @@ int EQ::Net::TCPConnection::RemotePort() const
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
bool EQ::Net::TCPConnection::IsConnected() const
|
||||
{
|
||||
return m_socket != nullptr;
|
||||
}
|
||||
|
||||
@@ -24,10 +24,12 @@ namespace EQ
|
||||
void Read(const char *data, size_t count);
|
||||
void Write(const char *data, size_t count);
|
||||
|
||||
bool IsConnected() const;
|
||||
std::string LocalIP() const;
|
||||
int LocalPort() const;
|
||||
std::string RemoteIP() const;
|
||||
int RemotePort() const;
|
||||
|
||||
private:
|
||||
TCPConnection();
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ EQ::Net::WebsocketServer::WebsocketServer(const std::string &addr, int port)
|
||||
auto &connection = iter->second;
|
||||
connection->GetWebsocketConnection()->ping("keepalive");
|
||||
}
|
||||
catch (std::exception) {
|
||||
catch (std::exception &) {
|
||||
iter->second->GetTCPConnection()->Disconnect();
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ void EQ::Net::WebsocketServer::DispatchEvent(WebsocketSubscriptionEvent evt, Jso
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (std::exception) {
|
||||
catch (std::exception &) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ Json::Value EQ::Net::WebsocketServer::Login(WebsocketServerConnection *connectio
|
||||
|
||||
return ret;
|
||||
}
|
||||
catch (std::exception) {
|
||||
catch (std::exception &) {
|
||||
throw WebsocketException("Unable to process login request");
|
||||
}
|
||||
}
|
||||
@@ -212,7 +212,7 @@ Json::Value EQ::Net::WebsocketServer::Subscribe(WebsocketServerConnection *conne
|
||||
catch (WebsocketException &ex) {
|
||||
throw ex;
|
||||
}
|
||||
catch (std::exception) {
|
||||
catch (std::exception &) {
|
||||
throw WebsocketException("Unable to process unsubscribe request");
|
||||
}
|
||||
}
|
||||
@@ -234,7 +234,7 @@ Json::Value EQ::Net::WebsocketServer::Unsubscribe(WebsocketServerConnection *con
|
||||
catch (WebsocketException &ex) {
|
||||
throw ex;
|
||||
}
|
||||
catch (std::exception) {
|
||||
catch (std::exception &) {
|
||||
throw WebsocketException("Unable to process unsubscribe request");
|
||||
}
|
||||
}
|
||||
|
||||
+187
-178
@@ -45,7 +45,7 @@ namespace RoF
|
||||
static OpcodeManager *opcodes = nullptr;
|
||||
static Strategy struct_strategy;
|
||||
|
||||
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id, uint8 depth, ItemPacketType packet_type);
|
||||
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id, uint8 depth, ItemPacketType packet_type);
|
||||
|
||||
// server to client inventory location converters
|
||||
static inline structs::InventorySlot_Struct ServerToRoFSlot(uint32 server_slot);
|
||||
@@ -65,8 +65,8 @@ namespace RoF
|
||||
// client to server say link converter
|
||||
static inline void RoFToServerSayLink(std::string& serverSayLink, const std::string& rofSayLink);
|
||||
|
||||
static inline spells::CastingSlot ServerToRoFCastingSlot(EQEmu::spells::CastingSlot slot);
|
||||
static inline EQEmu::spells::CastingSlot RoFToServerCastingSlot(spells::CastingSlot slot);
|
||||
static inline spells::CastingSlot ServerToRoFCastingSlot(EQ::spells::CastingSlot slot);
|
||||
static inline EQ::spells::CastingSlot RoFToServerCastingSlot(spells::CastingSlot slot);
|
||||
|
||||
static inline int ServerToRoFBuffSlot(int index);
|
||||
static inline int RoFToServerBuffSlot(int index);
|
||||
@@ -147,9 +147,9 @@ namespace RoF
|
||||
return(r);
|
||||
}
|
||||
|
||||
const EQEmu::versions::ClientVersion Strategy::ClientVersion() const
|
||||
const EQ::versions::ClientVersion Strategy::ClientVersion() const
|
||||
{
|
||||
return EQEmu::versions::ClientVersion::RoF;
|
||||
return EQ::versions::ClientVersion::RoF;
|
||||
}
|
||||
|
||||
#include "ss_define.h"
|
||||
@@ -193,7 +193,7 @@ namespace RoF
|
||||
|
||||
eq->unknown000 = 1;
|
||||
OUT(npcid);
|
||||
eq->inventory_slot = ServerToRoFTypelessSlot(emu->slot, EQEmu::invtype::typePossessions);
|
||||
eq->inventory_slot = ServerToRoFTypelessSlot(emu->slot, EQ::invtype::typePossessions);
|
||||
OUT(charges);
|
||||
OUT(sell_price);
|
||||
|
||||
@@ -246,7 +246,7 @@ namespace RoF
|
||||
SETUP_DIRECT_ENCODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct);
|
||||
|
||||
OUT(merchant_entity_id);
|
||||
eq->inventory_slot = ServerToRoFTypelessSlot(emu->slot_id, EQEmu::invtype::typePossessions);
|
||||
eq->inventory_slot = ServerToRoFTypelessSlot(emu->slot_id, EQ::invtype::typePossessions);
|
||||
OUT(charges);
|
||||
OUT(cost);
|
||||
|
||||
@@ -270,7 +270,7 @@ namespace RoF
|
||||
ENCODE_LENGTH_EXACT(ApplyPoison_Struct);
|
||||
SETUP_DIRECT_ENCODE(ApplyPoison_Struct, structs::ApplyPoison_Struct);
|
||||
|
||||
eq->inventory_slot = ServerToRoFTypelessSlot(emu->inventorySlot, EQEmu::invtype::typePossessions);
|
||||
eq->inventory_slot = ServerToRoFTypelessSlot(emu->inventorySlot, EQ::invtype::typePossessions);
|
||||
OUT(success);
|
||||
|
||||
FINISH_ENCODE();
|
||||
@@ -502,7 +502,7 @@ namespace RoF
|
||||
ENCODE_LENGTH_EXACT(CastSpell_Struct);
|
||||
SETUP_DIRECT_ENCODE(CastSpell_Struct, structs::CastSpell_Struct);
|
||||
|
||||
eq->slot = static_cast<uint32>(ServerToRoFCastingSlot(static_cast<EQEmu::spells::CastingSlot>(emu->slot)));
|
||||
eq->slot = static_cast<uint32>(ServerToRoFCastingSlot(static_cast<EQ::spells::CastingSlot>(emu->slot)));
|
||||
|
||||
OUT(spell_id);
|
||||
eq->inventory_slot = ServerToRoFSlot(emu->inventoryslot);
|
||||
@@ -570,24 +570,24 @@ namespace RoF
|
||||
//store away the emu struct
|
||||
uchar* __emu_buffer = in->pBuffer;
|
||||
|
||||
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
|
||||
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
|
||||
int item_count = in->size / sizeof(EQ::InternalSerializedItem_Struct);
|
||||
if (!item_count || (in->size % sizeof(EQ::InternalSerializedItem_Struct)) != 0) {
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
|
||||
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQ::InternalSerializedItem_Struct));
|
||||
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
|
||||
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
|
||||
EQ::InternalSerializedItem_Struct* eq = (EQ::InternalSerializedItem_Struct*)in->pBuffer;
|
||||
|
||||
EQEmu::OutBuffer ob;
|
||||
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
|
||||
EQ::OutBuffer ob;
|
||||
EQ::OutBuffer::pos_type last_pos = ob.tellp();
|
||||
|
||||
ob.write((const char*)&item_count, sizeof(uint32));
|
||||
|
||||
for (int index = 0; index < item_count; ++index, ++eq) {
|
||||
SerializeItem(ob, (const EQEmu::ItemInstance*)eq->inst, eq->slot_id, 0, ItemPacketCharInventory);
|
||||
SerializeItem(ob, (const EQ::ItemInstance*)eq->inst, eq->slot_id, 0, ItemPacketCharInventory);
|
||||
if (ob.tellp() == last_pos)
|
||||
LogNetcode("RoF::ENCODE(OP_CharInventory) Serialization failed on item slot [{}] during OP_CharInventory. Item skipped", eq->slot_id);
|
||||
|
||||
@@ -624,6 +624,7 @@ namespace RoF
|
||||
SETUP_DIRECT_ENCODE(PlayerPositionUpdateServer_Struct, structs::PlayerPositionUpdateServer_Struct);
|
||||
|
||||
OUT(spawn_id);
|
||||
OUT(vehicle_id);
|
||||
OUT(x_pos);
|
||||
OUT(delta_x);
|
||||
OUT(delta_y);
|
||||
@@ -1512,14 +1513,14 @@ namespace RoF
|
||||
uchar* __emu_buffer = in->pBuffer;
|
||||
|
||||
ItemPacket_Struct* old_item_pkt = (ItemPacket_Struct*)__emu_buffer;
|
||||
EQEmu::InternalSerializedItem_Struct* int_struct = (EQEmu::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
|
||||
EQ::InternalSerializedItem_Struct* int_struct = (EQ::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
|
||||
|
||||
EQEmu::OutBuffer ob;
|
||||
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
|
||||
EQ::OutBuffer ob;
|
||||
EQ::OutBuffer::pos_type last_pos = ob.tellp();
|
||||
|
||||
ob.write((const char*)__emu_buffer, 4);
|
||||
|
||||
SerializeItem(ob, (const EQEmu::ItemInstance*)int_struct->inst, int_struct->slot_id, 0, old_item_pkt->PacketType);
|
||||
SerializeItem(ob, (const EQ::ItemInstance*)int_struct->inst, int_struct->slot_id, 0, old_item_pkt->PacketType);
|
||||
if (ob.tellp() == last_pos) {
|
||||
LogNetcode("RoF::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
|
||||
delete in;
|
||||
@@ -1956,7 +1957,7 @@ namespace RoF
|
||||
|
||||
outapp->WriteUInt32(22); // Equipment count
|
||||
|
||||
for (int r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++)
|
||||
for (int r = EQ::textures::textureBegin; r < EQ::textures::materialCount; r++)
|
||||
{
|
||||
outapp->WriteUInt32(emu->item_material.Slot[r].Material);
|
||||
outapp->WriteUInt32(0);
|
||||
@@ -1976,9 +1977,9 @@ namespace RoF
|
||||
outapp->WriteUInt32(0);
|
||||
}
|
||||
|
||||
outapp->WriteUInt32(EQEmu::textures::materialCount); // Equipment2 count
|
||||
outapp->WriteUInt32(EQ::textures::materialCount); // Equipment2 count
|
||||
|
||||
for (int r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++)
|
||||
for (int r = EQ::textures::textureBegin; r < EQ::textures::materialCount; r++)
|
||||
{
|
||||
outapp->WriteUInt32(0);
|
||||
outapp->WriteUInt32(0);
|
||||
@@ -1987,7 +1988,7 @@ namespace RoF
|
||||
outapp->WriteUInt32(0);
|
||||
}
|
||||
|
||||
outapp->WriteUInt32(EQEmu::textures::materialCount); // Tint Count
|
||||
outapp->WriteUInt32(EQ::textures::materialCount); // Tint Count
|
||||
|
||||
for (int r = 0; r < 7; r++)
|
||||
{
|
||||
@@ -1997,7 +1998,7 @@ namespace RoF
|
||||
outapp->WriteUInt32(0);
|
||||
outapp->WriteUInt32(0);
|
||||
|
||||
outapp->WriteUInt32(EQEmu::textures::materialCount); // Tint2 Count
|
||||
outapp->WriteUInt32(EQ::textures::materialCount); // Tint2 Count
|
||||
|
||||
for (int r = 0; r < 7; r++)
|
||||
{
|
||||
@@ -2126,7 +2127,7 @@ namespace RoF
|
||||
|
||||
outapp->WriteUInt32(spells::SPELLBOOK_SIZE); // Spellbook slots
|
||||
|
||||
if (spells::SPELLBOOK_SIZE <= EQEmu::spells::SPELLBOOK_SIZE) {
|
||||
if (spells::SPELLBOOK_SIZE <= EQ::spells::SPELLBOOK_SIZE) {
|
||||
for (uint32 r = 0; r < spells::SPELLBOOK_SIZE; r++) {
|
||||
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
|
||||
outapp->WriteUInt32(emu->spell_book[r]);
|
||||
@@ -2135,33 +2136,33 @@ namespace RoF
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (uint32 r = 0; r < EQEmu::spells::SPELLBOOK_SIZE; r++) {
|
||||
for (uint32 r = 0; r < EQ::spells::SPELLBOOK_SIZE; r++) {
|
||||
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
|
||||
outapp->WriteUInt32(emu->spell_book[r]);
|
||||
else
|
||||
outapp->WriteUInt32(0xFFFFFFFFU);
|
||||
}
|
||||
// invalidate the rest of the spellbook slots
|
||||
for (uint32 r = EQEmu::spells::SPELLBOOK_SIZE; r < spells::SPELLBOOK_SIZE; r++) {
|
||||
for (uint32 r = EQ::spells::SPELLBOOK_SIZE; r < spells::SPELLBOOK_SIZE; r++) {
|
||||
outapp->WriteUInt32(0xFFFFFFFFU);
|
||||
}
|
||||
}
|
||||
|
||||
outapp->WriteUInt32(spells::SPELL_GEM_COUNT); // Memorised spell slots
|
||||
|
||||
for (uint32 r = 0; r < EQEmu::spells::SPELL_GEM_COUNT; r++) // first 12
|
||||
for (uint32 r = 0; r < EQ::spells::SPELL_GEM_COUNT; r++) // first 12
|
||||
{
|
||||
outapp->WriteUInt32(emu->mem_spells[r]);
|
||||
}
|
||||
// zeroes for the rest of the slots -- the other 4 which don't work at all!
|
||||
for (uint32 r = 0; r < spells::SPELL_GEM_COUNT - EQEmu::spells::SPELL_GEM_COUNT; r++)
|
||||
for (uint32 r = 0; r < spells::SPELL_GEM_COUNT - EQ::spells::SPELL_GEM_COUNT; r++)
|
||||
{
|
||||
outapp->WriteUInt32(0xFFFFFFFFU);
|
||||
}
|
||||
|
||||
outapp->WriteUInt32(13); // gem refresh count
|
||||
|
||||
for (uint32 r = 0; r < EQEmu::spells::SPELL_GEM_COUNT; r++)
|
||||
for (uint32 r = 0; r < EQ::spells::SPELL_GEM_COUNT; r++)
|
||||
{
|
||||
outapp->WriteUInt32(emu->spellSlotRefresh[r]); // spell gem refresh
|
||||
}
|
||||
@@ -2250,7 +2251,7 @@ namespace RoF
|
||||
outapp->WriteUInt32(profile::BANDOLIERS_SIZE);
|
||||
|
||||
// Copy bandoliers where server and client indices converge
|
||||
for (uint32 r = 0; r < EQEmu::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
|
||||
for (uint32 r = 0; r < EQ::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
|
||||
outapp->WriteString(emu->bandoliers[r].Name);
|
||||
for (uint32 j = 0; j < profile::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
|
||||
outapp->WriteString(emu->bandoliers[r].Items[j].Name);
|
||||
@@ -2265,7 +2266,7 @@ namespace RoF
|
||||
}
|
||||
}
|
||||
// Nullify bandoliers where server and client indices diverge, with a client bias
|
||||
for (uint32 r = EQEmu::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
|
||||
for (uint32 r = EQ::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
|
||||
outapp->WriteString("");
|
||||
for (uint32 j = 0; j < profile::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
|
||||
outapp->WriteString("");
|
||||
@@ -2277,7 +2278,7 @@ namespace RoF
|
||||
outapp->WriteUInt32(profile::POTION_BELT_SIZE);
|
||||
|
||||
// Copy potion belt where server and client indices converge
|
||||
for (uint32 r = 0; r < EQEmu::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
|
||||
for (uint32 r = 0; r < EQ::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
|
||||
outapp->WriteString(emu->potionbelt.Items[r].Name);
|
||||
outapp->WriteUInt32(emu->potionbelt.Items[r].ID);
|
||||
if (emu->potionbelt.Items[r].Icon) {
|
||||
@@ -2289,7 +2290,7 @@ namespace RoF
|
||||
}
|
||||
}
|
||||
// Nullify potion belt where server and client indices diverge, with a client bias
|
||||
for (uint32 r = EQEmu::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
|
||||
for (uint32 r = EQ::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
|
||||
outapp->WriteString("");
|
||||
outapp->WriteUInt32(0);
|
||||
outapp->WriteSInt32(-1);
|
||||
@@ -2411,9 +2412,9 @@ namespace RoF
|
||||
outapp->WriteUInt8(0); // Unknown
|
||||
outapp->WriteUInt8(0); // Unknown
|
||||
|
||||
outapp->WriteUInt32(EQEmu::invtype::TRIBUTE_SIZE);
|
||||
outapp->WriteUInt32(EQ::invtype::TRIBUTE_SIZE);
|
||||
|
||||
for (uint32 r = 0; r < EQEmu::invtype::TRIBUTE_SIZE; r++)
|
||||
for (uint32 r = 0; r < EQ::invtype::TRIBUTE_SIZE; r++)
|
||||
{
|
||||
outapp->WriteUInt32(emu->tributes[r].tribute);
|
||||
outapp->WriteUInt32(emu->tributes[r].tier);
|
||||
@@ -2948,7 +2949,7 @@ namespace RoF
|
||||
eq_cse->Gender = emu_cse->Gender;
|
||||
eq_cse->Face = emu_cse->Face;
|
||||
|
||||
for (int equip_index = 0; equip_index < EQEmu::textures::materialCount; equip_index++) {
|
||||
for (int equip_index = 0; equip_index < EQ::textures::materialCount; equip_index++) {
|
||||
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
|
||||
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
|
||||
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
|
||||
@@ -3065,7 +3066,7 @@ namespace RoF
|
||||
SETUP_DIRECT_ENCODE(Merchant_Purchase_Struct, structs::Merchant_Purchase_Struct);
|
||||
|
||||
OUT(npcid);
|
||||
eq->inventory_slot = ServerToRoFTypelessSlot(emu->itemslot, EQEmu::invtype::typePossessions);
|
||||
eq->inventory_slot = ServerToRoFTypelessSlot(emu->itemslot, EQ::invtype::typePossessions);
|
||||
//OUT(itemslot);
|
||||
OUT(quantity);
|
||||
OUT(price);
|
||||
@@ -3979,7 +3980,7 @@ namespace RoF
|
||||
|
||||
if ((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
|
||||
{
|
||||
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; ++k)
|
||||
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; ++k)
|
||||
{
|
||||
{
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment_tint.Slot[k].Color);
|
||||
@@ -3988,7 +3989,7 @@ namespace RoF
|
||||
|
||||
structs::Texture_Struct *Equipment = (structs::Texture_Struct *)Buffer;
|
||||
|
||||
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
|
||||
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; k++) {
|
||||
Equipment[k].Material = emu->equipment.Slot[k].Material;
|
||||
Equipment[k].Unknown1 = emu->equipment.Slot[k].Unknown1;
|
||||
Equipment[k].EliteMaterial = emu->equipment.Slot[k].EliteModel;
|
||||
@@ -3996,7 +3997,7 @@ namespace RoF
|
||||
Equipment[k].Material2 = emu->equipment.Slot[k].Unknown2;
|
||||
}
|
||||
|
||||
Buffer += (sizeof(structs::Texture_Struct) * EQEmu::textures::materialCount);
|
||||
Buffer += (sizeof(structs::Texture_Struct) * EQ::textures::materialCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4314,6 +4315,7 @@ namespace RoF
|
||||
SETUP_DIRECT_DECODE(PlayerPositionUpdateClient_Struct, structs::PlayerPositionUpdateClient_Struct);
|
||||
|
||||
IN(spawn_id);
|
||||
IN(vehicle_id);
|
||||
IN(sequence);
|
||||
IN(x_pos);
|
||||
IN(y_pos);
|
||||
@@ -4712,7 +4714,7 @@ namespace RoF
|
||||
|
||||
IN(item_id);
|
||||
int r;
|
||||
for (r = EQEmu::invaug::SOCKET_BEGIN; r <= EQEmu::invaug::SOCKET_END; r++) {
|
||||
for (r = EQ::invaug::SOCKET_BEGIN; r <= EQ::invaug::SOCKET_END; r++) {
|
||||
IN(augments[r]);
|
||||
}
|
||||
IN(link_hash);
|
||||
@@ -4737,7 +4739,7 @@ namespace RoF
|
||||
DECODE_LENGTH_EXACT(structs::LoadSpellSet_Struct);
|
||||
SETUP_DIRECT_DECODE(LoadSpellSet_Struct, structs::LoadSpellSet_Struct);
|
||||
|
||||
for (unsigned int i = 0; i < EQEmu::spells::SPELL_GEM_COUNT; ++i)
|
||||
for (unsigned int i = 0; i < EQ::spells::SPELL_GEM_COUNT; ++i)
|
||||
{
|
||||
if (eq->spell[i] == 0)
|
||||
emu->spell[i] = 0xFFFFFFFF;
|
||||
@@ -5089,9 +5091,9 @@ namespace RoF
|
||||
return NextItemInstSerialNumber;
|
||||
}
|
||||
|
||||
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id_in, uint8 depth, ItemPacketType packet_type)
|
||||
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id_in, uint8 depth, ItemPacketType packet_type)
|
||||
{
|
||||
const EQEmu::ItemData *item = inst->GetUnscaledItem();
|
||||
const EQ::ItemData *item = inst->GetUnscaledItem();
|
||||
|
||||
RoF::structs::ItemSerializationHeader hdr;
|
||||
|
||||
@@ -5154,7 +5156,7 @@ namespace RoF
|
||||
uint32 hero_model = 0;
|
||||
|
||||
if (inst->GetOrnamentationIDFile()) {
|
||||
hero_model = inst->GetOrnamentHeroModel(EQEmu::InventoryProfile::CalcMaterialFromSlot(slot_id_in));
|
||||
hero_model = inst->GetOrnamentHeroModel(EQ::InventoryProfile::CalcMaterialFromSlot(slot_id_in));
|
||||
|
||||
char tmp[30];
|
||||
memset(tmp, 0x0, 30);
|
||||
@@ -5354,6 +5356,12 @@ namespace RoF
|
||||
itbs.no_transfer = item->NoTransfer;
|
||||
itbs.expendablearrow = item->ExpendableArrow;
|
||||
|
||||
// Done to hack older clients to label expendable fishing poles as such
|
||||
// July 28th, 2018 patch
|
||||
if (item->ItemType == EQ::item::ItemTypeFishingPole && item->SubType == 0) {
|
||||
itbs.expendablearrow = 1;
|
||||
}
|
||||
|
||||
itbs.unknown8 = 0;
|
||||
itbs.unknown9 = 0;
|
||||
itbs.unknown10 = 0;
|
||||
@@ -5502,34 +5510,35 @@ namespace RoF
|
||||
iqbs.HealAmt = item->HealAmt;
|
||||
iqbs.SpellDmg = item->SpellDmg;
|
||||
iqbs.Clairvoyance = item->Clairvoyance;
|
||||
iqbs.SubType = item->SubType;
|
||||
iqbs.unknown28 = 0;
|
||||
iqbs.unknown30 = 0;
|
||||
iqbs.unknown39 = 1;
|
||||
|
||||
ob.write((const char*)&iqbs, sizeof(RoF::structs::ItemQuaternaryBodyStruct));
|
||||
|
||||
EQEmu::OutBuffer::pos_type count_pos = ob.tellp();
|
||||
EQ::OutBuffer::pos_type count_pos = ob.tellp();
|
||||
uint32 subitem_count = 0;
|
||||
|
||||
ob.write((const char*)&subitem_count, sizeof(uint32));
|
||||
|
||||
// moved outside of loop since it is not modified within that scope
|
||||
int16 SubSlotNumber = EQEmu::invbag::SLOT_INVALID;
|
||||
int16 SubSlotNumber = EQ::invbag::SLOT_INVALID;
|
||||
|
||||
if (slot_id_in <= EQEmu::invslot::GENERAL_END && slot_id_in >= EQEmu::invslot::GENERAL_BEGIN)
|
||||
SubSlotNumber = EQEmu::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
||||
else if (slot_id_in == EQEmu::invslot::slotCursor)
|
||||
SubSlotNumber = EQEmu::invbag::CURSOR_BAG_BEGIN;
|
||||
else if (slot_id_in <= EQEmu::invslot::BANK_END && slot_id_in >= EQEmu::invslot::BANK_BEGIN)
|
||||
SubSlotNumber = EQEmu::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
||||
else if (slot_id_in <= EQEmu::invslot::SHARED_BANK_END && slot_id_in >= EQEmu::invslot::SHARED_BANK_BEGIN)
|
||||
SubSlotNumber = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::SHARED_BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
||||
if (slot_id_in <= EQ::invslot::GENERAL_END && slot_id_in >= EQ::invslot::GENERAL_BEGIN)
|
||||
SubSlotNumber = EQ::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQ::invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||
else if (slot_id_in == EQ::invslot::slotCursor)
|
||||
SubSlotNumber = EQ::invbag::CURSOR_BAG_BEGIN;
|
||||
else if (slot_id_in <= EQ::invslot::BANK_END && slot_id_in >= EQ::invslot::BANK_BEGIN)
|
||||
SubSlotNumber = EQ::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||
else if (slot_id_in <= EQ::invslot::SHARED_BANK_END && slot_id_in >= EQ::invslot::SHARED_BANK_BEGIN)
|
||||
SubSlotNumber = EQ::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::SHARED_BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||
else
|
||||
SubSlotNumber = slot_id_in; // not sure if this is the best way to handle this..leaving for now
|
||||
|
||||
if (SubSlotNumber != EQEmu::invbag::SLOT_INVALID) {
|
||||
for (uint32 index = EQEmu::invbag::SLOT_BEGIN; index <= EQEmu::invbag::SLOT_END; ++index) {
|
||||
EQEmu::ItemInstance* sub = inst->GetItem(index);
|
||||
if (SubSlotNumber != EQ::invbag::SLOT_INVALID) {
|
||||
for (uint32 index = EQ::invbag::SLOT_BEGIN; index <= EQ::invbag::SLOT_END; ++index) {
|
||||
EQ::ItemInstance* sub = inst->GetItem(index);
|
||||
if (!sub)
|
||||
continue;
|
||||
|
||||
@@ -5555,77 +5564,77 @@ namespace RoF
|
||||
RoFSlot.AugIndex = invaug::SOCKET_INVALID;
|
||||
RoFSlot.Unknown01 = INULL;
|
||||
|
||||
uint32 temp_slot = (uint32) EQEmu::invslot::SLOT_INVALID;
|
||||
uint32 temp_slot = (uint32) EQ::invslot::SLOT_INVALID;
|
||||
|
||||
if (server_slot < EQEmu::invtype::POSSESSIONS_SIZE) {
|
||||
if (server_slot < EQ::invtype::POSSESSIONS_SIZE) {
|
||||
RoFSlot.Type = invtype::typePossessions;
|
||||
RoFSlot.Slot = server_slot;
|
||||
}
|
||||
|
||||
else if (server_slot <= EQEmu::invbag::CURSOR_BAG_END && server_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
|
||||
temp_slot = server_slot - EQEmu::invbag::GENERAL_BAGS_BEGIN;
|
||||
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
||||
temp_slot = server_slot - EQ::invbag::GENERAL_BAGS_BEGIN;
|
||||
|
||||
RoFSlot.Type = invtype::typePossessions;
|
||||
RoFSlot.Slot = invslot::GENERAL_BEGIN + (temp_slot / EQEmu::invbag::SLOT_COUNT);
|
||||
RoFSlot.SubIndex = temp_slot - ((RoFSlot.Slot - invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
||||
RoFSlot.Slot = invslot::GENERAL_BEGIN + (temp_slot / EQ::invbag::SLOT_COUNT);
|
||||
RoFSlot.SubIndex = temp_slot - ((RoFSlot.Slot - invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||
}
|
||||
|
||||
else if (server_slot <= EQEmu::invslot::TRIBUTE_END && server_slot >= EQEmu::invslot::TRIBUTE_BEGIN) {
|
||||
else if (server_slot <= EQ::invslot::TRIBUTE_END && server_slot >= EQ::invslot::TRIBUTE_BEGIN) {
|
||||
RoFSlot.Type = invtype::typeTribute;
|
||||
RoFSlot.Slot = server_slot - EQEmu::invslot::TRIBUTE_BEGIN;
|
||||
RoFSlot.Slot = server_slot - EQ::invslot::TRIBUTE_BEGIN;
|
||||
}
|
||||
|
||||
else if (server_slot <= EQEmu::invslot::GUILD_TRIBUTE_END && server_slot >= EQEmu::invslot::GUILD_TRIBUTE_BEGIN) {
|
||||
else if (server_slot <= EQ::invslot::GUILD_TRIBUTE_END && server_slot >= EQ::invslot::GUILD_TRIBUTE_BEGIN) {
|
||||
RoFSlot.Type = invtype::typeGuildTribute;
|
||||
RoFSlot.Slot = server_slot - EQEmu::invslot::GUILD_TRIBUTE_BEGIN;
|
||||
RoFSlot.Slot = server_slot - EQ::invslot::GUILD_TRIBUTE_BEGIN;
|
||||
}
|
||||
|
||||
else if (server_slot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
|
||||
else if (server_slot == EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
|
||||
RoFSlot.Type = invtype::typeWorld;
|
||||
}
|
||||
|
||||
else if (server_slot <= EQEmu::invslot::BANK_END && server_slot >= EQEmu::invslot::BANK_BEGIN) {
|
||||
else if (server_slot <= EQ::invslot::BANK_END && server_slot >= EQ::invslot::BANK_BEGIN) {
|
||||
RoFSlot.Type = invtype::typeBank;
|
||||
RoFSlot.Slot = server_slot - EQEmu::invslot::BANK_BEGIN;
|
||||
RoFSlot.Slot = server_slot - EQ::invslot::BANK_BEGIN;
|
||||
}
|
||||
|
||||
else if (server_slot <= EQEmu::invbag::BANK_BAGS_END && server_slot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
|
||||
temp_slot = server_slot - EQEmu::invbag::BANK_BAGS_BEGIN;
|
||||
else if (server_slot <= EQ::invbag::BANK_BAGS_END && server_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
|
||||
temp_slot = server_slot - EQ::invbag::BANK_BAGS_BEGIN;
|
||||
|
||||
RoFSlot.Type = invtype::typeBank;
|
||||
RoFSlot.Slot = temp_slot / EQEmu::invbag::SLOT_COUNT;
|
||||
RoFSlot.SubIndex = temp_slot - (RoFSlot.Slot * EQEmu::invbag::SLOT_COUNT);
|
||||
RoFSlot.Slot = temp_slot / EQ::invbag::SLOT_COUNT;
|
||||
RoFSlot.SubIndex = temp_slot - (RoFSlot.Slot * EQ::invbag::SLOT_COUNT);
|
||||
}
|
||||
|
||||
else if (server_slot <= EQEmu::invslot::SHARED_BANK_END && server_slot >= EQEmu::invslot::SHARED_BANK_BEGIN) {
|
||||
else if (server_slot <= EQ::invslot::SHARED_BANK_END && server_slot >= EQ::invslot::SHARED_BANK_BEGIN) {
|
||||
RoFSlot.Type = invtype::typeSharedBank;
|
||||
RoFSlot.Slot = server_slot - EQEmu::invslot::SHARED_BANK_BEGIN;
|
||||
RoFSlot.Slot = server_slot - EQ::invslot::SHARED_BANK_BEGIN;
|
||||
}
|
||||
|
||||
else if (server_slot <= EQEmu::invbag::SHARED_BANK_BAGS_END && server_slot >= EQEmu::invbag::SHARED_BANK_BAGS_BEGIN) {
|
||||
temp_slot = server_slot - EQEmu::invbag::SHARED_BANK_BAGS_BEGIN;
|
||||
else if (server_slot <= EQ::invbag::SHARED_BANK_BAGS_END && server_slot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
|
||||
temp_slot = server_slot - EQ::invbag::SHARED_BANK_BAGS_BEGIN;
|
||||
|
||||
RoFSlot.Type = invtype::typeSharedBank;
|
||||
RoFSlot.Slot = temp_slot / EQEmu::invbag::SLOT_COUNT;
|
||||
RoFSlot.SubIndex = temp_slot - (RoFSlot.Slot * EQEmu::invbag::SLOT_COUNT);
|
||||
RoFSlot.Slot = temp_slot / EQ::invbag::SLOT_COUNT;
|
||||
RoFSlot.SubIndex = temp_slot - (RoFSlot.Slot * EQ::invbag::SLOT_COUNT);
|
||||
}
|
||||
|
||||
else if (server_slot <= EQEmu::invslot::TRADE_END && server_slot >= EQEmu::invslot::TRADE_BEGIN) {
|
||||
else if (server_slot <= EQ::invslot::TRADE_END && server_slot >= EQ::invslot::TRADE_BEGIN) {
|
||||
RoFSlot.Type = invtype::typeTrade;
|
||||
RoFSlot.Slot = server_slot - EQEmu::invslot::TRADE_BEGIN;
|
||||
RoFSlot.Slot = server_slot - EQ::invslot::TRADE_BEGIN;
|
||||
}
|
||||
|
||||
else if (server_slot <= EQEmu::invbag::TRADE_BAGS_END && server_slot >= EQEmu::invbag::TRADE_BAGS_BEGIN) {
|
||||
temp_slot = server_slot - EQEmu::invbag::TRADE_BAGS_BEGIN;
|
||||
else if (server_slot <= EQ::invbag::TRADE_BAGS_END && server_slot >= EQ::invbag::TRADE_BAGS_BEGIN) {
|
||||
temp_slot = server_slot - EQ::invbag::TRADE_BAGS_BEGIN;
|
||||
|
||||
RoFSlot.Type = invtype::typeTrade;
|
||||
RoFSlot.Slot = temp_slot / EQEmu::invbag::SLOT_COUNT;
|
||||
RoFSlot.SubIndex = temp_slot - (RoFSlot.Slot * EQEmu::invbag::SLOT_COUNT);
|
||||
RoFSlot.Slot = temp_slot / EQ::invbag::SLOT_COUNT;
|
||||
RoFSlot.SubIndex = temp_slot - (RoFSlot.Slot * EQ::invbag::SLOT_COUNT);
|
||||
}
|
||||
|
||||
else if (server_slot <= EQEmu::invslot::WORLD_END && server_slot >= EQEmu::invslot::WORLD_BEGIN) {
|
||||
else if (server_slot <= EQ::invslot::WORLD_END && server_slot >= EQ::invslot::WORLD_BEGIN) {
|
||||
RoFSlot.Type = invtype::typeWorld;
|
||||
RoFSlot.Slot = server_slot - EQEmu::invslot::WORLD_BEGIN;
|
||||
RoFSlot.Slot = server_slot - EQ::invslot::WORLD_BEGIN;
|
||||
}
|
||||
|
||||
Log(Logs::Detail,
|
||||
@@ -5674,7 +5683,7 @@ namespace RoF
|
||||
{
|
||||
uint32 RoFSlot = invslot::SLOT_INVALID;
|
||||
|
||||
if (server_corpse_slot <= EQEmu::invslot::CORPSE_END && server_corpse_slot >= EQEmu::invslot::CORPSE_BEGIN) {
|
||||
if (server_corpse_slot <= EQ::invslot::CORPSE_END && server_corpse_slot >= EQ::invslot::CORPSE_BEGIN) {
|
||||
RoFSlot = server_corpse_slot;
|
||||
}
|
||||
|
||||
@@ -5691,18 +5700,18 @@ namespace RoF
|
||||
RoFSlot.AugIndex = invaug::SOCKET_INVALID;
|
||||
RoFSlot.Unknown01 = INULL;
|
||||
|
||||
uint32 TempSlot = EQEmu::invslot::SLOT_INVALID;
|
||||
uint32 TempSlot = EQ::invslot::SLOT_INVALID;
|
||||
|
||||
if (server_type == EQEmu::invtype::typePossessions) {
|
||||
if (server_slot < EQEmu::invtype::POSSESSIONS_SIZE) {
|
||||
if (server_type == EQ::invtype::typePossessions) {
|
||||
if (server_slot < EQ::invtype::POSSESSIONS_SIZE) {
|
||||
RoFSlot.Slot = server_slot;
|
||||
}
|
||||
|
||||
else if (server_slot <= EQEmu::invbag::CURSOR_BAG_END && server_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
|
||||
TempSlot = server_slot - EQEmu::invbag::GENERAL_BAGS_BEGIN;
|
||||
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
||||
TempSlot = server_slot - EQ::invbag::GENERAL_BAGS_BEGIN;
|
||||
|
||||
RoFSlot.Slot = invslot::GENERAL_BEGIN + (TempSlot / EQEmu::invbag::SLOT_COUNT);
|
||||
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot - invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
||||
RoFSlot.Slot = invslot::GENERAL_BEGIN + (TempSlot / EQ::invbag::SLOT_COUNT);
|
||||
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot - invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5723,12 +5732,12 @@ namespace RoF
|
||||
rof_slot.AugIndex,
|
||||
rof_slot.Unknown02,
|
||||
rof_slot.Unknown01,
|
||||
EQEmu::invslot::SLOT_INVALID);
|
||||
EQ::invslot::SLOT_INVALID);
|
||||
|
||||
return EQEmu::invslot::SLOT_INVALID;
|
||||
return EQ::invslot::SLOT_INVALID;
|
||||
}
|
||||
|
||||
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
|
||||
uint32 server_slot = EQ::invslot::SLOT_INVALID;
|
||||
uint32 temp_slot = invslot::SLOT_INVALID;
|
||||
|
||||
switch (rof_slot.Type) {
|
||||
@@ -5738,10 +5747,10 @@ namespace RoF
|
||||
server_slot = rof_slot.Slot;
|
||||
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
|
||||
if (rof_slot.Slot < invslot::GENERAL_BEGIN)
|
||||
return EQEmu::invslot::SLOT_INVALID;
|
||||
return EQ::invslot::SLOT_INVALID;
|
||||
|
||||
temp_slot = (rof_slot.Slot - invslot::GENERAL_BEGIN) * invbag::SLOT_COUNT;
|
||||
server_slot = EQEmu::invbag::GENERAL_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
||||
server_slot = EQ::invbag::GENERAL_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5750,10 +5759,10 @@ namespace RoF
|
||||
case invtype::typeBank: {
|
||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::BANK_SIZE) {
|
||||
if (rof_slot.SubIndex == invbag::SLOT_INVALID) {
|
||||
server_slot = EQEmu::invslot::BANK_BEGIN + rof_slot.Slot;
|
||||
server_slot = EQ::invslot::BANK_BEGIN + rof_slot.Slot;
|
||||
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
|
||||
temp_slot = rof_slot.Slot * invbag::SLOT_COUNT;
|
||||
server_slot = EQEmu::invbag::BANK_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
||||
server_slot = EQ::invbag::BANK_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5762,10 +5771,10 @@ namespace RoF
|
||||
case invtype::typeSharedBank: {
|
||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::SHARED_BANK_SIZE) {
|
||||
if (rof_slot.SubIndex == invbag::SLOT_INVALID) {
|
||||
server_slot = EQEmu::invslot::SHARED_BANK_BEGIN + rof_slot.Slot;
|
||||
server_slot = EQ::invslot::SHARED_BANK_BEGIN + rof_slot.Slot;
|
||||
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
|
||||
temp_slot = rof_slot.Slot * invbag::SLOT_COUNT;
|
||||
server_slot = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
||||
server_slot = EQ::invbag::SHARED_BANK_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5774,10 +5783,10 @@ namespace RoF
|
||||
case invtype::typeTrade: {
|
||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::TRADE_SIZE) {
|
||||
if (rof_slot.SubIndex == invbag::SLOT_INVALID) {
|
||||
server_slot = EQEmu::invslot::TRADE_BEGIN + rof_slot.Slot;
|
||||
server_slot = EQ::invslot::TRADE_BEGIN + rof_slot.Slot;
|
||||
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
|
||||
temp_slot = rof_slot.Slot * invbag::SLOT_COUNT;
|
||||
server_slot = EQEmu::invbag::TRADE_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
||||
server_slot = EQ::invbag::TRADE_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5785,32 +5794,32 @@ namespace RoF
|
||||
}
|
||||
case invtype::typeWorld: {
|
||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::WORLD_SIZE) {
|
||||
server_slot = EQEmu::invslot::WORLD_BEGIN + rof_slot.Slot;
|
||||
server_slot = EQ::invslot::WORLD_BEGIN + rof_slot.Slot;
|
||||
}
|
||||
|
||||
else if (rof_slot.Slot == invslot::SLOT_INVALID) {
|
||||
server_slot = EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
|
||||
server_slot = EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case invtype::typeLimbo: {
|
||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::LIMBO_SIZE) {
|
||||
server_slot = EQEmu::invslot::slotCursor;
|
||||
server_slot = EQ::invslot::slotCursor;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case invtype::typeTribute: {
|
||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::TRIBUTE_SIZE) {
|
||||
server_slot = EQEmu::invslot::TRIBUTE_BEGIN + rof_slot.Slot;
|
||||
server_slot = EQ::invslot::TRIBUTE_BEGIN + rof_slot.Slot;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case invtype::typeGuildTribute: {
|
||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::GUILD_TRIBUTE_SIZE) {
|
||||
server_slot = EQEmu::invslot::GUILD_TRIBUTE_BEGIN + rof_slot.Slot;
|
||||
server_slot = EQ::invslot::GUILD_TRIBUTE_BEGIN + rof_slot.Slot;
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -5844,10 +5853,10 @@ namespace RoF
|
||||
|
||||
static inline uint32 RoFToServerCorpseSlot(structs::InventorySlot_Struct rof_corpse_slot)
|
||||
{
|
||||
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
|
||||
uint32 server_slot = EQ::invslot::SLOT_INVALID;
|
||||
|
||||
if (rof_corpse_slot.Type != invtype::typeCorpse || rof_corpse_slot.SubIndex != invbag::SLOT_INVALID || rof_corpse_slot.AugIndex != invaug::SOCKET_INVALID) {
|
||||
server_slot = EQEmu::invslot::SLOT_INVALID;
|
||||
server_slot = EQ::invslot::SLOT_INVALID;
|
||||
}
|
||||
|
||||
else {
|
||||
@@ -5869,7 +5878,7 @@ namespace RoF
|
||||
}
|
||||
|
||||
static inline uint32 RoFToServerCorpseMainSlot(uint32 rof_corpse_slot) {
|
||||
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
|
||||
uint32 server_slot = EQ::invslot::SLOT_INVALID;
|
||||
|
||||
if (rof_corpse_slot <= invslot::CORPSE_END && rof_corpse_slot >= invslot::CORPSE_BEGIN) {
|
||||
server_slot = rof_corpse_slot;
|
||||
@@ -5895,12 +5904,12 @@ namespace RoF
|
||||
rof_slot.AugIndex,
|
||||
rof_type,
|
||||
rof_slot.Unknown01,
|
||||
EQEmu::invslot::SLOT_INVALID);
|
||||
EQ::invslot::SLOT_INVALID);
|
||||
|
||||
return (uint32) EQEmu::invslot::SLOT_INVALID;
|
||||
return (uint32) EQ::invslot::SLOT_INVALID;
|
||||
}
|
||||
|
||||
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
|
||||
uint32 server_slot = EQ::invslot::SLOT_INVALID;
|
||||
uint32 temp_slot = invslot::SLOT_INVALID;
|
||||
|
||||
switch (rof_type) {
|
||||
@@ -5910,10 +5919,10 @@ namespace RoF
|
||||
server_slot = rof_slot.Slot;
|
||||
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
|
||||
if (rof_slot.Slot < invslot::GENERAL_BEGIN)
|
||||
return EQEmu::invslot::SLOT_INVALID;
|
||||
return EQ::invslot::SLOT_INVALID;
|
||||
|
||||
temp_slot = (rof_slot.Slot - invslot::GENERAL_BEGIN) * invbag::SLOT_COUNT;
|
||||
server_slot = EQEmu::invbag::GENERAL_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
||||
server_slot = EQ::invbag::GENERAL_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5922,10 +5931,10 @@ namespace RoF
|
||||
case invtype::typeBank: {
|
||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::BANK_SIZE) {
|
||||
if (rof_slot.SubIndex == invbag::SLOT_INVALID) {
|
||||
server_slot = EQEmu::invslot::BANK_BEGIN + rof_slot.Slot;
|
||||
server_slot = EQ::invslot::BANK_BEGIN + rof_slot.Slot;
|
||||
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
|
||||
temp_slot = rof_slot.Slot * invbag::SLOT_COUNT;
|
||||
server_slot = EQEmu::invbag::BANK_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
||||
server_slot = EQ::invbag::BANK_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5934,10 +5943,10 @@ namespace RoF
|
||||
case invtype::typeSharedBank: {
|
||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::SHARED_BANK_SIZE) {
|
||||
if (rof_slot.SubIndex == invbag::SLOT_INVALID) {
|
||||
server_slot = EQEmu::invslot::SHARED_BANK_BEGIN + rof_slot.Slot;
|
||||
server_slot = EQ::invslot::SHARED_BANK_BEGIN + rof_slot.Slot;
|
||||
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
|
||||
temp_slot = rof_slot.Slot * invbag::SLOT_COUNT;
|
||||
server_slot = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
||||
server_slot = EQ::invbag::SHARED_BANK_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5946,10 +5955,10 @@ namespace RoF
|
||||
case invtype::typeTrade: {
|
||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::TRADE_SIZE) {
|
||||
if (rof_slot.SubIndex == invbag::SLOT_INVALID) {
|
||||
server_slot = EQEmu::invslot::TRADE_BEGIN + rof_slot.Slot;
|
||||
server_slot = EQ::invslot::TRADE_BEGIN + rof_slot.Slot;
|
||||
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
|
||||
temp_slot = rof_slot.Slot * invbag::SLOT_COUNT;
|
||||
server_slot = EQEmu::invbag::TRADE_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
||||
server_slot = EQ::invbag::TRADE_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5957,32 +5966,32 @@ namespace RoF
|
||||
}
|
||||
case invtype::typeWorld: {
|
||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::WORLD_SIZE) {
|
||||
server_slot = EQEmu::invslot::WORLD_BEGIN + rof_slot.Slot;
|
||||
server_slot = EQ::invslot::WORLD_BEGIN + rof_slot.Slot;
|
||||
}
|
||||
|
||||
else if (rof_slot.Slot == invslot::SLOT_INVALID) {
|
||||
server_slot = EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
|
||||
server_slot = EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case invtype::typeLimbo: {
|
||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::LIMBO_SIZE) {
|
||||
server_slot = EQEmu::invslot::slotCursor;
|
||||
server_slot = EQ::invslot::slotCursor;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case invtype::typeTribute: {
|
||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::TRIBUTE_SIZE) {
|
||||
server_slot = EQEmu::invslot::TRIBUTE_BEGIN + rof_slot.Slot;
|
||||
server_slot = EQ::invslot::TRIBUTE_BEGIN + rof_slot.Slot;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case invtype::typeGuildTribute: {
|
||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::GUILD_TRIBUTE_SIZE) {
|
||||
server_slot = EQEmu::invslot::GUILD_TRIBUTE_BEGIN + rof_slot.Slot;
|
||||
server_slot = EQ::invslot::GUILD_TRIBUTE_BEGIN + rof_slot.Slot;
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -6015,7 +6024,7 @@ namespace RoF
|
||||
|
||||
static inline void ServerToRoFSayLink(std::string& rofSayLink, const std::string& serverSayLink)
|
||||
{
|
||||
if ((constants::SAY_LINK_BODY_SIZE == EQEmu::constants::SAY_LINK_BODY_SIZE) || (serverSayLink.find('\x12') == std::string::npos)) {
|
||||
if ((constants::SAY_LINK_BODY_SIZE == EQ::constants::SAY_LINK_BODY_SIZE) || (serverSayLink.find('\x12') == std::string::npos)) {
|
||||
rofSayLink = serverSayLink;
|
||||
return;
|
||||
}
|
||||
@@ -6024,7 +6033,7 @@ namespace RoF
|
||||
|
||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||
if (segment_iter & 1) {
|
||||
if (segments[segment_iter].length() <= EQEmu::constants::SAY_LINK_BODY_SIZE) {
|
||||
if (segments[segment_iter].length() <= EQ::constants::SAY_LINK_BODY_SIZE) {
|
||||
rofSayLink.append(segments[segment_iter]);
|
||||
// TODO: log size mismatch error
|
||||
continue;
|
||||
@@ -6054,7 +6063,7 @@ namespace RoF
|
||||
|
||||
static inline void RoFToServerSayLink(std::string& serverSayLink, const std::string& rofSayLink)
|
||||
{
|
||||
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (rofSayLink.find('\x12') == std::string::npos)) {
|
||||
if ((EQ::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (rofSayLink.find('\x12') == std::string::npos)) {
|
||||
serverSayLink = rofSayLink;
|
||||
return;
|
||||
}
|
||||
@@ -6086,80 +6095,80 @@ namespace RoF
|
||||
}
|
||||
}
|
||||
|
||||
static inline spells::CastingSlot ServerToRoFCastingSlot(EQEmu::spells::CastingSlot slot)
|
||||
static inline spells::CastingSlot ServerToRoFCastingSlot(EQ::spells::CastingSlot slot)
|
||||
{
|
||||
switch (slot) {
|
||||
case EQEmu::spells::CastingSlot::Gem1:
|
||||
case EQ::spells::CastingSlot::Gem1:
|
||||
return spells::CastingSlot::Gem1;
|
||||
case EQEmu::spells::CastingSlot::Gem2:
|
||||
case EQ::spells::CastingSlot::Gem2:
|
||||
return spells::CastingSlot::Gem2;
|
||||
case EQEmu::spells::CastingSlot::Gem3:
|
||||
case EQ::spells::CastingSlot::Gem3:
|
||||
return spells::CastingSlot::Gem3;
|
||||
case EQEmu::spells::CastingSlot::Gem4:
|
||||
case EQ::spells::CastingSlot::Gem4:
|
||||
return spells::CastingSlot::Gem4;
|
||||
case EQEmu::spells::CastingSlot::Gem5:
|
||||
case EQ::spells::CastingSlot::Gem5:
|
||||
return spells::CastingSlot::Gem5;
|
||||
case EQEmu::spells::CastingSlot::Gem6:
|
||||
case EQ::spells::CastingSlot::Gem6:
|
||||
return spells::CastingSlot::Gem6;
|
||||
case EQEmu::spells::CastingSlot::Gem7:
|
||||
case EQ::spells::CastingSlot::Gem7:
|
||||
return spells::CastingSlot::Gem7;
|
||||
case EQEmu::spells::CastingSlot::Gem8:
|
||||
case EQ::spells::CastingSlot::Gem8:
|
||||
return spells::CastingSlot::Gem8;
|
||||
case EQEmu::spells::CastingSlot::Gem9:
|
||||
case EQ::spells::CastingSlot::Gem9:
|
||||
return spells::CastingSlot::Gem9;
|
||||
case EQEmu::spells::CastingSlot::Gem10:
|
||||
case EQ::spells::CastingSlot::Gem10:
|
||||
return spells::CastingSlot::Gem10;
|
||||
case EQEmu::spells::CastingSlot::Gem11:
|
||||
case EQ::spells::CastingSlot::Gem11:
|
||||
return spells::CastingSlot::Gem11;
|
||||
case EQEmu::spells::CastingSlot::Gem12:
|
||||
case EQ::spells::CastingSlot::Gem12:
|
||||
return spells::CastingSlot::Gem12;
|
||||
case EQEmu::spells::CastingSlot::Item:
|
||||
case EQEmu::spells::CastingSlot::PotionBelt:
|
||||
case EQ::spells::CastingSlot::Item:
|
||||
case EQ::spells::CastingSlot::PotionBelt:
|
||||
return spells::CastingSlot::Item;
|
||||
case EQEmu::spells::CastingSlot::Discipline:
|
||||
case EQ::spells::CastingSlot::Discipline:
|
||||
return spells::CastingSlot::Discipline;
|
||||
case EQEmu::spells::CastingSlot::AltAbility:
|
||||
case EQ::spells::CastingSlot::AltAbility:
|
||||
return spells::CastingSlot::AltAbility;
|
||||
default: // we shouldn't have any issues with other slots ... just return something
|
||||
return spells::CastingSlot::Discipline;
|
||||
}
|
||||
}
|
||||
|
||||
static inline EQEmu::spells::CastingSlot RoFToServerCastingSlot(spells::CastingSlot slot)
|
||||
static inline EQ::spells::CastingSlot RoFToServerCastingSlot(spells::CastingSlot slot)
|
||||
{
|
||||
switch (slot) {
|
||||
case spells::CastingSlot::Gem1:
|
||||
return EQEmu::spells::CastingSlot::Gem1;
|
||||
return EQ::spells::CastingSlot::Gem1;
|
||||
case spells::CastingSlot::Gem2:
|
||||
return EQEmu::spells::CastingSlot::Gem2;
|
||||
return EQ::spells::CastingSlot::Gem2;
|
||||
case spells::CastingSlot::Gem3:
|
||||
return EQEmu::spells::CastingSlot::Gem3;
|
||||
return EQ::spells::CastingSlot::Gem3;
|
||||
case spells::CastingSlot::Gem4:
|
||||
return EQEmu::spells::CastingSlot::Gem4;
|
||||
return EQ::spells::CastingSlot::Gem4;
|
||||
case spells::CastingSlot::Gem5:
|
||||
return EQEmu::spells::CastingSlot::Gem5;
|
||||
return EQ::spells::CastingSlot::Gem5;
|
||||
case spells::CastingSlot::Gem6:
|
||||
return EQEmu::spells::CastingSlot::Gem6;
|
||||
return EQ::spells::CastingSlot::Gem6;
|
||||
case spells::CastingSlot::Gem7:
|
||||
return EQEmu::spells::CastingSlot::Gem7;
|
||||
return EQ::spells::CastingSlot::Gem7;
|
||||
case spells::CastingSlot::Gem8:
|
||||
return EQEmu::spells::CastingSlot::Gem8;
|
||||
return EQ::spells::CastingSlot::Gem8;
|
||||
case spells::CastingSlot::Gem9:
|
||||
return EQEmu::spells::CastingSlot::Gem9;
|
||||
return EQ::spells::CastingSlot::Gem9;
|
||||
case spells::CastingSlot::Gem10:
|
||||
return EQEmu::spells::CastingSlot::Gem10;
|
||||
return EQ::spells::CastingSlot::Gem10;
|
||||
case spells::CastingSlot::Gem11:
|
||||
return EQEmu::spells::CastingSlot::Gem11;
|
||||
return EQ::spells::CastingSlot::Gem11;
|
||||
case spells::CastingSlot::Gem12:
|
||||
return EQEmu::spells::CastingSlot::Gem12;
|
||||
return EQ::spells::CastingSlot::Gem12;
|
||||
case spells::CastingSlot::Discipline:
|
||||
return EQEmu::spells::CastingSlot::Discipline;
|
||||
return EQ::spells::CastingSlot::Discipline;
|
||||
case spells::CastingSlot::Item:
|
||||
return EQEmu::spells::CastingSlot::Item;
|
||||
return EQ::spells::CastingSlot::Item;
|
||||
case spells::CastingSlot::AltAbility:
|
||||
return EQEmu::spells::CastingSlot::AltAbility;
|
||||
return EQ::spells::CastingSlot::AltAbility;
|
||||
default: // we shouldn't have any issues with other slots ... just return something
|
||||
return EQEmu::spells::CastingSlot::Discipline;
|
||||
return EQ::spells::CastingSlot::Discipline;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6168,12 +6177,12 @@ namespace RoF
|
||||
static inline int ServerToRoFBuffSlot(int index)
|
||||
{
|
||||
// we're a disc
|
||||
if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
|
||||
return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
|
||||
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
|
||||
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
|
||||
spells::LONG_BUFFS + spells::SHORT_BUFFS;
|
||||
// we're a song
|
||||
if (index >= EQEmu::spells::LONG_BUFFS)
|
||||
return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
|
||||
if (index >= EQ::spells::LONG_BUFFS)
|
||||
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
|
||||
// we're a normal buff
|
||||
return index; // as long as we guard against bad slots server side, we should be fine
|
||||
}
|
||||
@@ -6182,11 +6191,11 @@ namespace RoF
|
||||
{
|
||||
// we're a disc
|
||||
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
|
||||
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
|
||||
EQEmu::spells::SHORT_BUFFS;
|
||||
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQ::spells::LONG_BUFFS +
|
||||
EQ::spells::SHORT_BUFFS;
|
||||
// we're a song
|
||||
if (index >= spells::LONG_BUFFS)
|
||||
return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS;
|
||||
return index - spells::LONG_BUFFS + EQ::spells::LONG_BUFFS;
|
||||
// we're a normal buff
|
||||
return index; // as long as we guard against bad slots server side, we should be fine
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace RoF
|
||||
protected:
|
||||
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
|
||||
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
||||
|
||||
//magic macro to declare our opcode processors
|
||||
#include "ss_declare.h"
|
||||
|
||||
+187
-219
@@ -37,6 +37,7 @@
|
||||
#include <sstream>
|
||||
#include <numeric>
|
||||
#include <cassert>
|
||||
#include <cinttypes>
|
||||
|
||||
|
||||
namespace RoF2
|
||||
@@ -45,7 +46,7 @@ namespace RoF2
|
||||
static OpcodeManager *opcodes = nullptr;
|
||||
static Strategy struct_strategy;
|
||||
|
||||
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id, uint8 depth, ItemPacketType packet_type);
|
||||
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id, uint8 depth, ItemPacketType packet_type);
|
||||
|
||||
// server to client inventory location converters
|
||||
static inline structs::InventorySlot_Struct ServerToRoF2Slot(uint32 server_slot);
|
||||
@@ -65,8 +66,8 @@ namespace RoF2
|
||||
// client to server say link converter
|
||||
static inline void RoF2ToServerSayLink(std::string &server_saylink, const std::string &rof2_saylink);
|
||||
|
||||
static inline spells::CastingSlot ServerToRoF2CastingSlot(EQEmu::spells::CastingSlot slot);
|
||||
static inline EQEmu::spells::CastingSlot RoF2ToServerCastingSlot(spells::CastingSlot slot);
|
||||
static inline spells::CastingSlot ServerToRoF2CastingSlot(EQ::spells::CastingSlot slot);
|
||||
static inline EQ::spells::CastingSlot RoF2ToServerCastingSlot(spells::CastingSlot slot);
|
||||
|
||||
static inline int ServerToRoF2BuffSlot(int index);
|
||||
static inline int RoF2ToServerBuffSlot(int index);
|
||||
@@ -150,9 +151,9 @@ namespace RoF2
|
||||
return(r);
|
||||
}
|
||||
|
||||
const EQEmu::versions::ClientVersion Strategy::ClientVersion() const
|
||||
const EQ::versions::ClientVersion Strategy::ClientVersion() const
|
||||
{
|
||||
return EQEmu::versions::ClientVersion::RoF2;
|
||||
return EQ::versions::ClientVersion::RoF2;
|
||||
}
|
||||
|
||||
#include "ss_define.h"
|
||||
@@ -262,7 +263,7 @@ namespace RoF2
|
||||
|
||||
eq->unknown000 = 1;
|
||||
OUT(npcid);
|
||||
eq->inventory_slot = ServerToRoF2TypelessSlot(emu->slot, EQEmu::invtype::typePossessions);
|
||||
eq->inventory_slot = ServerToRoF2TypelessSlot(emu->slot, EQ::invtype::typePossessions);
|
||||
OUT(charges);
|
||||
OUT(sell_price);
|
||||
|
||||
@@ -315,7 +316,7 @@ namespace RoF2
|
||||
SETUP_DIRECT_ENCODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct);
|
||||
|
||||
OUT(merchant_entity_id);
|
||||
eq->inventory_slot = ServerToRoF2TypelessSlot(emu->slot_id, EQEmu::invtype::typePossessions);
|
||||
eq->inventory_slot = ServerToRoF2TypelessSlot(emu->slot_id, EQ::invtype::typePossessions);
|
||||
OUT(charges);
|
||||
OUT(cost);
|
||||
|
||||
@@ -339,7 +340,7 @@ namespace RoF2
|
||||
ENCODE_LENGTH_EXACT(ApplyPoison_Struct);
|
||||
SETUP_DIRECT_ENCODE(ApplyPoison_Struct, structs::ApplyPoison_Struct);
|
||||
|
||||
eq->inventorySlot = ServerToRoF2TypelessSlot(emu->inventorySlot, EQEmu::invtype::typePossessions);
|
||||
eq->inventorySlot = ServerToRoF2TypelessSlot(emu->inventorySlot, EQ::invtype::typePossessions);
|
||||
OUT(success);
|
||||
|
||||
FINISH_ENCODE();
|
||||
@@ -570,7 +571,7 @@ namespace RoF2
|
||||
ENCODE_LENGTH_EXACT(CastSpell_Struct);
|
||||
SETUP_DIRECT_ENCODE(CastSpell_Struct, structs::CastSpell_Struct);
|
||||
|
||||
eq->slot = static_cast<uint32>(ServerToRoF2CastingSlot(static_cast<EQEmu::spells::CastingSlot>(emu->slot)));
|
||||
eq->slot = static_cast<uint32>(ServerToRoF2CastingSlot(static_cast<EQ::spells::CastingSlot>(emu->slot)));
|
||||
|
||||
OUT(spell_id);
|
||||
eq->inventory_slot = ServerToRoF2Slot(emu->inventoryslot);
|
||||
@@ -638,24 +639,24 @@ namespace RoF2
|
||||
//store away the emu struct
|
||||
uchar* __emu_buffer = in->pBuffer;
|
||||
|
||||
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
|
||||
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
|
||||
int item_count = in->size / sizeof(EQ::InternalSerializedItem_Struct);
|
||||
if (!item_count || (in->size % sizeof(EQ::InternalSerializedItem_Struct)) != 0) {
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
|
||||
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQ::InternalSerializedItem_Struct));
|
||||
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
|
||||
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
|
||||
EQ::InternalSerializedItem_Struct* eq = (EQ::InternalSerializedItem_Struct*)in->pBuffer;
|
||||
|
||||
EQEmu::OutBuffer ob;
|
||||
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
|
||||
EQ::OutBuffer ob;
|
||||
EQ::OutBuffer::pos_type last_pos = ob.tellp();
|
||||
|
||||
ob.write((const char*)&item_count, sizeof(uint32));
|
||||
|
||||
for (int index = 0; index < item_count; ++index, ++eq) {
|
||||
SerializeItem(ob, (const EQEmu::ItemInstance*)eq->inst, eq->slot_id, 0, ItemPacketCharInventory);
|
||||
SerializeItem(ob, (const EQ::ItemInstance*)eq->inst, eq->slot_id, 0, ItemPacketCharInventory);
|
||||
if (ob.tellp() == last_pos)
|
||||
LogNetcode("RoF2::ENCODE(OP_CharInventory) Serialization failed on item slot [{}] during OP_CharInventory. Item skipped", eq->slot_id);
|
||||
|
||||
@@ -686,25 +687,6 @@ namespace RoF2
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
|
||||
ENCODE(OP_ClientUpdate)
|
||||
{
|
||||
ENCODE_LENGTH_EXACT(PlayerPositionUpdateServer_Struct);
|
||||
SETUP_DIRECT_ENCODE(PlayerPositionUpdateServer_Struct, structs::PlayerPositionUpdateServer_Struct);
|
||||
|
||||
OUT(spawn_id);
|
||||
OUT(x_pos);
|
||||
OUT(delta_x);
|
||||
OUT(delta_y);
|
||||
OUT(z_pos);
|
||||
OUT(delta_heading);
|
||||
OUT(y_pos);
|
||||
OUT(delta_z);
|
||||
OUT(animation);
|
||||
OUT(heading);
|
||||
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
|
||||
ENCODE(OP_Consider)
|
||||
{
|
||||
ENCODE_LENGTH_EXACT(Consider_Struct);
|
||||
@@ -1580,14 +1562,14 @@ namespace RoF2
|
||||
uchar* __emu_buffer = in->pBuffer;
|
||||
|
||||
ItemPacket_Struct* old_item_pkt = (ItemPacket_Struct*)__emu_buffer;
|
||||
EQEmu::InternalSerializedItem_Struct* int_struct = (EQEmu::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
|
||||
EQ::InternalSerializedItem_Struct* int_struct = (EQ::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
|
||||
|
||||
EQEmu::OutBuffer ob;
|
||||
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
|
||||
EQ::OutBuffer ob;
|
||||
EQ::OutBuffer::pos_type last_pos = ob.tellp();
|
||||
|
||||
ob.write((const char*)__emu_buffer, 4);
|
||||
|
||||
SerializeItem(ob, (const EQEmu::ItemInstance*)int_struct->inst, int_struct->slot_id, 0, old_item_pkt->PacketType);
|
||||
SerializeItem(ob, (const EQ::ItemInstance*)int_struct->inst, int_struct->slot_id, 0, old_item_pkt->PacketType);
|
||||
if (ob.tellp() == last_pos) {
|
||||
LogNetcode("RoF2::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
|
||||
delete in;
|
||||
@@ -2032,7 +2014,7 @@ namespace RoF2
|
||||
|
||||
outapp->WriteUInt32(22); // Equipment count
|
||||
|
||||
for (int r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++)
|
||||
for (int r = EQ::textures::textureBegin; r < EQ::textures::materialCount; r++)
|
||||
{
|
||||
outapp->WriteUInt32(emu->item_material.Slot[r].Material);
|
||||
outapp->WriteUInt32(0);
|
||||
@@ -2052,9 +2034,9 @@ namespace RoF2
|
||||
outapp->WriteUInt32(0);
|
||||
}
|
||||
|
||||
outapp->WriteUInt32(EQEmu::textures::materialCount); // Equipment2 count
|
||||
outapp->WriteUInt32(EQ::textures::materialCount); // Equipment2 count
|
||||
|
||||
for (int r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++)
|
||||
for (int r = EQ::textures::textureBegin; r < EQ::textures::materialCount; r++)
|
||||
{
|
||||
outapp->WriteUInt32(0);
|
||||
outapp->WriteUInt32(0);
|
||||
@@ -2063,7 +2045,7 @@ namespace RoF2
|
||||
outapp->WriteUInt32(0);
|
||||
}
|
||||
|
||||
outapp->WriteUInt32(EQEmu::textures::materialCount); // Tint Count
|
||||
outapp->WriteUInt32(EQ::textures::materialCount); // Tint Count
|
||||
|
||||
for (int r = 0; r < 7; r++)
|
||||
{
|
||||
@@ -2073,7 +2055,7 @@ namespace RoF2
|
||||
outapp->WriteUInt32(0);
|
||||
outapp->WriteUInt32(0);
|
||||
|
||||
outapp->WriteUInt32(EQEmu::textures::materialCount); // Tint2 Count
|
||||
outapp->WriteUInt32(EQ::textures::materialCount); // Tint2 Count
|
||||
|
||||
for (int r = 0; r < 7; r++)
|
||||
{
|
||||
@@ -2202,7 +2184,7 @@ namespace RoF2
|
||||
|
||||
outapp->WriteUInt32(spells::SPELLBOOK_SIZE); // Spellbook slots
|
||||
|
||||
if (spells::SPELLBOOK_SIZE <= EQEmu::spells::SPELLBOOK_SIZE) {
|
||||
if (spells::SPELLBOOK_SIZE <= EQ::spells::SPELLBOOK_SIZE) {
|
||||
for (uint32 r = 0; r < spells::SPELLBOOK_SIZE; r++) {
|
||||
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
|
||||
outapp->WriteUInt32(emu->spell_book[r]);
|
||||
@@ -2211,33 +2193,33 @@ namespace RoF2
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (uint32 r = 0; r < EQEmu::spells::SPELLBOOK_SIZE; r++) {
|
||||
for (uint32 r = 0; r < EQ::spells::SPELLBOOK_SIZE; r++) {
|
||||
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
|
||||
outapp->WriteUInt32(emu->spell_book[r]);
|
||||
else
|
||||
outapp->WriteUInt32(0xFFFFFFFFU);
|
||||
}
|
||||
// invalidate the rest of the spellbook slots
|
||||
for (uint32 r = EQEmu::spells::SPELLBOOK_SIZE; r < spells::SPELLBOOK_SIZE; r++) {
|
||||
for (uint32 r = EQ::spells::SPELLBOOK_SIZE; r < spells::SPELLBOOK_SIZE; r++) {
|
||||
outapp->WriteUInt32(0xFFFFFFFFU);
|
||||
}
|
||||
}
|
||||
|
||||
outapp->WriteUInt32(spells::SPELL_GEM_COUNT); // Memorised spell slots
|
||||
|
||||
for (uint32 r = 0; r < EQEmu::spells::SPELL_GEM_COUNT; r++) // write first 12
|
||||
for (uint32 r = 0; r < EQ::spells::SPELL_GEM_COUNT; r++) // write first 12
|
||||
{
|
||||
outapp->WriteUInt32(emu->mem_spells[r]);
|
||||
}
|
||||
// zeroes for the rest of the slots the other 4, which actually don't work on the client at all :D
|
||||
for (uint32 r = 0; r < spells::SPELL_GEM_COUNT - EQEmu::spells::SPELL_GEM_COUNT; r++)
|
||||
for (uint32 r = 0; r < spells::SPELL_GEM_COUNT - EQ::spells::SPELL_GEM_COUNT; r++)
|
||||
{
|
||||
outapp->WriteUInt32(0xFFFFFFFFU);
|
||||
}
|
||||
|
||||
outapp->WriteUInt32(13); // gem refresh counts
|
||||
|
||||
for (uint32 r = 0; r < EQEmu::spells::SPELL_GEM_COUNT; r++)
|
||||
for (uint32 r = 0; r < EQ::spells::SPELL_GEM_COUNT; r++)
|
||||
{
|
||||
outapp->WriteUInt32(emu->spellSlotRefresh[r]); // spell gem refresh
|
||||
}
|
||||
@@ -2326,7 +2308,7 @@ namespace RoF2
|
||||
outapp->WriteUInt32(profile::BANDOLIERS_SIZE);
|
||||
|
||||
// Copy bandoliers where server and client indices converge
|
||||
for (uint32 r = 0; r < EQEmu::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
|
||||
for (uint32 r = 0; r < EQ::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
|
||||
outapp->WriteString(emu->bandoliers[r].Name);
|
||||
for (uint32 j = 0; j < profile::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
|
||||
outapp->WriteString(emu->bandoliers[r].Items[j].Name);
|
||||
@@ -2341,7 +2323,7 @@ namespace RoF2
|
||||
}
|
||||
}
|
||||
// Nullify bandoliers where server and client indices diverge, with a client bias
|
||||
for (uint32 r = EQEmu::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
|
||||
for (uint32 r = EQ::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
|
||||
outapp->WriteString("");
|
||||
for (uint32 j = 0; j < profile::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
|
||||
outapp->WriteString("");
|
||||
@@ -2353,7 +2335,7 @@ namespace RoF2
|
||||
outapp->WriteUInt32(profile::POTION_BELT_SIZE);
|
||||
|
||||
// Copy potion belt where server and client indices converge
|
||||
for (uint32 r = 0; r < EQEmu::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
|
||||
for (uint32 r = 0; r < EQ::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
|
||||
outapp->WriteString(emu->potionbelt.Items[r].Name);
|
||||
outapp->WriteUInt32(emu->potionbelt.Items[r].ID);
|
||||
if (emu->potionbelt.Items[r].Icon) {
|
||||
@@ -2365,7 +2347,7 @@ namespace RoF2
|
||||
}
|
||||
}
|
||||
// Nullify potion belt where server and client indices diverge, with a client bias
|
||||
for (uint32 r = EQEmu::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
|
||||
for (uint32 r = EQ::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
|
||||
outapp->WriteString("");
|
||||
outapp->WriteUInt32(0);
|
||||
outapp->WriteSInt32(-1);
|
||||
@@ -2482,9 +2464,9 @@ namespace RoF2
|
||||
outapp->WriteUInt8(0); // Unknown
|
||||
outapp->WriteUInt8(0); // Unknown
|
||||
|
||||
outapp->WriteUInt32(EQEmu::invtype::TRIBUTE_SIZE);
|
||||
outapp->WriteUInt32(EQ::invtype::TRIBUTE_SIZE);
|
||||
|
||||
for (uint32 r = 0; r < EQEmu::invtype::TRIBUTE_SIZE; r++)
|
||||
for (uint32 r = 0; r < EQ::invtype::TRIBUTE_SIZE; r++)
|
||||
{
|
||||
outapp->WriteUInt32(emu->tributes[r].tribute);
|
||||
outapp->WriteUInt32(emu->tributes[r].tier);
|
||||
@@ -3033,7 +3015,7 @@ namespace RoF2
|
||||
eq_cse->Gender = emu_cse->Gender;
|
||||
eq_cse->Face = emu_cse->Face;
|
||||
|
||||
for (int equip_index = 0; equip_index < EQEmu::textures::materialCount; equip_index++) {
|
||||
for (int equip_index = 0; equip_index < EQ::textures::materialCount; equip_index++) {
|
||||
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
|
||||
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
|
||||
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
|
||||
@@ -3132,7 +3114,7 @@ namespace RoF2
|
||||
SETUP_DIRECT_ENCODE(Merchant_Purchase_Struct, structs::Merchant_Purchase_Struct);
|
||||
|
||||
OUT(npcid);
|
||||
eq->inventory_slot = ServerToRoF2TypelessSlot(emu->itemslot, EQEmu::invtype::typePossessions);
|
||||
eq->inventory_slot = ServerToRoF2TypelessSlot(emu->itemslot, EQ::invtype::typePossessions);
|
||||
//OUT(itemslot);
|
||||
OUT(quantity);
|
||||
OUT(price);
|
||||
@@ -3567,7 +3549,7 @@ namespace RoF2
|
||||
{
|
||||
eq->items[i].Unknown18 = 0;
|
||||
if (i < 80) {
|
||||
snprintf(eq->items[i].SerialNumber, sizeof(eq->items[i].SerialNumber), "%016d", emu->SerialNumber[i]);
|
||||
snprintf(eq->items[i].SerialNumber, sizeof(eq->items[i].SerialNumber), "%016" PRId64, emu->SerialNumber[i]);
|
||||
eq->ItemCost[i] = emu->ItemCost[i];
|
||||
}
|
||||
else {
|
||||
@@ -4201,7 +4183,7 @@ namespace RoF2
|
||||
|
||||
if ((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
|
||||
{
|
||||
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; ++k)
|
||||
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; ++k)
|
||||
{
|
||||
{
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment_tint.Slot[k].Color);
|
||||
@@ -4210,7 +4192,7 @@ namespace RoF2
|
||||
|
||||
structs::Texture_Struct *Equipment = (structs::Texture_Struct *)Buffer;
|
||||
|
||||
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
|
||||
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; k++) {
|
||||
Equipment[k].Material = emu->equipment.Slot[k].Material;
|
||||
Equipment[k].Unknown1 = emu->equipment.Slot[k].Unknown1;
|
||||
Equipment[k].EliteMaterial = emu->equipment.Slot[k].EliteModel;
|
||||
@@ -4218,7 +4200,7 @@ namespace RoF2
|
||||
Equipment[k].Material2 = emu->equipment.Slot[k].Unknown2;
|
||||
}
|
||||
|
||||
Buffer += (sizeof(structs::Texture_Struct) * EQEmu::textures::materialCount);
|
||||
Buffer += (sizeof(structs::Texture_Struct) * EQ::textures::materialCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4545,27 +4527,6 @@ namespace RoF2
|
||||
FINISH_DIRECT_DECODE();
|
||||
}
|
||||
|
||||
DECODE(OP_ClientUpdate)
|
||||
{
|
||||
// for some odd reason, there is an extra byte on the end of this on occasion..
|
||||
DECODE_LENGTH_ATLEAST(structs::PlayerPositionUpdateClient_Struct);
|
||||
SETUP_DIRECT_DECODE(PlayerPositionUpdateClient_Struct, structs::PlayerPositionUpdateClient_Struct);
|
||||
|
||||
IN(spawn_id);
|
||||
IN(sequence);
|
||||
IN(x_pos);
|
||||
IN(y_pos);
|
||||
IN(z_pos);
|
||||
IN(heading);
|
||||
IN(delta_x);
|
||||
IN(delta_y);
|
||||
IN(delta_z);
|
||||
IN(delta_heading);
|
||||
IN(animation);
|
||||
|
||||
FINISH_DIRECT_DECODE();
|
||||
}
|
||||
|
||||
DECODE(OP_Consider)
|
||||
{
|
||||
DECODE_LENGTH_EXACT(structs::Consider_Struct);
|
||||
@@ -4950,7 +4911,7 @@ namespace RoF2
|
||||
|
||||
IN(item_id);
|
||||
int r;
|
||||
for (r = EQEmu::invaug::SOCKET_BEGIN; r <= EQEmu::invaug::SOCKET_END; r++) {
|
||||
for (r = EQ::invaug::SOCKET_BEGIN; r <= EQ::invaug::SOCKET_END; r++) {
|
||||
IN(augments[r]);
|
||||
}
|
||||
IN(link_hash);
|
||||
@@ -4975,7 +4936,7 @@ namespace RoF2
|
||||
DECODE_LENGTH_EXACT(structs::LoadSpellSet_Struct);
|
||||
SETUP_DIRECT_DECODE(LoadSpellSet_Struct, structs::LoadSpellSet_Struct);
|
||||
|
||||
for (unsigned int i = 0; i < EQEmu::spells::SPELL_GEM_COUNT; ++i)
|
||||
for (unsigned int i = 0; i < EQ::spells::SPELL_GEM_COUNT; ++i)
|
||||
{
|
||||
if (eq->spell[i] == 0)
|
||||
emu->spell[i] = 0xFFFFFFFF;
|
||||
@@ -5385,9 +5346,9 @@ namespace RoF2
|
||||
return NextItemInstSerialNumber;
|
||||
}
|
||||
|
||||
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id_in, uint8 depth, ItemPacketType packet_type)
|
||||
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id_in, uint8 depth, ItemPacketType packet_type)
|
||||
{
|
||||
const EQEmu::ItemData *item = inst->GetUnscaledItem();
|
||||
const EQ::ItemData *item = inst->GetUnscaledItem();
|
||||
|
||||
RoF2::structs::ItemSerializationHeader hdr;
|
||||
|
||||
@@ -5450,7 +5411,7 @@ namespace RoF2
|
||||
uint32 hero_model = 0;
|
||||
|
||||
if (inst->GetOrnamentationIDFile()) {
|
||||
hero_model = inst->GetOrnamentHeroModel(EQEmu::InventoryProfile::CalcMaterialFromSlot(slot_id_in));
|
||||
hero_model = inst->GetOrnamentHeroModel(EQ::InventoryProfile::CalcMaterialFromSlot(slot_id_in));
|
||||
|
||||
char tmp[30];
|
||||
memset(tmp, 0x0, 30);
|
||||
@@ -5650,6 +5611,12 @@ namespace RoF2
|
||||
itbs.no_transfer = item->NoTransfer;
|
||||
itbs.expendablearrow = item->ExpendableArrow;
|
||||
|
||||
// Done to hack older clients to label expendable fishing poles as such
|
||||
// July 28th, 2018 patch
|
||||
if (item->ItemType == EQ::item::ItemTypeFishingPole && item->SubType == 0) {
|
||||
itbs.expendablearrow = 1;
|
||||
}
|
||||
|
||||
itbs.unknown8 = 0;
|
||||
itbs.unknown9 = 0;
|
||||
itbs.unknown10 = 0;
|
||||
@@ -5798,6 +5765,7 @@ namespace RoF2
|
||||
iqbs.HealAmt = item->HealAmt;
|
||||
iqbs.SpellDmg = item->SpellDmg;
|
||||
iqbs.Clairvoyance = item->Clairvoyance;
|
||||
iqbs.SubType = item->SubType;
|
||||
|
||||
//unknown18; //Power Source Capacity or evolve filename?
|
||||
//evolve_string; // Some String, but being evolution related is just a guess
|
||||
@@ -5814,28 +5782,28 @@ namespace RoF2
|
||||
|
||||
ob.write((const char*)&iqbs, sizeof(RoF2::structs::ItemQuaternaryBodyStruct));
|
||||
|
||||
EQEmu::OutBuffer::pos_type count_pos = ob.tellp();
|
||||
EQ::OutBuffer::pos_type count_pos = ob.tellp();
|
||||
uint32 subitem_count = 0;
|
||||
|
||||
ob.write((const char*)&subitem_count, sizeof(uint32));
|
||||
|
||||
// moved outside of loop since it is not modified within that scope
|
||||
int16 SubSlotNumber = EQEmu::invbag::SLOT_INVALID;
|
||||
int16 SubSlotNumber = EQ::invbag::SLOT_INVALID;
|
||||
|
||||
if (slot_id_in <= EQEmu::invslot::GENERAL_END && slot_id_in >= EQEmu::invslot::GENERAL_BEGIN)
|
||||
SubSlotNumber = EQEmu::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
||||
else if (slot_id_in == EQEmu::invslot::slotCursor)
|
||||
SubSlotNumber = EQEmu::invbag::CURSOR_BAG_BEGIN;
|
||||
else if (slot_id_in <= EQEmu::invslot::BANK_END && slot_id_in >= EQEmu::invslot::BANK_BEGIN)
|
||||
SubSlotNumber = EQEmu::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
||||
else if (slot_id_in <= EQEmu::invslot::SHARED_BANK_END && slot_id_in >= EQEmu::invslot::SHARED_BANK_BEGIN)
|
||||
SubSlotNumber = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::SHARED_BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
||||
if (slot_id_in <= EQ::invslot::GENERAL_END && slot_id_in >= EQ::invslot::GENERAL_BEGIN)
|
||||
SubSlotNumber = EQ::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQ::invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||
else if (slot_id_in == EQ::invslot::slotCursor)
|
||||
SubSlotNumber = EQ::invbag::CURSOR_BAG_BEGIN;
|
||||
else if (slot_id_in <= EQ::invslot::BANK_END && slot_id_in >= EQ::invslot::BANK_BEGIN)
|
||||
SubSlotNumber = EQ::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||
else if (slot_id_in <= EQ::invslot::SHARED_BANK_END && slot_id_in >= EQ::invslot::SHARED_BANK_BEGIN)
|
||||
SubSlotNumber = EQ::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::SHARED_BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||
else
|
||||
SubSlotNumber = slot_id_in; // not sure if this is the best way to handle this..leaving for now
|
||||
|
||||
if (SubSlotNumber != EQEmu::invbag::SLOT_INVALID) {
|
||||
for (uint32 index = EQEmu::invbag::SLOT_BEGIN; index <= EQEmu::invbag::SLOT_END; ++index) {
|
||||
EQEmu::ItemInstance* sub = inst->GetItem(index);
|
||||
if (SubSlotNumber != EQ::invbag::SLOT_INVALID) {
|
||||
for (uint32 index = EQ::invbag::SLOT_BEGIN; index <= EQ::invbag::SLOT_END; ++index) {
|
||||
EQ::ItemInstance* sub = inst->GetItem(index);
|
||||
if (!sub)
|
||||
continue;
|
||||
|
||||
@@ -5860,77 +5828,77 @@ namespace RoF2
|
||||
RoF2Slot.AugIndex = invaug::SOCKET_INVALID;
|
||||
RoF2Slot.Unknown01 = INULL;
|
||||
|
||||
uint32 TempSlot = EQEmu::invslot::SLOT_INVALID;
|
||||
uint32 TempSlot = EQ::invslot::SLOT_INVALID;
|
||||
|
||||
if (server_slot < EQEmu::invtype::POSSESSIONS_SIZE) {
|
||||
if (server_slot < EQ::invtype::POSSESSIONS_SIZE) {
|
||||
RoF2Slot.Type = invtype::typePossessions;
|
||||
RoF2Slot.Slot = server_slot;
|
||||
}
|
||||
|
||||
else if (server_slot <= EQEmu::invbag::CURSOR_BAG_END && server_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
|
||||
TempSlot = server_slot - EQEmu::invbag::GENERAL_BAGS_BEGIN;
|
||||
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
||||
TempSlot = server_slot - EQ::invbag::GENERAL_BAGS_BEGIN;
|
||||
|
||||
RoF2Slot.Type = invtype::typePossessions;
|
||||
RoF2Slot.Slot = invslot::GENERAL_BEGIN + (TempSlot / EQEmu::invbag::SLOT_COUNT);
|
||||
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot - invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
||||
RoF2Slot.Slot = invslot::GENERAL_BEGIN + (TempSlot / EQ::invbag::SLOT_COUNT);
|
||||
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot - invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||
}
|
||||
|
||||
else if (server_slot <= EQEmu::invslot::TRIBUTE_END && server_slot >= EQEmu::invslot::TRIBUTE_BEGIN) {
|
||||
else if (server_slot <= EQ::invslot::TRIBUTE_END && server_slot >= EQ::invslot::TRIBUTE_BEGIN) {
|
||||
RoF2Slot.Type = invtype::typeTribute;
|
||||
RoF2Slot.Slot = server_slot - EQEmu::invslot::TRIBUTE_BEGIN;
|
||||
RoF2Slot.Slot = server_slot - EQ::invslot::TRIBUTE_BEGIN;
|
||||
}
|
||||
|
||||
else if (server_slot <= EQEmu::invslot::GUILD_TRIBUTE_END && server_slot >= EQEmu::invslot::GUILD_TRIBUTE_BEGIN) {
|
||||
else if (server_slot <= EQ::invslot::GUILD_TRIBUTE_END && server_slot >= EQ::invslot::GUILD_TRIBUTE_BEGIN) {
|
||||
RoF2Slot.Type = invtype::typeGuildTribute;
|
||||
RoF2Slot.Slot = server_slot - EQEmu::invslot::GUILD_TRIBUTE_BEGIN;
|
||||
RoF2Slot.Slot = server_slot - EQ::invslot::GUILD_TRIBUTE_BEGIN;
|
||||
}
|
||||
|
||||
else if (server_slot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
|
||||
else if (server_slot == EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
|
||||
RoF2Slot.Type = invtype::typeWorld;
|
||||
}
|
||||
|
||||
else if (server_slot <= EQEmu::invslot::BANK_END && server_slot >= EQEmu::invslot::BANK_BEGIN) {
|
||||
else if (server_slot <= EQ::invslot::BANK_END && server_slot >= EQ::invslot::BANK_BEGIN) {
|
||||
RoF2Slot.Type = invtype::typeBank;
|
||||
RoF2Slot.Slot = server_slot - EQEmu::invslot::BANK_BEGIN;
|
||||
RoF2Slot.Slot = server_slot - EQ::invslot::BANK_BEGIN;
|
||||
}
|
||||
|
||||
else if (server_slot <= EQEmu::invbag::BANK_BAGS_END && server_slot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
|
||||
TempSlot = server_slot - EQEmu::invbag::BANK_BAGS_BEGIN;
|
||||
else if (server_slot <= EQ::invbag::BANK_BAGS_END && server_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
|
||||
TempSlot = server_slot - EQ::invbag::BANK_BAGS_BEGIN;
|
||||
|
||||
RoF2Slot.Type = invtype::typeBank;
|
||||
RoF2Slot.Slot = TempSlot / EQEmu::invbag::SLOT_COUNT;
|
||||
RoF2Slot.SubIndex = TempSlot - (RoF2Slot.Slot * EQEmu::invbag::SLOT_COUNT);
|
||||
RoF2Slot.Slot = TempSlot / EQ::invbag::SLOT_COUNT;
|
||||
RoF2Slot.SubIndex = TempSlot - (RoF2Slot.Slot * EQ::invbag::SLOT_COUNT);
|
||||
}
|
||||
|
||||
else if (server_slot <= EQEmu::invslot::SHARED_BANK_END && server_slot >= EQEmu::invslot::SHARED_BANK_BEGIN) {
|
||||
else if (server_slot <= EQ::invslot::SHARED_BANK_END && server_slot >= EQ::invslot::SHARED_BANK_BEGIN) {
|
||||
RoF2Slot.Type = invtype::typeSharedBank;
|
||||
RoF2Slot.Slot = server_slot - EQEmu::invslot::SHARED_BANK_BEGIN;
|
||||
RoF2Slot.Slot = server_slot - EQ::invslot::SHARED_BANK_BEGIN;
|
||||
}
|
||||
|
||||
else if (server_slot <= EQEmu::invbag::SHARED_BANK_BAGS_END && server_slot >= EQEmu::invbag::SHARED_BANK_BAGS_BEGIN) {
|
||||
TempSlot = server_slot - EQEmu::invbag::SHARED_BANK_BAGS_BEGIN;
|
||||
else if (server_slot <= EQ::invbag::SHARED_BANK_BAGS_END && server_slot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
|
||||
TempSlot = server_slot - EQ::invbag::SHARED_BANK_BAGS_BEGIN;
|
||||
|
||||
RoF2Slot.Type = invtype::typeSharedBank;
|
||||
RoF2Slot.Slot = TempSlot / EQEmu::invbag::SLOT_COUNT;
|
||||
RoF2Slot.SubIndex = TempSlot - (RoF2Slot.Slot * EQEmu::invbag::SLOT_COUNT);
|
||||
RoF2Slot.Slot = TempSlot / EQ::invbag::SLOT_COUNT;
|
||||
RoF2Slot.SubIndex = TempSlot - (RoF2Slot.Slot * EQ::invbag::SLOT_COUNT);
|
||||
}
|
||||
|
||||
else if (server_slot <= EQEmu::invslot::TRADE_END && server_slot >= EQEmu::invslot::TRADE_BEGIN) {
|
||||
else if (server_slot <= EQ::invslot::TRADE_END && server_slot >= EQ::invslot::TRADE_BEGIN) {
|
||||
RoF2Slot.Type = invtype::typeTrade;
|
||||
RoF2Slot.Slot = server_slot - EQEmu::invslot::TRADE_BEGIN;
|
||||
RoF2Slot.Slot = server_slot - EQ::invslot::TRADE_BEGIN;
|
||||
}
|
||||
|
||||
else if (server_slot <= EQEmu::invbag::TRADE_BAGS_END && server_slot >= EQEmu::invbag::TRADE_BAGS_BEGIN) {
|
||||
TempSlot = server_slot - EQEmu::invbag::TRADE_BAGS_BEGIN;
|
||||
else if (server_slot <= EQ::invbag::TRADE_BAGS_END && server_slot >= EQ::invbag::TRADE_BAGS_BEGIN) {
|
||||
TempSlot = server_slot - EQ::invbag::TRADE_BAGS_BEGIN;
|
||||
|
||||
RoF2Slot.Type = invtype::typeTrade;
|
||||
RoF2Slot.Slot = TempSlot / EQEmu::invbag::SLOT_COUNT;
|
||||
RoF2Slot.SubIndex = TempSlot - (RoF2Slot.Slot * EQEmu::invbag::SLOT_COUNT);
|
||||
RoF2Slot.Slot = TempSlot / EQ::invbag::SLOT_COUNT;
|
||||
RoF2Slot.SubIndex = TempSlot - (RoF2Slot.Slot * EQ::invbag::SLOT_COUNT);
|
||||
}
|
||||
|
||||
else if (server_slot <= EQEmu::invslot::WORLD_END && server_slot >= EQEmu::invslot::WORLD_BEGIN) {
|
||||
else if (server_slot <= EQ::invslot::WORLD_END && server_slot >= EQ::invslot::WORLD_BEGIN) {
|
||||
RoF2Slot.Type = invtype::typeWorld;
|
||||
RoF2Slot.Slot = server_slot - EQEmu::invslot::WORLD_BEGIN;
|
||||
RoF2Slot.Slot = server_slot - EQ::invslot::WORLD_BEGIN;
|
||||
}
|
||||
|
||||
Log(Logs::Detail, Logs::Netcode, "Convert Server Slot %i to RoF2 Slot [%i, %i, %i, %i] (unk2: %i, unk1: %i)",
|
||||
@@ -5962,7 +5930,7 @@ namespace RoF2
|
||||
{
|
||||
uint32 RoF2Slot = invslot::SLOT_INVALID;
|
||||
|
||||
if (server_corpse_slot <= EQEmu::invslot::CORPSE_END && server_corpse_slot >= EQEmu::invslot::CORPSE_BEGIN) {
|
||||
if (server_corpse_slot <= EQ::invslot::CORPSE_END && server_corpse_slot >= EQ::invslot::CORPSE_BEGIN) {
|
||||
RoF2Slot = server_corpse_slot;
|
||||
}
|
||||
|
||||
@@ -5979,18 +5947,18 @@ namespace RoF2
|
||||
RoF2Slot.AugIndex = invaug::SOCKET_INVALID;
|
||||
RoF2Slot.Unknown01 = INULL;
|
||||
|
||||
uint32 TempSlot = EQEmu::invslot::SLOT_INVALID;
|
||||
uint32 TempSlot = EQ::invslot::SLOT_INVALID;
|
||||
|
||||
if (server_type == EQEmu::invtype::typePossessions) {
|
||||
if (server_slot < EQEmu::invtype::POSSESSIONS_SIZE) {
|
||||
if (server_type == EQ::invtype::typePossessions) {
|
||||
if (server_slot < EQ::invtype::POSSESSIONS_SIZE) {
|
||||
RoF2Slot.Slot = server_slot;
|
||||
}
|
||||
|
||||
else if (server_slot <= EQEmu::invbag::CURSOR_BAG_END && server_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
|
||||
TempSlot = server_slot - EQEmu::invbag::GENERAL_BAGS_BEGIN;
|
||||
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
||||
TempSlot = server_slot - EQ::invbag::GENERAL_BAGS_BEGIN;
|
||||
|
||||
RoF2Slot.Slot = invslot::GENERAL_BEGIN + (TempSlot / EQEmu::invbag::SLOT_COUNT);
|
||||
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot - invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
||||
RoF2Slot.Slot = invslot::GENERAL_BEGIN + (TempSlot / EQ::invbag::SLOT_COUNT);
|
||||
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot - invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6004,12 +5972,12 @@ namespace RoF2
|
||||
{
|
||||
if (rof2_slot.AugIndex < invaug::SOCKET_INVALID || rof2_slot.AugIndex >= invaug::SOCKET_COUNT) {
|
||||
Log(Logs::Detail, Logs::Netcode, "Convert RoF2 Slot [%i, %i, %i, %i] (unk2: %i, unk1: %i) to Server Slot %i",
|
||||
rof2_slot.Type, rof2_slot.Slot, rof2_slot.SubIndex, rof2_slot.AugIndex, rof2_slot.Unknown02, rof2_slot.Unknown01, EQEmu::invslot::SLOT_INVALID);
|
||||
rof2_slot.Type, rof2_slot.Slot, rof2_slot.SubIndex, rof2_slot.AugIndex, rof2_slot.Unknown02, rof2_slot.Unknown01, EQ::invslot::SLOT_INVALID);
|
||||
|
||||
return EQEmu::invslot::SLOT_INVALID;
|
||||
return EQ::invslot::SLOT_INVALID;
|
||||
}
|
||||
|
||||
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
|
||||
uint32 server_slot = EQ::invslot::SLOT_INVALID;
|
||||
uint32 temp_slot = invslot::SLOT_INVALID;
|
||||
|
||||
switch (rof2_slot.Type) {
|
||||
@@ -6021,10 +5989,10 @@ namespace RoF2
|
||||
|
||||
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
|
||||
if (rof2_slot.Slot < invslot::GENERAL_BEGIN)
|
||||
return EQEmu::invslot::SLOT_INVALID;
|
||||
return EQ::invslot::SLOT_INVALID;
|
||||
|
||||
temp_slot = (rof2_slot.Slot - invslot::GENERAL_BEGIN) * invbag::SLOT_COUNT;
|
||||
server_slot = EQEmu::invbag::GENERAL_BAGS_BEGIN + temp_slot + rof2_slot.SubIndex;
|
||||
server_slot = EQ::invbag::GENERAL_BAGS_BEGIN + temp_slot + rof2_slot.SubIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6033,12 +6001,12 @@ namespace RoF2
|
||||
case invtype::typeBank: {
|
||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::BANK_SIZE) {
|
||||
if (rof2_slot.SubIndex == invbag::SLOT_INVALID) {
|
||||
server_slot = EQEmu::invslot::BANK_BEGIN + rof2_slot.Slot;
|
||||
server_slot = EQ::invslot::BANK_BEGIN + rof2_slot.Slot;
|
||||
}
|
||||
|
||||
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
|
||||
temp_slot = rof2_slot.Slot * invbag::SLOT_COUNT;
|
||||
server_slot = EQEmu::invbag::BANK_BAGS_BEGIN + temp_slot + rof2_slot.SubIndex;
|
||||
server_slot = EQ::invbag::BANK_BAGS_BEGIN + temp_slot + rof2_slot.SubIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6047,12 +6015,12 @@ namespace RoF2
|
||||
case invtype::typeSharedBank: {
|
||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::SHARED_BANK_SIZE) {
|
||||
if (rof2_slot.SubIndex == invbag::SLOT_INVALID) {
|
||||
server_slot = EQEmu::invslot::SHARED_BANK_BEGIN + rof2_slot.Slot;
|
||||
server_slot = EQ::invslot::SHARED_BANK_BEGIN + rof2_slot.Slot;
|
||||
}
|
||||
|
||||
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
|
||||
temp_slot = rof2_slot.Slot * invbag::SLOT_COUNT;
|
||||
server_slot = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + temp_slot + rof2_slot.SubIndex;
|
||||
server_slot = EQ::invbag::SHARED_BANK_BAGS_BEGIN + temp_slot + rof2_slot.SubIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6061,12 +6029,12 @@ namespace RoF2
|
||||
case invtype::typeTrade: {
|
||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::TRADE_SIZE) {
|
||||
if (rof2_slot.SubIndex == invbag::SLOT_INVALID) {
|
||||
server_slot = EQEmu::invslot::TRADE_BEGIN + rof2_slot.Slot;
|
||||
server_slot = EQ::invslot::TRADE_BEGIN + rof2_slot.Slot;
|
||||
}
|
||||
|
||||
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
|
||||
temp_slot = rof2_slot.Slot * invbag::SLOT_COUNT;
|
||||
server_slot = EQEmu::invbag::TRADE_BAGS_BEGIN + temp_slot + rof2_slot.SubIndex;
|
||||
server_slot = EQ::invbag::TRADE_BAGS_BEGIN + temp_slot + rof2_slot.SubIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6074,32 +6042,32 @@ namespace RoF2
|
||||
}
|
||||
case invtype::typeWorld: {
|
||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::WORLD_SIZE) {
|
||||
server_slot = EQEmu::invslot::WORLD_BEGIN + rof2_slot.Slot;
|
||||
server_slot = EQ::invslot::WORLD_BEGIN + rof2_slot.Slot;
|
||||
}
|
||||
|
||||
else if (rof2_slot.Slot == invslot::SLOT_INVALID) {
|
||||
server_slot = EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
|
||||
server_slot = EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case invtype::typeLimbo: {
|
||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::LIMBO_SIZE) {
|
||||
server_slot = EQEmu::invslot::slotCursor;
|
||||
server_slot = EQ::invslot::slotCursor;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case invtype::typeTribute: {
|
||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::TRIBUTE_SIZE) {
|
||||
server_slot = EQEmu::invslot::TRIBUTE_BEGIN + rof2_slot.Slot;
|
||||
server_slot = EQ::invslot::TRIBUTE_BEGIN + rof2_slot.Slot;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case invtype::typeGuildTribute: {
|
||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::GUILD_TRIBUTE_SIZE) {
|
||||
server_slot = EQEmu::invslot::GUILD_TRIBUTE_BEGIN + rof2_slot.Slot;
|
||||
server_slot = EQ::invslot::GUILD_TRIBUTE_BEGIN + rof2_slot.Slot;
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -6125,10 +6093,10 @@ namespace RoF2
|
||||
|
||||
static inline uint32 RoF2ToServerCorpseSlot(structs::InventorySlot_Struct rof2_corpse_slot)
|
||||
{
|
||||
uint32 ServerSlot = EQEmu::invslot::SLOT_INVALID;
|
||||
uint32 ServerSlot = EQ::invslot::SLOT_INVALID;
|
||||
|
||||
if (rof2_corpse_slot.Type != invtype::typeCorpse || rof2_corpse_slot.SubIndex != invbag::SLOT_INVALID || rof2_corpse_slot.AugIndex != invaug::SOCKET_INVALID) {
|
||||
ServerSlot = EQEmu::invslot::SLOT_INVALID;
|
||||
ServerSlot = EQ::invslot::SLOT_INVALID;
|
||||
}
|
||||
|
||||
else {
|
||||
@@ -6143,7 +6111,7 @@ namespace RoF2
|
||||
|
||||
static inline uint32 RoF2ToServerCorpseMainSlot(uint32 rof2_corpse_slot)
|
||||
{
|
||||
uint32 ServerSlot = EQEmu::invslot::SLOT_INVALID;
|
||||
uint32 ServerSlot = EQ::invslot::SLOT_INVALID;
|
||||
|
||||
if (rof2_corpse_slot <= invslot::CORPSE_END && rof2_corpse_slot >= invslot::CORPSE_BEGIN) {
|
||||
ServerSlot = rof2_corpse_slot;
|
||||
@@ -6158,12 +6126,12 @@ namespace RoF2
|
||||
{
|
||||
if (rof2_slot.AugIndex < invaug::SOCKET_INVALID || rof2_slot.AugIndex >= invaug::SOCKET_COUNT) {
|
||||
Log(Logs::Detail, Logs::Netcode, "Convert RoF2 Typeless Slot [%i, %i, %i] (implied type: %i, unk1: %i) to Server Slot %i",
|
||||
rof2_slot.Slot, rof2_slot.SubIndex, rof2_slot.AugIndex, rof2_type, rof2_slot.Unknown01, EQEmu::invslot::SLOT_INVALID);
|
||||
rof2_slot.Slot, rof2_slot.SubIndex, rof2_slot.AugIndex, rof2_type, rof2_slot.Unknown01, EQ::invslot::SLOT_INVALID);
|
||||
|
||||
return EQEmu::invslot::SLOT_INVALID;
|
||||
return EQ::invslot::SLOT_INVALID;
|
||||
}
|
||||
|
||||
uint32 ServerSlot = EQEmu::invslot::SLOT_INVALID;
|
||||
uint32 ServerSlot = EQ::invslot::SLOT_INVALID;
|
||||
uint32 TempSlot = invslot::SLOT_INVALID;
|
||||
|
||||
switch (rof2_type) {
|
||||
@@ -6175,10 +6143,10 @@ namespace RoF2
|
||||
|
||||
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
|
||||
if (rof2_slot.Slot < invslot::GENERAL_BEGIN)
|
||||
return EQEmu::invslot::SLOT_INVALID;
|
||||
return EQ::invslot::SLOT_INVALID;
|
||||
|
||||
TempSlot = (rof2_slot.Slot - invslot::GENERAL_BEGIN) * invbag::SLOT_COUNT;
|
||||
ServerSlot = EQEmu::invbag::GENERAL_BAGS_BEGIN + TempSlot + rof2_slot.SubIndex;
|
||||
ServerSlot = EQ::invbag::GENERAL_BAGS_BEGIN + TempSlot + rof2_slot.SubIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6187,12 +6155,12 @@ namespace RoF2
|
||||
case invtype::typeBank: {
|
||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::BANK_SIZE) {
|
||||
if (rof2_slot.SubIndex == invbag::SLOT_INVALID) {
|
||||
ServerSlot = EQEmu::invslot::BANK_BEGIN + rof2_slot.Slot;
|
||||
ServerSlot = EQ::invslot::BANK_BEGIN + rof2_slot.Slot;
|
||||
}
|
||||
|
||||
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
|
||||
TempSlot = rof2_slot.Slot * invbag::SLOT_COUNT;
|
||||
ServerSlot = EQEmu::invbag::BANK_BAGS_BEGIN + TempSlot + rof2_slot.SubIndex;
|
||||
ServerSlot = EQ::invbag::BANK_BAGS_BEGIN + TempSlot + rof2_slot.SubIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6201,12 +6169,12 @@ namespace RoF2
|
||||
case invtype::typeSharedBank: {
|
||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::SHARED_BANK_SIZE) {
|
||||
if (rof2_slot.SubIndex == invbag::SLOT_INVALID) {
|
||||
ServerSlot = EQEmu::invslot::SHARED_BANK_BEGIN + rof2_slot.Slot;
|
||||
ServerSlot = EQ::invslot::SHARED_BANK_BEGIN + rof2_slot.Slot;
|
||||
}
|
||||
|
||||
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
|
||||
TempSlot = rof2_slot.Slot * invbag::SLOT_COUNT;
|
||||
ServerSlot = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + TempSlot + rof2_slot.SubIndex;
|
||||
ServerSlot = EQ::invbag::SHARED_BANK_BAGS_BEGIN + TempSlot + rof2_slot.SubIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6215,12 +6183,12 @@ namespace RoF2
|
||||
case invtype::typeTrade: {
|
||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::TRADE_SIZE) {
|
||||
if (rof2_slot.SubIndex == invbag::SLOT_INVALID) {
|
||||
ServerSlot = EQEmu::invslot::TRADE_BEGIN + rof2_slot.Slot;
|
||||
ServerSlot = EQ::invslot::TRADE_BEGIN + rof2_slot.Slot;
|
||||
}
|
||||
|
||||
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
|
||||
TempSlot = rof2_slot.Slot * invbag::SLOT_COUNT;
|
||||
ServerSlot = EQEmu::invbag::TRADE_BAGS_BEGIN + TempSlot + rof2_slot.SubIndex;
|
||||
ServerSlot = EQ::invbag::TRADE_BAGS_BEGIN + TempSlot + rof2_slot.SubIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6228,32 +6196,32 @@ namespace RoF2
|
||||
}
|
||||
case invtype::typeWorld: {
|
||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::WORLD_SIZE) {
|
||||
ServerSlot = EQEmu::invslot::WORLD_BEGIN + rof2_slot.Slot;
|
||||
ServerSlot = EQ::invslot::WORLD_BEGIN + rof2_slot.Slot;
|
||||
}
|
||||
|
||||
else if (rof2_slot.Slot == invslot::SLOT_INVALID) {
|
||||
ServerSlot = EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
|
||||
ServerSlot = EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case invtype::typeLimbo: {
|
||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::LIMBO_SIZE) {
|
||||
ServerSlot = EQEmu::invslot::slotCursor;
|
||||
ServerSlot = EQ::invslot::slotCursor;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case invtype::typeTribute: {
|
||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::TRIBUTE_SIZE) {
|
||||
ServerSlot = EQEmu::invslot::TRIBUTE_BEGIN + rof2_slot.Slot;
|
||||
ServerSlot = EQ::invslot::TRIBUTE_BEGIN + rof2_slot.Slot;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case invtype::typeGuildTribute: {
|
||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::GUILD_TRIBUTE_SIZE) {
|
||||
ServerSlot = EQEmu::invslot::GUILD_TRIBUTE_BEGIN + rof2_slot.Slot;
|
||||
ServerSlot = EQ::invslot::GUILD_TRIBUTE_BEGIN + rof2_slot.Slot;
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -6279,7 +6247,7 @@ namespace RoF2
|
||||
|
||||
static inline void ServerToRoF2SayLink(std::string &rof2_saylink, const std::string &server_saylink)
|
||||
{
|
||||
if ((constants::SAY_LINK_BODY_SIZE == EQEmu::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
|
||||
if ((constants::SAY_LINK_BODY_SIZE == EQ::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
|
||||
rof2_saylink = server_saylink;
|
||||
return;
|
||||
}
|
||||
@@ -6288,7 +6256,7 @@ namespace RoF2
|
||||
|
||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||
if (segment_iter & 1) {
|
||||
if (segments[segment_iter].length() <= EQEmu::constants::SAY_LINK_BODY_SIZE) {
|
||||
if (segments[segment_iter].length() <= EQ::constants::SAY_LINK_BODY_SIZE) {
|
||||
rof2_saylink.append(segments[segment_iter]);
|
||||
// TODO: log size mismatch error
|
||||
continue;
|
||||
@@ -6311,7 +6279,7 @@ namespace RoF2
|
||||
|
||||
static inline void RoF2ToServerSayLink(std::string &server_saylink, const std::string &rof2_saylink)
|
||||
{
|
||||
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (rof2_saylink.find('\x12') == std::string::npos)) {
|
||||
if ((EQ::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (rof2_saylink.find('\x12') == std::string::npos)) {
|
||||
server_saylink = rof2_saylink;
|
||||
return;
|
||||
}
|
||||
@@ -6341,80 +6309,80 @@ namespace RoF2
|
||||
}
|
||||
}
|
||||
|
||||
static inline spells::CastingSlot ServerToRoF2CastingSlot(EQEmu::spells::CastingSlot slot)
|
||||
static inline spells::CastingSlot ServerToRoF2CastingSlot(EQ::spells::CastingSlot slot)
|
||||
{
|
||||
switch (slot) {
|
||||
case EQEmu::spells::CastingSlot::Gem1:
|
||||
case EQ::spells::CastingSlot::Gem1:
|
||||
return spells::CastingSlot::Gem1;
|
||||
case EQEmu::spells::CastingSlot::Gem2:
|
||||
case EQ::spells::CastingSlot::Gem2:
|
||||
return spells::CastingSlot::Gem2;
|
||||
case EQEmu::spells::CastingSlot::Gem3:
|
||||
case EQ::spells::CastingSlot::Gem3:
|
||||
return spells::CastingSlot::Gem3;
|
||||
case EQEmu::spells::CastingSlot::Gem4:
|
||||
case EQ::spells::CastingSlot::Gem4:
|
||||
return spells::CastingSlot::Gem4;
|
||||
case EQEmu::spells::CastingSlot::Gem5:
|
||||
case EQ::spells::CastingSlot::Gem5:
|
||||
return spells::CastingSlot::Gem5;
|
||||
case EQEmu::spells::CastingSlot::Gem6:
|
||||
case EQ::spells::CastingSlot::Gem6:
|
||||
return spells::CastingSlot::Gem6;
|
||||
case EQEmu::spells::CastingSlot::Gem7:
|
||||
case EQ::spells::CastingSlot::Gem7:
|
||||
return spells::CastingSlot::Gem7;
|
||||
case EQEmu::spells::CastingSlot::Gem8:
|
||||
case EQ::spells::CastingSlot::Gem8:
|
||||
return spells::CastingSlot::Gem8;
|
||||
case EQEmu::spells::CastingSlot::Gem9:
|
||||
case EQ::spells::CastingSlot::Gem9:
|
||||
return spells::CastingSlot::Gem9;
|
||||
case EQEmu::spells::CastingSlot::Gem10:
|
||||
case EQ::spells::CastingSlot::Gem10:
|
||||
return spells::CastingSlot::Gem10;
|
||||
case EQEmu::spells::CastingSlot::Gem11:
|
||||
case EQ::spells::CastingSlot::Gem11:
|
||||
return spells::CastingSlot::Gem11;
|
||||
case EQEmu::spells::CastingSlot::Gem12:
|
||||
case EQ::spells::CastingSlot::Gem12:
|
||||
return spells::CastingSlot::Gem12;
|
||||
case EQEmu::spells::CastingSlot::Item:
|
||||
case EQEmu::spells::CastingSlot::PotionBelt:
|
||||
case EQ::spells::CastingSlot::Item:
|
||||
case EQ::spells::CastingSlot::PotionBelt:
|
||||
return spells::CastingSlot::Item;
|
||||
case EQEmu::spells::CastingSlot::Discipline:
|
||||
case EQ::spells::CastingSlot::Discipline:
|
||||
return spells::CastingSlot::Discipline;
|
||||
case EQEmu::spells::CastingSlot::AltAbility:
|
||||
case EQ::spells::CastingSlot::AltAbility:
|
||||
return spells::CastingSlot::AltAbility;
|
||||
default: // we shouldn't have any issues with other slots ... just return something
|
||||
return spells::CastingSlot::Discipline;
|
||||
}
|
||||
}
|
||||
|
||||
static inline EQEmu::spells::CastingSlot RoF2ToServerCastingSlot(spells::CastingSlot slot)
|
||||
static inline EQ::spells::CastingSlot RoF2ToServerCastingSlot(spells::CastingSlot slot)
|
||||
{
|
||||
switch (slot) {
|
||||
case spells::CastingSlot::Gem1:
|
||||
return EQEmu::spells::CastingSlot::Gem1;
|
||||
return EQ::spells::CastingSlot::Gem1;
|
||||
case spells::CastingSlot::Gem2:
|
||||
return EQEmu::spells::CastingSlot::Gem2;
|
||||
return EQ::spells::CastingSlot::Gem2;
|
||||
case spells::CastingSlot::Gem3:
|
||||
return EQEmu::spells::CastingSlot::Gem3;
|
||||
return EQ::spells::CastingSlot::Gem3;
|
||||
case spells::CastingSlot::Gem4:
|
||||
return EQEmu::spells::CastingSlot::Gem4;
|
||||
return EQ::spells::CastingSlot::Gem4;
|
||||
case spells::CastingSlot::Gem5:
|
||||
return EQEmu::spells::CastingSlot::Gem5;
|
||||
return EQ::spells::CastingSlot::Gem5;
|
||||
case spells::CastingSlot::Gem6:
|
||||
return EQEmu::spells::CastingSlot::Gem6;
|
||||
return EQ::spells::CastingSlot::Gem6;
|
||||
case spells::CastingSlot::Gem7:
|
||||
return EQEmu::spells::CastingSlot::Gem7;
|
||||
return EQ::spells::CastingSlot::Gem7;
|
||||
case spells::CastingSlot::Gem8:
|
||||
return EQEmu::spells::CastingSlot::Gem8;
|
||||
return EQ::spells::CastingSlot::Gem8;
|
||||
case spells::CastingSlot::Gem9:
|
||||
return EQEmu::spells::CastingSlot::Gem9;
|
||||
return EQ::spells::CastingSlot::Gem9;
|
||||
case spells::CastingSlot::Gem10:
|
||||
return EQEmu::spells::CastingSlot::Gem10;
|
||||
return EQ::spells::CastingSlot::Gem10;
|
||||
case spells::CastingSlot::Gem11:
|
||||
return EQEmu::spells::CastingSlot::Gem11;
|
||||
return EQ::spells::CastingSlot::Gem11;
|
||||
case spells::CastingSlot::Gem12:
|
||||
return EQEmu::spells::CastingSlot::Gem12;
|
||||
return EQ::spells::CastingSlot::Gem12;
|
||||
case spells::CastingSlot::Discipline:
|
||||
return EQEmu::spells::CastingSlot::Discipline;
|
||||
return EQ::spells::CastingSlot::Discipline;
|
||||
case spells::CastingSlot::Item:
|
||||
return EQEmu::spells::CastingSlot::Item;
|
||||
return EQ::spells::CastingSlot::Item;
|
||||
case spells::CastingSlot::AltAbility:
|
||||
return EQEmu::spells::CastingSlot::AltAbility;
|
||||
return EQ::spells::CastingSlot::AltAbility;
|
||||
default: // we shouldn't have any issues with other slots ... just return something
|
||||
return EQEmu::spells::CastingSlot::Discipline;
|
||||
return EQ::spells::CastingSlot::Discipline;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6423,12 +6391,12 @@ namespace RoF2
|
||||
static inline int ServerToRoF2BuffSlot(int index)
|
||||
{
|
||||
// we're a disc
|
||||
if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
|
||||
return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
|
||||
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
|
||||
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
|
||||
spells::LONG_BUFFS + spells::SHORT_BUFFS;
|
||||
// we're a song
|
||||
if (index >= EQEmu::spells::LONG_BUFFS)
|
||||
return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
|
||||
if (index >= EQ::spells::LONG_BUFFS)
|
||||
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
|
||||
// we're a normal buff
|
||||
return index; // as long as we guard against bad slots server side, we should be fine
|
||||
}
|
||||
@@ -6437,11 +6405,11 @@ namespace RoF2
|
||||
{
|
||||
// we're a disc
|
||||
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
|
||||
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
|
||||
EQEmu::spells::SHORT_BUFFS;
|
||||
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQ::spells::LONG_BUFFS +
|
||||
EQ::spells::SHORT_BUFFS;
|
||||
// we're a song
|
||||
if (index >= spells::LONG_BUFFS)
|
||||
return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS;
|
||||
return index - spells::LONG_BUFFS + EQ::spells::LONG_BUFFS;
|
||||
// we're a normal buff
|
||||
return index; // as long as we guard against bad slots server side, we should be fine
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace RoF2
|
||||
protected:
|
||||
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
|
||||
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
||||
|
||||
//magic macro to declare our opcode processors
|
||||
#include "ss_declare.h"
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace RoF2
|
||||
const int16 INULL = 0;
|
||||
|
||||
namespace inventory {
|
||||
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||
inline EQ::versions::ClientVersion GetInventoryRef() { return EQ::versions::ClientVersion::RoF2; }
|
||||
|
||||
const bool ConcatenateInvTypeLimbo = false;
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace RoF2
|
||||
} /*inventory*/
|
||||
|
||||
namespace invtype {
|
||||
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||
inline EQ::versions::ClientVersion GetInvTypeRef() { return EQ::versions::ClientVersion::RoF2; }
|
||||
|
||||
namespace enum_ {
|
||||
enum InventoryTypes : int16 {
|
||||
@@ -118,7 +118,7 @@ namespace RoF2
|
||||
} /*invtype*/
|
||||
|
||||
namespace invslot {
|
||||
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||
inline EQ::versions::ClientVersion GetInvSlotRef() { return EQ::versions::ClientVersion::RoF2; }
|
||||
|
||||
namespace enum_ {
|
||||
enum InventorySlots : int16 {
|
||||
@@ -196,7 +196,7 @@ namespace RoF2
|
||||
} /*invslot*/
|
||||
|
||||
namespace invbag {
|
||||
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||
inline EQ::versions::ClientVersion GetInvBagRef() { return EQ::versions::ClientVersion::RoF2; }
|
||||
|
||||
const int16 SLOT_INVALID = IINVALID;
|
||||
const int16 SLOT_BEGIN = INULL;
|
||||
@@ -208,7 +208,7 @@ namespace RoF2
|
||||
} /*invbag*/
|
||||
|
||||
namespace invaug {
|
||||
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||
inline EQ::versions::ClientVersion GetInvAugRef() { return EQ::versions::ClientVersion::RoF2; }
|
||||
|
||||
const int16 SOCKET_INVALID = IINVALID;
|
||||
const int16 SOCKET_BEGIN = INULL;
|
||||
@@ -220,7 +220,7 @@ namespace RoF2
|
||||
} /*invaug*/
|
||||
|
||||
namespace item {
|
||||
inline EQEmu::versions::ClientVersion GetItemRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||
inline EQ::versions::ClientVersion GetItemRef() { return EQ::versions::ClientVersion::RoF2; }
|
||||
|
||||
//enum Unknown : int { // looks like item class..but, RoF has it too - nothing in UF-
|
||||
// Unknown1 = 0,
|
||||
@@ -249,7 +249,7 @@ namespace RoF2
|
||||
} /*item*/
|
||||
|
||||
namespace profile {
|
||||
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||
inline EQ::versions::ClientVersion GetProfileRef() { return EQ::versions::ClientVersion::RoF2; }
|
||||
|
||||
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
|
||||
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
||||
@@ -261,11 +261,11 @@ namespace RoF2
|
||||
} /*profile*/
|
||||
|
||||
namespace constants {
|
||||
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||
inline EQ::versions::ClientVersion GetConstantsRef() { return EQ::versions::ClientVersion::RoF2; }
|
||||
|
||||
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::RoF;
|
||||
const uint32 EXPANSION_BIT = EQEmu::expansions::bitRoF;
|
||||
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskRoF;
|
||||
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::RoF;
|
||||
const uint32 EXPANSION_BIT = EQ::expansions::bitRoF;
|
||||
const uint32 EXPANSIONS_MASK = EQ::expansions::maskRoF;
|
||||
|
||||
const size_t CHARACTER_CREATION_LIMIT = 12;
|
||||
|
||||
@@ -274,21 +274,21 @@ namespace RoF2
|
||||
} /*constants*/
|
||||
|
||||
namespace behavior {
|
||||
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||
inline EQ::versions::ClientVersion GetBehaviorRef() { return EQ::versions::ClientVersion::RoF2; }
|
||||
|
||||
const bool CoinHasWeight = false;
|
||||
|
||||
} /*behavior*/
|
||||
|
||||
namespace skills {
|
||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::RoF2; }
|
||||
|
||||
const size_t LastUsableSkill = EQEmu::skills::Skill2HPiercing;
|
||||
const size_t LastUsableSkill = EQ::skills::Skill2HPiercing;
|
||||
|
||||
} /*skills*/
|
||||
|
||||
namespace spells {
|
||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::RoF2; }
|
||||
|
||||
enum class CastingSlot : uint32 {
|
||||
Gem1 = 0,
|
||||
|
||||
@@ -52,7 +52,6 @@ E(OP_CastSpell)
|
||||
E(OP_ChannelMessage)
|
||||
E(OP_CharInventory)
|
||||
E(OP_ClickObjectAction)
|
||||
E(OP_ClientUpdate)
|
||||
E(OP_Consider)
|
||||
E(OP_Damage)
|
||||
E(OP_DeleteCharge)
|
||||
@@ -155,7 +154,6 @@ D(OP_BuffRemoveRequest)
|
||||
D(OP_CastSpell)
|
||||
D(OP_ChannelMessage)
|
||||
D(OP_CharacterCreate)
|
||||
D(OP_ClientUpdate)
|
||||
D(OP_Consider)
|
||||
D(OP_ConsiderCorpse)
|
||||
D(OP_Consume)
|
||||
|
||||
@@ -190,7 +190,7 @@ struct TintProfile
|
||||
Tint_Struct Primary;
|
||||
Tint_Struct Secondary;
|
||||
};
|
||||
Tint_Struct Slot[EQEmu::textures::materialCount];
|
||||
Tint_Struct Slot[EQ::textures::materialCount];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -222,7 +222,7 @@ struct Texture_Struct
|
||||
// Texture_Struct Primary;
|
||||
// Texture_Struct Secondary;
|
||||
// };
|
||||
// Texture_Struct Slot[EQEmu::textures::TextureCount];
|
||||
// Texture_Struct Slot[EQ::textures::TextureCount];
|
||||
// };
|
||||
//
|
||||
// TextureProfile();
|
||||
@@ -1113,7 +1113,7 @@ union
|
||||
/*00184*/ Texture_Struct equipment[22]; // Total Slots
|
||||
};
|
||||
/*00624*/ uint32 equip2_count; // Seen 9
|
||||
/*00628*/ Texture_Struct equipment2[EQEmu::textures::materialCount]; // Appears to be Visible slots, but all 0s
|
||||
/*00628*/ Texture_Struct equipment2[EQ::textures::materialCount]; // Appears to be Visible slots, but all 0s
|
||||
/*00808*/ uint32 tint_count; // Seen 9
|
||||
/*00812*/ TintProfile item_tint; // RR GG BB 00
|
||||
/*00848*/ uint32 tint_count2; // Seen 9
|
||||
@@ -1620,24 +1620,24 @@ struct RespawnWindow_Struct {
|
||||
*/
|
||||
struct PlayerPositionUpdateServer_Struct
|
||||
{
|
||||
/*0000*/ uint16 spawn_id;
|
||||
/*0002*/ uint16 spawnId2;
|
||||
/*0004*/ signed padding0004 : 12;
|
||||
signed y_pos : 19; // y coord
|
||||
unsigned padding : 1;
|
||||
/*0008*/ signed delta_z : 13; // change in z
|
||||
signed delta_x : 13; // change in x
|
||||
signed padding0008 : 6;
|
||||
/*0012*/ signed x_pos : 19; // x coord
|
||||
unsigned heading : 12; // heading
|
||||
signed padding0016 : 1;
|
||||
/*0016*/ signed delta_heading : 10; // change in heading
|
||||
signed z_pos : 19; // z coord
|
||||
signed padding0020 : 3;
|
||||
/*0020*/ signed animation : 10; // animation
|
||||
signed delta_y : 13; // change in y
|
||||
signed padding0024 : 9;
|
||||
/*0024*/
|
||||
/*0000*/ uint16 spawn_id;
|
||||
/*0002*/ uint16 vehicle_id;
|
||||
/*0004*/ signed padding0004 : 12;
|
||||
signed y_pos : 19; // y coord
|
||||
unsigned padding : 1;
|
||||
/*0008*/ signed delta_z : 13; // change in z
|
||||
signed delta_x : 13; // change in x
|
||||
signed padding0008 : 6;
|
||||
/*0012*/ signed x_pos : 19; // x coord
|
||||
unsigned heading : 12; // heading
|
||||
signed padding0016 : 1;
|
||||
/*0016*/ signed delta_heading : 10; // change in heading
|
||||
signed z_pos : 19; // z coord
|
||||
signed padding0020 : 3;
|
||||
/*0020*/ signed animation : 10; // animation
|
||||
signed delta_y : 13; // change in y
|
||||
signed padding0024 : 9;
|
||||
/*0024*/
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -1648,22 +1648,23 @@ struct PlayerPositionUpdateServer_Struct
|
||||
*/
|
||||
struct PlayerPositionUpdateClient_Struct
|
||||
{
|
||||
/*0000*/ uint16 sequence; // increments one each packet - Verified
|
||||
/*0002*/ uint16 spawn_id; // Player's spawn id
|
||||
/*0004*/ uint8 unknown0004[6]; // ***Placeholder
|
||||
/*0010*/ float delta_x; // Change in x
|
||||
/*0014*/ unsigned heading : 12; // Directional heading
|
||||
unsigned padding0040 : 20; // ***Placeholder
|
||||
/*0018*/ float x_pos; // x coord (2nd loc value)
|
||||
/*0022*/ float delta_z; // Change in z
|
||||
/*0026*/ float z_pos; // z coord (3rd loc value)
|
||||
/*0030*/ float y_pos; // y coord (1st loc value)
|
||||
/*0034*/ unsigned animation : 10; // ***Placeholder
|
||||
unsigned padding0024 : 22; // animation
|
||||
/*0038*/ float delta_y; // Change in y
|
||||
/*0042*/ signed delta_heading : 10; // change in heading
|
||||
unsigned padding0041 : 22; // ***Placeholder
|
||||
/*0046*/
|
||||
/*0000*/ uint16 sequence; // increments one each packet - Verified
|
||||
/*0002*/ uint16 spawn_id; // Player's spawn id
|
||||
/*0004*/ uint16 vehicle_id; // Player's vehicle spawn id
|
||||
/*0006*/ uint8 unknown0004[4]; // ***Placeholder
|
||||
/*0010*/ float delta_x; // Change in x
|
||||
/*0014*/ unsigned heading : 12; // Directional heading
|
||||
unsigned padding0040 : 20; // ***Placeholder
|
||||
/*0018*/ float x_pos; // x coord (2nd loc value)
|
||||
/*0022*/ float delta_z; // Change in z
|
||||
/*0026*/ float z_pos; // z coord (3rd loc value)
|
||||
/*0030*/ float y_pos; // y coord (1st loc value)
|
||||
/*0034*/ unsigned animation : 10; // ***Placeholder
|
||||
unsigned padding0024 : 22; // animation
|
||||
/*0038*/ float delta_y; // Change in y
|
||||
/*0042*/ signed delta_heading : 10; // change in heading
|
||||
unsigned padding0041 : 22; // ***Placeholder
|
||||
/*0046*/
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -4400,7 +4401,7 @@ struct SendAA_Struct {
|
||||
/*0104*/ uint32 special_category;
|
||||
/*0108*/ uint8 shroud;
|
||||
/*0109*/ uint8 unknown109;
|
||||
/*0110*/ uint8 layonhands; // 1 for lay on hands -- doesn't seem to matter?
|
||||
/*0110*/ uint8 reset_on_death; // timer is reset on death
|
||||
/*0111*/ uint8 unknown111;
|
||||
/*0112*/ uint32 total_abilities;
|
||||
/*0116*/ AA_Ability abilities[0];
|
||||
@@ -4803,8 +4804,8 @@ struct ItemQuaternaryBodyStruct
|
||||
int32 HealAmt;
|
||||
int32 SpellDmg;
|
||||
int32 Clairvoyance;
|
||||
uint8 unknown18; //Power Source Capacity or evolve filename?
|
||||
uint32 evolve_string; // Some String, but being evolution related is just a guess
|
||||
int32 SubType;
|
||||
uint8 evolve_string; // Some String, but being evolution related is just a guess
|
||||
uint8 unknown19;
|
||||
uint16 unknown20;
|
||||
uint8 unknown21;
|
||||
|
||||
+15
-15
@@ -31,7 +31,7 @@ namespace RoF
|
||||
const int16 INULL = 0;
|
||||
|
||||
namespace inventory {
|
||||
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||
inline EQ::versions::ClientVersion GetInventoryRef() { return EQ::versions::ClientVersion::RoF; }
|
||||
|
||||
const bool ConcatenateInvTypeLimbo = false;
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace RoF
|
||||
} /*inventory*/
|
||||
|
||||
namespace invtype {
|
||||
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||
inline EQ::versions::ClientVersion GetInvTypeRef() { return EQ::versions::ClientVersion::RoF; }
|
||||
|
||||
namespace enum_ {
|
||||
enum InventoryTypes : int16 {
|
||||
@@ -116,7 +116,7 @@ namespace RoF
|
||||
} /*invtype*/
|
||||
|
||||
namespace invslot {
|
||||
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||
inline EQ::versions::ClientVersion GetInvSlotRef() { return EQ::versions::ClientVersion::RoF; }
|
||||
|
||||
namespace enum_ {
|
||||
enum InventorySlots : int16 {
|
||||
@@ -194,7 +194,7 @@ namespace RoF
|
||||
} /*invslot*/
|
||||
|
||||
namespace invbag {
|
||||
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||
inline EQ::versions::ClientVersion GetInvBagRef() { return EQ::versions::ClientVersion::RoF; }
|
||||
|
||||
const int16 SLOT_INVALID = IINVALID;
|
||||
const int16 SLOT_BEGIN = INULL;
|
||||
@@ -206,7 +206,7 @@ namespace RoF
|
||||
} /*invbag*/
|
||||
|
||||
namespace invaug {
|
||||
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||
inline EQ::versions::ClientVersion GetInvAugRef() { return EQ::versions::ClientVersion::RoF; }
|
||||
|
||||
const int16 SOCKET_INVALID = IINVALID;
|
||||
const int16 SOCKET_BEGIN = INULL;
|
||||
@@ -218,7 +218,7 @@ namespace RoF
|
||||
} /*invaug*/
|
||||
|
||||
namespace item {
|
||||
inline EQEmu::versions::ClientVersion GetItemRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||
inline EQ::versions::ClientVersion GetItemRef() { return EQ::versions::ClientVersion::RoF; }
|
||||
|
||||
enum ItemPacketType : int {
|
||||
ItemPacketMerchant = 100,
|
||||
@@ -240,7 +240,7 @@ namespace RoF
|
||||
} /*item*/
|
||||
|
||||
namespace profile {
|
||||
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||
inline EQ::versions::ClientVersion GetProfileRef() { return EQ::versions::ClientVersion::RoF; }
|
||||
|
||||
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
|
||||
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
||||
@@ -252,11 +252,11 @@ namespace RoF
|
||||
} /*profile*/
|
||||
|
||||
namespace constants {
|
||||
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||
inline EQ::versions::ClientVersion GetConstantsRef() { return EQ::versions::ClientVersion::RoF; }
|
||||
|
||||
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::RoF;
|
||||
const uint32 EXPANSION_BIT = EQEmu::expansions::bitRoF;
|
||||
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskRoF;
|
||||
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::RoF;
|
||||
const uint32 EXPANSION_BIT = EQ::expansions::bitRoF;
|
||||
const uint32 EXPANSIONS_MASK = EQ::expansions::maskRoF;
|
||||
|
||||
const size_t CHARACTER_CREATION_LIMIT = 12;
|
||||
|
||||
@@ -265,21 +265,21 @@ namespace RoF
|
||||
} /*constants*/
|
||||
|
||||
namespace behavior {
|
||||
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||
inline EQ::versions::ClientVersion GetBehaviorRef() { return EQ::versions::ClientVersion::RoF; }
|
||||
|
||||
const bool CoinHasWeight = false;
|
||||
|
||||
} /*behavior*/
|
||||
|
||||
namespace skills {
|
||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::RoF; }
|
||||
|
||||
const size_t LastUsableSkill = EQEmu::skills::SkillTripleAttack;
|
||||
const size_t LastUsableSkill = EQ::skills::SkillTripleAttack;
|
||||
|
||||
} /*skills*/
|
||||
|
||||
namespace spells {
|
||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::RoF; }
|
||||
|
||||
enum class CastingSlot : uint32 {
|
||||
Gem1 = 0,
|
||||
|
||||
@@ -190,7 +190,7 @@ struct TintProfile
|
||||
Tint_Struct Primary;
|
||||
Tint_Struct Secondary;
|
||||
};
|
||||
Tint_Struct Slot[EQEmu::textures::materialCount];
|
||||
Tint_Struct Slot[EQ::textures::materialCount];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -222,7 +222,7 @@ struct Texture_Struct
|
||||
// Texture_Struct Primary;
|
||||
// Texture_Struct Secondary;
|
||||
// };
|
||||
// Texture_Struct Slot[EQEmu::textures::TextureCount];
|
||||
// Texture_Struct Slot[EQ::textures::TextureCount];
|
||||
// };
|
||||
//
|
||||
// TextureProfile();
|
||||
@@ -1608,22 +1608,22 @@ struct RespawnWindow_Struct {
|
||||
*/
|
||||
struct PlayerPositionUpdateServer_Struct
|
||||
{
|
||||
/*0000*/ uint16 spawn_id;
|
||||
/*0002*/ uint16 spawnId2;
|
||||
/*0004*/ signed padding0004:12;
|
||||
signed y_pos:19; // y coord
|
||||
unsigned padding:1;
|
||||
/*0008*/ signed delta_x:13; // change in x
|
||||
signed delta_heading:10;// change in heading
|
||||
signed padding0008:9;
|
||||
/*0012*/ signed delta_y:13; // change in y
|
||||
signed z_pos:19; // z coord
|
||||
/*0016*/ signed x_pos:19; // x coord
|
||||
signed animation:10; // animation
|
||||
signed padding0016:3;
|
||||
/*0020*/ unsigned heading:12; // heading
|
||||
signed delta_z:13; // change in z
|
||||
signed padding0020:7;
|
||||
/*0000*/ uint16 spawn_id;
|
||||
/*0002*/ uint16 vehicle_id;
|
||||
/*0004*/ signed padding0004 : 12;
|
||||
signed y_pos : 19; // y coord
|
||||
unsigned padding : 1;
|
||||
/*0008*/ signed delta_x : 13; // change in x
|
||||
signed delta_heading : 10; // change in heading
|
||||
signed padding0008 : 9;
|
||||
/*0012*/ signed delta_y : 13; // change in y
|
||||
signed z_pos : 19; // z coord
|
||||
/*0016*/ signed x_pos : 19; // x coord
|
||||
signed animation : 10; // animation
|
||||
signed padding0016 : 3;
|
||||
/*0020*/ unsigned heading : 12; // heading
|
||||
signed delta_z : 13; // change in z
|
||||
signed padding0020 : 7;
|
||||
/*0024*/
|
||||
};
|
||||
|
||||
@@ -1636,21 +1636,22 @@ struct PlayerPositionUpdateServer_Struct
|
||||
*/
|
||||
struct PlayerPositionUpdateClient_Struct
|
||||
{
|
||||
/*0000*/ uint16 sequence; // increments one each packet - Verified
|
||||
/*0002*/ uint16 spawn_id; // Player's spawn id
|
||||
/*0004*/ uint8 unknown0004[6]; // ***Placeholder
|
||||
/*0010*/ float delta_y; // Change in y
|
||||
/*0014*/ float x_pos; // x coord (2nd loc value)
|
||||
/*0018*/ float y_pos; // y coord (1st loc value)
|
||||
/*0022*/ signed delta_heading:10; // change in heading
|
||||
unsigned animation:10; // ***Placeholder
|
||||
unsigned padding0024:12; // animation
|
||||
/*0026*/ float delta_z; // Change in z
|
||||
/*0030*/ float delta_x; // Change in x
|
||||
/*0034*/ float z_pos; // z coord (3rd loc value)
|
||||
/*0038*/ unsigned heading:12; // Directional heading
|
||||
unsigned padding0040:10; // ***Placeholder
|
||||
unsigned padding0041:10; // ***Placeholder
|
||||
/*0000*/ uint16 sequence; // increments one each packet - Verified
|
||||
/*0002*/ uint16 spawn_id; // Player's spawn id
|
||||
/*0004*/ uint16 vehicle_id; // Player's vehicle spawn id
|
||||
/*0006*/ uint8 unknown0004[4]; // ***Placeholder
|
||||
/*0010*/ float delta_y; // Change in y
|
||||
/*0014*/ float x_pos; // x coord (2nd loc value)
|
||||
/*0018*/ float y_pos; // y coord (1st loc value)
|
||||
/*0022*/ signed delta_heading : 10; // change in heading
|
||||
unsigned animation : 10; // ***Placeholder
|
||||
unsigned padding0024 : 12; // animation
|
||||
/*0026*/ float delta_z; // Change in z
|
||||
/*0030*/ float delta_x; // Change in x
|
||||
/*0034*/ float z_pos; // z coord (3rd loc value)
|
||||
/*0038*/ unsigned heading : 12; // Directional heading
|
||||
unsigned padding0040 : 10; // ***Placeholder
|
||||
unsigned padding0041 : 10; // ***Placeholder
|
||||
/*0042*/
|
||||
};
|
||||
|
||||
@@ -4340,7 +4341,7 @@ struct SendAA_Struct {
|
||||
/*0104*/ uint32 special_category;
|
||||
/*0108*/ uint8 shroud;
|
||||
/*0109*/ uint8 unknown109;
|
||||
/*0110*/ uint8 layonhands; // 1 for lay on hands -- doesn't seem to matter?
|
||||
/*0110*/ uint8 reset_on_death; // timer is reset on death
|
||||
/*0111*/ uint8 unknown111;
|
||||
/*0112*/ uint32 total_abilities;
|
||||
/*0116*/ AA_Ability abilities[0];
|
||||
@@ -4743,8 +4744,8 @@ struct ItemQuaternaryBodyStruct
|
||||
int32 HealAmt;
|
||||
int32 SpellDmg;
|
||||
int32 Clairvoyance;
|
||||
uint8 unknown18; //Power Source Capacity or evolve filename?
|
||||
uint32 evolve_string; // Some String, but being evolution related is just a guess
|
||||
int32 SubType;
|
||||
uint8 evolve_string; // Some String, but being evolution related is just a guess
|
||||
uint8 unknown19;
|
||||
uint32 unknown20; // Bard Stuff?
|
||||
//uint32 unknown21;
|
||||
|
||||
+112
-105
@@ -43,7 +43,7 @@ namespace SoD
|
||||
static OpcodeManager *opcodes = nullptr;
|
||||
static Strategy struct_strategy;
|
||||
|
||||
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id, uint8 depth);
|
||||
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id, uint8 depth);
|
||||
|
||||
// server to client inventory location converters
|
||||
static inline uint32 ServerToSoDSlot(uint32 server_slot);
|
||||
@@ -59,8 +59,8 @@ namespace SoD
|
||||
// client to server say link converter
|
||||
static inline void SoDToServerSayLink(std::string &server_saylink, const std::string &sod_saylink);
|
||||
|
||||
static inline spells::CastingSlot ServerToSoDCastingSlot(EQEmu::spells::CastingSlot slot);
|
||||
static inline EQEmu::spells::CastingSlot SoDToServerCastingSlot(spells::CastingSlot slot);
|
||||
static inline spells::CastingSlot ServerToSoDCastingSlot(EQ::spells::CastingSlot slot);
|
||||
static inline EQ::spells::CastingSlot SoDToServerCastingSlot(spells::CastingSlot slot);
|
||||
|
||||
static inline int ServerToSoDBuffSlot(int index);
|
||||
static inline int SoDToServerBuffSlot(int index);
|
||||
@@ -144,9 +144,9 @@ namespace SoD
|
||||
return(r);
|
||||
}
|
||||
|
||||
const EQEmu::versions::ClientVersion Strategy::ClientVersion() const
|
||||
const EQ::versions::ClientVersion Strategy::ClientVersion() const
|
||||
{
|
||||
return EQEmu::versions::ClientVersion::SoD;
|
||||
return EQ::versions::ClientVersion::SoD;
|
||||
}
|
||||
|
||||
#include "ss_define.h"
|
||||
@@ -381,24 +381,24 @@ namespace SoD
|
||||
//store away the emu struct
|
||||
uchar* __emu_buffer = in->pBuffer;
|
||||
|
||||
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
|
||||
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
|
||||
int item_count = in->size / sizeof(EQ::InternalSerializedItem_Struct);
|
||||
if (!item_count || (in->size % sizeof(EQ::InternalSerializedItem_Struct)) != 0) {
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
|
||||
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQ::InternalSerializedItem_Struct));
|
||||
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
|
||||
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
|
||||
EQ::InternalSerializedItem_Struct* eq = (EQ::InternalSerializedItem_Struct*)in->pBuffer;
|
||||
|
||||
EQEmu::OutBuffer ob;
|
||||
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
|
||||
EQ::OutBuffer ob;
|
||||
EQ::OutBuffer::pos_type last_pos = ob.tellp();
|
||||
|
||||
ob.write((const char*)&item_count, sizeof(uint32));
|
||||
|
||||
for (int index = 0; index < item_count; ++index, ++eq) {
|
||||
SerializeItem(ob, (const EQEmu::ItemInstance*)eq->inst, eq->slot_id, 0);
|
||||
SerializeItem(ob, (const EQ::ItemInstance*)eq->inst, eq->slot_id, 0);
|
||||
if (ob.tellp() == last_pos)
|
||||
LogNetcode("SoD::ENCODE(OP_CharInventory) Serialization failed on item slot [{}] during OP_CharInventory. Item skipped", eq->slot_id);
|
||||
|
||||
@@ -1060,14 +1060,14 @@ namespace SoD
|
||||
//store away the emu struct
|
||||
uchar* __emu_buffer = in->pBuffer;
|
||||
|
||||
EQEmu::InternalSerializedItem_Struct* int_struct = (EQEmu::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
|
||||
EQ::InternalSerializedItem_Struct* int_struct = (EQ::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
|
||||
|
||||
EQEmu::OutBuffer ob;
|
||||
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
|
||||
EQ::OutBuffer ob;
|
||||
EQ::OutBuffer::pos_type last_pos = ob.tellp();
|
||||
|
||||
ob.write((const char*)__emu_buffer, 4);
|
||||
|
||||
SerializeItem(ob, (const EQEmu::ItemInstance*)int_struct->inst, int_struct->slot_id, 0);
|
||||
SerializeItem(ob, (const EQ::ItemInstance*)int_struct->inst, int_struct->slot_id, 0);
|
||||
if (ob.tellp() == last_pos) {
|
||||
LogNetcode("SoD::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
|
||||
delete in;
|
||||
@@ -1463,7 +1463,7 @@ namespace SoD
|
||||
OUT(hairstyle);
|
||||
OUT(beard);
|
||||
// OUT(unknown00178[10]);
|
||||
for (r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++) {
|
||||
for (r = EQ::textures::textureBegin; r < EQ::textures::materialCount; r++) {
|
||||
eq->equipment.Slot[r].Material = emu->item_material.Slot[r].Material;
|
||||
eq->equipment.Slot[r].Unknown1 = 0;
|
||||
eq->equipment.Slot[r].EliteMaterial = 0;
|
||||
@@ -1493,7 +1493,7 @@ namespace SoD
|
||||
OUT(face);
|
||||
// OUT(unknown02264[47]);
|
||||
|
||||
if (spells::SPELLBOOK_SIZE <= EQEmu::spells::SPELLBOOK_SIZE) {
|
||||
if (spells::SPELLBOOK_SIZE <= EQ::spells::SPELLBOOK_SIZE) {
|
||||
for (uint32 r = 0; r < spells::SPELLBOOK_SIZE; r++) {
|
||||
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
|
||||
eq->spell_book[r] = emu->spell_book[r];
|
||||
@@ -1502,14 +1502,14 @@ namespace SoD
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (uint32 r = 0; r < EQEmu::spells::SPELLBOOK_SIZE; r++) {
|
||||
for (uint32 r = 0; r < EQ::spells::SPELLBOOK_SIZE; r++) {
|
||||
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
|
||||
eq->spell_book[r] = emu->spell_book[r];
|
||||
else
|
||||
eq->spell_book[r] = 0xFFFFFFFFU;
|
||||
}
|
||||
// invalidate the rest of the spellbook slots
|
||||
memset(&eq->spell_book[EQEmu::spells::SPELLBOOK_SIZE], 0xFF, (sizeof(uint32) * (spells::SPELLBOOK_SIZE - EQEmu::spells::SPELLBOOK_SIZE)));
|
||||
memset(&eq->spell_book[EQ::spells::SPELLBOOK_SIZE], 0xFF, (sizeof(uint32) * (spells::SPELLBOOK_SIZE - EQ::spells::SPELLBOOK_SIZE)));
|
||||
}
|
||||
|
||||
// OUT(unknown4184[128]);
|
||||
@@ -1553,7 +1553,7 @@ namespace SoD
|
||||
// OUT(unknown06160[4]);
|
||||
|
||||
// Copy bandoliers where server and client indices converge
|
||||
for (r = 0; r < EQEmu::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
|
||||
for (r = 0; r < EQ::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
|
||||
OUT_str(bandoliers[r].Name);
|
||||
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
OUT(bandoliers[r].Items[k].ID);
|
||||
@@ -1562,7 +1562,7 @@ namespace SoD
|
||||
}
|
||||
}
|
||||
// Nullify bandoliers where server and client indices diverge, with a client bias
|
||||
for (r = EQEmu::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
|
||||
for (r = EQ::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
|
||||
eq->bandoliers[r].Name[0] = '\0';
|
||||
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
eq->bandoliers[r].Items[k].ID = 0;
|
||||
@@ -1574,13 +1574,13 @@ namespace SoD
|
||||
// OUT(unknown07444[5120]);
|
||||
|
||||
// Copy potion belt where server and client indices converge
|
||||
for (r = 0; r < EQEmu::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
|
||||
for (r = 0; r < EQ::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
|
||||
OUT(potionbelt.Items[r].ID);
|
||||
OUT(potionbelt.Items[r].Icon);
|
||||
OUT_str(potionbelt.Items[r].Name);
|
||||
}
|
||||
// Nullify potion belt where server and client indices diverge, with a client bias
|
||||
for (r = EQEmu::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
|
||||
for (r = EQ::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
|
||||
eq->potionbelt.Items[r].ID = 0;
|
||||
eq->potionbelt.Items[r].Icon = 0;
|
||||
eq->potionbelt.Items[r].Name[0] = '\0';
|
||||
@@ -1923,7 +1923,7 @@ namespace SoD
|
||||
eq_cse->HairColor = emu_cse->HairColor;
|
||||
eq_cse->Face = emu_cse->Face;
|
||||
|
||||
for (int equip_index = EQEmu::textures::textureBegin; equip_index < EQEmu::textures::materialCount; equip_index++) {
|
||||
for (int equip_index = EQ::textures::textureBegin; equip_index < EQ::textures::materialCount; equip_index++) {
|
||||
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
|
||||
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
|
||||
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
|
||||
@@ -2484,7 +2484,7 @@ namespace SoD
|
||||
float SpawnSize = emu->size;
|
||||
if (!((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522)))
|
||||
{
|
||||
PacketSize -= (sizeof(structs::Texture_Struct) * EQEmu::textures::materialCount);
|
||||
PacketSize -= (sizeof(structs::Texture_Struct) * EQ::textures::materialCount);
|
||||
|
||||
if (emu->size == 0)
|
||||
{
|
||||
@@ -2681,7 +2681,7 @@ namespace SoD
|
||||
|
||||
if ((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
|
||||
{
|
||||
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; ++k)
|
||||
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; ++k)
|
||||
{
|
||||
{
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment_tint.Slot[k].Color);
|
||||
@@ -2708,13 +2708,13 @@ namespace SoD
|
||||
{
|
||||
structs::Texture_Struct *Equipment = (structs::Texture_Struct *)Buffer;
|
||||
|
||||
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
|
||||
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; k++) {
|
||||
Equipment[k].Material = emu->equipment.Slot[k].Material;
|
||||
Equipment[k].Unknown1 = emu->equipment.Slot[k].Unknown1;
|
||||
Equipment[k].EliteMaterial = emu->equipment.Slot[k].EliteModel;
|
||||
}
|
||||
|
||||
Buffer += (sizeof(structs::Texture_Struct) * EQEmu::textures::materialCount);
|
||||
Buffer += (sizeof(structs::Texture_Struct) * EQ::textures::materialCount);
|
||||
}
|
||||
if (strlen(emu->title))
|
||||
{
|
||||
@@ -2926,6 +2926,7 @@ namespace SoD
|
||||
IN(delta_z);
|
||||
IN(delta_heading);
|
||||
IN(animation);
|
||||
emu->vehicle_id = 0;
|
||||
|
||||
FINISH_DIRECT_DECODE();
|
||||
}
|
||||
@@ -3145,7 +3146,7 @@ namespace SoD
|
||||
|
||||
for (int i = 0; i < spells::SPELL_GEM_COUNT; ++i)
|
||||
emu->spell[i] = eq->spell[i];
|
||||
for (int i = spells::SPELL_GEM_COUNT; i < EQEmu::spells::SPELL_GEM_COUNT; ++i)
|
||||
for (int i = spells::SPELL_GEM_COUNT; i < EQ::spells::SPELL_GEM_COUNT; ++i)
|
||||
emu->spell[i] = 0xFFFFFFFF;
|
||||
|
||||
FINISH_DIRECT_DECODE();
|
||||
@@ -3439,9 +3440,9 @@ namespace SoD
|
||||
return NextItemInstSerialNumber;
|
||||
}
|
||||
|
||||
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id_in, uint8 depth)
|
||||
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id_in, uint8 depth)
|
||||
{
|
||||
const EQEmu::ItemData *item = inst->GetUnscaledItem();
|
||||
const EQ::ItemData *item = inst->GetUnscaledItem();
|
||||
|
||||
SoD::structs::ItemSerializationHeader hdr;
|
||||
|
||||
@@ -3630,6 +3631,12 @@ namespace SoD
|
||||
itbs.no_transfer = item->NoTransfer;
|
||||
itbs.expendablearrow = item->ExpendableArrow;
|
||||
|
||||
// Done to hack older clients to label expendable fishing poles as such
|
||||
// July 28th, 2018 patch
|
||||
if (item->ItemType == EQ::item::ItemTypeFishingPole && item->SubType == 0) {
|
||||
itbs.expendablearrow = 1;
|
||||
}
|
||||
|
||||
ob.write((const char*)&itbs, sizeof(SoD::structs::ItemTertiaryBodyStruct));
|
||||
|
||||
// Effect Structures Broken down to allow variable length strings for effect names
|
||||
@@ -3750,30 +3757,30 @@ namespace SoD
|
||||
|
||||
ob.write((const char*)&iqbs, sizeof(SoD::structs::ItemQuaternaryBodyStruct));
|
||||
|
||||
EQEmu::OutBuffer::pos_type count_pos = ob.tellp();
|
||||
EQ::OutBuffer::pos_type count_pos = ob.tellp();
|
||||
uint32 subitem_count = 0;
|
||||
|
||||
ob.write((const char*)&subitem_count, sizeof(uint32));
|
||||
|
||||
// moved outside of loop since it is not modified within that scope
|
||||
int16 SubSlotNumber = EQEmu::invbag::SLOT_INVALID;
|
||||
int16 SubSlotNumber = EQ::invbag::SLOT_INVALID;
|
||||
|
||||
if (slot_id_in <= EQEmu::invslot::slotGeneral8 && slot_id_in >= EQEmu::invslot::GENERAL_BEGIN)
|
||||
SubSlotNumber = EQEmu::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
||||
else if (slot_id_in <= EQEmu::invslot::GENERAL_END && slot_id_in >= EQEmu::invslot::slotGeneral9)
|
||||
SubSlotNumber = EQEmu::invbag::SLOT_INVALID;
|
||||
else if (slot_id_in == EQEmu::invslot::slotCursor)
|
||||
SubSlotNumber = EQEmu::invbag::CURSOR_BAG_BEGIN;
|
||||
else if (slot_id_in <= EQEmu::invslot::BANK_END && slot_id_in >= EQEmu::invslot::BANK_BEGIN)
|
||||
SubSlotNumber = EQEmu::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
||||
else if (slot_id_in <= EQEmu::invslot::SHARED_BANK_END && slot_id_in >= EQEmu::invslot::SHARED_BANK_BEGIN)
|
||||
SubSlotNumber = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::SHARED_BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
||||
if (slot_id_in <= EQ::invslot::slotGeneral8 && slot_id_in >= EQ::invslot::GENERAL_BEGIN)
|
||||
SubSlotNumber = EQ::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQ::invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||
else if (slot_id_in <= EQ::invslot::GENERAL_END && slot_id_in >= EQ::invslot::slotGeneral9)
|
||||
SubSlotNumber = EQ::invbag::SLOT_INVALID;
|
||||
else if (slot_id_in == EQ::invslot::slotCursor)
|
||||
SubSlotNumber = EQ::invbag::CURSOR_BAG_BEGIN;
|
||||
else if (slot_id_in <= EQ::invslot::BANK_END && slot_id_in >= EQ::invslot::BANK_BEGIN)
|
||||
SubSlotNumber = EQ::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||
else if (slot_id_in <= EQ::invslot::SHARED_BANK_END && slot_id_in >= EQ::invslot::SHARED_BANK_BEGIN)
|
||||
SubSlotNumber = EQ::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::SHARED_BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||
else
|
||||
SubSlotNumber = slot_id_in; // not sure if this is the best way to handle this..leaving for now
|
||||
|
||||
if (SubSlotNumber != EQEmu::invbag::SLOT_INVALID) {
|
||||
for (uint32 index = EQEmu::invbag::SLOT_BEGIN; index <= EQEmu::invbag::SLOT_END; ++index) {
|
||||
EQEmu::ItemInstance* sub = inst->GetItem(index);
|
||||
if (SubSlotNumber != EQ::invbag::SLOT_INVALID) {
|
||||
for (uint32 index = EQ::invbag::SLOT_BEGIN; index <= EQ::invbag::SLOT_END; ++index) {
|
||||
EQ::ItemInstance* sub = inst->GetItem(index);
|
||||
if (!sub)
|
||||
continue;
|
||||
|
||||
@@ -3792,59 +3799,59 @@ namespace SoD
|
||||
{
|
||||
uint32 SoDSlot = invslot::SLOT_INVALID;
|
||||
|
||||
if (serverSlot <= EQEmu::invslot::slotGeneral8) {
|
||||
if (serverSlot <= EQ::invslot::slotGeneral8) {
|
||||
SoDSlot = serverSlot;
|
||||
}
|
||||
|
||||
else if (serverSlot <= EQEmu::invslot::CORPSE_END && serverSlot >= EQEmu::invslot::slotCursor) {
|
||||
else if (serverSlot <= EQ::invslot::CORPSE_END && serverSlot >= EQ::invslot::slotCursor) {
|
||||
SoDSlot = serverSlot - 2;
|
||||
}
|
||||
|
||||
else if (serverSlot <= EQEmu::invbag::GENERAL_BAGS_8_END && serverSlot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
|
||||
else if (serverSlot <= EQ::invbag::GENERAL_BAGS_8_END && serverSlot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
||||
SoDSlot = serverSlot + 11;
|
||||
}
|
||||
|
||||
else if (serverSlot <= EQEmu::invbag::CURSOR_BAG_END && serverSlot >= EQEmu::invbag::CURSOR_BAG_BEGIN) {
|
||||
else if (serverSlot <= EQ::invbag::CURSOR_BAG_END && serverSlot >= EQ::invbag::CURSOR_BAG_BEGIN) {
|
||||
SoDSlot = serverSlot - 9;
|
||||
}
|
||||
|
||||
else if (serverSlot <= EQEmu::invslot::TRIBUTE_END && serverSlot >= EQEmu::invslot::TRIBUTE_BEGIN) {
|
||||
else if (serverSlot <= EQ::invslot::TRIBUTE_END && serverSlot >= EQ::invslot::TRIBUTE_BEGIN) {
|
||||
SoDSlot = serverSlot;
|
||||
}
|
||||
|
||||
else if (serverSlot <= EQEmu::invslot::GUILD_TRIBUTE_END && serverSlot >= EQEmu::invslot::GUILD_TRIBUTE_BEGIN) {
|
||||
else if (serverSlot <= EQ::invslot::GUILD_TRIBUTE_END && serverSlot >= EQ::invslot::GUILD_TRIBUTE_BEGIN) {
|
||||
SoDSlot = serverSlot;
|
||||
}
|
||||
|
||||
else if (serverSlot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
|
||||
else if (serverSlot == EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
|
||||
SoDSlot = serverSlot;
|
||||
}
|
||||
|
||||
else if (serverSlot <= EQEmu::invslot::BANK_END && serverSlot >= EQEmu::invslot::BANK_BEGIN) {
|
||||
else if (serverSlot <= EQ::invslot::BANK_END && serverSlot >= EQ::invslot::BANK_BEGIN) {
|
||||
SoDSlot = serverSlot;
|
||||
}
|
||||
|
||||
else if (serverSlot <= EQEmu::invbag::BANK_BAGS_END && serverSlot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
|
||||
else if (serverSlot <= EQ::invbag::BANK_BAGS_END && serverSlot >= EQ::invbag::BANK_BAGS_BEGIN) {
|
||||
SoDSlot = serverSlot + 1;
|
||||
}
|
||||
|
||||
else if (serverSlot <= EQEmu::invslot::SHARED_BANK_END && serverSlot >= EQEmu::invslot::SHARED_BANK_BEGIN) {
|
||||
else if (serverSlot <= EQ::invslot::SHARED_BANK_END && serverSlot >= EQ::invslot::SHARED_BANK_BEGIN) {
|
||||
SoDSlot = serverSlot;
|
||||
}
|
||||
|
||||
else if (serverSlot <= EQEmu::invbag::SHARED_BANK_BAGS_END && serverSlot >= EQEmu::invbag::SHARED_BANK_BAGS_BEGIN) {
|
||||
else if (serverSlot <= EQ::invbag::SHARED_BANK_BAGS_END && serverSlot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
|
||||
SoDSlot = serverSlot + 1;
|
||||
}
|
||||
|
||||
else if (serverSlot <= EQEmu::invslot::TRADE_END && serverSlot >= EQEmu::invslot::TRADE_BEGIN) {
|
||||
else if (serverSlot <= EQ::invslot::TRADE_END && serverSlot >= EQ::invslot::TRADE_BEGIN) {
|
||||
SoDSlot = serverSlot;
|
||||
}
|
||||
|
||||
else if (serverSlot <= EQEmu::invbag::TRADE_BAGS_END && serverSlot >= EQEmu::invbag::TRADE_BAGS_BEGIN) {
|
||||
else if (serverSlot <= EQ::invbag::TRADE_BAGS_END && serverSlot >= EQ::invbag::TRADE_BAGS_BEGIN) {
|
||||
SoDSlot = serverSlot;
|
||||
}
|
||||
|
||||
else if (serverSlot <= EQEmu::invslot::WORLD_END && serverSlot >= EQEmu::invslot::WORLD_BEGIN) {
|
||||
else if (serverSlot <= EQ::invslot::WORLD_END && serverSlot >= EQ::invslot::WORLD_BEGIN) {
|
||||
SoDSlot = serverSlot;
|
||||
}
|
||||
|
||||
@@ -3857,11 +3864,11 @@ namespace SoD
|
||||
{
|
||||
uint32 SoDSlot = invslot::SLOT_INVALID;
|
||||
|
||||
if (server_corpse_slot <= EQEmu::invslot::slotGeneral8 && server_corpse_slot >= EQEmu::invslot::slotGeneral1) {
|
||||
if (server_corpse_slot <= EQ::invslot::slotGeneral8 && server_corpse_slot >= EQ::invslot::slotGeneral1) {
|
||||
SoDSlot = server_corpse_slot;
|
||||
}
|
||||
|
||||
else if (server_corpse_slot <= EQEmu::invslot::CORPSE_END && server_corpse_slot >= EQEmu::invslot::slotCursor) {
|
||||
else if (server_corpse_slot <= EQ::invslot::CORPSE_END && server_corpse_slot >= EQ::invslot::slotCursor) {
|
||||
SoDSlot = server_corpse_slot - 2;
|
||||
}
|
||||
|
||||
@@ -3872,7 +3879,7 @@ namespace SoD
|
||||
|
||||
static inline uint32 SoDToServerSlot(uint32 sod_slot)
|
||||
{
|
||||
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
|
||||
uint32 server_slot = EQ::invslot::SLOT_INVALID;
|
||||
|
||||
if (sod_slot <= invslot::slotGeneral8) {
|
||||
server_slot = sod_slot;
|
||||
@@ -3937,7 +3944,7 @@ namespace SoD
|
||||
|
||||
static inline uint32 SoDToServerCorpseSlot(uint32 sod_corpse_slot)
|
||||
{
|
||||
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
|
||||
uint32 server_slot = EQ::invslot::SLOT_INVALID;
|
||||
|
||||
if (sod_corpse_slot <= invslot::slotGeneral8 && sod_corpse_slot >= invslot::slotGeneral1) {
|
||||
server_slot = sod_corpse_slot;
|
||||
@@ -3954,7 +3961,7 @@ namespace SoD
|
||||
|
||||
static inline void ServerToSoDSayLink(std::string &sod_saylink, const std::string &server_saylink)
|
||||
{
|
||||
if ((constants::SAY_LINK_BODY_SIZE == EQEmu::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
|
||||
if ((constants::SAY_LINK_BODY_SIZE == EQ::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
|
||||
sod_saylink = server_saylink;
|
||||
return;
|
||||
}
|
||||
@@ -3963,7 +3970,7 @@ namespace SoD
|
||||
|
||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||
if (segment_iter & 1) {
|
||||
if (segments[segment_iter].length() <= EQEmu::constants::SAY_LINK_BODY_SIZE) {
|
||||
if (segments[segment_iter].length() <= EQ::constants::SAY_LINK_BODY_SIZE) {
|
||||
sod_saylink.append(segments[segment_iter]);
|
||||
// TODO: log size mismatch error
|
||||
continue;
|
||||
@@ -3994,7 +4001,7 @@ namespace SoD
|
||||
|
||||
static inline void SoDToServerSayLink(std::string &server_saylink, const std::string &sod_saylink)
|
||||
{
|
||||
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (sod_saylink.find('\x12') == std::string::npos)) {
|
||||
if ((EQ::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (sod_saylink.find('\x12') == std::string::npos)) {
|
||||
server_saylink = sod_saylink;
|
||||
return;
|
||||
}
|
||||
@@ -4028,84 +4035,84 @@ namespace SoD
|
||||
}
|
||||
}
|
||||
|
||||
static inline spells::CastingSlot ServerToSoDCastingSlot(EQEmu::spells::CastingSlot slot)
|
||||
static inline spells::CastingSlot ServerToSoDCastingSlot(EQ::spells::CastingSlot slot)
|
||||
{
|
||||
switch (slot) {
|
||||
case EQEmu::spells::CastingSlot::Gem1:
|
||||
case EQ::spells::CastingSlot::Gem1:
|
||||
return spells::CastingSlot::Gem1;
|
||||
case EQEmu::spells::CastingSlot::Gem2:
|
||||
case EQ::spells::CastingSlot::Gem2:
|
||||
return spells::CastingSlot::Gem2;
|
||||
case EQEmu::spells::CastingSlot::Gem3:
|
||||
case EQ::spells::CastingSlot::Gem3:
|
||||
return spells::CastingSlot::Gem3;
|
||||
case EQEmu::spells::CastingSlot::Gem4:
|
||||
case EQ::spells::CastingSlot::Gem4:
|
||||
return spells::CastingSlot::Gem4;
|
||||
case EQEmu::spells::CastingSlot::Gem5:
|
||||
case EQ::spells::CastingSlot::Gem5:
|
||||
return spells::CastingSlot::Gem5;
|
||||
case EQEmu::spells::CastingSlot::Gem6:
|
||||
case EQ::spells::CastingSlot::Gem6:
|
||||
return spells::CastingSlot::Gem6;
|
||||
case EQEmu::spells::CastingSlot::Gem7:
|
||||
case EQ::spells::CastingSlot::Gem7:
|
||||
return spells::CastingSlot::Gem7;
|
||||
case EQEmu::spells::CastingSlot::Gem8:
|
||||
case EQ::spells::CastingSlot::Gem8:
|
||||
return spells::CastingSlot::Gem8;
|
||||
case EQEmu::spells::CastingSlot::Gem9:
|
||||
case EQ::spells::CastingSlot::Gem9:
|
||||
return spells::CastingSlot::Gem9;
|
||||
case EQEmu::spells::CastingSlot::Gem10:
|
||||
case EQ::spells::CastingSlot::Gem10:
|
||||
return spells::CastingSlot::Gem10;
|
||||
case EQEmu::spells::CastingSlot::Item:
|
||||
case EQEmu::spells::CastingSlot::PotionBelt:
|
||||
case EQ::spells::CastingSlot::Item:
|
||||
case EQ::spells::CastingSlot::PotionBelt:
|
||||
return spells::CastingSlot::Item;
|
||||
case EQEmu::spells::CastingSlot::Discipline:
|
||||
case EQ::spells::CastingSlot::Discipline:
|
||||
return spells::CastingSlot::Discipline;
|
||||
case EQEmu::spells::CastingSlot::AltAbility:
|
||||
case EQ::spells::CastingSlot::AltAbility:
|
||||
return spells::CastingSlot::AltAbility;
|
||||
default: // we shouldn't have any issues with other slots ... just return something
|
||||
return spells::CastingSlot::Discipline;
|
||||
}
|
||||
}
|
||||
|
||||
static inline EQEmu::spells::CastingSlot SoDToServerCastingSlot(spells::CastingSlot slot)
|
||||
static inline EQ::spells::CastingSlot SoDToServerCastingSlot(spells::CastingSlot slot)
|
||||
{
|
||||
switch (slot) {
|
||||
case spells::CastingSlot::Gem1:
|
||||
return EQEmu::spells::CastingSlot::Gem1;
|
||||
return EQ::spells::CastingSlot::Gem1;
|
||||
case spells::CastingSlot::Gem2:
|
||||
return EQEmu::spells::CastingSlot::Gem2;
|
||||
return EQ::spells::CastingSlot::Gem2;
|
||||
case spells::CastingSlot::Gem3:
|
||||
return EQEmu::spells::CastingSlot::Gem3;
|
||||
return EQ::spells::CastingSlot::Gem3;
|
||||
case spells::CastingSlot::Gem4:
|
||||
return EQEmu::spells::CastingSlot::Gem4;
|
||||
return EQ::spells::CastingSlot::Gem4;
|
||||
case spells::CastingSlot::Gem5:
|
||||
return EQEmu::spells::CastingSlot::Gem5;
|
||||
return EQ::spells::CastingSlot::Gem5;
|
||||
case spells::CastingSlot::Gem6:
|
||||
return EQEmu::spells::CastingSlot::Gem6;
|
||||
return EQ::spells::CastingSlot::Gem6;
|
||||
case spells::CastingSlot::Gem7:
|
||||
return EQEmu::spells::CastingSlot::Gem7;
|
||||
return EQ::spells::CastingSlot::Gem7;
|
||||
case spells::CastingSlot::Gem8:
|
||||
return EQEmu::spells::CastingSlot::Gem8;
|
||||
return EQ::spells::CastingSlot::Gem8;
|
||||
case spells::CastingSlot::Gem9:
|
||||
return EQEmu::spells::CastingSlot::Gem9;
|
||||
return EQ::spells::CastingSlot::Gem9;
|
||||
case spells::CastingSlot::Gem10:
|
||||
return EQEmu::spells::CastingSlot::Gem10;
|
||||
return EQ::spells::CastingSlot::Gem10;
|
||||
case spells::CastingSlot::Discipline:
|
||||
return EQEmu::spells::CastingSlot::Discipline;
|
||||
return EQ::spells::CastingSlot::Discipline;
|
||||
case spells::CastingSlot::Item:
|
||||
return EQEmu::spells::CastingSlot::Item;
|
||||
return EQ::spells::CastingSlot::Item;
|
||||
case spells::CastingSlot::AltAbility:
|
||||
return EQEmu::spells::CastingSlot::AltAbility;
|
||||
return EQ::spells::CastingSlot::AltAbility;
|
||||
default: // we shouldn't have any issues with other slots ... just return something
|
||||
return EQEmu::spells::CastingSlot::Discipline;
|
||||
return EQ::spells::CastingSlot::Discipline;
|
||||
}
|
||||
}
|
||||
|
||||
static inline int ServerToSoDBuffSlot(int index)
|
||||
{
|
||||
// we're a disc
|
||||
if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
|
||||
return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
|
||||
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
|
||||
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
|
||||
spells::LONG_BUFFS + spells::SHORT_BUFFS;
|
||||
// we're a song
|
||||
if (index >= EQEmu::spells::LONG_BUFFS)
|
||||
return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
|
||||
if (index >= EQ::spells::LONG_BUFFS)
|
||||
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
|
||||
// we're a normal buff
|
||||
return index; // as long as we guard against bad slots server side, we should be fine
|
||||
}
|
||||
@@ -4114,11 +4121,11 @@ namespace SoD
|
||||
{
|
||||
// we're a disc
|
||||
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
|
||||
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
|
||||
EQEmu::spells::SHORT_BUFFS;
|
||||
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQ::spells::LONG_BUFFS +
|
||||
EQ::spells::SHORT_BUFFS;
|
||||
// we're a song
|
||||
if (index >= spells::LONG_BUFFS)
|
||||
return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS;
|
||||
return index - spells::LONG_BUFFS + EQ::spells::LONG_BUFFS;
|
||||
// we're a normal buff
|
||||
return index; // as long as we guard against bad slots server side, we should be fine
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace SoD
|
||||
protected:
|
||||
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
|
||||
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
||||
|
||||
//magic macro to declare our opcode processors
|
||||
#include "ss_declare.h"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user