![]() |
TrinityCore
|
#include <CalendarMgr.h>
Static Public Member Functions | |
| static CalendarMgr * | instance () |
Private Member Functions | |
| CalendarMgr () | |
| ~CalendarMgr () | |
Private Attributes | |
| CalendarEventStore | _events |
| CalendarEventInviteStore | _invites |
| std::deque< uint64 > | _freeEventIds |
| std::deque< uint64 > | _freeInviteIds |
| uint64 | _maxEventId |
| uint64 | _maxInviteId |
Definition at line 282 of file CalendarMgr.h.
|
private |
Definition at line 49 of file CalendarMgr.cpp.
|
private |
Definition at line 51 of file CalendarMgr.cpp.
|
delete |
|
delete |
| void CalendarMgr::AddEvent | ( | CalendarEvent * | calendarEvent, |
| CalendarSendEventType | sendType | ||
| ) |
Definition at line 143 of file CalendarMgr.cpp.
References _events, CalendarEvent::GetOwnerGUID(), SendCalendarEvent(), and UpdateEvent().
| void CalendarMgr::AddInvite | ( | CalendarEvent * | calendarEvent, |
| CalendarInvite * | invite, | ||
| CharacterDatabaseTransaction | trans = nullptr |
||
| ) |
Definition at line 150 of file CalendarMgr.cpp.
References _invites, CalendarInvite::GetEventId(), CalendarInvite::GetInviteeGUID(), CalendarEvent::GetOwnerGUID(), CalendarEvent::IsGuildAnnouncement(), CalendarEvent::IsGuildEvent(), SendCalendarEventInvite(), SendCalendarEventInviteAlert(), and UpdateInvite().
| void CalendarMgr::DeleteOldEvents | ( | ) |
Definition at line 370 of file CalendarMgr.cpp.
References _events, CALENDAR_OLD_EVENTS_DELETION_TIME, ObjectGuid::Empty, GameTime::GetGameTime(), and RemoveEvent().
| void CalendarMgr::FreeEventId | ( | uint64 | id | ) |
Definition at line 334 of file CalendarMgr.cpp.
References _freeEventIds, and _maxEventId.
| void CalendarMgr::FreeInviteId | ( | uint64 | id | ) |
Definition at line 352 of file CalendarMgr.cpp.
References _freeInviteIds, and _maxInviteId.
| std::vector< Player * > CalendarMgr::GetAllEventRelatives | ( | CalendarEvent const & | calendarEvent | ) | const |
Definition at line 743 of file CalendarMgr.cpp.
References _invites, ObjectAccessor::FindConnectedPlayer(), CalendarEvent::GetEventId(), CalendarEvent::GetGuildId(), CalendarEvent::IsGuildAnnouncement(), CalendarEvent::IsGuildEvent(), and sGuildMgr.
Referenced by SendCalendarEventInvite(), SendCalendarEventRemovedAlert(), SendCalendarEventStatus(), SendCalendarEventUpdateAlert(), and SendPacketToAllEventRelatives().
| CalendarEvent * CalendarMgr::GetEvent | ( | uint64 | eventId | ) | const |
Definition at line 313 of file CalendarMgr.cpp.
References _events, and TC_LOG_DEBUG.
Referenced by GetPlayerEvents(), LoadFromDB(), RemoveEvent(), RemoveInvite(), RemovePlayerGuildEventsAndSignups(), and SendCalendarEventInvite().
| CalendarInviteStore CalendarMgr::GetEventInvites | ( | uint64 | eventId | ) | const |
Definition at line 427 of file CalendarMgr.cpp.
References _invites, and Trinity::Containers::MapGetValuePtr().
|
inline |
Definition at line 308 of file CalendarMgr.h.
| CalendarEventStore CalendarMgr::GetEventsCreatedBy | ( | ObjectGuid | guid, |
| bool | includeGuildEvents = false |
||
| ) | const |
Definition at line 383 of file CalendarMgr.cpp.
References _events.
| uint64 CalendarMgr::GetFreeEventId | ( | ) |
Definition at line 342 of file CalendarMgr.cpp.
References _freeEventIds, and _maxEventId.
| uint64 CalendarMgr::GetFreeInviteId | ( | ) |
Definition at line 360 of file CalendarMgr.cpp.
References _freeInviteIds, and _maxInviteId.
| CalendarEventStore CalendarMgr::GetGuildEvents | ( | ObjectGuid::LowType | guildId | ) | const |
Definition at line 393 of file CalendarMgr.cpp.
References _events.
| CalendarInvite * CalendarMgr::GetInvite | ( | uint64 | inviteId | ) | const |
Definition at line 323 of file CalendarMgr.cpp.
References _invites, and TC_LOG_DEBUG.
Referenced by LoadFromDB().
|
inline |
Definition at line 314 of file CalendarMgr.h.
| CalendarEventStore CalendarMgr::GetPlayerEvents | ( | ObjectGuid | guid | ) | const |
Definition at line 408 of file CalendarMgr.cpp.
References _events, _invites, ObjectAccessor::FindConnectedPlayer(), and GetEvent().
| CalendarInviteStore CalendarMgr::GetPlayerInvites | ( | ObjectGuid | guid | ) | const |
Definition at line 436 of file CalendarMgr.cpp.
References _invites.
Referenced by GetPlayerNumPending(), RemoveAllPlayerEventsAndInvites(), and RemovePlayerGuildEventsAndSignups().
| uint32 CalendarMgr::GetPlayerNumPending | ( | ObjectGuid | guid | ) |
Definition at line 448 of file CalendarMgr.cpp.
References CALENDAR_STATUS_INVITED, CALENDAR_STATUS_NOT_SIGNED_UP, CALENDAR_STATUS_TENTATIVE, and GetPlayerInvites().
|
static |
| void CalendarMgr::LoadFromDB | ( | ) |
Definition at line 67 of file CalendarMgr.cpp.
References _events, _freeEventIds, _freeInviteIds, _invites, _maxEventId, _maxInviteId, CALENDAR_FLAG_GUILD_EVENT, CALENDAR_FLAG_WITHOUT_INVITES, CharacterDatabase, flags, GetEvent(), Field::GetInt32(), Field::GetInt64(), GetInvite(), getMSTime(), GetMSTimeDiffToNow(), Field::GetString(), Field::GetUInt32(), Field::GetUInt64(), sCharacterCache, TC_LOG_INFO, and UI64LIT.
|
delete |
|
delete |
| void CalendarMgr::RemoveAllPlayerEventsAndInvites | ( | ObjectGuid | guid | ) |
Definition at line 285 of file CalendarMgr.cpp.
References _events, ObjectGuid::Empty, GetPlayerInvites(), RemoveEvent(), and RemoveInvite().
| void CalendarMgr::RemoveEvent | ( | CalendarEvent * | calendarEvent, |
| ObjectGuid | remover | ||
| ) |
Definition at line 178 of file CalendarMgr.cpp.
References _events, _invites, CalendarEvent::BuildCalendarMailBody(), CalendarEvent::BuildCalendarMailSubject(), CALENDAR_ERROR_EVENT_INVALID, CHAR_DEL_CALENDAR_EVENT, CHAR_DEL_CALENDAR_INVITE, CharacterDatabase, ObjectAccessor::FindConnectedPlayer(), ObjectGuid::GetCounter(), CalendarEvent::GetEventId(), CalendarInvite::GetInviteeGUID(), CalendarInvite::GetInviteId(), ObjectGuid::IsEmpty(), MAIL_CHECK_MASK_CALENDAR_INVITE, MAIL_CHECK_MASK_COPIED, SendCalendarCommandResult(), SendCalendarEventRemovedAlert(), MailDraft::SendMailTo(), and PreparedStatementBase::setUInt64().
| void CalendarMgr::RemoveEvent | ( | uint64 | eventId, |
| ObjectGuid | remover | ||
| ) |
Definition at line 165 of file CalendarMgr.cpp.
References CALENDAR_ERROR_EVENT_INVALID, GetEvent(), RemoveEvent(), and SendCalendarCommandResult().
Referenced by DeleteOldEvents(), RemoveAllPlayerEventsAndInvites(), RemoveEvent(), and RemovePlayerGuildEventsAndSignups().
| void CalendarMgr::RemoveInvite | ( | uint64 | inviteId, |
| uint64 | eventId, | ||
| ObjectGuid | remover | ||
| ) |
Definition at line 221 of file CalendarMgr.cpp.
References _invites, CALENDAR_STATUS_REMOVED, CHAR_DEL_CALENDAR_INVITE, CharacterDatabase, GetEvent(), CalendarEvent::GetFlags(), CalendarEvent::IsGuildEvent(), SendCalendarEventInviteRemove(), SendCalendarEventInviteRemoveAlert(), and PreparedStatementBase::setUInt64().
Referenced by RemoveAllPlayerEventsAndInvites(), and RemovePlayerGuildEventsAndSignups().
| void CalendarMgr::RemovePlayerGuildEventsAndSignups | ( | ObjectGuid | guid, |
| ObjectGuid::LowType | guildId | ||
| ) |
Definition at line 300 of file CalendarMgr.cpp.
References _events, GetEvent(), GetPlayerInvites(), RemoveEvent(), and RemoveInvite().
| void CalendarMgr::SendCalendarClearPendingAction | ( | ObjectGuid | guid | ) | const |
Definition at line 708 of file CalendarMgr.cpp.
References ObjectAccessor::FindConnectedPlayer().
| void CalendarMgr::SendCalendarCommandResult | ( | ObjectGuid | guid, |
| CalendarError | err, | ||
| char const * | param = nullptr |
||
| ) | const |
Definition at line 714 of file CalendarMgr.cpp.
References CALENDAR_ERROR_ALREADY_INVITED_TO_EVENT_S, CALENDAR_ERROR_IGNORING_YOU_S, CALENDAR_ERROR_OTHER_INVITES_EXCEEDED, WorldPackets::Calendar::CalendarCommandResult::Command, ObjectAccessor::FindConnectedPlayer(), WorldPackets::Calendar::CalendarCommandResult::Name, WorldPackets::Calendar::CalendarCommandResult::Result, and WorldPackets::Calendar::CalendarCommandResult::Write().
Referenced by RemoveEvent(), and RemoveEvent().
| void CalendarMgr::SendCalendarEvent | ( | ObjectGuid | guid, |
| CalendarEvent const & | calendarEvent, | ||
| CalendarSendEventType | sendType | ||
| ) | const |
Definition at line 643 of file CalendarMgr.cpp.
References _invites, WorldPackets::Calendar::CalendarSendEvent::Date, WorldPackets::Calendar::CalendarSendEvent::Description, WorldPackets::Calendar::CalendarSendEvent::EventClubID, WorldPackets::Calendar::CalendarSendEvent::EventID, WorldPackets::Calendar::CalendarSendEvent::EventName, WorldPackets::Calendar::CalendarSendEvent::EventType, ObjectAccessor::FindConnectedPlayer(), ObjectAccessor::FindPlayer(), WorldPackets::Calendar::CalendarSendEvent::Flags, CalendarEvent::GetDate(), CalendarEvent::GetDescription(), CalendarEvent::GetEventId(), WorldPackets::Calendar::CalendarSendEvent::GetEventType, CalendarEvent::GetFlags(), CalendarEvent::GetGuildId(), Player::GetGuildId(), Unit::GetLevel(), CalendarEvent::GetLockDate(), CalendarEvent::GetOwnerGUID(), Player::GetSession(), CalendarEvent::GetTextureId(), WorldSession::GetTimezoneOffset(), CalendarEvent::GetTitle(), CalendarEvent::GetType(), WorldPackets::Calendar::CalendarEventInviteInfo::Guid, WorldPackets::Calendar::CalendarEventInviteInfo::InviteID, WorldPackets::Calendar::CalendarSendEvent::Invites, WorldPackets::Calendar::CalendarEventInviteInfo::InviteType, CalendarEvent::IsGuildEvent(), WorldPackets::Calendar::CalendarEventInviteInfo::Level, WorldPackets::Calendar::CalendarSendEvent::LockDate, Trinity::Containers::MapGetValuePtr(), WorldPackets::Calendar::CalendarEventInviteInfo::Moderator, WorldPackets::Calendar::CalendarEventInviteInfo::Notes, WorldPackets::Calendar::CalendarSendEvent::OwnerGuid, WorldPackets::Calendar::CalendarEventInviteInfo::ResponseTime, sCharacterCache, Player::SendDirectMessage(), WowTime::SetUtcTimeFromUnixTime(), WorldPackets::Calendar::CalendarEventInviteInfo::Status, WorldPackets::Calendar::CalendarSendEvent::TextureID, and WorldPackets::Calendar::CalendarSendEvent::Write().
Referenced by AddEvent().
| void CalendarMgr::SendCalendarEventInvite | ( | CalendarInvite const & | invite | ) | const |
Definition at line 485 of file CalendarMgr.cpp.
References WorldPackets::Calendar::CalendarInviteAdded::ClearPending, WorldPackets::Calendar::CalendarInviteAdded::EventID, ObjectAccessor::FindConnectedPlayer(), GetAllEventRelatives(), GetEvent(), CalendarInvite::GetEventId(), CalendarEvent::GetEventId(), CalendarInvite::GetInviteeGUID(), CalendarInvite::GetInviteId(), Unit::GetLevel(), CalendarEvent::GetOwnerGUID(), CalendarInvite::GetResponseTime(), CalendarInvite::GetSenderGUID(), CalendarInvite::GetStatus(), WorldPackets::Calendar::CalendarInviteAdded::InviteGuid, WorldPackets::Calendar::CalendarInviteAdded::InviteID, CalendarEvent::IsGuildEvent(), WorldPackets::Calendar::CalendarInviteAdded::Level, WorldPackets::Calendar::CalendarInviteAdded::ResponseTime, sCharacterCache, WowTime::SetUtcTimeFromUnixTime(), WorldPackets::Calendar::CalendarInviteAdded::Status, WorldPackets::Calendar::CalendarInviteAdded::Type, and WorldPackets::Calendar::CalendarInviteAdded::Write().
Referenced by AddInvite().
| void CalendarMgr::SendCalendarEventInviteAlert | ( | CalendarEvent const & | calendarEvent, |
| CalendarInvite const & | invite | ||
| ) | const |
Definition at line 612 of file CalendarMgr.cpp.
References WorldPackets::Calendar::CalendarInviteAlert::Date, WorldPackets::Calendar::CalendarInviteAlert::EventClubID, WorldPackets::Calendar::CalendarInviteAlert::EventID, WorldPackets::Calendar::CalendarInviteAlert::EventName, WorldPackets::Calendar::CalendarInviteAlert::EventType, ObjectAccessor::FindConnectedPlayer(), WorldPackets::Calendar::CalendarInviteAlert::Flags, CalendarEvent::GetDate(), CalendarEvent::GetEventId(), CalendarEvent::GetFlags(), CalendarEvent::GetGuildId(), CalendarInvite::GetInviteeGUID(), CalendarInvite::GetInviteId(), CalendarEvent::GetOwnerGUID(), CalendarInvite::GetRank(), CalendarInvite::GetSenderGUID(), CalendarInvite::GetStatus(), CalendarEvent::GetTextureId(), CalendarEvent::GetTitle(), CalendarEvent::GetType(), WorldPackets::Calendar::CalendarInviteAlert::InvitedByGuid, WorldPackets::Calendar::CalendarInviteAlert::InviteID, CalendarEvent::IsGuildAnnouncement(), CalendarEvent::IsGuildEvent(), WorldPackets::Calendar::CalendarInviteAlert::ModeratorStatus, WorldPackets::Calendar::CalendarInviteAlert::OwnerGuid, WowTime::SetUtcTimeFromUnixTime(), sGuildMgr, WorldPackets::Calendar::CalendarInviteAlert::Status, WorldPackets::Calendar::CalendarInviteAlert::TextureID, and WorldPackets::Calendar::CalendarInviteAlert::Write().
Referenced by AddInvite().
| void CalendarMgr::SendCalendarEventInviteRemove | ( | CalendarEvent const & | calendarEvent, |
| CalendarInvite const & | invite, | ||
| uint32 | flags | ||
| ) | const |
Definition at line 590 of file CalendarMgr.cpp.
References WorldPackets::Calendar::CalendarInviteRemoved::ClearPending, WorldPackets::Calendar::CalendarInviteRemoved::EventID, flags, WorldPackets::Calendar::CalendarInviteRemoved::Flags, CalendarEvent::GetEventId(), CalendarInvite::GetInviteeGUID(), WorldPackets::Calendar::CalendarInviteRemoved::InviteGuid, SendPacketToAllEventRelatives(), and WorldPackets::Calendar::CalendarInviteRemoved::Write().
Referenced by RemoveInvite().
| void CalendarMgr::SendCalendarEventInviteRemoveAlert | ( | ObjectGuid | guid, |
| CalendarEvent const & | calendarEvent, | ||
| CalendarInviteStatus | status | ||
| ) | const |
Definition at line 693 of file CalendarMgr.cpp.
References WorldPackets::Calendar::CalendarInviteRemovedAlert::Date, WorldPackets::Calendar::CalendarInviteRemovedAlert::EventID, ObjectAccessor::FindConnectedPlayer(), WorldPackets::Calendar::CalendarInviteRemovedAlert::Flags, CalendarEvent::GetDate(), CalendarEvent::GetEventId(), CalendarEvent::GetFlags(), WowTime::SetUtcTimeFromUnixTime(), WorldPackets::Calendar::CalendarInviteRemovedAlert::Status, and WorldPackets::Calendar::CalendarInviteRemovedAlert::Write().
Referenced by RemoveInvite().
| void CalendarMgr::SendCalendarEventModeratorStatusAlert | ( | CalendarEvent const & | calendarEvent, |
| CalendarInvite const & | invite | ||
| ) | const |
Definition at line 601 of file CalendarMgr.cpp.
References WorldPackets::Calendar::CalendarModeratorStatus::ClearPending, WorldPackets::Calendar::CalendarModeratorStatus::EventID, CalendarEvent::GetEventId(), CalendarInvite::GetInviteeGUID(), CalendarInvite::GetStatus(), WorldPackets::Calendar::CalendarModeratorStatus::InviteGuid, SendPacketToAllEventRelatives(), WorldPackets::Calendar::CalendarModeratorStatus::Status, and WorldPackets::Calendar::CalendarModeratorStatus::Write().
| void CalendarMgr::SendCalendarEventRemovedAlert | ( | CalendarEvent const & | calendarEvent | ) | const |
Definition at line 573 of file CalendarMgr.cpp.
References WorldPackets::Calendar::CalendarEventRemovedAlert::ClearPending, WorldPackets::Calendar::CalendarEventRemovedAlert::Date, WorldPackets::Calendar::CalendarEventRemovedAlert::EventID, GetAllEventRelatives(), CalendarEvent::GetDate(), CalendarEvent::GetEventId(), CalendarEvent::GetOwnerGUID(), WowTime::SetUtcTimeFromUnixTime(), and WorldPackets::Calendar::CalendarEventRemovedAlert::Write().
Referenced by RemoveEvent().
| void CalendarMgr::SendCalendarEventStatus | ( | CalendarEvent const & | calendarEvent, |
| CalendarInvite const & | invite | ||
| ) | const |
Definition at line 551 of file CalendarMgr.cpp.
References WorldPackets::Calendar::CalendarInviteStatus::ClearPending, WorldPackets::Calendar::CalendarInviteStatus::Date, WorldPackets::Calendar::CalendarInviteStatus::EventID, WorldPackets::Calendar::CalendarInviteStatus::Flags, GetAllEventRelatives(), CalendarEvent::GetDate(), CalendarEvent::GetEventId(), CalendarEvent::GetFlags(), CalendarInvite::GetInviteeGUID(), CalendarInvite::GetResponseTime(), CalendarInvite::GetStatus(), WorldPackets::Calendar::CalendarInviteStatus::InviteGuid, WorldPackets::Calendar::CalendarInviteStatus::ResponseTime, WowTime::SetUtcTimeFromUnixTime(), WorldPackets::Calendar::CalendarInviteStatus::Status, and WorldPackets::Calendar::CalendarInviteStatus::Write().
| void CalendarMgr::SendCalendarEventUpdateAlert | ( | CalendarEvent const & | calendarEvent, |
| time_t | originalDate | ||
| ) | const |
Definition at line 523 of file CalendarMgr.cpp.
References WorldPackets::Calendar::CalendarEventUpdatedAlert::ClearPending, WorldPackets::Calendar::CalendarEventUpdatedAlert::Date, WorldPackets::Calendar::CalendarEventUpdatedAlert::Description, WorldPackets::Calendar::CalendarEventUpdatedAlert::EventClubID, WorldPackets::Calendar::CalendarEventUpdatedAlert::EventID, WorldPackets::Calendar::CalendarEventUpdatedAlert::EventName, WorldPackets::Calendar::CalendarEventUpdatedAlert::EventType, WorldPackets::Calendar::CalendarEventUpdatedAlert::Flags, GetAllEventRelatives(), CalendarEvent::GetDate(), CalendarEvent::GetDescription(), CalendarEvent::GetEventId(), CalendarEvent::GetFlags(), CalendarEvent::GetGuildId(), CalendarEvent::GetLockDate(), CalendarEvent::GetOwnerGUID(), CalendarEvent::GetTextureId(), CalendarEvent::GetTitle(), CalendarEvent::GetType(), WorldPackets::Calendar::CalendarEventUpdatedAlert::LockDate, WorldPackets::Calendar::CalendarEventUpdatedAlert::OriginalDate, WowTime::SetUtcTimeFromUnixTime(), WorldPackets::Calendar::CalendarEventUpdatedAlert::TextureID, and WorldPackets::Calendar::CalendarEventUpdatedAlert::Write().
| void CalendarMgr::SendPacketToAllEventRelatives | ( | WorldPacket const * | packet, |
| CalendarEvent const & | calendarEvent | ||
| ) | const |
Definition at line 737 of file CalendarMgr.cpp.
References GetAllEventRelatives().
Referenced by SendCalendarEventInviteRemove(), and SendCalendarEventModeratorStatusAlert().
| void CalendarMgr::UpdateEvent | ( | CalendarEvent * | calendarEvent | ) |
Definition at line 256 of file CalendarMgr.cpp.
References CHAR_REP_CALENDAR_EVENT, CharacterDatabase, ObjectGuid::GetCounter(), CalendarEvent::GetDate(), CalendarEvent::GetDescription(), CalendarEvent::GetEventId(), CalendarEvent::GetFlags(), CalendarEvent::GetLockDate(), CalendarEvent::GetOwnerGUID(), CalendarEvent::GetTextureId(), CalendarEvent::GetTitle(), CalendarEvent::GetType(), PreparedStatementBase::setInt32(), PreparedStatementBase::setInt64(), PreparedStatementBase::setString(), PreparedStatementBase::setUInt32(), PreparedStatementBase::setUInt64(), and PreparedStatementBase::setUInt8().
Referenced by AddEvent().
| void CalendarMgr::UpdateInvite | ( | CalendarInvite * | invite, |
| CharacterDatabaseTransaction | trans = nullptr |
||
| ) |
Definition at line 271 of file CalendarMgr.cpp.
References CHAR_REP_CALENDAR_INVITE, CharacterDatabase, ObjectGuid::GetCounter(), CalendarInvite::GetEventId(), CalendarInvite::GetInviteeGUID(), CalendarInvite::GetInviteId(), CalendarInvite::GetNote(), CalendarInvite::GetRank(), CalendarInvite::GetResponseTime(), CalendarInvite::GetSenderGUID(), CalendarInvite::GetStatus(), PreparedStatementBase::setInt64(), PreparedStatementBase::setString(), PreparedStatementBase::setUInt64(), and PreparedStatementBase::setUInt8().
Referenced by AddInvite().
|
private |
Definition at line 288 of file CalendarMgr.h.
Referenced by AddEvent(), DeleteOldEvents(), GetEvent(), GetEventsCreatedBy(), GetGuildEvents(), GetPlayerEvents(), LoadFromDB(), RemoveAllPlayerEventsAndInvites(), RemoveEvent(), RemovePlayerGuildEventsAndSignups(), and ~CalendarMgr().
|
private |
Definition at line 291 of file CalendarMgr.h.
Referenced by FreeEventId(), GetFreeEventId(), and LoadFromDB().
|
private |
Definition at line 292 of file CalendarMgr.h.
Referenced by FreeInviteId(), GetFreeInviteId(), and LoadFromDB().
|
private |
Definition at line 289 of file CalendarMgr.h.
Referenced by AddInvite(), GetAllEventRelatives(), GetEventInvites(), GetInvite(), GetPlayerEvents(), GetPlayerInvites(), LoadFromDB(), RemoveEvent(), RemoveInvite(), SendCalendarEvent(), and ~CalendarMgr().
|
private |
Definition at line 293 of file CalendarMgr.h.
Referenced by FreeEventId(), GetFreeEventId(), and LoadFromDB().
|
private |
Definition at line 294 of file CalendarMgr.h.
Referenced by FreeInviteId(), GetFreeInviteId(), and LoadFromDB().