[8013] Fixed SMSG_RAID_INSTANCE_INFO opcode, some other fixes.

This commit is contained in:
tomrus88 2009-06-14 19:24:07 +04:00
parent 55e9e6b04a
commit 25140ea3cc
8 changed files with 46 additions and 53 deletions

View file

@ -1099,8 +1099,8 @@ struct MapEntry
// Helpers // Helpers
uint32 Expansion() const { return addon; } uint32 Expansion() const { return addon; }
bool IsDungeon() const { return map_type == MAP_INSTANCE || map_type == MAP_RAID; } 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 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 IsRaid() const { return map_type == MAP_RAID; }
bool IsBattleGround() const { return map_type == MAP_BATTLEGROUND; } bool IsBattleGround() const { return map_type == MAP_BATTLEGROUND; }

View file

@ -34,10 +34,10 @@ void WorldSession::SendGMTicketGetTicket(uint32 status, char const* text)
{ {
data << text; // ticket text data << text; // ticket text
data << uint8(0x7); // ticket category data << uint8(0x7); // ticket category
data << float(0); // time from ticket creation? data << float(0); // tickets in queue?
data << float(0); // const data << float(0); // if > "tickets in queue" then "We are currently experiencing a high volume of petitions."
data << float(0); // const data << float(0); // 0 - "Your ticket will be serviced soon", 1 - "Wait time currently unavailable"
data << uint8(0); // const data << uint8(0); // if == 2 and next field == 1 then "Your ticket has been escalated"
data << uint8(0); // const data << uint8(0); // const
} }
SendPacket( &data ); SendPacket( &data );
@ -104,7 +104,7 @@ void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data )
if(ticketmgr.GetGMTicket(GetPlayer()->GetGUIDLow())) if(ticketmgr.GetGMTicket(GetPlayer()->GetGUIDLow()))
{ {
WorldPacket data( SMSG_GMTICKET_CREATE, 4 ); WorldPacket data( SMSG_GMTICKET_CREATE, 4 );
data << uint32(1); data << uint32(1); // 1 - You already have GM ticket
SendPacket( &data ); SendPacket( &data );
return; return;
} }
@ -117,7 +117,7 @@ void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data )
SendPacket( &data ); SendPacket( &data );
data.Initialize( SMSG_GMTICKET_CREATE, 4 ); data.Initialize( SMSG_GMTICKET_CREATE, 4 );
data << uint32(2); data << uint32(2); // 2 - nothing appears (3-error creating, 5-error updating)
SendPacket( &data ); SendPacket( &data );
DEBUG_LOG("update the ticket"); DEBUG_LOG("update the ticket");

View file

