mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-18 03:01:29 +00:00
Merge branch 'master' into aa
This commit is contained in:
commit
963eb91669
@ -207,6 +207,7 @@ Client::Client(EQStreamInterface* ieqs)
|
|||||||
npclevel = 0;
|
npclevel = 0;
|
||||||
pQueuedSaveWorkID = 0;
|
pQueuedSaveWorkID = 0;
|
||||||
position_timer_counter = 0;
|
position_timer_counter = 0;
|
||||||
|
position_update_same_count = 0;
|
||||||
fishing_timer.Disable();
|
fishing_timer.Disable();
|
||||||
shield_timer.Disable();
|
shield_timer.Disable();
|
||||||
dead_timer.Disable();
|
dead_timer.Disable();
|
||||||
|
|||||||
@ -1449,6 +1449,9 @@ private:
|
|||||||
Timer position_timer;
|
Timer position_timer;
|
||||||
uint8 position_timer_counter;
|
uint8 position_timer_counter;
|
||||||
|
|
||||||
|
// this is used to try to cut back on position update reflections
|
||||||
|
int position_update_same_count;
|
||||||
|
|
||||||
PTimerList p_timers; //persistent timers
|
PTimerList p_timers; //persistent timers
|
||||||
Timer hpupdate_timer;
|
Timer hpupdate_timer;
|
||||||
Timer camp_timer;
|
Timer camp_timer;
|
||||||
|
|||||||
@ -4459,9 +4459,20 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
// Outgoing client packet
|
// Outgoing client packet
|
||||||
float tmpheading = EQ19toFloat(ppu->heading);
|
float tmpheading = EQ19toFloat(ppu->heading);
|
||||||
|
/* The clients send an update at best every 1.3 seconds
|
||||||
|
* We want to avoid reflecting these updates to other clients as much as possible
|
||||||
|
* The client also sends an update every 280 ms while turning, if we prevent
|
||||||
|
* sending these by checking if the location is the same too aggressively, clients end up spinning
|
||||||
|
* so keep a count of how many packets are the same within a tolerance and stop when we get there */
|
||||||
|
|
||||||
if (!FCMP(ppu->y_pos, m_Position.y) || !FCMP(ppu->x_pos, m_Position.x) || !FCMP(tmpheading, m_Position.w) || ppu->animation != animation)
|
bool pos_same = FCMP(ppu->y_pos, m_Position.y) && FCMP(ppu->x_pos, m_Position.x) && FCMP(tmpheading, m_Position.w) && ppu->animation == animation;
|
||||||
|
if (!pos_same || (pos_same && position_update_same_count < 6))
|
||||||
{
|
{
|
||||||
|
if (pos_same)
|
||||||
|
position_update_same_count++;
|
||||||
|
else
|
||||||
|
position_update_same_count = 0;
|
||||||
|
|
||||||
m_Position.x = ppu->x_pos;
|
m_Position.x = ppu->x_pos;
|
||||||
m_Position.y = ppu->y_pos;
|
m_Position.y = ppu->y_pos;
|
||||||
m_Position.z = ppu->z_pos;
|
m_Position.z = ppu->z_pos;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user