diff options
author | joschiwald <joschiwald.trinity@gmail.com> | 2014-11-17 18:21:41 +0100 |
---|---|---|
committer | joschiwald <joschiwald.trinity@gmail.com> | 2014-11-17 18:21:41 +0100 |
commit | da37723b5f6739eb536b3c32676177b3b821c39d (patch) | |
tree | 08db9be04a922a9f058356babc1a7b986fddda3a /src/server/game/Reputation/ReputationMgr.cpp | |
parent | cff8b624483f14ae4d2a7cd65a3455f15595cc1f (diff) |
Core/Packets: updated SMSG_INITIALIZE_FACTIONS and added struct for SMSG_CHANNEL_LIST
Diffstat (limited to 'src/server/game/Reputation/ReputationMgr.cpp')
-rw-r--r-- | src/server/game/Reputation/ReputationMgr.cpp | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp index 359a8f3946a..3bf3464f016 100644 --- a/src/server/game/Reputation/ReputationMgr.cpp +++ b/src/server/game/Reputation/ReputationMgr.cpp @@ -18,6 +18,7 @@ #include "DatabaseEnv.h" #include "ReputationMgr.h" +#include "ReputationPackets.h" #include "DBCStores.h" #include "Player.h" #include "WorldPacket.h" @@ -199,38 +200,17 @@ void ReputationMgr::SendState(FactionState const* faction) void ReputationMgr::SendInitialReputations() { - uint16 count = 256; - WorldPacket data(SMSG_INITIALIZE_FACTIONS, 4 + count * 5); - data << uint32(count); - - RepListID a = 0; + WorldPackets::Reputation::InitializeFactions initFactions; for (FactionStateList::iterator itr = _factions.begin(); itr != _factions.end(); ++itr) { - // fill in absent fields - for (; a != itr->first; ++a) - { - data << uint8(0); - data << uint32(0); - } - - // fill in encountered data - data << uint8(itr->second.Flags); - data << uint32(itr->second.Standing); - + initFactions.FactionFlags[itr->first] = itr->second.Flags; + initFactions.FactionStandings[itr->first] = itr->second.Standing; + /// @todo faction bonus itr->second.needSend = false; - - ++a; } - // fill in absent fields - for (; a != count; ++a) - { - data << uint8(0); - data << uint32(0); - } - - _player->SendDirectMessage(&data); + _player->SendDirectMessage(initFactions.Write()); } void ReputationMgr::SendStates() |