mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-28 06:25:55 +00:00
feat(Core/Handlers): Make use of a few billing plan flags for authentication response. (#24569)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -23,10 +23,10 @@ void WorldSession::SendAuthResponse(uint8 code, bool shortForm, uint32 queuePos)
|
||||
{
|
||||
WorldPacket packet(SMSG_AUTH_RESPONSE, 1 + 4 + 1 + 4 + 1 + (shortForm ? 0 : (4 + 1)));
|
||||
packet << uint8(code);
|
||||
packet << uint32(0); // BillingTimeRemaining
|
||||
packet << uint8(0); // BillingPlanFlags
|
||||
packet << uint32(0); // BillingTimeRested
|
||||
uint8 exp = Expansion(); // 0 - normal, 1 - TBC, 2 - WOTLK, must be set in database manually for each account
|
||||
packet << uint32(0); // BillingTimeRemaining
|
||||
packet << GetBillingPlanFlags();
|
||||
packet << uint32(0); // BillingTimeRested
|
||||
uint8 exp = Expansion(); // 0 - normal, 1 - TBC, 2 - WotLK, must be set in database manually for each account
|
||||
|
||||
if (exp >= MAX_EXPANSIONS)
|
||||
exp = MAX_EXPANSIONS - 1;
|
||||
|
||||
@@ -208,6 +208,37 @@ bool WorldSession::IsGMAccount() const
|
||||
return GetSecurity() >= SEC_GAMEMASTER;
|
||||
}
|
||||
|
||||
bool WorldSession::IsTrialAccount() const
|
||||
{
|
||||
return HasAccountFlag(ACCOUNT_FLAG_TRIAL);
|
||||
}
|
||||
|
||||
bool WorldSession::IsInternetGameRoomAccount() const
|
||||
{
|
||||
return HasAccountFlag(ACCOUNT_FLAG_IGR);
|
||||
}
|
||||
|
||||
bool WorldSession::IsRecurringBillingAccount() const
|
||||
{
|
||||
return HasAccountFlag(ACCOUNT_FLAG_RECURRING_BILLING);
|
||||
}
|
||||
|
||||
uint8 WorldSession::GetBillingPlanFlags() const
|
||||
{
|
||||
uint8 flags = SESSION_NONE;
|
||||
|
||||
if (IsRecurringBillingAccount())
|
||||
flags |= SESSION_RECURRING_BILL;
|
||||
|
||||
if (IsTrialAccount())
|
||||
flags |= SESSION_FREE_TRIAL;
|
||||
|
||||
if (IsInternetGameRoomAccount())
|
||||
flags |= SESSION_IGR;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
std::string const& WorldSession::GetPlayerName() const
|
||||
{
|
||||
return _player ? _player->GetName() : DefaultPlayerName;
|
||||
|
||||
@@ -383,6 +383,11 @@ public:
|
||||
void ValidateAccountFlags();
|
||||
|
||||
bool IsGMAccount() const;
|
||||
bool IsTrialAccount() const;
|
||||
bool IsInternetGameRoomAccount() const;
|
||||
bool IsRecurringBillingAccount() const;
|
||||
|
||||
uint8 GetBillingPlanFlags() const;
|
||||
|
||||
bool PlayerLoading() const { return m_playerLoading; }
|
||||
bool PlayerLogout() const { return m_playerLogout; }
|
||||
|
||||
@@ -73,14 +73,14 @@ enum WorldTimers
|
||||
enum BillingPlanFlags
|
||||
{
|
||||
SESSION_NONE = 0x00,
|
||||
SESSION_UNUSED = 0x01,
|
||||
SESSION_UNUSED = 0x01, // Unk, NYI
|
||||
SESSION_RECURRING_BILL = 0x02,
|
||||
SESSION_FREE_TRIAL = 0x04,
|
||||
SESSION_IGR = 0x08,
|
||||
SESSION_USAGE = 0x10,
|
||||
SESSION_TIME_MIXTURE = 0x20,
|
||||
SESSION_RESTRICTED = 0x40,
|
||||
SESSION_ENABLE_CAIS = 0x80,
|
||||
SESSION_IGR = 0x08, // Internet Game Room
|
||||
SESSION_USAGE = 0x10, // Unk, NYI
|
||||
SESSION_TIME_MIXTURE = 0x20, // Unk, NYI
|
||||
SESSION_RESTRICTED = 0x40, // Unk, NYI
|
||||
SESSION_ENABLE_CAIS = 0x80, // Unk, NYI, possibly account play time limit related for China?
|
||||
};
|
||||
|
||||
enum RealmZone
|
||||
|
||||
Reference in New Issue
Block a user