Revert "Fix mem leak is caused by shop disable shop"
This reverts commit d3bf90c301.
This commit is contained in:
@@ -30,6 +30,10 @@
|
||||
#include "Util.h"
|
||||
#include "World.h"
|
||||
|
||||
//WowCommunity
|
||||
#include "Config.h"
|
||||
//WowCommunity
|
||||
|
||||
void WorldSession::SendAuthResponse(uint32 code, bool queued, uint32 queuePos)
|
||||
{
|
||||
WorldPackets::Auth::AuthResponse response;
|
||||
@@ -108,7 +112,10 @@ void WorldSession::SendSetTimeZoneInformation()
|
||||
void WorldSession::SendFeatureSystemStatusGlueScreen()
|
||||
{
|
||||
WorldPackets::System::FeatureSystemStatusGlueScreen features;
|
||||
features.BpayStoreAvailable = false;
|
||||
// WorldSession::SendFeatureSystemStatus. Both follow the Shop.Enabled worldserver.conf toggle.
|
||||
bool const shopEnabled = sWorld->getBoolConfig(CONFIG_SHOP_ENABLED);
|
||||
features.BpayStoreAvailable = shopEnabled;
|
||||
features.CommerceServerEnabled = shopEnabled;
|
||||
features.BpayStoreDisabledByParentalControls = false;
|
||||
features.CharUndeleteEnabled = sWorld->getBoolConfig(CONFIG_FEATURE_SYSTEM_CHARACTER_UNDELETE_ENABLED);
|
||||
features.MaxCharactersOnThisRealm = sWorld->getIntConfig(CONFIG_CHARACTERS_PER_REALM);
|
||||
@@ -140,6 +147,27 @@ void WorldSession::SendFeatureSystemStatusGlueScreen()
|
||||
|
||||
features.AvailableGameModeIDs.push_back(8); // GameMode.db2, standard
|
||||
|
||||
// In-game Shop character boost. These three are what the client's glue screen reads to decide
|
||||
// whether to offer a boost at all: C_CharacterServices consults IsTrialBoostEnabled before drawing
|
||||
// the boost/"Try New Class" affordances, and the two type fields tell it WHICH boost, which has to
|
||||
// match the BoostID our catalog's CharacterBoost deliverable carries or the UI describes a different
|
||||
// product to the one the account owns.
|
||||
//
|
||||
// They follow ownership, not configuration: the flag is set only while this account actually holds
|
||||
// an unapplied boost entitlement, so the client never offers a boost that CMSG_CHARACTER_UPGRADE_START
|
||||
// would then have to refuse. _shopBoostAdvertised records what we said, so the Shop can push a
|
||||
// corrected copy of this packet when the answer changes mid-session (see LoadBattlePayEntitlements).
|
||||
_shopBoostAdvertised = shopEnabled
|
||||
&& sWorld->getBoolConfig(CONFIG_SHOP_ENTITLEMENTS_ENABLED)
|
||||
&& HasBattlePayCharacterBoost();
|
||||
|
||||
if (_shopBoostAdvertised)
|
||||
{
|
||||
features.TrialBoostEnabled = true;
|
||||
features.ActiveBoostType = BattlePayMgr::GetCharacterBoostType();
|
||||
features.TrialBoostType = BattlePayMgr::GetCharacterBoostType();
|
||||
}
|
||||
|
||||
SendPacket(features.Write());
|
||||
|
||||
WorldPackets::System::MirrorVarSingle vars[] =
|
||||
@@ -147,10 +175,25 @@ void WorldSession::SendFeatureSystemStatusGlueScreen()
|
||||
{ "raidLockoutExtendEnabled"sv, "1"sv },
|
||||
{ "sellAllJunkEnabled"sv, "1"sv },
|
||||
{ "bypassItemLevelScalingCode"sv, "0"sv },
|
||||
{ "shop2Enabled"sv, "0"sv },
|
||||
{ "bpayStoreEnable"sv, "0"sv },
|
||||
{ "recentAlliesEnabledClient"sv, "0"sv },
|
||||
{ "browserEnabled"sv, "0"sv },
|
||||
// In-game Shop. Two independent client store gates:
|
||||
// bpayStoreEnable - the legacy BattlePay opcode path (CMSG_BATTLE_PAY_GET_PRODUCT_LIST ->
|
||||
// our BattlePayMgr catalog). This is the one we actually implement, so it follows Shop.Enabled.
|
||||
// shop2Enabled - the MODERN path, which is NOT a game-opcode flow at all: the client talks
|
||||
// HTTPS to Blizzard web services whose endpoints arrive in these very MirrorVars
|
||||
// (shop2HostUrlRequests = https://us.api.blizzard.com, shop2HostUrlAuth =
|
||||
// https://oauth.battle.net, plus shop2ClientIdStr and the VC/POP GUIDs - all captured in
|
||||
// ingame-shop_ordersCrafting_professions.pkt). Announcing shop2Enabled=1 while shipping no
|
||||
// endpoints leaves the client with the modern store switched on and nowhere to reach, so it
|
||||
// is OFF by default and gated behind its own config. Turn Shop.Shop2Enabled on only when a
|
||||
// real endpoint exists to answer it.
|
||||
{ "shop2Enabled"sv, (shopEnabled && sWorld->getBoolConfig(CONFIG_SHOP_SHOP2_ENABLED)) ? "1"sv : "0"sv },
|
||||
{ "bpayStoreEnable"sv, shopEnabled ? "1"sv : "0"sv },
|
||||
// Recent Allies is implemented server-side (RecentAlliesMgr + the 5 opcodes); retail sends 1.
|
||||
{ "recentAlliesEnabledClient"sv, "1"sv },
|
||||
// In-game browser widget (retail sends 1); the Shop uses it to render richer content.
|
||||
{ "browserEnabled"sv, "1"sv },
|
||||
// Master looter is a fully supported loot method (LOOT_METHOD_MASTER); retail sends 1.
|
||||
{ "masterLooterEnabled"sv, "1"sv },
|
||||
{ "housingEnableCreateGuildNeighborhood"sv, "0"sv },
|
||||
{ "housingEnableDeleteHouse"sv, "0"sv },
|
||||
{ "housingServiceEnabled"sv, "0"sv },
|
||||
@@ -160,7 +203,28 @@ void WorldSession::SendFeatureSystemStatusGlueScreen()
|
||||
{ "housingMarketEnabled"sv, "0"sv },
|
||||
};
|
||||
|
||||
// shop2 endpoint advertisement. The client reaches the modern store over HTTPS at whatever host
|
||||
// these vars name - they are the ONLY thing that points it anywhere, so serving our own endpoint
|
||||
// is a matter of naming it here (no hosts file, no hostname impersonation). The client's built-in
|
||||
// defaults are Blizzard's dev hosts (https://us.apidev.blizzard.net, https://oauth.web.blizzard.net),
|
||||
// which is why an arbitrary host is acceptable to it. Only advertised when Shop.Shop2Enabled is on
|
||||
// AND a URL is actually configured, so we never announce a store with nowhere to reach.
|
||||
std::vector<WorldPackets::System::MirrorVarSingle> varList(std::begin(vars), std::end(vars));
|
||||
if (shopEnabled && sWorld->getBoolConfig(CONFIG_SHOP_SHOP2_ENABLED))
|
||||
{
|
||||
auto addIfConfigured = [&varList](std::string_view name, char const* configKey)
|
||||
{
|
||||
std::string value = sConfigMgr->GetStringDefault(configKey, "");
|
||||
if (!value.empty())
|
||||
varList.emplace_back(name, value);
|
||||
};
|
||||
|
||||
addIfConfigured("shop2HostUrlRequests"sv, "Shop.Shop2HostUrlRequests");
|
||||
addIfConfigured("shop2HostUrlAuth"sv, "Shop.Shop2HostUrlAuth");
|
||||
addIfConfigured("shop2ClientIdStr"sv, "Shop.Shop2ClientId");
|
||||
}
|
||||
|
||||
WorldPackets::System::MirrorVars variables;
|
||||
variables.Variables = vars;
|
||||
variables.Variables = varList;
|
||||
SendPacket(variables.Write());
|
||||
}
|
||||
|
||||
@@ -68,7 +68,6 @@ enum DruidSpells
|
||||
SPELL_DRUID_DREAM_OF_CENARIUS = 372152,
|
||||
SPELL_DRUID_DREAM_OF_CENARIUS_COOLDOWN = 372523,
|
||||
SPELL_DRUID_EARTHWARDEN_AURA = 203975,
|
||||
SPELL_DRUID_ECLIPSE_DUMMY = 79577,
|
||||
SPELL_DRUID_ECLIPSE_LUNAR_AURA = 48518,
|
||||
SPELL_DRUID_ECLIPSE_OOC = 329910,
|
||||
SPELL_DRUID_ECLIPSE_SOLAR_AURA = 48517,
|
||||
@@ -578,30 +577,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
// 48517 Eclipse (Solar) + 48518 Eclipse (Lunar)
|
||||
class spell_dru_eclipse_aura : public AuraScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_DRUID_ECLIPSE_DUMMY });
|
||||
}
|
||||
|
||||
void HandleRemoved(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
AuraEffect const* auraEffDummy = GetTarget()->GetAuraEffect(SPELL_DRUID_ECLIPSE_DUMMY, EFFECT_0);
|
||||
if (!auraEffDummy)
|
||||
return;
|
||||
|
||||
uint32 spellId = GetSpellInfo()->Id == SPELL_DRUID_ECLIPSE_SOLAR_AURA;
|
||||
spell_dru_eclipse_common::SetSpellCount(GetTarget(), spellId, auraEffDummy->GetAmountAsInt());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_dru_eclipse_aura::HandleRemoved, EFFECT_0, SPELL_AURA_ADD_PCT_MODIFIER, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
// 145205 - Efflorescence
|
||||
class spell_dru_efflorescence : public SpellScript
|
||||
{
|
||||
@@ -3034,7 +3009,6 @@ void AddSC_druid_spell_scripts()
|
||||
RegisterSpellScript(spell_dru_dash);
|
||||
RegisterSpellScript(spell_dru_dream_of_cenarius_guardian);
|
||||
RegisterSpellScript(spell_dru_earthwarden);
|
||||
RegisterSpellScript(spell_dru_eclipse_aura);
|
||||
RegisterSpellScript(spell_dru_efflorescence);
|
||||
RegisterSpellScript(spell_dru_efflorescence_dummy);
|
||||
RegisterSpellScript(spell_dru_efflorescence_heal);
|
||||
|
||||
@@ -40,7 +40,6 @@ enum RogueSpells
|
||||
SPELL_ROGUE_AMPLIFYING_POISON_DEBUFF = 383414,
|
||||
SPELL_ROGUE_ATROPHIC_POISON = 381637,
|
||||
SPELL_ROGUE_ATROPHIC_POISON_DEBUFF = 392388,
|
||||
SPELL_ROGUE_BETWEEN_THE_EYES = 199804,
|
||||
SPELL_ROGUE_BLACKJACK_TALENT = 379005,
|
||||
SPELL_ROGUE_BLACKJACK = 394119,
|
||||
SPELL_ROGUE_BLADE_FLURRY = 13877,
|
||||
@@ -963,7 +962,7 @@ class spell_rog_prey_on_the_weak : public AuraScript
|
||||
// 79096 - Restless Blades
|
||||
class spell_rog_restless_blades : public AuraScript
|
||||
{
|
||||
static uint32 constexpr Spells[] = { SPELL_ROGUE_ADRENALINE_RUSH, SPELL_ROGUE_BETWEEN_THE_EYES, SPELL_ROGUE_SPRINT,
|
||||
static uint32 constexpr Spells[] = { SPELL_ROGUE_ADRENALINE_RUSH, SPELL_ROGUE_SPRINT,
|
||||
SPELL_ROGUE_GRAPPLING_HOOK, SPELL_ROGUE_VANISH, SPELL_ROGUE_KILLING_SPREE, SPELL_ROGUE_MARKED_FOR_DEATH };
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
|
||||
Reference in New Issue
Block a user