mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-23 00:42:27 +00:00
Compare commits
312 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f37e0c3214 | |||
| 01b498f9c2 | |||
| e0f9d9a8db | |||
| ee54a7eb5f | |||
| a6814d46de | |||
| 9dba6a6680 | |||
| bc875ae554 | |||
| bb897b755f | |||
| a39a825045 | |||
| ccd0713b33 | |||
| 5d94c9844a | |||
| bbe2db7c0f | |||
| 5dc76e595b | |||
| b6b662f1c7 | |||
| 5275201713 | |||
| 1e86e0c02f | |||
| 25c0416f1e | |||
| 326dba6aeb | |||
| b75741ff4e | |||
| 8e62383997 | |||
| 4296e2e39e | |||
| e5f924d1d5 | |||
| fb2aee1827 | |||
| 791d8b329d | |||
| abcf8cbce1 | |||
| 3ed6663c4c | |||
| f22608a43a | |||
| 0e5d578d71 | |||
| 8107ed52e1 | |||
| d904db0e52 | |||
| e6c8a38ffa | |||
| dbe0591b09 | |||
| 5b6f1d38be | |||
| ce85c70a07 | |||
| f814b5bec5 | |||
| 4e40d7eacc | |||
| 31ad0da811 | |||
| 25a19a13dc | |||
| 2a5ddde78a | |||
| eca2ed0321 | |||
| afc32afb02 | |||
| 751db6fffb | |||
| c4eb1f8439 | |||
| d6c03b54a1 | |||
| 261a9e6938 | |||
| ac214f71d4 | |||
| fd878e7b16 | |||
| 58cde58b45 | |||
| cc2ef11158 | |||
| 2dfb7614cc | |||
| 6dffeacc6e | |||
| 2ec6dcbe24 | |||
| 39bc12b582 | |||
| 6d78f926c8 | |||
| 00af2903c3 | |||
| 58fafd0f9c | |||
| 9f0989ee2d | |||
| 14648b96c4 | |||
| bfd1cf9379 | |||
| 3c35e9bbc8 | |||
| d86544ff60 | |||
| 70eed67e08 | |||
| 1c0524681e | |||
| aa9320de3c | |||
| ad28f3c3f3 | |||
| 71dfa9acc0 | |||
| 56d0478ab1 | |||
| 0d02fadb60 | |||
| 4de5a7b86d | |||
| ba3c19ad0b | |||
| 8ec80644ee | |||
| ed7e2b2652 | |||
| a83ad7080a | |||
| 677d595c9d | |||
| 615f4a5304 | |||
| 5fd62d82db | |||
| b938e6223c | |||
| 51c8771bd2 | |||
| cc9196bd65 | |||
| 6303f129af | |||
| 3f0987ba55 | |||
| 1d4438ae1f | |||
| 03adf20fe9 | |||
| dd6cde68bb | |||
| 95c8b60ec6 | |||
| fa418172d6 | |||
| 7b106fc622 | |||
| 62a453f0d7 | |||
| fa9314811e | |||
| d2d7b8108d | |||
| 99793cab8b | |||
| e2484997dd | |||
| 66935fe21b | |||
| db988e4261 | |||
| fdd260d5fa | |||
| 9110bc863e | |||
| 4a41583805 | |||
| 5396c0c88b | |||
| 968ae26c99 | |||
| 7bf466cf3f | |||
| 49d7eb1402 | |||
| d83ced6f76 | |||
| 1ea8888607 | |||
| f9eb4603a3 | |||
| d656be6be4 | |||
| fbbbd3b09d | |||
| a6d1652f44 | |||
| f0bf285836 | |||
| 1f560529da | |||
| f65a6d2761 | |||
| 79f250da2d | |||
| 752e6c89f3 | |||
| e962ad3a35 | |||
| 872d494bb6 | |||
| 8a48473dbc | |||
| a208801d1f | |||
| a5d8a64792 | |||
| ee1f0ea91f | |||
| 7c20a86f23 | |||
| dbe6adbed0 | |||
| d300e78b39 | |||
| 0400504adc | |||
| 5ce2889210 | |||
| cc0371c16e | |||
| 4e297f3d96 | |||
| e9f48d5fba | |||
| 00c41dda8c | |||
| 7b235a6ede | |||
| 58d5983ef1 | |||
| 7749c626f0 | |||
| a6cd0bc33a | |||
| cba95851a2 | |||
| 7f5706abcf | |||
| 44b8c9203a | |||
| afdbc0ce80 | |||
| e850d80656 | |||
| b9722c6d28 | |||
| 5a7ee28740 | |||
| e4f2aec11e | |||
| e99c8dafc5 | |||
| 936043a53c | |||
| 3c09448e90 | |||
| e09a8f8f8f | |||
| 804f0681a9 | |||
| 71c53cb18b | |||
| 176bfc8524 | |||
| 28b1abe1a7 | |||
| 3a94132749 | |||
| 5ebbbf647b | |||
| 5f482a9b30 | |||
| 91aa950304 | |||
| 613066976d | |||
| 1a556f4451 | |||
| d10145fc6f | |||
| f3002d9656 | |||
| 59c373bcff | |||
| ae8273e0b1 | |||
| 10083387b6 | |||
| 7e065ad966 | |||
| ffa968f64f | |||
| 6bf5608cf3 | |||
| 3853c4f150 | |||
| d6d4c458e7 | |||
| 26b160c59b | |||
| d107ff3069 | |||
| 220d8497dd | |||
| 645251992d | |||
| 9815f50efa | |||
| c0f57bed1f | |||
| d280d54446 | |||
| c99c5c1f1c | |||
| e45f02af95 | |||
| 323b35989c | |||
| 7f23c93ce5 | |||
| 6a7782ab8d | |||
| 5457f30659 | |||
| 652ea89dea | |||
| c79fbb99aa | |||
| 4f0e9945c6 | |||
| 4fbb98a5f7 | |||
| 8c78a19c95 | |||
| 6a77764f8b | |||
| d0ec0872b9 | |||
| 724d47432b | |||
| f26d56d6d5 | |||
| 886b321e66 | |||
| 85971590c8 | |||
| 898b1ea4d1 | |||
| d460fb3db8 | |||
| fbc5d045de | |||
| 3414d3a1ae | |||
| feed584a41 | |||
| 119b2d023f | |||
| 73acc3310c | |||
| 6da7116c66 | |||
| 26b21673ad | |||
| ef1f6adf18 | |||
| 1c2e1ea228 | |||
| 7cf66a2daa | |||
| 91c958ae63 | |||
| 8de410ebb7 | |||
| 550485ba33 | |||
| eb2b4fd9e0 | |||
| 42f439c4b7 | |||
| 294e51fca7 | |||
| 94166e0f95 | |||
| 1a1c3abc24 | |||
| 0f4f5d7046 | |||
| 8ec4afe721 | |||
| aa4536e1ef | |||
| 01a671918a | |||
| e09f28c62c | |||
| 82000949e3 | |||
| 4a154686e1 | |||
| 29dfe9d404 | |||
| 9a0c98397e | |||
| bc0795bb48 | |||
| d972183a79 | |||
| f70b4a79b2 | |||
| 7cac2e2bc3 | |||
| 2be1321aa9 | |||
| ba5bb09af7 | |||
| 5ab9b941e2 | |||
| d28f902ecc | |||
| fd862d16bb | |||
| a6e5534b64 | |||
| 225497337c | |||
| a5348e207b | |||
| c4c5256438 | |||
| b3b9899a23 | |||
| 7d1d385418 | |||
| 96cdf1b076 | |||
| 8688e9c9fa | |||
| 6a28828e08 | |||
| 8566662d56 | |||
| 298ae3e3ba | |||
| 4507b063f5 | |||
| 774e0c7faa | |||
| 8b54bb34e4 | |||
| e87b8e2682 | |||
| 2dc3ca52db | |||
| 514029a6bb | |||
| b29f398239 | |||
| e474b2a280 | |||
| d38b8a4867 | |||
| 1a5f48521d | |||
| ba427c64ba | |||
| 9d59b3def4 | |||
| a6f5bf72be | |||
| 6ff7f7aa53 | |||
| 1a2897c423 | |||
| 8b5b19ae2c | |||
| 6fa41a3b73 | |||
| 6496690123 | |||
| a11482ff23 | |||
| 4672e48fbd | |||
| 8f3cce6585 | |||
| 8d3a179ecc | |||
| 2cbcefd9a0 | |||
| ef06a0d0b6 | |||
| 1935ea60d0 | |||
| 8c7e1be344 | |||
| 9240497cbc | |||
| 0da4610249 | |||
| 26c7287997 | |||
| cece66adc6 | |||
| d29993fafa | |||
| 39c27c987d | |||
| 5470ec6293 | |||
| 1acdc6034b | |||
| e9fc80815a | |||
| a84536cd05 | |||
| 0a34809bb3 | |||
| 03847fb1ac | |||
| 8a27fce3a8 | |||
| 6a42639386 | |||
| b9214bfdee | |||
| 04fda24c8e | |||
| 446c5d90ec | |||
| 80f15ed04a | |||
| 51fb46556d | |||
| d73194c1f6 | |||
| ec1cf68ce2 | |||
| 39b39970f6 | |||
| 40edefa6f4 | |||
| 7154d5b841 | |||
| dfe43ce189 | |||
| 69d5fee471 | |||
| f1d9221b4c | |||
| fb2f901539 | |||
| 7c12c5d5ef | |||
| 7559732408 | |||
| fac0d795f2 | |||
| 3efd9c7f60 | |||
| bf8a0328b3 | |||
| 0ebb1cc54c | |||
| a111668888 | |||
| 0550fcfd3f | |||
| 293361a1f7 | |||
| 5d75b7b365 | |||
| 6400e2f8bc | |||
| 76b0183a0f | |||
| b3471c51df | |||
| b2c86f5571 | |||
| 264c6cb019 | |||
| 9bcb617f90 | |||
| f5d37a9959 | |||
| c44b82500d | |||
| 4f550fcbf3 | |||
| 1103d50733 | |||
| ddcb184183 | |||
| 90bcc5f03c |
@@ -54,3 +54,5 @@ bin/
|
||||
/Win32
|
||||
/x64
|
||||
/client_files/**/CMakeFiles/
|
||||
|
||||
.idea
|
||||
|
||||
Vendored
+116
@@ -0,0 +1,116 @@
|
||||
{
|
||||
//"testMate.cpp.test.executables": "{build,Build,BUILD,out,Out,OUT}/**/*{test,Test,TEST}*"
|
||||
"testMate.cpp.test.executables": "{build,Build,BUILD,out,Out,OUT}/**/*zone{test,Test,TEST}*",
|
||||
"cmake.configureSettings": {
|
||||
//"EQEMU_BUILD_SERVER": "ON",
|
||||
"EQEMU_BUILD_LUA": "ON"
|
||||
},
|
||||
"files.associations": {
|
||||
"chrono": "cpp",
|
||||
"functional": "cpp",
|
||||
"algorithm": "cpp",
|
||||
"any": "cpp",
|
||||
"array": "cpp",
|
||||
"atomic": "cpp",
|
||||
"bit": "cpp",
|
||||
"bitset": "cpp",
|
||||
"cctype": "cpp",
|
||||
"cfenv": "cpp",
|
||||
"charconv": "cpp",
|
||||
"cinttypes": "cpp",
|
||||
"clocale": "cpp",
|
||||
"cmath": "cpp",
|
||||
"codecvt": "cpp",
|
||||
"compare": "cpp",
|
||||
"complex": "cpp",
|
||||
"concepts": "cpp",
|
||||
"condition_variable": "cpp",
|
||||
"coroutine": "cpp",
|
||||
"csetjmp": "cpp",
|
||||
"csignal": "cpp",
|
||||
"cstdarg": "cpp",
|
||||
"cstddef": "cpp",
|
||||
"cstdint": "cpp",
|
||||
"cstdio": "cpp",
|
||||
"cstdlib": "cpp",
|
||||
"cstring": "cpp",
|
||||
"ctime": "cpp",
|
||||
"cwchar": "cpp",
|
||||
"cwctype": "cpp",
|
||||
"deque": "cpp",
|
||||
"exception": "cpp",
|
||||
"execution": "cpp",
|
||||
"resumable": "cpp",
|
||||
"filesystem": "cpp",
|
||||
"format": "cpp",
|
||||
"forward_list": "cpp",
|
||||
"fstream": "cpp",
|
||||
"future": "cpp",
|
||||
"initializer_list": "cpp",
|
||||
"iomanip": "cpp",
|
||||
"ios": "cpp",
|
||||
"iosfwd": "cpp",
|
||||
"iostream": "cpp",
|
||||
"istream": "cpp",
|
||||
"iterator": "cpp",
|
||||
"limits": "cpp",
|
||||
"list": "cpp",
|
||||
"locale": "cpp",
|
||||
"map": "cpp",
|
||||
"memory": "cpp",
|
||||
"memory_resource": "cpp",
|
||||
"mutex": "cpp",
|
||||
"new": "cpp",
|
||||
"numeric": "cpp",
|
||||
"optional": "cpp",
|
||||
"ostream": "cpp",
|
||||
"queue": "cpp",
|
||||
"random": "cpp",
|
||||
"ratio": "cpp",
|
||||
"regex": "cpp",
|
||||
"scoped_allocator": "cpp",
|
||||
"set": "cpp",
|
||||
"shared_mutex": "cpp",
|
||||
"source_location": "cpp",
|
||||
"sstream": "cpp",
|
||||
"stack": "cpp",
|
||||
"stdexcept": "cpp",
|
||||
"stop_token": "cpp",
|
||||
"streambuf": "cpp",
|
||||
"string": "cpp",
|
||||
"strstream": "cpp",
|
||||
"system_error": "cpp",
|
||||
"thread": "cpp",
|
||||
"tuple": "cpp",
|
||||
"type_traits": "cpp",
|
||||
"typeindex": "cpp",
|
||||
"typeinfo": "cpp",
|
||||
"unordered_map": "cpp",
|
||||
"unordered_set": "cpp",
|
||||
"utility": "cpp",
|
||||
"valarray": "cpp",
|
||||
"variant": "cpp",
|
||||
"vector": "cpp",
|
||||
"xfacet": "cpp",
|
||||
"xhash": "cpp",
|
||||
"xiosbase": "cpp",
|
||||
"xlocale": "cpp",
|
||||
"xlocbuf": "cpp",
|
||||
"xlocinfo": "cpp",
|
||||
"xlocmes": "cpp",
|
||||
"xlocmon": "cpp",
|
||||
"xlocnum": "cpp",
|
||||
"xloctime": "cpp",
|
||||
"xmemory": "cpp",
|
||||
"xstddef": "cpp",
|
||||
"xstring": "cpp",
|
||||
"xtr1common": "cpp",
|
||||
"xtree": "cpp",
|
||||
"xutility": "cpp",
|
||||
"*.tcc": "cpp",
|
||||
"string_view": "cpp",
|
||||
"rope": "cpp",
|
||||
"slist": "cpp",
|
||||
"*.ipp": "cpp"
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -127,7 +127,7 @@ 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_TESTS "Build zone tests." ON)
|
||||
OPTION(EQEMU_BUILD_CLIENT_FILES "Build Client Import/Export Data Programs." ON)
|
||||
OPTION(EQEMU_PREFER_LUA "Build with normal Lua even if LuaJIT is found." OFF)
|
||||
|
||||
@@ -442,6 +442,7 @@ ENDIF(EQEMU_BUILD_HC)
|
||||
|
||||
IF(EQEMU_BUILD_TESTS)
|
||||
ADD_SUBDIRECTORY(tests)
|
||||
ADD_SUBDIRECTORY(test)
|
||||
ENDIF(EQEMU_BUILD_TESTS)
|
||||
|
||||
IF(EQEMU_BUILD_CLIENT_FILES)
|
||||
|
||||
@@ -18,16 +18,16 @@
|
||||
|**Install Count**|||
|
||||
### > Windows
|
||||
|
||||
* [Install Guide](https://eqemu.gitbook.io/server/categories/installation/server-installation-windows)
|
||||
* [Install Guide](https://docs.eqemu.io/server/installation/server-installation-windows/)
|
||||
|
||||
### > Debian/Ubuntu/CentOS/Fedora
|
||||
|
||||
* [Install Guide](https://eqemu.gitbook.io/server/categories/installation/server-installation-linux)
|
||||
* [Install Guide](https://docs.eqemu.io/server/installation/server-installation-linux/)
|
||||
|
||||
* You can use curl or wget to kick off the installer (whichever your OS has)
|
||||
> curl -O https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/linux_installer/install.sh install.sh && chmod 755 install.sh && ./install.sh
|
||||
|
||||
> wget --no-check-certificate https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/linux_installer/install.sh -O install.sh && chmod 755 install.sh && ./install.sh
|
||||
> wget --no-check-certificate https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/linux_installer/install.sh -O install.sh && chmod 755 install.sh && ./install.sh
|
||||
|
||||
## Supported Clients
|
||||
|
||||
@@ -56,7 +56,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://eqemu.gitbook.io/)
|
||||
- [EQEmulator Wiki](https://docs.eqemu.io/)
|
||||
|
||||
## Related Repositories
|
||||
* [ProjectEQ Quests](https://github.com/ProjectEQ/projecteqquests)
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "../database.h"
|
||||
#include "../rulesys.h"
|
||||
#include "../eqemu_logsys.h"
|
||||
#include "../loottable.h"
|
||||
#include "../repositories/content_flags_repository.h"
|
||||
|
||||
|
||||
@@ -35,8 +36,12 @@ int WorldContentService::GetCurrentExpansion() const
|
||||
return current_expansion;
|
||||
}
|
||||
|
||||
void WorldContentService::SetExpansionContext()
|
||||
WorldContentService *WorldContentService::SetExpansionContext()
|
||||
{
|
||||
// do a rule manager reload until where we store expansion is changed to somewhere else
|
||||
RuleManager::Instance()->LoadRules(GetDatabase(), "default", true);
|
||||
|
||||
// pull expansion from rules
|
||||
int expansion = RuleI(Expansion, CurrentExpansion);
|
||||
if (expansion >= Expansion::Classic && expansion <= Expansion::MaxId) {
|
||||
content_service.SetCurrentExpansion(expansion);
|
||||
@@ -47,6 +52,8 @@ void WorldContentService::SetExpansionContext()
|
||||
GetCurrentExpansion(),
|
||||
GetCurrentExpansionName()
|
||||
);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
std::string WorldContentService::GetCurrentExpansionName()
|
||||
@@ -73,15 +80,47 @@ void WorldContentService::SetCurrentExpansion(int current_expansion)
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
const std::vector<std::string> &WorldContentService::GetContentFlags() const
|
||||
const std::vector<ContentFlagsRepository::ContentFlags> &WorldContentService::GetContentFlags() const
|
||||
{
|
||||
return content_flags;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
std::vector<std::string> WorldContentService::GetContentFlagsEnabled()
|
||||
{
|
||||
std::vector<std::string> enabled_flags;
|
||||
|
||||
for (auto &f: GetContentFlags()) {
|
||||
if (f.enabled) {
|
||||
enabled_flags.emplace_back(f.flag_name);
|
||||
}
|
||||
}
|
||||
|
||||
return enabled_flags;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
std::vector<std::string> WorldContentService::GetContentFlagsDisabled()
|
||||
{
|
||||
std::vector<std::string> disabled_flags;
|
||||
|
||||
for (auto &f: GetContentFlags()) {
|
||||
if (!f.enabled) {
|
||||
disabled_flags.emplace_back(f.flag_name);
|
||||
}
|
||||
}
|
||||
|
||||
return disabled_flags;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param content_flags
|
||||
*/
|
||||
void WorldContentService::SetContentFlags(std::vector<std::string> content_flags)
|
||||
void WorldContentService::SetContentFlags(std::vector<ContentFlagsRepository::ContentFlags> content_flags)
|
||||
{
|
||||
WorldContentService::content_flags = content_flags;
|
||||
}
|
||||
@@ -90,10 +129,10 @@ void WorldContentService::SetContentFlags(std::vector<std::string> content_flags
|
||||
* @param content_flag
|
||||
* @return
|
||||
*/
|
||||
bool WorldContentService::IsContentFlagEnabled(const std::string& content_flag)
|
||||
bool WorldContentService::IsContentFlagEnabled(const std::string &content_flag)
|
||||
{
|
||||
for (auto &flag : GetContentFlags()) {
|
||||
if (flag == content_flag) {
|
||||
for (auto &f: GetContentFlags()) {
|
||||
if (f.flag_name == content_flag && f.enabled == true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -101,20 +140,102 @@ bool WorldContentService::IsContentFlagEnabled(const std::string& content_flag)
|
||||
return false;
|
||||
}
|
||||
|
||||
void WorldContentService::ReloadContentFlags(Database &db)
|
||||
/**
|
||||
* @param content_flag
|
||||
* @return
|
||||
*/
|
||||
bool WorldContentService::IsContentFlagDisabled(const std::string &content_flag)
|
||||
{
|
||||
std::vector<std::string> set_content_flags;
|
||||
auto content_flags = ContentFlagsRepository::GetWhere(db, "enabled = 1");
|
||||
|
||||
set_content_flags.reserve(content_flags.size());
|
||||
for (auto &flags: content_flags) {
|
||||
set_content_flags.push_back(flags.flag_name);
|
||||
for (auto &f: GetContentFlags()) {
|
||||
if (f.flag_name == content_flag && f.enabled == false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
LogInfo(
|
||||
"Enabled content flags [{}]",
|
||||
implode(", ", set_content_flags)
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool WorldContentService::DoesPassContentFiltering(const ContentFlags &f)
|
||||
{
|
||||
// if we're not set to (-1 All) then fail when we aren't within minimum expansion
|
||||
if (f.min_expansion > Expansion::EXPANSION_ALL && current_expansion < f.min_expansion) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// if we're not set to (-1 All) then fail when we aren't within max expansion
|
||||
if (f.max_expansion > Expansion::EXPANSION_ALL && current_expansion > f.max_expansion) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// if we don't have any enabled flag in enabled flags, we fail
|
||||
for (const auto& flag: SplitString(f.content_flags)) {
|
||||
if (!contains(GetContentFlagsEnabled(), flag)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// if we don't have any disabled flag in disabled flags, we fail
|
||||
for (const auto& flag: SplitString(f.content_flags_disabled)) {
|
||||
if (!contains(GetContentFlagsDisabled(), flag)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void WorldContentService::ReloadContentFlags()
|
||||
{
|
||||
std::vector<ContentFlagsRepository::ContentFlags> set_content_flags;
|
||||
auto flags = ContentFlagsRepository::All(*GetDatabase());
|
||||
|
||||
set_content_flags.reserve(flags.size());
|
||||
for (auto &f: flags) {
|
||||
set_content_flags.push_back(f);
|
||||
|
||||
LogInfo(
|
||||
"Loaded content flag [{}] [{}]",
|
||||
f.flag_name,
|
||||
(f.enabled ? "Enabled" : "Disabled")
|
||||
);
|
||||
}
|
||||
|
||||
SetContentFlags(set_content_flags);
|
||||
}
|
||||
|
||||
Database *WorldContentService::GetDatabase() const
|
||||
{
|
||||
return m_database;
|
||||
}
|
||||
|
||||
WorldContentService *WorldContentService::SetDatabase(Database *database)
|
||||
{
|
||||
WorldContentService::m_database = database;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
void WorldContentService::SetContentFlag(const std::string &content_flag_name, bool enabled)
|
||||
{
|
||||
auto flags = ContentFlagsRepository::GetWhere(
|
||||
*GetDatabase(),
|
||||
fmt::format("flag_name = '{}'", content_flag_name)
|
||||
);
|
||||
|
||||
auto f = ContentFlagsRepository::NewEntity();
|
||||
if (!flags.empty()) {
|
||||
f = flags.front();
|
||||
}
|
||||
|
||||
f.enabled = enabled ? 1 : 0;
|
||||
f.flag_name = content_flag_name;
|
||||
|
||||
if (!flags.empty()) {
|
||||
ContentFlagsRepository::UpdateOne(*GetDatabase(), f);
|
||||
}
|
||||
else {
|
||||
ContentFlagsRepository::InsertOne(*GetDatabase(), f);
|
||||
}
|
||||
|
||||
ReloadContentFlags();
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "../loottable.h"
|
||||
#include "../repositories/content_flags_repository.h"
|
||||
|
||||
class Database;
|
||||
|
||||
@@ -160,15 +162,28 @@ public:
|
||||
bool IsCurrentExpansionTheBurningLands() { return current_expansion == Expansion::ExpansionNumber::TheBurningLands; }
|
||||
bool IsCurrentExpansionTormentOfVelious() { return current_expansion == Expansion::ExpansionNumber::TormentOfVelious; }
|
||||
|
||||
const std::vector<ContentFlagsRepository::ContentFlags> &GetContentFlags() const;
|
||||
std::vector<std::string> GetContentFlagsEnabled();
|
||||
std::vector<std::string> GetContentFlagsDisabled();
|
||||
bool IsContentFlagEnabled(const std::string& content_flag);
|
||||
bool IsContentFlagDisabled(const std::string& content_flag);
|
||||
void SetContentFlags(std::vector<ContentFlagsRepository::ContentFlags> content_flags);
|
||||
void ReloadContentFlags();
|
||||
WorldContentService * SetExpansionContext();
|
||||
|
||||
bool DoesPassContentFiltering(const ContentFlags& f);
|
||||
|
||||
WorldContentService * SetDatabase(Database *database);
|
||||
Database *GetDatabase() const;
|
||||
|
||||
void SetContentFlag(const std::string &content_flag_name, bool enabled);
|
||||
|
||||
private:
|
||||
int current_expansion{};
|
||||
std::vector<std::string> content_flags;
|
||||
public:
|
||||
const std::vector<std::string> &GetContentFlags() const;
|
||||
bool IsContentFlagEnabled(const std::string& content_flag);
|
||||
void SetContentFlags(std::vector<std::string> content_flags);
|
||||
void ReloadContentFlags(Database &db);
|
||||
void SetExpansionContext();
|
||||
std::vector<ContentFlagsRepository::ContentFlags> content_flags;
|
||||
|
||||
// reference to database
|
||||
Database *m_database;
|
||||
};
|
||||
|
||||
extern WorldContentService content_service;
|
||||
|
||||
+14
-2
@@ -716,7 +716,7 @@ bool Database::SaveCharacterCreate(uint32 character_id, uint32 account_id, Playe
|
||||
/* HoTT Ability */
|
||||
if(RuleB(Character, GrantHoTTOnCreate))
|
||||
{
|
||||
query = StringFormat("INSERT INTO `character_leadership_abilities` (id, slot, rank) VALUES (%u, %i, %i)", character_id, 14, 1);
|
||||
query = StringFormat("INSERT INTO `character_leadership_abilities` (id, slot, `rank`) VALUES (%u, %i, %i)", character_id, 14, 1);
|
||||
results = QueryDatabase(query);
|
||||
}
|
||||
|
||||
@@ -997,6 +997,18 @@ bool Database::SetVariable(const std::string varname, const std::string &varvalu
|
||||
return true;
|
||||
}
|
||||
|
||||
void Database::SetAccountCRCField(uint32 account_id, std::string field_name, uint64 checksum)
|
||||
{
|
||||
QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE `account` SET `{}` = '{}' WHERE `id` = {}",
|
||||
field_name,
|
||||
checksum,
|
||||
account_id
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Get zone starting points from DB
|
||||
bool Database::GetSafePoints(const char* zone_short_name, uint32 instance_version, float* safe_x, float* safe_y, float* safe_z, float* safe_heading, int16* min_status, uint8* min_level, char *flag_needed) {
|
||||
|
||||
@@ -2285,7 +2297,7 @@ void Database::SetIPExemption(std::string account_ip, int exemption_amount) {
|
||||
auto row = results.begin();
|
||||
exemption_id = atoi(row[0]);
|
||||
}
|
||||
|
||||
|
||||
query = fmt::format(
|
||||
"INSERT INTO `ip_exemptions` (`exemption_ip`, `exemption_amount`) VALUES ('{}', {})",
|
||||
account_ip,
|
||||
|
||||
@@ -190,6 +190,8 @@ public:
|
||||
|
||||
int16 CheckStatus(uint32 account_id);
|
||||
|
||||
void SetAccountCRCField(uint32 account_id, std::string field_name, uint64 checksum);
|
||||
|
||||
uint32 CheckLogin(const char* name, const char* password, const char *loginserver, int16* oStatus = 0);
|
||||
uint32 CreateAccount(const char* name, const char* password, int16 status, const char* loginserver, uint32 lsaccount_id);
|
||||
uint32 GetAccountIDFromLSID(const std::string& in_loginserver_id, uint32 in_loginserver_account_id, char* in_account_name = 0, int16* in_status = 0);
|
||||
|
||||
@@ -476,7 +476,7 @@ bool Database::CheckDatabaseConversions() {
|
||||
CheckDatabaseConvertCorpseDeblob();
|
||||
|
||||
/* Run EQEmu Server script (Checks for database updates) */
|
||||
if(system("perl eqemu_server.pl ran_from_world"));
|
||||
system("perl eqemu_server.pl ran_from_world");
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1452,7 +1452,7 @@ bool Database::CheckDatabaseConvertPPDeblob(){
|
||||
for (i = 0; i < MAX_LEADERSHIP_AA_ARRAY; i++){
|
||||
if (pp->leader_abilities.ranks[i] > 0 && pp->leader_abilities.ranks[i] < 6){
|
||||
if (first_entry != 1){
|
||||
rquery = StringFormat("REPLACE INTO `character_leadership_abilities` (id, slot, rank) VALUES (%i, %u, %u)", character_id, i, pp->leader_abilities.ranks[i]);
|
||||
rquery = StringFormat("REPLACE INTO `character_leadership_abilities` (id, slot, `rank`) VALUES (%i, %u, %u)", character_id, i, pp->leader_abilities.ranks[i]);
|
||||
first_entry = 1;
|
||||
}
|
||||
rquery = rquery + StringFormat(", (%i, %u, %u)", character_id, i, pp->leader_abilities.ranks[i]);
|
||||
|
||||
@@ -82,7 +82,6 @@ namespace DatabaseSchema {
|
||||
{"player_titlesets", "char_id"},
|
||||
{"quest_globals", "charid"},
|
||||
{"timers", "char_id"},
|
||||
{"titles", "char_id"},
|
||||
{"trader", "char_id"},
|
||||
{"zone_flags", "charID"}
|
||||
};
|
||||
@@ -158,7 +157,6 @@ namespace DatabaseSchema {
|
||||
"spell_buckets",
|
||||
"spell_globals",
|
||||
"timers",
|
||||
"titles",
|
||||
"trader",
|
||||
"trader_audit",
|
||||
"zone_flags"
|
||||
@@ -270,6 +268,7 @@ namespace DatabaseSchema {
|
||||
"perl_event_export_settings",
|
||||
"profanity_list",
|
||||
"rule_sets",
|
||||
"titles",
|
||||
"rule_values",
|
||||
"variables",
|
||||
};
|
||||
|
||||
@@ -561,8 +561,9 @@ std::string DynamicZoneBase::GetDynamicZoneTypeName(DynamicZoneType dz_type)
|
||||
return "Mission";
|
||||
case DynamicZoneType::Quest:
|
||||
return "Quest";
|
||||
default:
|
||||
return "Unknown";
|
||||
}
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
EQ::Net::DynamicPacket DynamicZoneBase::GetSerializedDzPacket()
|
||||
|
||||
+187
-2
@@ -19,6 +19,8 @@
|
||||
|
||||
#include "emu_constants.h"
|
||||
#include "languages.h"
|
||||
#include "data_verification.h"
|
||||
#include "bodytypes.h"
|
||||
|
||||
|
||||
int16 EQ::invtype::GetInvTypeSize(int16 inv_type) {
|
||||
@@ -148,8 +150,9 @@ const char *EQ::constants::GetStanceName(StanceType stance_type) {
|
||||
}
|
||||
|
||||
int EQ::constants::ConvertStanceTypeToIndex(StanceType stance_type) {
|
||||
if (stance_type >= EQ::constants::stancePassive && stance_type <= EQ::constants::stanceBurnAE)
|
||||
if (EQ::ValueWithin(stance_type, EQ::constants::stancePassive, EQ::constants::stanceBurnAE)) {
|
||||
return (stance_type - EQ::constants::stancePassive);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -191,9 +194,191 @@ const std::map<int, std::string>& EQ::constants::GetLanguageMap()
|
||||
|
||||
std::string EQ::constants::GetLanguageName(int language_id)
|
||||
{
|
||||
if (language_id >= LANG_COMMON_TONGUE && language_id <= LANG_UNKNOWN) {
|
||||
if (EQ::ValueWithin(language_id, LANG_COMMON_TONGUE, LANG_UNKNOWN)) {
|
||||
auto languages = EQ::constants::GetLanguageMap();
|
||||
return languages[language_id];
|
||||
}
|
||||
return std::string();
|
||||
}
|
||||
|
||||
const std::map<uint32, std::string>& EQ::constants::GetLDoNThemeMap()
|
||||
{
|
||||
static const std::map<uint32, std::string> ldon_theme_map = {
|
||||
{ LDoNThemes::Unused, "Unused" },
|
||||
{ LDoNThemes::GUK, "Deepest Guk" },
|
||||
{ LDoNThemes::MIR, "Miragul's Menagerie" },
|
||||
{ LDoNThemes::MMC, "Mistmoore Catacombs" },
|
||||
{ LDoNThemes::RUJ, "Rujarkian Hills" },
|
||||
{ LDoNThemes::TAK, "Takish-Hiz" },
|
||||
};
|
||||
return ldon_theme_map;
|
||||
}
|
||||
|
||||
std::string EQ::constants::GetLDoNThemeName(uint32 theme_id)
|
||||
{
|
||||
if (EQ::ValueWithin(theme_id, LDoNThemes::Unused, LDoNThemes::TAK)) {
|
||||
auto ldon_themes = EQ::constants::GetLDoNThemeMap();
|
||||
return ldon_themes[theme_id];
|
||||
}
|
||||
return std::string();
|
||||
}
|
||||
|
||||
const std::map<uint8, std::string>& EQ::constants::GetFlyModeMap()
|
||||
{
|
||||
static const std::map<uint8, std::string> flymode_map = {
|
||||
{ GravityBehavior::Ground, "Ground" },
|
||||
{ GravityBehavior::Flying, "Flying" },
|
||||
{ GravityBehavior::Levitating, "Levitating" },
|
||||
{ GravityBehavior::Water, "Water" },
|
||||
{ GravityBehavior::Floating, "Floating" },
|
||||
{ GravityBehavior::LevitateWhileRunning, "Levitating While Running" },
|
||||
};
|
||||
return flymode_map;
|
||||
}
|
||||
|
||||
std::string EQ::constants::GetFlyModeName(uint8 flymode_id)
|
||||
{
|
||||
if (EQ::ValueWithin(flymode_id, GravityBehavior::Ground, GravityBehavior::LevitateWhileRunning)) {
|
||||
auto flymodes = EQ::constants::GetFlyModeMap();
|
||||
return flymodes[flymode_id];
|
||||
}
|
||||
return std::string();
|
||||
}
|
||||
|
||||
const std::map<bodyType, std::string>& EQ::constants::GetBodyTypeMap()
|
||||
{
|
||||
static const std::map<bodyType, std::string> bodytype_map = {
|
||||
{ BT_Humanoid, "Humanoid" },
|
||||
{ BT_Lycanthrope, "Lycanthrope" },
|
||||
{ BT_Undead, "Undead" },
|
||||
{ BT_Giant, "Giant" },
|
||||
{ BT_Construct, "Construct" },
|
||||
{ BT_Extraplanar, "Extraplanar" },
|
||||
{ BT_Magical, "Magical" },
|
||||
{ BT_SummonedUndead, "Summoned Undead" },
|
||||
{ BT_RaidGiant, "Raid Giant" },
|
||||
{ BT_RaidColdain, "Raid Coldain" },
|
||||
{ BT_NoTarget, "Untargetable" },
|
||||
{ BT_Vampire, "Vampire" },
|
||||
{ BT_Atenha_Ra, "Aten Ha Ra" },
|
||||
{ BT_Greater_Akheva, "Greater Akheva" },
|
||||
{ BT_Khati_Sha, "Khati Sha" },
|
||||
{ BT_Seru, "Seru" },
|
||||
{ BT_Grieg_Veneficus, "Grieg Veneficus" },
|
||||
{ BT_Draz_Nurakk, "Draz Nurakk" },
|
||||
{ BT_Zek, "Zek" },
|
||||
{ BT_Luggald, "Luggald" },
|
||||
{ BT_Animal, "Animal" },
|
||||
{ BT_Insect, "Insect" },
|
||||
{ BT_Monster, "Monster" },
|
||||
{ BT_Summoned, "Summoned" },
|
||||
{ BT_Plant, "Plant" },
|
||||
{ BT_Dragon, "Dragon" },
|
||||
{ BT_Summoned2, "Summoned 2" },
|
||||
{ BT_Summoned3, "Summoned 3" },
|
||||
{ BT_Dragon2, "Dragon 2" },
|
||||
{ BT_VeliousDragon, "Velious Dragon" },
|
||||
{ BT_Familiar, "Familiar" },
|
||||
{ BT_Dragon3, "Dragon 3" },
|
||||
{ BT_Boxes, "Boxes" },
|
||||
{ BT_Muramite, "Muramite" },
|
||||
{ BT_NoTarget2, "Untargetable 2" },
|
||||
{ BT_SwarmPet, "Swarm Pet" },
|
||||
{ BT_MonsterSummon, "Monster Summon" },
|
||||
{ BT_InvisMan, "Invisible Man" },
|
||||
{ BT_Special, "Special" },
|
||||
};
|
||||
return bodytype_map;
|
||||
}
|
||||
|
||||
std::string EQ::constants::GetBodyTypeName(bodyType bodytype_id)
|
||||
{
|
||||
auto bodytypes = EQ::constants::GetBodyTypeMap();
|
||||
if (!bodytypes[bodytype_id].empty()) {
|
||||
return bodytypes[bodytype_id];
|
||||
}
|
||||
return std::string();
|
||||
}
|
||||
|
||||
const std::map<uint8, std::string>& EQ::constants::GetAccountStatusMap()
|
||||
{
|
||||
static const std::map<uint8, std::string> account_status_map = {
|
||||
{ AccountStatus::Player, "Player" },
|
||||
{ AccountStatus::Steward, "Steward" },
|
||||
{ AccountStatus::ApprenticeGuide, "Apprentice Guide" },
|
||||
{ AccountStatus::Guide, "Guide" },
|
||||
{ AccountStatus::QuestTroupe, "Quest Troupe" },
|
||||
{ AccountStatus::SeniorGuide, "Senior Guide" },
|
||||
{ AccountStatus::GMTester, "GM Tester" },
|
||||
{ AccountStatus::EQSupport, "EQ Support" },
|
||||
{ AccountStatus::GMStaff, "GM Staff" },
|
||||
{ AccountStatus::GMAdmin, "GM Admin" },
|
||||
{ AccountStatus::GMLeadAdmin, "GM Lead Admin" },
|
||||
{ AccountStatus::QuestMaster, "Quest Master" },
|
||||
{ AccountStatus::GMAreas, "GM Areas" },
|
||||
{ AccountStatus::GMCoder, "GM Coder" },
|
||||
{ AccountStatus::GMMgmt, "GM Mgmt" },
|
||||
{ AccountStatus::GMImpossible, "GM Impossible" },
|
||||
{ AccountStatus::Max, "GM Max" }
|
||||
};
|
||||
return account_status_map;
|
||||
}
|
||||
|
||||
std::string EQ::constants::GetAccountStatusName(uint8 account_status)
|
||||
{
|
||||
auto account_statuses = EQ::constants::GetAccountStatusMap();
|
||||
std::string status_name;
|
||||
for (auto status_level = account_statuses.rbegin(); status_level != account_statuses.rend(); ++status_level) {
|
||||
if (account_status >= status_level->first) {
|
||||
status_name = status_level->second;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return status_name;
|
||||
}
|
||||
|
||||
const std::map<uint8, std::string>& EQ::constants::GetConsiderLevelMap()
|
||||
{
|
||||
static const std::map<uint8, std::string> consider_level_map = {
|
||||
{ ConsiderLevel::Ally, "Ally" },
|
||||
{ ConsiderLevel::Warmly, "Warmly" },
|
||||
{ ConsiderLevel::Kindly, "Kindly" },
|
||||
{ ConsiderLevel::Amiably, "Amiably" },
|
||||
{ ConsiderLevel::Indifferently, "Indifferently" },
|
||||
{ ConsiderLevel::Apprehensively, "Apprehensively" },
|
||||
{ ConsiderLevel::Dubiously, "Dubiously" },
|
||||
{ ConsiderLevel::Threateningly, "Threateningly" },
|
||||
{ ConsiderLevel::Scowls, "Scowls" }
|
||||
};
|
||||
return consider_level_map;
|
||||
}
|
||||
|
||||
std::string EQ::constants::GetConsiderLevelName(uint8 faction_consider_level)
|
||||
{
|
||||
auto consider_levels = EQ::constants::GetConsiderLevelMap();
|
||||
if (!consider_levels[faction_consider_level].empty()) {
|
||||
return consider_levels[faction_consider_level];
|
||||
}
|
||||
return std::string();
|
||||
}
|
||||
|
||||
const std::map<uint8, std::string>& EQ::constants::GetEnvironmentalDamageMap()
|
||||
{
|
||||
static const std::map<uint8, std::string> damage_type_map = {
|
||||
{ EnvironmentalDamage::Lava, "Lava" },
|
||||
{ EnvironmentalDamage::Drowning, "Drowning" },
|
||||
{ EnvironmentalDamage::Falling, "Falling" },
|
||||
{ EnvironmentalDamage::Trap, "Trap" }
|
||||
};
|
||||
return damage_type_map;
|
||||
}
|
||||
|
||||
std::string EQ::constants::GetEnvironmentalDamageName(uint8 damage_type)
|
||||
{
|
||||
if (EQ::ValueWithin(damage_type, EnvironmentalDamage::Lava, EnvironmentalDamage::Trap)) {
|
||||
auto damage_types = EQ::constants::GetEnvironmentalDamageMap();
|
||||
return damage_types[damage_type];
|
||||
}
|
||||
return std::string();
|
||||
}
|
||||
|
||||
+86
-7
@@ -22,6 +22,7 @@
|
||||
|
||||
#include "eq_limits.h"
|
||||
#include "emu_versions.h"
|
||||
#include "bodytypes.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@@ -220,12 +221,46 @@ namespace EQ
|
||||
stanceBurnAE
|
||||
};
|
||||
|
||||
enum GravityBehavior : uint8 {
|
||||
Ground,
|
||||
Flying,
|
||||
Levitating,
|
||||
Water,
|
||||
Floating,
|
||||
LevitateWhileRunning
|
||||
};
|
||||
|
||||
enum EnvironmentalDamage : uint8 {
|
||||
Lava = 250,
|
||||
Drowning,
|
||||
Falling,
|
||||
Trap
|
||||
};
|
||||
|
||||
const char *GetStanceName(StanceType stance_type);
|
||||
int ConvertStanceTypeToIndex(StanceType stance_type);
|
||||
|
||||
extern const std::map<int, std::string>& GetLanguageMap();
|
||||
std::string GetLanguageName(int language_id);
|
||||
|
||||
extern const std::map<uint32, std::string>& GetLDoNThemeMap();
|
||||
std::string GetLDoNThemeName(uint32 theme_id);
|
||||
|
||||
extern const std::map<uint8, std::string>& GetFlyModeMap();
|
||||
std::string GetFlyModeName(uint8 flymode_id);
|
||||
|
||||
extern const std::map<bodyType, std::string>& GetBodyTypeMap();
|
||||
std::string GetBodyTypeName(bodyType bodytype_id);
|
||||
|
||||
extern const std::map<uint8, std::string>& GetAccountStatusMap();
|
||||
std::string GetAccountStatusName(uint8 account_status);
|
||||
|
||||
extern const std::map<uint8, std::string>& GetConsiderLevelMap();
|
||||
std::string GetConsiderLevelName(uint8 consider_level);
|
||||
|
||||
extern const std::map<uint8, std::string>& GetEnvironmentalDamageMap();
|
||||
std::string GetEnvironmentalDamageName(uint8 damage_type);
|
||||
|
||||
const int STANCE_TYPE_FIRST = stancePassive;
|
||||
const int STANCE_TYPE_LAST = stanceBurnAE;
|
||||
const int STANCE_TYPE_COUNT = stanceBurnAE;
|
||||
@@ -328,13 +363,57 @@ namespace EQ
|
||||
Guild
|
||||
};
|
||||
}; // namespace consent
|
||||
|
||||
} /*EQEmu*/
|
||||
|
||||
enum ServerLockType : int {
|
||||
List,
|
||||
Lock,
|
||||
Unlock
|
||||
};
|
||||
|
||||
enum AccountStatus : uint8 {
|
||||
Player = 0,
|
||||
Steward = 10,
|
||||
ApprenticeGuide = 20,
|
||||
Guide = 50,
|
||||
QuestTroupe = 80,
|
||||
SeniorGuide = 81,
|
||||
GMTester = 85,
|
||||
EQSupport = 90,
|
||||
GMStaff = 95,
|
||||
GMAdmin = 100,
|
||||
GMLeadAdmin = 150,
|
||||
QuestMaster = 160,
|
||||
GMAreas = 170,
|
||||
GMCoder = 180,
|
||||
GMMgmt = 200,
|
||||
GMImpossible = 250,
|
||||
Max = 255
|
||||
};
|
||||
|
||||
enum Invisibility : uint8 {
|
||||
Visible,
|
||||
Invisible,
|
||||
Special = 255
|
||||
};
|
||||
|
||||
enum AugmentActions : int {
|
||||
Insert,
|
||||
Remove,
|
||||
Swap,
|
||||
Destroy
|
||||
};
|
||||
|
||||
enum ConsiderLevel : uint8 {
|
||||
Ally = 1,
|
||||
Warmly,
|
||||
Kindly,
|
||||
Amiably,
|
||||
Indifferently,
|
||||
Apprehensively,
|
||||
Dubiously,
|
||||
Threateningly,
|
||||
Scowls
|
||||
};
|
||||
|
||||
#endif /*COMMON_EMU_CONSTANTS_H*/
|
||||
|
||||
/* hack list to prevent circular references
|
||||
|
||||
eq_limits.h:EQ::inventory::LookupEntry::InventoryTypeSize[n];
|
||||
|
||||
*/
|
||||
|
||||
+3
-2
@@ -129,8 +129,8 @@ N(OP_DisciplineTimer),
|
||||
N(OP_DisciplineUpdate),
|
||||
N(OP_DiscordMerchantInventory),
|
||||
N(OP_DoGroupLeadershipAbility),
|
||||
N(OP_DuelResponse),
|
||||
N(OP_DuelResponse2),
|
||||
N(OP_DuelDecline),
|
||||
N(OP_DuelAccept),
|
||||
N(OP_DumpName),
|
||||
N(OP_Dye),
|
||||
N(OP_DynamicWall),
|
||||
@@ -558,6 +558,7 @@ N(OP_WhoAllRequest),
|
||||
N(OP_WhoAllResponse),
|
||||
N(OP_World_Client_CRC1),
|
||||
N(OP_World_Client_CRC2),
|
||||
N(OP_World_Client_CRC3),
|
||||
N(OP_WorldClientReady),
|
||||
N(OP_WorldComplete),
|
||||
N(OP_WorldLogout),
|
||||
|
||||
@@ -448,6 +448,7 @@ struct ManaChange_Struct
|
||||
/*08*/ uint32 spell_id;
|
||||
/*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting?
|
||||
/*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like
|
||||
/*16*/ int32 slot; // -1 normal, otherwise clear ETA and GCD
|
||||
};
|
||||
|
||||
struct SwapSpell_Struct
|
||||
@@ -2761,7 +2762,7 @@ struct EnvDamage2_Struct {
|
||||
/*0004*/ uint16 unknown4;
|
||||
/*0006*/ uint32 damage;
|
||||
/*0010*/ uint8 unknown10[12];
|
||||
/*0022*/ uint8 dmgtype; //FA = Lava; FC = Falling
|
||||
/*0022*/ uint8 dmgtype; // FA = Lava, FB = Drowning, FC = Falling, FD = Trap
|
||||
/*0023*/ uint8 unknown2[4];
|
||||
/*0027*/ uint16 constant; //Always FFFF
|
||||
/*0029*/ uint16 unknown29;
|
||||
@@ -5581,6 +5582,11 @@ struct SayLinkBodyFrame_Struct {
|
||||
/*056*/
|
||||
};
|
||||
|
||||
struct Checksum_Struct {
|
||||
uint64 checksum;
|
||||
uint8 data[2048];
|
||||
};
|
||||
|
||||
struct UpdateMovementEntry {
|
||||
/* 00 */ float Y;
|
||||
/* 04 */ float X;
|
||||
|
||||
+20
-18
@@ -116,22 +116,24 @@ EQEmuLogSys *EQEmuLogSys::LoadLogSettingsDefaults()
|
||||
/**
|
||||
* Set Defaults
|
||||
*/
|
||||
log_settings[Logs::WorldServer].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::ZoneServer].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::QSServer].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::UCSServer].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::Crash].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::MySQLError].log_to_console = static_cast<uint8>(Logs::General);
|
||||
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);
|
||||
log_settings[Logs::Loot].log_to_gmsay = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::Scheduler].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::Cheat].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::HTTP].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::HTTP].log_to_gmsay = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::WorldServer].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::ZoneServer].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::QSServer].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::UCSServer].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::Crash].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::MySQLError].log_to_console = static_cast<uint8>(Logs::General);
|
||||
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);
|
||||
log_settings[Logs::Loot].log_to_gmsay = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::Scheduler].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::Cheat].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::HTTP].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::HTTP].log_to_gmsay = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::ChecksumVerification].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::ChecksumVerification].log_to_gmsay = static_cast<uint8>(Logs::General);
|
||||
|
||||
/**
|
||||
* RFC 5424
|
||||
@@ -241,7 +243,7 @@ void EQEmuLogSys::ProcessGMSay(
|
||||
*/
|
||||
if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone ||
|
||||
EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformWorld
|
||||
) {
|
||||
) {
|
||||
on_log_gmsay_hook(log_category, message);
|
||||
}
|
||||
}
|
||||
@@ -467,7 +469,7 @@ void EQEmuLogSys::Out(
|
||||
std::string prefix;
|
||||
|
||||
if (RuleB(Logging, PrintFileFunctionAndLine)) {
|
||||
prefix = fmt::format("[{0}::{1}:{2}] ", base_file_name(file), func, line);
|
||||
prefix = fmt::format("[{0}:{1}] ", base_file_name(file), line);
|
||||
}
|
||||
|
||||
va_list args;
|
||||
|
||||
@@ -127,6 +127,7 @@ namespace Logs {
|
||||
DiaWind,
|
||||
HTTP,
|
||||
Saylink,
|
||||
ChecksumVerification,
|
||||
MaxCategoryID /* Don't Remove this */
|
||||
};
|
||||
|
||||
@@ -212,6 +213,7 @@ namespace Logs {
|
||||
"DialogueWindow",
|
||||
"HTTP",
|
||||
"Saylink",
|
||||
"ChecksumVerification",
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -696,6 +696,16 @@
|
||||
OutF(LogSys, Logs::Detail, Logs::Saylink, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogChecksumVerification(message, ...) do {\
|
||||
if (LogSys.log_settings[Logs::ChecksumVerification].is_category_enabled == 1)\
|
||||
OutF(LogSys, Logs::General, Logs::ChecksumVerification, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogChecksumVerificationDetail(message, ...) do {\
|
||||
if (LogSys.log_settings[Logs::ChecksumVerification].is_category_enabled == 1)\
|
||||
OutF(LogSys, Logs::Detail, Logs::ChecksumVerification, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define Log(debug_level, log_category, message, ...) do {\
|
||||
if (LogSys.log_settings[log_category].is_category_enabled == 1)\
|
||||
LogSys.Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
@@ -1092,6 +1102,18 @@
|
||||
#define LogHTTPDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogSaylink(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogSaylinkDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogChecksumVerification(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define LogChecksumVerificationDetail(message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
#define Log(debug_level, log_category, message, ...) do {\
|
||||
} while (0)
|
||||
|
||||
|
||||
+22
-22
@@ -20,31 +20,31 @@
|
||||
#include "races.h"
|
||||
#include "rulesys.h"
|
||||
|
||||
const char *FactionValueToString(FACTION_VALUE fv)
|
||||
const char *FactionValueToString(FACTION_VALUE faction_value)
|
||||
{
|
||||
switch (fv) {
|
||||
switch (faction_value) {
|
||||
case FACTION_ALLY:
|
||||
return ("Ally");
|
||||
return "Ally";
|
||||
case FACTION_WARMLY:
|
||||
return ("Warmly");
|
||||
return "Warmly";
|
||||
case FACTION_KINDLY:
|
||||
return ("Kindly");
|
||||
case FACTION_AMIABLE:
|
||||
return ("Amiable");
|
||||
case FACTION_INDIFFERENT:
|
||||
return ("Indifferent");
|
||||
case FACTION_APPREHENSIVE:
|
||||
return ("Apprehensive");
|
||||
case FACTION_DUBIOUS:
|
||||
return ("Dubious");
|
||||
case FACTION_THREATENLY:
|
||||
return ("Threatenly");
|
||||
return "Kindly";
|
||||
case FACTION_AMIABLY:
|
||||
return "Amiably";
|
||||
case FACTION_INDIFFERENTLY:
|
||||
return "Indifferently";
|
||||
case FACTION_APPREHENSIVELY:
|
||||
return "Apprehensively";
|
||||
case FACTION_DUBIOUSLY:
|
||||
return "Dubiously";
|
||||
case FACTION_THREATENINGLY:
|
||||
return "Threateningly";
|
||||
case FACTION_SCOWLS:
|
||||
return ("Scowls, ready to attack.");
|
||||
return "Scowls";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return ("Unknown Faction Con");
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
|
||||
@@ -70,19 +70,19 @@ FACTION_VALUE CalculateFaction(FactionMods* fm, int32 tmpCharacter_value)
|
||||
return FACTION_KINDLY;
|
||||
}
|
||||
if (character_value >= RuleI(Faction, AmiablyFactionMinimum)) {
|
||||
return FACTION_AMIABLE;
|
||||
return FACTION_AMIABLY;
|
||||
}
|
||||
if (character_value >= RuleI(Faction, IndifferentlyFactionMinimum)) {
|
||||
return FACTION_INDIFFERENT;
|
||||
return FACTION_INDIFFERENTLY;
|
||||
}
|
||||
if (character_value >= RuleI(Faction, ApprehensivelyFactionMinimum)) {
|
||||
return FACTION_APPREHENSIVE;
|
||||
return FACTION_APPREHENSIVELY;
|
||||
}
|
||||
if (character_value >= RuleI(Faction, DubiouslyFactionMinimum)) {
|
||||
return FACTION_DUBIOUS;
|
||||
return FACTION_DUBIOUSLY;
|
||||
}
|
||||
if (character_value >= RuleI(Faction, ThreateninglyFactionMinimum)) {
|
||||
return FACTION_THREATENLY;
|
||||
return FACTION_THREATENINGLY;
|
||||
}
|
||||
return FACTION_SCOWLS;
|
||||
}
|
||||
|
||||
+6
-6
@@ -27,13 +27,13 @@ enum FACTION_VALUE {
|
||||
FACTION_ALLY = 1,
|
||||
FACTION_WARMLY = 2,
|
||||
FACTION_KINDLY = 3,
|
||||
FACTION_AMIABLE = 4,
|
||||
FACTION_AMIABLY = 4,
|
||||
|
||||
FACTION_INDIFFERENT = 5,
|
||||
FACTION_INDIFFERENTLY = 5,
|
||||
|
||||
FACTION_APPREHENSIVE = 6,
|
||||
FACTION_DUBIOUS = 7,
|
||||
FACTION_THREATENLY = 8,
|
||||
FACTION_APPREHENSIVELY = 6,
|
||||
FACTION_DUBIOUSLY = 7,
|
||||
FACTION_THREATENINGLY = 8,
|
||||
FACTION_SCOWLS = 9
|
||||
};
|
||||
|
||||
@@ -75,6 +75,6 @@ struct NPCFaction
|
||||
uint8 temp;
|
||||
};
|
||||
|
||||
const char *FactionValueToString(FACTION_VALUE fv);
|
||||
const char *FactionValueToString(FACTION_VALUE faction_value);
|
||||
FACTION_VALUE CalculateFaction(FactionMods* fm, int32 tmpCharacter_value);
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -204,7 +204,7 @@ enum { //some random constants
|
||||
#define MIN_LEVEL_ALCHEMY 25
|
||||
|
||||
//chance ratio that a
|
||||
#define THREATENLY_ARRGO_CHANCE 32 // 32/128 (25%) chance that a mob will arrgo on con Threatenly
|
||||
#define THREATENINGLY_AGGRO_CHANCE 32 // 32/128 (25%) chance that a mob will arrgo on con Threatenly
|
||||
|
||||
//max factions per npc faction list
|
||||
#define MAX_NPC_FACTIONS 20
|
||||
|
||||
@@ -64,4 +64,9 @@ void FileUtil::mkdir(const std::string& directory_name)
|
||||
}
|
||||
::mkdir(directory_name.c_str(), 0755);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
bool file_exists(const std::string& name) {
|
||||
std::ifstream f(name.c_str());
|
||||
return f.good();
|
||||
}
|
||||
|
||||
@@ -28,5 +28,6 @@ public:
|
||||
static void mkdir(const std::string& directory_name);
|
||||
};
|
||||
|
||||
bool file_exists(const std::string& name);
|
||||
|
||||
#endif //EQEMU_FILE_UTIL_H
|
||||
|
||||
+66
-6
@@ -63,7 +63,7 @@ bool BaseGuildManager::LoadGuilds() {
|
||||
for (auto row=results.begin();row!=results.end();++row)
|
||||
_CreateGuild(atoi(row[0]), row[1], atoi(row[2]), atoi(row[3]), row[4], row[5], row[6], row[7]);
|
||||
|
||||
query = "SELECT guild_id,rank,title,can_hear,can_speak,can_invite,can_remove,can_promote,can_demote,can_motd,can_warpeace FROM guild_ranks";
|
||||
query = "SELECT guild_id,`rank`,title,can_hear,can_speak,can_invite,can_remove,can_promote,can_demote,can_motd,can_warpeace FROM guild_ranks";
|
||||
results = m_db->QueryDatabase(query);
|
||||
|
||||
if (!results.Success())
|
||||
@@ -131,7 +131,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) {
|
||||
|
||||
info = _CreateGuild(guild_id, row[0], atoi(row[1]), atoi(row[2]), row[3], row[4], row[5], row[6]);
|
||||
|
||||
query = StringFormat("SELECT guild_id, rank, title, can_hear, can_speak, can_invite, can_remove, can_promote, can_demote, can_motd, can_warpeace "
|
||||
query = StringFormat("SELECT guild_id, `rank`, title, can_hear, can_speak, can_invite, can_remove, can_promote, can_demote, can_motd, can_warpeace "
|
||||
"FROM guild_ranks WHERE guild_id=%lu", (unsigned long)guild_id);
|
||||
results = m_db->QueryDatabase(query);
|
||||
|
||||
@@ -268,7 +268,7 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) {
|
||||
m_db->DoEscapeString(title_esc, rankInfo.name.c_str(), rankInfo.name.length());
|
||||
|
||||
query = StringFormat("INSERT INTO guild_ranks "
|
||||
"(guild_id,rank,title,can_hear,can_speak,can_invite,can_remove,can_promote,can_demote,can_motd,can_warpeace)"
|
||||
"(guild_id,`rank`,title,can_hear,can_speak,can_invite,can_remove,can_promote,can_demote,can_motd,can_warpeace)"
|
||||
" VALUES(%d,%d,'%s',%d,%d,%d,%d,%d,%d,%d,%d)",
|
||||
guild_id, rank, title_esc,
|
||||
rankInfo.permissions[GUILD_HEAR],
|
||||
@@ -738,7 +738,7 @@ bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) {
|
||||
std::string query;
|
||||
|
||||
if(guild_id != GUILD_NONE) {
|
||||
query = StringFormat("REPLACE INTO guild_members (char_id,guild_id,rank,public_note) VALUES(%d,%d,%d,'')", charid, guild_id, rank);
|
||||
query = StringFormat("REPLACE INTO guild_members (char_id,guild_id,`rank`,public_note) VALUES(%d,%d,%d,'')", charid, guild_id, rank);
|
||||
auto results = m_db->QueryDatabase(query);
|
||||
|
||||
if (!results.Success()) {
|
||||
@@ -758,7 +758,7 @@ bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) {
|
||||
}
|
||||
|
||||
bool BaseGuildManager::DBSetGuildRank(uint32 charid, uint8 rank) {
|
||||
std::string query = StringFormat("UPDATE guild_members SET rank=%d WHERE char_id=%d", rank, charid);
|
||||
std::string query = StringFormat("UPDATE guild_members SET `rank`=%d WHERE char_id=%d", rank, charid);
|
||||
return(QueryWithLogging(query, "setting a guild member's rank"));
|
||||
}
|
||||
|
||||
@@ -1208,7 +1208,7 @@ BaseGuildManager::RankInfo::RankInfo() {
|
||||
|
||||
BaseGuildManager::GuildInfo::GuildInfo() {
|
||||
leader_char_id = 0;
|
||||
minstatus = 0;
|
||||
minstatus = AccountStatus::Player;
|
||||
}
|
||||
|
||||
uint32 BaseGuildManager::DoesAccountContainAGuildLeader(uint32 AccountID)
|
||||
@@ -1225,6 +1225,66 @@ uint32 BaseGuildManager::DoesAccountContainAGuildLeader(uint32 AccountID)
|
||||
return results.RowCount();
|
||||
}
|
||||
|
||||
std::string BaseGuildManager::GetGuildNameByID(uint32 guild_id) const {
|
||||
if(guild_id == GUILD_NONE) {
|
||||
return std::string();
|
||||
}
|
||||
|
||||
std::map<uint32, GuildInfo *>::const_iterator res;
|
||||
res = m_guilds.find(guild_id);
|
||||
if(res == m_guilds.end()) {
|
||||
return "Invalid Guild";
|
||||
}
|
||||
|
||||
return res->second->name;
|
||||
}
|
||||
|
||||
std::string BaseGuildManager::GetGuildRankName(uint32 guild_id, uint8 rank) const
|
||||
{
|
||||
if(rank > GUILD_MAX_RANK) {
|
||||
return "Invalid Rank";
|
||||
}
|
||||
|
||||
std::map<uint32, GuildInfo *>::const_iterator res;
|
||||
res = m_guilds.find(guild_id);
|
||||
if(res == m_guilds.end()) {
|
||||
return "Invalid Guild Rank";
|
||||
}
|
||||
|
||||
return res->second->ranks[rank].name;
|
||||
}
|
||||
|
||||
uint32 BaseGuildManager::GetGuildIDByCharacterID(uint32 character_id)
|
||||
{
|
||||
if(!m_db) {
|
||||
return GUILD_NONE;
|
||||
}
|
||||
|
||||
std::string query = fmt::format(
|
||||
"SELECT `guild_id` FROM `guild_members` WHERE char_id = {} LIMIT 1",
|
||||
character_id
|
||||
);
|
||||
auto results = m_db->QueryDatabase(query);
|
||||
if(!results.Success() || !results.RowCount()) {
|
||||
return GUILD_NONE;
|
||||
}
|
||||
|
||||
auto row = results.begin();
|
||||
auto guild_id = std::stoul(row[0]);
|
||||
return guild_id;
|
||||
}
|
||||
|
||||
bool BaseGuildManager::IsCharacterInGuild(uint32 character_id, uint32 guild_id)
|
||||
{
|
||||
auto current_guild_id = GetGuildIDByCharacterID(character_id);
|
||||
|
||||
if (current_guild_id == GUILD_NONE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (guild_id && current_guild_id != guild_id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -76,8 +76,12 @@ class BaseGuildManager
|
||||
bool GetGuildChannel(uint32 GuildID, char *ChannelBuffer) const;
|
||||
const char *GetRankName(uint32 guild_id, uint8 rank) const;
|
||||
const char *GetGuildName(uint32 guild_id) const;
|
||||
std::string GetGuildNameByID(uint32 guild_id) const;
|
||||
std::string GetGuildRankName(uint32 guild_id, uint8 rank) const;
|
||||
bool IsCharacterInGuild(uint32 character_id, uint32 guild_id = 0);
|
||||
bool GetGuildNameByID(uint32 guild_id, std::string &into) const;
|
||||
uint32 GetGuildIDByName(const char *GuildName);
|
||||
uint32 GetGuildIDByCharacterID(uint32 character_id);
|
||||
bool IsGuildLeader(uint32 guild_id, uint32 char_id) const;
|
||||
uint8 GetDisplayedRank(uint32 guild_id, uint8 rank, uint32 char_id) const;
|
||||
bool CheckGMStatus(uint32 guild_id, uint8 status) const;
|
||||
|
||||
@@ -399,7 +399,7 @@ bool EQ::InventoryProfile::SwapItem(
|
||||
}
|
||||
|
||||
// Remove item from inventory (with memory delete)
|
||||
bool EQ::InventoryProfile::DeleteItem(int16 slot_id, uint8 quantity) {
|
||||
bool EQ::InventoryProfile::DeleteItem(int16 slot_id, int16 quantity) {
|
||||
// Pop item out of inventory map (or queue)
|
||||
ItemInstance *item_to_delete = PopItem(slot_id);
|
||||
|
||||
@@ -590,6 +590,68 @@ bool EQ::InventoryProfile::HasSpaceForItem(const ItemData *ItemToTry, int16 Quan
|
||||
// Checks that user has at least 'quantity' number of items in a given inventory slot
|
||||
// Returns first slot it was found in, or SLOT_INVALID if not found
|
||||
|
||||
bool EQ::InventoryProfile::HasAugmentEquippedByID(uint32 item_id)
|
||||
{
|
||||
bool has_equipped = false;
|
||||
ItemInstance* item = nullptr;
|
||||
|
||||
for (int slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invslot::EQUIPMENT_END; ++slot_id) {
|
||||
item = GetItem(slot_id);
|
||||
if (item && item->ContainsAugmentByID(item_id)) {
|
||||
has_equipped = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return has_equipped;
|
||||
}
|
||||
|
||||
int EQ::InventoryProfile::CountAugmentEquippedByID(uint32 item_id)
|
||||
{
|
||||
int quantity = 0;
|
||||
ItemInstance* item = nullptr;
|
||||
|
||||
for (int slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invslot::EQUIPMENT_END; ++slot_id) {
|
||||
item = GetItem(slot_id);
|
||||
if (item && item->ContainsAugmentByID(item_id)) {
|
||||
quantity += item->CountAugmentByID(item_id);
|
||||
}
|
||||
}
|
||||
|
||||
return quantity;
|
||||
}
|
||||
|
||||
bool EQ::InventoryProfile::HasItemEquippedByID(uint32 item_id)
|
||||
{
|
||||
bool has_equipped = false;
|
||||
ItemInstance* item = nullptr;
|
||||
|
||||
for (int slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invslot::EQUIPMENT_END; ++slot_id) {
|
||||
item = GetItem(slot_id);
|
||||
if (item && item->GetID() == item_id) {
|
||||
has_equipped = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return has_equipped;
|
||||
}
|
||||
|
||||
int EQ::InventoryProfile::CountItemEquippedByID(uint32 item_id)
|
||||
{
|
||||
int quantity = 0;
|
||||
ItemInstance* item = nullptr;
|
||||
|
||||
for (int slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invslot::EQUIPMENT_END; ++slot_id) {
|
||||
item = GetItem(slot_id);
|
||||
if (item && item->GetID() == item_id) {
|
||||
quantity += item->IsStackable() ? item->GetCharges() : 1;
|
||||
}
|
||||
}
|
||||
|
||||
return quantity;
|
||||
}
|
||||
|
||||
//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 EQ::InventoryProfile::HasItem(uint32 item_id, uint8 quantity, uint8 where)
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace EQ
|
||||
bool SwapItem(int16 source_slot, int16 destination_slot, SwapItemFailState& fail_state, uint16 race_id = 0, uint8 class_id = 0, uint16 deity_id = 0, uint8 level = 0);
|
||||
|
||||
// Remove item from inventory
|
||||
bool DeleteItem(int16 slot_id, uint8 quantity = 0);
|
||||
bool DeleteItem(int16 slot_id, int16 quantity = 0);
|
||||
|
||||
// Checks All items in a bag for No Drop
|
||||
bool CheckNoDrop(int16 slot_id, bool recurse = true);
|
||||
@@ -140,6 +140,18 @@ namespace EQ
|
||||
// Remove item from inventory (and take control of memory)
|
||||
ItemInstance* PopItem(int16 slot_id);
|
||||
|
||||
// Check if player has a specific item equipped by Item ID
|
||||
bool HasItemEquippedByID(uint32 item_id);
|
||||
|
||||
// Check how many of a specific item the player has equipped by Item ID
|
||||
int CountItemEquippedByID(uint32 item_id);
|
||||
|
||||
// Check if player has a specific augment equipped by Item ID
|
||||
bool HasAugmentEquippedByID(uint32 item_id);
|
||||
|
||||
// Check how many of a specific augment the player has equipped by Item ID
|
||||
int CountAugmentEquippedByID(uint32 item_id);
|
||||
|
||||
// Check whether there is space for the specified number of the specified item.
|
||||
bool HasSpaceForItem(const ItemData *ItemToTry, int16 Quantity);
|
||||
|
||||
|
||||
@@ -689,6 +689,45 @@ bool EQ::ItemInstance::IsAugmented()
|
||||
return false;
|
||||
}
|
||||
|
||||
bool EQ::ItemInstance::ContainsAugmentByID(uint32 item_id)
|
||||
{
|
||||
if (!m_item || !m_item->IsClassCommon()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!item_id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (uint8 augment_slot = invaug::SOCKET_BEGIN; augment_slot <= invaug::SOCKET_END; ++augment_slot) {
|
||||
if (GetAugmentItemID(augment_slot) == item_id) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int EQ::ItemInstance::CountAugmentByID(uint32 item_id)
|
||||
{
|
||||
int quantity = 0;
|
||||
if (!m_item || !m_item->IsClassCommon()) {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
if (!item_id) {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
for (uint8 augment_slot = invaug::SOCKET_BEGIN; augment_slot <= invaug::SOCKET_END; ++augment_slot) {
|
||||
if (GetAugmentItemID(augment_slot) == item_id) {
|
||||
quantity++;
|
||||
}
|
||||
}
|
||||
|
||||
return quantity;
|
||||
}
|
||||
|
||||
// Has attack/delay?
|
||||
bool EQ::ItemInstance::IsWeapon() const
|
||||
{
|
||||
@@ -1706,4 +1745,4 @@ EvolveInfo::EvolveInfo(uint32 first, uint8 max, bool allkills, uint32 L2, uint32
|
||||
|
||||
EvolveInfo::~EvolveInfo() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -132,6 +132,8 @@ namespace EQ
|
||||
void DeleteAugment(uint8 slot);
|
||||
ItemInstance* RemoveAugment(uint8 index);
|
||||
bool IsAugmented();
|
||||
bool ContainsAugmentByID(uint32 item_id);
|
||||
int CountAugmentByID(uint32 item_id);
|
||||
ItemInstance* GetOrnamentationAug(int32 ornamentationAugtype) const;
|
||||
bool UpdateOrnamentationInfo();
|
||||
static bool CanTransform(const ItemData *ItemToTry, const ItemData *Container, bool AllowAll = false);
|
||||
|
||||
+14
-5
@@ -30,11 +30,19 @@ struct LootTableEntries_Struct {
|
||||
float probability;
|
||||
};
|
||||
|
||||
struct ContentFlags {
|
||||
int16 min_expansion;
|
||||
int16 max_expansion;
|
||||
char content_flags[100];
|
||||
char content_flags_disabled[100];
|
||||
};
|
||||
|
||||
struct LootTable_Struct {
|
||||
uint32 mincash;
|
||||
uint32 maxcash;
|
||||
uint32 avgcoin;
|
||||
uint32 NumEntries;
|
||||
uint32 mincash;
|
||||
uint32 maxcash;
|
||||
uint32 avgcoin;
|
||||
uint32 NumEntries;
|
||||
ContentFlags content_flags;
|
||||
LootTableEntries_Struct Entries[0];
|
||||
};
|
||||
|
||||
@@ -51,7 +59,8 @@ struct LootDropEntries_Struct {
|
||||
};
|
||||
|
||||
struct LootDrop_Struct {
|
||||
uint32 NumEntries;
|
||||
uint32 NumEntries;
|
||||
ContentFlags content_flags;
|
||||
LootDropEntries_Struct Entries[0];
|
||||
};
|
||||
#pragma pack()
|
||||
|
||||
+1
-1
@@ -194,7 +194,7 @@ void MD5::Final(uint8 digest[16], MD5Context *ctx) {
|
||||
|
||||
/* The heart of the MD5 algorithm. */
|
||||
void MD5::Transform(uint32 hash[4], const uint32 input[16]) {
|
||||
register uint32 a = hash[0], b = hash[1], c = hash[2], d = hash[3];
|
||||
uint32 a = hash[0], b = hash[1], c = hash[2], d = hash[3];
|
||||
|
||||
MD5STEP(F1, a, b, c, d, input[ 0]+0xd76aa478, 7);
|
||||
MD5STEP(F1, d, a, b, c, input[ 1]+0xe8c7b756, 12);
|
||||
|
||||
@@ -15,7 +15,7 @@ EQ::Net::ConsoleServerConnection::ConsoleServerConnection(ConsoleServer *parent,
|
||||
memset(m_line, 0, MaxConsoleLineLength);
|
||||
m_accept_messages = false;
|
||||
m_user_id = 0;
|
||||
m_admin = 0;
|
||||
m_admin = AccountStatus::Player;
|
||||
|
||||
m_connection->OnRead(std::bind(&ConsoleServerConnection::OnRead, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
m_connection->OnDisconnect(std::bind(&ConsoleServerConnection::OnDisconnect, this, std::placeholders::_1));
|
||||
@@ -29,7 +29,7 @@ EQ::Net::ConsoleServerConnection::ConsoleServerConnection(ConsoleServer *parent,
|
||||
if (addr.find("127.0.0.1") != std::string::npos || addr.find("::0") != std::string::npos) {
|
||||
SendLine("Connection established from localhost, assuming admin");
|
||||
m_status = ConsoleStatusLoggedIn;
|
||||
m_admin = 255;
|
||||
m_admin = AccountStatus::Max;
|
||||
SendPrompt();
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <map>
|
||||
#include <unordered_set>
|
||||
#include <array>
|
||||
#include "../emu_constants.h"
|
||||
|
||||
struct MethodHandlerEntry
|
||||
{
|
||||
@@ -174,13 +175,13 @@ Json::Value EQ::Net::WebsocketServer::Login(WebsocketServerConnection *connectio
|
||||
auto r = _impl->login_handler(connection, user, pass);
|
||||
|
||||
if (r.logged_in) {
|
||||
connection->SetAuthorized(true, r.account_name, r.account_id, 255);
|
||||
connection->SetAuthorized(true, r.account_name, r.account_id, AccountStatus::Max);
|
||||
ret["status"] = "Ok";
|
||||
}
|
||||
else if (user == "admin" && (connection->RemoteIP() == "127.0.0.1" || connection->RemoteIP() == "::")) {
|
||||
r.logged_in = true;
|
||||
r.account_id = 0;
|
||||
connection->SetAuthorized(true, r.account_name, r.account_id, 255);
|
||||
connection->SetAuthorized(true, r.account_name, r.account_id, AccountStatus::Max);
|
||||
ret["status"] = "Ok";
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -115,8 +115,8 @@ IN(OP_GMTraining, GMTrainee_Struct);
|
||||
IN(OP_GMEndTraining, GMTrainEnd_Struct);
|
||||
IN(OP_GMTrainSkill, GMSkillChange_Struct);
|
||||
IN(OP_RequestDuel, Duel_Struct);
|
||||
IN(OP_DuelResponse, DuelResponse_Struct);
|
||||
IN(OP_DuelResponse2, Duel_Struct);
|
||||
IN(OP_DuelDecline, DuelResponse_Struct);
|
||||
IN(OP_DuelAccept, Duel_Struct);
|
||||
IN(OP_SpawnAppearance, SpawnAppearance_Struct);
|
||||
IN(OP_BazaarInspect, BazaarInspect_Struct);
|
||||
IN(OP_Death, Death_Struct);
|
||||
|
||||
@@ -240,8 +240,8 @@ void load_opcode_names()
|
||||
opcode_map[0x00a1] = "LiveOP_SaveOnZoneReq";
|
||||
opcode_map[0x0185] = "LiveOP_Logout";
|
||||
opcode_map[0x0298] = "LiveOP_RequestDuel";
|
||||
opcode_map[0x0a5d] = "LiveOP_DuelResponse";
|
||||
opcode_map[0x016e] = "LiveOP_DuelResponse2";
|
||||
opcode_map[0x0a5d] = "LiveOP_DuelDecline";
|
||||
opcode_map[0x016e] = "LiveOP_DuelAccept";
|
||||
opcode_map[0x007c] = "LiveOP_InstillDoubt";
|
||||
opcode_map[0x00ac] = "LiveOP_SafeFallSuccess";
|
||||
opcode_map[0x02fb] = "LiveOP_DisciplineUpdate";
|
||||
|
||||
@@ -1634,20 +1634,6 @@ namespace RoF
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
|
||||
ENCODE(OP_ManaChange)
|
||||
{
|
||||
ENCODE_LENGTH_EXACT(ManaChange_Struct);
|
||||
SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
|
||||
|
||||
OUT(new_mana);
|
||||
OUT(stamina);
|
||||
OUT(spell_id);
|
||||
OUT(keepcasting);
|
||||
eq->slot = -1; // this is spell gem slot. It's -1 in normal operation
|
||||
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
|
||||
ENCODE(OP_MercenaryDataResponse)
|
||||
{
|
||||
//consume the packet
|
||||
|
||||
@@ -1683,20 +1683,6 @@ namespace RoF2
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
|
||||
ENCODE(OP_ManaChange)
|
||||
{
|
||||
ENCODE_LENGTH_EXACT(ManaChange_Struct);
|
||||
SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
|
||||
|
||||
OUT(new_mana);
|
||||
OUT(stamina);
|
||||
OUT(spell_id);
|
||||
OUT(keepcasting);
|
||||
eq->slot = -1; // this is spell gem slot. It's -1 in normal operation
|
||||
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
|
||||
ENCODE(OP_MercenaryDataResponse)
|
||||
{
|
||||
//consume the packet
|
||||
|
||||
@@ -93,7 +93,6 @@ E(OP_ItemVerifyReply)
|
||||
E(OP_LeadershipExpUpdate)
|
||||
E(OP_LogServer)
|
||||
E(OP_LootItem)
|
||||
E(OP_ManaChange)
|
||||
E(OP_MercenaryDataResponse)
|
||||
E(OP_MercenaryDataUpdate)
|
||||
E(OP_MoveItem)
|
||||
|
||||
@@ -3061,7 +3061,7 @@ struct EnvDamage2_Struct {
|
||||
/*0006*/ uint32 damage;
|
||||
/*0010*/ float unknown10; // New to Underfoot - Seen 1
|
||||
/*0014*/ uint8 unknown14[12];
|
||||
/*0026*/ uint8 dmgtype; // FA = Lava; FC = Falling
|
||||
/*0026*/ uint8 dmgtype; // FA = Lava, FB = Drowning, FC = Falling, FD = Trap
|
||||
/*0027*/ uint8 unknown27[4];
|
||||
/*0031*/ uint16 unknown31; // New to Underfoot - Seen 66
|
||||
/*0033*/ uint16 constant; // Always FFFF
|
||||
@@ -5218,6 +5218,11 @@ struct SayLinkBodyFrame_Struct {
|
||||
/*056*/
|
||||
};
|
||||
|
||||
struct Checksum_Struct {
|
||||
uint64_t checksum;
|
||||
uint8_t data[2048];
|
||||
};
|
||||
|
||||
}; /*structs*/
|
||||
|
||||
}; /*RoF2*/
|
||||
|
||||
@@ -79,7 +79,6 @@ E(OP_ItemVerifyReply)
|
||||
E(OP_LeadershipExpUpdate)
|
||||
E(OP_LogServer)
|
||||
E(OP_LootItem)
|
||||
E(OP_ManaChange)
|
||||
E(OP_MercenaryDataResponse)
|
||||
E(OP_MercenaryDataUpdate)
|
||||
E(OP_MoveItem)
|
||||
|
||||
@@ -3032,7 +3032,7 @@ struct EnvDamage2_Struct {
|
||||
/*0006*/ uint32 damage;
|
||||
/*0010*/ float unknown10; // New to Underfoot - Seen 1
|
||||
/*0014*/ uint8 unknown14[12];
|
||||
/*0026*/ uint8 dmgtype; // FA = Lava; FC = Falling
|
||||
/*0026*/ uint8 dmgtype; // FA = Lava, FB = Drowning, FC = Falling, FD = Trap
|
||||
/*0027*/ uint8 unknown27[4];
|
||||
/*0031*/ uint16 unknown31; // New to Underfoot - Seen 66
|
||||
/*0033*/ uint16 constant; // Always FFFF
|
||||
|
||||
@@ -1170,20 +1170,6 @@ namespace SoD
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
|
||||
ENCODE(OP_ManaChange)
|
||||
{
|
||||
ENCODE_LENGTH_EXACT(ManaChange_Struct);
|
||||
SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
|
||||
|
||||
OUT(new_mana);
|
||||
OUT(stamina);
|
||||
OUT(spell_id);
|
||||
OUT(keepcasting);
|
||||
eq->slot = -1; // this is spell gem slot. It's -1 in normal operation
|
||||
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
|
||||
ENCODE(OP_MercenaryDataResponse)
|
||||
{
|
||||
//consume the packet
|
||||
|
||||
@@ -63,7 +63,6 @@ E(OP_ItemVerifyReply)
|
||||
E(OP_LeadershipExpUpdate)
|
||||
E(OP_LogServer)
|
||||
E(OP_LootItem)
|
||||
E(OP_ManaChange)
|
||||
E(OP_MercenaryDataResponse)
|
||||
E(OP_MercenaryDataUpdate)
|
||||
E(OP_MoveItem)
|
||||
|
||||
@@ -2539,7 +2539,7 @@ struct EnvDamage2_Struct {
|
||||
/*0004*/ uint16 unknown4;
|
||||
/*0006*/ uint32 damage;
|
||||
/*0010*/ uint8 unknown10[12];
|
||||
/*0022*/ uint8 dmgtype; //FA = Lava; FC = Falling
|
||||
/*0022*/ uint8 dmgtype; // FA = Lava, FB = Drowning, FC = Falling, FD = Trap
|
||||
/*0023*/ uint8 unknown2[4];
|
||||
/*0027*/ uint16 constant; //Always FFFF
|
||||
/*0029*/ uint16 unknown29;
|
||||
|
||||
@@ -966,20 +966,6 @@ namespace SoF
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
|
||||
ENCODE(OP_ManaChange)
|
||||
{
|
||||
ENCODE_LENGTH_EXACT(ManaChange_Struct);
|
||||
SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
|
||||
|
||||
OUT(new_mana);
|
||||
OUT(stamina);
|
||||
OUT(spell_id);
|
||||
OUT(keepcasting);
|
||||
eq->slot = -1; // this is spell gem slot. It's -1 in normal operation
|
||||
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
|
||||
ENCODE(OP_MemorizeSpell)
|
||||
{
|
||||
ENCODE_LENGTH_EXACT(MemorizeSpell_Struct);
|
||||
|
||||
@@ -59,7 +59,6 @@ E(OP_ItemVerifyReply)
|
||||
E(OP_LeadershipExpUpdate)
|
||||
E(OP_LogServer)
|
||||
E(OP_LootItem)
|
||||
E(OP_ManaChange)
|
||||
E(OP_MemorizeSpell)
|
||||
E(OP_MoveItem)
|
||||
E(OP_NewSpawn)
|
||||
|
||||
@@ -2509,7 +2509,7 @@ struct EnvDamage2_Struct {
|
||||
/*0004*/ uint16 unknown4;
|
||||
/*0006*/ uint32 damage;
|
||||
/*0010*/ uint8 unknown10[12];
|
||||
/*0022*/ uint8 dmgtype; //FA = Lava; FC = Falling
|
||||
/*0022*/ uint8 dmgtype; // FA = Lava, FB = Drowning, FC = Falling, FD = Trap
|
||||
/*0023*/ uint8 unknown2[4];
|
||||
/*0027*/ uint16 constant; //Always FFFF
|
||||
/*0029*/ uint16 unknown29;
|
||||
|
||||
@@ -932,6 +932,19 @@ namespace Titanium
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
|
||||
ENCODE(OP_ManaChange)
|
||||
{
|
||||
ENCODE_LENGTH_EXACT(ManaChange_Struct);
|
||||
SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
|
||||
|
||||
OUT(new_mana);
|
||||
OUT(stamina);
|
||||
OUT(spell_id);
|
||||
OUT(keepcasting);
|
||||
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
|
||||
ENCODE(OP_MemorizeSpell)
|
||||
{
|
||||
ENCODE_LENGTH_EXACT(MemorizeSpell_Struct);
|
||||
|
||||
@@ -55,6 +55,7 @@ E(OP_ItemPacket)
|
||||
E(OP_LeadershipExpUpdate)
|
||||
E(OP_LFGuild)
|
||||
E(OP_LootItem)
|
||||
E(OP_ManaChange)
|
||||
E(OP_MemorizeSpell)
|
||||
E(OP_MoveItem)
|
||||
E(OP_OnLevelMessage)
|
||||
|
||||
@@ -1390,20 +1390,6 @@ namespace UF
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
|
||||
ENCODE(OP_ManaChange)
|
||||
{
|
||||
ENCODE_LENGTH_EXACT(ManaChange_Struct);
|
||||
SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
|
||||
|
||||
OUT(new_mana);
|
||||
OUT(stamina);
|
||||
OUT(spell_id);
|
||||
OUT(keepcasting);
|
||||
eq->slot = -1; // this is spell gem slot. It's -1 in normal operation
|
||||
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
|
||||
ENCODE(OP_MercenaryDataResponse)
|
||||
{
|
||||
//consume the packet
|
||||
|
||||
@@ -68,7 +68,6 @@ E(OP_ItemVerifyReply)
|
||||
E(OP_LeadershipExpUpdate)
|
||||
E(OP_LogServer)
|
||||
E(OP_LootItem)
|
||||
E(OP_ManaChange)
|
||||
E(OP_MercenaryDataResponse)
|
||||
E(OP_MercenaryDataUpdate)
|
||||
E(OP_MoveItem)
|
||||
|
||||
@@ -221,9 +221,6 @@ XS(XS_EQDB_escape_string)
|
||||
XSRETURN(1);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
XS(boot_EQDB); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(boot_EQDB)
|
||||
{
|
||||
|
||||
@@ -260,9 +260,6 @@ XS(XS_EQDBRes_fetch_lengths)
|
||||
XSRETURN(1);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
XS(boot_EQDBRes); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(boot_EQDBRes)
|
||||
{
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseAaAbilityRepository {
|
||||
public:
|
||||
@@ -59,11 +60,36 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"name",
|
||||
"category",
|
||||
"classes",
|
||||
"races",
|
||||
"drakkin_heritage",
|
||||
"deities",
|
||||
"status",
|
||||
"type",
|
||||
"charges",
|
||||
"grant_only",
|
||||
"first_rank_id",
|
||||
"enabled",
|
||||
"reset_on_death",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("aa_ability");
|
||||
@@ -73,7 +99,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseAaRankEffectsRepository {
|
||||
public:
|
||||
@@ -41,11 +42,27 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"rank_id",
|
||||
"slot",
|
||||
"effect_id",
|
||||
"base1",
|
||||
"base2",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("aa_rank_effects");
|
||||
@@ -55,7 +72,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseAaRankPrereqsRepository {
|
||||
public:
|
||||
@@ -37,11 +38,25 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"rank_id",
|
||||
"aa_id",
|
||||
"points",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("aa_rank_prereqs");
|
||||
@@ -51,7 +66,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseAaRanksRepository {
|
||||
public:
|
||||
@@ -57,11 +58,35 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"upper_hotkey_sid",
|
||||
"lower_hotkey_sid",
|
||||
"title_sid",
|
||||
"desc_sid",
|
||||
"cost",
|
||||
"level_req",
|
||||
"spell",
|
||||
"spell_type",
|
||||
"recast_time",
|
||||
"expansion",
|
||||
"prev_id",
|
||||
"next_id",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("aa_ranks");
|
||||
@@ -71,7 +96,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseAccountFlagsRepository {
|
||||
public:
|
||||
@@ -37,11 +38,25 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"p_accid",
|
||||
"p_flag",
|
||||
"p_value",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("account_flags");
|
||||
@@ -51,7 +66,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseAccountIpRepository {
|
||||
public:
|
||||
@@ -39,11 +40,26 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"accid",
|
||||
"ip",
|
||||
"count",
|
||||
"lastused",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("account_ip");
|
||||
@@ -53,7 +69,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
@@ -74,7 +90,7 @@ public:
|
||||
entry.accid = 0;
|
||||
entry.ip = "";
|
||||
entry.count = 1;
|
||||
entry.lastused = "";
|
||||
entry.lastused = std::time(nullptr);
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseAccountRepository {
|
||||
public:
|
||||
@@ -32,11 +33,14 @@ public:
|
||||
std::string minilogin_ip;
|
||||
int hideme;
|
||||
int rulesflag;
|
||||
std::string suspendeduntil;
|
||||
time_t suspendeduntil;
|
||||
int time_creation;
|
||||
int expansion;
|
||||
std::string ban_reason;
|
||||
std::string suspend_reason;
|
||||
std::string crc_eqgame;
|
||||
std::string crc_skillcaps;
|
||||
std::string crc_basedata;
|
||||
};
|
||||
|
||||
static std::string PrimaryKey()
|
||||
@@ -66,6 +70,37 @@ public:
|
||||
"expansion",
|
||||
"ban_reason",
|
||||
"suspend_reason",
|
||||
"crc_eqgame",
|
||||
"crc_skillcaps",
|
||||
"crc_basedata",
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"name",
|
||||
"charname",
|
||||
"sharedplat",
|
||||
"password",
|
||||
"status",
|
||||
"ls_id",
|
||||
"lsaccount_id",
|
||||
"gmspeed",
|
||||
"revoked",
|
||||
"karma",
|
||||
"minilogin_ip",
|
||||
"hideme",
|
||||
"rulesflag",
|
||||
"UNIX_TIMESTAMP(suspendeduntil)",
|
||||
"time_creation",
|
||||
"expansion",
|
||||
"ban_reason",
|
||||
"suspend_reason",
|
||||
"crc_eqgame",
|
||||
"crc_skillcaps",
|
||||
"crc_basedata",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -74,6 +109,11 @@ public:
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("account");
|
||||
@@ -83,7 +123,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
@@ -115,11 +155,14 @@ public:
|
||||
entry.minilogin_ip = "";
|
||||
entry.hideme = 0;
|
||||
entry.rulesflag = 0;
|
||||
entry.suspendeduntil = "0000-00-00 00:00:00";
|
||||
entry.suspendeduntil = 0;
|
||||
entry.time_creation = 0;
|
||||
entry.expansion = 0;
|
||||
entry.ban_reason = "";
|
||||
entry.suspend_reason = "";
|
||||
entry.crc_eqgame = "";
|
||||
entry.crc_skillcaps = "";
|
||||
entry.crc_basedata = "";
|
||||
|
||||
return entry;
|
||||
}
|
||||
@@ -169,11 +212,14 @@ public:
|
||||
entry.minilogin_ip = row[11] ? row[11] : "";
|
||||
entry.hideme = atoi(row[12]);
|
||||
entry.rulesflag = atoi(row[13]);
|
||||
entry.suspendeduntil = row[14] ? row[14] : "";
|
||||
entry.suspendeduntil = strtoll(row[14] ? row[14] : "-1", nullptr, 10);
|
||||
entry.time_creation = atoi(row[15]);
|
||||
entry.expansion = atoi(row[16]);
|
||||
entry.ban_reason = row[17] ? row[17] : "";
|
||||
entry.suspend_reason = row[18] ? row[18] : "";
|
||||
entry.crc_eqgame = row[19] ? row[19] : "";
|
||||
entry.crc_skillcaps = row[20] ? row[20] : "";
|
||||
entry.crc_basedata = row[21] ? row[21] : "";
|
||||
|
||||
return entry;
|
||||
}
|
||||
@@ -220,11 +266,14 @@ public:
|
||||
update_values.push_back(columns[11] + " = '" + EscapeString(account_entry.minilogin_ip) + "'");
|
||||
update_values.push_back(columns[12] + " = " + std::to_string(account_entry.hideme));
|
||||
update_values.push_back(columns[13] + " = " + std::to_string(account_entry.rulesflag));
|
||||
update_values.push_back(columns[14] + " = '" + EscapeString(account_entry.suspendeduntil) + "'");
|
||||
update_values.push_back(columns[14] + " = FROM_UNIXTIME(" + (account_entry.suspendeduntil > 0 ? std::to_string(account_entry.suspendeduntil) : "null") + ")");
|
||||
update_values.push_back(columns[15] + " = " + std::to_string(account_entry.time_creation));
|
||||
update_values.push_back(columns[16] + " = " + std::to_string(account_entry.expansion));
|
||||
update_values.push_back(columns[17] + " = '" + EscapeString(account_entry.ban_reason) + "'");
|
||||
update_values.push_back(columns[18] + " = '" + EscapeString(account_entry.suspend_reason) + "'");
|
||||
update_values.push_back(columns[19] + " = '" + EscapeString(account_entry.crc_eqgame) + "'");
|
||||
update_values.push_back(columns[20] + " = '" + EscapeString(account_entry.crc_skillcaps) + "'");
|
||||
update_values.push_back(columns[21] + " = '" + EscapeString(account_entry.crc_basedata) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -260,11 +309,14 @@ public:
|
||||
insert_values.push_back("'" + EscapeString(account_entry.minilogin_ip) + "'");
|
||||
insert_values.push_back(std::to_string(account_entry.hideme));
|
||||
insert_values.push_back(std::to_string(account_entry.rulesflag));
|
||||
insert_values.push_back("'" + EscapeString(account_entry.suspendeduntil) + "'");
|
||||
insert_values.push_back("FROM_UNIXTIME(" + (account_entry.suspendeduntil > 0 ? std::to_string(account_entry.suspendeduntil) : "null") + ")");
|
||||
insert_values.push_back(std::to_string(account_entry.time_creation));
|
||||
insert_values.push_back(std::to_string(account_entry.expansion));
|
||||
insert_values.push_back("'" + EscapeString(account_entry.ban_reason) + "'");
|
||||
insert_values.push_back("'" + EscapeString(account_entry.suspend_reason) + "'");
|
||||
insert_values.push_back("'" + EscapeString(account_entry.crc_eqgame) + "'");
|
||||
insert_values.push_back("'" + EscapeString(account_entry.crc_skillcaps) + "'");
|
||||
insert_values.push_back("'" + EscapeString(account_entry.crc_basedata) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -308,11 +360,14 @@ public:
|
||||
insert_values.push_back("'" + EscapeString(account_entry.minilogin_ip) + "'");
|
||||
insert_values.push_back(std::to_string(account_entry.hideme));
|
||||
insert_values.push_back(std::to_string(account_entry.rulesflag));
|
||||
insert_values.push_back("'" + EscapeString(account_entry.suspendeduntil) + "'");
|
||||
insert_values.push_back("FROM_UNIXTIME(" + (account_entry.suspendeduntil > 0 ? std::to_string(account_entry.suspendeduntil) : "null") + ")");
|
||||
insert_values.push_back(std::to_string(account_entry.time_creation));
|
||||
insert_values.push_back(std::to_string(account_entry.expansion));
|
||||
insert_values.push_back("'" + EscapeString(account_entry.ban_reason) + "'");
|
||||
insert_values.push_back("'" + EscapeString(account_entry.suspend_reason) + "'");
|
||||
insert_values.push_back("'" + EscapeString(account_entry.crc_eqgame) + "'");
|
||||
insert_values.push_back("'" + EscapeString(account_entry.crc_skillcaps) + "'");
|
||||
insert_values.push_back("'" + EscapeString(account_entry.crc_basedata) + "'");
|
||||
|
||||
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
|
||||
}
|
||||
@@ -360,11 +415,14 @@ public:
|
||||
entry.minilogin_ip = row[11] ? row[11] : "";
|
||||
entry.hideme = atoi(row[12]);
|
||||
entry.rulesflag = atoi(row[13]);
|
||||
entry.suspendeduntil = row[14] ? row[14] : "";
|
||||
entry.suspendeduntil = strtoll(row[14] ? row[14] : "-1", nullptr, 10);
|
||||
entry.time_creation = atoi(row[15]);
|
||||
entry.expansion = atoi(row[16]);
|
||||
entry.ban_reason = row[17] ? row[17] : "";
|
||||
entry.suspend_reason = row[18] ? row[18] : "";
|
||||
entry.crc_eqgame = row[19] ? row[19] : "";
|
||||
entry.crc_skillcaps = row[20] ? row[20] : "";
|
||||
entry.crc_basedata = row[21] ? row[21] : "";
|
||||
|
||||
all_entries.push_back(entry);
|
||||
}
|
||||
@@ -403,11 +461,14 @@ public:
|
||||
entry.minilogin_ip = row[11] ? row[11] : "";
|
||||
entry.hideme = atoi(row[12]);
|
||||
entry.rulesflag = atoi(row[13]);
|
||||
entry.suspendeduntil = row[14] ? row[14] : "";
|
||||
entry.suspendeduntil = strtoll(row[14] ? row[14] : "-1", nullptr, 10);
|
||||
entry.time_creation = atoi(row[15]);
|
||||
entry.expansion = atoi(row[16]);
|
||||
entry.ban_reason = row[17] ? row[17] : "";
|
||||
entry.suspend_reason = row[18] ? row[18] : "";
|
||||
entry.crc_eqgame = row[19] ? row[19] : "";
|
||||
entry.crc_skillcaps = row[20] ? row[20] : "";
|
||||
entry.crc_basedata = row[21] ? row[21] : "";
|
||||
|
||||
all_entries.push_back(entry);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseAccountRewardsRepository {
|
||||
public:
|
||||
@@ -37,11 +38,25 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"account_id",
|
||||
"reward_id",
|
||||
"amount",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("account_rewards");
|
||||
@@ -51,7 +66,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseAdventureDetailsRepository {
|
||||
public:
|
||||
@@ -49,11 +50,31 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"adventure_id",
|
||||
"instance_id",
|
||||
"count",
|
||||
"assassinate_count",
|
||||
"status",
|
||||
"time_created",
|
||||
"time_zoned",
|
||||
"time_completed",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("adventure_details");
|
||||
@@ -63,7 +84,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseAdventureMembersRepository {
|
||||
public:
|
||||
@@ -35,11 +36,24 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"charid",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("adventure_members");
|
||||
@@ -49,7 +63,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseAdventureStatsRepository {
|
||||
public:
|
||||
@@ -53,11 +54,33 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"player_id",
|
||||
"guk_wins",
|
||||
"mir_wins",
|
||||
"mmc_wins",
|
||||
"ruj_wins",
|
||||
"tak_wins",
|
||||
"guk_losses",
|
||||
"mir_losses",
|
||||
"mmc_losses",
|
||||
"ruj_losses",
|
||||
"tak_losses",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("adventure_stats");
|
||||
@@ -67,7 +90,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseAdventureTemplateEntryFlavorRepository {
|
||||
public:
|
||||
@@ -35,11 +36,24 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"text",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("adventure_template_entry_flavor");
|
||||
@@ -49,7 +63,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseAdventureTemplateEntryRepository {
|
||||
public:
|
||||
@@ -35,11 +36,24 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"template_id",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("adventure_template_entry");
|
||||
@@ -49,7 +63,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseAdventureTemplateRepository {
|
||||
public:
|
||||
@@ -97,11 +98,55 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"zone",
|
||||
"zone_version",
|
||||
"is_hard",
|
||||
"is_raid",
|
||||
"min_level",
|
||||
"max_level",
|
||||
"type",
|
||||
"type_data",
|
||||
"type_count",
|
||||
"assa_x",
|
||||
"assa_y",
|
||||
"assa_z",
|
||||
"assa_h",
|
||||
"text",
|
||||
"duration",
|
||||
"zone_in_time",
|
||||
"win_points",
|
||||
"lose_points",
|
||||
"theme",
|
||||
"zone_in_zone_id",
|
||||
"zone_in_x",
|
||||
"zone_in_y",
|
||||
"zone_in_object_id",
|
||||
"dest_x",
|
||||
"dest_y",
|
||||
"dest_z",
|
||||
"dest_h",
|
||||
"graveyard_zone_id",
|
||||
"graveyard_x",
|
||||
"graveyard_y",
|
||||
"graveyard_z",
|
||||
"graveyard_radius",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("adventure_template");
|
||||
@@ -111,7 +156,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
@@ -148,7 +193,7 @@ public:
|
||||
entry.zone_in_time = 1800;
|
||||
entry.win_points = 0;
|
||||
entry.lose_points = 0;
|
||||
entry.theme = LDoNThemes::GUK;
|
||||
entry.theme = 1;
|
||||
entry.zone_in_zone_id = 0;
|
||||
entry.zone_in_x = 0;
|
||||
entry.zone_in_y = 0;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseAlternateCurrencyRepository {
|
||||
public:
|
||||
@@ -35,11 +36,24 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"item_id",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("alternate_currency");
|
||||
@@ -49,7 +63,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseAurasRepository {
|
||||
public:
|
||||
@@ -53,11 +54,33 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"type",
|
||||
"npc_type",
|
||||
"name",
|
||||
"spell_id",
|
||||
"distance",
|
||||
"aura_type",
|
||||
"spawn_type",
|
||||
"movement",
|
||||
"duration",
|
||||
"icon",
|
||||
"cast_time",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("auras");
|
||||
@@ -67,7 +90,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseBaseDataRepository {
|
||||
public:
|
||||
@@ -51,11 +52,32 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"level",
|
||||
"`class`",
|
||||
"hp",
|
||||
"mana",
|
||||
"end",
|
||||
"unk1",
|
||||
"unk2",
|
||||
"hp_fac",
|
||||
"mana_fac",
|
||||
"end_fac",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("base_data");
|
||||
@@ -65,7 +87,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseBlockedSpellsRepository {
|
||||
public:
|
||||
@@ -55,11 +56,34 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"spellid",
|
||||
"type",
|
||||
"zoneid",
|
||||
"x",
|
||||
"y",
|
||||
"z",
|
||||
"x_diff",
|
||||
"y_diff",
|
||||
"z_diff",
|
||||
"message",
|
||||
"description",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("blocked_spells");
|
||||
@@ -69,7 +93,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,326 @@
|
||||
/**
|
||||
* DO NOT MODIFY THIS FILE
|
||||
*
|
||||
* This repository was automatically generated and is NOT to be modified directly.
|
||||
* Any repository modifications are meant to be made to the repository extending the base.
|
||||
* Any modifications to base repositories are to be made by the generator only
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_BOOKS_REPOSITORY_H
|
||||
#define EQEMU_BASE_BOOKS_REPOSITORY_H
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseBooksRepository {
|
||||
public:
|
||||
struct Books {
|
||||
int id;
|
||||
std::string name;
|
||||
std::string txtfile;
|
||||
int language;
|
||||
};
|
||||
|
||||
static std::string PrimaryKey()
|
||||
{
|
||||
return std::string("id");
|
||||
}
|
||||
|
||||
static std::vector<std::string> Columns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"name",
|
||||
"txtfile",
|
||||
"language",
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"name",
|
||||
"txtfile",
|
||||
"language",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("books");
|
||||
}
|
||||
|
||||
static std::string BaseSelect()
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
static std::string BaseInsert()
|
||||
{
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static Books NewEntity()
|
||||
{
|
||||
Books entry{};
|
||||
|
||||
entry.id = 0;
|
||||
entry.name = "";
|
||||
entry.txtfile = "";
|
||||
entry.language = 0;
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
static Books GetBooksEntry(
|
||||
const std::vector<Books> &bookss,
|
||||
int books_id
|
||||
)
|
||||
{
|
||||
for (auto &books : bookss) {
|
||||
if (books.id == books_id) {
|
||||
return books;
|
||||
}
|
||||
}
|
||||
|
||||
return NewEntity();
|
||||
}
|
||||
|
||||
static Books FindOne(
|
||||
Database& db,
|
||||
int books_id
|
||||
)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
books_id
|
||||
)
|
||||
);
|
||||
|
||||
auto row = results.begin();
|
||||
if (results.RowCount() == 1) {
|
||||
Books entry{};
|
||||
|
||||
entry.id = atoi(row[0]);
|
||||
entry.name = row[1] ? row[1] : "";
|
||||
entry.txtfile = row[2] ? row[2] : "";
|
||||
entry.language = atoi(row[3]);
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
return NewEntity();
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int books_id
|
||||
)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
PrimaryKey(),
|
||||
books_id
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
Books books_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> update_values;
|
||||
|
||||
auto columns = Columns();
|
||||
|
||||
update_values.push_back(columns[1] + " = '" + EscapeString(books_entry.name) + "'");
|
||||
update_values.push_back(columns[2] + " = '" + EscapeString(books_entry.txtfile) + "'");
|
||||
update_values.push_back(columns[3] + " = " + std::to_string(books_entry.language));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
implode(", ", update_values),
|
||||
PrimaryKey(),
|
||||
books_entry.id
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static Books InsertOne(
|
||||
Database& db,
|
||||
Books books_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(books_entry.id));
|
||||
insert_values.push_back("'" + EscapeString(books_entry.name) + "'");
|
||||
insert_values.push_back("'" + EscapeString(books_entry.txtfile) + "'");
|
||||
insert_values.push_back(std::to_string(books_entry.language));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
implode(",", insert_values)
|
||||
)
|
||||
);
|
||||
|
||||
if (results.Success()) {
|
||||
books_entry.id = results.LastInsertedID();
|
||||
return books_entry;
|
||||
}
|
||||
|
||||
books_entry = NewEntity();
|
||||
|
||||
return books_entry;
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<Books> books_entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &books_entry: books_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(books_entry.id));
|
||||
insert_values.push_back("'" + EscapeString(books_entry.name) + "'");
|
||||
insert_values.push_back("'" + EscapeString(books_entry.txtfile) + "'");
|
||||
insert_values.push_back(std::to_string(books_entry.language));
|
||||
|
||||
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<Books> All(Database& db)
|
||||
{
|
||||
std::vector<Books> all_entries;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
)
|
||||
);
|
||||
|
||||
all_entries.reserve(results.RowCount());
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
Books entry{};
|
||||
|
||||
entry.id = atoi(row[0]);
|
||||
entry.name = row[1] ? row[1] : "";
|
||||
entry.txtfile = row[2] ? row[2] : "";
|
||||
entry.language = atoi(row[3]);
|
||||
|
||||
all_entries.push_back(entry);
|
||||
}
|
||||
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<Books> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<Books> all_entries;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
where_filter
|
||||
)
|
||||
);
|
||||
|
||||
all_entries.reserve(results.RowCount());
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
Books entry{};
|
||||
|
||||
entry.id = atoi(row[0]);
|
||||
entry.name = row[1] ? row[1] : "";
|
||||
entry.txtfile = row[2] ? row[2] : "";
|
||||
entry.language = atoi(row[3]);
|
||||
|
||||
all_entries.push_back(entry);
|
||||
}
|
||||
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
where_filter
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_BOOKS_REPOSITORY_H
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseBugReportsRepository {
|
||||
public:
|
||||
@@ -45,9 +46,9 @@ public:
|
||||
int _unknown_value;
|
||||
std::string bug_report;
|
||||
std::string system_info;
|
||||
std::string report_datetime;
|
||||
time_t report_datetime;
|
||||
int bug_status;
|
||||
std::string last_review;
|
||||
time_t last_review;
|
||||
std::string last_reviewer;
|
||||
std::string reviewer_notes;
|
||||
};
|
||||
@@ -95,11 +96,54 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"zone",
|
||||
"client_version_id",
|
||||
"client_version_name",
|
||||
"account_id",
|
||||
"character_id",
|
||||
"character_name",
|
||||
"reporter_spoof",
|
||||
"category_id",
|
||||
"category_name",
|
||||
"reporter_name",
|
||||
"ui_path",
|
||||
"pos_x",
|
||||
"pos_y",
|
||||
"pos_z",
|
||||
"heading",
|
||||
"time_played",
|
||||
"target_id",
|
||||
"target_name",
|
||||
"optional_info_mask",
|
||||
"_can_duplicate",
|
||||
"_crash_bug",
|
||||
"_target_info",
|
||||
"_character_flags",
|
||||
"_unknown_value",
|
||||
"bug_report",
|
||||
"system_info",
|
||||
"UNIX_TIMESTAMP(report_datetime)",
|
||||
"bug_status",
|
||||
"UNIX_TIMESTAMP(last_review)",
|
||||
"last_reviewer",
|
||||
"reviewer_notes",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("bug_reports");
|
||||
@@ -109,7 +153,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
@@ -154,9 +198,9 @@ public:
|
||||
entry._unknown_value = 0;
|
||||
entry.bug_report = "";
|
||||
entry.system_info = "";
|
||||
entry.report_datetime = "";
|
||||
entry.report_datetime = std::time(nullptr);
|
||||
entry.bug_status = 0;
|
||||
entry.last_review = "";
|
||||
entry.last_review = std::time(nullptr);
|
||||
entry.last_reviewer = "None";
|
||||
entry.reviewer_notes = "";
|
||||
|
||||
@@ -221,9 +265,9 @@ public:
|
||||
entry._unknown_value = atoi(row[24]);
|
||||
entry.bug_report = row[25] ? row[25] : "";
|
||||
entry.system_info = row[26] ? row[26] : "";
|
||||
entry.report_datetime = row[27] ? row[27] : "";
|
||||
entry.report_datetime = strtoll(row[27] ? row[27] : "-1", nullptr, 10);
|
||||
entry.bug_status = atoi(row[28]);
|
||||
entry.last_review = row[29] ? row[29] : "";
|
||||
entry.last_review = strtoll(row[29] ? row[29] : "-1", nullptr, 10);
|
||||
entry.last_reviewer = row[30] ? row[30] : "";
|
||||
entry.reviewer_notes = row[31] ? row[31] : "";
|
||||
|
||||
@@ -285,9 +329,9 @@ public:
|
||||
update_values.push_back(columns[24] + " = " + std::to_string(bug_reports_entry._unknown_value));
|
||||
update_values.push_back(columns[25] + " = '" + EscapeString(bug_reports_entry.bug_report) + "'");
|
||||
update_values.push_back(columns[26] + " = '" + EscapeString(bug_reports_entry.system_info) + "'");
|
||||
update_values.push_back(columns[27] + " = '" + EscapeString(bug_reports_entry.report_datetime) + "'");
|
||||
update_values.push_back(columns[27] + " = FROM_UNIXTIME(" + (bug_reports_entry.report_datetime > 0 ? std::to_string(bug_reports_entry.report_datetime) : "null") + ")");
|
||||
update_values.push_back(columns[28] + " = " + std::to_string(bug_reports_entry.bug_status));
|
||||
update_values.push_back(columns[29] + " = '" + EscapeString(bug_reports_entry.last_review) + "'");
|
||||
update_values.push_back(columns[29] + " = FROM_UNIXTIME(" + (bug_reports_entry.last_review > 0 ? std::to_string(bug_reports_entry.last_review) : "null") + ")");
|
||||
update_values.push_back(columns[30] + " = '" + EscapeString(bug_reports_entry.last_reviewer) + "'");
|
||||
update_values.push_back(columns[31] + " = '" + EscapeString(bug_reports_entry.reviewer_notes) + "'");
|
||||
|
||||
@@ -338,9 +382,9 @@ public:
|
||||
insert_values.push_back(std::to_string(bug_reports_entry._unknown_value));
|
||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.bug_report) + "'");
|
||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.system_info) + "'");
|
||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.report_datetime) + "'");
|
||||
insert_values.push_back("FROM_UNIXTIME(" + (bug_reports_entry.report_datetime > 0 ? std::to_string(bug_reports_entry.report_datetime) : "null") + ")");
|
||||
insert_values.push_back(std::to_string(bug_reports_entry.bug_status));
|
||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.last_review) + "'");
|
||||
insert_values.push_back("FROM_UNIXTIME(" + (bug_reports_entry.last_review > 0 ? std::to_string(bug_reports_entry.last_review) : "null") + ")");
|
||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.last_reviewer) + "'");
|
||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.reviewer_notes) + "'");
|
||||
|
||||
@@ -399,9 +443,9 @@ public:
|
||||
insert_values.push_back(std::to_string(bug_reports_entry._unknown_value));
|
||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.bug_report) + "'");
|
||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.system_info) + "'");
|
||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.report_datetime) + "'");
|
||||
insert_values.push_back("FROM_UNIXTIME(" + (bug_reports_entry.report_datetime > 0 ? std::to_string(bug_reports_entry.report_datetime) : "null") + ")");
|
||||
insert_values.push_back(std::to_string(bug_reports_entry.bug_status));
|
||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.last_review) + "'");
|
||||
insert_values.push_back("FROM_UNIXTIME(" + (bug_reports_entry.last_review > 0 ? std::to_string(bug_reports_entry.last_review) : "null") + ")");
|
||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.last_reviewer) + "'");
|
||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.reviewer_notes) + "'");
|
||||
|
||||
@@ -464,9 +508,9 @@ public:
|
||||
entry._unknown_value = atoi(row[24]);
|
||||
entry.bug_report = row[25] ? row[25] : "";
|
||||
entry.system_info = row[26] ? row[26] : "";
|
||||
entry.report_datetime = row[27] ? row[27] : "";
|
||||
entry.report_datetime = strtoll(row[27] ? row[27] : "-1", nullptr, 10);
|
||||
entry.bug_status = atoi(row[28]);
|
||||
entry.last_review = row[29] ? row[29] : "";
|
||||
entry.last_review = strtoll(row[29] ? row[29] : "-1", nullptr, 10);
|
||||
entry.last_reviewer = row[30] ? row[30] : "";
|
||||
entry.reviewer_notes = row[31] ? row[31] : "";
|
||||
|
||||
@@ -520,9 +564,9 @@ public:
|
||||
entry._unknown_value = atoi(row[24]);
|
||||
entry.bug_report = row[25] ? row[25] : "";
|
||||
entry.system_info = row[26] ? row[26] : "";
|
||||
entry.report_datetime = row[27] ? row[27] : "";
|
||||
entry.report_datetime = strtoll(row[27] ? row[27] : "-1", nullptr, 10);
|
||||
entry.bug_status = atoi(row[28]);
|
||||
entry.last_review = row[29] ? row[29] : "";
|
||||
entry.last_review = strtoll(row[29] ? row[29] : "-1", nullptr, 10);
|
||||
entry.last_reviewer = row[30] ? row[30] : "";
|
||||
entry.reviewer_notes = row[31] ? row[31] : "";
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseBugsRepository {
|
||||
public:
|
||||
@@ -57,11 +58,35 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"zone",
|
||||
"name",
|
||||
"ui",
|
||||
"x",
|
||||
"y",
|
||||
"z",
|
||||
"type",
|
||||
"flag",
|
||||
"target",
|
||||
"bug",
|
||||
"date",
|
||||
"status",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("bugs");
|
||||
@@ -71,7 +96,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseBuyerRepository {
|
||||
public:
|
||||
@@ -43,11 +44,28 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"charid",
|
||||
"buyslot",
|
||||
"itemid",
|
||||
"itemname",
|
||||
"quantity",
|
||||
"price",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("buyer");
|
||||
@@ -57,7 +75,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseCharCreateCombinationsRepository {
|
||||
public:
|
||||
@@ -43,11 +44,28 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"allocation_id",
|
||||
"race",
|
||||
"`class`",
|
||||
"deity",
|
||||
"start_zone",
|
||||
"expansions_req",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("char_create_combinations");
|
||||
@@ -57,7 +75,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseCharCreatePointAllocationsRepository {
|
||||
public:
|
||||
@@ -61,11 +62,37 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"base_str",
|
||||
"base_sta",
|
||||
"base_dex",
|
||||
"base_agi",
|
||||
"base_int",
|
||||
"base_wis",
|
||||
"base_cha",
|
||||
"alloc_str",
|
||||
"alloc_sta",
|
||||
"alloc_dex",
|
||||
"alloc_agi",
|
||||
"alloc_int",
|
||||
"alloc_wis",
|
||||
"alloc_cha",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("char_create_point_allocations");
|
||||
@@ -75,7 +102,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseCharRecipeListRepository {
|
||||
public:
|
||||
@@ -37,11 +38,25 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"char_id",
|
||||
"recipe_id",
|
||||
"madecount",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("char_recipe_list");
|
||||
@@ -51,7 +66,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseCharacterActivitiesRepository {
|
||||
public:
|
||||
@@ -41,11 +42,27 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"charid",
|
||||
"taskid",
|
||||
"activityid",
|
||||
"donecount",
|
||||
"completed",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("character_activities");
|
||||
@@ -55,7 +72,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseCharacterAltCurrencyRepository {
|
||||
public:
|
||||
@@ -37,11 +38,25 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"char_id",
|
||||
"currency_id",
|
||||
"amount",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("character_alt_currency");
|
||||
@@ -51,7 +66,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseCharacterAlternateAbilitiesRepository {
|
||||
public:
|
||||
@@ -39,11 +40,26 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"aa_id",
|
||||
"aa_value",
|
||||
"charges",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("character_alternate_abilities");
|
||||
@@ -53,7 +69,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseCharacterAurasRepository {
|
||||
public:
|
||||
@@ -37,11 +38,25 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"slot",
|
||||
"spell_id",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("character_auras");
|
||||
@@ -51,7 +66,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseCharacterBandolierRepository {
|
||||
public:
|
||||
@@ -43,11 +44,28 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"bandolier_id",
|
||||
"bandolier_slot",
|
||||
"item_id",
|
||||
"icon",
|
||||
"bandolier_name",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("character_bandolier");
|
||||
@@ -57,7 +75,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseCharacterBindRepository {
|
||||
public:
|
||||
@@ -47,11 +48,30 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"slot",
|
||||
"zone_id",
|
||||
"instance_id",
|
||||
"x",
|
||||
"y",
|
||||
"z",
|
||||
"heading",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("character_bind");
|
||||
@@ -61,7 +81,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseCharacterBuffsRepository {
|
||||
public:
|
||||
@@ -65,11 +66,39 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"character_id",
|
||||
"slot_id",
|
||||
"spell_id",
|
||||
"caster_level",
|
||||
"caster_name",
|
||||
"ticsremaining",
|
||||
"counters",
|
||||
"numhits",
|
||||
"melee_rune",
|
||||
"magic_rune",
|
||||
"persistent",
|
||||
"dot_rune",
|
||||
"caston_x",
|
||||
"caston_y",
|
||||
"caston_z",
|
||||
"ExtraDIChance",
|
||||
"instrument_mod",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("character_buffs");
|
||||
@@ -79,7 +108,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseCharacterCorpseItemsRepository {
|
||||
public:
|
||||
@@ -53,11 +54,33 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"corpse_id",
|
||||
"equip_slot",
|
||||
"item_id",
|
||||
"charges",
|
||||
"aug_1",
|
||||
"aug_2",
|
||||
"aug_3",
|
||||
"aug_4",
|
||||
"aug_5",
|
||||
"aug_6",
|
||||
"attuned",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("character_corpse_items");
|
||||
@@ -67,7 +90,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseCharacterCorpsesRepository {
|
||||
public:
|
||||
@@ -27,7 +28,7 @@ public:
|
||||
float y;
|
||||
float z;
|
||||
float heading;
|
||||
std::string time_of_death;
|
||||
time_t time_of_death;
|
||||
int guild_consent_id;
|
||||
int is_rezzed;
|
||||
int is_buried;
|
||||
@@ -125,11 +126,69 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"charid",
|
||||
"charname",
|
||||
"zone_id",
|
||||
"instance_id",
|
||||
"x",
|
||||
"y",
|
||||
"z",
|
||||
"heading",
|
||||
"UNIX_TIMESTAMP(time_of_death)",
|
||||
"guild_consent_id",
|
||||
"is_rezzed",
|
||||
"is_buried",
|
||||
"was_at_graveyard",
|
||||
"is_locked",
|
||||
"exp",
|
||||
"size",
|
||||
"level",
|
||||
"race",
|
||||
"gender",
|
||||
"`class`",
|
||||
"deity",
|
||||
"texture",
|
||||
"helm_texture",
|
||||
"copper",
|
||||
"silver",
|
||||
"gold",
|
||||
"platinum",
|
||||
"hair_color",
|
||||
"beard_color",
|
||||
"eye_color_1",
|
||||
"eye_color_2",
|
||||
"hair_style",
|
||||
"face",
|
||||
"beard",
|
||||
"drakkin_heritage",
|
||||
"drakkin_tattoo",
|
||||
"drakkin_details",
|
||||
"wc_1",
|
||||
"wc_2",
|
||||
"wc_3",
|
||||
"wc_4",
|
||||
"wc_5",
|
||||
"wc_6",
|
||||
"wc_7",
|
||||
"wc_8",
|
||||
"wc_9",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("character_corpses");
|
||||
@@ -139,7 +198,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
@@ -166,7 +225,7 @@ public:
|
||||
entry.y = 0;
|
||||
entry.z = 0;
|
||||
entry.heading = 0;
|
||||
entry.time_of_death = "0000-00-00 00:00:00";
|
||||
entry.time_of_death = 0;
|
||||
entry.guild_consent_id = 0;
|
||||
entry.is_rezzed = 0;
|
||||
entry.is_buried = 0;
|
||||
@@ -248,7 +307,7 @@ public:
|
||||
entry.y = static_cast<float>(atof(row[6]));
|
||||
entry.z = static_cast<float>(atof(row[7]));
|
||||
entry.heading = static_cast<float>(atof(row[8]));
|
||||
entry.time_of_death = row[9] ? row[9] : "";
|
||||
entry.time_of_death = strtoll(row[9] ? row[9] : "-1", nullptr, 10);
|
||||
entry.guild_consent_id = atoi(row[10]);
|
||||
entry.is_rezzed = atoi(row[11]);
|
||||
entry.is_buried = atoi(row[12]);
|
||||
@@ -327,7 +386,7 @@ public:
|
||||
update_values.push_back(columns[6] + " = " + std::to_string(character_corpses_entry.y));
|
||||
update_values.push_back(columns[7] + " = " + std::to_string(character_corpses_entry.z));
|
||||
update_values.push_back(columns[8] + " = " + std::to_string(character_corpses_entry.heading));
|
||||
update_values.push_back(columns[9] + " = '" + EscapeString(character_corpses_entry.time_of_death) + "'");
|
||||
update_values.push_back(columns[9] + " = FROM_UNIXTIME(" + (character_corpses_entry.time_of_death > 0 ? std::to_string(character_corpses_entry.time_of_death) : "null") + ")");
|
||||
update_values.push_back(columns[10] + " = " + std::to_string(character_corpses_entry.guild_consent_id));
|
||||
update_values.push_back(columns[11] + " = " + std::to_string(character_corpses_entry.is_rezzed));
|
||||
update_values.push_back(columns[12] + " = " + std::to_string(character_corpses_entry.is_buried));
|
||||
@@ -395,7 +454,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_corpses_entry.y));
|
||||
insert_values.push_back(std::to_string(character_corpses_entry.z));
|
||||
insert_values.push_back(std::to_string(character_corpses_entry.heading));
|
||||
insert_values.push_back("'" + EscapeString(character_corpses_entry.time_of_death) + "'");
|
||||
insert_values.push_back("FROM_UNIXTIME(" + (character_corpses_entry.time_of_death > 0 ? std::to_string(character_corpses_entry.time_of_death) : "null") + ")");
|
||||
insert_values.push_back(std::to_string(character_corpses_entry.guild_consent_id));
|
||||
insert_values.push_back(std::to_string(character_corpses_entry.is_rezzed));
|
||||
insert_values.push_back(std::to_string(character_corpses_entry.is_buried));
|
||||
@@ -471,7 +530,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_corpses_entry.y));
|
||||
insert_values.push_back(std::to_string(character_corpses_entry.z));
|
||||
insert_values.push_back(std::to_string(character_corpses_entry.heading));
|
||||
insert_values.push_back("'" + EscapeString(character_corpses_entry.time_of_death) + "'");
|
||||
insert_values.push_back("FROM_UNIXTIME(" + (character_corpses_entry.time_of_death > 0 ? std::to_string(character_corpses_entry.time_of_death) : "null") + ")");
|
||||
insert_values.push_back(std::to_string(character_corpses_entry.guild_consent_id));
|
||||
insert_values.push_back(std::to_string(character_corpses_entry.is_rezzed));
|
||||
insert_values.push_back(std::to_string(character_corpses_entry.is_buried));
|
||||
@@ -551,7 +610,7 @@ public:
|
||||
entry.y = static_cast<float>(atof(row[6]));
|
||||
entry.z = static_cast<float>(atof(row[7]));
|
||||
entry.heading = static_cast<float>(atof(row[8]));
|
||||
entry.time_of_death = row[9] ? row[9] : "";
|
||||
entry.time_of_death = strtoll(row[9] ? row[9] : "-1", nullptr, 10);
|
||||
entry.guild_consent_id = atoi(row[10]);
|
||||
entry.is_rezzed = atoi(row[11]);
|
||||
entry.is_buried = atoi(row[12]);
|
||||
@@ -622,7 +681,7 @@ public:
|
||||
entry.y = static_cast<float>(atof(row[6]));
|
||||
entry.z = static_cast<float>(atof(row[7]));
|
||||
entry.heading = static_cast<float>(atof(row[8]));
|
||||
entry.time_of_death = row[9] ? row[9] : "";
|
||||
entry.time_of_death = strtoll(row[9] ? row[9] : "-1", nullptr, 10);
|
||||
entry.guild_consent_id = atoi(row[10]);
|
||||
entry.is_rezzed = atoi(row[11]);
|
||||
entry.is_buried = atoi(row[12]);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseCharacterCurrencyRepository {
|
||||
public:
|
||||
@@ -65,11 +66,39 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"platinum",
|
||||
"gold",
|
||||
"silver",
|
||||
"copper",
|
||||
"platinum_bank",
|
||||
"gold_bank",
|
||||
"silver_bank",
|
||||
"copper_bank",
|
||||
"platinum_cursor",
|
||||
"gold_cursor",
|
||||
"silver_cursor",
|
||||
"copper_cursor",
|
||||
"radiant_crystals",
|
||||
"career_radiant_crystals",
|
||||
"ebon_crystals",
|
||||
"career_ebon_crystals",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("character_currency");
|
||||
@@ -79,7 +108,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseCharacterDataRepository {
|
||||
public:
|
||||
@@ -119,7 +120,7 @@ public:
|
||||
int aa_points_spent_old;
|
||||
int aa_points_old;
|
||||
int e_last_invsnapshot;
|
||||
std::string deleted_at;
|
||||
time_t deleted_at;
|
||||
};
|
||||
|
||||
static std::string PrimaryKey()
|
||||
@@ -235,11 +236,124 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"account_id",
|
||||
"name",
|
||||
"last_name",
|
||||
"title",
|
||||
"suffix",
|
||||
"zone_id",
|
||||
"zone_instance",
|
||||
"y",
|
||||
"x",
|
||||
"z",
|
||||
"heading",
|
||||
"gender",
|
||||
"race",
|
||||
"`class`",
|
||||
"level",
|
||||
"deity",
|
||||
"birthday",
|
||||
"last_login",
|
||||
"time_played",
|
||||
"level2",
|
||||
"anon",
|
||||
"gm",
|
||||
"face",
|
||||
"hair_color",
|
||||
"hair_style",
|
||||
"beard",
|
||||
"beard_color",
|
||||
"eye_color_1",
|
||||
"eye_color_2",
|
||||
"drakkin_heritage",
|
||||
"drakkin_tattoo",
|
||||
"drakkin_details",
|
||||
"ability_time_seconds",
|
||||
"ability_number",
|
||||
"ability_time_minutes",
|
||||
"ability_time_hours",
|
||||
"exp",
|
||||
"aa_points_spent",
|
||||
"aa_exp",
|
||||
"aa_points",
|
||||
"group_leadership_exp",
|
||||
"raid_leadership_exp",
|
||||
"group_leadership_points",
|
||||
"raid_leadership_points",
|
||||
"points",
|
||||
"cur_hp",
|
||||
"mana",
|
||||
"endurance",
|
||||
"intoxication",
|
||||
"str",
|
||||
"sta",
|
||||
"cha",
|
||||
"dex",
|
||||
"`int`",
|
||||
"agi",
|
||||
"wis",
|
||||
"zone_change_count",
|
||||
"toxicity",
|
||||
"hunger_level",
|
||||
"thirst_level",
|
||||
"ability_up",
|
||||
"ldon_points_guk",
|
||||
"ldon_points_mir",
|
||||
"ldon_points_mmc",
|
||||
"ldon_points_ruj",
|
||||
"ldon_points_tak",
|
||||
"ldon_points_available",
|
||||
"tribute_time_remaining",
|
||||
"career_tribute_points",
|
||||
"tribute_points",
|
||||
"tribute_active",
|
||||
"pvp_status",
|
||||
"pvp_kills",
|
||||
"pvp_deaths",
|
||||
"pvp_current_points",
|
||||
"pvp_career_points",
|
||||
"pvp_best_kill_streak",
|
||||
"pvp_worst_death_streak",
|
||||
"pvp_current_kill_streak",
|
||||
"pvp2",
|
||||
"pvp_type",
|
||||
"show_helm",
|
||||
"group_auto_consent",
|
||||
"raid_auto_consent",
|
||||
"guild_auto_consent",
|
||||
"leadership_exp_on",
|
||||
"RestTimer",
|
||||
"air_remaining",
|
||||
"autosplit_enabled",
|
||||
"lfp",
|
||||
"lfg",
|
||||
"mailkey",
|
||||
"xtargets",
|
||||
"firstlogon",
|
||||
"e_aa_effects",
|
||||
"e_percent_to_aa",
|
||||
"e_expended_aa_spent",
|
||||
"aa_points_spent_old",
|
||||
"aa_points_old",
|
||||
"e_last_invsnapshot",
|
||||
"UNIX_TIMESTAMP(deleted_at)",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("character_data");
|
||||
@@ -249,7 +363,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
@@ -368,7 +482,7 @@ public:
|
||||
entry.aa_points_spent_old = 0;
|
||||
entry.aa_points_old = 0;
|
||||
entry.e_last_invsnapshot = 0;
|
||||
entry.deleted_at = "";
|
||||
entry.deleted_at = 0;
|
||||
|
||||
return entry;
|
||||
}
|
||||
@@ -505,7 +619,7 @@ public:
|
||||
entry.aa_points_spent_old = atoi(row[98]);
|
||||
entry.aa_points_old = atoi(row[99]);
|
||||
entry.e_last_invsnapshot = atoi(row[100]);
|
||||
entry.deleted_at = row[101] ? row[101] : "";
|
||||
entry.deleted_at = strtoll(row[101] ? row[101] : "-1", nullptr, 10);
|
||||
|
||||
return entry;
|
||||
}
|
||||
@@ -639,7 +753,7 @@ public:
|
||||
update_values.push_back(columns[98] + " = " + std::to_string(character_data_entry.aa_points_spent_old));
|
||||
update_values.push_back(columns[99] + " = " + std::to_string(character_data_entry.aa_points_old));
|
||||
update_values.push_back(columns[100] + " = " + std::to_string(character_data_entry.e_last_invsnapshot));
|
||||
update_values.push_back(columns[101] + " = '" + EscapeString(character_data_entry.deleted_at) + "'");
|
||||
update_values.push_back(columns[101] + " = FROM_UNIXTIME(" + (character_data_entry.deleted_at > 0 ? std::to_string(character_data_entry.deleted_at) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -762,7 +876,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_data_entry.aa_points_spent_old));
|
||||
insert_values.push_back(std::to_string(character_data_entry.aa_points_old));
|
||||
insert_values.push_back(std::to_string(character_data_entry.e_last_invsnapshot));
|
||||
insert_values.push_back("'" + EscapeString(character_data_entry.deleted_at) + "'");
|
||||
insert_values.push_back("FROM_UNIXTIME(" + (character_data_entry.deleted_at > 0 ? std::to_string(character_data_entry.deleted_at) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -893,7 +1007,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_data_entry.aa_points_spent_old));
|
||||
insert_values.push_back(std::to_string(character_data_entry.aa_points_old));
|
||||
insert_values.push_back(std::to_string(character_data_entry.e_last_invsnapshot));
|
||||
insert_values.push_back("'" + EscapeString(character_data_entry.deleted_at) + "'");
|
||||
insert_values.push_back("FROM_UNIXTIME(" + (character_data_entry.deleted_at > 0 ? std::to_string(character_data_entry.deleted_at) : "null") + ")");
|
||||
|
||||
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
|
||||
}
|
||||
@@ -1028,7 +1142,7 @@ public:
|
||||
entry.aa_points_spent_old = atoi(row[98]);
|
||||
entry.aa_points_old = atoi(row[99]);
|
||||
entry.e_last_invsnapshot = atoi(row[100]);
|
||||
entry.deleted_at = row[101] ? row[101] : "";
|
||||
entry.deleted_at = strtoll(row[101] ? row[101] : "-1", nullptr, 10);
|
||||
|
||||
all_entries.push_back(entry);
|
||||
}
|
||||
@@ -1154,7 +1268,7 @@ public:
|
||||
entry.aa_points_spent_old = atoi(row[98]);
|
||||
entry.aa_points_old = atoi(row[99]);
|
||||
entry.e_last_invsnapshot = atoi(row[100]);
|
||||
entry.deleted_at = row[101] ? row[101] : "";
|
||||
entry.deleted_at = strtoll(row[101] ? row[101] : "-1", nullptr, 10);
|
||||
|
||||
all_entries.push_back(entry);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseCharacterDisciplinesRepository {
|
||||
public:
|
||||
@@ -37,11 +38,25 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"slot_id",
|
||||
"disc_id",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("character_disciplines");
|
||||
@@ -51,7 +66,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,327 @@
|
||||
/**
|
||||
* DO NOT MODIFY THIS FILE
|
||||
*
|
||||
* This repository was automatically generated and is NOT to be modified directly.
|
||||
* Any repository modifications are meant to be made to the repository extending the base.
|
||||
* Any modifications to base repositories are to be made by the generator only
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_CHARACTER_EXP_MODIFIERS_REPOSITORY_H
|
||||
#define EQEMU_BASE_CHARACTER_EXP_MODIFIERS_REPOSITORY_H
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseCharacterExpModifiersRepository {
|
||||
public:
|
||||
struct CharacterExpModifiers {
|
||||
int character_id;
|
||||
int zone_id;
|
||||
float aa_modifier;
|
||||
float exp_modifier;
|
||||
};
|
||||
|
||||
static std::string PrimaryKey()
|
||||
{
|
||||
return std::string("character_id");
|
||||
}
|
||||
|
||||
static std::vector<std::string> Columns()
|
||||
{
|
||||
return {
|
||||
"character_id",
|
||||
"zone_id",
|
||||
"aa_modifier",
|
||||
"exp_modifier",
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"character_id",
|
||||
"zone_id",
|
||||
"aa_modifier",
|
||||
"exp_modifier",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("character_exp_modifiers");
|
||||
}
|
||||
|
||||
static std::string BaseSelect()
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
static std::string BaseInsert()
|
||||
{
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static CharacterExpModifiers NewEntity()
|
||||
{
|
||||
CharacterExpModifiers entry{};
|
||||
|
||||
entry.character_id = 0;
|
||||
entry.zone_id = 0;
|
||||
entry.aa_modifier = 0;
|
||||
entry.exp_modifier = 0;
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
static CharacterExpModifiers GetCharacterExpModifiersEntry(
|
||||
const std::vector<CharacterExpModifiers> &character_exp_modifierss,
|
||||
int character_exp_modifiers_id
|
||||
)
|
||||
{
|
||||
for (auto &character_exp_modifiers : character_exp_modifierss) {
|
||||
if (character_exp_modifiers.character_id == character_exp_modifiers_id) {
|
||||
return character_exp_modifiers;
|
||||
}
|
||||
}
|
||||
|
||||
return NewEntity();
|
||||
}
|
||||
|
||||
static CharacterExpModifiers FindOne(
|
||||
Database& db,
|
||||
int character_exp_modifiers_id
|
||||
)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
character_exp_modifiers_id
|
||||
)
|
||||
);
|
||||
|
||||
auto row = results.begin();
|
||||
if (results.RowCount() == 1) {
|
||||
CharacterExpModifiers entry{};
|
||||
|
||||
entry.character_id = atoi(row[0]);
|
||||
entry.zone_id = atoi(row[1]);
|
||||
entry.aa_modifier = static_cast<float>(atof(row[2]));
|
||||
entry.exp_modifier = static_cast<float>(atof(row[3]));
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
return NewEntity();
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_exp_modifiers_id
|
||||
)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
PrimaryKey(),
|
||||
character_exp_modifiers_id
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterExpModifiers character_exp_modifiers_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> update_values;
|
||||
|
||||
auto columns = Columns();
|
||||
|
||||
update_values.push_back(columns[0] + " = " + std::to_string(character_exp_modifiers_entry.character_id));
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(character_exp_modifiers_entry.zone_id));
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(character_exp_modifiers_entry.aa_modifier));
|
||||
update_values.push_back(columns[3] + " = " + std::to_string(character_exp_modifiers_entry.exp_modifier));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
implode(", ", update_values),
|
||||
PrimaryKey(),
|
||||
character_exp_modifiers_entry.character_id
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static CharacterExpModifiers InsertOne(
|
||||
Database& db,
|
||||
CharacterExpModifiers character_exp_modifiers_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(character_exp_modifiers_entry.character_id));
|
||||
insert_values.push_back(std::to_string(character_exp_modifiers_entry.zone_id));
|
||||
insert_values.push_back(std::to_string(character_exp_modifiers_entry.aa_modifier));
|
||||
insert_values.push_back(std::to_string(character_exp_modifiers_entry.exp_modifier));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
implode(",", insert_values)
|
||||
)
|
||||
);
|
||||
|
||||
if (results.Success()) {
|
||||
character_exp_modifiers_entry.character_id = results.LastInsertedID();
|
||||
return character_exp_modifiers_entry;
|
||||
}
|
||||
|
||||
character_exp_modifiers_entry = NewEntity();
|
||||
|
||||
return character_exp_modifiers_entry;
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterExpModifiers> character_exp_modifiers_entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &character_exp_modifiers_entry: character_exp_modifiers_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(character_exp_modifiers_entry.character_id));
|
||||
insert_values.push_back(std::to_string(character_exp_modifiers_entry.zone_id));
|
||||
insert_values.push_back(std::to_string(character_exp_modifiers_entry.aa_modifier));
|
||||
insert_values.push_back(std::to_string(character_exp_modifiers_entry.exp_modifier));
|
||||
|
||||
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterExpModifiers> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterExpModifiers> all_entries;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
)
|
||||
);
|
||||
|
||||
all_entries.reserve(results.RowCount());
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
CharacterExpModifiers entry{};
|
||||
|
||||
entry.character_id = atoi(row[0]);
|
||||
entry.zone_id = atoi(row[1]);
|
||||
entry.aa_modifier = static_cast<float>(atof(row[2]));
|
||||
entry.exp_modifier = static_cast<float>(atof(row[3]));
|
||||
|
||||
all_entries.push_back(entry);
|
||||
}
|
||||
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterExpModifiers> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterExpModifiers> all_entries;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
where_filter
|
||||
)
|
||||
);
|
||||
|
||||
all_entries.reserve(results.RowCount());
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
CharacterExpModifiers entry{};
|
||||
|
||||
entry.character_id = atoi(row[0]);
|
||||
entry.zone_id = atoi(row[1]);
|
||||
entry.aa_modifier = static_cast<float>(atof(row[2]));
|
||||
entry.exp_modifier = static_cast<float>(atof(row[3]));
|
||||
|
||||
all_entries.push_back(entry);
|
||||
}
|
||||
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
where_filter
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_CHARACTER_EXP_MODIFIERS_REPOSITORY_H
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseCharacterExpeditionLockoutsRepository {
|
||||
public:
|
||||
@@ -22,7 +23,7 @@ public:
|
||||
int character_id;
|
||||
std::string expedition_name;
|
||||
std::string event_name;
|
||||
std::string expire_time;
|
||||
time_t expire_time;
|
||||
int duration;
|
||||
std::string from_expedition_uuid;
|
||||
};
|
||||
@@ -45,11 +46,29 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"character_id",
|
||||
"expedition_name",
|
||||
"event_name",
|
||||
"UNIX_TIMESTAMP(expire_time)",
|
||||
"duration",
|
||||
"from_expedition_uuid",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("character_expedition_lockouts");
|
||||
@@ -59,7 +78,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
@@ -81,7 +100,7 @@ public:
|
||||
entry.character_id = 0;
|
||||
entry.expedition_name = "";
|
||||
entry.event_name = "";
|
||||
entry.expire_time = "";
|
||||
entry.expire_time = std::time(nullptr);
|
||||
entry.duration = 0;
|
||||
entry.from_expedition_uuid = "";
|
||||
|
||||
@@ -123,7 +142,7 @@ public:
|
||||
entry.character_id = atoi(row[1]);
|
||||
entry.expedition_name = row[2] ? row[2] : "";
|
||||
entry.event_name = row[3] ? row[3] : "";
|
||||
entry.expire_time = row[4] ? row[4] : "";
|
||||
entry.expire_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10);
|
||||
entry.duration = atoi(row[5]);
|
||||
entry.from_expedition_uuid = row[6] ? row[6] : "";
|
||||
|
||||
@@ -162,7 +181,7 @@ public:
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(character_expedition_lockouts_entry.character_id));
|
||||
update_values.push_back(columns[2] + " = '" + EscapeString(character_expedition_lockouts_entry.expedition_name) + "'");
|
||||
update_values.push_back(columns[3] + " = '" + EscapeString(character_expedition_lockouts_entry.event_name) + "'");
|
||||
update_values.push_back(columns[4] + " = '" + EscapeString(character_expedition_lockouts_entry.expire_time) + "'");
|
||||
update_values.push_back(columns[4] + " = FROM_UNIXTIME(" + (character_expedition_lockouts_entry.expire_time > 0 ? std::to_string(character_expedition_lockouts_entry.expire_time) : "null") + ")");
|
||||
update_values.push_back(columns[5] + " = " + std::to_string(character_expedition_lockouts_entry.duration));
|
||||
update_values.push_back(columns[6] + " = '" + EscapeString(character_expedition_lockouts_entry.from_expedition_uuid) + "'");
|
||||
|
||||
@@ -190,7 +209,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_expedition_lockouts_entry.character_id));
|
||||
insert_values.push_back("'" + EscapeString(character_expedition_lockouts_entry.expedition_name) + "'");
|
||||
insert_values.push_back("'" + EscapeString(character_expedition_lockouts_entry.event_name) + "'");
|
||||
insert_values.push_back("'" + EscapeString(character_expedition_lockouts_entry.expire_time) + "'");
|
||||
insert_values.push_back("FROM_UNIXTIME(" + (character_expedition_lockouts_entry.expire_time > 0 ? std::to_string(character_expedition_lockouts_entry.expire_time) : "null") + ")");
|
||||
insert_values.push_back(std::to_string(character_expedition_lockouts_entry.duration));
|
||||
insert_values.push_back("'" + EscapeString(character_expedition_lockouts_entry.from_expedition_uuid) + "'");
|
||||
|
||||
@@ -226,7 +245,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_expedition_lockouts_entry.character_id));
|
||||
insert_values.push_back("'" + EscapeString(character_expedition_lockouts_entry.expedition_name) + "'");
|
||||
insert_values.push_back("'" + EscapeString(character_expedition_lockouts_entry.event_name) + "'");
|
||||
insert_values.push_back("'" + EscapeString(character_expedition_lockouts_entry.expire_time) + "'");
|
||||
insert_values.push_back("FROM_UNIXTIME(" + (character_expedition_lockouts_entry.expire_time > 0 ? std::to_string(character_expedition_lockouts_entry.expire_time) : "null") + ")");
|
||||
insert_values.push_back(std::to_string(character_expedition_lockouts_entry.duration));
|
||||
insert_values.push_back("'" + EscapeString(character_expedition_lockouts_entry.from_expedition_uuid) + "'");
|
||||
|
||||
@@ -266,7 +285,7 @@ public:
|
||||
entry.character_id = atoi(row[1]);
|
||||
entry.expedition_name = row[2] ? row[2] : "";
|
||||
entry.event_name = row[3] ? row[3] : "";
|
||||
entry.expire_time = row[4] ? row[4] : "";
|
||||
entry.expire_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10);
|
||||
entry.duration = atoi(row[5]);
|
||||
entry.from_expedition_uuid = row[6] ? row[6] : "";
|
||||
|
||||
@@ -297,7 +316,7 @@ public:
|
||||
entry.character_id = atoi(row[1]);
|
||||
entry.expedition_name = row[2] ? row[2] : "";
|
||||
entry.event_name = row[3] ? row[3] : "";
|
||||
entry.expire_time = row[4] ? row[4] : "";
|
||||
entry.expire_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10);
|
||||
entry.duration = atoi(row[5]);
|
||||
entry.from_expedition_uuid = row[6] ? row[6] : "";
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseCharacterInspectMessagesRepository {
|
||||
public:
|
||||
@@ -35,11 +36,24 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"inspect_message",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("character_inspect_messages");
|
||||
@@ -49,7 +63,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseCharacterInstanceSafereturnsRepository {
|
||||
public:
|
||||
@@ -49,11 +50,31 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"character_id",
|
||||
"instance_zone_id",
|
||||
"instance_id",
|
||||
"safe_zone_id",
|
||||
"safe_x",
|
||||
"safe_y",
|
||||
"safe_z",
|
||||
"safe_heading",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("character_instance_safereturns");
|
||||
@@ -63,7 +84,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseCharacterItemRecastRepository {
|
||||
public:
|
||||
@@ -37,11 +38,25 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"recast_type",
|
||||
"timestamp",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("character_item_recast");
|
||||
@@ -51,7 +66,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseCharacterLanguagesRepository {
|
||||
public:
|
||||
@@ -37,11 +38,25 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"lang_id",
|
||||
"value",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("character_languages");
|
||||
@@ -51,7 +66,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseCharacterLeadershipAbilitiesRepository {
|
||||
public:
|
||||
@@ -37,11 +38,25 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"slot",
|
||||
"rank",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("character_leadership_abilities");
|
||||
@@ -51,7 +66,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseCharacterMaterialRepository {
|
||||
public:
|
||||
@@ -45,11 +46,29 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"slot",
|
||||
"blue",
|
||||
"green",
|
||||
"red",
|
||||
"use_tint",
|
||||
"color",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("character_material");
|
||||
@@ -59,7 +78,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseCharacterMemmedSpellsRepository {
|
||||
public:
|
||||
@@ -37,11 +38,25 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"slot_id",
|
||||
"spell_id",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("character_memmed_spells");
|
||||
@@ -51,7 +66,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseCharacterPetBuffsRepository {
|
||||
public:
|
||||
@@ -53,11 +54,33 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"char_id",
|
||||
"pet",
|
||||
"slot",
|
||||
"spell_id",
|
||||
"caster_level",
|
||||
"castername",
|
||||
"ticsremaining",
|
||||
"counters",
|
||||
"numhits",
|
||||
"rune",
|
||||
"instrument_mod",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("character_pet_buffs");
|
||||
@@ -67,7 +90,7 @@ public:
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user