diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Makefile.am | 256 | ||||
-rw-r--r-- | src/game/World.cpp | 1 | ||||
-rw-r--r-- | src/game/WorldSession.cpp | 119 | ||||
-rw-r--r-- | src/game/WorldSession.h | 20 | ||||
-rw-r--r-- | src/game/WorldSocket.cpp | 1 |
5 files changed, 397 insertions, 0 deletions
diff --git a/src/game/Makefile.am b/src/game/Makefile.am index 8482a8874ce..a760cdd1eeb 100644 --- a/src/game/Makefile.am +++ b/src/game/Makefile.am @@ -30,6 +30,7 @@ noinst_LIBRARIES = libmangosgame.a # libmangossgame library will later be reused by ... libmangosgame_a_SOURCES = \ +<<<<<<< HEAD:src/game/Makefile.am AccountMgr.cpp \ AccountMgr.h \ AchievementMgr.h \ @@ -309,6 +310,261 @@ libmangosgame_a_SOURCES = \ GroupReference.cpp \ GroupReference.h \ GroupRefManager.h +======= + AccountMgr.cpp \ + AccountMgr.h \ + AchievementMgr.h \ + AchievementMgr.cpp \ + AggressorAI.cpp \ + AggressorAI.h \ + AnimalRandomMovementGenerator.h \ + ArenaTeam.cpp \ + ArenaTeam.h \ + ArenaTeamHandler.cpp \ + AuctionHouseHandler.cpp \ + AuctionHouseMgr.cpp \ + AuctionHouseMgr.h \ + Bag.cpp \ + Bag.h \ + BattleGround.cpp \ + BattleGroundAA.cpp \ + BattleGroundAB.cpp \ + BattleGroundAV.cpp \ + BattleGroundBE.cpp \ + BattleGroundDS.cpp \ + BattleGroundEY.cpp \ + BattleGroundNA.cpp \ + BattleGroundRL.cpp \ + BattleGroundRV.cpp \ + BattleGroundSA.cpp \ + BattleGroundWS.cpp \ + BattleGround.h \ + BattleGroundAA.h \ + BattleGroundAB.h \ + BattleGroundAV.h \ + BattleGroundBE.h \ + BattleGroundDS.h \ + BattleGroundEY.h \ + BattleGroundNA.h \ + BattleGroundRL.h \ + BattleGroundRV.h \ + BattleGroundSA.h \ + BattleGroundWS.h \ + BattleGroundHandler.cpp \ + BattleGroundMgr.cpp \ + BattleGroundMgr.h \ + Calendar.cpp \ + Calendar.h \ + CalendarHandler.cpp \ + Cell.h \ + CellImpl.h \ + Channel.cpp \ + Channel.h \ + ChannelHandler.cpp \ + ChannelMgr.h \ + CharacterHandler.cpp \ + Chat.cpp \ + Chat.h \ + ChatHandler.cpp \ + CombatHandler.cpp \ + ConfusedMovementGenerator.cpp \ + ConfusedMovementGenerator.h \ + Corpse.cpp \ + Corpse.h \ + CreatureAI.cpp \ + CreatureAI.h \ + CreatureAIImpl.h \ + CreatureAIRegistry.cpp \ + CreatureAIRegistry.h \ + CreatureAISelector.cpp \ + CreatureAISelector.h \ + Creature.cpp \ + Creature.h \ + debugcmds.cpp \ + DestinationHolder.cpp \ + DestinationHolder.h \ + DestinationHolderImp.h \ + DuelHandler.cpp \ + DynamicObject.cpp \ + DynamicObject.h \ + FleeingMovementGenerator.cpp \ + FleeingMovementGenerator.h \ + Formulas.h \ + GameEventMgr.cpp \ + GameEventMgr.h \ + GameObject.cpp \ + GameObject.h \ + GlobalEvents.cpp \ + GlobalEvents.h \ + GMTicketHandler.cpp \ + GMTicketMgr.cpp \ + GMTicketMgr.h \ + GossipDef.cpp \ + GossipDef.h \ + GridDefines.h \ + GridNotifiers.cpp \ + GridNotifiers.h \ + GridNotifiersImpl.h \ + GridStates.cpp \ + GridStates.h \ + Group.cpp \ + Group.h \ + GroupHandler.cpp \ + GuardAI.cpp \ + GuardAI.h \ + Guild.cpp \ + Guild.h \ + GuildHandler.cpp \ + HomeMovementGenerator.cpp \ + HomeMovementGenerator.h \ + HostilRefManager.cpp \ + HostilRefManager.h \ + IdleMovementGenerator.cpp \ + IdleMovementGenerator.h \ + InstanceData.cpp \ + InstanceData.h \ + InstanceSaveMgr.cpp \ + InstanceSaveMgr.h \ + Item.cpp \ + Item.h \ + ItemEnchantmentMgr.cpp \ + ItemEnchantmentMgr.h \ + ItemHandler.cpp \ + ItemPrototype.h \ + Language.h \ + Level0.cpp \ + Level1.cpp \ + Level2.cpp \ + Level3.cpp \ + LFGHandler.cpp \ + LootHandler.cpp \ + LootMgr.cpp \ + LootMgr.h \ + Mail.cpp \ + Mail.h \ + Map.cpp \ + Map.h \ + MapInstanced.cpp \ + MapInstanced.h \ + MapManager.cpp \ + MapManager.h \ + MapReference.h \ + MapRefManager.h \ + MiscHandler.cpp \ + MotionMaster.cpp \ + MotionMaster.h \ + MovementGenerator.cpp \ + MovementGenerator.h \ + MovementGeneratorImpl.h \ + MovementHandler.cpp \ + NPCHandler.cpp \ + NPCHandler.h \ + NullCreatureAI.cpp \ + NullCreatureAI.h \ + ObjectAccessor.cpp \ + ObjectAccessor.h \ + Object.cpp \ + ObjectDefines.h \ + ObjectGridLoader.cpp \ + ObjectGridLoader.h \ + Object.h \ + ObjectMgr.cpp \ + ObjectMgr.h \ + ObjectPosSelector.cpp \ + ObjectPosSelector.h \ + Opcodes.cpp \ + Opcodes.h \ + Path.h \ + PetAI.cpp \ + PetAI.h \ + Pet.cpp \ + Pet.h \ + PetHandler.cpp \ + PetitionsHandler.cpp \ + Player.cpp \ + Player.h \ + PlayerDump.cpp \ + PlayerDump.h \ + PointMovementGenerator.cpp \ + PointMovementGenerator.h \ + PoolHandler.cpp \ + PoolHandler.h \ + QueryHandler.cpp \ + QuestDef.cpp \ + QuestDef.h \ + QuestHandler.cpp \ + RandomMovementGenerator.cpp \ + RandomMovementGenerator.h \ + ReactorAI.cpp \ + ReactorAI.h \ + ScriptCalls.cpp \ + ScriptCalls.h \ + SharedDefines.h \ + SkillHandler.cpp \ + SpellAuraDefines.h \ + SpellAuras.cpp \ + SpellAuras.h \ + Spell.cpp \ + SpellEffects.cpp \ + Spell.h \ + SkillDiscovery.cpp \ + SkillDiscovery.h \ + SkillExtraItems.cpp \ + SkillExtraItems.h \ + SpellHandler.cpp \ + SocialMgr.cpp \ + SocialMgr.h \ + SpellMgr.cpp \ + SpellMgr.h \ + StatSystem.cpp \ + TargetedMovementGenerator.cpp \ + TargetedMovementGenerator.h \ + TaxiHandler.cpp \ + TemporarySummon.cpp \ + TemporarySummon.h \ + TotemAI.cpp \ + TotemAI.h \ + Totem.cpp \ + Totem.h \ + TradeHandler.cpp \ + Transports.cpp \ + Transports.h \ + ThreatManager.cpp \ + ThreatManager.h \ + Traveller.h \ + Unit.cpp \ + Unit.h \ + UnitEvents.h \ + UpdateData.cpp \ + UpdateData.h \ + UpdateFields.h \ + UpdateMask.h \ + Vehicle.cpp \ + Vehicle.h \ + VoiceChatHandler.cpp \ + WaypointManager.cpp \ + WaypointManager.h \ + WaypointMovementGenerator.cpp \ + WaypointMovementGenerator.h \ + Weather.cpp \ + Weather.h \ + World.cpp \ + World.h \ + WorldLog.cpp \ + WorldLog.h \ + WorldSession.cpp \ + WorldSession.h \ + WorldSocket.cpp \ + WorldSocket.h \ + WorldSocketMgr.cpp \ + WorldSocketMgr.h \ + FollowerReference.cpp \ + FollowerReference.h \ + FollowerRefManager.h \ + GroupReference.cpp \ + GroupReference.h \ + GroupRefManager.h +>>>>>>> 2429aaf2276d689e101ed88285f18449dbe4280d:src/game/Makefile.am ## Link against shared library libmangosgame_a_LIBADD = ../shared/libmangosshared.a ../shared/Auth/libmangosauth.a ../shared/Config/libmangosconfig.a ../shared/Database/libmangosdatabase.a ../shared/vmap/libmangosvmaps.a diff --git a/src/game/World.cpp b/src/game/World.cpp index 947500c09dc..12d8d2ed64b 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -265,6 +265,7 @@ World::AddSession_ (WorldSession* s) packet << uint8 (s->Expansion()); // 0 - normal, 1 - TBC, must be set in database manually for each account s->SendPacket (&packet); + s->SendAddonsInfo(); UpdateMaxSessionCounters (); // Updates the population diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp index 01459930788..28af8d60314 100644 --- a/src/game/WorldSession.cpp +++ b/src/game/WorldSession.cpp @@ -39,6 +39,7 @@ #include "OutdoorPvPMgr.h" //#include "Language.h" // for CMSG_CANCEL_MOUNT_AURA handler #include "SocialMgr.h" +#include "zlib/zlib.h" /// WorldSession constructor WorldSession::WorldSession(uint32 id, WorldSocket *sock, uint32 sec, uint8 expansion, time_t mute_time, LocaleConstant locale) : @@ -615,3 +616,121 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo *mi) data >> mi->u_unk1; } } + +void WorldSession::ReadAddonsInfo(WorldPacket &data) +{ + uint32 size; + data >> size; + + if(!size) + return; + + uLongf uSize = size; + + uint32 pos = data.rpos(); + + ByteBuffer addonInfo; + addonInfo.resize(size); + + if (uncompress(const_cast<uint8*>(addonInfo.contents()), &uSize, const_cast<uint8*>(data.contents() + pos), data.size() - pos) == Z_OK) + { + uint32 addonsCount; + addonInfo >> addonsCount; // addons count + + for(uint32 i = 0; i < addonsCount; ++i) + { + std::string addonName; + uint8 enabled; + uint32 crc, unk1; + + // check next addon data format correctness + if(addonInfo.rpos()+1 > addonInfo.size()) + return; + + addonInfo >> addonName; + + // recheck next addon data format correctness + if(addonInfo.rpos()+1+4+4 > addonInfo.size()) + return; + + addonInfo >> enabled >> crc >> unk1; + + sLog.outDebug("ADDON: Name: %s, Enabled: 0x%x, CRC: 0x%x, Unknown2: 0x%x", addonName.c_str(), enabled, crc, unk1); + + m_addonsList.push_back(AddonInfo(addonName, enabled, crc)); + } + + uint32 unk2; + addonInfo >> unk2; + + if(addonInfo.rpos() != addonInfo.size()) + sLog.outDebug("packet under read!"); + } + else + sLog.outError("Addon packet uncompress error!"); +} + +void WorldSession::SendAddonsInfo() +{ + unsigned char tdata[256] = + { + 0xC3, 0x5B, 0x50, 0x84, 0xB9, 0x3E, 0x32, 0x42, 0x8C, 0xD0, 0xC7, 0x48, 0xFA, 0x0E, 0x5D, 0x54, + 0x5A, 0xA3, 0x0E, 0x14, 0xBA, 0x9E, 0x0D, 0xB9, 0x5D, 0x8B, 0xEE, 0xB6, 0x84, 0x93, 0x45, 0x75, + 0xFF, 0x31, 0xFE, 0x2F, 0x64, 0x3F, 0x3D, 0x6D, 0x07, 0xD9, 0x44, 0x9B, 0x40, 0x85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B, 0x8C, 0x29, 0xEF, 0x8E, 0xE5, 0x34, 0xCB, 0xD1, 0x2A, 0xCE, 0x79, 0xC3, 0x9A, + 0x0D, 0x36, 0xEA, 0x01, 0xE0, 0xAA, 0x91, 0x20, 0x54, 0xF0, 0x72, 0xD8, 0x1E, 0xC7, 0x89, 0xD2 + }; + + WorldPacket data(SMSG_ADDON_INFO, 4); + + for(AddonsList::iterator itr = m_addonsList.begin(); itr != m_addonsList.end(); ++itr) + { + uint8 state = (itr->Enabled ? 2 : 1); + data << uint8(state); + + uint8 unk1 = (itr->Enabled ? 1 : 0); + data << uint8(unk1); + if (unk1) + { + uint8 unk2 = (itr->CRC != 0x4c1c776d); // If addon is Standard addon CRC + data << uint8(unk2); + if (unk2) + data.append(tdata, sizeof(tdata)); + + data << uint32(0); + } + + uint8 unk3 = (itr->Enabled ? 0 : 1); + data << uint8(unk3); + if (unk3) + { + // String, 256 (null terminated?) + data << uint8(0); + } + } + + m_addonsList.clear(); + + uint32 count = 0; + data << uint32(count); + /*for(uint32 i = 0; i < count; ++i) + { + uint32 + string (16 bytes) + string (16 bytes) + uint32 + }*/ + + SendPacket(&data); +} diff --git a/src/game/WorldSession.h b/src/game/WorldSession.h index 7649c69f486..0848ef63ecb 100644 --- a/src/game/WorldSession.h +++ b/src/game/WorldSession.h @@ -58,6 +58,22 @@ struct AccountData std::string Data; }; +struct AddonInfo +{ + AddonInfo(std::string name, uint8 enabled, uint32 crc) + { + Name = name; + Enabled = enabled; + CRC = crc; + } + + std::string Name; + uint8 Enabled; + uint32 CRC; +}; + +typedef std::list<AddonInfo> AddonsList; + enum PartyOperation { PARTY_OP_INVITE = 0, @@ -92,6 +108,9 @@ class TRINITY_DLL_SPEC WorldSession void SizeError(WorldPacket const& packet, uint32 size) const; + void ReadAddonsInfo(WorldPacket &data); + void SendAddonsInfo(); + void ReadMovementInfo(WorldPacket &data, MovementInfo *mi); void SendPacket(WorldPacket const* packet); @@ -698,6 +717,7 @@ class TRINITY_DLL_SPEC WorldSession int m_sessionDbLocaleIndex; uint32 m_latency; AccountData m_accountData[NUM_ACCOUNT_DATA_TYPES]; + AddonsList m_addonsList; ZThread::LockedQueue<WorldPacket*,ZThread::FastMutex> _recvQueue; }; diff --git a/src/game/WorldSocket.cpp b/src/game/WorldSocket.cpp index c8ed6db0592..c32dcee78a9 100644 --- a/src/game/WorldSocket.cpp +++ b/src/game/WorldSocket.cpp @@ -1000,6 +1000,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) m_Crypt.Init (); m_Session->LoadAccountData(); + m_Session->ReadAddonsInfo(recvPacket); // In case needed sometime the second arg is in microseconds 1 000 000 = 1 sec ACE_OS::sleep (ACE_Time_Value (0, 10000)); |