Merge commit '6c1e4bc20d68d9fb548eb4896bd8b84a4c3ec4ff' into 4.3.4
Conflicts: README.md sql/updates/world/2015_04_04_00_world.sql sql/updates/world/2015_04_04_01_world.sql sql/updates/world/2015_04_05_06_world_335.sql src/server/game/Battlegrounds/Battleground.cpp src/server/game/DataStores/DBCStores.cpp src/server/game/DataStores/DBCStructure.h src/server/game/DataStores/DBCfmt.h src/server/game/Entities/Object/Object.cpp src/server/game/Entities/Player/Player.cpp src/server/game/Entities/Player/Player.h src/server/game/Entities/Unit/Unit.cpp src/server/game/Handlers/CharacterHandler.cpp src/server/game/Server/WorldSession.cpp src/server/game/Server/WorldSocket.cpp src/server/game/Spells/Spell.cpp src/server/game/Spells/SpellInfo.cpp src/server/game/World/World.cpp src/server/scripts/Commands/cs_account.cpp src/tools/map_extractor/System.cpp src/tools/vmap4_extractor/adtfile.cpp
This commit is contained in:
commit
224c7dc6ae
181 files changed
+707
-1014
No files matched your search
@@ -66,6 +66,8 @@ include_directories(
|
||||
${VALGRIND_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
add_executable(authserver
|
||||
${authserver_SRCS}
|
||||
${authserver_PCH_SRC}
|
||||
|
||||
@@ -34,9 +34,7 @@
|
||||
#include "RealmList.h"
|
||||
#include "SystemConfig.h"
|
||||
#include "Util.h"
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
#include <boost/program_options.hpp>
|
||||
#include <openssl/opensslv.h>
|
||||
#include <openssl/crypto.h>
|
||||
|
||||
@@ -81,6 +81,8 @@ include_directories(
|
||||
${VALGRIND_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
add_library(collision STATIC
|
||||
${collision_STAT_SRCS}
|
||||
${collision_STAT_PCH_SRC}
|
||||
|
||||
@@ -236,9 +236,11 @@ namespace VMAP
|
||||
{
|
||||
floor = info.ground_Z;
|
||||
ASSERT(floor < std::numeric_limits<float>::max());
|
||||
ASSERT(info.hitModel);
|
||||
type = info.hitModel->GetLiquidType(); // entry from LiquidType.dbc
|
||||
if (reqLiquidType && !(GetLiquidFlagsPtr(type) & reqLiquidType))
|
||||
return false;
|
||||
ASSERT(info.hitInstance);
|
||||
if (info.hitInstance->GetLiquidLevel(pos, info, level))
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include <set>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
|
||||
using G3D::Vector3;
|
||||
using G3D::AABox;
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
#include "GameObjectModel.h"
|
||||
#include "Log.h"
|
||||
#include "GameObject.h"
|
||||
#include "Creature.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include "Object.h"
|
||||
#include "DBCStores.h"
|
||||
#include "World.h"
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "ModelInstance.h"
|
||||
#include "WorldModel.h"
|
||||
#include "MapTree.h"
|
||||
#include "VMapDefinitions.h"
|
||||
|
||||
using G3D::Vector3;
|
||||
using G3D::Ray;
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
*/
|
||||
|
||||
#include "WorldModel.h"
|
||||
#include "ModelInstance.h"
|
||||
#include "VMapDefinitions.h"
|
||||
#include "MapTree.h"
|
||||
|
||||
|
||||
@@ -19,9 +19,6 @@
|
||||
#include "GuardAI.h"
|
||||
#include "Errors.h"
|
||||
#include "Player.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "World.h"
|
||||
#include "CreatureAIImpl.h"
|
||||
|
||||
int GuardAI::Permissible(Creature const* creature)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include "PassiveAI.h"
|
||||
#include "Creature.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
PassiveAI::PassiveAI(Creature* c) : CreatureAI(c) { me->SetReactState(REACT_PASSIVE); }
|
||||
PossessedAI::PossessedAI(Creature* c) : CreatureAI(c) { me->SetReactState(REACT_PASSIVE); }
|
||||
|
||||
@@ -20,12 +20,10 @@
|
||||
#include "Errors.h"
|
||||
#include "Pet.h"
|
||||
#include "Player.h"
|
||||
#include "DBCStores.h"
|
||||
#include "Spell.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "Creature.h"
|
||||
#include "World.h"
|
||||
#include "Util.h"
|
||||
#include "Group.h"
|
||||
#include "SpellInfo.h"
|
||||
|
||||
@@ -18,10 +18,6 @@
|
||||
|
||||
#include "ByteBuffer.h"
|
||||
#include "ReactorAI.h"
|
||||
#include "Errors.h"
|
||||
#include "Log.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "CreatureAIImpl.h"
|
||||
|
||||
int ReactorAI::Permissible(const Creature* creature)
|
||||
{
|
||||
|
||||
@@ -19,10 +19,8 @@
|
||||
#include "TotemAI.h"
|
||||
#include "Totem.h"
|
||||
#include "Creature.h"
|
||||
#include "DBCStores.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "SpellMgr.h"
|
||||
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "CellImpl.h"
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "PassiveAI.h"
|
||||
|
||||
#include "MovementGenerator.h"
|
||||
#include "Pet.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include "CreatureAIFactory.h"
|
||||
#include "ScriptMgr.h"
|
||||
|
||||
@@ -17,14 +17,12 @@
|
||||
*/
|
||||
|
||||
#include "ScriptedCreature.h"
|
||||
#include "Item.h"
|
||||
#include "Spell.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Cell.h"
|
||||
#include "CellImpl.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
// Spell summary for ScriptedAI::SelectSpell
|
||||
struct TSpellSummary
|
||||
|
||||
@@ -21,11 +21,7 @@
|
||||
#include "GridDefines.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Cell.h"
|
||||
#include "CellImpl.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "Group.h"
|
||||
#include "SmartAI.h"
|
||||
#include "ScriptMgr.h"
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include "SmartScript.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "Vehicle.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "GameEventMgr.h"
|
||||
|
||||
SmartScript::SmartScript()
|
||||
|
||||
@@ -17,18 +17,12 @@
|
||||
|
||||
#include "DatabaseEnv.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "GridDefines.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Cell.h"
|
||||
#include "CellImpl.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "GameEventMgr.h"
|
||||
#include "CreatureTextMgr.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellInfo.h"
|
||||
|
||||
#include "SmartScriptMgr.h"
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include "Item.h"
|
||||
#include "Language.h"
|
||||
#include "Log.h"
|
||||
#include <vector>
|
||||
|
||||
enum eAuctionHouse
|
||||
{
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "CellImpl.h"
|
||||
#include "CreatureTextMgr.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Group.h"
|
||||
#include "GroupMgr.h"
|
||||
#include "Map.h"
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
#include "BattlefieldMgr.h"
|
||||
#include "BattlefieldWG.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
|
||||
BattlefieldMgr::BattlefieldMgr()
|
||||
|
||||
@@ -28,12 +28,10 @@
|
||||
#include "Group.h"
|
||||
#include "GuildMgr.h"
|
||||
#include "Guild.h"
|
||||
#include "MapManager.h"
|
||||
#include "Object.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "ReputationMgr.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "Util.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
#include "ArenaTeam.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "BattlegroundAV.h"
|
||||
#include "BattlegroundAB.h"
|
||||
@@ -39,7 +38,6 @@
|
||||
#include "BattlegroundBFG.h"
|
||||
#include "Chat.h"
|
||||
#include "Map.h"
|
||||
#include "MapInstanced.h"
|
||||
#include "MapManager.h"
|
||||
#include "Player.h"
|
||||
#include "GameEventMgr.h"
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
#include "Group.h"
|
||||
#include "Log.h"
|
||||
#include "Language.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "ObjectAccessor.h"
|
||||
|
||||
/*********************************************************/
|
||||
/*** BATTLEGROUND QUEUE SYSTEM ***/
|
||||
|
||||
@@ -17,9 +17,7 @@
|
||||
*/
|
||||
|
||||
#include "BattlegroundAB.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "Creature.h"
|
||||
#include "Language.h"
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "Language.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
BattlegroundAV::BattlegroundAV()
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include "BattlegroundEY.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "Creature.h"
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "ObjectMgr.h"
|
||||
#include "Vehicle.h"
|
||||
#include "Transport.h"
|
||||
#include "WorldSession.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
BattlegroundIC::BattlegroundIC()
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
BattlegroundSA::BattlegroundSA()
|
||||
{
|
||||
|
||||
@@ -17,14 +17,12 @@
|
||||
*/
|
||||
|
||||
#include "BattlegroundWS.h"
|
||||
#include "Creature.h"
|
||||
#include "GameObject.h"
|
||||
#include "Language.h"
|
||||
#include "Object.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "Player.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
// these variables aren't used outside of this file, so declare them only here
|
||||
|
||||
@@ -212,6 +212,8 @@ include_directories(
|
||||
${ZMQ_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
add_library(game STATIC
|
||||
${game_STAT_SRCS}
|
||||
${game_STAT_PCH_SRC}
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "Opcodes.h"
|
||||
#include "Player.h"
|
||||
#include "UpdateMask.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ChatLink.h"
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include "ThreatManager.h"
|
||||
#include "Unit.h"
|
||||
#include "DBCStructure.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellInfo.h"
|
||||
|
||||
HostileRefManager::~HostileRefManager()
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
#include "ThreatManager.h"
|
||||
#include "Unit.h"
|
||||
#include "Creature.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "Map.h"
|
||||
#include "Player.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "UnitEvents.h"
|
||||
|
||||
@@ -49,6 +49,7 @@ struct WMOAreaTableTripple
|
||||
};
|
||||
|
||||
typedef std::map<WMOAreaTableTripple, WMOAreaTableEntry const*> WMOAreaInfoByTripple;
|
||||
typedef std::multimap<uint32, CharSectionsEntry const*> CharSectionsMap;
|
||||
|
||||
DBCStorage <AreaTableEntry> sAreaStore(AreaTableEntryfmt);
|
||||
DBCStorage <AreaGroupEntry> sAreaGroupStore(AreaGroupEntryfmt);
|
||||
@@ -69,6 +70,8 @@ DBCStorage <BattlemasterListEntry> sBattlemasterListStore(BattlemasterListEntryf
|
||||
DBCStorage <BarberShopStyleEntry> sBarberShopStyleStore(BarberShopStyleEntryfmt);
|
||||
DBCStorage <CharStartOutfitEntry> sCharStartOutfitStore(CharStartOutfitEntryfmt);
|
||||
std::map<uint32, CharStartOutfitEntry const*> sCharStartOutfitMap;
|
||||
DBCStorage <CharSectionsEntry> sCharSectionsStore(CharSectionsEntryfmt);
|
||||
CharSectionsMap sCharSectionMap;
|
||||
DBCStorage <CharTitlesEntry> sCharTitlesStore(CharTitlesEntryfmt);
|
||||
DBCStorage <ChatChannelsEntry> sChatChannelsStore(ChatChannelsEntryfmt);
|
||||
DBCStorage <ChrClassesEntry> sChrClassesStore(ChrClassesEntryfmt);
|
||||
@@ -360,6 +363,12 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
if (CharStartOutfitEntry const* outfit = sCharStartOutfitStore.LookupEntry(i))
|
||||
sCharStartOutfitMap[outfit->Race | (outfit->Class << 8) | (outfit->Gender << 16)] = outfit;
|
||||
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sCharSectionsStore, dbcPath, "CharSections.dbc");
|
||||
for (uint32 i = 0; i < sCharSectionsStore.GetNumRows(); ++i)
|
||||
if (CharSectionsEntry const* entry = sCharSectionsStore.LookupEntry(i))
|
||||
if (entry->Race && ((1 << (entry->Race - 1)) & RACEMASK_ALL_PLAYABLE) != 0) //ignore Nonplayable races
|
||||
sCharSectionMap.insert({ entry->GenType | (entry->Gender << 8) | (entry->Race << 16), entry });
|
||||
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sCharTitlesStore, dbcPath, "CharTitles.dbc");//15595
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sChatChannelsStore, dbcPath, "ChatChannels.dbc");//15595
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sChrClassesStore, dbcPath, "ChrClasses.dbc");//15595
|
||||
@@ -1132,6 +1141,18 @@ CharStartOutfitEntry const* GetCharStartOutfitEntry(uint8 race, uint8 class_, ui
|
||||
return itr->second;
|
||||
}
|
||||
|
||||
CharSectionsEntry const* GetCharSectionEntry(uint8 race, CharSectionType genType, uint8 gender, uint8 type, uint8 color)
|
||||
{
|
||||
std::pair<CharSectionsMap::const_iterator, CharSectionsMap::const_iterator> eqr = sCharSectionMap.equal_range(uint32(genType) | uint32(gender << 8) | uint32(race << 16));
|
||||
for (CharSectionsMap::const_iterator itr = eqr.first; itr != eqr.second; ++itr)
|
||||
{
|
||||
if (itr->second->Type == type && itr->second->Color == color)
|
||||
return itr->second;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
uint32 GetPowerIndexByClass(uint32 powerType, uint32 classId)
|
||||
{
|
||||
return PowersByClass[classId][powerType];
|
||||
|
||||
@@ -77,6 +77,7 @@ PvPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 lev
|
||||
PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundBracketId id);
|
||||
|
||||
CharStartOutfitEntry const* GetCharStartOutfitEntry(uint8 race, uint8 class_, uint8 gender);
|
||||
CharSectionsEntry const* GetCharSectionEntry(uint8 race, CharSectionType genType, uint8 gender, uint8 type, uint8 color);
|
||||
|
||||
uint32 GetPowerIndexByClass(uint32 powerType, uint32 classId);
|
||||
LFGDungeonEntry const* GetLFGDungeon(uint32 mapId, Difficulty difficulty);
|
||||
@@ -103,6 +104,7 @@ extern DBCStorage <BarberShopStyleEntry> sBarberShopStyleStore;
|
||||
extern DBCStorage <BattlemasterListEntry> sBattlemasterListStore;
|
||||
extern DBCStorage <ChatChannelsEntry> sChatChannelsStore;
|
||||
extern DBCStorage <CharStartOutfitEntry> sCharStartOutfitStore;
|
||||
extern DBCStorage <CharSectionsEntry> sCharSectionsStore;
|
||||
extern DBCStorage <CharTitlesEntry> sCharTitlesStore;
|
||||
extern DBCStorage <ChrClassesEntry> sChrClassesStore;
|
||||
extern DBCStorage <ChrRacesEntry> sChrRacesStore;
|
||||
|
||||
@@ -684,6 +684,33 @@ struct CharStartOutfitEntry
|
||||
uint32 PetFamilyEntry; // 78 Pet Family Entry for starting pet
|
||||
};
|
||||
|
||||
enum CharSectionFlags
|
||||
{
|
||||
SECTION_FLAG_PLAYER = 0x01,
|
||||
SECTION_FLAG_DEATH_KNIGHT = 0x04
|
||||
};
|
||||
|
||||
enum CharSectionType
|
||||
{
|
||||
SECTION_TYPE_SKIN = 0,
|
||||
SECTION_TYPE_FACE = 1,
|
||||
SECTION_TYPE_FACIAL_HAIR = 2,
|
||||
SECTION_TYPE_HAIR = 3,
|
||||
SECTION_TYPE_UNDERWEAR = 4
|
||||
};
|
||||
|
||||
struct CharSectionsEntry
|
||||
{
|
||||
//uint32 Id;
|
||||
uint32 Race;
|
||||
uint32 Gender;
|
||||
uint32 GenType;
|
||||
//char* TexturePath[3];
|
||||
uint32 Flags;
|
||||
uint32 Type;
|
||||
uint32 Color;
|
||||
};
|
||||
|
||||
struct CharTitlesEntry
|
||||
{
|
||||
uint32 ID; // 0, title ids, for example in Quest::GetCharTitleId()
|
||||
|
||||
@@ -37,6 +37,7 @@ char const BannedAddOnsfmt[] = "nxxxxxxxxxx";
|
||||
char const BarberShopStyleEntryfmt[] = "nixxxiii";
|
||||
char const BattlemasterListEntryfmt[] = "niiiiiiiiixsiiiixxxx";
|
||||
char const CharStartOutfitEntryfmt[] = "dbbbXiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxii";
|
||||
char const CharSectionsEntryfmt[] = "diiixxxiii";
|
||||
char const CharTitlesEntryfmt[] = "nxssix";
|
||||
char const ChatChannelsEntryfmt[] = "nixsx";
|
||||
char const ChrClassesEntryfmt[] = "nixsxxxixiiiii";
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "DisableMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "SocialMgr.h"
|
||||
#include "Language.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "LFGScripts.h"
|
||||
#include "LFGGroupData.h"
|
||||
@@ -1269,6 +1268,14 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
|
||||
if (player->GetMapId() == uint32(dungeon->map))
|
||||
player->TeleportToBGEntryPoint();
|
||||
|
||||
// in the case were we are the last in lfggroup then we must disband when porting out of the instance
|
||||
if (group->GetMembersCount() == 1)
|
||||
{
|
||||
group->Disband();
|
||||
TC_LOG_DEBUG("lfg.teleport", "Player %s is last in lfggroup so we disband the group.",
|
||||
player->GetName().c_str());
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,9 +23,6 @@
|
||||
#include "LFGQueue.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "Log.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "World.h"
|
||||
#include "GroupMgr.h"
|
||||
|
||||
namespace lfg
|
||||
{
|
||||
|
||||
@@ -22,9 +22,6 @@
|
||||
#include "UpdateMask.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Opcodes.h"
|
||||
#include "GossipDef.h"
|
||||
#include "World.h"
|
||||
|
||||
Corpse::Corpse(CorpseType type) : WorldObject(type != CORPSE_BONES), m_type(type)
|
||||
{
|
||||
|
||||
@@ -34,12 +34,9 @@
|
||||
#include "InstanceScript.h"
|
||||
#include "Log.h"
|
||||
#include "LootMgr.h"
|
||||
#include "MapManager.h"
|
||||
#include "MoveSpline.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "OutdoorPvPMgr.h"
|
||||
#include "Player.h"
|
||||
#include "PoolMgr.h"
|
||||
#include "QuestDef.h"
|
||||
@@ -48,10 +45,8 @@
|
||||
#include "TemporarySummon.h"
|
||||
#include "Util.h"
|
||||
#include "Vehicle.h"
|
||||
#include "WaypointMovementGenerator.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
#include "Transport.h"
|
||||
|
||||
TrainerSpell const* TrainerSpellData::Find(uint32 spell_id) const
|
||||
@@ -2231,12 +2226,7 @@ void Creature::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs
|
||||
continue;
|
||||
|
||||
uint32 unSpellId = m_spells[i];
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(unSpellId);
|
||||
if (!spellInfo)
|
||||
{
|
||||
ASSERT(spellInfo);
|
||||
continue;
|
||||
}
|
||||
SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(unSpellId);
|
||||
|
||||
// Not send cooldown for this spells
|
||||
if (spellInfo->IsCooldownStartedOnEvent())
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "Log.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include "Pet.h"
|
||||
#include "Player.h"
|
||||
|
||||
@@ -18,12 +18,10 @@
|
||||
|
||||
#include "Common.h"
|
||||
#include "UpdateMask.h"
|
||||
#include "Opcodes.h"
|
||||
#include "World.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "CellImpl.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "Transport.h"
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include "Battleground.h"
|
||||
#include "CellImpl.h"
|
||||
#include "CreatureAISelector.h"
|
||||
#include "DynamicTree.h"
|
||||
#include "GameObjectModel.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Group.h"
|
||||
@@ -33,7 +32,6 @@
|
||||
#include "UpdateFieldFlags.h"
|
||||
#include "World.h"
|
||||
#include "Transport.h"
|
||||
#include <G3D/Quat.h>
|
||||
|
||||
GameObject::GameObject() : WorldObject(false), MapObject(),
|
||||
m_model(NULL), m_goValue(), m_AI(NULL)
|
||||
|
||||
@@ -675,6 +675,7 @@ void Object::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* targe
|
||||
|
||||
uint32* flags = NULL;
|
||||
uint32 visibleFlag = GetUpdateFieldData(target, flags);
|
||||
ASSERT(flags);
|
||||
|
||||
for (uint16 index = 0; index < m_valuesCount; ++index)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include "ObjectGuid.h"
|
||||
#include "World.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "Formulas.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "Unit.h"
|
||||
#include "Util.h"
|
||||
#include "Group.h"
|
||||
|
||||
@@ -978,8 +978,6 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo)
|
||||
{
|
||||
//FIXME: outfitId not used in player creating
|
||||
/// @todo need more checks against packet modifications
|
||||
// should check that skin, face, hair* are valid via DBC per race/class
|
||||
// also do it in Player::BuildEnumData, Player::LoadFromDB
|
||||
|
||||
Object::_Create(guidlow, 0, HIGHGUID_PLAYER);
|
||||
|
||||
@@ -1021,6 +1019,13 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ValidateAppearance(createInfo->Race, createInfo->Class, createInfo->Gender, createInfo->HairStyle, createInfo->HairColor, createInfo->Face, createInfo->FacialHair, createInfo->Skin, true))
|
||||
{
|
||||
TC_LOG_ERROR("entities.player", "Player::Create: Possible hacking-attempt: Account %u tried creating a character named '%s' with invalid appearance attributes - refusing to do so",
|
||||
GetSession()->GetAccountId(), m_name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 RaceClassGender = (createInfo->Race) | (createInfo->Class << 8) | (createInfo->Gender << 16);
|
||||
|
||||
SetUInt32Value(UNIT_FIELD_BYTES_0, (RaceClassGender | (powertype << 24)));
|
||||
@@ -1987,6 +1992,24 @@ bool Player::BuildEnumData(PreparedQueryResult result, ByteBuffer* dataBuffer, B
|
||||
uint32 atLoginFlags = fields[15].GetUInt16();
|
||||
Tokenizer equipment(fields[19].GetString(), ' ');
|
||||
uint8 slot = fields[21].GetUInt8();
|
||||
uint32 playerBytes2 = fields[6].GetUInt32();
|
||||
|
||||
uint16 atLoginFlags = fields[15].GetUInt16();
|
||||
|
||||
if (!ValidateAppearance(uint8(plrRace), uint8(plrClass), gender, uint8(playerBytes >> 16), uint8(playerBytes >> 24), uint8(playerBytes >> 8), uint8(playerBytes2), uint8(playerBytes)))
|
||||
{
|
||||
TC_LOG_ERROR("entities.player.loading", "Player %u has wrong Appearance values (Hair/Skin/Color), forcing recustomize", guid);
|
||||
|
||||
if (!(atLoginFlags & AT_LOGIN_CUSTOMIZE))
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
|
||||
stmt->setUInt16(0, uint16(AT_LOGIN_CUSTOMIZE));
|
||||
stmt->setUInt32(1, guid);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
atLoginFlags |= AT_LOGIN_CUSTOMIZE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
uint32 charFlags = 0;
|
||||
if (playerFlags & PLAYER_FLAGS_HIDE_HELM)
|
||||
@@ -9968,7 +9991,7 @@ uint32 Player::GetXPRestBonus(uint32 xp)
|
||||
|
||||
SetRestBonus(GetRestBonus() - rested_bonus);
|
||||
|
||||
TC_LOG_DEBUG("entities.player", "Player gain %u xp (+ %u Rested Bonus). Rested points=%f", xp+rested_bonus, rested_bonus, GetRestBonus());
|
||||
TC_LOG_DEBUG("entities.player", "GetXPRestBonus: Player %s (%u) gain %u xp (+%u Rested Bonus). Rested points=%f", GetName().c_str(), GetGUIDLow(), xp+rested_bonus, rested_bonus, GetRestBonus());
|
||||
return rested_bonus;
|
||||
}
|
||||
|
||||
@@ -17374,6 +17397,20 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
|
||||
SetUInt32Value(PLAYER_BYTES_2, fields[10].GetUInt32());
|
||||
SetByteValue(PLAYER_BYTES_3, 0, fields[5].GetUInt8());
|
||||
SetByteValue(PLAYER_BYTES_3, 1, fields[45].GetUInt8());
|
||||
|
||||
if (!ValidateAppearance(
|
||||
fields[3].GetUInt8(), // race
|
||||
fields[4].GetUInt8(), // class
|
||||
gender, GetByteValue(PLAYER_BYTES, 2), // hair type
|
||||
GetByteValue(PLAYER_BYTES, 3), //hair color
|
||||
uint8(fields[9].GetUInt32() >> 8), // face
|
||||
GetByteValue(PLAYER_BYTES_2, 0), // facial hair
|
||||
GetByteValue(PLAYER_BYTES, 0))) // skin color
|
||||
{
|
||||
TC_LOG_ERROR("entities.player", "Player %s has wrong Appearance values (Hair/Skin/Color), can't be loaded.", guid.ToString().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
SetUInt32Value(PLAYER_FLAGS, fields[11].GetUInt32());
|
||||
SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fields[44].GetUInt32());
|
||||
|
||||
@@ -21849,12 +21886,7 @@ void Player::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs)
|
||||
if (itr->second->state == PLAYERSPELL_REMOVED)
|
||||
continue;
|
||||
uint32 unSpellId = itr->first;
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(unSpellId);
|
||||
if (!spellInfo)
|
||||
{
|
||||
ASSERT(spellInfo);
|
||||
continue;
|
||||
}
|
||||
SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(unSpellId);
|
||||
|
||||
// Not send cooldown for this spells
|
||||
if (spellInfo->IsCooldownStartedOnEvent())
|
||||
@@ -22498,9 +22530,9 @@ void Player::SetPvP(bool state)
|
||||
(*itr)->SetPvP(state);
|
||||
}
|
||||
|
||||
void Player::UpdatePvP(bool state, bool override)
|
||||
void Player::UpdatePvP(bool state, bool _override)
|
||||
{
|
||||
if (!state || override)
|
||||
if (!state || _override)
|
||||
{
|
||||
SetPvP(state);
|
||||
pvpInfo.EndTimer = 0;
|
||||
@@ -25655,11 +25687,11 @@ uint32 Player::CalculateTalentsPoints() const
|
||||
return uint32(talentPointsForLevel * sWorld->getRate(RATE_TALENT));
|
||||
}
|
||||
|
||||
bool Player::IsKnowHowFlyIn(uint32 mapid, uint32 zone) const
|
||||
bool Player::canFlyInZone(uint32 mapid, uint32 zone) const
|
||||
{
|
||||
// continent checked in SpellInfo::CheckLocation at cast and area update
|
||||
uint32 v_map = GetVirtualMapForMapAndZone(mapid, zone);
|
||||
return v_map != 571 || HasSpell(54197); // Cold Weather Flying
|
||||
return v_map != 571 || HasSpell(54197); // 54197 = Cold Weather Flying
|
||||
}
|
||||
|
||||
void Player::LearnSpellHighestRank(uint32 spellid)
|
||||
@@ -28066,3 +28098,58 @@ void Player::SendSupercededSpell(uint32 oldSpell, uint32 newSpell)
|
||||
data << uint32(newSpell) << uint32(oldSpell);
|
||||
GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
bool Player::ValidateAppearance(uint8 race, uint8 class_, uint8 gender, uint8 hairID, uint8 hairColor, uint8 faceID, uint8 facialHair, uint8 skinColor, bool create /*=false*/)
|
||||
{
|
||||
// Check skin color
|
||||
// For Skin type is always 0
|
||||
if (CharSectionsEntry const* entry = GetCharSectionEntry(race, SECTION_TYPE_SKIN, gender, 0, skinColor))
|
||||
{ // Skin Color defined as Face color, too, we check skin & face in one pass
|
||||
if (CharSectionsEntry const* entry2 = GetCharSectionEntry(race, SECTION_TYPE_FACE, gender, faceID, skinColor))
|
||||
{
|
||||
// Check DeathKnight exclusive
|
||||
if (((entry->Flags & SECTION_FLAG_DEATH_KNIGHT) || (entry2->Flags & SECTION_FLAG_DEATH_KNIGHT)) && class_ != CLASS_DEATH_KNIGHT)
|
||||
return false;
|
||||
if (create && !((entry->Flags & SECTION_FLAG_PLAYER) && (entry2->Flags & SECTION_FLAG_PLAYER)))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
||||
// These combinations don't have an entry of Type SECTION_TYPE_FACIAL_HAIR, exclude them from that check
|
||||
bool excludeCheck = (race == RACE_TAUREN) || (race == RACE_DRAENEI) || (gender == GENDER_FEMALE && race != RACE_NIGHTELF && race != RACE_UNDEAD_PLAYER);
|
||||
|
||||
// Check Hair
|
||||
if (CharSectionsEntry const* entry = GetCharSectionEntry(race, SECTION_TYPE_HAIR, gender, hairID, hairColor))
|
||||
{
|
||||
if ((entry->Flags & SECTION_FLAG_DEATH_KNIGHT) && class_ != CLASS_DEATH_KNIGHT)
|
||||
return false;
|
||||
if (create && !(entry->Flags & SECTION_FLAG_PLAYER))
|
||||
return false;
|
||||
|
||||
if (!excludeCheck)
|
||||
{
|
||||
if (CharSectionsEntry const* entry2 = GetCharSectionEntry(race, SECTION_TYPE_FACIAL_HAIR, gender, facialHair, hairColor))
|
||||
{
|
||||
if ((entry2->Flags & SECTION_FLAG_DEATH_KNIGHT) && class_ != CLASS_DEATH_KNIGHT)
|
||||
return false;
|
||||
if (create && !(entry2->Flags & SECTION_FLAG_PLAYER))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// @TODO: Bound checking for facialHair ID (used clientside for markings, tauren beard, etc.)
|
||||
// Not present in DBC
|
||||
}
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1683,6 +1683,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
static bool LoadPositionFromDB(uint32& mapid, float& x, float& y, float& z, float& o, bool& in_flight, ObjectGuid guid);
|
||||
|
||||
static bool IsValidGender(uint8 Gender) { return Gender <= GENDER_FEMALE; }
|
||||
static bool ValidateAppearance(uint8 race, uint8 class_, uint8 gender, uint8 hairID, uint8 hairColor, uint8 faceID, uint8 facialHair, uint8 skinColor, bool create = false);
|
||||
static bool IsValidClass(uint8 Class) { return ((1 << (Class - 1)) & CLASSMASK_ALL_PLAYABLE) != 0; }
|
||||
static bool IsValidRace(uint8 Race) { return ((1 << (Race - 1)) & RACEMASK_ALL_PLAYABLE) != 0; }
|
||||
|
||||
@@ -2347,7 +2348,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
void SetFallInformation(uint32 time, float z);
|
||||
void HandleFall(MovementInfo const& movementInfo);
|
||||
|
||||
bool IsKnowHowFlyIn(uint32 mapid, uint32 zone) const;
|
||||
bool canFlyInZone(uint32 mapid, uint32 zone) const;
|
||||
|
||||
void SetClientControl(Unit* target, bool allowMove);
|
||||
|
||||
|
||||
@@ -17,9 +17,7 @@
|
||||
*/
|
||||
|
||||
#include "Totem.h"
|
||||
#include "Log.h"
|
||||
#include "Group.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Player.h"
|
||||
#include "SpellMgr.h"
|
||||
|
||||
@@ -20,14 +20,10 @@
|
||||
#include "Transport.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Path.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "DBCStores.h"
|
||||
#include "World.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "Vehicle.h"
|
||||
#include "MapReference.h"
|
||||
#include "Player.h"
|
||||
#include "Cell.h"
|
||||
#include "CellImpl.h"
|
||||
@@ -340,6 +336,8 @@ GameObject* Transport::CreateGOPassenger(uint32 guid, GameObjectData const* data
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ASSERT(data);
|
||||
|
||||
float x = data->posX;
|
||||
float y = data->posY;
|
||||
float z = data->posZ;
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
#include "MoveSpline.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
@@ -5384,7 +5383,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
if (RandomSpells.empty()) // shouldn't happen
|
||||
return false;
|
||||
|
||||
uint8 rand_spell = irand(0, (RandomSpells.size() - 1));
|
||||
uint8 rand_spell = urand(0, (RandomSpells.size() - 1));
|
||||
CastSpell(target, RandomSpells[rand_spell], true, castItem, triggeredByAura, originalCaster);
|
||||
for (std::vector<uint32>::iterator itr = RandomSpells.begin(); itr != RandomSpells.end(); ++itr)
|
||||
{
|
||||
@@ -5430,7 +5429,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
if (RandomSpells.empty()) // shouldn't happen
|
||||
return false;
|
||||
|
||||
uint8 rand_spell = irand(0, (RandomSpells.size() - 1));
|
||||
uint8 rand_spell = urand(0, (RandomSpells.size() - 1));
|
||||
CastSpell(target, RandomSpells[rand_spell], true, castItem, triggeredByAura, originalCaster);
|
||||
for (std::vector<uint32>::iterator itr = RandomSpells.begin(); itr != RandomSpells.end(); ++itr)
|
||||
{
|
||||
@@ -12544,6 +12543,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
|
||||
uint32 Id = i->aura->GetId();
|
||||
|
||||
AuraApplication* aurApp = i->aura->GetApplicationOfTarget(GetGUID());
|
||||
ASSERT(aurApp);
|
||||
|
||||
bool prepare = i->aura->CallScriptPrepareProcHandlers(aurApp, eventInfo);
|
||||
|
||||
|
||||
@@ -22,12 +22,8 @@
|
||||
#include "Vehicle.h"
|
||||
#include "Unit.h"
|
||||
#include "Util.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "ZoneScript.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include "EventProcessor.h"
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include "Language.h"
|
||||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
#include "GossipDef.h"
|
||||
#include "Player.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "UnitAI.h"
|
||||
|
||||
@@ -20,28 +20,20 @@
|
||||
#include <boost/thread/locks.hpp>
|
||||
|
||||
#include "ObjectAccessor.h"
|
||||
#include "CellImpl.h"
|
||||
#include "Corpse.h"
|
||||
#include "Creature.h"
|
||||
#include "DynamicObject.h"
|
||||
#include "GameObject.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Item.h"
|
||||
#include "Map.h"
|
||||
#include "MapInstanced.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Pet.h"
|
||||
#include "Player.h"
|
||||
#include "Vehicle.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
ObjectAccessor::ObjectAccessor() { }
|
||||
|
||||
ObjectAccessor::~ObjectAccessor() { }
|
||||
|
||||
@@ -21,12 +21,9 @@
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
#include "UpdateData.h"
|
||||
#include "Item.h"
|
||||
#include "Map.h"
|
||||
#include "Transport.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "CellImpl.h"
|
||||
#include "SpellInfo.h"
|
||||
|
||||
using namespace Trinity;
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Creature.h"
|
||||
#include "Vehicle.h"
|
||||
#include "GameObject.h"
|
||||
#include "DynamicObject.h"
|
||||
#include "Corpse.h"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "MapManager.h"
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "MapInstanced.h"
|
||||
#include "Util.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "UpdateFieldFlags.h"
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include "zlib.h"
|
||||
#include "AddonHandler.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Log.h"
|
||||
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Player.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
@@ -1354,6 +1354,9 @@ void WorldSession::HandleAlterAppearance(WorldPacket& recvData)
|
||||
if (bs_skinColor && (bs_skinColor->type != 3 || bs_skinColor->race != _player->getRace() || bs_skinColor->gender != _player->getGender()))
|
||||
return;
|
||||
|
||||
if (!Player::ValidateAppearance(_player->getRace(), _player->getClass(), _player->getGender(), bs_hair->hair_id, Color, uint8(_player->GetUInt32Value(PLAYER_FLAGS) >> 8), bs_facialHair->hair_id, bs_skinColor ? bs_skinColor->hair_id : 0))
|
||||
return;
|
||||
|
||||
GameObject* go = _player->FindNearestGameObjectOfType(GAMEOBJECT_TYPE_BARBER_CHAIR, 5.0f);
|
||||
if (!go)
|
||||
{
|
||||
@@ -1438,9 +1441,8 @@ void WorldSession::HandleCharCustomize(WorldPacket& recvData)
|
||||
>> customizeInfo.FacialHair
|
||||
>> customizeInfo.Face;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AT_LOGIN);
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME_DATA);
|
||||
stmt->setUInt32(0, customizeInfo.Guid.GetCounter());
|
||||
// TODO: Make async with callback
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
if (!result)
|
||||
@@ -1450,6 +1452,29 @@ void WorldSession::HandleCharCustomize(WorldPacket& recvData)
|
||||
}
|
||||
|
||||
Field* fields = result->Fetch();
|
||||
uint8 plrRace = fields[0].GetUInt8();
|
||||
uint8 plrClass = fields[1].GetUInt8();
|
||||
uint8 plrGender = fields[2].GetUInt8();
|
||||
|
||||
if (!Player::ValidateAppearance(plrRace, plrClass, plrGender, customizeInfo.HairStyle, customizeInfo.HairColor, customizeInfo.Face, customizeInfo.FacialHair, customizeInfo.Skin, true))
|
||||
{
|
||||
SendCharCustomize(CHAR_CREATE_ERROR, customizeInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AT_LOGIN);
|
||||
|
||||
stmt->setUInt32(0, customizeInfo.Guid.GetCounter());
|
||||
// TODO: Make async with callback
|
||||
result = CharacterDatabase.Query(stmt);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
SendCharCustomize(CHAR_CREATE_ERROR, customizeInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
fields = result->Fetch();
|
||||
uint32 at_loginFlags = fields[0].GetUInt16();
|
||||
|
||||
if (!(at_loginFlags & AT_LOGIN_CUSTOMIZE))
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include "Log.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Player.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "Util.h"
|
||||
#include "ScriptMgr.h"
|
||||
|
||||
@@ -22,9 +22,7 @@
|
||||
#include "WorldSession.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "Vehicle.h"
|
||||
#include "VehicleDefines.h"
|
||||
#include "Player.h"
|
||||
#include "Opcodes.h"
|
||||
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
#include "Log.h"
|
||||
#include "Opcodes.h"
|
||||
#include "UpdateData.h"
|
||||
#include "Player.h"
|
||||
|
||||
void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket)
|
||||
|
||||
@@ -23,10 +23,7 @@
|
||||
#include "ObjectMgr.h"
|
||||
#include "GuildMgr.h"
|
||||
#include "Log.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Guild.h"
|
||||
#include "GossipDef.h"
|
||||
#include "SocialMgr.h"
|
||||
|
||||
void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "Item.h"
|
||||
#include "UpdateData.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "DB2Stores.h"
|
||||
#include <vector>
|
||||
|
||||
@@ -634,10 +634,10 @@ void WorldSession::SendLfgJoinResult(lfg::LfgJoinResultData const& joinData)
|
||||
|
||||
void WorldSession::SendLfgQueueStatus(lfg::LfgQueueStatusData const& queueData)
|
||||
{
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_QUEUE_STATUS %s dungeon: %u, waitTime: %d, "
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_QUEUE_STATUS %s state: %s, dungeon: %u, waitTime: %d, "
|
||||
"avgWaitTime: %d, waitTimeTanks: %d, waitTimeHealer: %d, waitTimeDps: %d, "
|
||||
"queuedTime: %u, tanks: %u, healers: %u, dps: %u",
|
||||
GetPlayerInfo().c_str(), queueData.dungeonId, queueData.waitTime, queueData.waitTimeAvg,
|
||||
GetPlayerInfo().c_str(), lfg::GetStateString(sLFGMgr->GetState(GetPlayer()->GetGUID())).c_str(), queueData.dungeonId, queueData.waitTime, queueData.waitTimeAvg,
|
||||
queueData.waitTimeTank, queueData.waitTimeHealer, queueData.waitTimeDps,
|
||||
queueData.queuedTime, queueData.tanks, queueData.healers, queueData.dps);
|
||||
|
||||
|
||||
@@ -28,9 +28,6 @@
|
||||
#include "ObjectMgr.h"
|
||||
#include "GuildMgr.h"
|
||||
#include "WorldSession.h"
|
||||
#include "BigNumber.h"
|
||||
#include "SHA1.h"
|
||||
#include "UpdateData.h"
|
||||
#include "LootMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "zlib.h"
|
||||
@@ -38,19 +35,14 @@
|
||||
#include "Object.h"
|
||||
#include "Battleground.h"
|
||||
#include "OutdoorPvP.h"
|
||||
#include "Pet.h"
|
||||
#include "SocialMgr.h"
|
||||
#include "CellImpl.h"
|
||||
#include "AccountMgr.h"
|
||||
#include "Vehicle.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "DBCEnums.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "MapManager.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "Group.h"
|
||||
#include "AccountMgr.h"
|
||||
#include "Spell.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "Battlefield.h"
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "Log.h"
|
||||
#include "Corpse.h"
|
||||
#include "Player.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "MapManager.h"
|
||||
#include "Transport.h"
|
||||
#include "Battleground.h"
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
#include "SpellMgr.h"
|
||||
#include "Player.h"
|
||||
#include "GossipDef.h"
|
||||
#include "UpdateMask.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Creature.h"
|
||||
#include "Pet.h"
|
||||
#include "ReputationMgr.h"
|
||||
|
||||
@@ -28,8 +28,6 @@
|
||||
#include "Opcodes.h"
|
||||
#include "Guild.h"
|
||||
#include "ArenaTeam.h"
|
||||
#include "GossipDef.h"
|
||||
#include "SocialMgr.h"
|
||||
|
||||
#define CHARTER_DISPLAY_ID 16161
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "Language.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
@@ -28,7 +27,6 @@
|
||||
#include "Player.h"
|
||||
#include "UpdateMask.h"
|
||||
#include "NPCHandler.h"
|
||||
#include "Pet.h"
|
||||
#include "MapManager.h"
|
||||
|
||||
void WorldSession::SendNameQueryOpcode(ObjectGuid guid)
|
||||
|
||||
@@ -17,13 +17,11 @@
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Log.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Player.h"
|
||||
#include "Pet.h"
|
||||
#include "UpdateMask.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
|
||||
@@ -27,9 +27,6 @@
|
||||
#include "Opcodes.h"
|
||||
#include "Spell.h"
|
||||
#include "Totem.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include "Log.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "UpdateMask.h"
|
||||
#include "Path.h"
|
||||
#include "WaypointMovementGenerator.h"
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "Common.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Log.h"
|
||||
|
||||
void WorldSession::HandleVoiceSessionEnableOpcode(WorldPacket& recvData)
|
||||
|
||||
@@ -21,15 +21,12 @@
|
||||
#include "GridNotifiers.h"
|
||||
#include "Log.h"
|
||||
#include "GridStates.h"
|
||||
#include "CellImpl.h"
|
||||
#include "Map.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapInstanced.h"
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "Timer.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Config.h"
|
||||
#include "Transport.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "World.h"
|
||||
#include "Group.h"
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include "Group.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "MapInstanced.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Pet.h"
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include "InstanceScript.h"
|
||||
#include "Config.h"
|
||||
#include "World.h"
|
||||
#include "CellImpl.h"
|
||||
#include "Corpse.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Language.h"
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include "RandomMovementGenerator.h"
|
||||
#include "MoveSpline.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include <cassert>
|
||||
|
||||
inline bool isStatic(MovementGenerator *mv)
|
||||
{
|
||||
|
||||
@@ -17,10 +17,8 @@
|
||||
*/
|
||||
|
||||
#include "Creature.h"
|
||||
#include "MapManager.h"
|
||||
#include "ConfusedMovementGenerator.h"
|
||||
#include "PathGenerator.h"
|
||||
#include "VMapFactory.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "MoveSpline.h"
|
||||
#include "Player.h"
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include "Creature.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "MapManager.h"
|
||||
#include "FleeingMovementGenerator.h"
|
||||
#include "PathGenerator.h"
|
||||
#include "ObjectAccessor.h"
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "HomeMovementGenerator.h"
|
||||
#include "Creature.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "MoveSpline.h"
|
||||
|
||||
|
||||
@@ -17,9 +17,7 @@
|
||||
*/
|
||||
|
||||
#include "Creature.h"
|
||||
#include "MapManager.h"
|
||||
#include "RandomMovementGenerator.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Map.h"
|
||||
#include "Util.h"
|
||||
#include "CreatureGroups.h"
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "WaypointMovementGenerator.h"
|
||||
//Extended headers
|
||||
#include "ObjectMgr.h"
|
||||
#include "World.h"
|
||||
#include "Transport.h"
|
||||
//Flightmaster grid preloading
|
||||
#include "MapManager.h"
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "MovementPacketBuilder.h"
|
||||
#include "Unit.h"
|
||||
#include "Transport.h"
|
||||
#include "Vehicle.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "Opcodes.h"
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include "MoveSplineFlag.h"
|
||||
#include <cmath>
|
||||
#include <string>
|
||||
|
||||
namespace Movement
|
||||
{
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Map.h"
|
||||
#include "MapManager.h"
|
||||
#include "Group.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "GridNotifiers.h"
|
||||
@@ -509,7 +508,7 @@ bool OPvPCapturePoint::HandleCustomSpell(Player* player, uint32 /*spellId*/, Gam
|
||||
{
|
||||
if (!player->IsOutdoorPvPActive())
|
||||
return false;
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OutdoorPvP::HandleOpenGo(Player* player, ObjectGuid guid)
|
||||
|
||||
@@ -170,7 +170,7 @@ PoolObject* PoolGroup<T>::RollOne(ActivePoolData& spawns, uint32 triggerFrom)
|
||||
}
|
||||
if (!EqualChanced.empty())
|
||||
{
|
||||
int32 index = irand(0, EqualChanced.size()-1);
|
||||
uint32 index = urand(0, EqualChanced.size()-1);
|
||||
// Triggering object is marked as spawned at this time and can be also rolled (respawn case)
|
||||
// so this need explicit check for this case
|
||||
if (EqualChanced[index].guid == triggerFrom || !spawns.IsActiveObject<T>(EqualChanced[index].guid))
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "GossipDef.h"
|
||||
#include "Map.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapRefManager.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Pet.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
@@ -269,6 +269,7 @@ void WorldSession::SendPacket(WorldPacket* packet, bool forced /*= false*/)
|
||||
|
||||
sScriptMgr->OnPacketSend(this, *packet);
|
||||
|
||||
TC_LOG_TRACE("network.opcode", "S->C: %s %s", GetPlayerInfo().c_str(), GetOpcodeNameForLogging(packet->GetOpcode()).c_str());
|
||||
m_Socket->SendPacket(*packet);
|
||||
}
|
||||
|
||||
@@ -856,7 +857,7 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data)
|
||||
|
||||
if (size > 0xFFFFF)
|
||||
{
|
||||
TC_LOG_ERROR("misc", "WorldSession::ReadAddonsInfo addon info too big, size %u", size);
|
||||
TC_LOG_DEBUG("addon", "WorldSession::ReadAddonsInfo: AddOnInfo too big, size %u", size);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -886,7 +887,7 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data)
|
||||
|
||||
addonInfo >> enabled >> crc >> unk1;
|
||||
|
||||
TC_LOG_DEBUG("misc", "ADDON: Name: %s, Enabled: 0x%x, CRC: 0x%x, Unknown2: 0x%x", addonName.c_str(), enabled, crc, unk1);
|
||||
TC_LOG_DEBUG("addon", "AddOn: %s (CRC: 0x%x) - enabled: 0x%x - Unknown2: 0x%x", addonName.c_str(), crc, enabled, unk1);
|
||||
|
||||
AddonInfo addon(addonName, enabled, crc, 2, true);
|
||||
|
||||
@@ -894,15 +895,14 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data)
|
||||
if (savedAddon)
|
||||
{
|
||||
if (addon.CRC != savedAddon->CRC)
|
||||
TC_LOG_ERROR("misc", "ADDON: %s was known, but didn't match known CRC (0x%x)!", addon.Name.c_str(), savedAddon->CRC);
|
||||
TC_LOG_WARN("addon", " Addon: %s: modified (CRC: 0x%x) - accountID %d)", addon.Name.c_str(), savedAddon->CRC, GetAccountId());
|
||||
else
|
||||
TC_LOG_DEBUG("misc", "ADDON: %s was known, CRC is correct (0x%x)", addon.Name.c_str(), savedAddon->CRC);
|
||||
TC_LOG_DEBUG("addon", "Addon: %s: validated (CRC: 0x%x) - accountID %d", addon.Name.c_str(), savedAddon->CRC, GetAccountId());
|
||||
}
|
||||
else
|
||||
{
|
||||
AddonMgr::SaveAddon(addon);
|
||||
|
||||
TC_LOG_DEBUG("misc", "ADDON: %s (0x%x) was not known, saving...", addon.Name.c_str(), addon.CRC);
|
||||
TC_LOG_WARN("addon", "Addon: %s: unknown (CRC: 0x%x) - accountId %d (storing addon name and checksum to database)", addon.Name.c_str(), addon.CRC, GetAccountId());
|
||||
}
|
||||
|
||||
/// @todo Find out when to not use CRC/pubkey, and other possible states.
|
||||
@@ -911,10 +911,10 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data)
|
||||
|
||||
uint32 currentTime;
|
||||
addonInfo >> currentTime;
|
||||
TC_LOG_DEBUG("network", "ADDON: CurrentTime: %u", currentTime);
|
||||
TC_LOG_DEBUG("addon", "AddOn: CurrentTime: %u", currentTime);
|
||||
}
|
||||
else
|
||||
TC_LOG_ERROR("misc", "Addon packet uncompress error!");
|
||||
TC_LOG_DEBUG("addon", "AddOn: Addon packet uncompress error!");
|
||||
}
|
||||
|
||||
void WorldSession::SendAddonsInfo()
|
||||
@@ -953,8 +953,8 @@ void WorldSession::SendAddonsInfo()
|
||||
data << uint8(usepk);
|
||||
if (usepk) // if CRC is wrong, add public key (client need it)
|
||||
{
|
||||
TC_LOG_DEBUG("misc", "ADDON: CRC (0x%x) for addon %s is wrong (does not match expected 0x%x), sending pubkey",
|
||||
itr->CRC, itr->Name.c_str(), STANDARD_ADDON_CRC);
|
||||
TC_LOG_DEBUG("addon", "AddOn: %s: CRC checksum mismatch: got 0x%x - expected 0x%x - sending pubkey to accountID %d",
|
||||
itr->Name.c_str(), itr->CRC, STANDARD_ADDON_CRC, GetAccountId());
|
||||
|
||||
data.append(addonPublicKey, sizeof(addonPublicKey));
|
||||
}
|
||||
|
||||
@@ -65,7 +65,13 @@ void WorldSocket::HandleSendAuthSession()
|
||||
|
||||
packet << uint32(_authSeed);
|
||||
packet << uint8(1);
|
||||
SendPacket(packet);
|
||||
|
||||
void WorldSocket::OnClose()
|
||||
{
|
||||
{
|
||||
std::lock_guard<std::mutex> sessionGuard(_worldSessionLock);
|
||||
_worldSession = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSocket::ReadHandler()
|
||||
@@ -92,7 +98,10 @@ void WorldSocket::ReadHandler()
|
||||
|
||||
// We just received nice new header
|
||||
if (!ReadHeaderHandler())
|
||||
{
|
||||
CloseSocket();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// We have full read header, now check the data payload
|
||||
@@ -113,7 +122,10 @@ void WorldSocket::ReadHandler()
|
||||
|
||||
// just received fresh new payload
|
||||
if (!ReadDataHandler())
|
||||
{
|
||||
CloseSocket();
|
||||
return;
|
||||
}
|
||||
|
||||
_headerBuffer.Reset();
|
||||
}
|
||||
@@ -169,24 +181,27 @@ bool WorldSocket::ReadDataHandler()
|
||||
if (sPacketLog->CanLogPacket())
|
||||
sPacketLog->LogPacket(packet, CLIENT_TO_SERVER, GetRemoteIpAddress(), GetRemotePort());
|
||||
|
||||
TC_LOG_TRACE("network.opcode", "C->S: %s %s", (_worldSession ? _worldSession->GetPlayerInfo() : GetRemoteIpAddress().to_string()).c_str(), GetOpcodeNameForLogging(opcode).c_str());
|
||||
std::unique_lock<std::mutex> sessionGuard(_worldSessionLock, std::defer_lock);
|
||||
|
||||
switch (opcode)
|
||||
{
|
||||
case CMSG_PING:
|
||||
HandlePing(packet);
|
||||
break;
|
||||
LogOpcodeText(opcode, sessionGuard);
|
||||
return HandlePing(packet);
|
||||
case CMSG_AUTH_SESSION:
|
||||
LogOpcodeText(opcode, sessionGuard);
|
||||
if (_worldSession)
|
||||
{
|
||||
// locking just to safely log offending user is probably overkill but we are disconnecting him anyway
|
||||
if (sessionGuard.try_lock())
|
||||
TC_LOG_ERROR("network", "WorldSocket::ProcessIncoming: received duplicate CMSG_AUTH_SESSION from %s", _worldSession->GetPlayerInfo().c_str());
|
||||
break;
|
||||
return false;
|
||||
}
|
||||
|
||||
HandleAuthSession(packet);
|
||||
break;
|
||||
case CMSG_KEEP_ALIVE:
|
||||
TC_LOG_DEBUG("network", "%s", GetOpcodeNameForLogging(opcode).c_str());
|
||||
LogOpcodeText(opcode, sessionGuard);
|
||||
sScriptMgr->OnPacketReceive(_worldSession, packet);
|
||||
break;
|
||||
case CMSG_LOG_DISCONNECT:
|
||||
@@ -204,6 +219,8 @@ bool WorldSocket::ReadDataHandler()
|
||||
}
|
||||
default:
|
||||
{
|
||||
sessionGuard.lock();
|
||||
LogOpcodeText(opcode, sessionGuard);
|
||||
if (!_worldSession)
|
||||
{
|
||||
TC_LOG_ERROR("network.opcode", "ProcessIncoming: Client not authed opcode = %u", uint32(opcode));
|
||||
@@ -253,7 +270,26 @@ bool WorldSocket::ReadDataHandler()
|
||||
return true;
|
||||
}
|
||||
|
||||
void WorldSocket::SendPacket(WorldPacket& packet)
|
||||
void WorldSocket::LogOpcodeText(uint16 opcode, std::unique_lock<std::mutex> const& guard) const
|
||||
{
|
||||
if (!guard)
|
||||
{
|
||||
TC_LOG_TRACE("network.opcode", "C->S: %s %s", GetRemoteIpAddress().to_string().c_str(), GetOpcodeNameForLogging(opcode).c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
TC_LOG_TRACE("network.opcode", "C->S: %s %s", (_worldSession ? _worldSession->GetPlayerInfo() : GetRemoteIpAddress().to_string()).c_str(),
|
||||
GetOpcodeNameForLogging(opcode).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSocket::SendPacketAndLogOpcode(WorldPacket const& packet)
|
||||
{
|
||||
TC_LOG_TRACE("network.opcode", "S->C: %s %s", GetRemoteIpAddress().to_string().c_str(), GetOpcodeNameForLogging(packet.GetOpcode()).c_str());
|
||||
SendPacket(packet);
|
||||
}
|
||||
|
||||
void WorldSocket::SendPacket(WorldPacket const& packet)
|
||||
{
|
||||
if (!IsOpen())
|
||||
return;
|
||||
@@ -264,8 +300,6 @@ void WorldSocket::SendPacket(WorldPacket& packet)
|
||||
if (_worldSession && packet.size() > 0x400 && !packet.IsCompressed())
|
||||
packet.Compress(_worldSession->GetCompressionStream());
|
||||
|
||||
TC_LOG_TRACE("network.opcode", "S->C: %s %s", (_worldSession ? _worldSession->GetPlayerInfo() : GetRemoteIpAddress().to_string()).c_str(), GetOpcodeNameForLogging(packet.GetOpcode()).c_str());
|
||||
|
||||
ServerPktHeader header(packet.size() + 2, packet.GetOpcode());
|
||||
|
||||
std::unique_lock<std::mutex> guard(_writeLock);
|
||||
@@ -570,10 +604,10 @@ void WorldSocket::SendAuthResponseError(uint8 code)
|
||||
packet.WriteBit(0); // has account info
|
||||
packet << uint8(code);
|
||||
|
||||
SendPacket(packet);
|
||||
SendPacketAndLogOpcode(packet);
|
||||
}
|
||||
|
||||
void WorldSocket::HandlePing(WorldPacket& recvPacket)
|
||||
bool WorldSocket::HandlePing(WorldPacket& recvPacket)
|
||||
{
|
||||
uint32 ping;
|
||||
uint32 latency;
|
||||
@@ -602,13 +636,14 @@ void WorldSocket::HandlePing(WorldPacket& recvPacket)
|
||||
|
||||
if (maxAllowed && _OverSpeedPings > maxAllowed)
|
||||
{
|
||||
std::unique_lock<std::mutex> sessionGuard(_worldSessionLock);
|
||||
|
||||
if (_worldSession && !_worldSession->HasPermission(rbac::RBAC_PERM_SKIP_CHECK_OVERSPEED_PING))
|
||||
{
|
||||
TC_LOG_ERROR("network", "WorldSocket::HandlePing: %s kicked for over-speed pings (address: %s)",
|
||||
_worldSession->GetPlayerInfo().c_str(), GetRemoteIpAddress().to_string().c_str());
|
||||
|
||||
CloseSocket();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -616,20 +651,23 @@ void WorldSocket::HandlePing(WorldPacket& recvPacket)
|
||||
_OverSpeedPings = 0;
|
||||
}
|
||||
|
||||
if (_worldSession)
|
||||
{
|
||||
_worldSession->SetLatency(latency);
|
||||
_worldSession->ResetClientTimeDelay();
|
||||
}
|
||||
else
|
||||
{
|
||||
TC_LOG_ERROR("network", "WorldSocket::HandlePing: peer sent CMSG_PING, but is not authenticated or got recently kicked, address = %s", GetRemoteIpAddress().to_string().c_str());
|
||||
std::lock_guard<std::mutex> sessionGuard(_worldSessionLock);
|
||||
|
||||
CloseSocket();
|
||||
return;
|
||||
if (_worldSession)
|
||||
{
|
||||
_worldSession->SetLatency(latency);
|
||||
_worldSession->ResetClientTimeDelay();
|
||||
}
|
||||
else
|
||||
{
|
||||
TC_LOG_ERROR("network", "WorldSocket::HandlePing: peer sent CMSG_PING, but is not authenticated or got recently kicked, address = %s", GetRemoteIpAddress().to_string().c_str());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
WorldPacket packet(SMSG_PONG, 4);
|
||||
packet << ping;
|
||||
return SendPacket(packet);
|
||||
SendPacketAndLogOpcode(packet);
|
||||
return true;
|
||||
}
|
||||
@@ -59,19 +59,25 @@ public:
|
||||
|
||||
void Start() override;
|
||||
|
||||
void SendPacket(WorldPacket& packet);
|
||||
void SendPacket(WorldPacket const& packet);
|
||||
|
||||
protected:
|
||||
void OnClose() override;
|
||||
void ReadHandler() override;
|
||||
bool ReadHeaderHandler();
|
||||
bool ReadDataHandler();
|
||||
|
||||
private:
|
||||
/// writes network.opcode log
|
||||
/// accessing WorldSession is not threadsafe, only do it when holding _worldSessionLock
|
||||
void LogOpcodeText(uint16 opcode, std::unique_lock<std::mutex> const& guard) const;
|
||||
/// sends and logs network.opcode without accessing WorldSession
|
||||
void SendPacketAndLogOpcode(WorldPacket const& packet);
|
||||
void HandleSendAuthSession();
|
||||
void HandleAuthSession(WorldPacket& recvPacket);
|
||||
void SendAuthResponseError(uint8 code);
|
||||
|
||||
void HandlePing(WorldPacket& recvPacket);
|
||||
bool HandlePing(WorldPacket& recvPacket);
|
||||
|
||||
uint32 _authSeed;
|
||||
WorldPacketCrypt _authCrypt;
|
||||
@@ -79,7 +85,9 @@ private:
|
||||
std::chrono::steady_clock::time_point _LastPingTime;
|
||||
uint32 _OverSpeedPings;
|
||||
|
||||
std::mutex _worldSessionLock;
|
||||
WorldSession* _worldSession;
|
||||
bool _authed;
|
||||
|
||||
MessageBuffer _headerBuffer;
|
||||
MessageBuffer _packetBuffer;
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "OutdoorPvPMgr.h"
|
||||
#include "Formulas.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "CellImpl.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "Vehicle.h"
|
||||
|
||||
@@ -31,13 +31,10 @@
|
||||
#include "Player.h"
|
||||
#include "Pet.h"
|
||||
#include "Unit.h"
|
||||
#include "Totem.h"
|
||||
#include "Spell.h"
|
||||
#include "DynamicObject.h"
|
||||
#include "Guild.h"
|
||||
#include "Group.h"
|
||||
#include "UpdateData.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "CellImpl.h"
|
||||
#include "SharedDefines.h"
|
||||
|
||||
@@ -32,10 +32,6 @@
|
||||
#include "DynamicObject.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "Group.h"
|
||||
#include "UpdateData.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "SharedDefines.h"
|
||||
#include "Pet.h"
|
||||
#include "GameObject.h"
|
||||
@@ -43,20 +39,14 @@
|
||||
#include "Creature.h"
|
||||
#include "Totem.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "Battleground.h"
|
||||
#include "OutdoorPvPMgr.h"
|
||||
#include "Language.h"
|
||||
#include "SocialMgr.h"
|
||||
#include "Util.h"
|
||||
#include "VMapFactory.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include "CellImpl.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "SkillDiscovery.h"
|
||||
#include "Formulas.h"
|
||||
#include "Vehicle.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "AccountMgr.h"
|
||||
|
||||
@@ -1657,10 +1657,10 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a
|
||||
return SPELL_FAILED_NOT_HERE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,15 +19,11 @@
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellAuraDefines.h"
|
||||
#include "SharedDefines.h"
|
||||
#include "DBCStores.h"
|
||||
#include "World.h"
|
||||
#include "Chat.h"
|
||||
#include "Spell.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "MapManager.h"
|
||||
#include "BattlefieldWG.h"
|
||||
#include "BattlefieldMgr.h"
|
||||
#include "Player.h"
|
||||
@@ -3079,6 +3075,10 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
spellInfo->Effects[EFFECT_0].TriggerSpell = 36325; // They Must Burn Bomb Drop (DND)
|
||||
break;
|
||||
case 49838: // Stop Time
|
||||
case 69438: // Sample Satisfaction
|
||||
case 69445: // Perfume Spritz
|
||||
case 69489: // Chocolate Sample
|
||||
case 69563: // Cologne Spritz
|
||||
spellInfo->AttributesEx3 |= SPELL_ATTR3_NO_INITIAL_AGGRO;
|
||||
break;
|
||||
case 61407: // Energize Cores
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "Spell.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellMgr.h"
|
||||
|
||||
bool _SpellScript::_Validate(SpellInfo const* entry)
|
||||
{
|
||||
|
||||
Loaded 100 of 181 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user