Core: Add new system for parallelizing client packet processing. Handle WorldSession updates in Map::Update() where we are safe to proceed. Patch by Ambal.
(And clean up tabs and whitespace while rummaging around in there) Closes issue 5084. --HG-- branch : trunk
This commit is contained in:
@@ -2425,6 +2425,6 @@ void Creature::FarTeleportTo(Map* map, float X, float Y, float Z, float O)
|
||||
ResetMap();
|
||||
SetMap(map);
|
||||
AddToWorld();
|
||||
|
||||
|
||||
SetPosition(X, Y, Z, O, true);
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ void CreatureGroupManager::LoadCreatureFormations()
|
||||
QueryResult guidResult = WorldDatabase.PQuery("SELECT guid FROM creature");
|
||||
if (guidResult)
|
||||
{
|
||||
do
|
||||
do
|
||||
{
|
||||
Field *fields = guidResult->Fetch();
|
||||
uint32 guid = fields[0].GetUInt32();
|
||||
|
||||
@@ -832,7 +832,7 @@ bool GameObject::isAlwaysVisibleFor(WorldObject const* seer) const
|
||||
|
||||
if (IsTransport())
|
||||
return true;
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1218,7 +1218,7 @@ void Player::SetDrunkValue(uint16 newDrunkenValue, uint32 itemId)
|
||||
m_invisibilityDetect.AddFlag(INVISIBILITY_DRUNK);
|
||||
else
|
||||
m_invisibilityDetect.DelFlag(INVISIBILITY_DRUNK);
|
||||
|
||||
|
||||
m_invisibilityDetect.AddValue(INVISIBILITY_DRUNK, int32(newDrunkenValue - m_drunk) / 256);
|
||||
|
||||
m_drunk = newDrunkenValue;
|
||||
@@ -11999,7 +11999,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update)
|
||||
if (pItem)
|
||||
{
|
||||
sLog.outDebug("STORAGE: DestroyItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry());
|
||||
// Also remove all contained items if the item is a bag.
|
||||
// Also remove all contained items if the item is a bag.
|
||||
// This if() prevents item saving crashes if the condition for a bag to be empty before being destroyed was bypassed somehow.
|
||||
if (pItem->IsBag() && !((Bag*)pItem)->IsEmpty())
|
||||
{
|
||||
|
||||
@@ -37,10 +37,10 @@
|
||||
#include "Unit.h"
|
||||
#include "Util.h" // for Tokens typedef
|
||||
#include "WorldSession.h"
|
||||
|
||||
|
||||
#include<string>
|
||||
#include<vector>
|
||||
|
||||
|
||||
struct Mail;
|
||||
class Channel;
|
||||
class Creature;
|
||||
@@ -2264,7 +2264,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
LfgState GetLfgState() const { return m_LookingForGroup.state; }
|
||||
void SetLfgState(LfgState state)
|
||||
{
|
||||
|
||||
|
||||
switch(state)
|
||||
{
|
||||
case LFG_STATE_NONE:
|
||||
@@ -2644,7 +2644,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
|
||||
bool canSeeAlways(WorldObject const* obj) const;
|
||||
|
||||
bool isAlwaysDetectableFor(WorldObject const* seer) const;
|
||||
bool isAlwaysDetectableFor(WorldObject const* seer) const;
|
||||
private:
|
||||
// internal common parts for CanStore/StoreItem functions
|
||||
uint8 _CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemPosCountVec& dest, ItemPrototype const *pProto, uint32& count, bool swap, Item *pSrcItem) const;
|
||||
|
||||
@@ -15289,7 +15289,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss)
|
||||
// Call creature just died function
|
||||
if (creature->IsAIEnabled)
|
||||
creature->AI()->JustDied(this);
|
||||
|
||||
|
||||
if (creature->ToTempSummon())
|
||||
{
|
||||
if (Unit* pSummoner = creature->ToTempSummon()->GetSummoner())
|
||||
|
||||
@@ -1212,7 +1212,7 @@ class Unit : public WorldObject
|
||||
inline bool HealthBelowPctDamaged(int32 pct, uint32 damage) const { return (int32(GetHealth()) - damage) * (int64)100 < GetMaxHealth() * (int64)pct; }
|
||||
inline bool HealthAbovePct(int32 pct) const { return GetHealth() * (uint64)100 > GetMaxHealth() * (uint64)pct; }
|
||||
inline float GetHealthPct() const { return GetMaxHealth() ? 100.f * GetHealth() / GetMaxHealth() : 0.0f; }
|
||||
inline uint32 CountPctFromMaxHealth(int32 pct) const { return CalculatePctN(GetMaxHealth(), pct); }
|
||||
inline uint32 CountPctFromMaxHealth(int32 pct) const { return CalculatePctN(GetMaxHealth(), pct); }
|
||||
|
||||
void SetHealth(uint32 val);
|
||||
void SetMaxHealth(uint32 val);
|
||||
|
||||
@@ -57,7 +57,7 @@ enum VehicleSpells
|
||||
{
|
||||
VEHICLE_SPELL_PARACHUTE = 45472
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct VehicleSeat
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user