Merge branch 'master' into bems_changes

This commit is contained in:
Chris Miles 2025-06-25 12:40:21 -05:00 committed by GitHub
commit ad73f68829
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
132 changed files with 2156 additions and 1538 deletions

View File

@ -42,6 +42,7 @@ IF(USE_MAP_MMFS)
ENDIF (USE_MAP_MMFS)
IF(MSVC)
add_compile_options(/bigobj)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
ADD_DEFINITIONS(-DNOMINMAX)
ADD_DEFINITIONS(-DCRASH_LOGGING)

View File

@ -40,8 +40,6 @@
EQEmuLogSys LogSys;
WorldContentService content_service;
ZoneStore zone_store;
PathManager path;
PlayerEventLogs player_event_logs;
EvolvingItemsManager evolving_items_manager;
@ -56,7 +54,7 @@ int main(int argc, char **argv)
LogSys.LoadLogSettingsDefaults();
set_exception_handler();
path.LoadPaths();
PathManager::Instance()->Init();
LogInfo("Client Files Export Utility");
if (!EQEmuConfig::LoadConfig()) {
@ -100,7 +98,7 @@ int main(int argc, char **argv)
}
LogSys.SetDatabase(&database)
->SetLogPath(path.GetLogPath())
->SetLogPath(PathManager::Instance()->GetLogPath())
->LoadLogDatabaseSettings()
->StartFileLogs();
@ -136,7 +134,7 @@ int main(int argc, char **argv)
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()) {
LogError("Unable to open export/spells_us.txt to write, skipping.");
return;
@ -155,7 +153,7 @@ void ExportSpells(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()) {
LogError("Unable to open export/SkillCaps.txt to write, skipping.");
return;
@ -174,7 +172,7 @@ void ExportSkillCaps(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()) {
LogError("Unable to open export/BaseData.txt to write, skipping.");
return;
@ -193,7 +191,7 @@ void ExportBaseData(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()) {
LogError("Unable to open export/dbstr_us.txt to write, skipping.");
return;

View File

@ -34,8 +34,6 @@
EQEmuLogSys LogSys;
WorldContentService content_service;
ZoneStore zone_store;
PathManager path;
PlayerEventLogs player_event_logs;
EvolvingItemsManager evolving_items_manager;
@ -49,7 +47,7 @@ int main(int argc, char **argv) {
LogSys.LoadLogSettingsDefaults();
set_exception_handler();
path.LoadPaths();
PathManager::Instance()->Init();
LogInfo("Client Files Import Utility");
if(!EQEmuConfig::LoadConfig()) {
@ -93,7 +91,7 @@ int main(int argc, char **argv) {
}
LogSys.SetDatabase(&database)
->SetLogPath(path.GetLogPath())
->SetLogPath(PathManager::Instance()->GetLogPath())
->LoadLogDatabaseSettings()
->StartFileLogs();
@ -138,7 +136,7 @@ bool IsStringField(int i) {
void ImportSpells(SharedDatabase *db) {
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");
if(!f) {
LogError("Unable to open {} to read, skipping.", file);
@ -228,7 +226,7 @@ void ImportSpells(SharedDatabase *db) {
void ImportSkillCaps(SharedDatabase *db) {
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");
if(!f) {
LogError("Unable to open {} to read, skipping.", file);
@ -265,7 +263,7 @@ void ImportBaseData(SharedDatabase *db)
{
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);
if (!file_contents.error.empty()) {
@ -305,7 +303,7 @@ void ImportBaseData(SharedDatabase *db)
void ImportDBStrings(SharedDatabase *db) {
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");
if(!f) {
LogError("Unable to open {} to read, skipping.", file);

View File

@ -842,7 +842,7 @@ IF (UNIX)
ENDIF (UNIX)
IF (WIN32 AND EQEMU_BUILD_PCH)
TARGET_PRECOMPILE_HEADERS(common PRIVATE pch/pch.h)
TARGET_PRECOMPILE_HEADERS(common PRIVATE pch/std-pch.h)
ENDIF ()
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)

View File

@ -185,7 +185,7 @@ void WorldContentService::ReloadContentFlags()
SetContentFlags(set_content_flags);
LoadStaticGlobalZoneInstances();
zone_store.LoadZones(*m_content_database);
ZoneStore::Instance()->LoadZones(*m_content_database);
}
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
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) {
if (
z.zoneidnumber == zone_id &&

View File

@ -1,18 +1,23 @@
#include "data_bucket.h"
#include "zonedb.h"
#include "mob.h"
#include "client.h"
#include "worldserver.h"
#include "../common/data_bucket.h"
#include "database.h"
#include <ctime>
#include <cctype>
#include "../common/json/json.hpp"
using json = nlohmann::json;
extern WorldServer worldserver;
const std::string NESTED_KEY_DELIMITER = ".";
const std::string NESTED_KEY_DELIMITER = ".";
std::vector<DataBucketsRepository::DataBuckets> g_data_bucket_cache = {};
std::vector<DataBucketsRepository::DataBuckets> g_data_bucket_cache = {};
#if defined(ZONE)
#include "../zone/zonedb.h"
extern ZoneDatabase database;
#elif defined(WORLD)
#include "../world/worlddb.h"
extern WorldDatabase database;
#else
#error "You must define either ZONE or WORLD"
#endif
void DataBucket::SetData(const std::string &bucket_key, const std::string &bucket_value, std::string expires_time)
{
@ -347,27 +352,6 @@ bool DataBucket::DeleteData(const std::string &bucket_key)
return DeleteData(DataBucketKey{.key = bucket_key});
}
// GetDataBuckets bulk loads all data buckets for a mob
bool DataBucket::GetDataBuckets(Mob *mob)
{
const uint32 id = mob->GetMobTypeIdentifier();
if (!id) {
return false;
}
if (mob->IsBot()) {
BulkLoadEntitiesToCache(DataBucketLoadType::Bot, {id});
}
else if (mob->IsClient()) {
uint32 account_id = mob->CastToClient()->AccountID();
BulkLoadEntitiesToCache(DataBucketLoadType::Account, {account_id});
BulkLoadEntitiesToCache(DataBucketLoadType::Client, {id});
}
return true;
}
bool DataBucket::DeleteData(const DataBucketKey &k)
{
bool is_nested_key = k.key.find(NESTED_KEY_DELIMITER) != std::string::npos;

View File

@ -2,11 +2,9 @@
#define EQEMU_DATABUCKET_H
#include <string>
#include "../common/types.h"
#include "../common/repositories/data_buckets_repository.h"
#include "mob.h"
#include "../common/json/json_archive_single_line.h"
#include "../common/servertalk.h"
#include "types.h"
#include "repositories/data_buckets_repository.h"
#include "json/json_archive_single_line.h"
struct DataBucketKey {
std::string key;
@ -46,8 +44,6 @@ public:
static std::string GetDataExpires(const std::string &bucket_key);
static std::string GetDataRemaining(const std::string &bucket_key);
static bool GetDataBuckets(Mob *mob);
// scoped bucket methods
static void SetData(const DataBucketKey &k_);
static bool DeleteData(const DataBucketKey &k);

View File

@ -708,6 +708,20 @@ const std::string Database::GetNPCNameByID(uint32 npc_id)
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 auto& e = NpcTypesRepository::FindOne(*this, npc_id);

View File

@ -7109,6 +7109,18 @@ ALTER TABLE `npc_types`
ALTER TABLE `character_data`
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`;
)",
.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
},

View File

@ -4,7 +4,6 @@
#include <string>
#include "../types.h"
#include "../http/httplib.h"
#include "../repositories/player_event_logs_repository.h"
#include "../events/player_events.h"

View File

@ -436,11 +436,11 @@ void EQEmuConfig::CheckUcsConfigConversion()
LogInfo("Migrating old [eqemu_config] UCS configuration to new configuration");
std::string config_file_path = std::filesystem::path{
path.GetServerPath() + "/eqemu_config.json"
PathManager::Instance()->GetServerPath() + "/eqemu_config.json"
}.string();
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();
// copy eqemu_config.json to eqemu_config.json.bak

View File

@ -191,7 +191,7 @@ class EQEmuConfig
std::string file = fmt::format(
"{}/{}",
(file_path.empty() ? path.GetServerPath() : file_path),
(file_path.empty() ? PathManager::Instance()->GetServerPath() : file_path),
EQEmuConfig::ConfigFile
);

View File

@ -537,9 +537,9 @@ void EQEmuLogSys::StartFileLogs(const std::string &log_name)
{
EQEmuLogSys::CloseFileLogs();
if (!File::Exists(path.GetLogPath())) {
LogInfo("Logs directory not found, creating [{}]", path.GetLogPath());
File::Makedir(path.GetLogPath());
if (!File::Exists(PathManager::Instance()->GetLogPath())) {
LogInfo("Logs directory not found, creating [{}]", PathManager::Instance()->GetLogPath());
File::Makedir(PathManager::Instance()->GetLogPath());
}
/**

View File

@ -716,7 +716,7 @@ std::string PlayerEventDiscordFormatter::FormatNPCHandinEvent(
);
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);
handin_items_info += fmt::format(
"Augment {}: {} ({})\n",
@ -741,7 +741,7 @@ std::string PlayerEventDiscordFormatter::FormatNPCHandinEvent(
);
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);
return_items_info += fmt::format(
"Augment {}: {} ({})\n",

View File

@ -195,10 +195,12 @@ void PlayerEventLogs::ProcessBatchQueue()
};
// Helper to assign ETL table ID
auto AssignEtlId = [&](
PlayerEventLogsRepository::PlayerEventLogs &r,
PlayerEvent::EventType type
) {
auto AssignEtlId = [&](
PlayerEventLogsRepository::PlayerEventLogs& r,
PlayerEvent::EventType type
)
{
if (m_etl_settings.contains(type)) {
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));
if (it != event_processors.end()) {
it->second(r); // Call the appropriate lambda
r.event_data = "{}"; // Clear event data
}
else {
LogPlayerEventsDetail("Non-Implemented ETL routing [{}]", r.event_type_id);
@ -535,6 +536,20 @@ std::string PlayerEventLogs::GetDiscordWebhookUrlFromEventType(int32_t event_typ
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
// ZONING | [x] Implemented Formatter
// AA_GAIN | [x] Implemented Formatter

View File

@ -73,9 +73,11 @@ public:
return BuildPlayerEventPacket(c);
}
[[nodiscard]] const PlayerEventLogSettingsRepository::PlayerEventLogSettings *GetSettings() const;
bool IsEventDiscordEnabled(int32_t event_type_id);
std::string GetDiscordWebhookUrlFromEventType(int32_t event_type_id);
[[nodiscard]] const PlayerEventLogSettingsRepository::PlayerEventLogSettings * GetSettings() const;
bool IsEventDiscordEnabled(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);

View File

@ -7,8 +7,16 @@
#include "../rulesys.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 {
GM_COMMAND = 1,
ZONING,
@ -26,10 +34,10 @@ namespace PlayerEvent {
LOOT_ITEM,
MERCHANT_PURCHASE,
MERCHANT_SELL,
GROUP_JOIN, // unimplemented
GROUP_JOIN, // unimplemented
GROUP_LEAVE, // unimplemented
RAID_JOIN, // unimplemented
RAID_LEAVE, // unimplemented
RAID_JOIN, // unimplemented
RAID_LEAVE, // unimplemented
GROUNDSPAWN_PICKUP,
NPC_HANDIN,
SKILL_UP,
@ -45,12 +53,12 @@ namespace PlayerEvent {
COMBINE_SUCCESS,
DROPPED_ITEM,
SPLIT_MONEY,
DZ_JOIN, // unimplemented
DZ_JOIN, // unimplemented
DZ_LEAVE, // unimplemented
TRADER_PURCHASE,
TRADER_SELL,
BANDOLIER_CREATE, // unimplemented
BANDOLIER_SWAP, // unimplemented
BANDOLIER_SWAP, // unimplemented
DISCOVER_ITEM,
POSSIBLE_HACK,
KILLED_NPC,
@ -76,7 +84,7 @@ namespace PlayerEvent {
// If event is unimplemented just tag (Unimplemented) in the name
// Events don't get saved to the database if unimplemented or deprecated
// Events tagged as deprecated will get automatically removed
static const char *EventName[EventType::MAX] = {
static const char* EventName[EventType::MAX] = {
"None",
"GM Command",
"Zoning",
@ -156,8 +164,8 @@ namespace PlayerEvent {
float heading;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(account_id),
@ -185,8 +193,8 @@ namespace PlayerEvent {
PlayerEventLogsRepository::PlayerEventLogs player_event_log;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(player_event),
@ -200,8 +208,8 @@ namespace PlayerEvent {
std::string noop; // noop, gets discard upstream
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(noop)
@ -224,8 +232,38 @@ namespace PlayerEvent {
bool attuned;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
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(
CEREAL_NVP(item_id),
@ -284,8 +322,37 @@ namespace PlayerEvent {
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
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(
CEREAL_NVP(slot),
@ -295,7 +362,7 @@ namespace PlayerEvent {
CEREAL_NVP(augment_2_id),
CEREAL_NVP(augment_2_name),
CEREAL_NVP(augment_3_id),
CEREAL_NVP(augment_1_name),
CEREAL_NVP(augment_3_name),
CEREAL_NVP(augment_4_id),
CEREAL_NVP(augment_4_name),
CEREAL_NVP(augment_5_id),
@ -319,8 +386,8 @@ namespace PlayerEvent {
int32 copper;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(platinum),
@ -342,8 +409,8 @@ namespace PlayerEvent {
std::vector<TradeItemEntry> character_2_give_items;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(character_1_id),
@ -363,8 +430,8 @@ namespace PlayerEvent {
std::string target;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(message),
@ -386,8 +453,8 @@ namespace PlayerEvent {
int32 to_instance_version;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(from_zone_long_name),
@ -408,8 +475,8 @@ namespace PlayerEvent {
uint32 aa_gained;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(CEREAL_NVP(aa_gained));
}
@ -422,8 +489,8 @@ namespace PlayerEvent {
int32 aa_next_id;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(aa_id),
@ -444,9 +511,34 @@ namespace PlayerEvent {
uint32 augment_6_id;
std::string item_name;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
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(
CEREAL_NVP(item_id),
@ -471,9 +563,34 @@ namespace PlayerEvent {
uint32 augment_6_id;
std::string item_name;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
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(
CEREAL_NVP(item_id),
@ -501,9 +618,41 @@ namespace PlayerEvent {
bool attuned;
std::string reason;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
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(
CEREAL_NVP(item_id),
@ -521,14 +670,15 @@ namespace PlayerEvent {
}
};
struct LevelGainedEvent {
uint32 from_level;
uint8 to_level;
int levels_gained;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(from_level),
@ -544,8 +694,8 @@ namespace PlayerEvent {
int levels_lost;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(from_level),
@ -569,8 +719,41 @@ namespace PlayerEvent {
std::string corpse_name;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
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(
CEREAL_NVP(item_id),
@ -601,8 +784,8 @@ namespace PlayerEvent {
uint64 player_currency_balance;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(npc_id),
@ -632,8 +815,8 @@ namespace PlayerEvent {
uint64 player_currency_balance;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(npc_id),
@ -657,8 +840,8 @@ namespace PlayerEvent {
std::string against_who;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(skill_id),
@ -676,8 +859,8 @@ namespace PlayerEvent {
std::string task_name;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(npc_id),
@ -695,8 +878,8 @@ namespace PlayerEvent {
uint32 done_count;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(task_id),
@ -714,8 +897,8 @@ namespace PlayerEvent {
uint32 done_count;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(task_id),
@ -731,8 +914,8 @@ namespace PlayerEvent {
std::string item_name;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(item_id),
@ -746,8 +929,8 @@ namespace PlayerEvent {
std::string target;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(message),
@ -762,8 +945,8 @@ namespace PlayerEvent {
uint32 spell_id;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(resurrecter_name),
@ -780,8 +963,8 @@ namespace PlayerEvent {
uint32 tradeskill_id;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(recipe_id),
@ -805,8 +988,38 @@ namespace PlayerEvent {
uint32 charges;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
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(
CEREAL_NVP(item_id),
@ -833,8 +1046,8 @@ namespace PlayerEvent {
std::string skill_name;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(killer_id),
@ -856,8 +1069,8 @@ namespace PlayerEvent {
uint64 player_money_balance;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(copper),
@ -886,10 +1099,44 @@ namespace PlayerEvent {
uint64 total_cost;
uint64 player_money_balance;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
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(
CEREAL_NVP(item_id),
@ -928,10 +1175,43 @@ namespace PlayerEvent {
uint64 total_cost;
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>
void serialize(Archive &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(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(
CEREAL_NVP(item_id),
@ -958,8 +1238,8 @@ namespace PlayerEvent {
std::string item_name;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(item_id),
@ -978,8 +1258,8 @@ namespace PlayerEvent {
bool attuned;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(item_id),
@ -1000,8 +1280,8 @@ namespace PlayerEvent {
uint32 platinum;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(copper),
@ -1022,8 +1302,8 @@ namespace PlayerEvent {
bool is_quest_handin;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(npc_id),
@ -1041,8 +1321,8 @@ namespace PlayerEvent {
std::string message;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(message)
@ -1058,8 +1338,8 @@ namespace PlayerEvent {
uint64 total_heal_per_second_taken;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(npc_id),
@ -1083,9 +1363,36 @@ namespace PlayerEvent {
bool attuned;
uint32 guild_favor;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
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(
CEREAL_NVP(item_id),
@ -1095,6 +1402,8 @@ namespace PlayerEvent {
CEREAL_NVP(augment_4_id),
CEREAL_NVP(augment_5_id),
CEREAL_NVP(augment_6_id),
CEREAL_NVP(charges),
CEREAL_NVP(attuned),
CEREAL_NVP(guild_favor)
);
}
@ -1105,8 +1414,8 @@ namespace PlayerEvent {
uint32 guild_favor;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(plat),
@ -1127,9 +1436,38 @@ namespace PlayerEvent {
std::string from_player_name;
uint32 sent_date;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
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(
CEREAL_NVP(item_id),
@ -1160,9 +1498,40 @@ namespace PlayerEvent {
std::string to_player_name;
uint32 sent_date;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
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(
CEREAL_NVP(item_id),
@ -1195,9 +1564,40 @@ namespace PlayerEvent {
std::string from_name;
std::string note;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
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(
CEREAL_NVP(item_id),
@ -1226,8 +1626,8 @@ namespace PlayerEvent {
std::string seller_name;
uint64 total_cost;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(status),
@ -1251,8 +1651,8 @@ namespace PlayerEvent {
double progression;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(status),
@ -1273,8 +1673,8 @@ namespace PlayerEvent {
uint32 type;
std::string message;
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
void serialize(Archive& ar)
{
ar(
CEREAL_NVP(to),
@ -1300,9 +1700,41 @@ namespace PlayerEvent {
uint32 quantity;
uint32 permission;
// cereal
template<class Archive>
void serialize(Archive &ar)
template <class Archive>
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(
CEREAL_NVP(char_id),
@ -1314,8 +1746,9 @@ namespace PlayerEvent {
CEREAL_NVP(aug_slot_four),
CEREAL_NVP(aug_slot_five),
CEREAL_NVP(aug_slot_six),
CEREAL_NVP(quantity)
);
CEREAL_NVP(quantity),
CEREAL_NVP(permission)
);
}
};
}

View File

@ -55,7 +55,7 @@ namespace EQ {
EQ_EXCEPT("IPC Mutex", "Could not create mutex.");
}
#else
std::string final_name = fmt::format("{}/{}.lock", path.GetSharedMemoryPath(), name);
std::string final_name = fmt::format("{}/{}.lock", PathManager::Instance()->GetSharedMemoryPath(), name);
#ifdef __DARWIN
#if __DARWIN_C_LEVEL < 200809L

View File

@ -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++) {
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;

View File

@ -78,7 +78,7 @@ namespace RoF
{
//create our opcode manager if we havent already
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.
//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.
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())) {
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
return;

View File

@ -81,7 +81,7 @@ namespace RoF2
//create our opcode manager if we havent already
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.
//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.
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())) {
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
return;

View File

@ -72,7 +72,7 @@ namespace SoD
{
//create our opcode manager if we havent already
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.
//TODO: figure out how to support shared memory with multiple patches...
opcodes = new RegularOpcodeManager();
@ -113,7 +113,7 @@ namespace SoD
//we need to go to every stream and replace it's manager.
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())) {
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
return;

View File

@ -71,7 +71,7 @@ namespace SoF
{
//create our opcode manager if we havent already
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.
//TODO: figure out how to support shared memory with multiple patches...
opcodes = new RegularOpcodeManager();
@ -110,7 +110,7 @@ namespace SoF
//we need to go to every stream and replace it's manager.
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())) {
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
return;

View File

@ -73,7 +73,7 @@ namespace Titanium
auto Config = EQEmuConfig::get();
//create our opcode manager if we havent already
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.
//TODO: figure out how to support shared memory with multiple patches...
opcodes = new RegularOpcodeManager();
@ -114,7 +114,7 @@ namespace Titanium
//we need to go to every stream and replace it's manager.
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())) {
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
return;

View File

@ -76,7 +76,7 @@ namespace UF
{
//create our opcode manager if we havent already
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.
//TODO: figure out how to support shared memory with multiple patches...
opcodes = new RegularOpcodeManager();
@ -117,7 +117,7 @@ namespace UF
//we need to go to every stream and replace it's manager.
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())) {
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
return;

View File

@ -8,7 +8,7 @@
namespace fs = std::filesystem;
void PathManager::LoadPaths()
void PathManager::Init()
{
m_server_path = File::FindEqemuConfigPath();

View File

@ -7,7 +7,13 @@
class PathManager {
public:
void LoadPaths();
void Init();
static PathManager *Instance()
{
static PathManager instance;
return &instance;
}
[[nodiscard]] const std::string &GetLogPath() const;
[[nodiscard]] const std::string &GetLuaModsPath() const;
@ -38,6 +44,4 @@ private:
std::string m_shared_memory_path;
};
extern PathManager path;
#endif //EQEMU_PATH_MANAGER_H

9
common/pch/app-pch.h Normal file
View 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"

View File

@ -1,6 +1,7 @@
#include <string>
#include <memory>
#include "process.h"
#include <fmt/format.h>
std::string Process::execute(const std::string &cmd)
{

View File

@ -116,6 +116,12 @@ namespace EQ {
Reseed();
}
static Random* Instance()
{
static Random instance;
return &instance;
}
private:
#ifndef BIASED_INT_DIST
typedef std::uniform_int_distribution<int>::param_type int_param_t;

View File

@ -15,7 +15,7 @@
#include "../../database.h"
#include "../../strings.h"
#include <ctime>
#include <cereal/cereal.hpp>
class BasePlayerEventLogSettingsRepository {
public:
struct PlayerEventLogSettings {
@ -25,6 +25,20 @@ public:
int32_t retention_days;
int32_t discord_webhook_id;
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()

View File

@ -43,6 +43,47 @@ public:
* 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
static std::vector<std::string> GetRuleNames(Database &db, int rule_set_id)
{
@ -87,12 +128,28 @@ public:
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)
{
const auto query = fmt::format(
"DELETE FROM {} WHERE rule_name IN ({})",
TableName(),
Strings::ImplodePair(",", std::pair<char, char>('\'', '\''), v)
ImplodePair(",", std::pair<char, char>('\'', '\''), v)
);
return db.QueryDatabase(query).Success();
@ -103,7 +160,7 @@ public:
const auto query = fmt::format(
"REPLACE INTO {} (`ruleset_id`, `rule_name`, `rule_value`, `notes`) VALUES {}",
TableName(),
Strings::ImplodePair(
ImplodePair(
",",
std::pair<char, char>('(', ')'),
join_tuple(",", std::pair<char, char>('\'', '\''), v)

View File

@ -273,8 +273,9 @@
#define ServerOP_WWTaskUpdate 0x4758
// player events
#define ServerOP_QSSendQuery 0x5000
#define ServerOP_QSSendQuery 0x5000
#define ServerOP_PlayerEvent 0x5100
#define ServerOP_SendPlayerEventSettings 0x5101
enum {
CZUpdateType_Character,
@ -1778,6 +1779,7 @@ struct BazaarPurchaseMessaging_Struct {
uint32 id;
};
#pragma pack()
#endif

View File

@ -974,7 +974,7 @@ bool SharedDatabase::LoadItems(const std::string &prefix) {
const auto Config = EQEmuConfig::get();
EQ::IPCMutex mutex("items");
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_hash = std::make_unique<EQ::FixedMemoryHashSet<EQ::ItemData>>(static_cast<uint8*>(items_mmf->Get()), items_mmf->Size());
mutex.Unlock();
@ -1544,12 +1544,60 @@ bool SharedDatabase::GetCommandSettings(std::map<std::string, std::pair<uint8, s
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)
{
if (injected.size()) {
const std::string query = fmt::format(
"REPLACE INTO `command_settings`(`command`, `access`) VALUES {}",
Strings::ImplodePair(
ImplodePair(
",",
std::pair<char, char>('(', ')'),
join_pair(",", std::pair<char, char>('\'', '\''), injected)
@ -1576,7 +1624,7 @@ bool SharedDatabase::UpdateOrphanedCommandSettings(const std::vector<std::string
if (orphaned.size()) {
std::string query = fmt::format(
"DELETE FROM `command_settings` WHERE `command` IN ({})",
Strings::ImplodePair(",", std::pair<char, char>('\'', '\''), orphaned)
ImplodePair(",", std::pair<char, char>('\'', '\''), orphaned)
);
auto results = QueryDatabase(query);
@ -1586,7 +1634,7 @@ bool SharedDatabase::UpdateOrphanedCommandSettings(const std::vector<std::string
query = fmt::format(
"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);
@ -1665,7 +1713,7 @@ bool SharedDatabase::LoadSpells(const std::string &prefix, int32 *records, const
EQ::IPCMutex mutex("spells");
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);
LogInfo("Loading [{}]", file_name);
*records = *static_cast<uint32*>(spells_mmf->Get());

View File

@ -16,12 +16,16 @@ public:
static int32_t GetSkillCapMaxLevel(uint8 class_id, EQ::skills::SkillType skill_id);
SkillCaps *SetContentDatabase(Database *db);
static SkillCaps* Instance()
{
static SkillCaps instance;
return &instance;
}
private:
Database *m_content_database{};
std::map<uint64, SkillCapsRepository::SkillCaps> m_skill_caps = {};
};
extern SkillCaps skill_caps;
#endif //CODE_SKILL_CAPS_H

View File

@ -34,6 +34,7 @@
*/
#include "strings.h"
#include <cereal/external/rapidjson/document.h>
#include <fmt/format.h>
#include <algorithm>
#include <cctype>
@ -41,6 +42,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <sstream>
#include <random>
#include <string>
@ -49,6 +51,12 @@
#include "strings_legacy.cpp" // legacy c functions
#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)
{
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);
}
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
std::string Strings::ConvertToDigit(int n, const std::string& suffix)
{

View File

@ -36,53 +36,19 @@
#define _STRINGUTIL_H_
#include <charconv>
#include <sstream>
#include <string.h>
#include <cstring>
#include <string_view>
#include <string>
#include <vector>
#include <cstdarg>
#include <tuple>
#include <type_traits>
#include <fmt/format.h>
#include <cereal/external/rapidjson/document.h>
#ifndef _WIN32
// this doesn't appear to affect linux-based systems..need feedback for _WIN64
#endif
#ifdef _WINDOWS
#ifdef _WIN32
#include <ctype.h>
#include <functional>
#include <algorithm>
#endif
#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 {
public:
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 EndsWith(const std::string& subject, const std::string& search);
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 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.
// 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
std::string SanitizeWorldServerName(std::string server_long_name);
std::vector<std::string> GetBadWords();
@ -310,18 +134,4 @@ std::string FormatName(const std::string &char_name);
bool IsAllowedWorldServerCharacterList(char c);
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

View File

@ -42,7 +42,7 @@
* 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 CUSTOM_BINARY_DATABASE_VERSION 0

View File

@ -104,36 +104,39 @@ public:
uint8 GetZoneIdleWhenEmpty(uint32 zone_id, int version = 0);
uint32 GetZoneSecondsBeforeIdle(uint32 zone_id, int version = 0);
static ZoneStore* Instance()
{
static ZoneStore instance;
return &instance;
}
private:
std::vector<ZoneRepository::Zone> m_zones;
};
extern ZoneStore zone_store;
/**
* Global helpers
*/
inline uint32 ZoneID(const char *in_zone_name) { return zone_store.GetZoneID(in_zone_name); }
inline uint32 ZoneID(const std::string& zone_name) { return zone_store.GetZoneID(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 ZoneStore::Instance()->GetZoneID(zone_name); }
inline const char *ZoneName(uint32 zone_id, bool error_unknown = false)
{
return zone_store.GetZoneName(
return ZoneStore::Instance()->GetZoneName(
zone_id,
error_unknown
);
}
inline const char *ZoneLongName(uint32 zone_id, bool error_unknown = false)
{
return zone_store.GetZoneLongName(
return ZoneStore::Instance()->GetZoneLongName(
zone_id,
error_unknown
);
}
inline ZoneRepository::Zone *GetZone(uint32 zone_id, int version = 0) { return zone_store.GetZone(zone_id, version); };
inline ZoneRepository::Zone *GetZone(const char *in_zone_name) { return zone_store.GetZone(in_zone_name); };
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 ZoneStore::Instance()->GetZone(in_zone_name); };
inline ZoneRepository::Zone *GetZone(const char *in_zone_name, int version = 0)
{
return zone_store.GetZone(
return ZoneStore::Instance()->GetZone(
ZoneID(
in_zone_name
), 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)
{
return zone_store.GetZoneWithFallback(
return ZoneStore::Instance()->GetZoneWithFallback(
zone_id,
version
);

View File

@ -34,7 +34,6 @@
#include <time.h>
EQEmuLogSys LogSys;
PathManager path;
bool RunLoops = false;
@ -45,7 +44,7 @@ int main(int argc, char *argv[]) {
LogSys.LoadLogSettingsDefaults();
set_exception_handler();
path.LoadPaths();
PathManager::Instance()->Init();
std::string launcher_name;
if(argc == 2) {

View File

@ -94,7 +94,7 @@ ClientManager::ClientManager()
std::string opcodes_path = fmt::format(
"{}/{}",
path.GetOpcodePath(),
PathManager::Instance()->GetOpcodePath(),
"login_opcodes.conf"
);
@ -131,7 +131,7 @@ ClientManager::ClientManager()
opcodes_path = fmt::format(
"{}/{}",
path.GetOpcodePath(),
PathManager::Instance()->GetOpcodePath(),
"login_opcodes_sod.conf"
);
@ -169,7 +169,7 @@ ClientManager::ClientManager()
opcodes_path = fmt::format(
"{}/{}",
path.GetOpcodePath(),
PathManager::Instance()->GetOpcodePath(),
"login_opcodes_larion.conf"
);

View File

@ -24,10 +24,8 @@
LoginServer server;
EQEmuLogSys LogSys;
bool run_server = true;
PathManager path;
Database database;
PlayerEventLogs player_event_logs;
ZoneStore zone_store;
void CatchSignal(int sig_num)
{
@ -52,7 +50,7 @@ void LoadDatabaseConnection()
void LoadServerConfig()
{
server.config = EQ::JsonConfigFile::Load(
fmt::format("{}/login.json", path.GetServerPath())
fmt::format("{}/login.json", PathManager::Instance()->GetServerPath())
);
LogInfo("Config System Init");
@ -162,7 +160,7 @@ int main(int argc, char **argv)
LogSys.LoadLogSettingsDefaults();
}
path.LoadPaths();
PathManager::Instance()->Init();
// command handler
if (argc > 1) {

View File

@ -31,8 +31,6 @@ std::string WorldShortName;
const queryservconfig *Config;
WorldServer *worldserver = 0;
EQEmuLogSys LogSys;
PathManager path;
ZoneStore zone_store;
PlayerEventLogs player_event_logs;
ZSList zs_list;
uint32 numzones = 0;
@ -50,7 +48,7 @@ int main()
set_exception_handler();
Timer LFGuildExpireTimer(60000);
path.LoadPaths();
PathManager::Instance()->Init();
LogInfo("Starting EQEmu QueryServ");
if (!queryservconfig::LoadConfig()) {
@ -86,7 +84,7 @@ int main()
}
LogSys.SetDatabase(&database)
->SetLogPath(path.GetLogPath())
->SetLogPath(PathManager::Instance()->GetLogPath())
->LoadLogDatabaseSettings()
->StartFileLogs();

View File

@ -21,10 +21,13 @@
#include <string.h>
#include <time.h>
#include "zonelist.h"
extern WorldServer worldserver;
extern const queryservconfig *Config;
extern QSDatabase qs_database;
extern LFGuildManager lfguildmanager;
extern ZSList zs_list;
WorldServer::WorldServer()
{
@ -78,6 +81,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
if (o->type == ServerReload::Type::Logs) {
LogSys.LoadLogDatabaseSettings();
player_event_logs.ReloadSettings();
zs_list.SendPlayerEventLogSettings();
}
break;

View File

@ -5,6 +5,8 @@
void ZSList::Add(ZoneServer* zoneserver) {
zone_server_list.emplace_back(std::unique_ptr<ZoneServer>(zoneserver));
zoneserver->SetIsZoneConnected(true);
zoneserver->SendPlayerEventLogSettings();
}
void ZSList::Remove(const std::string &uuid)
@ -18,3 +20,10 @@ void ZSList::Remove(const std::string &uuid)
iter++;
}
}
void ZSList::SendPlayerEventLogSettings()
{
for (auto &zs : zone_server_list) {
zs->SendPlayerEventLogSettings();
}
}

View File

@ -12,9 +12,10 @@ class ZoneServer;
class ZSList {
public:
std::list<std::unique_ptr<ZoneServer>> &GetZsList() { return zone_server_list; }
void Add(ZoneServer *zoneserver);
void Remove(const std::string &uuid);
std::list<std::unique_ptr<ZoneServer>>& GetZsList() { return zone_server_list; }
void Add(ZoneServer* zoneserver);
void Remove(const std::string& uuid);
void SendPlayerEventLogSettings();
private:
std::list<std::unique_ptr<ZoneServer>> zone_server_list;

View File

@ -7,6 +7,7 @@
extern DiscordManager discord_manager;
ZoneServer::ZoneServer(
std::shared_ptr<EQ::Net::ServertalkServerConnection> in_connection,
EQ::Net::ConsoleServer *in_console
@ -46,3 +47,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());
}

View File

@ -16,11 +16,12 @@ class ZoneServer : public WorldTCPConnection {
public:
ZoneServer(std::shared_ptr<EQ::Net::ServertalkServerConnection> in_connection, EQ::Net::ConsoleServer *in_console);
~ZoneServer();
void SendPacket(ServerPacket *pack) { m_connection->SendPacket(pack); }
void SetIsZoneConnected(bool in) { m_is_zone_connected = in; }
bool GetIsZoneConnected() { return m_is_zone_connected; }
void HandleMessage(uint16 opcode, const EQ::Net::Packet &p);
void SendPacket(ServerPacket *pack) { m_connection->SendPacket(pack); }
void SetIsZoneConnected(bool in) { m_is_zone_connected = in; }
bool GetIsZoneConnected() { return m_is_zone_connected; }
void HandleMessage(uint16 opcode, const EQ::Net::Packet &p);
std::string GetUUID() const { return m_connection->GetUUID(); }
void SendPlayerEventLogSettings();
private:
std::shared_ptr<EQ::Net::ServertalkServerConnection> m_connection{};

View File

@ -37,8 +37,6 @@
EQEmuLogSys LogSys;
WorldContentService content_service;
ZoneStore zone_store;
PathManager path;
PlayerEventLogs player_event_logs;
EvolvingItemsManager evolving_items_manager;
@ -84,7 +82,7 @@ int main(int argc, char **argv)
LogSys.LoadLogSettingsDefaults();
set_exception_handler();
path.LoadPaths();
PathManager::Instance()->Init();
LogInfo("Shared Memory Loader Program");
if (!EQEmuConfig::LoadConfig()) {
@ -127,7 +125,7 @@ int main(int argc, char **argv)
}
LogSys.SetDatabase(&database)
->SetLogPath(path.GetLogPath())
->SetLogPath(PathManager::Instance()->GetLogPath())
->LoadLogDatabaseSettings()
->StartFileLogs();

View File

@ -35,13 +35,12 @@
const EQEmuConfig *Config;
EQEmuLogSys LogSys;
PathManager path;
int main()
{
RegisterExecutablePlatform(ExePlatformClientImport);
LogSys.LoadLogSettingsDefaults();
path.LoadPaths();
PathManager::Instance()->Init();
auto ConfigLoadResult = EQEmuConfig::LoadConfig();
Config = EQEmuConfig::get();

View File

@ -30,7 +30,6 @@ public:
TEST_ADD(StringUtilTest::EscapeStringTest);
TEST_ADD(StringUtilTest::SearchDeliminatedStringTest);
TEST_ADD(StringUtilTest::SplitStringTest);
TEST_ADD(StringUtilTest::FromCharsTest);
TEST_ADD(StringUtilTest::TestIsFloat);
TEST_ADD(StringUtilTest::TestIsNumber);
}
@ -108,21 +107,6 @@ public:
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() {
TEST_ASSERT_EQUALS(Strings::IsFloat("0.23424523"), true);
TEST_ASSERT_EQUALS(Strings::IsFloat("12312312313.23424523"), true);

View File

@ -482,7 +482,7 @@ Clientlist::Clientlist(int ChatPort) {
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);
if (!ChatOpMgr->LoadOpcodes(opcodes_file.c_str()))

View File

@ -48,8 +48,6 @@ EQEmuLogSys LogSys;
UCSDatabase database;
WorldServer *worldserver = nullptr;
DiscordManager discord_manager;
PathManager path;
ZoneStore zone_store;
PlayerEventLogs player_event_logs;
const ucsconfig *Config;
@ -107,7 +105,7 @@ int main() {
LogSys.LoadLogSettingsDefaults();
set_exception_handler();
path.LoadPaths();
PathManager::Instance()->Init();
// Check every minute for unused channels we can delete
//
@ -140,7 +138,7 @@ int main() {
}
LogSys.SetDatabase(&database)
->SetLogPath(path.GetLogPath())
->SetLogPath(PathManager::Instance()->GetLogPath())
->LoadLogDatabaseSettings()
->StartFileLogs();

View File

@ -1,6 +1,8 @@
module should-release
go 1.18
go 1.23.0
toolchain go1.23.5
require (
github.com/google/go-github/v41 v41.0.0

View File

@ -114,7 +114,8 @@ if ($requested_table_to_generate ne "all") {
my @cereal_enabled_tables = (
"data_buckets",
"player_event_logs"
"player_event_logs",
"player_event_log_settings"
);
my $generated_base_repository_files = "";

View File

@ -7,6 +7,7 @@ SET(world_sources
cliententry.cpp
clientlist.cpp
console.cpp
../common/data_bucket.cpp
dynamic_zone.cpp
dynamic_zone_manager.cpp
eql_config.cpp
@ -42,6 +43,7 @@ SET(world_headers
cliententry.h
clientlist.h
console.h
../common/data_bucket.h
dynamic_zone.h
dynamic_zone_manager.h
eql_config.h
@ -75,7 +77,7 @@ ADD_EXECUTABLE(world ${world_sources} ${world_headers})
INSTALL(TARGETS world RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
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 ()
ADD_DEFINITIONS(-DWORLD)

View File

@ -18,7 +18,6 @@
extern ZSList zoneserver_list;
extern ClientList client_list;
extern AdventureManager adventure_manager;
extern EQ::Random emu_random;
Adventure::Adventure(AdventureTemplate *t)
{
@ -368,8 +367,8 @@ void Adventure::MoveCorpsesToGraveyard()
glm::vec4 position;
float x = GetTemplate()->graveyard_x + emu_random.Real(-GetTemplate()->graveyard_radius, GetTemplate()->graveyard_radius);
float y = GetTemplate()->graveyard_y + 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 + EQ::Random::Instance()->Real(-GetTemplate()->graveyard_radius, GetTemplate()->graveyard_radius);
float z = GetTemplate()->graveyard_z;
position.x = x;

View File

@ -16,7 +16,6 @@
extern ZSList zoneserver_list;
extern ClientList client_list;
extern EQ::Random emu_random;
AdventureManager::AdventureManager()
{
@ -324,7 +323,7 @@ void AdventureManager::CalculateAdventureRequestReply(const char *data)
if(eligible_adventures.size() > 0)
{
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)
{
++ea_iter;

View File

@ -91,7 +91,6 @@ std::vector<RaceClassCombos> character_create_race_class_combos;
extern ZSList zoneserver_list;
extern LoginServerList loginserverlist;
extern ClientList client_list;
extern EQ::Random emu_random;
extern uint32 numclients;
extern volatile bool RunLoops;
extern volatile bool UCSServerAvailable_;
@ -984,7 +983,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
safe_delete(outapp);
// 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);
if (UCSServerAvailable_) {
@ -2171,7 +2170,7 @@ void Client::SetClassStartingSkills(PlayerProfile_Struct *pp)
i == EQ::skills::SkillAlcoholTolerance || i == EQ::skills::SkillBindWound)
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 +2368,7 @@ bool Client::StoreCharacter(
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")) {
p_player_profile_struct->zone_id = Zones::QEYNOS;
}

View File

@ -1219,7 +1219,7 @@ void ConsoleCrossZoneMove(
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 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) {
connection->SendLine(fmt::format("No zone with the short name '{}' exists.", zone_short_name));
@ -1289,7 +1289,7 @@ void ConsoleWorldWideMove(
const auto& zone_short_name = !Strings::IsNumber(args[2]) ? args[2] : "";
const 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) {
connection->SendLine(fmt::format("No zone with the short name '{}' exists.", zone_short_name));
@ -1330,6 +1330,42 @@ void ConsoleWorldWideMove(
);
}
void ConsoleWWMarquee(
EQ::Net::ConsoleServerConnection* connection,
const std::string& command,
const std::vector<std::string>& args
)
{
if (args.size() < 2) {
connection->SendLine("Usage: wwmarquee <type> <message>");
return;
}
const uint32 type = Strings::IsNumber(args[0]) ? Strings::ToUnsignedInt(args[0]) : 0;
std::string message = Strings::Join(std::vector<std::string>(args.begin() + 1, args.end()), " ");
if (message.empty()) {
connection->SendLine("Message cannot be empty.");
return;
}
auto pack = new ServerPacket(ServerOP_WWMarquee, sizeof(WWMarquee_Struct));
auto* wwm = (WWMarquee_Struct*)pack->pBuffer;
wwm->type = type;
wwm->priority = 510;
wwm->fade_in = 0;
wwm->fade_out = 0;
wwm->duration = 5000;
wwm->min_status = AccountStatus::Player;
wwm->max_status = AccountStatus::Player;
strn0cpy(wwm->message, message.c_str(), sizeof(wwm->message));
zoneserver_list.SendPacket(pack);
safe_delete(pack);
connection->SendLine(fmt::format("Sent world marquee type {}: {}", type, message));
}
/**
* @param console
@ -1367,6 +1403,12 @@ void RegisterConsoleFunctions(std::unique_ptr<EQ::Net::ConsoleServer>& console)
console->RegisterCall("whoami", 50, "whoami", std::bind(ConsoleWhoami, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
console->RegisterCall("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(
"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("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));

View File

@ -91,8 +91,6 @@
#include "../common/repositories/character_parcels_repository.h"
#include "../common/ip_util.h"
SkillCaps skill_caps;
ZoneStore zone_store;
ClientList client_list;
GroupLFPList LFPGroupList;
ZSList zoneserver_list;
@ -103,7 +101,6 @@ LauncherList launcher_list;
AdventureManager adventure_manager;
WorldEventScheduler event_scheduler;
SharedTaskManager shared_task_manager;
EQ::Random emu_random;
volatile bool RunLoops = true;
uint32 numclients = 0;
uint32 numzones = 0;
@ -111,7 +108,6 @@ const WorldConfig *Config;
EQEmuLogSys LogSys;
WorldContentService content_service;
WebInterfaceList web_interface;
PathManager path;
PlayerEventLogs player_event_logs;
EvolvingItemsManager evolving_items_manager;
@ -142,7 +138,7 @@ int main(int argc, char **argv)
return 0;
}
path.LoadPaths();
PathManager::Instance()->Init();
if (!WorldBoot::LoadServerConfig()) {
return 0;
@ -207,7 +203,7 @@ int main(int argc, char **argv)
->SetExpansionContext()
->ReloadContentFlags();
skill_caps.SetContentDatabase(&content_db)->LoadSkillCaps();
SkillCaps::Instance()->SetContentDatabase(&content_db)->LoadSkillCaps();
std::unique_ptr<EQ::Net::ServertalkServer> server_connection;
server_connection = std::make_unique<EQ::Net::ServertalkServer>();

View File

@ -84,7 +84,7 @@ bool WorldBoot::HandleCommandInput(int argc, char **argv)
// command handler
if (argc > 1) {
LogSys.SilenceConsoleLogging();
path.LoadPaths();
PathManager::Instance()->Init();
WorldConfig::LoadConfig();
LoadDatabaseConnections();
RuleManager::Instance()->LoadRules(&database, "default", false);
@ -234,7 +234,7 @@ bool WorldBoot::DatabaseLoadRoutines(int argc, char **argv)
{
// logging system init
auto logging = LogSys.SetDatabase(&database)
->SetLogPath(path.GetLogPath())
->SetLogPath(PathManager::Instance()->GetLogPath())
->LoadLogDatabaseSettings();
LogSys.SetDiscordHandler(&WorldBoot::DiscordWebhookMessageHandler);
@ -279,9 +279,9 @@ bool WorldBoot::DatabaseLoadRoutines(int argc, char **argv)
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");
return 1;
}

View File

@ -37,14 +37,15 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "dynamic_zone_manager.h"
#include "ucs.h"
#include "clientlist.h"
#include "queryserv.h"
#include "../common/repositories/trader_repository.h"
#include "../common/repositories/buyer_repository.h"
extern uint32 numzones;
extern EQ::Random emu_random;
extern WebInterfaceList web_interface;
extern SharedTaskManager shared_task_manager;
extern ClientList client_list;
extern QueryServConnection QSLink;
volatile bool UCSServerAvailable_ = false;
void CatchSignal(int sig_num);
@ -694,7 +695,7 @@ void ZSList::RebootZone(const char* ip1, uint16 port, const char* ip2, uint32 sk
safe_delete_array(tmp);
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));
ServerZoneReboot_Struct* s = (ServerZoneReboot_Struct*)pack->pBuffer;
@ -978,13 +979,14 @@ void ZSList::SendServerReload(ServerReload::Type type, uchar *packet)
} else if (type == ServerReload::Type::Rules) {
RuleManager::Instance()->LoadRules(&database, RuleManager::Instance()->GetActiveRuleset(), true);
} else if (type == ServerReload::Type::SkillCaps) {
skill_caps.ReloadSkillCaps();
SkillCaps::Instance()->ReloadSkillCaps();
} else if (type == ServerReload::Type::ContentFlags) {
content_service.SetExpansionContext()->ReloadContentFlags();
} else if (type == ServerReload::Type::Logs) {
LogSys.LoadLogDatabaseSettings();
player_event_logs.ReloadSettings();
UCSLink.SendPacket(&pack);
QSLink.SendPacket(&pack);
} else if (type == ServerReload::Type::Tasks) {
shared_task_manager.LoadTaskData();
} else if (type == ServerReload::Type::DzTemplates) {

View File

@ -46,7 +46,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "../common/repositories/player_event_logs_repository.h"
#include "../common/events/player_event_logs.h"
#include "../common/patches/patches.h"
#include "../zone/data_bucket.h"
#include "../common/repositories/guild_tributes_repository.h"
#include "../common/skill_caps.h"
#include "../common/server_reload_types.h"

View File

@ -12,7 +12,6 @@ SET(zone_sources
bonuses.cpp
bot.cpp
bot_raid.cpp
bot_command.cpp
bot_database.cpp
botspellsai.cpp
cheat_manager.cpp
@ -23,9 +22,8 @@ SET(zone_sources
client_packet.cpp
client_process.cpp
combat_record.cpp
command.cpp
corpse.cpp
data_bucket.cpp
../common/data_bucket.cpp
doors.cpp
dialogue_window.cpp
dynamic_zone.cpp
@ -48,36 +46,6 @@ SET(zone_sources
horse.cpp
inventory.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
entity.cpp
exp.cpp
@ -108,30 +76,6 @@ SET(zone_sources
pathfinder_nav_mesh.cpp
pathfinder_null.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
pets.cpp
position.cpp
@ -195,7 +139,7 @@ SET(zone_headers
command.h
common.h
corpse.h
data_bucket.h
../common/data_bucket.h
doors.h
dialogue_window.h
dynamic_zone.h
@ -296,18 +240,268 @@ SET(zone_headers
zone_save_state.h
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})
# binary output directory
INSTALL(TARGETS zone RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
IF (WIN32 AND EQEMU_BUILD_PCH)
TARGET_PRECOMPILE_HEADERS(zone PRIVATE ../common/pch/pch.h)
TARGET_PRECOMPILE_HEADERS(zone PRIVATE ../common/types.h ../common/eqemu_logsys.h ../common/eqemu_logsys_log_aliases.h ../common/features.h ../common/global_define.h)
TARGET_PRECOMPILE_HEADERS(zone PRIVATE mob.h npc.h corpse.h doors.h bot.h entity.h client.h zone.h)
# precompiled headers
IF (EQEMU_BUILD_PCH)
TARGET_PRECOMPILE_HEADERS(zone PRIVATE ../common/pch/app-pch.h)
TARGET_PRECOMPILE_HEADERS(zone PRIVATE ./pch/pch.h)
ENDIF()
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)

View File

@ -2683,7 +2683,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
give_exp_client->GetCleanName(),
GetNPCTypeID()
);
task_manager->HandleUpdateTasksOnKill(give_exp_client, this);
TaskManager::Instance()->HandleUpdateTasksOnKill(give_exp_client, this);
}
if (killer_raid) {

View File

@ -1242,7 +1242,7 @@ uint16 Bot::GetPrimarySkillValue() {
}
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() {
@ -3575,7 +3575,7 @@ void Bot::Depop() {
RemoveAllAuras();
Mob* bot_pet = GetPet();
if (bot_pet) {
if (bot_pet->Charmed()) {
bot_pet->BuffFadeByEffect(SE_Charm);
@ -3640,7 +3640,7 @@ bool Bot::Spawn(Client* botCharacterOwner) {
entity_list.AddBot(this, true, true);
ClearDataBucketCache();
DataBucket::GetDataBuckets(this);
LoadDataBucketsCache();
LoadBotSpellSettings();
if (!AI_AddBotSpells(GetBotSpellID())) {
GetBotOwner()->CastToClient()->Message(
@ -7342,7 +7342,7 @@ void Bot::CalcBotStats(bool showtext) {
SetLevel(GetBotOwner()->GetLevel());
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);
@ -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> cast_order;
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; i++) {
BotSpellTypeOrder typeSettings = {
.spellType = i,
@ -13463,4 +13463,4 @@ bool Bot::HasControllablePet(uint8 ranks_required) {
return GetClass() != Class::Enchanter ||
GetPet()->GetPetType() != petAnimation ||
GetAA(aaAnimationEmpathy) >= ranks_required;
}
}

View File

@ -63,7 +63,6 @@
extern QueryServ* QServ;
extern WorldServer worldserver;
extern TaskManager *task_manager;
int bot_command_count;
@ -165,7 +164,7 @@ int bot_command_init(void)
bot_command_add("inventoryremove", "Removes an item from a bot's inventory", AccountStatus::Player, bot_command_inventory_remove) ||
bot_command_add("inventorywindow", "Displays all items in a bot's inventory in a pop-up window", AccountStatus::Player, bot_command_inventory_window) ||
bot_command_add("itemuse", "Elicits a report from spawned bots that can use the item on your cursor (option 'empty' yields only empty slots)", AccountStatus::Player, bot_command_item_use) ||
bot_command_add("maxmeleerange", "Toggles whether your bot is at max melee range or not. This will disable all special abilities, including taunt.", AccountStatus::Player, bot_command_max_melee_range) ||
bot_command_add("maxmeleerange", "Toggles whether your bot is at max melee range or not. This will disable all special abilities, including taunt.", AccountStatus::Player, bot_command_max_melee_range) ||
bot_command_add("owneroption", "Sets options available to bot owners", AccountStatus::Player, bot_command_owner_option) ||
bot_command_add("pet", "Lists the available bot pet [subcommands]", AccountStatus::Player, bot_command_pet) ||
bot_command_add("petgetlost", "Orders a bot to remove its summoned pet", AccountStatus::Player, bot_command_pet_get_lost) ||
@ -189,11 +188,11 @@ int bot_command_init(void)
bot_command_add("spellmaxhppct", "Controls at what HP percent a bot will stop casting different spell types", AccountStatus::Player, bot_command_spell_max_hp_pct) ||
bot_command_add("spellmaxmanapct", "Controls at what mana percent a bot will stop casting different spell types", AccountStatus::Player, bot_command_spell_max_mana_pct) ||
bot_command_add("spellmaxthresholds", "Controls the minimum target HP threshold for a spell to be cast for a specific type", AccountStatus::Player, bot_command_spell_max_thresholds) ||
bot_command_add("spellminhppct", "Controls at what HP percent a bot will start casting different spell types", AccountStatus::Player, bot_command_spell_min_hp_pct) ||
bot_command_add("spellminhppct", "Controls at what HP percent a bot will start casting different spell types", AccountStatus::Player, bot_command_spell_min_hp_pct) ||
bot_command_add("spellminmanapct", "Controls at what mana percent a bot will start casting different spell types", AccountStatus::Player, bot_command_spell_min_mana_pct) ||
bot_command_add("spellminthresholds", "Controls the maximum target HP threshold for a spell to be cast for a specific type", AccountStatus::Player, bot_command_spell_min_thresholds) ||
bot_command_add("spellminthresholds", "Controls the maximum target HP threshold for a spell to be cast for a specific type", AccountStatus::Player, bot_command_spell_min_thresholds) ||
bot_command_add("spellresistlimits", "Controls the resist limits for bots to cast spells on their target", AccountStatus::Player, bot_command_spell_resist_limits) ||
bot_command_add("spellpursuepriority", "Controls the order of casts by spell type when pursuing in combat", AccountStatus::Player, bot_command_spell_pursue_priority) ||
bot_command_add("spellpursuepriority", "Controls the order of casts by spell type when pursuing in combat", AccountStatus::Player, bot_command_spell_pursue_priority) ||
bot_command_add("spelltargetcount", "Sets the required target amount for group/AE spells by spell type", AccountStatus::Player, bot_command_spell_target_count) ||
bot_command_add("spellinfo", "Opens a dialogue window with spell info", AccountStatus::Player, bot_spell_info_dialogue_window) ||
bot_command_add("spells", "Lists all Spells learned by the Bot.", AccountStatus::Player, bot_command_spell_list) ||

View File

@ -74,13 +74,61 @@ bool BotDatabase::LoadBotCommandSettings(std::map<std::string, std::pair<uint8,
return true;
}
template<typename T1, typename T2>
inline std::vector<std::string> join_pair(
const std::string &glue,
const std::pair<char, char> &encapsulation,
const std::vector<std::pair<T1, T2>> &src
)
{
if (src.empty()) {
return {};
}
std::vector<std::string> output;
for (const std::pair<T1, T2> &src_iter: src) {
output.emplace_back(
fmt::format(
"{}{}{}{}{}{}{}",
encapsulation.first,
src_iter.first,
encapsulation.second,
glue,
encapsulation.first,
src_iter.second,
encapsulation.second
)
);
}
return output;
}
template<typename T>
inline std::string
ImplodePair(const std::string &glue, const std::pair<char, char> &encapsulation, const std::vector<T> &src)
{
if (src.empty()) {
return {};
}
std::ostringstream oss;
for (const T &src_iter: src) {
oss << encapsulation.first << src_iter << encapsulation.second << glue;
}
std::string output(oss.str());
output.resize(output.size() - glue.size());
return output;
}
bool BotDatabase::UpdateInjectedBotCommandSettings(const std::vector<std::pair<std::string, uint8>> &injected)
{
if (injected.size()) {
query = fmt::format(
"REPLACE INTO `bot_command_settings`(`bot_command`, `access`) VALUES {}",
Strings::ImplodePair(
ImplodePair(
",",
std::pair<char, char>('(', ')'),
join_pair(",", std::pair<char, char>('\'', '\''), injected)
@ -107,7 +155,7 @@ bool BotDatabase::UpdateOrphanedBotCommandSettings(const std::vector<std::string
query = fmt::format(
"DELETE FROM `bot_command_settings` WHERE `bot_command` IN ({})",
Strings::ImplodePair(",", std::pair<char, char>('\'', '\''), orphaned)
ImplodePair(",", std::pair<char, char>('\'', '\''), orphaned)
);
if (!database.QueryDatabase(query).Success()) {
@ -248,7 +296,7 @@ bool BotDatabase::LoadBotsList(const uint32 owner_id, std::list<BotsAvailableLis
SELECT `account_id` FROM `character_data` WHERE `id` = {}
)
)
AND
AND
`name` NOT LIKE '%-deleted-%'
),
owner_id
@ -2226,7 +2274,7 @@ bool BotDatabase::LoadBotSettings(Mob* m)
else {
query = fmt::format("`bot_id` = {} AND `stance` = {}", mob_id, stance_id);
}
if (stance_id == Stance::Passive) {
LogBotSettings("{} is currently set to {} [#{}]. No saving or loading required.", m->GetCleanName(), Stance::GetName(Stance::Passive), Stance::Passive);
return true;
@ -2278,7 +2326,7 @@ bool BotDatabase::SaveBotSettings(Mob* m)
if (!m->IsOfClientBot()) {
return false;
}
uint32 bot_id = (m->IsBot() ? m->CastToBot()->GetBotID() : 0);
uint32 character_id = (m->IsClient() ? m->CastToClient()->CharacterID() : 0);
uint8 stance_id = (m->IsBot() ? m->CastToBot()->GetBotStance() : 0);
@ -2289,10 +2337,10 @@ bool BotDatabase::SaveBotSettings(Mob* m)
}
std::string query = "";
if (m->IsClient()) {
query = fmt::format("`character_id` = {} AND `stance` = {}", character_id, stance_id);
}
}
else {
query = fmt::format("`bot_id` = {} AND `stance` = {}", bot_id, stance_id);
}

View File

@ -5,7 +5,7 @@
#include "../../common/eqemu_logsys.h"
#include "../sidecar_api/sidecar_api.h"
#include "../../common/platform.h"
#include "../data_bucket.h"
#include "../../common/data_bucket.h"
#include "../zonedb.h"
#include "../../common/repositories/data_buckets_repository.h"

View File

@ -1,4 +1,3 @@
#include "../../common/http/httplib.h"
#include "../../common/eqemu_logsys.h"
#include "../../common/platform.h"
#include "../../zone.h"

View File

@ -39,7 +39,7 @@ extern volatile bool RunLoops;
#include "../common/strings.h"
#include "../common/data_verification.h"
#include "../common/profanity_manager.h"
#include "data_bucket.h"
#include "../common/data_bucket.h"
#include "dynamic_zone.h"
#include "expedition_request.h"
#include "position.h"
@ -3197,7 +3197,7 @@ bool Client::CanHaveSkill(EQ::skills::SkillType skill_id) const
skill_id = EQ::skills::Skill2HPiercing;
}
return skill_caps.GetSkillCap(GetClass(), skill_id, RuleI(Character, MaxLevel)).cap > 0;
return SkillCaps::Instance()->GetSkillCap(GetClass(), skill_id, RuleI(Character, MaxLevel)).cap > 0;
}
uint16 Client::MaxSkill(EQ::skills::SkillType skill_id, uint8 class_id, uint8 level) const
@ -3210,7 +3210,7 @@ uint16 Client::MaxSkill(EQ::skills::SkillType skill_id, uint8 class_id, uint8 le
skill_id = EQ::skills::Skill2HPiercing;
}
return skill_caps.GetSkillCap(class_id, skill_id, level).cap;
return SkillCaps::Instance()->GetSkillCap(class_id, skill_id, level).cap;
}
uint8 Client::GetSkillTrainLevel(EQ::skills::SkillType skill_id, uint8 class_id)
@ -3223,7 +3223,7 @@ uint8 Client::GetSkillTrainLevel(EQ::skills::SkillType skill_id, uint8 class_id)
skill_id = EQ::skills::Skill2HPiercing;
}
return skill_caps.GetSkillTrainLevel(class_id, skill_id, RuleI(Character, MaxLevel));
return SkillCaps::Instance()->GetSkillTrainLevel(class_id, skill_id, RuleI(Character, MaxLevel));
}
uint16 Client::GetMaxSkillAfterSpecializationRules(EQ::skills::SkillType skillid, uint16 maxSkill)
@ -12100,7 +12100,7 @@ void Client::MaxSkills()
auto current_skill_value = (
EQ::skills::IsSpecializedSkill(s.first) ?
MAX_SPECIALIZED_SKILL :
skill_caps.GetSkillCap(GetClass(), s.first, GetLevel()).cap
SkillCaps::Instance()->GetSkillCap(GetClass(), s.first, GetLevel()).cap
);
if (GetSkill(s.first) < current_skill_value) {

View File

@ -98,7 +98,6 @@ namespace EQ
#define MAX_SPECIALIZED_SKILL 50
extern Zone* zone;
extern TaskManager *task_manager;
class CLIENTPACKET
{
@ -1359,7 +1358,7 @@ public:
}
inline bool SaveTaskState()
{
return task_manager != nullptr && task_manager->SaveClientState(this, task_state);
return TaskManager::Instance()->SaveClientState(this, task_state);
}
inline bool IsTaskStateLoaded() { return task_state != nullptr; }
inline bool IsTaskActive(int task_id) { return task_state != nullptr && task_state->IsTaskActive(task_id); }
@ -1433,14 +1432,14 @@ public:
}
inline void TaskSetSelector(Mob* mob, int task_set_id, bool ignore_cooldown)
{
if (task_manager && task_state) {
task_manager->TaskSetSelector(this, mob, task_set_id, ignore_cooldown);
if (task_state) {
TaskManager::Instance()->TaskSetSelector(this, mob, task_set_id, ignore_cooldown);
}
}
inline void TaskQuestSetSelector(Mob* mob, const std::vector<int>& tasks, bool ignore_cooldown)
{
if (task_manager && task_state) {
task_manager->TaskQuestSetSelector(this, mob, tasks, ignore_cooldown);
if (task_state) {
TaskManager::Instance()->TaskQuestSetSelector(this, mob, tasks, ignore_cooldown);
}
}
inline void EnableTask(int task_count, int *task_list)

View File

@ -42,7 +42,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "../common/data_verification.h"
#include "../common/rdtsc.h"
#include "data_bucket.h"
#include "../common/data_bucket.h"
#include "dynamic_zone.h"
#include "event_codes.h"
#include "guild_mgr.h"
@ -1473,7 +1473,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
// Load Data Buckets
ClearDataBucketCache();
DataBucket::GetDataBuckets(this);
LoadDataBucketsCache();
// Max Level for Character:PerCharacterQglobalMaxLevel and Character:PerCharacterBucketMaxLevel
uint8 client_max_level = 0;
@ -6963,7 +6963,7 @@ void Client::Handle_OP_GMSearchCorpse(const EQApplicationPacket *app)
DialogueWindow::TableCell(
fmt::format(
"{} ({})",
zone_store.GetZoneLongName(e.zone_id, true),
ZoneStore::Instance()->GetZoneLongName(e.zone_id, true),
e.zone_id
)
) +

View File

@ -19,7 +19,7 @@
#include "../common/file.h"
#include "../common/repositories/dynamic_zones_repository.h"
#include "data_bucket.h"
#include "../common/data_bucket.h"
#include "command.h"
#include "dynamic_zone.h"
#include "queryserv.h"
@ -34,7 +34,6 @@
extern QueryServ* QServ;
extern WorldServer worldserver;
extern TaskManager *task_manager;
extern FastMath g_Math;
void CatchSignal(int sig_num);
@ -783,161 +782,3 @@ void command_bot(Client *c, const Seperator *sep)
c->Message(Chat::Red, "Bots are disabled on this server.");
}
}
#include "gm_commands/acceptrules.cpp"
#include "gm_commands/advnpcspawn.cpp"
#include "gm_commands/aggrozone.cpp"
#include "gm_commands/ai.cpp"
#include "gm_commands/appearance.cpp"
#include "gm_commands/appearanceeffects.cpp"
#include "gm_commands/attack.cpp"
#include "gm_commands/augmentitem.cpp"
#include "gm_commands/ban.cpp"
#include "gm_commands/bugs.cpp"
#include "gm_commands/camerashake.cpp"
#include "gm_commands/castspell.cpp"
#include "gm_commands/chat.cpp"
#include "gm_commands/clearxtargets.cpp"
#include "gm_commands/copycharacter.cpp"
#include "gm_commands/corpse.cpp"
#include "gm_commands/corpsefix.cpp"
#include "gm_commands/countitem.cpp"
#include "gm_commands/damage.cpp"
#include "gm_commands/databuckets.cpp"
#include "gm_commands/dbspawn2.cpp"
#include "gm_commands/delacct.cpp"
#include "gm_commands/delpetition.cpp"
#include "gm_commands/depop.cpp"
#include "gm_commands/depopzone.cpp"
#include "gm_commands/devtools.cpp"
#include "gm_commands/disablerecipe.cpp"
#include "gm_commands/disarmtrap.cpp"
#include "gm_commands/doanim.cpp"
#include "gm_commands/door.cpp"
#include "gm_commands/door_manipulation.cpp"
#include "gm_commands/dye.cpp"
#include "gm_commands/dz.cpp"
#include "gm_commands/dzkickplayers.cpp"
#include "gm_commands/editmassrespawn.cpp"
#include "gm_commands/emote.cpp"
#include "gm_commands/emptyinventory.cpp"
#include "gm_commands/enablerecipe.cpp"
#include "gm_commands/entityvariable.cpp"
#include "gm_commands/exptoggle.cpp"
#include "gm_commands/faction.cpp"
#include "gm_commands/evolving_items.cpp"
#include "gm_commands/feature.cpp"
#include "gm_commands/find.cpp"
#include "gm_commands/fish.cpp"
#include "gm_commands/fixmob.cpp"
#include "gm_commands/flagedit.cpp"
#include "gm_commands/fleeinfo.cpp"
#include "gm_commands/forage.cpp"
#include "gm_commands/gearup.cpp"
#include "gm_commands/giveitem.cpp"
#include "gm_commands/givemoney.cpp"
#include "gm_commands/gmzone.cpp"
#include "gm_commands/goto.cpp"
#include "gm_commands/grantaa.cpp"
#include "gm_commands/grid.cpp"
#include "gm_commands/guild.cpp"
#include "gm_commands/hp.cpp"
#include "gm_commands/illusion_block.cpp"
#include "gm_commands/instance.cpp"
#include "gm_commands/interrogateinv.cpp"
#include "gm_commands/interrupt.cpp"
#include "gm_commands/invsnapshot.cpp"
#include "gm_commands/ipban.cpp"
#include "gm_commands/kick.cpp"
#include "gm_commands/kill.cpp"
#include "gm_commands/killallnpcs.cpp"
#include "gm_commands/list.cpp"
#include "gm_commands/lootsim.cpp"
#include "gm_commands/loc.cpp"
#include "gm_commands/logs.cpp"
#include "gm_commands/makepet.cpp"
#include "gm_commands/memspell.cpp"
#include "gm_commands/merchantshop.cpp"
#include "gm_commands/modifynpcstat.cpp"
#include "gm_commands/movechar.cpp"
#include "gm_commands/movement.cpp"
#include "gm_commands/myskills.cpp"
#include "gm_commands/mysql.cpp"
#include "gm_commands/mystats.cpp"
#include "gm_commands/npccast.cpp"
#include "gm_commands/npcedit.cpp"
#include "gm_commands/npceditmass.cpp"
#include "gm_commands/npcemote.cpp"
#include "gm_commands/npcloot.cpp"
#include "gm_commands/npcsay.cpp"
#include "gm_commands/npcshout.cpp"
#include "gm_commands/npcspawn.cpp"
#include "gm_commands/npctypespawn.cpp"
#include "gm_commands/nudge.cpp"
#include "gm_commands/nukebuffs.cpp"
#include "gm_commands/nukeitem.cpp"
#include "gm_commands/object.cpp"
#include "gm_commands/object_manipulation.cpp"
#include "gm_commands/parcels.cpp"
#include "gm_commands/path.cpp"
#include "gm_commands/peqzone.cpp"
#include "gm_commands/petitems.cpp"
#include "gm_commands/petname.cpp"
#include "gm_commands/picklock.cpp"
#include "gm_commands/profanity.cpp"
#include "gm_commands/push.cpp"
#include "gm_commands/raidloot.cpp"
#include "gm_commands/randomfeatures.cpp"
#include "gm_commands/refreshgroup.cpp"
#include "gm_commands/reload.cpp"
#include "gm_commands/removeitem.cpp"
#include "gm_commands/repop.cpp"
#include "gm_commands/resetaa.cpp"
#include "gm_commands/resetaa_timer.cpp"
#include "gm_commands/resetdisc_timer.cpp"
#include "gm_commands/revoke.cpp"
#include "gm_commands/roambox.cpp"
#include "gm_commands/rules.cpp"
#include "gm_commands/save.cpp"
#include "gm_commands/scale.cpp"
#include "gm_commands/scribespell.cpp"
#include "gm_commands/scribespells.cpp"
#include "gm_commands/sendzonespawns.cpp"
#include "gm_commands/sensetrap.cpp"
#include "gm_commands/serverrules.cpp"
#include "gm_commands/set.cpp"
#include "gm_commands/show.cpp"
#include "gm_commands/shutdown.cpp"
#include "gm_commands/spawn.cpp"
#include "gm_commands/spawneditmass.cpp"
#include "gm_commands/spawnfix.cpp"
#include "gm_commands/faction_association.cpp"
#include "gm_commands/stun.cpp"
#include "gm_commands/summon.cpp"
#include "gm_commands/summonburiedplayercorpse.cpp"
#include "gm_commands/summonitem.cpp"
#include "gm_commands/suspend.cpp"
#include "gm_commands/suspendmulti.cpp"
#include "gm_commands/takeplatinum.cpp"
#include "gm_commands/task.cpp"
#include "gm_commands/traindisc.cpp"
#include "gm_commands/tune.cpp"
#include "gm_commands/undye.cpp"
#include "gm_commands/unmemspell.cpp"
#include "gm_commands/unmemspells.cpp"
#include "gm_commands/unscribespell.cpp"
#include "gm_commands/unscribespells.cpp"
#include "gm_commands/untraindisc.cpp"
#include "gm_commands/untraindiscs.cpp"
#include "gm_commands/wc.cpp"
#include "gm_commands/worldshutdown.cpp"
#include "gm_commands/worldwide.cpp"
#include "gm_commands/wp.cpp"
#include "gm_commands/wpadd.cpp"
#include "gm_commands/zone.cpp"
#include "gm_commands/zonebootup.cpp"
#include "gm_commands/zoneshutdown.cpp"
#include "gm_commands/zonevariable.cpp"
#include "gm_commands/zone_instance.cpp"
#include "gm_commands/zone_shard.cpp"
#include "gm_commands/zsave.cpp"

View File

@ -1,5 +1,3 @@
#include <regex>
#include "dialogue_window.h"
void DialogueWindow::Render(Client *c, std::string markdown)
@ -529,12 +527,19 @@ std::string DialogueWindow::CenterMessage(std::string message)
return std::string();
}
auto cleaned_message = message;
std::string cleaned_message;
cleaned_message.reserve(message.size());
std::regex tags("<[^>]*>");
if (std::regex_search(cleaned_message, tags)) {
std::regex_replace(cleaned_message, tags, cleaned_message);
// Strip HTML-like tags
bool in_tag = false;
for (char c : message) {
if (c == '<') {
in_tag = true;
} else if (c == '>' && in_tag) {
in_tag = false;
} else if (!in_tag) {
cleaned_message += c;
}
}
auto message_len = cleaned_message.length();

View File

@ -33,7 +33,7 @@
#include "queryserv.h"
#include "questmgr.h"
#include "zone.h"
#include "data_bucket.h"
#include "../common/data_bucket.h"
#include "../common/events/player_event_logs.h"
#include "worldserver.h"
@ -5125,627 +5125,627 @@ void Perl__send_player_handin_event()
float Perl__GetZoneSafeX(uint32 zone_id)
{
return zone_store.GetZoneSafeCoordinates(zone_id).x;
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id).x;
}
float Perl__GetZoneSafeX(uint32 zone_id, int version)
{
return zone_store.GetZoneSafeCoordinates(zone_id, version).x;
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id, version).x;
}
float Perl__GetZoneSafeY(uint32 zone_id)
{
return zone_store.GetZoneSafeCoordinates(zone_id).y;
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id).y;
}
float Perl__GetZoneSafeY(uint32 zone_id, int version)
{
return zone_store.GetZoneSafeCoordinates(zone_id, version).y;
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id, version).y;
}
float Perl__GetZoneSafeZ(uint32 zone_id)
{
return zone_store.GetZoneSafeCoordinates(zone_id).z;
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id).z;
}
float Perl__GetZoneSafeZ(uint32 zone_id, int version)
{
return zone_store.GetZoneSafeCoordinates(zone_id, version).z;
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id, version).z;
}
float Perl__GetZoneSafeHeading(uint32 zone_id)
{
return zone_store.GetZoneSafeCoordinates(zone_id).w;
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id).w;
}
float Perl__GetZoneSafeHeading(uint32 zone_id, int version)
{
return zone_store.GetZoneSafeCoordinates(zone_id, version).w;
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id, version).w;
}
float Perl__GetZoneGraveyardID(uint32 zone_id)
{
return zone_store.GetZoneGraveyardID(zone_id);
return ZoneStore::Instance()->GetZoneGraveyardID(zone_id);
}
float Perl__GetZoneGraveyardID(uint32 zone_id, int version)
{
return zone_store.GetZoneGraveyardID(zone_id, version);
return ZoneStore::Instance()->GetZoneGraveyardID(zone_id, version);
}
uint8 Perl__GetZoneMinimumLevel(uint32 zone_id)
{
return zone_store.GetZoneMinimumLevel(zone_id);
return ZoneStore::Instance()->GetZoneMinimumLevel(zone_id);
}
uint8 Perl__GetZoneMinimumLevel(uint32 zone_id, int version)
{
return zone_store.GetZoneMinimumLevel(zone_id, version);
return ZoneStore::Instance()->GetZoneMinimumLevel(zone_id, version);
}
uint8 Perl__GetZoneMaximumLevel(uint32 zone_id)
{
return zone_store.GetZoneMaximumLevel(zone_id);
return ZoneStore::Instance()->GetZoneMaximumLevel(zone_id);
}
uint8 Perl__GetZoneMaximumLevel(uint32 zone_id, int version)
{
return zone_store.GetZoneMaximumLevel(zone_id, version);
return ZoneStore::Instance()->GetZoneMaximumLevel(zone_id, version);
}
uint8 Perl__GetZoneMinimumStatus(uint32 zone_id)
{
return zone_store.GetZoneMinimumStatus(zone_id);
return ZoneStore::Instance()->GetZoneMinimumStatus(zone_id);
}
uint8 Perl__GetZoneMinimumStatus(uint32 zone_id, int version)
{
return zone_store.GetZoneMinimumStatus(zone_id, version);
return ZoneStore::Instance()->GetZoneMinimumStatus(zone_id, version);
}
int Perl__GetZoneTimeZone(uint32 zone_id)
{
return zone_store.GetZoneTimeZone(zone_id);
return ZoneStore::Instance()->GetZoneTimeZone(zone_id);
}
int Perl__GetZoneTimeZone(uint32 zone_id, int version)
{
return zone_store.GetZoneTimeZone(zone_id, version);
return ZoneStore::Instance()->GetZoneTimeZone(zone_id, version);
}
int Perl__GetZoneMaximumPlayers(uint32 zone_id)
{
return zone_store.GetZoneMaximumPlayers(zone_id);
return ZoneStore::Instance()->GetZoneMaximumPlayers(zone_id);
}
int Perl__GetZoneMaximumPlayers(uint32 zone_id, int version)
{
return zone_store.GetZoneMaximumPlayers(zone_id, version);
return ZoneStore::Instance()->GetZoneMaximumPlayers(zone_id, version);
}
uint32 Perl__GetZoneRuleSet(uint32 zone_id)
{
return zone_store.GetZoneRuleSet(zone_id);
return ZoneStore::Instance()->GetZoneRuleSet(zone_id);
}
uint32 Perl__GetZoneRuleSet(uint32 zone_id, int version)
{
return zone_store.GetZoneRuleSet(zone_id, version);
return ZoneStore::Instance()->GetZoneRuleSet(zone_id, version);
}
std::string Perl__GetZoneNote(uint32 zone_id)
{
return zone_store.GetZoneNote(zone_id);
return ZoneStore::Instance()->GetZoneNote(zone_id);
}
std::string Perl__GetZoneNote(uint32 zone_id, int version)
{
return zone_store.GetZoneNote(zone_id, version);
return ZoneStore::Instance()->GetZoneNote(zone_id, version);
}
float Perl__GetZoneUnderworld(uint32 zone_id)
{
return zone_store.GetZoneUnderworld(zone_id);
return ZoneStore::Instance()->GetZoneUnderworld(zone_id);
}
float Perl__GetZoneUnderworld(uint32 zone_id, int version)
{
return zone_store.GetZoneUnderworld(zone_id, version);
return ZoneStore::Instance()->GetZoneUnderworld(zone_id, version);
}
float Perl__GetZoneMinimumClip(uint32 zone_id)
{
return zone_store.GetZoneMinimumClip(zone_id);
return ZoneStore::Instance()->GetZoneMinimumClip(zone_id);
}
float Perl__GetZoneMinimumClip(uint32 zone_id, int version)
{
return zone_store.GetZoneMinimumClip(zone_id, version);
return ZoneStore::Instance()->GetZoneMinimumClip(zone_id, version);
}
float Perl__GetZoneMaximumClip(uint32 zone_id)
{
return zone_store.GetZoneMaximumClip(zone_id);
return ZoneStore::Instance()->GetZoneMaximumClip(zone_id);
}
float Perl__GetZoneMaximumClip(uint32 zone_id, int version)
{
return zone_store.GetZoneMaximumClip(zone_id, version);
return ZoneStore::Instance()->GetZoneMaximumClip(zone_id, version);
}
float Perl__GetZoneFogMinimumClip(uint32 zone_id)
{
return zone_store.GetZoneFogMinimumClip(zone_id);
return ZoneStore::Instance()->GetZoneFogMinimumClip(zone_id);
}
float Perl__GetZoneFogMinimumClip(uint32 zone_id, uint8 slot)
{
return zone_store.GetZoneFogMinimumClip(zone_id, slot);
return ZoneStore::Instance()->GetZoneFogMinimumClip(zone_id, slot);
}
float Perl__GetZoneFogMinimumClip(uint32 zone_id, uint8 slot, int version)
{
return zone_store.GetZoneFogMinimumClip(zone_id, slot, version);
return ZoneStore::Instance()->GetZoneFogMinimumClip(zone_id, slot, version);
}
float Perl__GetZoneFogMaximumClip(uint32 zone_id)
{
return zone_store.GetZoneFogMaximumClip(zone_id);
return ZoneStore::Instance()->GetZoneFogMaximumClip(zone_id);
}
float Perl__GetZoneFogMaximumClip(uint32 zone_id, uint8 slot)
{
return zone_store.GetZoneFogMaximumClip(zone_id, slot);
return ZoneStore::Instance()->GetZoneFogMaximumClip(zone_id, slot);
}
float Perl__GetZoneFogMaximumClip(uint32 zone_id, uint8 slot, int version)
{
return zone_store.GetZoneFogMaximumClip(zone_id, slot, version);
return ZoneStore::Instance()->GetZoneFogMaximumClip(zone_id, slot, version);
}
uint8 Perl__GetZoneFogRed(uint32 zone_id)
{
return zone_store.GetZoneFogRed(zone_id);
return ZoneStore::Instance()->GetZoneFogRed(zone_id);
}
uint8 Perl__GetZoneFogRed(uint32 zone_id, uint8 slot)
{
return zone_store.GetZoneFogRed(zone_id, slot);
return ZoneStore::Instance()->GetZoneFogRed(zone_id, slot);
}
uint8 Perl__GetZoneFogRed(uint32 zone_id, uint8 slot, int version)
{
return zone_store.GetZoneFogRed(zone_id, slot, version);
return ZoneStore::Instance()->GetZoneFogRed(zone_id, slot, version);
}
uint8 Perl__GetZoneFogGreen(uint32 zone_id)
{
return zone_store.GetZoneFogGreen(zone_id);
return ZoneStore::Instance()->GetZoneFogGreen(zone_id);
}
uint8 Perl__GetZoneFogGreen(uint32 zone_id, uint8 slot)
{
return zone_store.GetZoneFogGreen(zone_id, slot);
return ZoneStore::Instance()->GetZoneFogGreen(zone_id, slot);
}
uint8 Perl__GetZoneFogGreen(uint32 zone_id, uint8 slot, int version)
{
return zone_store.GetZoneFogGreen(zone_id, slot, version);
return ZoneStore::Instance()->GetZoneFogGreen(zone_id, slot, version);
}
uint8 Perl__GetZoneFogBlue(uint32 zone_id)
{
return zone_store.GetZoneFogBlue(zone_id);
return ZoneStore::Instance()->GetZoneFogBlue(zone_id);
}
uint8 Perl__GetZoneFogBlue(uint32 zone_id, uint8 slot)
{
return zone_store.GetZoneFogBlue(zone_id, slot);
return ZoneStore::Instance()->GetZoneFogBlue(zone_id, slot);
}
uint8 Perl__GetZoneFogBlue(uint32 zone_id, uint8 slot, int version)
{
return zone_store.GetZoneFogBlue(zone_id, slot, version);
return ZoneStore::Instance()->GetZoneFogBlue(zone_id, slot, version);
}
uint8 Perl__GetZoneSky(uint32 zone_id)
{
return zone_store.GetZoneSky(zone_id);
return ZoneStore::Instance()->GetZoneSky(zone_id);
}
uint8 Perl__GetZoneSky(uint32 zone_id, int version)
{
return zone_store.GetZoneSky(zone_id, version);
return ZoneStore::Instance()->GetZoneSky(zone_id, version);
}
uint8 Perl__GetZoneZType(uint32 zone_id)
{
return zone_store.GetZoneZType(zone_id);
return ZoneStore::Instance()->GetZoneZType(zone_id);
}
uint8 Perl__GetZoneZType(uint32 zone_id, int version)
{
return zone_store.GetZoneZType(zone_id, version);
return ZoneStore::Instance()->GetZoneZType(zone_id, version);
}
float Perl__GetZoneExperienceMultiplier(uint32 zone_id)
{
return zone_store.GetZoneExperienceMultiplier(zone_id);
return ZoneStore::Instance()->GetZoneExperienceMultiplier(zone_id);
}
float Perl__GetZoneExperienceMultiplier(uint32 zone_id, int version)
{
return zone_store.GetZoneExperienceMultiplier(zone_id, version);
return ZoneStore::Instance()->GetZoneExperienceMultiplier(zone_id, version);
}
float Perl__GetZoneWalkSpeed(uint32 zone_id)
{
return zone_store.GetZoneWalkSpeed(zone_id);
return ZoneStore::Instance()->GetZoneWalkSpeed(zone_id);
}
float Perl__GetZoneWalkSpeed(uint32 zone_id, int version)
{
return zone_store.GetZoneWalkSpeed(zone_id, version);
return ZoneStore::Instance()->GetZoneWalkSpeed(zone_id, version);
}
uint8 Perl__GetZoneTimeType(uint32 zone_id)
{
return zone_store.GetZoneTimeType(zone_id);
return ZoneStore::Instance()->GetZoneTimeType(zone_id);
}
uint8 Perl__GetZoneTimeType(uint32 zone_id, int version)
{
return zone_store.GetZoneTimeType(zone_id, version);
return ZoneStore::Instance()->GetZoneTimeType(zone_id, version);
}
float Perl__GetZoneFogDensity(uint32 zone_id)
{
return zone_store.GetZoneFogDensity(zone_id);
return ZoneStore::Instance()->GetZoneFogDensity(zone_id);
}
float Perl__GetZoneFogDensity(uint32 zone_id, int version)
{
return zone_store.GetZoneFogDensity(zone_id, version);
return ZoneStore::Instance()->GetZoneFogDensity(zone_id, version);
}
std::string Perl__GetZoneFlagNeeded(uint32 zone_id)
{
return zone_store.GetZoneFlagNeeded(zone_id);
return ZoneStore::Instance()->GetZoneFlagNeeded(zone_id);
}
std::string Perl__GetZoneFlagNeeded(uint32 zone_id, int version)
{
return zone_store.GetZoneFlagNeeded(zone_id, version);
return ZoneStore::Instance()->GetZoneFlagNeeded(zone_id, version);
}
int8 Perl__GetZoneCanBind(uint32 zone_id)
{
return zone_store.GetZoneCanBind(zone_id);
return ZoneStore::Instance()->GetZoneCanBind(zone_id);
}
int8 Perl__GetZoneCanBind(uint32 zone_id, int version)
{
return zone_store.GetZoneCanBind(zone_id, version);
return ZoneStore::Instance()->GetZoneCanBind(zone_id, version);
}
int8 Perl__GetZoneCanCombat(uint32 zone_id)
{
return zone_store.GetZoneCanCombat(zone_id);
return ZoneStore::Instance()->GetZoneCanCombat(zone_id);
}
int8 Perl__GetZoneCanCombat(uint32 zone_id, int version)
{
return zone_store.GetZoneCanCombat(zone_id, version);
return ZoneStore::Instance()->GetZoneCanCombat(zone_id, version);
}
int8 Perl__GetZoneCanLevitate(uint32 zone_id)
{
return zone_store.GetZoneCanLevitate(zone_id);
return ZoneStore::Instance()->GetZoneCanLevitate(zone_id);
}
int8 Perl__GetZoneCanLevitate(uint32 zone_id, int version)
{
return zone_store.GetZoneCanLevitate(zone_id, version);
return ZoneStore::Instance()->GetZoneCanLevitate(zone_id, version);
}
int8 Perl__GetZoneCastOutdoor(uint32 zone_id)
{
return zone_store.GetZoneCastOutdoor(zone_id);
return ZoneStore::Instance()->GetZoneCastOutdoor(zone_id);
}
int8 Perl__GetZoneCastOutdoor(uint32 zone_id, int version)
{
return zone_store.GetZoneCastOutdoor(zone_id, version);
return ZoneStore::Instance()->GetZoneCastOutdoor(zone_id, version);
}
uint8 Perl__GetZoneHotzone(uint32 zone_id)
{
return zone_store.GetZoneHotzone(zone_id);
return ZoneStore::Instance()->GetZoneHotzone(zone_id);
}
uint8 Perl__GetZoneHotzone(uint32 zone_id, int version)
{
return zone_store.GetZoneHotzone(zone_id, version);
return ZoneStore::Instance()->GetZoneHotzone(zone_id, version);
}
uint8 Perl__GetZoneInstanceType(uint32 zone_id)
{
return zone_store.GetZoneInstanceType(zone_id);
return ZoneStore::Instance()->GetZoneInstanceType(zone_id);
}
uint8 Perl__GetZoneInstanceType(uint32 zone_id, int version)
{
return zone_store.GetZoneInstanceType(zone_id, version);
return ZoneStore::Instance()->GetZoneInstanceType(zone_id, version);
}
uint64 Perl__GetZoneShutdownDelay(uint32 zone_id)
{
return zone_store.GetZoneShutdownDelay(zone_id);
return ZoneStore::Instance()->GetZoneShutdownDelay(zone_id);
}
uint64 Perl__GetZoneShutdownDelay(uint32 zone_id, int version)
{
return zone_store.GetZoneShutdownDelay(zone_id, version);
return ZoneStore::Instance()->GetZoneShutdownDelay(zone_id, version);
}
int8 Perl__GetZonePEQZone(uint32 zone_id)
{
return zone_store.GetZonePEQZone(zone_id);
return ZoneStore::Instance()->GetZonePEQZone(zone_id);
}
int8 Perl__GetZonePEQZone(uint32 zone_id, int version)
{
return zone_store.GetZonePEQZone(zone_id, version);
return ZoneStore::Instance()->GetZonePEQZone(zone_id, version);
}
int8 Perl__GetZoneExpansion(uint32 zone_id)
{
return zone_store.GetZoneExpansion(zone_id);
return ZoneStore::Instance()->GetZoneExpansion(zone_id);
}
int8 Perl__GetZoneExpansion(uint32 zone_id, int version)
{
return zone_store.GetZoneExpansion(zone_id, version);
return ZoneStore::Instance()->GetZoneExpansion(zone_id, version);
}
int8 Perl__GetZoneBypassExpansionCheck(uint32 zone_id)
{
return zone_store.GetZoneBypassExpansionCheck(zone_id);
return ZoneStore::Instance()->GetZoneBypassExpansionCheck(zone_id);
}
int8 Perl__GetZoneBypassExpansionCheck(uint32 zone_id, int version)
{
return zone_store.GetZoneBypassExpansionCheck(zone_id, version);
return ZoneStore::Instance()->GetZoneBypassExpansionCheck(zone_id, version);
}
uint8 Perl__GetZoneSuspendBuffs(uint32 zone_id)
{
return zone_store.GetZoneSuspendBuffs(zone_id);
return ZoneStore::Instance()->GetZoneSuspendBuffs(zone_id);
}
uint8 Perl__GetZoneSuspendBuffs(uint32 zone_id, int version)
{
return zone_store.GetZoneSuspendBuffs(zone_id, version);
return ZoneStore::Instance()->GetZoneSuspendBuffs(zone_id, version);
}
int Perl__GetZoneRainChance(uint32 zone_id)
{
return zone_store.GetZoneRainChance(zone_id);
return ZoneStore::Instance()->GetZoneRainChance(zone_id);
}
int Perl__GetZoneRainChance(uint32 zone_id, uint8 slot)
{
return zone_store.GetZoneRainChance(zone_id, slot);
return ZoneStore::Instance()->GetZoneRainChance(zone_id, slot);
}
int Perl__GetZoneRainChance(uint32 zone_id, uint8 slot, int version)
{
return zone_store.GetZoneRainChance(zone_id, slot, version);
return ZoneStore::Instance()->GetZoneRainChance(zone_id, slot, version);
}
int Perl__GetZoneRainDuration(uint32 zone_id)
{
return zone_store.GetZoneRainDuration(zone_id);
return ZoneStore::Instance()->GetZoneRainDuration(zone_id);
}
int Perl__GetZoneRainDuration(uint32 zone_id, uint8 slot)
{
return zone_store.GetZoneRainDuration(zone_id, slot);
return ZoneStore::Instance()->GetZoneRainDuration(zone_id, slot);
}
int Perl__GetZoneRainDuration(uint32 zone_id, uint8 slot, int version)
{
return zone_store.GetZoneRainDuration(zone_id, slot, version);
return ZoneStore::Instance()->GetZoneRainDuration(zone_id, slot, version);
}
int Perl__GetZoneSnowChance(uint32 zone_id)
{
return zone_store.GetZoneSnowChance(zone_id);
return ZoneStore::Instance()->GetZoneSnowChance(zone_id);
}
int Perl__GetZoneSnowChance(uint32 zone_id, uint8 slot)
{
return zone_store.GetZoneSnowChance(zone_id, slot);
return ZoneStore::Instance()->GetZoneSnowChance(zone_id, slot);
}
int Perl__GetZoneSnowChance(uint32 zone_id, uint8 slot, int version)
{
return zone_store.GetZoneSnowChance(zone_id, slot, version);
return ZoneStore::Instance()->GetZoneSnowChance(zone_id, slot, version);
}
int Perl__GetZoneSnowDuration(uint32 zone_id)
{
return zone_store.GetZoneSnowDuration(zone_id);
return ZoneStore::Instance()->GetZoneSnowDuration(zone_id);
}
int Perl__GetZoneSnowDuration(uint32 zone_id, uint8 slot)
{
return zone_store.GetZoneSnowDuration(zone_id, slot);
return ZoneStore::Instance()->GetZoneSnowDuration(zone_id, slot);
}
int Perl__GetZoneSnowDuration(uint32 zone_id, uint8 slot, int version)
{
return zone_store.GetZoneSnowDuration(zone_id, slot, version);
return ZoneStore::Instance()->GetZoneSnowDuration(zone_id, slot, version);
}
float Perl__GetZoneGravity(uint32 zone_id)
{
return zone_store.GetZoneGravity(zone_id);
return ZoneStore::Instance()->GetZoneGravity(zone_id);
}
float Perl__GetZoneGravity(uint32 zone_id, int version)
{
return zone_store.GetZoneGravity(zone_id, version);
return ZoneStore::Instance()->GetZoneGravity(zone_id, version);
}
int Perl__GetZoneType(uint32 zone_id)
{
return zone_store.GetZoneType(zone_id);
return ZoneStore::Instance()->GetZoneType(zone_id);
}
int Perl__GetZoneType(uint32 zone_id, int version)
{
return zone_store.GetZoneType(zone_id, version);
return ZoneStore::Instance()->GetZoneType(zone_id, version);
}
int8 Perl__GetZoneSkyLock(uint32 zone_id)
{
return zone_store.GetZoneSkyLock(zone_id);
return ZoneStore::Instance()->GetZoneSkyLock(zone_id);
}
int8 Perl__GetZoneSkyLock(uint32 zone_id, int version)
{
return zone_store.GetZoneSkyLock(zone_id, version);
return ZoneStore::Instance()->GetZoneSkyLock(zone_id, version);
}
int Perl__GetZoneFastRegenHP(uint32 zone_id)
{
return zone_store.GetZoneFastRegenHP(zone_id);
return ZoneStore::Instance()->GetZoneFastRegenHP(zone_id);
}
int Perl__GetZoneFastRegenHP(uint32 zone_id, int version)
{
return zone_store.GetZoneFastRegenHP(zone_id, version);
return ZoneStore::Instance()->GetZoneFastRegenHP(zone_id, version);
}
int Perl__GetZoneFastRegenMana(uint32 zone_id)
{
return zone_store.GetZoneFastRegenMana(zone_id);
return ZoneStore::Instance()->GetZoneFastRegenMana(zone_id);
}
int Perl__GetZoneFastRegenMana(uint32 zone_id, int version)
{
return zone_store.GetZoneFastRegenMana(zone_id, version);
return ZoneStore::Instance()->GetZoneFastRegenMana(zone_id, version);
}
int Perl__GetZoneFastRegenEndurance(uint32 zone_id)
{
return zone_store.GetZoneFastRegenEndurance(zone_id);
return ZoneStore::Instance()->GetZoneFastRegenEndurance(zone_id);
}
int Perl__GetZoneFastRegenEndurance(uint32 zone_id, int version)
{
return zone_store.GetZoneFastRegenEndurance(zone_id, version);
return ZoneStore::Instance()->GetZoneFastRegenEndurance(zone_id, version);
}
int Perl__GetZoneNPCMaximumAggroDistance(uint32 zone_id)
{
return zone_store.GetZoneNPCMaximumAggroDistance(zone_id);
return ZoneStore::Instance()->GetZoneNPCMaximumAggroDistance(zone_id);
}
int Perl__GetZoneNPCMaximumAggroDistance(uint32 zone_id, int version)
{
return zone_store.GetZoneNPCMaximumAggroDistance(zone_id, version);
return ZoneStore::Instance()->GetZoneNPCMaximumAggroDistance(zone_id, version);
}
int8 Perl__GetZoneMinimumExpansion(uint32 zone_id)
{
return zone_store.GetZoneMinimumExpansion(zone_id);
return ZoneStore::Instance()->GetZoneMinimumExpansion(zone_id);
}
int8 Perl__GetZoneMinimumExpansion(uint32 zone_id, int version)
{
return zone_store.GetZoneMinimumExpansion(zone_id, version);
return ZoneStore::Instance()->GetZoneMinimumExpansion(zone_id, version);
}
int8 Perl__GetZoneMaximumExpansion(uint32 zone_id)
{
return zone_store.GetZoneMaximumExpansion(zone_id);
return ZoneStore::Instance()->GetZoneMaximumExpansion(zone_id);
}
int8 Perl__GetZoneMaximumExpansion(uint32 zone_id, int version)
{
return zone_store.GetZoneMaximumExpansion(zone_id, version);
return ZoneStore::Instance()->GetZoneMaximumExpansion(zone_id, version);
}
std::string Perl__GetZoneContentFlags(uint32 zone_id)
{
return zone_store.GetZoneContentFlags(zone_id);
return ZoneStore::Instance()->GetZoneContentFlags(zone_id);
}
std::string Perl__GetZoneContentFlags(uint32 zone_id, int version)
{
return zone_store.GetZoneContentFlags(zone_id, version);
return ZoneStore::Instance()->GetZoneContentFlags(zone_id, version);
}
std::string Perl__GetZoneContentFlagsDisabled(uint32 zone_id)
{
return zone_store.GetZoneContentFlagsDisabled(zone_id);
return ZoneStore::Instance()->GetZoneContentFlagsDisabled(zone_id);
}
std::string Perl__GetZoneContentFlagsDisabled(uint32 zone_id, int version)
{
return zone_store.GetZoneContentFlagsDisabled(zone_id, version);
return ZoneStore::Instance()->GetZoneContentFlagsDisabled(zone_id, version);
}
int Perl__GetZoneUnderworldTeleportIndex(uint32 zone_id)
{
return zone_store.GetZoneUnderworldTeleportIndex(zone_id);
return ZoneStore::Instance()->GetZoneUnderworldTeleportIndex(zone_id);
}
int Perl__GetZoneUnderworldTeleportIndex(uint32 zone_id, int version)
{
return zone_store.GetZoneUnderworldTeleportIndex(zone_id, version);
return ZoneStore::Instance()->GetZoneUnderworldTeleportIndex(zone_id, version);
}
int Perl__GetZoneLavaDamage(uint32 zone_id)
{
return zone_store.GetZoneLavaDamage(zone_id);
return ZoneStore::Instance()->GetZoneLavaDamage(zone_id);
}
int Perl__GetZoneLavaDamage(uint32 zone_id, int version)
{
return zone_store.GetZoneLavaDamage(zone_id, version);
return ZoneStore::Instance()->GetZoneLavaDamage(zone_id, version);
}
int Perl__GetZoneMinimumLavaDamage(uint32 zone_id)
{
return zone_store.GetZoneMinimumLavaDamage(zone_id);
return ZoneStore::Instance()->GetZoneMinimumLavaDamage(zone_id);
}
int Perl__GetZoneMinimumLavaDamage(uint32 zone_id, int version)
{
return zone_store.GetZoneMinimumLavaDamage(zone_id, version);
return ZoneStore::Instance()->GetZoneMinimumLavaDamage(zone_id, version);
}
uint8 Perl__GetZoneIdleWhenEmpty(uint32 zone_id)
{
return zone_store.GetZoneIdleWhenEmpty(zone_id);
return ZoneStore::Instance()->GetZoneIdleWhenEmpty(zone_id);
}
uint8 Perl__GetZoneIdleWhenEmpty(uint32 zone_id, int version)
{
return zone_store.GetZoneIdleWhenEmpty(zone_id, version);
return ZoneStore::Instance()->GetZoneIdleWhenEmpty(zone_id, version);
}
uint32 Perl__GetZoneSecondsBeforeIdle(uint32 zone_id)
{
return zone_store.GetZoneSecondsBeforeIdle(zone_id);
return ZoneStore::Instance()->GetZoneSecondsBeforeIdle(zone_id);
}
uint32 Perl__GetZoneSecondsBeforeIdle(uint32 zone_id, int version)
{
return zone_store.GetZoneSecondsBeforeIdle(zone_id, version);
return ZoneStore::Instance()->GetZoneSecondsBeforeIdle(zone_id, version);
}
void Perl__send_channel_message(uint8 channel_number, uint32 guild_id, uint8 language_id, uint8 language_skill, const char* message)
@ -5870,12 +5870,12 @@ bool Perl__SetAutoLoginCharacterNameByAccountID(uint32 account_id, std::string c
uint32 Perl__GetZoneIDByLongName(std::string zone_long_name)
{
return zone_store.GetZoneIDByLongName(zone_long_name);
return ZoneStore::Instance()->GetZoneIDByLongName(zone_long_name);
}
std::string Perl__GetZoneShortNameByLongName(std::string zone_long_name)
{
return zone_store.GetZoneShortNameByLongName(zone_long_name);
return ZoneStore::Instance()->GetZoneShortNameByLongName(zone_long_name);
}
bool Perl__send_parcel(perl::reference table_ref)

View File

@ -138,7 +138,7 @@ void Embperl::DoInit()
LogQuests("Warning [{}]: [{}]", Config->PluginPlFile, e);
}
for (auto & dir : path.GetPluginPaths()) {
for (auto & dir : PathManager::Instance()->GetPluginPaths()) {
try {
//should probably read the directory in c, instead, so that
//I can echo filenames as I do it, but c'mon... I'm lazy and this 1 line reads in all the plugins

View File

@ -4175,10 +4175,6 @@ void EntityList::ProcessProximitySay(const char *message, Client *c, uint8 langu
void EntityList::SaveAllClientsTaskState()
{
if (!task_manager) {
return;
}
auto it = client_list.begin();
while (it != client_list.end()) {
Client *client = it->second;
@ -4192,9 +4188,6 @@ void EntityList::SaveAllClientsTaskState()
void EntityList::ReloadAllClientsTaskState(int task_id)
{
if (!task_manager)
return;
auto it = client_list.begin();
while (it != client_list.end()) {
Client *client = it->second;
@ -4205,7 +4198,7 @@ void EntityList::ReloadAllClientsTaskState(int task_id)
Log(Logs::General, Logs::Tasks, "[CLIENTLOAD] Reloading Task State For Client %s", client->GetName());
client->RemoveClientTaskState();
client->LoadClientTaskState();
task_manager->SendActiveTasksToClient(client);
TaskManager::Instance()->SendActiveTasksToClient(client);
}
}
++it;

View File

@ -22,7 +22,7 @@
#include "../common/strings.h"
#include "client.h"
#include "data_bucket.h"
#include "../common/data_bucket.h"
#include "groups.h"
#include "mob.h"
#include "raids.h"

View File

@ -1,8 +1,17 @@
#include "../client.h"
#include "../data_bucket.h"
#include "../../common/data_bucket.h"
#include "../dialogue_window.h"
#include "../../common/repositories/data_buckets_repository.h"
void SendDataBucketsSubCommands(Client *c)
{
c->Message(Chat::White, "Usage: #databuckets delete [Key] [Character ID] [NPC ID] [Bot ID]");
c->Message(Chat::White, "Usage: #databuckets edit [Key] [Character ID] [NPC ID] [Bot ID] [Value] [Expires]");
c->Message(Chat::White, "Usage: #databuckets view [Partial Key] [Character ID] [NPC ID] [Bot ID]");
c->Message(Chat::White, "Note: Character ID, NPC ID, and Bot ID are optional if not needed, if needed they are required for specificity");
c->Message(Chat::White, "Note: Edit requires Character ID, NPC ID, Bot ID, and Value, Expires is optional and does not modify the existing expiration time if not provided");
}
void command_databuckets(Client *c, const Seperator *sep)
{
const int arguments = sep->argnum;
@ -251,12 +260,3 @@ void command_databuckets(Client *c, const Seperator *sep)
c->Message(Chat::White, response.c_str());
}
}
void SendDataBucketsSubCommands(Client *c)
{
c->Message(Chat::White, "Usage: #databuckets delete [Key] [Character ID] [NPC ID] [Bot ID]");
c->Message(Chat::White, "Usage: #databuckets edit [Key] [Character ID] [NPC ID] [Bot ID] [Value] [Expires]");
c->Message(Chat::White, "Usage: #databuckets view [Partial Key] [Character ID] [NPC ID] [Bot ID]");
c->Message(Chat::White, "Note: Character ID, NPC ID, and Bot ID are optional if not needed, if needed they are required for specificity");
c->Message(Chat::White, "Note: Edit requires Character ID, NPC ID, Bot ID, and Value, Expires is optional and does not modify the existing expiration time if not provided");
}

View File

@ -1,5 +1,5 @@
#include "../client.h"
#include "../data_bucket.h"
#include "../../common/data_bucket.h"
void command_devtools(Client *c, const Seperator *sep)
{

View File

@ -1,3 +1,4 @@
#include "../../object.h"
#include "../../client.h"
void FindObjectType(Client *c, const Seperator *sep)

View File

@ -11,7 +11,7 @@ void FindTask(Client *c, const Seperator *sep)
if (sep->IsNumber(2)) {
const auto task_id = Strings::ToUnsignedInt(sep->arg[2]);
const auto& task_name = task_manager->GetTaskName(task_id);
const auto& task_name = TaskManager::Instance()->GetTaskName(task_id);
if (task_name.empty()) {
c->Message(
@ -41,7 +41,7 @@ void FindTask(Client *c, const Seperator *sep)
auto found_count = 0;
for (const auto& t : task_manager->GetTaskData()) {
for (const auto& t : TaskManager::Instance()->GetTaskData()) {
const auto& task_name = t.second.title;
const auto& task_name_lower = Strings::ToLower(task_name);
if (!Strings::Contains(task_name_lower, search_criteria)) {

View File

@ -1,5 +1,5 @@
#include "../client.h"
#include "../data_bucket.h"
#include "../../common/data_bucket.h"
void command_gmzone(Client *c, const Seperator *sep)
{

View File

@ -8,6 +8,22 @@ extern QueryServ *QServ;
#include "../guild_mgr.h"
#include "../doors.h"
void SendGuildSubCommands(Client* c)
{
c->Message(Chat::White, "#guild create [Character ID|Character Name] [Guild Name]");
c->Message(Chat::White, "#guild delete [Guild ID]");
c->Message(Chat::White, "#guild details [Guild ID]");
c->Message(Chat::White, "#guild help");
c->Message(Chat::White, "#guild info [Guild ID]");
c->Message(Chat::White, "#guild list");
c->Message(Chat::White, "#guild rename [Guild ID] [New Name]");
c->Message(Chat::White, "#guild search [Search Criteria]");
c->Message(Chat::White, "#guild set [Character ID|Character Name] [Guild ID] (Guild ID 0 is Guildless)");
c->Message(Chat::White, "#guild setleader [Guild ID] [Character ID|Character Name]");
c->Message(Chat::White, "#guild setrank [Character ID|Character Name] [Rank]");
c->Message(Chat::White, "#guild status [Character ID|Character Name]");
}
void command_guild(Client* c, const Seperator* sep)
{
const auto arguments = sep->argnum;
@ -675,20 +691,4 @@ void command_guild(Client* c, const Seperator* sep)
// }
}
}
}
void SendGuildSubCommands(Client* c)
{
c->Message(Chat::White, "#guild create [Character ID|Character Name] [Guild Name]");
c->Message(Chat::White, "#guild delete [Guild ID]");
c->Message(Chat::White, "#guild details [Guild ID]");
c->Message(Chat::White, "#guild help");
c->Message(Chat::White, "#guild info [Guild ID]");
c->Message(Chat::White, "#guild list");
c->Message(Chat::White, "#guild rename [Guild ID] [New Name]");
c->Message(Chat::White, "#guild search [Search Criteria]");
c->Message(Chat::White, "#guild set [Character ID|Character Name] [Guild ID] (Guild ID 0 is Guildless)");
c->Message(Chat::White, "#guild setleader [Guild ID] [Character ID|Character Name]");
c->Message(Chat::White, "#guild setrank [Character ID|Character Name] [Rank]");
c->Message(Chat::White, "#guild status [Character ID|Character Name]");
}
}

View File

@ -1,3 +1,4 @@
#include "../dialogue_window.h"
#include "../client.h"
void command_illusion_block(Client* c, const Seperator* sep)

View File

@ -2,6 +2,7 @@
#include "../corpse.h"
#include "../object.h"
#include "../doors.h"
#include "../command.h"
struct UniqueEntity {
uint16 entity_id;

View File

@ -1,4 +1,5 @@
#include "../client.h"
#include "../water_map.h"
void command_loc(Client *c, const Seperator *sep)
{

View File

@ -1,63 +1,5 @@
#include "../client.h"
void command_modifynpcstat(Client *c, const Seperator *sep)
{
auto arguments = sep->argnum;
if (!arguments) {
c->Message(Chat::White, "Usage: #modifynpcstat [Stat] [Value]");
ListModifyNPCStatMap(c);
return;
}
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
c->Message(Chat::White, "You must target an NPC to use this command.");
return;
}
auto target = c->GetTarget()->CastToNPC();
const std::string& stat = sep->arg[1] ? sep->arg[1] : "";
const std::string& value = sep->arg[2] ? sep->arg[2] : "";
if (stat.empty() || value.empty()) {
c->Message(Chat::White, "Usage: #modifynpcstat [Stat] [Value]");
ListModifyNPCStatMap(c);
return;
}
auto stat_description = GetModifyNPCStatDescription(stat);
if (!stat_description.length()) {
c->Message(
Chat::White,
fmt::format(
"Stat '{}' does not exist.",
stat
).c_str()
);
return;
}
target->ModifyNPCStat(stat, value);
c->Message(
Chat::White,
fmt::format(
"Stat Modified | Target: {}",
c->GetTargetDescription(target)
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"Stat Modified | Stat: {} ({}) Value: {}",
GetModifyNPCStatDescription(stat),
stat,
value
).c_str()
);
}
std::map<std::string, std::string> GetModifyNPCStatMap()
{
std::map<std::string, std::string> identifiers_map = {
@ -134,3 +76,61 @@ void ListModifyNPCStatMap(Client *c)
);
}
}
void command_modifynpcstat(Client *c, const Seperator *sep)
{
auto arguments = sep->argnum;
if (!arguments) {
c->Message(Chat::White, "Usage: #modifynpcstat [Stat] [Value]");
ListModifyNPCStatMap(c);
return;
}
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
c->Message(Chat::White, "You must target an NPC to use this command.");
return;
}
auto target = c->GetTarget()->CastToNPC();
const std::string& stat = sep->arg[1] ? sep->arg[1] : "";
const std::string& value = sep->arg[2] ? sep->arg[2] : "";
if (stat.empty() || value.empty()) {
c->Message(Chat::White, "Usage: #modifynpcstat [Stat] [Value]");
ListModifyNPCStatMap(c);
return;
}
auto stat_description = GetModifyNPCStatDescription(stat);
if (!stat_description.length()) {
c->Message(
Chat::White,
fmt::format(
"Stat '{}' does not exist.",
stat
).c_str()
);
return;
}
target->ModifyNPCStat(stat, value);
c->Message(
Chat::White,
fmt::format(
"Stat Modified | Target: {}",
c->GetTargetDescription(target)
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"Stat Modified | Stat: {} ({}) Value: {}",
GetModifyNPCStatDescription(stat),
stat,
value
).c_str()
);
}

View File

@ -1,3 +1,4 @@
#include "../bot.h"
#include "../client.h"
void command_mystats(Client *c, const Seperator *sep)

View File

@ -3,6 +3,115 @@
#include "../raids.h"
#include "../../common/repositories/npc_types_repository.h"
void SendNPCEditSubCommands(Client *c)
{
c->Message(Chat::White, "Usage: #npcedit name [Name] - Sets an NPC's Name");
c->Message(Chat::White, "Usage: #npcedit lastname [Last Name] - Sets an NPC's Last Name");
c->Message(Chat::White, "Usage: #npcedit level [Level] - Sets an NPC's Level");
c->Message(Chat::White, "Usage: #npcedit race [Race ID] - Sets an NPC's Race");
c->Message(Chat::White, "Usage: #npcedit class [Class ID] - Sets an NPC's Class");
c->Message(Chat::White, "Usage: #npcedit bodytype [Body Type ID] - Sets an NPC's Bodytype");
c->Message(Chat::White, "Usage: #npcedit hp [HP] - Sets an NPC's HP");
c->Message(Chat::White, "Usage: #npcedit mana [Mana] - Sets an NPC's Mana");
c->Message(Chat::White, "Usage: #npcedit gender [Gender ID] - Sets an NPC's Gender");
c->Message(Chat::White, "Usage: #npcedit texture [Texture] - Sets an NPC's Texture");
c->Message(Chat::White, "Usage: #npcedit helmtexture [Helmet Texture] - Sets an NPC's Helmet Texture");
c->Message(Chat::White, "Usage: #npcedit herosforgemodel [Model Number] - Sets an NPC's Hero's Forge Model");
c->Message(Chat::White, "Usage: #npcedit size [Size] - Sets an NPC's Size");
c->Message(Chat::White, "Usage: #npcedit hpregen [HP Regen] - Sets an NPC's HP Regen Rate Per Tick");
c->Message(Chat::White, "Usage: #npcedit hp_regen_per_second [HP Regen] - Sets an NPC's HP Regen Rate Per Second");
c->Message(Chat::White, "Usage: #npcedit manaregen [Mana Regen] - Sets an NPC's Mana Regen Rate Per Tick");
c->Message(Chat::White, "Usage: #npcedit loottable [Loottable ID] - Sets an NPC's Loottable ID");
c->Message(Chat::White, "Usage: #npcedit merchantid [Merchant ID] - Sets an NPC's Merchant ID");
c->Message(Chat::White, "Usage: #npcedit alt_currency_id [Alternate Currency ID] - Sets an NPC's Alternate Currency ID");
c->Message(Chat::White, "Usage: #npcedit spell [Spell List ID] - Sets an NPC's Spells List ID");
c->Message(Chat::White, "Usage: #npcedit npc_spells_effects_id [Spell Effects ID] - Sets an NPC's Spell Effects ID");
c->Message(Chat::White, "Usage: #npcedit faction [Faction ID] - Sets an NPC's Faction ID");
c->Message(Chat::White, "Usage: #npcedit adventure_template_id [Template ID] - Sets an NPC's Adventure Template ID");
c->Message(Chat::White, "Usage: #npcedit trap_template [Template ID] - Sets an NPC's Trap Template ID");
c->Message(Chat::White, "Usage: #npcedit damage [Minimum] [Maximum] - Sets an NPC's Damage");
c->Message(Chat::White, "Usage: #npcedit attackcount [Attack Count] - Sets an NPC's Attack Count");
c->Message(Chat::White, "Usage: #npcedit special_attacks [Special Attacks] - Sets an NPC's Special Attacks");
c->Message(Chat::White, "Usage: #npcedit special_abilities [Special Abilities] - Sets an NPC's Special Abilities");
c->Message(Chat::White, "Usage: #npcedit aggroradius [Radius] - Sets an NPC's Aggro Radius");
c->Message(Chat::White, "Usage: #npcedit assistradius [Radius] - Sets an NPC's Assist Radius");
c->Message(Chat::White, "Usage: #npcedit featuresave - Saves an NPC's current facial features to the database");
c->Message(Chat::White, "Usage: #npcedit armortint_id [Armor Tint ID] - Sets an NPC's Armor Tint ID");
c->Message(Chat::White, "Usage: #npcedit color [Red] [Green] [Blue] - Sets an NPC's Red, Green, and Blue armor tint");
c->Message(Chat::White, "Usage: #npcedit ammoidfile [ID File] - Sets an NPC's Ammo ID File");
c->Message(Chat::White, "Usage: #npcedit weapon [Primary Model] [Secondary Model] - Sets an NPC's Primary and Secondary Weapon Model");
c->Message(Chat::White, "Usage: #npcedit meleetype [Primary Type] [Secondary Type] - Sets an NPC's Melee Skill Types");
c->Message(Chat::White, "Usage: #npcedit rangedtype [Type] - Sets an NPC's Ranged Skill Type");
c->Message(Chat::White, "Usage: #npcedit runspeed [Run Speed] - Sets an NPC's Run Speed");
c->Message(Chat::White, "Usage: #npcedit mr [Resistance] - Sets an NPC's Magic Resistance");
c->Message(Chat::White, "Usage: #npcedit pr [Resistance] - Sets an NPC's Poison Resistance");
c->Message(Chat::White, "Usage: #npcedit dr [Resistance] - Sets an NPC's Disease Resistance");
c->Message(Chat::White, "Usage: #npcedit fr [Resistance] - Sets an NPC's Fire Resistance");
c->Message(Chat::White, "Usage: #npcedit cr [Resistance] - Sets an NPC's Cold Resistance");
c->Message(Chat::White, "Usage: #npcedit corrup [Resistance] - Sets an NPC's Corruption Resistance");
c->Message(Chat::White, "Usage: #npcedit phr [Resistance] - Sets and NPC's Physical Resistance");
c->Message(Chat::White, "Usage: #npcedit seeinvis [Flag] - Sets an NPC's See Invisible Flag [0 = Cannot See Invisible, 1 = Can See Invisible]");
c->Message(Chat::White, "Usage: #npcedit seeinvisundead [Flag] - Sets an NPC's See Invisible vs. Undead Flag [0 = Cannot See Invisible vs. Undead, 1 = Can See Invisible vs. Undead]");
c->Message(Chat::White, "Usage: #npcedit qglobal [Flag] - Sets an NPC's Quest Global Flag [0 = Quest Globals Off, 1 = Quest Globals On]");
c->Message(Chat::White, "Usage: #npcedit ac [Armor Class] - Sets an NPC's Armor Class");
c->Message(Chat::White, "Usage: #npcedit npcaggro [Flag] - Sets an NPC's NPC Aggro Flag [0 = Aggro NPCs Off, 1 = Aggro NPCs On]");
c->Message(Chat::White, "Usage: #npcedit spawn_limit [Limit] - Sets an NPC's Spawn Limit Counter");
c->Message(Chat::White, "Usage: #npcedit attackspeed [Attack Speed] - Sets an NPC's Attack Speed Modifier");
c->Message(Chat::White, "Usage: #npcedit attackdelay [Attack Delay] - Sets an NPC's Attack Delay");
c->Message(Chat::White, "Usage: #npcedit findable [Flag] - Sets an NPC's Findable Flag [0 = Not Findable, 1 = Findable]");
c->Message(Chat::White, "Usage: #npcedit str [Strength] - Sets an NPC's Strength");
c->Message(Chat::White, "Usage: #npcedit sta [Stamina] - Sets an NPC's Stamina");
c->Message(Chat::White, "Usage: #npcedit agi [Agility] - Sets an NPC's Agility");
c->Message(Chat::White, "Usage: #npcedit dex [Dexterity] - Sets an NPC's Dexterity");
c->Message(Chat::White, "Usage: #npcedit int [Intelligence] - Sets an NPC's Intelligence");
c->Message(Chat::White, "Usage: #npcedit wis [Wisdom] - Sets an NPC's Wisdom");
c->Message(Chat::White, "Usage: #npcedit cha [Charisma] - Sets an NPC's Charisma");
c->Message(Chat::White, "Usage: #npcedit seehide [Flag] - Sets an NPC's See Hide Flag [0 = Cannot See Hide, 1 = Can See Hide]");
c->Message(Chat::White, "Usage: #npcedit seeimprovedhide [Flag] - Sets an NPC's See Improved Hide Flag [0 = Cannot See Improved Hide, 1 = Can See Improved Hide]");
c->Message(Chat::White, "Usage: #npcedit trackable [Flag] - Sets an NPC's Trackable Flag [0 = Not Trackable, 1 = Trackable]");
c->Message(Chat::White, "Usage: #npcedit atk [Attack] - Sets an NPC's Attack");
c->Message(Chat::White, "Usage: #npcedit accuracy [Accuracy] - Sets an NPC's Accuracy");
c->Message(Chat::White, "Usage: #npcedit avoidance [Avoidance] - Sets an NPC's Avoidance");
c->Message(Chat::White, "Usage: #npcedit slow_mitigation [Slow Mitigation] - Sets an NPC's Slow Mitigation");
c->Message(Chat::White, "Usage: #npcedit version [Version] - Sets an NPC's Version");
c->Message(Chat::White, "Usage: #npcedit maxlevel [Max Level] - Sets an NPC's Maximum Level");
c->Message(Chat::White, "Usage: #npcedit scalerate [Scale Rate] - Sets an NPC's Scaling Rate [50 = 50%, 100 = 100%, 200 = 200%]");
c->Message(Chat::White, "Usage: #npcedit emoteid [Emote ID] - Sets an NPC's Emote ID");
c->Message(Chat::White, "Usage: #npcedit spellscale [Scale Rate] - Sets an NPC's Spell Scaling Rate [50 = 50%, 100 = 100%, 200 = 200%]");
c->Message(Chat::White, "Usage: #npcedit healscale [Scale Rate] - Sets an NPC's Heal Scaling Rate [50 = 50%, 100 = 100%, 200 = 200%]");
c->Message(Chat::White, "Usage: #npcedit no_target [Flag] - Sets an NPC's No Target Hotkey Flag [0 = Not Targetable with Target Hotkey, 1 = Targetable with Target Hotkey]");
c->Message(Chat::White, "Usage: #npcedit raidtarget [Flag] - Sets an NPC's Raid Target Flag [0 = Not a Raid Target, 1 = Raid Target]");
c->Message(Chat::White, "Usage: #npcedit armtexture [Texture] - Sets an NPC's Arm Texture");
c->Message(Chat::White, "Usage: #npcedit bracertexture [Texture] - Sets an NPC's Bracer Texture");
c->Message(Chat::White, "Usage: #npcedit handtexture [Texture] - Sets an NPC's Hand Texture");
c->Message(Chat::White, "Usage: #npcedit legtexture [Texture] - Sets an NPC's Leg Texture");
c->Message(Chat::White, "Usage: #npcedit feettexture [Texture] - Sets an NPC's Feet Texture");
c->Message(Chat::White, "Usage: #npcedit walkspeed [Walk Speed] - Sets an NPC's Walk Speed");
c->Message(Chat::White, "Usage: #npcedit show_name [Flag] - Sets an NPC's Show Name Flag [0 = Hidden, 1 = Shown]");
c->Message(Chat::White, "Usage: #npcedit untargetable [Flag] - Sets an NPC's Untargetable Flag [0 = Targetable, 1 = Untargetable]");
c->Message(Chat::White, "Usage: #npcedit charm_ac [Armor Class] - Sets an NPC's Armor Class while Charmed");
c->Message(Chat::White, "Usage: #npcedit charm_min_dmg [Damage] - Sets an NPC's Minimum Damage while Charmed");
c->Message(Chat::White, "Usage: #npcedit charm_max_dmg [Damage] - Sets an NPC's Maximum Damage while Charmed");
c->Message(Chat::White, "Usage: #npcedit charm_attack_delay [Attack Delay] - Sets an NPC's Attack Delay while Charmed");
c->Message(Chat::White, "Usage: #npcedit charm_accuracy_rating [Accuracy] - Sets an NPC's Accuracy Rating while Charmed");
c->Message(Chat::White, "Usage: #npcedit charm_avoidance_rating [Avoidance] - Sets an NPC's Avoidance Rating while Charmed");
c->Message(Chat::White, "Usage: #npcedit charm_atk [Attack] - Sets an NPC's Attack while Charmed");
c->Message(Chat::White, "Usage: #npcedit skip_global_loot [Flag] - Sets an NPC's Skip Global Loot Flag [0 = Don't Skip, 1 = Skip");
c->Message(Chat::White, "Usage: #npcedit rarespawn [Flag] - Sets an NPC's Rare Spawn Flag [0 = Not a Rare Spawn, 1 = Rare Spawn]");
c->Message(Chat::White, "Usage: #npcedit stuck_behavior [Stuck Behavior] - Sets an NPC's Stuck Behavior [0 = Run to Target, 1 = Warp to Target, 2 = Take No Action, 3 = Evade Combat]");
c->Message(Chat::White, "Usage: #npcedit model [Race ID] - Sets an NPC's Race Model");
c->Message(Chat::White, "Usage: #npcedit flymode [Fly Mode] - Sets an NPC's Fly Mode [0 = Ground, 1 = Flying, 2 = Levitating, 3 = Water, 4 = Floating, 5 = Levitating While Running]");
c->Message(Chat::White, "Usage: #npcedit always_aggro [Flag] - Sets an NPC's Always Aggro Flag [0 = Does not Always Aggro, 1 = Always Aggro]");
c->Message(Chat::White, "Usage: #npcedit exp_mod [Modifier] - Sets an NPC's Experience Modifier [50 = 50%, 100 = 100%, 200 = 200%]");
c->Message(Chat::White, "Usage: #npcedit heroic_strikethrough [Heroic Strikethrough] - Sets an NPC's Heroic Strikethrough");
c->Message(Chat::White, "Usage: #npcedit faction_amount [Faction Amount] - Sets an NPC's Faction Amount");
c->Message(Chat::White, "Usage: #npcedit keeps_sold_items [Flag] - Sets an NPC's Keeps Sold Items Flag [0 = False, 1 = True]");
c->Message(Chat::White, "Usage: #npcedit is_parcel_merchant [Flag] - Sets an NPC's Parcel Merchant Flag [0 = False, 1 = True]");
c->Message(Chat::White, "Usage: #npcedit setanimation [Animation ID] - Sets an NPC's Animation on Spawn (Stored in spawn2 table)");
c->Message(Chat::White, "Usage: #npcedit respawntime [Respawn Time] - Sets an NPC's Respawn Timer in Seconds (Stored in spawn2 table)");
c->Message(Chat::White, "Usage: #npcedit set_grid [Grid ID] - Sets an NPC's Grid ID");
}
void command_npcedit(Client *c, const Seperator *sep)
{
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
@ -1727,113 +1836,4 @@ void command_npcedit(Client *c, const Seperator *sep)
}
c->Message(Chat::White, d.c_str());
}
void SendNPCEditSubCommands(Client *c)
{
c->Message(Chat::White, "Usage: #npcedit name [Name] - Sets an NPC's Name");
c->Message(Chat::White, "Usage: #npcedit lastname [Last Name] - Sets an NPC's Last Name");
c->Message(Chat::White, "Usage: #npcedit level [Level] - Sets an NPC's Level");
c->Message(Chat::White, "Usage: #npcedit race [Race ID] - Sets an NPC's Race");
c->Message(Chat::White, "Usage: #npcedit class [Class ID] - Sets an NPC's Class");
c->Message(Chat::White, "Usage: #npcedit bodytype [Body Type ID] - Sets an NPC's Bodytype");
c->Message(Chat::White, "Usage: #npcedit hp [HP] - Sets an NPC's HP");
c->Message(Chat::White, "Usage: #npcedit mana [Mana] - Sets an NPC's Mana");
c->Message(Chat::White, "Usage: #npcedit gender [Gender ID] - Sets an NPC's Gender");
c->Message(Chat::White, "Usage: #npcedit texture [Texture] - Sets an NPC's Texture");
c->Message(Chat::White, "Usage: #npcedit helmtexture [Helmet Texture] - Sets an NPC's Helmet Texture");
c->Message(Chat::White, "Usage: #npcedit herosforgemodel [Model Number] - Sets an NPC's Hero's Forge Model");
c->Message(Chat::White, "Usage: #npcedit size [Size] - Sets an NPC's Size");
c->Message(Chat::White, "Usage: #npcedit hpregen [HP Regen] - Sets an NPC's HP Regen Rate Per Tick");
c->Message(Chat::White, "Usage: #npcedit hp_regen_per_second [HP Regen] - Sets an NPC's HP Regen Rate Per Second");
c->Message(Chat::White, "Usage: #npcedit manaregen [Mana Regen] - Sets an NPC's Mana Regen Rate Per Tick");
c->Message(Chat::White, "Usage: #npcedit loottable [Loottable ID] - Sets an NPC's Loottable ID");
c->Message(Chat::White, "Usage: #npcedit merchantid [Merchant ID] - Sets an NPC's Merchant ID");
c->Message(Chat::White, "Usage: #npcedit alt_currency_id [Alternate Currency ID] - Sets an NPC's Alternate Currency ID");
c->Message(Chat::White, "Usage: #npcedit spell [Spell List ID] - Sets an NPC's Spells List ID");
c->Message(Chat::White, "Usage: #npcedit npc_spells_effects_id [Spell Effects ID] - Sets an NPC's Spell Effects ID");
c->Message(Chat::White, "Usage: #npcedit faction [Faction ID] - Sets an NPC's Faction ID");
c->Message(Chat::White, "Usage: #npcedit adventure_template_id [Template ID] - Sets an NPC's Adventure Template ID");
c->Message(Chat::White, "Usage: #npcedit trap_template [Template ID] - Sets an NPC's Trap Template ID");
c->Message(Chat::White, "Usage: #npcedit damage [Minimum] [Maximum] - Sets an NPC's Damage");
c->Message(Chat::White, "Usage: #npcedit attackcount [Attack Count] - Sets an NPC's Attack Count");
c->Message(Chat::White, "Usage: #npcedit special_attacks [Special Attacks] - Sets an NPC's Special Attacks");
c->Message(Chat::White, "Usage: #npcedit special_abilities [Special Abilities] - Sets an NPC's Special Abilities");
c->Message(Chat::White, "Usage: #npcedit aggroradius [Radius] - Sets an NPC's Aggro Radius");
c->Message(Chat::White, "Usage: #npcedit assistradius [Radius] - Sets an NPC's Assist Radius");
c->Message(Chat::White, "Usage: #npcedit featuresave - Saves an NPC's current facial features to the database");
c->Message(Chat::White, "Usage: #npcedit armortint_id [Armor Tint ID] - Sets an NPC's Armor Tint ID");
c->Message(Chat::White, "Usage: #npcedit color [Red] [Green] [Blue] - Sets an NPC's Red, Green, and Blue armor tint");
c->Message(Chat::White, "Usage: #npcedit ammoidfile [ID File] - Sets an NPC's Ammo ID File");
c->Message(Chat::White, "Usage: #npcedit weapon [Primary Model] [Secondary Model] - Sets an NPC's Primary and Secondary Weapon Model");
c->Message(Chat::White, "Usage: #npcedit meleetype [Primary Type] [Secondary Type] - Sets an NPC's Melee Skill Types");
c->Message(Chat::White, "Usage: #npcedit rangedtype [Type] - Sets an NPC's Ranged Skill Type");
c->Message(Chat::White, "Usage: #npcedit runspeed [Run Speed] - Sets an NPC's Run Speed");
c->Message(Chat::White, "Usage: #npcedit mr [Resistance] - Sets an NPC's Magic Resistance");
c->Message(Chat::White, "Usage: #npcedit pr [Resistance] - Sets an NPC's Poison Resistance");
c->Message(Chat::White, "Usage: #npcedit dr [Resistance] - Sets an NPC's Disease Resistance");
c->Message(Chat::White, "Usage: #npcedit fr [Resistance] - Sets an NPC's Fire Resistance");
c->Message(Chat::White, "Usage: #npcedit cr [Resistance] - Sets an NPC's Cold Resistance");
c->Message(Chat::White, "Usage: #npcedit corrup [Resistance] - Sets an NPC's Corruption Resistance");
c->Message(Chat::White, "Usage: #npcedit phr [Resistance] - Sets and NPC's Physical Resistance");
c->Message(Chat::White, "Usage: #npcedit seeinvis [Flag] - Sets an NPC's See Invisible Flag [0 = Cannot See Invisible, 1 = Can See Invisible]");
c->Message(Chat::White, "Usage: #npcedit seeinvisundead [Flag] - Sets an NPC's See Invisible vs. Undead Flag [0 = Cannot See Invisible vs. Undead, 1 = Can See Invisible vs. Undead]");
c->Message(Chat::White, "Usage: #npcedit qglobal [Flag] - Sets an NPC's Quest Global Flag [0 = Quest Globals Off, 1 = Quest Globals On]");
c->Message(Chat::White, "Usage: #npcedit ac [Armor Class] - Sets an NPC's Armor Class");
c->Message(Chat::White, "Usage: #npcedit npcaggro [Flag] - Sets an NPC's NPC Aggro Flag [0 = Aggro NPCs Off, 1 = Aggro NPCs On]");
c->Message(Chat::White, "Usage: #npcedit spawn_limit [Limit] - Sets an NPC's Spawn Limit Counter");
c->Message(Chat::White, "Usage: #npcedit attackspeed [Attack Speed] - Sets an NPC's Attack Speed Modifier");
c->Message(Chat::White, "Usage: #npcedit attackdelay [Attack Delay] - Sets an NPC's Attack Delay");
c->Message(Chat::White, "Usage: #npcedit findable [Flag] - Sets an NPC's Findable Flag [0 = Not Findable, 1 = Findable]");
c->Message(Chat::White, "Usage: #npcedit str [Strength] - Sets an NPC's Strength");
c->Message(Chat::White, "Usage: #npcedit sta [Stamina] - Sets an NPC's Stamina");
c->Message(Chat::White, "Usage: #npcedit agi [Agility] - Sets an NPC's Agility");
c->Message(Chat::White, "Usage: #npcedit dex [Dexterity] - Sets an NPC's Dexterity");
c->Message(Chat::White, "Usage: #npcedit int [Intelligence] - Sets an NPC's Intelligence");
c->Message(Chat::White, "Usage: #npcedit wis [Wisdom] - Sets an NPC's Wisdom");
c->Message(Chat::White, "Usage: #npcedit cha [Charisma] - Sets an NPC's Charisma");
c->Message(Chat::White, "Usage: #npcedit seehide [Flag] - Sets an NPC's See Hide Flag [0 = Cannot See Hide, 1 = Can See Hide]");
c->Message(Chat::White, "Usage: #npcedit seeimprovedhide [Flag] - Sets an NPC's See Improved Hide Flag [0 = Cannot See Improved Hide, 1 = Can See Improved Hide]");
c->Message(Chat::White, "Usage: #npcedit trackable [Flag] - Sets an NPC's Trackable Flag [0 = Not Trackable, 1 = Trackable]");
c->Message(Chat::White, "Usage: #npcedit atk [Attack] - Sets an NPC's Attack");
c->Message(Chat::White, "Usage: #npcedit accuracy [Accuracy] - Sets an NPC's Accuracy");
c->Message(Chat::White, "Usage: #npcedit avoidance [Avoidance] - Sets an NPC's Avoidance");
c->Message(Chat::White, "Usage: #npcedit slow_mitigation [Slow Mitigation] - Sets an NPC's Slow Mitigation");
c->Message(Chat::White, "Usage: #npcedit version [Version] - Sets an NPC's Version");
c->Message(Chat::White, "Usage: #npcedit maxlevel [Max Level] - Sets an NPC's Maximum Level");
c->Message(Chat::White, "Usage: #npcedit scalerate [Scale Rate] - Sets an NPC's Scaling Rate [50 = 50%, 100 = 100%, 200 = 200%]");
c->Message(Chat::White, "Usage: #npcedit emoteid [Emote ID] - Sets an NPC's Emote ID");
c->Message(Chat::White, "Usage: #npcedit spellscale [Scale Rate] - Sets an NPC's Spell Scaling Rate [50 = 50%, 100 = 100%, 200 = 200%]");
c->Message(Chat::White, "Usage: #npcedit healscale [Scale Rate] - Sets an NPC's Heal Scaling Rate [50 = 50%, 100 = 100%, 200 = 200%]");
c->Message(Chat::White, "Usage: #npcedit no_target [Flag] - Sets an NPC's No Target Hotkey Flag [0 = Not Targetable with Target Hotkey, 1 = Targetable with Target Hotkey]");
c->Message(Chat::White, "Usage: #npcedit raidtarget [Flag] - Sets an NPC's Raid Target Flag [0 = Not a Raid Target, 1 = Raid Target]");
c->Message(Chat::White, "Usage: #npcedit armtexture [Texture] - Sets an NPC's Arm Texture");
c->Message(Chat::White, "Usage: #npcedit bracertexture [Texture] - Sets an NPC's Bracer Texture");
c->Message(Chat::White, "Usage: #npcedit handtexture [Texture] - Sets an NPC's Hand Texture");
c->Message(Chat::White, "Usage: #npcedit legtexture [Texture] - Sets an NPC's Leg Texture");
c->Message(Chat::White, "Usage: #npcedit feettexture [Texture] - Sets an NPC's Feet Texture");
c->Message(Chat::White, "Usage: #npcedit walkspeed [Walk Speed] - Sets an NPC's Walk Speed");
c->Message(Chat::White, "Usage: #npcedit show_name [Flag] - Sets an NPC's Show Name Flag [0 = Hidden, 1 = Shown]");
c->Message(Chat::White, "Usage: #npcedit untargetable [Flag] - Sets an NPC's Untargetable Flag [0 = Targetable, 1 = Untargetable]");
c->Message(Chat::White, "Usage: #npcedit charm_ac [Armor Class] - Sets an NPC's Armor Class while Charmed");
c->Message(Chat::White, "Usage: #npcedit charm_min_dmg [Damage] - Sets an NPC's Minimum Damage while Charmed");
c->Message(Chat::White, "Usage: #npcedit charm_max_dmg [Damage] - Sets an NPC's Maximum Damage while Charmed");
c->Message(Chat::White, "Usage: #npcedit charm_attack_delay [Attack Delay] - Sets an NPC's Attack Delay while Charmed");
c->Message(Chat::White, "Usage: #npcedit charm_accuracy_rating [Accuracy] - Sets an NPC's Accuracy Rating while Charmed");
c->Message(Chat::White, "Usage: #npcedit charm_avoidance_rating [Avoidance] - Sets an NPC's Avoidance Rating while Charmed");
c->Message(Chat::White, "Usage: #npcedit charm_atk [Attack] - Sets an NPC's Attack while Charmed");
c->Message(Chat::White, "Usage: #npcedit skip_global_loot [Flag] - Sets an NPC's Skip Global Loot Flag [0 = Don't Skip, 1 = Skip");
c->Message(Chat::White, "Usage: #npcedit rarespawn [Flag] - Sets an NPC's Rare Spawn Flag [0 = Not a Rare Spawn, 1 = Rare Spawn]");
c->Message(Chat::White, "Usage: #npcedit stuck_behavior [Stuck Behavior] - Sets an NPC's Stuck Behavior [0 = Run to Target, 1 = Warp to Target, 2 = Take No Action, 3 = Evade Combat]");
c->Message(Chat::White, "Usage: #npcedit model [Race ID] - Sets an NPC's Race Model");
c->Message(Chat::White, "Usage: #npcedit flymode [Fly Mode] - Sets an NPC's Fly Mode [0 = Ground, 1 = Flying, 2 = Levitating, 3 = Water, 4 = Floating, 5 = Levitating While Running]");
c->Message(Chat::White, "Usage: #npcedit always_aggro [Flag] - Sets an NPC's Always Aggro Flag [0 = Does not Always Aggro, 1 = Always Aggro]");
c->Message(Chat::White, "Usage: #npcedit exp_mod [Modifier] - Sets an NPC's Experience Modifier [50 = 50%, 100 = 100%, 200 = 200%]");
c->Message(Chat::White, "Usage: #npcedit heroic_strikethrough [Heroic Strikethrough] - Sets an NPC's Heroic Strikethrough");
c->Message(Chat::White, "Usage: #npcedit faction_amount [Faction Amount] - Sets an NPC's Faction Amount");
c->Message(Chat::White, "Usage: #npcedit keeps_sold_items [Flag] - Sets an NPC's Keeps Sold Items Flag [0 = False, 1 = True]");
c->Message(Chat::White, "Usage: #npcedit is_parcel_merchant [Flag] - Sets an NPC's Parcel Merchant Flag [0 = False, 1 = True]");
c->Message(Chat::White, "Usage: #npcedit setanimation [Animation ID] - Sets an NPC's Animation on Spawn (Stored in spawn2 table)");
c->Message(Chat::White, "Usage: #npcedit respawntime [Respawn Time] - Sets an NPC's Respawn Timer in Seconds (Stored in spawn2 table)");
c->Message(Chat::White, "Usage: #npcedit set_grid [Grid ID] - Sets an NPC's Grid ID");
}
}

View File

@ -1,9 +1,23 @@
#include "../client.h"
#include "../queryserv.h"
#include "../worldserver.h"
#include "../../common/events/player_events.h"
#include "../../common/events/player_event_logs.h"
#include "../string_ids.h"
extern QueryServ *QServ;
extern WorldServer worldserver;
void SendParcelsSubCommands(Client *c)
{
c->Message(Chat::White, "#parcels listdb [Character Name]");
c->Message(Chat::White, "#parcels listmemory [Character Name] (Must be in the same zone)");
c->Message(
Chat::White,
"#parcels add [Character Name] [item id] [quantity] [note]. To send money use item id of 99990. Quantity is valid for stackable items, charges on an item, or amount of copper."
);
c->Message(Chat::White, "#parcels details [Character Name]");
}
void command_parcels(Client *c, const Seperator *sep)
{
const auto arguments = sep->argnum;
@ -305,15 +319,4 @@ void command_parcels(Client *c, const Seperator *sep)
c->SendParcelDeliveryToWorld(ps);
}
}
}
void SendParcelsSubCommands(Client *c)
{
c->Message(Chat::White, "#parcels listdb [Character Name]");
c->Message(Chat::White, "#parcels listmemory [Character Name] (Must be in the same zone)");
c->Message(
Chat::White,
"#parcels add [Character Name] [item id] [quantity] [note]. To send money use item id of 99990. Quantity is valid for stackable items, charges on an item, or amount of copper."
);
c->Message(Chat::White, "#parcels details [Character Name]");
}
}

View File

@ -1,3 +1,4 @@
#include "../bot.h"
#include "../client.h"
void command_petitems(Client *c, const Seperator *sep)

View File

@ -1,3 +1,4 @@
#include "../../bot.h"
#include "../../client.h"
void SetHaste(Client *c, const Seperator *sep)

View File

@ -273,7 +273,7 @@ void SetZoneData(Client *c, const Seperator *sep)
entity_list.QueueClients(c, outapp);
safe_delete(outapp);
zone_store.LoadZones(content_db);
ZoneStore::Instance()->LoadZones(content_db);
c->Message(
Chat::White,

View File

@ -1,6 +1,22 @@
#include "../../client.h"
#include "../../object.h"
void SendShowInventorySubCommands(Client* c) {
c->Message(Chat::White, "Usage: #show inventory equip - Shows items in Equipment slots");
c->Message(Chat::White, "Usage: #show inventory gen - Shows items in General slots");
c->Message(Chat::White, "Usage: #show inventory cursor - Shows items in Cursor slots");
c->Message(Chat::White, "Usage: #show inventory poss - Shows items in Equipment, General, and Cursor slots");
c->Message(Chat::White, "Usage: #show inventory limbo - Shows items in Limbo slots");
c->Message(Chat::White, "Usage: #show inventory curlim - Shows items in Cursor and Limbo slots");
c->Message(Chat::White, "Usage: #show inventory trib - Shows items in Tribute slots");
c->Message(Chat::White, "Usage: #show inventory bank - Shows items in Bank slots");
c->Message(Chat::White, "Usage: #show inventory shbank - Shows items in Shared Bank slots");
c->Message(Chat::White, "Usage: #show inventory allbank - Shows items in Bank and Shared Bank slots");
c->Message(Chat::White, "Usage: #show inventory trade - Shows items in Trade slots");
c->Message(Chat::White, "Usage: #show inventory world - Shows items in World slots");
c->Message(Chat::White, "Usage: #show inventory all - Shows items in all slots");
}
void ShowInventory(Client *c, const Seperator *sep)
{
const auto arguments = sep->argnum;
@ -432,20 +448,4 @@ void ShowInventory(Client *c, const Seperator *sep)
if (!found_items) {
c->Message(Chat::White, "No items found.");
}
}
void SendShowInventorySubCommands(Client* c) {
c->Message(Chat::White, "Usage: #show inventory equip - Shows items in Equipment slots");
c->Message(Chat::White, "Usage: #show inventory gen - Shows items in General slots");
c->Message(Chat::White, "Usage: #show inventory cursor - Shows items in Cursor slots");
c->Message(Chat::White, "Usage: #show inventory poss - Shows items in Equipment, General, and Cursor slots");
c->Message(Chat::White, "Usage: #show inventory limbo - Shows items in Limbo slots");
c->Message(Chat::White, "Usage: #show inventory curlim - Shows items in Cursor and Limbo slots");
c->Message(Chat::White, "Usage: #show inventory trib - Shows items in Tribute slots");
c->Message(Chat::White, "Usage: #show inventory bank - Shows items in Bank slots");
c->Message(Chat::White, "Usage: #show inventory shbank - Shows items in Shared Bank slots");
c->Message(Chat::White, "Usage: #show inventory allbank - Shows items in Bank and Shared Bank slots");
c->Message(Chat::White, "Usage: #show inventory trade - Shows items in Trade slots");
c->Message(Chat::White, "Usage: #show inventory world - Shows items in World slots");
c->Message(Chat::White, "Usage: #show inventory all - Shows items in all slots");
}
}

View File

@ -176,7 +176,7 @@ void command_task(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"Assigned {} (ID {}) to {}.",
task_manager->GetTaskName(task_id),
TaskManager::Instance()->GetTaskName(task_id),
task_id,
c->GetTargetDescription(t)
).c_str()
@ -197,7 +197,7 @@ void command_task(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"Successfully completed {} (ID {}) for {}.",
task_manager->GetTaskName(task_id),
TaskManager::Instance()->GetTaskName(task_id),
task_id,
c->GetTargetDescription(t)
).c_str()
@ -207,7 +207,7 @@ void command_task(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"Failed to complete {} (ID {}) for {}.",
task_manager->GetTaskName(task_id),
TaskManager::Instance()->GetTaskName(task_id),
task_id,
c->GetTargetDescription(t)
).c_str()
@ -220,7 +220,7 @@ void command_task(Client *c, const Seperator *sep)
"{} {} not have not {} (ID {}) assigned to them.",
c->GetTargetDescription(t, TargetDescriptionType::UCYou),
c == t ? "do" : "does",
task_manager->GetTaskName(task_id),
TaskManager::Instance()->GetTaskName(task_id),
task_id
).c_str()
);
@ -256,7 +256,7 @@ void command_task(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"Attempting to reload {} (ID {}).",
task_manager->GetTaskName(task_id),
TaskManager::Instance()->GetTaskName(task_id),
task_id
).c_str()
);
@ -265,7 +265,7 @@ void command_task(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"Successfully reloaded {} (ID {}).",
task_manager->GetTaskName(task_id),
TaskManager::Instance()->GetTaskName(task_id),
task_id
).c_str()
);
@ -309,7 +309,7 @@ void command_task(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"Successfully uncompleted {} (ID {}) for {}.",
task_manager->GetTaskName(task_id),
TaskManager::Instance()->GetTaskName(task_id),
task_id,
c->GetTargetDescription(t)
).c_str()
@ -321,7 +321,7 @@ void command_task(Client *c, const Seperator *sep)
"{} {} not completed {} (ID {}).",
c->GetTargetDescription(t, TargetDescriptionType::UCYou),
c == t ? "have" : "has",
task_manager->GetTaskName(task_id),
TaskManager::Instance()->GetTaskName(task_id),
task_id
).c_str()
);
@ -344,7 +344,7 @@ void command_task(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"Updating {} (ID {}), activity {} with a count of {} for {}.",
task_manager->GetTaskName(task_id),
TaskManager::Instance()->GetTaskName(task_id),
task_id,
activity_id,
count,

View File

@ -1,3 +1,4 @@
#include "../bot.h"
#include "../client.h"
void command_zone(Client *c, const Seperator *sep)
@ -25,7 +26,7 @@ void command_zone(Client *c, const Seperator *sep)
}
else {
// validate
if (!zone_store.GetZone(zone_input)) {
if (!ZoneStore::Instance()->GetZone(zone_input)) {
c->Message(Chat::White, fmt::format("Could not find zone by short_name [{}]", zone_input).c_str());
return;
}

Some files were not shown because too many files have changed in this diff Show More