mirror of
https://github.com/EQEmu/Server.git
synced 2026-02-18 14:52:25 +00:00
Fix missing invite failure messages
This commit is contained in:
parent
39fad0c1a0
commit
aee3e1084c
@ -883,19 +883,27 @@ void Expedition::DzAddPlayer(
|
||||
return;
|
||||
}
|
||||
|
||||
bool invite_failed = false;
|
||||
|
||||
if (add_char_name.empty())
|
||||
{
|
||||
requester->MessageString(Chat::Red, DZADD_NOT_ONLINE, add_char_name.c_str());
|
||||
return;
|
||||
invite_failed = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// we can avoid checking online status in world if we trust member status accuracy
|
||||
auto member_data = GetMemberData(add_char_name);
|
||||
if (member_data.char_id != 0 && member_data.status != ExpeditionMemberStatus::Offline)
|
||||
{
|
||||
requester->MessageString(Chat::Red, DZADD_ALREADY_PART, add_char_name.c_str());
|
||||
invite_failed = true;
|
||||
}
|
||||
}
|
||||
|
||||
// live prioritizes the "not online" message before the "already a member"
|
||||
// message but we can avoid checking world if we trust member status accuracy
|
||||
// live sanitizes input except for "sending invite" and "not online" msgs
|
||||
auto member_data = GetMemberData(add_char_name);
|
||||
if (member_data.char_id != 0 && member_data.status != ExpeditionMemberStatus::Offline)
|
||||
if (invite_failed)
|
||||
{
|
||||
requester->MessageString(Chat::Red, DZADD_ALREADY_PART, add_char_name.c_str());
|
||||
requester->MessageString(Chat::Red, DZADD_INVITE_FAIL, FormatName(add_char_name).c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1679,6 +1687,7 @@ void Expedition::HandleWorldMessage(ServerPacket* pack)
|
||||
if (leader)
|
||||
{
|
||||
leader->MessageString(Chat::Red, DZADD_NOT_ONLINE, FormatName(buf->target_name).c_str());
|
||||
leader->MessageString(Chat::Red, DZADD_INVITE_FAIL, FormatName(buf->target_name).c_str());
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user