mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
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:
+19
-1
@@ -114,7 +114,9 @@ Mob::Mob(const char* in_name,
|
||||
mitigation_ac(0),
|
||||
m_specialattacks(eSpecialAttacks::None),
|
||||
fix_z_timer(300),
|
||||
fix_z_timer_engaged(100)
|
||||
fix_z_timer_engaged(100),
|
||||
attack_anim_timer(1000),
|
||||
position_update_melee_push_timer(1000)
|
||||
{
|
||||
targeted = 0;
|
||||
tar_ndx=0;
|
||||
@@ -123,6 +125,8 @@ Mob::Mob(const char* in_name,
|
||||
|
||||
last_z = 0;
|
||||
|
||||
last_hp = 100;
|
||||
|
||||
AI_Init();
|
||||
SetMoving(false);
|
||||
moved=false;
|
||||
@@ -1299,6 +1303,20 @@ void Mob::CreateHPPacket(EQApplicationPacket* app)
|
||||
// sends hp update of this mob to people who might care
|
||||
void Mob::SendHPUpdate(bool skip_self)
|
||||
{
|
||||
|
||||
int8 current_hp = (max_hp == 0 ? 0 : static_cast<int>(cur_hp * 100 / max_hp));
|
||||
|
||||
Log(Logs::General, Logs::HP_Update, "Mob::SendHPUpdate :: SendHPUpdate %s HP is %i last %i", this->GetCleanName(), current_hp, last_hp);
|
||||
if (current_hp == last_hp) {
|
||||
Log(Logs::General, Logs::HP_Update, "Mob::SendHPUpdate :: Same HP - skipping update");
|
||||
ResetHPUpdateTimer();
|
||||
return;
|
||||
}
|
||||
else {
|
||||
Log(Logs::General, Logs::HP_Update, "Mob::SendHPUpdate :: HP Changed - Send update");
|
||||
last_hp = current_hp;
|
||||
}
|
||||
|
||||
EQApplicationPacket hp_app;
|
||||
Group *group = nullptr;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user