Implement new rule based ranges for various range based packet operations (performance)

- the defaults are set in the code and can be tweaked by sourcing utils/sql/git/optional/rule_values_range_update.sql
- Thanks to mackal for gathering live ranges, thanks to takp for initial numbers
- We would send 200 for combat updates and the client will only display <= range 54 anyways, these should help a lot in spammy combat

RULE_CATEGORY( Range )
RULE_INT ( Range, Say, 135 )
RULE_INT ( Range, Emote, 135 )
RULE_INT ( Range, BeginCast, 200)
RULE_INT ( Range, Anims, 135)
RULE_INT ( Range, DamageMessages, 50)
RULE_INT ( Range, SpellMessages, 75)
RULE_INT ( Range, SongMessages, 75)
RULE_CATEGORY_END()
This commit is contained in:
Akkadius
2017-03-12 14:38:14 -05:00
parent 8cd6416754
commit 14d09485eb
8 changed files with 39 additions and 21 deletions
+3 -3
View File
@@ -1099,7 +1099,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
CheckLDoNHail(GetTarget());
CheckEmoteHail(GetTarget(), message);
if(DistanceSquaredNoZ(m_Position, GetTarget()->GetPosition()) <= 200) {
if(DistanceSquaredNoZ(m_Position, GetTarget()->GetPosition()) <= RuleI(Range, Say)) {
NPC *tar = GetTarget()->CastToNPC();
parse->EventNPC(EVENT_SAY, tar->CastToNPC(), this, message, language);
@@ -1111,7 +1111,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
}
}
else {
if (DistanceSquaredNoZ(m_Position, GetTarget()->GetPosition()) <= 200) {
if (DistanceSquaredNoZ(m_Position, GetTarget()->GetPosition()) <= RuleI(Range, Say)) {
parse->EventNPC(EVENT_AGGRO_SAY, GetTarget()->CastToNPC(), this, message, language);
}
}
@@ -1140,7 +1140,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
char *Buffer = (char *)es;
Buffer += 4;
snprintf(Buffer, sizeof(Emote_Struct) - 4, "%s %s", GetName(), message);
entity_list.QueueCloseClients(this, outapp, true, 100, 0, true, FilterSocials);
entity_list.QueueCloseClients(this, outapp, true, RuleI(Range, Emote), 0, true, FilterSocials);
safe_delete(outapp);
break;
}