mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 09:06:46 +00:00
Merge branch 'master' into kinglykrab/discordmanager-global-to-singleton
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<b>EverQuest Emulator (EQEmu) - A Fan-Made Project Honoring the Legendary MMORPG</b>
|
<b>EQEmulator - A Fan-Made Project Honoring a Legendary MMORPG</b>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
@@ -26,19 +26,19 @@
|
|||||||
***
|
***
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
EQEmulator is a <b>passion-driven</b>, <b>open source server emulator</b> project dedicated to preserving and celebrating the groundbreaking world of <b>EverQuest</b>, the massively multiplayer online role-playing game originally developed by <b>Verant Interactive</b> and <b>Sony Online Entertainment (now Daybreak Game Company)</b>.
|
EQEmulator is a <b>passion-driven</b>, <b>open source server emulator</b> project dedicated to preserving and celebrating the legacy of a groundbreaking classic MMORPG.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
For over two decades and continuing, EQEmulator has served as a <strong>fan tribute</strong>, providing tools and technology that allow players to explore, customize, and experience EverQuest’s iconic gameplay in new ways. This project exists solely out of <strong>deep admiration</strong> for the original developers, artists, designers, and visionaries who created one of the most influential online worlds of all time.
|
For over two decades and continuing, EQEmulator has served as a <strong>fan tribute</strong>, providing tools and technology that allow players to explore, customize, and experience the legendary game's iconic gameplay in new ways. This project exists solely out of <strong>deep admiration</strong> for the original developers, artists, designers, and visionaries who created one of the most influential online worlds of all time.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
We do not claim ownership of EverQuest or its assets. <strong>All credit and respect belong to the original creators and Daybreak Game Company</strong>, whose work continues to inspire generations of players and developers alike.
|
We do not claim ownership of the original game or its assets. <strong>All credit and respect belong to the original creators and Daybreak Game Company</strong>, whose work continues to inspire generations of players and developers alike.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
EQEmulator has for over 20 years and always will be a <strong>fan-based, non-commercial open-source effort</strong> made by players, for players—preserving the legacy of EverQuest while empowering community-driven creativity, learning and joy that the game and its creators has so strongly inspired in us all.
|
EQEmulator has for over 20 years and always will be a <strong>fan-based, non-commercial open-source effort</strong> made by players, for players—preserving the legacy of the game while empowering community-driven creativity, learning and joy that the game and its creators has so strongly inspired in us all.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
***
|
***
|
||||||
@@ -47,7 +47,7 @@ EQEmulator has for over 20 years and always will be a <strong>fan-based, non-com
|
|||||||
Technical Overview & Reverse Engineering Effort
|
Technical Overview & Reverse Engineering Effort
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<p align="center">EQEmulator represents <strong>over two decades of collaborative reverse engineering</strong>, rebuilding the EverQuest server from the ground up without access to the original source code. This effort was achieved entirely through <strong>community-driven analysis, network protocol decoding, and in-game behavioral research</strong>.</p>
|
<p align="center">EQEmulator represents <strong>over two decades of collaborative reverse engineering</strong>, building the server from the ground up without access to the original source code. This effort was achieved entirely through <strong>community-driven analysis, network protocol decoding, and in-game behavioral research</strong>.</p>
|
||||||
|
|
||||||
<h1 align="center">
|
<h1 align="center">
|
||||||
💡 How We Did It
|
💡 How We Did It
|
||||||
@@ -104,10 +104,10 @@ Every system, packet, opcode, and game mechanic has been reconstructed through c
|
|||||||
🚀 Why It Matters
|
🚀 Why It Matters
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<p align="center">🧬 EQEmulator stands as a <strong>technical preservation project</strong>, ensuring that the magic of classic and custom EverQuest servers lives on for future generations of players, tinkerers, and game designers.
|
<p align="center">🧬 EQEmulator stands as a <strong>technical preservation project</strong>, ensuring that the magic of classic and custom servers lives on for future generations of players, tinkerers, and game designers.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
> We humbly acknowledge and thank the original developers at **Verant Interactive** and **Sony Online Entertainment (now Daybreak Game Company)** for creating one of the most influential online experiences in gaming history.
|
> We humbly acknowledge and thank the original developers for creating one of the most influential online experiences in gaming history.
|
||||||
|
|
||||||
<h1 align="center">
|
<h1 align="center">
|
||||||
🧑💻🖥️ Supported Clients
|
🧑💻🖥️ Supported Clients
|
||||||
@@ -148,4 +148,3 @@ If you want to set up your own EQEmulator server, please refer to the current [s
|
|||||||
<a href="https://github.com/EQEmu/server/graphs/contributors">
|
<a href="https://github.com/EQEmu/server/graphs/contributors">
|
||||||
<img src="https://contributors-img.firebaseapp.com/image?repo=EQEmu/server" />
|
<img src="https://contributors-img.firebaseapp.com/image?repo=EQEmu/server" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,6 @@
|
|||||||
|
|
||||||
EQEmuLogSys LogSys;
|
EQEmuLogSys LogSys;
|
||||||
WorldContentService content_service;
|
WorldContentService content_service;
|
||||||
ZoneStore zone_store;
|
|
||||||
PlayerEventLogs player_event_logs;
|
PlayerEventLogs player_event_logs;
|
||||||
EvolvingItemsManager evolving_items_manager;
|
EvolvingItemsManager evolving_items_manager;
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,6 @@
|
|||||||
|
|
||||||
EQEmuLogSys LogSys;
|
EQEmuLogSys LogSys;
|
||||||
WorldContentService content_service;
|
WorldContentService content_service;
|
||||||
ZoneStore zone_store;
|
|
||||||
PlayerEventLogs player_event_logs;
|
PlayerEventLogs player_event_logs;
|
||||||
EvolvingItemsManager evolving_items_manager;
|
EvolvingItemsManager evolving_items_manager;
|
||||||
|
|
||||||
|
|||||||
@@ -842,7 +842,7 @@ IF (UNIX)
|
|||||||
ENDIF (UNIX)
|
ENDIF (UNIX)
|
||||||
|
|
||||||
IF (WIN32 AND EQEMU_BUILD_PCH)
|
IF (WIN32 AND EQEMU_BUILD_PCH)
|
||||||
TARGET_PRECOMPILE_HEADERS(common PRIVATE pch/pch.h)
|
TARGET_PRECOMPILE_HEADERS(common PRIVATE pch/std-pch.h)
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ void WorldContentService::ReloadContentFlags()
|
|||||||
|
|
||||||
SetContentFlags(set_content_flags);
|
SetContentFlags(set_content_flags);
|
||||||
LoadStaticGlobalZoneInstances();
|
LoadStaticGlobalZoneInstances();
|
||||||
zone_store.LoadZones(*m_content_database);
|
ZoneStore::Instance()->LoadZones(*m_content_database);
|
||||||
}
|
}
|
||||||
|
|
||||||
Database *WorldContentService::GetDatabase() const
|
Database *WorldContentService::GetDatabase() const
|
||||||
@@ -291,7 +291,7 @@ WorldContentService *WorldContentService::LoadStaticGlobalZoneInstances()
|
|||||||
// instance_list table entry for lavastorm has version = 1, is_global = 1, never_expires = 1
|
// instance_list table entry for lavastorm has version = 1, is_global = 1, never_expires = 1
|
||||||
WorldContentService::FindZoneResult WorldContentService::FindZone(uint32 zone_id, uint32 instance_id)
|
WorldContentService::FindZoneResult WorldContentService::FindZone(uint32 zone_id, uint32 instance_id)
|
||||||
{
|
{
|
||||||
for (const auto &z: zone_store.GetZones()) {
|
for (const auto &z: ZoneStore::Instance()->GetZones()) {
|
||||||
for (auto &i: m_zone_static_instances) {
|
for (auto &i: m_zone_static_instances) {
|
||||||
if (
|
if (
|
||||||
z.zoneidnumber == zone_id &&
|
z.zoneidnumber == zone_id &&
|
||||||
|
|||||||
+81
-7
@@ -19,6 +19,37 @@ extern WorldDatabase database;
|
|||||||
#error "You must define either ZONE or WORLD"
|
#error "You must define either ZONE or WORLD"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Key: compound cache key (e.g., account_id|character_id|zone_id|instance_id|top_key|full_key)
|
||||||
|
// Value: resolved DataBuckets with extracted nested value
|
||||||
|
static std::unordered_map<std::string, DataBucketsRepository::DataBuckets> g_nested_bucket_cache;
|
||||||
|
|
||||||
|
static std::string MakeNestedCacheKey(const DataBucketKey &k, const std::string &full_key) {
|
||||||
|
return fmt::format(
|
||||||
|
"account_id:{}|character_id:{}|npc_id:{}|bot_id:{}|zone_id:{}|instance_id:{}|top_key:{}|full_key:{}",
|
||||||
|
k.account_id, k.character_id, k.npc_id, k.bot_id, k.zone_id, k.instance_id,
|
||||||
|
Strings::Split(full_key, NESTED_KEY_DELIMITER).front(),
|
||||||
|
full_key
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string MakeNestedCacheKeyPrefix(const DataBucketKey &k, const std::string &top_key) {
|
||||||
|
return fmt::format(
|
||||||
|
"account_id:{}|character_id:{}|npc_id:{}|bot_id:{}|zone_id:{}|instance_id:{}|top_key:{}|",
|
||||||
|
k.account_id, k.character_id, k.npc_id, k.bot_id, k.zone_id, k.instance_id, top_key
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void InvalidateNestedCacheForKey(const DataBucketKey &k, const std::string &top_key) {
|
||||||
|
std::string prefix = MakeNestedCacheKeyPrefix(k, top_key);
|
||||||
|
for (auto it = g_nested_bucket_cache.begin(); it != g_nested_bucket_cache.end(); ) {
|
||||||
|
if (it->first.find(prefix) == 0) {
|
||||||
|
it = g_nested_bucket_cache.erase(it);
|
||||||
|
} else {
|
||||||
|
++it;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void DataBucket::SetData(const std::string &bucket_key, const std::string &bucket_value, std::string expires_time)
|
void DataBucket::SetData(const std::string &bucket_key, const std::string &bucket_value, std::string expires_time)
|
||||||
{
|
{
|
||||||
auto k = DataBucketKey{
|
auto k = DataBucketKey{
|
||||||
@@ -136,6 +167,15 @@ void DataBucket::SetData(const DataBucketKey &k_)
|
|||||||
// Serialize JSON back to string
|
// Serialize JSON back to string
|
||||||
b.value = json_value.dump();
|
b.value = json_value.dump();
|
||||||
b.key_ = top_key; // Use the top-level key
|
b.key_ = top_key; // Use the top-level key
|
||||||
|
|
||||||
|
if (CanCache(k_)) {
|
||||||
|
InvalidateNestedCacheForKey(k_, top_key);
|
||||||
|
std::string nested_cache_key = MakeNestedCacheKey(k_, k_.key);
|
||||||
|
auto extracted = ExtractNestedValue(b, k_.key);
|
||||||
|
if (extracted.id > 0) {
|
||||||
|
g_nested_bucket_cache[nested_cache_key] = extracted;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bucket_id) {
|
if (bucket_id) {
|
||||||
@@ -251,12 +291,27 @@ DataBucketsRepository::DataBuckets DataBucket::GetData(const DataBucketKey &k_,
|
|||||||
LogDataBuckets("Returning key [{}] value [{}] from cache", e.key_, e.value);
|
LogDataBuckets("Returning key [{}] value [{}] from cache", e.key_, e.value);
|
||||||
|
|
||||||
if (is_nested_key && !k_.key.empty()) {
|
if (is_nested_key && !k_.key.empty()) {
|
||||||
return ExtractNestedValue(e, k_.key);
|
std::string nested_cache_key = MakeNestedCacheKey(k_, k.key);
|
||||||
|
|
||||||
|
auto it = g_nested_bucket_cache.find(nested_cache_key);
|
||||||
|
if (it != g_nested_bucket_cache.end()) {
|
||||||
|
LogDataBucketsDetail("Nested cache hit for key [{}]", nested_cache_key);
|
||||||
|
return it->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto extracted = ExtractNestedValue(e, k_.key);
|
||||||
|
if (extracted.id > 0) {
|
||||||
|
g_nested_bucket_cache[nested_cache_key] = extracted;
|
||||||
|
}
|
||||||
|
return extracted;
|
||||||
}
|
}
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if we can cache its assumed we didn't load this into the cache so we should not return a miss
|
||||||
|
return DataBucketsRepository::NewEntity(); // Not found in cache
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetch the value from the database
|
// Fetch the value from the database
|
||||||
@@ -315,23 +370,42 @@ DataBucketsRepository::DataBuckets DataBucket::GetData(const DataBucketKey &k_,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add the value to the cache if it doesn't exist
|
// Add the value to the cache if it doesn't exist
|
||||||
|
// If cacheable and not found in cache, short-circuit and assume it doesn't exist
|
||||||
if (can_cache) {
|
if (can_cache) {
|
||||||
bool has_cache = false;
|
bool found_in_cache = false;
|
||||||
for (const auto &e : g_data_bucket_cache) {
|
for (const auto &e : g_data_bucket_cache) {
|
||||||
if (e.id == bucket.id) {
|
if (CheckBucketMatch(e, k)) {
|
||||||
has_cache = true;
|
found_in_cache = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!has_cache) {
|
if (!found_in_cache) {
|
||||||
g_data_bucket_cache.emplace_back(bucket);
|
LogDataBuckets("Cache miss for key [{}] - skipping DB due to CanCache", k.key);
|
||||||
|
return DataBucketsRepository::NewEntity();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle nested key extraction
|
// Handle nested key extraction
|
||||||
if (is_nested_key && !k_.key.empty()) {
|
if (is_nested_key && !k_.key.empty()) {
|
||||||
return ExtractNestedValue(bucket, k_.key);
|
if (CanCache(k_)) {
|
||||||
|
std::string nested_cache_key = MakeNestedCacheKey(k_, k.key);
|
||||||
|
|
||||||
|
auto it = g_nested_bucket_cache.find(nested_cache_key);
|
||||||
|
if (it != g_nested_bucket_cache.end()) {
|
||||||
|
LogDataBucketsDetail("Nested cache hit for key [{}]", nested_cache_key);
|
||||||
|
return it->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto extracted = ExtractNestedValue(bucket, k_.key);
|
||||||
|
if (extracted.id > 0) {
|
||||||
|
g_nested_bucket_cache[nested_cache_key] = extracted;
|
||||||
|
}
|
||||||
|
return extracted;
|
||||||
|
} else {
|
||||||
|
// Not cacheable, just extract and return
|
||||||
|
return ExtractNestedValue(bucket, k_.key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return bucket;
|
return bucket;
|
||||||
|
|||||||
@@ -708,6 +708,20 @@ const std::string Database::GetNPCNameByID(uint32 npc_id)
|
|||||||
return e.id ? e.name : std::string();
|
return e.id ? e.name : std::string();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename InputIterator, typename OutputIterator>
|
||||||
|
inline auto CleanMobName(InputIterator first, InputIterator last, OutputIterator result)
|
||||||
|
{
|
||||||
|
for (; first != last; ++first) {
|
||||||
|
if (*first == '_') {
|
||||||
|
*result = ' ';
|
||||||
|
}
|
||||||
|
else if (isalpha(*first) || *first == '`') {
|
||||||
|
*result = *first;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
const std::string Database::GetCleanNPCNameByID(uint32 npc_id)
|
const std::string Database::GetCleanNPCNameByID(uint32 npc_id)
|
||||||
{
|
{
|
||||||
const auto& e = NpcTypesRepository::FindOne(*this, npc_id);
|
const auto& e = NpcTypesRepository::FindOne(*this, npc_id);
|
||||||
|
|||||||
@@ -7109,6 +7109,18 @@ ALTER TABLE `npc_types`
|
|||||||
ALTER TABLE `character_data`
|
ALTER TABLE `character_data`
|
||||||
CHANGE COLUMN `firstlogon` `ingame` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 AFTER `xtargets`,
|
CHANGE COLUMN `firstlogon` `ingame` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 AFTER `xtargets`,
|
||||||
ADD COLUMN `first_login` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `xtargets`;
|
ADD COLUMN `first_login` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `xtargets`;
|
||||||
|
)",
|
||||||
|
.content_schema_update = false
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9324,
|
||||||
|
.description = "2025_06_11_player_event_logs_table.sql",
|
||||||
|
.check = "SHOW CREATE TABLE `player_event_logs`",
|
||||||
|
.condition = "missing",
|
||||||
|
.match = "COMPRESS",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE player_event_logs ROW_FORMAT=COMPRESSED;
|
||||||
|
CREATE INDEX idx_event_type_char_id ON player_event_logs (event_type_id, character_id);
|
||||||
)",
|
)",
|
||||||
.content_schema_update = false
|
.content_schema_update = false
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -716,7 +716,7 @@ std::string PlayerEventDiscordFormatter::FormatNPCHandinEvent(
|
|||||||
);
|
);
|
||||||
|
|
||||||
for (int i = 0; i < h.augment_ids.size(); i++) {
|
for (int i = 0; i < h.augment_ids.size(); i++) {
|
||||||
if (!Strings::EqualFold(h.augment_names[i], "None")) {
|
if (!h.augment_names[i].empty()) {
|
||||||
const uint8 slot_id = (i + 1);
|
const uint8 slot_id = (i + 1);
|
||||||
handin_items_info += fmt::format(
|
handin_items_info += fmt::format(
|
||||||
"Augment {}: {} ({})\n",
|
"Augment {}: {} ({})\n",
|
||||||
@@ -741,7 +741,7 @@ std::string PlayerEventDiscordFormatter::FormatNPCHandinEvent(
|
|||||||
);
|
);
|
||||||
|
|
||||||
for (int i = 0; i < r.augment_ids.size(); i++) {
|
for (int i = 0; i < r.augment_ids.size(); i++) {
|
||||||
if (!Strings::EqualFold(r.augment_names[i], "None")) {
|
if (!r.augment_names[i].empty()) {
|
||||||
const uint8 slot_id = (i + 1);
|
const uint8 slot_id = (i + 1);
|
||||||
return_items_info += fmt::format(
|
return_items_info += fmt::format(
|
||||||
"Augment {}: {} ({})\n",
|
"Augment {}: {} ({})\n",
|
||||||
|
|||||||
@@ -195,10 +195,12 @@ void PlayerEventLogs::ProcessBatchQueue()
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Helper to assign ETL table ID
|
// Helper to assign ETL table ID
|
||||||
auto AssignEtlId = [&](
|
|
||||||
PlayerEventLogsRepository::PlayerEventLogs &r,
|
auto AssignEtlId = [&](
|
||||||
PlayerEvent::EventType type
|
PlayerEventLogsRepository::PlayerEventLogs& r,
|
||||||
) {
|
PlayerEvent::EventType type
|
||||||
|
)
|
||||||
|
{
|
||||||
if (m_etl_settings.contains(type)) {
|
if (m_etl_settings.contains(type)) {
|
||||||
r.etl_table_id = m_etl_settings.at(type).next_id++;
|
r.etl_table_id = m_etl_settings.at(type).next_id++;
|
||||||
}
|
}
|
||||||
@@ -406,7 +408,6 @@ void PlayerEventLogs::ProcessBatchQueue()
|
|||||||
auto it = event_processors.find(static_cast<PlayerEvent::EventType>(r.event_type_id));
|
auto it = event_processors.find(static_cast<PlayerEvent::EventType>(r.event_type_id));
|
||||||
if (it != event_processors.end()) {
|
if (it != event_processors.end()) {
|
||||||
it->second(r); // Call the appropriate lambda
|
it->second(r); // Call the appropriate lambda
|
||||||
r.event_data = "{}"; // Clear event data
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LogPlayerEventsDetail("Non-Implemented ETL routing [{}]", r.event_type_id);
|
LogPlayerEventsDetail("Non-Implemented ETL routing [{}]", r.event_type_id);
|
||||||
@@ -535,6 +536,20 @@ std::string PlayerEventLogs::GetDiscordWebhookUrlFromEventType(int32_t event_typ
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PlayerEventLogs::LoadPlayerEventSettingsFromQS(
|
||||||
|
const std::vector<PlayerEventLogSettingsRepository::PlayerEventLogSettings> &settings
|
||||||
|
)
|
||||||
|
{
|
||||||
|
for (const auto &e : settings) {
|
||||||
|
if (e.id >= PlayerEvent::MAX || e.id < 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
m_settings[e.id] = e;
|
||||||
|
}
|
||||||
|
|
||||||
|
LogInfo("Applied [{}] player event log settings from QS", settings.size());
|
||||||
|
}
|
||||||
|
|
||||||
// GM_COMMAND | [x] Implemented Formatter
|
// GM_COMMAND | [x] Implemented Formatter
|
||||||
// ZONING | [x] Implemented Formatter
|
// ZONING | [x] Implemented Formatter
|
||||||
// AA_GAIN | [x] Implemented Formatter
|
// AA_GAIN | [x] Implemented Formatter
|
||||||
|
|||||||
@@ -73,9 +73,11 @@ public:
|
|||||||
return BuildPlayerEventPacket(c);
|
return BuildPlayerEventPacket(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] const PlayerEventLogSettingsRepository::PlayerEventLogSettings *GetSettings() const;
|
[[nodiscard]] const PlayerEventLogSettingsRepository::PlayerEventLogSettings * GetSettings() const;
|
||||||
bool IsEventDiscordEnabled(int32_t event_type_id);
|
bool IsEventDiscordEnabled(int32_t event_type_id);
|
||||||
std::string GetDiscordWebhookUrlFromEventType(int32_t event_type_id);
|
std::string GetDiscordWebhookUrlFromEventType(int32_t event_type_id);
|
||||||
|
|
||||||
|
void LoadPlayerEventSettingsFromQS(const std::vector<PlayerEventLogSettingsRepository::PlayerEventLogSettings>& settings);
|
||||||
|
|
||||||
static std::string GetDiscordPayloadFromEvent(const PlayerEvent::PlayerEventContainer &e);
|
static std::string GetDiscordPayloadFromEvent(const PlayerEvent::PlayerEventContainer &e);
|
||||||
|
|
||||||
|
|||||||
+547
-114
@@ -7,8 +7,16 @@
|
|||||||
#include "../rulesys.h"
|
#include "../rulesys.h"
|
||||||
#include "../repositories/player_event_logs_repository.h"
|
#include "../repositories/player_event_logs_repository.h"
|
||||||
|
|
||||||
namespace PlayerEvent {
|
#define CEREAL_NVP_IF_NONZERO(ar, name) \
|
||||||
|
if ((name) != 0) ar(cereal::make_nvp(#name, name))
|
||||||
|
|
||||||
|
#define CEREAL_NVP_IF_NOT_EMPTY(ar, name) \
|
||||||
|
if (!(name).empty()) ar(cereal::make_nvp(#name, name))
|
||||||
|
|
||||||
|
#define CEREAL_NVP_IF_TRUE(ar, name) \
|
||||||
|
if ((name)) ar(cereal::make_nvp(#name, name))
|
||||||
|
|
||||||
|
namespace PlayerEvent {
|
||||||
enum EventType {
|
enum EventType {
|
||||||
GM_COMMAND = 1,
|
GM_COMMAND = 1,
|
||||||
ZONING,
|
ZONING,
|
||||||
@@ -26,10 +34,10 @@ namespace PlayerEvent {
|
|||||||
LOOT_ITEM,
|
LOOT_ITEM,
|
||||||
MERCHANT_PURCHASE,
|
MERCHANT_PURCHASE,
|
||||||
MERCHANT_SELL,
|
MERCHANT_SELL,
|
||||||
GROUP_JOIN, // unimplemented
|
GROUP_JOIN, // unimplemented
|
||||||
GROUP_LEAVE, // unimplemented
|
GROUP_LEAVE, // unimplemented
|
||||||
RAID_JOIN, // unimplemented
|
RAID_JOIN, // unimplemented
|
||||||
RAID_LEAVE, // unimplemented
|
RAID_LEAVE, // unimplemented
|
||||||
GROUNDSPAWN_PICKUP,
|
GROUNDSPAWN_PICKUP,
|
||||||
NPC_HANDIN,
|
NPC_HANDIN,
|
||||||
SKILL_UP,
|
SKILL_UP,
|
||||||
@@ -45,12 +53,12 @@ namespace PlayerEvent {
|
|||||||
COMBINE_SUCCESS,
|
COMBINE_SUCCESS,
|
||||||
DROPPED_ITEM,
|
DROPPED_ITEM,
|
||||||
SPLIT_MONEY,
|
SPLIT_MONEY,
|
||||||
DZ_JOIN, // unimplemented
|
DZ_JOIN, // unimplemented
|
||||||
DZ_LEAVE, // unimplemented
|
DZ_LEAVE, // unimplemented
|
||||||
TRADER_PURCHASE,
|
TRADER_PURCHASE,
|
||||||
TRADER_SELL,
|
TRADER_SELL,
|
||||||
BANDOLIER_CREATE, // unimplemented
|
BANDOLIER_CREATE, // unimplemented
|
||||||
BANDOLIER_SWAP, // unimplemented
|
BANDOLIER_SWAP, // unimplemented
|
||||||
DISCOVER_ITEM,
|
DISCOVER_ITEM,
|
||||||
POSSIBLE_HACK,
|
POSSIBLE_HACK,
|
||||||
KILLED_NPC,
|
KILLED_NPC,
|
||||||
@@ -76,7 +84,7 @@ namespace PlayerEvent {
|
|||||||
// If event is unimplemented just tag (Unimplemented) in the name
|
// If event is unimplemented just tag (Unimplemented) in the name
|
||||||
// Events don't get saved to the database if unimplemented or deprecated
|
// Events don't get saved to the database if unimplemented or deprecated
|
||||||
// Events tagged as deprecated will get automatically removed
|
// Events tagged as deprecated will get automatically removed
|
||||||
static const char *EventName[EventType::MAX] = {
|
static const char* EventName[EventType::MAX] = {
|
||||||
"None",
|
"None",
|
||||||
"GM Command",
|
"GM Command",
|
||||||
"Zoning",
|
"Zoning",
|
||||||
@@ -156,8 +164,8 @@ namespace PlayerEvent {
|
|||||||
float heading;
|
float heading;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(account_id),
|
CEREAL_NVP(account_id),
|
||||||
@@ -185,8 +193,8 @@ namespace PlayerEvent {
|
|||||||
PlayerEventLogsRepository::PlayerEventLogs player_event_log;
|
PlayerEventLogsRepository::PlayerEventLogs player_event_log;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(player_event),
|
CEREAL_NVP(player_event),
|
||||||
@@ -200,8 +208,8 @@ namespace PlayerEvent {
|
|||||||
std::string noop; // noop, gets discard upstream
|
std::string noop; // noop, gets discard upstream
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(noop)
|
CEREAL_NVP(noop)
|
||||||
@@ -224,8 +232,38 @@ namespace PlayerEvent {
|
|||||||
bool attuned;
|
bool attuned;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
|
{
|
||||||
|
if constexpr (Archive::is_saving::value) {
|
||||||
|
save(ar);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
load(ar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void save(Archive& ar) const
|
||||||
|
{
|
||||||
|
ar(
|
||||||
|
CEREAL_NVP(item_id),
|
||||||
|
CEREAL_NVP(item_name),
|
||||||
|
CEREAL_NVP(to_slot),
|
||||||
|
CEREAL_NVP(charges)
|
||||||
|
);
|
||||||
|
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
|
||||||
|
CEREAL_NVP_IF_TRUE(ar, attuned);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void load(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(item_id),
|
CEREAL_NVP(item_id),
|
||||||
@@ -284,8 +322,37 @@ namespace PlayerEvent {
|
|||||||
|
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void save(Archive& ar) const
|
||||||
|
{
|
||||||
|
ar(
|
||||||
|
CEREAL_NVP(slot),
|
||||||
|
CEREAL_NVP(item_id)
|
||||||
|
);
|
||||||
|
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
|
||||||
|
CEREAL_NVP_IF_NOT_EMPTY(ar, augment_1_name);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
|
||||||
|
CEREAL_NVP_IF_NOT_EMPTY(ar, augment_2_name);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
|
||||||
|
CEREAL_NVP_IF_NOT_EMPTY(ar, augment_3_name);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
|
||||||
|
CEREAL_NVP_IF_NOT_EMPTY(ar, augment_4_name);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
|
||||||
|
CEREAL_NVP_IF_NOT_EMPTY(ar, augment_5_name);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
|
||||||
|
CEREAL_NVP_IF_NOT_EMPTY(ar, augment_6_name);
|
||||||
|
|
||||||
|
ar(
|
||||||
|
CEREAL_NVP(item_name),
|
||||||
|
CEREAL_NVP(charges)
|
||||||
|
);
|
||||||
|
|
||||||
|
CEREAL_NVP_IF_TRUE(ar, in_bag);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void load(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(slot),
|
CEREAL_NVP(slot),
|
||||||
@@ -295,7 +362,7 @@ namespace PlayerEvent {
|
|||||||
CEREAL_NVP(augment_2_id),
|
CEREAL_NVP(augment_2_id),
|
||||||
CEREAL_NVP(augment_2_name),
|
CEREAL_NVP(augment_2_name),
|
||||||
CEREAL_NVP(augment_3_id),
|
CEREAL_NVP(augment_3_id),
|
||||||
CEREAL_NVP(augment_1_name),
|
CEREAL_NVP(augment_3_name),
|
||||||
CEREAL_NVP(augment_4_id),
|
CEREAL_NVP(augment_4_id),
|
||||||
CEREAL_NVP(augment_4_name),
|
CEREAL_NVP(augment_4_name),
|
||||||
CEREAL_NVP(augment_5_id),
|
CEREAL_NVP(augment_5_id),
|
||||||
@@ -319,8 +386,8 @@ namespace PlayerEvent {
|
|||||||
int32 copper;
|
int32 copper;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(platinum),
|
CEREAL_NVP(platinum),
|
||||||
@@ -342,8 +409,8 @@ namespace PlayerEvent {
|
|||||||
std::vector<TradeItemEntry> character_2_give_items;
|
std::vector<TradeItemEntry> character_2_give_items;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(character_1_id),
|
CEREAL_NVP(character_1_id),
|
||||||
@@ -363,8 +430,8 @@ namespace PlayerEvent {
|
|||||||
std::string target;
|
std::string target;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(message),
|
CEREAL_NVP(message),
|
||||||
@@ -386,8 +453,8 @@ namespace PlayerEvent {
|
|||||||
int32 to_instance_version;
|
int32 to_instance_version;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(from_zone_long_name),
|
CEREAL_NVP(from_zone_long_name),
|
||||||
@@ -408,8 +475,8 @@ namespace PlayerEvent {
|
|||||||
uint32 aa_gained;
|
uint32 aa_gained;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(CEREAL_NVP(aa_gained));
|
ar(CEREAL_NVP(aa_gained));
|
||||||
}
|
}
|
||||||
@@ -422,8 +489,8 @@ namespace PlayerEvent {
|
|||||||
int32 aa_next_id;
|
int32 aa_next_id;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(aa_id),
|
CEREAL_NVP(aa_id),
|
||||||
@@ -444,9 +511,34 @@ namespace PlayerEvent {
|
|||||||
uint32 augment_6_id;
|
uint32 augment_6_id;
|
||||||
std::string item_name;
|
std::string item_name;
|
||||||
|
|
||||||
// cereal
|
template <class Archive>
|
||||||
template<class Archive>
|
void serialize(Archive& ar)
|
||||||
void serialize(Archive &ar)
|
{
|
||||||
|
if constexpr (Archive::is_saving::value) {
|
||||||
|
save(ar);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
load(ar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void save(Archive& ar) const
|
||||||
|
{
|
||||||
|
ar(CEREAL_NVP(item_id));
|
||||||
|
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
|
||||||
|
|
||||||
|
ar(CEREAL_NVP(item_name));
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void load(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(item_id),
|
CEREAL_NVP(item_id),
|
||||||
@@ -471,9 +563,34 @@ namespace PlayerEvent {
|
|||||||
uint32 augment_6_id;
|
uint32 augment_6_id;
|
||||||
std::string item_name;
|
std::string item_name;
|
||||||
|
|
||||||
// cereal
|
template <class Archive>
|
||||||
template<class Archive>
|
void serialize(Archive& ar)
|
||||||
void serialize(Archive &ar)
|
{
|
||||||
|
if constexpr (Archive::is_saving::value) {
|
||||||
|
save(ar);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
load(ar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void save(Archive& ar) const
|
||||||
|
{
|
||||||
|
ar(CEREAL_NVP(item_id));
|
||||||
|
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
|
||||||
|
|
||||||
|
ar(CEREAL_NVP(item_name));
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void load(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(item_id),
|
CEREAL_NVP(item_id),
|
||||||
@@ -501,9 +618,41 @@ namespace PlayerEvent {
|
|||||||
bool attuned;
|
bool attuned;
|
||||||
std::string reason;
|
std::string reason;
|
||||||
|
|
||||||
// cereal
|
template <class Archive>
|
||||||
template<class Archive>
|
void serialize(Archive& ar)
|
||||||
void serialize(Archive &ar)
|
{
|
||||||
|
if constexpr (Archive::is_saving::value) {
|
||||||
|
save(ar);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
load(ar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void save(Archive& ar) const
|
||||||
|
{
|
||||||
|
ar(
|
||||||
|
CEREAL_NVP(item_id),
|
||||||
|
CEREAL_NVP(item_name),
|
||||||
|
CEREAL_NVP(charges)
|
||||||
|
);
|
||||||
|
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
|
||||||
|
|
||||||
|
ar(
|
||||||
|
CEREAL_NVP(attuned),
|
||||||
|
CEREAL_NVP(reason)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void load(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(item_id),
|
CEREAL_NVP(item_id),
|
||||||
@@ -521,14 +670,15 @@ namespace PlayerEvent {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct LevelGainedEvent {
|
struct LevelGainedEvent {
|
||||||
uint32 from_level;
|
uint32 from_level;
|
||||||
uint8 to_level;
|
uint8 to_level;
|
||||||
int levels_gained;
|
int levels_gained;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(from_level),
|
CEREAL_NVP(from_level),
|
||||||
@@ -544,8 +694,8 @@ namespace PlayerEvent {
|
|||||||
int levels_lost;
|
int levels_lost;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(from_level),
|
CEREAL_NVP(from_level),
|
||||||
@@ -569,8 +719,41 @@ namespace PlayerEvent {
|
|||||||
std::string corpse_name;
|
std::string corpse_name;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
|
{
|
||||||
|
if constexpr (Archive::is_saving::value) {
|
||||||
|
save(ar);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
load(ar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void save(Archive& ar) const
|
||||||
|
{
|
||||||
|
ar(
|
||||||
|
CEREAL_NVP(item_id),
|
||||||
|
CEREAL_NVP(item_name),
|
||||||
|
CEREAL_NVP(charges)
|
||||||
|
);
|
||||||
|
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
|
||||||
|
|
||||||
|
ar(
|
||||||
|
CEREAL_NVP(npc_id),
|
||||||
|
CEREAL_NVP(corpse_name)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void load(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(item_id),
|
CEREAL_NVP(item_id),
|
||||||
@@ -601,8 +784,8 @@ namespace PlayerEvent {
|
|||||||
uint64 player_currency_balance;
|
uint64 player_currency_balance;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(npc_id),
|
CEREAL_NVP(npc_id),
|
||||||
@@ -632,8 +815,8 @@ namespace PlayerEvent {
|
|||||||
uint64 player_currency_balance;
|
uint64 player_currency_balance;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(npc_id),
|
CEREAL_NVP(npc_id),
|
||||||
@@ -657,8 +840,8 @@ namespace PlayerEvent {
|
|||||||
std::string against_who;
|
std::string against_who;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(skill_id),
|
CEREAL_NVP(skill_id),
|
||||||
@@ -676,8 +859,8 @@ namespace PlayerEvent {
|
|||||||
std::string task_name;
|
std::string task_name;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(npc_id),
|
CEREAL_NVP(npc_id),
|
||||||
@@ -695,8 +878,8 @@ namespace PlayerEvent {
|
|||||||
uint32 done_count;
|
uint32 done_count;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(task_id),
|
CEREAL_NVP(task_id),
|
||||||
@@ -714,8 +897,8 @@ namespace PlayerEvent {
|
|||||||
uint32 done_count;
|
uint32 done_count;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(task_id),
|
CEREAL_NVP(task_id),
|
||||||
@@ -731,8 +914,8 @@ namespace PlayerEvent {
|
|||||||
std::string item_name;
|
std::string item_name;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(item_id),
|
CEREAL_NVP(item_id),
|
||||||
@@ -746,8 +929,8 @@ namespace PlayerEvent {
|
|||||||
std::string target;
|
std::string target;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(message),
|
CEREAL_NVP(message),
|
||||||
@@ -762,8 +945,8 @@ namespace PlayerEvent {
|
|||||||
uint32 spell_id;
|
uint32 spell_id;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(resurrecter_name),
|
CEREAL_NVP(resurrecter_name),
|
||||||
@@ -780,8 +963,8 @@ namespace PlayerEvent {
|
|||||||
uint32 tradeskill_id;
|
uint32 tradeskill_id;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(recipe_id),
|
CEREAL_NVP(recipe_id),
|
||||||
@@ -805,8 +988,38 @@ namespace PlayerEvent {
|
|||||||
uint32 charges;
|
uint32 charges;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
|
{
|
||||||
|
if constexpr (Archive::is_saving::value) {
|
||||||
|
save(ar);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
load(ar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void save(Archive& ar) const
|
||||||
|
{
|
||||||
|
ar(CEREAL_NVP(item_id));
|
||||||
|
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
|
||||||
|
|
||||||
|
ar(
|
||||||
|
CEREAL_NVP(item_name),
|
||||||
|
CEREAL_NVP(slot_id),
|
||||||
|
CEREAL_NVP(charges)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void load(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(item_id),
|
CEREAL_NVP(item_id),
|
||||||
@@ -833,8 +1046,8 @@ namespace PlayerEvent {
|
|||||||
std::string skill_name;
|
std::string skill_name;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(killer_id),
|
CEREAL_NVP(killer_id),
|
||||||
@@ -856,8 +1069,8 @@ namespace PlayerEvent {
|
|||||||
uint64 player_money_balance;
|
uint64 player_money_balance;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(copper),
|
CEREAL_NVP(copper),
|
||||||
@@ -886,10 +1099,44 @@ namespace PlayerEvent {
|
|||||||
uint64 total_cost;
|
uint64 total_cost;
|
||||||
uint64 player_money_balance;
|
uint64 player_money_balance;
|
||||||
|
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
|
{
|
||||||
|
if constexpr (Archive::is_saving::value) {
|
||||||
|
save(ar);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
load(ar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void save(Archive& ar) const
|
||||||
|
{
|
||||||
|
ar(CEREAL_NVP(item_id));
|
||||||
|
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
|
||||||
|
|
||||||
|
ar(
|
||||||
|
CEREAL_NVP(item_name),
|
||||||
|
CEREAL_NVP(trader_id),
|
||||||
|
CEREAL_NVP(trader_name),
|
||||||
|
CEREAL_NVP(price),
|
||||||
|
CEREAL_NVP(quantity),
|
||||||
|
CEREAL_NVP(charges),
|
||||||
|
CEREAL_NVP(total_cost),
|
||||||
|
CEREAL_NVP(player_money_balance)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void load(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(item_id),
|
CEREAL_NVP(item_id),
|
||||||
@@ -928,10 +1175,43 @@ namespace PlayerEvent {
|
|||||||
uint64 total_cost;
|
uint64 total_cost;
|
||||||
uint64 player_money_balance;
|
uint64 player_money_balance;
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void serialize(Archive& ar)
|
||||||
|
{
|
||||||
|
if constexpr (Archive::is_saving::value) {
|
||||||
|
save(ar);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
load(ar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// cereal
|
template <class Archive>
|
||||||
template<class Archive>
|
void save(Archive& ar) const
|
||||||
void serialize(Archive &ar)
|
{
|
||||||
|
ar(CEREAL_NVP(item_id));
|
||||||
|
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
|
||||||
|
|
||||||
|
ar(
|
||||||
|
CEREAL_NVP(item_name),
|
||||||
|
CEREAL_NVP(buyer_id),
|
||||||
|
CEREAL_NVP(buyer_name),
|
||||||
|
CEREAL_NVP(price),
|
||||||
|
CEREAL_NVP(quantity),
|
||||||
|
CEREAL_NVP(charges),
|
||||||
|
CEREAL_NVP(total_cost),
|
||||||
|
CEREAL_NVP(player_money_balance)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void load(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(item_id),
|
CEREAL_NVP(item_id),
|
||||||
@@ -958,8 +1238,8 @@ namespace PlayerEvent {
|
|||||||
std::string item_name;
|
std::string item_name;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(item_id),
|
CEREAL_NVP(item_id),
|
||||||
@@ -978,8 +1258,8 @@ namespace PlayerEvent {
|
|||||||
bool attuned;
|
bool attuned;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(item_id),
|
CEREAL_NVP(item_id),
|
||||||
@@ -1000,8 +1280,8 @@ namespace PlayerEvent {
|
|||||||
uint32 platinum;
|
uint32 platinum;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(copper),
|
CEREAL_NVP(copper),
|
||||||
@@ -1022,8 +1302,8 @@ namespace PlayerEvent {
|
|||||||
bool is_quest_handin;
|
bool is_quest_handin;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(npc_id),
|
CEREAL_NVP(npc_id),
|
||||||
@@ -1041,8 +1321,8 @@ namespace PlayerEvent {
|
|||||||
std::string message;
|
std::string message;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(message)
|
CEREAL_NVP(message)
|
||||||
@@ -1058,8 +1338,8 @@ namespace PlayerEvent {
|
|||||||
uint64 total_heal_per_second_taken;
|
uint64 total_heal_per_second_taken;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(npc_id),
|
CEREAL_NVP(npc_id),
|
||||||
@@ -1083,9 +1363,36 @@ namespace PlayerEvent {
|
|||||||
bool attuned;
|
bool attuned;
|
||||||
uint32 guild_favor;
|
uint32 guild_favor;
|
||||||
|
|
||||||
// cereal
|
template <class Archive>
|
||||||
template<class Archive>
|
void serialize(Archive& ar)
|
||||||
void serialize(Archive &ar)
|
{
|
||||||
|
if constexpr (Archive::is_saving::value) {
|
||||||
|
save(ar);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
load(ar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void save(Archive& ar) const
|
||||||
|
{
|
||||||
|
ar(CEREAL_NVP(item_id));
|
||||||
|
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, charges);
|
||||||
|
CEREAL_NVP_IF_TRUE(ar, attuned);
|
||||||
|
|
||||||
|
ar(CEREAL_NVP(guild_favor));
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void load(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(item_id),
|
CEREAL_NVP(item_id),
|
||||||
@@ -1095,6 +1402,8 @@ namespace PlayerEvent {
|
|||||||
CEREAL_NVP(augment_4_id),
|
CEREAL_NVP(augment_4_id),
|
||||||
CEREAL_NVP(augment_5_id),
|
CEREAL_NVP(augment_5_id),
|
||||||
CEREAL_NVP(augment_6_id),
|
CEREAL_NVP(augment_6_id),
|
||||||
|
CEREAL_NVP(charges),
|
||||||
|
CEREAL_NVP(attuned),
|
||||||
CEREAL_NVP(guild_favor)
|
CEREAL_NVP(guild_favor)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1105,8 +1414,8 @@ namespace PlayerEvent {
|
|||||||
uint32 guild_favor;
|
uint32 guild_favor;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(plat),
|
CEREAL_NVP(plat),
|
||||||
@@ -1127,9 +1436,38 @@ namespace PlayerEvent {
|
|||||||
std::string from_player_name;
|
std::string from_player_name;
|
||||||
uint32 sent_date;
|
uint32 sent_date;
|
||||||
|
|
||||||
// cereal
|
template <class Archive>
|
||||||
template<class Archive>
|
void serialize(Archive& ar)
|
||||||
void serialize(Archive &ar)
|
{
|
||||||
|
if constexpr (Archive::is_saving::value) {
|
||||||
|
save(ar);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
load(ar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void save(Archive& ar) const
|
||||||
|
{
|
||||||
|
ar(CEREAL_NVP(item_id));
|
||||||
|
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
|
||||||
|
|
||||||
|
ar(
|
||||||
|
CEREAL_NVP(quantity),
|
||||||
|
CEREAL_NVP(from_player_name),
|
||||||
|
CEREAL_NVP(sent_date)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void load(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(item_id),
|
CEREAL_NVP(item_id),
|
||||||
@@ -1160,9 +1498,40 @@ namespace PlayerEvent {
|
|||||||
std::string to_player_name;
|
std::string to_player_name;
|
||||||
uint32 sent_date;
|
uint32 sent_date;
|
||||||
|
|
||||||
// cereal
|
template <class Archive>
|
||||||
template<class Archive>
|
void serialize(Archive& ar)
|
||||||
void serialize(Archive &ar)
|
{
|
||||||
|
if constexpr (Archive::is_saving::value) {
|
||||||
|
save(ar);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
load(ar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void save(Archive& ar) const
|
||||||
|
{
|
||||||
|
ar(CEREAL_NVP(item_id));
|
||||||
|
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, charges);
|
||||||
|
|
||||||
|
ar(
|
||||||
|
CEREAL_NVP(quantity),
|
||||||
|
CEREAL_NVP(from_player_name),
|
||||||
|
CEREAL_NVP(to_player_name),
|
||||||
|
CEREAL_NVP(sent_date)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void load(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(item_id),
|
CEREAL_NVP(item_id),
|
||||||
@@ -1195,9 +1564,40 @@ namespace PlayerEvent {
|
|||||||
std::string from_name;
|
std::string from_name;
|
||||||
std::string note;
|
std::string note;
|
||||||
|
|
||||||
// cereal
|
template <class Archive>
|
||||||
template<class Archive>
|
void serialize(Archive& ar)
|
||||||
void serialize(Archive &ar)
|
{
|
||||||
|
if constexpr (Archive::is_saving::value) {
|
||||||
|
save(ar);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
load(ar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void save(Archive& ar) const
|
||||||
|
{
|
||||||
|
ar(CEREAL_NVP(item_id));
|
||||||
|
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
|
||||||
|
|
||||||
|
ar(
|
||||||
|
CEREAL_NVP(quantity),
|
||||||
|
CEREAL_NVP(char_id),
|
||||||
|
CEREAL_NVP(from_name),
|
||||||
|
CEREAL_NVP(note),
|
||||||
|
CEREAL_NVP(sent_date)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void load(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(item_id),
|
CEREAL_NVP(item_id),
|
||||||
@@ -1226,8 +1626,8 @@ namespace PlayerEvent {
|
|||||||
std::string seller_name;
|
std::string seller_name;
|
||||||
uint64 total_cost;
|
uint64 total_cost;
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(status),
|
CEREAL_NVP(status),
|
||||||
@@ -1251,8 +1651,8 @@ namespace PlayerEvent {
|
|||||||
double progression;
|
double progression;
|
||||||
|
|
||||||
// cereal
|
// cereal
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(status),
|
CEREAL_NVP(status),
|
||||||
@@ -1273,8 +1673,8 @@ namespace PlayerEvent {
|
|||||||
uint32 type;
|
uint32 type;
|
||||||
std::string message;
|
std::string message;
|
||||||
|
|
||||||
template<class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(to),
|
CEREAL_NVP(to),
|
||||||
@@ -1300,9 +1700,41 @@ namespace PlayerEvent {
|
|||||||
uint32 quantity;
|
uint32 quantity;
|
||||||
uint32 permission;
|
uint32 permission;
|
||||||
|
|
||||||
// cereal
|
template <class Archive>
|
||||||
template<class Archive>
|
void serialize(Archive& ar)
|
||||||
void serialize(Archive &ar)
|
{
|
||||||
|
if constexpr (Archive::is_saving::value) {
|
||||||
|
save(ar);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
load(ar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void save(Archive& ar) const
|
||||||
|
{
|
||||||
|
ar(
|
||||||
|
CEREAL_NVP(char_id),
|
||||||
|
CEREAL_NVP(guild_id),
|
||||||
|
CEREAL_NVP(item_id)
|
||||||
|
);
|
||||||
|
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, aug_slot_one);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, aug_slot_two);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, aug_slot_three);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, aug_slot_four);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, aug_slot_five);
|
||||||
|
CEREAL_NVP_IF_NONZERO(ar, aug_slot_six);
|
||||||
|
|
||||||
|
ar(
|
||||||
|
CEREAL_NVP(quantity),
|
||||||
|
CEREAL_NVP(permission)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void load(Archive& ar)
|
||||||
{
|
{
|
||||||
ar(
|
ar(
|
||||||
CEREAL_NVP(char_id),
|
CEREAL_NVP(char_id),
|
||||||
@@ -1314,8 +1746,9 @@ namespace PlayerEvent {
|
|||||||
CEREAL_NVP(aug_slot_four),
|
CEREAL_NVP(aug_slot_four),
|
||||||
CEREAL_NVP(aug_slot_five),
|
CEREAL_NVP(aug_slot_five),
|
||||||
CEREAL_NVP(aug_slot_six),
|
CEREAL_NVP(aug_slot_six),
|
||||||
CEREAL_NVP(quantity)
|
CEREAL_NVP(quantity),
|
||||||
);
|
CEREAL_NVP(permission)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1799,7 +1799,7 @@ std::vector<std::string> EQ::ItemInstance::GetAugmentNames() const
|
|||||||
|
|
||||||
for (uint8 slot_id = invaug::SOCKET_BEGIN; slot_id <= invaug::SOCKET_END; slot_id++) {
|
for (uint8 slot_id = invaug::SOCKET_BEGIN; slot_id <= invaug::SOCKET_END; slot_id++) {
|
||||||
const auto augment = GetAugment(slot_id);
|
const auto augment = GetAugment(slot_id);
|
||||||
augment_names.push_back(augment ? augment->GetItem()->Name : "None");
|
augment_names.push_back(augment ? augment->GetItem()->Name : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
return augment_names;
|
return augment_names;
|
||||||
|
|||||||
+11
-11
@@ -3966,12 +3966,12 @@ namespace SoD
|
|||||||
SoDSlot = serverSlot - 2;
|
SoDSlot = serverSlot - 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot <= EQ::invbag::GENERAL_BAGS_8_END && serverSlot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
else if (serverSlot <= EQ::invbag::GENERAL_BAGS_END && serverSlot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
||||||
SoDSlot = serverSlot + 11;
|
SoDSlot = serverSlot - (EQ::invbag::GENERAL_BAGS_BEGIN - invbag::GENERAL_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((serverSlot - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot <= EQ::invbag::CURSOR_BAG_END && serverSlot >= EQ::invbag::CURSOR_BAG_BEGIN) {
|
else if (serverSlot <= EQ::invbag::CURSOR_BAG_END && serverSlot >= EQ::invbag::CURSOR_BAG_BEGIN) {
|
||||||
SoDSlot = serverSlot - 9;
|
SoDSlot = serverSlot - (EQ::invbag::CURSOR_BAG_BEGIN - invbag::CURSOR_BAG_BEGIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot <= EQ::invslot::TRIBUTE_END && serverSlot >= EQ::invslot::TRIBUTE_BEGIN) {
|
else if (serverSlot <= EQ::invslot::TRIBUTE_END && serverSlot >= EQ::invslot::TRIBUTE_BEGIN) {
|
||||||
@@ -3991,7 +3991,7 @@ namespace SoD
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot <= EQ::invbag::BANK_BAGS_END && serverSlot >= EQ::invbag::BANK_BAGS_BEGIN) {
|
else if (serverSlot <= EQ::invbag::BANK_BAGS_END && serverSlot >= EQ::invbag::BANK_BAGS_BEGIN) {
|
||||||
SoDSlot = serverSlot + 1;
|
SoDSlot = serverSlot - (EQ::invbag::BANK_BAGS_BEGIN - invbag::BANK_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((serverSlot - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot <= EQ::invslot::SHARED_BANK_END && serverSlot >= EQ::invslot::SHARED_BANK_BEGIN) {
|
else if (serverSlot <= EQ::invslot::SHARED_BANK_END && serverSlot >= EQ::invslot::SHARED_BANK_BEGIN) {
|
||||||
@@ -3999,7 +3999,7 @@ namespace SoD
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot <= EQ::invbag::SHARED_BANK_BAGS_END && serverSlot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
|
else if (serverSlot <= EQ::invbag::SHARED_BANK_BAGS_END && serverSlot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
|
||||||
SoDSlot = serverSlot + 1;
|
SoDSlot = serverSlot - (EQ::invbag::SHARED_BANK_BAGS_BEGIN - invbag::SHARED_BANK_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((serverSlot - EQ::invbag::SHARED_BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot <= EQ::invslot::TRADE_END && serverSlot >= EQ::invslot::TRADE_BEGIN) {
|
else if (serverSlot <= EQ::invslot::TRADE_END && serverSlot >= EQ::invslot::TRADE_BEGIN) {
|
||||||
@@ -4007,7 +4007,7 @@ namespace SoD
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot <= EQ::invbag::TRADE_BAGS_END && serverSlot >= EQ::invbag::TRADE_BAGS_BEGIN) {
|
else if (serverSlot <= EQ::invbag::TRADE_BAGS_END && serverSlot >= EQ::invbag::TRADE_BAGS_BEGIN) {
|
||||||
SoDSlot = serverSlot;
|
SoDSlot = serverSlot - (EQ::invbag::TRADE_BAGS_BEGIN - invbag::TRADE_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((serverSlot - EQ::invbag::TRADE_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot <= EQ::invslot::WORLD_END && serverSlot >= EQ::invslot::WORLD_BEGIN) {
|
else if (serverSlot <= EQ::invslot::WORLD_END && serverSlot >= EQ::invslot::WORLD_BEGIN) {
|
||||||
@@ -4049,11 +4049,11 @@ namespace SoD
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (sod_slot <= invbag::GENERAL_BAGS_END && sod_slot >= invbag::GENERAL_BAGS_BEGIN) {
|
else if (sod_slot <= invbag::GENERAL_BAGS_END && sod_slot >= invbag::GENERAL_BAGS_BEGIN) {
|
||||||
server_slot = sod_slot - 11;
|
server_slot = sod_slot + (EQ::invbag::GENERAL_BAGS_BEGIN - invbag::GENERAL_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((sod_slot - invbag::GENERAL_BAGS_BEGIN) / invbag::SLOT_COUNT));
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (sod_slot <= invbag::CURSOR_BAG_END && sod_slot >= invbag::CURSOR_BAG_BEGIN) {
|
else if (sod_slot <= invbag::CURSOR_BAG_END && sod_slot >= invbag::CURSOR_BAG_BEGIN) {
|
||||||
server_slot = sod_slot + 9;
|
server_slot = sod_slot + (EQ::invbag::CURSOR_BAG_BEGIN - invbag::CURSOR_BAG_BEGIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (sod_slot <= invslot::TRIBUTE_END && sod_slot >= invslot::TRIBUTE_BEGIN) {
|
else if (sod_slot <= invslot::TRIBUTE_END && sod_slot >= invslot::TRIBUTE_BEGIN) {
|
||||||
@@ -4073,7 +4073,7 @@ namespace SoD
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (sod_slot <= invbag::BANK_BAGS_END && sod_slot >= invbag::BANK_BAGS_BEGIN) {
|
else if (sod_slot <= invbag::BANK_BAGS_END && sod_slot >= invbag::BANK_BAGS_BEGIN) {
|
||||||
server_slot = sod_slot - 1;
|
server_slot = sod_slot + (EQ::invbag::BANK_BAGS_BEGIN - invbag::BANK_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((sod_slot - invbag::BANK_BAGS_BEGIN) / invbag::SLOT_COUNT));
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (sod_slot <= invslot::SHARED_BANK_END && sod_slot >= invslot::SHARED_BANK_BEGIN) {
|
else if (sod_slot <= invslot::SHARED_BANK_END && sod_slot >= invslot::SHARED_BANK_BEGIN) {
|
||||||
@@ -4081,7 +4081,7 @@ namespace SoD
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (sod_slot <= invbag::SHARED_BANK_BAGS_END && sod_slot >= invbag::SHARED_BANK_BAGS_BEGIN) {
|
else if (sod_slot <= invbag::SHARED_BANK_BAGS_END && sod_slot >= invbag::SHARED_BANK_BAGS_BEGIN) {
|
||||||
server_slot = sod_slot - 1;
|
server_slot = sod_slot + (EQ::invbag::SHARED_BANK_BAGS_BEGIN - invbag::SHARED_BANK_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((sod_slot - invbag::SHARED_BANK_BAGS_BEGIN) / invbag::SLOT_COUNT));
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (sod_slot <= invslot::TRADE_END && sod_slot >= invslot::TRADE_BEGIN) {
|
else if (sod_slot <= invslot::TRADE_END && sod_slot >= invslot::TRADE_BEGIN) {
|
||||||
@@ -4089,7 +4089,7 @@ namespace SoD
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (sod_slot <= invbag::TRADE_BAGS_END && sod_slot >= invbag::TRADE_BAGS_BEGIN) {
|
else if (sod_slot <= invbag::TRADE_BAGS_END && sod_slot >= invbag::TRADE_BAGS_BEGIN) {
|
||||||
server_slot = sod_slot;
|
server_slot = sod_slot + (EQ::invbag::TRADE_BAGS_BEGIN - invbag::TRADE_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((sod_slot - invbag::TRADE_BAGS_BEGIN) / invbag::SLOT_COUNT));
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (sod_slot <= invslot::WORLD_END && sod_slot >= invslot::WORLD_BEGIN) {
|
else if (sod_slot <= invslot::WORLD_END && sod_slot >= invslot::WORLD_BEGIN) {
|
||||||
|
|||||||
+11
-11
@@ -3355,12 +3355,12 @@ namespace SoF
|
|||||||
sof_slot = server_slot - 2;
|
sof_slot = server_slot - 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQ::invbag::GENERAL_BAGS_8_END && server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::GENERAL_BAGS_END && server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
||||||
sof_slot = server_slot + 11;
|
sof_slot = server_slot - (EQ::invbag::GENERAL_BAGS_BEGIN - invbag::GENERAL_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((server_slot - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::CURSOR_BAG_BEGIN) {
|
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::CURSOR_BAG_BEGIN) {
|
||||||
sof_slot = server_slot - 9;
|
sof_slot = server_slot - (EQ::invbag::CURSOR_BAG_BEGIN - invbag::CURSOR_BAG_BEGIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQ::invslot::TRIBUTE_END && server_slot >= EQ::invslot::TRIBUTE_BEGIN) {
|
else if (server_slot <= EQ::invslot::TRIBUTE_END && server_slot >= EQ::invslot::TRIBUTE_BEGIN) {
|
||||||
@@ -3380,7 +3380,7 @@ namespace SoF
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQ::invbag::BANK_BAGS_END && server_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::BANK_BAGS_END && server_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
|
||||||
sof_slot = server_slot + 1;
|
sof_slot = server_slot - (EQ::invbag::BANK_BAGS_BEGIN - invbag::BANK_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((server_slot - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQ::invslot::SHARED_BANK_END && server_slot >= EQ::invslot::SHARED_BANK_BEGIN) {
|
else if (server_slot <= EQ::invslot::SHARED_BANK_END && server_slot >= EQ::invslot::SHARED_BANK_BEGIN) {
|
||||||
@@ -3388,7 +3388,7 @@ namespace SoF
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQ::invbag::SHARED_BANK_BAGS_END && server_slot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::SHARED_BANK_BAGS_END && server_slot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
|
||||||
sof_slot = server_slot + 1;
|
sof_slot = server_slot - (EQ::invbag::SHARED_BANK_BAGS_BEGIN - invbag::SHARED_BANK_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((server_slot - EQ::invbag::SHARED_BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQ::invslot::TRADE_END && server_slot >= EQ::invslot::TRADE_BEGIN) {
|
else if (server_slot <= EQ::invslot::TRADE_END && server_slot >= EQ::invslot::TRADE_BEGIN) {
|
||||||
@@ -3396,7 +3396,7 @@ namespace SoF
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQ::invbag::TRADE_BAGS_END && server_slot >= EQ::invbag::TRADE_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::TRADE_BAGS_END && server_slot >= EQ::invbag::TRADE_BAGS_BEGIN) {
|
||||||
sof_slot = server_slot;
|
sof_slot = server_slot - (EQ::invbag::TRADE_BAGS_BEGIN - invbag::TRADE_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((server_slot - EQ::invbag::TRADE_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQ::invslot::WORLD_END && server_slot >= EQ::invslot::WORLD_BEGIN) {
|
else if (server_slot <= EQ::invslot::WORLD_END && server_slot >= EQ::invslot::WORLD_BEGIN) {
|
||||||
@@ -3442,11 +3442,11 @@ namespace SoF
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (sof_slot <= invbag::GENERAL_BAGS_END && sof_slot >= invbag::GENERAL_BAGS_BEGIN) {
|
else if (sof_slot <= invbag::GENERAL_BAGS_END && sof_slot >= invbag::GENERAL_BAGS_BEGIN) {
|
||||||
server_slot = sof_slot - 11;
|
server_slot = sof_slot + (EQ::invbag::GENERAL_BAGS_BEGIN - invbag::GENERAL_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((sof_slot - invbag::GENERAL_BAGS_BEGIN) / invbag::SLOT_COUNT));;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (sof_slot <= invbag::CURSOR_BAG_END && sof_slot >= invbag::CURSOR_BAG_BEGIN) {
|
else if (sof_slot <= invbag::CURSOR_BAG_END && sof_slot >= invbag::CURSOR_BAG_BEGIN) {
|
||||||
server_slot = sof_slot + 9;
|
server_slot = sof_slot + (EQ::invbag::CURSOR_BAG_BEGIN - invbag::CURSOR_BAG_BEGIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (sof_slot <= invslot::TRIBUTE_END && sof_slot >= invslot::TRIBUTE_BEGIN) {
|
else if (sof_slot <= invslot::TRIBUTE_END && sof_slot >= invslot::TRIBUTE_BEGIN) {
|
||||||
@@ -3466,7 +3466,7 @@ namespace SoF
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (sof_slot <= invbag::BANK_BAGS_END && sof_slot >= invbag::BANK_BAGS_BEGIN) {
|
else if (sof_slot <= invbag::BANK_BAGS_END && sof_slot >= invbag::BANK_BAGS_BEGIN) {
|
||||||
server_slot = sof_slot - 1;
|
server_slot = sof_slot + (EQ::invbag::BANK_BAGS_BEGIN - invbag::BANK_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((sof_slot - invbag::BANK_BAGS_BEGIN) / invbag::SLOT_COUNT));;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (sof_slot <= invslot::SHARED_BANK_END && sof_slot >= invslot::SHARED_BANK_BEGIN) {
|
else if (sof_slot <= invslot::SHARED_BANK_END && sof_slot >= invslot::SHARED_BANK_BEGIN) {
|
||||||
@@ -3474,7 +3474,7 @@ namespace SoF
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (sof_slot <= invbag::SHARED_BANK_BAGS_END && sof_slot >= invbag::SHARED_BANK_BAGS_BEGIN) {
|
else if (sof_slot <= invbag::SHARED_BANK_BAGS_END && sof_slot >= invbag::SHARED_BANK_BAGS_BEGIN) {
|
||||||
server_slot = sof_slot - 1;
|
server_slot = sof_slot + (EQ::invbag::SHARED_BANK_BAGS_BEGIN - invbag::SHARED_BANK_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((sof_slot - invbag::SHARED_BANK_BAGS_BEGIN) / invbag::SLOT_COUNT));;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (sof_slot <= invslot::TRADE_END && sof_slot >= invslot::TRADE_BEGIN) {
|
else if (sof_slot <= invslot::TRADE_END && sof_slot >= invslot::TRADE_BEGIN) {
|
||||||
@@ -3482,7 +3482,7 @@ namespace SoF
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (sof_slot <= invbag::TRADE_BAGS_END && sof_slot >= invbag::TRADE_BAGS_BEGIN) {
|
else if (sof_slot <= invbag::TRADE_BAGS_END && sof_slot >= invbag::TRADE_BAGS_BEGIN) {
|
||||||
server_slot = sof_slot;
|
server_slot = sof_slot + (EQ::invbag::TRADE_BAGS_BEGIN - invbag::TRADE_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((sof_slot - invbag::TRADE_BAGS_BEGIN) / invbag::SLOT_COUNT));;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (sof_slot <= invslot::WORLD_END && sof_slot >= invslot::WORLD_BEGIN) {
|
else if (sof_slot <= invslot::WORLD_END && sof_slot >= invslot::WORLD_BEGIN) {
|
||||||
|
|||||||
+12
-12
@@ -3596,12 +3596,12 @@ namespace Titanium
|
|||||||
else if (server_slot == (EQ::invslot::POSSESSIONS_COUNT + EQ::invslot::slotAmmo)) {
|
else if (server_slot == (EQ::invslot::POSSESSIONS_COUNT + EQ::invslot::slotAmmo)) {
|
||||||
titanium_slot = server_slot - 4;
|
titanium_slot = server_slot - 4;
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQ::invbag::GENERAL_BAGS_8_END &&
|
else if (server_slot <= EQ::invbag::GENERAL_BAGS_END &&
|
||||||
server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot - (EQ::invbag::GENERAL_BAGS_BEGIN - invbag::GENERAL_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((server_slot - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::CURSOR_BAG_BEGIN) {
|
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::CURSOR_BAG_BEGIN) {
|
||||||
titanium_slot = server_slot - 20;
|
titanium_slot = server_slot - (EQ::invbag::CURSOR_BAG_BEGIN - invbag::CURSOR_BAG_BEGIN);
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQ::invslot::TRIBUTE_END && server_slot >= EQ::invslot::TRIBUTE_BEGIN) {
|
else if (server_slot <= EQ::invslot::TRIBUTE_END && server_slot >= EQ::invslot::TRIBUTE_BEGIN) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot;
|
||||||
@@ -3616,21 +3616,21 @@ namespace Titanium
|
|||||||
else if (server_slot <= EQ::invslot::BANK_END && server_slot >= EQ::invslot::BANK_BEGIN) {
|
else if (server_slot <= EQ::invslot::BANK_END && server_slot >= EQ::invslot::BANK_BEGIN) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot;
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQ::invbag::BANK_BAGS_16_END && server_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::BANK_BAGS_END && server_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot - (EQ::invbag::BANK_BAGS_BEGIN - invbag::BANK_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((server_slot - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQ::invslot::SHARED_BANK_END && server_slot >= EQ::invslot::SHARED_BANK_BEGIN) {
|
else if (server_slot <= EQ::invslot::SHARED_BANK_END && server_slot >= EQ::invslot::SHARED_BANK_BEGIN) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot;
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQ::invbag::SHARED_BANK_BAGS_END &&
|
else if (server_slot <= EQ::invbag::SHARED_BANK_BAGS_END &&
|
||||||
server_slot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
|
server_slot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot - (EQ::invbag::SHARED_BANK_BAGS_BEGIN - invbag::SHARED_BANK_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((server_slot - EQ::invbag::SHARED_BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQ::invslot::TRADE_END && server_slot >= EQ::invslot::TRADE_BEGIN) {
|
else if (server_slot <= EQ::invslot::TRADE_END && server_slot >= EQ::invslot::TRADE_BEGIN) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot;
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQ::invbag::TRADE_BAGS_END && server_slot >= EQ::invbag::TRADE_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::TRADE_BAGS_END && server_slot >= EQ::invbag::TRADE_BAGS_BEGIN) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot - (EQ::invbag::TRADE_BAGS_BEGIN - invbag::TRADE_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((server_slot - EQ::invbag::TRADE_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQ::invslot::WORLD_END && server_slot >= EQ::invslot::WORLD_BEGIN) {
|
else if (server_slot <= EQ::invslot::WORLD_END && server_slot >= EQ::invslot::WORLD_BEGIN) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot;
|
||||||
@@ -3687,10 +3687,10 @@ namespace Titanium
|
|||||||
server_slot = titanium_slot + 4;
|
server_slot = titanium_slot + 4;
|
||||||
}
|
}
|
||||||
else if (titanium_slot <= invbag::GENERAL_BAGS_END && titanium_slot >= invbag::GENERAL_BAGS_BEGIN) {
|
else if (titanium_slot <= invbag::GENERAL_BAGS_END && titanium_slot >= invbag::GENERAL_BAGS_BEGIN) {
|
||||||
server_slot = titanium_slot;
|
server_slot = titanium_slot + (EQ::invbag::GENERAL_BAGS_BEGIN - invbag::GENERAL_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((titanium_slot - invbag::GENERAL_BAGS_BEGIN) / invbag::SLOT_COUNT));
|
||||||
}
|
}
|
||||||
else if (titanium_slot <= invbag::CURSOR_BAG_END && titanium_slot >= invbag::CURSOR_BAG_BEGIN) {
|
else if (titanium_slot <= invbag::CURSOR_BAG_END && titanium_slot >= invbag::CURSOR_BAG_BEGIN) {
|
||||||
server_slot = titanium_slot + 20;
|
server_slot = titanium_slot + (EQ::invbag::CURSOR_BAG_BEGIN - invbag::CURSOR_BAG_BEGIN);
|
||||||
}
|
}
|
||||||
else if (titanium_slot <= invslot::TRIBUTE_END && titanium_slot >= invslot::TRIBUTE_BEGIN) {
|
else if (titanium_slot <= invslot::TRIBUTE_END && titanium_slot >= invslot::TRIBUTE_BEGIN) {
|
||||||
server_slot = titanium_slot;
|
server_slot = titanium_slot;
|
||||||
@@ -3705,19 +3705,19 @@ namespace Titanium
|
|||||||
server_slot = titanium_slot;
|
server_slot = titanium_slot;
|
||||||
}
|
}
|
||||||
else if (titanium_slot <= invbag::BANK_BAGS_END && titanium_slot >= invbag::BANK_BAGS_BEGIN) {
|
else if (titanium_slot <= invbag::BANK_BAGS_END && titanium_slot >= invbag::BANK_BAGS_BEGIN) {
|
||||||
server_slot = titanium_slot;
|
server_slot = titanium_slot + (EQ::invbag::BANK_BAGS_BEGIN - invbag::BANK_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((titanium_slot - invbag::BANK_BAGS_BEGIN) / invbag::SLOT_COUNT));
|
||||||
}
|
}
|
||||||
else if (titanium_slot <= invslot::SHARED_BANK_END && titanium_slot >= invslot::SHARED_BANK_BEGIN) {
|
else if (titanium_slot <= invslot::SHARED_BANK_END && titanium_slot >= invslot::SHARED_BANK_BEGIN) {
|
||||||
server_slot = titanium_slot;
|
server_slot = titanium_slot;
|
||||||
}
|
}
|
||||||
else if (titanium_slot <= invbag::SHARED_BANK_BAGS_END && titanium_slot >= invbag::SHARED_BANK_BAGS_BEGIN) {
|
else if (titanium_slot <= invbag::SHARED_BANK_BAGS_END && titanium_slot >= invbag::SHARED_BANK_BAGS_BEGIN) {
|
||||||
server_slot = titanium_slot;
|
server_slot = titanium_slot + (EQ::invbag::SHARED_BANK_BAGS_BEGIN - invbag::SHARED_BANK_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((titanium_slot - invbag::SHARED_BANK_BAGS_BEGIN) / invbag::SLOT_COUNT));
|
||||||
}
|
}
|
||||||
else if (titanium_slot <= invslot::TRADE_END && titanium_slot >= invslot::TRADE_BEGIN) {
|
else if (titanium_slot <= invslot::TRADE_END && titanium_slot >= invslot::TRADE_BEGIN) {
|
||||||
server_slot = titanium_slot;
|
server_slot = titanium_slot;
|
||||||
}
|
}
|
||||||
else if (titanium_slot <= invbag::TRADE_BAGS_END && titanium_slot >= invbag::TRADE_BAGS_BEGIN) {
|
else if (titanium_slot <= invbag::TRADE_BAGS_END && titanium_slot >= invbag::TRADE_BAGS_BEGIN) {
|
||||||
server_slot = titanium_slot;
|
server_slot = titanium_slot + (EQ::invbag::TRADE_BAGS_BEGIN - invbag::TRADE_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((titanium_slot - invbag::TRADE_BAGS_BEGIN) / invbag::SLOT_COUNT));
|
||||||
}
|
}
|
||||||
else if (titanium_slot <= invslot::WORLD_END && titanium_slot >= invslot::WORLD_BEGIN) {
|
else if (titanium_slot <= invslot::WORLD_END && titanium_slot >= invslot::WORLD_BEGIN) {
|
||||||
server_slot = titanium_slot;
|
server_slot = titanium_slot;
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "../types.h"
|
||||||
|
#include "../database.h"
|
||||||
|
#include "../strings.h"
|
||||||
|
#include "../eqemu_logsys.h"
|
||||||
|
#include "../eqemu_logsys_log_aliases.h"
|
||||||
|
#include "../features.h"
|
||||||
|
#include "../global_define.h"
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "process.h"
|
#include "process.h"
|
||||||
|
#include <fmt/format.h>
|
||||||
|
|
||||||
std::string Process::execute(const std::string &cmd)
|
std::string Process::execute(const std::string &cmd)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -116,6 +116,12 @@ namespace EQ {
|
|||||||
Reseed();
|
Reseed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Random* Instance()
|
||||||
|
{
|
||||||
|
static Random instance;
|
||||||
|
return &instance;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifndef BIASED_INT_DIST
|
#ifndef BIASED_INT_DIST
|
||||||
typedef std::uniform_int_distribution<int>::param_type int_param_t;
|
typedef std::uniform_int_distribution<int>::param_type int_param_t;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../strings.h"
|
#include "../../strings.h"
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
#include <cereal/cereal.hpp>
|
||||||
class BasePlayerEventLogSettingsRepository {
|
class BasePlayerEventLogSettingsRepository {
|
||||||
public:
|
public:
|
||||||
struct PlayerEventLogSettings {
|
struct PlayerEventLogSettings {
|
||||||
@@ -25,6 +25,20 @@ public:
|
|||||||
int32_t retention_days;
|
int32_t retention_days;
|
||||||
int32_t discord_webhook_id;
|
int32_t discord_webhook_id;
|
||||||
uint8_t etl_enabled;
|
uint8_t etl_enabled;
|
||||||
|
|
||||||
|
// cereal
|
||||||
|
template<class Archive>
|
||||||
|
void serialize(Archive &ar)
|
||||||
|
{
|
||||||
|
ar(
|
||||||
|
CEREAL_NVP(id),
|
||||||
|
CEREAL_NVP(event_name),
|
||||||
|
CEREAL_NVP(event_enabled),
|
||||||
|
CEREAL_NVP(retention_days),
|
||||||
|
CEREAL_NVP(discord_webhook_id),
|
||||||
|
CEREAL_NVP(etl_enabled)
|
||||||
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::string PrimaryKey()
|
static std::string PrimaryKey()
|
||||||
|
|||||||
@@ -167,6 +167,30 @@ public:
|
|||||||
|
|
||||||
return zone_player_counts;
|
return zone_player_counts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<uint32_t> GetCharacterIDsByAccountID(
|
||||||
|
Database& db,
|
||||||
|
uint32_t account_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<uint32_t> character_ids;
|
||||||
|
|
||||||
|
auto query = fmt::format(
|
||||||
|
"SELECT id FROM character_data WHERE account_id = {} AND deleted_at IS NULL",
|
||||||
|
account_id
|
||||||
|
);
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(query);
|
||||||
|
if (results.Success()) {
|
||||||
|
for (auto row : results) {
|
||||||
|
if (row[0]) {
|
||||||
|
character_ids.push_back(static_cast<uint32_t>(std::stoul(row[0])));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return character_ids;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //EQEMU_CHARACTER_DATA_REPOSITORY_H
|
#endif //EQEMU_CHARACTER_DATA_REPOSITORY_H
|
||||||
|
|||||||
@@ -43,6 +43,47 @@ public:
|
|||||||
* method and encapsulate filters there
|
* method and encapsulate filters there
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
template<typename T1, typename T2, typename T3, typename T4>
|
||||||
|
static std::vector<std::string> join_tuple(
|
||||||
|
const std::string &glue,
|
||||||
|
const std::pair<char, char> &encapsulation,
|
||||||
|
const std::vector<std::tuple<T1, T2, T3, T4>> &src
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (src.empty()) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> output;
|
||||||
|
|
||||||
|
for (const std::tuple<T1, T2, T3, T4> &src_iter: src) {
|
||||||
|
|
||||||
|
output.emplace_back(
|
||||||
|
|
||||||
|
fmt::format(
|
||||||
|
"{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
|
||||||
|
encapsulation.first,
|
||||||
|
std::get<0>(src_iter),
|
||||||
|
encapsulation.second,
|
||||||
|
glue,
|
||||||
|
encapsulation.first,
|
||||||
|
std::get<1>(src_iter),
|
||||||
|
encapsulation.second,
|
||||||
|
glue,
|
||||||
|
encapsulation.first,
|
||||||
|
std::get<2>(src_iter),
|
||||||
|
encapsulation.second,
|
||||||
|
glue,
|
||||||
|
encapsulation.first,
|
||||||
|
std::get<3>(src_iter),
|
||||||
|
encapsulation.second
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
// Custom extended repository methods here
|
// Custom extended repository methods here
|
||||||
static std::vector<std::string> GetRuleNames(Database &db, int rule_set_id)
|
static std::vector<std::string> GetRuleNames(Database &db, int rule_set_id)
|
||||||
{
|
{
|
||||||
@@ -87,12 +128,28 @@ public:
|
|||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
static std::string
|
||||||
|
ImplodePair(const std::string &glue, const std::pair<char, char> &encapsulation, const std::vector<T> &src)
|
||||||
|
{
|
||||||
|
if (src.empty()) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
std::ostringstream oss;
|
||||||
|
for (const T &src_iter: src) {
|
||||||
|
oss << encapsulation.first << src_iter << encapsulation.second << glue;
|
||||||
|
}
|
||||||
|
std::string output(oss.str());
|
||||||
|
output.resize(output.size() - glue.size());
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
static bool DeleteOrphanedRules(Database& db, std::vector<std::string>& v)
|
static bool DeleteOrphanedRules(Database& db, std::vector<std::string>& v)
|
||||||
{
|
{
|
||||||
const auto query = fmt::format(
|
const auto query = fmt::format(
|
||||||
"DELETE FROM {} WHERE rule_name IN ({})",
|
"DELETE FROM {} WHERE rule_name IN ({})",
|
||||||
TableName(),
|
TableName(),
|
||||||
Strings::ImplodePair(",", std::pair<char, char>('\'', '\''), v)
|
ImplodePair(",", std::pair<char, char>('\'', '\''), v)
|
||||||
);
|
);
|
||||||
|
|
||||||
return db.QueryDatabase(query).Success();
|
return db.QueryDatabase(query).Success();
|
||||||
@@ -103,7 +160,7 @@ public:
|
|||||||
const auto query = fmt::format(
|
const auto query = fmt::format(
|
||||||
"REPLACE INTO {} (`ruleset_id`, `rule_name`, `rule_value`, `notes`) VALUES {}",
|
"REPLACE INTO {} (`ruleset_id`, `rule_name`, `rule_value`, `notes`) VALUES {}",
|
||||||
TableName(),
|
TableName(),
|
||||||
Strings::ImplodePair(
|
ImplodePair(
|
||||||
",",
|
",",
|
||||||
std::pair<char, char>('(', ')'),
|
std::pair<char, char>('(', ')'),
|
||||||
join_tuple(",", std::pair<char, char>('\'', '\''), v)
|
join_tuple(",", std::pair<char, char>('\'', '\''), v)
|
||||||
|
|||||||
+3
-1
@@ -273,8 +273,9 @@
|
|||||||
#define ServerOP_WWTaskUpdate 0x4758
|
#define ServerOP_WWTaskUpdate 0x4758
|
||||||
|
|
||||||
// player events
|
// player events
|
||||||
#define ServerOP_QSSendQuery 0x5000
|
#define ServerOP_QSSendQuery 0x5000
|
||||||
#define ServerOP_PlayerEvent 0x5100
|
#define ServerOP_PlayerEvent 0x5100
|
||||||
|
#define ServerOP_SendPlayerEventSettings 0x5101
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
CZUpdateType_Character,
|
CZUpdateType_Character,
|
||||||
@@ -1778,6 +1779,7 @@ struct BazaarPurchaseMessaging_Struct {
|
|||||||
uint32 id;
|
uint32 id;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#pragma pack()
|
#pragma pack()
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+51
-3
@@ -1544,12 +1544,60 @@ bool SharedDatabase::GetCommandSettings(std::map<std::string, std::pair<uint8, s
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T1, typename T2>
|
||||||
|
inline std::vector<std::string> join_pair(
|
||||||
|
const std::string &glue,
|
||||||
|
const std::pair<char, char> &encapsulation,
|
||||||
|
const std::vector<std::pair<T1, T2>> &src
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (src.empty()) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> output;
|
||||||
|
|
||||||
|
for (const std::pair<T1, T2> &src_iter: src) {
|
||||||
|
output.emplace_back(
|
||||||
|
|
||||||
|
fmt::format(
|
||||||
|
"{}{}{}{}{}{}{}",
|
||||||
|
encapsulation.first,
|
||||||
|
src_iter.first,
|
||||||
|
encapsulation.second,
|
||||||
|
glue,
|
||||||
|
encapsulation.first,
|
||||||
|
src_iter.second,
|
||||||
|
encapsulation.second
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
inline std::string
|
||||||
|
ImplodePair(const std::string &glue, const std::pair<char, char> &encapsulation, const std::vector<T> &src)
|
||||||
|
{
|
||||||
|
if (src.empty()) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
std::ostringstream oss;
|
||||||
|
for (const T &src_iter: src) {
|
||||||
|
oss << encapsulation.first << src_iter << encapsulation.second << glue;
|
||||||
|
}
|
||||||
|
std::string output(oss.str());
|
||||||
|
output.resize(output.size() - glue.size());
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
bool SharedDatabase::UpdateInjectedCommandSettings(const std::vector<std::pair<std::string, uint8>> &injected)
|
bool SharedDatabase::UpdateInjectedCommandSettings(const std::vector<std::pair<std::string, uint8>> &injected)
|
||||||
{
|
{
|
||||||
if (injected.size()) {
|
if (injected.size()) {
|
||||||
const std::string query = fmt::format(
|
const std::string query = fmt::format(
|
||||||
"REPLACE INTO `command_settings`(`command`, `access`) VALUES {}",
|
"REPLACE INTO `command_settings`(`command`, `access`) VALUES {}",
|
||||||
Strings::ImplodePair(
|
ImplodePair(
|
||||||
",",
|
",",
|
||||||
std::pair<char, char>('(', ')'),
|
std::pair<char, char>('(', ')'),
|
||||||
join_pair(",", std::pair<char, char>('\'', '\''), injected)
|
join_pair(",", std::pair<char, char>('\'', '\''), injected)
|
||||||
@@ -1576,7 +1624,7 @@ bool SharedDatabase::UpdateOrphanedCommandSettings(const std::vector<std::string
|
|||||||
if (orphaned.size()) {
|
if (orphaned.size()) {
|
||||||
std::string query = fmt::format(
|
std::string query = fmt::format(
|
||||||
"DELETE FROM `command_settings` WHERE `command` IN ({})",
|
"DELETE FROM `command_settings` WHERE `command` IN ({})",
|
||||||
Strings::ImplodePair(",", std::pair<char, char>('\'', '\''), orphaned)
|
ImplodePair(",", std::pair<char, char>('\'', '\''), orphaned)
|
||||||
);
|
);
|
||||||
|
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
@@ -1586,7 +1634,7 @@ bool SharedDatabase::UpdateOrphanedCommandSettings(const std::vector<std::string
|
|||||||
|
|
||||||
query = fmt::format(
|
query = fmt::format(
|
||||||
"DELETE FROM `command_subsettings` WHERE `parent_command` IN ({})",
|
"DELETE FROM `command_subsettings` WHERE `parent_command` IN ({})",
|
||||||
Strings::ImplodePair(",", std::pair<char, char>('\'', '\''), orphaned)
|
ImplodePair(",", std::pair<char, char>('\'', '\''), orphaned)
|
||||||
);
|
);
|
||||||
|
|
||||||
auto results_two = QueryDatabase(query);
|
auto results_two = QueryDatabase(query);
|
||||||
|
|||||||
+6
-2
@@ -16,12 +16,16 @@ public:
|
|||||||
static int32_t GetSkillCapMaxLevel(uint8 class_id, EQ::skills::SkillType skill_id);
|
static int32_t GetSkillCapMaxLevel(uint8 class_id, EQ::skills::SkillType skill_id);
|
||||||
|
|
||||||
SkillCaps *SetContentDatabase(Database *db);
|
SkillCaps *SetContentDatabase(Database *db);
|
||||||
|
|
||||||
|
static SkillCaps* Instance()
|
||||||
|
{
|
||||||
|
static SkillCaps instance;
|
||||||
|
return &instance;
|
||||||
|
}
|
||||||
private:
|
private:
|
||||||
Database *m_content_database{};
|
Database *m_content_database{};
|
||||||
std::map<uint64, SkillCapsRepository::SkillCaps> m_skill_caps = {};
|
std::map<uint64, SkillCapsRepository::SkillCaps> m_skill_caps = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
extern SkillCaps skill_caps;
|
|
||||||
|
|
||||||
|
|
||||||
#endif //CODE_SKILL_CAPS_H
|
#endif //CODE_SKILL_CAPS_H
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "strings.h"
|
#include "strings.h"
|
||||||
|
#include <cereal/external/rapidjson/document.h>
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
@@ -41,6 +42,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
#include <random>
|
#include <random>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -49,6 +51,12 @@
|
|||||||
#include "strings_legacy.cpp" // legacy c functions
|
#include "strings_legacy.cpp" // legacy c functions
|
||||||
#include "strings_misc.cpp" // anything non "Strings" scoped
|
#include "strings_misc.cpp" // anything non "Strings" scoped
|
||||||
|
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <functional>
|
||||||
|
#include <algorithm>
|
||||||
|
#endif
|
||||||
|
|
||||||
std::string Strings::Random(size_t length)
|
std::string Strings::Random(size_t length)
|
||||||
{
|
{
|
||||||
static auto &chrs = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
static auto &chrs = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||||
@@ -701,6 +709,18 @@ std::string &Strings::Trim(std::string &str, const std::string &chars)
|
|||||||
return LTrim(RTrim(str, chars), chars);
|
return LTrim(RTrim(str, chars), chars);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::string NUM_TO_ENGLISH_X[] = {
|
||||||
|
"", "One ", "Two ", "Three ", "Four ",
|
||||||
|
"Five ", "Six ", "Seven ", "Eight ", "Nine ", "Ten ", "Eleven ",
|
||||||
|
"Twelve ", "Thirteen ", "Fourteen ", "Fifteen ",
|
||||||
|
"Sixteen ", "Seventeen ", "Eighteen ", "Nineteen "
|
||||||
|
};
|
||||||
|
|
||||||
|
const std::string NUM_TO_ENGLISH_Y[] = {
|
||||||
|
"", "", "Twenty ", "Thirty ", "Forty ",
|
||||||
|
"Fifty ", "Sixty ", "Seventy ", "Eighty ", "Ninety "
|
||||||
|
};
|
||||||
|
|
||||||
// Function to convert single digit or two digit number into words
|
// Function to convert single digit or two digit number into words
|
||||||
std::string Strings::ConvertToDigit(int n, const std::string& suffix)
|
std::string Strings::ConvertToDigit(int n, const std::string& suffix)
|
||||||
{
|
{
|
||||||
|
|||||||
+3
-193
@@ -36,53 +36,19 @@
|
|||||||
#define _STRINGUTIL_H_
|
#define _STRINGUTIL_H_
|
||||||
|
|
||||||
#include <charconv>
|
#include <charconv>
|
||||||
#include <sstream>
|
#include <cstring>
|
||||||
#include <string.h>
|
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cstdarg>
|
#include <cstdarg>
|
||||||
#include <tuple>
|
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
#include <fmt/format.h>
|
#ifdef _WIN32
|
||||||
#include <cereal/external/rapidjson/document.h>
|
|
||||||
|
|
||||||
#ifndef _WIN32
|
|
||||||
// this doesn't appear to affect linux-based systems..need feedback for _WIN64
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <functional>
|
|
||||||
#include <algorithm>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
namespace detail {
|
|
||||||
// template magic to check if std::from_chars floating point functions exist
|
|
||||||
template <typename T, typename = void>
|
|
||||||
struct has_from_chars_float : std::false_type { };
|
|
||||||
|
|
||||||
// basically it "uses" this template if they do exist because reasons
|
|
||||||
template <typename T>
|
|
||||||
struct has_from_chars_float < T,
|
|
||||||
std::void_t<decltype(std::from_chars(std::declval<const char *>(), std::declval<const char *>(),
|
|
||||||
std::declval<T &>()))>> : std::true_type { };
|
|
||||||
}; // namespace detail
|
|
||||||
|
|
||||||
namespace EQ {
|
|
||||||
// lame -- older GCC's didn't define this, clang's libc++ however does, even though they lack FP support
|
|
||||||
#if defined(__GNUC__) && (__GNUC__ < 11) && !defined(__clang__)
|
|
||||||
enum class chars_format {
|
|
||||||
scientific = 1, fixed = 2, hex = 4, general = fixed | scientific
|
|
||||||
};
|
|
||||||
#else
|
|
||||||
using chars_format = std::chars_format;
|
|
||||||
#endif
|
|
||||||
}; // namespace EQ
|
|
||||||
|
|
||||||
class Strings {
|
class Strings {
|
||||||
public:
|
public:
|
||||||
static bool Contains(std::vector<std::string> container, const std::string& element);
|
static bool Contains(std::vector<std::string> container, const std::string& element);
|
||||||
@@ -133,61 +99,6 @@ public:
|
|||||||
static bool BeginsWith(const std::string& subject, const std::string& search);
|
static bool BeginsWith(const std::string& subject, const std::string& search);
|
||||||
static bool EndsWith(const std::string& subject, const std::string& search);
|
static bool EndsWith(const std::string& subject, const std::string& search);
|
||||||
static std::string ZoneTime(const uint8 hours, const uint8 minutes);
|
static std::string ZoneTime(const uint8 hours, const uint8 minutes);
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
static std::string
|
|
||||||
ImplodePair(const std::string &glue, const std::pair<char, char> &encapsulation, const std::vector<T> &src)
|
|
||||||
{
|
|
||||||
if (src.empty()) {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
std::ostringstream oss;
|
|
||||||
for (const T &src_iter: src) {
|
|
||||||
oss << encapsulation.first << src_iter << encapsulation.second << glue;
|
|
||||||
}
|
|
||||||
std::string output(oss.str());
|
|
||||||
output.resize(output.size() - glue.size());
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
|
|
||||||
// basic string_view overloads that just use std stuff since they work!
|
|
||||||
template <typename T>
|
|
||||||
std::enable_if_t<std::is_floating_point_v<T> && detail::has_from_chars_float<T>::value, std::from_chars_result>
|
|
||||||
static from_chars(std::string_view str, T& value, EQ::chars_format fmt = EQ::chars_format::general)
|
|
||||||
{
|
|
||||||
return std::from_chars(str.data(), str.data() + str.size(), value, fmt);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
std::enable_if_t<std::is_integral_v<T>, std::from_chars_result>
|
|
||||||
static from_chars(std::string_view str, T& value, int base = 10)
|
|
||||||
{
|
|
||||||
return std::from_chars(str.data(), str.data() + str.size(), value, base);
|
|
||||||
}
|
|
||||||
|
|
||||||
// fallback versions of floating point in case they're not implemented
|
|
||||||
// TODO: add error handling ...
|
|
||||||
// This does have to allocate since from_chars doesn't need a null terminated string and neither does string_view
|
|
||||||
template <typename T>
|
|
||||||
std::enable_if_t<std::is_floating_point_v<T> && !detail::has_from_chars_float<T>::value && std::is_same_v<T, float>, std::from_chars_result>
|
|
||||||
static from_chars(std::string_view str, T& value, EQ::chars_format fmt = EQ::chars_format::general)
|
|
||||||
{
|
|
||||||
std::from_chars_result res{};
|
|
||||||
std::string tmp_str(str.data(), str.size());
|
|
||||||
value = strtof(tmp_str.data(), nullptr);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
std::enable_if_t<std::is_floating_point_v<T> && !detail::has_from_chars_float<T>::value && std::is_same_v<T, double>, std::from_chars_result>
|
|
||||||
static from_chars(std::string_view str, T& value, EQ::chars_format fmt = EQ::chars_format::general)
|
|
||||||
{
|
|
||||||
std::from_chars_result res{};
|
|
||||||
std::string tmp_str(str.data(), str.size());
|
|
||||||
value = strtod(tmp_str.data(), nullptr);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
static std::string Slugify(const std::string &input, const std::string &separator = "-");
|
static std::string Slugify(const std::string &input, const std::string &separator = "-");
|
||||||
static bool IsValidJson(const std::string& json);
|
static bool IsValidJson(const std::string& json);
|
||||||
};
|
};
|
||||||
@@ -199,93 +110,6 @@ const std::string vStringFormat(const char *format, va_list args);
|
|||||||
// Used for grid nodes, as NPC names remove numerals.
|
// Used for grid nodes, as NPC names remove numerals.
|
||||||
// But general purpose
|
// But general purpose
|
||||||
|
|
||||||
const std::string NUM_TO_ENGLISH_X[] = {
|
|
||||||
"", "One ", "Two ", "Three ", "Four ",
|
|
||||||
"Five ", "Six ", "Seven ", "Eight ", "Nine ", "Ten ", "Eleven ",
|
|
||||||
"Twelve ", "Thirteen ", "Fourteen ", "Fifteen ",
|
|
||||||
"Sixteen ", "Seventeen ", "Eighteen ", "Nineteen "
|
|
||||||
};
|
|
||||||
|
|
||||||
const std::string NUM_TO_ENGLISH_Y[] = {
|
|
||||||
"", "", "Twenty ", "Thirty ", "Forty ",
|
|
||||||
"Fifty ", "Sixty ", "Seventy ", "Eighty ", "Ninety "
|
|
||||||
};
|
|
||||||
|
|
||||||
// _WIN32 builds require that #include<fmt/format.h> be included in whatever code file the invocation is made from (no header files)
|
|
||||||
template<typename T1, typename T2>
|
|
||||||
std::vector<std::string> join_pair(
|
|
||||||
const std::string &glue,
|
|
||||||
const std::pair<char, char> &encapsulation,
|
|
||||||
const std::vector<std::pair<T1, T2>> &src
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if (src.empty()) {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<std::string> output;
|
|
||||||
|
|
||||||
for (const std::pair<T1, T2> &src_iter: src) {
|
|
||||||
output.emplace_back(
|
|
||||||
|
|
||||||
fmt::format(
|
|
||||||
"{}{}{}{}{}{}{}",
|
|
||||||
encapsulation.first,
|
|
||||||
src_iter.first,
|
|
||||||
encapsulation.second,
|
|
||||||
glue,
|
|
||||||
encapsulation.first,
|
|
||||||
src_iter.second,
|
|
||||||
encapsulation.second
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
|
|
||||||
// _WIN32 builds require that #include<fmt/format.h> be included in whatever code file the invocation is made from (no header files)
|
|
||||||
template<typename T1, typename T2, typename T3, typename T4>
|
|
||||||
std::vector<std::string> join_tuple(
|
|
||||||
const std::string &glue,
|
|
||||||
const std::pair<char, char> &encapsulation,
|
|
||||||
const std::vector<std::tuple<T1, T2, T3, T4>> &src
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if (src.empty()) {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<std::string> output;
|
|
||||||
|
|
||||||
for (const std::tuple<T1, T2, T3, T4> &src_iter: src) {
|
|
||||||
|
|
||||||
output.emplace_back(
|
|
||||||
|
|
||||||
fmt::format(
|
|
||||||
"{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
|
|
||||||
encapsulation.first,
|
|
||||||
std::get<0>(src_iter),
|
|
||||||
encapsulation.second,
|
|
||||||
glue,
|
|
||||||
encapsulation.first,
|
|
||||||
std::get<1>(src_iter),
|
|
||||||
encapsulation.second,
|
|
||||||
glue,
|
|
||||||
encapsulation.first,
|
|
||||||
std::get<2>(src_iter),
|
|
||||||
encapsulation.second,
|
|
||||||
glue,
|
|
||||||
encapsulation.first,
|
|
||||||
std::get<3>(src_iter),
|
|
||||||
encapsulation.second
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
|
|
||||||
// misc functions
|
// misc functions
|
||||||
std::string SanitizeWorldServerName(std::string server_long_name);
|
std::string SanitizeWorldServerName(std::string server_long_name);
|
||||||
std::vector<std::string> GetBadWords();
|
std::vector<std::string> GetBadWords();
|
||||||
@@ -310,18 +134,4 @@ std::string FormatName(const std::string &char_name);
|
|||||||
bool IsAllowedWorldServerCharacterList(char c);
|
bool IsAllowedWorldServerCharacterList(char c);
|
||||||
void SanitizeWorldServerName(char *name);
|
void SanitizeWorldServerName(char *name);
|
||||||
|
|
||||||
template<typename InputIterator, typename OutputIterator>
|
|
||||||
auto CleanMobName(InputIterator first, InputIterator last, OutputIterator result)
|
|
||||||
{
|
|
||||||
for (; first != last; ++first) {
|
|
||||||
if (*first == '_') {
|
|
||||||
*result = ' ';
|
|
||||||
}
|
|
||||||
else if (isalpha(*first) || *first == '`') {
|
|
||||||
*result = *first;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+1
-1
@@ -42,7 +42,7 @@
|
|||||||
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
|
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define CURRENT_BINARY_DATABASE_VERSION 9323
|
#define CURRENT_BINARY_DATABASE_VERSION 9324
|
||||||
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9054
|
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9054
|
||||||
#define CUSTOM_BINARY_DATABASE_VERSION 0
|
#define CUSTOM_BINARY_DATABASE_VERSION 0
|
||||||
|
|
||||||
|
|||||||
+13
-10
@@ -104,36 +104,39 @@ public:
|
|||||||
uint8 GetZoneIdleWhenEmpty(uint32 zone_id, int version = 0);
|
uint8 GetZoneIdleWhenEmpty(uint32 zone_id, int version = 0);
|
||||||
uint32 GetZoneSecondsBeforeIdle(uint32 zone_id, int version = 0);
|
uint32 GetZoneSecondsBeforeIdle(uint32 zone_id, int version = 0);
|
||||||
|
|
||||||
|
static ZoneStore* Instance()
|
||||||
|
{
|
||||||
|
static ZoneStore instance;
|
||||||
|
return &instance;
|
||||||
|
}
|
||||||
private:
|
private:
|
||||||
std::vector<ZoneRepository::Zone> m_zones;
|
std::vector<ZoneRepository::Zone> m_zones;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern ZoneStore zone_store;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Global helpers
|
* Global helpers
|
||||||
*/
|
*/
|
||||||
inline uint32 ZoneID(const char *in_zone_name) { return zone_store.GetZoneID(in_zone_name); }
|
inline uint32 ZoneID(const char *in_zone_name) { return ZoneStore::Instance()->GetZoneID(in_zone_name); }
|
||||||
inline uint32 ZoneID(const std::string& zone_name) { return zone_store.GetZoneID(zone_name); }
|
inline uint32 ZoneID(const std::string& zone_name) { return ZoneStore::Instance()->GetZoneID(zone_name); }
|
||||||
inline const char *ZoneName(uint32 zone_id, bool error_unknown = false)
|
inline const char *ZoneName(uint32 zone_id, bool error_unknown = false)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneName(
|
return ZoneStore::Instance()->GetZoneName(
|
||||||
zone_id,
|
zone_id,
|
||||||
error_unknown
|
error_unknown
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
inline const char *ZoneLongName(uint32 zone_id, bool error_unknown = false)
|
inline const char *ZoneLongName(uint32 zone_id, bool error_unknown = false)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneLongName(
|
return ZoneStore::Instance()->GetZoneLongName(
|
||||||
zone_id,
|
zone_id,
|
||||||
error_unknown
|
error_unknown
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
inline ZoneRepository::Zone *GetZone(uint32 zone_id, int version = 0) { return zone_store.GetZone(zone_id, version); };
|
inline ZoneRepository::Zone *GetZone(uint32 zone_id, int version = 0) { return ZoneStore::Instance()->GetZone(zone_id, version); };
|
||||||
inline ZoneRepository::Zone *GetZone(const char *in_zone_name) { return zone_store.GetZone(in_zone_name); };
|
inline ZoneRepository::Zone *GetZone(const char *in_zone_name) { return ZoneStore::Instance()->GetZone(in_zone_name); };
|
||||||
inline ZoneRepository::Zone *GetZone(const char *in_zone_name, int version = 0)
|
inline ZoneRepository::Zone *GetZone(const char *in_zone_name, int version = 0)
|
||||||
{
|
{
|
||||||
return zone_store.GetZone(
|
return ZoneStore::Instance()->GetZone(
|
||||||
ZoneID(
|
ZoneID(
|
||||||
in_zone_name
|
in_zone_name
|
||||||
), version
|
), version
|
||||||
@@ -141,7 +144,7 @@ inline ZoneRepository::Zone *GetZone(const char *in_zone_name, int version = 0)
|
|||||||
};
|
};
|
||||||
inline ZoneRepository::Zone *GetZoneVersionWithFallback(uint32 zone_id, int version = 0)
|
inline ZoneRepository::Zone *GetZoneVersionWithFallback(uint32 zone_id, int version = 0)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneWithFallback(
|
return ZoneStore::Instance()->GetZoneWithFallback(
|
||||||
zone_id,
|
zone_id,
|
||||||
version
|
version
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ EQEmuLogSys LogSys;
|
|||||||
bool run_server = true;
|
bool run_server = true;
|
||||||
Database database;
|
Database database;
|
||||||
PlayerEventLogs player_event_logs;
|
PlayerEventLogs player_event_logs;
|
||||||
ZoneStore zone_store;
|
|
||||||
|
|
||||||
void CatchSignal(int sig_num)
|
void CatchSignal(int sig_num)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ std::string WorldShortName;
|
|||||||
const queryservconfig *Config;
|
const queryservconfig *Config;
|
||||||
WorldServer *worldserver = 0;
|
WorldServer *worldserver = 0;
|
||||||
EQEmuLogSys LogSys;
|
EQEmuLogSys LogSys;
|
||||||
ZoneStore zone_store;
|
|
||||||
PlayerEventLogs player_event_logs;
|
PlayerEventLogs player_event_logs;
|
||||||
ZSList zs_list;
|
ZSList zs_list;
|
||||||
uint32 numzones = 0;
|
uint32 numzones = 0;
|
||||||
|
|||||||
@@ -21,10 +21,13 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
#include "zonelist.h"
|
||||||
|
|
||||||
extern WorldServer worldserver;
|
extern WorldServer worldserver;
|
||||||
extern const queryservconfig *Config;
|
extern const queryservconfig *Config;
|
||||||
extern QSDatabase qs_database;
|
extern QSDatabase qs_database;
|
||||||
extern LFGuildManager lfguildmanager;
|
extern LFGuildManager lfguildmanager;
|
||||||
|
extern ZSList zs_list;
|
||||||
|
|
||||||
WorldServer::WorldServer()
|
WorldServer::WorldServer()
|
||||||
{
|
{
|
||||||
@@ -78,6 +81,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
|||||||
if (o->type == ServerReload::Type::Logs) {
|
if (o->type == ServerReload::Type::Logs) {
|
||||||
LogSys.LoadLogDatabaseSettings();
|
LogSys.LoadLogDatabaseSettings();
|
||||||
player_event_logs.ReloadSettings();
|
player_event_logs.ReloadSettings();
|
||||||
|
zs_list.SendPlayerEventLogSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
void ZSList::Add(ZoneServer* zoneserver) {
|
void ZSList::Add(ZoneServer* zoneserver) {
|
||||||
zone_server_list.emplace_back(std::unique_ptr<ZoneServer>(zoneserver));
|
zone_server_list.emplace_back(std::unique_ptr<ZoneServer>(zoneserver));
|
||||||
zoneserver->SetIsZoneConnected(true);
|
zoneserver->SetIsZoneConnected(true);
|
||||||
|
|
||||||
|
zoneserver->SendPlayerEventLogSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZSList::Remove(const std::string &uuid)
|
void ZSList::Remove(const std::string &uuid)
|
||||||
@@ -18,3 +20,10 @@ void ZSList::Remove(const std::string &uuid)
|
|||||||
iter++;
|
iter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ZSList::SendPlayerEventLogSettings()
|
||||||
|
{
|
||||||
|
for (auto &zs : zone_server_list) {
|
||||||
|
zs->SendPlayerEventLogSettings();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -12,9 +12,10 @@ class ZoneServer;
|
|||||||
|
|
||||||
class ZSList {
|
class ZSList {
|
||||||
public:
|
public:
|
||||||
std::list<std::unique_ptr<ZoneServer>> &GetZsList() { return zone_server_list; }
|
std::list<std::unique_ptr<ZoneServer>>& GetZsList() { return zone_server_list; }
|
||||||
void Add(ZoneServer *zoneserver);
|
void Add(ZoneServer* zoneserver);
|
||||||
void Remove(const std::string &uuid);
|
void Remove(const std::string& uuid);
|
||||||
|
void SendPlayerEventLogSettings();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::list<std::unique_ptr<ZoneServer>> zone_server_list;
|
std::list<std::unique_ptr<ZoneServer>> zone_server_list;
|
||||||
|
|||||||
@@ -44,3 +44,27 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ZoneServer::SendPlayerEventLogSettings()
|
||||||
|
{
|
||||||
|
EQ::Net::DynamicPacket dyn_pack;
|
||||||
|
std::vector<PlayerEventLogSettingsRepository::PlayerEventLogSettings> settings(
|
||||||
|
player_event_logs.GetSettings(),
|
||||||
|
player_event_logs.GetSettings() + PlayerEvent::EventType::MAX
|
||||||
|
);
|
||||||
|
|
||||||
|
dyn_pack.PutSerialize(0, settings);
|
||||||
|
|
||||||
|
auto packet_size = sizeof(ServerSendPlayerEvent_Struct) + dyn_pack.Length();
|
||||||
|
|
||||||
|
auto pack = std::make_unique<ServerPacket>(
|
||||||
|
ServerOP_SendPlayerEventSettings,
|
||||||
|
static_cast<uint32_t>(packet_size)
|
||||||
|
);
|
||||||
|
|
||||||
|
auto* buf = reinterpret_cast<ServerSendPlayerEvent_Struct*>(pack->pBuffer);
|
||||||
|
buf->cereal_size = static_cast<uint32_t>(dyn_pack.Length());
|
||||||
|
memcpy(buf->cereal_data, dyn_pack.Data(), dyn_pack.Length());
|
||||||
|
|
||||||
|
SendPacket(pack.release());
|
||||||
|
}
|
||||||
|
|||||||
@@ -16,11 +16,12 @@ class ZoneServer : public WorldTCPConnection {
|
|||||||
public:
|
public:
|
||||||
ZoneServer(std::shared_ptr<EQ::Net::ServertalkServerConnection> in_connection, EQ::Net::ConsoleServer *in_console);
|
ZoneServer(std::shared_ptr<EQ::Net::ServertalkServerConnection> in_connection, EQ::Net::ConsoleServer *in_console);
|
||||||
~ZoneServer();
|
~ZoneServer();
|
||||||
void SendPacket(ServerPacket *pack) { m_connection->SendPacket(pack); }
|
void SendPacket(ServerPacket *pack) { m_connection->SendPacket(pack); }
|
||||||
void SetIsZoneConnected(bool in) { m_is_zone_connected = in; }
|
void SetIsZoneConnected(bool in) { m_is_zone_connected = in; }
|
||||||
bool GetIsZoneConnected() { return m_is_zone_connected; }
|
bool GetIsZoneConnected() { return m_is_zone_connected; }
|
||||||
void HandleMessage(uint16 opcode, const EQ::Net::Packet &p);
|
void HandleMessage(uint16 opcode, const EQ::Net::Packet &p);
|
||||||
std::string GetUUID() const { return m_connection->GetUUID(); }
|
std::string GetUUID() const { return m_connection->GetUUID(); }
|
||||||
|
void SendPlayerEventLogSettings();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<EQ::Net::ServertalkServerConnection> m_connection{};
|
std::shared_ptr<EQ::Net::ServertalkServerConnection> m_connection{};
|
||||||
|
|||||||
@@ -37,7 +37,6 @@
|
|||||||
|
|
||||||
EQEmuLogSys LogSys;
|
EQEmuLogSys LogSys;
|
||||||
WorldContentService content_service;
|
WorldContentService content_service;
|
||||||
ZoneStore zone_store;
|
|
||||||
PlayerEventLogs player_event_logs;
|
PlayerEventLogs player_event_logs;
|
||||||
EvolvingItemsManager evolving_items_manager;
|
EvolvingItemsManager evolving_items_manager;
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ public:
|
|||||||
TEST_ADD(StringUtilTest::EscapeStringTest);
|
TEST_ADD(StringUtilTest::EscapeStringTest);
|
||||||
TEST_ADD(StringUtilTest::SearchDeliminatedStringTest);
|
TEST_ADD(StringUtilTest::SearchDeliminatedStringTest);
|
||||||
TEST_ADD(StringUtilTest::SplitStringTest);
|
TEST_ADD(StringUtilTest::SplitStringTest);
|
||||||
TEST_ADD(StringUtilTest::FromCharsTest);
|
|
||||||
TEST_ADD(StringUtilTest::TestIsFloat);
|
TEST_ADD(StringUtilTest::TestIsFloat);
|
||||||
TEST_ADD(StringUtilTest::TestIsNumber);
|
TEST_ADD(StringUtilTest::TestIsNumber);
|
||||||
}
|
}
|
||||||
@@ -108,21 +107,6 @@ public:
|
|||||||
TEST_ASSERT(v[2] == "789");
|
TEST_ASSERT(v[2] == "789");
|
||||||
}
|
}
|
||||||
|
|
||||||
void FromCharsTest() {
|
|
||||||
char int_chars[] = "123";
|
|
||||||
int int_value = 0;
|
|
||||||
|
|
||||||
char float_chars[] = "3.14";
|
|
||||||
float float_value = 0.0f;
|
|
||||||
|
|
||||||
Strings::from_chars(int_chars, int_value);
|
|
||||||
TEST_ASSERT(int_value == 123);
|
|
||||||
|
|
||||||
Strings::from_chars(float_chars, float_value);
|
|
||||||
TEST_ASSERT(float_value == 3.14f);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void TestIsFloat() {
|
void TestIsFloat() {
|
||||||
TEST_ASSERT_EQUALS(Strings::IsFloat("0.23424523"), true);
|
TEST_ASSERT_EQUALS(Strings::IsFloat("0.23424523"), true);
|
||||||
TEST_ASSERT_EQUALS(Strings::IsFloat("12312312313.23424523"), true);
|
TEST_ASSERT_EQUALS(Strings::IsFloat("12312312313.23424523"), true);
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ Clientlist *g_Clientlist;
|
|||||||
EQEmuLogSys LogSys;
|
EQEmuLogSys LogSys;
|
||||||
UCSDatabase database;
|
UCSDatabase database;
|
||||||
WorldServer *worldserver = nullptr;
|
WorldServer *worldserver = nullptr;
|
||||||
ZoneStore zone_store;
|
|
||||||
PlayerEventLogs player_event_logs;
|
PlayerEventLogs player_event_logs;
|
||||||
|
|
||||||
const ucsconfig *Config;
|
const ucsconfig *Config;
|
||||||
|
|||||||
@@ -114,7 +114,8 @@ if ($requested_table_to_generate ne "all") {
|
|||||||
|
|
||||||
my @cereal_enabled_tables = (
|
my @cereal_enabled_tables = (
|
||||||
"data_buckets",
|
"data_buckets",
|
||||||
"player_event_logs"
|
"player_event_logs",
|
||||||
|
"player_event_log_settings"
|
||||||
);
|
);
|
||||||
|
|
||||||
my $generated_base_repository_files = "";
|
my $generated_base_repository_files = "";
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ ADD_EXECUTABLE(world ${world_sources} ${world_headers})
|
|||||||
INSTALL(TARGETS world RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
INSTALL(TARGETS world RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||||
|
|
||||||
IF (WIN32 AND EQEMU_BUILD_PCH)
|
IF (WIN32 AND EQEMU_BUILD_PCH)
|
||||||
TARGET_PRECOMPILE_HEADERS(world PRIVATE ../common/pch/pch.h)
|
TARGET_PRECOMPILE_HEADERS(world PRIVATE ../common/pch/std-pch.h)
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
ADD_DEFINITIONS(-DWORLD)
|
ADD_DEFINITIONS(-DWORLD)
|
||||||
|
|||||||
+2
-3
@@ -18,7 +18,6 @@
|
|||||||
extern ZSList zoneserver_list;
|
extern ZSList zoneserver_list;
|
||||||
extern ClientList client_list;
|
extern ClientList client_list;
|
||||||
extern AdventureManager adventure_manager;
|
extern AdventureManager adventure_manager;
|
||||||
extern EQ::Random emu_random;
|
|
||||||
|
|
||||||
Adventure::Adventure(AdventureTemplate *t)
|
Adventure::Adventure(AdventureTemplate *t)
|
||||||
{
|
{
|
||||||
@@ -368,8 +367,8 @@ void Adventure::MoveCorpsesToGraveyard()
|
|||||||
|
|
||||||
glm::vec4 position;
|
glm::vec4 position;
|
||||||
|
|
||||||
float x = GetTemplate()->graveyard_x + emu_random.Real(-GetTemplate()->graveyard_radius, GetTemplate()->graveyard_radius);
|
float x = GetTemplate()->graveyard_x + EQ::Random::Instance()->Real(-GetTemplate()->graveyard_radius, GetTemplate()->graveyard_radius);
|
||||||
float y = GetTemplate()->graveyard_y + emu_random.Real(-GetTemplate()->graveyard_radius, GetTemplate()->graveyard_radius);
|
float y = GetTemplate()->graveyard_y + EQ::Random::Instance()->Real(-GetTemplate()->graveyard_radius, GetTemplate()->graveyard_radius);
|
||||||
float z = GetTemplate()->graveyard_z;
|
float z = GetTemplate()->graveyard_z;
|
||||||
|
|
||||||
position.x = x;
|
position.x = x;
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
extern ZSList zoneserver_list;
|
extern ZSList zoneserver_list;
|
||||||
extern ClientList client_list;
|
extern ClientList client_list;
|
||||||
extern EQ::Random emu_random;
|
|
||||||
|
|
||||||
AdventureManager::AdventureManager()
|
AdventureManager::AdventureManager()
|
||||||
{
|
{
|
||||||
@@ -324,7 +323,7 @@ void AdventureManager::CalculateAdventureRequestReply(const char *data)
|
|||||||
if(eligible_adventures.size() > 0)
|
if(eligible_adventures.size() > 0)
|
||||||
{
|
{
|
||||||
ea_iter = eligible_adventures.begin();
|
ea_iter = eligible_adventures.begin();
|
||||||
int c_index = emu_random.Int(0, (eligible_adventures.size()-1));
|
int c_index = EQ::Random::Instance()->Int(0, (eligible_adventures.size()-1));
|
||||||
for(int i = 0; i < c_index; ++i)
|
for(int i = 0; i < c_index; ++i)
|
||||||
{
|
{
|
||||||
++ea_iter;
|
++ea_iter;
|
||||||
|
|||||||
+24
-4
@@ -36,6 +36,7 @@
|
|||||||
#include "../common/shareddb.h"
|
#include "../common/shareddb.h"
|
||||||
#include "../common/opcodemgr.h"
|
#include "../common/opcodemgr.h"
|
||||||
#include "../common/data_verification.h"
|
#include "../common/data_verification.h"
|
||||||
|
#include "../common/data_bucket.h"
|
||||||
|
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
#include "worlddb.h"
|
#include "worlddb.h"
|
||||||
@@ -91,7 +92,6 @@ std::vector<RaceClassCombos> character_create_race_class_combos;
|
|||||||
extern ZSList zoneserver_list;
|
extern ZSList zoneserver_list;
|
||||||
extern LoginServerList loginserverlist;
|
extern LoginServerList loginserverlist;
|
||||||
extern ClientList client_list;
|
extern ClientList client_list;
|
||||||
extern EQ::Random emu_random;
|
|
||||||
extern uint32 numclients;
|
extern uint32 numclients;
|
||||||
extern volatile bool RunLoops;
|
extern volatile bool RunLoops;
|
||||||
extern volatile bool UCSServerAvailable_;
|
extern volatile bool UCSServerAvailable_;
|
||||||
@@ -135,6 +135,8 @@ Client::Client(EQStreamInterface* ieqs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Client::~Client() {
|
Client::~Client() {
|
||||||
|
ClearDataBucketsCache();
|
||||||
|
|
||||||
if (RunLoops && cle && zone_id == 0)
|
if (RunLoops && cle && zone_id == 0)
|
||||||
cle->SetOnline(CLE_Status::Offline);
|
cle->SetOnline(CLE_Status::Offline);
|
||||||
|
|
||||||
@@ -477,6 +479,8 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app)
|
|||||||
LogClientLogin("Checking authentication id [{}]", id);
|
LogClientLogin("Checking authentication id [{}]", id);
|
||||||
|
|
||||||
if ((cle = client_list.CheckAuth(id, password))) {
|
if ((cle = client_list.CheckAuth(id, password))) {
|
||||||
|
LoadDataBucketsCache();
|
||||||
|
|
||||||
LogClientLogin("Checking authentication id [{}] passed", id);
|
LogClientLogin("Checking authentication id [{}] passed", id);
|
||||||
if (!is_player_zoning) {
|
if (!is_player_zoning) {
|
||||||
// Track who is in and who is out of the game
|
// Track who is in and who is out of the game
|
||||||
@@ -984,7 +988,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
|
|||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
|
|
||||||
// set mailkey - used for duration of character session
|
// set mailkey - used for duration of character session
|
||||||
int mail_key = emu_random.Int(1, INT_MAX);
|
int mail_key = EQ::Random::Instance()->Int(1, INT_MAX);
|
||||||
|
|
||||||
database.SetMailKey(charid, GetIP(), mail_key);
|
database.SetMailKey(charid, GetIP(), mail_key);
|
||||||
if (UCSServerAvailable_) {
|
if (UCSServerAvailable_) {
|
||||||
@@ -2171,7 +2175,7 @@ void Client::SetClassStartingSkills(PlayerProfile_Struct *pp)
|
|||||||
i == EQ::skills::SkillAlcoholTolerance || i == EQ::skills::SkillBindWound)
|
i == EQ::skills::SkillAlcoholTolerance || i == EQ::skills::SkillBindWound)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
pp->skills[i] = skill_caps.GetSkillCap(pp->class_, (EQ::skills::SkillType)i, 1).cap;
|
pp->skills[i] = SkillCaps::Instance()->GetSkillCap(pp->class_, (EQ::skills::SkillType)i, 1).cap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2369,7 +2373,7 @@ bool Client::StoreCharacter(
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string& zone_name = zone_store.GetZoneName(p_player_profile_struct->zone_id, true);
|
const std::string& zone_name = ZoneStore::Instance()->GetZoneName(p_player_profile_struct->zone_id, true);
|
||||||
if (Strings::EqualFold(zone_name, "UNKNOWN")) {
|
if (Strings::EqualFold(zone_name, "UNKNOWN")) {
|
||||||
p_player_profile_struct->zone_id = Zones::QEYNOS;
|
p_player_profile_struct->zone_id = Zones::QEYNOS;
|
||||||
}
|
}
|
||||||
@@ -2518,3 +2522,19 @@ void Client::SendUnsupportedClientPacket(const std::string& message)
|
|||||||
|
|
||||||
QueuePacket(&packet);
|
QueuePacket(&packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Client::LoadDataBucketsCache()
|
||||||
|
{
|
||||||
|
DataBucket::BulkLoadEntitiesToCache(DataBucketLoadType::Account, {GetAccountID()});
|
||||||
|
const auto ids = CharacterDataRepository::GetCharacterIDsByAccountID(database, GetAccountID());
|
||||||
|
DataBucket::BulkLoadEntitiesToCache(DataBucketLoadType::Client, ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Client::ClearDataBucketsCache()
|
||||||
|
{
|
||||||
|
DataBucket::DeleteFromCache(GetAccountID(), DataBucketLoadType::Account);
|
||||||
|
auto ids = CharacterDataRepository::GetCharacterIDsByAccountID(database, GetAccountID());
|
||||||
|
for (const auto& id : ids) {
|
||||||
|
DataBucket::DeleteFromCache(id, DataBucketLoadType::Client);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -121,6 +121,9 @@ private:
|
|||||||
bool CanTradeFVNoDropItem();
|
bool CanTradeFVNoDropItem();
|
||||||
void RecordPossibleHack(const std::string& message);
|
void RecordPossibleHack(const std::string& message);
|
||||||
void SendUnsupportedClientPacket(const std::string& message);
|
void SendUnsupportedClientPacket(const std::string& message);
|
||||||
|
|
||||||
|
void LoadDataBucketsCache();
|
||||||
|
void ClearDataBucketsCache();
|
||||||
};
|
};
|
||||||
|
|
||||||
bool CheckCharCreateInfoSoF(CharCreate_Struct *cc);
|
bool CheckCharCreateInfoSoF(CharCreate_Struct *cc);
|
||||||
|
|||||||
+44
-2
@@ -1219,7 +1219,7 @@ void ConsoleCrossZoneMove(
|
|||||||
const auto& zone_short_name = !Strings::IsNumber(args[2]) ? args[2] : "";
|
const auto& zone_short_name = !Strings::IsNumber(args[2]) ? args[2] : "";
|
||||||
const uint16 instance_id = Strings::IsNumber(args[2]) ? static_cast<uint16>(Strings::ToUnsignedInt(args[2])) : 0;
|
const uint16 instance_id = Strings::IsNumber(args[2]) ? static_cast<uint16>(Strings::ToUnsignedInt(args[2])) : 0;
|
||||||
|
|
||||||
const auto& z = !zone_short_name.empty() ? zone_store.GetZone(zone_short_name) : nullptr;
|
const auto& z = !zone_short_name.empty() ? ZoneStore::Instance()->GetZone(zone_short_name) : nullptr;
|
||||||
|
|
||||||
if (z && !z->id) {
|
if (z && !z->id) {
|
||||||
connection->SendLine(fmt::format("No zone with the short name '{}' exists.", zone_short_name));
|
connection->SendLine(fmt::format("No zone with the short name '{}' exists.", zone_short_name));
|
||||||
@@ -1289,7 +1289,7 @@ void ConsoleWorldWideMove(
|
|||||||
const auto& zone_short_name = !Strings::IsNumber(args[2]) ? args[2] : "";
|
const auto& zone_short_name = !Strings::IsNumber(args[2]) ? args[2] : "";
|
||||||
const uint16 instance_id = Strings::IsNumber(args[2]) ? static_cast<uint16>(Strings::ToUnsignedInt(args[2])) : 0;
|
const uint16 instance_id = Strings::IsNumber(args[2]) ? static_cast<uint16>(Strings::ToUnsignedInt(args[2])) : 0;
|
||||||
|
|
||||||
const auto& z = !zone_short_name.empty() ? zone_store.GetZone(zone_short_name) : nullptr;
|
const auto& z = !zone_short_name.empty() ? ZoneStore::Instance()->GetZone(zone_short_name) : nullptr;
|
||||||
|
|
||||||
if (z && !z->id) {
|
if (z && !z->id) {
|
||||||
connection->SendLine(fmt::format("No zone with the short name '{}' exists.", zone_short_name));
|
connection->SendLine(fmt::format("No zone with the short name '{}' exists.", zone_short_name));
|
||||||
@@ -1330,6 +1330,42 @@ void ConsoleWorldWideMove(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConsoleWWMarquee(
|
||||||
|
EQ::Net::ConsoleServerConnection* connection,
|
||||||
|
const std::string& command,
|
||||||
|
const std::vector<std::string>& args
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (args.size() < 2) {
|
||||||
|
connection->SendLine("Usage: wwmarquee <type> <message>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const uint32 type = Strings::IsNumber(args[0]) ? Strings::ToUnsignedInt(args[0]) : 0;
|
||||||
|
std::string message = Strings::Join(std::vector<std::string>(args.begin() + 1, args.end()), " ");
|
||||||
|
if (message.empty()) {
|
||||||
|
connection->SendLine("Message cannot be empty.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto pack = new ServerPacket(ServerOP_WWMarquee, sizeof(WWMarquee_Struct));
|
||||||
|
auto* wwm = (WWMarquee_Struct*)pack->pBuffer;
|
||||||
|
|
||||||
|
wwm->type = type;
|
||||||
|
wwm->priority = 510;
|
||||||
|
wwm->fade_in = 0;
|
||||||
|
wwm->fade_out = 0;
|
||||||
|
wwm->duration = 5000;
|
||||||
|
wwm->min_status = AccountStatus::Player;
|
||||||
|
wwm->max_status = AccountStatus::Player;
|
||||||
|
|
||||||
|
strn0cpy(wwm->message, message.c_str(), sizeof(wwm->message));
|
||||||
|
|
||||||
|
zoneserver_list.SendPacket(pack);
|
||||||
|
safe_delete(pack);
|
||||||
|
|
||||||
|
connection->SendLine(fmt::format("Sent world marquee type {}: {}", type, message));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param console
|
* @param console
|
||||||
@@ -1367,6 +1403,12 @@ void RegisterConsoleFunctions(std::unique_ptr<EQ::Net::ConsoleServer>& console)
|
|||||||
console->RegisterCall("whoami", 50, "whoami", std::bind(ConsoleWhoami, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
console->RegisterCall("whoami", 50, "whoami", std::bind(ConsoleWhoami, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||||
console->RegisterCall("worldshutdown", 200, "worldshutdown", std::bind(ConsoleWorldShutdown, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
console->RegisterCall("worldshutdown", 200, "worldshutdown", std::bind(ConsoleWorldShutdown, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||||
console->RegisterCall("wwcast", 50, "wwcast [spell_id] [min_status] [max_status] - min_status and max_status are optional", std::bind(ConsoleWorldWideCastSpell, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
console->RegisterCall("wwcast", 50, "wwcast [spell_id] [min_status] [max_status] - min_status and max_status are optional", std::bind(ConsoleWorldWideCastSpell, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||||
|
console->RegisterCall(
|
||||||
|
"wwmarquee",
|
||||||
|
50,
|
||||||
|
"wwmarquee <type> <message>",
|
||||||
|
std::bind(ConsoleWWMarquee, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)
|
||||||
|
);
|
||||||
console->RegisterCall("wwmove", 50, "wwmove [instance_id|zone_short_name] [min_status] [max_status] - min_status and max_status are optional, instance_id and zone_short_name are interchangeable", std::bind(ConsoleWorldWideMove, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
console->RegisterCall("wwmove", 50, "wwmove [instance_id|zone_short_name] [min_status] [max_status] - min_status and max_status are optional, instance_id and zone_short_name are interchangeable", std::bind(ConsoleWorldWideMove, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||||
console->RegisterCall("zonebootup", 150, "zonebootup [zone_server_id] [zone_short_name]", std::bind(ConsoleZoneBootup, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
console->RegisterCall("zonebootup", 150, "zonebootup [zone_server_id] [zone_short_name]", std::bind(ConsoleZoneBootup, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||||
console->RegisterCall("zonelock", 150, "zonelock [list|lock|unlock] [zone_short_name]", std::bind(ConsoleZoneLock, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
console->RegisterCall("zonelock", 150, "zonelock [list|lock|unlock] [zone_short_name]", std::bind(ConsoleZoneLock, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||||
|
|||||||
+1
-4
@@ -91,8 +91,6 @@
|
|||||||
#include "../common/repositories/character_parcels_repository.h"
|
#include "../common/repositories/character_parcels_repository.h"
|
||||||
#include "../common/ip_util.h"
|
#include "../common/ip_util.h"
|
||||||
|
|
||||||
SkillCaps skill_caps;
|
|
||||||
ZoneStore zone_store;
|
|
||||||
ClientList client_list;
|
ClientList client_list;
|
||||||
GroupLFPList LFPGroupList;
|
GroupLFPList LFPGroupList;
|
||||||
ZSList zoneserver_list;
|
ZSList zoneserver_list;
|
||||||
@@ -103,7 +101,6 @@ LauncherList launcher_list;
|
|||||||
AdventureManager adventure_manager;
|
AdventureManager adventure_manager;
|
||||||
WorldEventScheduler event_scheduler;
|
WorldEventScheduler event_scheduler;
|
||||||
SharedTaskManager shared_task_manager;
|
SharedTaskManager shared_task_manager;
|
||||||
EQ::Random emu_random;
|
|
||||||
volatile bool RunLoops = true;
|
volatile bool RunLoops = true;
|
||||||
uint32 numclients = 0;
|
uint32 numclients = 0;
|
||||||
uint32 numzones = 0;
|
uint32 numzones = 0;
|
||||||
@@ -206,7 +203,7 @@ int main(int argc, char **argv)
|
|||||||
->SetExpansionContext()
|
->SetExpansionContext()
|
||||||
->ReloadContentFlags();
|
->ReloadContentFlags();
|
||||||
|
|
||||||
skill_caps.SetContentDatabase(&content_db)->LoadSkillCaps();
|
SkillCaps::Instance()->SetContentDatabase(&content_db)->LoadSkillCaps();
|
||||||
|
|
||||||
std::unique_ptr<EQ::Net::ServertalkServer> server_connection;
|
std::unique_ptr<EQ::Net::ServertalkServer> server_connection;
|
||||||
server_connection = std::make_unique<EQ::Net::ServertalkServer>();
|
server_connection = std::make_unique<EQ::Net::ServertalkServer>();
|
||||||
|
|||||||
@@ -279,9 +279,9 @@ bool WorldBoot::DatabaseLoadRoutines(int argc, char **argv)
|
|||||||
|
|
||||||
LogInfo("Loading zones");
|
LogInfo("Loading zones");
|
||||||
|
|
||||||
zone_store.LoadZones(content_db);
|
ZoneStore::Instance()->LoadZones(content_db);
|
||||||
|
|
||||||
if (zone_store.GetZones().empty()) {
|
if (ZoneStore::Instance()->GetZones().empty()) {
|
||||||
LogError("Failed to load zones data, check your schema for possible errors");
|
LogError("Failed to load zones data, check your schema for possible errors");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-3
@@ -37,14 +37,15 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#include "dynamic_zone_manager.h"
|
#include "dynamic_zone_manager.h"
|
||||||
#include "ucs.h"
|
#include "ucs.h"
|
||||||
#include "clientlist.h"
|
#include "clientlist.h"
|
||||||
|
#include "queryserv.h"
|
||||||
#include "../common/repositories/trader_repository.h"
|
#include "../common/repositories/trader_repository.h"
|
||||||
#include "../common/repositories/buyer_repository.h"
|
#include "../common/repositories/buyer_repository.h"
|
||||||
|
|
||||||
extern uint32 numzones;
|
extern uint32 numzones;
|
||||||
extern EQ::Random emu_random;
|
|
||||||
extern WebInterfaceList web_interface;
|
extern WebInterfaceList web_interface;
|
||||||
extern SharedTaskManager shared_task_manager;
|
extern SharedTaskManager shared_task_manager;
|
||||||
extern ClientList client_list;
|
extern ClientList client_list;
|
||||||
|
extern QueryServConnection QSLink;
|
||||||
volatile bool UCSServerAvailable_ = false;
|
volatile bool UCSServerAvailable_ = false;
|
||||||
void CatchSignal(int sig_num);
|
void CatchSignal(int sig_num);
|
||||||
|
|
||||||
@@ -694,7 +695,7 @@ void ZSList::RebootZone(const char* ip1, uint16 port, const char* ip2, uint32 sk
|
|||||||
safe_delete_array(tmp);
|
safe_delete_array(tmp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uint32 z = emu_random.Int(0, y - 1);
|
uint32 z = EQ::Random::Instance()->Int(0, y - 1);
|
||||||
|
|
||||||
auto pack = new ServerPacket(ServerOP_ZoneReboot, sizeof(ServerZoneReboot_Struct));
|
auto pack = new ServerPacket(ServerOP_ZoneReboot, sizeof(ServerZoneReboot_Struct));
|
||||||
ServerZoneReboot_Struct* s = (ServerZoneReboot_Struct*)pack->pBuffer;
|
ServerZoneReboot_Struct* s = (ServerZoneReboot_Struct*)pack->pBuffer;
|
||||||
@@ -978,13 +979,14 @@ void ZSList::SendServerReload(ServerReload::Type type, uchar *packet)
|
|||||||
} else if (type == ServerReload::Type::Rules) {
|
} else if (type == ServerReload::Type::Rules) {
|
||||||
RuleManager::Instance()->LoadRules(&database, RuleManager::Instance()->GetActiveRuleset(), true);
|
RuleManager::Instance()->LoadRules(&database, RuleManager::Instance()->GetActiveRuleset(), true);
|
||||||
} else if (type == ServerReload::Type::SkillCaps) {
|
} else if (type == ServerReload::Type::SkillCaps) {
|
||||||
skill_caps.ReloadSkillCaps();
|
SkillCaps::Instance()->ReloadSkillCaps();
|
||||||
} else if (type == ServerReload::Type::ContentFlags) {
|
} else if (type == ServerReload::Type::ContentFlags) {
|
||||||
content_service.SetExpansionContext()->ReloadContentFlags();
|
content_service.SetExpansionContext()->ReloadContentFlags();
|
||||||
} else if (type == ServerReload::Type::Logs) {
|
} else if (type == ServerReload::Type::Logs) {
|
||||||
LogSys.LoadLogDatabaseSettings();
|
LogSys.LoadLogDatabaseSettings();
|
||||||
player_event_logs.ReloadSettings();
|
player_event_logs.ReloadSettings();
|
||||||
UCSLink.SendPacket(&pack);
|
UCSLink.SendPacket(&pack);
|
||||||
|
QSLink.SendPacket(&pack);
|
||||||
} else if (type == ServerReload::Type::Tasks) {
|
} else if (type == ServerReload::Type::Tasks) {
|
||||||
shared_task_manager.LoadTaskData();
|
shared_task_manager.LoadTaskData();
|
||||||
} else if (type == ServerReload::Type::DzTemplates) {
|
} else if (type == ServerReload::Type::DzTemplates) {
|
||||||
|
|||||||
+4
-5
@@ -480,11 +480,10 @@ ADD_EXECUTABLE(zone ${zone_sources} ${zone_headers})
|
|||||||
# binary output directory
|
# binary output directory
|
||||||
INSTALL(TARGETS zone RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
INSTALL(TARGETS zone RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||||
|
|
||||||
# precompile headers
|
# precompiled headers
|
||||||
IF (WIN32 AND EQEMU_BUILD_PCH)
|
IF (EQEMU_BUILD_PCH)
|
||||||
TARGET_PRECOMPILE_HEADERS(zone PRIVATE ../common/pch/pch.h)
|
TARGET_PRECOMPILE_HEADERS(zone PRIVATE ../common/pch/app-pch.h)
|
||||||
TARGET_PRECOMPILE_HEADERS(zone PRIVATE ../common/types.h ../common/eqemu_logsys.h ../common/eqemu_logsys_log_aliases.h ../common/features.h ../common/global_define.h)
|
TARGET_PRECOMPILE_HEADERS(zone PRIVATE ./pch/pch.h)
|
||||||
TARGET_PRECOMPILE_HEADERS(zone PRIVATE mob.h npc.h corpse.h doors.h bot.h entity.h client.h zone.h)
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
ADD_DEFINITIONS(-DZONE)
|
ADD_DEFINITIONS(-DZONE)
|
||||||
|
|||||||
+1
-1
@@ -2683,7 +2683,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
|||||||
give_exp_client->GetCleanName(),
|
give_exp_client->GetCleanName(),
|
||||||
GetNPCTypeID()
|
GetNPCTypeID()
|
||||||
);
|
);
|
||||||
task_manager->HandleUpdateTasksOnKill(give_exp_client, this);
|
TaskManager::Instance()->HandleUpdateTasksOnKill(give_exp_client, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (killer_raid) {
|
if (killer_raid) {
|
||||||
|
|||||||
+2
-2
@@ -1242,7 +1242,7 @@ uint16 Bot::GetPrimarySkillValue() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint16 Bot::MaxSkill(EQ::skills::SkillType skillid, uint16 class_, uint16 level) const {
|
uint16 Bot::MaxSkill(EQ::skills::SkillType skillid, uint16 class_, uint16 level) const {
|
||||||
return skill_caps.GetSkillCap(class_, skillid, level).cap;
|
return SkillCaps::Instance()->GetSkillCap(class_, skillid, level).cap;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Bot::GetTotalATK() {
|
uint32 Bot::GetTotalATK() {
|
||||||
@@ -7342,7 +7342,7 @@ void Bot::CalcBotStats(bool showtext) {
|
|||||||
SetLevel(GetBotOwner()->GetLevel());
|
SetLevel(GetBotOwner()->GetLevel());
|
||||||
|
|
||||||
for (int sindex = 0; sindex <= EQ::skills::HIGHEST_SKILL; ++sindex) {
|
for (int sindex = 0; sindex <= EQ::skills::HIGHEST_SKILL; ++sindex) {
|
||||||
skills[sindex] = skill_caps.GetSkillCap(GetClass(), (EQ::skills::SkillType)sindex, GetLevel()).cap;
|
skills[sindex] = SkillCaps::Instance()->GetSkillCap(GetClass(), (EQ::skills::SkillType)sindex, GetLevel()).cap;
|
||||||
}
|
}
|
||||||
|
|
||||||
taunt_timer.Start(1000);
|
taunt_timer.Start(1000);
|
||||||
|
|||||||
@@ -63,7 +63,6 @@
|
|||||||
|
|
||||||
extern QueryServ* QServ;
|
extern QueryServ* QServ;
|
||||||
extern WorldServer worldserver;
|
extern WorldServer worldserver;
|
||||||
extern TaskManager *task_manager;
|
|
||||||
|
|
||||||
int bot_command_count;
|
int bot_command_count;
|
||||||
|
|
||||||
|
|||||||
+50
-2
@@ -74,13 +74,61 @@ bool BotDatabase::LoadBotCommandSettings(std::map<std::string, std::pair<uint8,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T1, typename T2>
|
||||||
|
inline std::vector<std::string> join_pair(
|
||||||
|
const std::string &glue,
|
||||||
|
const std::pair<char, char> &encapsulation,
|
||||||
|
const std::vector<std::pair<T1, T2>> &src
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (src.empty()) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> output;
|
||||||
|
|
||||||
|
for (const std::pair<T1, T2> &src_iter: src) {
|
||||||
|
output.emplace_back(
|
||||||
|
|
||||||
|
fmt::format(
|
||||||
|
"{}{}{}{}{}{}{}",
|
||||||
|
encapsulation.first,
|
||||||
|
src_iter.first,
|
||||||
|
encapsulation.second,
|
||||||
|
glue,
|
||||||
|
encapsulation.first,
|
||||||
|
src_iter.second,
|
||||||
|
encapsulation.second
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
inline std::string
|
||||||
|
ImplodePair(const std::string &glue, const std::pair<char, char> &encapsulation, const std::vector<T> &src)
|
||||||
|
{
|
||||||
|
if (src.empty()) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
std::ostringstream oss;
|
||||||
|
for (const T &src_iter: src) {
|
||||||
|
oss << encapsulation.first << src_iter << encapsulation.second << glue;
|
||||||
|
}
|
||||||
|
std::string output(oss.str());
|
||||||
|
output.resize(output.size() - glue.size());
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
bool BotDatabase::UpdateInjectedBotCommandSettings(const std::vector<std::pair<std::string, uint8>> &injected)
|
bool BotDatabase::UpdateInjectedBotCommandSettings(const std::vector<std::pair<std::string, uint8>> &injected)
|
||||||
{
|
{
|
||||||
if (injected.size()) {
|
if (injected.size()) {
|
||||||
|
|
||||||
query = fmt::format(
|
query = fmt::format(
|
||||||
"REPLACE INTO `bot_command_settings`(`bot_command`, `access`) VALUES {}",
|
"REPLACE INTO `bot_command_settings`(`bot_command`, `access`) VALUES {}",
|
||||||
Strings::ImplodePair(
|
ImplodePair(
|
||||||
",",
|
",",
|
||||||
std::pair<char, char>('(', ')'),
|
std::pair<char, char>('(', ')'),
|
||||||
join_pair(",", std::pair<char, char>('\'', '\''), injected)
|
join_pair(",", std::pair<char, char>('\'', '\''), injected)
|
||||||
@@ -107,7 +155,7 @@ bool BotDatabase::UpdateOrphanedBotCommandSettings(const std::vector<std::string
|
|||||||
|
|
||||||
query = fmt::format(
|
query = fmt::format(
|
||||||
"DELETE FROM `bot_command_settings` WHERE `bot_command` IN ({})",
|
"DELETE FROM `bot_command_settings` WHERE `bot_command` IN ({})",
|
||||||
Strings::ImplodePair(",", std::pair<char, char>('\'', '\''), orphaned)
|
ImplodePair(",", std::pair<char, char>('\'', '\''), orphaned)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!database.QueryDatabase(query).Success()) {
|
if (!database.QueryDatabase(query).Success()) {
|
||||||
|
|||||||
@@ -195,6 +195,25 @@ void RunBenchmarkCycle(uint64_t target_rows)
|
|||||||
std::cout << "✅ Completed " << Strings::Commify(OPERATIONS_PER_TEST) << " cached reads in "
|
std::cout << "✅ Completed " << Strings::Commify(OPERATIONS_PER_TEST) << " cached reads in "
|
||||||
<< read_cached_time.count() << " seconds. (DataBucket::GetData)\n";
|
<< read_cached_time.count() << " seconds. (DataBucket::GetData)\n";
|
||||||
|
|
||||||
|
// 🔍 **Measure Client-Scoped Cache Miss Performance (Skips DB via CanCache)**
|
||||||
|
auto read_client_cache_miss_start = std::chrono::high_resolution_clock::now();
|
||||||
|
for (size_t i = 0; i < OPERATIONS_PER_TEST; ++i) {
|
||||||
|
// generate key that doesn't exist
|
||||||
|
std::string key = "nonexistent_key_" + std::to_string(i);
|
||||||
|
|
||||||
|
DataBucketKey k{
|
||||||
|
.key = key,
|
||||||
|
.character_id = 999999999, // use scoped value
|
||||||
|
};
|
||||||
|
|
||||||
|
DataBucket::GetData(k);
|
||||||
|
}
|
||||||
|
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::cout << "✅ Completed " << Strings::Commify(OPERATIONS_PER_TEST)
|
||||||
|
<< " scoped cache-miss reads (no DB) in "
|
||||||
|
<< read_client_cache_miss_time.count() << " seconds. (Client Scoped, Cache Miss, No DB)\n";
|
||||||
|
|
||||||
// 🔍 **Measure Non-Cached Read Performance (Direct Query)**
|
// 🔍 **Measure Non-Cached Read Performance (Direct Query)**
|
||||||
auto read_uncached_start = std::chrono::high_resolution_clock::now();
|
auto read_uncached_start = std::chrono::high_resolution_clock::now();
|
||||||
for (size_t i = 0; i < OPERATIONS_PER_TEST; ++i) {
|
for (size_t i = 0; i < OPERATIONS_PER_TEST; ++i) {
|
||||||
|
|||||||
+124
-19
@@ -5,16 +5,16 @@
|
|||||||
#include "../../client.h"
|
#include "../../client.h"
|
||||||
#include "../../common/net/eqstream.h"
|
#include "../../common/net/eqstream.h"
|
||||||
|
|
||||||
extern Zone *zone;
|
extern Zone* zone;
|
||||||
|
|
||||||
void ZoneCLI::TestDataBuckets(int argc, char **argv, argh::parser &cmd, std::string &description)
|
void ZoneCLI::TestDataBuckets(int argc, char** argv, argh::parser& cmd, std::string& description)
|
||||||
{
|
{
|
||||||
if (cmd[{"-h", "--help"}]) {
|
if (cmd[{"-h", "--help"}]) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 break_length = 50;
|
uint32 break_length = 50;
|
||||||
int failed_count = 0;
|
int failed_count = 0;
|
||||||
|
|
||||||
LogSys.SilenceConsoleLogging();
|
LogSys.SilenceConsoleLogging();
|
||||||
|
|
||||||
@@ -25,14 +25,36 @@ void ZoneCLI::TestDataBuckets(int argc, char **argv, argh::parser &cmd, std::str
|
|||||||
entity_list.Process();
|
entity_list.Process();
|
||||||
entity_list.MobProcess();
|
entity_list.MobProcess();
|
||||||
|
|
||||||
|
Client* client = new Client();
|
||||||
|
client->SetCharacterId(1); // Set a dummy character ID for testing
|
||||||
|
|
||||||
LogSys.EnableConsoleLogging();
|
LogSys.EnableConsoleLogging();
|
||||||
|
|
||||||
|
LogSys.log_settings[Logs::MySQLQuery].is_category_enabled = std::getenv("DEBUG") ? 1 : 0;
|
||||||
|
LogSys.log_settings[Logs::MySQLQuery].log_to_console = std::getenv("DEBUG") ? 3 : 0;
|
||||||
|
|
||||||
|
// 🧹 Delete all test keys before running tests
|
||||||
|
std::vector<std::string> test_keys_to_clear = {
|
||||||
|
"basic_key", "expiring_key", "cache_key", "json_key", "non_existent_key", "simple_key",
|
||||||
|
"nested", "nested.test1", "nested.test2", "nested.test1.a", "nested.test2.a",
|
||||||
|
"exp_test", "cache_test", "full_json", "full_json.key2", "complex", "complex.nested.obj1",
|
||||||
|
"complex.nested.obj2", "plain_string", "json_array", "nested_partial",
|
||||||
|
"nested_override", "empty_json", "json_string", "deep_nested",
|
||||||
|
"nested_expire", "scoped_miss_test", "scoped_nested_miss.key",
|
||||||
|
"cache_miss_overwrite", "missed_nested_set", "account_client_test", "ac_nested.test",
|
||||||
|
"scoped_db_only_key"
|
||||||
|
};
|
||||||
|
|
||||||
|
DataBucketsRepository::DeleteWhere(
|
||||||
|
database,
|
||||||
|
fmt::format("`key` IN ('{}')", Strings::Join(test_keys_to_clear, "','"))
|
||||||
|
);
|
||||||
|
DataBucket::ClearCache();
|
||||||
|
|
||||||
std::cout << "===========================================\n";
|
std::cout << "===========================================\n";
|
||||||
std::cout << "⚙\uFE0F> Running DataBuckets Tests...\n";
|
std::cout << "⚙\uFE0F> Running DataBuckets Tests...\n";
|
||||||
std::cout << "===========================================\n\n";
|
std::cout << "===========================================\n\n";
|
||||||
|
|
||||||
Client *client = new Client();
|
|
||||||
|
|
||||||
// Basic Key-Value Set/Get
|
// Basic Key-Value Set/Get
|
||||||
client->DeleteBucket("basic_key");
|
client->DeleteBucket("basic_key");
|
||||||
client->SetBucket("basic_key", "simple_value");
|
client->SetBucket("basic_key", "simple_value");
|
||||||
@@ -101,7 +123,7 @@ void ZoneCLI::TestDataBuckets(int argc, char **argv, argh::parser &cmd, std::str
|
|||||||
client->DeleteBucket("nested");
|
client->DeleteBucket("nested");
|
||||||
client->SetBucket("nested.test1.a", "value1");
|
client->SetBucket("nested.test1.a", "value1");
|
||||||
client->SetBucket("nested.test2.a", "value2");
|
client->SetBucket("nested.test2.a", "value2");
|
||||||
client->SetBucket("nested.test2", "new_value"); // Should be **rejected**
|
client->SetBucket("nested.test2", "new_value"); // Should be **rejected**
|
||||||
value = client->GetBucket("nested");
|
value = client->GetBucket("nested");
|
||||||
RunTest("Prevent Overwriting Objects", R"({"test1":{"a":"value1"},"test2":{"a":"value2"}})", value);
|
RunTest("Prevent Overwriting Objects", R"({"test1":{"a":"value1"},"test2":{"a":"value2"}})", value);
|
||||||
|
|
||||||
@@ -160,9 +182,10 @@ void ZoneCLI::TestDataBuckets(int argc, char **argv, argh::parser &cmd, std::str
|
|||||||
client->DeleteBucket("complex");
|
client->DeleteBucket("complex");
|
||||||
client->SetBucket("complex.nested.obj1", "data1");
|
client->SetBucket("complex.nested.obj1", "data1");
|
||||||
client->SetBucket("complex.nested.obj2", "data2");
|
client->SetBucket("complex.nested.obj2", "data2");
|
||||||
client->DeleteBucket("does_not_exist"); // Should do nothing
|
client->DeleteBucket("does_not_exist"); // Should do nothing
|
||||||
value = client->GetBucket("complex");
|
value = client->GetBucket("complex");
|
||||||
RunTest("Deleting Non-Existent Key Doesn't Break Existing Data", R"({"nested":{"obj1":"data1","obj2":"data2"}})", value);
|
RunTest("Deleting Non-Existent Key Doesn't Break Existing Data", R"({"nested":{"obj1":"data1","obj2":"data2"}})",
|
||||||
|
value);
|
||||||
|
|
||||||
// Get nested key value one level up **
|
// Get nested key value one level up **
|
||||||
client->DeleteBucket("complex");
|
client->DeleteBucket("complex");
|
||||||
@@ -190,12 +213,12 @@ void ZoneCLI::TestDataBuckets(int argc, char **argv, argh::parser &cmd, std::str
|
|||||||
value = client->GetBucket("json_array");
|
value = client->GetBucket("json_array");
|
||||||
RunTest("Store and Retrieve JSON Array", R"(["item1", "item2"])", value);
|
RunTest("Store and Retrieve JSON Array", R"(["item1", "item2"])", value);
|
||||||
|
|
||||||
// // Prevent Overwriting Array with Object**
|
// // Prevent Overwriting Array with Object**
|
||||||
// client->DeleteBucket("json_array");
|
// client->DeleteBucket("json_array");
|
||||||
// client->SetBucket("json_array", R"(["item1", "item2"])");
|
// client->SetBucket("json_array", R"(["item1", "item2"])");
|
||||||
// client->SetBucket("json_array.item", "new_value"); // Should be rejected
|
// client->SetBucket("json_array.item", "new_value"); // Should be rejected
|
||||||
// value = client->GetBucket("json_array");
|
// value = client->GetBucket("json_array");
|
||||||
// RunTest("Prevent Overwriting Array with Object", R"(["item1", "item2"])", value);
|
// RunTest("Prevent Overwriting Array with Object", R"(["item1", "item2"])", value);
|
||||||
|
|
||||||
// Retrieve Non-Existent Nested Key**
|
// Retrieve Non-Existent Nested Key**
|
||||||
client->DeleteBucket("nested_partial");
|
client->DeleteBucket("nested_partial");
|
||||||
@@ -235,11 +258,93 @@ void ZoneCLI::TestDataBuckets(int argc, char **argv, argh::parser &cmd, std::str
|
|||||||
RunTest("Setting a nested key with an expiration protection test", R"({"test":{"test":"shouldnt_expire"}})", value);
|
RunTest("Setting a nested key with an expiration protection test", R"({"test":{"test":"shouldnt_expire"}})", value);
|
||||||
|
|
||||||
// Delete Deep Nested Key Keeps Parent**
|
// Delete Deep Nested Key Keeps Parent**
|
||||||
// client->DeleteBucket("deep_nested");
|
// client->DeleteBucket("deep_nested");
|
||||||
// client->SetBucket("deep_nested.level1.level2.level3", R"({"key": "value"})");
|
// client->SetBucket("deep_nested.level1.level2.level3", R"({"key": "value"})");
|
||||||
// client->DeleteBucket("deep_nested.level1.level2.level3.key");
|
// client->DeleteBucket("deep_nested.level1.level2.level3.key");
|
||||||
// value = client->GetBucket("deep_nested.level1.level2.level3");
|
// value = client->GetBucket("deep_nested.level1.level2.level3");
|
||||||
// RunTest("Delete Deep Nested Key Keeps Parent", "{}", value);
|
// RunTest("Delete Deep Nested Key Keeps Parent", "{}", value);
|
||||||
|
|
||||||
|
// ================================
|
||||||
|
// 🧪 Scoped Cache-Miss Behavior Tests
|
||||||
|
// ================================
|
||||||
|
|
||||||
|
// Ensure a scoped key (character ID) that doesn't exist is not fetched from DB if not in cache
|
||||||
|
client->DeleteBucket("scoped_miss_test"); // Ensure not in DB
|
||||||
|
DataBucket::ClearCache(); // Clear all caches
|
||||||
|
std::string scoped_miss_value = client->GetBucket("scoped_miss_test");
|
||||||
|
RunTest("Scoped Missing Key Returns Empty (Skips DB)", "", scoped_miss_value);
|
||||||
|
|
||||||
|
// Ensure nested scoped key that isn't in cache returns empty immediately
|
||||||
|
client->DeleteBucket("scoped_nested_miss.key");
|
||||||
|
DataBucket::ClearCache(); // Clear cache again
|
||||||
|
std::string scoped_nested_miss = client->GetBucket("scoped_nested_miss.key");
|
||||||
|
RunTest("Nested Scoped Key Miss Returns Empty (Skips DB)", "", scoped_nested_miss);
|
||||||
|
|
||||||
|
// Write to a key that was previously missed (0-id cached miss)
|
||||||
|
client->DeleteBucket("cache_miss_overwrite");
|
||||||
|
DataBucket::ClearCache(); // Ensure clean slate
|
||||||
|
std::string missed_value = client->GetBucket("cache_miss_overwrite");
|
||||||
|
RunTest("Initial Cache Miss Returns Empty", "", missed_value);
|
||||||
|
client->SetBucket("cache_miss_overwrite", "new_value");
|
||||||
|
std::string new_val = client->GetBucket("cache_miss_overwrite");
|
||||||
|
RunTest("Overwrite After Cache Miss Works", "new_value", new_val);
|
||||||
|
|
||||||
|
// Write a nested key that previously missed
|
||||||
|
client->DeleteBucket("missed_nested_set.test");
|
||||||
|
DataBucket::ClearCache();
|
||||||
|
std::string initial = client->GetBucket("missed_nested_set.test");
|
||||||
|
RunTest("Missed Nested Key Returns Empty", "", initial);
|
||||||
|
client->SetBucket("missed_nested_set.test", "set_value");
|
||||||
|
std::string after_write = client->GetBucket("missed_nested_set.test");
|
||||||
|
RunTest("Nested Set After Miss Works", "set_value", after_write);
|
||||||
|
|
||||||
|
// ================================
|
||||||
|
// 🧪 Scoped Cache Preload Tests (Account + Client)
|
||||||
|
// ================================
|
||||||
|
|
||||||
|
// Clear everything for a clean test
|
||||||
|
// Insert directly into the DB without touching cache
|
||||||
|
const std::string scoped_key = "scoped_db_only_key";
|
||||||
|
client->DeleteBucket(scoped_key);
|
||||||
|
DataBucket::ClearCache();
|
||||||
|
|
||||||
|
// ✅ Scoped insert
|
||||||
|
DataBucketsRepository::InsertOne(
|
||||||
|
database, {
|
||||||
|
.key_ = scoped_key,
|
||||||
|
.value = "cached_value",
|
||||||
|
.character_id = client->CharacterID()
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// Cold cache test — should return ""
|
||||||
|
std::string cold_value = client->GetBucket(scoped_key);
|
||||||
|
RunTest("Cold Cache Scoped Key Returns Empty (Due to Skip DB)", "", cold_value);
|
||||||
|
|
||||||
|
// ✅ Reload cache
|
||||||
|
client->LoadDataBucketsCache();
|
||||||
|
|
||||||
|
// Cache should now return the value
|
||||||
|
std::string hot_value = client->GetBucket(scoped_key);
|
||||||
|
RunTest("Post-BulkLoad Scoped Key Returns Value", "cached_value", hot_value);
|
||||||
|
|
||||||
|
// Also test nested key after preload
|
||||||
|
client->DeleteBucket("ac_nested.test");
|
||||||
|
client->SetBucket("ac_nested.test", "nested_val");
|
||||||
|
|
||||||
|
// Clear cache, then preload
|
||||||
|
DataBucket::ClearCache();
|
||||||
|
client->LoadDataBucketsCache();
|
||||||
|
|
||||||
|
std::string nested_value = client->GetBucket("ac_nested.test");
|
||||||
|
RunTest("Post-BulkLoad Nested Scoped Key Returns Value", "nested_val", nested_value);
|
||||||
|
|
||||||
|
// Remove and check that cache misses properly again
|
||||||
|
client->DeleteBucket("ac_nested.test");
|
||||||
|
DataBucket::ClearCache();
|
||||||
|
std::string post_delete_check = client->GetBucket("ac_nested.test");
|
||||||
|
RunTest("Post-Delete Nested Scoped Key Returns Empty", "", post_delete_check);
|
||||||
|
|
||||||
|
|
||||||
std::cout << "\n===========================================\n";
|
std::cout << "\n===========================================\n";
|
||||||
std::cout << "✅ All DataBucket Tests Completed!\n";
|
std::cout << "✅ All DataBucket Tests Completed!\n";
|
||||||
|
|||||||
+20
-6
@@ -68,6 +68,7 @@ extern volatile bool RunLoops;
|
|||||||
#include "../common/repositories/character_disciplines_repository.h"
|
#include "../common/repositories/character_disciplines_repository.h"
|
||||||
#include "../common/repositories/character_data_repository.h"
|
#include "../common/repositories/character_data_repository.h"
|
||||||
#include "../common/repositories/character_pet_name_repository.h"
|
#include "../common/repositories/character_pet_name_repository.h"
|
||||||
|
#include "../common/repositories/completed_tasks_repository.h"
|
||||||
#include "../common/repositories/discovered_items_repository.h"
|
#include "../common/repositories/discovered_items_repository.h"
|
||||||
#include "../common/repositories/inventory_repository.h"
|
#include "../common/repositories/inventory_repository.h"
|
||||||
#include "../common/repositories/keyring_repository.h"
|
#include "../common/repositories/keyring_repository.h"
|
||||||
@@ -85,7 +86,6 @@ extern Zone* zone;
|
|||||||
extern volatile bool is_zone_loaded;
|
extern volatile bool is_zone_loaded;
|
||||||
extern WorldServer worldserver;
|
extern WorldServer worldserver;
|
||||||
extern uint32 numclients;
|
extern uint32 numclients;
|
||||||
extern PetitionList petition_list;
|
|
||||||
|
|
||||||
void UpdateWindowTitle(char* iNewTitle);
|
void UpdateWindowTitle(char* iNewTitle);
|
||||||
|
|
||||||
@@ -2232,7 +2232,7 @@ void Client::UpdateAdmin(bool from_database) {
|
|||||||
|
|
||||||
if (m_pp.gm) {
|
if (m_pp.gm) {
|
||||||
LogInfo("[{}] - [{}] is a GM", __FUNCTION__ , GetName());
|
LogInfo("[{}] - [{}] is a GM", __FUNCTION__ , GetName());
|
||||||
petition_list.UpdateGMQueue();
|
PetitionList::Instance()->UpdateGMQueue();
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateWho();
|
UpdateWho();
|
||||||
@@ -3196,7 +3196,7 @@ bool Client::CanHaveSkill(EQ::skills::SkillType skill_id) const
|
|||||||
skill_id = EQ::skills::Skill2HPiercing;
|
skill_id = EQ::skills::Skill2HPiercing;
|
||||||
}
|
}
|
||||||
|
|
||||||
return skill_caps.GetSkillCap(GetClass(), skill_id, RuleI(Character, MaxLevel)).cap > 0;
|
return SkillCaps::Instance()->GetSkillCap(GetClass(), skill_id, RuleI(Character, MaxLevel)).cap > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16 Client::MaxSkill(EQ::skills::SkillType skill_id, uint8 class_id, uint8 level) const
|
uint16 Client::MaxSkill(EQ::skills::SkillType skill_id, uint8 class_id, uint8 level) const
|
||||||
@@ -3209,7 +3209,7 @@ uint16 Client::MaxSkill(EQ::skills::SkillType skill_id, uint8 class_id, uint8 le
|
|||||||
skill_id = EQ::skills::Skill2HPiercing;
|
skill_id = EQ::skills::Skill2HPiercing;
|
||||||
}
|
}
|
||||||
|
|
||||||
return skill_caps.GetSkillCap(class_id, skill_id, level).cap;
|
return SkillCaps::Instance()->GetSkillCap(class_id, skill_id, level).cap;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Client::GetSkillTrainLevel(EQ::skills::SkillType skill_id, uint8 class_id)
|
uint8 Client::GetSkillTrainLevel(EQ::skills::SkillType skill_id, uint8 class_id)
|
||||||
@@ -3222,7 +3222,7 @@ uint8 Client::GetSkillTrainLevel(EQ::skills::SkillType skill_id, uint8 class_id)
|
|||||||
skill_id = EQ::skills::Skill2HPiercing;
|
skill_id = EQ::skills::Skill2HPiercing;
|
||||||
}
|
}
|
||||||
|
|
||||||
return skill_caps.GetSkillTrainLevel(class_id, skill_id, RuleI(Character, MaxLevel));
|
return SkillCaps::Instance()->GetSkillTrainLevel(class_id, skill_id, RuleI(Character, MaxLevel));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16 Client::GetMaxSkillAfterSpecializationRules(EQ::skills::SkillType skillid, uint16 maxSkill)
|
uint16 Client::GetMaxSkillAfterSpecializationRules(EQ::skills::SkillType skillid, uint16 maxSkill)
|
||||||
@@ -12099,7 +12099,7 @@ void Client::MaxSkills()
|
|||||||
auto current_skill_value = (
|
auto current_skill_value = (
|
||||||
EQ::skills::IsSpecializedSkill(s.first) ?
|
EQ::skills::IsSpecializedSkill(s.first) ?
|
||||||
MAX_SPECIALIZED_SKILL :
|
MAX_SPECIALIZED_SKILL :
|
||||||
skill_caps.GetSkillCap(GetClass(), s.first, GetLevel()).cap
|
SkillCaps::Instance()->GetSkillCap(GetClass(), s.first, GetLevel()).cap
|
||||||
);
|
);
|
||||||
|
|
||||||
if (GetSkill(s.first) < current_skill_value) {
|
if (GetSkill(s.first) < current_skill_value) {
|
||||||
@@ -13253,3 +13253,17 @@ void Client::CheckItemDiscoverability(uint32 item_id)
|
|||||||
|
|
||||||
DiscoverItem(item_id);
|
DiscoverItem(item_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Client::UncompleteTask(int task_id)
|
||||||
|
{
|
||||||
|
CompletedTasksRepository::DeleteWhere(
|
||||||
|
database,
|
||||||
|
fmt::format(
|
||||||
|
"charid = {} AND taskid = {}",
|
||||||
|
CharacterID(),
|
||||||
|
task_id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return task_state->UncompleteTask(task_id);
|
||||||
|
}
|
||||||
|
|||||||
+9
-6
@@ -98,7 +98,6 @@ namespace EQ
|
|||||||
#define MAX_SPECIALIZED_SKILL 50
|
#define MAX_SPECIALIZED_SKILL 50
|
||||||
|
|
||||||
extern Zone* zone;
|
extern Zone* zone;
|
||||||
extern TaskManager *task_manager;
|
|
||||||
|
|
||||||
class CLIENTPACKET
|
class CLIENTPACKET
|
||||||
{
|
{
|
||||||
@@ -1359,7 +1358,7 @@ public:
|
|||||||
}
|
}
|
||||||
inline bool SaveTaskState()
|
inline bool SaveTaskState()
|
||||||
{
|
{
|
||||||
return task_manager != nullptr && task_manager->SaveClientState(this, task_state);
|
return TaskManager::Instance()->SaveClientState(this, task_state);
|
||||||
}
|
}
|
||||||
inline bool IsTaskStateLoaded() { return task_state != nullptr; }
|
inline bool IsTaskStateLoaded() { return task_state != nullptr; }
|
||||||
inline bool IsTaskActive(int task_id) { return task_state != nullptr && task_state->IsTaskActive(task_id); }
|
inline bool IsTaskActive(int task_id) { return task_state != nullptr && task_state->IsTaskActive(task_id); }
|
||||||
@@ -1433,14 +1432,14 @@ public:
|
|||||||
}
|
}
|
||||||
inline void TaskSetSelector(Mob* mob, int task_set_id, bool ignore_cooldown)
|
inline void TaskSetSelector(Mob* mob, int task_set_id, bool ignore_cooldown)
|
||||||
{
|
{
|
||||||
if (task_manager && task_state) {
|
if (task_state) {
|
||||||
task_manager->TaskSetSelector(this, mob, task_set_id, ignore_cooldown);
|
TaskManager::Instance()->TaskSetSelector(this, mob, task_set_id, ignore_cooldown);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
inline void TaskQuestSetSelector(Mob* mob, const std::vector<int>& tasks, bool ignore_cooldown)
|
inline void TaskQuestSetSelector(Mob* mob, const std::vector<int>& tasks, bool ignore_cooldown)
|
||||||
{
|
{
|
||||||
if (task_manager && task_state) {
|
if (task_state) {
|
||||||
task_manager->TaskQuestSetSelector(this, mob, tasks, ignore_cooldown);
|
TaskManager::Instance()->TaskQuestSetSelector(this, mob, tasks, ignore_cooldown);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
inline void EnableTask(int task_count, int *task_list)
|
inline void EnableTask(int task_count, int *task_list)
|
||||||
@@ -1501,6 +1500,7 @@ public:
|
|||||||
{
|
{
|
||||||
return task_state ? task_state->CompleteTask(this, task_id) : false;
|
return task_state ? task_state->CompleteTask(this, task_id) : false;
|
||||||
}
|
}
|
||||||
|
bool UncompleteTask(int task_id);
|
||||||
inline void FailTask(int task_id) { if (task_state) { task_state->FailTask(this, task_id); }}
|
inline void FailTask(int task_id) { if (task_state) { task_state->FailTask(this, task_id); }}
|
||||||
inline int TaskTimeLeft(int task_id) { return (task_state ? task_state->TaskTimeLeft(task_id) : 0); }
|
inline int TaskTimeLeft(int task_id) { return (task_state ? task_state->TaskTimeLeft(task_id) : 0); }
|
||||||
inline int EnabledTaskCount(int task_set_id)
|
inline int EnabledTaskCount(int task_set_id)
|
||||||
@@ -1959,6 +1959,9 @@ public:
|
|||||||
ExternalHandinMoneyReturned GetExternalHandinMoneyReturned() { return m_external_handin_money_returned; }
|
ExternalHandinMoneyReturned GetExternalHandinMoneyReturned() { return m_external_handin_money_returned; }
|
||||||
std::vector<uint32_t> GetExternalHandinItemsReturned() { return m_external_handin_items_returned; }
|
std::vector<uint32_t> GetExternalHandinItemsReturned() { return m_external_handin_items_returned; }
|
||||||
|
|
||||||
|
// used only for testing
|
||||||
|
inline void SetCharacterId(uint32_t id) { character_id = id; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class Mob;
|
friend class Mob;
|
||||||
void CalcEdibleBonuses(StatBonuses* newbon);
|
void CalcEdibleBonuses(StatBonuses* newbon);
|
||||||
|
|||||||
@@ -337,24 +337,29 @@ bool Client::DoEvolveCheckProgression(EQ::ItemInstance &inst)
|
|||||||
!RuleB(EvolvingItems, DestroyAugmentsOnEvolve) &&
|
!RuleB(EvolvingItems, DestroyAugmentsOnEvolve) &&
|
||||||
inst.IsAugmented()
|
inst.IsAugmented()
|
||||||
) {
|
) {
|
||||||
auto const augs = inst.GetAugmentIDs();
|
auto const augs = inst.GetAugmentIDs();
|
||||||
std::vector<CharacterParcelsRepository::CharacterParcels> parcels;
|
std::vector<CharacterParcelsRepository::CharacterParcels> parcels;
|
||||||
for (auto const &item_id: augs) {
|
int32 next_slot = FindNextFreeParcelSlotUsingMemory();
|
||||||
if (!item_id) {
|
for (auto const &item_id: augs) {
|
||||||
continue;
|
if (!item_id) {
|
||||||
}
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
CharacterParcelsRepository::CharacterParcels p{};
|
if (next_slot == INVALID_INDEX) {
|
||||||
p.char_id = CharacterID();
|
break;
|
||||||
p.from_name = "Evolving Item Sub-System";
|
}
|
||||||
p.note = fmt::format(
|
|
||||||
"System automatically removed from {} which recently evolved.",
|
CharacterParcelsRepository::CharacterParcels p{};
|
||||||
inst.GetItem()->Name
|
p.char_id = CharacterID();
|
||||||
);
|
p.from_name = "Evolving Item Sub-System";
|
||||||
p.slot_id = FindNextFreeParcelSlotUsingMemory();
|
p.note = fmt::format(
|
||||||
p.sent_date = time(nullptr);
|
"System automatically removed from {} which recently evolved.",
|
||||||
p.item_id = item_id;
|
inst.GetItem()->Name
|
||||||
p.quantity = 1;
|
);
|
||||||
|
p.slot_id = next_slot;
|
||||||
|
p.sent_date = time(nullptr);
|
||||||
|
p.item_id = item_id;
|
||||||
|
p.quantity = 1;
|
||||||
|
|
||||||
if (player_event_logs.IsEventEnabled(PlayerEvent::PARCEL_SEND)) {
|
if (player_event_logs.IsEventEnabled(PlayerEvent::PARCEL_SEND)) {
|
||||||
PlayerEvent::ParcelSend e{};
|
PlayerEvent::ParcelSend e{};
|
||||||
@@ -367,8 +372,10 @@ bool Client::DoEvolveCheckProgression(EQ::ItemInstance &inst)
|
|||||||
RecordPlayerEventLog(PlayerEvent::PARCEL_SEND, e);
|
RecordPlayerEventLog(PlayerEvent::PARCEL_SEND, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
parcels.push_back(p);
|
parcels.push_back(p);
|
||||||
}
|
m_parcels.emplace(p.slot_id, p);
|
||||||
|
next_slot = FindNextFreeParcelSlotUsingMemory();
|
||||||
|
}
|
||||||
|
|
||||||
CharacterParcelsRepository::InsertMany(database, parcels);
|
CharacterParcelsRepository::InsertMany(database, parcels);
|
||||||
SendParcelStatus();
|
SendParcelStatus();
|
||||||
|
|||||||
+24
-25
@@ -79,7 +79,6 @@ extern QueryServ* QServ;
|
|||||||
extern Zone* zone;
|
extern Zone* zone;
|
||||||
extern volatile bool is_zone_loaded;
|
extern volatile bool is_zone_loaded;
|
||||||
extern WorldServer worldserver;
|
extern WorldServer worldserver;
|
||||||
extern PetitionList petition_list;
|
|
||||||
extern EntityList entity_list;
|
extern EntityList entity_list;
|
||||||
typedef void (Client::*ClientPacketProc)(const EQApplicationPacket *app);
|
typedef void (Client::*ClientPacketProc)(const EQApplicationPacket *app);
|
||||||
|
|
||||||
@@ -6963,7 +6962,7 @@ void Client::Handle_OP_GMSearchCorpse(const EQApplicationPacket *app)
|
|||||||
DialogueWindow::TableCell(
|
DialogueWindow::TableCell(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"{} ({})",
|
"{} ({})",
|
||||||
zone_store.GetZoneLongName(e.zone_id, true),
|
ZoneStore::Instance()->GetZoneLongName(e.zone_id, true),
|
||||||
e.zone_id
|
e.zone_id
|
||||||
)
|
)
|
||||||
) +
|
) +
|
||||||
@@ -11058,7 +11057,7 @@ void Client::Handle_OP_PDeletePetition(const EQApplicationPacket *app)
|
|||||||
LogError("Wrong size: OP_PDeletePetition, size=[{}], expected [{}]", app->size, 2);
|
LogError("Wrong size: OP_PDeletePetition, size=[{}], expected [{}]", app->size, 2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (petition_list.DeletePetitionByCharName((char*)app->pBuffer))
|
if (PetitionList::Instance()->DeletePetitionByCharName((char*)app->pBuffer))
|
||||||
MessageString(Chat::White, PETITION_DELETED);
|
MessageString(Chat::White, PETITION_DELETED);
|
||||||
else
|
else
|
||||||
MessageString(Chat::White, PETITION_NO_DELETE);
|
MessageString(Chat::White, PETITION_NO_DELETE);
|
||||||
@@ -11736,7 +11735,7 @@ void Client::Handle_OP_Petition(const EQApplicationPacket *app)
|
|||||||
}*/
|
}*/
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (petition_list.FindPetitionByAccountName(AccountName()))
|
if (PetitionList::Instance()->FindPetitionByAccountName(AccountName()))
|
||||||
{
|
{
|
||||||
Message(Chat::White, "You already have a petition in the queue, you must wait for it to be answered or use /deletepetition to delete it.");
|
Message(Chat::White, "You already have a petition in the queue, you must wait for it to be answered or use /deletepetition to delete it.");
|
||||||
return;
|
return;
|
||||||
@@ -11752,10 +11751,10 @@ void Client::Handle_OP_Petition(const EQApplicationPacket *app)
|
|||||||
pet->SetPetitionText((char*)app->pBuffer);
|
pet->SetPetitionText((char*)app->pBuffer);
|
||||||
pet->SetZone(zone->GetZoneID());
|
pet->SetZone(zone->GetZoneID());
|
||||||
pet->SetUrgency(0);
|
pet->SetUrgency(0);
|
||||||
petition_list.AddPetition(pet);
|
PetitionList::Instance()->AddPetition(pet);
|
||||||
database.InsertPetitionToDB(pet);
|
database.InsertPetitionToDB(pet);
|
||||||
petition_list.UpdateGMQueue();
|
PetitionList::Instance()->UpdateGMQueue();
|
||||||
petition_list.UpdateZoneListQueue();
|
PetitionList::Instance()->UpdateZoneListQueue();
|
||||||
worldserver.SendEmoteMessage(
|
worldserver.SendEmoteMessage(
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
@@ -11786,16 +11785,16 @@ void Client::Handle_OP_PetitionCheckIn(const EQApplicationPacket *app)
|
|||||||
}
|
}
|
||||||
Petition_Struct* inpet = (Petition_Struct*)app->pBuffer;
|
Petition_Struct* inpet = (Petition_Struct*)app->pBuffer;
|
||||||
|
|
||||||
Petition* pet = petition_list.GetPetitionByID(inpet->petnumber);
|
Petition* pet = PetitionList::Instance()->GetPetitionByID(inpet->petnumber);
|
||||||
//if (inpet->urgency != pet->GetUrgency())
|
//if (inpet->urgency != pet->GetUrgency())
|
||||||
pet->SetUrgency(inpet->urgency);
|
pet->SetUrgency(inpet->urgency);
|
||||||
pet->SetLastGM(GetName());
|
pet->SetLastGM(GetName());
|
||||||
pet->SetGMText(inpet->gmtext);
|
pet->SetGMText(inpet->gmtext);
|
||||||
|
|
||||||
pet->SetCheckedOut(false);
|
pet->SetCheckedOut(false);
|
||||||
petition_list.UpdatePetition(pet);
|
PetitionList::Instance()->UpdatePetition(pet);
|
||||||
petition_list.UpdateGMQueue();
|
PetitionList::Instance()->UpdateGMQueue();
|
||||||
petition_list.UpdateZoneListQueue();
|
PetitionList::Instance()->UpdateZoneListQueue();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -11809,14 +11808,14 @@ void Client::Handle_OP_PetitionCheckout(const EQApplicationPacket *app)
|
|||||||
Message(Chat::Red, "Error: World server disconnected");
|
Message(Chat::Red, "Error: World server disconnected");
|
||||||
else {
|
else {
|
||||||
uint32 getpetnum = *((uint32*)app->pBuffer);
|
uint32 getpetnum = *((uint32*)app->pBuffer);
|
||||||
Petition* getpet = petition_list.GetPetitionByID(getpetnum);
|
Petition* getpet = PetitionList::Instance()->GetPetitionByID(getpetnum);
|
||||||
if (getpet != 0) {
|
if (getpet != 0) {
|
||||||
getpet->AddCheckout();
|
getpet->AddCheckout();
|
||||||
getpet->SetCheckedOut(true);
|
getpet->SetCheckedOut(true);
|
||||||
getpet->SendPetitionToPlayer(CastToClient());
|
getpet->SendPetitionToPlayer(CastToClient());
|
||||||
petition_list.UpdatePetition(getpet);
|
PetitionList::Instance()->UpdatePetition(getpet);
|
||||||
petition_list.UpdateGMQueue();
|
PetitionList::Instance()->UpdateGMQueue();
|
||||||
petition_list.UpdateZoneListQueue();
|
PetitionList::Instance()->UpdateZoneListQueue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -11836,16 +11835,16 @@ void Client::Handle_OP_PetitionDelete(const EQApplicationPacket *app)
|
|||||||
pet->senttime = 0;
|
pet->senttime = 0;
|
||||||
strcpy(pet->accountid, "");
|
strcpy(pet->accountid, "");
|
||||||
strcpy(pet->gmsenttoo, "");
|
strcpy(pet->gmsenttoo, "");
|
||||||
pet->quetotal = petition_list.GetTotalPetitions();
|
pet->quetotal = PetitionList::Instance()->GetTotalPetitions();
|
||||||
strcpy(pet->charname, "");
|
strcpy(pet->charname, "");
|
||||||
FastQueuePacket(&outapp);
|
FastQueuePacket(&outapp);
|
||||||
|
|
||||||
if (petition_list.DeletePetition(pet->petnumber) == -1)
|
if (PetitionList::Instance()->DeletePetition(pet->petnumber) == -1)
|
||||||
std::cout << "Something is borked with: " << pet->petnumber << std::endl;
|
std::cout << "Something is borked with: " << pet->petnumber << std::endl;
|
||||||
petition_list.ClearPetitions();
|
PetitionList::Instance()->ClearPetitions();
|
||||||
petition_list.UpdateGMQueue();
|
PetitionList::Instance()->UpdateGMQueue();
|
||||||
petition_list.ReadDatabase();
|
PetitionList::Instance()->ReadDatabase();
|
||||||
petition_list.UpdateZoneListQueue();
|
PetitionList::Instance()->UpdateZoneListQueue();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -11880,12 +11879,12 @@ void Client::Handle_OP_PetitionUnCheckout(const EQApplicationPacket *app)
|
|||||||
Message(Chat::Red, "Error: World server disconnected");
|
Message(Chat::Red, "Error: World server disconnected");
|
||||||
else {
|
else {
|
||||||
uint32 getpetnum = *((uint32*)app->pBuffer);
|
uint32 getpetnum = *((uint32*)app->pBuffer);
|
||||||
Petition* getpet = petition_list.GetPetitionByID(getpetnum);
|
Petition* getpet = PetitionList::Instance()->GetPetitionByID(getpetnum);
|
||||||
if (getpet != 0) {
|
if (getpet != 0) {
|
||||||
getpet->SetCheckedOut(false);
|
getpet->SetCheckedOut(false);
|
||||||
petition_list.UpdatePetition(getpet);
|
PetitionList::Instance()->UpdatePetition(getpet);
|
||||||
petition_list.UpdateGMQueue();
|
PetitionList::Instance()->UpdateGMQueue();
|
||||||
petition_list.UpdateZoneListQueue();
|
PetitionList::Instance()->UpdateZoneListQueue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ extern QueryServ* QServ;
|
|||||||
extern Zone* zone;
|
extern Zone* zone;
|
||||||
extern volatile bool is_zone_loaded;
|
extern volatile bool is_zone_loaded;
|
||||||
extern WorldServer worldserver;
|
extern WorldServer worldserver;
|
||||||
extern PetitionList petition_list;
|
|
||||||
extern EntityList entity_list;
|
extern EntityList entity_list;
|
||||||
|
|
||||||
bool Client::Process() {
|
bool Client::Process() {
|
||||||
|
|||||||
@@ -34,7 +34,6 @@
|
|||||||
|
|
||||||
extern QueryServ* QServ;
|
extern QueryServ* QServ;
|
||||||
extern WorldServer worldserver;
|
extern WorldServer worldserver;
|
||||||
extern TaskManager *task_manager;
|
|
||||||
extern FastMath g_Math;
|
extern FastMath g_Math;
|
||||||
void CatchSignal(int sig_num);
|
void CatchSignal(int sig_num);
|
||||||
|
|
||||||
|
|||||||
+139
-127
@@ -1271,6 +1271,16 @@ void Perl__failtask(int task_id)
|
|||||||
quest_manager.failtask(task_id);
|
quest_manager.failtask(task_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Perl__completetask(int task_id)
|
||||||
|
{
|
||||||
|
return quest_manager.completetask(task_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Perl__uncompletetask(int task_id)
|
||||||
|
{
|
||||||
|
return quest_manager.uncompletetask(task_id);
|
||||||
|
}
|
||||||
|
|
||||||
int Perl__tasktimeleft(int task_id)
|
int Perl__tasktimeleft(int task_id)
|
||||||
{
|
{
|
||||||
return quest_manager.tasktimeleft(task_id);
|
return quest_manager.tasktimeleft(task_id);
|
||||||
@@ -5115,627 +5125,627 @@ void Perl__send_player_handin_event()
|
|||||||
|
|
||||||
float Perl__GetZoneSafeX(uint32 zone_id)
|
float Perl__GetZoneSafeX(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSafeCoordinates(zone_id).x;
|
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id).x;
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneSafeX(uint32 zone_id, int version)
|
float Perl__GetZoneSafeX(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSafeCoordinates(zone_id, version).x;
|
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id, version).x;
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneSafeY(uint32 zone_id)
|
float Perl__GetZoneSafeY(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSafeCoordinates(zone_id).y;
|
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id).y;
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneSafeY(uint32 zone_id, int version)
|
float Perl__GetZoneSafeY(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSafeCoordinates(zone_id, version).y;
|
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id, version).y;
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneSafeZ(uint32 zone_id)
|
float Perl__GetZoneSafeZ(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSafeCoordinates(zone_id).z;
|
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id).z;
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneSafeZ(uint32 zone_id, int version)
|
float Perl__GetZoneSafeZ(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSafeCoordinates(zone_id, version).z;
|
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id, version).z;
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneSafeHeading(uint32 zone_id)
|
float Perl__GetZoneSafeHeading(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSafeCoordinates(zone_id).w;
|
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id).w;
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneSafeHeading(uint32 zone_id, int version)
|
float Perl__GetZoneSafeHeading(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSafeCoordinates(zone_id, version).w;
|
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id, version).w;
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneGraveyardID(uint32 zone_id)
|
float Perl__GetZoneGraveyardID(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneGraveyardID(zone_id);
|
return ZoneStore::Instance()->GetZoneGraveyardID(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneGraveyardID(uint32 zone_id, int version)
|
float Perl__GetZoneGraveyardID(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneGraveyardID(zone_id, version);
|
return ZoneStore::Instance()->GetZoneGraveyardID(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneMinimumLevel(uint32 zone_id)
|
uint8 Perl__GetZoneMinimumLevel(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMinimumLevel(zone_id);
|
return ZoneStore::Instance()->GetZoneMinimumLevel(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneMinimumLevel(uint32 zone_id, int version)
|
uint8 Perl__GetZoneMinimumLevel(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMinimumLevel(zone_id, version);
|
return ZoneStore::Instance()->GetZoneMinimumLevel(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneMaximumLevel(uint32 zone_id)
|
uint8 Perl__GetZoneMaximumLevel(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMaximumLevel(zone_id);
|
return ZoneStore::Instance()->GetZoneMaximumLevel(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneMaximumLevel(uint32 zone_id, int version)
|
uint8 Perl__GetZoneMaximumLevel(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMaximumLevel(zone_id, version);
|
return ZoneStore::Instance()->GetZoneMaximumLevel(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneMinimumStatus(uint32 zone_id)
|
uint8 Perl__GetZoneMinimumStatus(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMinimumStatus(zone_id);
|
return ZoneStore::Instance()->GetZoneMinimumStatus(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneMinimumStatus(uint32 zone_id, int version)
|
uint8 Perl__GetZoneMinimumStatus(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMinimumStatus(zone_id, version);
|
return ZoneStore::Instance()->GetZoneMinimumStatus(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneTimeZone(uint32 zone_id)
|
int Perl__GetZoneTimeZone(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneTimeZone(zone_id);
|
return ZoneStore::Instance()->GetZoneTimeZone(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneTimeZone(uint32 zone_id, int version)
|
int Perl__GetZoneTimeZone(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneTimeZone(zone_id, version);
|
return ZoneStore::Instance()->GetZoneTimeZone(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneMaximumPlayers(uint32 zone_id)
|
int Perl__GetZoneMaximumPlayers(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMaximumPlayers(zone_id);
|
return ZoneStore::Instance()->GetZoneMaximumPlayers(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneMaximumPlayers(uint32 zone_id, int version)
|
int Perl__GetZoneMaximumPlayers(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMaximumPlayers(zone_id, version);
|
return ZoneStore::Instance()->GetZoneMaximumPlayers(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Perl__GetZoneRuleSet(uint32 zone_id)
|
uint32 Perl__GetZoneRuleSet(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneRuleSet(zone_id);
|
return ZoneStore::Instance()->GetZoneRuleSet(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Perl__GetZoneRuleSet(uint32 zone_id, int version)
|
uint32 Perl__GetZoneRuleSet(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneRuleSet(zone_id, version);
|
return ZoneStore::Instance()->GetZoneRuleSet(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Perl__GetZoneNote(uint32 zone_id)
|
std::string Perl__GetZoneNote(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneNote(zone_id);
|
return ZoneStore::Instance()->GetZoneNote(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Perl__GetZoneNote(uint32 zone_id, int version)
|
std::string Perl__GetZoneNote(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneNote(zone_id, version);
|
return ZoneStore::Instance()->GetZoneNote(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneUnderworld(uint32 zone_id)
|
float Perl__GetZoneUnderworld(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneUnderworld(zone_id);
|
return ZoneStore::Instance()->GetZoneUnderworld(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneUnderworld(uint32 zone_id, int version)
|
float Perl__GetZoneUnderworld(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneUnderworld(zone_id, version);
|
return ZoneStore::Instance()->GetZoneUnderworld(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneMinimumClip(uint32 zone_id)
|
float Perl__GetZoneMinimumClip(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMinimumClip(zone_id);
|
return ZoneStore::Instance()->GetZoneMinimumClip(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneMinimumClip(uint32 zone_id, int version)
|
float Perl__GetZoneMinimumClip(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMinimumClip(zone_id, version);
|
return ZoneStore::Instance()->GetZoneMinimumClip(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneMaximumClip(uint32 zone_id)
|
float Perl__GetZoneMaximumClip(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMaximumClip(zone_id);
|
return ZoneStore::Instance()->GetZoneMaximumClip(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneMaximumClip(uint32 zone_id, int version)
|
float Perl__GetZoneMaximumClip(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMaximumClip(zone_id, version);
|
return ZoneStore::Instance()->GetZoneMaximumClip(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneFogMinimumClip(uint32 zone_id)
|
float Perl__GetZoneFogMinimumClip(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogMinimumClip(zone_id);
|
return ZoneStore::Instance()->GetZoneFogMinimumClip(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneFogMinimumClip(uint32 zone_id, uint8 slot)
|
float Perl__GetZoneFogMinimumClip(uint32 zone_id, uint8 slot)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogMinimumClip(zone_id, slot);
|
return ZoneStore::Instance()->GetZoneFogMinimumClip(zone_id, slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneFogMinimumClip(uint32 zone_id, uint8 slot, int version)
|
float Perl__GetZoneFogMinimumClip(uint32 zone_id, uint8 slot, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogMinimumClip(zone_id, slot, version);
|
return ZoneStore::Instance()->GetZoneFogMinimumClip(zone_id, slot, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneFogMaximumClip(uint32 zone_id)
|
float Perl__GetZoneFogMaximumClip(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogMaximumClip(zone_id);
|
return ZoneStore::Instance()->GetZoneFogMaximumClip(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneFogMaximumClip(uint32 zone_id, uint8 slot)
|
float Perl__GetZoneFogMaximumClip(uint32 zone_id, uint8 slot)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogMaximumClip(zone_id, slot);
|
return ZoneStore::Instance()->GetZoneFogMaximumClip(zone_id, slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneFogMaximumClip(uint32 zone_id, uint8 slot, int version)
|
float Perl__GetZoneFogMaximumClip(uint32 zone_id, uint8 slot, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogMaximumClip(zone_id, slot, version);
|
return ZoneStore::Instance()->GetZoneFogMaximumClip(zone_id, slot, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneFogRed(uint32 zone_id)
|
uint8 Perl__GetZoneFogRed(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogRed(zone_id);
|
return ZoneStore::Instance()->GetZoneFogRed(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneFogRed(uint32 zone_id, uint8 slot)
|
uint8 Perl__GetZoneFogRed(uint32 zone_id, uint8 slot)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogRed(zone_id, slot);
|
return ZoneStore::Instance()->GetZoneFogRed(zone_id, slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneFogRed(uint32 zone_id, uint8 slot, int version)
|
uint8 Perl__GetZoneFogRed(uint32 zone_id, uint8 slot, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogRed(zone_id, slot, version);
|
return ZoneStore::Instance()->GetZoneFogRed(zone_id, slot, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneFogGreen(uint32 zone_id)
|
uint8 Perl__GetZoneFogGreen(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogGreen(zone_id);
|
return ZoneStore::Instance()->GetZoneFogGreen(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneFogGreen(uint32 zone_id, uint8 slot)
|
uint8 Perl__GetZoneFogGreen(uint32 zone_id, uint8 slot)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogGreen(zone_id, slot);
|
return ZoneStore::Instance()->GetZoneFogGreen(zone_id, slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneFogGreen(uint32 zone_id, uint8 slot, int version)
|
uint8 Perl__GetZoneFogGreen(uint32 zone_id, uint8 slot, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogGreen(zone_id, slot, version);
|
return ZoneStore::Instance()->GetZoneFogGreen(zone_id, slot, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneFogBlue(uint32 zone_id)
|
uint8 Perl__GetZoneFogBlue(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogBlue(zone_id);
|
return ZoneStore::Instance()->GetZoneFogBlue(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneFogBlue(uint32 zone_id, uint8 slot)
|
uint8 Perl__GetZoneFogBlue(uint32 zone_id, uint8 slot)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogBlue(zone_id, slot);
|
return ZoneStore::Instance()->GetZoneFogBlue(zone_id, slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneFogBlue(uint32 zone_id, uint8 slot, int version)
|
uint8 Perl__GetZoneFogBlue(uint32 zone_id, uint8 slot, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogBlue(zone_id, slot, version);
|
return ZoneStore::Instance()->GetZoneFogBlue(zone_id, slot, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneSky(uint32 zone_id)
|
uint8 Perl__GetZoneSky(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSky(zone_id);
|
return ZoneStore::Instance()->GetZoneSky(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneSky(uint32 zone_id, int version)
|
uint8 Perl__GetZoneSky(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSky(zone_id, version);
|
return ZoneStore::Instance()->GetZoneSky(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneZType(uint32 zone_id)
|
uint8 Perl__GetZoneZType(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneZType(zone_id);
|
return ZoneStore::Instance()->GetZoneZType(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneZType(uint32 zone_id, int version)
|
uint8 Perl__GetZoneZType(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneZType(zone_id, version);
|
return ZoneStore::Instance()->GetZoneZType(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneExperienceMultiplier(uint32 zone_id)
|
float Perl__GetZoneExperienceMultiplier(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneExperienceMultiplier(zone_id);
|
return ZoneStore::Instance()->GetZoneExperienceMultiplier(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneExperienceMultiplier(uint32 zone_id, int version)
|
float Perl__GetZoneExperienceMultiplier(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneExperienceMultiplier(zone_id, version);
|
return ZoneStore::Instance()->GetZoneExperienceMultiplier(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneWalkSpeed(uint32 zone_id)
|
float Perl__GetZoneWalkSpeed(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneWalkSpeed(zone_id);
|
return ZoneStore::Instance()->GetZoneWalkSpeed(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneWalkSpeed(uint32 zone_id, int version)
|
float Perl__GetZoneWalkSpeed(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneWalkSpeed(zone_id, version);
|
return ZoneStore::Instance()->GetZoneWalkSpeed(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneTimeType(uint32 zone_id)
|
uint8 Perl__GetZoneTimeType(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneTimeType(zone_id);
|
return ZoneStore::Instance()->GetZoneTimeType(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneTimeType(uint32 zone_id, int version)
|
uint8 Perl__GetZoneTimeType(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneTimeType(zone_id, version);
|
return ZoneStore::Instance()->GetZoneTimeType(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneFogDensity(uint32 zone_id)
|
float Perl__GetZoneFogDensity(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogDensity(zone_id);
|
return ZoneStore::Instance()->GetZoneFogDensity(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneFogDensity(uint32 zone_id, int version)
|
float Perl__GetZoneFogDensity(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogDensity(zone_id, version);
|
return ZoneStore::Instance()->GetZoneFogDensity(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Perl__GetZoneFlagNeeded(uint32 zone_id)
|
std::string Perl__GetZoneFlagNeeded(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFlagNeeded(zone_id);
|
return ZoneStore::Instance()->GetZoneFlagNeeded(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Perl__GetZoneFlagNeeded(uint32 zone_id, int version)
|
std::string Perl__GetZoneFlagNeeded(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFlagNeeded(zone_id, version);
|
return ZoneStore::Instance()->GetZoneFlagNeeded(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Perl__GetZoneCanBind(uint32 zone_id)
|
int8 Perl__GetZoneCanBind(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneCanBind(zone_id);
|
return ZoneStore::Instance()->GetZoneCanBind(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Perl__GetZoneCanBind(uint32 zone_id, int version)
|
int8 Perl__GetZoneCanBind(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneCanBind(zone_id, version);
|
return ZoneStore::Instance()->GetZoneCanBind(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Perl__GetZoneCanCombat(uint32 zone_id)
|
int8 Perl__GetZoneCanCombat(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneCanCombat(zone_id);
|
return ZoneStore::Instance()->GetZoneCanCombat(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Perl__GetZoneCanCombat(uint32 zone_id, int version)
|
int8 Perl__GetZoneCanCombat(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneCanCombat(zone_id, version);
|
return ZoneStore::Instance()->GetZoneCanCombat(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Perl__GetZoneCanLevitate(uint32 zone_id)
|
int8 Perl__GetZoneCanLevitate(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneCanLevitate(zone_id);
|
return ZoneStore::Instance()->GetZoneCanLevitate(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Perl__GetZoneCanLevitate(uint32 zone_id, int version)
|
int8 Perl__GetZoneCanLevitate(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneCanLevitate(zone_id, version);
|
return ZoneStore::Instance()->GetZoneCanLevitate(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Perl__GetZoneCastOutdoor(uint32 zone_id)
|
int8 Perl__GetZoneCastOutdoor(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneCastOutdoor(zone_id);
|
return ZoneStore::Instance()->GetZoneCastOutdoor(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Perl__GetZoneCastOutdoor(uint32 zone_id, int version)
|
int8 Perl__GetZoneCastOutdoor(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneCastOutdoor(zone_id, version);
|
return ZoneStore::Instance()->GetZoneCastOutdoor(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneHotzone(uint32 zone_id)
|
uint8 Perl__GetZoneHotzone(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneHotzone(zone_id);
|
return ZoneStore::Instance()->GetZoneHotzone(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneHotzone(uint32 zone_id, int version)
|
uint8 Perl__GetZoneHotzone(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneHotzone(zone_id, version);
|
return ZoneStore::Instance()->GetZoneHotzone(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneInstanceType(uint32 zone_id)
|
uint8 Perl__GetZoneInstanceType(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneInstanceType(zone_id);
|
return ZoneStore::Instance()->GetZoneInstanceType(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneInstanceType(uint32 zone_id, int version)
|
uint8 Perl__GetZoneInstanceType(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneInstanceType(zone_id, version);
|
return ZoneStore::Instance()->GetZoneInstanceType(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64 Perl__GetZoneShutdownDelay(uint32 zone_id)
|
uint64 Perl__GetZoneShutdownDelay(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneShutdownDelay(zone_id);
|
return ZoneStore::Instance()->GetZoneShutdownDelay(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64 Perl__GetZoneShutdownDelay(uint32 zone_id, int version)
|
uint64 Perl__GetZoneShutdownDelay(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneShutdownDelay(zone_id, version);
|
return ZoneStore::Instance()->GetZoneShutdownDelay(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Perl__GetZonePEQZone(uint32 zone_id)
|
int8 Perl__GetZonePEQZone(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZonePEQZone(zone_id);
|
return ZoneStore::Instance()->GetZonePEQZone(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Perl__GetZonePEQZone(uint32 zone_id, int version)
|
int8 Perl__GetZonePEQZone(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZonePEQZone(zone_id, version);
|
return ZoneStore::Instance()->GetZonePEQZone(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Perl__GetZoneExpansion(uint32 zone_id)
|
int8 Perl__GetZoneExpansion(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneExpansion(zone_id);
|
return ZoneStore::Instance()->GetZoneExpansion(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Perl__GetZoneExpansion(uint32 zone_id, int version)
|
int8 Perl__GetZoneExpansion(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneExpansion(zone_id, version);
|
return ZoneStore::Instance()->GetZoneExpansion(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Perl__GetZoneBypassExpansionCheck(uint32 zone_id)
|
int8 Perl__GetZoneBypassExpansionCheck(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneBypassExpansionCheck(zone_id);
|
return ZoneStore::Instance()->GetZoneBypassExpansionCheck(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Perl__GetZoneBypassExpansionCheck(uint32 zone_id, int version)
|
int8 Perl__GetZoneBypassExpansionCheck(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneBypassExpansionCheck(zone_id, version);
|
return ZoneStore::Instance()->GetZoneBypassExpansionCheck(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneSuspendBuffs(uint32 zone_id)
|
uint8 Perl__GetZoneSuspendBuffs(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSuspendBuffs(zone_id);
|
return ZoneStore::Instance()->GetZoneSuspendBuffs(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneSuspendBuffs(uint32 zone_id, int version)
|
uint8 Perl__GetZoneSuspendBuffs(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSuspendBuffs(zone_id, version);
|
return ZoneStore::Instance()->GetZoneSuspendBuffs(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneRainChance(uint32 zone_id)
|
int Perl__GetZoneRainChance(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneRainChance(zone_id);
|
return ZoneStore::Instance()->GetZoneRainChance(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneRainChance(uint32 zone_id, uint8 slot)
|
int Perl__GetZoneRainChance(uint32 zone_id, uint8 slot)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneRainChance(zone_id, slot);
|
return ZoneStore::Instance()->GetZoneRainChance(zone_id, slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneRainChance(uint32 zone_id, uint8 slot, int version)
|
int Perl__GetZoneRainChance(uint32 zone_id, uint8 slot, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneRainChance(zone_id, slot, version);
|
return ZoneStore::Instance()->GetZoneRainChance(zone_id, slot, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneRainDuration(uint32 zone_id)
|
int Perl__GetZoneRainDuration(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneRainDuration(zone_id);
|
return ZoneStore::Instance()->GetZoneRainDuration(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneRainDuration(uint32 zone_id, uint8 slot)
|
int Perl__GetZoneRainDuration(uint32 zone_id, uint8 slot)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneRainDuration(zone_id, slot);
|
return ZoneStore::Instance()->GetZoneRainDuration(zone_id, slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneRainDuration(uint32 zone_id, uint8 slot, int version)
|
int Perl__GetZoneRainDuration(uint32 zone_id, uint8 slot, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneRainDuration(zone_id, slot, version);
|
return ZoneStore::Instance()->GetZoneRainDuration(zone_id, slot, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneSnowChance(uint32 zone_id)
|
int Perl__GetZoneSnowChance(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSnowChance(zone_id);
|
return ZoneStore::Instance()->GetZoneSnowChance(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneSnowChance(uint32 zone_id, uint8 slot)
|
int Perl__GetZoneSnowChance(uint32 zone_id, uint8 slot)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSnowChance(zone_id, slot);
|
return ZoneStore::Instance()->GetZoneSnowChance(zone_id, slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneSnowChance(uint32 zone_id, uint8 slot, int version)
|
int Perl__GetZoneSnowChance(uint32 zone_id, uint8 slot, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSnowChance(zone_id, slot, version);
|
return ZoneStore::Instance()->GetZoneSnowChance(zone_id, slot, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneSnowDuration(uint32 zone_id)
|
int Perl__GetZoneSnowDuration(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSnowDuration(zone_id);
|
return ZoneStore::Instance()->GetZoneSnowDuration(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneSnowDuration(uint32 zone_id, uint8 slot)
|
int Perl__GetZoneSnowDuration(uint32 zone_id, uint8 slot)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSnowDuration(zone_id, slot);
|
return ZoneStore::Instance()->GetZoneSnowDuration(zone_id, slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneSnowDuration(uint32 zone_id, uint8 slot, int version)
|
int Perl__GetZoneSnowDuration(uint32 zone_id, uint8 slot, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSnowDuration(zone_id, slot, version);
|
return ZoneStore::Instance()->GetZoneSnowDuration(zone_id, slot, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneGravity(uint32 zone_id)
|
float Perl__GetZoneGravity(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneGravity(zone_id);
|
return ZoneStore::Instance()->GetZoneGravity(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl__GetZoneGravity(uint32 zone_id, int version)
|
float Perl__GetZoneGravity(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneGravity(zone_id, version);
|
return ZoneStore::Instance()->GetZoneGravity(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneType(uint32 zone_id)
|
int Perl__GetZoneType(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneType(zone_id);
|
return ZoneStore::Instance()->GetZoneType(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneType(uint32 zone_id, int version)
|
int Perl__GetZoneType(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneType(zone_id, version);
|
return ZoneStore::Instance()->GetZoneType(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Perl__GetZoneSkyLock(uint32 zone_id)
|
int8 Perl__GetZoneSkyLock(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSkyLock(zone_id);
|
return ZoneStore::Instance()->GetZoneSkyLock(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Perl__GetZoneSkyLock(uint32 zone_id, int version)
|
int8 Perl__GetZoneSkyLock(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSkyLock(zone_id, version);
|
return ZoneStore::Instance()->GetZoneSkyLock(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneFastRegenHP(uint32 zone_id)
|
int Perl__GetZoneFastRegenHP(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFastRegenHP(zone_id);
|
return ZoneStore::Instance()->GetZoneFastRegenHP(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneFastRegenHP(uint32 zone_id, int version)
|
int Perl__GetZoneFastRegenHP(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFastRegenHP(zone_id, version);
|
return ZoneStore::Instance()->GetZoneFastRegenHP(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneFastRegenMana(uint32 zone_id)
|
int Perl__GetZoneFastRegenMana(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFastRegenMana(zone_id);
|
return ZoneStore::Instance()->GetZoneFastRegenMana(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneFastRegenMana(uint32 zone_id, int version)
|
int Perl__GetZoneFastRegenMana(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFastRegenMana(zone_id, version);
|
return ZoneStore::Instance()->GetZoneFastRegenMana(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneFastRegenEndurance(uint32 zone_id)
|
int Perl__GetZoneFastRegenEndurance(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFastRegenEndurance(zone_id);
|
return ZoneStore::Instance()->GetZoneFastRegenEndurance(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneFastRegenEndurance(uint32 zone_id, int version)
|
int Perl__GetZoneFastRegenEndurance(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFastRegenEndurance(zone_id, version);
|
return ZoneStore::Instance()->GetZoneFastRegenEndurance(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneNPCMaximumAggroDistance(uint32 zone_id)
|
int Perl__GetZoneNPCMaximumAggroDistance(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneNPCMaximumAggroDistance(zone_id);
|
return ZoneStore::Instance()->GetZoneNPCMaximumAggroDistance(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneNPCMaximumAggroDistance(uint32 zone_id, int version)
|
int Perl__GetZoneNPCMaximumAggroDistance(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneNPCMaximumAggroDistance(zone_id, version);
|
return ZoneStore::Instance()->GetZoneNPCMaximumAggroDistance(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Perl__GetZoneMinimumExpansion(uint32 zone_id)
|
int8 Perl__GetZoneMinimumExpansion(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMinimumExpansion(zone_id);
|
return ZoneStore::Instance()->GetZoneMinimumExpansion(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Perl__GetZoneMinimumExpansion(uint32 zone_id, int version)
|
int8 Perl__GetZoneMinimumExpansion(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMinimumExpansion(zone_id, version);
|
return ZoneStore::Instance()->GetZoneMinimumExpansion(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Perl__GetZoneMaximumExpansion(uint32 zone_id)
|
int8 Perl__GetZoneMaximumExpansion(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMaximumExpansion(zone_id);
|
return ZoneStore::Instance()->GetZoneMaximumExpansion(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Perl__GetZoneMaximumExpansion(uint32 zone_id, int version)
|
int8 Perl__GetZoneMaximumExpansion(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMaximumExpansion(zone_id, version);
|
return ZoneStore::Instance()->GetZoneMaximumExpansion(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Perl__GetZoneContentFlags(uint32 zone_id)
|
std::string Perl__GetZoneContentFlags(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneContentFlags(zone_id);
|
return ZoneStore::Instance()->GetZoneContentFlags(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Perl__GetZoneContentFlags(uint32 zone_id, int version)
|
std::string Perl__GetZoneContentFlags(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneContentFlags(zone_id, version);
|
return ZoneStore::Instance()->GetZoneContentFlags(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Perl__GetZoneContentFlagsDisabled(uint32 zone_id)
|
std::string Perl__GetZoneContentFlagsDisabled(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneContentFlagsDisabled(zone_id);
|
return ZoneStore::Instance()->GetZoneContentFlagsDisabled(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Perl__GetZoneContentFlagsDisabled(uint32 zone_id, int version)
|
std::string Perl__GetZoneContentFlagsDisabled(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneContentFlagsDisabled(zone_id, version);
|
return ZoneStore::Instance()->GetZoneContentFlagsDisabled(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneUnderworldTeleportIndex(uint32 zone_id)
|
int Perl__GetZoneUnderworldTeleportIndex(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneUnderworldTeleportIndex(zone_id);
|
return ZoneStore::Instance()->GetZoneUnderworldTeleportIndex(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneUnderworldTeleportIndex(uint32 zone_id, int version)
|
int Perl__GetZoneUnderworldTeleportIndex(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneUnderworldTeleportIndex(zone_id, version);
|
return ZoneStore::Instance()->GetZoneUnderworldTeleportIndex(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneLavaDamage(uint32 zone_id)
|
int Perl__GetZoneLavaDamage(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneLavaDamage(zone_id);
|
return ZoneStore::Instance()->GetZoneLavaDamage(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneLavaDamage(uint32 zone_id, int version)
|
int Perl__GetZoneLavaDamage(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneLavaDamage(zone_id, version);
|
return ZoneStore::Instance()->GetZoneLavaDamage(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneMinimumLavaDamage(uint32 zone_id)
|
int Perl__GetZoneMinimumLavaDamage(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMinimumLavaDamage(zone_id);
|
return ZoneStore::Instance()->GetZoneMinimumLavaDamage(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__GetZoneMinimumLavaDamage(uint32 zone_id, int version)
|
int Perl__GetZoneMinimumLavaDamage(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMinimumLavaDamage(zone_id, version);
|
return ZoneStore::Instance()->GetZoneMinimumLavaDamage(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneIdleWhenEmpty(uint32 zone_id)
|
uint8 Perl__GetZoneIdleWhenEmpty(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneIdleWhenEmpty(zone_id);
|
return ZoneStore::Instance()->GetZoneIdleWhenEmpty(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl__GetZoneIdleWhenEmpty(uint32 zone_id, int version)
|
uint8 Perl__GetZoneIdleWhenEmpty(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneIdleWhenEmpty(zone_id, version);
|
return ZoneStore::Instance()->GetZoneIdleWhenEmpty(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Perl__GetZoneSecondsBeforeIdle(uint32 zone_id)
|
uint32 Perl__GetZoneSecondsBeforeIdle(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSecondsBeforeIdle(zone_id);
|
return ZoneStore::Instance()->GetZoneSecondsBeforeIdle(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Perl__GetZoneSecondsBeforeIdle(uint32 zone_id, int version)
|
uint32 Perl__GetZoneSecondsBeforeIdle(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSecondsBeforeIdle(zone_id, version);
|
return ZoneStore::Instance()->GetZoneSecondsBeforeIdle(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Perl__send_channel_message(uint8 channel_number, uint32 guild_id, uint8 language_id, uint8 language_skill, const char* message)
|
void Perl__send_channel_message(uint8 channel_number, uint32 guild_id, uint8 language_id, uint8 language_skill, const char* message)
|
||||||
@@ -5860,12 +5870,12 @@ bool Perl__SetAutoLoginCharacterNameByAccountID(uint32 account_id, std::string c
|
|||||||
|
|
||||||
uint32 Perl__GetZoneIDByLongName(std::string zone_long_name)
|
uint32 Perl__GetZoneIDByLongName(std::string zone_long_name)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneIDByLongName(zone_long_name);
|
return ZoneStore::Instance()->GetZoneIDByLongName(zone_long_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Perl__GetZoneShortNameByLongName(std::string zone_long_name)
|
std::string Perl__GetZoneShortNameByLongName(std::string zone_long_name)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneShortNameByLongName(zone_long_name);
|
return ZoneStore::Instance()->GetZoneShortNameByLongName(zone_long_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Perl__send_parcel(perl::reference table_ref)
|
bool Perl__send_parcel(perl::reference table_ref)
|
||||||
@@ -6628,6 +6638,8 @@ void perl_register_quest()
|
|||||||
package.add("faction", (void(*)(int, int, int))&Perl__faction);
|
package.add("faction", (void(*)(int, int, int))&Perl__faction);
|
||||||
package.add("factionvalue", &Perl__FactionValue);
|
package.add("factionvalue", &Perl__FactionValue);
|
||||||
package.add("failtask", &Perl__failtask);
|
package.add("failtask", &Perl__failtask);
|
||||||
|
package.add("completetask", &Perl__completetask);
|
||||||
|
package.add("uncompletetask", &Perl__uncompletetask);
|
||||||
package.add("firsttaskinset", &Perl__firsttaskinset);
|
package.add("firsttaskinset", &Perl__firsttaskinset);
|
||||||
package.add("follow", (void(*)(int))&Perl__follow);
|
package.add("follow", (void(*)(int))&Perl__follow);
|
||||||
package.add("follow", (void(*)(int, int))&Perl__follow);
|
package.add("follow", (void(*)(int, int))&Perl__follow);
|
||||||
|
|||||||
+3
-11
@@ -55,7 +55,6 @@ extern Zone *zone;
|
|||||||
extern volatile bool is_zone_loaded;
|
extern volatile bool is_zone_loaded;
|
||||||
extern WorldServer worldserver;
|
extern WorldServer worldserver;
|
||||||
extern uint32 numclients;
|
extern uint32 numclients;
|
||||||
extern PetitionList petition_list;
|
|
||||||
|
|
||||||
extern char errorname[32];
|
extern char errorname[32];
|
||||||
|
|
||||||
@@ -3447,7 +3446,7 @@ void EntityList::SendPetitionToAdmins(Petition *pet)
|
|||||||
strcpy(pcus->accountid, pet->GetAccountName());
|
strcpy(pcus->accountid, pet->GetAccountName());
|
||||||
strcpy(pcus->charname, pet->GetCharName());
|
strcpy(pcus->charname, pet->GetCharName());
|
||||||
}
|
}
|
||||||
pcus->quetotal = petition_list.GetTotalPetitions();
|
pcus->quetotal = PetitionList::Instance()->GetTotalPetitions();
|
||||||
auto it = client_list.begin();
|
auto it = client_list.begin();
|
||||||
while (it != client_list.end()) {
|
while (it != client_list.end()) {
|
||||||
if (it->second->CastToClient()->Admin() >= AccountStatus::QuestTroupe) {
|
if (it->second->CastToClient()->Admin() >= AccountStatus::QuestTroupe) {
|
||||||
@@ -3472,7 +3471,7 @@ void EntityList::ClearClientPetitionQueue()
|
|||||||
strcpy(pet->accountid, "");
|
strcpy(pet->accountid, "");
|
||||||
strcpy(pet->gmsenttoo, "");
|
strcpy(pet->gmsenttoo, "");
|
||||||
strcpy(pet->charname, "");
|
strcpy(pet->charname, "");
|
||||||
pet->quetotal = petition_list.GetTotalPetitions();
|
pet->quetotal = PetitionList::Instance()->GetTotalPetitions();
|
||||||
auto it = client_list.begin();
|
auto it = client_list.begin();
|
||||||
while (it != client_list.end()) {
|
while (it != client_list.end()) {
|
||||||
if (it->second->CastToClient()->Admin() >= AccountStatus::GMAdmin) {
|
if (it->second->CastToClient()->Admin() >= AccountStatus::GMAdmin) {
|
||||||
@@ -4175,10 +4174,6 @@ void EntityList::ProcessProximitySay(const char *message, Client *c, uint8 langu
|
|||||||
|
|
||||||
void EntityList::SaveAllClientsTaskState()
|
void EntityList::SaveAllClientsTaskState()
|
||||||
{
|
{
|
||||||
if (!task_manager) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto it = client_list.begin();
|
auto it = client_list.begin();
|
||||||
while (it != client_list.end()) {
|
while (it != client_list.end()) {
|
||||||
Client *client = it->second;
|
Client *client = it->second;
|
||||||
@@ -4192,9 +4187,6 @@ void EntityList::SaveAllClientsTaskState()
|
|||||||
|
|
||||||
void EntityList::ReloadAllClientsTaskState(int task_id)
|
void EntityList::ReloadAllClientsTaskState(int task_id)
|
||||||
{
|
{
|
||||||
if (!task_manager)
|
|
||||||
return;
|
|
||||||
|
|
||||||
auto it = client_list.begin();
|
auto it = client_list.begin();
|
||||||
while (it != client_list.end()) {
|
while (it != client_list.end()) {
|
||||||
Client *client = it->second;
|
Client *client = it->second;
|
||||||
@@ -4205,7 +4197,7 @@ void EntityList::ReloadAllClientsTaskState(int task_id)
|
|||||||
Log(Logs::General, Logs::Tasks, "[CLIENTLOAD] Reloading Task State For Client %s", client->GetName());
|
Log(Logs::General, Logs::Tasks, "[CLIENTLOAD] Reloading Task State For Client %s", client->GetName());
|
||||||
client->RemoveClientTaskState();
|
client->RemoveClientTaskState();
|
||||||
client->LoadClientTaskState();
|
client->LoadClientTaskState();
|
||||||
task_manager->SendActiveTasksToClient(client);
|
TaskManager::Instance()->SendActiveTasksToClient(client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
++it;
|
++it;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ void FindTask(Client *c, const Seperator *sep)
|
|||||||
|
|
||||||
if (sep->IsNumber(2)) {
|
if (sep->IsNumber(2)) {
|
||||||
const auto task_id = Strings::ToUnsignedInt(sep->arg[2]);
|
const auto task_id = Strings::ToUnsignedInt(sep->arg[2]);
|
||||||
const auto& task_name = task_manager->GetTaskName(task_id);
|
const auto& task_name = TaskManager::Instance()->GetTaskName(task_id);
|
||||||
|
|
||||||
if (task_name.empty()) {
|
if (task_name.empty()) {
|
||||||
c->Message(
|
c->Message(
|
||||||
@@ -41,7 +41,7 @@ void FindTask(Client *c, const Seperator *sep)
|
|||||||
|
|
||||||
auto found_count = 0;
|
auto found_count = 0;
|
||||||
|
|
||||||
for (const auto& t : task_manager->GetTaskData()) {
|
for (const auto& t : TaskManager::Instance()->GetTaskData()) {
|
||||||
const auto& task_name = t.second.title;
|
const auto& task_name = t.second.title;
|
||||||
const auto& task_name_lower = Strings::ToLower(task_name);
|
const auto& task_name_lower = Strings::ToLower(task_name);
|
||||||
if (!Strings::Contains(task_name_lower, search_criteria)) {
|
if (!Strings::Contains(task_name_lower, search_criteria)) {
|
||||||
|
|||||||
@@ -273,7 +273,7 @@ void SetZoneData(Client *c, const Seperator *sep)
|
|||||||
entity_list.QueueClients(c, outapp);
|
entity_list.QueueClients(c, outapp);
|
||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
|
|
||||||
zone_store.LoadZones(content_db);
|
ZoneStore::Instance()->LoadZones(content_db);
|
||||||
|
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
|
|||||||
+10
-19
@@ -176,7 +176,7 @@ void command_task(Client *c, const Seperator *sep)
|
|||||||
Chat::White,
|
Chat::White,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"Assigned {} (ID {}) to {}.",
|
"Assigned {} (ID {}) to {}.",
|
||||||
task_manager->GetTaskName(task_id),
|
TaskManager::Instance()->GetTaskName(task_id),
|
||||||
task_id,
|
task_id,
|
||||||
c->GetTargetDescription(t)
|
c->GetTargetDescription(t)
|
||||||
).c_str()
|
).c_str()
|
||||||
@@ -197,7 +197,7 @@ void command_task(Client *c, const Seperator *sep)
|
|||||||
Chat::White,
|
Chat::White,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"Successfully completed {} (ID {}) for {}.",
|
"Successfully completed {} (ID {}) for {}.",
|
||||||
task_manager->GetTaskName(task_id),
|
TaskManager::Instance()->GetTaskName(task_id),
|
||||||
task_id,
|
task_id,
|
||||||
c->GetTargetDescription(t)
|
c->GetTargetDescription(t)
|
||||||
).c_str()
|
).c_str()
|
||||||
@@ -207,7 +207,7 @@ void command_task(Client *c, const Seperator *sep)
|
|||||||
Chat::White,
|
Chat::White,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"Failed to complete {} (ID {}) for {}.",
|
"Failed to complete {} (ID {}) for {}.",
|
||||||
task_manager->GetTaskName(task_id),
|
TaskManager::Instance()->GetTaskName(task_id),
|
||||||
task_id,
|
task_id,
|
||||||
c->GetTargetDescription(t)
|
c->GetTargetDescription(t)
|
||||||
).c_str()
|
).c_str()
|
||||||
@@ -220,7 +220,7 @@ void command_task(Client *c, const Seperator *sep)
|
|||||||
"{} {} not have not {} (ID {}) assigned to them.",
|
"{} {} not have not {} (ID {}) assigned to them.",
|
||||||
c->GetTargetDescription(t, TargetDescriptionType::UCYou),
|
c->GetTargetDescription(t, TargetDescriptionType::UCYou),
|
||||||
c == t ? "do" : "does",
|
c == t ? "do" : "does",
|
||||||
task_manager->GetTaskName(task_id),
|
TaskManager::Instance()->GetTaskName(task_id),
|
||||||
task_id
|
task_id
|
||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
@@ -256,7 +256,7 @@ void command_task(Client *c, const Seperator *sep)
|
|||||||
Chat::White,
|
Chat::White,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"Attempting to reload {} (ID {}).",
|
"Attempting to reload {} (ID {}).",
|
||||||
task_manager->GetTaskName(task_id),
|
TaskManager::Instance()->GetTaskName(task_id),
|
||||||
task_id
|
task_id
|
||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
@@ -265,7 +265,7 @@ void command_task(Client *c, const Seperator *sep)
|
|||||||
Chat::White,
|
Chat::White,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"Successfully reloaded {} (ID {}).",
|
"Successfully reloaded {} (ID {}).",
|
||||||
task_manager->GetTaskName(task_id),
|
TaskManager::Instance()->GetTaskName(task_id),
|
||||||
task_id
|
task_id
|
||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
@@ -304,21 +304,12 @@ void command_task(Client *c, const Seperator *sep)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (t->UncompleteTask(task_id)) {
|
||||||
CompletedTasksRepository::DeleteWhere(
|
|
||||||
database,
|
|
||||||
fmt::format(
|
|
||||||
"charid = {} AND taskid = {}",
|
|
||||||
t->CharacterID(),
|
|
||||||
task_id
|
|
||||||
)
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"Successfully uncompleted {} (ID {}) for {}.",
|
"Successfully uncompleted {} (ID {}) for {}.",
|
||||||
task_manager->GetTaskName(task_id),
|
TaskManager::Instance()->GetTaskName(task_id),
|
||||||
task_id,
|
task_id,
|
||||||
c->GetTargetDescription(t)
|
c->GetTargetDescription(t)
|
||||||
).c_str()
|
).c_str()
|
||||||
@@ -330,7 +321,7 @@ void command_task(Client *c, const Seperator *sep)
|
|||||||
"{} {} not completed {} (ID {}).",
|
"{} {} not completed {} (ID {}).",
|
||||||
c->GetTargetDescription(t, TargetDescriptionType::UCYou),
|
c->GetTargetDescription(t, TargetDescriptionType::UCYou),
|
||||||
c == t ? "have" : "has",
|
c == t ? "have" : "has",
|
||||||
task_manager->GetTaskName(task_id),
|
TaskManager::Instance()->GetTaskName(task_id),
|
||||||
task_id
|
task_id
|
||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
@@ -353,7 +344,7 @@ void command_task(Client *c, const Seperator *sep)
|
|||||||
Chat::White,
|
Chat::White,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"Updating {} (ID {}), activity {} with a count of {} for {}.",
|
"Updating {} (ID {}), activity {} with a count of {} for {}.",
|
||||||
task_manager->GetTaskName(task_id),
|
TaskManager::Instance()->GetTaskName(task_id),
|
||||||
task_id,
|
task_id,
|
||||||
activity_id,
|
activity_id,
|
||||||
count,
|
count,
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ void command_zone(Client *c, const Seperator *sep)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// validate
|
// validate
|
||||||
if (!zone_store.GetZone(zone_input)) {
|
if (!ZoneStore::Instance()->GetZone(zone_input)) {
|
||||||
c->Message(Chat::White, fmt::format("Could not find zone by short_name [{}]", zone_input).c_str());
|
c->Message(Chat::White, fmt::format("Could not find zone by short_name [{}]", zone_input).c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ void command_zone_shard(Client *c, const Seperator *sep)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// validate
|
// validate
|
||||||
if (!zone_store.GetZone(zone_input)) {
|
if (!ZoneStore::Instance()->GetZone(zone_input)) {
|
||||||
c->Message(Chat::White, fmt::format("Could not find zone by short_name [{}]", zone_input).c_str());
|
c->Message(Chat::White, fmt::format("Could not find zone by short_name [{}]", zone_input).c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
#include "../common/repositories/guild_bank_repository.h"
|
#include "../common/repositories/guild_bank_repository.h"
|
||||||
#include "../zone/petitions.h"
|
#include "../zone/petitions.h"
|
||||||
|
|
||||||
extern PetitionList petition_list;
|
|
||||||
//extern GuildRanks_Struct guilds[512];
|
//extern GuildRanks_Struct guilds[512];
|
||||||
//extern ZoneDatabase database;
|
//extern ZoneDatabase database;
|
||||||
|
|
||||||
|
|||||||
@@ -3584,6 +3584,24 @@ bool Lua_Client::KeyRingRemove(uint32 item_id)
|
|||||||
return self->KeyRingRemove(item_id);
|
return self->KeyRingRemove(item_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Lua_Client::CompleteTask(int task_id)
|
||||||
|
{
|
||||||
|
Lua_Safe_Call_Bool();
|
||||||
|
return self->CompleteTask(task_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Lua_Client::UncompleteTask(int task_id)
|
||||||
|
{
|
||||||
|
Lua_Safe_Call_Bool();
|
||||||
|
return self->UncompleteTask(task_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Lua_Client::EnableTitleSet(uint32 title_set) {
|
||||||
|
Lua_Safe_Call_Void();
|
||||||
|
self->EnableTitle(title_set);
|
||||||
|
}
|
||||||
|
|
||||||
luabind::scope lua_register_client() {
|
luabind::scope lua_register_client() {
|
||||||
return luabind::class_<Lua_Client, Lua_Mob>("Client")
|
return luabind::class_<Lua_Client, Lua_Mob>("Client")
|
||||||
.def(luabind::constructor<>())
|
.def(luabind::constructor<>())
|
||||||
@@ -3663,6 +3681,7 @@ luabind::scope lua_register_client() {
|
|||||||
.def("ClearPEQZoneFlag", (void(Lua_Client::*)(uint32))&Lua_Client::ClearPEQZoneFlag)
|
.def("ClearPEQZoneFlag", (void(Lua_Client::*)(uint32))&Lua_Client::ClearPEQZoneFlag)
|
||||||
.def("ClearXTargets", (void(Lua_Client::*)(void))&Lua_Client::ClearXTargets)
|
.def("ClearXTargets", (void(Lua_Client::*)(void))&Lua_Client::ClearXTargets)
|
||||||
.def("ClearZoneFlag", (void(Lua_Client::*)(uint32))&Lua_Client::ClearZoneFlag)
|
.def("ClearZoneFlag", (void(Lua_Client::*)(uint32))&Lua_Client::ClearZoneFlag)
|
||||||
|
.def("CompleteTask", (bool(Lua_Client::*)(int))&Lua_Client::CompleteTask)
|
||||||
.def("Connected", (bool(Lua_Client::*)(void))&Lua_Client::Connected)
|
.def("Connected", (bool(Lua_Client::*)(void))&Lua_Client::Connected)
|
||||||
.def("CountAugmentEquippedByID", (uint32(Lua_Client::*)(uint32))&Lua_Client::CountAugmentEquippedByID)
|
.def("CountAugmentEquippedByID", (uint32(Lua_Client::*)(uint32))&Lua_Client::CountAugmentEquippedByID)
|
||||||
.def("CountItem", (uint32(Lua_Client::*)(uint32))&Lua_Client::CountItem)
|
.def("CountItem", (uint32(Lua_Client::*)(uint32))&Lua_Client::CountItem)
|
||||||
@@ -3693,6 +3712,7 @@ luabind::scope lua_register_client() {
|
|||||||
.def("EnableAreaHPRegen", &Lua_Client::EnableAreaHPRegen)
|
.def("EnableAreaHPRegen", &Lua_Client::EnableAreaHPRegen)
|
||||||
.def("EnableAreaManaRegen", &Lua_Client::EnableAreaManaRegen)
|
.def("EnableAreaManaRegen", &Lua_Client::EnableAreaManaRegen)
|
||||||
.def("EnableAreaRegens", &Lua_Client::EnableAreaRegens)
|
.def("EnableAreaRegens", &Lua_Client::EnableAreaRegens)
|
||||||
|
.def("EnableTitleSet", &Lua_Client::EnableTitleSet)
|
||||||
.def("EndSharedTask", (void(Lua_Client::*)(void))&Lua_Client::EndSharedTask)
|
.def("EndSharedTask", (void(Lua_Client::*)(void))&Lua_Client::EndSharedTask)
|
||||||
.def("EndSharedTask", (void(Lua_Client::*)(bool))&Lua_Client::EndSharedTask)
|
.def("EndSharedTask", (void(Lua_Client::*)(bool))&Lua_Client::EndSharedTask)
|
||||||
.def("Escape", (void(Lua_Client::*)(void))&Lua_Client::Escape)
|
.def("Escape", (void(Lua_Client::*)(void))&Lua_Client::Escape)
|
||||||
@@ -4156,6 +4176,7 @@ luabind::scope lua_register_client() {
|
|||||||
.def("TrainDisc", (void(Lua_Client::*)(int))&Lua_Client::TrainDisc)
|
.def("TrainDisc", (void(Lua_Client::*)(int))&Lua_Client::TrainDisc)
|
||||||
.def("TrainDiscBySpellID", (void(Lua_Client::*)(int32))&Lua_Client::TrainDiscBySpellID)
|
.def("TrainDiscBySpellID", (void(Lua_Client::*)(int32))&Lua_Client::TrainDiscBySpellID)
|
||||||
.def("UnFreeze", (void(Lua_Client::*)(void))&Lua_Client::UnFreeze)
|
.def("UnFreeze", (void(Lua_Client::*)(void))&Lua_Client::UnFreeze)
|
||||||
|
.def("UncompleteTask", (bool(Lua_Client::*)(int))&Lua_Client::UncompleteTask)
|
||||||
.def("Undye", (void(Lua_Client::*)(void))&Lua_Client::Undye)
|
.def("Undye", (void(Lua_Client::*)(void))&Lua_Client::Undye)
|
||||||
.def("UnmemSpell", (void(Lua_Client::*)(int))&Lua_Client::UnmemSpell)
|
.def("UnmemSpell", (void(Lua_Client::*)(int))&Lua_Client::UnmemSpell)
|
||||||
.def("UnmemSpell", (void(Lua_Client::*)(int,bool))&Lua_Client::UnmemSpell)
|
.def("UnmemSpell", (void(Lua_Client::*)(int,bool))&Lua_Client::UnmemSpell)
|
||||||
|
|||||||
@@ -297,6 +297,7 @@ public:
|
|||||||
int GetClientVersion();
|
int GetClientVersion();
|
||||||
uint32 GetClientVersionBit();
|
uint32 GetClientVersionBit();
|
||||||
void SetTitleSuffix(const char *text);
|
void SetTitleSuffix(const char *text);
|
||||||
|
void EnableTitleSet(uint32 title_set);
|
||||||
void SetAAPoints(int points);
|
void SetAAPoints(int points);
|
||||||
int GetAAPoints();
|
int GetAAPoints();
|
||||||
int GetSpentAA();
|
int GetSpentAA();
|
||||||
@@ -521,6 +522,8 @@ public:
|
|||||||
bool KeyRingClear();
|
bool KeyRingClear();
|
||||||
void KeyRingList();
|
void KeyRingList();
|
||||||
bool KeyRingRemove(uint32 item_id);
|
bool KeyRingRemove(uint32 item_id);
|
||||||
|
bool CompleteTask(int task_id);
|
||||||
|
bool UncompleteTask(int task_id);
|
||||||
|
|
||||||
// account data buckets
|
// account data buckets
|
||||||
void SetAccountBucket(std::string bucket_name, std::string bucket_value);
|
void SetAccountBucket(std::string bucket_name, std::string bucket_value);
|
||||||
|
|||||||
+133
-123
@@ -722,6 +722,14 @@ void lua_fail_task(int task_id) {
|
|||||||
quest_manager.failtask(task_id);
|
quest_manager.failtask(task_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool lua_complete_task(int task_id) {
|
||||||
|
return quest_manager.completetask(task_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool lua_uncomplete_task(int task_id) {
|
||||||
|
return quest_manager.uncompletetask(task_id);
|
||||||
|
}
|
||||||
|
|
||||||
int lua_task_time_left(int task_id) {
|
int lua_task_time_left(int task_id) {
|
||||||
return quest_manager.tasktimeleft(task_id);
|
return quest_manager.tasktimeleft(task_id);
|
||||||
}
|
}
|
||||||
@@ -4157,607 +4165,607 @@ void lua_send_player_handin_event()
|
|||||||
|
|
||||||
float lua_get_zone_safe_x(uint32 zone_id)
|
float lua_get_zone_safe_x(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSafeCoordinates(zone_id).x;
|
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id).x;
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_safe_x(uint32 zone_id, int version)
|
float lua_get_zone_safe_x(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSafeCoordinates(zone_id, version).x;
|
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id, version).x;
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_safe_y(uint32 zone_id)
|
float lua_get_zone_safe_y(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSafeCoordinates(zone_id).y;
|
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id).y;
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_safe_y(uint32 zone_id, int version)
|
float lua_get_zone_safe_y(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSafeCoordinates(zone_id, version).y;
|
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id, version).y;
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_safe_z(uint32 zone_id)
|
float lua_get_zone_safe_z(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSafeCoordinates(zone_id).z;
|
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id).z;
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_safe_z(uint32 zone_id, int version)
|
float lua_get_zone_safe_z(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSafeCoordinates(zone_id, version).z;
|
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id, version).z;
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_safe_heading(uint32 zone_id)
|
float lua_get_zone_safe_heading(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSafeCoordinates(zone_id).w;
|
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id).w;
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_safe_heading(uint32 zone_id, int version)
|
float lua_get_zone_safe_heading(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSafeCoordinates(zone_id, version).w;
|
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id, version).w;
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_graveyard_id(uint32 zone_id)
|
float lua_get_zone_graveyard_id(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneGraveyardID(zone_id);
|
return ZoneStore::Instance()->GetZoneGraveyardID(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_graveyard_id(uint32 zone_id, int version)
|
float lua_get_zone_graveyard_id(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneGraveyardID(zone_id, version);
|
return ZoneStore::Instance()->GetZoneGraveyardID(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_minimum_level(uint32 zone_id)
|
uint8 lua_get_zone_minimum_level(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMinimumLevel(zone_id);
|
return ZoneStore::Instance()->GetZoneMinimumLevel(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_minimum_level(uint32 zone_id, int version)
|
uint8 lua_get_zone_minimum_level(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMinimumLevel(zone_id, version);
|
return ZoneStore::Instance()->GetZoneMinimumLevel(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_maximum_level(uint32 zone_id)
|
uint8 lua_get_zone_maximum_level(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMaximumLevel(zone_id);
|
return ZoneStore::Instance()->GetZoneMaximumLevel(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_maximum_level(uint32 zone_id, int version)
|
uint8 lua_get_zone_maximum_level(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMaximumLevel(zone_id, version);
|
return ZoneStore::Instance()->GetZoneMaximumLevel(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_minimum_status(uint32 zone_id)
|
uint8 lua_get_zone_minimum_status(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMinimumStatus(zone_id);
|
return ZoneStore::Instance()->GetZoneMinimumStatus(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_minimum_status(uint32 zone_id, int version)
|
uint8 lua_get_zone_minimum_status(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMinimumStatus(zone_id, version);
|
return ZoneStore::Instance()->GetZoneMinimumStatus(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_time_zone(uint32 zone_id)
|
int lua_get_zone_time_zone(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneTimeZone(zone_id);
|
return ZoneStore::Instance()->GetZoneTimeZone(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_time_zone(uint32 zone_id, int version)
|
int lua_get_zone_time_zone(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneTimeZone(zone_id, version);
|
return ZoneStore::Instance()->GetZoneTimeZone(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_maximum_players(uint32 zone_id)
|
int lua_get_zone_maximum_players(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMaximumPlayers(zone_id);
|
return ZoneStore::Instance()->GetZoneMaximumPlayers(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_maximum_players(uint32 zone_id, int version)
|
int lua_get_zone_maximum_players(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMaximumPlayers(zone_id, version);
|
return ZoneStore::Instance()->GetZoneMaximumPlayers(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 lua_get_zone_rule_set(uint32 zone_id)
|
uint32 lua_get_zone_rule_set(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneRuleSet(zone_id);
|
return ZoneStore::Instance()->GetZoneRuleSet(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 lua_get_zone_rule_set(uint32 zone_id, int version)
|
uint32 lua_get_zone_rule_set(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneRuleSet(zone_id, version);
|
return ZoneStore::Instance()->GetZoneRuleSet(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string lua_get_zone_note(uint32 zone_id)
|
std::string lua_get_zone_note(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneNote(zone_id);
|
return ZoneStore::Instance()->GetZoneNote(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string lua_get_zone_note(uint32 zone_id, int version)
|
std::string lua_get_zone_note(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneNote(zone_id, version);
|
return ZoneStore::Instance()->GetZoneNote(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_underworld(uint32 zone_id)
|
float lua_get_zone_underworld(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneUnderworld(zone_id);
|
return ZoneStore::Instance()->GetZoneUnderworld(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_underworld(uint32 zone_id, int version)
|
float lua_get_zone_underworld(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneUnderworld(zone_id, version);
|
return ZoneStore::Instance()->GetZoneUnderworld(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_minimum_clip(uint32 zone_id)
|
float lua_get_zone_minimum_clip(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMinimumClip(zone_id);
|
return ZoneStore::Instance()->GetZoneMinimumClip(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_minimum_clip(uint32 zone_id, int version)
|
float lua_get_zone_minimum_clip(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMinimumClip(zone_id, version);
|
return ZoneStore::Instance()->GetZoneMinimumClip(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_maximum_clip(uint32 zone_id)
|
float lua_get_zone_maximum_clip(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMaximumClip(zone_id);
|
return ZoneStore::Instance()->GetZoneMaximumClip(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_maximum_clip(uint32 zone_id, int version)
|
float lua_get_zone_maximum_clip(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMaximumClip(zone_id, version);
|
return ZoneStore::Instance()->GetZoneMaximumClip(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_fog_minimum_clip(uint32 zone_id)
|
float lua_get_zone_fog_minimum_clip(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogMinimumClip(zone_id);
|
return ZoneStore::Instance()->GetZoneFogMinimumClip(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_fog_minimum_clip(uint32 zone_id, uint8 slot)
|
float lua_get_zone_fog_minimum_clip(uint32 zone_id, uint8 slot)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogMinimumClip(zone_id, slot);
|
return ZoneStore::Instance()->GetZoneFogMinimumClip(zone_id, slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_fog_minimum_clip(uint32 zone_id, uint8 slot, int version)
|
float lua_get_zone_fog_minimum_clip(uint32 zone_id, uint8 slot, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogMinimumClip(zone_id, slot);
|
return ZoneStore::Instance()->GetZoneFogMinimumClip(zone_id, slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_fog_maximum_clip(uint32 zone_id)
|
float lua_get_zone_fog_maximum_clip(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogMaximumClip(zone_id);
|
return ZoneStore::Instance()->GetZoneFogMaximumClip(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_fog_maximum_clip(uint32 zone_id, uint8 slot)
|
float lua_get_zone_fog_maximum_clip(uint32 zone_id, uint8 slot)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogMaximumClip(zone_id, slot);
|
return ZoneStore::Instance()->GetZoneFogMaximumClip(zone_id, slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_fog_maximum_clip(uint32 zone_id, uint8 slot, int version)
|
float lua_get_zone_fog_maximum_clip(uint32 zone_id, uint8 slot, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogMaximumClip(zone_id, slot, version);
|
return ZoneStore::Instance()->GetZoneFogMaximumClip(zone_id, slot, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_fog_red(uint32 zone_id)
|
uint8 lua_get_zone_fog_red(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogRed(zone_id);
|
return ZoneStore::Instance()->GetZoneFogRed(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_fog_red(uint32 zone_id, uint8 slot)
|
uint8 lua_get_zone_fog_red(uint32 zone_id, uint8 slot)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogRed(zone_id, slot);
|
return ZoneStore::Instance()->GetZoneFogRed(zone_id, slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_fog_red(uint32 zone_id, uint8 slot, int version)
|
uint8 lua_get_zone_fog_red(uint32 zone_id, uint8 slot, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogRed(zone_id, slot, version);
|
return ZoneStore::Instance()->GetZoneFogRed(zone_id, slot, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_fog_green(uint32 zone_id)
|
uint8 lua_get_zone_fog_green(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogGreen(zone_id);
|
return ZoneStore::Instance()->GetZoneFogGreen(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_fog_green(uint32 zone_id, uint8 slot)
|
uint8 lua_get_zone_fog_green(uint32 zone_id, uint8 slot)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogGreen(zone_id, slot);
|
return ZoneStore::Instance()->GetZoneFogGreen(zone_id, slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_fog_green(uint32 zone_id, uint8 slot, int version)
|
uint8 lua_get_zone_fog_green(uint32 zone_id, uint8 slot, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogGreen(zone_id, slot, version);
|
return ZoneStore::Instance()->GetZoneFogGreen(zone_id, slot, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_fog_blue(uint32 zone_id)
|
uint8 lua_get_zone_fog_blue(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogBlue(zone_id);
|
return ZoneStore::Instance()->GetZoneFogBlue(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_fog_blue(uint32 zone_id, uint8 slot)
|
uint8 lua_get_zone_fog_blue(uint32 zone_id, uint8 slot)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogBlue(zone_id, slot);
|
return ZoneStore::Instance()->GetZoneFogBlue(zone_id, slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_fog_blue(uint32 zone_id, uint8 slot, int version)
|
uint8 lua_get_zone_fog_blue(uint32 zone_id, uint8 slot, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogBlue(zone_id, slot, version);
|
return ZoneStore::Instance()->GetZoneFogBlue(zone_id, slot, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_sky(uint32 zone_id)
|
uint8 lua_get_zone_sky(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSky(zone_id);
|
return ZoneStore::Instance()->GetZoneSky(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_sky(uint32 zone_id, int version)
|
uint8 lua_get_zone_sky(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSky(zone_id, version);
|
return ZoneStore::Instance()->GetZoneSky(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_ztype(uint32 zone_id)
|
uint8 lua_get_zone_ztype(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneZType(zone_id);
|
return ZoneStore::Instance()->GetZoneZType(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_ztype(uint32 zone_id, int version)
|
uint8 lua_get_zone_ztype(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneZType(zone_id, version);
|
return ZoneStore::Instance()->GetZoneZType(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_experience_multiplier(uint32 zone_id)
|
float lua_get_zone_experience_multiplier(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneExperienceMultiplier(zone_id);
|
return ZoneStore::Instance()->GetZoneExperienceMultiplier(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_experience_multiplier(uint32 zone_id, int version)
|
float lua_get_zone_experience_multiplier(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneExperienceMultiplier(zone_id, version);
|
return ZoneStore::Instance()->GetZoneExperienceMultiplier(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_walk_speed(uint32 zone_id)
|
float lua_get_zone_walk_speed(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneWalkSpeed(zone_id);
|
return ZoneStore::Instance()->GetZoneWalkSpeed(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_walk_speed(uint32 zone_id, int version)
|
float lua_get_zone_walk_speed(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneWalkSpeed(zone_id, version);
|
return ZoneStore::Instance()->GetZoneWalkSpeed(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_time_type(uint32 zone_id)
|
uint8 lua_get_zone_time_type(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneTimeType(zone_id);
|
return ZoneStore::Instance()->GetZoneTimeType(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_time_type(uint32 zone_id, int version)
|
uint8 lua_get_zone_time_type(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneTimeType(zone_id, version);
|
return ZoneStore::Instance()->GetZoneTimeType(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_fog_density(uint32 zone_id)
|
float lua_get_zone_fog_density(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogDensity(zone_id);
|
return ZoneStore::Instance()->GetZoneFogDensity(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_fog_density(uint32 zone_id, int version)
|
float lua_get_zone_fog_density(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogDensity(zone_id, version);
|
return ZoneStore::Instance()->GetZoneFogDensity(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string lua_get_zone_flag_needed(uint32 zone_id)
|
std::string lua_get_zone_flag_needed(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFlagNeeded(zone_id);
|
return ZoneStore::Instance()->GetZoneFlagNeeded(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string lua_get_zone_flag_needed(uint32 zone_id, int version)
|
std::string lua_get_zone_flag_needed(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFlagNeeded(zone_id, version);
|
return ZoneStore::Instance()->GetZoneFlagNeeded(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 lua_get_zone_can_bind(uint32 zone_id)
|
int8 lua_get_zone_can_bind(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneCanBind(zone_id);
|
return ZoneStore::Instance()->GetZoneCanBind(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 lua_get_zone_can_bind(uint32 zone_id, int version)
|
int8 lua_get_zone_can_bind(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneCanBind(zone_id, version);
|
return ZoneStore::Instance()->GetZoneCanBind(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 lua_get_zone_can_combat(uint32 zone_id)
|
int8 lua_get_zone_can_combat(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneCanCombat(zone_id);
|
return ZoneStore::Instance()->GetZoneCanCombat(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 lua_get_zone_can_combat(uint32 zone_id, int version)
|
int8 lua_get_zone_can_combat(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneCanCombat(zone_id, version);
|
return ZoneStore::Instance()->GetZoneCanCombat(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 lua_get_zone_can_levitate(uint32 zone_id)
|
int8 lua_get_zone_can_levitate(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneCanLevitate(zone_id);
|
return ZoneStore::Instance()->GetZoneCanLevitate(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 lua_get_zone_can_levitate(uint32 zone_id, int version)
|
int8 lua_get_zone_can_levitate(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneCanLevitate(zone_id, version);
|
return ZoneStore::Instance()->GetZoneCanLevitate(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 lua_get_zone_cast_outdoor(uint32 zone_id)
|
int8 lua_get_zone_cast_outdoor(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneCastOutdoor(zone_id);
|
return ZoneStore::Instance()->GetZoneCastOutdoor(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 lua_get_zone_cast_outdoor(uint32 zone_id, int version)
|
int8 lua_get_zone_cast_outdoor(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneCastOutdoor(zone_id, version);
|
return ZoneStore::Instance()->GetZoneCastOutdoor(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_hotzone(uint32 zone_id)
|
uint8 lua_get_zone_hotzone(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneHotzone(zone_id);
|
return ZoneStore::Instance()->GetZoneHotzone(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_hotzone(uint32 zone_id, int version)
|
uint8 lua_get_zone_hotzone(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneHotzone(zone_id, version);
|
return ZoneStore::Instance()->GetZoneHotzone(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_instance_type(uint32 zone_id)
|
uint8 lua_get_zone_instance_type(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneInstanceType(zone_id);
|
return ZoneStore::Instance()->GetZoneInstanceType(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_instance_type(uint32 zone_id, int version)
|
uint8 lua_get_zone_instance_type(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneInstanceType(zone_id, version);
|
return ZoneStore::Instance()->GetZoneInstanceType(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64 lua_get_zone_shutdown_delay(uint32 zone_id)
|
uint64 lua_get_zone_shutdown_delay(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneShutdownDelay(zone_id);
|
return ZoneStore::Instance()->GetZoneShutdownDelay(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64 lua_get_zone_shutdown_delay(uint32 zone_id, int version)
|
uint64 lua_get_zone_shutdown_delay(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneShutdownDelay(zone_id, version);
|
return ZoneStore::Instance()->GetZoneShutdownDelay(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 lua_get_zone_peqzone(uint32 zone_id)
|
int8 lua_get_zone_peqzone(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZonePEQZone(zone_id);
|
return ZoneStore::Instance()->GetZonePEQZone(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 lua_get_zone_peqzone(uint32 zone_id, int version)
|
int8 lua_get_zone_peqzone(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZonePEQZone(zone_id, version);
|
return ZoneStore::Instance()->GetZonePEQZone(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 lua_get_zone_expansion(uint32 zone_id)
|
int8 lua_get_zone_expansion(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneExpansion(zone_id);
|
return ZoneStore::Instance()->GetZoneExpansion(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 lua_get_zone_expansion(uint32 zone_id, int version)
|
int8 lua_get_zone_expansion(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneExpansion(zone_id, version);
|
return ZoneStore::Instance()->GetZoneExpansion(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 lua_get_zone_bypass_expansion_check(uint32 zone_id)
|
int8 lua_get_zone_bypass_expansion_check(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneBypassExpansionCheck(zone_id);
|
return ZoneStore::Instance()->GetZoneBypassExpansionCheck(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 lua_get_zone_bypass_expansion_check(uint32 zone_id, int version)
|
int8 lua_get_zone_bypass_expansion_check(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneBypassExpansionCheck(zone_id, version);
|
return ZoneStore::Instance()->GetZoneBypassExpansionCheck(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 lua_get_zone_suspend_buffs(uint32 zone_id)
|
int8 lua_get_zone_suspend_buffs(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSuspendBuffs(zone_id);
|
return ZoneStore::Instance()->GetZoneSuspendBuffs(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 lua_get_zone_suspend_buffs(uint32 zone_id, int version)
|
int8 lua_get_zone_suspend_buffs(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSuspendBuffs(zone_id, version);
|
return ZoneStore::Instance()->GetZoneSuspendBuffs(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_rain_chance(uint32 zone_id)
|
int lua_get_zone_rain_chance(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneRainChance(zone_id);
|
return ZoneStore::Instance()->GetZoneRainChance(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_rain_chance(uint32 zone_id, int version)
|
int lua_get_zone_rain_chance(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneRainChance(zone_id, version);
|
return ZoneStore::Instance()->GetZoneRainChance(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_rain_duration(uint32 zone_id)
|
int lua_get_zone_rain_duration(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneRainDuration(zone_id);
|
return ZoneStore::Instance()->GetZoneRainDuration(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_rain_duration(uint32 zone_id, int version)
|
int lua_get_zone_rain_duration(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneRainDuration(zone_id, version);
|
return ZoneStore::Instance()->GetZoneRainDuration(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_snow_chance(uint32 zone_id)
|
int lua_get_zone_snow_chance(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSnowChance(zone_id);
|
return ZoneStore::Instance()->GetZoneSnowChance(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_snow_chance(uint32 zone_id, int version)
|
int lua_get_zone_snow_chance(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSnowChance(zone_id, version);
|
return ZoneStore::Instance()->GetZoneSnowChance(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_snow_duration(uint32 zone_id)
|
int lua_get_zone_snow_duration(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSnowDuration(zone_id);
|
return ZoneStore::Instance()->GetZoneSnowDuration(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_snow_duration(uint32 zone_id, int version)
|
int lua_get_zone_snow_duration(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSnowDuration(zone_id, version);
|
return ZoneStore::Instance()->GetZoneSnowDuration(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_gravity(uint32 zone_id)
|
float lua_get_zone_gravity(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneGravity(zone_id);
|
return ZoneStore::Instance()->GetZoneGravity(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
float lua_get_zone_gravity(uint32 zone_id, int version)
|
float lua_get_zone_gravity(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneGravity(zone_id, version);
|
return ZoneStore::Instance()->GetZoneGravity(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_type(uint32 zone_id)
|
int lua_get_zone_type(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneType(zone_id);
|
return ZoneStore::Instance()->GetZoneType(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_type(uint32 zone_id, int version)
|
int lua_get_zone_type(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneType(zone_id, version);
|
return ZoneStore::Instance()->GetZoneType(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_sky_lock(uint32 zone_id)
|
int lua_get_zone_sky_lock(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSkyLock(zone_id);
|
return ZoneStore::Instance()->GetZoneSkyLock(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_sky_lock(uint32 zone_id, int version)
|
int lua_get_zone_sky_lock(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSkyLock(zone_id, version);
|
return ZoneStore::Instance()->GetZoneSkyLock(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_fast_regen_hp(uint32 zone_id)
|
int lua_get_zone_fast_regen_hp(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFastRegenHP(zone_id);
|
return ZoneStore::Instance()->GetZoneFastRegenHP(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_fast_regen_hp(uint32 zone_id, int version)
|
int lua_get_zone_fast_regen_hp(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFastRegenHP(zone_id, version);
|
return ZoneStore::Instance()->GetZoneFastRegenHP(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_fast_regen_mana(uint32 zone_id)
|
int lua_get_zone_fast_regen_mana(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFastRegenMana(zone_id);
|
return ZoneStore::Instance()->GetZoneFastRegenMana(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_fast_regen_mana(uint32 zone_id, int version)
|
int lua_get_zone_fast_regen_mana(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFastRegenMana(zone_id, version);
|
return ZoneStore::Instance()->GetZoneFastRegenMana(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_fast_regen_endurance(uint32 zone_id)
|
int lua_get_zone_fast_regen_endurance(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFastRegenEndurance(zone_id);
|
return ZoneStore::Instance()->GetZoneFastRegenEndurance(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_fast_regen_endurance(uint32 zone_id, int version)
|
int lua_get_zone_fast_regen_endurance(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFastRegenEndurance(zone_id, version);
|
return ZoneStore::Instance()->GetZoneFastRegenEndurance(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_npc_maximum_aggro_distance(uint32 zone_id)
|
int lua_get_zone_npc_maximum_aggro_distance(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneNPCMaximumAggroDistance(zone_id);
|
return ZoneStore::Instance()->GetZoneNPCMaximumAggroDistance(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_npc_maximum_aggro_distance(uint32 zone_id, int version)
|
int lua_get_zone_npc_maximum_aggro_distance(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneNPCMaximumAggroDistance(zone_id, version);
|
return ZoneStore::Instance()->GetZoneNPCMaximumAggroDistance(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 lua_get_zone_minimum_expansion(uint32 zone_id)
|
int8 lua_get_zone_minimum_expansion(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMinimumExpansion(zone_id);
|
return ZoneStore::Instance()->GetZoneMinimumExpansion(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 lua_get_zone_minimum_expansion(uint32 zone_id, int version)
|
int8 lua_get_zone_minimum_expansion(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMinimumExpansion(zone_id, version);
|
return ZoneStore::Instance()->GetZoneMinimumExpansion(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 lua_get_zone_maximum_expansion(uint32 zone_id)
|
int8 lua_get_zone_maximum_expansion(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMaximumExpansion(zone_id);
|
return ZoneStore::Instance()->GetZoneMaximumExpansion(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 lua_get_zone_maximum_expansion(uint32 zone_id, int version)
|
int8 lua_get_zone_maximum_expansion(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMaximumExpansion(zone_id, version);
|
return ZoneStore::Instance()->GetZoneMaximumExpansion(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string lua_get_zone_content_flags(uint32 zone_id)
|
std::string lua_get_zone_content_flags(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneContentFlags(zone_id);
|
return ZoneStore::Instance()->GetZoneContentFlags(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string lua_get_zone_content_flags(uint32 zone_id, int version)
|
std::string lua_get_zone_content_flags(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneContentFlags(zone_id, version);
|
return ZoneStore::Instance()->GetZoneContentFlags(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string lua_get_zone_content_flags_disabled(uint32 zone_id)
|
std::string lua_get_zone_content_flags_disabled(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneContentFlagsDisabled(zone_id);
|
return ZoneStore::Instance()->GetZoneContentFlagsDisabled(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string lua_get_zone_content_flags_disabled(uint32 zone_id, int version)
|
std::string lua_get_zone_content_flags_disabled(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneContentFlagsDisabled(zone_id, version);
|
return ZoneStore::Instance()->GetZoneContentFlagsDisabled(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_underworld_teleport_index(uint32 zone_id)
|
int lua_get_zone_underworld_teleport_index(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneUnderworldTeleportIndex(zone_id);
|
return ZoneStore::Instance()->GetZoneUnderworldTeleportIndex(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_underworld_teleport_index(uint32 zone_id, int version)
|
int lua_get_zone_underworld_teleport_index(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneUnderworldTeleportIndex(zone_id, version);
|
return ZoneStore::Instance()->GetZoneUnderworldTeleportIndex(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_lava_damage(uint32 zone_id)
|
int lua_get_zone_lava_damage(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneLavaDamage(zone_id);
|
return ZoneStore::Instance()->GetZoneLavaDamage(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_lava_damage(uint32 zone_id, int version)
|
int lua_get_zone_lava_damage(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneLavaDamage(zone_id, version);
|
return ZoneStore::Instance()->GetZoneLavaDamage(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_minimum_lava_damage(uint32 zone_id)
|
int lua_get_zone_minimum_lava_damage(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMinimumLavaDamage(zone_id);
|
return ZoneStore::Instance()->GetZoneMinimumLavaDamage(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_get_zone_minimum_lava_damage(uint32 zone_id, int version)
|
int lua_get_zone_minimum_lava_damage(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMinimumLavaDamage(zone_id, version);
|
return ZoneStore::Instance()->GetZoneMinimumLavaDamage(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_idle_when_empty(uint32 zone_id)
|
uint8 lua_get_zone_idle_when_empty(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneIdleWhenEmpty(zone_id);
|
return ZoneStore::Instance()->GetZoneIdleWhenEmpty(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 lua_get_zone_idle_when_empty(uint32 zone_id, int version)
|
uint8 lua_get_zone_idle_when_empty(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneIdleWhenEmpty(zone_id, version);
|
return ZoneStore::Instance()->GetZoneIdleWhenEmpty(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 lua_get_zone_seconds_before_idle(uint32 zone_id)
|
uint32 lua_get_zone_seconds_before_idle(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSecondsBeforeIdle(zone_id);
|
return ZoneStore::Instance()->GetZoneSecondsBeforeIdle(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 lua_get_zone_seconds_before_idle(uint32 zone_id, int version)
|
uint32 lua_get_zone_seconds_before_idle(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSecondsBeforeIdle(zone_id, version);
|
return ZoneStore::Instance()->GetZoneSecondsBeforeIdle(zone_id, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lua_send_channel_message(uint8 channel_number, uint32 guild_id, uint8 language_id, uint8 language_skill, const char* message)
|
void lua_send_channel_message(uint8 channel_number, uint32 guild_id, uint8 language_id, uint8 language_skill, const char* message)
|
||||||
@@ -5497,11 +5505,11 @@ bool lua_set_auto_login_character_name_by_account_id(uint32 account_id, std::str
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32 lua_get_zone_id_by_long_name(std::string zone_long_name) {
|
uint32 lua_get_zone_id_by_long_name(std::string zone_long_name) {
|
||||||
return zone_store.GetZoneIDByLongName(zone_long_name);
|
return ZoneStore::Instance()->GetZoneIDByLongName(zone_long_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string lua_get_zone_short_name_by_long_name(std::string zone_long_name) {
|
std::string lua_get_zone_short_name_by_long_name(std::string zone_long_name) {
|
||||||
return zone_store.GetZoneShortNameByLongName(zone_long_name);
|
return ZoneStore::Instance()->GetZoneShortNameByLongName(zone_long_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool lua_send_parcel(luabind::object lua_table)
|
bool lua_send_parcel(luabind::object lua_table)
|
||||||
@@ -5970,6 +5978,8 @@ luabind::scope lua_register_general() {
|
|||||||
luabind::def("reset_task_activity", &lua_reset_task_activity),
|
luabind::def("reset_task_activity", &lua_reset_task_activity),
|
||||||
luabind::def("assign_task", &lua_assign_task),
|
luabind::def("assign_task", &lua_assign_task),
|
||||||
luabind::def("fail_task", &lua_fail_task),
|
luabind::def("fail_task", &lua_fail_task),
|
||||||
|
luabind::def("complete_task", &lua_complete_task),
|
||||||
|
luabind::def("uncomplete_task", &lua_uncomplete_task),
|
||||||
luabind::def("task_time_left", &lua_task_time_left),
|
luabind::def("task_time_left", &lua_task_time_left),
|
||||||
luabind::def("is_task_completed", &lua_is_task_completed),
|
luabind::def("is_task_completed", &lua_is_task_completed),
|
||||||
luabind::def("enabled_task_count", &lua_enabled_task_count),
|
luabind::def("enabled_task_count", &lua_enabled_task_count),
|
||||||
|
|||||||
+52
-52
@@ -15,7 +15,7 @@ bool Lua_Zone::BuffTimersSuspended()
|
|||||||
bool Lua_Zone::BypassesExpansionCheck()
|
bool Lua_Zone::BypassesExpansionCheck()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Bool();
|
Lua_Safe_Call_Bool();
|
||||||
return zone_store.GetZoneBypassExpansionCheck(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneBypassExpansionCheck(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Lua_Zone::CanBind()
|
bool Lua_Zone::CanBind()
|
||||||
@@ -87,25 +87,25 @@ float Lua_Zone::GetAAEXPModifierByCharacterID(uint32 character_id)
|
|||||||
std::string Lua_Zone::GetContentFlags()
|
std::string Lua_Zone::GetContentFlags()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_String();
|
Lua_Safe_Call_String();
|
||||||
return zone_store.GetZoneContentFlags(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneContentFlags(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Lua_Zone::GetContentFlagsDisabled()
|
std::string Lua_Zone::GetContentFlagsDisabled()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_String();
|
Lua_Safe_Call_String();
|
||||||
return zone_store.GetZoneContentFlagsDisabled(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneContentFlagsDisabled(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
float Lua_Zone::GetExperienceMultiplier()
|
float Lua_Zone::GetExperienceMultiplier()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Real();
|
Lua_Safe_Call_Real();
|
||||||
return zone_store.GetZoneExperienceMultiplier(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneExperienceMultiplier(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Lua_Zone::GetExpansion()
|
int8 Lua_Zone::GetExpansion()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneExpansion(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneExpansion(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
float Lua_Zone::GetEXPModifier(Lua_Client c)
|
float Lua_Zone::GetEXPModifier(Lua_Client c)
|
||||||
@@ -123,19 +123,19 @@ float Lua_Zone::GetEXPModifierByCharacterID(uint32 character_id)
|
|||||||
int Lua_Zone::GetFastRegenEndurance()
|
int Lua_Zone::GetFastRegenEndurance()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneFastRegenEndurance(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneFastRegenEndurance(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Lua_Zone::GetFastRegenHP()
|
int Lua_Zone::GetFastRegenHP()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneFastRegenHP(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneFastRegenHP(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Lua_Zone::GetFastRegenMana()
|
int Lua_Zone::GetFastRegenMana()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneFastRegenMana(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneFastRegenMana(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Lua_Zone::GetFileName()
|
std::string Lua_Zone::GetFileName()
|
||||||
@@ -147,73 +147,73 @@ std::string Lua_Zone::GetFileName()
|
|||||||
std::string Lua_Zone::GetFlagNeeded()
|
std::string Lua_Zone::GetFlagNeeded()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_String();
|
Lua_Safe_Call_String();
|
||||||
return zone_store.GetZoneFlagNeeded(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneFlagNeeded(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Lua_Zone::GetFogBlue()
|
uint8 Lua_Zone::GetFogBlue()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneFogBlue(self->GetZoneID(), 0, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneFogBlue(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Lua_Zone::GetFogBlue(uint8 slot)
|
uint8 Lua_Zone::GetFogBlue(uint8 slot)
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneFogBlue(self->GetZoneID(), slot, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneFogBlue(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
float Lua_Zone::GetFogDensity()
|
float Lua_Zone::GetFogDensity()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Real();
|
Lua_Safe_Call_Real();
|
||||||
return zone_store.GetZoneFogDensity(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneFogDensity(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Lua_Zone::GetFogGreen()
|
uint8 Lua_Zone::GetFogGreen()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneFogGreen(self->GetZoneID(), 0, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneFogGreen(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Lua_Zone::GetFogGreen(uint8 slot)
|
uint8 Lua_Zone::GetFogGreen(uint8 slot)
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneFogGreen(self->GetZoneID(), slot, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneFogGreen(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
float Lua_Zone::GetFogMaximumClip()
|
float Lua_Zone::GetFogMaximumClip()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Real();
|
Lua_Safe_Call_Real();
|
||||||
return zone_store.GetZoneFogMaximumClip(self->GetZoneID(), 0, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneFogMaximumClip(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
float Lua_Zone::GetFogMaximumClip(uint8 slot)
|
float Lua_Zone::GetFogMaximumClip(uint8 slot)
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Real();
|
Lua_Safe_Call_Real();
|
||||||
return zone_store.GetZoneFogMaximumClip(self->GetZoneID(), slot, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneFogMaximumClip(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
float Lua_Zone::GetFogMinimumClip()
|
float Lua_Zone::GetFogMinimumClip()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Real();
|
Lua_Safe_Call_Real();
|
||||||
return zone_store.GetZoneFogMinimumClip(self->GetZoneID(), 0, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneFogMinimumClip(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
float Lua_Zone::GetFogMinimumClip(uint8 slot)
|
float Lua_Zone::GetFogMinimumClip(uint8 slot)
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Real();
|
Lua_Safe_Call_Real();
|
||||||
return zone_store.GetZoneFogMinimumClip(self->GetZoneID(), slot, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneFogMinimumClip(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Lua_Zone::GetFogRed()
|
uint8 Lua_Zone::GetFogRed()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneFogRed(self->GetZoneID(), 0, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneFogRed(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Lua_Zone::GetFogRed(uint8 slot)
|
uint8 Lua_Zone::GetFogRed(uint8 slot)
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneFogRed(self->GetZoneID(), slot, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneFogRed(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
float Lua_Zone::GetGraveyardHeading()
|
float Lua_Zone::GetGraveyardHeading()
|
||||||
@@ -255,7 +255,7 @@ uint32 Lua_Zone::GetGraveyardZoneID()
|
|||||||
float Lua_Zone::GetGravity()
|
float Lua_Zone::GetGravity()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Real();
|
Lua_Safe_Call_Real();
|
||||||
return zone_store.GetZoneGravity(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneGravity(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Lua_Zone::GetInstanceID()
|
uint32 Lua_Zone::GetInstanceID()
|
||||||
@@ -267,7 +267,7 @@ uint32 Lua_Zone::GetInstanceID()
|
|||||||
uint8 Lua_Zone::GetInstanceType()
|
uint8 Lua_Zone::GetInstanceType()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneInstanceType(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneInstanceType(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16 Lua_Zone::GetInstanceVersion()
|
uint16 Lua_Zone::GetInstanceVersion()
|
||||||
@@ -285,7 +285,7 @@ uint32 Lua_Zone::GetInstanceTimeRemaining()
|
|||||||
int Lua_Zone::GetLavaDamage()
|
int Lua_Zone::GetLavaDamage()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneLavaDamage(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneLavaDamage(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Lua_Zone::GetLongName()
|
std::string Lua_Zone::GetLongName()
|
||||||
@@ -297,19 +297,19 @@ std::string Lua_Zone::GetLongName()
|
|||||||
float Lua_Zone::GetMaximumClip()
|
float Lua_Zone::GetMaximumClip()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Real();
|
Lua_Safe_Call_Real();
|
||||||
return zone_store.GetZoneMaximumClip(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneMaximumClip(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Lua_Zone::GetMaximumExpansion()
|
int8 Lua_Zone::GetMaximumExpansion()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneMaximumExpansion(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneMaximumExpansion(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Lua_Zone::GetMaximumLevel()
|
uint8 Lua_Zone::GetMaximumLevel()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneMaximumLevel(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneMaximumLevel(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Lua_Zone::GetMaxClients()
|
uint32 Lua_Zone::GetMaxClients()
|
||||||
@@ -321,79 +321,79 @@ uint32 Lua_Zone::GetMaxClients()
|
|||||||
float Lua_Zone::GetMinimumClip()
|
float Lua_Zone::GetMinimumClip()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneMinimumClip(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneMinimumClip(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Lua_Zone::GetMinimumExpansion()
|
int8 Lua_Zone::GetMinimumExpansion()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneMinimumExpansion(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneMinimumExpansion(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Lua_Zone::GetMinimumLevel()
|
uint8 Lua_Zone::GetMinimumLevel()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneMinimumLevel(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneMinimumLevel(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Lua_Zone::GetMinimumLavaDamage()
|
int Lua_Zone::GetMinimumLavaDamage()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneMinimumLavaDamage(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneMinimumLavaDamage(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Lua_Zone::GetMinimumStatus()
|
uint8 Lua_Zone::GetMinimumStatus()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneMinimumStatus(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneMinimumStatus(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Lua_Zone::GetNote()
|
std::string Lua_Zone::GetNote()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_String();
|
Lua_Safe_Call_String();
|
||||||
return zone_store.GetZoneNote(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneNote(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Lua_Zone::GetNPCMaximumAggroDistance()
|
int Lua_Zone::GetNPCMaximumAggroDistance()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneNPCMaximumAggroDistance(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneNPCMaximumAggroDistance(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Lua_Zone::GetPEQZone()
|
int8 Lua_Zone::GetPEQZone()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZonePEQZone(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZonePEQZone(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Lua_Zone::GetRainChance()
|
int Lua_Zone::GetRainChance()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneRainChance(self->GetZoneID(), 0, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneRainChance(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Lua_Zone::GetRainChance(uint8 slot)
|
int Lua_Zone::GetRainChance(uint8 slot)
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneRainChance(self->GetZoneID(), slot, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneRainChance(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Lua_Zone::GetRainDuration()
|
int Lua_Zone::GetRainDuration()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneRainDuration(self->GetZoneID(), 0, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneRainDuration(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Lua_Zone::GetRainDuration(uint8 slot)
|
int Lua_Zone::GetRainDuration(uint8 slot)
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneRainDuration(self->GetZoneID(), slot, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneRainDuration(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Lua_Zone::GetRuleSet()
|
uint32 Lua_Zone::GetRuleSet()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneRuleSet(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneRuleSet(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
float Lua_Zone::GetSafeHeading()
|
float Lua_Zone::GetSafeHeading()
|
||||||
@@ -435,55 +435,55 @@ uint32 Lua_Zone::GetSecondsBeforeIdle()
|
|||||||
uint64 Lua_Zone::GetShutdownDelay()
|
uint64 Lua_Zone::GetShutdownDelay()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneShutdownDelay(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneShutdownDelay(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Lua_Zone::GetSky()
|
uint8 Lua_Zone::GetSky()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneSky(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneSky(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Lua_Zone::GetSkyLock()
|
int8 Lua_Zone::GetSkyLock()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneSkyLock(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneSkyLock(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Lua_Zone::GetSnowChance()
|
int Lua_Zone::GetSnowChance()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneSnowChance(self->GetZoneID(), 0, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneSnowChance(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Lua_Zone::GetSnowChance(uint8 slot)
|
int Lua_Zone::GetSnowChance(uint8 slot)
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneSnowChance(self->GetZoneID(), slot, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneSnowChance(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Lua_Zone::GetSnowDuration()
|
int Lua_Zone::GetSnowDuration()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneSnowDuration(self->GetZoneID(), 0, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneSnowDuration(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Lua_Zone::GetSnowDuration(uint8 slot)
|
int Lua_Zone::GetSnowDuration(uint8 slot)
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneSnowDuration(self->GetZoneID(), slot, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneSnowDuration(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Lua_Zone::GetTimeType()
|
uint8 Lua_Zone::GetTimeType()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneTimeType(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneTimeType(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Lua_Zone::GetTimeZone()
|
int Lua_Zone::GetTimeZone()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneTimeZone(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneTimeZone(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Lua_Zone::GetZoneDescription()
|
std::string Lua_Zone::GetZoneDescription()
|
||||||
@@ -507,25 +507,25 @@ uint8 Lua_Zone::GetZoneType()
|
|||||||
float Lua_Zone::GetUnderworld()
|
float Lua_Zone::GetUnderworld()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Real();
|
Lua_Safe_Call_Real();
|
||||||
return zone_store.GetZoneUnderworld(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneUnderworld(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Lua_Zone::GetUnderworldTeleportIndex()
|
int Lua_Zone::GetUnderworldTeleportIndex()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneUnderworldTeleportIndex(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneUnderworldTeleportIndex(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
float Lua_Zone::GetWalkSpeed()
|
float Lua_Zone::GetWalkSpeed()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Real();
|
Lua_Safe_Call_Real();
|
||||||
return zone_store.GetZoneWalkSpeed(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneWalkSpeed(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Lua_Zone::GetZoneZType()
|
uint8 Lua_Zone::GetZoneZType()
|
||||||
{
|
{
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return zone_store.GetZoneZType(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneZType(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Lua_Zone::GetZoneTotalBlockedSpells()
|
int Lua_Zone::GetZoneTotalBlockedSpells()
|
||||||
|
|||||||
+4
-9
@@ -93,7 +93,6 @@ extern volatile bool is_zone_loaded;
|
|||||||
|
|
||||||
EntityList entity_list;
|
EntityList entity_list;
|
||||||
WorldServer worldserver;
|
WorldServer worldserver;
|
||||||
ZoneStore zone_store;
|
|
||||||
uint32 numclients = 0;
|
uint32 numclients = 0;
|
||||||
char errorname[32];
|
char errorname[32];
|
||||||
extern Zone *zone;
|
extern Zone *zone;
|
||||||
@@ -101,7 +100,6 @@ extern Zone *zone;
|
|||||||
npcDecayTimes_Struct npcCorpseDecayTimes[100];
|
npcDecayTimes_Struct npcCorpseDecayTimes[100];
|
||||||
TitleManager title_manager;
|
TitleManager title_manager;
|
||||||
QueryServ *QServ = 0;
|
QueryServ *QServ = 0;
|
||||||
TaskManager *task_manager = 0;
|
|
||||||
NpcScaleManager *npc_scale_manager;
|
NpcScaleManager *npc_scale_manager;
|
||||||
QuestParserCollection *parse = 0;
|
QuestParserCollection *parse = 0;
|
||||||
EQEmuLogSys LogSys;
|
EQEmuLogSys LogSys;
|
||||||
@@ -109,7 +107,6 @@ ZoneEventScheduler event_scheduler;
|
|||||||
WorldContentService content_service;
|
WorldContentService content_service;
|
||||||
PlayerEventLogs player_event_logs;
|
PlayerEventLogs player_event_logs;
|
||||||
DatabaseUpdate database_update;
|
DatabaseUpdate database_update;
|
||||||
SkillCaps skill_caps;
|
|
||||||
EvolvingItemsManager evolving_items_manager;
|
EvolvingItemsManager evolving_items_manager;
|
||||||
|
|
||||||
const SPDat_Spell_Struct* spells;
|
const SPDat_Spell_Struct* spells;
|
||||||
@@ -315,7 +312,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
player_event_logs.SetDatabase(&database)->Init();
|
player_event_logs.SetDatabase(&database)->Init();
|
||||||
|
|
||||||
skill_caps.SetContentDatabase(&content_db)->LoadSkillCaps();
|
SkillCaps::Instance()->SetContentDatabase(&content_db)->LoadSkillCaps();
|
||||||
|
|
||||||
const auto c = EQEmuConfig::get();
|
const auto c = EQEmuConfig::get();
|
||||||
if (c->auto_database_updates) {
|
if (c->auto_database_updates) {
|
||||||
@@ -366,9 +363,9 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
zone_store.LoadZones(content_db);
|
ZoneStore::Instance()->LoadZones(content_db);
|
||||||
|
|
||||||
if (zone_store.GetZones().empty()) {
|
if (ZoneStore::Instance()->GetZones().empty()) {
|
||||||
LogError("Failed to load zones data, check your schema for possible errors");
|
LogError("Failed to load zones data, check your schema for possible errors");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -449,8 +446,7 @@ int main(int argc, char **argv)
|
|||||||
npc_scale_manager->LoadScaleData();
|
npc_scale_manager->LoadScaleData();
|
||||||
|
|
||||||
if (RuleB(TaskSystem, EnableTaskSystem)) {
|
if (RuleB(TaskSystem, EnableTaskSystem)) {
|
||||||
task_manager = new TaskManager;
|
TaskManager::Instance()->LoadTasks();
|
||||||
task_manager->LoadTasks();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
parse = new QuestParserCollection();
|
parse = new QuestParserCollection();
|
||||||
@@ -681,7 +677,6 @@ int main(int argc, char **argv)
|
|||||||
zone->Shutdown(true);
|
zone->Shutdown(true);
|
||||||
}
|
}
|
||||||
//Fix for Linux world server problem.
|
//Fix for Linux world server problem.
|
||||||
safe_delete(task_manager);
|
|
||||||
safe_delete(npc_scale_manager);
|
safe_delete(npc_scale_manager);
|
||||||
command_deinit();
|
command_deinit();
|
||||||
bot_command_deinit();
|
bot_command_deinit();
|
||||||
|
|||||||
+3
-3
@@ -67,7 +67,7 @@ Merc::Merc(const NPCType* d, float x, float y, float z, float heading)
|
|||||||
|
|
||||||
int r;
|
int r;
|
||||||
for (r = 0; r <= EQ::skills::HIGHEST_SKILL; r++) {
|
for (r = 0; r <= EQ::skills::HIGHEST_SKILL; r++) {
|
||||||
skills[r] = skill_caps.GetSkillCap(GetClass(), (EQ::skills::SkillType)r, GetLevel()).cap;
|
skills[r] = SkillCaps::Instance()->GetSkillCap(GetClass(), (EQ::skills::SkillType)r, GetLevel()).cap;
|
||||||
}
|
}
|
||||||
|
|
||||||
size = d->size;
|
size = d->size;
|
||||||
@@ -774,12 +774,12 @@ bool Merc::HasSkill(EQ::skills::SkillType skill_id) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Merc::CanHaveSkill(EQ::skills::SkillType skill_id) const {
|
bool Merc::CanHaveSkill(EQ::skills::SkillType skill_id) const {
|
||||||
return skill_caps.GetSkillCap(GetClass(), skill_id, RuleI(Character, MaxLevel)).cap > 0;
|
return SkillCaps::Instance()->GetSkillCap(GetClass(), skill_id, RuleI(Character, MaxLevel)).cap > 0;
|
||||||
//if you don't have it by max level, then odds are you never will?
|
//if you don't have it by max level, then odds are you never will?
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16 Merc::MaxSkill(EQ::skills::SkillType skillid, uint16 class_, uint16 level) const {
|
uint16 Merc::MaxSkill(EQ::skills::SkillType skillid, uint16 class_, uint16 level) const {
|
||||||
return skill_caps.GetSkillCap(class_, skillid, level).cap;
|
return SkillCaps::Instance()->GetSkillCap(class_, skillid, level).cap;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Merc::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
void Merc::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||||
|
|||||||
@@ -208,6 +208,10 @@ public:
|
|||||||
Timer m_see_close_mobs_timer;
|
Timer m_see_close_mobs_timer;
|
||||||
Timer m_mob_check_moving_timer;
|
Timer m_mob_check_moving_timer;
|
||||||
|
|
||||||
|
uint16 m_last_wearchange_race_id = 0;
|
||||||
|
// client_id -> slot_id -> key
|
||||||
|
std::unordered_map<uint32_t, std::unordered_map<uint8_t, uint64_t>> m_last_seen_wearchange;
|
||||||
|
|
||||||
// Bot attack flag
|
// Bot attack flag
|
||||||
Timer bot_attack_flag_timer;
|
Timer bot_attack_flag_timer;
|
||||||
|
|
||||||
|
|||||||
+44
-8
@@ -381,10 +381,6 @@ void Mob::SendWearChange(uint8 material_slot, Client *one_client)
|
|||||||
auto packet = new EQApplicationPacket(OP_WearChange, sizeof(WearChange_Struct));
|
auto packet = new EQApplicationPacket(OP_WearChange, sizeof(WearChange_Struct));
|
||||||
auto w = (WearChange_Struct *) packet->pBuffer;
|
auto w = (WearChange_Struct *) packet->pBuffer;
|
||||||
|
|
||||||
Log(Logs::Detail, Logs::MobAppearance, "[%s]",
|
|
||||||
GetCleanName()
|
|
||||||
);
|
|
||||||
|
|
||||||
w->spawn_id = GetID();
|
w->spawn_id = GetID();
|
||||||
w->material = static_cast<uint32>(GetEquipmentMaterial(material_slot));
|
w->material = static_cast<uint32>(GetEquipmentMaterial(material_slot));
|
||||||
w->elite_material = IsEliteMaterialItem(material_slot);
|
w->elite_material = IsEliteMaterialItem(material_slot);
|
||||||
@@ -399,10 +395,50 @@ void Mob::SendWearChange(uint8 material_slot, Client *one_client)
|
|||||||
|
|
||||||
w->wear_slot_id = material_slot;
|
w->wear_slot_id = material_slot;
|
||||||
|
|
||||||
if (!one_client) {
|
if (GetRace() != m_last_wearchange_race_id) {
|
||||||
entity_list.QueueClients(this, packet);
|
m_last_seen_wearchange.clear();
|
||||||
} else {
|
m_last_wearchange_race_id = GetRace();
|
||||||
one_client->QueuePacket(packet, false, Client::CLIENT_CONNECTED);
|
}
|
||||||
|
|
||||||
|
// this is a hash-like key to deduplicate packets sent to clients
|
||||||
|
// it includes spawn_id, material, elite_material, hero_forge_model, wear_slot_id, and color
|
||||||
|
// we send an enormous amount of wearchange packets in brute-force fashion and this is a low cost way to deduplicate them
|
||||||
|
// we could remove all the extra wearchanges at the expense of tracing down intermittent visual bugs over a long time
|
||||||
|
auto build_key = [&](const WearChange_Struct& s) -> uint64_t {
|
||||||
|
uint64_t key = 0;
|
||||||
|
|
||||||
|
key |= static_cast<uint64_t>(s.material & 0xFFF) << 0; // 12 bits
|
||||||
|
key |= static_cast<uint64_t>(s.elite_material & 0x1) << 12; // 1 bit
|
||||||
|
key |= static_cast<uint64_t>(s.hero_forge_model & 0xFFFFF) << 13; // 20 bits
|
||||||
|
key |= static_cast<uint64_t>(GetRace() & 0xFFFF) << 33; // 16 bits
|
||||||
|
|
||||||
|
// Optional: Fold in color for appearance differences
|
||||||
|
uint8_t folded_color = static_cast<uint8_t>(
|
||||||
|
(s.color.Color * 17ull) & 0xFF
|
||||||
|
);
|
||||||
|
key |= static_cast<uint64_t>(folded_color) << 49;
|
||||||
|
|
||||||
|
return key;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
auto dedupe_key = build_key(*w);
|
||||||
|
auto send_if_changed = [&](Client* client) {
|
||||||
|
auto& last_key = m_last_seen_wearchange[client->GetID()][material_slot];
|
||||||
|
if (last_key == dedupe_key) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
last_key = dedupe_key;
|
||||||
|
client->QueuePacket(packet, true, Client::CLIENT_CONNECTED);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (one_client) {
|
||||||
|
send_if_changed(one_client);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for (auto& [_, client] : entity_list.GetClientList()) {
|
||||||
|
send_if_changed(client);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
safe_delete(packet);
|
safe_delete(packet);
|
||||||
|
|||||||
+2
-2
@@ -370,7 +370,7 @@ NPC::NPC(const NPCType *npc_type_data, Spawn2 *in_respawn, const glm::vec4 &posi
|
|||||||
//give NPCs skill values...
|
//give NPCs skill values...
|
||||||
int r;
|
int r;
|
||||||
for (r = 0; r <= EQ::skills::HIGHEST_SKILL; r++) {
|
for (r = 0; r <= EQ::skills::HIGHEST_SKILL; r++) {
|
||||||
skills[r] = skill_caps.GetSkillCap(GetClass(), (EQ::skills::SkillType)r, moblevel).cap;
|
skills[r] = SkillCaps::Instance()->GetSkillCap(GetClass(), (EQ::skills::SkillType)r, moblevel).cap;
|
||||||
}
|
}
|
||||||
// some overrides -- really we need to be able to set skills for mobs in the DB
|
// some overrides -- really we need to be able to set skills for mobs in the DB
|
||||||
// There are some known low level SHM/BST pets that do not follow this, which supports
|
// There are some known low level SHM/BST pets that do not follow this, which supports
|
||||||
@@ -3726,7 +3726,7 @@ void NPC::RecalculateSkills()
|
|||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
for (r = 0; r <= EQ::skills::HIGHEST_SKILL; r++) {
|
for (r = 0; r <= EQ::skills::HIGHEST_SKILL; r++) {
|
||||||
skills[r] = skill_caps.GetSkillCap(GetClass(), (EQ::skills::SkillType)r, level).cap;
|
skills[r] = SkillCaps::Instance()->GetSkillCap(GetClass(), (EQ::skills::SkillType)r, level).cap;
|
||||||
}
|
}
|
||||||
|
|
||||||
// some overrides -- really we need to be able to set skills for mobs in the DB
|
// some overrides -- really we need to be able to set skills for mobs in the DB
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "../merc.h"
|
||||||
|
#include "../mob.h"
|
||||||
|
#include "../npc.h"
|
||||||
|
#include "../corpse.h"
|
||||||
|
#include "../doors.h"
|
||||||
|
#include "../bot.h"
|
||||||
|
#include "../entity.h"
|
||||||
|
#include "../client.h"
|
||||||
|
#include "../zone.h"
|
||||||
@@ -3336,6 +3336,16 @@ bool Perl_Client_KeyRingRemove(Client* self, uint32 item_id)
|
|||||||
return self->KeyRingRemove(item_id);
|
return self->KeyRingRemove(item_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Perl_Client_CompleteTask(Client* self, int task_id)
|
||||||
|
{
|
||||||
|
return self->CompleteTask(task_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Perl_Client_UncompleteTask(Client* self, int task_id)
|
||||||
|
{
|
||||||
|
return self->UncompleteTask(task_id);
|
||||||
|
}
|
||||||
|
|
||||||
void perl_register_client()
|
void perl_register_client()
|
||||||
{
|
{
|
||||||
perl::interpreter perl(PERL_GET_THX);
|
perl::interpreter perl(PERL_GET_THX);
|
||||||
@@ -3418,6 +3428,7 @@ void perl_register_client()
|
|||||||
package.add("ClearPEQZoneFlag", &Perl_Client_ClearPEQZoneFlag);
|
package.add("ClearPEQZoneFlag", &Perl_Client_ClearPEQZoneFlag);
|
||||||
package.add("ClearXTargets", &Perl_Client_ClearXTargets);
|
package.add("ClearXTargets", &Perl_Client_ClearXTargets);
|
||||||
package.add("ClearZoneFlag", &Perl_Client_ClearZoneFlag);
|
package.add("ClearZoneFlag", &Perl_Client_ClearZoneFlag);
|
||||||
|
package.add("CompleteTask", &Perl_Client_CompleteTask);
|
||||||
package.add("Connected", &Perl_Client_Connected);
|
package.add("Connected", &Perl_Client_Connected);
|
||||||
package.add("CountAugmentEquippedByID", &Perl_Client_CountAugmentEquippedByID);
|
package.add("CountAugmentEquippedByID", &Perl_Client_CountAugmentEquippedByID);
|
||||||
package.add("CountItem", &Perl_Client_CountItem);
|
package.add("CountItem", &Perl_Client_CountItem);
|
||||||
@@ -3909,6 +3920,7 @@ void perl_register_client()
|
|||||||
package.add("Thirsty", &Perl_Client_Thirsty);
|
package.add("Thirsty", &Perl_Client_Thirsty);
|
||||||
package.add("TrainDiscBySpellID", &Perl_Client_TrainDiscBySpellID);
|
package.add("TrainDiscBySpellID", &Perl_Client_TrainDiscBySpellID);
|
||||||
package.add("UnFreeze", &Perl_Client_UnFreeze);
|
package.add("UnFreeze", &Perl_Client_UnFreeze);
|
||||||
|
package.add("UncompleteTask", &Perl_Client_UncompleteTask);
|
||||||
package.add("Undye", &Perl_Client_Undye);
|
package.add("Undye", &Perl_Client_Undye);
|
||||||
package.add("UnmemSpell", (void(*)(Client*, int))&Perl_Client_UnmemSpell);
|
package.add("UnmemSpell", (void(*)(Client*, int))&Perl_Client_UnmemSpell);
|
||||||
package.add("UnmemSpell", (void(*)(Client*, int, bool))&Perl_Client_UnmemSpell);
|
package.add("UnmemSpell", (void(*)(Client*, int, bool))&Perl_Client_UnmemSpell);
|
||||||
|
|||||||
+43
-43
@@ -13,7 +13,7 @@ bool Perl_Zone_BuffTimersSuspended(Zone* self)
|
|||||||
|
|
||||||
bool Perl_Zone_BypassesExpansionCheck(Zone* self)
|
bool Perl_Zone_BypassesExpansionCheck(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneBypassExpansionCheck(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneBypassExpansionCheck(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Perl_Zone_CanBind(Zone* self)
|
bool Perl_Zone_CanBind(Zone* self)
|
||||||
@@ -73,22 +73,22 @@ float Perl_Zone_GetAAEXPModifierByCharacterID(Zone* self, uint32 character_id)
|
|||||||
|
|
||||||
std::string Perl_Zone_GetContentFlags(Zone* self)
|
std::string Perl_Zone_GetContentFlags(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneContentFlags(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneContentFlags(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Perl_Zone_GetContentFlagsDisabled(Zone* self)
|
std::string Perl_Zone_GetContentFlagsDisabled(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneContentFlagsDisabled(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneContentFlagsDisabled(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl_Zone_GetExperienceMultiplier(Zone* self)
|
float Perl_Zone_GetExperienceMultiplier(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneExperienceMultiplier(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneExperienceMultiplier(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Perl_Zone_GetExpansion(Zone* self)
|
int8 Perl_Zone_GetExpansion(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneExpansion(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneExpansion(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl_Zone_GetEXPModifier(Zone* self, Client* c)
|
float Perl_Zone_GetEXPModifier(Zone* self, Client* c)
|
||||||
@@ -103,17 +103,17 @@ float Perl_Zone_GetEXPModifierByCharacterID(Zone* self, uint32 character_id)
|
|||||||
|
|
||||||
int Perl_Zone_GetFastRegenEndurance(Zone* self)
|
int Perl_Zone_GetFastRegenEndurance(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFastRegenEndurance(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneFastRegenEndurance(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl_Zone_GetFastRegenHP(Zone* self)
|
int Perl_Zone_GetFastRegenHP(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFastRegenHP(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneFastRegenHP(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl_Zone_GetFastRegenMana(Zone* self)
|
int Perl_Zone_GetFastRegenMana(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFastRegenMana(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneFastRegenMana(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Perl_Zone_GetFileName(Zone* self)
|
std::string Perl_Zone_GetFileName(Zone* self)
|
||||||
@@ -123,37 +123,37 @@ std::string Perl_Zone_GetFileName(Zone* self)
|
|||||||
|
|
||||||
std::string Perl_Zone_GetFlagNeeded(Zone* self)
|
std::string Perl_Zone_GetFlagNeeded(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFlagNeeded(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneFlagNeeded(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl_Zone_GetFogBlue(Zone* self, uint8 slot = 0)
|
uint8 Perl_Zone_GetFogBlue(Zone* self, uint8 slot = 0)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogBlue(self->GetZoneID(), slot, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneFogBlue(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl_Zone_GetFogDensity(Zone* self)
|
float Perl_Zone_GetFogDensity(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogDensity(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneFogDensity(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl_Zone_GetFogGreen(Zone* self, uint8 slot = 0)
|
uint8 Perl_Zone_GetFogGreen(Zone* self, uint8 slot = 0)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogGreen(self->GetZoneID(), slot, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneFogGreen(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl_Zone_GetFogMaximumClip(Zone* self, uint8 slot = 0)
|
float Perl_Zone_GetFogMaximumClip(Zone* self, uint8 slot = 0)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogMaximumClip(self->GetZoneID(), slot, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneFogMaximumClip(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl_Zone_GetFogMinimumClip(Zone* self, uint8 slot = 0)
|
float Perl_Zone_GetFogMinimumClip(Zone* self, uint8 slot = 0)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogMinimumClip(self->GetZoneID(), slot, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneFogMinimumClip(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl_Zone_GetFogRed(Zone* self, uint8 slot = 0)
|
uint8 Perl_Zone_GetFogRed(Zone* self, uint8 slot = 0)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneFogRed(self->GetZoneID(), slot, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneFogRed(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl_Zone_GetGraveyardHeading(Zone* self)
|
float Perl_Zone_GetGraveyardHeading(Zone* self)
|
||||||
@@ -188,7 +188,7 @@ uint32 Perl_Zone_GetGraveyardZoneID(Zone* self)
|
|||||||
|
|
||||||
float Perl_Zone_GetGravity(Zone* self)
|
float Perl_Zone_GetGravity(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneGravity(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneGravity(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Perl_Zone_GetInstanceID(Zone* self)
|
uint32 Perl_Zone_GetInstanceID(Zone* self)
|
||||||
@@ -198,7 +198,7 @@ uint32 Perl_Zone_GetInstanceID(Zone* self)
|
|||||||
|
|
||||||
uint8 Perl_Zone_GetInstanceType(Zone* self)
|
uint8 Perl_Zone_GetInstanceType(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneInstanceType(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneInstanceType(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16 Perl_Zone_GetInstanceVersion(Zone* self)
|
uint16 Perl_Zone_GetInstanceVersion(Zone* self)
|
||||||
@@ -213,7 +213,7 @@ uint32 Perl_Zone_GetInstanceTimeRemaining(Zone* self)
|
|||||||
|
|
||||||
int Perl_Zone_GetLavaDamage(Zone* self)
|
int Perl_Zone_GetLavaDamage(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneLavaDamage(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneLavaDamage(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Perl_Zone_GetLongName(Zone* self)
|
std::string Perl_Zone_GetLongName(Zone* self)
|
||||||
@@ -223,17 +223,17 @@ std::string Perl_Zone_GetLongName(Zone* self)
|
|||||||
|
|
||||||
float Perl_Zone_GetMaximumClip(Zone* self)
|
float Perl_Zone_GetMaximumClip(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMaximumClip(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneMaximumClip(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Perl_Zone_GetMaximumExpansion(Zone* self)
|
int8 Perl_Zone_GetMaximumExpansion(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMaximumExpansion(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneMaximumExpansion(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl_Zone_GetMaximumLevel(Zone* self)
|
uint8 Perl_Zone_GetMaximumLevel(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMaximumLevel(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneMaximumLevel(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Perl_Zone_GetMaxClients(Zone* self)
|
uint32 Perl_Zone_GetMaxClients(Zone* self)
|
||||||
@@ -243,57 +243,57 @@ uint32 Perl_Zone_GetMaxClients(Zone* self)
|
|||||||
|
|
||||||
float Perl_Zone_GetMinimumClip(Zone* self)
|
float Perl_Zone_GetMinimumClip(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMinimumClip(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneMinimumClip(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Perl_Zone_GetMinimumExpansion(Zone* self)
|
int8 Perl_Zone_GetMinimumExpansion(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMinimumExpansion(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneMinimumExpansion(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl_Zone_GetMinimumLevel(Zone* self)
|
uint8 Perl_Zone_GetMinimumLevel(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMinimumLevel(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneMinimumLevel(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl_Zone_GetMinimumLavaDamage(Zone* self)
|
int Perl_Zone_GetMinimumLavaDamage(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMinimumLavaDamage(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneMinimumLavaDamage(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl_Zone_GetMinimumStatus(Zone* self)
|
uint8 Perl_Zone_GetMinimumStatus(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneMinimumStatus(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneMinimumStatus(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Perl_Zone_GetNote(Zone* self)
|
std::string Perl_Zone_GetNote(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneNote(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneNote(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl_Zone_GetNPCMaximumAggroDistance(Zone* self)
|
int Perl_Zone_GetNPCMaximumAggroDistance(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneNPCMaximumAggroDistance(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneNPCMaximumAggroDistance(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Perl_Zone_GetPEQZone(Zone* self)
|
int8 Perl_Zone_GetPEQZone(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZonePEQZone(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZonePEQZone(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl_Zone_GetRainChance(Zone* self, uint8 slot = 0)
|
int Perl_Zone_GetRainChance(Zone* self, uint8 slot = 0)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneRainChance(self->GetZoneID(), slot, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneRainChance(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl_Zone_GetRainDuration(Zone* self, uint8 slot = 0)
|
int Perl_Zone_GetRainDuration(Zone* self, uint8 slot = 0)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneRainDuration(self->GetZoneID(), slot, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneRainDuration(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Perl_Zone_GetRuleSet(Zone* self)
|
uint32 Perl_Zone_GetRuleSet(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneRuleSet(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneRuleSet(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl_Zone_GetSafeHeading(Zone* self)
|
float Perl_Zone_GetSafeHeading(Zone* self)
|
||||||
@@ -328,37 +328,37 @@ uint32 Perl_Zone_GetSecondsBeforeIdle(Zone* self)
|
|||||||
|
|
||||||
uint64 Perl_Zone_GetShutdownDelay(Zone* self)
|
uint64 Perl_Zone_GetShutdownDelay(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneShutdownDelay(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneShutdownDelay(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl_Zone_GetSky(Zone* self)
|
uint8 Perl_Zone_GetSky(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSky(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneSky(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 Perl_Zone_GetSkyLock(Zone* self)
|
int8 Perl_Zone_GetSkyLock(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSkyLock(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneSkyLock(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl_Zone_GetSnowChance(Zone* self, uint8 slot = 0)
|
int Perl_Zone_GetSnowChance(Zone* self, uint8 slot = 0)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSnowChance(self->GetZoneID(), slot, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneSnowChance(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl_Zone_GetSnowDuration(Zone* self, uint8 slot = 0)
|
int Perl_Zone_GetSnowDuration(Zone* self, uint8 slot = 0)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneSnowDuration(self->GetZoneID(), slot, self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneSnowDuration(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl_Zone_GetTimeType(Zone* self)
|
uint8 Perl_Zone_GetTimeType(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneTimeType(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneTimeType(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl_Zone_GetTimeZone(Zone* self)
|
int Perl_Zone_GetTimeZone(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneTimeZone(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneTimeZone(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Perl_Zone_GetZoneDescription(Zone* self)
|
std::string Perl_Zone_GetZoneDescription(Zone* self)
|
||||||
@@ -378,22 +378,22 @@ uint8 Perl_Zone_GetZoneType(Zone* self)
|
|||||||
|
|
||||||
float Perl_Zone_GetUnderworld(Zone* self)
|
float Perl_Zone_GetUnderworld(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneUnderworld(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneUnderworld(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl_Zone_GetUnderworldTeleportIndex(Zone* self)
|
int Perl_Zone_GetUnderworldTeleportIndex(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneUnderworldTeleportIndex(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneUnderworldTeleportIndex(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
float Perl_Zone_GetWalkSpeed(Zone* self)
|
float Perl_Zone_GetWalkSpeed(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneWalkSpeed(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneWalkSpeed(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Perl_Zone_GetZoneZType(Zone* self)
|
uint8 Perl_Zone_GetZoneZType(Zone* self)
|
||||||
{
|
{
|
||||||
return zone_store.GetZoneZType(self->GetZoneID(), self->GetInstanceVersion());
|
return ZoneStore::Instance()->GetZoneZType(self->GetZoneID(), self->GetInstanceVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl_Zone_GetZoneTotalBlockedSpells(Zone* self)
|
int Perl_Zone_GetZoneTotalBlockedSpells(Zone* self)
|
||||||
|
|||||||
+1
-3
@@ -38,8 +38,6 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
|||||||
#include "petitions.h"
|
#include "petitions.h"
|
||||||
#include "worldserver.h"
|
#include "worldserver.h"
|
||||||
|
|
||||||
PetitionList petition_list;
|
|
||||||
|
|
||||||
extern WorldServer worldserver;
|
extern WorldServer worldserver;
|
||||||
|
|
||||||
void Petition::SendPetitionToPlayer(Client* clientto) {
|
void Petition::SendPetitionToPlayer(Client* clientto) {
|
||||||
@@ -288,7 +286,7 @@ void ZoneDatabase::RefreshPetitionsFromDB()
|
|||||||
newpet->SetCheckedOut(true);
|
newpet->SetCheckedOut(true);
|
||||||
else
|
else
|
||||||
newpet->SetCheckedOut(false);
|
newpet->SetCheckedOut(false);
|
||||||
petition_list.AddPetition(newpet);
|
PetitionList::Instance()->AddPetition(newpet);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,6 +112,12 @@ public:
|
|||||||
bool FindPetitionByAccountName(const char* acctname);
|
bool FindPetitionByAccountName(const char* acctname);
|
||||||
bool DeletePetitionByCharName(const char* charname);
|
bool DeletePetitionByCharName(const char* charname);
|
||||||
|
|
||||||
|
static PetitionList* Instance()
|
||||||
|
{
|
||||||
|
static PetitionList instance;
|
||||||
|
return &instance;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LinkedList<Petition*> list;
|
LinkedList<Petition*> list;
|
||||||
Mutex PList_Mutex;
|
Mutex PList_Mutex;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include "../common/data_verification.h"
|
#include "../common/data_verification.h"
|
||||||
#include <numbers>
|
#include <numbers>
|
||||||
#include "../common/types.h"
|
#include "../common/types.h"
|
||||||
|
#include <fmt/format.h>
|
||||||
|
|
||||||
constexpr float position_eps = 0.0001f;
|
constexpr float position_eps = 0.0001f;
|
||||||
|
|
||||||
|
|||||||
+58
-10
@@ -1,12 +1,13 @@
|
|||||||
#include "../common/global_define.h"
|
#include "../common/global_define.h"
|
||||||
#include "../common/servertalk.h"
|
#include "../common/servertalk.h"
|
||||||
#include "../common/strings.h"
|
#include "../common/strings.h"
|
||||||
|
#include "../common/events/player_event_logs.h"
|
||||||
#include "queryserv.h"
|
#include "queryserv.h"
|
||||||
#include "worldserver.h"
|
#include "worldserver.h"
|
||||||
|
|
||||||
|
|
||||||
extern WorldServer worldserver;
|
extern WorldServer worldserver;
|
||||||
extern QueryServ *QServ;
|
extern QueryServ* QServ;
|
||||||
|
|
||||||
QueryServ::QueryServ()
|
QueryServ::QueryServ()
|
||||||
{
|
{
|
||||||
@@ -20,18 +21,29 @@ void QueryServ::SendQuery(std::string Query)
|
|||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_QSSendQuery, Query.length() + 5);
|
auto pack = new ServerPacket(ServerOP_QSSendQuery, Query.length() + 5);
|
||||||
pack->WriteUInt32(Query.length()); /* Pack Query String Size so it can be dynamically broken out at queryserv */
|
pack->WriteUInt32(Query.length()); /* Pack Query String Size so it can be dynamically broken out at queryserv */
|
||||||
pack->WriteString(Query.c_str()); /* Query */
|
pack->WriteString(Query.c_str()); /* Query */
|
||||||
worldserver.SendPacket(pack);
|
worldserver.SendPacket(pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QueryServ::Connect()
|
void QueryServ::Connect()
|
||||||
{
|
{
|
||||||
m_connection = std::make_unique<EQ::Net::ServertalkClient>(Config->QSHost, Config->QSPort, false, "Zone", Config->SharedKey);
|
m_connection = std::make_unique<EQ::Net::ServertalkClient>(
|
||||||
|
Config->QSHost,
|
||||||
|
Config->QSPort,
|
||||||
|
false,
|
||||||
|
"Zone",
|
||||||
|
Config->SharedKey
|
||||||
|
);
|
||||||
m_connection->OnMessage(std::bind(&QueryServ::HandleMessage, this, std::placeholders::_1, std::placeholders::_2));
|
m_connection->OnMessage(std::bind(&QueryServ::HandleMessage, this, std::placeholders::_1, std::placeholders::_2));
|
||||||
m_connection->OnConnect([this](EQ::Net::ServertalkClient *client) {
|
m_connection->OnConnect([this](EQ::Net::ServertalkClient* client)
|
||||||
|
{
|
||||||
m_is_qs_connected = true;
|
m_is_qs_connected = true;
|
||||||
LogInfo("Query Server connection established to [{}] [{}]", client->Handle()->RemoteIP(), client->Handle()->RemotePort());
|
LogInfo(
|
||||||
|
"Query Server connection established to [{}] [{}]",
|
||||||
|
client->Handle()->RemoteIP(),
|
||||||
|
client->Handle()->RemotePort()
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
LogInfo(
|
LogInfo(
|
||||||
@@ -41,7 +53,7 @@ void QueryServ::Connect()
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QueryServ::SendPacket(ServerPacket *pack)
|
bool QueryServ::SendPacket(ServerPacket* pack)
|
||||||
{
|
{
|
||||||
if (m_connection.get() == nullptr) {
|
if (m_connection.get() == nullptr) {
|
||||||
Connect();
|
Connect();
|
||||||
@@ -59,14 +71,50 @@ bool QueryServ::SendPacket(ServerPacket *pack)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QueryServ::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
void QueryServ::HandleMessage(uint16 opcode, const EQ::Net::Packet& p)
|
||||||
{
|
{
|
||||||
ServerPacket tpack(opcode, p);
|
ServerPacket tpack(opcode, p);
|
||||||
auto pack = &tpack;
|
auto pack = &tpack;
|
||||||
|
|
||||||
switch (opcode) {
|
switch (opcode) {
|
||||||
default: {
|
case ServerOP_SendPlayerEventSettings:
|
||||||
LogInfo("Unknown ServerOP Received <red>[{}]", opcode);
|
{
|
||||||
|
if (pack->size < sizeof(ServerSendPlayerEvent_Struct)) {
|
||||||
|
LogError("ServerOP_SendPlayerEventSettings: packet too small");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto* data = reinterpret_cast<const ServerSendPlayerEvent_Struct*>(pack->pBuffer);
|
||||||
|
const uint32_t expected_size = sizeof(ServerSendPlayerEvent_Struct) + data->cereal_size;
|
||||||
|
|
||||||
|
if (pack->size < expected_size) {
|
||||||
|
LogError(
|
||||||
|
"ServerOP_SendPlayerEventSettings: packet size mismatch, expected {}, got {}", expected_size,
|
||||||
|
pack->size
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<PlayerEventLogSettingsRepository::PlayerEventLogSettings> settings;
|
||||||
|
|
||||||
|
try {
|
||||||
|
EQ::Util::MemoryStreamReader ms(const_cast<char*>(data->cereal_data), data->cereal_size);
|
||||||
|
cereal::BinaryInputArchive ar(ms);
|
||||||
|
ar(settings);
|
||||||
|
}
|
||||||
|
catch (const std::exception& ex) {
|
||||||
|
LogError("Failed to deserialize PlayerEventLogSettings: {}", ex.what());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
player_event_logs.LoadPlayerEventSettingsFromQS(settings);
|
||||||
|
LogInfo("Loaded {} PlayerEventLogSettings from queryserv", settings.size());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
LogInfo("Unknown ServerOP Received [{}]", opcode);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+40
-18
@@ -40,6 +40,7 @@
|
|||||||
#include "dialogue_window.h"
|
#include "dialogue_window.h"
|
||||||
|
|
||||||
#include "../common/repositories/account_repository.h"
|
#include "../common/repositories/account_repository.h"
|
||||||
|
#include "../common/repositories/completed_tasks_repository.h"
|
||||||
#include "../common/repositories/tradeskill_recipe_repository.h"
|
#include "../common/repositories/tradeskill_recipe_repository.h"
|
||||||
#include "../common/repositories/instance_list_repository.h"
|
#include "../common/repositories/instance_list_repository.h"
|
||||||
#include "../common/repositories/grid_entries_repository.h"
|
#include "../common/repositories/grid_entries_repository.h"
|
||||||
@@ -2868,27 +2869,27 @@ bool QuestManager::createBot(const char *name, const char *lastname, uint8 level
|
|||||||
|
|
||||||
void QuestManager::taskselector(const std::vector<int>& tasks, bool ignore_cooldown) {
|
void QuestManager::taskselector(const std::vector<int>& tasks, bool ignore_cooldown) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && owner && task_manager)
|
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && owner)
|
||||||
initiator->TaskQuestSetSelector(owner, tasks, ignore_cooldown);
|
initiator->TaskQuestSetSelector(owner, tasks, ignore_cooldown);
|
||||||
}
|
}
|
||||||
void QuestManager::enabletask(int taskcount, int *tasks) {
|
void QuestManager::enabletask(int taskcount, int *tasks) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && task_manager)
|
if(RuleB(TaskSystem, EnableTaskSystem) && initiator)
|
||||||
initiator->EnableTask(taskcount, tasks);
|
initiator->EnableTask(taskcount, tasks);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::disabletask(int taskcount, int *tasks) {
|
void QuestManager::disabletask(int taskcount, int *tasks) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && task_manager)
|
if(RuleB(TaskSystem, EnableTaskSystem) && initiator)
|
||||||
initiator->DisableTask(taskcount, tasks);
|
initiator->DisableTask(taskcount, tasks);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QuestManager::istaskenabled(int taskid) {
|
bool QuestManager::istaskenabled(int taskid) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && task_manager)
|
if(RuleB(TaskSystem, EnableTaskSystem) && initiator)
|
||||||
return initiator->IsTaskEnabled(taskid);
|
return initiator->IsTaskEnabled(taskid);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -2897,7 +2898,7 @@ bool QuestManager::istaskenabled(int taskid) {
|
|||||||
void QuestManager::tasksetselector(int tasksetid, bool ignore_cooldown) {
|
void QuestManager::tasksetselector(int tasksetid, bool ignore_cooldown) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
Log(Logs::General, Logs::Tasks, "[UPDATE] TaskSetSelector called for task set %i", tasksetid);
|
Log(Logs::General, Logs::Tasks, "[UPDATE] TaskSetSelector called for task set %i", tasksetid);
|
||||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && owner && task_manager)
|
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && owner)
|
||||||
initiator->TaskSetSelector(owner, tasksetid, ignore_cooldown);
|
initiator->TaskSetSelector(owner, tasksetid, ignore_cooldown);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2958,6 +2959,27 @@ void QuestManager::failtask(int taskid) {
|
|||||||
initiator->FailTask(taskid);
|
initiator->FailTask(taskid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QuestManager::completetask(int task_id) {
|
||||||
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
|
if (!RuleB(TaskSystem, EnableTaskSystem) || !initiator) {
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return initiator->CompleteTask(task_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QuestManager::uncompletetask(int task_id) {
|
||||||
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
|
if (!RuleB(TaskSystem, EnableTaskSystem) || !initiator) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return initiator->UncompleteTask(task_id);
|
||||||
|
}
|
||||||
|
|
||||||
int QuestManager::tasktimeleft(int taskid) {
|
int QuestManager::tasktimeleft(int taskid) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
@@ -2979,8 +3001,8 @@ int QuestManager::enabledtaskcount(int taskset) {
|
|||||||
int QuestManager::firsttaskinset(int taskset) {
|
int QuestManager::firsttaskinset(int taskset) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
if(RuleB(TaskSystem, EnableTaskSystem) && task_manager)
|
if(RuleB(TaskSystem, EnableTaskSystem))
|
||||||
return task_manager->FirstTaskInSet(taskset);
|
return TaskManager::Instance()->FirstTaskInSet(taskset);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -2988,8 +3010,8 @@ int QuestManager::firsttaskinset(int taskset) {
|
|||||||
int QuestManager::lasttaskinset(int taskset) {
|
int QuestManager::lasttaskinset(int taskset) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
if(RuleB(TaskSystem, EnableTaskSystem) && task_manager)
|
if(RuleB(TaskSystem, EnableTaskSystem))
|
||||||
return task_manager->LastTaskInSet(taskset);
|
return TaskManager::Instance()->LastTaskInSet(taskset);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -2997,8 +3019,8 @@ int QuestManager::lasttaskinset(int taskset) {
|
|||||||
int QuestManager::nexttaskinset(int taskset, int taskid) {
|
int QuestManager::nexttaskinset(int taskset, int taskid) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
if(RuleB(TaskSystem, EnableTaskSystem) && task_manager)
|
if(RuleB(TaskSystem, EnableTaskSystem))
|
||||||
return task_manager->NextTaskInSet(taskset, taskid);
|
return TaskManager::Instance()->NextTaskInSet(taskset, taskid);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -3063,8 +3085,8 @@ int QuestManager::completedtasksinset(int taskset) {
|
|||||||
bool QuestManager::istaskappropriate(int task) {
|
bool QuestManager::istaskappropriate(int task) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && task_manager)
|
if(RuleB(TaskSystem, EnableTaskSystem) && initiator)
|
||||||
return task_manager->ValidateLevel(task, initiator->GetLevel());
|
return TaskManager::Instance()->ValidateLevel(task, initiator->GetLevel());
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -3073,7 +3095,7 @@ std::string QuestManager::gettaskname(uint32 task_id) {
|
|||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
if (RuleB(TaskSystem, EnableTaskSystem)) {
|
if (RuleB(TaskSystem, EnableTaskSystem)) {
|
||||||
return task_manager->GetTaskName(task_id);
|
return TaskManager::Instance()->GetTaskName(task_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::string();
|
return std::string();
|
||||||
@@ -3082,8 +3104,8 @@ std::string QuestManager::gettaskname(uint32 task_id) {
|
|||||||
int QuestManager::GetCurrentDzTaskID() {
|
int QuestManager::GetCurrentDzTaskID() {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
if (RuleB(TaskSystem, EnableTaskSystem) && zone && task_manager) {
|
if (RuleB(TaskSystem, EnableTaskSystem) && zone) {
|
||||||
return task_manager->GetCurrentDzTaskID();
|
return TaskManager::Instance()->GetCurrentDzTaskID();
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -3092,8 +3114,8 @@ int QuestManager::GetCurrentDzTaskID() {
|
|||||||
void QuestManager::EndCurrentDzTask(bool send_fail) {
|
void QuestManager::EndCurrentDzTask(bool send_fail) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
if (RuleB(TaskSystem, EnableTaskSystem) && zone && task_manager) {
|
if (RuleB(TaskSystem, EnableTaskSystem) && zone) {
|
||||||
task_manager->EndCurrentDzTask(send_fail);
|
TaskManager::Instance()->EndCurrentDzTask(send_fail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -224,6 +224,8 @@ public:
|
|||||||
void resettaskactivity(int task, int activity);
|
void resettaskactivity(int task, int activity);
|
||||||
void assigntask(int taskid, bool enforce_level_requirement = false);
|
void assigntask(int taskid, bool enforce_level_requirement = false);
|
||||||
void failtask(int taskid);
|
void failtask(int taskid);
|
||||||
|
bool completetask(int task_id);
|
||||||
|
bool uncompletetask(int task_id);
|
||||||
int tasktimeleft(int taskid);
|
int tasktimeleft(int taskid);
|
||||||
bool istaskcompleted(int task_id);
|
bool istaskcompleted(int task_id);
|
||||||
bool aretaskscompleted(const std::vector<int>& task_ids);
|
bool aretaskscompleted(const std::vector<int>& task_ids);
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ void SharedTaskZoneMessaging::HandleWorldMessage(ServerPacket *pack)
|
|||||||
|
|
||||||
for (auto &client: entity_list.GetClientList()) {
|
for (auto &client: entity_list.GetClientList()) {
|
||||||
Client *c = client.second;
|
Client *c = client.second;
|
||||||
task_manager->SyncClientSharedTaskState(c, c->GetTaskState());
|
TaskManager::Instance()->SyncClientSharedTaskState(c, c->GetTaskState());
|
||||||
c->RemoveClientTaskState();
|
c->RemoveClientTaskState();
|
||||||
c->LoadClientTaskState();
|
c->LoadClientTaskState();
|
||||||
}
|
}
|
||||||
|
|||||||
+51
-55
@@ -66,7 +66,7 @@ void ClientTaskState::SendTaskHistory(Client *client, int task_index)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto task_data = task_manager->GetTaskData(task_id);
|
const auto task_data = TaskManager::Instance()->GetTaskData(task_id);
|
||||||
if (!task_data) {
|
if (!task_data) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -252,16 +252,16 @@ int ClientTaskState::EnabledTaskCount(int task_set_id)
|
|||||||
if ((task_set_id <= 0) || (task_set_id >= MAXTASKSETS)) { return -1; }
|
if ((task_set_id <= 0) || (task_set_id >= MAXTASKSETS)) { return -1; }
|
||||||
|
|
||||||
while ((enabled_task_index < m_enabled_tasks.size()) &&
|
while ((enabled_task_index < m_enabled_tasks.size()) &&
|
||||||
(task_set_index < task_manager->m_task_sets[task_set_id].size())) {
|
(task_set_index < TaskManager::Instance()->m_task_sets[task_set_id].size())) {
|
||||||
|
|
||||||
if (m_enabled_tasks[enabled_task_index] == task_manager->m_task_sets[task_set_id][task_set_index]) {
|
if (m_enabled_tasks[enabled_task_index] == TaskManager::Instance()->m_task_sets[task_set_id][task_set_index]) {
|
||||||
enabled_task_count++;
|
enabled_task_count++;
|
||||||
enabled_task_index++;
|
enabled_task_index++;
|
||||||
task_set_index++;
|
task_set_index++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_enabled_tasks[enabled_task_index] < task_manager->m_task_sets[task_set_id][task_set_index]) {
|
if (m_enabled_tasks[enabled_task_index] < TaskManager::Instance()->m_task_sets[task_set_id][task_set_index]) {
|
||||||
enabled_task_index++;
|
enabled_task_index++;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -281,7 +281,7 @@ int ClientTaskState::ActiveTasksInSet(int task_set_id)
|
|||||||
|
|
||||||
int active_task_in_set_count = 0;
|
int active_task_in_set_count = 0;
|
||||||
|
|
||||||
for (int task_id : task_manager->m_task_sets[task_set_id]) {
|
for (int task_id : TaskManager::Instance()->m_task_sets[task_set_id]) {
|
||||||
if (IsTaskActive(task_id)) {
|
if (IsTaskActive(task_id)) {
|
||||||
active_task_in_set_count++;
|
active_task_in_set_count++;
|
||||||
}
|
}
|
||||||
@@ -298,7 +298,7 @@ int ClientTaskState::CompletedTasksInSet(int task_set_id)
|
|||||||
|
|
||||||
int completed_tasks_count = 0;
|
int completed_tasks_count = 0;
|
||||||
|
|
||||||
for (int i : task_manager->m_task_sets[task_set_id]) {
|
for (int i : TaskManager::Instance()->m_task_sets[task_set_id]) {
|
||||||
if (IsTaskCompleted(i)) {
|
if (IsTaskCompleted(i)) {
|
||||||
completed_tasks_count++;
|
completed_tasks_count++;
|
||||||
}
|
}
|
||||||
@@ -362,7 +362,7 @@ bool ClientTaskState::UnlockActivities(Client* client, ClientTaskInformation& ta
|
|||||||
task_info.updated
|
task_info.updated
|
||||||
);
|
);
|
||||||
|
|
||||||
const auto task = task_manager->GetTaskData(task_info.task_id);
|
const auto task = TaskManager::Instance()->GetTaskData(task_info.task_id);
|
||||||
if (!task)
|
if (!task)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
@@ -453,7 +453,7 @@ const TaskInformation* ClientTaskState::GetTaskData(const ClientTaskInformation&
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return task_manager->GetTaskData(client_task.task_id);
|
return TaskManager::Instance()->GetTaskData(client_task.task_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ClientTaskState::CanUpdate(Client* client, const TaskUpdateFilter& filter, int task_id,
|
bool ClientTaskState::CanUpdate(Client* client, const TaskUpdateFilter& filter, int task_id,
|
||||||
@@ -521,11 +521,6 @@ bool ClientTaskState::CanUpdate(Client* client, const TaskUpdateFilter& filter,
|
|||||||
|
|
||||||
int ClientTaskState::UpdateTasks(Client* client, const TaskUpdateFilter& filter, int count)
|
int ClientTaskState::UpdateTasks(Client* client, const TaskUpdateFilter& filter, int count)
|
||||||
{
|
{
|
||||||
if (!task_manager)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int max_updated = 0;
|
int max_updated = 0;
|
||||||
|
|
||||||
for (const auto& client_task : m_active_tasks)
|
for (const auto& client_task : m_active_tasks)
|
||||||
@@ -593,11 +588,6 @@ int ClientTaskState::UpdateTasks(Client* client, const TaskUpdateFilter& filter,
|
|||||||
|
|
||||||
std::pair<int, int> ClientTaskState::FindTask(Client* client, const TaskUpdateFilter& filter) const
|
std::pair<int, int> ClientTaskState::FindTask(Client* client, const TaskUpdateFilter& filter) const
|
||||||
{
|
{
|
||||||
if (!task_manager)
|
|
||||||
{
|
|
||||||
return std::make_pair(0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const auto& client_task : m_active_tasks)
|
for (const auto& client_task : m_active_tasks)
|
||||||
{
|
{
|
||||||
const auto task = GetTaskData(client_task);
|
const auto task = GetTaskData(client_task);
|
||||||
@@ -901,7 +891,7 @@ int ClientTaskState::IncrementDoneCount(
|
|||||||
// and by the 'Task Stage Completed' message
|
// and by the 'Task Stage Completed' message
|
||||||
client->SendTaskActivityComplete(info->task_id, activity_id, task_index, task_data->type);
|
client->SendTaskActivityComplete(info->task_id, activity_id, task_index, task_data->type);
|
||||||
// Send the updated task/activity_information list to the client
|
// Send the updated task/activity_information list to the client
|
||||||
task_manager->SendSingleActiveTaskToClient(client, *info, task_complete, false);
|
TaskManager::Instance()->SendSingleActiveTaskToClient(client, *info, task_complete, false);
|
||||||
|
|
||||||
if (!ignore_quest_update) {
|
if (!ignore_quest_update) {
|
||||||
if (parse->PlayerHasQuestSub(EVENT_TASK_STAGE_COMPLETE)) {
|
if (parse->PlayerHasQuestSub(EVENT_TASK_STAGE_COMPLETE)) {
|
||||||
@@ -929,7 +919,7 @@ int ClientTaskState::IncrementDoneCount(
|
|||||||
if (player_event_logs.IsEventEnabled(PlayerEvent::TASK_COMPLETE)) {
|
if (player_event_logs.IsEventEnabled(PlayerEvent::TASK_COMPLETE)) {
|
||||||
auto e = PlayerEvent::TaskCompleteEvent{
|
auto e = PlayerEvent::TaskCompleteEvent{
|
||||||
.task_id = static_cast<uint32>(info->task_id),
|
.task_id = static_cast<uint32>(info->task_id),
|
||||||
.task_name = task_manager->GetTaskName(static_cast<uint32>(info->task_id)),
|
.task_name = TaskManager::Instance()->GetTaskName(static_cast<uint32>(info->task_id)),
|
||||||
.activity_id = static_cast<uint32>(info->activity[activity_id].activity_id),
|
.activity_id = static_cast<uint32>(info->activity[activity_id].activity_id),
|
||||||
.done_count = static_cast<uint32>(info->activity[activity_id].done_count)
|
.done_count = static_cast<uint32>(info->activity[activity_id].done_count)
|
||||||
};
|
};
|
||||||
@@ -948,7 +938,7 @@ int ClientTaskState::IncrementDoneCount(
|
|||||||
|
|
||||||
// shared tasks linger at the completion step and do not get removed from the task window unlike quests/task
|
// shared tasks linger at the completion step and do not get removed from the task window unlike quests/task
|
||||||
if (task_data->type != TaskType::Shared) {
|
if (task_data->type != TaskType::Shared) {
|
||||||
task_manager->SendCompletedTasksToClient(client, this);
|
TaskManager::Instance()->SendCompletedTasksToClient(client, this);
|
||||||
|
|
||||||
client->CancelTask(task_index, task_data->type);
|
client->CancelTask(task_index, task_data->type);
|
||||||
}
|
}
|
||||||
@@ -958,7 +948,7 @@ int ClientTaskState::IncrementDoneCount(
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Send an updated packet for this single activity_information
|
// Send an updated packet for this single activity_information
|
||||||
task_manager->SendTaskActivityLong(
|
TaskManager::Instance()->SendTaskActivityLong(
|
||||||
client,
|
client,
|
||||||
info->task_id,
|
info->task_id,
|
||||||
activity_id,
|
activity_id,
|
||||||
@@ -968,7 +958,7 @@ int ClientTaskState::IncrementDoneCount(
|
|||||||
if (player_event_logs.IsEventEnabled(PlayerEvent::TASK_UPDATE)) {
|
if (player_event_logs.IsEventEnabled(PlayerEvent::TASK_UPDATE)) {
|
||||||
auto e = PlayerEvent::TaskUpdateEvent{
|
auto e = PlayerEvent::TaskUpdateEvent{
|
||||||
.task_id = static_cast<uint32>(info->task_id),
|
.task_id = static_cast<uint32>(info->task_id),
|
||||||
.task_name = task_manager->GetTaskName(static_cast<uint32>(info->task_id)),
|
.task_name = TaskManager::Instance()->GetTaskName(static_cast<uint32>(info->task_id)),
|
||||||
.activity_id = static_cast<uint32>(info->activity[activity_id].activity_id),
|
.activity_id = static_cast<uint32>(info->activity[activity_id].activity_id),
|
||||||
.done_count = static_cast<uint32>(info->activity[activity_id].done_count)
|
.done_count = static_cast<uint32>(info->activity[activity_id].done_count)
|
||||||
};
|
};
|
||||||
@@ -976,7 +966,7 @@ int ClientTaskState::IncrementDoneCount(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task_manager->SaveClientState(client, this);
|
TaskManager::Instance()->SaveClientState(client, this);
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
@@ -1149,7 +1139,7 @@ void ClientTaskState::FailTask(Client *client, int task_id)
|
|||||||
|
|
||||||
// type: Shared Task (failed via world for all members)
|
// type: Shared Task (failed via world for all members)
|
||||||
if (m_active_shared_task.task_id == task_id) {
|
if (m_active_shared_task.task_id == task_id) {
|
||||||
task_manager->EndSharedTask(*client, task_id, true);
|
TaskManager::Instance()->EndSharedTask(*client, task_id, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1211,7 +1201,7 @@ bool ClientTaskState::IsTaskActivityActive(int task_id, int activity_id)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto task_data = task_manager->GetTaskData(info->task_id);
|
const auto task_data = TaskManager::Instance()->GetTaskData(info->task_id);
|
||||||
if (!task_data) {
|
if (!task_data) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1282,7 +1272,7 @@ void ClientTaskState::UpdateTaskActivity(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto task_data = task_manager->GetTaskData(info->task_id);
|
const auto task_data = TaskManager::Instance()->GetTaskData(info->task_id);
|
||||||
if (!task_data) {
|
if (!task_data) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1352,7 +1342,7 @@ void ClientTaskState::ResetTaskActivity(Client *client, int task_id, int activit
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto task_data = task_manager->GetTaskData(info->task_id);
|
const auto task_data = TaskManager::Instance()->GetTaskData(info->task_id);
|
||||||
if (!task_data) {
|
if (!task_data) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1386,14 +1376,14 @@ void ClientTaskState::ResetTaskActivity(Client *client, int task_id, int activit
|
|||||||
|
|
||||||
bool ClientTaskState::CompleteTask(Client *c, uint32 task_id)
|
bool ClientTaskState::CompleteTask(Client *c, uint32 task_id)
|
||||||
{
|
{
|
||||||
const auto task_data = task_manager->GetTaskData(task_id);
|
const auto task_data = TaskManager::Instance()->GetTaskData(task_id);
|
||||||
if (!task_data) {
|
if (!task_data) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (
|
for (
|
||||||
int activity_id = 0;
|
int activity_id = 0;
|
||||||
activity_id < task_manager->GetActivityCount(task_id);
|
activity_id < TaskManager::Instance()->GetActivityCount(task_id);
|
||||||
activity_id++
|
activity_id++
|
||||||
) {
|
) {
|
||||||
c->UpdateTaskActivity(
|
c->UpdateTaskActivity(
|
||||||
@@ -1406,9 +1396,19 @@ bool ClientTaskState::CompleteTask(Client *c, uint32 task_id)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ClientTaskState::UncompleteTask(int task_id)
|
||||||
|
{
|
||||||
|
return std::erase_if(
|
||||||
|
m_completed_tasks,
|
||||||
|
[&](const CompletedTaskInformation& task) {
|
||||||
|
return task.task_id == task_id;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
void ClientTaskState::ShowClientTaskInfoMessage(ClientTaskInformation *task, Client *c)
|
void ClientTaskState::ShowClientTaskInfoMessage(ClientTaskInformation *task, Client *c)
|
||||||
{
|
{
|
||||||
const auto task_data = task_manager->GetTaskData(task->task_id);
|
const auto task_data = TaskManager::Instance()->GetTaskData(task->task_id);
|
||||||
|
|
||||||
c->Message(Chat::White, "------------------------------------------------");
|
c->Message(Chat::White, "------------------------------------------------");
|
||||||
c->Message(
|
c->Message(
|
||||||
@@ -1430,7 +1430,7 @@ void ClientTaskState::ShowClientTaskInfoMessage(ClientTaskInformation *task, Cli
|
|||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
|
|
||||||
for (int activity_id = 0; activity_id < task_manager->GetActivityCount(task->task_id); activity_id++) {
|
for (int activity_id = 0; activity_id < TaskManager::Instance()->GetActivityCount(task->task_id); activity_id++) {
|
||||||
std::vector<std::string> update_increments = { "1", "5", "10", "20", "50" };
|
std::vector<std::string> update_increments = { "1", "5", "10", "20", "50" };
|
||||||
std::vector<std::string> update_saylinks;
|
std::vector<std::string> update_saylinks;
|
||||||
|
|
||||||
@@ -1501,7 +1501,7 @@ int ClientTaskState::TaskTimeLeft(int task_id)
|
|||||||
if (m_active_task.task_id == task_id) {
|
if (m_active_task.task_id == task_id) {
|
||||||
int time_now = time(nullptr);
|
int time_now = time(nullptr);
|
||||||
|
|
||||||
const auto task_data = task_manager->GetTaskData(task_id);
|
const auto task_data = TaskManager::Instance()->GetTaskData(task_id);
|
||||||
if (!task_data) {
|
if (!task_data) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -1519,7 +1519,7 @@ int ClientTaskState::TaskTimeLeft(int task_id)
|
|||||||
if (m_active_shared_task.task_id == task_id) {
|
if (m_active_shared_task.task_id == task_id) {
|
||||||
int time_now = time(nullptr);
|
int time_now = time(nullptr);
|
||||||
|
|
||||||
const auto task_data = task_manager->GetTaskData(task_id);
|
const auto task_data = TaskManager::Instance()->GetTaskData(task_id);
|
||||||
if (!task_data) {
|
if (!task_data) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -1544,7 +1544,7 @@ int ClientTaskState::TaskTimeLeft(int task_id)
|
|||||||
|
|
||||||
int time_now = time(nullptr);
|
int time_now = time(nullptr);
|
||||||
|
|
||||||
const auto task_data = task_manager->GetTaskData(active_quest.task_id);
|
const auto task_data = TaskManager::Instance()->GetTaskData(active_quest.task_id);
|
||||||
if (!task_data) {
|
if (!task_data) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -1616,7 +1616,7 @@ bool ClientTaskState::TaskOutOfTime(TaskType task_type, int index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int time_now = time(nullptr);
|
int time_now = time(nullptr);
|
||||||
const auto task_data = task_manager->GetTaskData(info->task_id);
|
const auto task_data = TaskManager::Instance()->GetTaskData(info->task_id);
|
||||||
if (!task_data) {
|
if (!task_data) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1936,7 +1936,7 @@ void ClientTaskState::RemoveTask(Client *client, int sequence_number, TaskType t
|
|||||||
|
|
||||||
void ClientTaskState::RemoveTaskByTaskID(Client *client, uint32 task_id)
|
void ClientTaskState::RemoveTaskByTaskID(Client *client, uint32 task_id)
|
||||||
{
|
{
|
||||||
switch (task_manager->GetTaskType(task_id)) {
|
switch (TaskManager::Instance()->GetTaskType(task_id)) {
|
||||||
case TaskType::Task: {
|
case TaskType::Task: {
|
||||||
if (m_active_task.task_id == task_id) {
|
if (m_active_task.task_id == task_id) {
|
||||||
LogTasks("RemoveTaskByTaskID found Task [{}]", task_id);
|
LogTasks("RemoveTaskByTaskID found Task [{}]", task_id);
|
||||||
@@ -1973,12 +1973,12 @@ void ClientTaskState::AcceptNewTask(
|
|||||||
bool enforce_level_requirement
|
bool enforce_level_requirement
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (!task_manager || task_id < 0) {
|
if (task_id < 0) {
|
||||||
client->Message(Chat::Red, "Task system not functioning, or task_id %i out of range.", task_id);
|
client->Message(Chat::Red, "Task system not functioning, or task_id %i out of range.", task_id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto task = task_manager->GetTaskData(task_id);
|
const auto task = TaskManager::Instance()->GetTaskData(task_id);
|
||||||
if (!task) {
|
if (!task) {
|
||||||
client->Message(Chat::Red, "Invalid task_id %i", task_id);
|
client->Message(Chat::Red, "Invalid task_id %i", task_id);
|
||||||
return;
|
return;
|
||||||
@@ -2048,12 +2048,12 @@ void ClientTaskState::AcceptNewTask(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enforce_level_requirement && !task_manager->ValidateLevel(task_id, client->GetLevel())) {
|
if (enforce_level_requirement && !TaskManager::Instance()->ValidateLevel(task_id, client->GetLevel())) {
|
||||||
client->MessageString(Chat::Yellow, TASK_NOT_RIGHT_LEVEL);
|
client->MessageString(Chat::Yellow, TASK_NOT_RIGHT_LEVEL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!task_manager->IsTaskRepeatable(task_id) && IsTaskCompleted(task_id)) {
|
if (!TaskManager::Instance()->IsTaskRepeatable(task_id) && IsTaskCompleted(task_id)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2184,11 +2184,11 @@ void ClientTaskState::AcceptNewTask(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task_manager->SendSingleActiveTaskToClient(client, *active_slot, false, true);
|
TaskManager::Instance()->SendSingleActiveTaskToClient(client, *active_slot, false, true);
|
||||||
client->StartTaskRequestCooldownTimer();
|
client->StartTaskRequestCooldownTimer();
|
||||||
client->MessageString(Chat::DefaultText, YOU_ASSIGNED_TASK, task->title.c_str());
|
client->MessageString(Chat::DefaultText, YOU_ASSIGNED_TASK, task->title.c_str());
|
||||||
|
|
||||||
task_manager->SaveClientState(client, this);
|
TaskManager::Instance()->SaveClientState(client, this);
|
||||||
|
|
||||||
NPC *npc = entity_list.GetNPCByID(npc_entity_id);
|
NPC *npc = entity_list.GetNPCByID(npc_entity_id);
|
||||||
if (npc) {
|
if (npc) {
|
||||||
@@ -2197,7 +2197,7 @@ void ClientTaskState::AcceptNewTask(
|
|||||||
.npc_id = npc->GetNPCTypeID(),
|
.npc_id = npc->GetNPCTypeID(),
|
||||||
.npc_name = npc->GetCleanName(),
|
.npc_name = npc->GetCleanName(),
|
||||||
.task_id = static_cast<uint32>(task_id),
|
.task_id = static_cast<uint32>(task_id),
|
||||||
.task_name = task_manager->GetTaskName(static_cast<uint32>(task_id)),
|
.task_name = TaskManager::Instance()->GetTaskName(static_cast<uint32>(task_id)),
|
||||||
};
|
};
|
||||||
RecordPlayerEventLogWithClient(client, PlayerEvent::TASK_ACCEPT, e);
|
RecordPlayerEventLogWithClient(client, PlayerEvent::TASK_ACCEPT, e);
|
||||||
}
|
}
|
||||||
@@ -2211,7 +2211,7 @@ void ClientTaskState::AcceptNewTask(
|
|||||||
.npc_id = 0,
|
.npc_id = 0,
|
||||||
.npc_name = "No NPC",
|
.npc_name = "No NPC",
|
||||||
.task_id = static_cast<uint32>(task_id),
|
.task_id = static_cast<uint32>(task_id),
|
||||||
.task_name = task_manager->GetTaskName(static_cast<uint32>(task_id)),
|
.task_name = TaskManager::Instance()->GetTaskName(static_cast<uint32>(task_id)),
|
||||||
};
|
};
|
||||||
RecordPlayerEventLogWithClient(client, PlayerEvent::TASK_ACCEPT, e);
|
RecordPlayerEventLogWithClient(client, PlayerEvent::TASK_ACCEPT, e);
|
||||||
}
|
}
|
||||||
@@ -2247,7 +2247,7 @@ void ClientTaskState::SharedTaskIncrementDoneCount(
|
|||||||
bool ignore_quest_update
|
bool ignore_quest_update
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const auto t = task_manager->GetTaskData(task_id);
|
const auto t = TaskManager::Instance()->GetTaskData(task_id);
|
||||||
|
|
||||||
auto info = GetClientTaskInfo(t->type, TASKSLOTSHAREDTASK);
|
auto info = GetClientTaskInfo(t->type, TASKSLOTSHAREDTASK);
|
||||||
if (info == nullptr) {
|
if (info == nullptr) {
|
||||||
@@ -2286,14 +2286,14 @@ bool ClientTaskState::HasActiveSharedTask()
|
|||||||
|
|
||||||
void ClientTaskState::CreateTaskDynamicZone(Client* client, int task_id, DynamicZone& dz_request)
|
void ClientTaskState::CreateTaskDynamicZone(Client* client, int task_id, DynamicZone& dz_request)
|
||||||
{
|
{
|
||||||
const auto task = task_manager->GetTaskData(task_id);
|
const auto task = TaskManager::Instance()->GetTaskData(task_id);
|
||||||
if (!task)
|
if (!task)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// dz should be named the version-based zone name (used in choose zone window and dz window on live)
|
// dz should be named the version-based zone name (used in choose zone window and dz window on live)
|
||||||
auto zone_info = zone_store.GetZoneWithFallback(dz_request.GetZoneID(), dz_request.GetZoneVersion());
|
auto zone_info = ZoneStore::Instance()->GetZoneWithFallback(dz_request.GetZoneID(), dz_request.GetZoneVersion());
|
||||||
dz_request.SetName(zone_info && !zone_info->long_name.empty() ? zone_info->long_name : task->title);
|
dz_request.SetName(zone_info && !zone_info->long_name.empty() ? zone_info->long_name : task->title);
|
||||||
dz_request.SetMinPlayers(task->min_players);
|
dz_request.SetMinPlayers(task->min_players);
|
||||||
dz_request.SetMaxPlayers(task->max_players);
|
dz_request.SetMaxPlayers(task->max_players);
|
||||||
@@ -2349,7 +2349,7 @@ void ClientTaskState::ListTaskTimers(Client* client)
|
|||||||
|
|
||||||
for (const auto& task_timer : character_task_timers)
|
for (const auto& task_timer : character_task_timers)
|
||||||
{
|
{
|
||||||
const auto task = task_manager->GetTaskData(task_timer.task_id);
|
const auto task = TaskManager::Instance()->GetTaskData(task_timer.task_id);
|
||||||
if (task)
|
if (task)
|
||||||
{
|
{
|
||||||
auto timer_type = static_cast<TaskTimerType>(task_timer.timer_type);
|
auto timer_type = static_cast<TaskTimerType>(task_timer.timer_type);
|
||||||
@@ -2455,10 +2455,6 @@ void ClientTaskState::SyncSharedTaskZoneClientDoneCountState(
|
|||||||
|
|
||||||
bool ClientTaskState::HasActiveTasks()
|
bool ClientTaskState::HasActiveTasks()
|
||||||
{
|
{
|
||||||
if (!task_manager) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_active_task.task_id != TASKSLOTEMPTY) {
|
if (m_active_task.task_id != TASKSLOTEMPTY) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -2495,9 +2491,9 @@ void ClientTaskState::LockSharedTask(Client* client, bool lock)
|
|||||||
|
|
||||||
void ClientTaskState::EndSharedTask(Client* client, bool send_fail)
|
void ClientTaskState::EndSharedTask(Client* client, bool send_fail)
|
||||||
{
|
{
|
||||||
if (task_manager && m_active_shared_task.task_id != TASKSLOTEMPTY)
|
if (m_active_shared_task.task_id != TASKSLOTEMPTY)
|
||||||
{
|
{
|
||||||
task_manager->EndSharedTask(*client, m_active_shared_task.task_id, send_fail);
|
TaskManager::Instance()->EndSharedTask(*client, m_active_shared_task.task_id, send_fail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool ClientTaskState::CanAcceptNewTask(Client* client, int task_id, int npc_entity_id) const
|
bool ClientTaskState::CanAcceptNewTask(Client* client, int task_id, int npc_entity_id) const
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ public:
|
|||||||
bool HasExploreTask(Client* client) const;
|
bool HasExploreTask(Client* client) const;
|
||||||
void EndSharedTask(Client* client, bool send_fail);
|
void EndSharedTask(Client* client, bool send_fail);
|
||||||
bool CompleteTask(Client *c, uint32 task_id);
|
bool CompleteTask(Client *c, uint32 task_id);
|
||||||
|
bool UncompleteTask(int task_id);
|
||||||
|
|
||||||
inline bool HasFreeTaskSlot() { return m_active_task.task_id == TASKSLOTEMPTY; }
|
inline bool HasFreeTaskSlot() { return m_active_task.task_id == TASKSLOTEMPTY; }
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,12 @@ public:
|
|||||||
return it != m_task_data.end() ? &it->second : nullptr;
|
return it != m_task_data.end() ? &it->second : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static TaskManager* Instance()
|
||||||
|
{
|
||||||
|
static TaskManager instance;
|
||||||
|
return &instance;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<int> m_task_sets[MAXTASKSETS];
|
std::vector<int> m_task_sets[MAXTASKSETS];
|
||||||
std::unordered_map<uint32_t, TaskInformation> m_task_data;
|
std::unordered_map<uint32_t, TaskInformation> m_task_data;
|
||||||
|
|||||||
+4
-4
@@ -14,17 +14,17 @@ extern QueryServ *QServ;
|
|||||||
|
|
||||||
void Client::LoadClientTaskState()
|
void Client::LoadClientTaskState()
|
||||||
{
|
{
|
||||||
if (RuleB(TaskSystem, EnableTaskSystem) && task_manager) {
|
if (RuleB(TaskSystem, EnableTaskSystem)) {
|
||||||
LoadClientSharedCompletedTasks();
|
LoadClientSharedCompletedTasks();
|
||||||
|
|
||||||
safe_delete(task_state);
|
safe_delete(task_state);
|
||||||
task_state = new ClientTaskState();
|
task_state = new ClientTaskState();
|
||||||
if (!task_manager->LoadClientState(this, task_state)) {
|
if (!TaskManager::Instance()->LoadClientState(this, task_state)) {
|
||||||
safe_delete(task_state);
|
safe_delete(task_state);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
task_manager->SendActiveTasksToClient(this);
|
TaskManager::Instance()->SendActiveTasksToClient(this);
|
||||||
task_manager->SendCompletedTasksToClient(this, task_state);
|
TaskManager::Instance()->SendCompletedTasksToClient(this, task_state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-11
@@ -68,7 +68,6 @@ extern Zone *zone;
|
|||||||
extern volatile bool is_zone_loaded;
|
extern volatile bool is_zone_loaded;
|
||||||
extern void Shutdown();
|
extern void Shutdown();
|
||||||
extern WorldServer worldserver;
|
extern WorldServer worldserver;
|
||||||
extern PetitionList petition_list;
|
|
||||||
extern uint32 numclients;
|
extern uint32 numclients;
|
||||||
extern volatile bool RunLoops;
|
extern volatile bool RunLoops;
|
||||||
extern QuestParserCollection *parse;
|
extern QuestParserCollection *parse;
|
||||||
@@ -911,8 +910,8 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
|||||||
std::cout << "Got Server Requested Petition List Refresh" << std::endl;
|
std::cout << "Got Server Requested Petition List Refresh" << std::endl;
|
||||||
ServerPetitionUpdate_Struct* sus = (ServerPetitionUpdate_Struct*)pack->pBuffer;
|
ServerPetitionUpdate_Struct* sus = (ServerPetitionUpdate_Struct*)pack->pBuffer;
|
||||||
// this was typoed to = instead of ==, not that it acts any different now though..
|
// this was typoed to = instead of ==, not that it acts any different now though..
|
||||||
if (sus->status == 0) petition_list.ReadDatabase();
|
if (sus->status == 0) PetitionList::Instance()->ReadDatabase();
|
||||||
else if (sus->status == 1) petition_list.ReadDatabase(); // Until I fix this to be better....
|
else if (sus->status == 1) PetitionList::Instance()->ReadDatabase(); // Until I fix this to be better....
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ServerOP_RezzPlayer: {
|
case ServerOP_RezzPlayer: {
|
||||||
@@ -3140,7 +3139,6 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
|||||||
case ServerOP_WWMarquee:
|
case ServerOP_WWMarquee:
|
||||||
{
|
{
|
||||||
auto s = (WWMarquee_Struct*) pack->pBuffer;
|
auto s = (WWMarquee_Struct*) pack->pBuffer;
|
||||||
|
|
||||||
for (const auto& c : entity_list.GetClientList()) {
|
for (const auto& c : entity_list.GetClientList()) {
|
||||||
if (
|
if (
|
||||||
c.second->Admin() >= s->min_status &&
|
c.second->Admin() >= s->min_status &&
|
||||||
@@ -4592,7 +4590,10 @@ void WorldServer::ProcessReload(const ServerReload::Request& request)
|
|||||||
|
|
||||||
case ServerReload::Type::Logs:
|
case ServerReload::Type::Logs:
|
||||||
LogSys.LoadLogDatabaseSettings();
|
LogSys.LoadLogDatabaseSettings();
|
||||||
player_event_logs.ReloadSettings();
|
// if QS process is enabled, we get settings from QS
|
||||||
|
if (!RuleB(Logging, PlayerEventsQSProcess)) {
|
||||||
|
player_event_logs.ReloadSettings();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ServerReload::Type::Loot:
|
case ServerReload::Type::Loot:
|
||||||
@@ -4627,7 +4628,7 @@ void WorldServer::ProcessReload(const ServerReload::Request& request)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ServerReload::Type::SkillCaps:
|
case ServerReload::Type::SkillCaps:
|
||||||
skill_caps.ReloadSkillCaps();
|
SkillCaps::Instance()->ReloadSkillCaps();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ServerReload::Type::DataBucketsCache:
|
case ServerReload::Type::DataBucketsCache:
|
||||||
@@ -4644,11 +4645,9 @@ void WorldServer::ProcessReload(const ServerReload::Request& request)
|
|||||||
case ServerReload::Type::Tasks:
|
case ServerReload::Type::Tasks:
|
||||||
if (RuleB(Tasks, EnableTaskSystem)) {
|
if (RuleB(Tasks, EnableTaskSystem)) {
|
||||||
entity_list.SaveAllClientsTaskState();
|
entity_list.SaveAllClientsTaskState();
|
||||||
safe_delete(task_manager);
|
TaskManager::Instance()->LoadTasks();
|
||||||
task_manager = new TaskManager;
|
|
||||||
task_manager->LoadTasks();
|
|
||||||
entity_list.ReloadAllClientsTaskState();
|
entity_list.ReloadAllClientsTaskState();
|
||||||
task_manager->LoadTaskSets();
|
TaskManager::Instance()->LoadTaskSets();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -4700,7 +4699,7 @@ void WorldServer::ProcessReload(const ServerReload::Request& request)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ServerReload::Type::ZoneData:
|
case ServerReload::Type::ZoneData:
|
||||||
zone_store.LoadZones(content_db);
|
ZoneStore::Instance()->LoadZones(content_db);
|
||||||
zone->LoadZoneCFG(zone->GetShortName(), zone->GetInstanceVersion());
|
zone->LoadZoneCFG(zone->GetShortName(), zone->GetInstanceVersion());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
+6
-7
@@ -81,7 +81,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern bool staticzone;
|
extern bool staticzone;
|
||||||
extern PetitionList petition_list;
|
|
||||||
extern QuestParserCollection* parse;
|
extern QuestParserCollection* parse;
|
||||||
extern uint32 numclients;
|
extern uint32 numclients;
|
||||||
extern WorldServer worldserver;
|
extern WorldServer worldserver;
|
||||||
@@ -924,7 +923,7 @@ void Zone::Shutdown(bool quiet)
|
|||||||
GetInstanceVersion(),
|
GetInstanceVersion(),
|
||||||
GetInstanceID()
|
GetInstanceID()
|
||||||
);
|
);
|
||||||
petition_list.ClearPetitions();
|
PetitionList::Instance()->ClearPetitions();
|
||||||
SetZoneHasCurrentTime(false);
|
SetZoneHasCurrentTime(false);
|
||||||
if (!quiet) {
|
if (!quiet) {
|
||||||
LogInfo(
|
LogInfo(
|
||||||
@@ -1234,8 +1233,8 @@ bool Zone::Init(bool is_static) {
|
|||||||
LoadMercenarySpells();
|
LoadMercenarySpells();
|
||||||
}
|
}
|
||||||
|
|
||||||
petition_list.ClearPetitions();
|
PetitionList::Instance()->ClearPetitions();
|
||||||
petition_list.ReadDatabase();
|
PetitionList::Instance()->ReadDatabase();
|
||||||
|
|
||||||
guild_mgr.LoadGuilds();
|
guild_mgr.LoadGuilds();
|
||||||
|
|
||||||
@@ -1300,7 +1299,7 @@ void Zone::ReloadStaticData() {
|
|||||||
|
|
||||||
bool Zone::LoadZoneCFG(const char* filename, uint16 instance_version)
|
bool Zone::LoadZoneCFG(const char* filename, uint16 instance_version)
|
||||||
{
|
{
|
||||||
auto z = zone_store.GetZoneWithFallback(ZoneID(filename), instance_version);
|
auto z = ZoneStore::Instance()->GetZoneWithFallback(ZoneID(filename), instance_version);
|
||||||
|
|
||||||
if (!z) {
|
if (!z) {
|
||||||
LogError("Failed to load zone data for [{}] instance_version [{}]", filename, instance_version);
|
LogError("Failed to load zone data for [{}] instance_version [{}]", filename, instance_version);
|
||||||
@@ -2251,7 +2250,7 @@ void Zone::LoadZoneBlockedSpells()
|
|||||||
if (!content_db.LoadBlockedSpells(zone_total_blocked_spells, blocked_spells, GetZoneID())) {
|
if (!content_db.LoadBlockedSpells(zone_total_blocked_spells, blocked_spells, GetZoneID())) {
|
||||||
LogError(
|
LogError(
|
||||||
"Failed to load blocked spells for {} ({}).",
|
"Failed to load blocked spells for {} ({}).",
|
||||||
zone_store.GetZoneName(GetZoneID(), true),
|
ZoneStore::Instance()->GetZoneName(GetZoneID(), true),
|
||||||
GetZoneID()
|
GetZoneID()
|
||||||
);
|
);
|
||||||
ClearBlockedSpells();
|
ClearBlockedSpells();
|
||||||
@@ -2261,7 +2260,7 @@ void Zone::LoadZoneBlockedSpells()
|
|||||||
LogInfo(
|
LogInfo(
|
||||||
"Loaded [{}] blocked spells(s) for {} ({}).",
|
"Loaded [{}] blocked spells(s) for {} ({}).",
|
||||||
Strings::Commify(zone_total_blocked_spells),
|
Strings::Commify(zone_total_blocked_spells),
|
||||||
zone_store.GetZoneName(GetZoneID(), true),
|
ZoneStore::Instance()->GetZoneName(GetZoneID(), true),
|
||||||
GetZoneID()
|
GetZoneID()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -2639,7 +2639,7 @@ int64 ZoneDatabase::GetBlockedSpellsCount(uint32 zone_id)
|
|||||||
|
|
||||||
bool ZoneDatabase::LoadBlockedSpells(int64 blocked_spells_count, ZoneSpellsBlocked* into, uint32 zone_id)
|
bool ZoneDatabase::LoadBlockedSpells(int64 blocked_spells_count, ZoneSpellsBlocked* into, uint32 zone_id)
|
||||||
{
|
{
|
||||||
LogInfo("Loading Blocked Spells from database for {} ({}).", zone_store.GetZoneName(zone_id, true), zone_id);
|
LogInfo("Loading Blocked Spells from database for {} ({}).", ZoneStore::Instance()->GetZoneName(zone_id, true), zone_id);
|
||||||
|
|
||||||
const auto& l = BlockedSpellsRepository::GetWhere(
|
const auto& l = BlockedSpellsRepository::GetWhere(
|
||||||
*this,
|
*this,
|
||||||
@@ -2661,7 +2661,7 @@ bool ZoneDatabase::LoadBlockedSpells(int64 blocked_spells_count, ZoneSpellsBlock
|
|||||||
LogError(
|
LogError(
|
||||||
"Blocked spells count of {} exceeded for {} ({}).",
|
"Blocked spells count of {} exceeded for {} ({}).",
|
||||||
blocked_spells_count,
|
blocked_spells_count,
|
||||||
zone_store.GetZoneName(zone_id, true),
|
ZoneStore::Instance()->GetZoneName(zone_id, true),
|
||||||
zone_id
|
zone_id
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|||||||
+1
-1
@@ -352,7 +352,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) {
|
|||||||
if (content_service.GetCurrentExpansion() >= Expansion::Classic && !GetGM()) {
|
if (content_service.GetCurrentExpansion() >= Expansion::Classic && !GetGM()) {
|
||||||
bool meets_zone_expansion_check = false;
|
bool meets_zone_expansion_check = false;
|
||||||
|
|
||||||
auto z = zone_store.GetZoneWithFallback(ZoneID(target_zone_name), 0);
|
auto z = ZoneStore::Instance()->GetZoneWithFallback(ZoneID(target_zone_name), 0);
|
||||||
if (z->expansion <= content_service.GetCurrentExpansion() || z->bypass_expansion_check) {
|
if (z->expansion <= content_service.GetCurrentExpansion() || z->bypass_expansion_check) {
|
||||||
meets_zone_expansion_check = true;
|
meets_zone_expansion_check = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user