diff options
author | thenecromancer <none@none> | 2010-01-13 11:19:16 +0100 |
---|---|---|
committer | thenecromancer <none@none> | 2010-01-13 11:19:16 +0100 |
commit | e00fd0791b38d78da80d32b4a683612a88e01198 (patch) | |
tree | 27b9f8401616c6f5d01c90abcfe51bc7fdc7e276 /src | |
parent | ea4e25f3aaa10efeacf0849bcb1583ad78ee2b28 (diff) |
Send SMSG_TIME_SYNC_REQ periodicly (period guessed though)
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Player.cpp | 29 | ||||
-rw-r--r-- | src/game/Player.h | 6 |
2 files changed, 32 insertions, 3 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index b5846b3b980..05615c610fb 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -1323,6 +1323,14 @@ void Player::Update( uint32 p_time ) m_zoneUpdateTimer -= p_time; } + if (m_timeSyncTimer > 0)
+ {
+ if(p_time >= m_timeSyncTimer)
+ SendTimeSync();
+ else
+ m_timeSyncTimer -= p_time;
+ } + if (isAlive()) { m_regenTimer += p_time; @@ -20204,9 +20212,8 @@ void Player::SendInitialPacketsAfterAddToMap() GetZoneAndAreaId(newzone,newarea); UpdateZone(newzone,newarea); // also call SendInitWorldStates(); - WorldPacket data(SMSG_TIME_SYNC_REQ, 4); // new 2.0.x, enable movement - data << uint32(0x00000000); // on blizz it increments periodically - GetSession()->SendPacket(&data); + ResetTimeSync();
+ SendTimeSync(); CastSpell(this, SPELL_LOGINEFFECT_836, true); // LOGINEFFECT @@ -23026,6 +23033,22 @@ void Player::ActivateSpec(uint8 spec) SetPower(pw, 0); } +void Player::ResetTimeSync()
+{
+ m_timeSyncCount = 0;
+ m_timeSyncTimer = 0;
+} + +void Player::SendTimeSync()
+{
+ WorldPacket data(SMSG_TIME_SYNC_REQ, 4);
+ data << uint32(m_timeSyncCount++);
+ GetSession()->SendPacket(&data);
+
+ // Send another opcode in 10s again
+ m_timeSyncTimer = 10000;
+} + void Player::SetReputation(uint32 factionentry, uint32 value) { GetReputationMgr().SetReputation(sFactionStore.LookupEntry(factionentry),value); diff --git a/src/game/Player.h b/src/game/Player.h index cac6e889345..b2f1798c36f 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -2437,6 +2437,9 @@ Spell * m_spellModTakingSpell; EnchantDurationList m_enchantDuration; ItemDurationList m_itemDuration; + void ResetTimeSync();
+ void SendTimeSync(); + uint64 m_resurrectGUID; uint32 m_resurrectMap; float m_resurrectX, m_resurrectY, m_resurrectZ; @@ -2572,6 +2575,9 @@ Spell * m_spellModTakingSpell; SpellCooldowns m_spellCooldowns; uint32 m_ChampioningFaction; + + uint32 m_timeSyncCount;
+ uint32 m_timeSyncTimer; }; void AddItemsSetItem(Player*player,Item *item); |