[8013] Fixed SMSG_RAID_INSTANCE_INFO opcode, some other fixes. Author: tomrus88

--HG--
branch : trunk
This commit is contained in:
megamage
2009-06-14 10:19:44 -05:00
parent c748c642cb
commit 4e005c3070
6 changed files with 38 additions and 45 deletions
+1 -1
View File
@@ -1129,8 +1129,8 @@ struct MapEntry
// Helpers
uint32 Expansion() const { return addon; }
bool IsDungeon() const { return map_type == MAP_INSTANCE || map_type == MAP_RAID; }
bool IsNonRaidDungeon() const { return map_type == MAP_INSTANCE; }
bool Instanceable() const { return map_type == MAP_INSTANCE || map_type == MAP_RAID || map_type == MAP_BATTLEGROUND || map_type == MAP_ARENA; }
bool IsRaid() const { return map_type == MAP_RAID; }
bool IsBattleGround() const { return map_type == MAP_BATTLEGROUND; }
+1 -1
View File
@@ -2630,7 +2630,7 @@ void InstanceMap::UnloadAll()
void InstanceMap::SendResetWarnings(uint32 timeLeft) const
{
for(MapRefManager::const_iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
itr->getSource()->SendInstanceResetWarning(GetId(), timeLeft);
itr->getSource()->SendInstanceResetWarning(GetId(), itr->getSource()->GetDifficulty(), timeLeft);
}
void InstanceMap::SetResetSchedule(bool on)
+6 -11
View File
@@ -74,9 +74,6 @@ void WorldSession::HandleMoveWorldportAckOpcode()
// to let GetInstance() determine the proper InstanceId based on the player's binds
GetPlayer()->SetInstanceId(0);
// check this before Map::Add(player), because that will create the instance save!
bool reset_notify = (GetPlayer()->GetBoundInstance(GetPlayer()->GetMapId(), GetPlayer()->GetDifficulty()) == NULL);
GetPlayer()->SendInitialPacketsBeforeAddToMap();
// the CanEnter checks are done in TeleporTo but conditions may change
// while the player is in transit, for example the map may get full
@@ -97,10 +94,11 @@ void WorldSession::HandleMoveWorldportAckOpcode()
// only add to bg group and object, if the player was invited (else he entered through command)
if(_player->InBattleGround())
{
// cleanup seting if outdated
// cleanup setting if outdated
if(!mEntry->IsBattleGroundOrArena())
{
_player->SetBattleGroundId(0, BATTLEGROUND_TYPE_NONE); // We're not in BG.
// We're not in BG
_player->SetBattleGroundId(0, BATTLEGROUND_TYPE_NONE);
// reset destination bg team
_player->SetBGTeam(0);
}
@@ -142,13 +140,10 @@ void WorldSession::HandleMoveWorldportAckOpcode()
}
}
if(mEntry->IsRaid() && mInstance)
{
if(reset_notify)
if((mEntry->IsRaid() || (mEntry->IsNonRaidDungeon() && mEntry->SupportsHeroicMode() && GetPlayer()->IsHeroic())) && mInstance)
{
uint32 timeleft = sInstanceSaveManager.GetResetTimeFor(GetPlayer()->GetMapId()) - time(NULL);
GetPlayer()->SendInstanceResetWarning(GetPlayer()->GetMapId(), timeleft); // greeting at the entrance of the resort raid instance
}
GetPlayer()->SendInstanceResetWarning(GetPlayer()->GetMapId(), GetPlayer()->GetDifficulty(), timeleft);
}
// mount allow check
@@ -244,7 +239,7 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
if( movementInfo.t_x > 50 || movementInfo.t_y > 50 || movementInfo.t_z > 50 )
return;
if( !Trinity::IsValidMapCoord(movementInfo.x+movementInfo.t_x, movementInfo.y+movementInfo.t_y,
if( !MaNGOS::IsValidMapCoord(movementInfo.x+movementInfo.t_x, movementInfo.y + movementInfo.t_y,
movementInfo.z + movementInfo.t_z, movementInfo.o + movementInfo.t_o) )
return;
+1 -1
View File
@@ -363,7 +363,7 @@ enum Opcodes
SMSG_ATTACKSTOP = 0x144,
SMSG_ATTACKSWING_NOTINRANGE = 0x145,
SMSG_ATTACKSWING_BADFACING = 0x146,
SMSG_ATTACKSWING_NOTSTANDING = 0x147,
SMSG_INSTANCE_LOCK_QUERY = 0x147,
SMSG_ATTACKSWING_DEADTARGET = 0x148,
SMSG_ATTACKSWING_CANT_ATTACK = 0x149,
SMSG_ATTACKERSTATEUPDATE = 0x14A,
+12 -14
View File
@@ -15607,6 +15607,8 @@ void Player::SendRaidInfo()
size_t p_counter = data.wpos();
data << uint32(counter); // placeholder
time_t now = time(NULL);
for(int i = 0; i < TOTAL_DIFFICULTIES; ++i)
{
for (BoundInstancesMap::iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end(); ++itr)
@@ -15614,10 +15616,11 @@ void Player::SendRaidInfo()
if(itr->second.perm)
{
InstanceSave *save = itr->second.save;
data << uint32(save->GetMapId());
data << uint32(save->GetResetTime() - time(NULL));
data << uint32(save->GetInstanceId());
data << uint32(save->GetDifficulty());
data << uint32(save->GetMapId()); // map id
data << uint32(save->GetDifficulty()); // difficulty
data << uint64(save->GetInstanceId()); // instance id
data << uint32(save->GetResetTime() - now); // reset time
data << uint32(0); // is extended
++counter;
}
}
@@ -16451,12 +16454,6 @@ void Player::Customize(uint64 guid, uint8 gender, uint8 skin, uint8 face, uint8
SaveValuesArrayInDB(tokens, guid);
}
void Player::SendAttackSwingNotStanding()
{
WorldPacket data(SMSG_ATTACKSWING_NOTSTANDING, 0);
GetSession()->SendPacket( &data );
}
void Player::SendAttackSwingDeadTarget()
{
WorldPacket data(SMSG_ATTACKSWING_DEADTARGET, 0);
@@ -18784,7 +18781,7 @@ void Player::SendTransferAborted(uint32 mapid, uint8 reason, uint8 arg)
GetSession()->SendPacket(&data);
}
void Player::SendInstanceResetWarning(uint32 mapid, uint32 time)
void Player::SendInstanceResetWarning( uint32 mapid, uint32 difficulty, uint32 time )
{
// type of warning, based on the time remaining until reset
uint32 type;
@@ -18796,15 +18793,16 @@ void Player::SendInstanceResetWarning(uint32 mapid, uint32 time)
type = RAID_INSTANCE_WARNING_MIN;
else
type = RAID_INSTANCE_WARNING_MIN_SOON;
WorldPacket data(SMSG_RAID_INSTANCE_MESSAGE, 4+4+4+4);
data << uint32(type);
data << uint32(mapid);
data << uint32(0); // may be difficulty
data << uint32(difficulty); // difficulty
data << uint32(time);
if(type == RAID_INSTANCE_WELCOME)
{
data << uint8(0);
data << uint8(0);
data << uint8(0); // is your (1)
data << uint8(0); // is extended (1), ignored if prev field is 0
}
GetSession()->SendPacket(&data);
}
+2 -2
View File
@@ -894,7 +894,7 @@ class TRINITY_DLL_SPEC Player : public Unit
void SendInitialPacketsBeforeAddToMap();
void SendInitialPacketsAfterAddToMap();
void SendTransferAborted(uint32 mapid, uint8 reason, uint8 arg = 0);
void SendInstanceResetWarning(uint32 mapid, uint32 time);
void SendInstanceResetWarning(uint32 mapid, uint32 difficulty, uint32 time);
Creature* GetNPCIfCanInteractWith(uint64 guid, uint32 npcflagmask);
bool CanInteractWithNPCs(bool alive = true) const;
@@ -1532,6 +1532,7 @@ class TRINITY_DLL_SPEC Player : public Unit
void SetDifficulty(uint32 dungeon_difficulty) { m_dungeonDifficulty = dungeon_difficulty; }
uint8 GetDifficulty() { return m_dungeonDifficulty; }
bool IsHeroic() { return m_dungeonDifficulty == DIFFICULTY_HEROIC; }
bool UpdateSkill(uint32 skill_id, uint32 step);
bool UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step);
@@ -1613,7 +1614,6 @@ class TRINITY_DLL_SPEC Player : public Unit
void SendAttackSwingCantAttack();
void SendAttackSwingCancelAttack();
void SendAttackSwingDeadTarget();
void SendAttackSwingNotStanding();
void SendAttackSwingNotInRange();
void SendAttackSwingBadFacingAttack();
void SendAutoRepeatCancel();