*Update to HG 714.
--HG-- branch : trunk
This commit is contained in:
@@ -721,8 +721,11 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player *player, WorldPacke
|
||||
{
|
||||
if(auramask & (uint64(1) << i))
|
||||
{
|
||||
*data << uint32(player->GetVisibleAura(i));
|
||||
uint32 updatedAura = player->GetVisibleAura(i);
|
||||
*data << uint32(updatedAura);
|
||||
*data << uint8(1);
|
||||
if(!updatedAura)
|
||||
player->UnsetAuraUpdateMask(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -802,8 +805,11 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player *player, WorldPacke
|
||||
{
|
||||
if(auramask & (uint64(1) << i))
|
||||
{
|
||||
*data << uint32(pet->GetVisibleAura(i));
|
||||
uint32 updatedAura = pet->GetVisibleAura(i);
|
||||
*data << uint32(updatedAura);
|
||||
*data << uint8(1);
|
||||
if(!updatedAura)
|
||||
pet->UnsetAuraUpdateMask(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,6 +93,7 @@ bool ChatHandler::HandleServerInfoCommand(const char* /*args*/)
|
||||
uint32 maxActiveClientsNum = sWorld.GetMaxActiveSessionCount();
|
||||
uint32 maxQueuedClientsNum = sWorld.GetMaxQueuedSessionCount();
|
||||
std::string str = secsToTimeString(sWorld.GetUptime());
|
||||
uint32 updateTime = sWorld.GetUpdateTime();
|
||||
|
||||
PSendSysMessage(_FULLVERSION); //char const* full;
|
||||
//if(m_session)
|
||||
@@ -105,6 +106,7 @@ bool ChatHandler::HandleServerInfoCommand(const char* /*args*/)
|
||||
//PSendSysMessage(LANG_USING_WORLD_DB,sWorld.GetDBVersion());
|
||||
PSendSysMessage(LANG_CONNECTED_USERS, activeClientsNum, maxActiveClientsNum, queuedClientsNum, maxQueuedClientsNum);
|
||||
PSendSysMessage(LANG_UPTIME, str.c_str());
|
||||
PSendSysMessage("Update time diff: %u.", updateTime);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+2
-1
@@ -1778,7 +1778,8 @@ bool InstanceMap::Add(Player *player)
|
||||
{
|
||||
sLog.outError("InstanceMap::Add: player %s(%d) is being put in instance %d,%d,%d,%d,%d,%d but he is in group %d and is bound to instance %d,%d,%d,%d,%d,%d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset(), GUID_LOPART(pGroup->GetLeaderGUID()), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset());
|
||||
if(groupBind) sLog.outError("InstanceMap::Add: the group is bound to instance %d,%d,%d,%d,%d,%d", groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty(), groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount(), groupBind->save->CanReset());
|
||||
assert(false);
|
||||
player->UnbindInstance(GetId(), GetSpawnMode());
|
||||
//assert(false);
|
||||
}
|
||||
// bind to the group or keep using the group save
|
||||
if(!groupBind)
|
||||
|
||||
+1
-1
@@ -1544,7 +1544,7 @@ Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, floa
|
||||
{
|
||||
TemporarySummon* pCreature = new TemporarySummon(GetGUID());
|
||||
|
||||
pCreature->SetInstanceId(GetInstanceId());
|
||||
//pCreature->SetInstanceId(GetInstanceId());
|
||||
uint32 team = 0;
|
||||
if (GetTypeId()==TYPEID_PLAYER)
|
||||
team = ((Player*)this)->GetTeam();
|
||||
|
||||
@@ -882,7 +882,7 @@ void Aura::_AddAura()
|
||||
SendAuraUpdate(false);
|
||||
|
||||
// update for out of range group members
|
||||
m_target->UpdateAuraForGroup(slot, true);
|
||||
m_target->UpdateAuraForGroup(slot);
|
||||
}
|
||||
}
|
||||
else // use found slot
|
||||
@@ -970,7 +970,7 @@ void Aura::_RemoveAura()
|
||||
SendAuraUpdate(true);
|
||||
|
||||
// update for out of range group members
|
||||
m_target->UpdateAuraForGroup(slot, false);
|
||||
m_target->UpdateAuraForGroup(slot);
|
||||
|
||||
if( IsSealSpell(GetSpellProto()) )
|
||||
m_target->ModifyAuraState(AURA_STATE_JUDGEMENT,false);
|
||||
|
||||
@@ -3907,7 +3907,7 @@ void Spell::EffectEnchantItemTmp(uint32 i)
|
||||
// Shaman Rockbiter Weapon
|
||||
if(i==0 && m_spellInfo->Effect[1]==SPELL_EFFECT_DUMMY)
|
||||
{
|
||||
int32 enchnting_damage = m_currentBasePoints[1];//+1;
|
||||
int32 enchnting_damage = damage;//+1;
|
||||
|
||||
// enchanting id selected by calculated damage-per-sec stored in Effect[1] base value
|
||||
// with already applied percent bonus from Elemental Weapons talent
|
||||
|
||||
+3
-9
@@ -10675,7 +10675,7 @@ uint32 Unit::GetCastingTimeForBonus( SpellEntry const *spellProto, DamageEffectT
|
||||
return CastingTime;
|
||||
}
|
||||
|
||||
void Unit::UpdateAuraForGroup(uint8 slot, bool apply)
|
||||
void Unit::UpdateAuraForGroup(uint8 slot)
|
||||
{
|
||||
if(GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
@@ -10683,10 +10683,7 @@ void Unit::UpdateAuraForGroup(uint8 slot, bool apply)
|
||||
if(player->GetGroup())
|
||||
{
|
||||
player->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_AURAS);
|
||||
if(apply)
|
||||
player->SetAuraUpdateMask(slot);
|
||||
else
|
||||
player->UnsetAuraUpdateMask(slot);
|
||||
player->SetAuraUpdateMask(slot);
|
||||
}
|
||||
}
|
||||
else if(GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet())
|
||||
@@ -10698,10 +10695,7 @@ void Unit::UpdateAuraForGroup(uint8 slot, bool apply)
|
||||
if(owner && (owner->GetTypeId() == TYPEID_PLAYER) && ((Player*)owner)->GetGroup())
|
||||
{
|
||||
((Player*)owner)->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_PET_AURAS);
|
||||
if(apply)
|
||||
pet->SetAuraUpdateMask(slot);
|
||||
else
|
||||
pet->UnsetAuraUpdateMask(slot);
|
||||
pet->SetAuraUpdateMask(slot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1450,7 +1450,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
||||
void UpdateReactives(uint32 p_time);
|
||||
|
||||
// group updates
|
||||
void UpdateAuraForGroup(uint8 slot, bool apply);
|
||||
void UpdateAuraForGroup(uint8 slot);
|
||||
|
||||
// pet auras
|
||||
typedef std::set<PetAura const*> PetAuraSet;
|
||||
|
||||
@@ -107,7 +107,7 @@ WaypointMovementGenerator<Creature>::Initialize(Creature &u)
|
||||
Traveller<Creature> traveller(u);
|
||||
node = *(waypoints->at(i_currentNode));
|
||||
InitTraveller(u,node);
|
||||
i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z);
|
||||
i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z);
|
||||
i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
|
||||
}*/
|
||||
}
|
||||
@@ -152,8 +152,9 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
|
||||
{
|
||||
if(StopedByPlayer)
|
||||
{
|
||||
InitTraveller(unit,node);
|
||||
i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z);
|
||||
assert(node);
|
||||
InitTraveller(unit, *node);
|
||||
i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z);
|
||||
i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
|
||||
StopedByPlayer = false;
|
||||
return true;
|
||||
@@ -165,7 +166,7 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
|
||||
i_currentNode = 0; //Start moving all over again
|
||||
else
|
||||
{
|
||||
unit.SetHomePosition(node.x, node.y, node.z, unit.GetOrientation());
|
||||
unit.SetHomePosition(node->x, node->y, node->z, unit.GetOrientation());
|
||||
unit.GetMotionMaster()->Initialize();
|
||||
return false; //Clear the waypoint movement
|
||||
}
|
||||
@@ -173,24 +174,24 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
|
||||
else
|
||||
i_currentNode++;
|
||||
|
||||
node = *(waypoints->at(i_currentNode));
|
||||
InitTraveller(unit,node);
|
||||
i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z);
|
||||
node = waypoints->at(i_currentNode);
|
||||
InitTraveller(unit, *node);
|
||||
i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z);
|
||||
i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
|
||||
}
|
||||
else
|
||||
{
|
||||
//Determine waittime
|
||||
if(node.delay)
|
||||
i_nextMoveTime.Reset(node.delay);
|
||||
if(node->delay)
|
||||
i_nextMoveTime.Reset(node->delay);
|
||||
|
||||
if(node.event_id && rand()%100 < node.event_chance)
|
||||
sWorld.ScriptsStart(sWaypointScripts, node.event_id, &unit, NULL);
|
||||
if(node->event_id && rand()%100 < node->event_chance)
|
||||
sWorld.ScriptsStart(sWaypointScripts, node->event_id, &unit, NULL);
|
||||
|
||||
MovementInform(unit);
|
||||
unit.UpdateWaypointID(i_currentNode);
|
||||
unit.clearUnitState(UNIT_STAT_MOVING);
|
||||
unit.Relocate(node.x, node.y, node.z);
|
||||
unit.Relocate(node->x, node->y, node->z);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -80,7 +80,7 @@ class TRINITY_DLL_SPEC WaypointMovementGenerator
|
||||
MovementGeneratorType GetMovementGeneratorType() { return WAYPOINT_MOTION_TYPE; }
|
||||
|
||||
private:
|
||||
WaypointData node;
|
||||
WaypointData *node;
|
||||
uint32 path_id;
|
||||
TimeTrackerSmall i_nextMoveTime;
|
||||
WaypointPath *waypoints;
|
||||
|
||||
@@ -112,6 +112,9 @@ World::World()
|
||||
|
||||
m_defaultDbcLocale = LOCALE_enUS;
|
||||
m_availableDbcLocaleMask = 0;
|
||||
|
||||
m_updateTimeSum = 0;
|
||||
m_updateTimeCount = 0;
|
||||
}
|
||||
|
||||
/// World destructor
|
||||
@@ -1021,6 +1024,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
m_configs[CONFIG_PVP_TOKEN_COUNT] = 1;
|
||||
m_configs[CONFIG_NO_RESET_TALENT_COST] = sConfig.GetBoolDefault("NoResetTalentsCost", false);
|
||||
m_configs[CONFIG_SHOW_KICK_IN_WORLD] = sConfig.GetBoolDefault("ShowKickInWorld", false);
|
||||
m_configs[CONFIG_INTERVAL_LOG_UPDATE] = sConfig.GetIntDefault("RecordUpdateTimeDiffInterval", 60000);
|
||||
|
||||
std::string forbiddenmaps = sConfig.GetStringDefault("ForbiddenMaps", "");
|
||||
char * forbiddenMaps = new char[forbiddenmaps.length() + 1];
|
||||
@@ -1450,6 +1454,22 @@ void World::DetectDBCLang()
|
||||
/// Update the World !
|
||||
void World::Update(time_t diff)
|
||||
{
|
||||
m_updateTime = uint32(diff);
|
||||
if(m_configs[CONFIG_INTERVAL_LOG_UPDATE])
|
||||
{
|
||||
if(m_updateTimeSum > m_configs[CONFIG_INTERVAL_LOG_UPDATE])
|
||||
{
|
||||
sLog.outString("Update time diff: %u. Players online: %u.", m_updateTimeSum / m_updateTimeCount, GetActiveSessionCount());
|
||||
m_updateTimeSum = m_updateTime;
|
||||
m_updateTimeCount = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_updateTimeSum += m_updateTime;
|
||||
++m_updateTimeCount;
|
||||
}
|
||||
}
|
||||
|
||||
///- Update the different timers
|
||||
for(int i = 0; i < WUPDATE_COUNT; i++)
|
||||
if(m_timers[i].GetCurrent()>=0)
|
||||
|
||||
@@ -203,6 +203,7 @@ enum WorldConfigs
|
||||
CONFIG_PVP_TOKEN_COUNT,
|
||||
CONFIG_NO_RESET_TALENT_COST,
|
||||
CONFIG_SHOW_KICK_IN_WORLD,
|
||||
CONFIG_INTERVAL_LOG_UPDATE,
|
||||
|
||||
CONFIG_VALUE_COUNT
|
||||
};
|
||||
@@ -414,6 +415,8 @@ class World
|
||||
time_t const& GetGameTime() const { return m_gameTime; }
|
||||
/// Uptime (in secs)
|
||||
uint32 GetUptime() const { return uint32(m_gameTime - m_startTime); }
|
||||
/// Update time
|
||||
uint32 GetUpdateTime() const { return m_updateTime; }
|
||||
|
||||
/// Get the maximum skill level a player can reach
|
||||
uint16 GetConfigMaxSkillValue() const
|
||||
@@ -531,6 +534,8 @@ class World
|
||||
IntervalTimer m_timers[WUPDATE_COUNT];
|
||||
uint32 mail_timer;
|
||||
uint32 mail_timer_expires;
|
||||
uint32 m_updateTime, m_updateTimeSum;
|
||||
uint32 m_updateTimeCount;
|
||||
|
||||
typedef UNORDERED_MAP<uint32, Weather*> WeatherMap;
|
||||
WeatherMap m_weathers;
|
||||
|
||||
Reference in New Issue
Block a user