mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
[7255] Allows saving characters in Battle Grounds.
* Now player can join to BG after logout during 5 minutes, if BG in progress. * All players after server crash or restart should appear at the battlemaster Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
8af53064eb
commit
75121a5823
11 changed files with 162 additions and 52 deletions
|
|
@ -161,8 +161,6 @@ void BattleGround::Update(uint32 diff)
|
|||
m_RemovedPlayers.clear();
|
||||
}
|
||||
|
||||
// this code isn't efficient and its idea isn't implemented yet
|
||||
/* offline players are removed from battleground in worldsession::LogoutPlayer()
|
||||
// remove offline players from bg after ~5 minutes
|
||||
if(GetPlayersSize())
|
||||
{
|
||||
|
|
@ -177,7 +175,7 @@ void BattleGround::Update(uint32 diff)
|
|||
if(itr->second.LastOnlineTime >= MAX_OFFLINE_TIME) // 5 minutes
|
||||
m_RemovedPlayers[itr->first] = 1; // add to remove list (BG)
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
m_LastResurrectTime += diff;
|
||||
if (m_LastResurrectTime >= RESURRECTION_INTERVAL)
|
||||
|
|
@ -1495,6 +1493,31 @@ uint32 BattleGround::GetPlayerTeam(uint64 guid)
|
|||
return 0;
|
||||
}
|
||||
|
||||
bool BattleGround::IsPlayerInBattleGround(uint64 guid)
|
||||
{
|
||||
std::map<uint64, BattleGroundPlayer>::const_iterator itr = m_Players.find(guid);
|
||||
if(itr!=m_Players.end())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void BattleGround::PlayerRelogin(Player* plr)
|
||||
{
|
||||
if(GetStatus() != STATUS_WAIT_LEAVE)
|
||||
return;
|
||||
|
||||
WorldPacket data;
|
||||
uint32 bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(GetTypeID(), GetArenaType());
|
||||
|
||||
BlockMovement(plr);
|
||||
|
||||
sBattleGroundMgr.BuildPvpLogDataPacket(&data, this);
|
||||
plr->GetSession()->SendPacket(&data);
|
||||
|
||||
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, this, plr->GetTeam(), plr->GetBattleGroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, TIME_TO_AUTOREMOVE, GetStartTime());
|
||||
plr->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
uint32 BattleGround::GetAlivePlayersCountByTeam(uint32 Team) const
|
||||
{
|
||||
int count = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue