Skip to content

Commit

Permalink
[Core/Custom] Remove Premium
Browse files Browse the repository at this point in the history
Create 2023_11_10_world_trinity_string.sql
  • Loading branch information
leelf00 committed Nov 10, 2023
1 parent c7069ec commit 0d04d89
Show file tree
Hide file tree
Showing 38 changed files with 32 additions and 2,125 deletions.
56 changes: 0 additions & 56 deletions sql/base/auth.sql
Original file line number Diff line number Diff line change
Expand Up @@ -580,62 +580,6 @@ CREATE TABLE `pay_history` (

/*Data for the table `pay_history` */

/*Table structure for table `project_member_premiums` */

DROP TABLE IF EXISTS `project_member_premiums`;

CREATE TABLE `project_member_premiums` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`member_id` mediumint(8) NOT NULL,
`setdate` bigint(40) NOT NULL,
`unsetdate` bigint(40) NOT NULL,
`active` tinyint(1) NOT NULL DEFAULT '1',
`card_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `fk__nighthold_member_premium__members1_idx` (`member_id`),
KEY `fk__nighthold_member_premiums__nighthold_member_items1_idx` (`card_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Premium Members';

/*Data for the table `project_member_premiums` */

/*Table structure for table `project_member_rewards` */

DROP TABLE IF EXISTS `project_member_rewards`;

CREATE TABLE `project_member_rewards` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`member_id` int(10) unsigned NOT NULL,
`character_guid` int(10) unsigned NOT NULL,
`account_id` int(10) unsigned NOT NULL,
`realmid` int(10) unsigned NOT NULL,
`source_type` tinyint(3) unsigned NOT NULL,
`source_id` int(10) unsigned NOT NULL,
`reward_amount` int(10) unsigned NOT NULL,
`reward_date` int(10) unsigned NOT NULL,
`reward_day` int(10) unsigned NOT NULL COMMENT 'Used only for indexing purposes',
`processed` tinyint(3) unsigned NOT NULL DEFAULT '0',
`process_date` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `member_id_reward_day_source_type` (`member_id`,`reward_day`,`source_type`),
KEY `idx__member_id` (`member_id`),
KEY `idx__processed` (`processed`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Member Rewards';

/*Data for the table `project_member_rewards` */

/*Table structure for table `project_member_settings` */

DROP TABLE IF EXISTS `project_member_settings`;

CREATE TABLE `project_member_settings` (
`member_id` int(10) unsigned NOT NULL,
`setting` int(10) unsigned NOT NULL COMMENT 'nightholdMemberInfo::Setting in core',
`value` varchar(255) NOT NULL,
PRIMARY KEY (`member_id`,`setting`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Member Settings';

/*Data for the table `project_member_settings` */

/*Table structure for table `promocodes` */

DROP TABLE IF EXISTS `promocodes`;
Expand Down
4 changes: 4 additions & 0 deletions sql/updates/master/world/2023_11_10_auth.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Drop non-used custom tables
DROP TABLE IF EXISTS `project_member_premiums`;
DROP TABLE IF EXISTS `project_member_rewards`;
DROP TABLE IF EXISTS `project_member_settings`;
4 changes: 4 additions & 0 deletions sql/updates/master/world/2023_11_10_world_trinity_string.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- trinity_string
DELETE FROM `trinity_string` WHERE `entry`=15005;
INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`, `content_loc9`, `content_loc10`, `content_loc11`, `content_female`, `content_female_loc1`, `content_female_loc2`, `content_female_loc3`, `content_female_loc4`, `content_female_loc5`, `content_female_loc6`, `content_female_loc7`, `content_female_loc8`, `content_female_loc9`, `content_female_loc10`, `content_female_loc11`) VALUES
(15005, 'Your new balance is:', NULL, NULL, 'Deine neues Guthaben beträgt:', '您的余额:', '您的余額', NULL, NULL, 'Ваш остаток на балансе:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
11 changes: 0 additions & 11 deletions src/server/game/BattlePay/BattlePayMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -583,9 +583,6 @@ void BattlePayMgr::SendBattlePayProductList(WorldSession* session)
if (product->Id == BATTLE_PAY_SERVICE_BOOST)
if (session->HasBoost())
hasProduct = true;
if (product->Id == BATTLE_PAY_SERVICE_PREMIUM)
if (session->IsPremium())
hasProduct = true;
}
else if (product->Type == BATTLE_PAY_PRODUCT_TYPE_ITEM)
{
Expand Down Expand Up @@ -936,9 +933,6 @@ void BattlePayMgr::SendBattlePayPurchaseUpdate(PurchaseInfo* purchase)
BattlePayProduct* product = GetProductId(purchase->ProductId);
if (product->Id == BATTLE_PAY_SERVICE_BOOST && purchase->GetSession()->HasBoost())
validPurchase = false;
if (product->Id == BATTLE_PAY_SERVICE_PREMIUM && purchase->GetSession()->IsPremium())
validPurchase = false;


uint32 serverToken = irand(1, 999999); // temp solution

Expand Down Expand Up @@ -995,11 +989,6 @@ void BattlePayMgr::SendBattlePayPurchaseUpdate(PurchaseInfo* purchase)
SetBoosting(purchase->GetSession(), purchase->GetSession()->GetAccountId(), true);
SendBattlePayDistributionUpdate(purchase->GetSession(), BATTLE_PAY_SERVICE_BOOST, CHARACTER_BOOST_ALLOW);
}
if (product->Id == BATTLE_PAY_SERVICE_PREMIUM)
if (!purchase->GetSession()->IsPremium())
{
//purchase->GetSession()->SetPremium(true);
}
}
else if (product->Type == BATTLE_PAY_PRODUCT_TYPE_ITEM)
{
Expand Down
11 changes: 2 additions & 9 deletions src/server/game/BattlePay/ServiceBoost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,7 @@ void SetBoosting(WorldSession* session, uint32 accountId, bool boost)

if (sWorld->getBoolConfig(CONFIG_BOOST_PROMOTION) && !boost)
{
uint32 memberId = sWorld->GetprojectMemberID(accountId);
auto promoted = LoginDatabase.PQuery("SELECT member_id FROM boost_promotion_executed WHERE member_id = '%d'", memberId);
if (!promoted)
{
LoginDatabase.PExecute("INSERT INTO boost_promotion_executed (member_id) VALUES ('%d')", memberId);
return;
}
// to be impl new here
}

uint32 counter = 0;
Expand Down Expand Up @@ -643,9 +637,8 @@ void CharacterBooster::_HandleCharacterBoost() const

if (sWorld->getBoolConfig(CONFIG_BOOST_PROMOTION))
{
auto promoted = LoginDatabase.PQuery("SELECT member_id FROM boost_promotion_executed WHERE member_id = '%d'", sWorld->GetprojectMemberID(GetSession()->GetAccountId()));
auto paid = LoginDatabase.PQuery("SELECT counter FROM account_boost WHERE id = '%d' AND realmid = '%d' AND counter > 0", GetSession()->GetAccountId(), realmID);
if (promoted && !paid)
if (!paid)
return;
}

Expand Down
4 changes: 0 additions & 4 deletions src/server/game/Battlefield/Zones/BattlefieldWG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,6 @@ void BattlefieldWG::OnBattleEnd(bool endByTimer)
for (GuidSet::const_iterator itr = m_PlayersInWar[team].begin(); itr != m_PlayersInWar[team].end(); ++itr)
if (Player* player = sObjectAccessor->FindPlayer(*itr))
{
if (sWorld->AreprojectDailyQuestsEnabled() && player->HasAura(SPELL_LIEUTENANT))
player->CreditprojectDailyQuest(180014); // project Daily Quest Credit - Wintergrasp First Lieutenant Participation

RemoveAurasFromPlayer(player);
}

Expand Down Expand Up @@ -648,7 +645,6 @@ void BattlefieldWG::HandleKill(Player* killer, Unit* victim)
if (player->GetDistance2d(killer) < 40)
{
PromotePlayer(player);
player->CreditprojectDailyQuest(180010); // project Daily Quest Credit - Outdoor PvP Honorable Kill
}
return;
}
Expand Down
46 changes: 0 additions & 46 deletions src/server/game/Battlegrounds/Battleground.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1317,52 +1317,6 @@ void Battleground::EndBattleground(uint32 winner)
sBattlegroundMgr->EnqueueNewGameStat(stat);
}

if (sWorld->AreprojectDailyQuestsEnabled())
{
for (BattlegroundPlayerMap::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{
if (Player* player = _GetPlayer(itr, "EndBattleground"))
{
bool won = itr->second.Team == winner;
if (winnerArenaTeam && loserArenaTeam && winnerArenaTeam != loserArenaTeam || // ARENA_NORMAL
GetStatus() == STATUS_WAIT_JOIN || // ARENA_TIMEOUT
m_winner == WINNER_NONE || // ARENA_NO_WINNERS
m_Players.empty()) // ARENA_NO_WINNERS
{
if (GetArenaType() == ARENA_TYPE_3v3)
player->CreditprojectDailyQuest(180015); // project Daily Quest Credit - 3v3 Arena Participation
if (won)
player->CreditprojectDailyQuest(180003); // project Daily Quest Credit - Any Arena Victory
player->CreditprojectDailyQuest(180002); // project Daily Quest Credit - Any Arena Participation
}
else // BG_DEFAULT
{
if (IsArena()) // Unrated arenas end up here.
break;
if (won)
player->CreditprojectDailyQuest(180001); // project Daily Quest Credit - Any Battleground Victory
player->CreditprojectDailyQuest(180000); // project Daily Quest Credit - Any Battleground Participation
player->CreditprojectDailyQuest(180100 + GetTypeID()); // project Daily Quest Credit - * Participation
auto itr = PlayerScores.find(player->GetGUID());
if (itr != PlayerScores.end() && itr->second)
{
if (uint32 damage = itr->second->DamageDone / 1000)
player->CreditprojectDailyQuest(180004, damage); // project Daily Quest Credit - Battleground Damage Dealt
if (uint32 heal = itr->second->HealingDone / 1000)
player->CreditprojectDailyQuest(180005, heal); // project Daily Quest Credit - Battleground Damage Healed
if (uint32 kills = itr->second->HonorableKills)
player->CreditprojectDailyQuest(180009, kills); // project Daily Quest Credit - Battleground Honorable Kill
}
if (IsRatedBG())
{
if (won)
player->CreditprojectDailyQuest(180019); // project Daily Quest Credit - Solo 3v3 Arena Victory
player->CreditprojectDailyQuest(180020); // project Daily Quest Credit - Solo 3v3 Arena Participation
}
}
}
}
}
}

uint32 Battleground::GetBonusHonorFromKill(uint32 kills) const
Expand Down
160 changes: 0 additions & 160 deletions src/server/game/Battlegrounds/BattlegroundQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,146 +164,6 @@ bool BattlegroundQueue::SelectionPool::AddGroup(GroupQueueInfo* ginfo, uint32 de
/*** BATTLEGROUND QUEUES ***/
/*********************************************************/

bool QueueAnnounceContext::IsEnabled(BattlegroundTypeId bgTypeId, bool isRated, bool isSolo)
{
if (BattlegroundMgr::IsArenaType(bgTypeId))
return isRated && sWorld->getBoolConfig(isSolo ? CONFIG_ICORE_QUEUE_ANNOUNCE_ARENA_SOLO : CONFIG_ICORE_QUEUE_ANNOUNCE_ARENA);
return sWorld->getBoolConfig(CONFIG_ICORE_QUEUE_ANNOUNCE_BATTLEGROUND);
}

void QueueAnnounceContext::Announce() const
{
if (!IsEnabled(GroupInfo.BgTypeId, GroupInfo.IsRated, IsSolo))
return;

bool isArena = BattlegroundMgr::IsArenaType(GroupInfo.BgTypeId);
Battleground* bg = isArena ? nullptr : sBattlegroundMgr->GetBattlegroundTemplate(GroupInfo.BgTypeId);
PvPDifficultyEntry const* bracket = bg ? GetBattlegroundBracketById(bg->GetMapId(), BracketId) : nullptr;
auto builder = [this, isArena, bg, bracket](std::vector<WorldPacket*>& packets, LocaleConstant locale)
{
std::string text;
if (isArena)
{
switch (GroupInfo.ArenaType)
{
case ARENA_TYPE_2v2:
case ARENA_TYPE_3v3:
case ARENA_TYPE_5v5:
if (IsSolo)
{
//[Solo]: joined with %u MMR, %u %u in queue
text = Format(sObjectMgr->GetTrinityString(SoloSpec == SoloQueueRole::Healer ? LANG_QUEUE_ANNOUNCE_ARENA_SOLO_H : LANG_QUEUE_ANNOUNCE_ARENA_SOLO_D, locale),
GroupInfo.ArenaMatchmakerRating,
QueuedA, QueuedH);
}
else
{
//[%uv%u]: Team joined with %u MMR, %u teams in queue
text = Format(sObjectMgr->GetTrinityString(LANG_QUEUE_ANNOUNCE_ARENA, locale),
(uint32)GroupInfo.ArenaType, (uint32)GroupInfo.ArenaType,
GroupInfo.ArenaMatchmakerRating,
QueuedA + QueuedH);
}
break;
}
}
else
{
if (!bg || !bracket)
return;

if (sWorld->getBoolConfig(CONFIG_BATTLEGROUND_IGNORE_FACTION))
{
//[%s (%u-%u)]: %u players joined, %u/%u in queue
text = Format(sObjectMgr->GetTrinityString(LANG_QUEUE_ANNOUNCE_BATTLEGROUND_N, locale),
bg->GetName(locale),
bracket->minLevel, bracket->maxLevel,
GroupInfo.Players.size(),
QueuedA + QueuedH, bg->GetMinPlayersPerTeam() * 2);
}
else
{
TrinityStrings textId;
switch (GroupInfo.Team)
{
case ALLIANCE: textId = LANG_QUEUE_ANNOUNCE_BATTLEGROUND_A; break;
case HORDE: textId = LANG_QUEUE_ANNOUNCE_BATTLEGROUND_H; break;
}

//[%s (%u-%u)]: %u players joined, %u/%u %u/%u in queue
text = Format(sObjectMgr->GetTrinityString(textId, locale),
bg->GetName(locale),
bracket->minLevel, bracket->maxLevel,
GroupInfo.Players.size(),
QueuedH, bg->GetMinPlayersPerTeam(),
QueuedA, bg->GetMinPlayersPerTeam());
}
}
WorldPacket* data = new WorldPacket();
ChatHandler::BuildChatPacket(*data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, 0, 0, text);
packets.push_back(data);
};
Trinity::LocalizedPacketListDo<decltype(builder)> sender { builder };
for (auto&& session : sWorld->GetAllSessions())
{
Player* player = session.second->GetPlayer();
projectMemberInfo* info = session.second->GetprojectMemberInfo();
if (!player || !info)
continue;

// Don't show to players in the wrong level range
if (bracket && (player->GetLevel() < bracket->minLevel || player->GetLevel() > bracket->maxLevel))
continue;

Show setting = info->GetSetting(isArena ? projectMemberInfo::Setting::QueueAnnounceArenaHorizon : projectMemberInfo::Setting::QueueAnnounceBattlegroundHorizon).As<Show>();

// Always show for the players that just queued
if (GroupInfo.Players.find(player->GetGUID()) != GroupInfo.Players.end())
setting = Show::Always;

switch (setting)
{
case Show::Never:
continue;
case Show::WhileInSameQueue:
{
BattlegroundQueueTypeId queue = BattlegroundMgr::BGQueueTypeId(GroupInfo.BgTypeId, GroupInfo.ArenaType);
if (!player->InBattlegroundQueueForBattlegroundQueueType(queue))
continue;
//[[fallthrough]]
}
case Show::WhileQueued:
if (IsSolo)
{
if (!player->InBattlegroundQueueForBattlegroundQueueType(BATTLEGROUND_QUEUE_SOLO))
continue;
}
else if (isArena)
{
if (!player->InBattlegroundQueueForBattlegroundQueueType(BATTLEGROUND_QUEUE_2v2) &&
!player->InBattlegroundQueueForBattlegroundQueueType(BATTLEGROUND_QUEUE_3v3) &&
!player->InBattlegroundQueueForBattlegroundQueueType(BATTLEGROUND_QUEUE_5v5))
continue;
}
else
{
if (!player->InBattlegroundQueue())
continue;
}
//[[fallthrough]]
case Show::Always:
sender(player);

if (!session.second->queueAnnounceSent)
{
session.second->queueAnnounceSent = true;
ChatHandler(player).SendSysMessage(LANG_QUEUE_ANNOUNCE_INFO);
}
break;
}
}
}

// add group or player (grp == NULL) to bg queue with the given leader and bg specifications
GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, BattlegroundTypeId bgTypeId, PvPDifficultyEntry const* bracketEntry, uint8 arenaType, bool isRated, bool isPremade, uint32 arenaRating, uint32 matchmakerRating)
{
Expand Down Expand Up @@ -442,26 +302,6 @@ GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, Battlegr
//ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_Lock);
m_QueuedGroups[bracketId][index].push_back(ginfo);

//announce personal
if (QueueAnnounceContext::IsEnabled(bgTypeId, isRated, m_isSolo))
{
auto& queueA = m_QueuedGroups[bracketId][isRated || isPremade ? BG_QUEUE_PREMADE_ALLIANCE : BG_QUEUE_NORMAL_ALLIANCE];
auto& queueH = m_QueuedGroups[bracketId][isRated || isPremade ? BG_QUEUE_PREMADE_HORDE : BG_QUEUE_NORMAL_HORDE ];
//ArenaTeam* team = sArenaTeamMgr->GetArenaTeamById(ginfo->ArenaTeamId);
QueueAnnounceContext
{
true,
*ginfo,
bracketId,
isPremade,
m_isSolo,
m_isSolo ? ginfo->Players.begin()->second->Role : SoloQueueRole::None,
m_isSolo ? m_damagersCount : BattlegroundMgr::IsArenaType(bgTypeId) ? uint32(queueA.size()) : std::accumulate(queueA.begin(), queueA.end(), 0u, [](uint32 a, GroupQueueInfo* b) { return a + (b->IsInvitedToBGInstanceGUID ? 0 : b->Players.size()); }),
m_isSolo ? m_healersCount : BattlegroundMgr::IsArenaType(bgTypeId) ? uint32(queueH.size()) : std::accumulate(queueH.begin(), queueH.end(), 0u, [](uint32 a, GroupQueueInfo* b) { return a + (b->IsInvitedToBGInstanceGUID ? 0 : b->Players.size()); }),
"", //team ? team->GetName() : "",
}.Announce();
}

//announce to world, this code needs mutex
if (!isRated && !isPremade && sWorld->getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE))
{
Expand Down
Loading

0 comments on commit 0d04d89

Please sign in to comment.