mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-07 21:32:26 +00:00
Fix wrong group leader name in expedition requests
Get group leader name from Client if possible and ask database otherwise Group::GetLeaderName() is unreliable and broken for groups formed across zones. The correct leader name is needed here to avoid any possible exploits with an invalid leader bypassing lockout checks.
This commit is contained in:
parent
78eb3be127
commit
b116730885
@ -120,7 +120,8 @@ bool ExpeditionRequest::CanGroupRequest(Group* group)
|
|||||||
{
|
{
|
||||||
m_leader = group->GetLeader()->CastToClient();
|
m_leader = group->GetLeader()->CastToClient();
|
||||||
}
|
}
|
||||||
m_leader_name = group->GetLeaderName();
|
// Group::GetLeaderName() is broken if group formed across zones, ask database instead
|
||||||
|
m_leader_name = m_leader ? m_leader->GetName() : GetGroupLeaderName(group->GetID()); // group->GetLeaderName();
|
||||||
m_leader_id = m_leader ? m_leader->CharacterID() : database.GetCharacterID(m_leader_name.c_str());
|
m_leader_id = m_leader ? m_leader->CharacterID() : database.GetCharacterID(m_leader_name.c_str());
|
||||||
|
|
||||||
uint32_t count = 0;
|
uint32_t count = 0;
|
||||||
@ -142,6 +143,13 @@ bool ExpeditionRequest::CanGroupRequest(Group* group)
|
|||||||
return ValidateMembers(query_member_names, count);
|
return ValidateMembers(query_member_names, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string ExpeditionRequest::GetGroupLeaderName(uint32_t group_id)
|
||||||
|
{
|
||||||
|
char leader_name_buffer[64] = { 0 };
|
||||||
|
database.GetGroupLeadershipInfo(group_id, leader_name_buffer);
|
||||||
|
return std::string(leader_name_buffer);
|
||||||
|
}
|
||||||
|
|
||||||
bool ExpeditionRequest::ValidateMembers(const std::string& query_member_names, uint32_t member_count)
|
bool ExpeditionRequest::ValidateMembers(const std::string& query_member_names, uint32_t member_count)
|
||||||
{
|
{
|
||||||
if (query_member_names.empty() || !LoadLeaderLockouts())
|
if (query_member_names.empty() || !LoadLeaderLockouts())
|
||||||
|
|||||||
@ -58,6 +58,7 @@ private:
|
|||||||
bool CanRaidRequest(Raid* raid);
|
bool CanRaidRequest(Raid* raid);
|
||||||
bool CanGroupRequest(Group* group);
|
bool CanGroupRequest(Group* group);
|
||||||
bool CheckMembersForConflicts(MySQLRequestResult& results, bool is_solo);
|
bool CheckMembersForConflicts(MySQLRequestResult& results, bool is_solo);
|
||||||
|
std::string GetGroupLeaderName(uint32_t group_id);
|
||||||
bool IsPlayerCountValidated(uint32_t member_count);
|
bool IsPlayerCountValidated(uint32_t member_count);
|
||||||
bool LoadLeaderLockouts();
|
bool LoadLeaderLockouts();
|
||||||
void SendLeaderMemberInExpedition(const std::string& member_name, bool is_solo);
|
void SendLeaderMemberInExpedition(const std::string& member_name, bool is_solo);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user