mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-07 11:22:24 +00:00
Updates
This commit is contained in:
parent
8f54abec61
commit
34b3a3fc88
@ -679,7 +679,7 @@ int ZoneStore::GetZoneNPCMaximumAggroDistance(uint32 zone_id, int version)
|
|||||||
uint32 ZoneStore::GetZoneMaximumMovementUpdateRange(uint32 zone_id, int version)
|
uint32 ZoneStore::GetZoneMaximumMovementUpdateRange(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
const auto& z = GetZoneVersionWithFallback(zone_id, version);
|
const auto& z = GetZoneVersionWithFallback(zone_id, version);
|
||||||
return z ? z->max_movement_update_range : DEFAULT_ZONE_MAX_MOVEMENT_UPDATE_RANGE;
|
return z ? z->npc_update_range : DEFAULT_ZONE_MAX_MOVEMENT_UPDATE_RANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 ZoneStore::GetZoneMinimumExpansion(uint32 zone_id, int version)
|
int8 ZoneStore::GetZoneMinimumExpansion(uint32 zone_id, int version)
|
||||||
|
|||||||
@ -1122,7 +1122,7 @@ void EntityList::AESpell(
|
|||||||
|
|
||||||
LogAoeCast(
|
LogAoeCast(
|
||||||
"Close scan distance [{}] cast distance [{}]",
|
"Close scan distance [{}] cast distance [{}]",
|
||||||
zone->GetMaxUpdateRange(),
|
zone->GetMaxNpcUpdateRange(),
|
||||||
distance
|
distance
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -1733,7 +1733,7 @@ void EntityList::QueueCloseClients(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (distance <= 0) {
|
if (distance <= 0) {
|
||||||
distance = zone->GetMaxUpdateRange();
|
distance = zone->GetMaxClientUpdateRange();
|
||||||
}
|
}
|
||||||
|
|
||||||
float distance_squared = distance * distance;
|
float distance_squared = distance * distance;
|
||||||
@ -2940,7 +2940,7 @@ void EntityList::ScanCloseMobs(Mob *scanning_mob)
|
|||||||
|
|
||||||
g_scan_bench_timer.reset();
|
g_scan_bench_timer.reset();
|
||||||
|
|
||||||
float scan_range = zone->GetMaxUpdateRange();
|
float scan_range = std::max(zone->GetMaxNpcUpdateRange(), zone->GetMaxClientUpdateRange());
|
||||||
|
|
||||||
// Reserve memory in m_close_mobs to avoid frequent re-allocations if not already reserved.
|
// Reserve memory in m_close_mobs to avoid frequent re-allocations if not already reserved.
|
||||||
// Assuming mob_list.size() as an upper bound for reservation.
|
// Assuming mob_list.size() as an upper bound for reservation.
|
||||||
@ -2948,7 +2948,7 @@ void EntityList::ScanCloseMobs(Mob *scanning_mob)
|
|||||||
scanning_mob->m_close_mobs.reserve(mob_list.size());
|
scanning_mob->m_close_mobs.reserve(mob_list.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
scanning_mob->m_close_mobs.clear();
|
scanning_mob->m_close_mobs.clear();
|
||||||
|
|
||||||
for (auto &e : mob_list) {
|
for (auto &e : mob_list) {
|
||||||
auto mob = e.second;
|
auto mob = e.second;
|
||||||
@ -3002,7 +3002,7 @@ void EntityList::UpdateVisibility(Mob *scanning_mob) {
|
|||||||
int8_t scanning_visibility = (it_scanning_visible != scanning_mob->m_can_see_mob.end())
|
int8_t scanning_visibility = (it_scanning_visible != scanning_mob->m_can_see_mob.end())
|
||||||
? it_scanning_visible->second : 0;
|
? it_scanning_visible->second : 0;
|
||||||
|
|
||||||
if (scanning_mob->CalculateDistance(mob) <= zone->GetMaxUpdateRange()) {
|
if (scanning_mob->CalculateDistance(mob) <= mob->GetUpdateRange()) {
|
||||||
if (scanning_visibility != STATE_VISIBLE) { // Become visible
|
if (scanning_visibility != STATE_VISIBLE) { // Become visible
|
||||||
if (scanning_mob->IsClient()) {
|
if (scanning_mob->IsClient()) {
|
||||||
scanning_mob->CastToClient()->SetVisibility(mob, true);
|
scanning_mob->CastToClient()->SetVisibility(mob, true);
|
||||||
@ -5815,7 +5815,7 @@ void EntityList::ReloadMerchants() {
|
|||||||
*/
|
*/
|
||||||
std::unordered_map<uint16, Mob *> &EntityList::GetCloseMobList(Mob *mob, float distance)
|
std::unordered_map<uint16, Mob *> &EntityList::GetCloseMobList(Mob *mob, float distance)
|
||||||
{
|
{
|
||||||
if (distance <= zone->GetMaxUpdateRange()) {
|
if (distance <= zone->GetMaxNpcUpdateRange()) {
|
||||||
return mob->m_close_mobs;
|
return mob->m_close_mobs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
10
zone/mob.cpp
10
zone/mob.cpp
@ -8617,17 +8617,21 @@ std::unordered_map<uint16, Mob *> &Mob::GetCloseMobList(float distance)
|
|||||||
void Mob::ClearDataBucketCache()
|
void Mob::ClearDataBucketCache()
|
||||||
{
|
{
|
||||||
if (IsOfClientBot()) {
|
if (IsOfClientBot()) {
|
||||||
uint64 id = 0;
|
uint64 id = 0;
|
||||||
DataBucketLoadType::Type t{};
|
DataBucketLoadType::Type t{};
|
||||||
if (IsBot()) {
|
if (IsBot()) {
|
||||||
id = CastToBot()->GetBotID();
|
id = CastToBot()->GetBotID();
|
||||||
t = DataBucketLoadType::Bot;
|
t = DataBucketLoadType::Bot;
|
||||||
}
|
}
|
||||||
else if (IsClient()) {
|
else if (IsClient()) {
|
||||||
id = CastToClient()->CharacterID();
|
id = CastToClient()->CharacterID();
|
||||||
t = DataBucketLoadType::Client;
|
t = DataBucketLoadType::Client;
|
||||||
}
|
}
|
||||||
|
|
||||||
DataBucket::DeleteFromCache(id, t);
|
DataBucket::DeleteFromCache(id, t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float Mob::GetUpdateRange() {
|
||||||
|
return IsClient() ? zone->GetMaxClientUpdateRange() : zone->GetMaxNpcUpdateRange();
|
||||||
|
}
|
||||||
|
|||||||
@ -1493,6 +1493,7 @@ public:
|
|||||||
|
|
||||||
std::unordered_map<uint16, Mob *> &GetCloseMobList(float distance = 0.0f);
|
std::unordered_map<uint16, Mob *> &GetCloseMobList(float distance = 0.0f);
|
||||||
void CheckScanCloseMobsMovingTimer();
|
void CheckScanCloseMobsMovingTimer();
|
||||||
|
float GetUpdateRange();
|
||||||
|
|
||||||
void ClearDataBucketCache();
|
void ClearDataBucketCache();
|
||||||
|
|
||||||
|
|||||||
@ -859,7 +859,7 @@ void MobMovementManager::SendCommandToClients(
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
float short_range = RuleR(Pathing, ShortMovementUpdateRange);
|
float short_range = RuleR(Pathing, ShortMovementUpdateRange);
|
||||||
float long_range = zone->GetMaxUpdateRange();
|
float long_range = zone->GetMaxNpcUpdateRange();
|
||||||
|
|
||||||
for (auto &c : _impl->Clients) {
|
for (auto &c : _impl->Clients) {
|
||||||
if (single_client && c != single_client) {
|
if (single_client && c != single_client) {
|
||||||
|
|||||||
@ -1373,17 +1373,18 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_version)
|
|||||||
newzone_data.suspend_buffs = z->suspendbuffs;
|
newzone_data.suspend_buffs = z->suspendbuffs;
|
||||||
|
|
||||||
// local attributes
|
// local attributes
|
||||||
can_bind = z->canbind != 0;
|
can_bind = z->canbind != 0;
|
||||||
is_city = z->canbind == 2;
|
is_city = z->canbind == 2;
|
||||||
can_combat = z->cancombat != 0;
|
can_combat = z->cancombat != 0;
|
||||||
can_levitate = z->canlevitate != 0;
|
can_levitate = z->canlevitate != 0;
|
||||||
can_castoutdoor = z->castoutdoor != 0;
|
can_castoutdoor = z->castoutdoor != 0;
|
||||||
is_hotzone = z->hotzone != 0;
|
is_hotzone = z->hotzone != 0;
|
||||||
max_movement_update_range = z->max_movement_update_range;
|
m_npc_update_range = z->npc_update_range;
|
||||||
default_ruleset = z->ruleset;
|
m_client_update_range = z->client_update_range;
|
||||||
allow_mercs = true;
|
default_ruleset = z->ruleset;
|
||||||
m_graveyard_id = z->graveyard_id;
|
allow_mercs = true;
|
||||||
m_max_clients = z->maxclients;
|
m_graveyard_id = z->graveyard_id;
|
||||||
|
m_max_clients = z->maxclients;
|
||||||
|
|
||||||
SetIdleWhenEmpty(z->idle_when_empty);
|
SetIdleWhenEmpty(z->idle_when_empty);
|
||||||
SetSecondsBeforeIdle(z->seconds_before_idle);
|
SetSecondsBeforeIdle(z->seconds_before_idle);
|
||||||
|
|||||||
@ -414,7 +414,8 @@ public:
|
|||||||
SendDiscordMessage(webhook_id, message_prefix + Discord::FormatDiscordMessage(log_category, message));
|
SendDiscordMessage(webhook_id, message_prefix + Discord::FormatDiscordMessage(log_category, message));
|
||||||
};
|
};
|
||||||
|
|
||||||
double GetMaxUpdateRange() const { return max_movement_update_range; }
|
double GetMaxNpcUpdateRange() const { return m_npc_update_range; }
|
||||||
|
double GetMaxClientUpdateRange() const { return m_client_update_range; }
|
||||||
|
|
||||||
void SetIsHotzone(bool is_hotzone);
|
void SetIsHotzone(bool is_hotzone);
|
||||||
|
|
||||||
@ -466,7 +467,8 @@ private:
|
|||||||
bool staticzone;
|
bool staticzone;
|
||||||
bool zone_has_current_time;
|
bool zone_has_current_time;
|
||||||
bool quest_hot_reload_queued;
|
bool quest_hot_reload_queued;
|
||||||
double max_movement_update_range;
|
double m_npc_update_range;
|
||||||
|
double m_client_update_range;
|
||||||
char *long_name;
|
char *long_name;
|
||||||
char *map_name;
|
char *map_name;
|
||||||
char *short_name;
|
char *short_name;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user