@ -2499,7 +2499,7 @@ void InstanceMap::UnloadAll(bool pForce)
void InstanceMap::SendResetWarnings(uint32 timeLeft) const void InstanceMap::SendResetWarnings(uint32 timeLeft) const
{ {
for(MapRefManager::const_iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr) 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) void InstanceMap::SetResetSchedule(bool on)

View file

@ -72,9 +72,6 @@ void WorldSession::HandleMoveWorldportAckOpcode()
// to let GetInstance() determine the proper InstanceId based on the player's binds // to let GetInstance() determine the proper InstanceId based on the player's binds
GetPlayer()->SetInstanceId(0); 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(); GetPlayer()->SendInitialPacketsBeforeAddToMap();
// the CanEnter checks are done in TeleporTo but conditions may change // the CanEnter checks are done in TeleporTo but conditions may change
// while the player is in transit, for example the map may get full // while the player is in transit, for example the map may get full
@ -95,10 +92,11 @@ void WorldSession::HandleMoveWorldportAckOpcode()
// only add to bg group and object, if the player was invited (else he entered through command) // only add to bg group and object, if the player was invited (else he entered through command)
if(_player->InBattleGround()) if(_player->InBattleGround())
{ {
// cleanup seting if outdated // cleanup setting if outdated
if(!mEntry->IsBattleGroundOrArena()) 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 // reset destination bg team
_player->SetBGTeam(0); _player->SetBGTeam(0);
} }
@ -140,13 +138,10 @@ void WorldSession::HandleMoveWorldportAckOpcode()
} }
} }
if(mEntry->IsRaid() && mInstance) if((mEntry->IsRaid() || (mEntry->IsNonRaidDungeon() && mEntry->SupportsHeroicMode() && GetPlayer()->IsHeroic())) && mInstance)
{
if(reset_notify)
{ {
uint32 timeleft = sInstanceSaveManager.GetResetTimeFor(GetPlayer()->GetMapId()) - time(NULL); 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 // mount allow check

View file

@ -361,7 +361,7 @@ enum Opcodes
SMSG_ATTACKSTOP = 0x144, SMSG_ATTACKSTOP = 0x144,
SMSG_ATTACKSWING_NOTINRANGE = 0x145, SMSG_ATTACKSWING_NOTINRANGE = 0x145,
SMSG_ATTACKSWING_BADFACING = 0x146, SMSG_ATTACKSWING_BADFACING = 0x146,
SMSG_ATTACKSWING_NOTSTANDING = 0x147, SMSG_INSTANCE_LOCK_QUERY = 0x147,
SMSG_ATTACKSWING_DEADTARGET = 0x148, SMSG_ATTACKSWING_DEADTARGET = 0x148,
SMSG_ATTACKSWING_CANT_ATTACK = 0x149, SMSG_ATTACKSWING_CANT_ATTACK = 0x149,
SMSG_ATTACKERSTATEUPDATE = 0x14A, SMSG_ATTACKERSTATEUPDATE = 0x14A,

View file

@ -15212,6 +15212,8 @@ void Player::SendRaidInfo()
size_t p_counter = data.wpos(); size_t p_counter = data.wpos();
data << uint32(counter); // placeholder data << uint32(counter); // placeholder
time_t now = time(NULL);
for(int i = 0; i < TOTAL_DIFFICULTIES; ++i) for(int i = 0; i < TOTAL_DIFFICULTIES; ++i)
{ {
for (BoundInstancesMap::const_iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end(); ++itr) for (BoundInstancesMap::const_iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end(); ++itr)
@ -15219,10 +15221,11 @@ void Player::SendRaidInfo()
if(itr->second.perm) if(itr->second.perm)
{ {
InstanceSave *save = itr->second.save; InstanceSave *save = itr->second.save;
data << uint32(save->GetMapId()); data << uint32(save->GetMapId()); // map id
data << uint32(save->GetResetTime() - time(NULL)); data << uint32(save->GetDifficulty()); // difficulty
data << uint32(save->GetInstanceId()); data << uint64(save->GetInstanceId()); // instance id
data << uint32(save->GetDifficulty()); data << uint32(save->GetResetTime() - now); // reset time
data << uint32(0); // is extended
++counter; ++counter;
} }
} }
@ -16002,12 +16005,6 @@ void Player::Customize(uint64 guid, uint8 gender, uint8 skin, uint8 face, uint8
SaveValuesArrayInDB(tokens, guid); SaveValuesArrayInDB(tokens, guid);
} }
void Player::SendAttackSwingNotStanding()
{
WorldPacket data(SMSG_ATTACKSWING_NOTSTANDING, 0);
GetSession()->SendPacket( &data );
}
void Player::SendAttackSwingDeadTarget() void Player::SendAttackSwingDeadTarget()
{ {
WorldPacket data(SMSG_ATTACKSWING_DEADTARGET, 0); WorldPacket data(SMSG_ATTACKSWING_DEADTARGET, 0);
@ -18066,7 +18063,7 @@ void Player::SendTransferAborted(uint32 mapid, uint8 reason, uint8 arg)
GetSession()->SendPacket(&data); 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 // type of warning, based on the time remaining until reset
uint32 type; uint32 type;
@ -18078,15 +18075,16 @@ void Player::SendInstanceResetWarning(uint32 mapid, uint32 time)
type = RAID_INSTANCE_WARNING_MIN; type = RAID_INSTANCE_WARNING_MIN;
else else
type = RAID_INSTANCE_WARNING_MIN_SOON; type = RAID_INSTANCE_WARNING_MIN_SOON;
WorldPacket data(SMSG_RAID_INSTANCE_MESSAGE, 4+4+4+4); WorldPacket data(SMSG_RAID_INSTANCE_MESSAGE, 4+4+4+4);
data << uint32(type); data << uint32(type);
data << uint32(mapid); data << uint32(mapid);
data << uint32(0); // may be difficulty data << uint32(difficulty); // difficulty
data << uint32(time); data << uint32(time);
if(type == RAID_INSTANCE_WELCOME) if(type == RAID_INSTANCE_WELCOME)
{ {
data << uint8(0); data << uint8(0); // is your (1)
data << uint8(0); data << uint8(0); // is extended (1), ignored if prev field is 0
} }
GetSession()->SendPacket(&data); GetSession()->SendPacket(&data);
} }

View file

@ -913,7 +913,7 @@ class MANGOS_DLL_SPEC Player : public Unit
void SendInitialPacketsBeforeAddToMap(); void SendInitialPacketsBeforeAddToMap();
void SendInitialPacketsAfterAddToMap(); void SendInitialPacketsAfterAddToMap();
void SendTransferAborted(uint32 mapid, uint8 reason, uint8 arg = 0); 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); Creature* GetNPCIfCanInteractWith(uint64 guid, uint32 npcflagmask);
bool CanInteractWithNPCs(bool alive = true) const; bool CanInteractWithNPCs(bool alive = true) const;
@ -1538,6 +1538,7 @@ class MANGOS_DLL_SPEC Player : public Unit
void SetDifficulty(uint32 dungeon_difficulty) { m_dungeonDifficulty = dungeon_difficulty; } void SetDifficulty(uint32 dungeon_difficulty) { m_dungeonDifficulty = dungeon_difficulty; }
uint8 GetDifficulty() { return m_dungeonDifficulty; } uint8 GetDifficulty() { return m_dungeonDifficulty; }
bool IsHeroic() { return m_dungeonDifficulty == DIFFICULTY_HEROIC; }
bool UpdateSkill(uint32 skill_id, uint32 step); bool UpdateSkill(uint32 skill_id, uint32 step);
bool UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step); bool UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step);
@ -1619,7 +1620,6 @@ class MANGOS_DLL_SPEC Player : public Unit
void SendAttackSwingCantAttack(); void SendAttackSwingCantAttack();
void SendAttackSwingCancelAttack(); void SendAttackSwingCancelAttack();
void SendAttackSwingDeadTarget(); void SendAttackSwingDeadTarget();
void SendAttackSwingNotStanding();
void SendAttackSwingNotInRange(); void SendAttackSwingNotInRange();
void SendAttackSwingBadFacingAttack(); void SendAttackSwingBadFacingAttack();
void SendAutoRepeatCancel(); void SendAutoRepeatCancel();

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "8012" #define REVISION_NR "8013"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__