mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-06 00:32:25 +00:00
Merge branch 'master' into kinglykrab/lfguildmanager-global-to-singleton
This commit is contained in:
commit
fb47d8a469
@ -42,6 +42,7 @@ IF(USE_MAP_MMFS)
|
|||||||
ENDIF (USE_MAP_MMFS)
|
ENDIF (USE_MAP_MMFS)
|
||||||
|
|
||||||
IF(MSVC)
|
IF(MSVC)
|
||||||
|
add_compile_options(/bigobj)
|
||||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
|
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
|
||||||
ADD_DEFINITIONS(-DNOMINMAX)
|
ADD_DEFINITIONS(-DNOMINMAX)
|
||||||
ADD_DEFINITIONS(-DCRASH_LOGGING)
|
ADD_DEFINITIONS(-DCRASH_LOGGING)
|
||||||
|
|||||||
17
README.md
17
README.md
@ -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>
|
||||||
|
|
||||||
|
|||||||
@ -38,10 +38,7 @@
|
|||||||
#include "../../common/skill_caps.h"
|
#include "../../common/skill_caps.h"
|
||||||
#include "../../common/evolving_items.h"
|
#include "../../common/evolving_items.h"
|
||||||
|
|
||||||
EQEmuLogSys LogSys;
|
|
||||||
WorldContentService content_service;
|
WorldContentService content_service;
|
||||||
ZoneStore zone_store;
|
|
||||||
PathManager path;
|
|
||||||
PlayerEventLogs player_event_logs;
|
PlayerEventLogs player_event_logs;
|
||||||
EvolvingItemsManager evolving_items_manager;
|
EvolvingItemsManager evolving_items_manager;
|
||||||
|
|
||||||
@ -53,10 +50,10 @@ void ExportDBStrings(SharedDatabase *db);
|
|||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
RegisterExecutablePlatform(ExePlatformClientExport);
|
RegisterExecutablePlatform(ExePlatformClientExport);
|
||||||
LogSys.LoadLogSettingsDefaults();
|
EQEmuLogSys::Instance()->LoadLogSettingsDefaults();
|
||||||
set_exception_handler();
|
set_exception_handler();
|
||||||
|
|
||||||
path.LoadPaths();
|
PathManager::Instance()->Init();
|
||||||
|
|
||||||
LogInfo("Client Files Export Utility");
|
LogInfo("Client Files Export Utility");
|
||||||
if (!EQEmuConfig::LoadConfig()) {
|
if (!EQEmuConfig::LoadConfig()) {
|
||||||
@ -99,8 +96,8 @@ int main(int argc, char **argv)
|
|||||||
content_db.SetMySQL(database);
|
content_db.SetMySQL(database);
|
||||||
}
|
}
|
||||||
|
|
||||||
LogSys.SetDatabase(&database)
|
EQEmuLogSys::Instance()->SetDatabase(&database)
|
||||||
->SetLogPath(path.GetLogPath())
|
->SetLogPath(PathManager::Instance()->GetLogPath())
|
||||||
->LoadLogDatabaseSettings()
|
->LoadLogDatabaseSettings()
|
||||||
->StartFileLogs();
|
->StartFileLogs();
|
||||||
|
|
||||||
@ -129,14 +126,14 @@ int main(int argc, char **argv)
|
|||||||
ExportBaseData(&content_db);
|
ExportBaseData(&content_db);
|
||||||
ExportDBStrings(&database);
|
ExportDBStrings(&database);
|
||||||
|
|
||||||
LogSys.CloseFileLogs();
|
EQEmuLogSys::Instance()->CloseFileLogs();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExportSpells(SharedDatabase* db)
|
void ExportSpells(SharedDatabase* db)
|
||||||
{
|
{
|
||||||
std::ofstream file(fmt::format("{}/export/spells_us.txt", path.GetServerPath()));
|
std::ofstream file(fmt::format("{}/export/spells_us.txt", PathManager::Instance()->GetServerPath()));
|
||||||
if (!file || !file.is_open()) {
|
if (!file || !file.is_open()) {
|
||||||
LogError("Unable to open export/spells_us.txt to write, skipping.");
|
LogError("Unable to open export/spells_us.txt to write, skipping.");
|
||||||
return;
|
return;
|
||||||
@ -155,7 +152,7 @@ void ExportSpells(SharedDatabase* db)
|
|||||||
|
|
||||||
void ExportSkillCaps(SharedDatabase* db)
|
void ExportSkillCaps(SharedDatabase* db)
|
||||||
{
|
{
|
||||||
std::ofstream file(fmt::format("{}/export/SkillCaps.txt", path.GetServerPath()));
|
std::ofstream file(fmt::format("{}/export/SkillCaps.txt", PathManager::Instance()->GetServerPath()));
|
||||||
if (!file || !file.is_open()) {
|
if (!file || !file.is_open()) {
|
||||||
LogError("Unable to open export/SkillCaps.txt to write, skipping.");
|
LogError("Unable to open export/SkillCaps.txt to write, skipping.");
|
||||||
return;
|
return;
|
||||||
@ -174,7 +171,7 @@ void ExportSkillCaps(SharedDatabase* db)
|
|||||||
|
|
||||||
void ExportBaseData(SharedDatabase *db)
|
void ExportBaseData(SharedDatabase *db)
|
||||||
{
|
{
|
||||||
std::ofstream file(fmt::format("{}/export/BaseData.txt", path.GetServerPath()));
|
std::ofstream file(fmt::format("{}/export/BaseData.txt", PathManager::Instance()->GetServerPath()));
|
||||||
if (!file || !file.is_open()) {
|
if (!file || !file.is_open()) {
|
||||||
LogError("Unable to open export/BaseData.txt to write, skipping.");
|
LogError("Unable to open export/BaseData.txt to write, skipping.");
|
||||||
return;
|
return;
|
||||||
@ -193,7 +190,7 @@ void ExportBaseData(SharedDatabase *db)
|
|||||||
|
|
||||||
void ExportDBStrings(SharedDatabase *db)
|
void ExportDBStrings(SharedDatabase *db)
|
||||||
{
|
{
|
||||||
std::ofstream file(fmt::format("{}/export/dbstr_us.txt", path.GetServerPath()));
|
std::ofstream file(fmt::format("{}/export/dbstr_us.txt", PathManager::Instance()->GetServerPath()));
|
||||||
if (!file || !file.is_open()) {
|
if (!file || !file.is_open()) {
|
||||||
LogError("Unable to open export/dbstr_us.txt to write, skipping.");
|
LogError("Unable to open export/dbstr_us.txt to write, skipping.");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -32,10 +32,7 @@
|
|||||||
#include "../../common/events/player_event_logs.h"
|
#include "../../common/events/player_event_logs.h"
|
||||||
#include "../../common/evolving_items.h"
|
#include "../../common/evolving_items.h"
|
||||||
|
|
||||||
EQEmuLogSys LogSys;
|
|
||||||
WorldContentService content_service;
|
WorldContentService content_service;
|
||||||
ZoneStore zone_store;
|
|
||||||
PathManager path;
|
|
||||||
PlayerEventLogs player_event_logs;
|
PlayerEventLogs player_event_logs;
|
||||||
EvolvingItemsManager evolving_items_manager;
|
EvolvingItemsManager evolving_items_manager;
|
||||||
|
|
||||||
@ -46,10 +43,10 @@ void ImportDBStrings(SharedDatabase *db);
|
|||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
RegisterExecutablePlatform(ExePlatformClientImport);
|
RegisterExecutablePlatform(ExePlatformClientImport);
|
||||||
LogSys.LoadLogSettingsDefaults();
|
EQEmuLogSys::Instance()->LoadLogSettingsDefaults();
|
||||||
set_exception_handler();
|
set_exception_handler();
|
||||||
|
|
||||||
path.LoadPaths();
|
PathManager::Instance()->Init();
|
||||||
|
|
||||||
LogInfo("Client Files Import Utility");
|
LogInfo("Client Files Import Utility");
|
||||||
if(!EQEmuConfig::LoadConfig()) {
|
if(!EQEmuConfig::LoadConfig()) {
|
||||||
@ -92,8 +89,8 @@ int main(int argc, char **argv) {
|
|||||||
content_db.SetMySQL(database);
|
content_db.SetMySQL(database);
|
||||||
}
|
}
|
||||||
|
|
||||||
LogSys.SetDatabase(&database)
|
EQEmuLogSys::Instance()->SetDatabase(&database)
|
||||||
->SetLogPath(path.GetLogPath())
|
->SetLogPath(PathManager::Instance()->GetLogPath())
|
||||||
->LoadLogDatabaseSettings()
|
->LoadLogDatabaseSettings()
|
||||||
->StartFileLogs();
|
->StartFileLogs();
|
||||||
|
|
||||||
@ -102,7 +99,7 @@ int main(int argc, char **argv) {
|
|||||||
ImportBaseData(&content_db);
|
ImportBaseData(&content_db);
|
||||||
ImportDBStrings(&database);
|
ImportDBStrings(&database);
|
||||||
|
|
||||||
LogSys.CloseFileLogs();
|
EQEmuLogSys::Instance()->CloseFileLogs();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -138,7 +135,7 @@ bool IsStringField(int i) {
|
|||||||
|
|
||||||
void ImportSpells(SharedDatabase *db) {
|
void ImportSpells(SharedDatabase *db) {
|
||||||
LogInfo("Importing Spells");
|
LogInfo("Importing Spells");
|
||||||
std::string file = fmt::format("{}/import/spells_us.txt", path.GetServerPath());
|
std::string file = fmt::format("{}/import/spells_us.txt", PathManager::Instance()->GetServerPath());
|
||||||
FILE *f = fopen(file.c_str(), "r");
|
FILE *f = fopen(file.c_str(), "r");
|
||||||
if(!f) {
|
if(!f) {
|
||||||
LogError("Unable to open {} to read, skipping.", file);
|
LogError("Unable to open {} to read, skipping.", file);
|
||||||
@ -228,7 +225,7 @@ void ImportSpells(SharedDatabase *db) {
|
|||||||
void ImportSkillCaps(SharedDatabase *db) {
|
void ImportSkillCaps(SharedDatabase *db) {
|
||||||
LogInfo("Importing Skill Caps");
|
LogInfo("Importing Skill Caps");
|
||||||
|
|
||||||
std::string file = fmt::format("{}/import/SkillCaps.txt", path.GetServerPath());
|
std::string file = fmt::format("{}/import/SkillCaps.txt", PathManager::Instance()->GetServerPath());
|
||||||
FILE *f = fopen(file.c_str(), "r");
|
FILE *f = fopen(file.c_str(), "r");
|
||||||
if(!f) {
|
if(!f) {
|
||||||
LogError("Unable to open {} to read, skipping.", file);
|
LogError("Unable to open {} to read, skipping.", file);
|
||||||
@ -265,7 +262,7 @@ void ImportBaseData(SharedDatabase *db)
|
|||||||
{
|
{
|
||||||
LogInfo("Importing Base Data");
|
LogInfo("Importing Base Data");
|
||||||
|
|
||||||
const std::string& file_name = fmt::format("{}/import/BaseData.txt", path.GetServerPath());
|
const std::string& file_name = fmt::format("{}/import/BaseData.txt", PathManager::Instance()->GetServerPath());
|
||||||
|
|
||||||
const auto& file_contents = File::GetContents(file_name);
|
const auto& file_contents = File::GetContents(file_name);
|
||||||
if (!file_contents.error.empty()) {
|
if (!file_contents.error.empty()) {
|
||||||
@ -305,7 +302,7 @@ void ImportBaseData(SharedDatabase *db)
|
|||||||
void ImportDBStrings(SharedDatabase *db) {
|
void ImportDBStrings(SharedDatabase *db) {
|
||||||
LogInfo("Importing DB Strings");
|
LogInfo("Importing DB Strings");
|
||||||
|
|
||||||
std::string file = fmt::format("{}/import/dbstr_us.txt", path.GetServerPath());
|
std::string file = fmt::format("{}/import/dbstr_us.txt", PathManager::Instance()->GetServerPath());
|
||||||
FILE *f = fopen(file.c_str(), "r");
|
FILE *f = fopen(file.c_str(), "r");
|
||||||
if(!f) {
|
if(!f) {
|
||||||
LogError("Unable to open {} to read, skipping.", file);
|
LogError("Unable to open {} to read, skipping.", file);
|
||||||
|
|||||||
@ -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 &&
|
||||||
|
|||||||
@ -27,6 +27,8 @@ void SendCrashReport(const std::string &crash_report)
|
|||||||
// "http://localhost:3010/api/v1/analytics/server-crash-report", // development
|
// "http://localhost:3010/api/v1/analytics/server-crash-report", // development
|
||||||
};
|
};
|
||||||
|
|
||||||
|
EQEmuLogSys* log = EQEmuLogSys::Instance();
|
||||||
|
|
||||||
auto config = EQEmuConfig::get();
|
auto config = EQEmuConfig::get();
|
||||||
for (auto &e: endpoints) {
|
for (auto &e: endpoints) {
|
||||||
uri u(e);
|
uri u(e);
|
||||||
@ -68,12 +70,12 @@ void SendCrashReport(const std::string &crash_report)
|
|||||||
p["cpus"] = cpus.size();
|
p["cpus"] = cpus.size();
|
||||||
p["origination_info"] = "";
|
p["origination_info"] = "";
|
||||||
|
|
||||||
if (!LogSys.origination_info.zone_short_name.empty()) {
|
if (!log->origination_info.zone_short_name.empty()) {
|
||||||
p["origination_info"] = fmt::format(
|
p["origination_info"] = fmt::format(
|
||||||
"{} ({}) instance_id [{}]",
|
"{} ({}) instance_id [{}]",
|
||||||
LogSys.origination_info.zone_short_name,
|
log->origination_info.zone_short_name,
|
||||||
LogSys.origination_info.zone_long_name,
|
log->origination_info.zone_long_name,
|
||||||
LogSys.origination_info.instance_id
|
log->origination_info.instance_id
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -294,7 +296,7 @@ void print_trace()
|
|||||||
SendCrashReport(crash_report);
|
SendCrashReport(crash_report);
|
||||||
}
|
}
|
||||||
|
|
||||||
LogSys.CloseFileLogs();
|
EQEmuLogSys::Instance()->CloseFileLogs();
|
||||||
|
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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);
|
||||||
|
|||||||
@ -204,7 +204,7 @@ void DatabaseDumpService::DatabaseDump()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (IsDumpOutputToConsole()) {
|
if (IsDumpOutputToConsole()) {
|
||||||
LogSys.SilenceConsoleLogging();
|
EQEmuLogSys::Instance()->SilenceConsoleLogging();
|
||||||
}
|
}
|
||||||
|
|
||||||
LogInfo("MySQL installed [{}]", GetMySQLVersion());
|
LogInfo("MySQL installed [{}]", GetMySQLVersion());
|
||||||
@ -324,7 +324,7 @@ void DatabaseDumpService::DatabaseDump()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!IsDumpOutputToConsole()) {
|
if (!IsDumpOutputToConsole()) {
|
||||||
LogSys.LoadLogSettingsDefaults();
|
EQEmuLogSys::Instance()->LoadLogSettingsDefaults();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pipe_file.empty()) {
|
if (!pipe_file.empty()) {
|
||||||
|
|||||||
@ -154,7 +154,7 @@ bool DatabaseUpdate::UpdateManifest(
|
|||||||
std::vector<int> missing_migrations = {};
|
std::vector<int> missing_migrations = {};
|
||||||
if (version_low != version_high) {
|
if (version_low != version_high) {
|
||||||
|
|
||||||
LogSys.DisableMySQLErrorLogs();
|
EQEmuLogSys::Instance()->DisableMySQLErrorLogs();
|
||||||
bool force_interactive = false;
|
bool force_interactive = false;
|
||||||
for (int version = version_low + 1; version <= version_high; ++version) {
|
for (int version = version_low + 1; version <= version_high; ++version) {
|
||||||
for (auto &e: entries) {
|
for (auto &e: entries) {
|
||||||
@ -184,7 +184,7 @@ bool DatabaseUpdate::UpdateManifest(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LogSys.EnableMySQLErrorLogs();
|
EQEmuLogSys::Instance()->EnableMySQLErrorLogs();
|
||||||
LogInfo("{}", Strings::Repeat("-", BREAK_LENGTH));
|
LogInfo("{}", Strings::Repeat("-", BREAK_LENGTH));
|
||||||
|
|
||||||
if (!missing_migrations.empty() && m_skip_backup) {
|
if (!missing_migrations.empty() && m_skip_backup) {
|
||||||
|
|||||||
@ -33,6 +33,13 @@ public:
|
|||||||
DatabaseUpdate *SetContentDatabase(Database *db);
|
DatabaseUpdate *SetContentDatabase(Database *db);
|
||||||
DatabaseUpdate *SetSkipBackup(bool skip);
|
DatabaseUpdate *SetSkipBackup(bool skip);
|
||||||
bool HasPendingUpdates();
|
bool HasPendingUpdates();
|
||||||
|
|
||||||
|
static DatabaseUpdate* Instance()
|
||||||
|
{
|
||||||
|
static DatabaseUpdate instance;
|
||||||
|
return &instance;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_skip_backup = false;
|
bool m_skip_backup = false;
|
||||||
Database *m_database;
|
Database *m_database;
|
||||||
|
|||||||
@ -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
|
||||||
},
|
},
|
||||||
|
|||||||
@ -160,7 +160,7 @@ MySQLRequestResult DBcore::QueryDatabase(const char *query, uint32 querylen, boo
|
|||||||
(uint32) mysql_insert_id(mysql)
|
(uint32) mysql_insert_id(mysql)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (LogSys.log_settings[Logs::MySQLQuery].is_category_enabled == 1) {
|
if (EQEmuLogSys::Instance()->log_settings[Logs::MySQLQuery].is_category_enabled == 1) {
|
||||||
if ((strncasecmp(query, "select", 6) == 0)) {
|
if ((strncasecmp(query, "select", 6) == 0)) {
|
||||||
LogMySQLQuery(
|
LogMySQLQuery(
|
||||||
"{0} -- ({1} row{2} returned) ({3}s)",
|
"{0} -- ({1} row{2} returned) ({3}s)",
|
||||||
|
|||||||
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "../types.h"
|
#include "../types.h"
|
||||||
#include "../http/httplib.h"
|
|
||||||
#include "../repositories/player_event_logs_repository.h"
|
#include "../repositories/player_event_logs_repository.h"
|
||||||
#include "../events/player_events.h"
|
#include "../events/player_events.h"
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,7 @@ void DiscordManager::ProcessMessageQueue()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto webhook = LogSys.GetDiscordWebhooks()[q.first];
|
auto webhook = EQEmuLogSys::Instance()->GetDiscordWebhooks()[q.first];
|
||||||
std::string message;
|
std::string message;
|
||||||
|
|
||||||
for (auto &m: q.second) {
|
for (auto &m: q.second) {
|
||||||
|
|||||||
@ -13,6 +13,12 @@ public:
|
|||||||
void QueueWebhookMessage(uint32 webhook_id, const std::string& message);
|
void QueueWebhookMessage(uint32 webhook_id, const std::string& message);
|
||||||
void ProcessMessageQueue();
|
void ProcessMessageQueue();
|
||||||
void QueuePlayerEventMessage(const PlayerEvent::PlayerEventContainer& e);
|
void QueuePlayerEventMessage(const PlayerEvent::PlayerEventContainer& e);
|
||||||
|
|
||||||
|
static DiscordManager* Instance()
|
||||||
|
{
|
||||||
|
static DiscordManager instance;
|
||||||
|
return &instance;
|
||||||
|
}
|
||||||
private:
|
private:
|
||||||
std::mutex webhook_queue_lock{};
|
std::mutex webhook_queue_lock{};
|
||||||
std::map<uint32, std::vector<std::string>> webhook_message_queue{};
|
std::map<uint32, std::vector<std::string>> webhook_message_queue{};
|
||||||
|
|||||||
@ -545,13 +545,13 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p)
|
|||||||
uint32 chunksize, used;
|
uint32 chunksize, used;
|
||||||
uint32 length;
|
uint32 length;
|
||||||
|
|
||||||
if (LogSys.log_settings[Logs::Server_Client_Packet].is_category_enabled == 1){
|
if (EQEmuLogSys::Instance()->log_settings[Logs::Server_Client_Packet].is_category_enabled == 1){
|
||||||
if (p->GetOpcode() != OP_SpecialMesg){
|
if (p->GetOpcode() != OP_SpecialMesg){
|
||||||
Log(Logs::General, Logs::Server_Client_Packet, "[%s - 0x%04x] [Size: %u]", OpcodeManager::EmuToName(p->GetOpcode()), p->GetOpcode(), p->Size());
|
Log(Logs::General, Logs::Server_Client_Packet, "[%s - 0x%04x] [Size: %u]", OpcodeManager::EmuToName(p->GetOpcode()), p->GetOpcode(), p->Size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LogSys.log_settings[Logs::Server_Client_Packet_With_Dump].is_category_enabled == 1){
|
if (EQEmuLogSys::Instance()->log_settings[Logs::Server_Client_Packet_With_Dump].is_category_enabled == 1){
|
||||||
if (p->GetOpcode() != OP_SpecialMesg){
|
if (p->GetOpcode() != OP_SpecialMesg){
|
||||||
Log(Logs::General, Logs::Server_Client_Packet_With_Dump, "[%s - 0x%04x] [Size: %u] %s", OpcodeManager::EmuToName(p->GetOpcode()), p->GetOpcode(), p->Size(), DumpPacketToString(p).c_str());
|
Log(Logs::General, Logs::Server_Client_Packet_With_Dump, "[%s - 0x%04x] [Size: %u] %s", OpcodeManager::EmuToName(p->GetOpcode()), p->GetOpcode(), p->Size(), DumpPacketToString(p).c_str());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -436,11 +436,11 @@ void EQEmuConfig::CheckUcsConfigConversion()
|
|||||||
LogInfo("Migrating old [eqemu_config] UCS configuration to new configuration");
|
LogInfo("Migrating old [eqemu_config] UCS configuration to new configuration");
|
||||||
|
|
||||||
std::string config_file_path = std::filesystem::path{
|
std::string config_file_path = std::filesystem::path{
|
||||||
path.GetServerPath() + "/eqemu_config.json"
|
PathManager::Instance()->GetServerPath() + "/eqemu_config.json"
|
||||||
}.string();
|
}.string();
|
||||||
|
|
||||||
std::string config_file_bak_path = std::filesystem::path{
|
std::string config_file_bak_path = std::filesystem::path{
|
||||||
path.GetServerPath() + "/eqemu_config.ucs-migrate-json.bak"
|
PathManager::Instance()->GetServerPath() + "/eqemu_config.ucs-migrate-json.bak"
|
||||||
}.string();
|
}.string();
|
||||||
|
|
||||||
// copy eqemu_config.json to eqemu_config.json.bak
|
// copy eqemu_config.json to eqemu_config.json.bak
|
||||||
|
|||||||
@ -191,7 +191,7 @@ class EQEmuConfig
|
|||||||
|
|
||||||
std::string file = fmt::format(
|
std::string file = fmt::format(
|
||||||
"{}/{}",
|
"{}/{}",
|
||||||
(file_path.empty() ? path.GetServerPath() : file_path),
|
(file_path.empty() ? PathManager::Instance()->GetServerPath() : file_path),
|
||||||
EQEmuConfig::ConfigFile
|
EQEmuConfig::ConfigFile
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -537,9 +537,9 @@ void EQEmuLogSys::StartFileLogs(const std::string &log_name)
|
|||||||
{
|
{
|
||||||
EQEmuLogSys::CloseFileLogs();
|
EQEmuLogSys::CloseFileLogs();
|
||||||
|
|
||||||
if (!File::Exists(path.GetLogPath())) {
|
if (!File::Exists(PathManager::Instance()->GetLogPath())) {
|
||||||
LogInfo("Logs directory not found, creating [{}]", path.GetLogPath());
|
LogInfo("Logs directory not found, creating [{}]", PathManager::Instance()->GetLogPath());
|
||||||
File::Makedir(path.GetLogPath());
|
File::Makedir(PathManager::Instance()->GetLogPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -656,7 +656,7 @@ EQEmuLogSys *EQEmuLogSys::LoadLogDatabaseSettings(bool silent_load)
|
|||||||
// If we go through this whole loop and nothing is set to any debug level, there
|
// If we go through this whole loop and nothing is set to any debug level, there
|
||||||
// is no point to create a file or keep anything open
|
// is no point to create a file or keep anything open
|
||||||
if (log_settings[c.log_category_id].log_to_file > 0) {
|
if (log_settings[c.log_category_id].log_to_file > 0) {
|
||||||
LogSys.m_file_logs_enabled = true;
|
m_file_logs_enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
db_categories.emplace_back(c.log_category_id);
|
db_categories.emplace_back(c.log_category_id);
|
||||||
|
|||||||
@ -266,8 +266,6 @@ namespace Logs {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "eqemu_logsys_log_aliases.h"
|
|
||||||
|
|
||||||
class Database;
|
class Database;
|
||||||
|
|
||||||
constexpr uint16 MAX_DISCORD_WEBHOOK_ID = 300;
|
constexpr uint16 MAX_DISCORD_WEBHOOK_ID = 300;
|
||||||
@ -285,6 +283,12 @@ public:
|
|||||||
EQEmuLogSys *LoadLogSettingsDefaults();
|
EQEmuLogSys *LoadLogSettingsDefaults();
|
||||||
EQEmuLogSys *LoadLogDatabaseSettings(bool silent_load = false);
|
EQEmuLogSys *LoadLogDatabaseSettings(bool silent_load = false);
|
||||||
|
|
||||||
|
static EQEmuLogSys *Instance()
|
||||||
|
{
|
||||||
|
static EQEmuLogSys instance;
|
||||||
|
return &instance;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param directory_name
|
* @param directory_name
|
||||||
*/
|
*/
|
||||||
@ -350,7 +354,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Internally used memory reference for all log settings per category
|
* Internally used memory reference for all log settings per category
|
||||||
* These are loaded via DB and have defaults loaded in LoadLogSettingsDefaults
|
* These are loaded via DB and have defaults loaded in LoadLogSettingsDefaults
|
||||||
* Database loaded via LogSys.SetDatabase(&database)->LoadLogDatabaseSettings();
|
* Database loaded via EQEmuLogSys::Instance()->SetDatabase(&database)->LoadLogDatabaseSettings();
|
||||||
*/
|
*/
|
||||||
LogSettings log_settings[Logs::LogCategory::MaxCategoryID]{};
|
LogSettings log_settings[Logs::LogCategory::MaxCategoryID]{};
|
||||||
|
|
||||||
@ -434,7 +438,7 @@ private:
|
|||||||
void InjectTablesIfNotExist();
|
void InjectTablesIfNotExist();
|
||||||
};
|
};
|
||||||
|
|
||||||
extern EQEmuLogSys LogSys;
|
#include "eqemu_logsys_log_aliases.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
@ -456,7 +460,7 @@ void OutF(
|
|||||||
|
|
||||||
#define OutF(ls, debug_level, log_category, file, func, line, formatStr, ...) \
|
#define OutF(ls, debug_level, log_category, file, func, line, formatStr, ...) \
|
||||||
do { \
|
do { \
|
||||||
ls.Out(debug_level, log_category, file, func, line, fmt::format(formatStr, ##__VA_ARGS__).c_str()); \
|
ls->Out(debug_level, log_category, file, func, line, fmt::format(formatStr, ##__VA_ARGS__).c_str()); \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -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);
|
||||||
@ -508,7 +509,7 @@ bool PlayerEventLogs::IsEventDiscordEnabled(int32_t event_type_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ensure there is a matching webhook to begin with
|
// ensure there is a matching webhook to begin with
|
||||||
if (!LogSys.GetDiscordWebhooks()[m_settings[event_type_id].discord_webhook_id].webhook_url.empty()) {
|
if (!EQEmuLogSys::Instance()->GetDiscordWebhooks()[m_settings[event_type_id].discord_webhook_id].webhook_url.empty()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -528,13 +529,27 @@ std::string PlayerEventLogs::GetDiscordWebhookUrlFromEventType(int32_t event_typ
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ensure there is a matching webhook to begin with
|
// ensure there is a matching webhook to begin with
|
||||||
if (!LogSys.GetDiscordWebhooks()[m_settings[event_type_id].discord_webhook_id].webhook_url.empty()) {
|
if (!EQEmuLogSys::Instance()->GetDiscordWebhooks()[m_settings[event_type_id].discord_webhook_id].webhook_url.empty()) {
|
||||||
return LogSys.GetDiscordWebhooks()[m_settings[event_type_id].discord_webhook_id].webhook_url;
|
return EQEmuLogSys::Instance()->GetDiscordWebhooks()[m_settings[event_type_id].discord_webhook_id].webhook_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
|
|||||||
@ -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)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,7 +55,7 @@ namespace EQ {
|
|||||||
EQ_EXCEPT("IPC Mutex", "Could not create mutex.");
|
EQ_EXCEPT("IPC Mutex", "Could not create mutex.");
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
std::string final_name = fmt::format("{}/{}.lock", path.GetSharedMemoryPath(), name);
|
std::string final_name = fmt::format("{}/{}.lock", PathManager::Instance()->GetSharedMemoryPath(), name);
|
||||||
|
|
||||||
#ifdef __DARWIN
|
#ifdef __DARWIN
|
||||||
#if __DARWIN_C_LEVEL < 200809L
|
#if __DARWIN_C_LEVEL < 200809L
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -1167,7 +1167,7 @@ void EQ::Net::DaybreakConnection::ProcessResend(int stream)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LogSys.IsLogEnabled(Logs::General, Logs::NetClient)) {
|
if (EQEmuLogSys::Instance()->IsLogEnabled(Logs::General, Logs::NetClient)) {
|
||||||
size_t total_size = 0;
|
size_t total_size = 0;
|
||||||
for (auto &e: s->sent_packets) {
|
for (auto &e: s->sent_packets) {
|
||||||
total_size += e.second.packet.Length();
|
total_size += e.second.packet.Length();
|
||||||
|
|||||||
@ -71,7 +71,7 @@ void EQ::Net::EQStream::QueuePacket(const EQApplicationPacket *p, bool ack_req)
|
|||||||
OpcodeManager::EmuToName(p->GetOpcode()),
|
OpcodeManager::EmuToName(p->GetOpcode()),
|
||||||
(*m_opcode_manager)->EmuToEQ(p->GetOpcode()),
|
(*m_opcode_manager)->EmuToEQ(p->GetOpcode()),
|
||||||
p->Size(),
|
p->Size(),
|
||||||
(LogSys.IsLogEnabled(Logs::Detail, Logs::PacketServerClient) ? DumpPacketToString(p) : "")
|
(EQEmuLogSys::Instance()->IsLogEnabled(Logs::Detail, Logs::PacketServerClient) ? DumpPacketToString(p) : "")
|
||||||
);
|
);
|
||||||
|
|
||||||
if (m_opcode_manager && *m_opcode_manager) {
|
if (m_opcode_manager && *m_opcode_manager) {
|
||||||
|
|||||||
@ -319,7 +319,7 @@ void EQ::Net::ServertalkServerConnection::ProcessMessage(EQ::Net::Packet &p)
|
|||||||
size_t message_len = length;
|
size_t message_len = length;
|
||||||
EQ::Net::StaticPacket packet(&data[0], message_len);
|
EQ::Net::StaticPacket packet(&data[0], message_len);
|
||||||
|
|
||||||
const auto is_detail_enabled = LogSys.IsLogEnabled(Logs::Detail, Logs::PacketServerToServer);
|
const auto is_detail_enabled = EQEmuLogSys::Instance()->IsLogEnabled(Logs::Detail, Logs::PacketServerToServer);
|
||||||
if (opcode != ServerOP_KeepAlive || is_detail_enabled) {
|
if (opcode != ServerOP_KeepAlive || is_detail_enabled) {
|
||||||
LogPacketServerToServer(
|
LogPacketServerToServer(
|
||||||
"[{:#06x}] Size [{}] {}",
|
"[{:#06x}] Size [{}] {}",
|
||||||
|
|||||||
@ -78,7 +78,7 @@ namespace RoF
|
|||||||
{
|
{
|
||||||
//create our opcode manager if we havent already
|
//create our opcode manager if we havent already
|
||||||
if (opcodes == nullptr) {
|
if (opcodes == nullptr) {
|
||||||
std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
|
std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
|
||||||
|
|
||||||
//load up the opcode manager.
|
//load up the opcode manager.
|
||||||
//TODO: figure out how to support shared memory with multiple patches...
|
//TODO: figure out how to support shared memory with multiple patches...
|
||||||
@ -117,7 +117,7 @@ namespace RoF
|
|||||||
//we need to go to every stream and replace it's manager.
|
//we need to go to every stream and replace it's manager.
|
||||||
|
|
||||||
if (opcodes != nullptr) {
|
if (opcodes != nullptr) {
|
||||||
std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
|
std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
|
||||||
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
||||||
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
|
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -81,7 +81,7 @@ namespace RoF2
|
|||||||
//create our opcode manager if we havent already
|
//create our opcode manager if we havent already
|
||||||
if (opcodes == nullptr) {
|
if (opcodes == nullptr) {
|
||||||
|
|
||||||
std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
|
std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
|
||||||
|
|
||||||
//load up the opcode manager.
|
//load up the opcode manager.
|
||||||
//TODO: figure out how to support shared memory with multiple patches...
|
//TODO: figure out how to support shared memory with multiple patches...
|
||||||
@ -123,7 +123,7 @@ namespace RoF2
|
|||||||
//we need to go to every stream and replace it's manager.
|
//we need to go to every stream and replace it's manager.
|
||||||
|
|
||||||
if (opcodes != nullptr) {
|
if (opcodes != nullptr) {
|
||||||
std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
|
std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
|
||||||
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
||||||
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
|
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -72,7 +72,7 @@ namespace SoD
|
|||||||
{
|
{
|
||||||
//create our opcode manager if we havent already
|
//create our opcode manager if we havent already
|
||||||
if (opcodes == nullptr) {
|
if (opcodes == nullptr) {
|
||||||
std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
|
std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
|
||||||
//load up the opcode manager.
|
//load up the opcode manager.
|
||||||
//TODO: figure out how to support shared memory with multiple patches...
|
//TODO: figure out how to support shared memory with multiple patches...
|
||||||
opcodes = new RegularOpcodeManager();
|
opcodes = new RegularOpcodeManager();
|
||||||
@ -113,7 +113,7 @@ namespace SoD
|
|||||||
//we need to go to every stream and replace it's manager.
|
//we need to go to every stream and replace it's manager.
|
||||||
|
|
||||||
if (opcodes != nullptr) {
|
if (opcodes != nullptr) {
|
||||||
std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
|
std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
|
||||||
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
||||||
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
|
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
|
||||||
return;
|
return;
|
||||||
@ -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) {
|
||||||
|
|||||||
@ -71,7 +71,7 @@ namespace SoF
|
|||||||
{
|
{
|
||||||
//create our opcode manager if we havent already
|
//create our opcode manager if we havent already
|
||||||
if (opcodes == nullptr) {
|
if (opcodes == nullptr) {
|
||||||
std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
|
std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
|
||||||
//load up the opcode manager.
|
//load up the opcode manager.
|
||||||
//TODO: figure out how to support shared memory with multiple patches...
|
//TODO: figure out how to support shared memory with multiple patches...
|
||||||
opcodes = new RegularOpcodeManager();
|
opcodes = new RegularOpcodeManager();
|
||||||
@ -110,7 +110,7 @@ namespace SoF
|
|||||||
//we need to go to every stream and replace it's manager.
|
//we need to go to every stream and replace it's manager.
|
||||||
|
|
||||||
if (opcodes != nullptr) {
|
if (opcodes != nullptr) {
|
||||||
std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
|
std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
|
||||||
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
||||||
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
|
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
|
||||||
return;
|
return;
|
||||||
@ -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) {
|
||||||
|
|||||||
@ -73,7 +73,7 @@ namespace Titanium
|
|||||||
auto Config = EQEmuConfig::get();
|
auto Config = EQEmuConfig::get();
|
||||||
//create our opcode manager if we havent already
|
//create our opcode manager if we havent already
|
||||||
if (opcodes == nullptr) {
|
if (opcodes == nullptr) {
|
||||||
std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
|
std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
|
||||||
//load up the opcode manager.
|
//load up the opcode manager.
|
||||||
//TODO: figure out how to support shared memory with multiple patches...
|
//TODO: figure out how to support shared memory with multiple patches...
|
||||||
opcodes = new RegularOpcodeManager();
|
opcodes = new RegularOpcodeManager();
|
||||||
@ -114,7 +114,7 @@ namespace Titanium
|
|||||||
//we need to go to every stream and replace it's manager.
|
//we need to go to every stream and replace it's manager.
|
||||||
|
|
||||||
if (opcodes != nullptr) {
|
if (opcodes != nullptr) {
|
||||||
std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
|
std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
|
||||||
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
||||||
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
|
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
|
||||||
return;
|
return;
|
||||||
@ -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;
|
||||||
|
|||||||
@ -76,7 +76,7 @@ namespace UF
|
|||||||
{
|
{
|
||||||
//create our opcode manager if we havent already
|
//create our opcode manager if we havent already
|
||||||
if (opcodes == nullptr) {
|
if (opcodes == nullptr) {
|
||||||
std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
|
std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
|
||||||
//load up the opcode manager.
|
//load up the opcode manager.
|
||||||
//TODO: figure out how to support shared memory with multiple patches...
|
//TODO: figure out how to support shared memory with multiple patches...
|
||||||
opcodes = new RegularOpcodeManager();
|
opcodes = new RegularOpcodeManager();
|
||||||
@ -117,7 +117,7 @@ namespace UF
|
|||||||
//we need to go to every stream and replace it's manager.
|
//we need to go to every stream and replace it's manager.
|
||||||
|
|
||||||
if (opcodes != nullptr) {
|
if (opcodes != nullptr) {
|
||||||
std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
|
std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
|
||||||
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
||||||
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
|
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
namespace fs = std::filesystem;
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
void PathManager::LoadPaths()
|
void PathManager::Init()
|
||||||
{
|
{
|
||||||
m_server_path = File::FindEqemuConfigPath();
|
m_server_path = File::FindEqemuConfigPath();
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,13 @@
|
|||||||
|
|
||||||
class PathManager {
|
class PathManager {
|
||||||
public:
|
public:
|
||||||
void LoadPaths();
|
void Init();
|
||||||
|
|
||||||
|
static PathManager *Instance()
|
||||||
|
{
|
||||||
|
static PathManager instance;
|
||||||
|
return &instance;
|
||||||
|
}
|
||||||
|
|
||||||
[[nodiscard]] const std::string &GetLogPath() const;
|
[[nodiscard]] const std::string &GetLogPath() const;
|
||||||
[[nodiscard]] const std::string &GetLuaModsPath() const;
|
[[nodiscard]] const std::string &GetLuaModsPath() const;
|
||||||
@ -38,6 +44,4 @@ private:
|
|||||||
std::string m_shared_memory_path;
|
std::string m_shared_memory_path;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern PathManager path;
|
|
||||||
|
|
||||||
#endif //EQEMU_PATH_MANAGER_H
|
#endif //EQEMU_PATH_MANAGER_H
|
||||||
|
|||||||
9
common/pch/app-pch.h
Normal file
9
common/pch/app-pch.h
Normal file
@ -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)
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -974,7 +974,7 @@ bool SharedDatabase::LoadItems(const std::string &prefix) {
|
|||||||
const auto Config = EQEmuConfig::get();
|
const auto Config = EQEmuConfig::get();
|
||||||
EQ::IPCMutex mutex("items");
|
EQ::IPCMutex mutex("items");
|
||||||
mutex.Lock();
|
mutex.Lock();
|
||||||
std::string file_name = fmt::format("{}/{}{}", path.GetSharedMemoryPath(), prefix, std::string("items"));
|
std::string file_name = fmt::format("{}/{}{}", PathManager::Instance()->GetSharedMemoryPath(), prefix, std::string("items"));
|
||||||
items_mmf = std::make_unique<EQ::MemoryMappedFile>(file_name);
|
items_mmf = std::make_unique<EQ::MemoryMappedFile>(file_name);
|
||||||
items_hash = std::make_unique<EQ::FixedMemoryHashSet<EQ::ItemData>>(static_cast<uint8*>(items_mmf->Get()), items_mmf->Size());
|
items_hash = std::make_unique<EQ::FixedMemoryHashSet<EQ::ItemData>>(static_cast<uint8*>(items_mmf->Get()), items_mmf->Size());
|
||||||
mutex.Unlock();
|
mutex.Unlock();
|
||||||
@ -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);
|
||||||
@ -1665,7 +1713,7 @@ bool SharedDatabase::LoadSpells(const std::string &prefix, int32 *records, const
|
|||||||
EQ::IPCMutex mutex("spells");
|
EQ::IPCMutex mutex("spells");
|
||||||
mutex.Lock();
|
mutex.Lock();
|
||||||
|
|
||||||
std::string file_name = fmt::format("{}/{}{}", path.GetSharedMemoryPath(), prefix, std::string("spells"));
|
std::string file_name = fmt::format("{}/{}{}", PathManager::Instance()->GetSharedMemoryPath(), prefix, std::string("spells"));
|
||||||
spells_mmf = std::make_unique<EQ::MemoryMappedFile>(file_name);
|
spells_mmf = std::make_unique<EQ::MemoryMappedFile>(file_name);
|
||||||
LogInfo("Loading [{}]", file_name);
|
LogInfo("Loading [{}]", file_name);
|
||||||
*records = *static_cast<uint32*>(spells_mmf->Get());
|
*records = *static_cast<uint32*>(spells_mmf->Get());
|
||||||
|
|||||||
@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
196
common/strings.h
196
common/strings.h
@ -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
|
||||||
|
|||||||
@ -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
|
||||||
|
|
||||||
|
|||||||
@ -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
|
||||||
);
|
);
|
||||||
|
|||||||
@ -33,19 +33,16 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
EQEmuLogSys LogSys;
|
|
||||||
PathManager path;
|
|
||||||
|
|
||||||
bool RunLoops = false;
|
bool RunLoops = false;
|
||||||
|
|
||||||
void CatchSignal(int sig_num);
|
void CatchSignal(int sig_num);
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
RegisterExecutablePlatform(ExePlatformLaunch);
|
RegisterExecutablePlatform(ExePlatformLaunch);
|
||||||
LogSys.LoadLogSettingsDefaults();
|
EQEmuLogSys::Instance()->LoadLogSettingsDefaults();
|
||||||
set_exception_handler();
|
set_exception_handler();
|
||||||
|
|
||||||
path.LoadPaths();
|
PathManager::Instance()->Init();
|
||||||
|
|
||||||
std::string launcher_name;
|
std::string launcher_name;
|
||||||
if(argc == 2) {
|
if(argc == 2) {
|
||||||
@ -169,7 +166,7 @@ int main(int argc, char *argv[]) {
|
|||||||
delete zone->second;
|
delete zone->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
LogSys.CloseFileLogs();
|
EQEmuLogSys::Instance()->CloseFileLogs();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,7 @@ bool Client::Process()
|
|||||||
OpcodeManager::EmuToName(app->GetOpcode()),
|
OpcodeManager::EmuToName(app->GetOpcode()),
|
||||||
o->EmuToEQ(app->GetOpcode()) == 0 ? app->GetProtocolOpcode() : o->EmuToEQ(app->GetOpcode()),
|
o->EmuToEQ(app->GetOpcode()) == 0 ? app->GetProtocolOpcode() : o->EmuToEQ(app->GetOpcode()),
|
||||||
app->Size(),
|
app->Size(),
|
||||||
(LogSys.IsLogEnabled(Logs::Detail, Logs::PacketClientServer) ? DumpPacketToString(app) : "")
|
(EQEmuLogSys::Instance()->IsLogEnabled(Logs::Detail, Logs::PacketClientServer) ? DumpPacketToString(app) : "")
|
||||||
);
|
);
|
||||||
|
|
||||||
if (m_client_status == cs_failed_to_login) {
|
if (m_client_status == cs_failed_to_login) {
|
||||||
|
|||||||
@ -94,7 +94,7 @@ ClientManager::ClientManager()
|
|||||||
|
|
||||||
std::string opcodes_path = fmt::format(
|
std::string opcodes_path = fmt::format(
|
||||||
"{}/{}",
|
"{}/{}",
|
||||||
path.GetOpcodePath(),
|
PathManager::Instance()->GetOpcodePath(),
|
||||||
"login_opcodes.conf"
|
"login_opcodes.conf"
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ ClientManager::ClientManager()
|
|||||||
|
|
||||||
opcodes_path = fmt::format(
|
opcodes_path = fmt::format(
|
||||||
"{}/{}",
|
"{}/{}",
|
||||||
path.GetOpcodePath(),
|
PathManager::Instance()->GetOpcodePath(),
|
||||||
"login_opcodes_sod.conf"
|
"login_opcodes_sod.conf"
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -169,7 +169,7 @@ ClientManager::ClientManager()
|
|||||||
|
|
||||||
opcodes_path = fmt::format(
|
opcodes_path = fmt::format(
|
||||||
"{}/{}",
|
"{}/{}",
|
||||||
path.GetOpcodePath(),
|
PathManager::Instance()->GetOpcodePath(),
|
||||||
"login_opcodes_larion.conf"
|
"login_opcodes_larion.conf"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -22,12 +22,9 @@
|
|||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
LoginServer server;
|
LoginServer server;
|
||||||
EQEmuLogSys LogSys;
|
|
||||||
bool run_server = true;
|
bool run_server = true;
|
||||||
PathManager path;
|
|
||||||
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)
|
||||||
{
|
{
|
||||||
@ -52,7 +49,7 @@ void LoadDatabaseConnection()
|
|||||||
void LoadServerConfig()
|
void LoadServerConfig()
|
||||||
{
|
{
|
||||||
server.config = EQ::JsonConfigFile::Load(
|
server.config = EQ::JsonConfigFile::Load(
|
||||||
fmt::format("{}/login.json", path.GetServerPath())
|
fmt::format("{}/login.json", PathManager::Instance()->GetServerPath())
|
||||||
);
|
);
|
||||||
LogInfo("Config System Init");
|
LogInfo("Config System Init");
|
||||||
|
|
||||||
@ -159,21 +156,21 @@ int main(int argc, char **argv)
|
|||||||
LogInfo("Logging System Init");
|
LogInfo("Logging System Init");
|
||||||
|
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
LogSys.LoadLogSettingsDefaults();
|
EQEmuLogSys::Instance()->LoadLogSettingsDefaults();
|
||||||
}
|
}
|
||||||
|
|
||||||
path.LoadPaths();
|
PathManager::Instance()->Init();
|
||||||
|
|
||||||
// command handler
|
// command handler
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
LogSys.SilenceConsoleLogging();
|
EQEmuLogSys::Instance()->SilenceConsoleLogging();
|
||||||
|
|
||||||
LoadServerConfig();
|
LoadServerConfig();
|
||||||
LoadDatabaseConnection();
|
LoadDatabaseConnection();
|
||||||
|
|
||||||
LogSys.LoadLogSettingsDefaults();
|
EQEmuLogSys::Instance()->LoadLogSettingsDefaults();
|
||||||
LogSys.log_settings[Logs::Debug].log_to_console = static_cast<uint8>(Logs::General);
|
EQEmuLogSys::Instance()->log_settings[Logs::Debug].log_to_console = static_cast<uint8>(Logs::General);
|
||||||
LogSys.log_settings[Logs::Debug].is_category_enabled = 1;
|
EQEmuLogSys::Instance()->log_settings[Logs::Debug].is_category_enabled = 1;
|
||||||
|
|
||||||
LoginserverCommandHandler::CommandHandler(argc, argv);
|
LoginserverCommandHandler::CommandHandler(argc, argv);
|
||||||
}
|
}
|
||||||
@ -182,7 +179,7 @@ int main(int argc, char **argv)
|
|||||||
LoadDatabaseConnection();
|
LoadDatabaseConnection();
|
||||||
|
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
LogSys.SetDatabase(&database)
|
EQEmuLogSys::Instance()->SetDatabase(&database)
|
||||||
->SetLogPath("logs")
|
->SetLogPath("logs")
|
||||||
->LoadLogDatabaseSettings()
|
->LoadLogDatabaseSettings()
|
||||||
->StartFileLogs();
|
->StartFileLogs();
|
||||||
|
|||||||
@ -20,7 +20,6 @@
|
|||||||
#include "../common/net/console_server.h"
|
#include "../common/net/console_server.h"
|
||||||
#include "../queryserv/zonelist.h"
|
#include "../queryserv/zonelist.h"
|
||||||
#include "../queryserv/zoneserver.h"
|
#include "../queryserv/zoneserver.h"
|
||||||
#include "../common/discord/discord_manager.h"
|
|
||||||
|
|
||||||
volatile bool RunLoops = true;
|
volatile bool RunLoops = true;
|
||||||
|
|
||||||
@ -29,13 +28,9 @@ Database database;
|
|||||||
std::string WorldShortName;
|
std::string WorldShortName;
|
||||||
const queryservconfig *Config;
|
const queryservconfig *Config;
|
||||||
WorldServer *worldserver = 0;
|
WorldServer *worldserver = 0;
|
||||||
EQEmuLogSys LogSys;
|
|
||||||
PathManager path;
|
|
||||||
ZoneStore zone_store;
|
|
||||||
PlayerEventLogs player_event_logs;
|
PlayerEventLogs player_event_logs;
|
||||||
ZSList zs_list;
|
ZSList zs_list;
|
||||||
uint32 numzones = 0;
|
uint32 numzones = 0;
|
||||||
DiscordManager discord_manager;
|
|
||||||
|
|
||||||
void CatchSignal(int sig_num)
|
void CatchSignal(int sig_num)
|
||||||
{
|
{
|
||||||
@ -45,11 +40,11 @@ void CatchSignal(int sig_num)
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
RegisterExecutablePlatform(ExePlatformQueryServ);
|
RegisterExecutablePlatform(ExePlatformQueryServ);
|
||||||
LogSys.LoadLogSettingsDefaults();
|
EQEmuLogSys::Instance()->LoadLogSettingsDefaults();
|
||||||
set_exception_handler();
|
set_exception_handler();
|
||||||
Timer LFGuildExpireTimer(60000);
|
Timer LFGuildExpireTimer(60000);
|
||||||
|
|
||||||
path.LoadPaths();
|
PathManager::Instance()->Init();
|
||||||
|
|
||||||
LogInfo("Starting EQEmu QueryServ");
|
LogInfo("Starting EQEmu QueryServ");
|
||||||
if (!queryservconfig::LoadConfig()) {
|
if (!queryservconfig::LoadConfig()) {
|
||||||
@ -84,8 +79,8 @@ int main()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
LogSys.SetDatabase(&database)
|
EQEmuLogSys::Instance()->SetDatabase(&database)
|
||||||
->SetLogPath(path.GetLogPath())
|
->SetLogPath(PathManager::Instance()->GetLogPath())
|
||||||
->LoadLogDatabaseSettings()
|
->LoadLogDatabaseSettings()
|
||||||
->StartFileLogs();
|
->StartFileLogs();
|
||||||
|
|
||||||
@ -186,7 +181,7 @@ int main()
|
|||||||
EQ::EventLoop::Get().Run();
|
EQ::EventLoop::Get().Run();
|
||||||
|
|
||||||
safe_delete(worldserver);
|
safe_delete(worldserver);
|
||||||
LogSys.CloseFileLogs();
|
EQEmuLogSys::Instance()->CloseFileLogs();
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateWindowTitle(char *iNewTitle)
|
void UpdateWindowTitle(char *iNewTitle)
|
||||||
|
|||||||
@ -21,9 +21,16 @@
|
|||||||
#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;
|
||||||
|
<<<<<<< kinglykrab/lfguildmanager-global-to-singleton
|
||||||
|
=======
|
||||||
|
extern LFGuildManager lfguildmanager;
|
||||||
|
extern ZSList zs_list;
|
||||||
|
>>>>>>> master
|
||||||
|
|
||||||
WorldServer::WorldServer()
|
WorldServer::WorldServer()
|
||||||
{
|
{
|
||||||
@ -75,8 +82,9 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
|||||||
case ServerOP_ServerReloadRequest: {
|
case ServerOP_ServerReloadRequest: {
|
||||||
auto o = (ServerReload::Request*) p.Data();
|
auto o = (ServerReload::Request*) p.Data();
|
||||||
if (o->type == ServerReload::Type::Logs) {
|
if (o->type == ServerReload::Type::Logs) {
|
||||||
LogSys.LoadLogDatabaseSettings();
|
EQEmuLogSys::Instance()->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;
|
||||||
|
|||||||
@ -5,8 +5,6 @@
|
|||||||
#include "../common/events/player_event_logs.h"
|
#include "../common/events/player_event_logs.h"
|
||||||
#include "../common/discord/discord_manager.h"
|
#include "../common/discord/discord_manager.h"
|
||||||
|
|
||||||
extern DiscordManager discord_manager;
|
|
||||||
|
|
||||||
ZoneServer::ZoneServer(
|
ZoneServer::ZoneServer(
|
||||||
std::shared_ptr<EQ::Net::ServertalkServerConnection> in_connection,
|
std::shared_ptr<EQ::Net::ServertalkServerConnection> in_connection,
|
||||||
EQ::Net::ConsoleServer *in_console
|
EQ::Net::ConsoleServer *in_console
|
||||||
@ -37,7 +35,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
|||||||
|
|
||||||
player_event_logs.AddToQueue(n.player_event_log);
|
player_event_logs.AddToQueue(n.player_event_log);
|
||||||
|
|
||||||
discord_manager.QueuePlayerEventMessage(n);
|
DiscordManager::Instance()->QueuePlayerEventMessage(n);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
@ -46,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{};
|
||||||
|
|||||||
@ -35,10 +35,7 @@
|
|||||||
#include "../common/events/player_event_logs.h"
|
#include "../common/events/player_event_logs.h"
|
||||||
#include "../common/evolving_items.h"
|
#include "../common/evolving_items.h"
|
||||||
|
|
||||||
EQEmuLogSys LogSys;
|
|
||||||
WorldContentService content_service;
|
WorldContentService content_service;
|
||||||
ZoneStore zone_store;
|
|
||||||
PathManager path;
|
|
||||||
PlayerEventLogs player_event_logs;
|
PlayerEventLogs player_event_logs;
|
||||||
EvolvingItemsManager evolving_items_manager;
|
EvolvingItemsManager evolving_items_manager;
|
||||||
|
|
||||||
@ -81,10 +78,10 @@ inline bool MakeDirectory(const std::string &directory_name)
|
|||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
RegisterExecutablePlatform(ExePlatformSharedMemory);
|
RegisterExecutablePlatform(ExePlatformSharedMemory);
|
||||||
LogSys.LoadLogSettingsDefaults();
|
EQEmuLogSys::Instance()->LoadLogSettingsDefaults();
|
||||||
set_exception_handler();
|
set_exception_handler();
|
||||||
|
|
||||||
path.LoadPaths();
|
PathManager::Instance()->Init();
|
||||||
|
|
||||||
LogInfo("Shared Memory Loader Program");
|
LogInfo("Shared Memory Loader Program");
|
||||||
if (!EQEmuConfig::LoadConfig()) {
|
if (!EQEmuConfig::LoadConfig()) {
|
||||||
@ -126,8 +123,8 @@ int main(int argc, char **argv)
|
|||||||
content_db.SetMySQL(database);
|
content_db.SetMySQL(database);
|
||||||
}
|
}
|
||||||
|
|
||||||
LogSys.SetDatabase(&database)
|
EQEmuLogSys::Instance()->SetDatabase(&database)
|
||||||
->SetLogPath(path.GetLogPath())
|
->SetLogPath(PathManager::Instance()->GetLogPath())
|
||||||
->LoadLogDatabaseSettings()
|
->LoadLogDatabaseSettings()
|
||||||
->StartFileLogs();
|
->StartFileLogs();
|
||||||
|
|
||||||
@ -244,6 +241,6 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LogSys.CloseFileLogs();
|
EQEmuLogSys::Instance()->CloseFileLogs();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,14 +34,12 @@
|
|||||||
#include "task_state_test.h"
|
#include "task_state_test.h"
|
||||||
|
|
||||||
const EQEmuConfig *Config;
|
const EQEmuConfig *Config;
|
||||||
EQEmuLogSys LogSys;
|
|
||||||
PathManager path;
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
RegisterExecutablePlatform(ExePlatformClientImport);
|
RegisterExecutablePlatform(ExePlatformClientImport);
|
||||||
LogSys.LoadLogSettingsDefaults();
|
EQEmuLogSys::Instance()->LoadLogSettingsDefaults();
|
||||||
path.LoadPaths();
|
PathManager::Instance()->Init();
|
||||||
|
|
||||||
auto ConfigLoadResult = EQEmuConfig::LoadConfig();
|
auto ConfigLoadResult = EQEmuConfig::LoadConfig();
|
||||||
Config = EQEmuConfig::get();
|
Config = EQEmuConfig::get();
|
||||||
|
|||||||
@ -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);
|
||||||
|
|||||||
@ -482,7 +482,7 @@ Clientlist::Clientlist(int ChatPort) {
|
|||||||
const ucsconfig *Config = ucsconfig::get();
|
const ucsconfig *Config = ucsconfig::get();
|
||||||
|
|
||||||
|
|
||||||
std::string opcodes_file = fmt::format("{}/{}", path.GetServerPath(), Config->MailOpCodesFile);
|
std::string opcodes_file = fmt::format("{}/{}", PathManager::Instance()->GetServerPath(), Config->MailOpCodesFile);
|
||||||
|
|
||||||
LogInfo("Loading [{}]", opcodes_file);
|
LogInfo("Loading [{}]", opcodes_file);
|
||||||
if (!ChatOpMgr->LoadOpcodes(opcodes_file.c_str()))
|
if (!ChatOpMgr->LoadOpcodes(opcodes_file.c_str()))
|
||||||
@ -651,7 +651,7 @@ void Clientlist::Process()
|
|||||||
OpcodeManager::EmuToName(app->GetOpcode()),
|
OpcodeManager::EmuToName(app->GetOpcode()),
|
||||||
o->EmuToEQ(app->GetOpcode()) == 0 ? app->GetProtocolOpcode() : o->EmuToEQ(app->GetOpcode()),
|
o->EmuToEQ(app->GetOpcode()) == 0 ? app->GetProtocolOpcode() : o->EmuToEQ(app->GetOpcode()),
|
||||||
app->Size(),
|
app->Size(),
|
||||||
(LogSys.IsLogEnabled(Logs::Detail, Logs::PacketClientServer) ? DumpPacketToString(app) : "")
|
(EQEmuLogSys::Instance()->IsLogEnabled(Logs::Detail, Logs::PacketClientServer) ? DumpPacketToString(app) : "")
|
||||||
);
|
);
|
||||||
|
|
||||||
switch (opcode) {
|
switch (opcode) {
|
||||||
|
|||||||
19
ucs/ucs.cpp
19
ucs/ucs.cpp
@ -44,12 +44,8 @@
|
|||||||
|
|
||||||
ChatChannelList *ChannelList;
|
ChatChannelList *ChannelList;
|
||||||
Clientlist *g_Clientlist;
|
Clientlist *g_Clientlist;
|
||||||
EQEmuLogSys LogSys;
|
|
||||||
UCSDatabase database;
|
UCSDatabase database;
|
||||||
WorldServer *worldserver = nullptr;
|
WorldServer *worldserver = nullptr;
|
||||||
DiscordManager discord_manager;
|
|
||||||
PathManager path;
|
|
||||||
ZoneStore zone_store;
|
|
||||||
PlayerEventLogs player_event_logs;
|
PlayerEventLogs player_event_logs;
|
||||||
|
|
||||||
const ucsconfig *Config;
|
const ucsconfig *Config;
|
||||||
@ -75,7 +71,7 @@ void Shutdown() {
|
|||||||
LogInfo("Shutting down...");
|
LogInfo("Shutting down...");
|
||||||
ChannelList->RemoveAllChannels();
|
ChannelList->RemoveAllChannels();
|
||||||
g_Clientlist->CloseAllConnections();
|
g_Clientlist->CloseAllConnections();
|
||||||
LogSys.CloseFileLogs();
|
EQEmuLogSys::Instance()->CloseFileLogs();
|
||||||
}
|
}
|
||||||
|
|
||||||
int caught_loop = 0;
|
int caught_loop = 0;
|
||||||
@ -90,24 +86,24 @@ void CatchSignal(int sig_num) {
|
|||||||
LogInfo("In a signal handler loop and process is incapable of exiting properly, forcefully cleaning up");
|
LogInfo("In a signal handler loop and process is incapable of exiting properly, forcefully cleaning up");
|
||||||
ChannelList->RemoveAllChannels();
|
ChannelList->RemoveAllChannels();
|
||||||
g_Clientlist->CloseAllConnections();
|
g_Clientlist->CloseAllConnections();
|
||||||
LogSys.CloseFileLogs();
|
EQEmuLogSys::Instance()->CloseFileLogs();
|
||||||
std::exit(0);
|
std::exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerEventQueueListener() {
|
void PlayerEventQueueListener() {
|
||||||
while (caught_loop == 0) {
|
while (caught_loop == 0) {
|
||||||
discord_manager.ProcessMessageQueue();
|
DiscordManager::Instance()->ProcessMessageQueue();
|
||||||
Sleep(100);
|
Sleep(100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
RegisterExecutablePlatform(ExePlatformUCS);
|
RegisterExecutablePlatform(ExePlatformUCS);
|
||||||
LogSys.LoadLogSettingsDefaults();
|
EQEmuLogSys::Instance()->LoadLogSettingsDefaults();
|
||||||
set_exception_handler();
|
set_exception_handler();
|
||||||
|
|
||||||
path.LoadPaths();
|
PathManager::Instance()->Init();
|
||||||
|
|
||||||
// Check every minute for unused channels we can delete
|
// Check every minute for unused channels we can delete
|
||||||
//
|
//
|
||||||
@ -139,8 +135,9 @@ int main() {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
LogSys.SetDatabase(&database)
|
EQEmuLogSys::Instance()
|
||||||
->SetLogPath(path.GetLogPath())
|
->SetDatabase(&database)
|
||||||
|
->SetLogPath(PathManager::Instance()->GetLogPath())
|
||||||
->LoadLogDatabaseSettings()
|
->LoadLogDatabaseSettings()
|
||||||
->StartFileLogs();
|
->StartFileLogs();
|
||||||
|
|
||||||
|
|||||||
@ -42,7 +42,6 @@ extern WorldServer worldserver;
|
|||||||
extern Clientlist *g_Clientlist;
|
extern Clientlist *g_Clientlist;
|
||||||
extern const ucsconfig *Config;
|
extern const ucsconfig *Config;
|
||||||
extern UCSDatabase database;
|
extern UCSDatabase database;
|
||||||
extern DiscordManager discord_manager;
|
|
||||||
|
|
||||||
void ProcessMailTo(Client *c, const std::string& from, const std::string& subject, const std::string& message);
|
void ProcessMailTo(Client *c, const std::string& from, const std::string& subject, const std::string& message);
|
||||||
|
|
||||||
@ -79,7 +78,7 @@ void WorldServer::ProcessMessage(uint16 opcode, EQ::Net::Packet &p)
|
|||||||
case ServerOP_ServerReloadRequest: {
|
case ServerOP_ServerReloadRequest: {
|
||||||
auto o = (ServerReload::Request*) pack->pBuffer;
|
auto o = (ServerReload::Request*) pack->pBuffer;
|
||||||
if (o->type == ServerReload::Type::Logs) {
|
if (o->type == ServerReload::Type::Logs) {
|
||||||
LogSys.LoadLogDatabaseSettings();
|
EQEmuLogSys::Instance()->LoadLogDatabaseSettings();
|
||||||
player_event_logs.ReloadSettings();
|
player_event_logs.ReloadSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,14 +91,14 @@ void WorldServer::ProcessMessage(uint16 opcode, EQ::Net::Packet &p)
|
|||||||
cereal::BinaryInputArchive archive(ss);
|
cereal::BinaryInputArchive archive(ss);
|
||||||
archive(n);
|
archive(n);
|
||||||
|
|
||||||
discord_manager.QueuePlayerEventMessage(n);
|
DiscordManager::Instance()->QueuePlayerEventMessage(n);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ServerOP_DiscordWebhookMessage: {
|
case ServerOP_DiscordWebhookMessage: {
|
||||||
auto *q = (DiscordWebhookMessage_Struct *) p.Data();
|
auto *q = (DiscordWebhookMessage_Struct *) p.Data();
|
||||||
|
|
||||||
discord_manager.QueueWebhookMessage(
|
DiscordManager::Instance()->QueueWebhookMessage(
|
||||||
q->webhook_id,
|
q->webhook_id,
|
||||||
q->message
|
q->message
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
module should-release
|
module should-release
|
||||||
|
|
||||||
go 1.18
|
go 1.23.0
|
||||||
|
|
||||||
|
toolchain go1.23.5
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/google/go-github/v41 v41.0.0
|
github.com/google/go-github/v41 v41.0.0
|
||||||
|
|||||||
@ -35,12 +35,12 @@ if (scalar(@enum) > 0) {
|
|||||||
|
|
||||||
foreach my $cat (@cats) {
|
foreach my $cat (@cats) {
|
||||||
print "#define Log" . $cat . "(message, ...) do {\\
|
print "#define Log" . $cat . "(message, ...) do {\\
|
||||||
if (LogSys.IsLogEnabled(Logs::General, Logs::" . $cat . "))\\
|
if (EQEmuLogSys::Instance()->IsLogEnabled(Logs::General, Logs::" . $cat . "))\\
|
||||||
OutF(LogSys, Logs::General, Logs::" . $cat . ", __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\\
|
OutF(LogSys, Logs::General, Logs::" . $cat . ", __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define Log" . $cat . "Detail(message, ...) do {\\
|
#define Log" . $cat . "Detail(message, ...) do {\\
|
||||||
if (LogSys.IsLogEnabled(Logs::Detail, Logs::" . $cat . "))\\
|
if (EQEmuLogSys::Instance()->IsLogEnabled(Logs::Detail, Logs::" . $cat . "))\\
|
||||||
OutF(LogSys, Logs::Detail, Logs::" . $cat . ", __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\\
|
OutF(LogSys, Logs::Detail, Logs::" . $cat . ", __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|||||||
@ -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)
|
||||||
|
|||||||
@ -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()
|
||||||
{
|
{
|
||||||
@ -68,7 +67,7 @@ void AdventureManager::Process()
|
|||||||
void AdventureManager::CalculateAdventureRequestReply(const char *data)
|
void AdventureManager::CalculateAdventureRequestReply(const char *data)
|
||||||
{
|
{
|
||||||
ServerAdventureRequest_Struct *sar = (ServerAdventureRequest_Struct*)data;
|
ServerAdventureRequest_Struct *sar = (ServerAdventureRequest_Struct*)data;
|
||||||
ClientListEntry *leader = client_list.FindCharacter(sar->leader);
|
ClientListEntry *leader = ClientList::Instance()->FindCharacter(sar->leader);
|
||||||
if(!leader)
|
if(!leader)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -185,7 +184,7 @@ void AdventureManager::CalculateAdventureRequestReply(const char *data)
|
|||||||
|
|
||||||
for(int i = 0; i < sar->member_count; ++i)
|
for(int i = 0; i < sar->member_count; ++i)
|
||||||
{
|
{
|
||||||
ClientListEntry *current = client_list.FindCharacter((data + sizeof(ServerAdventureRequest_Struct) + (64 * i)));
|
ClientListEntry *current = ClientList::Instance()->FindCharacter((data + sizeof(ServerAdventureRequest_Struct) + (64 * i)));
|
||||||
if(current)
|
if(current)
|
||||||
{
|
{
|
||||||
int lvl = current->level();
|
int lvl = current->level();
|
||||||
@ -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;
|
||||||
@ -357,7 +356,7 @@ void AdventureManager::CalculateAdventureRequestReply(const char *data)
|
|||||||
void AdventureManager::TryAdventureCreate(const char *data)
|
void AdventureManager::TryAdventureCreate(const char *data)
|
||||||
{
|
{
|
||||||
ServerAdventureRequestCreate_Struct *src = (ServerAdventureRequestCreate_Struct*)data;
|
ServerAdventureRequestCreate_Struct *src = (ServerAdventureRequestCreate_Struct*)data;
|
||||||
ClientListEntry *leader = client_list.FindCharacter(src->leader);
|
ClientListEntry *leader = ClientList::Instance()->FindCharacter(src->leader);
|
||||||
if(!leader)
|
if(!leader)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -404,7 +403,7 @@ void AdventureManager::TryAdventureCreate(const char *data)
|
|||||||
for(int i = 0; i < src->member_count; ++i)
|
for(int i = 0; i < src->member_count; ++i)
|
||||||
{
|
{
|
||||||
|
|
||||||
ClientListEntry *player = client_list.FindCharacter((data + sizeof(ServerAdventureRequestCreate_Struct) + (64 * i)));
|
ClientListEntry *player = ClientList::Instance()->FindCharacter((data + sizeof(ServerAdventureRequestCreate_Struct) + (64 * i)));
|
||||||
if(player)
|
if(player)
|
||||||
{
|
{
|
||||||
int f_count = 0;
|
int f_count = 0;
|
||||||
@ -458,7 +457,7 @@ void AdventureManager::GetAdventureData(Adventure *adv)
|
|||||||
|
|
||||||
void AdventureManager::GetAdventureData(const char *name)
|
void AdventureManager::GetAdventureData(const char *name)
|
||||||
{
|
{
|
||||||
ClientListEntry *player = client_list.FindCharacter(name);
|
ClientListEntry *player = ClientList::Instance()->FindCharacter(name);
|
||||||
if(player)
|
if(player)
|
||||||
{
|
{
|
||||||
int f_count = 0;
|
int f_count = 0;
|
||||||
@ -764,7 +763,7 @@ void AdventureManager::PlayerClickedDoor(const char *player, int zone_id, int do
|
|||||||
{
|
{
|
||||||
if((*iter)->PlayerExists(player))
|
if((*iter)->PlayerExists(player))
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = client_list.FindCharacter(player);
|
ClientListEntry *pc = ClientList::Instance()->FindCharacter(player);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack =
|
auto pack =
|
||||||
@ -792,7 +791,7 @@ void AdventureManager::PlayerClickedDoor(const char *player, int zone_id, int do
|
|||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
ClientListEntry *pc = client_list.FindCharacter(player);
|
ClientListEntry *pc = ClientList::Instance()->FindCharacter(player);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureClickDoorError, 64);
|
auto pack = new ServerPacket(ServerOP_AdventureClickDoorError, 64);
|
||||||
@ -804,7 +803,7 @@ void AdventureManager::PlayerClickedDoor(const char *player, int zone_id, int do
|
|||||||
|
|
||||||
void AdventureManager::LeaveAdventure(const char *name)
|
void AdventureManager::LeaveAdventure(const char *name)
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = client_list.FindCharacter(name);
|
ClientListEntry *pc = ClientList::Instance()->FindCharacter(name);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
Adventure *current = GetActiveAdventure(name);
|
Adventure *current = GetActiveAdventure(name);
|
||||||
@ -867,7 +866,7 @@ void AdventureManager::IncrementCount(uint16 instance_id)
|
|||||||
|
|
||||||
while(siter != slist.end())
|
while(siter != slist.end())
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = client_list.FindCharacter((*siter).c_str());
|
ClientListEntry *pc = ClientList::Instance()->FindCharacter((*siter).c_str());
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
memset(ac->player, 0, 64);
|
memset(ac->player, 0, 64);
|
||||||
@ -1262,7 +1261,7 @@ void AdventureManager::DoLeaderboardRequest(const char* player, uint8 type)
|
|||||||
|
|
||||||
void AdventureManager::DoLeaderboardRequestWins(const char* player)
|
void AdventureManager::DoLeaderboardRequestWins(const char* player)
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = client_list.FindCharacter(player);
|
ClientListEntry *pc = ClientList::Instance()->FindCharacter(player);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
||||||
@ -1328,7 +1327,7 @@ void AdventureManager::DoLeaderboardRequestWins(const char* player)
|
|||||||
|
|
||||||
void AdventureManager::DoLeaderboardRequestPercentage(const char* player)
|
void AdventureManager::DoLeaderboardRequestPercentage(const char* player)
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = client_list.FindCharacter(player);
|
ClientListEntry *pc = ClientList::Instance()->FindCharacter(player);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
||||||
@ -1394,7 +1393,7 @@ void AdventureManager::DoLeaderboardRequestPercentage(const char* player)
|
|||||||
|
|
||||||
void AdventureManager::DoLeaderboardRequestWinsGuk(const char* player)
|
void AdventureManager::DoLeaderboardRequestWinsGuk(const char* player)
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = client_list.FindCharacter(player);
|
ClientListEntry *pc = ClientList::Instance()->FindCharacter(player);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
||||||
@ -1460,7 +1459,7 @@ void AdventureManager::DoLeaderboardRequestWinsGuk(const char* player)
|
|||||||
|
|
||||||
void AdventureManager::DoLeaderboardRequestPercentageGuk(const char* player)
|
void AdventureManager::DoLeaderboardRequestPercentageGuk(const char* player)
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = client_list.FindCharacter(player);
|
ClientListEntry *pc = ClientList::Instance()->FindCharacter(player);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
||||||
@ -1526,7 +1525,7 @@ void AdventureManager::DoLeaderboardRequestPercentageGuk(const char* player)
|
|||||||
|
|
||||||
void AdventureManager::DoLeaderboardRequestWinsMir(const char* player)
|
void AdventureManager::DoLeaderboardRequestWinsMir(const char* player)
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = client_list.FindCharacter(player);
|
ClientListEntry *pc = ClientList::Instance()->FindCharacter(player);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
||||||
@ -1592,7 +1591,7 @@ void AdventureManager::DoLeaderboardRequestWinsMir(const char* player)
|
|||||||
|
|
||||||
void AdventureManager::DoLeaderboardRequestPercentageMir(const char* player)
|
void AdventureManager::DoLeaderboardRequestPercentageMir(const char* player)
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = client_list.FindCharacter(player);
|
ClientListEntry *pc = ClientList::Instance()->FindCharacter(player);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
||||||
@ -1658,7 +1657,7 @@ void AdventureManager::DoLeaderboardRequestPercentageMir(const char* player)
|
|||||||
|
|
||||||
void AdventureManager::DoLeaderboardRequestWinsMmc(const char* player)
|
void AdventureManager::DoLeaderboardRequestWinsMmc(const char* player)
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = client_list.FindCharacter(player);
|
ClientListEntry *pc = ClientList::Instance()->FindCharacter(player);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
||||||
@ -1724,7 +1723,7 @@ void AdventureManager::DoLeaderboardRequestWinsMmc(const char* player)
|
|||||||
|
|
||||||
void AdventureManager::DoLeaderboardRequestPercentageMmc(const char* player)
|
void AdventureManager::DoLeaderboardRequestPercentageMmc(const char* player)
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = client_list.FindCharacter(player);
|
ClientListEntry *pc = ClientList::Instance()->FindCharacter(player);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
||||||
@ -1790,7 +1789,7 @@ void AdventureManager::DoLeaderboardRequestPercentageMmc(const char* player)
|
|||||||
|
|
||||||
void AdventureManager::DoLeaderboardRequestWinsRuj(const char* player)
|
void AdventureManager::DoLeaderboardRequestWinsRuj(const char* player)
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = client_list.FindCharacter(player);
|
ClientListEntry *pc = ClientList::Instance()->FindCharacter(player);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
||||||
|
|||||||
@ -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"
|
||||||
@ -89,9 +90,7 @@ std::vector<RaceClassAllocation> character_create_allocations;
|
|||||||
std::vector<RaceClassCombos> character_create_race_class_combos;
|
std::vector<RaceClassCombos> character_create_race_class_combos;
|
||||||
|
|
||||||
extern ZSList zoneserver_list;
|
extern ZSList zoneserver_list;
|
||||||
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 +134,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 +478,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
|
||||||
@ -514,7 +517,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app)
|
|||||||
ServerLSPlayerJoinWorld_Struct* join =(ServerLSPlayerJoinWorld_Struct*)pack->pBuffer;
|
ServerLSPlayerJoinWorld_Struct* join =(ServerLSPlayerJoinWorld_Struct*)pack->pBuffer;
|
||||||
strcpy(join->key,GetLSKey());
|
strcpy(join->key,GetLSKey());
|
||||||
join->lsaccount_id = GetLSID();
|
join->lsaccount_id = GetLSID();
|
||||||
loginserverlist.SendPacket(pack);
|
LoginServerList::Instance()->SendPacket(pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -984,7 +987,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_) {
|
||||||
@ -1097,7 +1100,7 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
|||||||
OpcodeManager::EmuToName(app->GetOpcode()),
|
OpcodeManager::EmuToName(app->GetOpcode()),
|
||||||
o->EmuToEQ(app->GetOpcode()) == 0 ? app->GetProtocolOpcode() : o->EmuToEQ(app->GetOpcode()),
|
o->EmuToEQ(app->GetOpcode()) == 0 ? app->GetProtocolOpcode() : o->EmuToEQ(app->GetOpcode()),
|
||||||
app->Size(),
|
app->Size(),
|
||||||
(LogSys.IsLogEnabled(Logs::Detail, Logs::PacketClientServer) ? DumpPacketToString(app) : "")
|
(EQEmuLogSys::Instance()->IsLogEnabled(Logs::Detail, Logs::PacketClientServer) ? DumpPacketToString(app) : "")
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!eqs->CheckState(ESTABLISHED)) {
|
if (!eqs->CheckState(ESTABLISHED)) {
|
||||||
@ -1246,7 +1249,7 @@ bool Client::Process() {
|
|||||||
ServerLSPlayerLeftWorld_Struct* logout =(ServerLSPlayerLeftWorld_Struct*)pack->pBuffer;
|
ServerLSPlayerLeftWorld_Struct* logout =(ServerLSPlayerLeftWorld_Struct*)pack->pBuffer;
|
||||||
strcpy(logout->key,GetLSKey());
|
strcpy(logout->key,GetLSKey());
|
||||||
logout->lsaccount_id = GetLSID();
|
logout->lsaccount_id = GetLSID();
|
||||||
loginserverlist.SendPacket(pack);
|
LoginServerList::Instance()->SendPacket(pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
LogInfo("Client disconnected (not active in process)");
|
LogInfo("Client disconnected (not active in process)");
|
||||||
@ -2171,7 +2174,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 +2372,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 +2521,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);
|
||||||
|
|||||||
@ -9,10 +9,8 @@
|
|||||||
#include "world_config.h"
|
#include "world_config.h"
|
||||||
|
|
||||||
extern uint32 numplayers;
|
extern uint32 numplayers;
|
||||||
extern LoginServerList loginserverlist;
|
|
||||||
extern ClientList client_list;
|
extern ClientList client_list;
|
||||||
extern volatile bool RunLoops;
|
extern volatile bool RunLoops;
|
||||||
extern SharedTaskManager shared_task_manager;
|
|
||||||
|
|
||||||
ClientListEntry::ClientListEntry(
|
ClientListEntry::ClientListEntry(
|
||||||
uint32 id,
|
uint32 id,
|
||||||
@ -94,7 +92,7 @@ ClientListEntry::~ClientListEntry()
|
|||||||
{
|
{
|
||||||
if (RunLoops) {
|
if (RunLoops) {
|
||||||
Camp(); // updates zoneserver's numplayers
|
Camp(); // updates zoneserver's numplayers
|
||||||
client_list.RemoveCLEReferances(this);
|
ClientList::Instance()->RemoveCLEReferances(this);
|
||||||
}
|
}
|
||||||
for (auto &elem: m_tell_queue) {
|
for (auto &elem: m_tell_queue) {
|
||||||
safe_delete_array(elem);
|
safe_delete_array(elem);
|
||||||
@ -146,7 +144,7 @@ void ClientListEntry::LSUpdate(ZoneServer *iZS)
|
|||||||
zone->count = iZS->NumPlayers();
|
zone->count = iZS->NumPlayers();
|
||||||
zone->zone = iZS->GetZoneID();
|
zone->zone = iZS->GetZoneID();
|
||||||
zone->zone_wid = iZS->GetID();
|
zone->zone_wid = iZS->GetID();
|
||||||
loginserverlist.SendPacket(pack);
|
LoginServerList::Instance()->SendPacket(pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -162,7 +160,7 @@ void ClientListEntry::LSZoneChange(ZoneToZone_Struct *ztz)
|
|||||||
zonechange->lsaccount_id = LSID();
|
zonechange->lsaccount_id = LSID();
|
||||||
zonechange->from = ztz->current_zone_id;
|
zonechange->from = ztz->current_zone_id;
|
||||||
zonechange->to = ztz->requested_zone_id;
|
zonechange->to = ztz->requested_zone_id;
|
||||||
loginserverlist.SendPacket(pack);
|
LoginServerList::Instance()->SendPacket(pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -224,7 +222,7 @@ void ClientListEntry::LeavingZone(ZoneServer *iZS, CLE_Status iOnline)
|
|||||||
}
|
}
|
||||||
SetOnline(iOnline);
|
SetOnline(iOnline);
|
||||||
|
|
||||||
shared_task_manager.RemoveActiveInvitationByCharacterID(CharID());
|
SharedTaskManager::Instance()->RemoveActiveInvitationByCharacterID(CharID());
|
||||||
|
|
||||||
if (m_zone_server) {
|
if (m_zone_server) {
|
||||||
m_zone_server->RemovePlayer();
|
m_zone_server->RemovePlayer();
|
||||||
|
|||||||
@ -85,6 +85,12 @@ public:
|
|||||||
return {m_gm_zone_server_ids.begin(), m_gm_zone_server_ids.end()};
|
return {m_gm_zone_server_ids.begin(), m_gm_zone_server_ids.end()};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static ClientList* Instance()
|
||||||
|
{
|
||||||
|
static ClientList instance;
|
||||||
|
return &instance;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void OnTick(EQ::Timer *t);
|
void OnTick(EQ::Timer *t);
|
||||||
inline uint32 GetNextCLEID() { return NextCLEID++; }
|
inline uint32 GetNextCLEID() { return NextCLEID++; }
|
||||||
|
|||||||
@ -35,7 +35,6 @@
|
|||||||
|
|
||||||
extern ClientList client_list;
|
extern ClientList client_list;
|
||||||
extern ZSList zoneserver_list;
|
extern ZSList zoneserver_list;
|
||||||
extern LoginServerList loginserverlist;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param username
|
* @param username
|
||||||
@ -534,8 +533,8 @@ void ConsoleLock(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
WorldConfig::LockWorld();
|
WorldConfig::LockWorld();
|
||||||
if (loginserverlist.Connected()) {
|
if (LoginServerList::Instance()->Connected()) {
|
||||||
loginserverlist.SendStatus();
|
LoginServerList::Instance()->SendStatus();
|
||||||
connection->SendLine("World locked.");
|
connection->SendLine("World locked.");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -555,8 +554,8 @@ void ConsoleUnlock(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
WorldConfig::UnlockWorld();
|
WorldConfig::UnlockWorld();
|
||||||
if (loginserverlist.Connected()) {
|
if (LoginServerList::Instance()->Connected()) {
|
||||||
loginserverlist.SendStatus();
|
LoginServerList::Instance()->SendStatus();
|
||||||
connection->SendLine("World unlocked.");
|
connection->SendLine("World unlocked.");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1219,7 +1218,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 +1288,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 +1329,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 +1402,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));
|
||||||
|
|||||||
@ -41,7 +41,7 @@ void DynamicZone::ChooseNewLeader()
|
|||||||
|
|
||||||
auto it = std::find_if(m_members.begin(), m_members.end(), [&](const DynamicZoneMember& member) {
|
auto it = std::find_if(m_members.begin(), m_members.end(), [&](const DynamicZoneMember& member) {
|
||||||
if (member.id != GetLeaderID() && member.IsOnline()) {
|
if (member.id != GetLeaderID() && member.IsOnline()) {
|
||||||
auto member_cle = client_list.FindCLEByCharacterID(member.id);
|
auto member_cle = ClientList::Instance()->FindCLEByCharacterID(member.id);
|
||||||
return (member_cle && member_cle->GetOnline() == CLE_Status::InZone);
|
return (member_cle && member_cle->GetOnline() == CLE_Status::InZone);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -230,8 +230,8 @@ void DynamicZone::CacheMemberStatuses()
|
|||||||
// called when a new dz is cached to fill member statuses
|
// called when a new dz is cached to fill member statuses
|
||||||
std::string zone_name;
|
std::string zone_name;
|
||||||
std::vector<ClientListEntry*> all_clients;
|
std::vector<ClientListEntry*> all_clients;
|
||||||
all_clients.reserve(client_list.GetClientCount());
|
all_clients.reserve(ClientList::Instance()->GetClientCount());
|
||||||
client_list.GetClients(zone_name.c_str(), all_clients);
|
ClientList::Instance()->GetClients(zone_name.c_str(), all_clients);
|
||||||
|
|
||||||
for (const auto& member : m_members)
|
for (const auto& member : m_members)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -210,7 +210,7 @@ void DynamicZoneManager::HandleZoneMessage(ServerPacket* pack)
|
|||||||
{
|
{
|
||||||
auto buf = reinterpret_cast<ServerDzCommand_Struct*>(pack->pBuffer);
|
auto buf = reinterpret_cast<ServerDzCommand_Struct*>(pack->pBuffer);
|
||||||
|
|
||||||
ClientListEntry* cle = client_list.FindCharacter(buf->target_name);
|
ClientListEntry* cle = ClientList::Instance()->FindCharacter(buf->target_name);
|
||||||
if (cle && cle->Server())
|
if (cle && cle->Server())
|
||||||
{
|
{
|
||||||
// continue in the add target's zone
|
// continue in the add target's zone
|
||||||
@ -220,7 +220,7 @@ void DynamicZoneManager::HandleZoneMessage(ServerPacket* pack)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// add target not online, return to inviter
|
// add target not online, return to inviter
|
||||||
ClientListEntry* inviter_cle = client_list.FindCharacter(buf->requester_name);
|
ClientListEntry* inviter_cle = ClientList::Instance()->FindCharacter(buf->requester_name);
|
||||||
if (inviter_cle && inviter_cle->Server())
|
if (inviter_cle && inviter_cle->Server())
|
||||||
{
|
{
|
||||||
inviter_cle->Server()->SendPacket(pack);
|
inviter_cle->Server()->SendPacket(pack);
|
||||||
@ -231,7 +231,7 @@ void DynamicZoneManager::HandleZoneMessage(ServerPacket* pack)
|
|||||||
case ServerOP_DzSaveInvite:
|
case ServerOP_DzSaveInvite:
|
||||||
{
|
{
|
||||||
auto buf = reinterpret_cast<ServerDzCommand_Struct*>(pack->pBuffer);
|
auto buf = reinterpret_cast<ServerDzCommand_Struct*>(pack->pBuffer);
|
||||||
if (ClientListEntry* cle = client_list.FindCharacter(buf->target_name))
|
if (ClientListEntry* cle = ClientList::Instance()->FindCharacter(buf->target_name))
|
||||||
{
|
{
|
||||||
// store packet on cle and re-send it when client requests it
|
// store packet on cle and re-send it when client requests it
|
||||||
buf->is_char_online = true;
|
buf->is_char_online = true;
|
||||||
@ -243,7 +243,7 @@ void DynamicZoneManager::HandleZoneMessage(ServerPacket* pack)
|
|||||||
case ServerOP_DzRequestInvite:
|
case ServerOP_DzRequestInvite:
|
||||||
{
|
{
|
||||||
auto buf = reinterpret_cast<ServerCharacterID_Struct*>(pack->pBuffer);
|
auto buf = reinterpret_cast<ServerCharacterID_Struct*>(pack->pBuffer);
|
||||||
if (ClientListEntry* cle = client_list.FindCLEByCharacterID(buf->char_id))
|
if (ClientListEntry* cle = ClientList::Instance()->FindCLEByCharacterID(buf->char_id))
|
||||||
{
|
{
|
||||||
auto invite_pack = cle->GetPendingDzInvite();
|
auto invite_pack = cle->GetPendingDzInvite();
|
||||||
if (invite_pack && cle->Server())
|
if (invite_pack && cle->Server())
|
||||||
@ -259,7 +259,7 @@ void DynamicZoneManager::HandleZoneMessage(ServerPacket* pack)
|
|||||||
|
|
||||||
// notify requester (old leader) and new leader of the result
|
// notify requester (old leader) and new leader of the result
|
||||||
ZoneServer* new_leader_zs = nullptr;
|
ZoneServer* new_leader_zs = nullptr;
|
||||||
ClientListEntry* leader_cle = client_list.FindCharacter(buf->new_leader_name);
|
ClientListEntry* leader_cle = ClientList::Instance()->FindCharacter(buf->new_leader_name);
|
||||||
if (leader_cle && leader_cle->Server())
|
if (leader_cle && leader_cle->Server())
|
||||||
{
|
{
|
||||||
auto dz = DynamicZone::FindDynamicZoneByID(buf->dz_id);
|
auto dz = DynamicZone::FindDynamicZoneByID(buf->dz_id);
|
||||||
@ -274,7 +274,7 @@ void DynamicZoneManager::HandleZoneMessage(ServerPacket* pack)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if old and new leader are in the same zone only send one message
|
// if old and new leader are in the same zone only send one message
|
||||||
ClientListEntry* requester_cle = client_list.FindCLEByCharacterID(buf->requester_id);
|
ClientListEntry* requester_cle = ClientList::Instance()->FindCLEByCharacterID(buf->requester_id);
|
||||||
if (requester_cle && requester_cle->Server() && requester_cle->Server() != new_leader_zs)
|
if (requester_cle && requester_cle->Server() && requester_cle->Server() != new_leader_zs)
|
||||||
{
|
{
|
||||||
requester_cle->Server()->SendPacket(pack);
|
requester_cle->Server()->SendPacket(pack);
|
||||||
@ -441,7 +441,7 @@ void DynamicZoneManager::HandleZoneMessage(ServerPacket* pack)
|
|||||||
case ServerOP_DzCharacterLockout:
|
case ServerOP_DzCharacterLockout:
|
||||||
{
|
{
|
||||||
auto buf = reinterpret_cast<ServerDzCharacterLockout_Struct*>(pack->pBuffer);
|
auto buf = reinterpret_cast<ServerDzCharacterLockout_Struct*>(pack->pBuffer);
|
||||||
auto cle = client_list.FindCLEByCharacterID(buf->char_id);
|
auto cle = ClientList::Instance()->FindCLEByCharacterID(buf->char_id);
|
||||||
if (cle && cle->Server())
|
if (cle && cle->Server())
|
||||||
{
|
{
|
||||||
cle->Server()->SendPacket(pack);
|
cle->Server()->SendPacket(pack);
|
||||||
|
|||||||
@ -125,7 +125,7 @@ void callGetClientList(Json::Value &response, const std::vector<std::string> &ar
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
client_list.GetClientList(response, full_list);
|
ClientList::Instance()->GetClientList(response, full_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
void getReloadTypes(Json::Value &response)
|
void getReloadTypes(Json::Value &response)
|
||||||
@ -142,7 +142,7 @@ void getReloadTypes(Json::Value &response)
|
|||||||
void getServerCounts(Json::Value &response, const std::vector<std::string> &args)
|
void getServerCounts(Json::Value &response, const std::vector<std::string> &args)
|
||||||
{
|
{
|
||||||
response["zone_count"] = zoneserver_list.GetServerListCount();
|
response["zone_count"] = zoneserver_list.GetServerListCount();
|
||||||
response["client_count"] = client_list.GetClientCount();
|
response["client_count"] = ClientList::Instance()->GetClientCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmuApiWorldDataService::reload(Json::Value &r, const std::vector<std::string> &args)
|
void EQEmuApiWorldDataService::reload(Json::Value &r, const std::vector<std::string> &args)
|
||||||
@ -259,7 +259,7 @@ void EQEmuApiWorldDataService::callGetGuildDetails(Json::Value &response, const
|
|||||||
row["tribute"]["time_remaining"] = guild->tribute.time_remaining;
|
row["tribute"]["time_remaining"] = guild->tribute.time_remaining;
|
||||||
row["tribute"]["enabled"] = guild->tribute.enabled;
|
row["tribute"]["enabled"] = guild->tribute.enabled;
|
||||||
|
|
||||||
client_list.GetGuildClientList(response, guild_id);
|
ClientList::Instance()->GetGuildClientList(response, guild_id);
|
||||||
|
|
||||||
response.append(row);
|
response.append(row);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,7 +48,6 @@
|
|||||||
extern ZSList zoneserver_list;
|
extern ZSList zoneserver_list;
|
||||||
extern ClientList client_list;
|
extern ClientList client_list;
|
||||||
extern uint32 numzones;
|
extern uint32 numzones;
|
||||||
extern LoginServerList loginserverlist;
|
|
||||||
extern LauncherList launcher_list;
|
extern LauncherList launcher_list;
|
||||||
extern volatile bool RunLoops;
|
extern volatile bool RunLoops;
|
||||||
|
|
||||||
@ -86,15 +85,15 @@ const std::string &EQW::GetOutput() const {
|
|||||||
|
|
||||||
void EQW::LockWorld() {
|
void EQW::LockWorld() {
|
||||||
WorldConfig::LockWorld();
|
WorldConfig::LockWorld();
|
||||||
if (loginserverlist.Connected()) {
|
if (LoginServerList::Instance()->Connected()) {
|
||||||
loginserverlist.SendStatus();
|
LoginServerList::Instance()->SendStatus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQW::UnlockWorld() {
|
void EQW::UnlockWorld() {
|
||||||
WorldConfig::UnlockWorld();
|
WorldConfig::UnlockWorld();
|
||||||
if (loginserverlist.Connected()) {
|
if (LoginServerList::Instance()->Connected()) {
|
||||||
loginserverlist.SendStatus();
|
LoginServerList::Instance()->SendStatus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,7 +103,7 @@ Const_char *EQW::GetConfig(Const_char *var_name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool EQW::LSConnected() {
|
bool EQW::LSConnected() {
|
||||||
return(loginserverlist.Connected());
|
return(LoginServerList::Instance()->Connected());
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQW::CountZones() {
|
int EQW::CountZones() {
|
||||||
|
|||||||
@ -108,7 +108,7 @@ void LoginServer::ProcessUsertoWorldReqLeg(uint16_t opcode, EQ::Net::Packet &p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (RuleB(World, EnforceCharacterLimitAtLogin)) {
|
if (RuleB(World, EnforceCharacterLimitAtLogin)) {
|
||||||
if (client_list.IsAccountInGame(utwr->lsaccountid)) {
|
if (ClientList::Instance()->IsAccountInGame(utwr->lsaccountid)) {
|
||||||
LogDebug("User already online account_id [{0}]", utwr->lsaccountid);
|
LogDebug("User already online account_id [{0}]", utwr->lsaccountid);
|
||||||
utwrs->response = UserToWorldStatusAlreadyOnline;
|
utwrs->response = UserToWorldStatusAlreadyOnline;
|
||||||
SendPacket(&outpack);
|
SendPacket(&outpack);
|
||||||
@ -189,7 +189,7 @@ void LoginServer::ProcessUsertoWorldReq(uint16_t opcode, EQ::Net::Packet &p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (RuleB(World, EnforceCharacterLimitAtLogin)) {
|
if (RuleB(World, EnforceCharacterLimitAtLogin)) {
|
||||||
if (client_list.IsAccountInGame(utwr->lsaccountid)) {
|
if (ClientList::Instance()->IsAccountInGame(utwr->lsaccountid)) {
|
||||||
LogDebug("User already online account_id [{0}]", utwr->lsaccountid);
|
LogDebug("User already online account_id [{0}]", utwr->lsaccountid);
|
||||||
utwrs->response = UserToWorldStatusAlreadyOnline;
|
utwrs->response = UserToWorldStatusAlreadyOnline;
|
||||||
SendPacket(&outpack);
|
SendPacket(&outpack);
|
||||||
@ -221,7 +221,7 @@ void LoginServer::ProcessLSClientAuthLegacy(uint16_t opcode, EQ::Net::Packet &p)
|
|||||||
r.is_client_from_local_network
|
r.is_client_from_local_network
|
||||||
);
|
);
|
||||||
|
|
||||||
client_list.CLEAdd(
|
ClientList::Instance()->CLEAdd(
|
||||||
r.loginserver_account_id,
|
r.loginserver_account_id,
|
||||||
"eqemu",
|
"eqemu",
|
||||||
r.loginserver_account_name,
|
r.loginserver_account_name,
|
||||||
@ -256,7 +256,7 @@ void LoginServer::ProcessLSClientAuth(uint16_t opcode, EQ::Net::Packet &p)
|
|||||||
r.is_client_from_local_network
|
r.is_client_from_local_network
|
||||||
);
|
);
|
||||||
|
|
||||||
client_list.CLEAdd(
|
ClientList::Instance()->CLEAdd(
|
||||||
r.loginserver_account_id,
|
r.loginserver_account_id,
|
||||||
r.loginserver_name,
|
r.loginserver_name,
|
||||||
r.account_name,
|
r.account_name,
|
||||||
|
|||||||
@ -37,7 +37,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#include "world_config.h"
|
#include "world_config.h"
|
||||||
|
|
||||||
extern ZSList zoneserver_list;
|
extern ZSList zoneserver_list;
|
||||||
extern LoginServerList loginserverlist;
|
|
||||||
extern ClientList client_list;
|
extern ClientList client_list;
|
||||||
extern uint32 numzones;
|
extern uint32 numzones;
|
||||||
extern uint32 numplayers;
|
extern uint32 numplayers;
|
||||||
|
|||||||
@ -21,6 +21,13 @@ public:
|
|||||||
bool SendAccountUpdate(ServerPacket *pack);
|
bool SendAccountUpdate(ServerPacket *pack);
|
||||||
bool Connected();
|
bool Connected();
|
||||||
size_t GetServerCount() const { return m_list.size(); }
|
size_t GetServerCount() const { return m_list.size(); }
|
||||||
|
|
||||||
|
static LoginServerList* Instance()
|
||||||
|
{
|
||||||
|
static LoginServerList instance;
|
||||||
|
return &instance;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::list<std::unique_ptr<LoginServer>> m_list;
|
std::list<std::unique_ptr<LoginServer>> m_list;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -91,27 +91,20 @@
|
|||||||
#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;
|
||||||
LoginServerList loginserverlist;
|
|
||||||
UCSConnection UCSLink;
|
UCSConnection UCSLink;
|
||||||
QueryServConnection QSLink;
|
QueryServConnection QSLink;
|
||||||
LauncherList launcher_list;
|
LauncherList launcher_list;
|
||||||
AdventureManager adventure_manager;
|
AdventureManager adventure_manager;
|
||||||
WorldEventScheduler event_scheduler;
|
WorldEventScheduler event_scheduler;
|
||||||
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;
|
||||||
const WorldConfig *Config;
|
const WorldConfig *Config;
|
||||||
EQEmuLogSys LogSys;
|
|
||||||
WorldContentService content_service;
|
WorldContentService content_service;
|
||||||
WebInterfaceList web_interface;
|
WebInterfaceList web_interface;
|
||||||
PathManager path;
|
|
||||||
PlayerEventLogs player_event_logs;
|
PlayerEventLogs player_event_logs;
|
||||||
EvolvingItemsManager evolving_items_manager;
|
EvolvingItemsManager evolving_items_manager;
|
||||||
|
|
||||||
@ -135,14 +128,14 @@ inline void UpdateWindowTitle(std::string new_title)
|
|||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
RegisterExecutablePlatform(ExePlatformWorld);
|
RegisterExecutablePlatform(ExePlatformWorld);
|
||||||
LogSys.LoadLogSettingsDefaults();
|
EQEmuLogSys::Instance()->LoadLogSettingsDefaults();
|
||||||
set_exception_handler();
|
set_exception_handler();
|
||||||
|
|
||||||
if (WorldBoot::HandleCommandInput(argc, argv)) {
|
if (WorldBoot::HandleCommandInput(argc, argv)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
path.LoadPaths();
|
PathManager::Instance()->Init();
|
||||||
|
|
||||||
if (!WorldBoot::LoadServerConfig()) {
|
if (!WorldBoot::LoadServerConfig()) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -207,7 +200,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>();
|
||||||
@ -476,7 +469,7 @@ int main(int argc, char **argv)
|
|||||||
launcher_list.Process();
|
launcher_list.Process();
|
||||||
LFPGroupList.Process();
|
LFPGroupList.Process();
|
||||||
adventure_manager.Process();
|
adventure_manager.Process();
|
||||||
shared_task_manager.Process();
|
SharedTaskManager::Instance()->Process();
|
||||||
dynamic_zone_manager.Process();
|
dynamic_zone_manager.Process();
|
||||||
|
|
||||||
if (!RuleB(Logging, PlayerEventsQSProcess)) {
|
if (!RuleB(Logging, PlayerEventsQSProcess)) {
|
||||||
@ -509,7 +502,7 @@ int main(int argc, char **argv)
|
|||||||
zoneserver_list.KillAll();
|
zoneserver_list.KillAll();
|
||||||
LogInfo("Zone (TCP) listener stopped");
|
LogInfo("Zone (TCP) listener stopped");
|
||||||
LogInfo("Signaling HTTP service to stop");
|
LogInfo("Signaling HTTP service to stop");
|
||||||
LogSys.CloseFileLogs();
|
EQEmuLogSys::Instance()->CloseFileLogs();
|
||||||
|
|
||||||
WorldBoot::Shutdown();
|
WorldBoot::Shutdown();
|
||||||
|
|
||||||
|
|||||||
@ -199,7 +199,7 @@ void SharedTaskManager::RemoveMember(SharedTask* s, const SharedTaskMember& memb
|
|||||||
|
|
||||||
SendSharedTaskMemberRemovedToAllMembers(s, member.character_name);
|
SendSharedTaskMemberRemovedToAllMembers(s, member.character_name);
|
||||||
|
|
||||||
client_list.SendCharacterMessageID(member.character_id, Chat::Yellow,
|
ClientList::Instance()->SendCharacterMessageID(member.character_id, Chat::Yellow,
|
||||||
TaskStr::PLAYER_REMOVED, {member.character_name, s->GetTaskData().title});
|
TaskStr::PLAYER_REMOVED, {member.character_name, s->GetTaskData().title});
|
||||||
|
|
||||||
if (member.is_leader) {
|
if (member.is_leader) {
|
||||||
@ -229,10 +229,10 @@ void SharedTaskManager::RemoveEveryoneFromSharedTask(SharedTask *t, uint32 reque
|
|||||||
|
|
||||||
SendRemovePlayerFromSharedTaskPacket(m.character_id, t->GetTaskData().id, true);
|
SendRemovePlayerFromSharedTaskPacket(m.character_id, t->GetTaskData().id, true);
|
||||||
|
|
||||||
client_list.SendCharacterMessageID(m.character_id, Chat::Yellow, TaskStr::YOU_REMOVED, {t->GetTaskData().title});
|
ClientList::Instance()->SendCharacterMessageID(m.character_id, Chat::Yellow, TaskStr::YOU_REMOVED, {t->GetTaskData().title});
|
||||||
}
|
}
|
||||||
|
|
||||||
client_list.SendCharacterMessageID(requested_character_id, Chat::Red, TaskStr::PLAYER_REMOVED, {"Everyone", t->GetTaskData().title});
|
ClientList::Instance()->SendCharacterMessageID(requested_character_id, Chat::Red, TaskStr::PLAYER_REMOVED, {"Everyone", t->GetTaskData().title});
|
||||||
|
|
||||||
RemoveAllMembersFromDynamicZones(t);
|
RemoveAllMembersFromDynamicZones(t);
|
||||||
|
|
||||||
@ -252,7 +252,7 @@ void SharedTaskManager::Terminate(SharedTask& s, bool send_fail, bool erase)
|
|||||||
SendSharedTaskFailed(member.character_id, s.GetTaskData().id);
|
SendSharedTaskFailed(member.character_id, s.GetTaskData().id);
|
||||||
}
|
}
|
||||||
SendRemovePlayerFromSharedTaskPacket(member.character_id, s.GetTaskData().id, true);
|
SendRemovePlayerFromSharedTaskPacket(member.character_id, s.GetTaskData().id, true);
|
||||||
client_list.SendCharacterMessageID(member.character_id, Chat::Yellow, TaskStr::HAS_ENDED, {s.GetTaskData().title});
|
ClientList::Instance()->SendCharacterMessageID(member.character_id, Chat::Yellow, TaskStr::HAS_ENDED, {s.GetTaskData().title});
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoveAllMembersFromDynamicZones(&s);
|
RemoveAllMembersFromDynamicZones(&s);
|
||||||
@ -581,7 +581,7 @@ void SharedTaskManager::SharedTaskActivityUpdate(
|
|||||||
d->ignore_quest_update = ignore_quest_update;
|
d->ignore_quest_update = ignore_quest_update;
|
||||||
|
|
||||||
// get requested character zone server
|
// get requested character zone server
|
||||||
ClientListEntry *c = client_list.FindCLEByCharacterID(m.character_id);
|
ClientListEntry *c = ClientList::Instance()->FindCLEByCharacterID(m.character_id);
|
||||||
if (c && c->Server()) {
|
if (c && c->Server()) {
|
||||||
c->Server()->SendPacket(p.get());
|
c->Server()->SendPacket(p.get());
|
||||||
}
|
}
|
||||||
@ -683,7 +683,7 @@ void SharedTaskManager::SendAcceptNewSharedTaskPacket(
|
|||||||
d->accept_time = accept_time;
|
d->accept_time = accept_time;
|
||||||
|
|
||||||
// get requested character zone server
|
// get requested character zone server
|
||||||
ClientListEntry *cle = client_list.FindCLEByCharacterID(character_id);
|
ClientListEntry *cle = ClientList::Instance()->FindCLEByCharacterID(character_id);
|
||||||
if (cle && cle->Server()) {
|
if (cle && cle->Server()) {
|
||||||
cle->Server()->SendPacket(p.get());
|
cle->Server()->SendPacket(p.get());
|
||||||
}
|
}
|
||||||
@ -704,7 +704,7 @@ void SharedTaskManager::SendRemovePlayerFromSharedTaskPacket(
|
|||||||
d->remove_from_db = remove_from_db;
|
d->remove_from_db = remove_from_db;
|
||||||
|
|
||||||
// get requested character zone server
|
// get requested character zone server
|
||||||
ClientListEntry *cle = client_list.FindCLEByCharacterID(character_id);
|
ClientListEntry *cle = ClientList::Instance()->FindCLEByCharacterID(character_id);
|
||||||
if (cle && cle->Server()) {
|
if (cle && cle->Server()) {
|
||||||
cle->Server()->SendPacket(p.get());
|
cle->Server()->SendPacket(p.get());
|
||||||
}
|
}
|
||||||
@ -717,7 +717,7 @@ void SharedTaskManager::SendSharedTaskFailed(uint32_t character_id, uint32_t tas
|
|||||||
buf->character_id = character_id;
|
buf->character_id = character_id;
|
||||||
buf->task_id = task_id;
|
buf->task_id = task_id;
|
||||||
|
|
||||||
ClientListEntry* cle = client_list.FindCLEByCharacterID(character_id);
|
ClientListEntry* cle = ClientList::Instance()->FindCLEByCharacterID(character_id);
|
||||||
if (cle && cle->Server())
|
if (cle && cle->Server())
|
||||||
{
|
{
|
||||||
cle->Server()->SendPacket(&pack);
|
cle->Server()->SendPacket(&pack);
|
||||||
@ -746,7 +746,7 @@ void SharedTaskManager::SendSharedTaskMemberList(uint32 character_id, const EQ::
|
|||||||
memcpy(d->cereal_serialized_members, serialized_members.Data(), serialized_members.Length());
|
memcpy(d->cereal_serialized_members, serialized_members.Data(), serialized_members.Length());
|
||||||
|
|
||||||
// send memberlist
|
// send memberlist
|
||||||
ClientListEntry *cle = client_list.FindCLEByCharacterID(character_id);
|
ClientListEntry *cle = ClientList::Instance()->FindCLEByCharacterID(character_id);
|
||||||
if (cle && cle->Server()) {
|
if (cle && cle->Server()) {
|
||||||
cle->Server()->SendPacket(p.get());
|
cle->Server()->SendPacket(p.get());
|
||||||
}
|
}
|
||||||
@ -768,7 +768,7 @@ void SharedTaskManager::SendSharedTaskMemberChange(
|
|||||||
d->removed = removed;
|
d->removed = removed;
|
||||||
strn0cpy(d->player_name, player_name.c_str(), sizeof(d->player_name));
|
strn0cpy(d->player_name, player_name.c_str(), sizeof(d->player_name));
|
||||||
|
|
||||||
ClientListEntry *cle = client_list.FindCLEByCharacterID(character_id);
|
ClientListEntry *cle = ClientList::Instance()->FindCLEByCharacterID(character_id);
|
||||||
if (cle && cle->Server()) {
|
if (cle && cle->Server()) {
|
||||||
cle->Server()->SendPacket(p.get());
|
cle->Server()->SendPacket(p.get());
|
||||||
}
|
}
|
||||||
@ -990,7 +990,7 @@ void SharedTaskManager::SendSharedTaskInvitePacket(SharedTask *s, int64 invited_
|
|||||||
strn0cpy(d->task_name, s->GetTaskData().title.c_str(), sizeof(d->task_name));
|
strn0cpy(d->task_name, s->GetTaskData().title.c_str(), sizeof(d->task_name));
|
||||||
|
|
||||||
// get requested character zone server
|
// get requested character zone server
|
||||||
ClientListEntry *cle = client_list.FindCLEByCharacterID(invited_character_id);
|
ClientListEntry *cle = ClientList::Instance()->FindCLEByCharacterID(invited_character_id);
|
||||||
if (cle && cle->Server()) {
|
if (cle && cle->Server()) {
|
||||||
SendLeaderMessageID(s, Chat::Yellow, TaskStr::SEND_INVITE_TO, {cle->name()});
|
SendLeaderMessageID(s, Chat::Yellow, TaskStr::SEND_INVITE_TO, {cle->name()});
|
||||||
cle->Server()->SendPacket(p.get());
|
cle->Server()->SendPacket(p.get());
|
||||||
@ -1213,7 +1213,7 @@ void SharedTaskManager::SendLeaderMessage(SharedTask *shared_task, int chat_type
|
|||||||
|
|
||||||
for (const auto &member : shared_task->GetMembers()) {
|
for (const auto &member : shared_task->GetMembers()) {
|
||||||
if (member.is_leader) {
|
if (member.is_leader) {
|
||||||
client_list.SendCharacterMessage(member.character_id, chat_type, message);
|
ClientList::Instance()->SendCharacterMessage(member.character_id, chat_type, message);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1230,7 +1230,7 @@ void SharedTaskManager::SendLeaderMessageID(
|
|||||||
|
|
||||||
for (const auto &member : shared_task->GetMembers()) {
|
for (const auto &member : shared_task->GetMembers()) {
|
||||||
if (member.is_leader) {
|
if (member.is_leader) {
|
||||||
client_list.SendCharacterMessageID(member.character_id, chat_type, eqstr_id, args);
|
ClientList::Instance()->SendCharacterMessageID(member.character_id, chat_type, eqstr_id, args);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1243,7 +1243,7 @@ void SharedTaskManager::SendMembersMessage(SharedTask *shared_task, int chat_typ
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const auto &member : shared_task->GetMembers()) {
|
for (const auto &member : shared_task->GetMembers()) {
|
||||||
client_list.SendCharacterMessage(member.character_id, chat_type, message);
|
ClientList::Instance()->SendCharacterMessage(member.character_id, chat_type, message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -102,6 +102,12 @@ public:
|
|||||||
void SetSharedTasks(const std::vector<SharedTask> &shared_tasks);
|
void SetSharedTasks(const std::vector<SharedTask> &shared_tasks);
|
||||||
|
|
||||||
SharedTaskManager * PurgeExpiredSharedTasks();
|
SharedTaskManager * PurgeExpiredSharedTasks();
|
||||||
|
|
||||||
|
static SharedTaskManager* Instance()
|
||||||
|
{
|
||||||
|
static SharedTaskManager instance;
|
||||||
|
return &instance;
|
||||||
|
}
|
||||||
protected:
|
protected:
|
||||||
// reference to database
|
// reference to database
|
||||||
Database *m_database;
|
Database *m_database;
|
||||||
|
|||||||
@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
extern ClientList client_list;
|
extern ClientList client_list;
|
||||||
extern ZSList zoneserver_list;
|
extern ZSList zoneserver_list;
|
||||||
extern SharedTaskManager shared_task_manager;
|
|
||||||
|
|
||||||
void SharedTaskWorldMessaging::HandleZoneMessage(ServerPacket *pack)
|
void SharedTaskWorldMessaging::HandleZoneMessage(ServerPacket *pack)
|
||||||
{
|
{
|
||||||
@ -30,7 +29,7 @@ void SharedTaskWorldMessaging::HandleZoneMessage(ServerPacket *pack)
|
|||||||
r->requested_npc_entity_id
|
r->requested_npc_entity_id
|
||||||
);
|
);
|
||||||
|
|
||||||
shared_task_manager.AttemptSharedTaskCreation(
|
SharedTaskManager::Instance()->AttemptSharedTaskCreation(
|
||||||
r->requested_task_id,
|
r->requested_task_id,
|
||||||
r->requested_character_id,
|
r->requested_character_id,
|
||||||
r->requested_npc_entity_id
|
r->requested_npc_entity_id
|
||||||
@ -47,11 +46,11 @@ void SharedTaskWorldMessaging::HandleZoneMessage(ServerPacket *pack)
|
|||||||
r->remove_from_db
|
r->remove_from_db
|
||||||
);
|
);
|
||||||
|
|
||||||
auto s = shared_task_manager.FindSharedTaskByTaskIdAndCharacterId(r->task_id, r->requested_character_id);
|
auto s = SharedTaskManager::Instance()->FindSharedTaskByTaskIdAndCharacterId(r->task_id, r->requested_character_id);
|
||||||
if (s) {
|
if (s) {
|
||||||
auto member = s->FindMemberFromCharacterID(r->requested_character_id);
|
auto member = s->FindMemberFromCharacterID(r->requested_character_id);
|
||||||
if (member.character_id != 0) {
|
if (member.character_id != 0) {
|
||||||
shared_task_manager.RemoveMember(s, member, r->remove_from_db);
|
SharedTaskManager::Instance()->RemoveMember(s, member, r->remove_from_db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -64,14 +63,14 @@ void SharedTaskWorldMessaging::HandleZoneMessage(ServerPacket *pack)
|
|||||||
r->task_id
|
r->task_id
|
||||||
);
|
);
|
||||||
|
|
||||||
auto t = shared_task_manager.FindSharedTaskByTaskIdAndCharacterId(r->task_id, r->source_character_id);
|
auto t = SharedTaskManager::Instance()->FindSharedTaskByTaskIdAndCharacterId(r->task_id, r->source_character_id);
|
||||||
if (t) {
|
if (t) {
|
||||||
auto leader = t->GetLeader();
|
auto leader = t->GetLeader();
|
||||||
if (leader.character_id != r->source_character_id) {
|
if (leader.character_id != r->source_character_id) {
|
||||||
client_list.SendCharacterMessageID(r->source_character_id, Chat::Red, TaskStr::NOT_LEADER, {leader.character_name});
|
ClientList::Instance()->SendCharacterMessageID(r->source_character_id, Chat::Red, TaskStr::NOT_LEADER, {leader.character_name});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
shared_task_manager.RemoveEveryoneFromSharedTask(t, r->source_character_id);
|
SharedTaskManager::Instance()->RemoveEveryoneFromSharedTask(t, r->source_character_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,7 +88,7 @@ void SharedTaskWorldMessaging::HandleZoneMessage(ServerPacket *pack)
|
|||||||
(r->ignore_quest_update ? "true" : "false")
|
(r->ignore_quest_update ? "true" : "false")
|
||||||
);
|
);
|
||||||
|
|
||||||
shared_task_manager.SharedTaskActivityUpdate(
|
SharedTaskManager::Instance()->SharedTaskActivityUpdate(
|
||||||
r->source_character_id,
|
r->source_character_id,
|
||||||
r->task_id,
|
r->task_id,
|
||||||
r->activity_id,
|
r->activity_id,
|
||||||
@ -108,7 +107,7 @@ void SharedTaskWorldMessaging::HandleZoneMessage(ServerPacket *pack)
|
|||||||
r->task_id
|
r->task_id
|
||||||
);
|
);
|
||||||
|
|
||||||
auto t = shared_task_manager.FindSharedTaskByTaskIdAndCharacterId(r->task_id, r->source_character_id);
|
auto t = SharedTaskManager::Instance()->FindSharedTaskByTaskIdAndCharacterId(r->task_id, r->source_character_id);
|
||||||
if (t) {
|
if (t) {
|
||||||
LogTasksDetail(
|
LogTasksDetail(
|
||||||
"[ServerOP_SharedTaskRequestMemberlist] Found shared task character [{}] shared_task_id [{}]",
|
"[ServerOP_SharedTaskRequestMemberlist] Found shared task character [{}] shared_task_id [{}]",
|
||||||
@ -116,7 +115,7 @@ void SharedTaskWorldMessaging::HandleZoneMessage(ServerPacket *pack)
|
|||||||
t->GetDbSharedTask().id
|
t->GetDbSharedTask().id
|
||||||
);
|
);
|
||||||
|
|
||||||
shared_task_manager.SendSharedTaskMemberList(
|
SharedTaskManager::Instance()->SendSharedTaskMemberList(
|
||||||
r->source_character_id,
|
r->source_character_id,
|
||||||
t->GetMembers()
|
t->GetMembers()
|
||||||
);
|
);
|
||||||
@ -134,7 +133,7 @@ void SharedTaskWorldMessaging::HandleZoneMessage(ServerPacket *pack)
|
|||||||
r->player_name
|
r->player_name
|
||||||
);
|
);
|
||||||
|
|
||||||
auto t = shared_task_manager.FindSharedTaskByTaskIdAndCharacterId(r->task_id, r->source_character_id);
|
auto t = SharedTaskManager::Instance()->FindSharedTaskByTaskIdAndCharacterId(r->task_id, r->source_character_id);
|
||||||
if (t) {
|
if (t) {
|
||||||
LogTasksDetail(
|
LogTasksDetail(
|
||||||
"[ServerOP_SharedTaskRemovePlayer] Found shared task character [{}] shared_task_id [{}]",
|
"[ServerOP_SharedTaskRemovePlayer] Found shared task character [{}] shared_task_id [{}]",
|
||||||
@ -144,7 +143,7 @@ void SharedTaskWorldMessaging::HandleZoneMessage(ServerPacket *pack)
|
|||||||
|
|
||||||
auto leader = t->GetLeader();
|
auto leader = t->GetLeader();
|
||||||
if (leader.character_id != r->source_character_id) {
|
if (leader.character_id != r->source_character_id) {
|
||||||
client_list.SendCharacterMessageID(r->source_character_id, Chat::Red, TaskStr::NOT_LEADER, {leader.character_name});
|
ClientList::Instance()->SendCharacterMessageID(r->source_character_id, Chat::Red, TaskStr::NOT_LEADER, {leader.character_name});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LogTasksDetail(
|
LogTasksDetail(
|
||||||
@ -155,11 +154,11 @@ void SharedTaskWorldMessaging::HandleZoneMessage(ServerPacket *pack)
|
|||||||
|
|
||||||
auto member = t->FindMemberFromCharacterName(r->player_name);
|
auto member = t->FindMemberFromCharacterName(r->player_name);
|
||||||
if (member.character_id == 0) {
|
if (member.character_id == 0) {
|
||||||
shared_task_manager.SendLeaderMessageID(t, Chat::Red, TaskStr::IS_NOT_MEMBER, {r->player_name});
|
SharedTaskManager::Instance()->SendLeaderMessageID(t, Chat::Red, TaskStr::IS_NOT_MEMBER, {r->player_name});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
shared_task_manager.RemoveMember(t, member, true);
|
SharedTaskManager::Instance()->RemoveMember(t, member, true);
|
||||||
shared_task_manager.SendLeaderMessageID(t, Chat::Yellow, TaskStr::PLAYER_REMOVED, {member.character_name, t->GetTaskData().title});
|
SharedTaskManager::Instance()->SendLeaderMessageID(t, Chat::Yellow, TaskStr::PLAYER_REMOVED, {member.character_name, t->GetTaskData().title});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -176,7 +175,7 @@ void SharedTaskWorldMessaging::HandleZoneMessage(ServerPacket *pack)
|
|||||||
r->player_name
|
r->player_name
|
||||||
);
|
);
|
||||||
|
|
||||||
auto t = shared_task_manager.FindSharedTaskByTaskIdAndCharacterId(r->task_id, r->source_character_id);
|
auto t = SharedTaskManager::Instance()->FindSharedTaskByTaskIdAndCharacterId(r->task_id, r->source_character_id);
|
||||||
if (t) {
|
if (t) {
|
||||||
LogTasksDetail(
|
LogTasksDetail(
|
||||||
"[ServerOP_SharedTaskMakeLeader] Found shared task character [{}] shared_task_id [{}]",
|
"[ServerOP_SharedTaskMakeLeader] Found shared task character [{}] shared_task_id [{}]",
|
||||||
@ -186,10 +185,10 @@ void SharedTaskWorldMessaging::HandleZoneMessage(ServerPacket *pack)
|
|||||||
|
|
||||||
auto leader = t->GetLeader();
|
auto leader = t->GetLeader();
|
||||||
if (leader.character_id != r->source_character_id) {
|
if (leader.character_id != r->source_character_id) {
|
||||||
client_list.SendCharacterMessageID(r->source_character_id, Chat::Red, TaskStr::NOT_LEADER, {leader.character_name});
|
ClientList::Instance()->SendCharacterMessageID(r->source_character_id, Chat::Red, TaskStr::NOT_LEADER, {leader.character_name});
|
||||||
}
|
}
|
||||||
else if (strcasecmp(leader.character_name.c_str(), r->player_name) == 0) {
|
else if (strcasecmp(leader.character_name.c_str(), r->player_name) == 0) {
|
||||||
client_list.SendCharacterMessageID(r->source_character_id, Chat::Red, TaskStr::YOU_ALREADY_LEADER);
|
ClientList::Instance()->SendCharacterMessageID(r->source_character_id, Chat::Red, TaskStr::YOU_ALREADY_LEADER);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LogTasksDetail(
|
LogTasksDetail(
|
||||||
@ -199,7 +198,7 @@ void SharedTaskWorldMessaging::HandleZoneMessage(ServerPacket *pack)
|
|||||||
);
|
);
|
||||||
|
|
||||||
std::string character_name = r->player_name;
|
std::string character_name = r->player_name;
|
||||||
shared_task_manager.MakeLeaderByPlayerName(t, character_name);
|
SharedTaskManager::Instance()->MakeLeaderByPlayerName(t, character_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,7 +214,7 @@ void SharedTaskWorldMessaging::HandleZoneMessage(ServerPacket *pack)
|
|||||||
r->player_name
|
r->player_name
|
||||||
);
|
);
|
||||||
|
|
||||||
auto t = shared_task_manager.FindSharedTaskByTaskIdAndCharacterId(r->task_id, r->source_character_id);
|
auto t = SharedTaskManager::Instance()->FindSharedTaskByTaskIdAndCharacterId(r->task_id, r->source_character_id);
|
||||||
if (t) {
|
if (t) {
|
||||||
LogTasksDetail(
|
LogTasksDetail(
|
||||||
"[ServerOP_SharedTaskAddPlayer] Found shared task character [{}] shared_task_id [{}]",
|
"[ServerOP_SharedTaskAddPlayer] Found shared task character [{}] shared_task_id [{}]",
|
||||||
@ -226,7 +225,7 @@ void SharedTaskWorldMessaging::HandleZoneMessage(ServerPacket *pack)
|
|||||||
auto leader = t->GetLeader();
|
auto leader = t->GetLeader();
|
||||||
if (leader.character_id != r->source_character_id) {
|
if (leader.character_id != r->source_character_id) {
|
||||||
// taskadd is client sided with System color in newer clients, server side might still be red
|
// taskadd is client sided with System color in newer clients, server side might still be red
|
||||||
client_list.SendCharacterMessageID(r->source_character_id, Chat::Red, TaskStr::NOT_LEADER, {leader.character_name});
|
ClientList::Instance()->SendCharacterMessageID(r->source_character_id, Chat::Red, TaskStr::NOT_LEADER, {leader.character_name});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LogTasksDetail(
|
LogTasksDetail(
|
||||||
@ -236,7 +235,7 @@ void SharedTaskWorldMessaging::HandleZoneMessage(ServerPacket *pack)
|
|||||||
);
|
);
|
||||||
|
|
||||||
std::string character_name = r->player_name;
|
std::string character_name = r->player_name;
|
||||||
shared_task_manager.InvitePlayerByPlayerName(t, character_name);
|
SharedTaskManager::Instance()->InvitePlayerByPlayerName(t, character_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -252,21 +251,21 @@ void SharedTaskWorldMessaging::HandleZoneMessage(ServerPacket *pack)
|
|||||||
r->accepted
|
r->accepted
|
||||||
);
|
);
|
||||||
|
|
||||||
auto t = shared_task_manager.FindSharedTaskById(r->shared_task_id);
|
auto t = SharedTaskManager::Instance()->FindSharedTaskById(r->shared_task_id);
|
||||||
if (t && shared_task_manager.IsInvitationActive(r->shared_task_id, r->source_character_id)) {
|
if (t && SharedTaskManager::Instance()->IsInvitationActive(r->shared_task_id, r->source_character_id)) {
|
||||||
LogTasksDetail(
|
LogTasksDetail(
|
||||||
"[ServerOP_SharedTaskInviteAcceptedPlayer] Found shared task character [{}] shared_task_id [{}]",
|
"[ServerOP_SharedTaskInviteAcceptedPlayer] Found shared task character [{}] shared_task_id [{}]",
|
||||||
r->source_character_id,
|
r->source_character_id,
|
||||||
t->GetDbSharedTask().id
|
t->GetDbSharedTask().id
|
||||||
);
|
);
|
||||||
|
|
||||||
shared_task_manager.RemoveActiveInvitation(r->shared_task_id, r->source_character_id);
|
SharedTaskManager::Instance()->RemoveActiveInvitation(r->shared_task_id, r->source_character_id);
|
||||||
|
|
||||||
if (r->accepted) {
|
if (r->accepted) {
|
||||||
shared_task_manager.AddPlayerByCharacterIdAndName(t, r->source_character_id, r->player_name);
|
SharedTaskManager::Instance()->AddPlayerByCharacterIdAndName(t, r->source_character_id, r->player_name);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
shared_task_manager.SendLeaderMessageID(t, Chat::Red, TaskStr::PLAYER_DECLINED_OFFER, {r->player_name});
|
SharedTaskManager::Instance()->SendLeaderMessageID(t, Chat::Red, TaskStr::PLAYER_DECLINED_OFFER, {r->player_name});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -280,19 +279,19 @@ void SharedTaskWorldMessaging::HandleZoneMessage(ServerPacket *pack)
|
|||||||
buf->task_id
|
buf->task_id
|
||||||
);
|
);
|
||||||
|
|
||||||
auto t = shared_task_manager.FindSharedTaskByTaskIdAndCharacterId(buf->task_id, buf->source_character_id);
|
auto t = SharedTaskManager::Instance()->FindSharedTaskByTaskIdAndCharacterId(buf->task_id, buf->source_character_id);
|
||||||
if (t) {
|
if (t) {
|
||||||
DynamicZone dz;
|
DynamicZone dz;
|
||||||
dz.Unserialize({ buf->cereal_data, buf->cereal_size });
|
dz.Unserialize({ buf->cereal_data, buf->cereal_size });
|
||||||
|
|
||||||
shared_task_manager.CreateDynamicZone(t, dz);
|
SharedTaskManager::Instance()->CreateDynamicZone(t, dz);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ServerOP_SharedTaskPurgeAllCommand: {
|
case ServerOP_SharedTaskPurgeAllCommand: {
|
||||||
LogTasksDetail("[ServerOP_SharedTaskPurgeAllCommand] Received request to purge all shared tasks");
|
LogTasksDetail("[ServerOP_SharedTaskPurgeAllCommand] Received request to purge all shared tasks");
|
||||||
|
|
||||||
shared_task_manager.PurgeAllSharedTasks();
|
SharedTaskManager::Instance()->PurgeAllSharedTasks();
|
||||||
auto p = std::make_unique<ServerPacket>(
|
auto p = std::make_unique<ServerPacket>(
|
||||||
ServerOP_SharedTaskPurgeAllCommand,
|
ServerOP_SharedTaskPurgeAllCommand,
|
||||||
0
|
0
|
||||||
@ -311,7 +310,7 @@ void SharedTaskWorldMessaging::HandleZoneMessage(ServerPacket *pack)
|
|||||||
buf->task_id
|
buf->task_id
|
||||||
);
|
);
|
||||||
|
|
||||||
auto s = shared_task_manager.FindSharedTaskByTaskIdAndCharacterId(buf->task_id, buf->source_character_id);
|
auto s = SharedTaskManager::Instance()->FindSharedTaskByTaskIdAndCharacterId(buf->task_id, buf->source_character_id);
|
||||||
if (s) {
|
if (s) {
|
||||||
std::vector<std::string> player_names;
|
std::vector<std::string> player_names;
|
||||||
|
|
||||||
@ -319,40 +318,40 @@ void SharedTaskWorldMessaging::HandleZoneMessage(ServerPacket *pack)
|
|||||||
player_names.emplace_back(member.character_name);
|
player_names.emplace_back(member.character_name);
|
||||||
|
|
||||||
if (member.is_leader) {
|
if (member.is_leader) {
|
||||||
client_list.SendCharacterMessageID(buf->source_character_id, Chat::Yellow, TaskStr::LEADER_PRINT, {member.character_name});
|
ClientList::Instance()->SendCharacterMessageID(buf->source_character_id, Chat::Yellow, TaskStr::LEADER_PRINT, {member.character_name});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string player_list = fmt::format("{}", Strings::Join(player_names, ", "));
|
std::string player_list = fmt::format("{}", Strings::Join(player_names, ", "));
|
||||||
client_list.SendCharacterMessageID(buf->source_character_id, Chat::Yellow, TaskStr::MEMBERS_PRINT, {player_list});
|
ClientList::Instance()->SendCharacterMessageID(buf->source_character_id, Chat::Yellow, TaskStr::MEMBERS_PRINT, {player_list});
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ServerOP_SharedTaskLock: {
|
case ServerOP_SharedTaskLock: {
|
||||||
auto buf = reinterpret_cast<ServerSharedTaskLock_Struct*>(pack->pBuffer);
|
auto buf = reinterpret_cast<ServerSharedTaskLock_Struct*>(pack->pBuffer);
|
||||||
auto shared_task = shared_task_manager.FindSharedTaskByTaskIdAndCharacterId(buf->task_id, buf->source_character_id);
|
auto shared_task = SharedTaskManager::Instance()->FindSharedTaskByTaskIdAndCharacterId(buf->task_id, buf->source_character_id);
|
||||||
if (shared_task)
|
if (shared_task)
|
||||||
{
|
{
|
||||||
shared_task_manager.LockTask(shared_task, buf->lock);
|
SharedTaskManager::Instance()->LockTask(shared_task, buf->lock);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ServerOP_SharedTaskEndByDz: {
|
case ServerOP_SharedTaskEndByDz: {
|
||||||
auto buf = reinterpret_cast<ServerSharedTaskEnd_Struct*>(pack->pBuffer);
|
auto buf = reinterpret_cast<ServerSharedTaskEnd_Struct*>(pack->pBuffer);
|
||||||
auto shared_task = shared_task_manager.FindSharedTaskByDzId(buf->dz_id);
|
auto shared_task = SharedTaskManager::Instance()->FindSharedTaskByDzId(buf->dz_id);
|
||||||
if (shared_task)
|
if (shared_task)
|
||||||
{
|
{
|
||||||
shared_task_manager.Terminate(*shared_task, buf->send_fail, true);
|
SharedTaskManager::Instance()->Terminate(*shared_task, buf->send_fail, true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ServerOP_SharedTaskEnd: {
|
case ServerOP_SharedTaskEnd: {
|
||||||
auto buf = reinterpret_cast<ServerSharedTaskEnd_Struct*>(pack->pBuffer);
|
auto buf = reinterpret_cast<ServerSharedTaskEnd_Struct*>(pack->pBuffer);
|
||||||
auto shared_task = shared_task_manager.FindSharedTaskByTaskIdAndCharacterId(buf->task_id, buf->character_id);
|
auto shared_task = SharedTaskManager::Instance()->FindSharedTaskByTaskIdAndCharacterId(buf->task_id, buf->character_id);
|
||||||
if (shared_task)
|
if (shared_task)
|
||||||
{
|
{
|
||||||
shared_task_manager.Terminate(*shared_task, buf->send_fail, true);
|
SharedTaskManager::Instance()->Terminate(*shared_task, buf->send_fail, true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,6 @@
|
|||||||
#include "zonelist.h"
|
#include "zonelist.h"
|
||||||
#include "launcher_list.h"
|
#include "launcher_list.h"
|
||||||
|
|
||||||
extern LoginServerList loginserverlist;
|
|
||||||
extern ClientList client_list;
|
extern ClientList client_list;
|
||||||
extern ZSList zoneserver_list;
|
extern ZSList zoneserver_list;
|
||||||
extern LauncherList launcher_list;
|
extern LauncherList launcher_list;
|
||||||
@ -33,8 +32,8 @@ void EQW__IsLocked(WebInterface *i, const std::string& method, const std::string
|
|||||||
|
|
||||||
void EQW__Lock(WebInterface *i, const std::string& method, const std::string& id, const Json::Value& params) {
|
void EQW__Lock(WebInterface *i, const std::string& method, const std::string& id, const Json::Value& params) {
|
||||||
WorldConfig::LockWorld();
|
WorldConfig::LockWorld();
|
||||||
if (loginserverlist.Connected()) {
|
if (LoginServerList::Instance()->Connected()) {
|
||||||
loginserverlist.SendStatus();
|
LoginServerList::Instance()->SendStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
Json::Value ret;
|
Json::Value ret;
|
||||||
@ -44,8 +43,8 @@ void EQW__Lock(WebInterface *i, const std::string& method, const std::string& id
|
|||||||
|
|
||||||
void EQW__Unlock(WebInterface *i, const std::string& method, const std::string& id, const Json::Value& params) {
|
void EQW__Unlock(WebInterface *i, const std::string& method, const std::string& id, const Json::Value& params) {
|
||||||
WorldConfig::UnlockWorld();
|
WorldConfig::UnlockWorld();
|
||||||
if (loginserverlist.Connected()) {
|
if (LoginServerList::Instance()->Connected()) {
|
||||||
loginserverlist.SendStatus();
|
LoginServerList::Instance()->SendStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
Json::Value ret;
|
Json::Value ret;
|
||||||
@ -69,7 +68,7 @@ void EQW__GetLauncherCount(WebInterface *i, const std::string& method, const std
|
|||||||
}
|
}
|
||||||
|
|
||||||
void EQW__GetLoginServerCount(WebInterface *i, const std::string& method, const std::string& id, const Json::Value& params) {
|
void EQW__GetLoginServerCount(WebInterface *i, const std::string& method, const std::string& id, const Json::Value& params) {
|
||||||
Json::Value ret = loginserverlist.GetServerCount();
|
Json::Value ret = LoginServerList::Instance()->GetServerCount();
|
||||||
i->SendResponse(id, ret);
|
i->SendResponse(id, ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -57,7 +57,7 @@ void WorldBoot::GMSayHookCallBackProcessWorld(uint16 log_category, const char *f
|
|||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
AccountStatus::QuestTroupe,
|
AccountStatus::QuestTroupe,
|
||||||
LogSys.GetGMSayColorFromCategory(log_category),
|
EQEmuLogSys::Instance()->GetGMSayColorFromCategory(log_category),
|
||||||
fmt::format(
|
fmt::format(
|
||||||
" {}{}",
|
" {}{}",
|
||||||
(iter == 0 ? " ---" : ""),
|
(iter == 0 ? " ---" : ""),
|
||||||
@ -73,7 +73,7 @@ void WorldBoot::GMSayHookCallBackProcessWorld(uint16 log_category, const char *f
|
|||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
AccountStatus::QuestTroupe,
|
AccountStatus::QuestTroupe,
|
||||||
LogSys.GetGMSayColorFromCategory(log_category),
|
EQEmuLogSys::Instance()->GetGMSayColorFromCategory(log_category),
|
||||||
"%s",
|
"%s",
|
||||||
fmt::format("[{}] [{}] {}", Logs::LogCategoryName[log_category], func, message).c_str()
|
fmt::format("[{}] [{}] {}", Logs::LogCategoryName[log_category], func, message).c_str()
|
||||||
);
|
);
|
||||||
@ -83,12 +83,12 @@ bool WorldBoot::HandleCommandInput(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
// command handler
|
// command handler
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
LogSys.SilenceConsoleLogging();
|
EQEmuLogSys::Instance()->SilenceConsoleLogging();
|
||||||
path.LoadPaths();
|
PathManager::Instance()->Init();
|
||||||
WorldConfig::LoadConfig();
|
WorldConfig::LoadConfig();
|
||||||
LoadDatabaseConnections();
|
LoadDatabaseConnections();
|
||||||
RuleManager::Instance()->LoadRules(&database, "default", false);
|
RuleManager::Instance()->LoadRules(&database, "default", false);
|
||||||
LogSys.EnableConsoleLogging();
|
EQEmuLogSys::Instance()->EnableConsoleLogging();
|
||||||
WorldserverCLI::CommandHandler(argc, argv);
|
WorldserverCLI::CommandHandler(argc, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,15 +183,13 @@ int get_file_size(const std::string &filename) // path to file
|
|||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern LoginServerList loginserverlist;
|
|
||||||
|
|
||||||
void WorldBoot::RegisterLoginservers()
|
void WorldBoot::RegisterLoginservers()
|
||||||
{
|
{
|
||||||
const auto c = EQEmuConfig::get();
|
const auto c = EQEmuConfig::get();
|
||||||
|
|
||||||
if (c->LoginCount == 0) {
|
if (c->LoginCount == 0) {
|
||||||
if (c->LoginHost.length()) {
|
if (c->LoginHost.length()) {
|
||||||
loginserverlist.Add(
|
LoginServerList::Instance()->Add(
|
||||||
c->LoginHost.c_str(),
|
c->LoginHost.c_str(),
|
||||||
c->LoginPort,
|
c->LoginPort,
|
||||||
c->LoginAccount.c_str(),
|
c->LoginAccount.c_str(),
|
||||||
@ -207,7 +205,7 @@ void WorldBoot::RegisterLoginservers()
|
|||||||
iterator.Reset();
|
iterator.Reset();
|
||||||
while (iterator.MoreElements()) {
|
while (iterator.MoreElements()) {
|
||||||
if (iterator.GetData()->LoginHost.length()) {
|
if (iterator.GetData()->LoginHost.length()) {
|
||||||
loginserverlist.Add(
|
LoginServerList::Instance()->Add(
|
||||||
iterator.GetData()->LoginHost.c_str(),
|
iterator.GetData()->LoginHost.c_str(),
|
||||||
iterator.GetData()->LoginPort,
|
iterator.GetData()->LoginPort,
|
||||||
iterator.GetData()->LoginAccount.c_str(),
|
iterator.GetData()->LoginAccount.c_str(),
|
||||||
@ -226,18 +224,17 @@ void WorldBoot::RegisterLoginservers()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern SharedTaskManager shared_task_manager;
|
|
||||||
extern AdventureManager adventure_manager;
|
extern AdventureManager adventure_manager;
|
||||||
extern WorldEventScheduler event_scheduler;
|
extern WorldEventScheduler event_scheduler;
|
||||||
|
|
||||||
bool WorldBoot::DatabaseLoadRoutines(int argc, char **argv)
|
bool WorldBoot::DatabaseLoadRoutines(int argc, char **argv)
|
||||||
{
|
{
|
||||||
// logging system init
|
// logging system init
|
||||||
auto logging = LogSys.SetDatabase(&database)
|
auto logging = EQEmuLogSys::Instance()->SetDatabase(&database)
|
||||||
->SetLogPath(path.GetLogPath())
|
->SetLogPath(PathManager::Instance()->GetLogPath())
|
||||||
->LoadLogDatabaseSettings();
|
->LoadLogDatabaseSettings();
|
||||||
|
|
||||||
LogSys.SetDiscordHandler(&WorldBoot::DiscordWebhookMessageHandler);
|
EQEmuLogSys::Instance()->SetDiscordHandler(&WorldBoot::DiscordWebhookMessageHandler);
|
||||||
|
|
||||||
const auto c = EQEmuConfig::get();
|
const auto c = EQEmuConfig::get();
|
||||||
if (c->auto_database_updates) {
|
if (c->auto_database_updates) {
|
||||||
@ -279,9 +276,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;
|
||||||
}
|
}
|
||||||
@ -402,13 +399,13 @@ bool WorldBoot::DatabaseLoadRoutines(int argc, char **argv)
|
|||||||
->ReloadContentFlags();
|
->ReloadContentFlags();
|
||||||
|
|
||||||
LogInfo("Initializing [SharedTaskManager]");
|
LogInfo("Initializing [SharedTaskManager]");
|
||||||
shared_task_manager.SetDatabase(&database)
|
SharedTaskManager::Instance()->SetDatabase(&database)
|
||||||
->SetContentDatabase(&content_db)
|
->SetContentDatabase(&content_db)
|
||||||
->LoadTaskData()
|
->LoadTaskData()
|
||||||
->LoadSharedTaskState();
|
->LoadSharedTaskState();
|
||||||
|
|
||||||
LogInfo("Purging expired shared tasks");
|
LogInfo("Purging expired shared tasks");
|
||||||
shared_task_manager.PurgeExpiredSharedTasks();
|
SharedTaskManager::Instance()->PurgeExpiredSharedTasks();
|
||||||
|
|
||||||
LogInfo("Cleaning up instance corpses");
|
LogInfo("Cleaning up instance corpses");
|
||||||
database.CleanupInstanceCorpses();
|
database.CleanupInstanceCorpses();
|
||||||
|
|||||||
@ -37,14 +37,14 @@ 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 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 +694,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;
|
||||||
@ -912,7 +912,7 @@ bool ZSList::SendPacketToBootedZones(ServerPacket* pack)
|
|||||||
|
|
||||||
bool ZSList::SendPacketToZonesWithGuild(uint32 guild_id, ServerPacket* pack)
|
bool ZSList::SendPacketToZonesWithGuild(uint32 guild_id, ServerPacket* pack)
|
||||||
{
|
{
|
||||||
auto servers = client_list.GetGuildZoneServers(guild_id);
|
auto servers = ClientList::Instance()->GetGuildZoneServers(guild_id);
|
||||||
for (auto const& z : zone_server_list) {
|
for (auto const& z : zone_server_list) {
|
||||||
for (auto const& server_id : servers) {
|
for (auto const& server_id : servers) {
|
||||||
if (z->GetID() == server_id && z->GetZoneID() > 0) {
|
if (z->GetID() == server_id && z->GetZoneID() > 0) {
|
||||||
@ -926,7 +926,7 @@ bool ZSList::SendPacketToZonesWithGuild(uint32 guild_id, ServerPacket* pack)
|
|||||||
|
|
||||||
bool ZSList::SendPacketToZonesWithGMs(ServerPacket* pack)
|
bool ZSList::SendPacketToZonesWithGMs(ServerPacket* pack)
|
||||||
{
|
{
|
||||||
auto servers = client_list.GetZoneServersWithGMs();
|
auto servers = ClientList::Instance()->GetZoneServersWithGMs();
|
||||||
for (auto const &z: zone_server_list) {
|
for (auto const &z: zone_server_list) {
|
||||||
for (auto const &server_id: servers) {
|
for (auto const &server_id: servers) {
|
||||||
if (z->GetID() == server_id && z->GetZoneID() > 0) {
|
if (z->GetID() == server_id && z->GetZoneID() > 0) {
|
||||||
@ -978,15 +978,16 @@ 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();
|
EQEmuLogSys::Instance()->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();
|
SharedTaskManager::Instance()->LoadTaskData();
|
||||||
} else if (type == ServerReload::Type::DzTemplates) {
|
} else if (type == ServerReload::Type::DzTemplates) {
|
||||||
dynamic_zone_manager.LoadTemplates();
|
dynamic_zone_manager.LoadTemplates();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,13 +55,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
extern ClientList client_list;
|
extern ClientList client_list;
|
||||||
extern GroupLFPList LFPGroupList;
|
extern GroupLFPList LFPGroupList;
|
||||||
extern ZSList zoneserver_list;
|
extern ZSList zoneserver_list;
|
||||||
extern LoginServerList loginserverlist;
|
|
||||||
extern volatile bool RunLoops;
|
extern volatile bool RunLoops;
|
||||||
extern volatile bool UCSServerAvailable_;
|
extern volatile bool UCSServerAvailable_;
|
||||||
extern AdventureManager adventure_manager;
|
extern AdventureManager adventure_manager;
|
||||||
extern UCSConnection UCSLink;
|
extern UCSConnection UCSLink;
|
||||||
extern QueryServConnection QSLink;
|
extern QueryServConnection QSLink;
|
||||||
extern SharedTaskManager shared_task_manager;
|
|
||||||
|
|
||||||
void CatchSignal(int sig_num);
|
void CatchSignal(int sig_num);
|
||||||
|
|
||||||
@ -164,7 +162,7 @@ void ZoneServer::LSBootUpdate(uint32 zone_id, uint32 instanceid, bool startup) {
|
|||||||
bootup->zone = zone_id;
|
bootup->zone = zone_id;
|
||||||
bootup->zone_wid = GetID();
|
bootup->zone_wid = GetID();
|
||||||
bootup->instance = instanceid;
|
bootup->instance = instanceid;
|
||||||
loginserverlist.SendPacket(pack);
|
LoginServerList::Instance()->SendPacket(pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -179,7 +177,7 @@ void ZoneServer::LSSleepUpdate(uint32 zone_id) {
|
|||||||
auto sleep = (ServerLSZoneSleep_Struct*) pack->pBuffer;
|
auto sleep = (ServerLSZoneSleep_Struct*) pack->pBuffer;
|
||||||
sleep->zone = zone_id;
|
sleep->zone = zone_id;
|
||||||
sleep->zone_wid = GetID();
|
sleep->zone_wid = GetID();
|
||||||
loginserverlist.SendPacket(pack);
|
LoginServerList::Instance()->SendPacket(pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1076,8 +1074,8 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
|||||||
WorldConfig::UnlockWorld();
|
WorldConfig::UnlockWorld();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (loginserverlist.Connected()) {
|
if (LoginServerList::Instance()->Connected()) {
|
||||||
loginserverlist.SendStatus();
|
LoginServerList::Instance()->SendStatus();
|
||||||
SendEmoteMessage(
|
SendEmoteMessage(
|
||||||
l->character_name,
|
l->character_name,
|
||||||
0,
|
0,
|
||||||
@ -1339,7 +1337,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
|||||||
}
|
}
|
||||||
case ServerOP_LSAccountUpdate: {
|
case ServerOP_LSAccountUpdate: {
|
||||||
LogNetcode("Received ServerOP_LSAccountUpdate packet from zone");
|
LogNetcode("Received ServerOP_LSAccountUpdate packet from zone");
|
||||||
loginserverlist.SendAccountUpdate(pack);
|
LoginServerList::Instance()->SendAccountUpdate(pack);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ServerOP_DiscordWebhookMessage:
|
case ServerOP_DiscordWebhookMessage:
|
||||||
|
|||||||
@ -12,7 +12,6 @@ SET(zone_sources
|
|||||||
bonuses.cpp
|
bonuses.cpp
|
||||||
bot.cpp
|
bot.cpp
|
||||||
bot_raid.cpp
|
bot_raid.cpp
|
||||||
bot_command.cpp
|
|
||||||
bot_database.cpp
|
bot_database.cpp
|
||||||
botspellsai.cpp
|
botspellsai.cpp
|
||||||
cheat_manager.cpp
|
cheat_manager.cpp
|
||||||
@ -23,7 +22,6 @@ SET(zone_sources
|
|||||||
client_packet.cpp
|
client_packet.cpp
|
||||||
client_process.cpp
|
client_process.cpp
|
||||||
combat_record.cpp
|
combat_record.cpp
|
||||||
command.cpp
|
|
||||||
corpse.cpp
|
corpse.cpp
|
||||||
../common/data_bucket.cpp
|
../common/data_bucket.cpp
|
||||||
doors.cpp
|
doors.cpp
|
||||||
@ -48,36 +46,6 @@ SET(zone_sources
|
|||||||
horse.cpp
|
horse.cpp
|
||||||
inventory.cpp
|
inventory.cpp
|
||||||
loot.cpp
|
loot.cpp
|
||||||
lua_bot.cpp
|
|
||||||
lua_bit.cpp
|
|
||||||
lua_buff.cpp
|
|
||||||
lua_corpse.cpp
|
|
||||||
lua_client.cpp
|
|
||||||
lua_database.cpp
|
|
||||||
lua_door.cpp
|
|
||||||
lua_encounter.cpp
|
|
||||||
lua_entity.cpp
|
|
||||||
lua_entity_list.cpp
|
|
||||||
lua_expedition.cpp
|
|
||||||
lua_general.cpp
|
|
||||||
lua_group.cpp
|
|
||||||
lua_hate_list.cpp
|
|
||||||
lua_inventory.cpp
|
|
||||||
lua_item.cpp
|
|
||||||
lua_iteminst.cpp
|
|
||||||
lua_merc.cpp
|
|
||||||
lua_mob.cpp
|
|
||||||
lua_mod.cpp
|
|
||||||
lua_npc.cpp
|
|
||||||
lua_object.cpp
|
|
||||||
lua_packet.cpp
|
|
||||||
lua_parser.cpp
|
|
||||||
lua_parser_events.cpp
|
|
||||||
lua_raid.cpp
|
|
||||||
lua_spawn.cpp
|
|
||||||
lua_spell.cpp
|
|
||||||
lua_stat_bonuses.cpp
|
|
||||||
lua_zone.cpp
|
|
||||||
embperl.cpp
|
embperl.cpp
|
||||||
entity.cpp
|
entity.cpp
|
||||||
exp.cpp
|
exp.cpp
|
||||||
@ -108,30 +76,6 @@ SET(zone_sources
|
|||||||
pathfinder_nav_mesh.cpp
|
pathfinder_nav_mesh.cpp
|
||||||
pathfinder_null.cpp
|
pathfinder_null.cpp
|
||||||
pathing.cpp
|
pathing.cpp
|
||||||
perl_bot.cpp
|
|
||||||
perl_buff.cpp
|
|
||||||
perl_client.cpp
|
|
||||||
perl_database.cpp
|
|
||||||
perl_doors.cpp
|
|
||||||
perl_entity.cpp
|
|
||||||
perl_expedition.cpp
|
|
||||||
perl_groups.cpp
|
|
||||||
perl_hateentry.cpp
|
|
||||||
perl_inventory.cpp
|
|
||||||
perl_merc.cpp
|
|
||||||
perl_mob.cpp
|
|
||||||
perl_npc.cpp
|
|
||||||
perl_object.cpp
|
|
||||||
perl_perlpacket.cpp
|
|
||||||
perl_player_corpse.cpp
|
|
||||||
perl_questitem.cpp
|
|
||||||
perl_questitem_data.cpp
|
|
||||||
perl_raids.cpp
|
|
||||||
perl_spawn.cpp
|
|
||||||
perl_spell.cpp
|
|
||||||
perl_stat_bonuses.cpp
|
|
||||||
perl_zone.cpp
|
|
||||||
perlpacket.cpp
|
|
||||||
petitions.cpp
|
petitions.cpp
|
||||||
pets.cpp
|
pets.cpp
|
||||||
position.cpp
|
position.cpp
|
||||||
@ -296,18 +240,268 @@ SET(zone_headers
|
|||||||
zone_save_state.h
|
zone_save_state.h
|
||||||
zone_cli.cpp)
|
zone_cli.cpp)
|
||||||
|
|
||||||
|
# lua unity build
|
||||||
|
set(lua_sources
|
||||||
|
lua_bot.cpp
|
||||||
|
lua_bit.cpp
|
||||||
|
lua_buff.cpp
|
||||||
|
lua_corpse.cpp
|
||||||
|
lua_client.cpp
|
||||||
|
lua_database.cpp
|
||||||
|
lua_door.cpp
|
||||||
|
lua_encounter.cpp
|
||||||
|
lua_entity.cpp
|
||||||
|
lua_entity_list.cpp
|
||||||
|
lua_expedition.cpp
|
||||||
|
lua_general.cpp
|
||||||
|
lua_group.cpp
|
||||||
|
lua_hate_list.cpp
|
||||||
|
lua_inventory.cpp
|
||||||
|
lua_item.cpp
|
||||||
|
lua_iteminst.cpp
|
||||||
|
lua_merc.cpp
|
||||||
|
lua_mob.cpp
|
||||||
|
lua_mod.cpp
|
||||||
|
lua_npc.cpp
|
||||||
|
lua_object.cpp
|
||||||
|
lua_packet.cpp
|
||||||
|
lua_parser.cpp
|
||||||
|
lua_parser_events.cpp
|
||||||
|
lua_raid.cpp
|
||||||
|
lua_spawn.cpp
|
||||||
|
lua_spell.cpp
|
||||||
|
lua_stat_bonuses.cpp
|
||||||
|
lua_zone.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(lua_zone STATIC ${lua_sources})
|
||||||
|
set_target_properties(lua_zone PROPERTIES UNITY_BUILD ON UNITY_BUILD_BATCH_SIZE 8)
|
||||||
|
|
||||||
|
# perl unity build
|
||||||
|
set(perl_sources
|
||||||
|
perl_bot.cpp
|
||||||
|
perl_buff.cpp
|
||||||
|
perl_client.cpp
|
||||||
|
perl_database.cpp
|
||||||
|
perl_doors.cpp
|
||||||
|
perl_entity.cpp
|
||||||
|
perl_expedition.cpp
|
||||||
|
perl_groups.cpp
|
||||||
|
perl_hateentry.cpp
|
||||||
|
perl_inventory.cpp
|
||||||
|
perl_merc.cpp
|
||||||
|
perl_mob.cpp
|
||||||
|
perl_npc.cpp
|
||||||
|
perl_object.cpp
|
||||||
|
perl_perlpacket.cpp
|
||||||
|
perl_player_corpse.cpp
|
||||||
|
perl_questitem.cpp
|
||||||
|
perl_questitem_data.cpp
|
||||||
|
perl_raids.cpp
|
||||||
|
perl_spawn.cpp
|
||||||
|
perl_spell.cpp
|
||||||
|
perl_stat_bonuses.cpp
|
||||||
|
perl_zone.cpp
|
||||||
|
perlpacket.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(perl_zone STATIC ${perl_sources})
|
||||||
|
set_target_properties(perl_zone PROPERTIES UNITY_BUILD ON UNITY_BUILD_BATCH_SIZE 8)
|
||||||
|
|
||||||
|
# gm commands
|
||||||
|
set(gm_command_sources
|
||||||
|
command.cpp
|
||||||
|
bot_command.cpp
|
||||||
|
gm_commands/acceptrules.cpp
|
||||||
|
gm_commands/advnpcspawn.cpp
|
||||||
|
gm_commands/aggrozone.cpp
|
||||||
|
gm_commands/ai.cpp
|
||||||
|
gm_commands/appearance.cpp
|
||||||
|
gm_commands/appearanceeffects.cpp
|
||||||
|
gm_commands/attack.cpp
|
||||||
|
gm_commands/augmentitem.cpp
|
||||||
|
gm_commands/ban.cpp
|
||||||
|
gm_commands/bugs.cpp
|
||||||
|
gm_commands/camerashake.cpp
|
||||||
|
gm_commands/castspell.cpp
|
||||||
|
gm_commands/chat.cpp
|
||||||
|
gm_commands/clearxtargets.cpp
|
||||||
|
gm_commands/copycharacter.cpp
|
||||||
|
gm_commands/corpse.cpp
|
||||||
|
gm_commands/corpsefix.cpp
|
||||||
|
gm_commands/countitem.cpp
|
||||||
|
gm_commands/damage.cpp
|
||||||
|
gm_commands/databuckets.cpp
|
||||||
|
gm_commands/dbspawn2.cpp
|
||||||
|
gm_commands/delacct.cpp
|
||||||
|
gm_commands/delpetition.cpp
|
||||||
|
gm_commands/depop.cpp
|
||||||
|
gm_commands/depopzone.cpp
|
||||||
|
gm_commands/devtools.cpp
|
||||||
|
gm_commands/disablerecipe.cpp
|
||||||
|
gm_commands/disarmtrap.cpp
|
||||||
|
gm_commands/doanim.cpp
|
||||||
|
gm_commands/door.cpp
|
||||||
|
gm_commands/door_manipulation.cpp
|
||||||
|
gm_commands/dye.cpp
|
||||||
|
gm_commands/dz.cpp
|
||||||
|
gm_commands/dzkickplayers.cpp
|
||||||
|
gm_commands/editmassrespawn.cpp
|
||||||
|
gm_commands/emote.cpp
|
||||||
|
gm_commands/emptyinventory.cpp
|
||||||
|
gm_commands/enablerecipe.cpp
|
||||||
|
gm_commands/entityvariable.cpp
|
||||||
|
gm_commands/exptoggle.cpp
|
||||||
|
gm_commands/faction.cpp
|
||||||
|
gm_commands/evolving_items.cpp
|
||||||
|
gm_commands/feature.cpp
|
||||||
|
gm_commands/find.cpp
|
||||||
|
gm_commands/fish.cpp
|
||||||
|
gm_commands/fixmob.cpp
|
||||||
|
gm_commands/flagedit.cpp
|
||||||
|
gm_commands/fleeinfo.cpp
|
||||||
|
gm_commands/forage.cpp
|
||||||
|
gm_commands/gearup.cpp
|
||||||
|
gm_commands/giveitem.cpp
|
||||||
|
gm_commands/givemoney.cpp
|
||||||
|
gm_commands/gmzone.cpp
|
||||||
|
gm_commands/goto.cpp
|
||||||
|
gm_commands/grantaa.cpp
|
||||||
|
gm_commands/grid.cpp
|
||||||
|
gm_commands/guild.cpp
|
||||||
|
gm_commands/hp.cpp
|
||||||
|
gm_commands/illusion_block.cpp
|
||||||
|
gm_commands/instance.cpp
|
||||||
|
gm_commands/interrogateinv.cpp
|
||||||
|
gm_commands/interrupt.cpp
|
||||||
|
gm_commands/invsnapshot.cpp
|
||||||
|
gm_commands/ipban.cpp
|
||||||
|
gm_commands/kick.cpp
|
||||||
|
gm_commands/kill.cpp
|
||||||
|
gm_commands/killallnpcs.cpp
|
||||||
|
gm_commands/list.cpp
|
||||||
|
gm_commands/lootsim.cpp
|
||||||
|
gm_commands/loc.cpp
|
||||||
|
gm_commands/logs.cpp
|
||||||
|
gm_commands/makepet.cpp
|
||||||
|
gm_commands/memspell.cpp
|
||||||
|
gm_commands/merchantshop.cpp
|
||||||
|
gm_commands/modifynpcstat.cpp
|
||||||
|
gm_commands/movechar.cpp
|
||||||
|
gm_commands/movement.cpp
|
||||||
|
gm_commands/myskills.cpp
|
||||||
|
gm_commands/mysql.cpp
|
||||||
|
gm_commands/mystats.cpp
|
||||||
|
gm_commands/npccast.cpp
|
||||||
|
gm_commands/npcedit.cpp
|
||||||
|
gm_commands/npceditmass.cpp
|
||||||
|
gm_commands/npcemote.cpp
|
||||||
|
gm_commands/npcloot.cpp
|
||||||
|
gm_commands/npcsay.cpp
|
||||||
|
gm_commands/npcshout.cpp
|
||||||
|
gm_commands/npcspawn.cpp
|
||||||
|
gm_commands/npctypespawn.cpp
|
||||||
|
gm_commands/nudge.cpp
|
||||||
|
gm_commands/nukebuffs.cpp
|
||||||
|
gm_commands/nukeitem.cpp
|
||||||
|
gm_commands/object.cpp
|
||||||
|
gm_commands/object_manipulation.cpp
|
||||||
|
gm_commands/parcels.cpp
|
||||||
|
gm_commands/path.cpp
|
||||||
|
gm_commands/peqzone.cpp
|
||||||
|
gm_commands/petitems.cpp
|
||||||
|
gm_commands/petname.cpp
|
||||||
|
gm_commands/picklock.cpp
|
||||||
|
gm_commands/profanity.cpp
|
||||||
|
gm_commands/push.cpp
|
||||||
|
gm_commands/raidloot.cpp
|
||||||
|
gm_commands/randomfeatures.cpp
|
||||||
|
gm_commands/refreshgroup.cpp
|
||||||
|
gm_commands/reload.cpp
|
||||||
|
gm_commands/removeitem.cpp
|
||||||
|
gm_commands/repop.cpp
|
||||||
|
gm_commands/resetaa.cpp
|
||||||
|
gm_commands/resetaa_timer.cpp
|
||||||
|
gm_commands/resetdisc_timer.cpp
|
||||||
|
gm_commands/revoke.cpp
|
||||||
|
gm_commands/roambox.cpp
|
||||||
|
gm_commands/rules.cpp
|
||||||
|
gm_commands/save.cpp
|
||||||
|
gm_commands/scale.cpp
|
||||||
|
gm_commands/scribespell.cpp
|
||||||
|
gm_commands/scribespells.cpp
|
||||||
|
gm_commands/sendzonespawns.cpp
|
||||||
|
gm_commands/sensetrap.cpp
|
||||||
|
gm_commands/serverrules.cpp
|
||||||
|
gm_commands/set.cpp
|
||||||
|
gm_commands/show.cpp
|
||||||
|
gm_commands/shutdown.cpp
|
||||||
|
gm_commands/spawn.cpp
|
||||||
|
gm_commands/spawneditmass.cpp
|
||||||
|
gm_commands/spawnfix.cpp
|
||||||
|
gm_commands/faction_association.cpp
|
||||||
|
gm_commands/stun.cpp
|
||||||
|
gm_commands/summon.cpp
|
||||||
|
gm_commands/summonburiedplayercorpse.cpp
|
||||||
|
gm_commands/summonitem.cpp
|
||||||
|
gm_commands/suspend.cpp
|
||||||
|
gm_commands/suspendmulti.cpp
|
||||||
|
gm_commands/takeplatinum.cpp
|
||||||
|
gm_commands/task.cpp
|
||||||
|
gm_commands/traindisc.cpp
|
||||||
|
gm_commands/tune.cpp
|
||||||
|
gm_commands/undye.cpp
|
||||||
|
gm_commands/unmemspell.cpp
|
||||||
|
gm_commands/unmemspells.cpp
|
||||||
|
gm_commands/unscribespell.cpp
|
||||||
|
gm_commands/unscribespells.cpp
|
||||||
|
gm_commands/untraindisc.cpp
|
||||||
|
gm_commands/untraindiscs.cpp
|
||||||
|
gm_commands/wc.cpp
|
||||||
|
gm_commands/worldshutdown.cpp
|
||||||
|
gm_commands/worldwide.cpp
|
||||||
|
gm_commands/wp.cpp
|
||||||
|
gm_commands/wpadd.cpp
|
||||||
|
gm_commands/zone.cpp
|
||||||
|
gm_commands/zonebootup.cpp
|
||||||
|
gm_commands/zoneshutdown.cpp
|
||||||
|
gm_commands/zonevariable.cpp
|
||||||
|
gm_commands/zone_instance.cpp
|
||||||
|
gm_commands/zone_shard.cpp
|
||||||
|
gm_commands/zsave.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(gm_commands_zone STATIC ${gm_command_sources})
|
||||||
|
set_target_properties(gm_commands_zone PROPERTIES UNITY_BUILD ON UNITY_BUILD_BATCH_SIZE 32)
|
||||||
|
|
||||||
|
# zone combine sources and headers
|
||||||
ADD_EXECUTABLE(zone ${zone_sources} ${zone_headers})
|
ADD_EXECUTABLE(zone ${zone_sources} ${zone_headers})
|
||||||
|
|
||||||
|
# binary output directory
|
||||||
INSTALL(TARGETS zone RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
INSTALL(TARGETS zone RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||||
|
|
||||||
IF (WIN32 AND EQEMU_BUILD_PCH)
|
# precompiled headers
|
||||||
TARGET_PRECOMPILE_HEADERS(zone PRIVATE ../common/pch/pch.h)
|
IF (EQEMU_BUILD_PCH)
|
||||||
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 ../common/pch/app-pch.h)
|
||||||
TARGET_PRECOMPILE_HEADERS(zone PRIVATE mob.h npc.h corpse.h doors.h bot.h entity.h client.h zone.h)
|
TARGET_PRECOMPILE_HEADERS(zone PRIVATE ./pch/pch.h)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
ADD_DEFINITIONS(-DZONE)
|
ADD_DEFINITIONS(-DZONE)
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(zone ${ZONE_LIBS})
|
# link lua_zone unity build against luabind
|
||||||
|
target_link_libraries(lua_zone PRIVATE luabind)
|
||||||
|
if (EQEMU_BUILD_STATIC AND LUA_LIBRARY)
|
||||||
|
target_link_libraries(zone PRIVATE ${LUA_LIBRARY})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# perl unity build links against perl_zone
|
||||||
|
target_link_libraries(perl_zone PRIVATE perlbind)
|
||||||
|
if (EQEMU_BUILD_STATIC AND PERL_LIBRARY)
|
||||||
|
target_link_libraries(zone PRIVATE ${PERL_LIBRARY})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# link zone against common libraries
|
||||||
|
target_link_libraries(zone PRIVATE ${ZONE_LIBS} lua_zone perl_zone gm_commands_zone)
|
||||||
|
|
||||||
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
||||||
|
|
||||||
|
|||||||
@ -835,9 +835,9 @@ Json::Value ApiGetLogsysCategories(EQ::Net::WebsocketServerConnection *connectio
|
|||||||
|
|
||||||
row["log_category_id"] = i;
|
row["log_category_id"] = i;
|
||||||
row["log_category_description"] = Logs::LogCategoryName[i];
|
row["log_category_description"] = Logs::LogCategoryName[i];
|
||||||
row["log_to_console"] = LogSys.log_settings[i].log_to_console;
|
row["log_to_console"] = EQEmuLogSys::Instance()->log_settings[i].log_to_console;
|
||||||
row["log_to_file"] = LogSys.log_settings[i].log_to_file;
|
row["log_to_file"] = EQEmuLogSys::Instance()->log_settings[i].log_to_file;
|
||||||
row["log_to_gmsay"] = LogSys.log_settings[i].log_to_gmsay;
|
row["log_to_gmsay"] = EQEmuLogSys::Instance()->log_settings[i].log_to_gmsay;
|
||||||
|
|
||||||
response.append(row);
|
response.append(row);
|
||||||
}
|
}
|
||||||
@ -866,15 +866,15 @@ Json::Value ApiSetLoggingLevel(EQ::Net::WebsocketServerConnection *connection, J
|
|||||||
if (logging_category < Logs::LogCategory::MaxCategoryID &&
|
if (logging_category < Logs::LogCategory::MaxCategoryID &&
|
||||||
logging_category > Logs::LogCategory::None
|
logging_category > Logs::LogCategory::None
|
||||||
) {
|
) {
|
||||||
LogSys.log_settings[logging_category].log_to_console = logging_level;
|
EQEmuLogSys::Instance()->log_settings[logging_category].log_to_console = logging_level;
|
||||||
response["status"] = "Category log level updated";
|
response["status"] = "Category log level updated";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logging_level > 0) {
|
if (logging_level > 0) {
|
||||||
LogSys.log_settings[logging_category].is_category_enabled = 1;
|
EQEmuLogSys::Instance()->log_settings[logging_category].is_category_enabled = 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LogSys.log_settings[logging_category].is_category_enabled = 0;
|
EQEmuLogSys::Instance()->log_settings[logging_category].is_category_enabled = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
@ -882,7 +882,7 @@ Json::Value ApiSetLoggingLevel(EQ::Net::WebsocketServerConnection *connection, J
|
|||||||
|
|
||||||
void RegisterApiLogEvent(std::unique_ptr<EQ::Net::WebsocketServer> &server)
|
void RegisterApiLogEvent(std::unique_ptr<EQ::Net::WebsocketServer> &server)
|
||||||
{
|
{
|
||||||
LogSys.SetConsoleHandler(
|
EQEmuLogSys::Instance()->SetConsoleHandler(
|
||||||
[&](uint16 log_category, const std::string &msg) {
|
[&](uint16 log_category, const std::string &msg) {
|
||||||
Json::Value data;
|
Json::Value data;
|
||||||
data["log_category"] = log_category;
|
data["log_category"] = log_category;
|
||||||
|
|||||||
@ -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) {
|
||||||
|
|||||||
10
zone/bot.cpp
10
zone/bot.cpp
@ -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() {
|
||||||
@ -3575,7 +3575,7 @@ void Bot::Depop() {
|
|||||||
RemoveAllAuras();
|
RemoveAllAuras();
|
||||||
|
|
||||||
Mob* bot_pet = GetPet();
|
Mob* bot_pet = GetPet();
|
||||||
|
|
||||||
if (bot_pet) {
|
if (bot_pet) {
|
||||||
if (bot_pet->Charmed()) {
|
if (bot_pet->Charmed()) {
|
||||||
bot_pet->BuffFadeByEffect(SE_Charm);
|
bot_pet->BuffFadeByEffect(SE_Charm);
|
||||||
@ -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);
|
||||||
@ -11274,7 +11274,7 @@ void Bot::SetSpellTypePriority(uint16 spell_type, uint8 priority_type, uint16 pr
|
|||||||
|
|
||||||
std::list<BotSpellTypeOrder> Bot::GetSpellTypesPrioritized(uint8 priority_type) {
|
std::list<BotSpellTypeOrder> Bot::GetSpellTypesPrioritized(uint8 priority_type) {
|
||||||
std::list<BotSpellTypeOrder> cast_order;
|
std::list<BotSpellTypeOrder> cast_order;
|
||||||
|
|
||||||
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; i++) {
|
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; i++) {
|
||||||
BotSpellTypeOrder typeSettings = {
|
BotSpellTypeOrder typeSettings = {
|
||||||
.spellType = i,
|
.spellType = i,
|
||||||
@ -13463,4 +13463,4 @@ bool Bot::HasControllablePet(uint8 ranks_required) {
|
|||||||
return GetClass() != Class::Enchanter ||
|
return GetClass() != Class::Enchanter ||
|
||||||
GetPet()->GetPetType() != petAnimation ||
|
GetPet()->GetPetType() != petAnimation ||
|
||||||
GetAA(aaAnimationEmpathy) >= ranks_required;
|
GetAA(aaAnimationEmpathy) >= ranks_required;
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user