BG BotFill : QueueID renseigne dans l inscription BG des bots + garde-fou anti sur-provision
ProcessInBGQueue envoyait BattlemasterJoin avec QueueID=0 (ligne commentee du portage) : toutes les inscriptions bots etaient rejetees (invalid bgtype 0). Ajout de GetScheduledBotCount : tant que 8+ bots sont en cours d engagement (login/re-level/inscription), le tick n en engage pas de nouveaux (on est montes a 92 bots en ligne pour un 15v15). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -3036,8 +3036,28 @@ bool PlayerBotMgr::CanReadyArenaByArenaTeamID(uint32 arenaTeamId)
|
||||
return true;
|
||||
}
|
||||
|
||||
// SylvaniaCore (module BG BotFill): nombre de bots en cours d engagement (login /
|
||||
// re-level / inscription pas encore aboutis). Sert de garde-fou anti sur-provision :
|
||||
// tant que des bots sont en vol, le tick n en engage pas de nouveaux.
|
||||
uint32 PlayerBotMgr::GetScheduledBotCount()
|
||||
{
|
||||
uint32 count = 0;
|
||||
const SessionMap& allSession = sWorld->GetAllSessions();
|
||||
for (SessionMap::const_iterator itSession = allSession.begin(); itSession != allSession.end(); itSession++)
|
||||
{
|
||||
if (!itSession->second || !itSession->second->IsBotSession())
|
||||
continue;
|
||||
PlayerBotSession* pSession = dynamic_cast<PlayerBotSession*>((WorldSession*)itSession->second);
|
||||
if (pSession && !pSession->IsAccountBotSession() && pSession->HasSchedules())
|
||||
++count;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
void PlayerBotMgr::QueryBattlegroundRequirement()
|
||||
{
|
||||
if (GetScheduledBotCount() >= 8)
|
||||
return;
|
||||
int32 teamSizeCap = sConfigMgr->GetIntDefault("pbotbg_maxperteam", 0);
|
||||
for (BattleGroundTypes::iterator itType = m_BGTypes.begin(); itType != m_BGTypes.end(); itType++)
|
||||
{
|
||||
|
||||
@@ -396,6 +396,7 @@ private:
|
||||
uint32 GetScheduleTalentByLFGRequirement(lfg::LfgRoles roles, uint32 botCls);
|
||||
void QueryBattlegroundRequirement();
|
||||
void UpdateIdleBotLogout();
|
||||
uint32 GetScheduledBotCount();
|
||||
void QueryRatedArenaRequirement();
|
||||
void QueryNonRatedArenaRequirement();
|
||||
void OnlinePlayerBotByGUIDQueue();
|
||||
|
||||
@@ -445,8 +445,9 @@ bool PlayerBotSession::ProcessInBGQueue(BotGlobleSchedule& schedule)
|
||||
|
||||
WorldPacket cmd(CMSG_BATTLEMASTER_JOIN);
|
||||
WorldPackets::Battleground::BattlemasterJoin packet(std::move(cmd));
|
||||
//packet.QueueID = MS::Battlegrounds::QueueOffsets::Battleground + MS::Battlegrounds::BattlegroundTypeId::BattlegroundRandom;
|
||||
//packet.RolesMask = 14;
|
||||
// SylvaniaCore (module BG BotFill): le QueueID n etait jamais renseigne (ligne commentee
|
||||
// du portage) -> le handler recevait bgtype 0 et rejetait toutes les inscriptions bots
|
||||
packet.QueueID = uint64(schedule.parameter1);
|
||||
HandleBattlemasterJoinOpcode(packet);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user