diff --git a/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp b/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp index 959387b99..f7d4fe69d 100755 --- a/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp +++ b/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp @@ -541,6 +541,89 @@ bool ItemUse_item_Totemic_Beacon(Player *player, Item* _Item, SpellCastTargets c return false; } +#define NPC_ICECALLERBRIATHA 25949 + +struct TRINITY_DLL_DECL npc_Heretic_EmisaryAI : public ScriptedAI +{ + npc_Heretic_EmisaryAI(Creature* c) : ScriptedAI(c) {} + + uint32 TalkTimer; + uint32 Phase; + uint32 Check; + Unit * player; + Creature * Briatha; + bool EventStarted; + + void Reset() + { + Phase = 0; + + TalkTimer = 5000; + EventStarted = false; + } + + void MoveInLineOfSight(Unit * unit) + { + if(unit->GetTypeId() == TYPEID_PLAYER && unit->HasAura(46337, 0) && ((Player*)unit)->GetQuestStatus(11891) == QUEST_STATUS_INCOMPLETE) + { + EventStarted = true; + player = unit; + Briatha = me->GetMap()->GetCreature(me->GetMap()->GetCreatureGUID(NPC_ICECALLERBRIATHA)); + } + } + + void UpdateAI(const uint32 diff) + { + if (!me->getVictim()) + { + if (EventStarted && Briatha) + { + if (TalkTimer < diff) + { + switch(Phase) + { + case 0: + Briatha->Say("These stones should be the last of them. Our coordination with Neptulon's forces will be impeccable.", LANG_NEUTRAL, 0); + Phase++; + break; + case 1: + me->Say("Yess. The Tidehunter will be pleased at this development. The Firelord's hold will weaken.", LANG_NEUTRAL, 0); + Phase++; + break; + case 2: + Briatha->Say("And your own preparations? Will the Frost Lord have a path to the portal?", LANG_NEUTRAL, 0); + Phase++; + break; + case 3: + me->Say("Skar'this has informed us well. We have worked our way into the slave pens and await your cryomancerss.", LANG_NEUTRAL, 0); + Phase++; + break; + case 4: + Briatha->Say("The ritual in Coilfang will bring Ahune through once he is fully prepared, and the resulting clash between Firelord and Frostlord will rend the foundations of this world. Our ultimate goals are in reach at last...", LANG_NEUTRAL, 0); + Phase = 0; + if(player->HasAura(46337, 0)) + ((Player*)player)->AreaExploredOrEventHappens(11891); + EventStarted = false; + break; + } + TalkTimer = 5000; + } + else + TalkTimer -= diff; + } + return; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_Heretic_Emisary(Creature *_Creature) +{ + return new npc_Heretic_EmisaryAI(_Creature); +} + + void AddSC_ashenvale() { Script *newscript; @@ -573,4 +656,9 @@ void AddSC_ashenvale() newscript->pItemUse = &ItemUse_item_Totemic_Beacon; newscript->RegisterSelf(); + newscript = new Script; + newscript->Name="npc_Heretic_Emisary"; + newscript->GetAI = &GetAI_npc_Heretic_Emisary; + newscript->RegisterSelf(); + } \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp b/src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp index bbc824a42..b52f47d4b 100755 --- a/src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp @@ -751,6 +751,52 @@ struct TRINITY_DLL_DECL npc_shattered_hand_berserkerAI : public ScriptedAI } }; + +/////// +/// Ice Stone +/////// + +#define GOSSIP_ICE_STONE "Place your hands on stone" + +#define NPC_GLACIAL_TEMPLAR 26216 + +bool GossipHello_go_ice_stone(Player *player, GameObject* _GO) +{ + if( player->GetQuestStatus(11954) == QUEST_STATUS_INCOMPLETE ) + { + player->ADD_GOSSIP_ITEM(0, GOSSIP_ICE_STONE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + } + player->SEND_GOSSIP_MENU(_GO->GetGOInfo()->questgiver.gossipID, _GO->GetGUID()); + return true; +} + +void SendActionMenu_go_ice_stone(Player *player, GameObject* _GO, uint32 action) +{ + _GO->SetGoState(GO_STATE_ACTIVE); + _GO->SetRespawnTime(300); + player->CLOSE_GOSSIP_MENU(); + + float x,y,z; + player->GetClosePoint(x,y,z, 0.0f, 2.0f, frand(0, M_PI)); + + switch(action) + { + case GOSSIP_ACTION_INFO_DEF: + player->SummonCreature(NPC_GLACIAL_TEMPLAR, x,y,z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 600000); + break; + } +} + +bool GossipSelect_go_ice_stone(Player *player, GameObject* _GO, uint32 sender, uint32 action ) +{ + switch(sender) + { + case GOSSIP_SENDER_MAIN: SendActionMenu_go_ice_stone(player, _GO, action); break; + } + return true; +} + + CreatureAI* GetAI_npc_shattered_hand_berserker(Creature *_Creature) { return new npc_shattered_hand_berserkerAI(_Creature); @@ -823,4 +869,10 @@ void AddSC_hellfire_peninsula() newscript->Name="npc_shattered_hand_berserker"; newscript->GetAI = &GetAI_npc_shattered_hand_berserker; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="go_ice_stone"; + newscript->pGOHello = &GossipHello_go_ice_stone; + newscript->pGOSelect = &GossipSelect_go_ice_stone; + newscript->RegisterSelf(); } diff --git a/src/game/AntiCheat.h b/src/game/AntiCheat.h index 232efb24d..520ff0347 100644 --- a/src/game/AntiCheat.h +++ b/src/game/AntiCheat.h @@ -46,7 +46,7 @@ class ACRequest : public ACE_Method_Request } // is on taxi - if (pPlayer->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_TAXI_FLIGHT) || !pPlayer->m_taxi.empty()) + if (pPlayer->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_TAXI_FLIGHT) || pPlayer->m_taxi.GetTaxiSource()) return -1; // speed rate differs from prev packet @@ -147,11 +147,13 @@ class ACRequest : public ACE_Method_Request return 0; } - pPlayer->m_AC_count++; - pPlayer->m_AC_timer = IN_MILISECONDS; // 1 sek + pPlayer->AC.IncrementAlertCount(); + + // we really need it ? :p + //pPlayer->AC.SetTimer(IN_MILISECONDS); //if (!(pPlayer->m_AC_count %5)) - sWorld.SendGMText(LANG_ANTICHEAT, pPlayer->GetName(), pPlayer->m_AC_count, m_speed, m_speed*fClientRate); + sWorld.SendGMText(LANG_ANTICHEAT, pPlayer->GetName(), pPlayer->AC.GetAlertCount(), m_speed, m_speed*fClientRate); sLog.outCheat("Player %s (GUID: %u / ACCOUNT_ID: %u) moved for distance %f with server speed : %f (client speed: %f). MapID: %u, player's coord before X:%f Y:%f Z:%f. Player's coord now X:%f Y:%f Z:%f. MOVEMENTFLAGS: %u LATENCY: %u. BG/Arena: %s", pPlayer->GetName(), pPlayer->GetGUIDLow(), pPlayer->GetSession()->GetAccountId(), fDistance2d, m_speed, m_speed*fClientRate, pPlayer->GetMapId(), m_pos.x, m_pos.y, m_pos.z, m_newPacket.pos.x, m_newPacket.pos.y, m_newPacket.pos.z, m_newPacket.GetMovementFlags(), m_latency, pPlayer->GetMap() ? (pPlayer->GetMap()->IsBattleGroundOrArena() ? "Yes" : "No") : "No"); diff --git a/src/game/CMakeLists.txt b/src/game/CMakeLists.txt index 0d661933e..12bf4c20f 100755 --- a/src/game/CMakeLists.txt +++ b/src/game/CMakeLists.txt @@ -39,6 +39,8 @@ SET(game_STAT_SRCS BattleGroundHandler.cpp BattleGroundMgr.cpp BattleGroundMgr.h + Camera.h + Camera.cpp Cell.h CellImpl.h Channel.cpp diff --git a/src/game/Camera.cpp b/src/game/Camera.cpp new file mode 100644 index 000000000..abb4de4a1 --- /dev/null +++ b/src/game/Camera.cpp @@ -0,0 +1,159 @@ +/* + * Copyright (C) 2005-2011 MaNGOS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "Camera.h" +#include "GridNotifiersImpl.h" +#include "CellImpl.h" +#include "Player.h" + +Camera::Camera(Player* pl) : m_owner(*pl), m_source(pl) +{ + m_source->GetViewPoint().Attach(this); +} + +Camera::~Camera() +{ + // view of camera should be already reseted to owner (RemoveFromWorld -> Event_RemovedFromWorld -> ResetView) + ASSERT(m_source == &m_owner); + + // for symmetry with constructor and way to make viewpoint's list empty + m_source->GetViewPoint().Detach(this); +} + +void Camera::ReceivePacket(WorldPacket *data) +{ + m_owner.SendDirectMessage(data); +} + +void Camera::UpdateForCurrentViewPoint() +{ + m_gridRef.unlink(); + + if (GridType* grid = m_source->GetViewPoint().m_grid) + grid->AddWorldObject(this); + + UpdateVisibilityForOwner(); +} + +void Camera::SetView(WorldObject *obj, bool update_far_sight_field /*= true*/) +{ + ASSERT(obj); + + if (m_source == obj) + return; + + if (!m_owner.IsInMap(obj)) + { + sLog.outError("Camera::SetView, viewpoint is not in map with camera's owner"); + return; + } + + if (!obj->isType(TypeMask(TYPEMASK_DYNAMICOBJECT | TYPEMASK_UNIT))) + { + sLog.outError("Camera::SetView, viewpoint type is not available for client"); + return; + } + + // detach and deregister from active objects if there are no more reasons to be active + m_source->GetViewPoint().Detach(this); + if (!m_source->isActiveObject()) + m_source->GetMap()->RemoveFromActive(m_source); + + m_source = obj; + + if (!m_source->isActiveObject()) + m_source->GetMap()->AddToActive(m_source); + + m_source->GetViewPoint().Attach(this); + + if (update_far_sight_field) + m_owner.SetUInt64Value(PLAYER_FARSIGHT, (m_source == &m_owner ? 0 : m_source->GetGUID())); + + UpdateForCurrentViewPoint(); +} + +void Camera::Event_ViewPointVisibilityChanged() +{ + if (!m_owner.HaveAtClient(m_source)) + ResetView(); +} + +void Camera::ResetView(bool update_far_sight_field /*= true*/) +{ + SetView(&m_owner, update_far_sight_field); +} + +void Camera::Event_AddedToWorld() +{ + GridType* grid = m_source->GetViewPoint().m_grid; + ASSERT(grid); + grid->AddWorldObject(this); + + UpdateVisibilityForOwner(); +} + +void Camera::Event_RemovedFromWorld() +{ + if (m_source == &m_owner) + { + m_gridRef.unlink(); + return; + } + + ResetView(); +} + +void Camera::Event_Moved() +{ + m_gridRef.unlink(); + m_source->GetViewPoint().m_grid->AddWorldObject(this); +} + +void Camera::UpdateVisibilityOf(WorldObject* target) +{ + m_owner.UpdateVisibilityOf(m_source, target); +} + +template +void Camera::UpdateVisibilityOf(T * target, UpdateData &data, std::set& vis) +{ + m_owner.template UpdateVisibilityOf(m_source, target,data,vis); +} + +template void Camera::UpdateVisibilityOf(Player* , UpdateData& , std::set& ); +template void Camera::UpdateVisibilityOf(Creature* , UpdateData& , std::set& ); +template void Camera::UpdateVisibilityOf(Corpse* , UpdateData& , std::set& ); +template void Camera::UpdateVisibilityOf(GameObject* , UpdateData& , std::set& ); +template void Camera::UpdateVisibilityOf(DynamicObject* , UpdateData& , std::set& ); + +void Camera::UpdateVisibilityForOwner() +{ + Trinity::VisibleNotifier notifier(*this); + Cell::VisitAllObjects(m_source, notifier, m_source->GetMap()->GetVisibilityDistance(), false); + notifier.Notify(); +} + +////////////////// + +ViewPoint::~ViewPoint() +{ + if (!m_cameras.empty()) + { + sLog.outError("ViewPoint destructor called, but some cameras referenced to it"); + } +} \ No newline at end of file diff --git a/src/game/Camera.h b/src/game/Camera.h new file mode 100644 index 000000000..06c4a6502 --- /dev/null +++ b/src/game/Camera.h @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2005-2011 MaNGOS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef MANGOSSERVER_CAMERA_H +#define MANGOSSERVER_CAMERA_H + +#include "Common.h" +#include "GridDefines.h" + +class ViewPoint; +class WorldObject; +class UpdateData; +class WorldPacket; +class Player; + +/// Camera - object-receiver. Receives broadcast packets from nearby worldobjects, object visibility changes and sends them to client +class TRINITY_DLL_SPEC Camera +{ + friend class ViewPoint; + public: + + explicit Camera(Player* pl); + ~Camera(); + + WorldObject* GetBody() { return m_source;} + Player* GetOwner() { return &m_owner;} + + // set camera's view to any worldobject + // Note: this worldobject must be in same map, in same phase with camera's owner(player) + // client supports only unit and dynamic objects as farsight objects + void SetView(WorldObject *obj, bool update_far_sight_field = true); + + // set view to camera's owner + void ResetView(bool update_far_sight_field = true); + + template + void UpdateVisibilityOf(T * obj, UpdateData &d, std::set& vis); + void UpdateVisibilityOf(WorldObject* obj); + + void ReceivePacket(WorldPacket *data); + + // updates visibility of worldobjects around viewpoint for camera's owner + void UpdateVisibilityForOwner(); + + private: + // called when viewpoint changes visibility state + void Event_AddedToWorld(); + void Event_RemovedFromWorld(); + void Event_Moved(); + void Event_ViewPointVisibilityChanged(); + + Player& m_owner; + WorldObject* m_source; + + void UpdateForCurrentViewPoint(); + + public: + GridReference& GetGridRef() { return m_gridRef; } + bool isActiveObject() const { return false; } + private: + GridReference m_gridRef; +}; + +/// Object-observer, notifies farsight object state to cameras that attached to it +class TRINITY_DLL_SPEC ViewPoint +{ + friend class Camera; + + typedef std::list CameraList; + + CameraList m_cameras; + GridType * m_grid; + + void Attach(Camera* c) { m_cameras.push_back(c); } + void Detach(Camera* c) { m_cameras.remove(c); } + + void CameraCall(void (Camera::*handler)()) + { + if (!m_cameras.empty()) + { + for(CameraList::iterator itr = m_cameras.begin(); itr != m_cameras.end();) + { + Camera *c = *(itr++); + (c->*handler)(); + } + } + } + +public: + + ViewPoint() : m_grid(0) {} + ~ViewPoint(); + + bool hasViewers() const { return !m_cameras.empty(); } + + // these events are called when viewpoint changes visibility state + void Event_AddedToWorld(GridType *grid) + { + m_grid = grid; + CameraCall(&Camera::Event_AddedToWorld); + } + + void Event_RemovedFromWorld() + { + m_grid = NULL; + CameraCall(&Camera::Event_RemovedFromWorld); + } + + void Event_GridChanged(GridType *grid) + { + m_grid = grid; + CameraCall(&Camera::Event_Moved); + } + + void Event_ViewPointVisibilityChanged() + { + CameraCall(&Camera::Event_ViewPointVisibilityChanged); + } + + void Call_UpdateVisibilityForOwner() + { + CameraCall(&Camera::UpdateVisibilityForOwner); + } +}; + +#endif diff --git a/src/game/Corpse.cpp b/src/game/Corpse.cpp index 7e6eb54ba..3a1570962 100755 --- a/src/game/Corpse.cpp +++ b/src/game/Corpse.cpp @@ -220,11 +220,8 @@ bool Corpse::LoadFromDB(uint32 guid, Field *fields) return true; } -bool Corpse::isVisibleForInState(Player const* u, bool inVisibleList) const +bool Corpse::isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList) const { - const WorldObject* viewPoint = u->GetFarsightTarget(); - if (!viewPoint || !u->HasFarsightVision()) viewPoint = u; - return IsInWorld() && u->IsInWorld() && IsWithinDistInMap(viewPoint, World::GetMaxVisibleDistanceForObject()+(inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f), false); } diff --git a/src/game/Corpse.h b/src/game/Corpse.h index 435e2e630..f216c1cce 100755 --- a/src/game/Corpse.h +++ b/src/game/Corpse.h @@ -76,7 +76,7 @@ class Corpse : public WorldObject GridPair const& GetGrid() const { return m_grid; } void SetGrid(GridPair const& grid) { m_grid = grid; } - bool isVisibleForInState(Player const* u, bool inVisibleList) const; + bool isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList) const; Loot loot; // remove insignia ONLY at BG Player* lootRecipient; diff --git a/src/game/DynamicObject.cpp b/src/game/DynamicObject.cpp index 9791de569..1d1b0d722 100755 --- a/src/game/DynamicObject.cpp +++ b/src/game/DynamicObject.cpp @@ -60,6 +60,7 @@ void DynamicObject::RemoveFromWorld() { WorldObject::RemoveFromWorld(); GetMap()->RemoveFromObjMap(GetGUID()); + GetViewPoint().Event_RemovedFromWorld(); } } @@ -152,11 +153,8 @@ void DynamicObject::Delay(int32 delaytime) (*iunit)->DelayAura(m_spellId, m_effIndex, delaytime); } -bool DynamicObject::isVisibleForInState(Player const* u, bool inVisibleList) const +bool DynamicObject::isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList) const { - const WorldObject* viewPoint = u->GetFarsightTarget(); - if (!viewPoint || !u->HasFarsightVision()) viewPoint = u; - return IsInWorld() && u->IsInWorld() && (IsWithinDistInMap(viewPoint, World::GetMaxVisibleDistanceForObject()+(inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f), false) || GetCasterGUID() == u->GetGUID()); } diff --git a/src/game/DynamicObject.h b/src/game/DynamicObject.h index d619c0925..65d75729d 100755 --- a/src/game/DynamicObject.h +++ b/src/game/DynamicObject.h @@ -48,7 +48,7 @@ class DynamicObject : public WorldObject void AddAffected(Unit *unit) { m_affected.insert(unit); } void RemoveAffected(Unit *unit) { m_affected.erase(unit); } void Delay(int32 delaytime); - bool isVisibleForInState(Player const* u, bool inVisibleList) const; + bool isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList) const; float GetObjectBoundingRadius() const // overwrite WorldObject version { diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index d7658d7d2..a33443d40 100755 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -778,7 +778,7 @@ void GameObject::SaveRespawnTime() objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime); } -bool GameObject::isVisibleForInState(Player const* u, bool inVisibleList) const +bool GameObject::isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList) const { // Not in world if (!IsInWorld() || !u->IsInWorld()) @@ -808,10 +808,6 @@ bool GameObject::isVisibleForInState(Player const* u, bool inVisibleList) const return false; } - // check distance - const WorldObject* viewPoint = u->GetFarsightTarget(); - if (!viewPoint || !u->HasFarsightVision()) viewPoint = u; - return IsWithinDistInMap(viewPoint, World::GetMaxVisibleDistanceForObject() + (inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f), false); } diff --git a/src/game/GameObject.h b/src/game/GameObject.h index 15da2b453..be38f464f 100755 --- a/src/game/GameObject.h +++ b/src/game/GameObject.h @@ -609,7 +609,7 @@ class TRINITY_DLL_SPEC GameObject : public WorldObject void TriggeringLinkedGameObject(uint32 trapEntry, Unit* target); - bool isVisibleForInState(Player const* u, bool inVisibleList) const; + bool isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList) const; bool canDetectTrap(Player const* u, float distance) const; GameObject* LookupFishingHoleAround(float range); diff --git a/src/game/GridDefines.h b/src/game/GridDefines.h index 1a0313939..3c5fa461f 100755 --- a/src/game/GridDefines.h +++ b/src/game/GridDefines.h @@ -32,6 +32,7 @@ class DynamicObject; class GameObject; class Pet; class Player; +class Camera; #ifdef LARGE_CELL #define MAX_NUMBER_OF_CELLS 8 @@ -79,9 +80,10 @@ struct GridMapLiquidData }; // Creature used instead pet to simplify *::Visit templates (not required duplicate code for Creature->Pet case) -typedef TYPELIST_4(Player, Creature/*pets*/, Corpse/*resurrectable*/, DynamicObject/*farsight target*/) AllWorldObjectTypes; +typedef TYPELIST_4(Player, Creature/*pets*/, Corpse/*resurrectable*/, Camera) AllWorldObjectTypes; typedef TYPELIST_4(GameObject, Creature/*except pets*/, DynamicObject, Corpse/*Bones*/) AllGridObjectTypes; +typedef GridRefManager CameraMapType; typedef GridRefManager CorpseMapType; typedef GridRefManager CreatureMapType; typedef GridRefManager DynamicObjectMapType; diff --git a/src/game/GridNotifiers.cpp b/src/game/GridNotifiers.cpp index e3c0d4b0d..29ac6ef3c 100755 --- a/src/game/GridNotifiers.cpp +++ b/src/game/GridNotifiers.cpp @@ -19,230 +19,83 @@ */ #include "GridNotifiers.h" -#include "GridNotifiersImpl.h" #include "WorldPacket.h" #include "WorldSession.h" #include "UpdateData.h" #include "Item.h" #include "Map.h" -#include "MapManager.h" #include "Transports.h" #include "ObjectAccessor.h" -#include "CellImpl.h" #include "SpellAuras.h" using namespace Trinity; -void VisibleNotifier::SendToSelf() +void VisibleChangesNotifier::Visit(CameraMapType &m) { + for (CameraMapType::iterator iter = m.begin(); iter != m.end(); ++iter) + iter->getSource()->UpdateVisibilityOf(&i_object); +} + +void VisibleNotifier::Notify() +{ + Player& player = *i_camera.GetOwner(); // at this moment i_clientGUIDs have guids that not iterate at grid level checks // but exist one case when this possible and object not out of range: transports - if (Transport* transport = i_player.GetTransport()) - for (Transport::PlayerSet::const_iterator itr = transport->GetPassengers().begin();itr!=transport->GetPassengers().end();++itr) + if(Transport* transport = player.GetTransport()) + { + for(Transport::PlayerSet::const_iterator itr = transport->GetPassengers().begin();itr!=transport->GetPassengers().end();++itr) { - if (vis_guids.find((*itr)->GetGUID()) != vis_guids.end()) + if(i_clientGUIDs.find((*itr)->GetGUID())!=i_clientGUIDs.end()) { - vis_guids.erase((*itr)->GetGUID()); - - i_player.UpdateVisibilityOf((*itr), i_data, i_visibleNow); - - if (!(*itr)->isNeedNotify(NOTIFY_VISIBILITY_CHANGED)) - (*itr)->UpdateVisibilityOf(&i_player); + // ignore far sight case + (*itr)->UpdateVisibilityOf(*itr, &player); + player.UpdateVisibilityOf(&player, *itr, i_data, i_visibleNow); + i_clientGUIDs.erase((*itr)->GetGUID()); } } - - for (Player::ClientGUIDs::const_iterator it = vis_guids.begin();it != vis_guids.end(); ++it) - { - i_player.m_clientGUIDs.erase(*it); - i_data.AddOutOfRangeGUID(*it); - if (IS_PLAYER_GUID(*it)) - { - Player* plr = ObjectAccessor::FindPlayer(*it); - if (plr && plr->IsInWorld() && !plr->isNeedNotify(NOTIFY_VISIBILITY_CHANGED)) - plr->UpdateVisibilityOf(&i_player); - } - } - - if (!i_data.HasData()) - return; - - WorldPacket packet; - i_data.BuildPacket(&packet); - i_player.GetSession()->SendPacket(&packet); - - for (std::set::const_iterator it = i_visibleNow.begin(); it != i_visibleNow.end(); ++it) - i_player.SendInitialVisiblePackets(*it); -} - -void VisibleChangesNotifier::Visit(PlayerMapType &m) -{ - for (PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter) - { - if (iter->getSource() == &i_object) - continue; - - iter->getSource()->UpdateVisibilityOf(&i_object); - - if (!iter->getSource()->GetSharedVisionList().empty()) - for (SharedVisionList::const_iterator i = iter->getSource()->GetSharedVisionList().begin(); i != iter->getSource()->GetSharedVisionList().end(); ++i) - if ((*i)->HasFarsightVision() && (*i)->GetFarsightTarget() == iter->getSource()) - (*i)->UpdateVisibilityOf(&i_object); } -} - -void VisibleChangesNotifier::Visit(CreatureMapType &m) -{ - for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter) - if(!iter->getSource()->GetSharedVisionList().empty()) - for(SharedVisionList::const_iterator i = iter->getSource()->GetSharedVisionList().begin(); i != iter->getSource()->GetSharedVisionList().end(); ++i) - if ((*i)->HasFarsightVision() && (*i)->GetFarsightTarget() == iter->getSource()) - (*i)->UpdateVisibilityOf(&i_object); -} - -void VisibleChangesNotifier::Visit(DynamicObjectMapType &m) -{ - for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter) - if(IS_PLAYER_GUID(iter->getSource()->GetCasterGUID())) - if(Player* caster = (Player*)iter->getSource()->GetCaster()) - caster->UpdateVisibilityOf(&i_object); -} - -inline void CreatureUnitRelocationWorker(Creature* c, Unit* u) -{ - if (!u->isAlive() || !c->isAlive() || c == u) - return; - - // hacky exception for Sunblade Lookout, Shattered Sun Bombardier and Brutallus - if (u->isInFlight() && c->GetEntry() != 25132 && c->GetEntry() != 25144 && c->GetEntry() != 25158) - return; - - if (c->HasReactState(REACT_AGGRESSIVE) && !c->hasUnitState(UNIT_STAT_SIGHTLESS)) - if (c->_IsWithinDist(u, DEFAULT_VISIBILITY_DISTANCE, true) && c->IsAIEnabled) - c->AI()->MoveInLineOfSight_Safe(u); -} -void PlayerRelocationNotifier::Visit(PlayerMapType &m) -{ - for (PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter) + // generate outOfRange for not iterate objects + for (Player::ClientGUIDs::iterator itr = i_clientGUIDs.begin(); itr != i_clientGUIDs.end(); ++itr) { - Player* plr = iter->getSource(); - - vis_guids.erase(plr->GetGUID()); - - i_player.UpdateVisibilityOf(plr,i_data,i_visibleNow); - - WorldObject const* viewPoint = plr->GetFarsightTarget(); - if (!viewPoint || !plr->HasFarsightVision()) viewPoint = plr; + player.m_clientGUIDs.erase(*itr); + i_data.AddOutOfRangeGUID(*itr); - if (viewPoint->isNeedNotify(NOTIFY_VISIBILITY_CHANGED)) + if (!IS_PLAYER_GUID(*itr)) continue; - plr->UpdateVisibilityOf(&i_player); - } -} - -void PlayerRelocationNotifier::Visit(CreatureMapType &m) -{ - bool relocated_for_ai = (i_player.GetFarsightTarget() == NULL); - for (CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter) - { - Creature * c = iter->getSource(); - - vis_guids.erase(c->GetGUID()); - - i_player.UpdateVisibilityOf(c,i_data,i_visibleNow); - - if (relocated_for_ai && !c->isNeedNotify(NOTIFY_VISIBILITY_CHANGED)) - CreatureUnitRelocationWorker(c, &i_player); + if (Player *plr = ObjectAccessor::FindPlayer(*itr)) + { + if (plr->IsInWorld()) + plr->UpdateVisibilityOf(plr->GetCamera().GetBody(), &player); + } } -} -void CreatureRelocationNotifier::Visit(PlayerMapType &m) -{ - for (PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter) + if (i_data.HasData()) { - Player * pl = iter->getSource(); - - WorldObject const* viewPoint = pl->GetFarsightTarget(); - if (!viewPoint || !pl->HasFarsightVision()) viewPoint = pl; - - if (!viewPoint->isNeedNotify(NOTIFY_VISIBILITY_CHANGED)) - pl->UpdateVisibilityOf(&i_creature); - - CreatureUnitRelocationWorker(&i_creature, pl); + // send create/outofrange packet to player (except player create updates that already sent using SendUpdateToPlayer) + WorldPacket packet; + i_data.BuildPacket(&packet); + player.GetSession()->SendPacket(&packet); } -} -void CreatureRelocationNotifier::Visit(CreatureMapType &m) -{ - if (!i_creature.isAlive()) - return; + // Now do operations that required done at object visibility change to visible - for (CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter) + // send data at target visibility change (adding to client) + for (std::set::const_iterator vItr = i_visibleNow.begin(); vItr != i_visibleNow.end(); ++vItr) { - Creature* c = iter->getSource(); - CreatureUnitRelocationWorker(&i_creature, c); + // target aura duration for caster show only if target exist at caster client + if ((*vItr) != &player && (*vItr)->isType(TYPEMASK_UNIT)) + player.SendAuraDurationsForTarget((Unit*)(*vItr)); - if (!c->isNeedNotify(NOTIFY_VISIBILITY_CHANGED)) - CreatureUnitRelocationWorker(c, &i_creature); - } -} - -void DelayedUnitRelocation::Visit(CreatureMapType &m) -{ - for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter) - { - Creature * unit = iter->getSource(); - if (!unit->isNeedNotify(NOTIFY_VISIBILITY_CHANGED)) - continue; - - CreatureRelocationNotifier relocate(*unit); - - TypeContainerVisitor c2world_relocation(relocate); - TypeContainerVisitor c2grid_relocation(relocate); - - cell.Visit(p, c2world_relocation, i_map, *unit, i_radius); - cell.Visit(p, c2grid_relocation, i_map, *unit, i_radius); - } -} - -void DelayedUnitRelocation::Visit(PlayerMapType &m) -{ - for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter) - { - Player * player = iter->getSource(); - - WorldObject const* viewPoint = player->GetFarsightTarget(); - if (!viewPoint || !player->HasFarsightVision()) viewPoint = player; - - if (!viewPoint->isNeedNotify(NOTIFY_VISIBILITY_CHANGED)) - continue; - - if (player != viewPoint && !viewPoint->IsPositionValid()) - continue; - - CellPair pair2(Trinity::ComputeCellPair(viewPoint->GetPositionX(), viewPoint->GetPositionY())); - Cell cell2(pair2); - - PlayerRelocationNotifier relocate(*player); - TypeContainerVisitor c2world_relocation(relocate); - TypeContainerVisitor c2grid_relocation(relocate); - - cell2.Visit(pair2, c2world_relocation, i_map, *viewPoint, i_radius); - cell2.Visit(pair2, c2grid_relocation, i_map, *viewPoint, i_radius); - - relocate.SendToSelf(); - } -} + // non finished movements show to player + if ((*vItr)->GetTypeId()==TYPEID_UNIT && ((Creature*)(*vItr))->isAlive()) + { + ((Creature*)(*vItr))->SendMonsterMoveWithSpeedToCurrentDestination(&player); -void AIRelocationNotifier::Visit(CreatureMapType &m) -{ - for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter) - { - Creature *c = iter->getSource(); - CreatureUnitRelocationWorker(c, &i_unit); - if (isCreature) - CreatureUnitRelocationWorker((Creature*)&i_unit, c); + if (((Creature*)(*vItr))->getVictim()) + ((Creature*)(*vItr))->SendMeleeAttackStart(((Creature*)(*vItr))->getVictim()); + } } } @@ -321,88 +174,68 @@ void DynamicObjectUpdater::Visit(PlayerMapType &m) VisitHelper(itr->getSource()); } -void Deliverer::Visit(PlayerMapType &m) +void MessageDeliverer::Visit(CameraMapType &m) { - for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter) + for(CameraMapType::iterator iter = m.begin(); iter != m.end(); ++iter) { - if (!i_dist || iter->getSource()->GetDistance(&i_source) <= i_dist) - { - // Send packet to all who are sharing the player's vision - if (!iter->getSource()->GetSharedVisionList().empty()) - { - SharedVisionList::const_iterator it = iter->getSource()->GetSharedVisionList().begin(); - for (; it != iter->getSource()->GetSharedVisionList().end(); ++it) - SendPacket(*it); - } - - VisitObject(iter->getSource()); - } - } -} + Player* owner = iter->getSource()->GetOwner(); -void Deliverer::Visit(CreatureMapType &m) -{ - for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter) - { - if (!i_dist || iter->getSource()->GetDistance(&i_source) <= i_dist) + if (i_toSelf || owner != &i_player) { - // Send packet to all who are sharing the creature's vision - if (!iter->getSource()->GetSharedVisionList().empty()) - { - SharedVisionList::const_iterator it = iter->getSource()->GetSharedVisionList().begin(); - for (; it != iter->getSource()->GetSharedVisionList().end(); ++it) - SendPacket(*it); - } + if (WorldSession* session = owner->GetSession()) + session->SendPacket(i_message); } } } -void Deliverer::Visit(DynamicObjectMapType &m) +void MessageDelivererExcept::Visit(CameraMapType &m) { - for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter) + for(CameraMapType::iterator iter = m.begin(); iter != m.end(); ++iter) { - if (IS_PLAYER_GUID(iter->getSource()->GetCasterGUID())) - { - // Send packet back to the caster if the caster has vision of dynamic object - Player* caster = (Player*)iter->getSource()->GetCaster(); - if (caster && caster->GetUInt64Value(PLAYER_FARSIGHT) == iter->getSource()->GetGUID() && - (!i_dist || iter->getSource()->GetDistance(&i_source) <= i_dist)) - SendPacket(caster); - } + Player* owner = iter->getSource()->GetOwner(); + + if (owner == i_skipped_receiver) + continue; + + if (WorldSession* session = owner->GetSession()) + session->SendPacket(i_message); } } -void Deliverer::SendPacket(Player* plr) +void ObjectMessageDeliverer::Visit(CameraMapType &m) { - if (!plr) - return; - - // Don't send the packet to self if not supposed to - if (!i_toSelf && plr == &i_source) - return; - - // Don't send the packet to possesor if not supposed to - if (!i_toPossessor && plr->isPossessing() && plr->GetCharmGUID() == i_source.GetGUID()) - return; - - if (plr_list.find(plr->GetGUID()) == plr_list.end()) + for(CameraMapType::iterator iter = m.begin(); iter != m.end(); ++iter) { - if (WorldSession* session = plr->GetSession()) + if(WorldSession* session = iter->getSource()->GetOwner()->GetSession()) session->SendPacket(i_message); - plr_list.insert(plr->GetGUID()); } } -void MessageDeliverer::VisitObject(Player* plr) +void MessageDistDeliverer::Visit(CameraMapType &m) { - SendPacket(plr); + for(CameraMapType::iterator iter=m.begin(); iter != m.end(); ++iter) + { + Player * owner = iter->getSource()->GetOwner(); + + if ((i_toSelf || owner != &i_player) && + (!i_ownTeamOnly || owner->GetTeam() == i_player.GetTeam()) && + (!i_dist || iter->getSource()->GetBody()->IsWithinDist(&i_player,i_dist))) + { + if (WorldSession* session = owner->GetSession()) + session->SendPacket(i_message); + } + } } -void MessageDistDeliverer::VisitObject(Player* plr) +void ObjectMessageDistDeliverer::Visit(CameraMapType &m) { - if (!i_ownTeamOnly || (i_source.GetTypeId() == TYPEID_PLAYER && plr->GetTeam() == ((Player&)i_source).GetTeam())) + for(CameraMapType::iterator iter=m.begin(); iter != m.end(); ++iter) { - SendPacket(plr); + if (!i_dist || iter->getSource()->GetBody()->IsWithinDist(&i_object,i_dist)) + { + if (WorldSession* session = iter->getSource()->GetOwner()->GetSession()) + session->SendPacket(i_message); + } } } diff --git a/src/game/GridNotifiers.h b/src/game/GridNotifiers.h index 20331bc95..b103c4c34 100755 --- a/src/game/GridNotifiers.h +++ b/src/game/GridNotifiers.h @@ -39,17 +39,17 @@ class Player; namespace Trinity { - struct VisibleNotifier + struct TRINITY_DLL_DECL VisibleNotifier { - Player &i_player; + Camera& i_camera; UpdateData i_data; - std::set i_visibleNow; - Player::ClientGUIDs vis_guids; - - VisibleNotifier(Player &player) : i_player(player), vis_guids(player.m_clientGUIDs) {} + Player::ClientGUIDs i_clientGUIDs; + std::set i_visibleNow; + explicit VisibleNotifier(Camera &c) : i_camera(c), i_clientGUIDs(c.GetOwner()->m_clientGUIDs) {} template void Visit(GridRefManager &m); - void SendToSelf(void); + void Visit(CameraMapType &m) {} + void Notify(void); }; struct TRINITY_DLL_DECL VisibleChangesNotifier @@ -58,50 +58,32 @@ namespace Trinity explicit VisibleChangesNotifier(WorldObject &object) : i_object(object) {} template void Visit(GridRefManager &) {} - void Visit(PlayerMapType &); - void Visit(CreatureMapType &); - void Visit(DynamicObjectMapType &); + void Visit(CameraMapType &); }; - struct PlayerRelocationNotifier : public VisibleNotifier + struct TRINITY_DLL_DECL PlayerRelocationNotifier { - PlayerRelocationNotifier(Player &pl) : VisibleNotifier(pl) {} - - template void Visit(GridRefManager &m) { VisibleNotifier::Visit(m); } - void Visit(CreatureMapType &); + Player &i_player; + PlayerRelocationNotifier(Player &pl) : i_player(pl) {} + template void Visit(GridRefManager &) {} void Visit(PlayerMapType &); + void Visit(CreatureMapType &); }; - struct CreatureRelocationNotifier + struct TRINITY_DLL_DECL CreatureRelocationNotifier { Creature &i_creature; CreatureRelocationNotifier(Creature &c) : i_creature(c) {} template void Visit(GridRefManager &) {} - void Visit(CreatureMapType &); - void Visit(PlayerMapType &); + #ifdef WIN32 + template<> void Visit(PlayerMapType &); + #endif }; - struct DelayedUnitRelocation - { - Map &i_map; - Cell &cell; - CellPair &p; - const float i_radius; - DelayedUnitRelocation(Cell &c, CellPair &pair, Map &map, float radius) : - cell(c), p(pair), i_map(map), i_radius(radius) {} - template void Visit(GridRefManager &) {} - void Visit(CreatureMapType &); - void Visit(PlayerMapType &); - }; - - struct AIRelocationNotifier - { - Unit &i_unit; - bool isCreature; - explicit AIRelocationNotifier(Unit &unit) : i_unit(unit), isCreature(unit.GetTypeId() == TYPEID_UNIT) {} - template void Visit(GridRefManager &) {} - void Visit(CreatureMapType &); - }; + #ifndef WIN32 + template<> inline void Trinity::CreatureRelocationNotifier::Visit(CreatureMapType &m); + template<> inline void Trinity::CreatureRelocationNotifier::Visit(PlayerMapType &m); + #endif struct TRINITY_DLL_DECL GridUpdater { @@ -114,7 +96,7 @@ namespace Trinity for (typename GridRefManager::iterator iter = m.begin(); iter != m.end(); ++iter) { WorldObject::UpdateHelper helper(iter->getSource()); - helper.Update(i_timeDiff); + helper.Update(i_timeDiff); } } @@ -125,46 +107,58 @@ namespace Trinity void Visit(CorpseMapType &m) { updateObjects(m); } }; - struct TRINITY_DLL_DECL Deliverer + struct TRINITY_DLL_DECL MessageDeliverer { - WorldObject &i_source; + Player &i_player; WorldPacket *i_message; - std::set plr_list; - bool i_toPossessor; bool i_toSelf; - float i_dist; - Deliverer(WorldObject &src, WorldPacket *msg, bool to_possessor, bool to_self, float dist = 0.0f) : i_source(src), i_message(msg), i_toPossessor(to_possessor), i_toSelf(to_self), i_dist(dist) {} - void Visit(PlayerMapType &m); - void Visit(CreatureMapType &m); - void Visit(DynamicObjectMapType &m); - virtual void VisitObject(Player* plr) = 0; - void SendPacket(Player* plr); + MessageDeliverer(Player &pl, WorldPacket *msg, bool to_self) : i_player(pl), i_message(msg), i_toSelf(to_self) {} + void Visit(CameraMapType &m); template void Visit(GridRefManager &) {} }; - struct TRINITY_DLL_DECL MessageDeliverer : public Deliverer + struct MessageDelivererExcept { - MessageDeliverer(Player &pl, WorldPacket *msg, bool to_possessor, bool to_self) : Deliverer(pl, msg, to_possessor, to_self) {} - void VisitObject(Player* plr); + WorldPacket* i_message; + Player const* i_skipped_receiver; + + MessageDelivererExcept(WorldPacket *msg, Player const* skipped) + : i_message(msg), i_skipped_receiver(skipped) {} + + void Visit(CameraMapType &m); + template void Visit(GridRefManager &) {} }; - struct TRINITY_DLL_DECL ObjectMessageDeliverer : public Deliverer + struct TRINITY_DLL_DECL ObjectMessageDeliverer { - explicit ObjectMessageDeliverer(WorldObject &src, WorldPacket *msg, bool to_possessor) : Deliverer(src, msg, to_possessor, false) {} - void VisitObject(Player* plr) { SendPacket(plr); } + WorldPacket *i_message; + explicit ObjectMessageDeliverer(WorldPacket *msg) : i_message(msg) {} + void Visit(CameraMapType &m); + template void Visit(GridRefManager &) {} }; - struct TRINITY_DLL_DECL MessageDistDeliverer : public Deliverer + struct TRINITY_DLL_DECL MessageDistDeliverer { + Player &i_player; + WorldPacket *i_message; + bool i_toSelf; bool i_ownTeamOnly; - MessageDistDeliverer(Player &pl, WorldPacket *msg, bool to_possessor, float dist, bool to_self, bool ownTeamOnly) : Deliverer(pl, msg, to_possessor, to_self, dist), i_ownTeamOnly(ownTeamOnly) {} - void VisitObject(Player* plr); + float i_dist; + + MessageDistDeliverer(Player &pl, WorldPacket *msg, float dist, bool to_self, bool ownTeamOnly) + : i_player(pl), i_message(msg), i_toSelf(to_self), i_ownTeamOnly(ownTeamOnly), i_dist(dist) {} + void Visit(CameraMapType &m); + template void Visit(GridRefManager &) {} }; - struct TRINITY_DLL_DECL ObjectMessageDistDeliverer : public Deliverer + struct TRINITY_DLL_DECL ObjectMessageDistDeliverer { - ObjectMessageDistDeliverer(WorldObject &obj, WorldPacket *msg, bool to_possessor, float dist) : Deliverer(obj, msg, to_possessor, false, dist) {} - void VisitObject(Player* plr) { SendPacket(plr); } + WorldObject &i_object; + WorldPacket *i_message; + float i_dist; + ObjectMessageDistDeliverer(WorldObject &obj, WorldPacket *msg, float dist) : i_object(obj), i_message(msg), i_dist(dist) {} + void Visit(CameraMapType &m); + template void Visit(GridRefManager &) {} }; struct TRINITY_DLL_DECL ObjectUpdater @@ -174,6 +168,7 @@ namespace Trinity template void Visit(GridRefManager &m); void Visit(PlayerMapType &) {} void Visit(CorpseMapType &) {} + void Visit(CameraMapType &) {} void Visit(CreatureMapType &); }; @@ -467,6 +462,25 @@ namespace Trinity template void Visit(GridRefManager &) {} }; + template + struct TRINITY_DLL_DECL CameraDistWorker + { + WorldObject const* i_searcher; + float i_dist; + Do& i_do; + + CameraDistWorker(WorldObject const* searcher, float _dist, Do& _do) + : i_searcher(searcher), i_dist(_dist), i_do(_do) {} + + void Visit(CameraMapType &m) + { + for(CameraMapType::iterator itr=m.begin(); itr != m.end(); ++itr) + if (itr->getSource()->GetBody()->IsWithinDist(i_searcher,i_dist)) + i_do(itr->getSource()->GetOwner()); + } + template void Visit(GridRefManager &) {} + }; + // CHECKS && DO classes // WorldObject check classes @@ -705,7 +719,7 @@ namespace Trinity bool operator()(Unit* u) { if (u->isTargetableForAttack() && i_obj->IsWithinDistInMap(u, i_range) && - !i_funit->IsFriendlyTo(u) && u->isVisibleForOrDetect(i_funit,false) ) + !i_funit->IsFriendlyTo(u) && u->isVisibleForOrDetect(i_funit,i_funit,false) ) { i_range = i_obj->GetDistance(u); // use found unit range as new range limit for next check return true; diff --git a/src/game/GridNotifiersImpl.h b/src/game/GridNotifiersImpl.h index 3bd334db6..e9cd79f57 100755 --- a/src/game/GridNotifiersImpl.h +++ b/src/game/GridNotifiersImpl.h @@ -30,25 +30,113 @@ #include "SpellAuras.h" template -inline void -Trinity::VisibleNotifier::Visit(GridRefManager &m) +inline void Trinity::VisibleNotifier::Visit(GridRefManager &m) { for(typename GridRefManager::iterator iter = m.begin(); iter != m.end(); ++iter) { - vis_guids.erase(iter->getSource()->GetGUID()); - i_player.UpdateVisibilityOf(iter->getSource(),i_data,i_visibleNow); + i_camera.UpdateVisibilityOf(iter->getSource(), i_data, i_visibleNow); + i_clientGUIDs.erase(iter->getSource()->GetGUID()); } } -inline void -Trinity::ObjectUpdater::Visit(CreatureMapType &m) +inline void Trinity::ObjectUpdater::Visit(CreatureMapType &m) { for (CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter) + { if (iter->getSource()->IsInWorld() && !iter->getSource()->isSpiritService()) { WorldObject::UpdateHelper helper(iter->getSource()); helper.Update(i_timeDiff); } + } +} + +inline void Trinity::PlayerRelocationNotifier::Visit(PlayerMapType &m) +{ + for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter) + { + if (&i_player==iter->getSource()) + continue; + + // visibility for players updated by ObjectAccessor::UpdateVisibilityFor calls in appropriate places + + // Cancel Trade + if (i_player.GetTrader()==iter->getSource()) + // iteraction distance + if (!i_player.IsWithinDistInMap(iter->getSource(), INTERACTION_DISTANCE)) + i_player.GetSession()->SendCancelTrade(); // will clode both side trade windows + } +} + +inline void PlayerCreatureRelocationWorker(Player* pl, Creature* c) +{ + // Creature AI reaction + + // hacky exception for Sunblade Lookout, Shattered Sun Bombardier and Brutallus + if (pl->isInFlight() && c->GetEntry() != 25132 && c->GetEntry() != 25144 && c->GetEntry() != 25158) + return; + + if (!c->hasUnitState(UNIT_STAT_FLEEING) && c->HasReactState(REACT_AGGRESSIVE) && !c->hasUnitState(UNIT_STAT_SIGHTLESS)) + { + if (c->AI() /*&& c->AI()->IsVisible(pl)*/ && !c->IsInEvadeMode()) + c->AI()->MoveInLineOfSight_Safe(pl); + } +} + +inline void CreatureCreatureRelocationWorker(Creature* c1, Creature* c2) +{ + if (!c1->hasUnitState(UNIT_STAT_FLEEING) && c1->HasReactState(REACT_AGGRESSIVE) && !c1->hasUnitState(UNIT_STAT_SIGHTLESS)) + { + if (c1->AI() /*&& c->AI()->IsVisible(pl)*/ && !c1->IsInEvadeMode()) + c1->AI()->MoveInLineOfSight_Safe(c2); + } + + if (!c2->hasUnitState(UNIT_STAT_FLEEING) && c2->HasReactState(REACT_AGGRESSIVE) && !c2->hasUnitState(UNIT_STAT_SIGHTLESS)) + { + if (c2->AI() /*&& c->AI()->IsVisible(pl)*/ && !c2->IsInEvadeMode()) + c2->AI()->MoveInLineOfSight_Safe(c1); + } +} + +inline void Trinity::PlayerRelocationNotifier::Visit(CreatureMapType &m) +{ + if (!i_player.isAlive() || i_player.isInFlight()) + return; + + for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter) + { + Creature* c = iter->getSource(); + if (c->isAlive()) + PlayerCreatureRelocationWorker(&i_player, c); + } +} + +template<> +inline void Trinity::CreatureRelocationNotifier::Visit(PlayerMapType &m) +{ + if (!i_creature.isAlive()) + return; + + for (PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter) + { + Player* player = iter->getSource(); + if (player->isAlive() && !player->isInFlight()) + PlayerCreatureRelocationWorker(player, &i_creature); + } +} + +template<> +inline void Trinity::CreatureRelocationNotifier::Visit(CreatureMapType &m) +{ + if (!i_creature.isAlive()) + return; + + for(CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter) + { + Creature* c = iter->getSource(); + if (c != &i_creature && c->isAlive()) + CreatureCreatureRelocationWorker(c, &i_creature); + } } // SEARCHERS & LIST SEARCHERS & WORKERS diff --git a/src/game/GuardAI.cpp b/src/game/GuardAI.cpp index a4099d4e8..9f7d8da5b 100755 --- a/src/game/GuardAI.cpp +++ b/src/game/GuardAI.cpp @@ -127,7 +127,7 @@ void GuardAI::UpdateAI(const uint32 /*diff*/) bool GuardAI::IsVisible(Unit *pl) const { return m_creature->IsWithinDistInMap(pl,sWorld.getConfig(CONFIG_SIGHT_GUARDER)) && - pl->isVisibleForOrDetect(m_creature,true); + pl->isVisibleForOrDetect(m_creature,m_creature,true); } void GuardAI::JustDied(Unit *killer) diff --git a/src/game/Map.cpp b/src/game/Map.cpp index a38633221..48fea14fe 100755 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -158,8 +158,7 @@ void Map::DeleteStateMachine() Map::Map(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnMode) : i_mapEntry (sMapStore.LookupEntry(id)), i_spawnMode(SpawnMode), i_id(id), i_InstanceId(InstanceId), m_unloadTimer(0), i_gridExpiry(expiry), - m_VisibleDistance(DEFAULT_VISIBILITY_DISTANCE), m_activeNonPlayersIter(m_activeNonPlayers.end()), i_scriptLock(true), - m_VisibilityNotifyPeriod(DEFAULT_VISIBILITY_NOTIFY_PERIOD) + m_VisibleDistance(DEFAULT_VISIBILITY_DISTANCE), m_activeNonPlayersIter(m_activeNonPlayers.end()), i_scriptLock(true) { for (unsigned int idx=0; idx < MAX_NUMBER_OF_GRIDS; ++idx) { @@ -171,8 +170,6 @@ Map::Map(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnMode) } } - m_VisibilityNotifyPeriod = World::GetVisibilityNotifyPeriodOnContinents(); - //lets initialize visibility distance for map Map::InitVisibilityDistance(); } @@ -334,8 +331,8 @@ void Map::EnsureGridCreated(const GridPair &p) { if (!getNGrid(p.x_coord, p.y_coord)) { - Guard guard(*this); - if (!getNGrid(p.x_coord, p.y_coord)) + //Guard guard(*this); + //if (!getNGrid(p.x_coord, p.y_coord)) { sLog.outDebug("Loading grid[%u,%u] for map %u", p.x_coord, p.y_coord, i_id); @@ -426,7 +423,9 @@ bool Map::Add(Player *player) SendInitTransports(player); player->m_clientGUIDs.clear(); - player->UpdateObjectVisibility(true); + + player->GetViewPoint().Event_AddedToWorld(&(*grid)(cell.CellX(), cell.CellY())); + UpdateObjectVisibility(player,cell,p); return true; } @@ -444,11 +443,6 @@ Map::Add(T *obj) } Cell cell(p); - if (obj->IsInWorld()) // need some clean up later - { - obj->UpdateObjectVisibility(true); - return; - } if (obj->isActiveObject()) EnsureGridLoadedAtEnter(cell); @@ -466,31 +460,31 @@ Map::Add(T *obj) DEBUG_LOG("Object %u enters grid[%u,%u]", GUID_LOPART(obj->GetGUID()), cell.GridX(), cell.GridY()); - //trigger needs to cast spell, if not update, cannot see visual - obj->UpdateObjectVisibility(true); + obj->GetViewPoint().Event_AddedToWorld(&(*grid)(cell.CellX(), cell.CellY())); + UpdateObjectVisibility(obj,cell,p); } void Map::MessageBroadcast(Player *player, WorldPacket *msg, bool to_self, bool to_possessor) { - Trinity::MessageDeliverer post_man(*player, msg, to_possessor, to_self); + Trinity::MessageDeliverer post_man(*player, msg, to_self); Cell::VisitWorldObjects(player, post_man, GetVisibilityDistance()); } void Map::MessageBroadcast(WorldObject *obj, WorldPacket *msg, bool to_possessor) { - Trinity::ObjectMessageDeliverer post_man(*obj, msg, to_possessor); + Trinity::ObjectMessageDeliverer post_man(msg); Cell::VisitWorldObjects(obj, post_man, GetVisibilityDistance()); } void Map::MessageDistBroadcast(Player *player, WorldPacket *msg, float dist, bool to_self, bool to_possessor, bool own_team_only) { - Trinity::MessageDistDeliverer post_man(*player, msg, to_possessor, dist, to_self, own_team_only); + Trinity::MessageDistDeliverer post_man(*player, msg, dist, to_self, own_team_only); Cell::VisitWorldObjects(player, post_man, GetVisibilityDistance()); } void Map::MessageDistBroadcast(WorldObject *obj, WorldPacket *msg, float dist, bool to_possessor) { - Trinity::ObjectMessageDistDeliverer post_man(*obj, msg, to_possessor, dist); + Trinity::ObjectMessageDistDeliverer post_man(*obj, msg, dist); Cell::VisitWorldObjects(obj, post_man, GetVisibilityDistance()); } @@ -611,101 +605,6 @@ void Map::Update(const uint32 &t_diff) ScriptsProcess(); i_scriptLock = false; } - - MoveAllCreaturesInMoveList(); - - if(!m_mapRefManager.isEmpty() || !m_activeNonPlayers.empty()) - ProcessRelocationNotifies(t_diff); -} - -struct ResetNotifier -{ - templateinline void resetNotify(GridRefManager &m) - { - for(typename GridRefManager::iterator iter=m.begin(); iter != m.end(); ++iter) - iter->getSource()->ResetAllNotifies(); - } - - template void Visit(GridRefManager &) {} - void Visit(CreatureMapType &m) { resetNotify(m);} - void Visit(PlayerMapType &m) { resetNotify(m);} -}; - -void Map::ProcessRelocationNotifies(const uint32 & diff) -{ - for(GridRefManager::iterator i = GridRefManager::begin(); i != GridRefManager::end(); ++i) - { - NGridType *grid = i->getSource(); - - if (grid->GetGridState() != GRID_STATE_ACTIVE) - continue; - - grid->getGridInfoRef()->getRelocationTimer().TUpdate(diff); - if (!grid->getGridInfoRef()->getRelocationTimer().TPassed()) - continue; - - uint32 gx = grid->getX(), gy = grid->getY(); - - CellPair cell_min(gx*MAX_NUMBER_OF_CELLS, gy*MAX_NUMBER_OF_CELLS); - CellPair cell_max(cell_min.x_coord + MAX_NUMBER_OF_CELLS, cell_min.y_coord+MAX_NUMBER_OF_CELLS); - - for (uint32 x = cell_min.x_coord; x < cell_max.x_coord; ++x) - { - for (uint32 y = cell_min.y_coord; y < cell_max.y_coord; ++y) - { - uint32 cell_id = (y * TOTAL_NUMBER_OF_CELLS_PER_MAP) + x; - if (!isCellMarked(cell_id)) - continue; - - CellPair pair(x,y); - Cell cell(pair); - cell.SetNoCreate(); - - Trinity::DelayedUnitRelocation cell_relocation(cell, pair, *this, GetVisibilityDistance()); - TypeContainerVisitor grid_object_relocation(cell_relocation); - TypeContainerVisitor world_object_relocation(cell_relocation); - Visit(cell, grid_object_relocation); - Visit(cell, world_object_relocation); - } - } - } - - ResetNotifier reset; - TypeContainerVisitor grid_notifier(reset); - TypeContainerVisitor world_notifier(reset); - - for (GridRefManager::iterator i = GridRefManager::begin(); i != GridRefManager::end(); ++i) - { - NGridType *grid = i->getSource(); - - if (grid->GetGridState() != GRID_STATE_ACTIVE) - continue; - - if (!grid->getGridInfoRef()->getRelocationTimer().TPassed()) - continue; - - grid->getGridInfoRef()->getRelocationTimer().TReset(diff, m_VisibilityNotifyPeriod); - uint32 gx = grid->getX(), gy = grid->getY(); - - CellPair cell_min(gx*MAX_NUMBER_OF_CELLS, gy*MAX_NUMBER_OF_CELLS); - CellPair cell_max(cell_min.x_coord + MAX_NUMBER_OF_CELLS, cell_min.y_coord+MAX_NUMBER_OF_CELLS); - - for (uint32 x = cell_min.x_coord; x < cell_max.x_coord; ++x) - { - for (uint32 y = cell_min.y_coord; y < cell_max.y_coord; ++y) - { - uint32 cell_id = (y * TOTAL_NUMBER_OF_CELLS_PER_MAP) + x; - if (!isCellMarked(cell_id)) - continue; - - CellPair pair(x,y); - Cell cell(pair); - cell.SetNoCreate(); - Visit(cell, grid_notifier); - Visit(cell, world_notifier); - } - } - } } void Map::SendObjectUpdates() @@ -763,11 +662,11 @@ void Map::Remove(Player *player, bool remove) NGridType *grid = getNGrid(cell.GridX(), cell.GridY()); assert(grid != NULL); - player->UpdateObjectVisibility(true); player->RemoveFromWorld(); RemoveFromGrid(player,grid,cell); SendRemoveTransports(player); + UpdateObjectVisibility(player,cell,p); if (remove) DeleteFromWorld(player); @@ -807,7 +706,8 @@ void Map::Remove(T *obj, bool remove) obj->RemoveFromWorld(); if (obj->isActiveObject()) RemoveFromActive(obj); - obj->UpdateObjectVisibility(true); + + UpdateObjectVisibility(obj,cell,p); // i think will be better to call this function while object still in grid, this changes nothing but logically is better(as for me) RemoveFromGrid(obj,grid,cell); if (remove) @@ -821,13 +721,14 @@ void Map::Remove(T *obj, bool remove) void Map::PlayerRelocation(Player *player, float x, float y, float z, float orientation) { - assert(player); + ASSERT(player); CellPair old_val = Trinity::ComputeCellPair(player->GetPositionX(), player->GetPositionY()); CellPair new_val = Trinity::ComputeCellPair(x, y); Cell old_cell(old_val); Cell new_cell(new_val); + bool same_cell = (new_cell == old_cell); player->Relocate(x, y, z, orientation); @@ -841,19 +742,28 @@ void Map::PlayerRelocation(Player *player, float x, float y, float z, float orie NGridType* oldGrid = getNGrid(old_cell.GridX(), old_cell.GridY()); RemoveFromGrid(player, oldGrid,old_cell); - if (old_cell.DiffGrid(new_cell)) + if (!old_cell.DiffGrid(new_cell)) + AddToGrid(player, oldGrid,new_cell); + else EnsureGridLoadedAtEnter(new_cell, player); NGridType* newGrid = getNGrid(new_cell.GridX(), new_cell.GridY()); - AddToGrid(player, newGrid,new_cell); + player->GetViewPoint().Event_GridChanged(&(*newGrid)(new_cell.CellX(),new_cell.CellY())); } - player->UpdateObjectVisibility(player->GetMotionMaster()->GetCurrentMovementGeneratorType() != IDLE_MOTION_TYPE); + player->OnRelocated(); + + NGridType* newGrid = getNGrid(new_cell.GridX(), new_cell.GridY()); + if (!same_cell && newGrid->GetGridState() != GRID_STATE_ACTIVE) + { + ResetGridExpiry(*newGrid, 0.1f); + newGrid->SetGridState(GRID_STATE_ACTIVE); + } } void Map::CreatureRelocation(Creature *creature, float x, float y, float z, float ang) { - assert(CheckGridIntegrity(creature,false)); + ASSERT(CheckGridIntegrity(creature,false)); Cell old_cell = creature->GetCurrentCell(); @@ -863,91 +773,50 @@ void Map::CreatureRelocation(Creature *creature, float x, float y, float z, floa // delay creature move for grid/cell to grid/cell moves if (old_cell.DiffCell(new_cell) || old_cell.DiffGrid(new_cell)) { - #ifdef TRINITY_DEBUG - if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES)==0) - sLog.outDebug("Creature (GUID: %u Entry: %u) added to moving list from grid[%u,%u]cell[%u,%u] to grid[%u,%u]cell[%u,%u].", creature->GetGUIDLow(), creature->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); - #endif - AddCreatureToMoveList(creature,x,y,z,ang); - // in diffcell/diffgrid case notifiers called at finishing move creature in Map::MoveAllCreaturesInMoveList - } - else - { - creature->Relocate(x, y, z, ang); - creature->UpdateObjectVisibility(false); - } - assert(CheckGridIntegrity(creature,true)); -} - -void Map::AddCreatureToMoveList(Creature *c, float x, float y, float z, float ang) -{ - if (!c) - return; - - i_creaturesToMove[c] = CreatureMover(x,y,z,ang); -} - -void Map::MoveAllCreaturesInMoveList() -{ - while (!i_creaturesToMove.empty()) - { - // get data and remove element; - CreatureMoveList::iterator iter = i_creaturesToMove.begin(); - Creature* c = iter->first; - CreatureMover cm = iter->second; - i_creaturesToMove.erase(iter); - - // calculate cells - CellPair new_val = Trinity::ComputeCellPair(cm.x, cm.y); - Cell new_cell(new_val); + DEBUG_LOG("Creature (GUID: %u Entry: %u) added to moving list from grid[%u,%u]cell[%u,%u] to grid[%u,%u]cell[%u,%u].", creature->GetGUIDLow(), creature->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); // do move or do move to respawn or remove creature if previous all fail - if (CreatureCellRelocation(c,new_cell)) + if (CreatureCellRelocation(creature,new_cell)) { // update pos - c->Relocate(cm.x, cm.y, cm.z, cm.ang); - //CreatureRelocationNotify(c,new_cell,new_cell.cellPair()); - c->UpdateObjectVisibility(false); + creature->Relocate(x, y, z, ang); + creature->OnRelocated(); } - else + else if (!CreatureRespawnRelocation(creature)) { - // if creature can't be move in new cell/grid (not loaded) move it to repawn cell/grid - // creature coordinates will be updated and notifiers send - if (!CreatureRespawnRelocation(c)) - { - // ... or unload (if respawn grid also not loaded) - #ifdef TRINITY_DEBUG - if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES)==0) - sLog.outDebug("Creature (GUID: %u Entry: %u) can't be move to unloaded respawn grid.",c->GetGUIDLow(),c->GetEntry()); - #endif - c->CleanupsBeforeDelete(); - AddObjectToRemoveList(c); - } + // ... or unload (if respawn grid also not loaded) + DEBUG_LOG("Creature (GUID: %u Entry: %u ) can't be move to unloaded respawn grid.",creature->GetGUIDLow(),creature->GetEntry()); } } + else + { + creature->Relocate(x, y, z, ang); + creature->OnRelocated(); + } + + ASSERT(CheckGridIntegrity(creature,true)); } bool Map::CreatureCellRelocation(Creature *c, Cell new_cell) { Cell const& old_cell = c->GetCurrentCell(); - if (!old_cell.DiffGrid(new_cell)) // in same grid + if (!old_cell.DiffGrid(new_cell) ) // in same grid { // if in same cell then none do - if (old_cell.DiffCell(new_cell)) + if(old_cell.DiffCell(new_cell)) { - #ifdef TRINITY_DEBUG - if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES)==0) - sLog.outDebug("Creature (GUID: %u Entry: %u) moved in grid[%u,%u] from cell[%u,%u] to cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.CellX(), new_cell.CellY()); - #endif + DEBUG_LOG("Creature (GUID: %u Entry: %u) moved in grid[%u,%u] from cell[%u,%u] to cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.CellX(), new_cell.CellY()); + + RemoveFromGrid(c,getNGrid(old_cell.GridX(), old_cell.GridY()),old_cell); - RemoveFromGrid(c,getNGrid(old_cell.GridX(), old_cell.GridY()),old_cell); - AddToGrid(c,getNGrid(new_cell.GridX(), new_cell.GridY()),new_cell); + NGridType* new_grid = getNGrid(new_cell.GridX(), new_cell.GridY()); + AddToGrid(c,new_grid,new_cell); + + c->GetViewPoint().Event_GridChanged( &(*new_grid)(new_cell.CellX(),new_cell.CellY()) ); } else { - #ifdef TRINITY_DEBUG - if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES)==0) - sLog.outDebug("Creature (GUID: %u Entry: %u) move in same grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY()); - #endif + DEBUG_LOG("Creature (GUID: %u Entry: %u) move in same grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY()); } return true; @@ -958,37 +827,37 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell) { EnsureGridLoadedAtEnter(new_cell); - #ifdef TRINITY_DEBUG - if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES)==0) - sLog.outDebug("Active creature (GUID: %u Entry: %u) moved from grid[%u,%u]cell[%u,%u] to grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); - #endif + DEBUG_LOG("Active creature (GUID: %u Entry: %u) moved from grid[%u,%u]cell[%u,%u] to grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); RemoveFromGrid(c,getNGrid(old_cell.GridX(), old_cell.GridY()),old_cell); - AddToGrid(c,getNGrid(new_cell.GridX(), new_cell.GridY()),new_cell); + NGridType* new_grid = getNGrid(new_cell.GridX(), new_cell.GridY()); + AddToGrid(c,new_grid,new_cell); + + c->GetViewPoint().Event_GridChanged( &(*new_grid)(new_cell.CellX(),new_cell.CellY())); return true; } // in diff. loaded grid normal creature if (loaded(GridPair(new_cell.GridX(), new_cell.GridY()))) { - #ifdef TRINITY_DEBUG - if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES)==0) - sLog.outDebug("Creature (GUID: %u Entry: %u) moved from grid[%u,%u]cell[%u,%u] to grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); - #endif + DEBUG_LOG(LOG_FILTER_CREATURE_MOVES, "Creature (GUID: %u Entry: %u) moved from grid[%u,%u]cell[%u,%u] to grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); RemoveFromGrid(c,getNGrid(old_cell.GridX(), old_cell.GridY()),old_cell); - EnsureGridCreated(GridPair(new_cell.GridX(), new_cell.GridY())); - AddToGrid(c,getNGrid(new_cell.GridX(), new_cell.GridY()),new_cell); + { + EnsureGridCreated(GridPair(new_cell.GridX(), new_cell.GridY())); + + NGridType* new_grid = getNGrid(new_cell.GridX(), new_cell.GridY()); + AddToGrid(c,new_grid,new_cell); + + c->GetViewPoint().Event_GridChanged( &(*new_grid)(new_cell.CellX(),new_cell.CellY())); + } return true; } // fail to move: normal creature attempt move to unloaded grid - #ifdef TRINITY_DEBUG - if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES)==0) - sLog.outDebug("Creature (GUID: %u Entry: %u) attempt move from grid[%u,%u]cell[%u,%u] to unloaded grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); - #endif + DEBUG_LOG("Creature (GUID: %u Entry: %u) attempt move from grid[%u,%u]cell[%u,%u] to unloaded grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); return false; } @@ -1003,18 +872,14 @@ bool Map::CreatureRespawnRelocation(Creature *c) c->CombatStop(); c->GetMotionMaster()->Clear(); - #ifdef TRINITY_DEBUG - if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES)==0) - sLog.outDebug("Creature (GUID: %u Entry: %u) will moved from grid[%u,%u]cell[%u,%u] to respawn grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), c->GetCurrentCell().GridX(), c->GetCurrentCell().GridY(), c->GetCurrentCell().CellX(), c->GetCurrentCell().CellY(), resp_cell.GridX(), resp_cell.GridY(), resp_cell.CellX(), resp_cell.CellY()); - #endif + DEBUG_LOG("Creature (GUID: %u Entry: %u) will moved from grid[%u,%u]cell[%u,%u] to respawn grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), c->GetCurrentCell().GridX(), c->GetCurrentCell().GridY(), c->GetCurrentCell().CellX(), c->GetCurrentCell().CellY(), resp_cell.GridX(), resp_cell.GridY(), resp_cell.CellX(), resp_cell.CellY()); // teleport it to respawn point (like normal respawn if player see) - if (CreatureCellRelocation(c,resp_cell)) + if(CreatureCellRelocation(c,resp_cell)) { c->Relocate(resp_x, resp_y, resp_z, resp_o); c->GetMotionMaster()->Initialize(); // prevent possible problems with default move generators - //CreatureRelocationNotify(c,resp_cell,resp_cell.cellPair()); - c->UpdateObjectVisibility(false); + c->OnRelocated(); return true; } else @@ -1036,15 +901,15 @@ bool Map::UnloadGrid(const uint32 &x, const uint32 &y, bool unloadAll) if (!unloadAll) { - // Finish creature moves, remove and delete all creatures with delayed remove before moving to respawn grids + // Finish remove and delete all creatures with delayed remove before moving to respawn grids // Must know real mob position before move - MoveAllCreaturesInMoveList(); + RemoveAllObjectsInRemoveList(); // move creatures to respawn grids if this is diff.grid or to remove list unloader.MoveToRespawnN(); - // Finish creature moves, remove and delete all creatures with delayed remove before unload - MoveAllCreaturesInMoveList(); + // Finish remove and delete all creatures with delayed remove before unload + RemoveAllObjectsInRemoveList(); } ObjectGridCleaner cleaner(*grid); @@ -1085,9 +950,6 @@ bool Map::UnloadGrid(const uint32 &x, const uint32 &y, bool unloadAll) void Map::UnloadAll() { - // clear all delayed moves, useless anyway do this moves before map unload. - i_creaturesToMove.clear(); - for (GridRefManager::iterator i = GridRefManager::begin(); i != GridRefManager::end();) { NGridType &grid(*i->getSource()); @@ -1454,20 +1316,6 @@ void Map::UpdateObjectVisibility(WorldObject* obj, Cell cell, CellPair cellpair) cell.Visit(cellpair, player_notifier, *this, *obj, GetVisibilityDistance()); } -void Map::UpdateObjectsVisibilityFor(Player* player, Cell cell, CellPair cellpair) -{ - Trinity::VisibleNotifier notifier(*player); - - cell.SetNoCreate(); - TypeContainerVisitor world_notifier(notifier); - TypeContainerVisitor grid_notifier(notifier); - cell.Visit(cellpair, world_notifier, *this, *player, GetVisibilityDistance()); - cell.Visit(cellpair, grid_notifier, *this, *player, GetVisibilityDistance()); - - // send data - notifier.SendToSelf(); -} - void Map::SendInitSelf(Player * player) { sLog.outDetail("Creating player data for himself %u", player->GetGUIDLow()); @@ -1716,47 +1564,67 @@ bool Map::ActiveObjectsNearGrid(uint32 x, uint32 y) const return false; } -void Map::AddToActive(Creature* c) +void Map::AddToActive( WorldObject* obj ) { - AddToActiveHelper(c); + m_activeNonPlayers.insert(obj); // also not allow unloading spawn grid to prevent creating creature clone at load - if (!c->isPet() && c->GetDBTableGUIDLow()) + if (obj->GetTypeId()==TYPEID_UNIT) { - float x,y,z; - c->GetRespawnCoord(x,y,z); - GridPair p = Trinity::ComputeGridPair(x, y); - if (getNGrid(p.x_coord, p.y_coord)) - getNGrid(p.x_coord, p.y_coord)->incUnloadActiveLock(); - else + Creature* c= (Creature*)obj; + if (!c->isPet() && c->GetDBTableGUIDLow()) { - GridPair p2 = Trinity::ComputeGridPair(c->GetPositionX(), c->GetPositionY()); - sLog.outError("Active creature (GUID: %u Entry: %u) added to grid[%u,%u] but spawn grid[%u,%u] not loaded.", - c->GetGUIDLow(), c->GetEntry(), p.x_coord, p.y_coord, p2.x_coord, p2.y_coord); + + float x,y,z; + c->GetRespawnCoord(x,y,z); + GridPair p = Trinity::ComputeGridPair(x, y); + if(getNGrid(p.x_coord, p.y_coord)) + getNGrid(p.x_coord, p.y_coord)->incUnloadActiveLock(); + else + { + GridPair p2 = Trinity::ComputeGridPair(c->GetPositionX(), c->GetPositionY()); + sLog.outError("Active creature (GUID: %u Entry: %u) added to grid[%u,%u] but spawn grid[%u,%u] not loaded.", + c->GetGUIDLow(), c->GetEntry(), p.x_coord, p.y_coord, p2.x_coord, p2.y_coord); + } } } } -void Map::RemoveFromActive(Creature* c) +void Map::RemoveFromActive( WorldObject* obj ) { - RemoveFromActiveHelper(c); + // Map::Update for active object in proccess + if(m_activeNonPlayersIter != m_activeNonPlayers.end()) + { + ActiveNonPlayers::iterator itr = m_activeNonPlayers.find(obj); + if(itr==m_activeNonPlayersIter) + ++m_activeNonPlayersIter; + + m_activeNonPlayers.erase(itr); + } + else + m_activeNonPlayers.erase(obj); // also allow unloading spawn grid - if (!c->isPet() && c->GetDBTableGUIDLow()) + if (obj->GetTypeId()==TYPEID_UNIT) { - float x,y,z; - c->GetRespawnCoord(x,y,z); - GridPair p = Trinity::ComputeGridPair(x, y); - if (getNGrid(p.x_coord, p.y_coord)) - getNGrid(p.x_coord, p.y_coord)->decUnloadActiveLock(); - else + Creature* c= (Creature*)obj; + if(!c->isPet() && c->GetDBTableGUIDLow()) { - GridPair p2 = Trinity::ComputeGridPair(c->GetPositionX(), c->GetPositionY()); - sLog.outError("Active creature (GUID: %u Entry: %u) removed from grid[%u,%u] but spawn grid[%u,%u] not loaded.", - c->GetGUIDLow(), c->GetEntry(), p.x_coord, p.y_coord, p2.x_coord, p2.y_coord); + float x,y,z; + c->GetRespawnCoord(x,y,z); + GridPair p = Trinity::ComputeGridPair(x, y); + if (getNGrid(p.x_coord, p.y_coord)) + getNGrid(p.x_coord, p.y_coord)->decUnloadActiveLock(); + else + { + GridPair p2 = Trinity::ComputeGridPair(c->GetPositionX(), c->GetPositionY()); + sLog.outError("Active creature (GUID: %u Entry: %u) removed from grid[%u,%u] but spawn grid[%u,%u] not loaded.", + c->GetGUIDLow(), c->GetEntry(), p.x_coord, p.y_coord, p2.x_coord, p2.y_coord); + } } } } + void Map::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, Object* target) { ///- Find the script map @@ -2560,8 +2428,6 @@ InstanceMap::InstanceMap(uint32 id, time_t expiry, uint32 InstanceId, uint8 Spaw // the timer is started by default, and stopped when the first player joins // this make sure it gets unloaded if for some reason no player joins m_unloadTimer = std::max(sWorld.getConfig(CONFIG_INSTANCE_UNLOAD_DELAY), (uint32)MIN_UNLOAD_DELAY); - - m_VisibilityNotifyPeriod = World::GetVisibilityNotifyPeriodInInstances(); } InstanceMap::~InstanceMap() @@ -2637,7 +2503,7 @@ bool InstanceMap::Add(Player *player) // Is it needed? { - Guard guard(*this); + //Guard guard(*this); if (!CanEnter(player)) return false; @@ -2911,8 +2777,6 @@ BattleGroundMap::BattleGroundMap(uint32 id, time_t expiry, uint32 InstanceId, Ba { m_bg = bg; BattleGroundMap::InitVisibilityDistance(); - - m_VisibilityNotifyPeriod = World::GetVisibilityNotifyPeriodInBGArenas(); } BattleGroundMap::~BattleGroundMap() @@ -2956,7 +2820,7 @@ void BattleGroundMap::Update(const uint32& t_diff) bool BattleGroundMap::Add(Player * player) { { - Guard guard(*this); + //Guard guard(*this); if (!CanEnter(player)) return false; // reset instance validity, battleground maps do not homebind diff --git a/src/game/Map.h b/src/game/Map.h index bbc47d034..9eca616b5 100755 --- a/src/game/Map.h +++ b/src/game/Map.h @@ -123,6 +123,8 @@ enum GetCreatureGuidType class TRINITY_DLL_SPEC Map : public GridRefManager, public Trinity::ObjectLevelLockable { friend class MapReference; + friend class ObjectGridLoader; + friend class ObjectWorldLoader; public: Map(uint32 id, time_t, uint32 InstanceId, uint8 SpawnMode); virtual ~Map(); @@ -230,7 +232,6 @@ class TRINITY_DLL_SPEC Map : public GridRefManager, public Trinity::O return GetZoneId(GetAreaFlag(x,y,z),i_id); } - void MoveAllCreaturesInMoveList(); void RemoveAllObjectsInRemoveList(); bool CreatureRespawnRelocation(Creature *c); // used only in MoveAllCreaturesInMoveList and ObjectGridUnloader @@ -261,7 +262,6 @@ class TRINITY_DLL_SPEC Map : public GridRefManager, public Trinity::O void UpdateObjectVisibility(WorldObject* obj, Cell cell, CellPair cellpair); void UpdatePlayerVisibility( Player* player, Cell cell, CellPair cellpair ); - void UpdateObjectsVisibilityFor(Player* player, Cell cell, CellPair cellpair ); void resetMarkedCells() { marked_cells.reset(); } bool isCellMarked(uint32 pCellId) { return marked_cells.test(pCellId); } @@ -277,20 +277,14 @@ class TRINITY_DLL_SPEC Map : public GridRefManager, public Trinity::O PlayerList const& GetPlayers() const { return m_mapRefManager; } // must called with AddToWorld - template - void AddToActive(T* obj) { AddToActiveHelper(obj); } - - void AddToActive(Creature* obj); + void AddToActive(WorldObject* obj); //per-map script storage void ScriptsStart(std::map > const& scripts, uint32 id, Object* source, Object* target); void ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* source, Object* target); // must called with RemoveFromWorld - template - void RemoveFromActive(T* obj) { RemoveFromActiveHelper(obj); } - - void RemoveFromActive(Creature* obj); + void RemoveFromActive(WorldObject* obj); template void SwitchGridContainers(T* obj, bool active); @@ -359,9 +353,6 @@ class TRINITY_DLL_SPEC Map : public GridRefManager, public Trinity::O bool CreatureCellRelocation(Creature *creature, Cell new_cell); - void AddCreatureToMoveList(Creature *c, float x, float y, float z, float ang); - CreatureMoveList i_creaturesToMove; - bool loaded(const GridPair &) const; void EnsureGridCreated(const GridPair &); bool EnsureGridLoaded(Cell const&); @@ -408,8 +399,6 @@ class TRINITY_DLL_SPEC Map : public GridRefManager, public Trinity::O MapRefManager m_mapRefManager; MapRefManager::iterator m_mapRefIter; - int32 m_VisibilityNotifyPeriod; - typedef std::set ActiveNonPlayers; ActiveNonPlayers m_activeNonPlayers; ActiveNonPlayers::iterator m_activeNonPlayersIter; @@ -421,7 +410,7 @@ class TRINITY_DLL_SPEC Map : public GridRefManager, public Trinity::O //these functions used to process player/mob aggro reactions and //visibility calculations. Highly optimized for massive calculations - void ProcessRelocationNotifies(const uint32 &diff); + void PlayerRelocationNotify(Player* player, Cell cell, CellPair cellpair); time_t i_gridExpiry; @@ -440,29 +429,6 @@ class TRINITY_DLL_SPEC Map : public GridRefManager, public Trinity::O template void DeleteFromWorld(T*); - - template - void AddToActiveHelper(T* obj) - { - m_activeNonPlayers.insert(obj); - } - - template - void RemoveFromActiveHelper(T* obj) - { - // Map::Update for active object in proccess - if (m_activeNonPlayersIter != m_activeNonPlayers.end()) - { - ActiveNonPlayers::iterator itr = m_activeNonPlayers.find(obj); - if (itr == m_activeNonPlayers.end()) - return; - if (itr==m_activeNonPlayersIter) - ++m_activeNonPlayersIter; - m_activeNonPlayers.erase(itr); - } - else - m_activeNonPlayers.erase(obj); - } }; enum InstanceResetMethod diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index 35b038b22..eb860a56b 100755 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -1403,19 +1403,15 @@ void WorldSession::HandleFarSightOpcode(WorldPacket & recv_data) uint8 apply; recv_data >> apply; - CellPair pair; - switch (apply) { case 0: - _player->SetFarsightVision(false); - pair = Trinity::ComputeCellPair(_player->GetPositionX(), _player->GetPositionY()); + _player->GetCamera().ResetView(false); sLog.outDebug("Player %u set vision to himself", _player->GetGUIDLow()); break; case 1: - _player->SetFarsightVision(true); if (WorldObject* obj = _player->GetFarsightTarget()) - pair = Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY()); + _player->GetCamera().SetView(obj, false); else return; sLog.outDebug("Added FarSight " I64FMT " to player %u", _player->GetFarSight(), _player->GetGUIDLow()); @@ -1424,8 +1420,6 @@ void WorldSession::HandleFarSightOpcode(WorldPacket & recv_data) sLog.outDebug("Unhandled mode in CMSG_FAR_SIGHT: %u", apply); return; } - - GetPlayer()->UpdateVisibilityForPlayer(); } void WorldSession::HandleChooseTitleOpcode(WorldPacket & recv_data) diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp index c8b53dfb6..c59282f36 100755 --- a/src/game/MovementHandler.cpp +++ b/src/game/MovementHandler.cpp @@ -178,178 +178,146 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data) void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data) { - /* extract packet */ + uint32 opcode = recv_data.GetOpcode(); - MovementInfo movementInfo; - recv_data >> movementInfo; + Unit *mover = _player->GetMover(); + Player *plMover = mover->GetTypeId() == TYPEID_PLAYER ? (Player*)mover : NULL; - /*----------------*/ - - if (recv_data.size() != recv_data.rpos()) + // ignore, waiting processing in WorldSession::HandleMoveWorldportAckOpcode and WorldSession::HandleMoveTeleportAck + if(plMover && plMover->IsBeingTeleported()) { - sLog.outError("MovementHandler: player %s (guid %d, account %u) sent a packet (opcode %u) that is %u bytes larger than it should be. Kicked as cheater.", _player->GetName(), _player->GetGUIDLow(), _player->GetSession()->GetAccountId(), recv_data.GetOpcode(), recv_data.size() - recv_data.rpos()); - KickPlayer(); + recv_data.rpos(recv_data.wpos()); // prevent warnings spam return; } + /* extract packet */ - if (!Trinity::IsValidMapCoord(movementInfo.GetPos()->x, movementInfo.GetPos()->y, movementInfo.GetPos()->z, movementInfo.GetPos()->o)) - return; + MovementInfo movementInfo; + recv_data >> movementInfo; - Player * pPlayer = GetPlayer(); + /*----------------*/ - // Handle possessed unit movement separately - Unit* pos_unit = pPlayer->GetCharm(); - if (pos_unit && pos_unit->isPossessed()) // can be charmed but not possessed + if (!Trinity::IsValidMapCoord(movementInfo.GetPos()->x, movementInfo.GetPos()->y, movementInfo.GetPos()->z, movementInfo.GetPos()->o)) { - HandlePossessedMovement(recv_data, movementInfo); - return; - } - - if (pPlayer->GetDontMove() || pPlayer->isCharmed()) + recv_data.rpos(recv_data.wpos()); // prevent warnings spam return; - - MovementInfo oldMovementInfo = pPlayer->m_movementInfo; - - // No fall damage cheat - if (oldMovementInfo.GetMovementFlags() & (MOVEFLAG_FALLING | MOVEFLAG_FALLINGFAR)) - { - if (oldMovementInfo.GetFallTime() == 357) - { - pPlayer->m_AC_NoFall_count ++; - // falltime = 357 <--- WEH No Fall Damage Cheat - sLog.outCheat("Player %s (GUID: %u / ACCOUNT_ID: %u) - possible no fall damage cheat. MapId: %u, falltime: %u, coords old: %f, %f, %f,coords new: %f, %f, %f. MOVEMENTFLAGS: %u LATENCY: %u. BG/Arena: %s", - pPlayer->GetName(), pPlayer->GetGUIDLow(), pPlayer->GetSession()->GetAccountId(), pPlayer->GetMapId(), oldMovementInfo.GetFallTime(), oldMovementInfo.pos.x, oldMovementInfo.pos.y, oldMovementInfo.pos.z, movementInfo.pos.x, movementInfo.pos.y, movementInfo.pos.z, movementInfo.pos.z, movementInfo.GetMovementFlags(), m_latency, pPlayer->GetMap() ? (pPlayer->GetMap()->IsBattleGroundOrArena() ? "Yes" : "No") : "No"); - - //pPlayer->Kill(pPlayer, true); - if (!(pPlayer->m_AC_NoFall_count % 5)) - sWorld.SendGMText(LANG_ANTICHEAT_NOFALLDMG, pPlayer->GetName(), pPlayer->m_AC_NoFall_count); - } } -/* - // TP cheat - UnitMoveType m_type = pPlayer->IsFlying() ? MOVE_FLIGHT : pPlayer->IsUnderWater() ? MOVE_SWIM : MOVE_RUN; - - float m_speedRate = pPlayer->GetSpeedRate(m_type); - float m_lastSpeedRate = pPlayer->GetLastSpeedRate(); - float m_speed = pPlayer->GetSpeed(m_type); - - if (!pPlayer->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_TAXI_FLIGHT) && pPlayer->m_taxi.empty() && m_speedRate == m_speed) + if (plMover) { - Position m_pos = oldMovementInfo.pos; - float dx = movementInfo.pos.x - m_pos.x; - float dy = movementInfo.pos.y - m_pos.y; - float dz = movementInfo.pos.z - m_pos.z; - float fDistance3d = sqrt(dx*dx + dy*dy + dz*dz); - - // time between packets - uint32 uiDiffTime = WorldTimer::getMSTimeDiff(oldMovementInfo.time, movementInfo.time); - - float fClientRate = (fDistance3d * 1000 / uiDiffTime) / m_speed; - float fServerRate = m_speed * uiDiffTime / 1000 +1.0f; + MovementInfo oldMovementInfo = plMover->m_movementInfo; - if (fDistance3d > 500.0f && fClientRate > fServerRate*4 && m_speed +0.2 < m_speed*fClientRate) + // No fall damage cheat + if (oldMovementInfo.GetMovementFlags() & (MOVEFLAG_FALLING | MOVEFLAG_FALLINGFAR)) { - pPlayer->m_AC_count++; - pPlayer->m_AC_timer = IN_MILISECONDS; // 1 sek - - sWorld.SendGMText(LANG_ANTICHEAT, pPlayer->GetName(), pPlayer->m_AC_count, m_speed, m_speed*fClientRate); - - sLog.outCheat("Player %s (GUID: %u / ACCOUNT_ID: %u) moved for distance %f with server speed : %f (client speed: %f). MapID: %u, player's coord before X:%f Y:%f Z:%f. Player's coord now X:%f Y:%f Z:%f. MOVEMENTFLAGS: %u LATENCY: %u. BG/Arena: %s", - pPlayer->GetName(), pPlayer->GetGUIDLow(), pPlayer->GetSession()->GetAccountId(), fDistance3d, m_speed, m_speed*fClientRate, pPlayer->GetMapId(), m_pos.x, m_pos.y, m_pos.z, movementInfo.pos.x, movementInfo.pos.y, movementInfo.pos.z, movementInfo.GetMovementFlags(), m_latency, pPlayer->GetMap() ? (pPlayer->GetMap()->IsBattleGroundOrArena() ? "Yes" : "No") : "No"); - pPlayer->Relocate(oldMovementInfo.pos); + if (oldMovementInfo.GetFallTime() == 357) + { + plMover->AC.IncrementNoFallCount(); + // falltime = 357 <--- WEH No Fall Damage Cheat + sLog.outCheat("Player %s (GUID: %u / ACCOUNT_ID: %u) - possible no fall damage cheat. MapId: %u, falltime: %u, coords old: %f, %f, %f,coords new: %f, %f, %f. MOVEMENTFLAGS: %u LATENCY: %u. BG/Arena: %s", + plMover->GetName(), plMover->GetGUIDLow(), plMover->GetSession()->GetAccountId(), plMover->GetMapId(), oldMovementInfo.GetFallTime(), oldMovementInfo.pos.x, oldMovementInfo.pos.y, oldMovementInfo.pos.z, movementInfo.pos.x, movementInfo.pos.y, movementInfo.pos.z, movementInfo.pos.z, movementInfo.GetMovementFlags(), m_latency, plMover->GetMap() ? (plMover->GetMap()->IsBattleGroundOrArena() ? "Yes" : "No") : "No"); + + //pPlayer->Kill(pPlayer, true); + if (!(plMover->AC.GetNoFallCount() % 5)) + sWorld.SendGMText(LANG_ANTICHEAT_NOFALLDMG, plMover->GetName(), plMover->AC.GetNoFallCount()); + } } - } -*/ - - //Save movement flags - pPlayer->SetUnitMovementFlags(movementInfo.GetMovementFlags()); - - /* handle special cases */ - if (movementInfo.HasMovementFlag(MOVEFLAG_ONTRANSPORT)) - { - // transports size limited - // (also received at zeppelin leave by some reason with t_* as absolute in continent coordinates, can be safely skipped) - if (movementInfo.GetTransportPos()->x > 50 || movementInfo.GetTransportPos()->y > 50 || movementInfo.GetTransportPos()->z > 50) - return; - if (!Trinity::IsValidMapCoord( - movementInfo.GetPos()->x + movementInfo.GetTransportPos()->x, - movementInfo.GetPos()->y + movementInfo.GetTransportPos()->y, - movementInfo.GetPos()->z + movementInfo.GetTransportPos()->z, - movementInfo.GetPos()->o + movementInfo.GetTransportPos()->o - )) - return; + plMover->SetUnitMovementFlags(movementInfo.GetMovementFlags()); - // if we boarded a transport, add us to it - if (!pPlayer->m_transport) + /* handle special cases */ + if (movementInfo.HasMovementFlag(MOVEFLAG_ONTRANSPORT)) { - // elevators also cause the client to send MOVEFLAG_ONTRANSPORT - just unmount if the guid can be found in the transport list - for (MapManager::TransportSet::iterator iter = sMapMgr.m_Transports.begin(); iter != sMapMgr.m_Transports.end(); ++iter) + // transports size limited + // (also received at zeppelin leave by some reason with t_* as absolute in continent coordinates, can be safely skipped) + if (movementInfo.GetTransportPos()->x > 50 || movementInfo.GetTransportPos()->y > 50 || movementInfo.GetTransportPos()->z > 50) + return; + + if (!Trinity::IsValidMapCoord( + movementInfo.GetPos()->x + movementInfo.GetTransportPos()->x, + movementInfo.GetPos()->y + movementInfo.GetTransportPos()->y, + movementInfo.GetPos()->z + movementInfo.GetTransportPos()->z, + movementInfo.GetPos()->o + movementInfo.GetTransportPos()->o + )) + return; + + // if we boarded a transport, add us to it + if (!plMover->m_transport) { - if ((*iter)->GetGUID() == movementInfo.t_guid) + // elevators also cause the client to send MOVEFLAG_ONTRANSPORT - just unmount if the guid can be found in the transport list + for (MapManager::TransportSet::iterator iter = sMapMgr.m_Transports.begin(); iter != sMapMgr.m_Transports.end(); ++iter) { - // unmount before boarding - pPlayer->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED); - - pPlayer->m_transport = (*iter); - (*iter)->AddPassenger(pPlayer); - break; + if ((*iter)->GetGUID() == movementInfo.t_guid) + { + // unmount before boarding + plMover->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED); + + plMover->m_transport = (*iter); + (*iter)->AddPassenger(plMover); + break; + } } } } - } - else if (pPlayer->m_transport) // if we were on a transport, leave - { - pPlayer->m_transport->RemovePassenger(pPlayer); - pPlayer->m_transport = NULL; - movementInfo.ClearTransportData(); - } + else if (plMover->m_transport) // if we were on a transport, leave + { + plMover->m_transport->RemovePassenger(plMover); + plMover->m_transport = NULL; + movementInfo.ClearTransportData(); + } - // fall damage generation (ignore in flight case that can be triggered also at lags in moment teleportation to another map). - if (recv_data.GetOpcode() == MSG_MOVE_FALL_LAND && !pPlayer->isInFlight()) - pPlayer->HandleFallDamage(movementInfo); + // fall damage generation (ignore in flight case that can be triggered also at lags in moment teleportation to another map). + if (opcode == MSG_MOVE_FALL_LAND && !plMover->isInFlight()) + plMover->HandleFallDamage(movementInfo); - if (movementInfo.HasMovementFlag(MOVEFLAG_SWIMMING) != pPlayer->IsInWater()) - { - // now client not include swimming flag in case jumping under water - pPlayer->SetInWater(!pPlayer->IsInWater() || pPlayer->GetBaseMap()->IsUnderWater(movementInfo.GetPos()->x, movementInfo.GetPos()->y, movementInfo.GetPos()->z)); - } + if (movementInfo.HasMovementFlag(MOVEFLAG_SWIMMING) != plMover->IsInWater()) + { + // now client not include swimming flag in case jumping under water + plMover->SetInWater(!plMover->IsInWater() || plMover->GetBaseMap()->IsUnderWater(movementInfo.GetPos()->x, movementInfo.GetPos()->y, movementInfo.GetPos()->z)); + } - if (sWorld.m_ac.activated() && !pPlayer->hasUnitState(UNIT_STAT_LOST_CONTROL | UNIT_STAT_NOT_MOVE) && !pPlayer->isGameMaster() && pPlayer->m_AC_timer == 0 && recv_data.GetOpcode() != MSG_MOVE_SET_FACING) - sWorld.m_ac.execute(new ACRequest(pPlayer, GetLatency(), pPlayer->m_movementInfo, movementInfo, pPlayer->GetLastSpeedRate())); + if (sWorld.m_ac.activated() && !plMover->hasUnitState(UNIT_STAT_LOST_CONTROL | UNIT_STAT_NOT_MOVE) && !plMover->isGameMaster() && plMover->AC.GetTimer() == 0 && opcode != MSG_MOVE_SET_FACING) + sWorld.m_ac.execute(new ACRequest(plMover, GetLatency(), plMover->m_movementInfo, movementInfo, plMover->AC.GetLastSpeedRate())); - /*----------------------*/ - uint8 uiMoveType = 0; + /*----------------------*/ + uint8 uiMoveType = 0; - if (pPlayer->IsFlying()) - uiMoveType = MOVE_FLIGHT; - else if (pPlayer->IsUnderWater()) - uiMoveType = MOVE_SWIM; - else - uiMoveType = MOVE_RUN; + if (plMover->IsFlying()) + uiMoveType = MOVE_FLIGHT; + else if (plMover->IsUnderWater()) + uiMoveType = MOVE_SWIM; + else + uiMoveType = MOVE_RUN; - pPlayer->SetLastSpeedRate(pPlayer->GetSpeedRate(UnitMoveType(uiMoveType))); + plMover->AC.SetLastSpeedRate(plMover->GetSpeedRate(UnitMoveType(uiMoveType))); + } /* process position-change */ recv_data.put(5, WorldTimer::getMSTime()); // offset flags(4) + unk(1) - WorldPacket data(recv_data.GetOpcode(), (pPlayer->GetPackGUID().size()+recv_data.size())); - data << pPlayer->GetPackGUID(); + WorldPacket data(recv_data.GetOpcode(), (mover->GetPackGUID().size()+recv_data.size())); + data << mover->GetPackGUID(); data.append(recv_data.contents(), recv_data.size()); - pPlayer->SendMessageToSet(&data, false); + mover->SendMessageToSetExcept(&data, _player); - pPlayer->SetPosition(movementInfo.GetPos()->x, movementInfo.GetPos()->y, movementInfo.GetPos()->z, movementInfo.GetPos()->o); - pPlayer->m_movementInfo = movementInfo; - pPlayer->UpdateFallInformationIfNeed(movementInfo, recv_data.GetOpcode()); + if (plMover) + { + plMover->SetPosition(movementInfo.GetPos()->x, movementInfo.GetPos()->y, movementInfo.GetPos()->z, movementInfo.GetPos()->o); + plMover->m_movementInfo = movementInfo; + plMover->UpdateFallInformationIfNeed(movementInfo, recv_data.GetOpcode()); - if (pPlayer->isMoving()) - pPlayer->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MOVE | AURA_INTERRUPT_FLAG_NOT_SEATED); + if (plMover->isMoving()) + plMover->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MOVE | AURA_INTERRUPT_FLAG_NOT_SEATED); - if (pPlayer->isTurning()) - pPlayer->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TURNING | AURA_INTERRUPT_FLAG_NOT_SEATED); + if (plMover->isTurning()) + plMover->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TURNING | AURA_INTERRUPT_FLAG_NOT_SEATED); - if (movementInfo.GetPos()->z < -500.0f) - pPlayer->HandleFallUnderMap(); + if (movementInfo.GetPos()->z < -500.0f) + plMover->HandleFallUnderMap(); + } + else + { + if(mover->IsInWorld()) + mover->GetMap()->CreatureRelocation((Creature*)mover, movementInfo.GetPos()->x, movementInfo.GetPos()->y, movementInfo.GetPos()->z, movementInfo.GetPos()->o); + } } void WorldSession::HandlePossessedMovement(WorldPacket& recv_data, MovementInfo& movementInfo) diff --git a/src/game/NPCHandler.cpp b/src/game/NPCHandler.cpp index d8a6eb67f..c9b2d3b48 100755 --- a/src/game/NPCHandler.cpp +++ b/src/game/NPCHandler.cpp @@ -400,11 +400,17 @@ void WorldSession::SendSpiritResurrect() _player->TeleportTo(corpseGrave->map_id, corpseGrave->x, corpseGrave->y, corpseGrave->z, _player->GetOrientation()); // or update at original position else + { + _player->GetCamera().UpdateVisibilityForOwner(); _player->UpdateObjectVisibility(); + } } // or update at original position else + { + _player->GetCamera().UpdateVisibilityForOwner(); _player->UpdateObjectVisibility(); + } _player->SaveToDB(); } diff --git a/src/game/Object.cpp b/src/game/Object.cpp index bcda2f161..6a8d750a1 100755 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -288,7 +288,9 @@ void Object::BuildMovementUpdate(ByteBuffer * data, uint8 updateFlags) const if (((Player*)this)->isInFlight()) { - WPAssert(((Player*)this)->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE); + if (((Player*)this)->GetMotionMaster()->GetCurrentMovementGeneratorType() != FLIGHT_MOTION_TYPE) + break; + moveFlags = (MOVEFLAG_FORWARD | MOVEFLAG_SPLINE_ENABLED); } } @@ -717,7 +719,6 @@ void Object::ClearUpdateMask(bool remove) } } - bool Object::LoadValues(const char* data) { if (!m_uint32Values) _InitValues(); @@ -1036,7 +1037,7 @@ WorldObject::WorldObject() m_positionX(0.0f), m_positionY(0.0f), m_positionZ(0.0f), m_orientation(0.0f) , m_map(NULL), m_zoneScript(NULL) , m_isActive(false), IsTempWorldObject(false) - , m_name(""), m_notifyflags(0), m_executed_notifies(0) + , m_name("") { m_groupLootTimer = 0; @@ -1346,6 +1347,11 @@ bool WorldObject::HasInArc(const float arcangle, const WorldObject* obj) const return ((angle >= lborder) && (angle <= rborder)); } +bool WorldObject::isInFrontInMap(WorldObject const* target, float distance, float arc) const +{ + return IsWithinDistInMap(target, distance) && HasInArc(arc, target); +} + void WorldObject::GetRandomPoint(float x, float y, float z, float distance, float &rand_x, float &rand_y, float &rand_z) const { if (distance==0) @@ -1655,7 +1661,11 @@ void WorldObject::SendMessageToSetInRange(WorldPacket *data, float dist, bool /* { GetMap()->MessageDistBroadcast(this, data, dist, bToPossessor); } - +void WorldObject::SendMessageToSetExcept(WorldPacket *data, Player const* skipped_receiver) +{ + Trinity::MessageDelivererExcept notifier(data, skipped_receiver); + Cell::VisitWorldObjects(this, notifier, GetMap()->GetVisibilityDistance()); +} void WorldObject::SendObjectDeSpawnAnim(uint64 guid) { WorldPacket data(SMSG_GAMEOBJECT_DESPAWN_ANIM, 8); @@ -2144,11 +2154,12 @@ void WorldObject::GetGroundPoint(float &x, float &y, float &z, float dist, float UpdateGroundPositionZ(x, y, z); } -void WorldObject::UpdateObjectVisibility(bool /*forced*/) +void WorldObject::UpdateObjectVisibility() { - //updates object's visibility for nearby players - Trinity::VisibleChangesNotifier notifier(*this); - Cell::VisitWorldObjects(this, notifier, GetMap()->GetVisibilityDistance()); + CellPair p = Trinity::ComputeCellPair(GetPositionX(), GetPositionY()); + Cell cell(p); + + GetMap()->UpdateObjectVisibility(this, cell, p); } void WorldObject::AddToClientUpdateList() @@ -2165,55 +2176,21 @@ struct WorldObjectChangeAccumulator { UpdateDataMapType &i_updateDatas; WorldObject &i_object; - std::set plr_list; - WorldObjectChangeAccumulator(WorldObject &obj, UpdateDataMapType &d) : i_updateDatas(d), i_object(obj) {} - void Visit(PlayerMapType &m) + WorldObjectChangeAccumulator(WorldObject &obj, UpdateDataMapType &d) : i_updateDatas(d), i_object(obj) { - for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter) - { - BuildPacket(iter->getSource()); - if (!iter->getSource()->GetSharedVisionList().empty()) - { - SharedVisionList::const_iterator it = iter->getSource()->GetSharedVisionList().begin(); - for (; it != iter->getSource()->GetSharedVisionList().end(); ++it) - BuildPacket(*it); - } - } + // send self fields changes in another way, otherwise + // with new camera system when player's camera too far from player, camera wouldn't receive packets and changes from player + if(i_object.isType(TYPEMASK_PLAYER)) + i_object.BuildFieldsUpdate((Player*)&i_object, i_updateDatas); } - void Visit(CreatureMapType &m) - { - for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter) - { - if (!iter->getSource()->GetSharedVisionList().empty()) - { - SharedVisionList::const_iterator it = iter->getSource()->GetSharedVisionList().begin(); - for (; it != iter->getSource()->GetSharedVisionList().end(); ++it) - BuildPacket(*it); - } - } - } - void Visit(DynamicObjectMapType &m) - { - for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter) - { - uint64 guid = iter->getSource()->GetCasterGUID(); - if (IS_PLAYER_GUID(guid)) - { - //Caster may be NULL if DynObj is in removelist - if (Player *caster = ObjectAccessor::FindPlayer(guid)) - if (caster->GetUInt64Value(PLAYER_FARSIGHT) == iter->getSource()->GetGUID()) - BuildPacket(caster); - } - } - } - void BuildPacket(Player* plr) + void Visit(CameraMapType &m) { - // Only send update once to a player - if (plr_list.find(plr->GetGUID()) == plr_list.end() && plr->HaveAtClient(&i_object)) + for(CameraMapType::iterator iter = m.begin(); iter != m.end(); ++iter) { - i_object.BuildFieldsUpdate(plr, i_updateDatas); - plr_list.insert(plr->GetGUID()); + Player* owner = iter->getSource()->GetOwner(); + if(owner != &i_object && owner->HaveAtClient(&i_object)) + i_object.BuildFieldsUpdate(owner, i_updateDatas); } } diff --git a/src/game/Object.h b/src/game/Object.h index 70acc8501..f8502d208 100755 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -25,10 +25,10 @@ #include "ByteBuffer.h" #include "UpdateFields.h" #include "UpdateData.h" -#include "GameSystem/GridReference.h" #include "ObjectGuid.h" #include "GridDefines.h" #include "Map.h" +#include "Camera.h" #include #include @@ -529,8 +529,11 @@ class TRINITY_DLL_SPEC WorldObject : public Object, public WorldLocation float GetAngle(const float x, const float y) const; bool HasInArc(const float arcangle, const WorldObject* obj) const; + bool isInFrontInMap(WorldObject const* target,float distance, float arc = M_PI) const; + virtual void SendMessageToSet(WorldPacket *data, bool self, bool to_possessor = true); virtual void SendMessageToSetInRange(WorldPacket *data, float dist, bool self, bool to_possessor = true); + void SendMessageToSetExcept(WorldPacket *data, Player const* skipped_receiver); bool IsBeingTeleported() { return mSemaphoreTeleport; } void SetSemaphoreTeleport(bool semphsetting) { mSemaphoreTeleport = semphsetting; } @@ -553,23 +556,14 @@ class TRINITY_DLL_SPEC WorldObject : public Object, public WorldLocation virtual void SaveRespawnTime() {} void AddObjectToRemoveList(); - virtual void UpdateObjectVisibility(bool forced = true); + void UpdateObjectVisibility(); void BuildUpdate(UpdateDataMapType&); - //new relocation and visibility system functions - void AddToNotify(uint16 f) { m_notifyflags |= f;} - bool isNeedNotify(uint16 f) const { return m_notifyflags & f;} - - uint16 GetNotifyFlags() const { return m_notifyflags; } - bool NotifyExecuted(uint16 f) const { return m_executed_notifies & f;} - void SetNotified(uint16 f) { m_executed_notifies |= f;} - void ResetAllNotifies() { m_notifyflags = 0; m_executed_notifies = 0; } - // main visibility check function in normal case (ignore grey zone distance check) - bool isVisiblefor (Player const* u) const { return isVisibleForInState(u,false); } + bool isVisibleFor(Player const* u, WorldObject const* viewPoint) const { return isVisibleForInState(u,viewPoint,false); } // low level function for visibility change code, must be define in all main world object subclasses - virtual bool isVisibleForInState(Player const* u, bool inVisibleList) const = 0; + virtual bool isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList) const = 0; // Low Level Packets void SendPlaySound(uint32 Sound, bool OnlySelf); @@ -597,6 +591,8 @@ class TRINITY_DLL_SPEC WorldObject : public Object, public WorldLocation uint32 m_groupLootTimer; // (msecs)timer used for group loot uint64 lootingGroupLeaderGUID; // used to find group which is looting corpse + ViewPoint& GetViewPoint() { return m_viewPoint; } + protected: explicit WorldObject(); std::string m_name; @@ -617,8 +613,7 @@ class TRINITY_DLL_SPEC WorldObject : public Object, public WorldLocation float m_positionZ; float m_orientation; - uint16 m_notifyflags; - uint16 m_executed_notifies; + ViewPoint m_viewPoint; bool mSemaphoreTeleport; WorldUpdateCounter m_updateTracker; diff --git a/src/game/ObjectGridLoader.cpp b/src/game/ObjectGridLoader.cpp index 2f5c260dd..b1187a0bf 100755 --- a/src/game/ObjectGridLoader.cpp +++ b/src/game/ObjectGridLoader.cpp @@ -109,7 +109,7 @@ template<> void addUnitState(Creature *obj, CellPair const& cell_pair) } template -void LoadHelper(CellGuidSet const& guid_set, CellPair &cell, GridRefManager &m, uint32 &count, Map* map) +void LoadHelper(CellGuidSet const& guid_set, CellPair &cell, GridRefManager &m, uint32 &count, Map* map, GridType& grid) { for (CellGuidSet::const_iterator i_guid = guid_set.begin(); i_guid != guid_set.end(); ++i_guid) { @@ -122,19 +122,21 @@ void LoadHelper(CellGuidSet const& guid_set, CellPair &cell, GridRefManager & continue; } - obj->GetGridRef().link(&m, obj); + grid.AddGridObject(obj); addUnitState(obj,cell); obj->AddToWorld(); if (obj->isActiveObject()) map->AddToActive(obj); + obj->GetViewPoint().Event_AddedToWorld(&grid); + ++count; } } -void LoadHelper(CellCorpseSet const& cell_corpses, CellPair &cell, CorpseMapType &m, uint32 &count, Map* map) +void LoadHelper(CellCorpseSet const& cell_corpses, CellPair &cell, CorpseMapType &m, uint32 &count, Map* map, GridType& grid) { if (cell_corpses.empty()) return; @@ -150,7 +152,7 @@ void LoadHelper(CellCorpseSet const& cell_corpses, CellPair &cell, CorpseMapType if (!obj) continue; - obj->GetGridRef().link(&m, obj); + grid.AddWorldObject(obj); addUnitState(obj,cell); obj->AddToWorld(); @@ -171,7 +173,8 @@ ObjectGridLoader::Visit(GameObjectMapType &m) CellObjectGuids const& cell_guids = objmgr.GetCellObjectGuids(i_map->GetId(), i_map->GetSpawnMode(), cell_id); - LoadHelper(cell_guids.gameobjects, cell_pair, m, i_gameObjects, i_map); + GridType& grid = (*i_map->getNGrid(i_cell.GridX(),i_cell.GridY())) (i_cell.CellX(),i_cell.CellY()); + LoadHelper(cell_guids.gameobjects, cell_pair, m, i_gameObjects, i_map, grid); } void @@ -184,7 +187,8 @@ ObjectGridLoader::Visit(CreatureMapType &m) CellObjectGuids const& cell_guids = objmgr.GetCellObjectGuids(i_map->GetId(), i_map->GetSpawnMode(), cell_id); - LoadHelper(cell_guids.creatures, cell_pair, m, i_creatures, i_map); + GridType& grid = (*i_map->getNGrid(i_cell.GridX(),i_cell.GridY())) (i_cell.CellX(),i_cell.CellY()); + LoadHelper(cell_guids.creatures, cell_pair, m, i_creatures, i_map, grid); } void @@ -197,7 +201,8 @@ ObjectWorldLoader::Visit(CorpseMapType &m) // corpses are always added to spawn mode 0 and they are spawned by their instance id CellObjectGuids const& cell_guids = objmgr.GetCellObjectGuids(i_map->GetId(), 0, cell_id); - LoadHelper(cell_guids.corpses, cell_pair, m, i_corpses, i_map); + GridType& grid = (*i_map->getNGrid(i_cell.GridX(),i_cell.GridY())) (i_cell.CellX(),i_cell.CellY()); + LoadHelper(cell_guids.corpses, cell_pair, m, i_corpses, i_map, grid); } void diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 0fb18f066..2fc96276d 100755 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -255,14 +255,10 @@ const int32 Player::ReputationRank_Length[MAX_REPUTATION_RANK] = {36000, 3000, 3 UpdateMask Player::updateVisualBits; -Player::Player (WorldSession *session): Unit() +Player::Player (WorldSession *session): Unit(), m_mover(this), m_camera(this) { m_transport = 0; - m_AC_timer = 0; - m_AC_count = 0; - m_AC_NoFall_count = 0; - m_speakTime = 0; m_speakCount = 0; @@ -1150,12 +1146,14 @@ void Player::Update(uint32 update_diff, uint32 p_time) return; } - if (m_AC_timer) + if (uint32 ac_timer = AC.GetTimer()) { - if (m_AC_timer < update_diff) - m_AC_timer = 0; + if (ac_timer < update_diff) + ac_timer = 0; else - m_AC_timer -= update_diff; + ac_timer -= update_diff; + + AC.SetTimer(ac_timer); } // undelivered mail @@ -1708,7 +1706,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati SetSemaphoreTeleport(true); - m_AC_timer = 3000; + AC.SetTimer(3*IN_MILISECONDS); // The player was ported to another map and looses the duel immediatly. // We have to perform this check before the teleport, otherwise the @@ -2276,6 +2274,12 @@ void Player::SetInWater(bool apply) void Player::SetGameMaster(bool on) { + if (GetVisibility() == VISIBILITY_OFF && !on) + { + ChatHandler(this).PSendSysMessage("You can't set GM OFF, beacause currently you have INVISIBILITY_OFF"); + return; + } + if (on) { m_ExtraFlags |= PLAYER_EXTRA_GM_ON; @@ -2304,6 +2308,7 @@ void Player::SetGameMaster(bool on) getHostilRefManager().setOnlineOfflineState(true); } + m_camera.UpdateVisibilityForOwner(); UpdateObjectVisibility(); } @@ -2332,7 +2337,7 @@ void Player::SetGMVisible(bool on) } } -bool Player::IsGroupVisiblefor (Player* p) const +bool Player::IsGroupVisibleFor(Player* p) const { switch (sWorld.getConfig(CONFIG_GROUP_VISIBILITY)) { @@ -4118,7 +4123,9 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness) SetPower(POWER_ENERGY, uint32(GetMaxPower(POWER_ENERGY)*restore_percent)); } - // update visibility + // update visibility of world around viewpoint + m_camera.UpdateVisibilityForOwner(); + // update visibility of player for nearby cameras UpdateObjectVisibility(); // some items limited to specific map @@ -5604,11 +5611,7 @@ void Player::SaveRecallPosition() void Player::SendMessageToSet(WorldPacket *data, bool self, bool to_possessor) { - // Arena Preparation hack - if (InArena() && GetBattleGround()->GetStatus() != STATUS_IN_PROGRESS) - GetMap()->MessageDistBroadcast(this, data, 10.0, self, to_possessor); - else - GetMap()->MessageBroadcast(this, data, self, to_possessor); + GetMap()->MessageBroadcast(this, data, self, to_possessor); } void Player::SendMessageToSetInRange(WorldPacket *data, float dist, bool self, bool to_possessor) @@ -6165,9 +6168,9 @@ bool Player::SetOneFactionReputation(FactionEntry const* factionEntry, int32 sta int32 Player::CalculateReputationGain(uint32 creatureOrQuestLevel, int32 rep, int32 faction, bool for_quest) { // for grey creature kill received 20%, in other case 100. - int32 percent = (!for_quest && (creatureOrQuestLevel <= Trinity::XP::GetGrayLevel(getLevel()))) ? 20 : 100; + float percent = (!for_quest && (creatureOrQuestLevel <= Trinity::XP::GetGrayLevel(getLevel()))) ? 20.0f : 100.0f; - int32 repMod = GetTotalAuraModifier(SPELL_AURA_MOD_REPUTATION_GAIN); + float repMod = GetTotalAuraModifier(SPELL_AURA_MOD_REPUTATION_GAIN); if (!for_quest) repMod += GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_FACTION_REPUTATION_GAIN, faction); @@ -6177,7 +6180,7 @@ int32 Player::CalculateReputationGain(uint32 creatureOrQuestLevel, int32 rep, in if (percent <=0) return 0; - return int32(sWorld.getRate(RATE_REPUTATION_GAIN)*rep*percent/100); + return int32(sWorld.getRate(RATE_REPUTATION_GAIN) *rep *percent/100.0f); } //Calculates how many reputation points player gains in victim's enemy factions @@ -14825,7 +14828,7 @@ bool Player::LoadFromDB(uint32 guid, SqlQueryHolder *holder) SetCreatorGUID(NULL); // reset some aura modifiers before aura apply - SetFarSight(NULL); + SetUInt64Value(PLAYER_FARSIGHT, 0); SetUInt32Value(PLAYER_TRACK_CREATURES, 0); SetUInt32Value(PLAYER_TRACK_RESOURCES, 0); @@ -17551,24 +17554,28 @@ void Player::HandleStealthedUnitsDetection() Cell::VisitAllObjects(this, searcher, MAX_PLAYER_STEALTH_DETECT_RANGE); + WorldObject const* viewPoint = GetCamera().GetBody(); + for (std::list::const_iterator i = stealthedUnits.begin(); i != stealthedUnits.end(); ++i) { - if ((*i) == this) + if((*i)==this) continue; bool hasAtClient = HaveAtClient((*i)); - bool hasDetected = canSeeOrDetect(*i, true); + bool hasDetected = (*i)->isVisibleForOrDetect(this, viewPoint, true); if (hasDetected) { if (!hasAtClient) { + uint64 i_guid = (*i)->GetGUID(); (*i)->SendCreateUpdateToPlayer(this); - m_clientGUIDs.insert((*i)->GetGUID()); + m_clientGUIDs.insert(i_guid); // target aura duration for caster show only if target exist at caster client // send data at target visibility change (adding to client) - SendInitialVisiblePackets(*i); + if ((*i) != this && (*i)->isType(TYPEMASK_UNIT)) + SendInitialVisiblePackets(*i); } } else @@ -18385,129 +18392,20 @@ void Player::ReportedAfkBy(Player* reporter) // 3 players have to complain to apply debuff if (m_bgAfkReporter.size() >= 3) { - // cast 'Idle' spell - CastSpell(this, 43680, true); - m_bgAfkReporter.clear(); - } - } -} - -bool Player::canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList, bool is3dDistance) const -{ - // Always can see self - if (u == this) - return true; - - // player visible for other player if not logout and at same transport - // including case when player is out of world - bool at_same_transport = - GetTransport() && u->GetTypeId() == TYPEID_PLAYER - && !GetSession()->PlayerLogout() && !((Player*)u)->GetSession()->PlayerLogout() - && !GetSession()->PlayerLoading() && !((Player*)u)->GetSession()->PlayerLoading() - && GetTransport() == ((Player*)u)->GetTransport(); - - // not in world - if (!at_same_transport && (!IsInWorld() || !u->IsInWorld())) - return false; - - // forbidden to seen (at GM respawn command) - if (u->GetVisibility() == VISIBILITY_RESPAWN) - return false; - - // always seen by owner - if (GetGUID() == u->GetCharmerOrOwnerGUID()) - return true; - - Map& _map = *u->GetMap(); - // Grid dead/alive checks - // non visible at grid for any stealth state - if (!u->IsVisibleInGridForPlayer(this)) - return false; + bool alive = isAlive(); - // If the player is currently channeling vision, update visibility from the target unit's location - const WorldObject* viewPoint = GetFarsightTarget(); - if (!viewPoint || !HasFarsightVision()) viewPoint = u; + if (!alive) + ResurrectPlayer(50); - // different visible distance checks - if (isInFlight()) // what see player in flight - { - if (!viewPoint->IsWithinDistInMap(u, _map.GetVisibilityDistance() + (inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f), is3dDistance)) - return false; - } - else if (!u->isAlive()) // distance for show body - { - if (!viewPoint->IsWithinDistInMap(u, _map.GetVisibilityDistance() + (inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f), is3dDistance)) - return false; - } - else if (u->GetTypeId()==TYPEID_PLAYER) // distance for show player - { - // Players far than max visible distance for player or not in our map are not visible too - if (!at_same_transport && !viewPoint->IsWithinDistInMap(u, _map.GetVisibilityDistance() + (inVisibleList ? World::GetVisibleUnitGreyDistance() : 0.0f), is3dDistance)) - return false; - } - else if (u->GetCharmerOrOwnerGUID()) // distance for show pet/charmed - { - // Pet/charmed far than max visible distance for player or not in our map are not visible too - if (!viewPoint->IsWithinDistInMap(u, _map.GetVisibilityDistance() + (inVisibleList ? World::GetVisibleUnitGreyDistance() : 0.0f), is3dDistance)) - return false; - } - else // distance for show creature - { - // Units far than max visible distance for creature or not in our map are not visible too - if (!viewPoint->IsWithinDistInMap(u, u->isActiveObject() ? (MAX_VISIBILITY_DISTANCE - (inVisibleList ? 0.0f : World::GetVisibleUnitGreyDistance())) - : (_map.GetVisibilityDistance() + (inVisibleList ? World::GetVisibleUnitGreyDistance() : 0.0f)) - , is3dDistance)) - return false; - } + // cast 'Idle' spell + CastSpell(this, 43680, true); - if (u->GetVisibility() == VISIBILITY_OFF) - { - // GMs see any players, not higher GMs and all units - if (isGameMaster()) - { - if (u->GetTypeId() == TYPEID_PLAYER) - return ((Player *)u)->GetSession()->GetSecurity() <= GetSession()->GetSecurity(); - else - return true; - } - return false; - } + if (!alive) + Kill(this, true); - // GM's can see everyone with invisibilitymask with less or equal security level - if (m_invisibilityMask || u->m_invisibilityMask) - { - if (isGameMaster()) - { - if (u->GetTypeId() == TYPEID_PLAYER) - return ((Player*)u)->GetSession()->GetSecurity() <= GetSession()->GetSecurity(); - else - return true; + m_bgAfkReporter.clear(); } - - // player see other player with stealth/invisibility only if he in same group or raid or same team (raid/team case dependent from conf setting) - if (!canDetectInvisibilityOf(u)) - if (!(u->GetTypeId()==TYPEID_PLAYER && !IsHostileTo(u) && IsGroupVisiblefor (((Player*)u)))) - return false; - } - - // GM invisibility checks early, invisibility if any detectable, so if not stealth then visible - if (u->GetVisibility() == VISIBILITY_GROUP_STEALTH && !isGameMaster()) - { - // if player is dead then he can't detect anyone in any cases - //do not know what is the use of this detect - // stealth and detected and visible for some seconds - if (!isAlive()) - detect = false; - if (m_DetectInvTimer < 300 || !HaveAtClient(u)) - if (!(u->GetTypeId()==TYPEID_PLAYER && !IsHostileTo(u) && IsGroupVisiblefor (((Player*)u)))) - if (!detect || !canDetectStealthOf(u, GetDistance(u))) - return false; } - - // If use this server will be too laggy - // Now check is target visible with LoS - //return u->IsWithinLOS(GetPositionX(),GetPositionY(),GetPositionZ()); - return true; } bool Player::IsVisibleInGridForPlayer(Player const * pl) const @@ -18516,6 +18414,10 @@ bool Player::IsVisibleInGridForPlayer(Player const * pl) const if (pl->isGameMaster() && GetSession()->GetSecurity() <= pl->GetSession()->GetSecurity()) return true; + // player see dead player/ghost from own group/raid + if (IsInSameRaidWith(pl)) + return true; + // It seems in battleground everyone sees everyone, except the enemy-faction ghosts if (InBattleGround()) { @@ -18576,63 +18478,41 @@ bool Player::IsVisibleGloballyfor (Player* u) const } template -inline void UpdateVisibilityOf_helper(std::set& s64, T* target, std::set& v) +inline void BeforeVisibilityDestroy(T* /*t*/, Player* /*p*/) { - s64.insert(target->GetGUID()); } template<> -inline void UpdateVisibilityOf_helper(std::set& s64, GameObject* target, std::set& v) +inline void BeforeVisibilityDestroy(Creature* t, Player* p) { - if(!target->IsTransport()) - s64.insert(target->GetGUID()); + if (p->GetPetGUID()==t->GetGUID() && ((Creature*)t)->isPet()) + ((Pet*)t)->Remove(PET_SAVE_NOT_IN_SLOT, true); } -template<> -inline void UpdateVisibilityOf_helper(std::set& s64, Creature* target, std::set& v) -{ - s64.insert(target->GetGUID()); - v.insert(target); -} - -template<> -inline void UpdateVisibilityOf_helper(std::set& s64, Player* target, std::set& v) -{ - s64.insert(target->GetGUID()); - v.insert(target); -} - -void Player::UpdateVisibilityOf(WorldObject* target) +void Player::UpdateVisibilityOf(WorldObject const* viewPoint, WorldObject* target) { if (HaveAtClient(target)) { - if (!target->isVisibleForInState(this, true)) + if (!target->isVisibleForInState(this, viewPoint, true)) { + if (target->GetTypeId()==TYPEID_UNIT) + BeforeVisibilityDestroy((Creature*)target, this); + target->DestroyForPlayer(this); m_clientGUIDs.erase(target->GetGUID()); - - #ifdef TRINITY_DEBUG - if ((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES)==0) - sLog.outDebug("Object %u (Type: %u) out of range for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),GetGUIDLow(),GetDistance(target)); - #endif } } else { - if (target->isVisibleForInState(this, false)) + if (target->isVisibleForInState(this, viewPoint, false)) { target->SendCreateUpdateToPlayer(this); - if (target->GetTypeId()!=TYPEID_GAMEOBJECT||!((GameObject*)target)->IsTransport()) + if (target->GetTypeId() != TYPEID_GAMEOBJECT || !((GameObject*)target)->IsTransport()) m_clientGUIDs.insert(target->GetGUID()); - #ifdef TRINITY_DEBUG - if ((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES)==0) - sLog.outDebug("Object %u (Type: %u) is visible now for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),GetGUIDLow(),GetDistance(target)); - #endif - // target aura duration for caster show only if target exist at caster client // send data at target visibility change (adding to client) - if (target->isType(TYPEMASK_UNIT)) + if (target != this && target->isType(TYPEMASK_UNIT)) SendInitialVisiblePackets((Unit*)target); } } @@ -18676,66 +18556,47 @@ void Player::SendInitialVisiblePackets(Unit* target) } template -void Player::UpdateVisibilityOf(T* target, UpdateData& data, std::set& visibleNow) +inline void UpdateVisibilityOf_helper(std::set& s64, T* target) { - if (!target) - return; + s64.insert(target->GetGUID()); +} + +template<> +inline void UpdateVisibilityOf_helper(std::set& s64, GameObject* target) +{ + if(!target->IsTransport()) + s64.insert(target->GetGUID()); +} +template +void Player::UpdateVisibilityOf(WorldObject const* viewPoint, T* target, UpdateData& data, std::set& visibleNow) +{ if (HaveAtClient(target)) { - if (!target->isVisibleForInState(this, true)) + if (!target->isVisibleForInState(this, viewPoint, true)) { + BeforeVisibilityDestroy(target, this); + target->BuildOutOfRangeUpdateBlock(&data); m_clientGUIDs.erase(target->GetGUID()); - - #ifdef TRINITY_DEBUG - if ((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES)==0) - sLog.outDebug("Object %u (Type: %u, Entry: %u) is out of range for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),target->GetEntry(),GetGUIDLow(),GetDistance(target)); - #endif } } - else if (visibleNow.size() < 30) + else { - if (target->isVisibleForInState(this, false)) + if (target->isVisibleForInState(this, viewPoint, false)) { + visibleNow.insert(target); target->BuildCreateUpdateBlockForPlayer(&data, this); - UpdateVisibilityOf_helper(m_clientGUIDs,target,visibleNow); - - #ifdef TRINITY_DEBUG - if ((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES)==0) - sLog.outDebug("Object %u (Type: %u, Entry: %u) is visible now for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),target->GetEntry(),GetGUIDLow(),GetDistance(target)); - #endif + UpdateVisibilityOf_helper(m_clientGUIDs,target); } } } -template void Player::UpdateVisibilityOf(Player* target, UpdateData& data, std::set& visibleNow); -template void Player::UpdateVisibilityOf(Creature* target, UpdateData& data, std::set& visibleNow); -template void Player::UpdateVisibilityOf(Corpse* target, UpdateData& data, std::set& visibleNow); -template void Player::UpdateVisibilityOf(GameObject* target, UpdateData& data, std::set& visibleNow); -template void Player::UpdateVisibilityOf(DynamicObject* target, UpdateData& data, std::set& visibleNow); - -void Player::UpdateObjectVisibility(bool forced) -{ - if (!forced) - AddToNotify(NOTIFY_VISIBILITY_CHANGED); - else - { - Unit::UpdateObjectVisibility(true); - UpdateVisibilityForPlayer(); - } -} - -void Player::UpdateVisibilityForPlayer() -{ - WorldObject const *viewPoint = GetFarsightTarget(); - if (!viewPoint || !HasFarsightVision()) viewPoint = this; - - // updates visibility of all objects around point of view for current player - Trinity::VisibleNotifier notifier(*this); - Cell::VisitAllObjects(viewPoint, notifier, GetMap()->GetVisibilityDistance()); - notifier.SendToSelf(); // send gathered data -} +template void Player::UpdateVisibilityOf(WorldObject const* viewPoint, Player* target, UpdateData& data, std::set& visibleNow); +template void Player::UpdateVisibilityOf(WorldObject const* viewPoint, Creature* target, UpdateData& data, std::set& visibleNow); +template void Player::UpdateVisibilityOf(WorldObject const* viewPoint, Corpse* target, UpdateData& data, std::set& visibleNow); +template void Player::UpdateVisibilityOf(WorldObject const* viewPoint, GameObject* target, UpdateData& data, std::set& visibleNow); +template void Player::UpdateVisibilityOf(WorldObject const* viewPoint, DynamicObject* target, UpdateData& data, std::set& visibleNow); void Player::InitPrimaryProffesions() { @@ -18866,6 +18727,8 @@ void Player::SendInitialPacketsBeforeAddToMap() // set fly flag if in fly form or taxi flight to prevent visually drop at ground in showup moment if (HasAuraType(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED) || isInFlight()) AddUnitMovementFlag(SPLINEFLAG_FLYINGING2); + + SetMover(this); } void Player::SendInitialPacketsAfterAddToMap() diff --git a/src/game/Player.h b/src/game/Player.h index a96a7da78..94f899787 100755 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -886,6 +886,33 @@ class TRINITY_DLL_SPEC PlayerTaxi std::deque m_TaxiDestinations; }; +class AntiCheat +{ + public: + AntiCheat() : m_timer(0), m_count(0), m_nofall_count(0), m_speedRate(0.0f) {} + + float GetLastSpeedRate() const { return m_speedRate; } + void SetLastSpeedRate(float SpeedRate) { m_speedRate = SpeedRate; } + + void SetTimer(uint32 tTimer) { m_timer = tTimer; } + uint32 GetTimer() const { return m_timer; } + + uint32 GetAlertCount() const { return m_count; } + uint32 GetNoFallCount() const { return m_nofall_count; } + + void IncrementAlertCount() { m_count++; } + void IncrementNoFallCount() { m_nofall_count++; } + + private: + uint32 m_timer; + uint32 m_count; + uint32 m_nofall_count; + + float m_speedRate; + + //MovementInfo oldMovement; +}; + class TRINITY_DLL_SPEC Player : public Unit { friend class WorldSession; @@ -1540,7 +1567,7 @@ class TRINITY_DLL_SPEC Player : public Unit void CheckDuelDistance(time_t currTime); void DuelComplete(DuelCompleteType type); - bool IsGroupVisiblefor (Player* p) const; + bool IsGroupVisibleFor(Player* p) const; bool IsInSameGroupWith(Player const* p) const; bool IsInSameRaidWith(Player const* p) const { return p==this || (GetGroup() != NULL && GetGroup() == p->GetGroup()); } void UninviteFromGroup(); @@ -1768,14 +1795,8 @@ class TRINITY_DLL_SPEC Player : public Unit /*********************************************************/ /*** ANTICHEAT SYSTEM ***/ /*********************************************************/ - float GetLastSpeedRate() { return fLastSpeedRate; } - void SetLastSpeedRate(float fSpeedRateRate) { fLastSpeedRate = fSpeedRateRate; } - uint32 m_AC_timer; - uint32 m_AC_count; - uint32 m_AC_NoFall_count; - - float fLastSpeedRate; + AntiCheat AC; /*********************************************************/ /*** PVP SYSTEM ***/ @@ -2021,6 +2042,9 @@ class TRINITY_DLL_SPEC Player : public Unit void HandleFallUnderMap(); void SetClientControl(Unit* target, uint8 allowMove); + void SetMover(Unit* target) { m_mover = target ? target : this; } + Unit* GetMover() const { return m_mover; } + bool IsSelfMover() const { return m_mover == this; }// normal case for player not controlling other unit uint64 GetFarSight() const { return GetUInt64Value(PLAYER_FARSIGHT); } void SetFarSight(uint64 guid) { SetUInt64Value(PLAYER_FARSIGHT, guid); } @@ -2062,22 +2086,22 @@ class TRINITY_DLL_SPEC Player : public Unit bool HaveAtClient(WorldObject const* u) const { return u==this || m_clientGUIDs.find(u->GetGUID())!=m_clientGUIDs.end(); } - bool canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList = false, bool is3dDistance = true) const; bool IsVisibleInGridForPlayer(Player const* pl) const; bool IsVisibleGloballyfor (Player* pl) const; - void UpdateVisibilityOf(WorldObject* target); void SendInitialVisiblePackets(Unit* target); - void UpdateObjectVisibility(bool forced = true); - void UpdateVisibilityForPlayer(); + + void UpdateVisibilityOf(WorldObject const* viewPoint, WorldObject* target); template - void UpdateVisibilityOf(T* target, UpdateData& data, std::set& visibleNow); + void UpdateVisibilityOf(WorldObject const* viewPoint, T* target, UpdateData& data, std::set& visibleNow); // Stealth detection system uint32 m_DetectInvTimer; void HandleStealthedUnitsDetection(); + Camera& GetCamera() { return m_camera; } + uint8 m_forced_speed_changes[MAX_MOVE_TYPE]; bool HasAtLoginFlag(AtLoginFlags f) const { return m_atLoginFlags & f; } @@ -2401,6 +2425,9 @@ class TRINITY_DLL_SPEC Player : public Unit uint8 m_MirrorTimerFlagsLast; bool m_isInWater; + Unit *m_mover; + Camera m_camera; + GridReference m_gridRef; MapReference m_mapRef; diff --git a/src/game/PointMovementGenerator.cpp b/src/game/PointMovementGenerator.cpp index 7f6d01d49..757b7cbce 100755 --- a/src/game/PointMovementGenerator.cpp +++ b/src/game/PointMovementGenerator.cpp @@ -30,7 +30,11 @@ template void PointMovementGenerator::Initialize(T &unit) { - unit.StopMoving(); + if (!unit.IsStopped()) + unit.StopMoving(); + + unit.addUnitState(UNIT_STAT_ROAMING); + Traveller traveller(unit); i_destinationHolder.SetDestination(traveller,i_x,i_y,i_z); } @@ -72,6 +76,8 @@ void PointMovementGenerator:: Finalize(T &unit) if (unit.hasUnitState(UNIT_STAT_CHARGING)) unit.clearUnitState(UNIT_STAT_CHARGING | UNIT_STAT_JUMPING); + unit.clearUnitState(UNIT_STAT_ROAMING); + if (i_destinationHolder.HasArrived()) // without this crash! MovementInform(unit); } @@ -105,6 +111,8 @@ template void PointMovementGenerator::Finalize(Creature&); void AssistanceMovementGenerator::Finalize(Unit &unit) { + unit.clearUnitState(UNIT_STAT_ROAMING); + ((Creature*)&unit)->SetNoCallAssistance(false); ((Creature*)&unit)->CallAssistance(); if (unit.isAlive()) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 6fd90bc8e..3d836a074 100755 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1111,7 +1111,7 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask) if ((m_originalCaster && !m_originalCaster->IsFriendlyTo(unit)) || !m_caster->IsFriendlyTo(unit)) { // reset damage to 0 if target has Invisibility or Vanish aura (_only_ vanish, not stealth) and isn't visible for caster - bool isVisibleForHit = ((unit->HasAuraType(SPELL_AURA_MOD_INVISIBILITY) || unit->HasAuraTypeWithFamilyFlags(SPELL_AURA_MOD_STEALTH, SPELLFAMILY_ROGUE ,SPELLFAMILYFLAG_ROGUE_VANISH)) && !unit->isVisibleForOrDetect(m_caster, true)) ? false : true; + bool isVisibleForHit = ((unit->HasAuraType(SPELL_AURA_MOD_INVISIBILITY) || unit->HasAuraTypeWithFamilyFlags(SPELL_AURA_MOD_STEALTH, SPELLFAMILY_ROGUE ,SPELLFAMILYFLAG_ROGUE_VANISH)) && !unit->isVisibleForOrDetect(m_caster, m_caster, true)) ? false : true; // for delayed spells ignore not visible explicit target if (m_spellInfo->speed > 0.0f && unit==m_targets.getUnitTarget() && !isVisibleForHit) @@ -1167,8 +1167,8 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask) DiminishingReturnsType type = GetDiminishingReturnsGroupType(m_diminishGroup); // Increase Diminishing on unit, current informations for actually casts will use values above if ((type == DRTYPE_PLAYER && unit->isCharmedOwnedByPlayerOrPlayer()) || type == DRTYPE_ALL) - { - if (m_caster->isCharmedOwnedByPlayerOrPlayer()) + { // Freezing trap exception, since it is casted by GO ? + if (m_caster->isCharmedOwnedByPlayerOrPlayer() || m_spellInfo->SpellFamilyFlags & 0x00000000008LL) unit->IncrDiminishing(m_diminishGroup); } } @@ -1397,7 +1397,7 @@ void Spell::SearchChainTarget(std::list &TagUnitMap, float max_range, uin } while (m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MELEE && !m_caster->isInFront(*next, max_range) - || !m_caster->canSeeOrDetect(*next, false) + || !m_caster->canSeeOrDetect(*next, *next, false) || !(m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_IGNORE_LOS) && !cur->IsWithinLOSInMap(*next)) { ++next; @@ -2393,7 +2393,7 @@ void Spell::cast(bool skipCheck) UpdatePointers(); if (Unit *pTarget = m_targets.getUnitTarget()) - if (pTarget->isAlive() && (pTarget->HasAuraType(SPELL_AURA_MOD_STEALTH) || pTarget->HasAuraType(SPELL_AURA_MOD_INVISIBILITY)) && !pTarget->IsFriendlyTo(m_caster) && !pTarget->isVisibleForOrDetect(m_caster, true)) + if (pTarget->isAlive() && (pTarget->HasAuraType(SPELL_AURA_MOD_STEALTH) || pTarget->HasAuraType(SPELL_AURA_MOD_INVISIBILITY)) && !pTarget->IsFriendlyTo(m_caster) && !pTarget->isVisibleForOrDetect(m_caster, m_caster, true)) { SendCastResult(SPELL_FAILED_BAD_TARGETS); finish(false); @@ -2558,6 +2558,7 @@ void Spell::handle_immediate() // Apply duration mod if (Player* modOwner = m_caster->GetSpellModOwner()) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration); + m_spellState = SPELL_STATE_CASTING; m_caster->AddInterruptMask(m_spellInfo->ChannelInterruptFlags); SendChannelStart(duration); diff --git a/src/game/Spell.h b/src/game/Spell.h index deea320dd..8ba46c19e 100755 --- a/src/game/Spell.h +++ b/src/game/Spell.h @@ -707,6 +707,7 @@ namespace Trinity template<> inline void Visit(PlayerMapType &) {} template<> inline void Visit(GameObjectMapType &) {} template<> inline void Visit(DynamicObjectMapType &) {} + template<> inline void Visit(CameraMapType & ) {} #endif }; @@ -820,6 +821,7 @@ namespace Trinity template<> inline void Visit(CorpseMapType &) {} template<> inline void Visit(GameObjectMapType &) {} template<> inline void Visit(DynamicObjectMapType &) {} + template<> inline void Visit(CameraMapType & ) {} #endif }; @@ -932,6 +934,7 @@ namespace Trinity template<> inline void Visit(GameObjectMapType &) {} template<> inline void Visit(PlayerMapType &) {} template<> inline void Visit(DynamicObjectMapType &) {} + template<> inline void Visit(CameraMapType & ) {} #endif }; @@ -940,15 +943,18 @@ namespace Trinity template<> inline void SpellNotifierGameObject::Visit(CreatureMapType&) {} template<> inline void SpellNotifierGameObject::Visit(PlayerMapType&) {} template<> inline void SpellNotifierGameObject::Visit(DynamicObjectMapType&) {} + template<> inline void SpellNotifierGameObject::Visit(CameraMapType & ) {} template<> inline void SpellNotifierCreatureAndPlayer::Visit(CorpseMapType&) {} template<> inline void SpellNotifierCreatureAndPlayer::Visit(GameObjectMapType&) {} template<> inline void SpellNotifierCreatureAndPlayer::Visit(DynamicObjectMapType&) {} + template<> inline void SpellNotifierCreatureAndPlayer::Visit(CameraMapType& ) {} template<> inline void SpellNotifierDeadCreature::Visit(CorpseMapType&) {} template<> inline void SpellNotifierDeadCreature::Visit(GameObjectMapType&) {} template<> inline void SpellNotifierDeadCreature::Visit(PlayerMapType&) {} template<> inline void SpellNotifierDeadCreature::Visit(DynamicObjectMapType&) {} + template<> inline void SpellNotifierDeadCreature::Visit(CameraMapType & ) {} #endif } diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index c68113e64..4ad0632cd 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -2502,7 +2502,9 @@ void Aura::HandleAuraDummy(bool apply, bool Real) if (m_target->GetTypeId() == TYPEID_PLAYER && GetSpellProto()->Effect[0]==72) { // spells with SpellEffect=72 and aura=4: 6196, 6197, 21171, 21425 - ((Player*)m_target)->ClearFarsight(); + ((Player*)m_target)->GetCamera().ResetView(); + WorldPacket data(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, 0); + ((Player*)m_target)->GetSession()->SendPacket(&data); return; } @@ -2965,18 +2967,14 @@ void Aura::HandleAuraDummy(bool apply, bool Real) if (caster->GetTypeId() == TYPEID_PLAYER) return; + Camera &camera = ((Player*)caster)->GetCamera(); if (apply) { - uint64 guid = caster->m_TotemSlot[3]; - if (guid) - { - Creature *totem = caster->GetMap()->GetCreature(guid); - if (totem && totem->isTotem()) - ((Player*)caster)->CastSpell(totem, 6277, true); - } + Creature *pTotem = caster->GetMap()->GetCreature(caster->m_TotemSlot[3]); + camera.SetView(pTotem); } else - ((Player*)caster)->StopCastingBindSight(); + camera.ResetView(); return; } break; @@ -3648,10 +3646,11 @@ void Aura::HandleBindSight(bool apply, bool Real) if (!caster || caster->GetTypeId() != TYPEID_PLAYER) return; + Camera& camera = ((Player*)caster)->GetCamera(); if (apply) - m_target->AddPlayerToVision((Player*)caster); + camera.SetView(m_target); else - m_target->RemovePlayerFromVision((Player*)caster); + camera.ResetView(); } void Aura::HandleFarSight(bool apply, bool Real) @@ -3660,7 +3659,11 @@ void Aura::HandleFarSight(bool apply, bool Real) if (!caster || caster->GetTypeId() != TYPEID_PLAYER) return; - ((Player*)caster)->SetFarSight(apply ? m_target->GetGUID() : NULL); + Camera& camera = ((Player*)caster)->GetCamera(); + if (apply) + camera.SetView(GetTarget()); + else + camera.ResetView(); } void Aura::HandleAuraTrackCreatures(bool apply, bool Real) @@ -3706,6 +3709,12 @@ void Aura::HandleModPossess(bool apply, bool Real) if (!Real) return; + Unit *target = GetTarget(); + + // not possess yourself + if(GetCasterGUID() == target->GetGUID()) + return; + Unit* caster = GetCaster(); if (caster && caster->GetTypeId() == TYPEID_UNIT) { @@ -3715,17 +3724,17 @@ void Aura::HandleModPossess(bool apply, bool Real) if (apply) { - if (m_target->getLevel() > m_modifier.m_amount) + if (target->getLevel() > m_modifier.m_amount) return; - m_target->SetCharmedOrPossessedBy(caster, true); + target->SetCharmedOrPossessedBy(caster, true); } else { - if (GetId() == 40268) - m_target->setDeathState(JUST_DIED); + target->RemoveCharmedOrPossessedBy(caster); - m_target->RemoveCharmedOrPossessedBy(caster); + if (GetId() == 40268) + target->setDeathState(JUST_DIED); } } @@ -3738,23 +3747,24 @@ void Aura::HandleModPossessPet(bool apply, bool Real) if (!caster || caster->GetTypeId() != TYPEID_PLAYER) return; + Pet *pet = caster->GetPet(); + if(!pet || pet != m_target) + return; + if (apply) { - if (caster->GetPet() != m_target) - return; - - m_target->SetCharmedOrPossessedBy(caster, true); + pet->SetCharmedOrPossessedBy(caster, true); } else { - m_target->RemoveCharmedOrPossessedBy(caster); + pet->RemoveCharmedOrPossessedBy(caster); // Reinitialize the pet bar and make the pet come back to the owner ((Player*)caster)->PetSpellInitialize(); - if (!m_target->getVictim()) + if (!pet->getVictim()) { - m_target->GetMotionMaster()->MoveFollow(caster, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); - m_target->GetCharmInfo()->SetCommandState(COMMAND_FOLLOW); + pet->GetMotionMaster()->MoveFollow(caster, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); + pet->GetCharmInfo()->SetCommandState(COMMAND_FOLLOW); } } } @@ -3764,17 +3774,25 @@ void Aura::HandleModCharm(bool apply, bool Real) if (!Real) return; + Unit *target = GetTarget(); + + // not charm yourself + if(GetCasterGUID() == target->GetGUID()) + return; + Unit* caster = GetCaster(); + if(!caster) + return; if (apply) { - if (int32(m_target->getLevel()) > m_modifier.m_amount) + if (int32(target->getLevel()) > m_modifier.m_amount) return; - m_target->SetCharmedOrPossessedBy(caster, false); + target->SetCharmedOrPossessedBy(caster, false); } else - m_target->RemoveCharmedOrPossessedBy(caster); + target->RemoveCharmedOrPossessedBy(caster); } void Aura::HandleModConfuse(bool apply, bool Real) @@ -4070,8 +4088,7 @@ void Aura::HandleInvisibilityDetect(bool apply, bool Real) } if (Real && m_target->GetTypeId()==TYPEID_PLAYER) - //ObjectAccessor::UpdateVisibilityForPlayer((Player*)m_target); - m_target->UpdateObjectVisibility(); + ((Player*)m_target)->GetCamera().UpdateVisibilityForOwner(); } void Aura::HandleAuraModRoot(bool apply, bool Real) @@ -4114,14 +4131,13 @@ void Aura::HandleAuraModSilence(bool apply, bool Real) if (!caster) return; - Aura * dummy = caster->GetDummyAura(28734); - if (dummy) + if (Aura * dummy = caster->GetDummyAura(28734)) { int32 bp = (5 + caster->getLevel()) * dummy->GetStackAmount(); caster->CastCustomSpell(caster, 28733, &bp, NULL, NULL, true); caster->RemoveAurasDueToSpell(28734); } - return; + break; } // Arcane Torrent (Energy) @@ -4132,13 +4148,13 @@ void Aura::HandleAuraModSilence(bool apply, bool Real) return; // Search Mana Tap auras on caster - Aura *dummy = caster->GetDummyAura(28734); - if (dummy) + if (Aura *dummy = caster->GetDummyAura(28734)) { int32 bp = dummy->GetStackAmount() * 10; caster->CastCustomSpell(caster, 25048, &bp, NULL, NULL, true); - m_target->RemoveAurasDueToSpell(28734); + caster->RemoveAurasDueToSpell(28734); } + break; } } } @@ -6481,10 +6497,11 @@ void Aura::HandleAuraAoeCharm(bool apply, bool Real) if (Unit* caster = GetCaster()) { + Unit *target = GetTarget(); if (apply) - m_target->SetCharmedOrPossessedBy(caster, false); + target->SetCharmedOrPossessedBy(caster, false); else - m_target->RemoveCharmedOrPossessedBy(caster); + target->RemoveCharmedOrPossessedBy(caster); } } diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 49919bfa8..f05a2c231 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -4241,14 +4241,11 @@ void Spell::EffectAddFarsight(uint32 i) } dynObj->SetUInt32Value(OBJECT_FIELD_TYPE, 65); dynObj->SetUInt32Value(DYNAMICOBJECT_BYTES, 0x80000002); - m_caster->AddDynObject(dynObj); - dynObj->setActive(true); //must before add to map to be put in world container + m_caster->AddDynObject(dynObj); m_caster->GetMap()->Add(dynObj); //grid will also be loaded - // Need to update visibility of object for client to accept farsight guid - ((Player*)m_caster)->UpdateVisibilityOf(dynObj); - ((Player*)m_caster)->SetFarsightTarget(dynObj); + ((Player*)m_caster)->GetCamera().SetView(dynObj); } void Spell::EffectSummonWild(uint32 i) @@ -7014,7 +7011,8 @@ void Spell::EffectCharge(uint32 /*i*/) float x, y, z; target->GetContactPoint(m_caster, x, y, z); if (m_caster->GetTypeId() == TYPEID_PLAYER) - ((Player *)m_caster)->m_AC_timer = 3000; + ((Player *)m_caster)->AC.SetTimer(3*IN_MILISECONDS); + m_caster->GetMotionMaster()->MoveCharge(x, y, z); // not all charge effects used in negative spells diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp index dde28be8d..c3d35ddf6 100755 --- a/src/game/SpellHandler.cpp +++ b/src/game/SpellHandler.cpp @@ -37,7 +37,6 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) { - Player* pUser = _player; uint8 bagIndex, slot; uint8 spell_count; // number of spells at item, not used uint8 cast_count; // next cast if exists (single or not) @@ -45,15 +44,25 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) recvPacket >> bagIndex >> slot >> spell_count >> cast_count >> item_guid; + Player* pUser = _player; + // ignore for remote control state + if (!pUser->IsSelfMover()) + { + recvPacket.rpos(recvPacket.wpos()); // prevent spam at not read packet tail + return; + } + Item *pItem = pUser->GetItemByPos(bagIndex, slot); if (!pItem) { + recvPacket.rpos(recvPacket.wpos()); pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); return; } if (pItem->GetGUID() != item_guid) { + recvPacket.rpos(recvPacket.wpos()); pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); return; } @@ -63,6 +72,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) ItemPrototype const *proto = pItem->GetProto(); if (!proto) { + recvPacket.rpos(recvPacket.wpos()); pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, pItem, NULL); return; } @@ -70,6 +80,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) // some item classes can be used only in equipped state if (proto->InventoryType != INVTYPE_NON_EQUIP && !pItem->IsEquipped()) { + recvPacket.rpos(recvPacket.wpos()); pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, pItem, NULL); return; } @@ -77,6 +88,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) uint8 msg = pUser->CanUseItem(pItem); if (msg != EQUIP_ERR_OK) { + recvPacket.rpos(recvPacket.wpos()); pUser->SendEquipError(msg, pItem, NULL); return; } @@ -86,6 +98,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) !(proto->Flags & ITEM_FLAGS_USEABLE_IN_ARENA) && pUser->InArena()) { + recvPacket.rpos(recvPacket.wpos()); pUser->SendEquipError(EQUIP_ERR_NOT_DURING_ARENA_MATCH,pItem,NULL); return; } @@ -98,6 +111,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) { if (IsNonCombatSpell(spellInfo)) { + recvPacket.rpos(recvPacket.wpos()); pUser->SendEquipError(EQUIP_ERR_NOT_IN_COMBAT,pItem,NULL); return; } @@ -227,11 +241,15 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) sLog.outDetail("WORLD: CMSG_OPEN_ITEM packet, data length = %i",recvPacket.size()); - Player* pUser = _player; uint8 bagIndex, slot; recvPacket >> bagIndex >> slot; + Player* pUser = _player; + // ignore for remote control state + if (!pUser->IsSelfMover()) + return; + sLog.outDetail("bagIndex: %u, slot: %u",bagIndex,slot); Item *pItem = pUser->GetItemByPos(bagIndex, slot); @@ -304,8 +322,12 @@ void WorldSession::HandleGameObjectUseOpcode(WorldPacket & recv_data) recv_data >> guid; sLog.outDebug("WORLD: Recvd CMSG_GAMEOBJ_USE Message [guid=%u]", GUID_LOPART(guid)); - GameObject *obj = GetPlayer()->GetMap()->GetGameObject(guid); + // ignore for remote control state + if (!_player->IsSelfMover()) + return; + + GameObject *obj = GetPlayer()->GetMap()->GetGameObject(guid); if (!obj) return; @@ -327,8 +349,15 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) sLog.outDebug("WORLD: got cast spell packet, spellId - %u, cast_count: %u data length = %i", spellId, cast_count, recvPacket.size()); - SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId); + // ignore for remote control state (for player case) + Unit* mover = _player->GetMover(); + if (mover != _player && mover->GetTypeId()==TYPEID_PLAYER) + { + recvPacket.rpos(recvPacket.wpos()); // prevent spam at ignore packet + return; + } + SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId); if (!spellInfo) { sLog.outError("WORLD: unknown spell id %u", spellId); @@ -376,7 +405,12 @@ void WorldSession::HandleCancelCastOpcode(WorldPacket& recvPacket) uint32 spellId; recvPacket >> spellId; - if (!_player->isCharmed() && !_player->isPossessed() && _player->IsNonMeleeSpellCasted(false)) + // ignore for remote control state (for player case) + Unit* mover = _player->GetMover(); + if (mover != _player && mover->GetTypeId()==TYPEID_PLAYER) + return; + + if (_player->IsNonMeleeSpellCasted(false)) _player->InterruptNonMeleeSpells(false,spellId,false); } @@ -396,7 +430,7 @@ void WorldSession::HandleCancelAuraOpcode(WorldPacket& recvPacket) if (!IsPositiveSpell(spellId)) { // ignore for remote control state - if (_player->GetFarsightTarget()) + if (!_player->IsSelfMover()) { // except own aura spells bool allow = false; @@ -441,6 +475,10 @@ void WorldSession::HandlePetCancelAuraOpcode(WorldPacket& recvPacket) recvPacket >> guid; recvPacket >> spellId; + // ignore for remote control state + if (!_player->IsSelfMover()) + return; + SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId); if (!spellInfo) { @@ -482,7 +520,7 @@ void WorldSession::HandleCancelAutoRepeatSpellOpcode(WorldPacket& /*recvPacket*/ { // may be better send SMSG_CANCEL_AUTO_REPEAT? // cancel and prepare for deleting - _player->InterruptSpell(CURRENT_AUTOREPEAT_SPELL); + _player->GetMover()->InterruptSpell(CURRENT_AUTOREPEAT_SPELL); } /// \todo Complete HandleCancelChanneling function @@ -504,6 +542,11 @@ void WorldSession::HandleTotemDestroy(WorldPacket& recvPacket) recvPacket >> slotId; + // ignore for remote control state (for player case) + Unit* mover = _player->GetMover(); + if (mover != _player && mover->GetTypeId()==TYPEID_PLAYER) + return; + if (slotId >= MAX_TOTEM) return; diff --git a/src/game/TaxiHandler.cpp b/src/game/TaxiHandler.cpp index 67550bcd1..03bc43f35 100755 --- a/src/game/TaxiHandler.cpp +++ b/src/game/TaxiHandler.cpp @@ -256,10 +256,10 @@ void WorldSession::HandleTaxiNextDestinationOpcode(WorldPacket& recv_data) if (path && MountId) SendDoFlight(MountId, path, 1); // skip start fly node else - GetPlayer()->CleanupAfterTaxiFlight(); // clear problematic path and next + GetPlayer()->m_taxi.ClearTaxiDestinations(); // clear problematic path and next } else - GetPlayer()->CleanupAfterTaxiFlight(); // not destinations, clear source node + GetPlayer()->m_taxi.ClearTaxiDestinations(); // not destinations, clear source node // TaxiNodes: 96 -> Zangarmarsh - Quest - As the Crow Flies - End | quest support: As the Crow Flies if (curDest == 96 && GetPlayer()->GetQuestStatus(9718) == QUEST_STATUS_INCOMPLETE) diff --git a/src/game/TotemAI.cpp b/src/game/TotemAI.cpp index b8697fd17..802758311 100755 --- a/src/game/TotemAI.cpp +++ b/src/game/TotemAI.cpp @@ -83,7 +83,7 @@ TotemAI::UpdateAI(const uint32 /*diff*/) // Search victim if no, not attackable, or out of range, or friendly (possible in case duel end) if (!victim || !victim->isTargetableForAttack() || !i_totem.IsWithinDistInMap(victim, max_range) || - (i_totem.IsFriendlyTo(victim) && victim != &i_totem) || !victim->isVisibleForOrDetect(&i_totem,false)) + (i_totem.IsFriendlyTo(victim) && victim != &i_totem) || !victim->isVisibleForOrDetect(&i_totem,&i_totem, false)) { victim = NULL; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 9d495a2e2..47635c229 100755 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -269,6 +269,8 @@ Unit::Unit() m_AurasUpdateIterator = m_Auras.end(); m_Visibility = VISIBILITY_ON; + m_AINotifyScheduled = false; + m_interruptMask = 0; m_detectInvisibilityMask = 0; m_invisibilityMask = 0; @@ -445,7 +447,7 @@ bool Unit::haveOffhandWeapon() const void Unit::SendMonsterMoveWithSpeedToCurrentDestination(Player* player) { float x, y, z; - if (GetMotionMaster()->GetDestination(x, y, z)) + if (!IsStopped() && GetMotionMaster()->GetDestination(x, y, z)) SendMonsterMoveWithSpeed(x, y, z, 0, player); } @@ -5917,8 +5919,9 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu if (triggeredByAura && castItem->GetGUID() != triggeredByAura->GetCastItemGUID()) return false; + const static uint32 WF_RANK_1 = 33757; // custom cooldown processing case - if (cooldown && ((Player*)this)->HasSpellCooldown(dummySpell->Id)) + if (cooldown && ((Player*)this)->HasSpellCooldown(WF_RANK_1)) return false; uint32 spellId; @@ -5963,11 +5966,11 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu // apply cooldown before cast to prevent processing itself if (cooldown) - ((Player*)this)->AddSpellCooldown(dummySpell->Id,0,time(NULL) + cooldown); + ((Player*)this)->AddSpellCooldown(WF_RANK_1, 0 , time(NULL) + cooldown); // Attack Twice - for (uint32 i = 0; i<2; ++i) - CastCustomSpell(pVictim,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura); + for (uint32 i = 0; i<2; ++i) // if we set castitem it will force our m_cantrigger = true to false for windfury weapon due to later checks in prepareDataForTriggerSystem() + CastCustomSpell(pVictim,triggered_spell_id,&basepoints0,NULL,NULL,true,NULL/*castItem*/,triggeredByAura); return true; } @@ -9002,7 +9005,7 @@ void Unit::Unmount() RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_MOUNT); if (GetTypeId() == TYPEID_PLAYER) - ((Player*)this)->m_AC_timer = 5000; + ((Player*)this)->AC.SetTimer(5*IN_MILISECONDS); // only resummon old pet if the player is already added to a map // this prevents adding a pet to a not created map which would otherwise cause a crash @@ -9296,7 +9299,7 @@ int32 Unit::ModifyPower(Powers power, int32 dVal) return gain; } -bool Unit::isVisibleForOrDetect(Unit const* u, bool detect, bool inVisibleList, bool is3dDistance) const +bool Unit::isVisibleForOrDetect(Unit const* u, WorldObject const* viewPoint, bool detect, bool inVisibleList, bool is3dDistance) const { if (!u || !IsInMap(u)) return false; @@ -9309,10 +9312,229 @@ bool Unit::isVisibleForOrDetect(Unit const* u, bool detect, bool inVisibleList, return false; } - return u->canSeeOrDetect(this, detect, inVisibleList, is3dDistance); + // player visible for other player if not logout and at same transport + // including case when player is out of world + bool at_same_transport = GetTypeId() == TYPEID_PLAYER && u->GetTypeId()==TYPEID_PLAYER && + !((Player*)this)->GetSession()->PlayerLogout() && !((Player*)u)->GetSession()->PlayerLogout() && + !((Player*)this)->GetSession()->PlayerLoading() && !((Player*)u)->GetSession()->PlayerLoading() && + ((Player*)this)->GetTransport() && ((Player*)this)->GetTransport() == ((Player*)u)->GetTransport(); + + // not in world + if(!at_same_transport && (!IsInWorld() || !u->IsInWorld())) + return false; + + // forbidden to seen (at GM respawn command) + if (m_Visibility == VISIBILITY_RESPAWN) + return false; + + Map& _map = *u->GetMap(); + // Grid dead/alive checks + if (u->GetTypeId()==TYPEID_PLAYER) + { + // non visible at grid for any stealth state + if (!IsVisibleInGridForPlayer((Player *)u)) + return false; + + // if player is dead then he can't detect anyone in any cases + if (!u->isAlive()) + detect = false; + } + else + { + // all dead creatures/players not visible for any creatures + if (!u->isAlive() || !isAlive()) + return false; + } + + // different visible distance checks + if (u->isInFlight()) // what see player in flight + { + // use object grey distance for all (only see objects any way) + if (!IsWithinDistInMap(viewPoint, World::GetMaxVisibleDistanceInFlight()+(inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f), is3dDistance)) + return false; + } + else if (!isAlive()) // distance for show body + { + if (!IsWithinDistInMap(viewPoint, World::GetMaxVisibleDistanceForObject()+(inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f), is3dDistance)) + return false; + } + else if (GetTypeId() == TYPEID_PLAYER) // distance for show player + { + if (u->GetTypeId() == TYPEID_PLAYER) + { + // Players far than max visible distance for player or not in our map are not visible too + if (!at_same_transport && !IsWithinDistInMap(viewPoint, _map.GetVisibilityDistance() + (inVisibleList ? World::GetVisibleUnitGreyDistance() : 0.0f), is3dDistance)) + return false; + } + else + { + // Units far than max visible distance for creature or not in our map are not visible too + if (!IsWithinDistInMap(viewPoint, _map.GetVisibilityDistance() + (inVisibleList ? World::GetVisibleUnitGreyDistance() : 0.0f), is3dDistance)) + return false; + } + } + else if (GetCharmerOrOwnerGUID()) // distance for show pet/charmed + { + // Pet/charmed far than max visible distance for player or not in our map are not visible too + if (!IsWithinDistInMap(viewPoint, _map.GetVisibilityDistance() + (inVisibleList ? World::GetVisibleUnitGreyDistance() : 0.0f), is3dDistance)) + return false; + } + else // distance for show creature + { + // Units far than max visible distance for creature or not in our map are not visible too + if (!IsWithinDistInMap(viewPoint, _map.GetVisibilityDistance() + (inVisibleList ? World::GetVisibleUnitGreyDistance() : 0.0f), is3dDistance)) + return false; + } + + // always seen by owner + if (GetCharmerOrOwnerGUID() == u->GetGUID()) + return true; + + /* + // isInvisibleForAlive() those units can only be seen by dead or if other + // unit is also invisible for alive.. if an isinvisibleforalive unit dies we + // should be able to see it too + if (u->isAlive() && isAlive() && isInvisibleForAlive() != u->isInvisibleForAlive()) + if (u->GetTypeId() != TYPEID_PLAYER || !((Player *)u)->isGameMaster()) + return false; + */ + + // Visible units, always are visible for all units, except for units under invisibility + if (m_Visibility == VISIBILITY_ON && u->m_invisibilityMask==0) + return true; + + // GMs see any players, not higher GMs and all units + if (u->GetTypeId() == TYPEID_PLAYER && ((Player *)u)->isGameMaster()) + { + if(GetTypeId() == TYPEID_PLAYER) + return ((Player *)this)->GetSession()->GetSecurity() <= ((Player *)u)->GetSession()->GetSecurity(); + else + return true; + } + + // non faction visibility non-breakable for non-GMs + if (m_Visibility == VISIBILITY_OFF) + return false; + + // raw invisibility + bool invisible = (m_invisibilityMask != 0 || u->m_invisibilityMask !=0); + + // detectable invisibility case + if (invisible && ( + // Invisible units, always are visible for units under same invisibility type + (m_invisibilityMask & u->m_invisibilityMask)!=0 || + // Invisible units, always are visible for unit that can detect this invisibility (have appropriate level for detect) + u->canDetectInvisibilityOf(this) || + // Units that can detect invisibility always are visible for units that can be detected + canDetectInvisibilityOf(u) )) + { + invisible = false; + } + + // special cases for always overwrite invisibility/stealth + if(invisible || m_Visibility == VISIBILITY_GROUP_STEALTH) + { + // non-hostile case + if (!u->IsHostileTo(this)) + { + // player see other player with stealth/invisibility only if he in same group or raid or same team (raid/team case dependent from conf setting) + if(GetTypeId()==TYPEID_PLAYER && u->GetTypeId()==TYPEID_PLAYER) + { + if(((Player*)this)->IsGroupVisibleFor(((Player*)u))) + return true; + + // else apply same rules as for hostile case (detecting check for stealth) + } + } + // hostile case + else + { + // Hunter mark functionality + AuraList const& auras = GetAurasByType(SPELL_AURA_MOD_STALKED); + for (AuraList::const_iterator iter = auras.begin(); iter != auras.end(); ++iter) + if ((*iter)->GetCasterGUID()==u->GetGUID()) + return true; + + // else apply detecting check for stealth + } + + // none other cases for detect invisibility, so invisible + if (invisible) + return false; + + // else apply stealth detecting check + } + + // unit got in stealth in this moment and must ignore old detected state + //if (m_Visibility == VISIBILITY_GROUP_NO_DETECT) + // return false; + + // GM invisibility checks early, invisibility if any detectable, so if not stealth then visible + if (m_Visibility != VISIBILITY_GROUP_STEALTH) + return true; + + // NOW ONLY STEALTH CASE + + //if in non-detect mode then invisible for unit + //mobs always detect players (detect == true)... return 'false' for those mobs which have (detect == false) + //players detect players only in Player::HandleStealthedUnitsDetection() + if (!detect) + return (u->GetTypeId() == TYPEID_PLAYER) ? ((Player*)u)->HaveAtClient(this) : false; + + // Special cases + + // If is attacked then stealth is lost, some creature can use stealth too + if (!getAttackers().empty()) + return true; + + // If there is collision rogue is seen regardless of level difference + if (IsWithinDist(u,0.24f)) + return true; + + //If a mob or player is stunned he will not be able to detect stealth + if (u->hasUnitState(UNIT_STAT_STUNNED) && (u != this)) + return false; + + // set max ditance + float visibleDistance = (u->GetTypeId() == TYPEID_PLAYER) ? MAX_PLAYER_STEALTH_DETECT_RANGE : ((Creature const*)u)->GetAttackDistance(this); + + //Always invisible from back (when stealth detection is on), also filter max distance cases + bool isInFront = viewPoint->isInFrontInMap(this, visibleDistance); + if (!isInFront) + return false; + + // if doesn't have stealth detection (Shadow Sight), then check how stealthy the unit is, otherwise just check los + if (!u->HasAuraType(SPELL_AURA_DETECT_STEALTH)) + { + //Calculation if target is in front + + //Visible distance based on stealth value (stealth rank 4 300MOD, 10.5 - 3 = 7.5) + visibleDistance = 10.5f - (GetTotalAuraModifier(SPELL_AURA_MOD_STEALTH)/100.0f); + + //Visible distance is modified by + //-Level Diff (every level diff = 1.0f in visible distance) + visibleDistance += int32(u->getLevelForTarget(this)) - int32(getLevelForTarget(u)); + + //This allows to check talent tree and will add addition stealth dependent on used points) + int32 stealthMod = GetTotalAuraModifier(SPELL_AURA_MOD_STEALTH_LEVEL); + if (stealthMod < 0) + stealthMod = 0; + + //-Stealth Mod(positive like Master of Deception) and Stealth Detection(negative like paranoia) + //based on wowwiki every 5 mod we have 1 more level diff in calculation + visibleDistance += (int32(u->GetTotalAuraModifier(SPELL_AURA_MOD_DETECT)) - stealthMod)/5.0f; + visibleDistance = visibleDistance > MAX_PLAYER_STEALTH_DETECT_RANGE ? MAX_PLAYER_STEALTH_DETECT_RANGE : visibleDistance; + + // recheck new distance + if (visibleDistance <= 0 || !IsWithinDist(viewPoint,visibleDistance)) + return false; + } + + // Now check is target visible with LoS + return true; } -bool Unit::canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList, bool is3dDistance) const +bool Unit::canSeeOrDetect(Unit const* u, WorldObject const* viewPoint, bool detect, bool inVisibleList, bool is3dDistance) const { return true; } @@ -9413,10 +9635,39 @@ void Unit::SetVisibility(UnitVisibility x) { m_Visibility = x; - if (x == VISIBILITY_GROUP_STEALTH) - DestroyForNearbyPlayers(); + if (IsInWorld()) + { + // some auras requires visible target + if (/*m_Visibility == VISIBILITY_GROUP_NO_DETECT || */m_Visibility == VISIBILITY_OFF) + { + static const AuraType auratypes[] = {SPELL_AURA_BIND_SIGHT, SPELL_AURA_FAR_SIGHT, SPELL_AURA_NONE}; + for (AuraType const* type = &auratypes[0]; *type != SPELL_AURA_NONE; ++type) + { + AuraList& alist = m_modAuras[*type]; + if(alist.empty()) + continue; - UpdateObjectVisibility(); + for (AuraList::iterator it = alist.begin(); it != alist.end();) + { + Aura* aura = (*it); + Unit* owner = aura->GetCaster(); + if (!owner || !isVisibleForOrDetect(owner,this,false)) + { + RemoveAurasDueToSpell((*it)->GetId()); + it = alist.begin(); + } + else + ++it; + } + } + } + + GetViewPoint().Call_UpdateVisibilityForOwner(); + UpdateObjectVisibility(); + ScheduleAINotify(0); + + GetViewPoint().Event_ViewPointVisibilityChanged(); + } } void Unit::UpdateSpeed(UnitMoveType mtype, bool forced) @@ -9426,7 +9677,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced) float non_stack_bonus = 1.0f; if (GetTypeId() == TYPEID_PLAYER) - ((Player *)this)->m_AC_timer = 2000; + ((Player *)this)->AC.SetTimer(2*IN_MILISECONDS); switch (mtype) { @@ -9543,7 +9794,7 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) return; if (GetTypeId() == TYPEID_PLAYER) - ((Player *)this)->m_AC_timer = 2000; + ((Player *)this)->AC.SetTimer(2*IN_MILISECONDS); m_speed_rate[mtype] = rate; @@ -10037,8 +10288,8 @@ void Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration,Un float mod = 1.0f; - // Some diminishings applies to mobs too (for example, Stun) - if ((GetDiminishingReturnsGroupType(group) == DRTYPE_PLAYER && (targetOwner ? targetOwner->GetTypeId():GetTypeId()) == TYPEID_PLAYER) || GetDiminishingReturnsGroupType(group) == DRTYPE_ALL) + // Some diminishings applies to mobs too (for example, Stun) // Freezing trap exception, since it is casted by GO ? + if ((GetDiminishingReturnsGroupType(group) == DRTYPE_PLAYER && (targetOwner ? targetOwner->GetTypeId():GetTypeId()) == TYPEID_PLAYER) || GetDiminishingReturnsGroupType(group) == DRTYPE_ALL || (tSpell && tSpell->SpellFamilyFlags & 0x00000000008LL)) { DiminishingLevels diminish = Level; switch (diminish) @@ -10103,9 +10354,9 @@ Creature* Unit::GetCreature(uint64 guid) return GetMap()->GetCreature(guid); } -bool Unit::isVisibleForInState(Player const* u, bool inVisibleList) const +bool Unit::isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList ) const { - return isVisibleForOrDetect(u, false, inVisibleList, false); + return isVisibleForOrDetect(u, viewPoint, false, inVisibleList, false); } uint32 Unit::GetCreatureType() const @@ -10526,7 +10777,10 @@ uint32 Unit::GetCreatePowers(Powers power) const void Unit::AddToWorld() { if (!IsInWorld()) + { WorldObject::AddToWorld(); + ScheduleAINotify(0); + } } void Unit::setHover(bool val) @@ -10549,6 +10803,7 @@ void Unit::RemoveFromWorld() { RemoveBindSightAuras(); RemoveNotOwnSingleTargetAuras(); + GetViewPoint().Event_RemovedFromWorld(); WorldObject::RemoveFromWorld(); } @@ -11963,19 +12218,6 @@ bool Unit::preventApplyPersistentAA(SpellEntry const *spellInfo, uint8 eff_index return false; } -void Unit::UpdateObjectVisibility(bool forced) -{ - if (!forced) - AddToNotify(NOTIFY_VISIBILITY_CHANGED); - else - { - WorldObject::UpdateObjectVisibility(true); - // call MoveInLineOfSight for nearby creatures - Trinity::AIRelocationNotifier notifier(*this); - Cell::VisitAllObjects(this, notifier, GetMap()->GetVisibilityDistance()); - } -} - void Unit::Kill(Unit *pVictim, bool durabilityLoss) { pVictim->SetHealth(0); @@ -12500,7 +12742,12 @@ void Unit::SetCharmedOrPossessedBy(Unit* charmer, bool possess) { addUnitState(UNIT_STAT_POSSESSED); SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED); - AddPlayerToVision((Player*)charmer); + + Camera& camera = ((Player*)charmer)->GetCamera(); + camera.SetView(this); + + ((Player*)charmer)->SetMover(this); + ((Player*)charmer)->SetViewport(GetGUID(), true); charmer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); } @@ -12588,7 +12835,11 @@ void Unit::RemoveCharmedOrPossessedBy(Unit *charmer) charmer->SetCharm(0); if (possess) { - RemovePlayerFromVision((Player*)charmer); + Camera& camera = ((Player*)charmer)->GetCamera(); + camera.ResetView(); + + ((Player*)charmer)->SetMover(charmer); + ((Player*)charmer)->SetViewport(charmer->GetGUID(), true); charmer->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); } @@ -12806,7 +13057,7 @@ void Unit::KnockBackFrom(Unit* target, float horizintalSpeed, float verticalSpee data << float(-verticalSpeed); // Z Movement speed (vertical) ((Player*)this)->GetSession()->SendPacket(&data); - ((Player*)this)->m_AC_timer = 5 *IN_MILISECONDS; + ((Player*)this)->AC.SetTimer(5*IN_MILISECONDS); } else { @@ -12892,3 +13143,62 @@ Unit* Unit::GetNextRandomRaidMember(float radius) uint32 randTarget = GetMap()->urand(0,nearMembers.size()-1); return nearMembers[randTarget]; } + +class RelocationNotifyEvent : public BasicEvent +{ +public: + RelocationNotifyEvent(Unit& owner) : BasicEvent(), m_owner(owner) + { + m_owner._SetAINotifyScheduled(true); + } + + bool Execute(uint64 /*e_time*/, uint32 /*p_time*/) + { + float radius = m_owner.GetMap()->GetVisibilityDistance(); + if (m_owner.GetTypeId() == TYPEID_PLAYER) + { + Trinity::PlayerRelocationNotifier notify((Player&)m_owner); + Cell::VisitAllObjects(&m_owner,notify,radius); + } + else //if(m_owner.GetTypeId() == TYPEID_UNIT) + { + Trinity::CreatureRelocationNotifier notify((Creature&)m_owner); + Cell::VisitAllObjects(&m_owner,notify,radius); + } + m_owner._SetAINotifyScheduled(false); + return true; + } + + void Abort(uint64) + { + m_owner._SetAINotifyScheduled(false); + } + +private: + Unit& m_owner; +}; + +void Unit::ScheduleAINotify(uint32 delay) +{ + if (!IsAINotifyScheduled()) + m_Events.AddEvent(new RelocationNotifyEvent(*this), m_Events.CalculateTime(delay)); +} + +void Unit::OnRelocated() +{ + // switch to use G3D::Vector3 is good idea, maybe + float dx = m_last_notified_position.x - GetPositionX(); + float dy = m_last_notified_position.y - GetPositionY(); + float dz = m_last_notified_position.z - GetPositionZ(); + float distsq = dx*dx+dy*dy+dz*dz; + if (distsq > World::GetRelocationLowerLimitSq()) + { + m_last_notified_position.x = GetPositionX(); + m_last_notified_position.y = GetPositionY(); + m_last_notified_position.z = GetPositionZ(); + + GetViewPoint().Call_UpdateVisibilityForOwner(); + UpdateObjectVisibility(); + } + ScheduleAINotify(World::GetRelocationAINotifyDelay()); +} diff --git a/src/game/Unit.h b/src/game/Unit.h index 3d7a02915..50a861bea 100755 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1452,15 +1452,21 @@ class TRINITY_DLL_SPEC Unit : public WorldObject void SetVisibility(UnitVisibility x); void DestroyForNearbyPlayers(); + void ScheduleAINotify(uint32 delay); + bool IsAINotifyScheduled() const { return m_AINotifyScheduled;} + void _SetAINotifyScheduled(bool on) { m_AINotifyScheduled = on;} // only for call from RelocationNotifyEvent class code + void OnRelocated(); + // common function for visibility checks for player/creatures with detection code - virtual bool canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList = false, bool is3dDistance = true) const; - bool isVisibleForOrDetect(Unit const* u, bool detect, bool inVisibleList = false, bool is3dDistance = true) const; + bool canSeeOrDetect(Unit const* u, WorldObject const* viewPoint, bool detect, bool inVisibleList = false, bool is3dDistance = true) const; + bool isVisibleForOrDetect(Unit const* u, WorldObject const* viewPoint, bool detect, bool inVisibleList = false, bool is3dDistance = true) const; + bool canDetectInvisibilityOf(Unit const* u) const; bool canDetectStealthOf(Unit const* u, float distance) const; - void UpdateObjectVisibility(bool forced = true); // virtual functions for all world objects types - bool isVisibleForInState(Player const* u, bool inVisibleList) const; + bool isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList) const; + // function for low level grid visibility checks in player/creature cases virtual bool IsVisibleInGridForPlayer(Player const* pl) const = 0; @@ -1732,6 +1738,8 @@ class TRINITY_DLL_SPEC Unit : public WorldObject uint32 m_lastManaUse; // msecs UnitVisibility m_Visibility; + Position m_last_notified_position; + bool m_AINotifyScheduled; Diminishing m_Diminishing; // Manage all Units threatening us diff --git a/src/game/World.cpp b/src/game/World.cpp index ca0b25bb6..f64b5d8fa 100755 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -86,9 +86,8 @@ float World::m_MaxVisibleDistanceInFlight = DEFAULT_VISIBILITY_DISTANCE; float World::m_VisibleUnitGreyDistance = 0; float World::m_VisibleObjectGreyDistance = 0; -int32 World::m_visibility_notify_periodOnContinents = DEFAULT_VISIBILITY_NOTIFY_PERIOD; -int32 World::m_visibility_notify_periodInInstances = DEFAULT_VISIBILITY_NOTIFY_PERIOD; -int32 World::m_visibility_notify_periodInBGArenas = DEFAULT_VISIBILITY_NOTIFY_PERIOD; +float World::m_relocation_lower_limit_sq = 10.f * 10.f; +uint32 World::m_relocation_ai_notify_delay = 1000u; // ServerMessages.dbc enum ServerMessageType @@ -1147,9 +1146,8 @@ void World::LoadConfigSettings(bool reload) m_MaxVisibleDistance = m_MaxVisibleDistanceInFlight; m_MaxVisibleDistance += 1.0f; - m_visibility_notify_periodOnContinents = sConfig.GetIntDefault("Visibility.Notify.Period.OnContinents", DEFAULT_VISIBILITY_NOTIFY_PERIOD); - m_visibility_notify_periodInInstances = sConfig.GetIntDefault("Visibility.Notify.Period.InInstances", DEFAULT_VISIBILITY_NOTIFY_PERIOD); - m_visibility_notify_periodInBGArenas = sConfig.GetIntDefault("Visibility.Notify.Period.InBGArenas", DEFAULT_VISIBILITY_NOTIFY_PERIOD); + m_relocation_ai_notify_delay = sConfig.GetIntDefault("Visibility.AIRelocationNotifyDelay", 1000u); + m_relocation_lower_limit_sq = pow(sConfig.GetFloatDefault("Visibility.RelocationLowerLimit",10), 2); ///- Read the "Data" directory from the config file std::string dataPath = sConfig.GetStringDefault("DataDir","./"); diff --git a/src/game/World.h b/src/game/World.h index 8da40ef99..974d50055 100755 --- a/src/game/World.h +++ b/src/game/World.h @@ -557,9 +557,8 @@ class World static float GetVisibleUnitGreyDistance() { return m_VisibleUnitGreyDistance; } static float GetVisibleObjectGreyDistance() { return m_VisibleObjectGreyDistance; } - static int32 GetVisibilityNotifyPeriodOnContinents(){ return m_visibility_notify_periodOnContinents; } - static int32 GetVisibilityNotifyPeriodInInstances() { return m_visibility_notify_periodInInstances; } - static int32 GetVisibilityNotifyPeriodInBGArenas() { return m_visibility_notify_periodInBGArenas; } + static float GetRelocationLowerLimitSq() { return m_relocation_lower_limit_sq; } + static uint32 GetRelocationAINotifyDelay() { return m_relocation_ai_notify_delay; } void ProcessCliCommands(); void QueueCliCommand(CliCommandHolder::Print* zprintf, char const* input) { cliCmdQueue.add(new CliCommandHolder(input, zprintf)); } @@ -650,9 +649,8 @@ class World static float m_VisibleUnitGreyDistance; static float m_VisibleObjectGreyDistance; - static int32 m_visibility_notify_periodOnContinents; - static int32 m_visibility_notify_periodInInstances; - static int32 m_visibility_notify_periodInBGArenas; + static float m_relocation_lower_limit_sq; + static uint32 m_relocation_ai_notify_delay; // CLI command holder to be thread safe ACE_Based::LockedQueue cliCmdQueue; diff --git a/src/trinitycore/trinitycore.conf.dist b/src/trinitycore/trinitycore.conf.dist index 1c5320c87..169948ad7 100755 --- a/src/trinitycore/trinitycore.conf.dist +++ b/src/trinitycore/trinitycore.conf.dist @@ -1062,9 +1062,8 @@ Visibility.Distance.InFlight = 132 Visibility.Distance.Grey.Unit = 1 Visibility.Distance.Grey.Object = 10 -Visibility.Notify.Period.OnContinents = 1000 -Visibility.Notify.Period.InInstances = 1000 -Visibility.Notify.Period.InBGArenas = 1000 +Visibility.RelocationLowerLimit = 10 +Visibility.AIRelocationNotifyDelay = 1000 ################################################################################################################### # SERVER RATES diff --git a/win/VC10/framework.vcxproj.filters b/win/VC10/framework.vcxproj.filters index 3f8fd52f8..c4ff521d2 100644 --- a/win/VC10/framework.vcxproj.filters +++ b/win/VC10/framework.vcxproj.filters @@ -1,129 +1,129 @@ - - - - - {feb15d50-f0a3-4a2a-be7e-cbfa9d02889e} - - - {f2d2bef6-6a93-42f4-a584-9d867aab6556} - - - {c3ad9113-9ee0-45b8-b882-24d54944f5c5} - - - {0c0c43dc-afd1-4c7b-90b6-5f378e5df497} - - - {a6f2daca-058f-4177-a4ff-ea7b8e640be2} - - - {48355845-199f-4c2d-95b9-587c1093496d} - - - {f8206e13-7039-440b-bb6a-086842279ac3} - - - {1865822a-6c08-4c8a-8336-d8a434382a36} - - - - - GameSystem - - - GameSystem - - - GameSystem - - - GameSystem - - - GameSystem - - - GameSystem - - - GameSystem - - - GameSystem - - - Platform - - - Platform - - - Policies - - - Policies - - - Policies - - - Policies - - - Policies - - - Utilities - - - Utilities - - - Utilities - - - Utilities - - - Utilities - - - Utilities - - - Utilities\CountedReference - - - Utilities\CountedReference - - - Utilities\CountedReference - - - Utilities\LinkedReference - - - Utilities\LinkedReference - - - Dynamic - - - Dynamic - - - Network - - - - - Policies - - - Policies - - - Utilities - - + + + + + {feb15d50-f0a3-4a2a-be7e-cbfa9d02889e} + + + {f2d2bef6-6a93-42f4-a584-9d867aab6556} + + + {c3ad9113-9ee0-45b8-b882-24d54944f5c5} + + + {0c0c43dc-afd1-4c7b-90b6-5f378e5df497} + + + {a6f2daca-058f-4177-a4ff-ea7b8e640be2} + + + {48355845-199f-4c2d-95b9-587c1093496d} + + + {f8206e13-7039-440b-bb6a-086842279ac3} + + + {1865822a-6c08-4c8a-8336-d8a434382a36} + + + + + GameSystem + + + GameSystem + + + GameSystem + + + GameSystem + + + GameSystem + + + GameSystem + + + GameSystem + + + GameSystem + + + Platform + + + Platform + + + Policies + + + Policies + + + Policies + + + Policies + + + Policies + + + Utilities + + + Utilities + + + Utilities + + + Utilities + + + Utilities + + + Utilities + + + Utilities\CountedReference + + + Utilities\CountedReference + + + Utilities\CountedReference + + + Utilities\LinkedReference + + + Utilities\LinkedReference + + + Dynamic + + + Dynamic + + + Network + + + + + Policies + + + Policies + + + Utilities + + \ No newline at end of file diff --git a/win/VC10/game.vcxproj b/win/VC10/game.vcxproj index 8d443ddfd..b7abc6d29 100644 --- a/win/VC10/game.vcxproj +++ b/win/VC10/game.vcxproj @@ -229,6 +229,7 @@ + @@ -378,6 +379,7 @@ + diff --git a/win/VC10/game.vcxproj.filters b/win/VC10/game.vcxproj.filters index e102e1e89..0cdd8c1b6 100644 --- a/win/VC10/game.vcxproj.filters +++ b/win/VC10/game.vcxproj.filters @@ -493,6 +493,9 @@ Warden + + Objects + @@ -922,5 +925,8 @@ Warden + + Objects + \ No newline at end of file diff --git a/win/VC10/tbb.vcxproj b/win/VC10/tbb.vcxproj index 9212ae33d..a64f74312 100644 --- a/win/VC10/tbb.vcxproj +++ b/win/VC10/tbb.vcxproj @@ -1,475 +1,475 @@ - - - - - Debug_NoPCH - Win32 - - - Debug_NoPCH - x64 - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {F62787DD-1327-448B-9818-030062BCFAA5} - tbb - Win32Proj - - - - DynamicLibrary - NotSet - - - DynamicLibrary - NotSet - true - - - DynamicLibrary - NotSet - - - DynamicLibrary - NotSet - - - DynamicLibrary - NotSet - true - - - DynamicLibrary - NotSet - - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - .\tbb__$(Platform)_$(Configuration)\ - .\tbb__$(Platform)_$(Configuration)\ - false - .\tbb__$(Platform)_$(Configuration)\ - .\tbb__$(Platform)_$(Configuration)\ - false - .\tbb__$(Platform)_$(Configuration)\ - .\tbb__$(Platform)_$(Configuration)\ - false - .\tbb__$(Platform)_$(Configuration)\ - .\tbb__$(Platform)_$(Configuration)\ - false - .\tbb__$(Platform)_$(Configuration)\ - .\tbb__$(Platform)_$(Configuration)\ - false - .\tbb__$(Platform)_$(Configuration)\ - .\tbb__$(Platform)_$(Configuration)\ - false - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - - - - /c /MDd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /DDO_ITT_ANNOTATE /D_USE_RTM_VERSION /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /W4 /I../../src /I../../include %(AdditionalOptions) - Disabled - ..\..\dep\tbb\include;..\..\dep\tbb\src;..\..\dep\tbb\build;..\..\dep\tbb\build\vsproject;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level4 - ProgramDatabase - - - /DLL /MAP /DEBUG /fixed:no /INCREMENTAL:NO /DEF:$(IntDir)tbb.def %(AdditionalOptions) - ..\..\dep\lib\$(Platform)_$(Configuration)\tbb_debug.dll - true - Windows - false - - - MachineX86 - - - - - X64 - - - /c /MDd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /DDO_ITT_ANNOTATE /D_USE_RTM_VERSION /GS- /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /W4 /I../../src /I../../include %(AdditionalOptions) - Disabled - ..\..\dep\tbb\include;..\..\dep\tbb\src;..\..\dep\tbb\build;..\..\dep\tbb\build\vsproject;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level4 - ProgramDatabase - false - - - /nologo /DLL /MAP /DEBUG /fixed:no /INCREMENTAL:NO /DEF:$(IntDir)tbb.def %(AdditionalOptions) - ..\..\dep\lib\$(Platform)_$(Configuration)\tbb_debug.dll - true - Windows - false - - - MachineX64 - - - - - /c /MD /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /Oy /D_USE_RTM_VERSION /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /W4 /I../../src /I../../include %(AdditionalOptions) - ..\..\dep\tbb\include;..\..\dep\tbb\src;..\..\dep\tbb\build;..\..\dep\tbb\build\vsproject;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MultiThreadedDLL - - - Level4 - ProgramDatabase - - - /nologo /DLL /MAP /DEBUG /fixed:no /INCREMENTAL:NO /DEF:$(IntDir)tbb.def %(AdditionalOptions) - ..\..\dep\lib\$(Platform)_$(Configuration)\tbb.dll - true - Windows - true - true - false - - - MachineX86 - - - - - X64 - - - /c /MD /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /D_USE_RTM_VERSION /GS- /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /W4 /I../../src /I../../include %(AdditionalOptions) - ..\..\dep\tbb\include;..\..\dep\tbb\src;..\..\dep\tbb\build;..\..\dep\tbb\build\vsproject;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MultiThreadedDLL - - - Level4 - ProgramDatabase - - - /nologo /DLL /MAP /DEBUG /fixed:no /INCREMENTAL:NO /DEF:$(IntDir)tbb.def %(AdditionalOptions) - ..\..\dep\lib\$(Platform)_$(Configuration)\tbb.dll - true - Windows - true - true - false - - - MachineX64 - - - - - /c /MDd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /DDO_ITT_ANNOTATE /D_USE_RTM_VERSION /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /W4 /I../../src /I../../include %(AdditionalOptions) - Disabled - ..\..\dep\tbb\include;..\..\dep\tbb\src;..\..\dep\tbb\build;..\..\dep\tbb\build\vsproject;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level4 - ProgramDatabase - - - /DLL /MAP /DEBUG /fixed:no /INCREMENTAL:NO /DEF:$(IntDir)tbb.def %(AdditionalOptions) - ..\..\dep\lib\$(Platform)_debug\tbb_debug.dll - true - Windows - false - - - MachineX86 - - - - - X64 - - - /c /MDd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /DDO_ITT_ANNOTATE /D_USE_RTM_VERSION /GS- /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /W4 /I../../src /I../../include %(AdditionalOptions) - Disabled - ..\..\dep\tbb\include;..\..\dep\tbb\src;..\..\dep\tbb\build;..\..\dep\tbb\build\vsproject;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level4 - ProgramDatabase - false - - - /nologo /DLL /MAP /DEBUG /fixed:no /INCREMENTAL:NO /DEF:$(IntDir)tbb.def %(AdditionalOptions) - ..\..\dep\lib\$(Platform)_debug\tbb_debug.dll - true - Windows - false - - - MachineX64 - - - - - /coff /Zi - true - /coff /Zi - /coff /Zi - true - /coff /Zi - true - - - true - building atomic_support.obj - ml64 /Fo"tbb__$(Platform)_$(Configuration)\atomic_support.obj" /DUSE_FRAME_POINTER /DEM64T=1 /c /Zi ../../dep/tbb/src/tbb/intel64-masm/atomic_support.asm - - tbb__$(Platform)_$(Configuration)\atomic_support.obj;%(Outputs) - true - building atomic_support.obj - ml64 /Fo"tbb__$(Platform)_$(Configuration)\atomic_support.obj" /DUSE_FRAME_POINTER /DEM64T=1 /c /Zi ../../dep/tbb/src/tbb/intel64-masm/atomic_support.asm - - tbb__$(Platform)_$(Configuration)\atomic_support.obj;%(Outputs) - true - building atomic_support.obj - ml64 /Fo"tbb__$(Platform)_$(Configuration)\atomic_support.obj" /DEM64T=1 /c /Zi ../../dep/tbb/src/tbb/intel64-masm/atomic_support.asm - - tbb__$(Platform)_$(Configuration)\atomic_support.obj;%(Outputs) - - - /coff /Zi - true - /coff /Zi - /coff /Zi - true - /coff /Zi - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - generating tbb.def file - cl /nologo /TC /EP ../../dep/tbb/src/tbb/win32-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /I../../dep/tbb/src /I../../dep/tbb/include >$(IntDir)tbb.def - - .\tbb__$(Platform)_$(Configuration)\tbb.def;%(Outputs) - true - generating tbb.def file - cl /nologo /TC /EP ../../src/tbb/win32-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbb.def - - $(IntDir)tbb.def;%(Outputs) - generating tbb.def file - cl /nologo /TC /EP ../../dep/tbb/src/tbb/win32-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /I../../dep/tbb/src /I../../dep/tbb/include >$(IntDir)tbb.def - - .\tbb__$(Platform)_$(Configuration)\tbb.def;%(Outputs) - true - generating tbb.def file - cl /nologo /TC /EP ../../src/tbb/win32-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbb.def - - $(IntDir)tbb.def;%(Outputs) - generating tbb.def file - cl /nologo /TC /EP ../../dep/tbb/src/tbb/win32-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /I../../dep/tbb/src /I../../dep/tbb/include >$(IntDir)tbb.def - - .\tbb__$(Platform)_$(Configuration)\tbb.def;%(Outputs) - true - generating tbb.def file - cl /nologo /TC /EP ../../src/tbb/win32-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbb.def - - $(IntDir)tbb.def;%(Outputs) - - - true - generating tbb.def file - cl /nologo /TC /EP ../../src/tbb/win64-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbb.def - - $(IntDir)tbb.def;%(Outputs) - generating tbb.def file - cl /nologo /TC /EP ../../dep/tbb/src/tbb/win64-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /I../../dep/tbb/src /I../../dep/tbb/include >$(IntDir)tbb.def - - ..\..\bin\$(Platform)_$(Configuration)\tbb.def;%(Outputs) - true - generating tbb.def file - cl /nologo /TC /EP ../../src/tbb/win64-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbb.def - - $(IntDir)tbb.def;%(Outputs) - generating tbb.def file - cl /nologo /TC /EP ../../dep/tbb/src/tbb/win64-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /I../../dep/tbb/src /I../../dep/tbb/include >$(IntDir)tbb.def - - ..\..\bin\$(Platform)_$(Configuration)\tbb.def;%(Outputs) - true - generating tbb.def file - cl /nologo /TC /EP ../../src/tbb/win64-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbb.def - - $(IntDir)tbb.def;%(Outputs) - generating tbb.def file - cl /nologo /TC /EP ../../dep/tbb/src/tbb/win64-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /I../../dep/tbb/src /I../../dep/tbb/include >$(IntDir)tbb.def - - ..\..\bin\$(Platform)_$(Configuration)\tbb.def;%(Outputs) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /I../../src /I../../include /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 %(AdditionalOptions) - /I../../src /I../../include /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 %(AdditionalOptions) - /I../../src /I../../include /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 %(AdditionalOptions) - /I../../src /I../../include /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 %(AdditionalOptions) - /I../../src /I../../include /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 %(AdditionalOptions) - /I../../src /I../../include /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 %(AdditionalOptions) - - - - - - + + + + + Debug_NoPCH + Win32 + + + Debug_NoPCH + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {F62787DD-1327-448B-9818-030062BCFAA5} + tbb + Win32Proj + + + + DynamicLibrary + NotSet + + + DynamicLibrary + NotSet + true + + + DynamicLibrary + NotSet + + + DynamicLibrary + NotSet + + + DynamicLibrary + NotSet + true + + + DynamicLibrary + NotSet + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + .\tbb__$(Platform)_$(Configuration)\ + .\tbb__$(Platform)_$(Configuration)\ + false + .\tbb__$(Platform)_$(Configuration)\ + .\tbb__$(Platform)_$(Configuration)\ + false + .\tbb__$(Platform)_$(Configuration)\ + .\tbb__$(Platform)_$(Configuration)\ + false + .\tbb__$(Platform)_$(Configuration)\ + .\tbb__$(Platform)_$(Configuration)\ + false + .\tbb__$(Platform)_$(Configuration)\ + .\tbb__$(Platform)_$(Configuration)\ + false + .\tbb__$(Platform)_$(Configuration)\ + .\tbb__$(Platform)_$(Configuration)\ + false + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + /c /MDd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /DDO_ITT_ANNOTATE /D_USE_RTM_VERSION /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /W4 /I../../src /I../../include %(AdditionalOptions) + Disabled + ..\..\dep\tbb\include;..\..\dep\tbb\src;..\..\dep\tbb\build;..\..\dep\tbb\build\vsproject;%(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level4 + ProgramDatabase + + + /DLL /MAP /DEBUG /fixed:no /INCREMENTAL:NO /DEF:$(IntDir)tbb.def %(AdditionalOptions) + ..\..\dep\lib\$(Platform)_$(Configuration)\tbb_debug.dll + true + Windows + false + + + MachineX86 + + + + + X64 + + + /c /MDd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /DDO_ITT_ANNOTATE /D_USE_RTM_VERSION /GS- /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /W4 /I../../src /I../../include %(AdditionalOptions) + Disabled + ..\..\dep\tbb\include;..\..\dep\tbb\src;..\..\dep\tbb\build;..\..\dep\tbb\build\vsproject;%(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level4 + ProgramDatabase + false + + + /nologo /DLL /MAP /DEBUG /fixed:no /INCREMENTAL:NO /DEF:$(IntDir)tbb.def %(AdditionalOptions) + ..\..\dep\lib\$(Platform)_$(Configuration)\tbb_debug.dll + true + Windows + false + + + MachineX64 + + + + + /c /MD /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /Oy /D_USE_RTM_VERSION /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /W4 /I../../src /I../../include %(AdditionalOptions) + ..\..\dep\tbb\include;..\..\dep\tbb\src;..\..\dep\tbb\build;..\..\dep\tbb\build\vsproject;%(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MultiThreadedDLL + + + Level4 + ProgramDatabase + + + /nologo /DLL /MAP /DEBUG /fixed:no /INCREMENTAL:NO /DEF:$(IntDir)tbb.def %(AdditionalOptions) + ..\..\dep\lib\$(Platform)_$(Configuration)\tbb.dll + true + Windows + true + true + false + + + MachineX86 + + + + + X64 + + + /c /MD /O2 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /D_USE_RTM_VERSION /GS- /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /W4 /I../../src /I../../include %(AdditionalOptions) + ..\..\dep\tbb\include;..\..\dep\tbb\src;..\..\dep\tbb\build;..\..\dep\tbb\build\vsproject;%(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MultiThreadedDLL + + + Level4 + ProgramDatabase + + + /nologo /DLL /MAP /DEBUG /fixed:no /INCREMENTAL:NO /DEF:$(IntDir)tbb.def %(AdditionalOptions) + ..\..\dep\lib\$(Platform)_$(Configuration)\tbb.dll + true + Windows + true + true + false + + + MachineX64 + + + + + /c /MDd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /DDO_ITT_ANNOTATE /D_USE_RTM_VERSION /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /W4 /I../../src /I../../include %(AdditionalOptions) + Disabled + ..\..\dep\tbb\include;..\..\dep\tbb\src;..\..\dep\tbb\build;..\..\dep\tbb\build\vsproject;%(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level4 + ProgramDatabase + + + /DLL /MAP /DEBUG /fixed:no /INCREMENTAL:NO /DEF:$(IntDir)tbb.def %(AdditionalOptions) + ..\..\dep\lib\$(Platform)_debug\tbb_debug.dll + true + Windows + false + + + MachineX86 + + + + + X64 + + + /c /MDd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /DDO_ITT_ANNOTATE /D_USE_RTM_VERSION /GS- /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /W4 /I../../src /I../../include %(AdditionalOptions) + Disabled + ..\..\dep\tbb\include;..\..\dep\tbb\src;..\..\dep\tbb\build;..\..\dep\tbb\build\vsproject;%(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level4 + ProgramDatabase + false + + + /nologo /DLL /MAP /DEBUG /fixed:no /INCREMENTAL:NO /DEF:$(IntDir)tbb.def %(AdditionalOptions) + ..\..\dep\lib\$(Platform)_debug\tbb_debug.dll + true + Windows + false + + + MachineX64 + + + + + /coff /Zi + true + /coff /Zi + /coff /Zi + true + /coff /Zi + true + + + true + building atomic_support.obj + ml64 /Fo"tbb__$(Platform)_$(Configuration)\atomic_support.obj" /DUSE_FRAME_POINTER /DEM64T=1 /c /Zi ../../dep/tbb/src/tbb/intel64-masm/atomic_support.asm + + tbb__$(Platform)_$(Configuration)\atomic_support.obj;%(Outputs) + true + building atomic_support.obj + ml64 /Fo"tbb__$(Platform)_$(Configuration)\atomic_support.obj" /DUSE_FRAME_POINTER /DEM64T=1 /c /Zi ../../dep/tbb/src/tbb/intel64-masm/atomic_support.asm + + tbb__$(Platform)_$(Configuration)\atomic_support.obj;%(Outputs) + true + building atomic_support.obj + ml64 /Fo"tbb__$(Platform)_$(Configuration)\atomic_support.obj" /DEM64T=1 /c /Zi ../../dep/tbb/src/tbb/intel64-masm/atomic_support.asm + + tbb__$(Platform)_$(Configuration)\atomic_support.obj;%(Outputs) + + + /coff /Zi + true + /coff /Zi + /coff /Zi + true + /coff /Zi + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + generating tbb.def file + cl /nologo /TC /EP ../../dep/tbb/src/tbb/win32-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /I../../dep/tbb/src /I../../dep/tbb/include >$(IntDir)tbb.def + + .\tbb__$(Platform)_$(Configuration)\tbb.def;%(Outputs) + true + generating tbb.def file + cl /nologo /TC /EP ../../src/tbb/win32-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbb.def + + $(IntDir)tbb.def;%(Outputs) + generating tbb.def file + cl /nologo /TC /EP ../../dep/tbb/src/tbb/win32-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /I../../dep/tbb/src /I../../dep/tbb/include >$(IntDir)tbb.def + + .\tbb__$(Platform)_$(Configuration)\tbb.def;%(Outputs) + true + generating tbb.def file + cl /nologo /TC /EP ../../src/tbb/win32-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbb.def + + $(IntDir)tbb.def;%(Outputs) + generating tbb.def file + cl /nologo /TC /EP ../../dep/tbb/src/tbb/win32-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /I../../dep/tbb/src /I../../dep/tbb/include >$(IntDir)tbb.def + + .\tbb__$(Platform)_$(Configuration)\tbb.def;%(Outputs) + true + generating tbb.def file + cl /nologo /TC /EP ../../src/tbb/win32-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbb.def + + $(IntDir)tbb.def;%(Outputs) + + + true + generating tbb.def file + cl /nologo /TC /EP ../../src/tbb/win64-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbb.def + + $(IntDir)tbb.def;%(Outputs) + generating tbb.def file + cl /nologo /TC /EP ../../dep/tbb/src/tbb/win64-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /I../../dep/tbb/src /I../../dep/tbb/include >$(IntDir)tbb.def + + ..\..\bin\$(Platform)_$(Configuration)\tbb.def;%(Outputs) + true + generating tbb.def file + cl /nologo /TC /EP ../../src/tbb/win64-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbb.def + + $(IntDir)tbb.def;%(Outputs) + generating tbb.def file + cl /nologo /TC /EP ../../dep/tbb/src/tbb/win64-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /I../../dep/tbb/src /I../../dep/tbb/include >$(IntDir)tbb.def + + ..\..\bin\$(Platform)_$(Configuration)\tbb.def;%(Outputs) + true + generating tbb.def file + cl /nologo /TC /EP ../../src/tbb/win64-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbb.def + + $(IntDir)tbb.def;%(Outputs) + generating tbb.def file + cl /nologo /TC /EP ../../dep/tbb/src/tbb/win64-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /I../../dep/tbb/src /I../../dep/tbb/include >$(IntDir)tbb.def + + ..\..\bin\$(Platform)_$(Configuration)\tbb.def;%(Outputs) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /I../../src /I../../include /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 %(AdditionalOptions) + /I../../src /I../../include /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 %(AdditionalOptions) + /I../../src /I../../include /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 %(AdditionalOptions) + /I../../src /I../../include /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 %(AdditionalOptions) + /I../../src /I../../include /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 %(AdditionalOptions) + /I../../src /I../../include /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 %(AdditionalOptions) + + + + + + \ No newline at end of file diff --git a/win/VC10/tbbmalloc.vcxproj b/win/VC10/tbbmalloc.vcxproj index 942a5b70f..204551ea2 100644 --- a/win/VC10/tbbmalloc.vcxproj +++ b/win/VC10/tbbmalloc.vcxproj @@ -1,462 +1,462 @@ - - - - - Debug_NoPCH - Win32 - - - Debug_NoPCH - x64 - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {B15F131E-328A-4D42-ADC2-9FF4CA6306D8} - tbbmalloc - Win32Proj - - - - DynamicLibrary - NotSet - - - DynamicLibrary - NotSet - true - - - DynamicLibrary - NotSet - - - DynamicLibrary - NotSet - - - DynamicLibrary - NotSet - true - - - DynamicLibrary - NotSet - - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - .\tbbmalloc__$(Platform)_$(Configuration)\ - .\tbbmalloc__$(Platform)_$(Configuration)\ - false - .\tbbmalloc__$(Platform)_$(Configuration)\ - .\tbbmalloc__$(Platform)_$(Configuration)\ - false - .\tbbmalloc__$(Platform)_$(Configuration)\ - .\tbbmalloc__$(Platform)_$(Configuration)\ - false - .\tbbmalloc__$(Platform)_$(Configuration)\ - .\tbbmalloc__$(Platform)_$(Configuration)\ - false - .\tbbmalloc__$(Platform)_$(Configuration)\ - .\tbbmalloc__$(Platform)_$(Configuration)\ - false - .\tbbmalloc__$(Platform)_$(Configuration)\ - .\tbbmalloc__$(Platform)_$(Configuration)\ - false - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - - - - /c /MDd /Od /Ob0 /Zi /EHs- /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /I../../src /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc %(AdditionalOptions) - Disabled - ..\..\dep\tbb\include;..\..\dep\tbb\src;..\..\dep\tbb\build;..\..\dep\tbb\build\vsproject;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Default - MultiThreadedDebugDLL - - - Level3 - false - ProgramDatabase - 4244;4267;%(DisableSpecificWarnings) - - - /DLL /MAP /DEBUG /fixed:no /INCREMENTAL:NO /DEF:$(IntDir)tbbmalloc.def %(AdditionalOptions) - ..\..\dep\lib\$(Platform)_$(Configuration)\tbbmalloc_debug.dll - true - Windows - false - - - MachineX86 - - - - - X64 - - - /c /MDd /Od /Ob0 /Zi /EHs- /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /GS- /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /I../../src /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc %(AdditionalOptions) - Disabled - ..\..\dep\tbb\include;..\..\dep\tbb\src;..\..\dep\tbb\build;..\..\dep\tbb\build\vsproject;%(AdditionalIncludeDirectories) - - - Default - MultiThreadedDebugDLL - true - - - Level3 - false - ProgramDatabase - 4244;4267;%(DisableSpecificWarnings) - false - - - /nologo /DLL /MAP /DEBUG /fixed:no /INCREMENTAL:NO /DEF:$(IntDir)tbbmalloc.def %(AdditionalOptions) - ..\..\dep\lib\$(Platform)_$(Configuration)\tbbmalloc_debug.dll - true - Windows - false - - - MachineX64 - - - - - /c /MD /O2 /Zi /EHs- /Zc:forScope /Zc:wchar_t /Oy /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /I../../src /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc %(AdditionalOptions) - ..\..\dep\tbb\include;..\..\dep\tbb\src;..\..\dep\tbb\build;..\..\dep\tbb\build\vsproject;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - MultiThreadedDLL - - - Level3 - false - ProgramDatabase - 4244;4267;%(DisableSpecificWarnings) - - - /nologo /DLL /MAP /DEBUG /fixed:no /INCREMENTAL:NO /DEF:$(IntDir)tbbmalloc.def %(AdditionalOptions) - ..\..\dep\lib\$(Platform)_$(Configuration)\tbbmalloc.dll - true - Windows - true - true - false - - - MachineX86 - - - - - X64 - - - /c /MD /O2 /Zi /EHs- /Zc:forScope /Zc:wchar_t /GS- /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /I../../src /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc %(AdditionalOptions) - ..\..\dep\tbb\include;..\..\dep\tbb\src;..\..\dep\tbb\build;..\..\dep\tbb\build\vsproject;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - MultiThreadedDLL - - - Level3 - false - ProgramDatabase - 4244;4267;%(DisableSpecificWarnings) - - - /nologo /DLL /MAP /DEBUG /fixed:no /INCREMENTAL:NO /DEF:$(IntDir)tbbmalloc.def %(AdditionalOptions) - ..\..\dep\lib\$(Platform)_$(Configuration)\tbbmalloc.dll - true - Windows - true - true - false - - - MachineX64 - - - - - /c /MDd /Od /Ob0 /Zi /EHs- /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /I../../src /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc %(AdditionalOptions) - Disabled - ..\..\dep\tbb\include;..\..\dep\tbb\src;..\..\dep\tbb\build;..\..\dep\tbb\build\vsproject;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Default - MultiThreadedDebugDLL - - - Level3 - false - ProgramDatabase - 4244;4267;%(DisableSpecificWarnings) - - - /DLL /MAP /DEBUG /fixed:no /INCREMENTAL:NO /DEF:$(IntDir)tbbmalloc.def %(AdditionalOptions) - ..\..\dep\lib\$(Platform)_debug\tbbmalloc_debug.dll - true - Windows - false - - - MachineX86 - - - - - X64 - - - /c /MDd /Od /Ob0 /Zi /EHs- /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /GS- /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /I../../src /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc %(AdditionalOptions) - Disabled - ..\..\dep\tbb\include;..\..\dep\tbb\src;..\..\dep\tbb\build;..\..\dep\tbb\build\vsproject;%(AdditionalIncludeDirectories) - - - Default - MultiThreadedDebugDLL - true - - - Level3 - false - ProgramDatabase - 4244;4267;%(DisableSpecificWarnings) - false - - - /nologo /DLL /MAP /DEBUG /fixed:no /INCREMENTAL:NO /DEF:$(IntDir)tbbmalloc.def %(AdditionalOptions) - ..\..\dep\lib\$(Platform)_debug\tbbmalloc_debug.dll - true - Windows - false - - - MachineX64 - - - - - true - building atomic_support.obj - ml64 /Fo"tbbmalloc__$(Platform)_$(Configuration)\atomic_support.obj" /DUSE_FRAME_POINTER /DEM64T=1 /c /Zi ../../dep/tbb/src/tbb/intel64-masm/atomic_support.asm - - tbbmalloc__$(Platform)_$(Configuration)\atomic_support.obj;%(Outputs) - true - building atomic_support.obj - ml64 /Fo"tbbmalloc__$(Platform)_$(Configuration)\atomic_support.obj" /DUSE_FRAME_POINTER /DEM64T=1 /c /Zi ../../dep/tbb/src/tbb/intel64-masm/atomic_support.asm - - tbbmalloc__$(Platform)_$(Configuration)\atomic_support.obj;%(Outputs) - true - building atomic_support.obj - ml64 /Fo"tbbmalloc__$(Platform)_$(Configuration)\atomic_support.obj" /DEM64T=1 /c /Zi ../../dep/tbb/src/tbb/intel64-masm/atomic_support.asm - - tbbmalloc__$(Platform)_$(Configuration)\atomic_support.obj;%(Outputs) - - - /coff /Zi - true - /coff /Zi - /coff /Zi - true - /coff /Zi - true - - - /coff /Zi - true - /coff /Zi - /coff /Zi - true - /coff /Zi - true - - - - - - - - - - - - generating tbbmalloc.def file - cl /nologo /TC /EP ../../dep/tbb/src/tbbmalloc/win32-tbbmalloc-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbbmalloc.def - - .\tbbmalloc__$(Platform)_$(Configuration)\tbbmalloc.def;%(Outputs) - true - generating tbb.def file - cl /nologo /TC /EP ../../src/tbbmalloc/win32-tbbmalloc-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbbmalloc.def - - $(IntDir)tbbmalloc.def;%(Outputs) - generating tbbmalloc.def file - cl /nologo /TC /EP ../../dep/tbb/src/tbbmalloc/win32-tbbmalloc-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbbmalloc.def - - .\tbbmalloc__$(Platform)_$(Configuration)\tbbmalloc.def;%(Outputs) - true - generating tbb.def file - cl /nologo /TC /EP ../../src/tbbmalloc/win32-tbbmalloc-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbbmalloc.def - - $(IntDir)tbbmalloc.def;%(Outputs) - generating tbbmalloc.def file - cl /nologo /TC /EP ../../dep/tbb/src/tbbmalloc/win32-tbbmalloc-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbbmalloc.def - - .\tbbmalloc__$(Platform)_$(Configuration)\tbbmalloc.def;%(Outputs) - true - generating tbb.def file - cl /nologo /TC /EP ../../src/tbb/win32-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbb.def - - $(IntDir)tbb.def;%(Outputs) - - - true - generating tbb.def file - cl /nologo /TC /EP ../../src/tbb/win64-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbb.def - - $(IntDir)tbb.def;%(Outputs) - generating tbbmalloc.def file - cl /nologo /TC /EP ../../dep/tbb/src/tbbmalloc/win64-tbbmalloc-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbbmalloc.def - - ..\..\bin\$(Platform)_$(Configuration)\tbbmalloc.def;%(Outputs) - true - generating tbb.def file - cl /nologo /TC /EP ../../src/tbb/win64-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbb.def - - $(IntDir)tbb.def;%(Outputs) - generating tbbmalloc.def file - cl /nologo /TC /EP ../../dep/tbb/src/tbbmalloc/win64-tbbmalloc-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbbmalloc.def - - ..\..\bin\$(Platform)_$(Configuration)\tbbmalloc.def;%(Outputs) - true - generating tbb.def file - cl /nologo /TC /EP ../../src/tbb/win64-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbb.def - - $(IntDir)tbb.def;%(Outputs) - generating tbbmalloc.def file - cl /nologo /TC /EP ../../dep/tbb/src/tbbmalloc/win64-tbbmalloc-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbbmalloc.def - - ..\..\bin\$(Platform)_$(Configuration)\tbbmalloc.def;%(Outputs) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + Debug_NoPCH + Win32 + + + Debug_NoPCH + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {B15F131E-328A-4D42-ADC2-9FF4CA6306D8} + tbbmalloc + Win32Proj + + + + DynamicLibrary + NotSet + + + DynamicLibrary + NotSet + true + + + DynamicLibrary + NotSet + + + DynamicLibrary + NotSet + + + DynamicLibrary + NotSet + true + + + DynamicLibrary + NotSet + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + .\tbbmalloc__$(Platform)_$(Configuration)\ + .\tbbmalloc__$(Platform)_$(Configuration)\ + false + .\tbbmalloc__$(Platform)_$(Configuration)\ + .\tbbmalloc__$(Platform)_$(Configuration)\ + false + .\tbbmalloc__$(Platform)_$(Configuration)\ + .\tbbmalloc__$(Platform)_$(Configuration)\ + false + .\tbbmalloc__$(Platform)_$(Configuration)\ + .\tbbmalloc__$(Platform)_$(Configuration)\ + false + .\tbbmalloc__$(Platform)_$(Configuration)\ + .\tbbmalloc__$(Platform)_$(Configuration)\ + false + .\tbbmalloc__$(Platform)_$(Configuration)\ + .\tbbmalloc__$(Platform)_$(Configuration)\ + false + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + /c /MDd /Od /Ob0 /Zi /EHs- /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /I../../src /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc %(AdditionalOptions) + Disabled + ..\..\dep\tbb\include;..\..\dep\tbb\src;..\..\dep\tbb\build;..\..\dep\tbb\build\vsproject;%(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + Default + MultiThreadedDebugDLL + + + Level3 + false + ProgramDatabase + 4244;4267;%(DisableSpecificWarnings) + + + /DLL /MAP /DEBUG /fixed:no /INCREMENTAL:NO /DEF:$(IntDir)tbbmalloc.def %(AdditionalOptions) + ..\..\dep\lib\$(Platform)_$(Configuration)\tbbmalloc_debug.dll + true + Windows + false + + + MachineX86 + + + + + X64 + + + /c /MDd /Od /Ob0 /Zi /EHs- /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /GS- /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /I../../src /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc %(AdditionalOptions) + Disabled + ..\..\dep\tbb\include;..\..\dep\tbb\src;..\..\dep\tbb\build;..\..\dep\tbb\build\vsproject;%(AdditionalIncludeDirectories) + + + Default + MultiThreadedDebugDLL + true + + + Level3 + false + ProgramDatabase + 4244;4267;%(DisableSpecificWarnings) + false + + + /nologo /DLL /MAP /DEBUG /fixed:no /INCREMENTAL:NO /DEF:$(IntDir)tbbmalloc.def %(AdditionalOptions) + ..\..\dep\lib\$(Platform)_$(Configuration)\tbbmalloc_debug.dll + true + Windows + false + + + MachineX64 + + + + + /c /MD /O2 /Zi /EHs- /Zc:forScope /Zc:wchar_t /Oy /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /I../../src /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc %(AdditionalOptions) + ..\..\dep\tbb\include;..\..\dep\tbb\src;..\..\dep\tbb\build;..\..\dep\tbb\build\vsproject;%(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + MultiThreadedDLL + + + Level3 + false + ProgramDatabase + 4244;4267;%(DisableSpecificWarnings) + + + /nologo /DLL /MAP /DEBUG /fixed:no /INCREMENTAL:NO /DEF:$(IntDir)tbbmalloc.def %(AdditionalOptions) + ..\..\dep\lib\$(Platform)_$(Configuration)\tbbmalloc.dll + true + Windows + true + true + false + + + MachineX86 + + + + + X64 + + + /c /MD /O2 /Zi /EHs- /Zc:forScope /Zc:wchar_t /GS- /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /I../../src /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc %(AdditionalOptions) + ..\..\dep\tbb\include;..\..\dep\tbb\src;..\..\dep\tbb\build;..\..\dep\tbb\build\vsproject;%(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + MultiThreadedDLL + + + Level3 + false + ProgramDatabase + 4244;4267;%(DisableSpecificWarnings) + + + /nologo /DLL /MAP /DEBUG /fixed:no /INCREMENTAL:NO /DEF:$(IntDir)tbbmalloc.def %(AdditionalOptions) + ..\..\dep\lib\$(Platform)_$(Configuration)\tbbmalloc.dll + true + Windows + true + true + false + + + MachineX64 + + + + + /c /MDd /Od /Ob0 /Zi /EHs- /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /I../../src /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc %(AdditionalOptions) + Disabled + ..\..\dep\tbb\include;..\..\dep\tbb\src;..\..\dep\tbb\build;..\..\dep\tbb\build\vsproject;%(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + Default + MultiThreadedDebugDLL + + + Level3 + false + ProgramDatabase + 4244;4267;%(DisableSpecificWarnings) + + + /DLL /MAP /DEBUG /fixed:no /INCREMENTAL:NO /DEF:$(IntDir)tbbmalloc.def %(AdditionalOptions) + ..\..\dep\lib\$(Platform)_debug\tbbmalloc_debug.dll + true + Windows + false + + + MachineX86 + + + + + X64 + + + /c /MDd /Od /Ob0 /Zi /EHs- /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /GS- /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 /I../../src /I../../include /I../../src/tbbmalloc /I../../src/tbbmalloc %(AdditionalOptions) + Disabled + ..\..\dep\tbb\include;..\..\dep\tbb\src;..\..\dep\tbb\build;..\..\dep\tbb\build\vsproject;%(AdditionalIncludeDirectories) + + + Default + MultiThreadedDebugDLL + true + + + Level3 + false + ProgramDatabase + 4244;4267;%(DisableSpecificWarnings) + false + + + /nologo /DLL /MAP /DEBUG /fixed:no /INCREMENTAL:NO /DEF:$(IntDir)tbbmalloc.def %(AdditionalOptions) + ..\..\dep\lib\$(Platform)_debug\tbbmalloc_debug.dll + true + Windows + false + + + MachineX64 + + + + + true + building atomic_support.obj + ml64 /Fo"tbbmalloc__$(Platform)_$(Configuration)\atomic_support.obj" /DUSE_FRAME_POINTER /DEM64T=1 /c /Zi ../../dep/tbb/src/tbb/intel64-masm/atomic_support.asm + + tbbmalloc__$(Platform)_$(Configuration)\atomic_support.obj;%(Outputs) + true + building atomic_support.obj + ml64 /Fo"tbbmalloc__$(Platform)_$(Configuration)\atomic_support.obj" /DUSE_FRAME_POINTER /DEM64T=1 /c /Zi ../../dep/tbb/src/tbb/intel64-masm/atomic_support.asm + + tbbmalloc__$(Platform)_$(Configuration)\atomic_support.obj;%(Outputs) + true + building atomic_support.obj + ml64 /Fo"tbbmalloc__$(Platform)_$(Configuration)\atomic_support.obj" /DEM64T=1 /c /Zi ../../dep/tbb/src/tbb/intel64-masm/atomic_support.asm + + tbbmalloc__$(Platform)_$(Configuration)\atomic_support.obj;%(Outputs) + + + /coff /Zi + true + /coff /Zi + /coff /Zi + true + /coff /Zi + true + + + /coff /Zi + true + /coff /Zi + /coff /Zi + true + /coff /Zi + true + + + + + + + + + + + + generating tbbmalloc.def file + cl /nologo /TC /EP ../../dep/tbb/src/tbbmalloc/win32-tbbmalloc-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbbmalloc.def + + .\tbbmalloc__$(Platform)_$(Configuration)\tbbmalloc.def;%(Outputs) + true + generating tbb.def file + cl /nologo /TC /EP ../../src/tbbmalloc/win32-tbbmalloc-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbbmalloc.def + + $(IntDir)tbbmalloc.def;%(Outputs) + generating tbbmalloc.def file + cl /nologo /TC /EP ../../dep/tbb/src/tbbmalloc/win32-tbbmalloc-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbbmalloc.def + + .\tbbmalloc__$(Platform)_$(Configuration)\tbbmalloc.def;%(Outputs) + true + generating tbb.def file + cl /nologo /TC /EP ../../src/tbbmalloc/win32-tbbmalloc-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbbmalloc.def + + $(IntDir)tbbmalloc.def;%(Outputs) + generating tbbmalloc.def file + cl /nologo /TC /EP ../../dep/tbb/src/tbbmalloc/win32-tbbmalloc-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbbmalloc.def + + .\tbbmalloc__$(Platform)_$(Configuration)\tbbmalloc.def;%(Outputs) + true + generating tbb.def file + cl /nologo /TC /EP ../../src/tbb/win32-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbb.def + + $(IntDir)tbb.def;%(Outputs) + + + true + generating tbb.def file + cl /nologo /TC /EP ../../src/tbb/win64-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbb.def + + $(IntDir)tbb.def;%(Outputs) + generating tbbmalloc.def file + cl /nologo /TC /EP ../../dep/tbb/src/tbbmalloc/win64-tbbmalloc-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbbmalloc.def + + ..\..\bin\$(Platform)_$(Configuration)\tbbmalloc.def;%(Outputs) + true + generating tbb.def file + cl /nologo /TC /EP ../../src/tbb/win64-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbb.def + + $(IntDir)tbb.def;%(Outputs) + generating tbbmalloc.def file + cl /nologo /TC /EP ../../dep/tbb/src/tbbmalloc/win64-tbbmalloc-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbbmalloc.def + + ..\..\bin\$(Platform)_$(Configuration)\tbbmalloc.def;%(Outputs) + true + generating tbb.def file + cl /nologo /TC /EP ../../src/tbb/win64-tbb-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbb.def + + $(IntDir)tbb.def;%(Outputs) + generating tbbmalloc.def file + cl /nologo /TC /EP ../../dep/tbb/src/tbbmalloc/win64-tbbmalloc-export.def /DTBB_USE_DEBUG /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0400 /D__TBB_BUILD=1 >$(IntDir)tbbmalloc.def + + ..\..\bin\$(Platform)_$(Configuration)\tbbmalloc.def;%(Outputs) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/win/VC90/game.vcproj b/win/VC90/game.vcproj index b43d57e1c..bc03cba2c 100755 --- a/win/VC90/game.vcproj +++ b/win/VC90/game.vcproj @@ -439,6 +439,14 @@ RelativePath="..\..\src\game\Bag.h" > + + + +