mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 17:26:30 +00:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 05f566ad07 | |||
| c7a8d796fc | |||
| 77163ec137 | |||
| e846bb86b6 | |||
| 3e6a3e2168 | |||
| 2aebf1a78a | |||
| 1be7e56b86 | |||
| a0ff9d67a1 | |||
| befee1c729 | |||
| 3d70063a68 | |||
| 4e28bcf85e | |||
| 687d10960a | |||
| 567d46c3d6 | |||
| 53cc2de459 | |||
| cb866cba31 | |||
| e2162c08da | |||
| e657953b8f |
@@ -1,3 +1,47 @@
|
|||||||
|
## [23.7.0] 5/19/2025
|
||||||
|
|
||||||
|
### CLI
|
||||||
|
|
||||||
|
* Add custom database version output ([#4901](https://github.com/EQEmu/Server/pull/4901)) @joligario 2025-05-18
|
||||||
|
* Fix MySQL check in database dumper ([#4897](https://github.com/EQEmu/Server/pull/4897)) @joligario 2025-05-16
|
||||||
|
|
||||||
|
### Commands
|
||||||
|
|
||||||
|
* Add #zonevariable Command ([#4882](https://github.com/EQEmu/Server/pull/4882)) @Kinglykrab 2025-05-15
|
||||||
|
|
||||||
|
### Database
|
||||||
|
|
||||||
|
* Add Custom Database Migrations for Operators ([#4892](https://github.com/EQEmu/Server/pull/4892)) @Akkadius 2025-05-16
|
||||||
|
* Remove Transaction Wrapped Character Save ([#4894](https://github.com/EQEmu/Server/pull/4894)) @Akkadius 2025-05-16
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Deadlock on failed #copycharacter commands ([#4887](https://github.com/EQEmu/Server/pull/4887)) @Akkadius 2025-05-16
|
||||||
|
|
||||||
|
### Logging
|
||||||
|
|
||||||
|
* Auto Update Log Category Names ([#4890](https://github.com/EQEmu/Server/pull/4890)) @Akkadius 2025-05-16
|
||||||
|
|
||||||
|
### Netcode
|
||||||
|
|
||||||
|
* Resend Logic Adjustments ([#4900](https://github.com/EQEmu/Server/pull/4900)) @Akkadius 2025-05-18
|
||||||
|
|
||||||
|
### Player Events
|
||||||
|
|
||||||
|
* Add rule to ignore configured GM commands ([#4888](https://github.com/EQEmu/Server/pull/4888)) @Akkadius 2025-05-16
|
||||||
|
|
||||||
|
### Rules
|
||||||
|
|
||||||
|
* Auto Update Rule Notes from Source ([#4891](https://github.com/EQEmu/Server/pull/4891)) @Akkadius 2025-05-16
|
||||||
|
|
||||||
|
### World
|
||||||
|
|
||||||
|
* Fix Rarer Reload Deadlock ([#4893](https://github.com/EQEmu/Server/pull/4893)) @Akkadius 2025-05-16
|
||||||
|
|
||||||
|
### Zone State
|
||||||
|
|
||||||
|
* Load New Spawn2 Data When Present ([#4889](https://github.com/EQEmu/Server/pull/4889)) @Akkadius 2025-05-16
|
||||||
|
|
||||||
## [23.6.0] 5/14/2025
|
## [23.6.0] 5/14/2025
|
||||||
|
|
||||||
### Bots
|
### Bots
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ IF(USE_MAP_MMFS)
|
|||||||
ENDIF (USE_MAP_MMFS)
|
ENDIF (USE_MAP_MMFS)
|
||||||
|
|
||||||
IF(MSVC)
|
IF(MSVC)
|
||||||
|
add_compile_options(/bigobj)
|
||||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
|
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
|
||||||
ADD_DEFINITIONS(-DNOMINMAX)
|
ADD_DEFINITIONS(-DNOMINMAX)
|
||||||
ADD_DEFINITIONS(-DCRASH_LOGGING)
|
ADD_DEFINITIONS(-DCRASH_LOGGING)
|
||||||
|
|||||||
@@ -1,19 +1,24 @@
|
|||||||
#include "data_bucket.h"
|
#include "../common/data_bucket.h"
|
||||||
#include "zonedb.h"
|
#include "database.h"
|
||||||
#include "mob.h"
|
|
||||||
#include "client.h"
|
|
||||||
#include "worldserver.h"
|
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include "../common/json/json.hpp"
|
#include "../common/json/json.hpp"
|
||||||
|
|
||||||
using json = nlohmann::json;
|
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)
|
void DataBucket::SetData(const std::string &bucket_key, const std::string &bucket_value, std::string expires_time)
|
||||||
{
|
{
|
||||||
auto k = DataBucketKey{
|
auto k = DataBucketKey{
|
||||||
@@ -347,27 +352,6 @@ bool DataBucket::DeleteData(const std::string &bucket_key)
|
|||||||
return DeleteData(DataBucketKey{.key = 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 DataBucket::DeleteData(const DataBucketKey &k)
|
||||||
{
|
{
|
||||||
bool is_nested_key = k.key.find(NESTED_KEY_DELIMITER) != std::string::npos;
|
bool is_nested_key = k.key.find(NESTED_KEY_DELIMITER) != std::string::npos;
|
||||||
@@ -2,11 +2,9 @@
|
|||||||
#define EQEMU_DATABUCKET_H
|
#define EQEMU_DATABUCKET_H
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "../common/types.h"
|
#include "types.h"
|
||||||
#include "../common/repositories/data_buckets_repository.h"
|
#include "repositories/data_buckets_repository.h"
|
||||||
#include "mob.h"
|
#include "json/json_archive_single_line.h"
|
||||||
#include "../common/json/json_archive_single_line.h"
|
|
||||||
#include "../common/servertalk.h"
|
|
||||||
|
|
||||||
struct DataBucketKey {
|
struct DataBucketKey {
|
||||||
std::string key;
|
std::string key;
|
||||||
@@ -46,8 +44,6 @@ public:
|
|||||||
static std::string GetDataExpires(const std::string &bucket_key);
|
static std::string GetDataExpires(const std::string &bucket_key);
|
||||||
static std::string GetDataRemaining(const std::string &bucket_key);
|
static std::string GetDataRemaining(const std::string &bucket_key);
|
||||||
|
|
||||||
static bool GetDataBuckets(Mob *mob);
|
|
||||||
|
|
||||||
// scoped bucket methods
|
// scoped bucket methods
|
||||||
static void SetData(const DataBucketKey &k_);
|
static void SetData(const DataBucketKey &k_);
|
||||||
static bool DeleteData(const DataBucketKey &k);
|
static bool DeleteData(const DataBucketKey &k);
|
||||||
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "../types.h"
|
#include "../types.h"
|
||||||
#include "../http/httplib.h"
|
|
||||||
#include "../repositories/player_event_logs_repository.h"
|
#include "../repositories/player_event_logs_repository.h"
|
||||||
#include "../events/player_events.h"
|
#include "../events/player_events.h"
|
||||||
|
|
||||||
|
|||||||
@@ -177,6 +177,21 @@ void EQEmuConfig::parse_config()
|
|||||||
SharedMemDir = _root["server"]["directories"].get("shared_memory", "shared/").asString();
|
SharedMemDir = _root["server"]["directories"].get("shared_memory", "shared/").asString();
|
||||||
LogDir = _root["server"]["directories"].get("logs", "logs/").asString();
|
LogDir = _root["server"]["directories"].get("logs", "logs/").asString();
|
||||||
|
|
||||||
|
auto load_paths = [&](const std::string& key, std::vector<std::string>& target) {
|
||||||
|
const auto& paths = _root["server"]["directories"][key];
|
||||||
|
if (paths.isArray()) {
|
||||||
|
for (const auto& dir : paths) {
|
||||||
|
if (dir.isString()) {
|
||||||
|
target.push_back(dir.asString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
load_paths("quest_paths", m_quest_directories);
|
||||||
|
load_paths("plugin_paths", m_plugin_directories);
|
||||||
|
load_paths("lua_module_paths", m_lua_module_directories);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logs
|
* Logs
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -120,6 +120,22 @@ class EQEmuConfig
|
|||||||
const std::string &GetUCSHost() const;
|
const std::string &GetUCSHost() const;
|
||||||
uint16 GetUCSPort() const;
|
uint16 GetUCSPort() const;
|
||||||
|
|
||||||
|
std::vector<std::string> GetQuestDirectories() const
|
||||||
|
{
|
||||||
|
return m_quest_directories;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> GetPluginsDirectories() const
|
||||||
|
{
|
||||||
|
return m_plugin_directories;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> GetLuaModuleDirectories() const
|
||||||
|
{
|
||||||
|
return m_lua_module_directories;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// uint16 DynamicCount;
|
// uint16 DynamicCount;
|
||||||
|
|
||||||
// map<string,uint16> StaticZones;
|
// map<string,uint16> StaticZones;
|
||||||
@@ -133,6 +149,11 @@ class EQEmuConfig
|
|||||||
Json::Value _root;
|
Json::Value _root;
|
||||||
static std::string ConfigFile;
|
static std::string ConfigFile;
|
||||||
|
|
||||||
|
std::vector<std::string> m_quest_directories = {};
|
||||||
|
std::vector<std::string> m_plugin_directories = {};
|
||||||
|
std::vector<std::string> m_lua_module_directories = {};
|
||||||
|
|
||||||
|
protected:
|
||||||
void parse_config();
|
void parse_config();
|
||||||
|
|
||||||
EQEmuConfig()
|
EQEmuConfig()
|
||||||
|
|||||||
+14
-4
@@ -454,9 +454,19 @@ void OutF(
|
|||||||
}
|
}
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#define OutF(ls, debug_level, log_category, file, func, line, formatStr, ...) \
|
template<typename... Args>
|
||||||
do { \
|
inline void OutF(
|
||||||
ls.Out(debug_level, log_category, file, func, line, fmt::format(formatStr, ##__VA_ARGS__).c_str()); \
|
EQEmuLogSys& ls,
|
||||||
} while(0)
|
Logs::DebugLevel debug_level,
|
||||||
|
uint16 log_category,
|
||||||
|
const char* file,
|
||||||
|
const char* func,
|
||||||
|
int line,
|
||||||
|
fmt::format_string<Args...> fmt_str,
|
||||||
|
Args&&... args
|
||||||
|
) {
|
||||||
|
std::string formatted = fmt::format(fmt_str, std::forward<Args>(args)...);
|
||||||
|
ls.Out(debug_level, log_category, file, func, line, formatted.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ const uint32 PROCESS_RETENTION_TRUNCATION_TIMER_INTERVAL = 60 * 60 * 1000; // 1
|
|||||||
// general initialization routine
|
// general initialization routine
|
||||||
void PlayerEventLogs::Init()
|
void PlayerEventLogs::Init()
|
||||||
{
|
{
|
||||||
|
|
||||||
m_process_batch_events_timer.SetTimer(RuleI(Logging, BatchPlayerEventProcessIntervalSeconds) * 1000);
|
m_process_batch_events_timer.SetTimer(RuleI(Logging, BatchPlayerEventProcessIntervalSeconds) * 1000);
|
||||||
m_process_retention_truncation_timer.SetTimer(PROCESS_RETENTION_TRUNCATION_TIMER_INTERVAL);
|
m_process_retention_truncation_timer.SetTimer(PROCESS_RETENTION_TRUNCATION_TIMER_INTERVAL);
|
||||||
|
m_database_ping_timer.SetTimer(10 * 1000); // 10 seconds
|
||||||
|
|
||||||
ValidateDatabaseConnection();
|
ValidateDatabaseConnection();
|
||||||
|
|
||||||
@@ -916,6 +916,10 @@ std::string PlayerEventLogs::GetDiscordPayloadFromEvent(const PlayerEvent::Playe
|
|||||||
// general process function, used in world or QS depending on rule Logging:PlayerEventsQSProcess
|
// general process function, used in world or QS depending on rule Logging:PlayerEventsQSProcess
|
||||||
void PlayerEventLogs::Process()
|
void PlayerEventLogs::Process()
|
||||||
{
|
{
|
||||||
|
if (m_database_ping_timer.Check()) {
|
||||||
|
m_database->ping();
|
||||||
|
}
|
||||||
|
|
||||||
if (m_process_batch_events_timer.Check() ||
|
if (m_process_batch_events_timer.Check() ||
|
||||||
m_record_batch_queue.size() >= RuleI(Logging, BatchPlayerEventProcessChunkSize)) {
|
m_record_batch_queue.size() >= RuleI(Logging, BatchPlayerEventProcessChunkSize)) {
|
||||||
ProcessBatchQueue();
|
ProcessBatchQueue();
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ private:
|
|||||||
std::map<PlayerEvent::EventType, EtlSettings> m_etl_settings{};
|
std::map<PlayerEvent::EventType, EtlSettings> m_etl_settings{};
|
||||||
|
|
||||||
// timers
|
// timers
|
||||||
|
Timer m_database_ping_timer; // database ping timer
|
||||||
Timer m_process_batch_events_timer; // events processing timer
|
Timer m_process_batch_events_timer; // events processing timer
|
||||||
Timer m_process_retention_truncation_timer; // timer for truncating events based on retention settings
|
Timer m_process_retention_truncation_timer; // timer for truncating events based on retention settings
|
||||||
|
|
||||||
|
|||||||
@@ -1127,22 +1127,59 @@ void EQ::Net::DaybreakConnection::ProcessResend(int stream)
|
|||||||
auto time_since_first_sent = std::chrono::duration_cast<std::chrono::milliseconds>(now - first_packet.first_sent).count();
|
auto time_since_first_sent = std::chrono::duration_cast<std::chrono::milliseconds>(now - first_packet.first_sent).count();
|
||||||
|
|
||||||
if (time_since_first_sent >= m_owner->m_options.resend_timeout) {
|
if (time_since_first_sent >= m_owner->m_options.resend_timeout) {
|
||||||
|
auto now_ms = std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch()).count();
|
||||||
|
auto first_sent_ms = std::chrono::duration_cast<std::chrono::milliseconds>(first_packet.first_sent.time_since_epoch()).count();
|
||||||
|
LogNetClient(
|
||||||
|
"Closing connection for m_endpoint [{}] m_port [{}] time_since_first_sent [{}] >= m_owner->m_options.resend_timeout [{}] now [{}] first_packet.first_sent [{}]",
|
||||||
|
m_endpoint,
|
||||||
|
m_port,
|
||||||
|
time_since_first_sent,
|
||||||
|
m_owner->m_options.resend_timeout,
|
||||||
|
now_ms,
|
||||||
|
first_sent_ms
|
||||||
|
);
|
||||||
Close();
|
Close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_last_ack - now > std::chrono::milliseconds(1000)) {
|
||||||
|
LogNetClient(
|
||||||
|
"Resetting m_acked_since_last_resend flag for m_endpoint [{}] m_port [{}]",
|
||||||
|
m_endpoint,
|
||||||
|
m_port
|
||||||
|
);
|
||||||
|
m_acked_since_last_resend = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// make sure that the first_packet in the list first_sent time is within the resend_delay and now
|
||||||
|
// if it is not, then we need to resend all packets in the list
|
||||||
|
if (time_since_first_sent <= first_packet.resend_delay && !m_acked_since_last_resend) {
|
||||||
|
LogNetClientDetail(
|
||||||
|
"Not resending packets for m_endpoint [{}] m_port [{}] packets [{}] time_first_sent [{}] resend_delay [{}] m_acked_since_last_resend [{}]",
|
||||||
|
m_endpoint,
|
||||||
|
m_port,
|
||||||
|
s->sent_packets.size(),
|
||||||
|
time_since_first_sent,
|
||||||
|
first_packet.resend_delay,
|
||||||
|
m_acked_since_last_resend
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LogSys.IsLogEnabled(Logs::Detail, Logs::Netcode)) {
|
if (LogSys.IsLogEnabled(Logs::General, Logs::NetClient)) {
|
||||||
size_t total_size = 0;
|
size_t total_size = 0;
|
||||||
for (auto &e: s->sent_packets) {
|
for (auto &e: s->sent_packets) {
|
||||||
total_size += e.second.packet.Length();
|
total_size += e.second.packet.Length();
|
||||||
}
|
}
|
||||||
|
|
||||||
LogNetClient(
|
LogNetClientDetail(
|
||||||
"Resending packets for stream [{}] packet count [{}] total packet size [{}]",
|
"Resending packets for m_endpoint [{}] m_port [{}] packet count [{}] total packet size [{}] m_acked_since_last_resend [{}]",
|
||||||
stream,
|
m_endpoint,
|
||||||
|
m_port,
|
||||||
s->sent_packets.size(),
|
s->sent_packets.size(),
|
||||||
total_size
|
total_size,
|
||||||
|
m_acked_since_last_resend
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1150,9 +1187,12 @@ void EQ::Net::DaybreakConnection::ProcessResend(int stream)
|
|||||||
if (m_resend_packets_sent >= MAX_CLIENT_RECV_PACKETS_PER_WINDOW ||
|
if (m_resend_packets_sent >= MAX_CLIENT_RECV_PACKETS_PER_WINDOW ||
|
||||||
m_resend_bytes_sent >= MAX_CLIENT_RECV_BYTES_PER_WINDOW) {
|
m_resend_bytes_sent >= MAX_CLIENT_RECV_BYTES_PER_WINDOW) {
|
||||||
LogNetClient(
|
LogNetClient(
|
||||||
"Stopping resend because we hit thresholds m_resend_packets_sent [{}] max [{}] m_resend_bytes_sent [{}] max [{}]",
|
"Stopping resend because we hit thresholds for m_endpoint [{}] m_port [{}] m_resend_packets_sent [{}] max [{}] in_queue [{}] m_resend_bytes_sent [{}] max [{}]",
|
||||||
|
m_endpoint,
|
||||||
|
m_port,
|
||||||
m_resend_packets_sent,
|
m_resend_packets_sent,
|
||||||
MAX_CLIENT_RECV_PACKETS_PER_WINDOW,
|
MAX_CLIENT_RECV_PACKETS_PER_WINDOW,
|
||||||
|
s->sent_packets.size(),
|
||||||
m_resend_bytes_sent,
|
m_resend_bytes_sent,
|
||||||
MAX_CLIENT_RECV_BYTES_PER_WINDOW
|
MAX_CLIENT_RECV_BYTES_PER_WINDOW
|
||||||
);
|
);
|
||||||
@@ -1187,11 +1227,13 @@ void EQ::Net::DaybreakConnection::ProcessResend(int stream)
|
|||||||
m_owner->m_options.resend_delay_max
|
m_owner->m_options.resend_delay_max
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_acked_since_last_resend = false;
|
||||||
|
m_last_ack = now;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQ::Net::DaybreakConnection::Ack(int stream, uint16_t seq)
|
void EQ::Net::DaybreakConnection::Ack(int stream, uint16_t seq)
|
||||||
{
|
{
|
||||||
|
|
||||||
auto now = Clock::now();
|
auto now = Clock::now();
|
||||||
auto s = &m_streams[stream];
|
auto s = &m_streams[stream];
|
||||||
auto iter = s->sent_packets.begin();
|
auto iter = s->sent_packets.begin();
|
||||||
@@ -1212,6 +1254,9 @@ void EQ::Net::DaybreakConnection::Ack(int stream, uint16_t seq)
|
|||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_acked_since_last_resend = true;
|
||||||
|
m_last_ack = now;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQ::Net::DaybreakConnection::OutOfOrderAck(int stream, uint16_t seq)
|
void EQ::Net::DaybreakConnection::OutOfOrderAck(int stream, uint16_t seq)
|
||||||
@@ -1229,6 +1274,9 @@ void EQ::Net::DaybreakConnection::OutOfOrderAck(int stream, uint16_t seq)
|
|||||||
|
|
||||||
s->sent_packets.erase(iter);
|
s->sent_packets.erase(iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_acked_since_last_resend = true;
|
||||||
|
m_last_ack = now;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQ::Net::DaybreakConnection::UpdateDataBudget(double budget_add)
|
void EQ::Net::DaybreakConnection::UpdateDataBudget(double budget_add)
|
||||||
|
|||||||
@@ -185,6 +185,8 @@ namespace EQ
|
|||||||
// resend tracking
|
// resend tracking
|
||||||
size_t m_resend_packets_sent = 0;
|
size_t m_resend_packets_sent = 0;
|
||||||
size_t m_resend_bytes_sent = 0;
|
size_t m_resend_bytes_sent = 0;
|
||||||
|
bool m_acked_since_last_resend = false;
|
||||||
|
Timestamp m_last_ack;
|
||||||
|
|
||||||
struct DaybreakSentPacket
|
struct DaybreakSentPacket
|
||||||
{
|
{
|
||||||
|
|||||||
+43
-22
@@ -48,10 +48,23 @@ void PathManager::LoadPaths()
|
|||||||
return dir;
|
return dir;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
auto load_many_paths_fallback = [&](const std::vector<std::string>& dirs, const std::string& fallback, std::vector<std::string>& target) {
|
||||||
|
target.clear();
|
||||||
|
if (!dirs.empty()) {
|
||||||
|
for (const auto& path : dirs) {
|
||||||
|
target.push_back(resolve_path(path));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
target.push_back(resolve_path(fallback));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
load_many_paths_fallback(c->GetQuestDirectories(), c->QuestDir, m_quests_paths);
|
||||||
|
load_many_paths_fallback(c->GetPluginsDirectories(), c->PluginDir, m_plugin_paths);
|
||||||
|
load_many_paths_fallback(c->GetLuaModuleDirectories(), c->LuaModuleDir, m_lua_module_paths);
|
||||||
|
|
||||||
|
// resolve all paths
|
||||||
m_maps_path = resolve_path(c->MapDir, {"maps", "Maps"});
|
m_maps_path = resolve_path(c->MapDir, {"maps", "Maps"});
|
||||||
m_quests_path = resolve_path(c->QuestDir);
|
|
||||||
m_plugins_path = resolve_path(c->PluginDir);
|
|
||||||
m_lua_modules_path = resolve_path(c->LuaModuleDir);
|
|
||||||
m_lua_mods_path = resolve_path("mods");
|
m_lua_mods_path = resolve_path("mods");
|
||||||
m_patch_path = resolve_path(c->PatchDir);
|
m_patch_path = resolve_path(c->PatchDir);
|
||||||
m_opcode_path = resolve_path(c->OpcodeDir);
|
m_opcode_path = resolve_path(c->OpcodeDir);
|
||||||
@@ -62,13 +75,10 @@ void PathManager::LoadPaths()
|
|||||||
std::vector<std::pair<std::string, std::string>> paths = {
|
std::vector<std::pair<std::string, std::string>> paths = {
|
||||||
{"server", m_server_path},
|
{"server", m_server_path},
|
||||||
{"logs", m_log_path},
|
{"logs", m_log_path},
|
||||||
{"lua mods", m_lua_mods_path},
|
|
||||||
{"lua_modules", m_lua_modules_path},
|
|
||||||
{"maps", m_maps_path},
|
{"maps", m_maps_path},
|
||||||
|
{"lua mods", m_lua_mods_path},
|
||||||
{"patches", m_patch_path},
|
{"patches", m_patch_path},
|
||||||
{"opcode", m_opcode_path},
|
{"opcode", m_opcode_path},
|
||||||
{"plugins", m_plugins_path},
|
|
||||||
{"quests", m_quests_path},
|
|
||||||
{"shared_memory", m_shared_memory_path}
|
{"shared_memory", m_shared_memory_path}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -83,6 +93,17 @@ void PathManager::LoadPaths()
|
|||||||
LogInfo("{:>{}} > [{:<{}}]", name, name_width, in_path, path_width);
|
LogInfo("{:>{}} > [{:<{}}]", name, name_width, in_path, path_width);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto log_paths = [&](const std::string& label, const std::vector<std::string>& paths) {
|
||||||
|
if (!paths.empty()) {
|
||||||
|
LogInfo("{:>{}} > [{:<{}}]", label, name_width - 1, Strings::Join(paths, ";"), path_width);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
log_paths("quests", m_quests_paths);
|
||||||
|
log_paths("plugins", m_plugin_paths);
|
||||||
|
log_paths("lua_modules", m_lua_module_paths);
|
||||||
|
|
||||||
LogInfo("{}", Strings::Repeat("-", break_length));
|
LogInfo("{}", Strings::Repeat("-", break_length));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,21 +117,26 @@ const std::string &PathManager::GetMapsPath() const
|
|||||||
return m_maps_path;
|
return m_maps_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &PathManager::GetQuestsPath() const
|
|
||||||
{
|
|
||||||
return m_quests_path;
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::string &PathManager::GetPluginsPath() const
|
|
||||||
{
|
|
||||||
return m_plugins_path;
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::string &PathManager::GetSharedMemoryPath() const
|
const std::string &PathManager::GetSharedMemoryPath() const
|
||||||
{
|
{
|
||||||
return m_shared_memory_path;
|
return m_shared_memory_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> PathManager::GetQuestPaths() const
|
||||||
|
{
|
||||||
|
return m_quests_paths;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> PathManager::GetPluginPaths() const
|
||||||
|
{
|
||||||
|
return m_plugin_paths;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> PathManager::GetLuaModulePaths() const
|
||||||
|
{
|
||||||
|
return m_lua_module_paths;
|
||||||
|
}
|
||||||
|
|
||||||
const std::string &PathManager::GetLogPath() const
|
const std::string &PathManager::GetLogPath() const
|
||||||
{
|
{
|
||||||
return m_log_path;
|
return m_log_path;
|
||||||
@@ -126,11 +152,6 @@ const std::string &PathManager::GetOpcodePath() const
|
|||||||
return m_opcode_path;
|
return m_opcode_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &PathManager::GetLuaModulesPath() const
|
|
||||||
{
|
|
||||||
return m_lua_modules_path;
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::string &PathManager::GetLuaModsPath() const
|
const std::string &PathManager::GetLuaModsPath() const
|
||||||
{
|
{
|
||||||
return m_lua_mods_path;
|
return m_lua_mods_path;
|
||||||
|
|||||||
+10
-4
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
class PathManager {
|
class PathManager {
|
||||||
public:
|
public:
|
||||||
@@ -14,20 +15,25 @@ public:
|
|||||||
[[nodiscard]] const std::string &GetMapsPath() const;
|
[[nodiscard]] const std::string &GetMapsPath() const;
|
||||||
[[nodiscard]] const std::string &GetPatchPath() const;
|
[[nodiscard]] const std::string &GetPatchPath() const;
|
||||||
[[nodiscard]] const std::string &GetOpcodePath() const;
|
[[nodiscard]] const std::string &GetOpcodePath() const;
|
||||||
[[nodiscard]] const std::string &GetPluginsPath() const;
|
|
||||||
[[nodiscard]] const std::string &GetQuestsPath() const;
|
|
||||||
[[nodiscard]] const std::string &GetServerPath() const;
|
[[nodiscard]] const std::string &GetServerPath() const;
|
||||||
[[nodiscard]] const std::string &GetSharedMemoryPath() const;
|
[[nodiscard]] const std::string &GetSharedMemoryPath() const;
|
||||||
|
[[nodiscard]] std::vector<std::string> GetQuestPaths() const;
|
||||||
|
[[nodiscard]] std::vector<std::string> GetPluginPaths() const;
|
||||||
|
[[nodiscard]] std::vector<std::string> GetLuaModulePaths() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string m_log_path;
|
std::string m_log_path;
|
||||||
std::string m_lua_mods_path;
|
std::string m_lua_mods_path;
|
||||||
std::string m_lua_modules_path;
|
|
||||||
std::string m_maps_path;
|
std::string m_maps_path;
|
||||||
std::string m_patch_path;
|
std::string m_patch_path;
|
||||||
std::string m_opcode_path;
|
std::string m_opcode_path;
|
||||||
std::string m_plugins_path;
|
|
||||||
std::string m_quests_path;
|
std::string m_quests_path;
|
||||||
|
std::vector<std::string> m_quests_paths;
|
||||||
|
std::vector<std::string> m_plugin_paths;
|
||||||
|
std::vector<std::string> m_lua_module_paths;
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
std::string m_server_path;
|
std::string m_server_path;
|
||||||
std::string m_shared_memory_path;
|
std::string m_shared_memory_path;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -233,6 +233,12 @@ RULE_BOOL(Character, SneakAlwaysSucceedOver100, false, "When sneak skill is over
|
|||||||
RULE_INT(Character, BandolierSwapDelay, 0, "Bandolier swap delay in milliseconds, default is 0")
|
RULE_INT(Character, BandolierSwapDelay, 0, "Bandolier swap delay in milliseconds, default is 0")
|
||||||
RULE_BOOL(Character, EnableHackedFastCampForGM, false, "Enables hacked fast camp for GM clients, if the GM doesn't have a hacked client they'll camp like normal")
|
RULE_BOOL(Character, EnableHackedFastCampForGM, false, "Enables hacked fast camp for GM clients, if the GM doesn't have a hacked client they'll camp like normal")
|
||||||
RULE_BOOL(Character, AlwaysAllowNameChange, false, "Enable this option to allow /changename to work without enabling a name change via scripts.")
|
RULE_BOOL(Character, AlwaysAllowNameChange, false, "Enable this option to allow /changename to work without enabling a name change via scripts.")
|
||||||
|
RULE_BOOL(Character, EnableAutoAFK, true, "Enable or disable the auto AFK feature, cuts down on packet spam")
|
||||||
|
RULE_BOOL(Character, AutoIdleFilterPackets, true, "Enable or disable filtering packets when auto AFK is enabled, heavily cuts down on packet spam in zones with lots of players")
|
||||||
|
RULE_INT(Character, SecondsBeforeIdleCombatZone, 600, "Seconds before a player is considered idle in combat zones (600 = 10 minutes)")
|
||||||
|
RULE_INT(Character, SecondsBeforeIdleNonCombatZone, 60, "Seconds before a player is considered idle in non-combat zones (60 = 1 minute)")
|
||||||
|
RULE_INT(Character, SecondsBeforeAFKCombatZone, 1800, "Seconds before a player is considered AFK in combat zones (1800 = 30 minutes)")
|
||||||
|
RULE_INT(Character, SecondsBeforeAFKNonCombatZone, 600, "Seconds before a player is considered AFK in non-combat zones (600 = 10 minutes)")
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
RULE_CATEGORY(Mercs)
|
RULE_CATEGORY(Mercs)
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ enum class SharedTaskRequestGroupType {
|
|||||||
struct ServerSharedTaskRequest_Struct {
|
struct ServerSharedTaskRequest_Struct {
|
||||||
uint32 requested_character_id;
|
uint32 requested_character_id;
|
||||||
uint32 requested_task_id;
|
uint32 requested_task_id;
|
||||||
uint32 requested_npc_type_id; // original task logic passthrough
|
uint32 requested_npc_entity_id; // original task logic passthrough
|
||||||
uint32 accept_time;
|
uint32 accept_time;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
// Build variables
|
// Build variables
|
||||||
// these get injected during the build pipeline
|
// these get injected during the build pipeline
|
||||||
#define CURRENT_VERSION "23.6.0-dev" // always append -dev to the current version for custom-builds
|
#define CURRENT_VERSION "23.7.0-dev" // always append -dev to the current version for custom-builds
|
||||||
#define LOGIN_VERSION "0.8.0"
|
#define LOGIN_VERSION "0.8.0"
|
||||||
#define COMPILE_DATE __DATE__
|
#define COMPILE_DATE __DATE__
|
||||||
#define COMPILE_TIME __TIME__
|
#define COMPILE_TIME __TIME__
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "eqemu-server",
|
"name": "eqemu-server",
|
||||||
"version": "23.6.0",
|
"version": "23.7.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/EQEmu/Server.git"
|
"url": "https://github.com/EQEmu/Server.git"
|
||||||
|
|||||||
+1
-1
Submodule submodules/libuv updated: 0c1fa696aa...8fb9cb9194
@@ -1,6 +1,8 @@
|
|||||||
module should-release
|
module should-release
|
||||||
|
|
||||||
go 1.18
|
go 1.23.0
|
||||||
|
|
||||||
|
toolchain go1.23.5
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/google/go-github/v41 v41.0.0
|
github.com/google/go-github/v41 v41.0.0
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ SET(world_sources
|
|||||||
cliententry.cpp
|
cliententry.cpp
|
||||||
clientlist.cpp
|
clientlist.cpp
|
||||||
console.cpp
|
console.cpp
|
||||||
|
../common/data_bucket.cpp
|
||||||
dynamic_zone.cpp
|
dynamic_zone.cpp
|
||||||
dynamic_zone_manager.cpp
|
dynamic_zone_manager.cpp
|
||||||
eql_config.cpp
|
eql_config.cpp
|
||||||
@@ -42,6 +43,7 @@ SET(world_headers
|
|||||||
cliententry.h
|
cliententry.h
|
||||||
clientlist.h
|
clientlist.h
|
||||||
console.h
|
console.h
|
||||||
|
../common/data_bucket.h
|
||||||
dynamic_zone.h
|
dynamic_zone.h
|
||||||
dynamic_zone_manager.h
|
dynamic_zone_manager.h
|
||||||
eql_config.h
|
eql_config.h
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ void WorldserverCLI::DatabaseVersion(int argc, char **argv, argh::parser &cmd, s
|
|||||||
|
|
||||||
v["database_version"] = CURRENT_BINARY_DATABASE_VERSION;
|
v["database_version"] = CURRENT_BINARY_DATABASE_VERSION;
|
||||||
v["bots_database_version"] = RuleB(Bots, Enabled) ? CURRENT_BINARY_BOTS_DATABASE_VERSION : 0;
|
v["bots_database_version"] = RuleB(Bots, Enabled) ? CURRENT_BINARY_BOTS_DATABASE_VERSION : 0;
|
||||||
|
v["custom_database_version"] = CUSTOM_BINARY_DATABASE_VERSION;
|
||||||
|
|
||||||
std::stringstream payload;
|
std::stringstream payload;
|
||||||
payload << v;
|
payload << v;
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ void WorldserverCLI::Version(int argc, char **argv, argh::parser &cmd, std::stri
|
|||||||
j["bots_database_version"] = CURRENT_BINARY_BOTS_DATABASE_VERSION;
|
j["bots_database_version"] = CURRENT_BINARY_BOTS_DATABASE_VERSION;
|
||||||
j["compile_date"] = COMPILE_DATE;
|
j["compile_date"] = COMPILE_DATE;
|
||||||
j["compile_time"] = COMPILE_TIME;
|
j["compile_time"] = COMPILE_TIME;
|
||||||
|
j["custom_database_version"] = CUSTOM_BINARY_DATABASE_VERSION;
|
||||||
j["database_version"] = CURRENT_BINARY_DATABASE_VERSION;
|
j["database_version"] = CURRENT_BINARY_DATABASE_VERSION;
|
||||||
j["server_version"] = CURRENT_VERSION;
|
j["server_version"] = CURRENT_VERSION;
|
||||||
|
|
||||||
|
|||||||
+15
-3
@@ -95,9 +95,22 @@ void ConsoleApi(
|
|||||||
BenchTimer timer;
|
BenchTimer timer;
|
||||||
timer.reset();
|
timer.reset();
|
||||||
|
|
||||||
EQEmuApiWorldDataService::get(response, args);
|
std::string method = args.empty() ? "" : args[0];
|
||||||
|
|
||||||
std::string method = args[0];
|
if (method.empty()) {
|
||||||
|
root["execution_time"] = std::to_string(timer.elapsed());
|
||||||
|
root["method"] = method;
|
||||||
|
root["data"] = response;
|
||||||
|
root["error"] = "No method specified";
|
||||||
|
|
||||||
|
std::stringstream payload;
|
||||||
|
payload << root;
|
||||||
|
connection->SendLine(payload.str());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Safe to call now that args[0] is known to exist
|
||||||
|
EQEmuApiWorldDataService::get(response, args);
|
||||||
|
|
||||||
root["execution_time"] = std::to_string(timer.elapsed());
|
root["execution_time"] = std::to_string(timer.elapsed());
|
||||||
root["method"] = method;
|
root["method"] = method;
|
||||||
@@ -105,7 +118,6 @@ void ConsoleApi(
|
|||||||
|
|
||||||
std::stringstream payload;
|
std::stringstream payload;
|
||||||
payload << root;
|
payload << root;
|
||||||
|
|
||||||
connection->SendLine(payload.str());
|
connection->SendLine(payload.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,10 @@ void callGetZoneList(Json::Value &response)
|
|||||||
for (auto &zone: zoneserver_list.getZoneServerList()) {
|
for (auto &zone: zoneserver_list.getZoneServerList()) {
|
||||||
Json::Value row;
|
Json::Value row;
|
||||||
|
|
||||||
|
if (!zone) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (!zone->IsConnected()) {
|
if (!zone->IsConnected()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-12
@@ -182,7 +182,8 @@ int main(int argc, char **argv)
|
|||||||
EQTimeTimer.Start(600000);
|
EQTimeTimer.Start(600000);
|
||||||
Timer parcel_prune_timer(86400000);
|
Timer parcel_prune_timer(86400000);
|
||||||
parcel_prune_timer.Start(86400000);
|
parcel_prune_timer.Start(86400000);
|
||||||
|
Timer player_event_log_process(1000);
|
||||||
|
player_event_log_process.Start(1000);
|
||||||
|
|
||||||
// global loads
|
// global loads
|
||||||
LogInfo("Loading launcher list");
|
LogInfo("Loading launcher list");
|
||||||
@@ -385,15 +386,6 @@ int main(int argc, char **argv)
|
|||||||
player_event_logs.Init();
|
player_event_logs.Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto event_log_processor = std::jthread([](const std::stop_token& stoken) {
|
|
||||||
while (!stoken.stop_requested()) {
|
|
||||||
if (!RuleB(Logging, PlayerEventsQSProcess)) {
|
|
||||||
player_event_logs.Process();
|
|
||||||
}
|
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
auto loop_fn = [&](EQ::Timer* t) {
|
auto loop_fn = [&](EQ::Timer* t) {
|
||||||
Timer::SetCurrentTime();
|
Timer::SetCurrentTime();
|
||||||
|
|
||||||
@@ -487,6 +479,12 @@ int main(int argc, char **argv)
|
|||||||
shared_task_manager.Process();
|
shared_task_manager.Process();
|
||||||
dynamic_zone_manager.Process();
|
dynamic_zone_manager.Process();
|
||||||
|
|
||||||
|
if (!RuleB(Logging, PlayerEventsQSProcess)) {
|
||||||
|
if (player_event_log_process.Check()) {
|
||||||
|
player_event_logs.Process();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (InterserverTimer.Check()) {
|
if (InterserverTimer.Check()) {
|
||||||
InterserverTimer.Start();
|
InterserverTimer.Start();
|
||||||
database.ping();
|
database.ping();
|
||||||
@@ -506,8 +504,6 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
EQ::EventLoop::Get().Run();
|
EQ::EventLoop::Get().Run();
|
||||||
|
|
||||||
event_log_processor.request_stop();
|
|
||||||
|
|
||||||
LogInfo("World main loop completed");
|
LogInfo("World main loop completed");
|
||||||
LogInfo("Shutting down zone connections (if any)");
|
LogInfo("Shutting down zone connections (if any)");
|
||||||
zoneserver_list.KillAll();
|
zoneserver_list.KillAll();
|
||||||
|
|||||||
@@ -679,7 +679,7 @@ void SharedTaskManager::SendAcceptNewSharedTaskPacket(
|
|||||||
auto d = reinterpret_cast<ServerSharedTaskRequest_Struct *>(p->pBuffer);
|
auto d = reinterpret_cast<ServerSharedTaskRequest_Struct *>(p->pBuffer);
|
||||||
d->requested_character_id = character_id;
|
d->requested_character_id = character_id;
|
||||||
d->requested_task_id = task_id;
|
d->requested_task_id = task_id;
|
||||||
d->requested_npc_type_id = npc_context_id;
|
d->requested_npc_entity_id = npc_context_id;
|
||||||
d->accept_time = accept_time;
|
d->accept_time = accept_time;
|
||||||
|
|
||||||
// get requested character zone server
|
// get requested character zone server
|
||||||
|
|||||||
@@ -24,16 +24,16 @@ void SharedTaskWorldMessaging::HandleZoneMessage(ServerPacket *pack)
|
|||||||
case ServerOP_SharedTaskRequest: {
|
case ServerOP_SharedTaskRequest: {
|
||||||
auto *r = (ServerSharedTaskRequest_Struct *) pack->pBuffer;
|
auto *r = (ServerSharedTaskRequest_Struct *) pack->pBuffer;
|
||||||
LogTasksDetail(
|
LogTasksDetail(
|
||||||
"[ServerOP_SharedTaskRequest] Received request from character [{}] task_id [{}] npc_type_id [{}]",
|
"[ServerOP_SharedTaskRequest] Received request from character [{}] task_id [{}] npc_entity_id [{}]",
|
||||||
r->requested_character_id,
|
r->requested_character_id,
|
||||||
r->requested_task_id,
|
r->requested_task_id,
|
||||||
r->requested_npc_type_id
|
r->requested_npc_entity_id
|
||||||
);
|
);
|
||||||
|
|
||||||
shared_task_manager.AttemptSharedTaskCreation(
|
shared_task_manager.AttemptSharedTaskCreation(
|
||||||
r->requested_task_id,
|
r->requested_task_id,
|
||||||
r->requested_character_id,
|
r->requested_character_id,
|
||||||
r->requested_npc_type_id
|
r->requested_npc_entity_id
|
||||||
);
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -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/repositories/player_event_logs_repository.h"
|
||||||
#include "../common/events/player_event_logs.h"
|
#include "../common/events/player_event_logs.h"
|
||||||
#include "../common/patches/patches.h"
|
#include "../common/patches/patches.h"
|
||||||
#include "../zone/data_bucket.h"
|
|
||||||
#include "../common/repositories/guild_tributes_repository.h"
|
#include "../common/repositories/guild_tributes_repository.h"
|
||||||
#include "../common/skill_caps.h"
|
#include "../common/skill_caps.h"
|
||||||
#include "../common/server_reload_types.h"
|
#include "../common/server_reload_types.h"
|
||||||
|
|||||||
+254
-59
@@ -12,7 +12,6 @@ SET(zone_sources
|
|||||||
bonuses.cpp
|
bonuses.cpp
|
||||||
bot.cpp
|
bot.cpp
|
||||||
bot_raid.cpp
|
bot_raid.cpp
|
||||||
bot_command.cpp
|
|
||||||
bot_database.cpp
|
bot_database.cpp
|
||||||
botspellsai.cpp
|
botspellsai.cpp
|
||||||
cheat_manager.cpp
|
cheat_manager.cpp
|
||||||
@@ -23,9 +22,8 @@ SET(zone_sources
|
|||||||
client_packet.cpp
|
client_packet.cpp
|
||||||
client_process.cpp
|
client_process.cpp
|
||||||
combat_record.cpp
|
combat_record.cpp
|
||||||
command.cpp
|
|
||||||
corpse.cpp
|
corpse.cpp
|
||||||
data_bucket.cpp
|
../common/data_bucket.cpp
|
||||||
doors.cpp
|
doors.cpp
|
||||||
dialogue_window.cpp
|
dialogue_window.cpp
|
||||||
dynamic_zone.cpp
|
dynamic_zone.cpp
|
||||||
@@ -48,36 +46,6 @@ SET(zone_sources
|
|||||||
horse.cpp
|
horse.cpp
|
||||||
inventory.cpp
|
inventory.cpp
|
||||||
loot.cpp
|
loot.cpp
|
||||||
lua_bot.cpp
|
|
||||||
lua_bit.cpp
|
|
||||||
lua_buff.cpp
|
|
||||||
lua_corpse.cpp
|
|
||||||
lua_client.cpp
|
|
||||||
lua_database.cpp
|
|
||||||
lua_door.cpp
|
|
||||||
lua_encounter.cpp
|
|
||||||
lua_entity.cpp
|
|
||||||
lua_entity_list.cpp
|
|
||||||
lua_expedition.cpp
|
|
||||||
lua_general.cpp
|
|
||||||
lua_group.cpp
|
|
||||||
lua_hate_list.cpp
|
|
||||||
lua_inventory.cpp
|
|
||||||
lua_item.cpp
|
|
||||||
lua_iteminst.cpp
|
|
||||||
lua_merc.cpp
|
|
||||||
lua_mob.cpp
|
|
||||||
lua_mod.cpp
|
|
||||||
lua_npc.cpp
|
|
||||||
lua_object.cpp
|
|
||||||
lua_packet.cpp
|
|
||||||
lua_parser.cpp
|
|
||||||
lua_parser_events.cpp
|
|
||||||
lua_raid.cpp
|
|
||||||
lua_spawn.cpp
|
|
||||||
lua_spell.cpp
|
|
||||||
lua_stat_bonuses.cpp
|
|
||||||
lua_zone.cpp
|
|
||||||
embperl.cpp
|
embperl.cpp
|
||||||
entity.cpp
|
entity.cpp
|
||||||
exp.cpp
|
exp.cpp
|
||||||
@@ -108,30 +76,6 @@ SET(zone_sources
|
|||||||
pathfinder_nav_mesh.cpp
|
pathfinder_nav_mesh.cpp
|
||||||
pathfinder_null.cpp
|
pathfinder_null.cpp
|
||||||
pathing.cpp
|
pathing.cpp
|
||||||
perl_bot.cpp
|
|
||||||
perl_buff.cpp
|
|
||||||
perl_client.cpp
|
|
||||||
perl_database.cpp
|
|
||||||
perl_doors.cpp
|
|
||||||
perl_entity.cpp
|
|
||||||
perl_expedition.cpp
|
|
||||||
perl_groups.cpp
|
|
||||||
perl_hateentry.cpp
|
|
||||||
perl_inventory.cpp
|
|
||||||
perl_merc.cpp
|
|
||||||
perl_mob.cpp
|
|
||||||
perl_npc.cpp
|
|
||||||
perl_object.cpp
|
|
||||||
perl_perlpacket.cpp
|
|
||||||
perl_player_corpse.cpp
|
|
||||||
perl_questitem.cpp
|
|
||||||
perl_questitem_data.cpp
|
|
||||||
perl_raids.cpp
|
|
||||||
perl_spawn.cpp
|
|
||||||
perl_spell.cpp
|
|
||||||
perl_stat_bonuses.cpp
|
|
||||||
perl_zone.cpp
|
|
||||||
perlpacket.cpp
|
|
||||||
petitions.cpp
|
petitions.cpp
|
||||||
pets.cpp
|
pets.cpp
|
||||||
position.cpp
|
position.cpp
|
||||||
@@ -195,7 +139,7 @@ SET(zone_headers
|
|||||||
command.h
|
command.h
|
||||||
common.h
|
common.h
|
||||||
corpse.h
|
corpse.h
|
||||||
data_bucket.h
|
../common/data_bucket.h
|
||||||
doors.h
|
doors.h
|
||||||
dialogue_window.h
|
dialogue_window.h
|
||||||
dynamic_zone.h
|
dynamic_zone.h
|
||||||
@@ -296,10 +240,247 @@ SET(zone_headers
|
|||||||
zone_save_state.h
|
zone_save_state.h
|
||||||
zone_cli.cpp)
|
zone_cli.cpp)
|
||||||
|
|
||||||
|
# lua unity build
|
||||||
|
set(lua_sources
|
||||||
|
lua_bot.cpp
|
||||||
|
lua_bit.cpp
|
||||||
|
lua_buff.cpp
|
||||||
|
lua_corpse.cpp
|
||||||
|
lua_client.cpp
|
||||||
|
lua_database.cpp
|
||||||
|
lua_door.cpp
|
||||||
|
lua_encounter.cpp
|
||||||
|
lua_entity.cpp
|
||||||
|
lua_entity_list.cpp
|
||||||
|
lua_expedition.cpp
|
||||||
|
lua_general.cpp
|
||||||
|
lua_group.cpp
|
||||||
|
lua_hate_list.cpp
|
||||||
|
lua_inventory.cpp
|
||||||
|
lua_item.cpp
|
||||||
|
lua_iteminst.cpp
|
||||||
|
lua_merc.cpp
|
||||||
|
lua_mob.cpp
|
||||||
|
lua_mod.cpp
|
||||||
|
lua_npc.cpp
|
||||||
|
lua_object.cpp
|
||||||
|
lua_packet.cpp
|
||||||
|
lua_parser.cpp
|
||||||
|
lua_parser_events.cpp
|
||||||
|
lua_raid.cpp
|
||||||
|
lua_spawn.cpp
|
||||||
|
lua_spell.cpp
|
||||||
|
lua_stat_bonuses.cpp
|
||||||
|
lua_zone.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(lua_zone STATIC ${lua_sources})
|
||||||
|
set_target_properties(lua_zone PROPERTIES UNITY_BUILD ON UNITY_BUILD_BATCH_SIZE 8)
|
||||||
|
|
||||||
|
# perl unity build
|
||||||
|
set(perl_sources
|
||||||
|
perl_bot.cpp
|
||||||
|
perl_buff.cpp
|
||||||
|
perl_client.cpp
|
||||||
|
perl_database.cpp
|
||||||
|
perl_doors.cpp
|
||||||
|
perl_entity.cpp
|
||||||
|
perl_expedition.cpp
|
||||||
|
perl_groups.cpp
|
||||||
|
perl_hateentry.cpp
|
||||||
|
perl_inventory.cpp
|
||||||
|
perl_merc.cpp
|
||||||
|
perl_mob.cpp
|
||||||
|
perl_npc.cpp
|
||||||
|
perl_object.cpp
|
||||||
|
perl_perlpacket.cpp
|
||||||
|
perl_player_corpse.cpp
|
||||||
|
perl_questitem.cpp
|
||||||
|
perl_questitem_data.cpp
|
||||||
|
perl_raids.cpp
|
||||||
|
perl_spawn.cpp
|
||||||
|
perl_spell.cpp
|
||||||
|
perl_stat_bonuses.cpp
|
||||||
|
perl_zone.cpp
|
||||||
|
perlpacket.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(perl_zone STATIC ${perl_sources})
|
||||||
|
set_target_properties(perl_zone PROPERTIES UNITY_BUILD ON UNITY_BUILD_BATCH_SIZE 8)
|
||||||
|
|
||||||
|
# gm commands
|
||||||
|
set(gm_command_sources
|
||||||
|
command.cpp
|
||||||
|
bot_command.cpp
|
||||||
|
gm_commands/acceptrules.cpp
|
||||||
|
gm_commands/advnpcspawn.cpp
|
||||||
|
gm_commands/aggrozone.cpp
|
||||||
|
gm_commands/ai.cpp
|
||||||
|
gm_commands/appearance.cpp
|
||||||
|
gm_commands/appearanceeffects.cpp
|
||||||
|
gm_commands/attack.cpp
|
||||||
|
gm_commands/augmentitem.cpp
|
||||||
|
gm_commands/ban.cpp
|
||||||
|
gm_commands/bugs.cpp
|
||||||
|
gm_commands/camerashake.cpp
|
||||||
|
gm_commands/castspell.cpp
|
||||||
|
gm_commands/chat.cpp
|
||||||
|
gm_commands/clearxtargets.cpp
|
||||||
|
gm_commands/copycharacter.cpp
|
||||||
|
gm_commands/corpse.cpp
|
||||||
|
gm_commands/corpsefix.cpp
|
||||||
|
gm_commands/countitem.cpp
|
||||||
|
gm_commands/damage.cpp
|
||||||
|
gm_commands/databuckets.cpp
|
||||||
|
gm_commands/dbspawn2.cpp
|
||||||
|
gm_commands/delacct.cpp
|
||||||
|
gm_commands/delpetition.cpp
|
||||||
|
gm_commands/depop.cpp
|
||||||
|
gm_commands/depopzone.cpp
|
||||||
|
gm_commands/devtools.cpp
|
||||||
|
gm_commands/disablerecipe.cpp
|
||||||
|
gm_commands/disarmtrap.cpp
|
||||||
|
gm_commands/doanim.cpp
|
||||||
|
gm_commands/door.cpp
|
||||||
|
gm_commands/door_manipulation.cpp
|
||||||
|
gm_commands/dye.cpp
|
||||||
|
gm_commands/dz.cpp
|
||||||
|
gm_commands/dzkickplayers.cpp
|
||||||
|
gm_commands/editmassrespawn.cpp
|
||||||
|
gm_commands/emote.cpp
|
||||||
|
gm_commands/emptyinventory.cpp
|
||||||
|
gm_commands/enablerecipe.cpp
|
||||||
|
gm_commands/entityvariable.cpp
|
||||||
|
gm_commands/exptoggle.cpp
|
||||||
|
gm_commands/faction.cpp
|
||||||
|
gm_commands/evolving_items.cpp
|
||||||
|
gm_commands/feature.cpp
|
||||||
|
gm_commands/find.cpp
|
||||||
|
gm_commands/fish.cpp
|
||||||
|
gm_commands/fixmob.cpp
|
||||||
|
gm_commands/flagedit.cpp
|
||||||
|
gm_commands/fleeinfo.cpp
|
||||||
|
gm_commands/forage.cpp
|
||||||
|
gm_commands/gearup.cpp
|
||||||
|
gm_commands/giveitem.cpp
|
||||||
|
gm_commands/givemoney.cpp
|
||||||
|
gm_commands/gmzone.cpp
|
||||||
|
gm_commands/goto.cpp
|
||||||
|
gm_commands/grantaa.cpp
|
||||||
|
gm_commands/grid.cpp
|
||||||
|
gm_commands/guild.cpp
|
||||||
|
gm_commands/hp.cpp
|
||||||
|
gm_commands/illusion_block.cpp
|
||||||
|
gm_commands/instance.cpp
|
||||||
|
gm_commands/interrogateinv.cpp
|
||||||
|
gm_commands/interrupt.cpp
|
||||||
|
gm_commands/invsnapshot.cpp
|
||||||
|
gm_commands/ipban.cpp
|
||||||
|
gm_commands/kick.cpp
|
||||||
|
gm_commands/kill.cpp
|
||||||
|
gm_commands/killallnpcs.cpp
|
||||||
|
gm_commands/list.cpp
|
||||||
|
gm_commands/lootsim.cpp
|
||||||
|
gm_commands/loc.cpp
|
||||||
|
gm_commands/logs.cpp
|
||||||
|
gm_commands/makepet.cpp
|
||||||
|
gm_commands/memspell.cpp
|
||||||
|
gm_commands/merchantshop.cpp
|
||||||
|
gm_commands/modifynpcstat.cpp
|
||||||
|
gm_commands/movechar.cpp
|
||||||
|
gm_commands/movement.cpp
|
||||||
|
gm_commands/myskills.cpp
|
||||||
|
gm_commands/mysql.cpp
|
||||||
|
gm_commands/mystats.cpp
|
||||||
|
gm_commands/npccast.cpp
|
||||||
|
gm_commands/npcedit.cpp
|
||||||
|
gm_commands/npceditmass.cpp
|
||||||
|
gm_commands/npcemote.cpp
|
||||||
|
gm_commands/npcloot.cpp
|
||||||
|
gm_commands/npcsay.cpp
|
||||||
|
gm_commands/npcshout.cpp
|
||||||
|
gm_commands/npcspawn.cpp
|
||||||
|
gm_commands/npctypespawn.cpp
|
||||||
|
gm_commands/nudge.cpp
|
||||||
|
gm_commands/nukebuffs.cpp
|
||||||
|
gm_commands/nukeitem.cpp
|
||||||
|
gm_commands/object.cpp
|
||||||
|
gm_commands/object_manipulation.cpp
|
||||||
|
gm_commands/parcels.cpp
|
||||||
|
gm_commands/path.cpp
|
||||||
|
gm_commands/peqzone.cpp
|
||||||
|
gm_commands/petitems.cpp
|
||||||
|
gm_commands/petname.cpp
|
||||||
|
gm_commands/picklock.cpp
|
||||||
|
gm_commands/profanity.cpp
|
||||||
|
gm_commands/push.cpp
|
||||||
|
gm_commands/raidloot.cpp
|
||||||
|
gm_commands/randomfeatures.cpp
|
||||||
|
gm_commands/refreshgroup.cpp
|
||||||
|
gm_commands/reload.cpp
|
||||||
|
gm_commands/removeitem.cpp
|
||||||
|
gm_commands/repop.cpp
|
||||||
|
gm_commands/resetaa.cpp
|
||||||
|
gm_commands/resetaa_timer.cpp
|
||||||
|
gm_commands/resetdisc_timer.cpp
|
||||||
|
gm_commands/revoke.cpp
|
||||||
|
gm_commands/roambox.cpp
|
||||||
|
gm_commands/rules.cpp
|
||||||
|
gm_commands/save.cpp
|
||||||
|
gm_commands/scale.cpp
|
||||||
|
gm_commands/scribespell.cpp
|
||||||
|
gm_commands/scribespells.cpp
|
||||||
|
gm_commands/sendzonespawns.cpp
|
||||||
|
gm_commands/sensetrap.cpp
|
||||||
|
gm_commands/serverrules.cpp
|
||||||
|
gm_commands/set.cpp
|
||||||
|
gm_commands/show.cpp
|
||||||
|
gm_commands/shutdown.cpp
|
||||||
|
gm_commands/spawn.cpp
|
||||||
|
gm_commands/spawneditmass.cpp
|
||||||
|
gm_commands/spawnfix.cpp
|
||||||
|
gm_commands/faction_association.cpp
|
||||||
|
gm_commands/stun.cpp
|
||||||
|
gm_commands/summon.cpp
|
||||||
|
gm_commands/summonburiedplayercorpse.cpp
|
||||||
|
gm_commands/summonitem.cpp
|
||||||
|
gm_commands/suspend.cpp
|
||||||
|
gm_commands/suspendmulti.cpp
|
||||||
|
gm_commands/takeplatinum.cpp
|
||||||
|
gm_commands/task.cpp
|
||||||
|
gm_commands/traindisc.cpp
|
||||||
|
gm_commands/tune.cpp
|
||||||
|
gm_commands/undye.cpp
|
||||||
|
gm_commands/unmemspell.cpp
|
||||||
|
gm_commands/unmemspells.cpp
|
||||||
|
gm_commands/unscribespell.cpp
|
||||||
|
gm_commands/unscribespells.cpp
|
||||||
|
gm_commands/untraindisc.cpp
|
||||||
|
gm_commands/untraindiscs.cpp
|
||||||
|
gm_commands/wc.cpp
|
||||||
|
gm_commands/worldshutdown.cpp
|
||||||
|
gm_commands/worldwide.cpp
|
||||||
|
gm_commands/wp.cpp
|
||||||
|
gm_commands/wpadd.cpp
|
||||||
|
gm_commands/zone.cpp
|
||||||
|
gm_commands/zonebootup.cpp
|
||||||
|
gm_commands/zoneshutdown.cpp
|
||||||
|
gm_commands/zonevariable.cpp
|
||||||
|
gm_commands/zone_instance.cpp
|
||||||
|
gm_commands/zone_shard.cpp
|
||||||
|
gm_commands/zsave.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(gm_commands_zone STATIC ${gm_command_sources})
|
||||||
|
set_target_properties(gm_commands_zone PROPERTIES UNITY_BUILD ON UNITY_BUILD_BATCH_SIZE 32)
|
||||||
|
|
||||||
|
# zone combine sources and headers
|
||||||
ADD_EXECUTABLE(zone ${zone_sources} ${zone_headers})
|
ADD_EXECUTABLE(zone ${zone_sources} ${zone_headers})
|
||||||
|
|
||||||
|
# binary output directory
|
||||||
INSTALL(TARGETS zone RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
INSTALL(TARGETS zone RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||||
|
|
||||||
|
# precompile headers
|
||||||
IF (WIN32 AND EQEMU_BUILD_PCH)
|
IF (WIN32 AND EQEMU_BUILD_PCH)
|
||||||
TARGET_PRECOMPILE_HEADERS(zone PRIVATE ../common/pch/pch.h)
|
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 ../common/types.h ../common/eqemu_logsys.h ../common/eqemu_logsys_log_aliases.h ../common/features.h ../common/global_define.h)
|
||||||
@@ -308,6 +489,20 @@ ENDIF()
|
|||||||
|
|
||||||
ADD_DEFINITIONS(-DZONE)
|
ADD_DEFINITIONS(-DZONE)
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(zone ${ZONE_LIBS})
|
# link lua_zone unity build against luabind
|
||||||
|
target_link_libraries(lua_zone PRIVATE luabind)
|
||||||
|
if (EQEMU_BUILD_STATIC AND LUA_LIBRARY)
|
||||||
|
target_link_libraries(zone PRIVATE ${LUA_LIBRARY})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# perl unity build links against perl_zone
|
||||||
|
target_link_libraries(perl_zone PRIVATE perlbind)
|
||||||
|
if (EQEMU_BUILD_STATIC AND PERL_LIBRARY)
|
||||||
|
target_link_libraries(zone PRIVATE ${PERL_LIBRARY})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# link zone against common libraries
|
||||||
|
target_link_libraries(zone PRIVATE ${ZONE_LIBS} lua_zone perl_zone gm_commands_zone)
|
||||||
|
|
||||||
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@
|
|||||||
Aura::Aura(NPCType *type_data, Mob *owner, AuraRecord &record)
|
Aura::Aura(NPCType *type_data, Mob *owner, AuraRecord &record)
|
||||||
: NPC(type_data, 0, owner->GetPosition(), GravityBehavior::Flying), spell_id(record.spell_id),
|
: NPC(type_data, 0, owner->GetPosition(), GravityBehavior::Flying), spell_id(record.spell_id),
|
||||||
distance(record.distance),
|
distance(record.distance),
|
||||||
remove_timer(record.duration), movement_timer(100), process_timer(1000), aura_id(-1)
|
remove_timer(record.duration), movement_timer(1000), process_timer(1000), aura_id(-1)
|
||||||
{
|
{
|
||||||
GiveNPCTypeData(type_data); // we will delete this later on
|
GiveNPCTypeData(type_data); // we will delete this later on
|
||||||
m_owner = owner->GetID();
|
m_owner = owner->GetID();
|
||||||
|
|||||||
+1
-1
@@ -3640,7 +3640,7 @@ bool Bot::Spawn(Client* botCharacterOwner) {
|
|||||||
entity_list.AddBot(this, true, true);
|
entity_list.AddBot(this, true, true);
|
||||||
|
|
||||||
ClearDataBucketCache();
|
ClearDataBucketCache();
|
||||||
DataBucket::GetDataBuckets(this);
|
LoadDataBucketsCache();
|
||||||
LoadBotSpellSettings();
|
LoadBotSpellSettings();
|
||||||
if (!AI_AddBotSpells(GetBotSpellID())) {
|
if (!AI_AddBotSpells(GetBotSpellID())) {
|
||||||
GetBotOwner()->CastToClient()->Message(
|
GetBotOwner()->CastToClient()->Message(
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include "../../common/eqemu_logsys.h"
|
#include "../../common/eqemu_logsys.h"
|
||||||
#include "../sidecar_api/sidecar_api.h"
|
#include "../sidecar_api/sidecar_api.h"
|
||||||
#include "../../common/platform.h"
|
#include "../../common/platform.h"
|
||||||
#include "../data_bucket.h"
|
#include "../../common/data_bucket.h"
|
||||||
#include "../zonedb.h"
|
#include "../zonedb.h"
|
||||||
#include "../../common/repositories/data_buckets_repository.h"
|
#include "../../common/repositories/data_buckets_repository.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
#include "../../common/http/httplib.h"
|
|
||||||
#include "../../common/eqemu_logsys.h"
|
#include "../../common/eqemu_logsys.h"
|
||||||
#include "../../common/platform.h"
|
#include "../../common/platform.h"
|
||||||
#include "../../zone.h"
|
#include "../../zone.h"
|
||||||
|
|||||||
+51
-15
@@ -39,7 +39,7 @@ extern volatile bool RunLoops;
|
|||||||
#include "../common/strings.h"
|
#include "../common/strings.h"
|
||||||
#include "../common/data_verification.h"
|
#include "../common/data_verification.h"
|
||||||
#include "../common/profanity_manager.h"
|
#include "../common/profanity_manager.h"
|
||||||
#include "data_bucket.h"
|
#include "../common/data_bucket.h"
|
||||||
#include "dynamic_zone.h"
|
#include "dynamic_zone.h"
|
||||||
#include "expedition_request.h"
|
#include "expedition_request.h"
|
||||||
#include "position.h"
|
#include "position.h"
|
||||||
@@ -226,7 +226,7 @@ Client::Client() : Mob(
|
|||||||
last_reported_endurance_percent = 0;
|
last_reported_endurance_percent = 0;
|
||||||
last_reported_mana_percent = 0;
|
last_reported_mana_percent = 0;
|
||||||
gm_hide_me = false;
|
gm_hide_me = false;
|
||||||
AFK = false;
|
m_is_afk = false;
|
||||||
LFG = false;
|
LFG = false;
|
||||||
LFGFromLevel = 0;
|
LFGFromLevel = 0;
|
||||||
LFGToLevel = 0;
|
LFGToLevel = 0;
|
||||||
@@ -536,7 +536,7 @@ Client::Client(EQStreamInterface *ieqs) : Mob(
|
|||||||
last_reported_endurance_percent = 0;
|
last_reported_endurance_percent = 0;
|
||||||
last_reported_mana_percent = 0;
|
last_reported_mana_percent = 0;
|
||||||
gm_hide_me = false;
|
gm_hide_me = false;
|
||||||
AFK = false;
|
m_is_afk = false;
|
||||||
LFG = false;
|
LFG = false;
|
||||||
LFGFromLevel = 0;
|
LFGFromLevel = 0;
|
||||||
LFGToLevel = 0;
|
LFGToLevel = 0;
|
||||||
@@ -1175,6 +1175,10 @@ void Client::QueuePacket(const EQApplicationPacket* app, bool ack_req, CLIENT_CO
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (RuleB(Character, AutoIdleFilterPackets) && m_is_idle && IsFilteredAFKPacket(app)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (client_state != CLIENT_CONNECTED && required_state == CLIENT_CONNECTED) {
|
if (client_state != CLIENT_CONNECTED && required_state == CLIENT_CONNECTED) {
|
||||||
AddPacket(app, ack_req);
|
AddPacket(app, ack_req);
|
||||||
return;
|
return;
|
||||||
@@ -2528,7 +2532,7 @@ void Client::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
|
|||||||
Mob::FillSpawnStruct(ns, ForWho);
|
Mob::FillSpawnStruct(ns, ForWho);
|
||||||
|
|
||||||
// Populate client-specific spawn information
|
// Populate client-specific spawn information
|
||||||
ns->spawn.afk = AFK;
|
ns->spawn.afk = m_is_afk;
|
||||||
ns->spawn.lfg = LFG; // afk and lfg are cleared on zoning on live
|
ns->spawn.lfg = LFG; // afk and lfg are cleared on zoning on live
|
||||||
ns->spawn.anon = m_pp.anon;
|
ns->spawn.anon = m_pp.anon;
|
||||||
ns->spawn.gm = GetGM() ? 1 : 0;
|
ns->spawn.gm = GetGM() ? 1 : 0;
|
||||||
@@ -10839,15 +10843,37 @@ void Client::SetAnon(uint8 anon_flag) {
|
|||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::SetAFK(uint8 afk_flag) {
|
void Client::SetAFK(uint8 afk_flag)
|
||||||
AFK = afk_flag;
|
{
|
||||||
auto outapp = new EQApplicationPacket(OP_SpawnAppearance, sizeof(SpawnAppearance_Struct));
|
if (!afk_flag) {
|
||||||
SpawnAppearance_Struct* spawn_appearance = (SpawnAppearance_Struct*)outapp->pBuffer;
|
ResetAFKTimer();
|
||||||
spawn_appearance->spawn_id = GetID();
|
}
|
||||||
spawn_appearance->type = AppearanceType::AFK;
|
|
||||||
spawn_appearance->parameter = afk_flag;
|
bool changed_afk_state = (m_is_afk && !afk_flag) || (!m_is_afk && afk_flag);
|
||||||
entity_list.QueueClients(this, outapp);
|
|
||||||
safe_delete(outapp);
|
if (!changed_afk_state) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// set messaging based on the state
|
||||||
|
std::string you_are = "You are no longer AFK.";
|
||||||
|
if (!m_is_afk && afk_flag) {
|
||||||
|
you_are = "You are now AFK.";
|
||||||
|
}
|
||||||
|
|
||||||
|
// set the state
|
||||||
|
m_is_afk = afk_flag;
|
||||||
|
|
||||||
|
// inform of state change
|
||||||
|
Message(Chat::Yellow, you_are.c_str());
|
||||||
|
|
||||||
|
// send the spawn appearance packet to all clients
|
||||||
|
static EQApplicationPacket p(OP_SpawnAppearance, sizeof(SpawnAppearance_Struct));
|
||||||
|
auto *s = (SpawnAppearance_Struct *) p.pBuffer;
|
||||||
|
s->spawn_id = GetID();
|
||||||
|
s->type = AppearanceType::AFK;
|
||||||
|
s->parameter = afk_flag;
|
||||||
|
entity_list.QueueClients(this, &p);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::SendToInstance(std::string instance_type, std::string zone_short_name, uint32 instance_version, float x, float y, float z, float heading, std::string instance_identifier, uint32 duration) {
|
void Client::SendToInstance(std::string instance_type, std::string zone_short_name, uint32 instance_version, float x, float y, float z, float heading, std::string instance_identifier, uint32 duration) {
|
||||||
@@ -12713,7 +12739,7 @@ void Client::SendTopLevelInventory()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::CheckSendBulkNpcPositions()
|
void Client::CheckSendBulkNpcPositions(bool force)
|
||||||
{
|
{
|
||||||
float distance_moved = DistanceNoZ(m_last_position_before_bulk_update, GetPosition());
|
float distance_moved = DistanceNoZ(m_last_position_before_bulk_update, GetPosition());
|
||||||
float update_range = RuleI(Range, MobCloseScanDistance);
|
float update_range = RuleI(Range, MobCloseScanDistance);
|
||||||
@@ -12724,7 +12750,7 @@ void Client::CheckSendBulkNpcPositions()
|
|||||||
|
|
||||||
int updated_count = 0;
|
int updated_count = 0;
|
||||||
int skipped_count = 0;
|
int skipped_count = 0;
|
||||||
if (is_ready_to_update) {
|
if (is_ready_to_update || force) {
|
||||||
auto &mob_movement_manager = MobMovementManager::Get();
|
auto &mob_movement_manager = MobMovementManager::Get();
|
||||||
|
|
||||||
for (auto &e: entity_list.GetMobList()) {
|
for (auto &e: entity_list.GetMobList()) {
|
||||||
@@ -12770,6 +12796,16 @@ void Client::CheckSendBulkNpcPositions()
|
|||||||
updated_count++;
|
updated_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (force) {
|
||||||
|
static EQApplicationPacket p(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
|
||||||
|
auto *s = (PlayerPositionUpdateServer_Struct *) p.pBuffer;
|
||||||
|
for (auto &e: entity_list.GetCorpseList()) {
|
||||||
|
Corpse *c = e.second;
|
||||||
|
MakeSpawnUpdate(s);
|
||||||
|
QueuePacket(&p, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
LogPositionUpdate(
|
LogPositionUpdate(
|
||||||
"[{}] Sent [{}] bulk updated NPC positions, skipped [{}] distance_moved [{}] update_range [{}]",
|
"[{}] Sent [{}] bulk updated NPC positions, skipped [{}] distance_moved [{}] update_range [{}]",
|
||||||
GetCleanName(),
|
GetCleanName(),
|
||||||
|
|||||||
+22
-3
@@ -501,9 +501,19 @@ public:
|
|||||||
void Kick(const std::string &reason);
|
void Kick(const std::string &reason);
|
||||||
void WorldKick();
|
void WorldKick();
|
||||||
inline uint8 GetAnon() const { return m_pp.anon; }
|
inline uint8 GetAnon() const { return m_pp.anon; }
|
||||||
inline uint8 GetAFK() const { return AFK; }
|
inline uint8 GetAFK() const { return m_is_afk; }
|
||||||
void SetAnon(uint8 anon_flag);
|
void SetAnon(uint8 anon_flag);
|
||||||
|
inline Client* ResetAFKTimer() {
|
||||||
|
if (!RuleB(Character, EnableAutoAFK)) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_afk_reset = true;
|
||||||
|
m_last_moved = std::chrono::steady_clock::now();
|
||||||
|
return this;
|
||||||
|
};
|
||||||
void SetAFK(uint8 afk_flag);
|
void SetAFK(uint8 afk_flag);
|
||||||
|
inline bool IsIdle() { return m_is_idle; }
|
||||||
inline PlayerProfile_Struct& GetPP() { return m_pp; }
|
inline PlayerProfile_Struct& GetPP() { return m_pp; }
|
||||||
inline ExtendedProfile_Struct& GetEPP() { return m_epp; }
|
inline ExtendedProfile_Struct& GetEPP() { return m_epp; }
|
||||||
inline EQ::InventoryProfile& GetInv() { return m_inv; }
|
inline EQ::InventoryProfile& GetInv() { return m_inv; }
|
||||||
@@ -2062,7 +2072,8 @@ private:
|
|||||||
uint8 LFGToLevel;
|
uint8 LFGToLevel;
|
||||||
bool LFGMatchFilter;
|
bool LFGMatchFilter;
|
||||||
char LFGComments[64];
|
char LFGComments[64];
|
||||||
bool AFK;
|
bool m_is_afk = false;
|
||||||
|
bool m_is_manual_afk = false;
|
||||||
bool auto_attack;
|
bool auto_attack;
|
||||||
bool auto_fire;
|
bool auto_fire;
|
||||||
bool runmode;
|
bool runmode;
|
||||||
@@ -2216,7 +2227,12 @@ private:
|
|||||||
glm::vec4 m_last_position_before_bulk_update;
|
glm::vec4 m_last_position_before_bulk_update;
|
||||||
Timer m_client_bulk_npc_pos_update_timer;
|
Timer m_client_bulk_npc_pos_update_timer;
|
||||||
Timer m_position_update_timer;
|
Timer m_position_update_timer;
|
||||||
void CheckSendBulkNpcPositions();
|
void CheckSendBulkNpcPositions(bool force = false);
|
||||||
|
|
||||||
|
// afk
|
||||||
|
bool m_is_idle = false;
|
||||||
|
bool m_afk_reset = false; // used to trigger next-tic afk reset
|
||||||
|
std::chrono::steady_clock::time_point m_last_moved = std::chrono::steady_clock::now();
|
||||||
|
|
||||||
void BulkSendInventoryItems();
|
void BulkSendInventoryItems();
|
||||||
|
|
||||||
@@ -2410,6 +2426,9 @@ public:
|
|||||||
const std::string &GetMailKey() const;
|
const std::string &GetMailKey() const;
|
||||||
void ShowZoneShardMenu();
|
void ShowZoneShardMenu();
|
||||||
void Handle_OP_ChangePetName(const EQApplicationPacket *app);
|
void Handle_OP_ChangePetName(const EQApplicationPacket *app);
|
||||||
|
bool IsFilteredAFKPacket(const EQApplicationPacket *p);
|
||||||
|
void CheckAutoIdleAFK(PlayerPositionUpdateClient_Struct *p);
|
||||||
|
void SyncWorldPositionsToClient(bool ignore_idle = false);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+191
-3
@@ -42,7 +42,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
|
|
||||||
#include "../common/data_verification.h"
|
#include "../common/data_verification.h"
|
||||||
#include "../common/rdtsc.h"
|
#include "../common/rdtsc.h"
|
||||||
#include "data_bucket.h"
|
#include "../common/data_bucket.h"
|
||||||
#include "dynamic_zone.h"
|
#include "dynamic_zone.h"
|
||||||
#include "event_codes.h"
|
#include "event_codes.h"
|
||||||
#include "guild_mgr.h"
|
#include "guild_mgr.h"
|
||||||
@@ -1473,7 +1473,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
// Load Data Buckets
|
// Load Data Buckets
|
||||||
ClearDataBucketCache();
|
ClearDataBucketCache();
|
||||||
DataBucket::GetDataBuckets(this);
|
LoadDataBucketsCache();
|
||||||
|
|
||||||
// Max Level for Character:PerCharacterQglobalMaxLevel and Character:PerCharacterBucketMaxLevel
|
// Max Level for Character:PerCharacterQglobalMaxLevel and Character:PerCharacterBucketMaxLevel
|
||||||
uint8 client_max_level = 0;
|
uint8 client_max_level = 0;
|
||||||
@@ -4383,6 +4383,14 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
m_TargetRing = glm::vec3(castspell->x_pos, castspell->y_pos, castspell->z_pos);
|
m_TargetRing = glm::vec3(castspell->x_pos, castspell->y_pos, castspell->z_pos);
|
||||||
|
|
||||||
|
if (castspell->spell_id && IsValidSpell(castspell->spell_id)) {
|
||||||
|
bool is_non_combat_zone = !zone->CanDoCombat() || zone->BuffTimersSuspended();
|
||||||
|
bool is_excluded_reset = is_non_combat_zone && IsBardSong(castspell->spell_id);
|
||||||
|
if (!is_excluded_reset) {
|
||||||
|
ResetAFKTimer();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
LogSpells("OP CastSpell: slot [{}] spell [{}] target [{}] inv [{}]", castspell->slot, castspell->spell_id, castspell->target_id, (unsigned long)castspell->inventoryslot);
|
LogSpells("OP CastSpell: slot [{}] spell [{}] target [{}] inv [{}]", castspell->slot, castspell->spell_id, castspell->target_id, (unsigned long)castspell->inventoryslot);
|
||||||
CastingSlot slot = static_cast<CastingSlot>(castspell->slot);
|
CastingSlot slot = static_cast<CastingSlot>(castspell->slot);
|
||||||
|
|
||||||
@@ -4566,6 +4574,12 @@ void Client::Handle_OP_ChannelMessage(const EQApplicationPacket *app)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// reject automatic AFK messages from resetting /afk
|
||||||
|
std::string message = cm->message;
|
||||||
|
if (!Strings::Contains(message, "Sorry, I am A.F.K.")) {
|
||||||
|
ResetAFKTimer();
|
||||||
|
}
|
||||||
|
|
||||||
if (IsAIControlled() && !GetGM()) {
|
if (IsAIControlled() && !GetGM()) {
|
||||||
Message(Chat::Red, "You try to speak but can't move your mouth!");
|
Message(Chat::Red, "You try to speak but can't move your mouth!");
|
||||||
return;
|
return;
|
||||||
@@ -4992,6 +5006,10 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) {
|
|||||||
|
|
||||||
SetMoving(!(cy == m_Position.y && cx == m_Position.x));
|
SetMoving(!(cy == m_Position.y && cx == m_Position.x));
|
||||||
|
|
||||||
|
if (RuleB(Character, EnableAutoAFK)) {
|
||||||
|
CheckAutoIdleAFK(ppu);
|
||||||
|
}
|
||||||
|
|
||||||
CheckClientToNpcAggroTimer();
|
CheckClientToNpcAggroTimer();
|
||||||
|
|
||||||
if (m_mob_check_moving_timer.Check()) {
|
if (m_mob_check_moving_timer.Check()) {
|
||||||
@@ -10792,6 +10810,8 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ResetAFKTimer();
|
||||||
|
|
||||||
BenchTimer bench;
|
BenchTimer bench;
|
||||||
|
|
||||||
MoveItem_Struct* mi = (MoveItem_Struct*) app->pBuffer;
|
MoveItem_Struct* mi = (MoveItem_Struct*) app->pBuffer;
|
||||||
@@ -14732,7 +14752,9 @@ void Client::Handle_OP_SpawnAppearance(const EQApplicationPacket *app)
|
|||||||
}
|
}
|
||||||
else if (sa->type == AppearanceType::AFK) {
|
else if (sa->type == AppearanceType::AFK) {
|
||||||
if (afk_toggle_timer.Check()) {
|
if (afk_toggle_timer.Check()) {
|
||||||
AFK = (sa->parameter == 1);
|
m_is_afk = (sa->parameter == 1);
|
||||||
|
m_is_manual_afk = (sa->parameter == 1);
|
||||||
|
ResetAFKTimer();
|
||||||
entity_list.QueueClients(this, app, true);
|
entity_list.QueueClients(this, app, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -15551,6 +15573,14 @@ void Client::Handle_OP_TradeRequest(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
// Pass trade request on to recipient
|
// Pass trade request on to recipient
|
||||||
if (tradee && tradee->IsClient()) {
|
if (tradee && tradee->IsClient()) {
|
||||||
|
// if we are idling we need to sync client positions otherwise clients will not be aware of each other
|
||||||
|
if (m_is_idle) {
|
||||||
|
SyncWorldPositionsToClient(true);
|
||||||
|
}
|
||||||
|
if (tradee->CastToClient()->IsIdle()) {
|
||||||
|
tradee->CastToClient()->SyncWorldPositionsToClient(true);
|
||||||
|
}
|
||||||
|
|
||||||
tradee->CastToClient()->QueuePacket(app);
|
tradee->CastToClient()->QueuePacket(app);
|
||||||
}
|
}
|
||||||
else if (tradee && (tradee->IsNPC() || tradee->IsBot())) {
|
else if (tradee && (tradee->IsNPC() || tradee->IsBot())) {
|
||||||
@@ -15580,6 +15610,14 @@ void Client::Handle_OP_TradeRequestAck(const EQApplicationPacket *app)
|
|||||||
Mob* tradee = entity_list.GetMob(msg->to_mob_id);
|
Mob* tradee = entity_list.GetMob(msg->to_mob_id);
|
||||||
|
|
||||||
if (tradee && tradee->IsClient()) {
|
if (tradee && tradee->IsClient()) {
|
||||||
|
// if we are idling we need to sync client positions otherwise clients will not be aware of each other
|
||||||
|
if (m_is_idle) {
|
||||||
|
SyncWorldPositionsToClient(true);
|
||||||
|
}
|
||||||
|
if (tradee->CastToClient()->IsIdle()) {
|
||||||
|
tradee->CastToClient()->SyncWorldPositionsToClient(true);
|
||||||
|
}
|
||||||
|
|
||||||
trade->Start(msg->to_mob_id);
|
trade->Start(msg->to_mob_id);
|
||||||
tradee->CastToClient()->QueuePacket(app);
|
tradee->CastToClient()->QueuePacket(app);
|
||||||
}
|
}
|
||||||
@@ -17166,3 +17204,153 @@ void Client::Handle_OP_EvolveItem(const EQApplicationPacket *app)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Client::IsFilteredAFKPacket(const EQApplicationPacket *p)
|
||||||
|
{
|
||||||
|
if (p->GetOpcode() == OP_ClientUpdate) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Client::CheckAutoIdleAFK(PlayerPositionUpdateClient_Struct *p)
|
||||||
|
{
|
||||||
|
if (!RuleB(Character, EnableAutoAFK)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool is_non_combat_zone = !zone->CanDoCombat() || zone->BuffTimersSuspended();
|
||||||
|
|
||||||
|
int seconds_before_afk =
|
||||||
|
is_non_combat_zone ?
|
||||||
|
RuleI(Character, SecondsBeforeAFKNonCombatZone) :
|
||||||
|
RuleI(Character, SecondsBeforeAFKCombatZone);
|
||||||
|
|
||||||
|
int seconds_before_idle =
|
||||||
|
is_non_combat_zone ?
|
||||||
|
RuleI(Character, SecondsBeforeIdleNonCombatZone) :
|
||||||
|
RuleI(Character, SecondsBeforeIdleCombatZone);
|
||||||
|
|
||||||
|
// seconds_before_idle can't be greater than seconds_before_afk
|
||||||
|
if (seconds_before_idle > seconds_before_afk) {
|
||||||
|
seconds_before_idle = seconds_before_afk;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool has_moved =
|
||||||
|
m_Position.x != p->x_pos ||
|
||||||
|
m_Position.y != p->y_pos ||
|
||||||
|
m_Position.z != p->z_pos ||
|
||||||
|
m_Position.w != EQ12toFloat(p->heading);
|
||||||
|
|
||||||
|
bool triggered_reset = m_afk_reset;
|
||||||
|
bool was_idle = m_is_idle;
|
||||||
|
bool is_idle_or_afk = m_is_idle || m_is_afk;
|
||||||
|
|
||||||
|
if (!has_moved && (!m_is_idle || !m_is_afk)) {
|
||||||
|
auto now = std::chrono::steady_clock::now();
|
||||||
|
auto since_last_moved = now - m_last_moved;
|
||||||
|
|
||||||
|
if (!m_is_manual_afk && !m_is_afk && since_last_moved > std::chrono::seconds(seconds_before_afk)) {
|
||||||
|
bool is_client_excluded_from_afk = (IsBuyer() || IsTrader() || GetGM());
|
||||||
|
if (is_client_excluded_from_afk) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LogInfo(
|
||||||
|
"Client [{}] has been AFK for [{}] seconds",
|
||||||
|
GetCleanName(),
|
||||||
|
std::chrono::duration_cast<std::chrono::seconds>(since_last_moved).count()
|
||||||
|
);
|
||||||
|
SetAFK(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (!m_is_idle && since_last_moved > std::chrono::seconds(seconds_before_idle)) {
|
||||||
|
bool is_client_excluded_from_idle = GetGM() && !is_non_combat_zone;
|
||||||
|
if (is_client_excluded_from_idle) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LogInfo(
|
||||||
|
"Client [{}] has been idle for [{}] seconds",
|
||||||
|
GetCleanName(),
|
||||||
|
std::chrono::duration_cast<std::chrono::seconds>(since_last_moved).count()
|
||||||
|
);
|
||||||
|
m_is_idle = true;
|
||||||
|
Message(Chat::Yellow, "You are now idle. Updates will be sent to you less frequently.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// if we triggered a reset, but didn't move, we are still idling but not AFK
|
||||||
|
if (triggered_reset && was_idle) {
|
||||||
|
m_is_idle = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if we moved or triggered reset through other actions, we are no longer AFK.
|
||||||
|
// we could trigger resetting AFK status through actions like message, cast, attack etc but still by idle until we move
|
||||||
|
if (!m_is_manual_afk && (has_moved || triggered_reset) && m_is_afk) {
|
||||||
|
LogInfo("AFK [{}] is no longer idle, syncing positions", GetCleanName());
|
||||||
|
SetAFK(false);
|
||||||
|
ResetAFKTimer();
|
||||||
|
}
|
||||||
|
|
||||||
|
// we could be not AFK and idle at the same time
|
||||||
|
if (has_moved && m_is_idle) {
|
||||||
|
LogInfo("Idle [{}] is no longer idle, syncing positions", GetCleanName());
|
||||||
|
m_is_idle = false;
|
||||||
|
Message(Chat::Yellow, "You are no longer idle.");
|
||||||
|
SyncWorldPositionsToClient();
|
||||||
|
ResetAFKTimer();
|
||||||
|
}
|
||||||
|
|
||||||
|
m_afk_reset = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Client::SyncWorldPositionsToClient(bool ignore_idle)
|
||||||
|
{
|
||||||
|
// if we are idle currently, we need to force updates (which bypasses idle status) and reset idle status
|
||||||
|
bool reset_idle = false;
|
||||||
|
if (ignore_idle && m_is_idle) {
|
||||||
|
m_is_idle = false;
|
||||||
|
reset_idle = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
LogInfo("Syncing positions for client [{}]", GetCleanName());
|
||||||
|
CheckSendBulkNpcPositions(true);
|
||||||
|
|
||||||
|
static EQApplicationPacket cu(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
|
||||||
|
|
||||||
|
for (auto &e: entity_list.GetClientList()) {
|
||||||
|
auto c = e.second;
|
||||||
|
|
||||||
|
// skip if not in range
|
||||||
|
if (Distance(c->GetPosition(), GetPosition()) > RuleI(Range, ClientPositionUpdates)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// skip self
|
||||||
|
if (c == this) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto *spu = (PlayerPositionUpdateServer_Struct *) cu.pBuffer;
|
||||||
|
|
||||||
|
memset(spu, 0x00, sizeof(PlayerPositionUpdateServer_Struct));
|
||||||
|
spu->spawn_id = c->GetID();
|
||||||
|
spu->x_pos = FloatToEQ19(c->GetX());
|
||||||
|
spu->y_pos = FloatToEQ19(c->GetY());
|
||||||
|
spu->z_pos = FloatToEQ19(c->GetZ());
|
||||||
|
spu->heading = FloatToEQ12(c->GetHeading());
|
||||||
|
spu->delta_x = FloatToEQ13(0);
|
||||||
|
spu->delta_y = FloatToEQ13(0);
|
||||||
|
spu->delta_z = FloatToEQ13(0);
|
||||||
|
spu->delta_heading = FloatToEQ10(0);
|
||||||
|
spu->animation = 0;
|
||||||
|
QueuePacket(&cu);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ignore_idle && reset_idle) {
|
||||||
|
m_is_idle = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -536,6 +536,10 @@ bool Client::Process() {
|
|||||||
DoEnduranceRegen();
|
DoEnduranceRegen();
|
||||||
BuffProcess();
|
BuffProcess();
|
||||||
|
|
||||||
|
if (auto_attack) {
|
||||||
|
ResetAFKTimer();
|
||||||
|
}
|
||||||
|
|
||||||
if (tribute_timer.Check()) {
|
if (tribute_timer.Check()) {
|
||||||
ToggleTribute(true); //re-activate the tribute.
|
ToggleTribute(true); //re-activate the tribute.
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-159
@@ -19,7 +19,7 @@
|
|||||||
#include "../common/file.h"
|
#include "../common/file.h"
|
||||||
#include "../common/repositories/dynamic_zones_repository.h"
|
#include "../common/repositories/dynamic_zones_repository.h"
|
||||||
|
|
||||||
#include "data_bucket.h"
|
#include "../common/data_bucket.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "dynamic_zone.h"
|
#include "dynamic_zone.h"
|
||||||
#include "queryserv.h"
|
#include "queryserv.h"
|
||||||
@@ -783,161 +783,3 @@ void command_bot(Client *c, const Seperator *sep)
|
|||||||
c->Message(Chat::Red, "Bots are disabled on this server.");
|
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"
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
#include <regex>
|
|
||||||
|
|
||||||
#include "dialogue_window.h"
|
#include "dialogue_window.h"
|
||||||
|
|
||||||
void DialogueWindow::Render(Client *c, std::string markdown)
|
void DialogueWindow::Render(Client *c, std::string markdown)
|
||||||
@@ -529,12 +527,19 @@ std::string DialogueWindow::CenterMessage(std::string message)
|
|||||||
return std::string();
|
return std::string();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto cleaned_message = message;
|
std::string cleaned_message;
|
||||||
|
cleaned_message.reserve(message.size());
|
||||||
|
|
||||||
std::regex tags("<[^>]*>");
|
// Strip HTML-like tags
|
||||||
|
bool in_tag = false;
|
||||||
if (std::regex_search(cleaned_message, tags)) {
|
for (char c : message) {
|
||||||
std::regex_replace(cleaned_message, tags, cleaned_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();
|
auto message_len = cleaned_message.length();
|
||||||
|
|||||||
+3
-1
@@ -852,11 +852,13 @@ void Doors::CreateDatabaseEntry()
|
|||||||
const auto& l = DoorsRepository::GetWhere(
|
const auto& l = DoorsRepository::GetWhere(
|
||||||
content_db,
|
content_db,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"zone = '{}' AND doorid = {}",
|
"zone = '{}' AND (version = {} OR version = -1) AND doorid = {}",
|
||||||
zone->GetShortName(),
|
zone->GetShortName(),
|
||||||
|
zone->GetInstanceVersion(),
|
||||||
GetDoorID()
|
GetDoorID()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!l.empty()) {
|
if (!l.empty()) {
|
||||||
auto e = l[0];
|
auto e = l[0];
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
#include "queryserv.h"
|
#include "queryserv.h"
|
||||||
#include "questmgr.h"
|
#include "questmgr.h"
|
||||||
#include "zone.h"
|
#include "zone.h"
|
||||||
#include "data_bucket.h"
|
#include "../common/data_bucket.h"
|
||||||
#include "../common/events/player_event_logs.h"
|
#include "../common/events/player_event_logs.h"
|
||||||
#include "worldserver.h"
|
#include "worldserver.h"
|
||||||
|
|
||||||
|
|||||||
+5
-2
@@ -137,18 +137,20 @@ void Embperl::DoInit()
|
|||||||
catch (std::string& e) {
|
catch (std::string& e) {
|
||||||
LogQuests("Warning [{}]: [{}]", Config->PluginPlFile, e);
|
LogQuests("Warning [{}]: [{}]", Config->PluginPlFile, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto & dir : path.GetPluginPaths()) {
|
||||||
try {
|
try {
|
||||||
//should probably read the directory in c, instead, so that
|
//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
|
//I can echo filenames as I do it, but c'mon... I'm lazy and this 1 line reads in all the plugins
|
||||||
const std::string& perl_command = (
|
const std::string& perl_command = (
|
||||||
"if(opendir(D,'" +
|
"if(opendir(D,'" +
|
||||||
path.GetPluginsPath() +
|
dir +
|
||||||
"')) { "
|
"')) { "
|
||||||
" my @d = readdir(D);"
|
" my @d = readdir(D);"
|
||||||
" closedir(D);"
|
" closedir(D);"
|
||||||
" foreach(@d){ "
|
" foreach(@d){ "
|
||||||
" main::eval_file('plugin','" +
|
" main::eval_file('plugin','" +
|
||||||
path.GetPluginsPath() +
|
dir +
|
||||||
"/'.$_)if/\\.pl$/;"
|
"/'.$_)if/\\.pl$/;"
|
||||||
" }"
|
" }"
|
||||||
"}");
|
"}");
|
||||||
@@ -157,6 +159,7 @@ void Embperl::DoInit()
|
|||||||
catch (std::string& e) {
|
catch (std::string& e) {
|
||||||
LogQuests("Warning [{}]", e);
|
LogQuests("Warning [{}]", e);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif //EMBPERL_PLUGIN
|
#endif //EMBPERL_PLUGIN
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
#include "../common/strings.h"
|
#include "../common/strings.h"
|
||||||
|
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
#include "data_bucket.h"
|
#include "../common/data_bucket.h"
|
||||||
#include "groups.h"
|
#include "groups.h"
|
||||||
#include "mob.h"
|
#include "mob.h"
|
||||||
#include "raids.h"
|
#include "raids.h"
|
||||||
|
|||||||
@@ -1,8 +1,17 @@
|
|||||||
#include "../client.h"
|
#include "../client.h"
|
||||||
#include "../data_bucket.h"
|
#include "../../common/data_bucket.h"
|
||||||
#include "../dialogue_window.h"
|
#include "../dialogue_window.h"
|
||||||
#include "../../common/repositories/data_buckets_repository.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)
|
void command_databuckets(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
const int arguments = sep->argnum;
|
const int arguments = sep->argnum;
|
||||||
@@ -251,12 +260,3 @@ void command_databuckets(Client *c, const Seperator *sep)
|
|||||||
c->Message(Chat::White, response.c_str());
|
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");
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "../client.h"
|
#include "../client.h"
|
||||||
#include "../data_bucket.h"
|
#include "../../common/data_bucket.h"
|
||||||
|
|
||||||
void command_devtools(Client *c, const Seperator *sep)
|
void command_devtools(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "../../object.h"
|
||||||
#include "../../client.h"
|
#include "../../client.h"
|
||||||
|
|
||||||
void FindObjectType(Client *c, const Seperator *sep)
|
void FindObjectType(Client *c, const Seperator *sep)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "../client.h"
|
#include "../client.h"
|
||||||
#include "../data_bucket.h"
|
#include "../../common/data_bucket.h"
|
||||||
|
|
||||||
void command_gmzone(Client *c, const Seperator *sep)
|
void command_gmzone(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
|
|||||||
+16
-16
@@ -8,6 +8,22 @@ extern QueryServ *QServ;
|
|||||||
#include "../guild_mgr.h"
|
#include "../guild_mgr.h"
|
||||||
#include "../doors.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)
|
void command_guild(Client* c, const Seperator* sep)
|
||||||
{
|
{
|
||||||
const auto arguments = sep->argnum;
|
const auto arguments = sep->argnum;
|
||||||
@@ -676,19 +692,3 @@ 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]");
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "../dialogue_window.h"
|
||||||
#include "../client.h"
|
#include "../client.h"
|
||||||
|
|
||||||
void command_illusion_block(Client* c, const Seperator* sep)
|
void command_illusion_block(Client* c, const Seperator* sep)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#include "../corpse.h"
|
#include "../corpse.h"
|
||||||
#include "../object.h"
|
#include "../object.h"
|
||||||
#include "../doors.h"
|
#include "../doors.h"
|
||||||
|
#include "../command.h"
|
||||||
|
|
||||||
struct UniqueEntity {
|
struct UniqueEntity {
|
||||||
uint16 entity_id;
|
uint16 entity_id;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "../client.h"
|
#include "../client.h"
|
||||||
|
#include "../water_map.h"
|
||||||
|
|
||||||
void command_loc(Client *c, const Seperator *sep)
|
void command_loc(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,63 +1,5 @@
|
|||||||
#include "../client.h"
|
#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> GetModifyNPCStatMap()
|
||||||
{
|
{
|
||||||
std::map<std::string, std::string> identifiers_map = {
|
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()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "../bot.h"
|
||||||
#include "../client.h"
|
#include "../client.h"
|
||||||
|
|
||||||
void command_mystats(Client *c, const Seperator *sep)
|
void command_mystats(Client *c, const Seperator *sep)
|
||||||
|
|||||||
+109
-109
@@ -3,6 +3,115 @@
|
|||||||
#include "../raids.h"
|
#include "../raids.h"
|
||||||
#include "../../common/repositories/npc_types_repository.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)
|
void command_npcedit(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
|
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
|
||||||
@@ -1728,112 +1837,3 @@ void command_npcedit(Client *c, const Seperator *sep)
|
|||||||
|
|
||||||
c->Message(Chat::White, d.c_str());
|
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");
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,9 +1,23 @@
|
|||||||
#include "../client.h"
|
#include "../client.h"
|
||||||
|
#include "../queryserv.h"
|
||||||
#include "../worldserver.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;
|
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)
|
void command_parcels(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
const auto arguments = sep->argnum;
|
const auto arguments = sep->argnum;
|
||||||
@@ -306,14 +320,3 @@ void command_parcels(Client *c, const Seperator *sep)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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]");
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "../bot.h"
|
||||||
#include "../client.h"
|
#include "../client.h"
|
||||||
|
|
||||||
void command_petitems(Client *c, const Seperator *sep)
|
void command_petitems(Client *c, const Seperator *sep)
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "../../bot.h"
|
||||||
#include "../../client.h"
|
#include "../../client.h"
|
||||||
|
|
||||||
void SetHaste(Client *c, const Seperator *sep)
|
void SetHaste(Client *c, const Seperator *sep)
|
||||||
|
|||||||
@@ -1,6 +1,22 @@
|
|||||||
#include "../../client.h"
|
#include "../../client.h"
|
||||||
#include "../../object.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)
|
void ShowInventory(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
const auto arguments = sep->argnum;
|
const auto arguments = sep->argnum;
|
||||||
@@ -433,19 +449,3 @@ void ShowInventory(Client *c, const Seperator *sep)
|
|||||||
c->Message(Chat::White, "No items found.");
|
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");
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "../bot.h"
|
||||||
#include "../client.h"
|
#include "../client.h"
|
||||||
|
|
||||||
void command_zone(Client *c, const Seperator *sep)
|
void command_zone(Client *c, const Seperator *sep)
|
||||||
|
|||||||
+2
-2
@@ -107,12 +107,12 @@ void Lua_Bot::SetExpansionBitmask(int expansion_bitmask) {
|
|||||||
|
|
||||||
bool Lua_Bot::ReloadBotDataBuckets() {
|
bool Lua_Bot::ReloadBotDataBuckets() {
|
||||||
Lua_Safe_Call_Bool();
|
Lua_Safe_Call_Bool();
|
||||||
return DataBucket::GetDataBuckets(self);
|
return self->LoadDataBucketsCache();;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Lua_Bot::ReloadBotOwnerDataBuckets() {
|
bool Lua_Bot::ReloadBotOwnerDataBuckets() {
|
||||||
Lua_Safe_Call_Bool();
|
Lua_Safe_Call_Bool();
|
||||||
return self->HasOwner() && DataBucket::GetDataBuckets(self->GetBotOwner());
|
return self->HasOwner() && self->LoadDataBucketsCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Lua_Bot::ReloadBotSpells() {
|
bool Lua_Bot::ReloadBotSpells() {
|
||||||
|
|||||||
+1
-1
@@ -3131,7 +3131,7 @@ bool Lua_Client::IsAutoFireEnabled()
|
|||||||
|
|
||||||
bool Lua_Client::ReloadDataBuckets() {
|
bool Lua_Client::ReloadDataBuckets() {
|
||||||
Lua_Safe_Call_Bool();
|
Lua_Safe_Call_Bool();
|
||||||
return DataBucket::GetDataBuckets(self);
|
return self->LoadDataBucketsCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Lua_Client::GetEXPForLevel(uint16 check_level)
|
uint32 Lua_Client::GetEXPForLevel(uint16 check_level)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
#include "qglobals.h"
|
#include "qglobals.h"
|
||||||
#include "encounter.h"
|
#include "encounter.h"
|
||||||
#include "lua_encounter.h"
|
#include "lua_encounter.h"
|
||||||
#include "data_bucket.h"
|
#include "../common/data_bucket.h"
|
||||||
#include "dialogue_window.h"
|
#include "dialogue_window.h"
|
||||||
#include "dynamic_zone.h"
|
#include "dynamic_zone.h"
|
||||||
#include "../common/events/player_event_logs.h"
|
#include "../common/events/player_event_logs.h"
|
||||||
|
|||||||
+29
-20
@@ -1067,13 +1067,16 @@ void LuaParser::ReloadQuests() {
|
|||||||
|
|
||||||
lua_getglobal(L, "package");
|
lua_getglobal(L, "package");
|
||||||
lua_getfield(L, -1, "path");
|
lua_getfield(L, -1, "path");
|
||||||
std::string module_path = lua_tostring(L,-1);
|
std::string module_path = lua_tostring(L, -1);
|
||||||
module_path += ";" + path.GetLuaModulesPath() + "/?.lua;" + path.GetLuaModulesPath() + "/?/init.lua";
|
|
||||||
// luarock paths using lua_modules as tree
|
|
||||||
// to path it adds foo/share/lua/5.1/?.lua and foo/share/lua/5.1/?/init.lua
|
|
||||||
module_path += ";" + path.GetLuaModulesPath() + "/share/lua/" + lua_version + "/?.lua";
|
|
||||||
module_path += ";" + path.GetLuaModulesPath() + "/share/lua/" + lua_version + "/?/init.lua";
|
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
|
|
||||||
|
for (const auto& dir : path.GetLuaModulePaths()) {
|
||||||
|
module_path += fmt::format(";{}/?.lua", dir);
|
||||||
|
module_path += fmt::format(";{}/?/init.lua", dir);
|
||||||
|
module_path += fmt::format(";{}/share/lua/{}/?.lua", dir, lua_version);
|
||||||
|
module_path += fmt::format(";{}/share/lua/{}/?/init.lua", dir, lua_version);
|
||||||
|
}
|
||||||
|
|
||||||
lua_pushstring(L, module_path.c_str());
|
lua_pushstring(L, module_path.c_str());
|
||||||
lua_setfield(L, -2, "path");
|
lua_setfield(L, -2, "path");
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
@@ -1081,11 +1084,13 @@ void LuaParser::ReloadQuests() {
|
|||||||
lua_getglobal(L, "package");
|
lua_getglobal(L, "package");
|
||||||
lua_getfield(L, -1, "cpath");
|
lua_getfield(L, -1, "cpath");
|
||||||
module_path = lua_tostring(L, -1);
|
module_path = lua_tostring(L, -1);
|
||||||
module_path += ";" + path.GetLuaModulesPath() + "/?" + libext;
|
|
||||||
// luarock paths using lua_modules as tree
|
|
||||||
// luarocks adds foo/lib/lua/5.1/?.so for cpath
|
|
||||||
module_path += ";" + path.GetLuaModulesPath() + "/lib/lua/" + lua_version + "/?" + libext;
|
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
|
|
||||||
|
for (const auto& dir : path.GetLuaModulePaths()) {
|
||||||
|
module_path += fmt::format(";{}/?{}", dir, libext);
|
||||||
|
module_path += fmt::format(";{}/lib/lua/{}/?{}", dir, lua_version, libext);
|
||||||
|
}
|
||||||
|
|
||||||
lua_pushstring(L, module_path.c_str());
|
lua_pushstring(L, module_path.c_str());
|
||||||
lua_setfield(L, -2, "cpath");
|
lua_setfield(L, -2, "cpath");
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
@@ -1093,38 +1098,41 @@ void LuaParser::ReloadQuests() {
|
|||||||
MapFunctions(L);
|
MapFunctions(L);
|
||||||
|
|
||||||
// load init
|
// load init
|
||||||
std::string filename = fmt::format("{}/{}/script_init.lua", path.GetQuestsPath(), QUEST_GLOBAL_DIRECTORY);
|
for (auto& dir : path.GetQuestPaths()) {
|
||||||
|
std::string filename = fmt::format("{}/{}/script_init.lua", dir, QUEST_GLOBAL_DIRECTORY);
|
||||||
|
|
||||||
FILE *f = fopen(filename.c_str(), "r");
|
FILE* f = fopen(filename.c_str(), "r");
|
||||||
if(f) {
|
if (f) {
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
if(luaL_dofile(L, filename.c_str())) {
|
if (luaL_dofile(L, filename.c_str())) {
|
||||||
std::string error = lua_tostring(L, -1);
|
std::string error = lua_tostring(L, -1);
|
||||||
AddError(error);
|
AddError(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//zone init - always loads after global
|
//zone init - always loads after global
|
||||||
if(zone) {
|
if (zone) {
|
||||||
|
for (auto& dir : path.GetQuestPaths()) {
|
||||||
std::string zone_script = fmt::format(
|
std::string zone_script = fmt::format(
|
||||||
"{}/{}/script_init_v{}.lua",
|
"{}/{}/script_init_v{}.lua",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
zone->GetShortName(),
|
zone->GetShortName(),
|
||||||
zone->GetInstanceVersion()
|
zone->GetInstanceVersion()
|
||||||
);
|
);
|
||||||
|
|
||||||
f = fopen(zone_script.c_str(), "r");
|
FILE* f = fopen(zone_script.c_str(), "r");
|
||||||
if(f) {
|
if (f) {
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
if(luaL_dofile(L, zone_script.c_str())) {
|
if (luaL_dofile(L, zone_script.c_str())) {
|
||||||
std::string error = lua_tostring(L, -1);
|
std::string error = lua_tostring(L, -1);
|
||||||
AddError(error);
|
AddError(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
zone_script = fmt::format("{}/{}/script_init.lua", path.GetQuestsPath(), zone->GetShortName());
|
zone_script = fmt::format("{}/{}/script_init.lua", dir, zone->GetShortName());
|
||||||
|
|
||||||
f = fopen(zone_script.c_str(), "r");
|
f = fopen(zone_script.c_str(), "r");
|
||||||
if (f) {
|
if (f) {
|
||||||
@@ -1137,6 +1145,7 @@ void LuaParser::ReloadQuests() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
FILE *load_order = fopen(fmt::format("{}/load_order.txt", path.GetLuaModsPath()).c_str(), "r");
|
FILE *load_order = fopen(fmt::format("{}/load_order.txt", path.GetLuaModsPath()).c_str(), "r");
|
||||||
if (load_order) {
|
if (load_order) {
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
#include <luabind/luabind.hpp>
|
#include <luabind/luabind.hpp>
|
||||||
#include "../common/global_define.h"
|
#include "../common/global_define.h"
|
||||||
#include "embperl.h"
|
|
||||||
#include "lua_zone.h"
|
#include "lua_zone.h"
|
||||||
|
|
||||||
bool Lua_Zone::BuffTimersSuspended()
|
bool Lua_Zone::BuffTimersSuspended()
|
||||||
|
|||||||
+22
-2
@@ -24,7 +24,7 @@
|
|||||||
#include "../common/repositories/bot_data_repository.h"
|
#include "../common/repositories/bot_data_repository.h"
|
||||||
#include "../common/repositories/character_data_repository.h"
|
#include "../common/repositories/character_data_repository.h"
|
||||||
|
|
||||||
#include "data_bucket.h"
|
#include "../common/data_bucket.h"
|
||||||
#include "quest_parser_collection.h"
|
#include "quest_parser_collection.h"
|
||||||
#include "string_ids.h"
|
#include "string_ids.h"
|
||||||
#include "worldserver.h"
|
#include "worldserver.h"
|
||||||
@@ -2646,7 +2646,7 @@ void Mob::SendStatsWindow(Client* c, bool use_window)
|
|||||||
Chat::White,
|
Chat::White,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
" AFK: {} LFG: {} Anon: {} PVP: {} GM: {} Fly Mode: {} ({}) GM Speed: {} Hide Me: {} Invulnerability: {} LD: {} Client Version: {} Tells Off: {}",
|
" AFK: {} LFG: {} Anon: {} PVP: {} GM: {} Fly Mode: {} ({}) GM Speed: {} Hide Me: {} Invulnerability: {} LD: {} Client Version: {} Tells Off: {}",
|
||||||
CastToClient()->AFK ? "Yes" : "No",
|
CastToClient()->m_is_afk ? "Yes" : "No",
|
||||||
CastToClient()->LFG ? "Yes" : "No",
|
CastToClient()->LFG ? "Yes" : "No",
|
||||||
CastToClient()->GetAnon() ? "Yes" : "No",
|
CastToClient()->GetAnon() ? "Yes" : "No",
|
||||||
CastToClient()->GetPVP() ? "Yes" : "No",
|
CastToClient()->GetPVP() ? "Yes" : "No",
|
||||||
@@ -8772,3 +8772,23 @@ bool Mob::IsGuildmaster() const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Mob::LoadDataBucketsCache()
|
||||||
|
{
|
||||||
|
const uint32 id = GetMobTypeIdentifier();
|
||||||
|
|
||||||
|
if (!id) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsBot()) {
|
||||||
|
DataBucket::BulkLoadEntitiesToCache(DataBucketLoadType::Bot, {id});
|
||||||
|
}
|
||||||
|
else if (IsClient()) {
|
||||||
|
uint32 account_id = CastToClient()->AccountID();
|
||||||
|
DataBucket::BulkLoadEntitiesToCache(DataBucketLoadType::Account, {account_id});
|
||||||
|
DataBucket::BulkLoadEntitiesToCache(DataBucketLoadType::Client, {id});
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
+2
-1
@@ -20,7 +20,7 @@
|
|||||||
#define MOB_H
|
#define MOB_H
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "data_bucket.h"
|
#include "../common/data_bucket.h"
|
||||||
#include "entity.h"
|
#include "entity.h"
|
||||||
#include "hate_list.h"
|
#include "hate_list.h"
|
||||||
#include "pathfinder_interface.h"
|
#include "pathfinder_interface.h"
|
||||||
@@ -1504,6 +1504,7 @@ public:
|
|||||||
void CalcHeroicBonuses(StatBonuses* newbon);
|
void CalcHeroicBonuses(StatBonuses* newbon);
|
||||||
|
|
||||||
DataBucketKey GetScopedBucketKeys();
|
DataBucketKey GetScopedBucketKeys();
|
||||||
|
bool LoadDataBucketsCache();
|
||||||
|
|
||||||
bool IsCloseToBanker();
|
bool IsCloseToBanker();
|
||||||
|
|
||||||
|
|||||||
@@ -839,6 +839,10 @@ void MobMovementManager::SendCommandToClients(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (c->IsIdle()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
_impl->Stats.TotalSent++;
|
_impl->Stats.TotalSent++;
|
||||||
|
|
||||||
if (anim != 0) {
|
if (anim != 0) {
|
||||||
@@ -879,6 +883,10 @@ void MobMovementManager::SendCommandToClients(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (c->IsIdle()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
float distance = c->CalculateDistance(mob->GetX(), mob->GetY(), mob->GetZ());
|
float distance = c->CalculateDistance(mob->GetX(), mob->GetY(), mob->GetZ());
|
||||||
|
|
||||||
bool match = false;
|
bool match = false;
|
||||||
|
|||||||
+2
-2
@@ -492,12 +492,12 @@ void Perl_Bot_SetSpellDurationRaid(Bot* self, int spell_id, int duration, int le
|
|||||||
|
|
||||||
bool Perl_Bot_ReloadBotDataBuckets(Bot* self)
|
bool Perl_Bot_ReloadBotDataBuckets(Bot* self)
|
||||||
{
|
{
|
||||||
return DataBucket::GetDataBuckets(self);
|
return self->LoadDataBucketsCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Perl_Bot_ReloadBotOwnerDataBuckets(Bot* self)
|
bool Perl_Bot_ReloadBotOwnerDataBuckets(Bot* self)
|
||||||
{
|
{
|
||||||
return self->HasOwner() && DataBucket::GetDataBuckets(self->GetBotOwner());
|
return self->HasOwner() && self->LoadDataBucketsCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Perl_Bot_ReloadBotSpells(Bot* self)
|
bool Perl_Bot_ReloadBotSpells(Bot* self)
|
||||||
|
|||||||
@@ -2995,7 +2995,7 @@ bool Perl_Client_IsAutoFireEnabled(Client* self)
|
|||||||
|
|
||||||
bool Perl_Client_ReloadDataBuckets(Client* self)
|
bool Perl_Client_ReloadDataBuckets(Client* self)
|
||||||
{
|
{
|
||||||
return DataBucket::GetDataBuckets(self);
|
return self->LoadDataBucketsCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Perl_Client_GetEXPForLevel(Client* self, uint16 check_level)
|
uint32 Perl_Client_GetEXPForLevel(Client* self, uint16 check_level)
|
||||||
|
|||||||
@@ -939,6 +939,7 @@ QuestInterface* QuestParserCollection::GetQIByNPCQuest(uint32 npc_id, std::strin
|
|||||||
|
|
||||||
Strings::FindReplace(npc_name, "`", "-");
|
Strings::FindReplace(npc_name, "`", "-");
|
||||||
|
|
||||||
|
for (auto & dir : path.GetQuestPaths()) {
|
||||||
const std::string& npc_id_and_name = fmt::format(
|
const std::string& npc_id_and_name = fmt::format(
|
||||||
"{}_{}",
|
"{}_{}",
|
||||||
npc_name,
|
npc_name,
|
||||||
@@ -947,19 +948,19 @@ QuestInterface* QuestParserCollection::GetQIByNPCQuest(uint32 npc_id, std::strin
|
|||||||
|
|
||||||
const std::string& global_path = fmt::format(
|
const std::string& global_path = fmt::format(
|
||||||
"{}/{}",
|
"{}/{}",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
QUEST_GLOBAL_DIRECTORY
|
QUEST_GLOBAL_DIRECTORY
|
||||||
);
|
);
|
||||||
|
|
||||||
const std::string& zone_path = fmt::format(
|
const std::string& zone_path = fmt::format(
|
||||||
"{}/{}",
|
"{}/{}",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
zone->GetShortName()
|
zone->GetShortName()
|
||||||
);
|
);
|
||||||
|
|
||||||
const std::string& zone_versioned_path = fmt::format(
|
const std::string& zone_versioned_path = fmt::format(
|
||||||
"{}/{}/v{}",
|
"{}/{}/v{}",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
zone->GetShortName(),
|
zone->GetShortName(),
|
||||||
zone->GetInstanceVersion()
|
zone->GetInstanceVersion()
|
||||||
);
|
);
|
||||||
@@ -995,6 +996,7 @@ QuestInterface* QuestParserCollection::GetQIByNPCQuest(uint32 npc_id, std::strin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@@ -1005,21 +1007,22 @@ QuestInterface* QuestParserCollection::GetQIByPlayerQuest(std::string& filename)
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto & dir : path.GetQuestPaths()) {
|
||||||
const std::string& global_path = fmt::format(
|
const std::string& global_path = fmt::format(
|
||||||
"{}/{}",
|
"{}/{}",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
QUEST_GLOBAL_DIRECTORY
|
QUEST_GLOBAL_DIRECTORY
|
||||||
);
|
);
|
||||||
|
|
||||||
const std::string& zone_path = fmt::format(
|
const std::string& zone_path = fmt::format(
|
||||||
"{}/{}",
|
"{}/{}",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
zone->GetShortName()
|
zone->GetShortName()
|
||||||
);
|
);
|
||||||
|
|
||||||
const std::string& zone_versioned_path = fmt::format(
|
const std::string& zone_versioned_path = fmt::format(
|
||||||
"{}/{}/v{}",
|
"{}/{}/v{}",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
zone->GetShortName(),
|
zone->GetShortName(),
|
||||||
zone->GetInstanceVersion()
|
zone->GetInstanceVersion()
|
||||||
);
|
);
|
||||||
@@ -1046,6 +1049,7 @@ QuestInterface* QuestParserCollection::GetQIByPlayerQuest(std::string& filename)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@@ -1058,10 +1062,11 @@ QuestInterface* QuestParserCollection::GetQIByGlobalNPCQuest(std::string& filena
|
|||||||
|
|
||||||
std::string file_name;
|
std::string file_name;
|
||||||
|
|
||||||
|
for (auto & dir : path.GetQuestPaths()) {
|
||||||
for (auto* e: _load_precedence) {
|
for (auto* e: _load_precedence) {
|
||||||
file_name = fmt::format(
|
file_name = fmt::format(
|
||||||
"{}/{}/global_npc.{}",
|
"{}/{}/global_npc.{}",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
QUEST_GLOBAL_DIRECTORY,
|
QUEST_GLOBAL_DIRECTORY,
|
||||||
_extensions.find(e->GetIdentifier())->second
|
_extensions.find(e->GetIdentifier())->second
|
||||||
);
|
);
|
||||||
@@ -1071,6 +1076,7 @@ QuestInterface* QuestParserCollection::GetQIByGlobalNPCQuest(std::string& filena
|
|||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@@ -1082,10 +1088,11 @@ QuestInterface* QuestParserCollection::GetQIByGlobalPlayerQuest(std::string& fil
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string file_name;
|
std::string file_name;
|
||||||
|
for (auto & dir : path.GetQuestPaths()) {
|
||||||
for (auto* e: _load_precedence) {
|
for (auto* e: _load_precedence) {
|
||||||
file_name = fmt::format(
|
file_name = fmt::format(
|
||||||
"{}/{}/global_player.{}",
|
"{}/{}/global_player.{}",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
QUEST_GLOBAL_DIRECTORY,
|
QUEST_GLOBAL_DIRECTORY,
|
||||||
_extensions.find(e->GetIdentifier())->second
|
_extensions.find(e->GetIdentifier())->second
|
||||||
);
|
);
|
||||||
@@ -1095,6 +1102,7 @@ QuestInterface* QuestParserCollection::GetQIByGlobalPlayerQuest(std::string& fil
|
|||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@@ -1105,21 +1113,22 @@ QuestInterface* QuestParserCollection::GetQIBySpellQuest(uint32 spell_id, std::s
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto & dir : path.GetQuestPaths()) {
|
||||||
const std::string& global_path = fmt::format(
|
const std::string& global_path = fmt::format(
|
||||||
"{}/{}/spells",
|
"{}/{}/spells",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
QUEST_GLOBAL_DIRECTORY
|
QUEST_GLOBAL_DIRECTORY
|
||||||
);
|
);
|
||||||
|
|
||||||
const std::string& zone_path = fmt::format(
|
const std::string& zone_path = fmt::format(
|
||||||
"{}/{}/spells",
|
"{}/{}/spells",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
zone->GetShortName()
|
zone->GetShortName()
|
||||||
);
|
);
|
||||||
|
|
||||||
const std::string& zone_versioned_path = fmt::format(
|
const std::string& zone_versioned_path = fmt::format(
|
||||||
"{}/{}/v{}/spells",
|
"{}/{}/v{}/spells",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
zone->GetShortName(),
|
zone->GetShortName(),
|
||||||
zone->GetInstanceVersion()
|
zone->GetInstanceVersion()
|
||||||
);
|
);
|
||||||
@@ -1147,6 +1156,7 @@ QuestInterface* QuestParserCollection::GetQIBySpellQuest(uint32 spell_id, std::s
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@@ -1157,21 +1167,22 @@ QuestInterface* QuestParserCollection::GetQIByItemQuest(std::string item_script,
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto & dir : path.GetQuestPaths()) {
|
||||||
const std::string& global_path = fmt::format(
|
const std::string& global_path = fmt::format(
|
||||||
"{}/{}/items",
|
"{}/{}/items",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
QUEST_GLOBAL_DIRECTORY
|
QUEST_GLOBAL_DIRECTORY
|
||||||
);
|
);
|
||||||
|
|
||||||
const std::string& zone_path = fmt::format(
|
const std::string& zone_path = fmt::format(
|
||||||
"{}/{}/items",
|
"{}/{}/items",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
zone->GetShortName()
|
zone->GetShortName()
|
||||||
);
|
);
|
||||||
|
|
||||||
const std::string& zone_versioned_path = fmt::format(
|
const std::string& zone_versioned_path = fmt::format(
|
||||||
"{}/{}/v{}/items",
|
"{}/{}/v{}/items",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
zone->GetShortName(),
|
zone->GetShortName(),
|
||||||
zone->GetInstanceVersion()
|
zone->GetInstanceVersion()
|
||||||
);
|
);
|
||||||
@@ -1199,6 +1210,7 @@ QuestInterface* QuestParserCollection::GetQIByItemQuest(std::string item_script,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@@ -1209,21 +1221,22 @@ QuestInterface* QuestParserCollection::GetQIByEncounterQuest(std::string encount
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto & dir : path.GetQuestPaths()) {
|
||||||
const std::string& global_path = fmt::format(
|
const std::string& global_path = fmt::format(
|
||||||
"{}/{}/encounters",
|
"{}/{}/encounters",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
QUEST_GLOBAL_DIRECTORY
|
QUEST_GLOBAL_DIRECTORY
|
||||||
);
|
);
|
||||||
|
|
||||||
const std::string& zone_path = fmt::format(
|
const std::string& zone_path = fmt::format(
|
||||||
"{}/{}/encounters",
|
"{}/{}/encounters",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
zone->GetShortName()
|
zone->GetShortName()
|
||||||
);
|
);
|
||||||
|
|
||||||
const std::string& zone_versioned_path = fmt::format(
|
const std::string& zone_versioned_path = fmt::format(
|
||||||
"{}/{}/v{}/encounters",
|
"{}/{}/v{}/encounters",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
zone->GetShortName(),
|
zone->GetShortName(),
|
||||||
zone->GetInstanceVersion()
|
zone->GetInstanceVersion()
|
||||||
);
|
);
|
||||||
@@ -1249,6 +1262,7 @@ QuestInterface* QuestParserCollection::GetQIByEncounterQuest(std::string encount
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@@ -1259,21 +1273,22 @@ QuestInterface* QuestParserCollection::GetQIByBotQuest(std::string& filename)
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto & dir : path.GetQuestPaths()) {
|
||||||
const std::string& global_path = fmt::format(
|
const std::string& global_path = fmt::format(
|
||||||
"{}/{}",
|
"{}/{}",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
QUEST_GLOBAL_DIRECTORY
|
QUEST_GLOBAL_DIRECTORY
|
||||||
);
|
);
|
||||||
|
|
||||||
const std::string& zone_path = fmt::format(
|
const std::string& zone_path = fmt::format(
|
||||||
"{}/{}",
|
"{}/{}",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
zone->GetShortName()
|
zone->GetShortName()
|
||||||
);
|
);
|
||||||
|
|
||||||
const std::string& zone_versioned_path = fmt::format(
|
const std::string& zone_versioned_path = fmt::format(
|
||||||
"{}/{}/v{}",
|
"{}/{}/v{}",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
zone->GetShortName(),
|
zone->GetShortName(),
|
||||||
zone->GetInstanceVersion()
|
zone->GetInstanceVersion()
|
||||||
);
|
);
|
||||||
@@ -1300,6 +1315,7 @@ QuestInterface* QuestParserCollection::GetQIByBotQuest(std::string& filename)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@@ -1311,10 +1327,11 @@ QuestInterface* QuestParserCollection::GetQIByGlobalBotQuest(std::string& filena
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string file_name;
|
std::string file_name;
|
||||||
|
for (auto & dir : path.GetQuestPaths()) {
|
||||||
for (auto* e: _load_precedence) {
|
for (auto* e: _load_precedence) {
|
||||||
file_name = fmt::format(
|
file_name = fmt::format(
|
||||||
"{}/{}/global_bot.{}",
|
"{}/{}/global_bot.{}",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
QUEST_GLOBAL_DIRECTORY,
|
QUEST_GLOBAL_DIRECTORY,
|
||||||
_extensions.find(e->GetIdentifier())->second
|
_extensions.find(e->GetIdentifier())->second
|
||||||
);
|
);
|
||||||
@@ -1324,6 +1341,7 @@ QuestInterface* QuestParserCollection::GetQIByGlobalBotQuest(std::string& filena
|
|||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@@ -1334,21 +1352,22 @@ QuestInterface* QuestParserCollection::GetQIByMercQuest(std::string& filename)
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto & dir : path.GetQuestPaths()) {
|
||||||
const std::string& global_path = fmt::format(
|
const std::string& global_path = fmt::format(
|
||||||
"{}/{}",
|
"{}/{}",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
QUEST_GLOBAL_DIRECTORY
|
QUEST_GLOBAL_DIRECTORY
|
||||||
);
|
);
|
||||||
|
|
||||||
const std::string& zone_path = fmt::format(
|
const std::string& zone_path = fmt::format(
|
||||||
"{}/{}",
|
"{}/{}",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
zone->GetShortName()
|
zone->GetShortName()
|
||||||
);
|
);
|
||||||
|
|
||||||
const std::string& zone_versioned_path = fmt::format(
|
const std::string& zone_versioned_path = fmt::format(
|
||||||
"{}/{}/v{}",
|
"{}/{}/v{}",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
zone->GetShortName(),
|
zone->GetShortName(),
|
||||||
zone->GetInstanceVersion()
|
zone->GetInstanceVersion()
|
||||||
);
|
);
|
||||||
@@ -1375,6 +1394,7 @@ QuestInterface* QuestParserCollection::GetQIByMercQuest(std::string& filename)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@@ -1386,10 +1406,11 @@ QuestInterface* QuestParserCollection::GetQIByGlobalMercQuest(std::string& filen
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string file_name;
|
std::string file_name;
|
||||||
|
for (auto & dir : path.GetQuestPaths()) {
|
||||||
for (auto* e: _load_precedence) {
|
for (auto* e: _load_precedence) {
|
||||||
file_name = fmt::format(
|
file_name = fmt::format(
|
||||||
"{}/{}/global_merc.{}",
|
"{}/{}/global_merc.{}",
|
||||||
path.GetQuestsPath(),
|
dir,
|
||||||
QUEST_GLOBAL_DIRECTORY,
|
QUEST_GLOBAL_DIRECTORY,
|
||||||
_extensions.find(e->GetIdentifier())->second
|
_extensions.find(e->GetIdentifier())->second
|
||||||
);
|
);
|
||||||
@@ -1399,6 +1420,7 @@ QuestInterface* QuestParserCollection::GetQIByGlobalMercQuest(std::string& filen
|
|||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ void SharedTaskZoneMessaging::HandleWorldMessage(ServerPacket *pack)
|
|||||||
->AcceptNewTask(
|
->AcceptNewTask(
|
||||||
c,
|
c,
|
||||||
(int) p->requested_task_id,
|
(int) p->requested_task_id,
|
||||||
(int) p->requested_npc_type_id,
|
(int) p->requested_npc_entity_id,
|
||||||
p->accept_time
|
p->accept_time
|
||||||
);
|
);
|
||||||
c->LoadClientTaskState();
|
c->LoadClientTaskState();
|
||||||
|
|||||||
+1
-1
@@ -80,7 +80,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
|||||||
#include "../common/repositories/character_corpses_repository.h"
|
#include "../common/repositories/character_corpses_repository.h"
|
||||||
#include "../common/repositories/spell_buckets_repository.h"
|
#include "../common/repositories/spell_buckets_repository.h"
|
||||||
|
|
||||||
#include "data_bucket.h"
|
#include "../common/data_bucket.h"
|
||||||
#include "quest_parser_collection.h"
|
#include "quest_parser_collection.h"
|
||||||
#include "string_ids.h"
|
#include "string_ids.h"
|
||||||
#include "worldserver.h"
|
#include "worldserver.h"
|
||||||
|
|||||||
@@ -1968,7 +1968,7 @@ void ClientTaskState::RemoveTaskByTaskID(Client *client, uint32 task_id)
|
|||||||
void ClientTaskState::AcceptNewTask(
|
void ClientTaskState::AcceptNewTask(
|
||||||
Client *client,
|
Client *client,
|
||||||
int task_id,
|
int task_id,
|
||||||
int npc_type_id,
|
int npc_entity_id,
|
||||||
time_t accept_time,
|
time_t accept_time,
|
||||||
bool enforce_level_requirement
|
bool enforce_level_requirement
|
||||||
)
|
)
|
||||||
@@ -2001,7 +2001,7 @@ void ClientTaskState::AcceptNewTask(
|
|||||||
// fill
|
// fill
|
||||||
r->requested_character_id = client->CharacterID();
|
r->requested_character_id = client->CharacterID();
|
||||||
r->requested_task_id = task_id;
|
r->requested_task_id = task_id;
|
||||||
r->requested_npc_type_id = npc_type_id;
|
r->requested_npc_entity_id = npc_entity_id;
|
||||||
|
|
||||||
// send
|
// send
|
||||||
worldserver.SendPacket(pack);
|
worldserver.SendPacket(pack);
|
||||||
@@ -2190,11 +2190,11 @@ void ClientTaskState::AcceptNewTask(
|
|||||||
|
|
||||||
task_manager->SaveClientState(client, this);
|
task_manager->SaveClientState(client, this);
|
||||||
|
|
||||||
NPC *npc = entity_list.GetID(npc_type_id)->CastToNPC();
|
NPC *npc = entity_list.GetNPCByID(npc_entity_id);
|
||||||
if (npc) {
|
if (npc) {
|
||||||
if (player_event_logs.IsEventEnabled(PlayerEvent::TASK_ACCEPT)) {
|
if (player_event_logs.IsEventEnabled(PlayerEvent::TASK_ACCEPT)) {
|
||||||
auto e = PlayerEvent::TaskAcceptEvent{
|
auto e = PlayerEvent::TaskAcceptEvent{
|
||||||
.npc_id = static_cast<uint32>(npc_type_id),
|
.npc_id = npc->GetNPCTypeID(),
|
||||||
.npc_name = npc->GetCleanName(),
|
.npc_name = npc->GetCleanName(),
|
||||||
.task_id = static_cast<uint32>(task_id),
|
.task_id = static_cast<uint32>(task_id),
|
||||||
.task_name = task_manager->GetTaskName(static_cast<uint32>(task_id)),
|
.task_name = task_manager->GetTaskName(static_cast<uint32>(task_id)),
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public:
|
|||||||
int GetTaskActivityDoneCount(TaskType task_type, int index, int activity_id);
|
int GetTaskActivityDoneCount(TaskType task_type, int index, int activity_id);
|
||||||
int GetTaskActivityDoneCountFromTaskID(int task_id, int activity_id);
|
int GetTaskActivityDoneCountFromTaskID(int task_id, int activity_id);
|
||||||
int GetTaskStartTime(TaskType task_type, int index);
|
int GetTaskStartTime(TaskType task_type, int index);
|
||||||
void AcceptNewTask(Client *client, int task_id, int npc_type_id, time_t accept_time, bool enforce_level_requirement = false);
|
void AcceptNewTask(Client *client, int task_id, int npc_entity_id, time_t accept_time, bool enforce_level_requirement = false);
|
||||||
void FailTask(Client *client, int task_id);
|
void FailTask(Client *client, int task_id);
|
||||||
int TaskTimeLeft(int task_id);
|
int TaskTimeLeft(int task_id);
|
||||||
bool IsTaskCompleted(int task_id, Client *c = nullptr);
|
bool IsTaskCompleted(int task_id, Client *c = nullptr);
|
||||||
|
|||||||
@@ -88,8 +88,6 @@ extern WorldServer worldserver;
|
|||||||
extern Zone* zone;
|
extern Zone* zone;
|
||||||
extern NpcScaleManager* npc_scale_manager;
|
extern NpcScaleManager* npc_scale_manager;
|
||||||
|
|
||||||
Mutex MZoneShutdown;
|
|
||||||
|
|
||||||
volatile bool is_zone_loaded = false;
|
volatile bool is_zone_loaded = false;
|
||||||
Zone* zone = 0;
|
Zone* zone = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user