Transcription ArgusCore lot 4 : anti-exploit LFG + calendrier
- LFG: quitter la file en solo n autorise que SON propre ticket, pas celui d un autre (28b8d962) - Calendrier: modifier un evenement ou y ajouter une invitation reserve au proprietaire ou a un invite moderateur (helper CalendarEventEditableBy sur UpdateEvent + Invite) (0c2fed59) Non portes (deja OK/absents chez nous) : arene join utilise deja la vraie note (pas le bug hardcode a 1) ; Chant de Chi-Ji areatrigger DEJA implemente (at_monk_song_of_chiji). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -174,6 +174,21 @@ void WorldSession::HandleCalendarAddEvent(WorldPackets::Calendar::CalendarAddEve
|
||||
sCalendarMgr->AddEvent(calendarEvent, CALENDAR_SENDTYPE_ADD);
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
// Un evenement ne peut etre modifie (details, invites, statut d un invite) que par son
|
||||
// proprietaire ou par un invite de rang moderateur (ArgusCore 0c2fed59).
|
||||
bool CalendarEventEditableBy(CalendarEvent const* calendarEvent, ObjectGuid guid)
|
||||
{
|
||||
if (calendarEvent->GetOwnerGUID() == guid)
|
||||
return true;
|
||||
for (CalendarInvite* invite : sCalendarMgr->GetEventInvites(calendarEvent->GetEventId()))
|
||||
if (invite->GetInviteeGUID() == guid && invite->GetRank() >= CALENDAR_RANK_MODERATOR)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::HandleCalendarUpdateEvent(WorldPackets::Calendar::CalendarUpdateEvent& calendarUpdateEvent)
|
||||
{
|
||||
ObjectGuid guid = _player->GetGUID();
|
||||
@@ -186,6 +201,12 @@ void WorldSession::HandleCalendarUpdateEvent(WorldPackets::Calendar::CalendarUpd
|
||||
|
||||
if (CalendarEvent* calendarEvent = sCalendarMgr->GetEvent(calendarUpdateEvent.EventInfo.EventID))
|
||||
{
|
||||
if (!CalendarEventEditableBy(calendarEvent, guid))
|
||||
{
|
||||
sCalendarMgr->SendCalendarCommandResult(guid, CALENDAR_ERROR_PERMISSIONS);
|
||||
return;
|
||||
}
|
||||
|
||||
oldEventTime = calendarEvent->GetDate();
|
||||
|
||||
calendarEvent->SetType(CalendarEventType(calendarUpdateEvent.EventInfo.EventType));
|
||||
@@ -301,6 +322,12 @@ void WorldSession::HandleCalendarEventInvite(WorldPackets::Calendar::CalendarEve
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CalendarEventEditableBy(calendarEvent, playerGuid))
|
||||
{
|
||||
sCalendarMgr->SendCalendarCommandResult(playerGuid, CALENDAR_ERROR_PERMISSIONS);
|
||||
return;
|
||||
}
|
||||
|
||||
CalendarInvite* invite = new CalendarInvite(sCalendarMgr->GetFreeInviteId(), calendarEventInvite.EventID, inviteeGuid, playerGuid, CALENDAR_DEFAULT_RESPONSE_TIME, CALENDAR_STATUS_INVITED, CALENDAR_RANK_PLAYER, "");
|
||||
sCalendarMgr->AddInvite(calendarEvent, invite);
|
||||
}
|
||||
|
||||
@@ -61,8 +61,9 @@ void WorldSession::HandleLfgLeaveOpcode(WorldPackets::LFG::DFLeave& dfLeave)
|
||||
TC_LOG_DEBUG("lfg", "CMSG_DF_LEAVE %s in group: %u sent guid %s.",
|
||||
GetPlayerInfo().c_str(), group ? 1 : 0, dfLeave.Ticket.RequesterGuid.ToString().c_str());
|
||||
|
||||
// Check cheating - only leader can leave the queue
|
||||
if (!group || group->GetLeaderGUID() == dfLeave.Ticket.RequesterGuid)
|
||||
// Anti-triche : en groupe seul le chef quitte via son ticket ; en solo on ne peut
|
||||
// quitter que SON PROPRE ticket, pas celui d un joueur arbitraire (ArgusCore 28b8d962)
|
||||
if (group ? group->GetLeaderGUID() == dfLeave.Ticket.RequesterGuid : GetPlayer()->GetGUID() == dfLeave.Ticket.RequesterGuid)
|
||||
sLFGMgr->LeaveLfg(dfLeave.Ticket.RequesterGuid, dfLeave.Ticket.Id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user