mirror of
https://github.com/EQEmu/Server.git
synced 2026-01-26 08:33:53 +00:00
fix zone
This commit is contained in:
parent
1f37254f1a
commit
ccb3cef3d7
@ -160,7 +160,7 @@ endif()
|
|||||||
if(EQEMU_BUILD_SERVER)
|
if(EQEMU_BUILD_SERVER)
|
||||||
add_subdirectory(shared_memory)
|
add_subdirectory(shared_memory)
|
||||||
add_subdirectory(world)
|
add_subdirectory(world)
|
||||||
#add_subdirectory(zone)
|
add_subdirectory(zone)
|
||||||
add_subdirectory(ucs)
|
add_subdirectory(ucs)
|
||||||
add_subdirectory(queryserv)
|
add_subdirectory(queryserv)
|
||||||
add_subdirectory(eqlaunch)
|
add_subdirectory(eqlaunch)
|
||||||
|
|||||||
@ -23,7 +23,6 @@ set(zone_sources
|
|||||||
client_process.cpp
|
client_process.cpp
|
||||||
combat_record.cpp
|
combat_record.cpp
|
||||||
corpse.cpp
|
corpse.cpp
|
||||||
../common/data_bucket.cpp
|
|
||||||
doors.cpp
|
doors.cpp
|
||||||
dialogue_window.cpp
|
dialogue_window.cpp
|
||||||
dynamic_zone.cpp
|
dynamic_zone.cpp
|
||||||
@ -139,7 +138,6 @@ set(zone_headers
|
|||||||
command.h
|
command.h
|
||||||
common.h
|
common.h
|
||||||
corpse.h
|
corpse.h
|
||||||
../common/data_bucket.h
|
|
||||||
doors.h
|
doors.h
|
||||||
dialogue_window.h
|
dialogue_window.h
|
||||||
dynamic_zone.h
|
dynamic_zone.h
|
||||||
@ -491,23 +489,32 @@ endif()
|
|||||||
add_definitions(-DZONE)
|
add_definitions(-DZONE)
|
||||||
|
|
||||||
# link lua_zone unity build against luabind
|
# link lua_zone unity build against luabind
|
||||||
if(MSVC)
|
if(EQEMU_BUILD_LUA)
|
||||||
target_compile_options(lua_zone PRIVATE /utf-8)
|
target_compile_definitions(lua_zone PUBLIC LUA_EQEMU)
|
||||||
endif()
|
target_link_libraries(lua_zone PRIVATE luabind Boost::dynamic_bitset Boost::tuple Boost::foreach common)
|
||||||
|
if (EQEMU_BUILD_STATIC AND LUA_LIBRARY)
|
||||||
target_link_libraries(lua_zone PRIVATE luabind Boost::dynamic_bitset Boost::tuple Boost::foreach unofficial::libmariadb)
|
target_link_libraries(zone PRIVATE ${LUA_LIBRARY})
|
||||||
if (EQEMU_BUILD_STATIC AND LUA_LIBRARY)
|
endif()
|
||||||
target_link_libraries(zone PRIVATE ${LUA_LIBRARY})
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# perl unity build links against perl_zone
|
# perl unity build links against perl_zone
|
||||||
target_link_libraries(perl_zone PRIVATE perlbind fmt::fmt unofficial::libmariadb ${PERL_LIBRARY_LIBS})
|
if(EQEMU_BUILD_PERL)
|
||||||
if (EQEMU_BUILD_STATIC AND PERL_LIBRARY)
|
target_link_libraries(perl_zone PRIVATE perlbind common ${PERL_LIBRARY_LIBS})
|
||||||
target_link_libraries(zone PRIVATE ${PERL_LIBRARY})
|
if (EQEMU_BUILD_STATIC AND PERL_LIBRARY)
|
||||||
|
target_link_libraries(zone PRIVATE ${PERL_LIBRARY})
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# link zone against common libraries
|
# link zone against common libraries
|
||||||
target_link_libraries(zone PRIVATE lua_zone perl_zone gm_commands_zone ${ZONE_LIBS} RecastNavigation::Detour)
|
target_link_libraries(zone PRIVATE gm_commands_zone common RecastNavigation::Detour)
|
||||||
|
|
||||||
|
if(EQEMU_BUILD_LUA)
|
||||||
|
target_link_libraries(zone PRIVATE lua_zone)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(EQEMU_BUILD_PERL)
|
||||||
|
target_link_libraries(zone PRIVATE perl_zone)
|
||||||
|
endif()
|
||||||
|
|
||||||
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
||||||
|
|
||||||
|
|||||||
@ -5901,7 +5901,7 @@ float Mob::CheckHeroicBonusesDataBuckets(std::string bucket_name)
|
|||||||
DataBucketKey k = GetScopedBucketKeys();
|
DataBucketKey k = GetScopedBucketKeys();
|
||||||
k.key = bucket_name;
|
k.key = bucket_name;
|
||||||
if (IsOfClientBot()) {
|
if (IsOfClientBot()) {
|
||||||
bucket_value = DataBucket::GetData(k).value;
|
bucket_value = DataBucket::GetData(&database, k).value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bucket_value.empty() || !Strings::IsNumber(bucket_value)) {
|
if (bucket_value.empty() || !Strings::IsNumber(bucket_value)) {
|
||||||
|
|||||||
@ -8224,13 +8224,13 @@ bool Bot::CheckDataBucket(std::string bucket_name, const std::string& bucket_val
|
|||||||
DataBucketKey k = GetScopedBucketKeys();
|
DataBucketKey k = GetScopedBucketKeys();
|
||||||
k.key = bucket_name;
|
k.key = bucket_name;
|
||||||
|
|
||||||
auto b = DataBucket::GetData(k);
|
auto b = DataBucket::GetData(&database, k);
|
||||||
if (b.value.empty() && GetBotOwner()) {
|
if (b.value.empty() && GetBotOwner()) {
|
||||||
// fetch from owner
|
// fetch from owner
|
||||||
k = GetBotOwner()->GetScopedBucketKeys();
|
k = GetBotOwner()->GetScopedBucketKeys();
|
||||||
k.key = bucket_name;
|
k.key = bucket_name;
|
||||||
|
|
||||||
b = DataBucket::GetData(k);
|
b = DataBucket::GetData(&database, k);
|
||||||
if (b.value.empty()) {
|
if (b.value.empty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -116,7 +116,7 @@ void RunBenchmarkCycle(uint64_t target_rows)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
DataBucket::SetData(e);
|
DataBucket::SetData(&database, e);
|
||||||
|
|
||||||
inserted_keys.emplace_back(e);
|
inserted_keys.emplace_back(e);
|
||||||
}
|
}
|
||||||
@ -129,7 +129,7 @@ void RunBenchmarkCycle(uint64_t target_rows)
|
|||||||
auto update_start = std::chrono::high_resolution_clock::now();
|
auto update_start = std::chrono::high_resolution_clock::now();
|
||||||
for (auto &key: inserted_keys) {
|
for (auto &key: inserted_keys) {
|
||||||
// 🔍 Retrieve existing bucket using scoped `GetData`
|
// 🔍 Retrieve existing bucket using scoped `GetData`
|
||||||
auto e = DataBucket::GetData(key);
|
auto e = DataBucket::GetData(&database, key);
|
||||||
if (e.id > 0) {
|
if (e.id > 0) {
|
||||||
// create a new key object with the updated values
|
// create a new key object with the updated values
|
||||||
DataBucketKey bucket_entry_key{
|
DataBucketKey bucket_entry_key{
|
||||||
@ -145,7 +145,7 @@ void RunBenchmarkCycle(uint64_t target_rows)
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 🔄 Update using DataBucket class
|
// 🔄 Update using DataBucket class
|
||||||
DataBucket::SetData(bucket_entry_key);
|
DataBucket::SetData(&database, bucket_entry_key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
auto update_end = std::chrono::high_resolution_clock::now();
|
auto update_end = std::chrono::high_resolution_clock::now();
|
||||||
@ -188,7 +188,7 @@ void RunBenchmarkCycle(uint64_t target_rows)
|
|||||||
k.instance_id = entity_choice;
|
k.instance_id = entity_choice;
|
||||||
}
|
}
|
||||||
|
|
||||||
DataBucket::GetData(key);
|
DataBucket::GetData(&database, key);
|
||||||
}
|
}
|
||||||
auto read_cached_end = std::chrono::high_resolution_clock::now();
|
auto read_cached_end = std::chrono::high_resolution_clock::now();
|
||||||
std::chrono::duration<double> read_cached_time = read_cached_end - read_cached_start;
|
std::chrono::duration<double> read_cached_time = read_cached_end - read_cached_start;
|
||||||
@ -206,7 +206,7 @@ void RunBenchmarkCycle(uint64_t target_rows)
|
|||||||
.character_id = 999999999, // use scoped value
|
.character_id = 999999999, // use scoped value
|
||||||
};
|
};
|
||||||
|
|
||||||
DataBucket::GetData(k);
|
DataBucket::GetData(&database, k);
|
||||||
}
|
}
|
||||||
auto read_client_cache_miss_end = std::chrono::high_resolution_clock::now();
|
auto read_client_cache_miss_end = std::chrono::high_resolution_clock::now();
|
||||||
std::chrono::duration<double> read_client_cache_miss_time = read_client_cache_miss_end - read_client_cache_miss_start;
|
std::chrono::duration<double> read_client_cache_miss_time = read_client_cache_miss_end - read_client_cache_miss_start;
|
||||||
@ -260,7 +260,7 @@ void RunBenchmarkCycle(uint64_t target_rows)
|
|||||||
k.instance_id = entity_choice;
|
k.instance_id = entity_choice;
|
||||||
}
|
}
|
||||||
|
|
||||||
DataBucket::DeleteData(k);
|
DataBucket::DeleteData(&database, k);
|
||||||
}
|
}
|
||||||
auto delete_end = std::chrono::high_resolution_clock::now();
|
auto delete_end = std::chrono::high_resolution_clock::now();
|
||||||
std::chrono::duration<double> delete_time = delete_end - delete_start;
|
std::chrono::duration<double> delete_time = delete_end - delete_start;
|
||||||
|
|||||||
@ -4840,7 +4840,7 @@ bool Client::IsNameChangeAllowed() {
|
|||||||
auto k = GetScopedBucketKeys();
|
auto k = GetScopedBucketKeys();
|
||||||
k.key = "name_change_allowed";
|
k.key = "name_change_allowed";
|
||||||
|
|
||||||
auto b = DataBucket::GetData(k);
|
auto b = DataBucket::GetData(&database, k);
|
||||||
if (!b.value.empty()) {
|
if (!b.value.empty()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -4856,7 +4856,7 @@ bool Client::ClearNameChange() {
|
|||||||
auto k = GetScopedBucketKeys();
|
auto k = GetScopedBucketKeys();
|
||||||
k.key = "name_change_allowed";
|
k.key = "name_change_allowed";
|
||||||
|
|
||||||
DataBucket::DeleteData(k);
|
DataBucket::DeleteData(&database, k);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -4878,7 +4878,7 @@ void Client::GrantNameChange() {
|
|||||||
auto k = GetScopedBucketKeys();
|
auto k = GetScopedBucketKeys();
|
||||||
k.key = "name_change_allowed";
|
k.key = "name_change_allowed";
|
||||||
k.value = "allowed"; // potentially put a timestamp here
|
k.value = "allowed"; // potentially put a timestamp here
|
||||||
DataBucket::SetData(k);
|
DataBucket::SetData(&database, k);
|
||||||
|
|
||||||
InvokeChangeNameWindow(true);
|
InvokeChangeNameWindow(true);
|
||||||
}
|
}
|
||||||
@ -4891,7 +4891,7 @@ bool Client::IsPetNameChangeAllowed() {
|
|||||||
DataBucketKey k = GetScopedBucketKeys();
|
DataBucketKey k = GetScopedBucketKeys();
|
||||||
k.key = "PetNameChangesAllowed";
|
k.key = "PetNameChangesAllowed";
|
||||||
|
|
||||||
auto b = DataBucket::GetData(k);
|
auto b = DataBucket::GetData(&database, k);
|
||||||
if (!b.value.empty()) {
|
if (!b.value.empty()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -4915,7 +4915,7 @@ void Client::GrantPetNameChange() {
|
|||||||
DataBucketKey k = GetScopedBucketKeys();
|
DataBucketKey k = GetScopedBucketKeys();
|
||||||
k.key = "PetNameChangesAllowed";
|
k.key = "PetNameChangesAllowed";
|
||||||
k.value = "true";
|
k.value = "true";
|
||||||
DataBucket::SetData(k);
|
DataBucket::SetData(&database, k);
|
||||||
|
|
||||||
InvokeChangePetName(true);
|
InvokeChangePetName(true);
|
||||||
}
|
}
|
||||||
@ -4924,7 +4924,7 @@ void Client::ClearPetNameChange() {
|
|||||||
DataBucketKey k = GetScopedBucketKeys();
|
DataBucketKey k = GetScopedBucketKeys();
|
||||||
k.key = "PetNameChangesAllowed";
|
k.key = "PetNameChangesAllowed";
|
||||||
|
|
||||||
DataBucket::DeleteData(k);
|
DataBucket::DeleteData(&database, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Client::ChangePetName(std::string new_name)
|
bool Client::ChangePetName(std::string new_name)
|
||||||
@ -9671,9 +9671,9 @@ void Client::SetDevToolsEnabled(bool in_dev_tools_enabled)
|
|||||||
const auto dev_tools_key = fmt::format("{}-dev-tools-disabled", AccountID());
|
const auto dev_tools_key = fmt::format("{}-dev-tools-disabled", AccountID());
|
||||||
|
|
||||||
if (in_dev_tools_enabled) {
|
if (in_dev_tools_enabled) {
|
||||||
DataBucket::DeleteData(dev_tools_key);
|
DataBucket::DeleteData(&database, dev_tools_key);
|
||||||
} else {
|
} else {
|
||||||
DataBucket::SetData(dev_tools_key, "true");
|
DataBucket::SetData(&database, dev_tools_key, "true");
|
||||||
}
|
}
|
||||||
|
|
||||||
Client::dev_tools_enabled = in_dev_tools_enabled;
|
Client::dev_tools_enabled = in_dev_tools_enabled;
|
||||||
@ -9846,7 +9846,7 @@ void Client::SendToGuildHall()
|
|||||||
uint32 expiration_time = (RuleI(Instances, GuildHallExpirationDays) * 86400);
|
uint32 expiration_time = (RuleI(Instances, GuildHallExpirationDays) * 86400);
|
||||||
uint16 instance_id = 0;
|
uint16 instance_id = 0;
|
||||||
std::string guild_hall_instance_key = fmt::format("guild-hall-instance-{}", GuildID());
|
std::string guild_hall_instance_key = fmt::format("guild-hall-instance-{}", GuildID());
|
||||||
std::string instance_data = DataBucket::GetData(guild_hall_instance_key);
|
std::string instance_data = DataBucket::GetData(&database, guild_hall_instance_key);
|
||||||
if (!instance_data.empty() && Strings::ToInt(instance_data) > 0) {
|
if (!instance_data.empty() && Strings::ToInt(instance_data) > 0) {
|
||||||
instance_id = Strings::ToInt(instance_data);
|
instance_id = Strings::ToInt(instance_data);
|
||||||
}
|
}
|
||||||
@ -9863,6 +9863,7 @@ void Client::SendToGuildHall()
|
|||||||
}
|
}
|
||||||
|
|
||||||
DataBucket::SetData(
|
DataBucket::SetData(
|
||||||
|
&database,
|
||||||
guild_hall_instance_key,
|
guild_hall_instance_key,
|
||||||
std::to_string(instance_id),
|
std::to_string(instance_id),
|
||||||
std::to_string(expiration_time)
|
std::to_string(expiration_time)
|
||||||
@ -10915,7 +10916,7 @@ void Client::SendToInstance(std::string instance_type, std::string zone_short_na
|
|||||||
instance_identifier,
|
instance_identifier,
|
||||||
zone_short_name
|
zone_short_name
|
||||||
);
|
);
|
||||||
std::string current_bucket_value = DataBucket::GetData(full_bucket_name);
|
std::string current_bucket_value = DataBucket::GetData(&database, full_bucket_name);
|
||||||
uint16 instance_id = 0;
|
uint16 instance_id = 0;
|
||||||
|
|
||||||
if (current_bucket_value.length() > 0) {
|
if (current_bucket_value.length() > 0) {
|
||||||
@ -10931,7 +10932,7 @@ void Client::SendToInstance(std::string instance_type, std::string zone_short_na
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DataBucket::SetData(full_bucket_name, itoa(instance_id), itoa(duration));
|
DataBucket::SetData(&database, full_bucket_name, itoa(instance_id), itoa(duration));
|
||||||
}
|
}
|
||||||
|
|
||||||
AssignToInstance(instance_id);
|
AssignToInstance(instance_id);
|
||||||
@ -13149,7 +13150,7 @@ std::string Client::GetAccountBucket(std::string bucket_name)
|
|||||||
k.account_id = AccountID();
|
k.account_id = AccountID();
|
||||||
k.key = bucket_name;
|
k.key = bucket_name;
|
||||||
|
|
||||||
return DataBucket::GetData(k).value;
|
return DataBucket::GetData(&database, k).value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::SetAccountBucket(std::string bucket_name, std::string bucket_value, std::string expiration)
|
void Client::SetAccountBucket(std::string bucket_name, std::string bucket_value, std::string expiration)
|
||||||
@ -13160,7 +13161,7 @@ void Client::SetAccountBucket(std::string bucket_name, std::string bucket_value,
|
|||||||
k.expires = expiration;
|
k.expires = expiration;
|
||||||
k.value = bucket_value;
|
k.value = bucket_value;
|
||||||
|
|
||||||
DataBucket::SetData(k);
|
DataBucket::SetData(&database, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::DeleteAccountBucket(std::string bucket_name)
|
void Client::DeleteAccountBucket(std::string bucket_name)
|
||||||
@ -13169,7 +13170,7 @@ void Client::DeleteAccountBucket(std::string bucket_name)
|
|||||||
k.account_id = AccountID();
|
k.account_id = AccountID();
|
||||||
k.key = bucket_name;
|
k.key = bucket_name;
|
||||||
|
|
||||||
DataBucket::DeleteData(k);
|
DataBucket::DeleteData(&database, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Client::GetAccountBucketExpires(std::string bucket_name)
|
std::string Client::GetAccountBucketExpires(std::string bucket_name)
|
||||||
@ -13178,7 +13179,7 @@ std::string Client::GetAccountBucketExpires(std::string bucket_name)
|
|||||||
k.account_id = AccountID();
|
k.account_id = AccountID();
|
||||||
k.key = bucket_name;
|
k.key = bucket_name;
|
||||||
|
|
||||||
return DataBucket::GetDataExpires(k);
|
return DataBucket::GetDataExpires(&database, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Client::GetAccountBucketRemaining(std::string bucket_name)
|
std::string Client::GetAccountBucketRemaining(std::string bucket_name)
|
||||||
@ -13187,7 +13188,7 @@ std::string Client::GetAccountBucketRemaining(std::string bucket_name)
|
|||||||
k.account_id = AccountID();
|
k.account_id = AccountID();
|
||||||
k.key = bucket_name;
|
k.key = bucket_name;
|
||||||
|
|
||||||
return DataBucket::GetDataRemaining(k);
|
return DataBucket::GetDataRemaining(&database, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Client::GetBandolierName(uint8 bandolier_slot)
|
std::string Client::GetBandolierName(uint8 bandolier_slot)
|
||||||
|
|||||||
@ -1853,7 +1853,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
|||||||
*/
|
*/
|
||||||
if (Admin() >= EQ::DevTools::GM_ACCOUNT_STATUS_LEVEL) {
|
if (Admin() >= EQ::DevTools::GM_ACCOUNT_STATUS_LEVEL) {
|
||||||
const auto dev_tools_key = fmt::format("{}-dev-tools-disabled", AccountID());
|
const auto dev_tools_key = fmt::format("{}-dev-tools-disabled", AccountID());
|
||||||
if (DataBucket::GetData(dev_tools_key) == "true") {
|
if (DataBucket::GetData(&database, dev_tools_key) == "true") {
|
||||||
dev_tools_enabled = false;
|
dev_tools_enabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -874,7 +874,7 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) {
|
|||||||
DataBucketKey k = GetScopedBucketKeys();
|
DataBucketKey k = GetScopedBucketKeys();
|
||||||
k.key = bucket_name;
|
k.key = bucket_name;
|
||||||
|
|
||||||
auto b = DataBucket::GetData(k);
|
auto b = DataBucket::GetData(&database, k);
|
||||||
if (b.value.empty()) {
|
if (b.value.empty()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1299,7 +1299,7 @@ uint8 Client::GetCharMaxLevelFromBucket()
|
|||||||
DataBucketKey k = GetScopedBucketKeys();
|
DataBucketKey k = GetScopedBucketKeys();
|
||||||
k.key = "CharMaxLevel";
|
k.key = "CharMaxLevel";
|
||||||
|
|
||||||
auto b = DataBucket::GetData(k);
|
auto b = DataBucket::GetData(&database, k);
|
||||||
if (!b.value.empty()) {
|
if (!b.value.empty()) {
|
||||||
if (Strings::IsNumber(b.value)) {
|
if (Strings::IsNumber(b.value)) {
|
||||||
return static_cast<uint8>(Strings::ToUnsignedInt(b.value));
|
return static_cast<uint8>(Strings::ToUnsignedInt(b.value));
|
||||||
|
|||||||
@ -50,7 +50,7 @@ void command_databuckets(Client *c, const Seperator *sep)
|
|||||||
!npc_id &&
|
!npc_id &&
|
||||||
!bot_id
|
!bot_id
|
||||||
) {
|
) {
|
||||||
if (!DataBucket::DeleteData(key_filter)) {
|
if (!DataBucket::DeleteData(&database, key_filter)) {
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@ -76,7 +76,7 @@ void command_databuckets(Client *c, const Seperator *sep)
|
|||||||
k.npc_id = npc_id;
|
k.npc_id = npc_id;
|
||||||
k.bot_id = bot_id;
|
k.bot_id = bot_id;
|
||||||
|
|
||||||
if (!DataBucket::DeleteData(k)) {
|
if (!DataBucket::DeleteData(&database, k)) {
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@ -123,7 +123,7 @@ void command_databuckets(Client *c, const Seperator *sep)
|
|||||||
|
|
||||||
const std::string& expires_string = expires == 0 ? "Never" : std::to_string(expires);
|
const std::string& expires_string = expires == 0 ? "Never" : std::to_string(expires);
|
||||||
|
|
||||||
DataBucket::SetData(k);
|
DataBucket::SetData(&database, k);
|
||||||
|
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
|
|||||||
@ -58,7 +58,7 @@ void command_gmzone(Client *c, const Seperator *sep)
|
|||||||
zone_version
|
zone_version
|
||||||
);
|
);
|
||||||
|
|
||||||
auto existing_zone_instance = DataBucket::GetData(bucket_key);
|
auto existing_zone_instance = DataBucket::GetData(&database, bucket_key);
|
||||||
uint16 instance_id = 0;
|
uint16 instance_id = 0;
|
||||||
uint32 duration = 100000000;
|
uint32 duration = 100000000;
|
||||||
|
|
||||||
@ -99,6 +99,7 @@ void command_gmzone(Client *c, const Seperator *sep)
|
|||||||
);
|
);
|
||||||
|
|
||||||
DataBucket::SetData(
|
DataBucket::SetData(
|
||||||
|
&database,
|
||||||
bucket_key,
|
bucket_key,
|
||||||
std::to_string(instance_id)
|
std::to_string(instance_id)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -933,23 +933,23 @@ std::string lua_get_rule(std::string rule_name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string lua_get_data(std::string bucket_key) {
|
std::string lua_get_data(std::string bucket_key) {
|
||||||
return DataBucket::GetData(bucket_key);
|
return DataBucket::GetData(&database, bucket_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string lua_get_data_expires(std::string bucket_key) {
|
std::string lua_get_data_expires(std::string bucket_key) {
|
||||||
return DataBucket::GetDataExpires(bucket_key);
|
return DataBucket::GetDataExpires(&database, bucket_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lua_set_data(std::string bucket_key, std::string bucket_value) {
|
void lua_set_data(std::string bucket_key, std::string bucket_value) {
|
||||||
DataBucket::SetData(bucket_key, bucket_value);
|
DataBucket::SetData(&database, bucket_key, bucket_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lua_set_data(std::string bucket_key, std::string bucket_value, std::string expires_at) {
|
void lua_set_data(std::string bucket_key, std::string bucket_value, std::string expires_at) {
|
||||||
DataBucket::SetData(bucket_key, bucket_value, expires_at);
|
DataBucket::SetData(&database, bucket_key, bucket_value, expires_at);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool lua_delete_data(std::string bucket_key) {
|
bool lua_delete_data(std::string bucket_key) {
|
||||||
return DataBucket::DeleteData(bucket_key);
|
return DataBucket::DeleteData(&database, bucket_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string lua_get_char_name_by_id(uint32 char_id) {
|
std::string lua_get_char_name_by_id(uint32 char_id) {
|
||||||
@ -2030,7 +2030,7 @@ void lua_rename(std::string name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string lua_get_data_remaining(std::string bucket_name) {
|
std::string lua_get_data_remaining(std::string bucket_name) {
|
||||||
return DataBucket::GetDataRemaining(bucket_name);
|
return DataBucket::GetDataRemaining(&database, bucket_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
const int lua_get_item_stat(uint32 item_id, std::string identifier) {
|
const int lua_get_item_stat(uint32 item_id, std::string identifier) {
|
||||||
|
|||||||
16
zone/mob.cpp
16
zone/mob.cpp
@ -8161,7 +8161,7 @@ void Mob::DeleteBucket(std::string bucket_name)
|
|||||||
DataBucketKey k = GetScopedBucketKeys();
|
DataBucketKey k = GetScopedBucketKeys();
|
||||||
k.key = bucket_name;
|
k.key = bucket_name;
|
||||||
|
|
||||||
DataBucket::DeleteData(k);
|
DataBucket::DeleteData(&database, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Mob::GetBucket(std::string bucket_name)
|
std::string Mob::GetBucket(std::string bucket_name)
|
||||||
@ -8169,7 +8169,7 @@ std::string Mob::GetBucket(std::string bucket_name)
|
|||||||
DataBucketKey k = GetScopedBucketKeys();
|
DataBucketKey k = GetScopedBucketKeys();
|
||||||
k.key = bucket_name;
|
k.key = bucket_name;
|
||||||
|
|
||||||
auto b = DataBucket::GetData(k);
|
auto b = DataBucket::GetData(&database, k);
|
||||||
if (!b.value.empty()) {
|
if (!b.value.empty()) {
|
||||||
return b.value;
|
return b.value;
|
||||||
}
|
}
|
||||||
@ -8181,7 +8181,7 @@ std::string Mob::GetBucketExpires(std::string bucket_name)
|
|||||||
DataBucketKey k = GetScopedBucketKeys();
|
DataBucketKey k = GetScopedBucketKeys();
|
||||||
k.key = bucket_name;
|
k.key = bucket_name;
|
||||||
|
|
||||||
std::string bucket_expiration = DataBucket::GetDataExpires(k);
|
std::string bucket_expiration = DataBucket::GetDataExpires(&database, k);
|
||||||
if (!bucket_expiration.empty()) {
|
if (!bucket_expiration.empty()) {
|
||||||
return bucket_expiration;
|
return bucket_expiration;
|
||||||
}
|
}
|
||||||
@ -8194,7 +8194,7 @@ std::string Mob::GetBucketRemaining(std::string bucket_name)
|
|||||||
DataBucketKey k = GetScopedBucketKeys();
|
DataBucketKey k = GetScopedBucketKeys();
|
||||||
k.key = bucket_name;
|
k.key = bucket_name;
|
||||||
|
|
||||||
std::string bucket_remaining = DataBucket::GetDataRemaining(k);
|
std::string bucket_remaining = DataBucket::GetDataRemaining(&database, k);
|
||||||
if (!bucket_remaining.empty() && Strings::ToInt(bucket_remaining) > 0) {
|
if (!bucket_remaining.empty() && Strings::ToInt(bucket_remaining) > 0) {
|
||||||
return bucket_remaining;
|
return bucket_remaining;
|
||||||
}
|
}
|
||||||
@ -8212,7 +8212,7 @@ void Mob::SetBucket(std::string bucket_name, std::string bucket_value, std::stri
|
|||||||
k.expires = expiration;
|
k.expires = expiration;
|
||||||
k.value = bucket_value;
|
k.value = bucket_value;
|
||||||
|
|
||||||
DataBucket::SetData(k);
|
DataBucket::SetData(&database, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Mob::GetMobDescription()
|
std::string Mob::GetMobDescription()
|
||||||
@ -8783,12 +8783,12 @@ bool Mob::LoadDataBucketsCache()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (IsBot()) {
|
if (IsBot()) {
|
||||||
DataBucket::BulkLoadEntitiesToCache(DataBucketLoadType::Bot, {id});
|
DataBucket::BulkLoadEntitiesToCache(&database, DataBucketLoadType::Bot, {id});
|
||||||
}
|
}
|
||||||
else if (IsClient()) {
|
else if (IsClient()) {
|
||||||
uint32 account_id = CastToClient()->AccountID();
|
uint32 account_id = CastToClient()->AccountID();
|
||||||
DataBucket::BulkLoadEntitiesToCache(DataBucketLoadType::Account, {account_id});
|
DataBucket::BulkLoadEntitiesToCache(&database, DataBucketLoadType::Account, {account_id});
|
||||||
DataBucket::BulkLoadEntitiesToCache(DataBucketLoadType::Client, {id});
|
DataBucket::BulkLoadEntitiesToCache(&database, DataBucketLoadType::Client, {id});
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -6275,7 +6275,7 @@ bool Client::SpellBucketCheck(uint16 spell_id, uint32 character_id)
|
|||||||
|
|
||||||
k.key = e.bucket_name;
|
k.key = e.bucket_name;
|
||||||
|
|
||||||
const auto& b = DataBucket::GetData(k);
|
const auto& b = DataBucket::GetData(&database, k);
|
||||||
|
|
||||||
return zone->CompareDataBucket(e.bucket_comparison, e.bucket_value, b.value);
|
return zone->CompareDataBucket(e.bucket_comparison, e.bucket_value, b.value);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -170,7 +170,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool is_static) {
|
|||||||
zone->RequestUCSServerStatus();
|
zone->RequestUCSServerStatus();
|
||||||
zone->StartShutdownTimer();
|
zone->StartShutdownTimer();
|
||||||
|
|
||||||
DataBucket::LoadZoneCache(iZoneID, iInstanceID);
|
DataBucket::LoadZoneCache(&database, iZoneID, iInstanceID);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set Logging
|
* Set Logging
|
||||||
@ -3186,7 +3186,7 @@ std::string Zone::GetBucket(const std::string& bucket_name)
|
|||||||
k.instance_id = instanceid;
|
k.instance_id = instanceid;
|
||||||
k.key = bucket_name;
|
k.key = bucket_name;
|
||||||
|
|
||||||
return DataBucket::GetData(k).value;
|
return DataBucket::GetData(&database, k).value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Zone::SetBucket(const std::string& bucket_name, const std::string& bucket_value, const std::string& expiration)
|
void Zone::SetBucket(const std::string& bucket_name, const std::string& bucket_value, const std::string& expiration)
|
||||||
@ -3198,7 +3198,7 @@ void Zone::SetBucket(const std::string& bucket_name, const std::string& bucket_v
|
|||||||
k.expires = expiration;
|
k.expires = expiration;
|
||||||
k.value = bucket_value;
|
k.value = bucket_value;
|
||||||
|
|
||||||
DataBucket::SetData(k);
|
DataBucket::SetData(&database, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Zone::DeleteBucket(const std::string& bucket_name)
|
void Zone::DeleteBucket(const std::string& bucket_name)
|
||||||
@ -3208,7 +3208,7 @@ void Zone::DeleteBucket(const std::string& bucket_name)
|
|||||||
k.instance_id = instanceid;
|
k.instance_id = instanceid;
|
||||||
k.key = bucket_name;
|
k.key = bucket_name;
|
||||||
|
|
||||||
DataBucket::DeleteData(k);
|
DataBucket::DeleteData(&database, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Zone::GetBucketExpires(const std::string& bucket_name)
|
std::string Zone::GetBucketExpires(const std::string& bucket_name)
|
||||||
@ -3218,7 +3218,7 @@ std::string Zone::GetBucketExpires(const std::string& bucket_name)
|
|||||||
k.instance_id = instanceid;
|
k.instance_id = instanceid;
|
||||||
k.key = bucket_name;
|
k.key = bucket_name;
|
||||||
|
|
||||||
return DataBucket::GetDataExpires(k);
|
return DataBucket::GetDataExpires(&database, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Zone::GetBucketRemaining(const std::string& bucket_name)
|
std::string Zone::GetBucketRemaining(const std::string& bucket_name)
|
||||||
@ -3228,7 +3228,7 @@ std::string Zone::GetBucketRemaining(const std::string& bucket_name)
|
|||||||
k.instance_id = instanceid;
|
k.instance_id = instanceid;
|
||||||
k.key = bucket_name;
|
k.key = bucket_name;
|
||||||
|
|
||||||
return DataBucket::GetDataRemaining(k);
|
return DataBucket::GetDataRemaining(&database, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Zone::DisableRespawnTimers()
|
void Zone::DisableRespawnTimers()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user