перевод текстов
This commit is contained in:
@@ -108,6 +108,8 @@ namespace lfg
|
||||
RANDOM_DUNGEON_HEROIC_WOTLK = 262
|
||||
};
|
||||
|
||||
constexpr uint32 LFG_SOLO_RANDOM_DUNGEON_ID_OFFSET = 1000;
|
||||
|
||||
class Lfg5Guids;
|
||||
|
||||
typedef std::list<Lfg5Guids> Lfg5GuidsList;
|
||||
|
||||
@@ -519,6 +519,7 @@ namespace lfg
|
||||
LfgJoinResultData joinData;
|
||||
LfgGuidSet players;
|
||||
uint32 rDungeonId = 0;
|
||||
bool soloQueue = false;
|
||||
bool isContinue = grp && grp->isLFGGroup() && GetState(gguid) != LFG_STATE_FINISHED_DUNGEON;
|
||||
|
||||
if (grp && (grp->isBGGroup() || grp->isBFGroup()))
|
||||
@@ -611,6 +612,10 @@ namespace lfg
|
||||
}
|
||||
}
|
||||
|
||||
soloQueue = rDungeonId && IsSoloRandomDungeon(rDungeonId);
|
||||
if (soloQueue && grp)
|
||||
joinData.result = LFG_JOIN_PARTY_NOT_MEET_REQS;
|
||||
|
||||
if (!isRaid && joinData.result == LFG_JOIN_OK)
|
||||
{
|
||||
// Check player or group member restrictions
|
||||
@@ -775,7 +780,7 @@ namespace lfg
|
||||
LfgRolesMap rolesMap;
|
||||
rolesMap[guid] = roles;
|
||||
LFGQueue& queue = GetQueue(guid);
|
||||
queue.AddQueueData(guid, GameTime::GetGameTime().count(), dungeons, rolesMap);
|
||||
queue.AddQueueData(guid, GameTime::GetGameTime().count(), dungeons, rolesMap, soloQueue);
|
||||
|
||||
if (!isContinue)
|
||||
{
|
||||
@@ -1671,7 +1676,11 @@ namespace lfg
|
||||
}
|
||||
|
||||
// Xinef: Store amount of random players player grouped with
|
||||
if (group)
|
||||
LfgDungeonSet const& selectedDungeons = GetSelectedDungeons(pguid);
|
||||
bool const soloRandom = !selectedDungeons.empty() && IsSoloRandomDungeon(*selectedDungeons.begin());
|
||||
if (soloRandom)
|
||||
SetRandomPlayersCount(pguid, 0);
|
||||
else if (group)
|
||||
{
|
||||
SetRandomPlayersCount(pguid, group->GetMembersCount() >= MAXGROUPSIZE ? 0 : MAXGROUPSIZE - group->GetMembersCount());
|
||||
oldGroupGUID = group->GetGUID();
|
||||
@@ -2345,8 +2354,12 @@ namespace lfg
|
||||
*/
|
||||
LfgReward const* LFGMgr::GetRandomDungeonReward(uint32 dungeon, uint8 level)
|
||||
{
|
||||
uint32 dungeonId = dungeon & 0x00FFFFFF;
|
||||
if (IsSoloRandomDungeon(dungeonId))
|
||||
dungeonId -= LFG_SOLO_RANDOM_DUNGEON_ID_OFFSET;
|
||||
|
||||
LfgReward const* rew = nullptr;
|
||||
LfgRewardContainerBounds bounds = RewardMapStore.equal_range(dungeon & 0x00FFFFFF);
|
||||
LfgRewardContainerBounds bounds = RewardMapStore.equal_range(dungeonId);
|
||||
for (LfgRewardContainer::const_iterator itr = bounds.first; itr != bounds.second; ++itr)
|
||||
{
|
||||
rew = itr->second;
|
||||
@@ -2358,6 +2371,20 @@ namespace lfg
|
||||
return rew;
|
||||
}
|
||||
|
||||
bool LFGMgr::IsSoloRandomDungeon(uint32 dungeon)
|
||||
{
|
||||
uint32 dungeonId = dungeon & 0x00FFFFFF;
|
||||
if (dungeonId < LFG_SOLO_RANDOM_DUNGEON_ID_OFFSET)
|
||||
return false;
|
||||
|
||||
LFGDungeonData const* solo = GetLFGDungeon(dungeonId);
|
||||
LFGDungeonData const* regular = GetLFGDungeon(dungeonId - LFG_SOLO_RANDOM_DUNGEON_ID_OFFSET);
|
||||
return solo && regular &&
|
||||
solo->type == LFG_TYPE_RANDOM &&
|
||||
regular->type == LFG_TYPE_RANDOM &&
|
||||
solo->group == regular->group;
|
||||
}
|
||||
|
||||
/**
|
||||
Given a Dungeon id returns the dungeon Type
|
||||
|
||||
|
||||
@@ -525,6 +525,8 @@ namespace lfg
|
||||
bool IsDungeonDisabled(uint32 mapId, Difficulty difficulty) const;
|
||||
/// Gets the random dungeon reward corresponding to given dungeon and player level
|
||||
LfgReward const* GetRandomDungeonReward(uint32 dungeon, uint8 level);
|
||||
/// Checks whether an entry is a custom one-player random dungeon category
|
||||
bool IsSoloRandomDungeon(uint32 dungeon);
|
||||
/// Returns all random and seasonal dungeons for given level and expansion
|
||||
LfgDungeonSet GetRandomAndSeasonalDungeons(uint8 level, uint8 expansion);
|
||||
/// Teleport a player to/from selected dungeon
|
||||
|
||||
@@ -104,10 +104,10 @@ namespace lfg
|
||||
restoredAfterProposal.remove(guid);
|
||||
}
|
||||
|
||||
void LFGQueue::AddQueueData(ObjectGuid guid, time_t joinTime, LfgDungeonSet const& dungeons, LfgRolesMap const& rolesMap)
|
||||
void LFGQueue::AddQueueData(ObjectGuid guid, time_t joinTime, LfgDungeonSet const& dungeons, LfgRolesMap const& rolesMap, bool solo)
|
||||
{
|
||||
LOG_DEBUG("lfg", "JOINED AddQueueData: {}", guid.ToString());
|
||||
QueueDataStore[guid] = LfgQueueData(joinTime, dungeons, rolesMap);
|
||||
QueueDataStore[guid] = LfgQueueData(joinTime, dungeons, rolesMap, solo);
|
||||
AddToQueue(guid);
|
||||
}
|
||||
|
||||
@@ -263,6 +263,7 @@ namespace lfg
|
||||
// Check if more than one LFG group and number of players joining
|
||||
uint8 numPlayers = 0;
|
||||
uint8 numLfgGroups = 0;
|
||||
bool soloQueue = false;
|
||||
ObjectGuid guid;
|
||||
uint64 addToFoundMask = 0;
|
||||
|
||||
@@ -280,6 +281,7 @@ namespace lfg
|
||||
for (LfgRolesMap::const_iterator it2 = itQueue->second.roles.begin(); it2 != itQueue->second.roles.end(); ++it2)
|
||||
proposalGroups[it2->first] = itQueue->first.IsGroup() ? itQueue->first : ObjectGuid::Empty;
|
||||
|
||||
soloQueue = soloQueue || itQueue->second.solo;
|
||||
numPlayers += itQueue->second.roles.size();
|
||||
|
||||
if (sLFGMgr->IsLfgGroup(guid))
|
||||
@@ -293,8 +295,13 @@ namespace lfg
|
||||
if (numLfgGroups > 1)
|
||||
return LFG_INCOMPATIBLES_MULTIPLE_LFG_GROUPS;
|
||||
|
||||
// A solo RDF entry is a complete one-player match and must not absorb
|
||||
// entries from the regular five-player queue.
|
||||
if (soloQueue && (check.size() != 1 || numPlayers != 1))
|
||||
return LFG_INCOMPATIBLES_WRONG_GROUP_SIZE;
|
||||
|
||||
// Group with less that MAXGROUPSIZE members always compatible
|
||||
if (!sLFGMgr->IsTesting() && check.size() == 1 && numPlayers < MAXGROUPSIZE)
|
||||
if (!sLFGMgr->IsTesting() && !soloQueue && check.size() == 1 && numPlayers < MAXGROUPSIZE)
|
||||
{
|
||||
LfgQueueDataContainer::iterator itQueue = QueueDataStore.find(check.front());
|
||||
LfgRolesMap roles = itQueue->second.roles;
|
||||
@@ -388,10 +395,27 @@ namespace lfg
|
||||
proposalDungeons = queue.dungeons;
|
||||
proposalRoles = queue.roles;
|
||||
LFGMgr::CheckGroupRoles(proposalRoles); // assing new roles
|
||||
|
||||
// A one-player proposal still has to contain one of the three
|
||||
// canonical combat roles. The stock queue never reaches a
|
||||
// proposal with PLAYER_ROLE_NONE, while the solo queue can.
|
||||
// Sending NONE (or a multi-role mask) makes the 3.3.5a client
|
||||
// return "UNKNOWN" and LFDFrame.lua raises an error.
|
||||
if (soloQueue)
|
||||
{
|
||||
uint8& role = proposalRoles.begin()->second;
|
||||
role &= PLAYER_ROLE_TANK | PLAYER_ROLE_HEALER | PLAYER_ROLE_DAMAGE;
|
||||
if (role & PLAYER_ROLE_TANK)
|
||||
role = PLAYER_ROLE_TANK;
|
||||
else if (role & PLAYER_ROLE_HEALER)
|
||||
role = PLAYER_ROLE_HEALER;
|
||||
else
|
||||
role = PLAYER_ROLE_DAMAGE;
|
||||
}
|
||||
}
|
||||
|
||||
// Enough players?
|
||||
if (!sLFGMgr->IsTesting() && numPlayers != MAXGROUPSIZE)
|
||||
if (!sLFGMgr->IsTesting() && !soloQueue && numPlayers != MAXGROUPSIZE)
|
||||
{
|
||||
strGuids.addRoles(proposalRoles);
|
||||
for (uint8 i = 0; i < 5 && check.guids[i]; ++i)
|
||||
|
||||
@@ -40,9 +40,9 @@ namespace lfg
|
||||
{
|
||||
LfgQueueData();
|
||||
|
||||
LfgQueueData(time_t _joinTime, LfgDungeonSet _dungeons, LfgRolesMap _roles):
|
||||
LfgQueueData(time_t _joinTime, LfgDungeonSet _dungeons, LfgRolesMap _roles, bool _solo):
|
||||
joinTime(_joinTime), lastRefreshTime(_joinTime), tanks(LFG_TANKS_NEEDED), healers(LFG_HEALERS_NEEDED),
|
||||
dps(LFG_DPS_NEEDED), dungeons(std::move(_dungeons)), roles(std::move(_roles))
|
||||
dps(LFG_DPS_NEEDED), dungeons(std::move(_dungeons)), roles(std::move(_roles)), solo(_solo)
|
||||
{ }
|
||||
|
||||
time_t joinTime; // Player queue join time (to calculate wait times)
|
||||
@@ -52,6 +52,7 @@ namespace lfg
|
||||
uint8 dps{LFG_DPS_NEEDED}; // Dps needed
|
||||
LfgDungeonSet dungeons; // Selected Player/Group Dungeon/s
|
||||
LfgRolesMap roles; // Selected Player Role/s
|
||||
bool solo{false}; // Match as a one-player RDF group
|
||||
Lfg5Guids bestCompatible; // Best compatible combination of people queued
|
||||
};
|
||||
|
||||
@@ -75,7 +76,7 @@ namespace lfg
|
||||
// Add/Remove from queue
|
||||
void AddToQueue(ObjectGuid guid, bool failedProposal = false);
|
||||
void RemoveFromQueue(ObjectGuid guid, bool partial = false); // xinef: partial remove, dont delete data from list!
|
||||
void AddQueueData(ObjectGuid guid, time_t joinTime, LfgDungeonSet const& dungeons, LfgRolesMap const& rolesMap);
|
||||
void AddQueueData(ObjectGuid guid, time_t joinTime, LfgDungeonSet const& dungeons, LfgRolesMap const& rolesMap, bool solo = false);
|
||||
void RemoveQueueData(ObjectGuid guid);
|
||||
|
||||
// Update Timers (when proposal success)
|
||||
|
||||
Reference in New Issue
Block a user