Massive reductions in unnecessary network traffic especially during high spam combat fights

- HP Updates now only send to others when HP percentage changes (0-100%)
		- HP Updates were sending excessively even during idle zones when HP wasn't changing at all
	- Attack animations now only send once per second versus up to a hundred times a second per Mob/Client
	- 17,000 OP_ClientUpdate packets per second have been observed in combat scenarios, some of the major culprits have been
		throttled without affecting what the client should see
	- Before and After packet differences under similar load/tests (Packets per second)
		- 7,000 - 8,000 	OP_Animation pps	After: 600-800 pps
		- 13,0000 - 17,000 	OP_MobHealth pps	After: 1-10 pps
		- 15,0000 - 20,000 	OP_ClientUpdate pps	After: 500-1,000 pps
	- Packet reports from a 46 client test here:
		https://gist.github.com/Akkadius/28b7ad2fdd82bdd15ea737c68f404346
	- Servers who use Marquee HP updates will also recieve far less packet spam as they will only be sent when HP changes
This commit is contained in:
Akkadius
2017-07-09 02:51:01 -05:00
parent aae1d2f049
commit 127f51e758
6 changed files with 51 additions and 7 deletions
+8 -4
View File
@@ -137,7 +137,10 @@ EQEmu::skills::SkillType Mob::AttackAnimation(int Hand, const EQEmu::ItemInstanc
if (Hand == EQEmu::inventory::slotSecondary) // DW anim
type = animDualWield;
DoAnim(type, 0, false);
if (attack_anim_timer.Check()) {
DoAnim(type, 0, false);
}
return skillinuse;
}
@@ -3397,8 +3400,6 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
SetHP(GetHP() - damage);
if (IsClient() && RuleB(Character, MarqueeHPUpdates))
this->CastToClient()->SendHPUpdateMarquee();
if (HasDied()) {
bool IsSaved = false;
@@ -3549,8 +3550,11 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
if (zone->zonemap && zone->zonemap->CheckLoS(glm::vec3(m_Position), new_pos)) { // If we have LoS on the new loc it should be reachable.
if (IsNPC()) {
// Is this adequate?
Teleport(new_pos);
SendPosUpdate();
if (position_update_melee_push_timer.Check()) {
SendPosUpdate();
}
}
}
else {