Replace World::getConfig with World::getFloatConfig, World::getIntConfig, and World::getBoolConfig.
Also fix a warning from a previous commit. --HG-- branch : trunk
This commit is contained in:
@@ -126,7 +126,7 @@ void GuardAI::UpdateAI(const uint32 /*diff*/)
|
||||
|
||||
bool GuardAI::IsVisible(Unit *pl) const
|
||||
{
|
||||
return me->IsWithinDist(pl,(float)sWorld.getConfig(CONFIG_SIGHT_GUARDER))
|
||||
return me->IsWithinDist(pl,sWorld.getFloatConfig(CONFIG_SIGHT_GUARDER))
|
||||
&& pl->isVisibleForOrDetect(me,true);
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ void CreatureAI::MoveInLineOfSight(Unit *who)
|
||||
if (me->canStartAttack(who, false))
|
||||
AttackStart(who);
|
||||
//else if (who->getVictim() && me->IsFriendlyTo(who)
|
||||
// && me->IsWithinDistInMap(who, sWorld.getConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS))
|
||||
// && me->IsWithinDistInMap(who, sWorld.getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS))
|
||||
// && me->canStartAttack(who->getVictim(), true)) // TODO: if we use true, it will not attack it when it arrives
|
||||
// me->GetMotionMaster()->MoveChase(who->getVictim());
|
||||
}
|
||||
|
||||
@@ -411,7 +411,7 @@ void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uin
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES) == 0)
|
||||
sLog.outDetail("AchievementMgr::ResetAchievementCriteria(%u, %u, %u)", type, miscvalue1, miscvalue2);
|
||||
|
||||
if (!sWorld.getConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER)
|
||||
if (!sWorld.getBoolConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER)
|
||||
return;
|
||||
|
||||
AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr.GetAchievementCriteriaByType(type);
|
||||
@@ -645,9 +645,9 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
|
||||
|
||||
Trinity::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED,achievement->ID);
|
||||
Trinity::LocalizedPacketDo<Trinity::AchievementChatBuilder> say_do(say_builder);
|
||||
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::AchievementChatBuilder> > say_worker(GetPlayer(),(float)sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY),say_do);
|
||||
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::AchievementChatBuilder> > say_worker(GetPlayer(),sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_SAY),say_do);
|
||||
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::AchievementChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), (float)sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY));
|
||||
cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
|
||||
}
|
||||
|
||||
WorldPacket data(SMSG_ACHIEVEMENT_EARNED, 8+4+8);
|
||||
@@ -655,7 +655,7 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
|
||||
data << uint32(achievement->ID);
|
||||
data << uint32(secsToTimeBitFields(time(NULL)));
|
||||
data << uint32(0);
|
||||
GetPlayer()->SendMessageToSetInRange(&data, (float)sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY), true);
|
||||
GetPlayer()->SendMessageToSetInRange(&data, sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_SAY), true);
|
||||
}
|
||||
|
||||
void AchievementMgr::SendCriteriaUpdate(AchievementCriteriaEntry const* entry, CriteriaProgress const* progress, uint32 timeElapsed, bool timedCompleted)
|
||||
@@ -707,7 +707,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES) == 0)
|
||||
sLog.outDetail("AchievementMgr::UpdateAchievementCriteria(%u, %u, %u, %u)", type, miscvalue1, miscvalue2, time);
|
||||
|
||||
if (!sWorld.getConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER)
|
||||
if (!sWorld.getBoolConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER)
|
||||
return;
|
||||
|
||||
AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr.GetAchievementCriteriaByType(type);
|
||||
@@ -1899,7 +1899,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
|
||||
{
|
||||
sLog.outDetail("AchievementMgr::CompletedAchievement(%u)", achievement->ID);
|
||||
|
||||
if (!sWorld.getConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER)
|
||||
if (!sWorld.getBoolConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER)
|
||||
return;
|
||||
|
||||
if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER || HasAchieved(achievement))
|
||||
|
||||
@@ -48,7 +48,7 @@ AuctionHouseMgr::~AuctionHouseMgr()
|
||||
|
||||
AuctionHouseObject * AuctionHouseMgr::GetAuctionsMap(uint32 factionTemplateId)
|
||||
{
|
||||
if (sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION))
|
||||
if (sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION))
|
||||
return &mNeutralAuctions;
|
||||
|
||||
// team have linked auction houses
|
||||
@@ -99,7 +99,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction, SQLTransaction&
|
||||
uint64 bidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER);
|
||||
Player *bidder = sObjectMgr.GetPlayer(bidder_guid);
|
||||
// data for gm.log
|
||||
if (sWorld.getConfig(CONFIG_GM_LOG_TRADE))
|
||||
if (sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||
{
|
||||
std::string bidder_name;
|
||||
if (bidder)
|
||||
@@ -175,7 +175,7 @@ void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry * auction, SQLTran
|
||||
std::ostringstream msgAuctionSalePendingBody;
|
||||
uint32 auctionCut = auction->GetAuctionCut();
|
||||
|
||||
time_t distrTime = time(NULL) + sWorld.getConfig(CONFIG_MAIL_DELIVERY_DELAY);
|
||||
time_t distrTime = time(NULL) + sWorld.getIntConfig(CONFIG_MAIL_DELIVERY_DELAY);
|
||||
|
||||
msgAuctionSalePendingBody.width(16);
|
||||
msgAuctionSalePendingBody << std::right << std::hex << auction->bidder;
|
||||
@@ -224,7 +224,7 @@ void AuctionHouseMgr::SendAuctionSuccessfulMail(AuctionEntry * auction, SQLTrans
|
||||
}
|
||||
MailDraft(msgAuctionSuccessfulSubject.str(), auctionSuccessfulBody.str())
|
||||
.AddMoney(profit)
|
||||
.SendMailTo(trans, MailReceiver(owner,auction->owner), auction, MAIL_CHECK_MASK_COPIED, sWorld.getConfig(CONFIG_MAIL_DELIVERY_DELAY));
|
||||
.SendMailTo(trans, MailReceiver(owner,auction->owner), auction, MAIL_CHECK_MASK_COPIED, sWorld.getIntConfig(CONFIG_MAIL_DELIVERY_DELAY));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -491,7 +491,7 @@ AuctionHouseEntry const* AuctionHouseMgr::GetAuctionHouseEntry(uint32 factionTem
|
||||
{
|
||||
uint32 houseid = 7; // goblin auction house
|
||||
|
||||
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION))
|
||||
if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION))
|
||||
{
|
||||
//FIXME: found way for proper auctionhouse selection by another way
|
||||
// AuctionHouse.dbc have faction field with _player_ factions associated with auction house races.
|
||||
|
||||
@@ -47,14 +47,14 @@ ArenaTeam::ArenaTeam()
|
||||
m_stats.games_season = 0;
|
||||
m_stats.rank = 0;
|
||||
/* warning: comparison of unsigned expression >= 0 is always true
|
||||
if (sWorld.getConfig(CONFIG_ARENA_START_RATING) >= 0)
|
||||
m_stats.rating = sWorld.getConfig(CONFIG_ARENA_START_RATING);
|
||||
else if (sWorld.getConfig(CONFIG_ARENA_SEASON_ID) >= 6)
|
||||
if (sWorld.getIntConfig(CONFIG_ARENA_START_RATING) >= 0)
|
||||
m_stats.rating = sWorld.getIntConfig(CONFIG_ARENA_START_RATING);
|
||||
else if (sWorld.getIntConfig(CONFIG_ARENA_SEASON_ID) >= 6)
|
||||
m_stats.rating = 0;
|
||||
else
|
||||
m_stats.rating = 1500;
|
||||
*/
|
||||
m_stats.rating = sWorld.getConfig(CONFIG_ARENA_START_RATING);
|
||||
m_stats.rating = sWorld.getIntConfig(CONFIG_ARENA_START_RATING);
|
||||
m_stats.wins_week = 0;
|
||||
m_stats.wins_season = 0;
|
||||
}
|
||||
@@ -151,11 +151,11 @@ bool ArenaTeam::AddMember(const uint64& PlayerGuid)
|
||||
newmember.wins_week = 0;
|
||||
newmember.personal_rating = 0;
|
||||
|
||||
if (sWorld.getConfig(CONFIG_ARENA_START_PERSONAL_RATING) > 0)
|
||||
newmember.personal_rating = sWorld.getConfig(CONFIG_ARENA_START_PERSONAL_RATING);
|
||||
if (sWorld.getIntConfig(CONFIG_ARENA_START_PERSONAL_RATING) > 0)
|
||||
newmember.personal_rating = sWorld.getIntConfig(CONFIG_ARENA_START_PERSONAL_RATING);
|
||||
else
|
||||
{
|
||||
if (sWorld.getConfig(CONFIG_ARENA_SEASON_ID) < 6)
|
||||
if (sWorld.getIntConfig(CONFIG_ARENA_SEASON_ID) < 6)
|
||||
newmember.personal_rating = 1500;
|
||||
else
|
||||
if (GetRating() >= 1000)
|
||||
@@ -546,7 +546,7 @@ uint32 ArenaTeam::GetPoints(uint32 MemberRating)
|
||||
|
||||
if (rating <= 1500)
|
||||
{
|
||||
if (sWorld.getConfig(CONFIG_ARENA_SEASON_ID) < 6)
|
||||
if (sWorld.getIntConfig(CONFIG_ARENA_SEASON_ID) < 6)
|
||||
points = (float)rating * 0.22f + 14.0f;
|
||||
else
|
||||
points = 344;
|
||||
@@ -568,7 +568,7 @@ float ArenaTeam::GetChanceAgainst(uint32 own_rating, uint32 enemy_rating)
|
||||
// returns the chance to win against a team with the given rating, used in the rating adjustment calculation
|
||||
// ELO system
|
||||
|
||||
if (sWorld.getConfig(CONFIG_ARENA_SEASON_ID) >= 6)
|
||||
if (sWorld.getIntConfig(CONFIG_ARENA_SEASON_ID) >= 6)
|
||||
if (enemy_rating < 1000)
|
||||
enemy_rating = 1000;
|
||||
return 1.0f/(1.0f+exp(log(10.0f)*(float)((float)enemy_rating - (float)own_rating)/400.0f));
|
||||
|
||||
@@ -457,7 +457,7 @@ void Battleground::Update(uint32 diff)
|
||||
if (Player* plr = sObjectMgr.GetPlayer(itr->first))
|
||||
plr->RemoveAurasDueToSpell(SPELL_PREPARATION);
|
||||
//Announce BG starting
|
||||
if (sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE))
|
||||
if (sWorld.getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE))
|
||||
{
|
||||
sWorld.SendWorldText(LANG_BG_STARTED_ANNOUNCE_WORLD, GetName(), GetMinLevel(), GetMaxLevel());
|
||||
}
|
||||
@@ -1887,7 +1887,7 @@ void Battleground::SetBracket(PvPDifficultyEntry const* bracketEntry)
|
||||
|
||||
void Battleground::RewardXPAtKill(Player* plr, Player* victim)
|
||||
{
|
||||
if (!sWorld.getConfig(CONFIG_BG_XP_FOR_KILL) || !plr || !victim)
|
||||
if (!sWorld.getBoolConfig(CONFIG_BG_XP_FOR_KILL) || !plr || !victim)
|
||||
return;
|
||||
|
||||
uint32 xp = 0;
|
||||
|
||||
@@ -58,7 +58,7 @@ BattlegroundMgr::BattlegroundMgr() : m_AutoDistributionTimeChecker(0), m_ArenaTe
|
||||
{
|
||||
for (uint32 i = BATTLEGROUND_TYPE_NONE; i < MAX_BATTLEGROUND_TYPE_ID; i++)
|
||||
m_Battlegrounds[i].clear();
|
||||
m_NextRatingDiscardUpdate = sWorld.getConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);
|
||||
m_NextRatingDiscardUpdate = sWorld.getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);
|
||||
m_Testing=false;
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ void BattlegroundMgr::Update(uint32 diff)
|
||||
}
|
||||
|
||||
// if rating difference counts, maybe force-update queues
|
||||
if (sWorld.getConfig(CONFIG_ARENA_MAX_RATING_DIFFERENCE) && sWorld.getConfig(CONFIG_ARENA_RATING_DISCARD_TIMER))
|
||||
if (sWorld.getIntConfig(CONFIG_ARENA_MAX_RATING_DIFFERENCE) && sWorld.getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER))
|
||||
{
|
||||
// it's time to force update
|
||||
if (m_NextRatingDiscardUpdate < diff)
|
||||
@@ -154,19 +154,19 @@ void BattlegroundMgr::Update(uint32 diff)
|
||||
BATTLEGROUND_AA, BattlegroundBracketId(bracket),
|
||||
BattlegroundMgr::BGArenaType(BattlegroundQueueTypeId(qtype)), true, 0);
|
||||
|
||||
m_NextRatingDiscardUpdate = sWorld.getConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);
|
||||
m_NextRatingDiscardUpdate = sWorld.getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);
|
||||
}
|
||||
else
|
||||
m_NextRatingDiscardUpdate -= diff;
|
||||
}
|
||||
if (sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS))
|
||||
if (sWorld.getBoolConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS))
|
||||
{
|
||||
if (m_AutoDistributionTimeChecker < diff)
|
||||
{
|
||||
if (time(NULL) > m_NextAutoDistributionTime)
|
||||
{
|
||||
DistributeArenaPoints();
|
||||
m_NextAutoDistributionTime = m_NextAutoDistributionTime + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS);
|
||||
m_NextAutoDistributionTime = m_NextAutoDistributionTime + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getIntConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS);
|
||||
sWorld.setWorldState(WS_ARENA_DISTRIBUTION_TIME, uint64(m_NextAutoDistributionTime));
|
||||
}
|
||||
m_AutoDistributionTimeChecker = 600000; // check 10 minutes
|
||||
@@ -778,7 +778,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
|
||||
|
||||
void BattlegroundMgr::InitAutomaticArenaPointDistribution()
|
||||
{
|
||||
if (!sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS))
|
||||
if (!sWorld.getBoolConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS))
|
||||
return;
|
||||
|
||||
time_t wstime = time_t(sWorld.getWorldState(WS_ARENA_DISTRIBUTION_TIME));
|
||||
@@ -1079,7 +1079,7 @@ void BattlegroundMgr::ScheduleQueueUpdate(uint32 arenaRating, uint8 arenaType, B
|
||||
uint32 BattlegroundMgr::GetMaxRatingDifference() const
|
||||
{
|
||||
// this is for stupid people who can't use brain and set max rating difference to 0
|
||||
uint32 diff = sWorld.getConfig(CONFIG_ARENA_MAX_RATING_DIFFERENCE);
|
||||
uint32 diff = sWorld.getIntConfig(CONFIG_ARENA_MAX_RATING_DIFFERENCE);
|
||||
if (diff == 0)
|
||||
diff = 5000;
|
||||
return diff;
|
||||
@@ -1087,12 +1087,12 @@ uint32 BattlegroundMgr::GetMaxRatingDifference() const
|
||||
|
||||
uint32 BattlegroundMgr::GetRatingDiscardTimer() const
|
||||
{
|
||||
return sWorld.getConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);
|
||||
return sWorld.getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);
|
||||
}
|
||||
|
||||
uint32 BattlegroundMgr::GetPrematureFinishTime() const
|
||||
{
|
||||
return sWorld.getConfig(CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER);
|
||||
return sWorld.getIntConfig(CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER);
|
||||
}
|
||||
|
||||
void BattlegroundMgr::LoadBattleMastersEntry()
|
||||
|
||||
@@ -155,7 +155,7 @@ GroupQueueInfo * BattlegroundQueue::AddGroup(Player *leader, Group* grp, Battleg
|
||||
uint32 lastOnlineTime = getMSTime();
|
||||
|
||||
//announce world (this don't need mutex)
|
||||
if (isRated && sWorld.getConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE))
|
||||
if (isRated && sWorld.getBoolConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE))
|
||||
{
|
||||
ArenaTeam *Team = sObjectMgr.GetArenaTeamById(arenateamid);
|
||||
if (Team)
|
||||
@@ -191,7 +191,7 @@ GroupQueueInfo * BattlegroundQueue::AddGroup(Player *leader, Group* grp, Battleg
|
||||
m_QueuedGroups[bracketId][index].push_back(ginfo);
|
||||
|
||||
//announce to world, this code needs mutex
|
||||
if (!isRated && !isPremade && sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE))
|
||||
if (!isRated && !isPremade && sWorld.getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE))
|
||||
{
|
||||
if (Battleground* bg = sBattlegroundMgr.GetBattlegroundTemplate(ginfo->BgTypeId))
|
||||
{
|
||||
@@ -210,7 +210,7 @@ GroupQueueInfo * BattlegroundQueue::AddGroup(Player *leader, Group* grp, Battleg
|
||||
qHorde += (*itr)->Players.size();
|
||||
|
||||
// Show queue status to player only (when joining queue)
|
||||
if (sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY))
|
||||
if (sWorld.getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY))
|
||||
{
|
||||
ChatHandler(leader).PSendSysMessage(LANG_BG_QUEUE_ANNOUNCE_SELF, bgName, q_min_level, q_max_level,
|
||||
qAlliance, (MinPlayers > qAlliance) ? MinPlayers - qAlliance : (uint32)0, qHorde, (MinPlayers > qHorde) ? MinPlayers - qHorde : (uint32)0);
|
||||
@@ -350,7 +350,7 @@ void BattlegroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou
|
||||
m_QueuedPlayers.erase(itr);
|
||||
|
||||
// announce to world if arena team left queue for rated match, show only once
|
||||
if (group->ArenaType && group->IsRated && group->Players.empty() && sWorld.getConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE))
|
||||
if (group->ArenaType && group->IsRated && group->Players.empty() && sWorld.getBoolConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE))
|
||||
{
|
||||
ArenaTeam *Team = sObjectMgr.GetArenaTeamById(group->ArenaTeamId);
|
||||
if (Team)
|
||||
@@ -508,7 +508,7 @@ void BattlegroundQueue::FillPlayersToBG(Battleground* bg, BattlegroundBracketId
|
||||
++Horde_itr;
|
||||
|
||||
//if ofc like BG queue invitation is set in config, then we are happy
|
||||
if (sWorld.getConfig(CONFIG_BATTLEGROUND_INVITATION_TYPE) == 0)
|
||||
if (sWorld.getIntConfig(CONFIG_BATTLEGROUND_INVITATION_TYPE) == 0)
|
||||
return;
|
||||
|
||||
/*
|
||||
@@ -604,7 +604,7 @@ bool BattlegroundQueue::CheckPremadeMatch(BattlegroundBracketId bracket_id, uint
|
||||
// this could be 2 cycles but i'm checking only first team in queue - it can cause problem -
|
||||
// if first is invited to BG and seconds timer expired, but we can ignore it, because players have only 80 seconds to click to enter bg
|
||||
// and when they click or after 80 seconds the queue info is removed from queue
|
||||
uint32 time_before = getMSTime() - sWorld.getConfig(CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH);
|
||||
uint32 time_before = getMSTime() - sWorld.getIntConfig(CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH);
|
||||
for (uint32 i = 0; i < BG_TEAMS_COUNT; i++)
|
||||
{
|
||||
if (!m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE + i].empty())
|
||||
@@ -643,7 +643,7 @@ bool BattlegroundQueue::CheckNormalMatch(Battleground* bg_template, Battleground
|
||||
uint32 j = BG_TEAM_ALLIANCE;
|
||||
if (m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() < m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount())
|
||||
j = BG_TEAM_HORDE;
|
||||
if (sWorld.getConfig(CONFIG_BATTLEGROUND_INVITATION_TYPE) != 0
|
||||
if (sWorld.getIntConfig(CONFIG_BATTLEGROUND_INVITATION_TYPE) != 0
|
||||
&& m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() >= minPlayers && m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() >= minPlayers)
|
||||
{
|
||||
//we will try to invite more groups to team with less players indexed by j
|
||||
|
||||
@@ -161,7 +161,7 @@ void Channel::Join(uint64 p, const char *pass)
|
||||
if (plr)
|
||||
{
|
||||
if (HasFlag(CHANNEL_FLAG_LFG) &&
|
||||
sWorld.getConfig(CONFIG_RESTRICTED_LFG_CHANNEL) && plr->GetSession()->GetSecurity() == SEC_PLAYER && plr->GetGroup())
|
||||
sWorld.getBoolConfig(CONFIG_RESTRICTED_LFG_CHANNEL) && plr->GetSession()->GetSecurity() == SEC_PLAYER && plr->GetGroup())
|
||||
{
|
||||
MakeNotInLfg(&data);
|
||||
SendToOne(&data, p);
|
||||
@@ -171,7 +171,7 @@ void Channel::Join(uint64 p, const char *pass)
|
||||
plr->JoinedChannel(this);
|
||||
}
|
||||
|
||||
if (m_announce && (!plr || plr->GetSession()->GetSecurity() < SEC_GAMEMASTER || !sWorld.getConfig(CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL)))
|
||||
if (m_announce && (!plr || plr->GetSession()->GetSecurity() < SEC_GAMEMASTER || !sWorld.getBoolConfig(CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL)))
|
||||
{
|
||||
MakeJoined(&data, p);
|
||||
SendToAll(&data);
|
||||
@@ -231,7 +231,7 @@ void Channel::Leave(uint64 p, bool send)
|
||||
bool changeowner = players[p].IsOwner();
|
||||
|
||||
players.erase(p);
|
||||
if (m_announce && (!plr || plr->GetSession()->GetSecurity() < SEC_GAMEMASTER || !sWorld.getConfig(CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL)))
|
||||
if (m_announce && (!plr || plr->GetSession()->GetSecurity() < SEC_GAMEMASTER || !sWorld.getBoolConfig(CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL)))
|
||||
{
|
||||
WorldPacket data;
|
||||
MakeLeft(&data, p);
|
||||
@@ -439,7 +439,7 @@ void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
|
||||
// allow make moderator from another team only if both is GMs
|
||||
// at this moment this only way to show channel post for GM from another team
|
||||
if ((plr->GetSession()->GetSecurity() < SEC_GAMEMASTER || newp->GetSession()->GetSecurity() < SEC_GAMEMASTER) &&
|
||||
plr->GetTeam() != newp->GetTeam() && !sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
|
||||
plr->GetTeam() != newp->GetTeam() && !sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
|
||||
{
|
||||
WorldPacket data;
|
||||
MakePlayerNotFound(&data, p2n);
|
||||
@@ -495,7 +495,7 @@ void Channel::SetOwner(uint64 p, const char *newname)
|
||||
return;
|
||||
}
|
||||
|
||||
if (newp->GetTeam() != plr->GetTeam() && !sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
|
||||
if (newp->GetTeam() != plr->GetTeam() && !sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
|
||||
{
|
||||
WorldPacket data;
|
||||
MakePlayerNotFound(&data, newname);
|
||||
@@ -543,7 +543,7 @@ void Channel::List(Player* player)
|
||||
size_t pos = data.wpos();
|
||||
data << uint32(0); // size of list, placeholder
|
||||
|
||||
uint32 gmLevelInWhoList = sWorld.getConfig(CONFIG_GM_LEVEL_IN_WHO_LIST);
|
||||
uint32 gmLevelInWhoList = sWorld.getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST);
|
||||
|
||||
uint32 count = 0;
|
||||
for (PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
|
||||
@@ -640,7 +640,7 @@ void Channel::Say(uint64 p, const char *what, uint32 lang)
|
||||
{
|
||||
if (!what)
|
||||
return;
|
||||
if (sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
|
||||
if (sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
|
||||
lang = LANG_UNIVERSAL;
|
||||
|
||||
uint32 sec = 0;
|
||||
@@ -716,7 +716,7 @@ void Channel::Invite(uint64 p, const char *newname)
|
||||
if (!plr)
|
||||
return;
|
||||
|
||||
if (newp->GetTeam() != plr->GetTeam() && !sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
|
||||
if (newp->GetTeam() != plr->GetTeam() && !sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
|
||||
{
|
||||
WorldPacket data;
|
||||
MakeInviteWrongFaction(&data);
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
ChannelMgr* channelMgr(uint32 team)
|
||||
{
|
||||
if (sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
|
||||
if (sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
|
||||
return ACE_Singleton<AllianceChannelMgr, ACE_Null_Mutex>::instance(); // cross-faction
|
||||
|
||||
if (team == ALLIANCE)
|
||||
|
||||
@@ -837,7 +837,7 @@ bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_ac
|
||||
return false;
|
||||
|
||||
// ignore only for non-players for non strong checks (when allow apply command at least to same sec level)
|
||||
if (m_session->GetSecurity() > SEC_PLAYER && !strong && !sWorld.getConfig(CONFIG_GM_LOWER_SECURITY))
|
||||
if (m_session->GetSecurity() > SEC_PLAYER && !strong && !sWorld.getBoolConfig(CONFIG_GM_LOWER_SECURITY))
|
||||
return false;
|
||||
|
||||
if (target)
|
||||
@@ -1102,7 +1102,7 @@ int ChatHandler::ParseCommands(const char* text)
|
||||
|
||||
std::string fullcmd = text;
|
||||
|
||||
if (m_session && m_session->GetSecurity() <= SEC_PLAYER && sWorld.getConfig(CONFIG_ALLOW_PLAYER_COMMANDS) == 0)
|
||||
if (m_session && m_session->GetSecurity() <= SEC_PLAYER && sWorld.getBoolConfig(CONFIG_ALLOW_PLAYER_COMMANDS) == 0)
|
||||
return 0;
|
||||
|
||||
/// chat case (.command or !command format)
|
||||
@@ -1163,7 +1163,7 @@ valid examples:
|
||||
const char* validSequenceIterator = validSequence;
|
||||
|
||||
// more simple checks
|
||||
if (sWorld.getConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) < 3)
|
||||
if (sWorld.getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) < 3)
|
||||
{
|
||||
const std::string validCommands = "cHhr|";
|
||||
|
||||
@@ -1182,7 +1182,7 @@ valid examples:
|
||||
|
||||
++message;
|
||||
// validate sequence
|
||||
if (sWorld.getConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) == 2)
|
||||
if (sWorld.getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) == 2)
|
||||
{
|
||||
if (commandChar == *validSequenceIterator)
|
||||
{
|
||||
|
||||
@@ -146,7 +146,7 @@ bool ChatHandler::HandleSaveCommand(const char* /*args*/)
|
||||
}
|
||||
|
||||
// save if the player has last been saved over 20 seconds ago
|
||||
uint32 save_interval = sWorld.getConfig(CONFIG_INTERVAL_SAVE);
|
||||
uint32 save_interval = sWorld.getIntConfig(CONFIG_INTERVAL_SAVE);
|
||||
if (save_interval == 0 || (save_interval > 20*IN_MILLISECONDS && player->GetSaveTimer() <= save_interval - 20*IN_MILLISECONDS))
|
||||
player->SaveToDB();
|
||||
|
||||
@@ -162,7 +162,7 @@ bool ChatHandler::HandleGMListIngameCommand(const char* /*args*/)
|
||||
for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
AccountTypes itr_sec = itr->second->GetSession()->GetSecurity();
|
||||
if ((itr->second->isGameMaster() || (itr_sec > SEC_PLAYER && itr_sec <= AccountTypes(sWorld.getConfig(CONFIG_GM_LEVEL_IN_GM_LIST)))) &&
|
||||
if ((itr->second->isGameMaster() || (itr_sec > SEC_PLAYER && itr_sec <= AccountTypes(sWorld.getIntConfig(CONFIG_GM_LEVEL_IN_GM_LIST)))) &&
|
||||
(!m_session || itr->second->IsVisibleGloballyFor(m_session->GetPlayer())))
|
||||
{
|
||||
if (first)
|
||||
@@ -252,7 +252,7 @@ bool ChatHandler::HandleAccountAddonCommand(const char* args)
|
||||
uint32 account_id = m_session->GetAccountId();
|
||||
|
||||
int expansion = atoi(szExp); //get int anyway (0 if error)
|
||||
if (expansion < 0 || uint8(expansion) > sWorld.getConfig(CONFIG_EXPANSION))
|
||||
if (expansion < 0 || uint8(expansion) > sWorld.getIntConfig(CONFIG_EXPANSION))
|
||||
{
|
||||
SendSysMessage(LANG_IMPROPER_VALUE);
|
||||
SetSentErrorMessage(true);
|
||||
|
||||
@@ -1199,7 +1199,7 @@ bool ChatHandler::HandleNpcChangeLevelCommand(const char* args)
|
||||
return false;
|
||||
|
||||
uint8 lvl = (uint8) atoi((char*)args);
|
||||
if (lvl < 1 || lvl > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL) + 3)
|
||||
if (lvl < 1 || lvl > sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL) + 3)
|
||||
{
|
||||
SendSysMessage(LANG_BAD_VALUE);
|
||||
SetSentErrorMessage(true);
|
||||
@@ -2042,7 +2042,7 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
|
||||
if (HasLowerSecurity(player, 0))
|
||||
return false;
|
||||
|
||||
if (sWorld.getConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1)
|
||||
if (sWorld.getIntConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1)
|
||||
{
|
||||
sWorld.SendWorldText(LANG_COMMAND_KICKMESSAGE, player->GetName(), kicker.c_str(), reason.c_str());
|
||||
}
|
||||
@@ -2089,7 +2089,7 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
|
||||
|
||||
if (sWorld.KickPlayer(name))
|
||||
{
|
||||
if (sWorld.getConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1)
|
||||
if (sWorld.getIntConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1)
|
||||
{
|
||||
sWorld.SendWorldText(LANG_COMMAND_KICKMESSAGE, nameLink.c_str(), kicker.c_str(), reason.c_str());
|
||||
}
|
||||
|
||||
@@ -3947,7 +3947,7 @@ bool ChatHandler::HandleDieCommand(const char* /*args*/)
|
||||
|
||||
if (target->isAlive())
|
||||
{
|
||||
if (sWorld.getConfig(CONFIG_DIE_COMMAND_MODE))
|
||||
if (sWorld.getBoolConfig(CONFIG_DIE_COMMAND_MODE))
|
||||
m_session->GetPlayer()->Kill(target);
|
||||
else
|
||||
m_session->GetPlayer()->DealDamage(target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
@@ -4668,7 +4668,7 @@ bool ChatHandler::HandleChangeWeather(const char *args)
|
||||
return false;
|
||||
|
||||
//Weather is OFF
|
||||
if (!sWorld.getConfig(CONFIG_WEATHER))
|
||||
if (!sWorld.getBoolConfig(CONFIG_WEATHER))
|
||||
{
|
||||
SendSysMessage(LANG_WEATHER_DISABLED);
|
||||
SetSentErrorMessage(true);
|
||||
@@ -4941,8 +4941,8 @@ bool ChatHandler::HandleResetLevelCommand(const char * args)
|
||||
|
||||
// set starting level
|
||||
uint32 start_level = target->getClass() != CLASS_DEATH_KNIGHT
|
||||
? sWorld.getConfig(CONFIG_START_PLAYER_LEVEL)
|
||||
: sWorld.getConfig(CONFIG_START_HEROIC_PLAYER_LEVEL);
|
||||
? sWorld.getIntConfig(CONFIG_START_PLAYER_LEVEL)
|
||||
: sWorld.getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL);
|
||||
|
||||
sScriptMgr.OnPlayerLevelChanged(target, start_level);
|
||||
|
||||
@@ -6727,7 +6727,7 @@ bool ChatHandler::HandleAccountSetAddonCommand(const char *args)
|
||||
return false;
|
||||
|
||||
int expansion = atoi(szExp); //get int anyway (0 if error)
|
||||
if (expansion < 0 || uint8(expansion) > sWorld.getConfig(CONFIG_EXPANSION))
|
||||
if (expansion < 0 || uint8(expansion) > sWorld.getIntConfig(CONFIG_EXPANSION))
|
||||
return false;
|
||||
|
||||
// No SQL injection
|
||||
|
||||
@@ -174,7 +174,7 @@ void LFGMgr::AddGuidToNewQueue(uint64 guid)
|
||||
|
||||
void LFGMgr::Update(uint32 diff)
|
||||
{
|
||||
if (!m_update || !sWorld.getConfig(CONFIG_DUNGEON_FINDER_ENABLE))
|
||||
if (!m_update || !sWorld.getBoolConfig(CONFIG_DUNGEON_FINDER_ENABLE))
|
||||
return;
|
||||
|
||||
m_update = false;
|
||||
@@ -715,7 +715,7 @@ void LFGMgr::FindNewGroups(LfgGuidList &check, LfgGuidList all, LfgProposalList
|
||||
if (plr->GetSocial()->HasIgnore((*itPlayer)->GetGUIDLow()) || (*itPlayer)->GetSocial()->HasIgnore(plr->GetGUIDLow()))
|
||||
plr = NULL;
|
||||
// neither with diferent faction if it's not a mixed faction server
|
||||
else if (plr->GetTeam() != (*itPlayer)->GetTeam() && !sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP))
|
||||
else if (plr->GetTeam() != (*itPlayer)->GetTeam() && !sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP))
|
||||
plr = NULL;
|
||||
}
|
||||
if (plr)
|
||||
|
||||
@@ -159,7 +159,7 @@ m_formation(NULL)
|
||||
DisableReputationGain = false;
|
||||
//m_unit_movement_flags = MONSTER_MOVE_WALK;
|
||||
|
||||
m_SightDistance = (float)sWorld.getConfig(CONFIG_SIGHT_MONSTER);
|
||||
m_SightDistance = sWorld.getFloatConfig(CONFIG_SIGHT_MONSTER);
|
||||
m_CombatDistance = 0;//MELEE_RANGE;
|
||||
|
||||
ResetLootMode(); // restore default loot mode
|
||||
@@ -670,7 +670,7 @@ void Creature::DoFleeToGetAssistance()
|
||||
if (HasAuraType(SPELL_AURA_PREVENTS_FLEEING))
|
||||
return;
|
||||
|
||||
float radius = (float)sWorld.getConfig(CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS);
|
||||
float radius = sWorld.getFloatConfig(CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS);
|
||||
if (radius >0)
|
||||
{
|
||||
Creature* pCreature = NULL;
|
||||
@@ -690,7 +690,7 @@ void Creature::DoFleeToGetAssistance()
|
||||
UpdateSpeed(MOVE_RUN, false);
|
||||
|
||||
if (!pCreature)
|
||||
//SetFeared(true, getVictim()->GetGUID(), 0 ,sWorld.getConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY));
|
||||
//SetFeared(true, getVictim()->GetGUID(), 0 ,sWorld.getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY));
|
||||
//TODO: use 31365
|
||||
SetControlled(true, UNIT_STAT_FLEEING);
|
||||
else
|
||||
@@ -755,19 +755,19 @@ bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry,
|
||||
switch (GetCreatureInfo()->rank)
|
||||
{
|
||||
case CREATURE_ELITE_RARE:
|
||||
m_corpseDelay = sWorld.getConfig(CONFIG_CORPSE_DECAY_RARE);
|
||||
m_corpseDelay = sWorld.getIntConfig(CONFIG_CORPSE_DECAY_RARE);
|
||||
break;
|
||||
case CREATURE_ELITE_ELITE:
|
||||
m_corpseDelay = sWorld.getConfig(CONFIG_CORPSE_DECAY_ELITE);
|
||||
m_corpseDelay = sWorld.getIntConfig(CONFIG_CORPSE_DECAY_ELITE);
|
||||
break;
|
||||
case CREATURE_ELITE_RAREELITE:
|
||||
m_corpseDelay = sWorld.getConfig(CONFIG_CORPSE_DECAY_RAREELITE);
|
||||
m_corpseDelay = sWorld.getIntConfig(CONFIG_CORPSE_DECAY_RAREELITE);
|
||||
break;
|
||||
case CREATURE_ELITE_WORLDBOSS:
|
||||
m_corpseDelay = sWorld.getConfig(CONFIG_CORPSE_DECAY_WORLDBOSS);
|
||||
m_corpseDelay = sWorld.getIntConfig(CONFIG_CORPSE_DECAY_WORLDBOSS);
|
||||
break;
|
||||
default:
|
||||
m_corpseDelay = sWorld.getConfig(CONFIG_CORPSE_DECAY_NORMAL);
|
||||
m_corpseDelay = sWorld.getIntConfig(CONFIG_CORPSE_DECAY_NORMAL);
|
||||
break;
|
||||
}
|
||||
LoadCreaturesAddon();
|
||||
@@ -1418,7 +1418,7 @@ bool Creature::canStartAttack(Unit const* who, bool force) const
|
||||
|
||||
if (who->isInCombat())
|
||||
if (Unit *victim = who->getAttackerForHelper())
|
||||
if (IsWithinDistInMap(victim, (float)sWorld.getConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS)))
|
||||
if (IsWithinDistInMap(victim, sWorld.getFloatConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS)))
|
||||
force = true;
|
||||
|
||||
if (!force && (IsNeutralToAll() || !IsWithinDistInMap(who, GetAttackDistance(who) + m_CombatDistance)))
|
||||
@@ -1453,7 +1453,7 @@ float Creature::GetAttackDistance(Unit const* pl) const
|
||||
// radius grow if playlevel < creaturelevel
|
||||
RetDistance -= (float)leveldif;
|
||||
|
||||
if (creaturelevel+5 <= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (creaturelevel+5 <= sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
// detect range auras
|
||||
RetDistance += GetTotalAuraModifier(SPELL_AURA_MOD_DETECT_RANGE);
|
||||
@@ -1476,7 +1476,7 @@ void Creature::setDeathState(DeathState s)
|
||||
m_deathTimer = m_corpseDelay*IN_MILLISECONDS;
|
||||
|
||||
// always save boss respawn time at death to prevent crash cheating
|
||||
if (sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY) || isWorldBoss())
|
||||
if (sWorld.getBoolConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY) || isWorldBoss())
|
||||
SaveRespawnTime();
|
||||
}
|
||||
Unit::setDeathState(s);
|
||||
@@ -1861,7 +1861,7 @@ void Creature::CallAssistance()
|
||||
{
|
||||
SetNoCallAssistance(true);
|
||||
|
||||
float radius = (float)sWorld.getConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS);
|
||||
float radius = sWorld.getFloatConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS);
|
||||
|
||||
if (radius > 0)
|
||||
{
|
||||
@@ -1890,7 +1890,7 @@ void Creature::CallAssistance()
|
||||
e->AddAssistant((*assistList.begin())->GetGUID());
|
||||
assistList.pop_front();
|
||||
}
|
||||
m_Events.AddEvent(e, m_Events.CalculateTime(sWorld.getConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY)));
|
||||
m_Events.AddEvent(e, m_Events.CalculateTime(sWorld.getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2013,7 +2013,7 @@ bool Creature::canCreatureAttack(Unit const *pVictim, bool force) const
|
||||
return true;
|
||||
|
||||
//Use AttackDistance in distance check if threat radius is lower. This prevents creature bounce in and out of combat every update tick.
|
||||
float dist = std::max(GetAttackDistance(pVictim), (float)sWorld.getConfig(CONFIG_THREAT_RADIUS)) + m_CombatDistance;
|
||||
float dist = std::max(GetAttackDistance(pVictim), sWorld.getFloatConfig(CONFIG_THREAT_RADIUS)) + m_CombatDistance;
|
||||
|
||||
if (Unit *unit = GetCharmerOrOwner())
|
||||
return pVictim->IsWithinDist(unit, dist);
|
||||
@@ -2276,7 +2276,7 @@ uint8 Creature::getLevelForTarget(Unit const* target) const
|
||||
if (!isWorldBoss())
|
||||
return Unit::getLevelForTarget(target);
|
||||
|
||||
uint16 level = target->getLevel()+sWorld.getConfig(CONFIG_WORLD_BOSS_LEVEL_DIFF);
|
||||
uint16 level = target->getLevel()+sWorld.getIntConfig(CONFIG_WORLD_BOSS_LEVEL_DIFF);
|
||||
if (level < 1)
|
||||
return 1;
|
||||
if (level > 255)
|
||||
|
||||
@@ -519,7 +519,7 @@ void GameObject::Update(uint32 diff)
|
||||
m_respawnTime = time(NULL) + m_respawnDelayTime;
|
||||
|
||||
// if option not set then object will be saved at grid unload
|
||||
if (sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY))
|
||||
if (sWorld.getBoolConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY))
|
||||
SaveRespawnTime();
|
||||
|
||||
UpdateObjectVisibility();
|
||||
|
||||
@@ -637,7 +637,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
|
||||
// FG: pretend that OTHER players in own group are friendly ("blue")
|
||||
else if (index == UNIT_FIELD_BYTES_2 || index == UNIT_FIELD_FACTIONTEMPLATE)
|
||||
{
|
||||
if (((Unit*)this)->IsControlledByPlayer() && target != this && sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && ((Unit*)this)->IsInRaidWith(target))
|
||||
if (((Unit*)this)->IsControlledByPlayer() && target != this && sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && ((Unit*)this)->IsInRaidWith(target))
|
||||
{
|
||||
FactionTemplateEntry const *ft1, *ft2;
|
||||
ft1 = ((Unit*)this)->getFactionTemplateEntry();
|
||||
@@ -1575,21 +1575,21 @@ void WorldObject::MonsterSay(const char* text, uint32 language, uint64 TargetGui
|
||||
{
|
||||
WorldPacket data(SMSG_MESSAGECHAT, 200);
|
||||
BuildMonsterChat(&data,CHAT_MSG_MONSTER_SAY,text,language,GetName(),TargetGuid);
|
||||
SendMessageToSetInRange(&data,(float)sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY),true);
|
||||
SendMessageToSetInRange(&data,sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_SAY),true);
|
||||
}
|
||||
|
||||
void WorldObject::MonsterYell(const char* text, uint32 language, uint64 TargetGuid)
|
||||
{
|
||||
WorldPacket data(SMSG_MESSAGECHAT, 200);
|
||||
BuildMonsterChat(&data,CHAT_MSG_MONSTER_YELL,text,language,GetName(),TargetGuid);
|
||||
SendMessageToSetInRange(&data,(float)sWorld.getConfig(CONFIG_LISTEN_RANGE_YELL),true);
|
||||
SendMessageToSetInRange(&data,sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_YELL),true);
|
||||
}
|
||||
|
||||
void WorldObject::MonsterTextEmote(const char* text, uint64 TargetGuid, bool IsBossEmote)
|
||||
{
|
||||
WorldPacket data(SMSG_MESSAGECHAT, 200);
|
||||
BuildMonsterChat(&data,IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE,text,LANG_UNIVERSAL,GetName(),TargetGuid);
|
||||
SendMessageToSetInRange(&data,(float)sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),true);
|
||||
SendMessageToSetInRange(&data,sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),true);
|
||||
}
|
||||
|
||||
void WorldObject::MonsterWhisper(const char* text, uint64 receiver, bool IsBossWhisper)
|
||||
@@ -1661,9 +1661,9 @@ void WorldObject::MonsterSay(int32 textId, uint32 language, uint64 TargetGuid)
|
||||
|
||||
Trinity::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_SAY, textId,language,TargetGuid);
|
||||
Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build);
|
||||
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this,(float)sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY),say_do);
|
||||
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this,sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_SAY),say_do);
|
||||
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetMap(), *this, (float)sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY));
|
||||
cell.Visit(p, message, *GetMap(), *this, sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
|
||||
}
|
||||
|
||||
void WorldObject::MonsterYell(int32 textId, uint32 language, uint64 TargetGuid)
|
||||
@@ -1676,9 +1676,9 @@ void WorldObject::MonsterYell(int32 textId, uint32 language, uint64 TargetGuid)
|
||||
|
||||
Trinity::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_YELL, textId,language,TargetGuid);
|
||||
Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build);
|
||||
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this,(float)sWorld.getConfig(CONFIG_LISTEN_RANGE_YELL),say_do);
|
||||
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this,sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_YELL),say_do);
|
||||
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetMap(), *this, (float)sWorld.getConfig(CONFIG_LISTEN_RANGE_YELL));
|
||||
cell.Visit(p, message, *GetMap(), *this, sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_YELL));
|
||||
}
|
||||
|
||||
void WorldObject::MonsterYellToZone(int32 textId, uint32 language, uint64 TargetGuid)
|
||||
@@ -1704,9 +1704,9 @@ void WorldObject::MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossE
|
||||
|
||||
Trinity::MonsterChatBuilder say_build(*this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId,LANG_UNIVERSAL,TargetGuid);
|
||||
Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build);
|
||||
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this,(float)sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),say_do);
|
||||
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this,sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),say_do);
|
||||
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetMap(), *this, (float)sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
|
||||
cell.Visit(p, message, *GetMap(), *this, sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
|
||||
}
|
||||
|
||||
void WorldObject::MonsterWhisper(int32 textId, uint64 receiver, bool IsBossWhisper)
|
||||
@@ -2217,7 +2217,7 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float
|
||||
|
||||
/*
|
||||
// if detection disabled, return first point
|
||||
if (!sWorld.getConfig(CONFIG_DETECT_POS_COLLISION))
|
||||
if (!sWorld.getIntConfig(CONFIG_DETECT_POS_COLLISION))
|
||||
{
|
||||
UpdateGroundPositionZ(x,y,z); // update to LOS height if available
|
||||
return;
|
||||
|
||||
@@ -56,7 +56,7 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size)
|
||||
c_stream.opaque = (voidpf)0;
|
||||
|
||||
// default Z_BEST_SPEED (1)
|
||||
int z_res = deflateInit(&c_stream, sWorld.getConfig(CONFIG_COMPRESSION));
|
||||
int z_res = deflateInit(&c_stream, sWorld.getIntConfig(CONFIG_COMPRESSION));
|
||||
if (z_res != Z_OK)
|
||||
{
|
||||
sLog.outError("Can't compress update packet (zlib: deflateInit) Error code: %i (%s)",z_res,zError(z_res));
|
||||
|
||||
@@ -710,7 +710,7 @@ void Pet::GivePetXP(uint32 xp)
|
||||
uint32 newXP = curXP + xp;
|
||||
|
||||
// Check how much XP the pet should receive, and hand off have any left from previous levelups
|
||||
while (newXP >= nextLvlXP && level < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
while (newXP >= nextLvlXP && level < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
// Subtract newXP from amount needed for nextlevel
|
||||
newXP -= nextLvlXP;
|
||||
|
||||
@@ -425,7 +425,7 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
|
||||
|
||||
m_areaUpdateId = 0;
|
||||
|
||||
m_nextSave = sWorld.getConfig(CONFIG_INTERVAL_SAVE);
|
||||
m_nextSave = sWorld.getIntConfig(CONFIG_INTERVAL_SAVE);
|
||||
|
||||
clearResurrectRequestData();
|
||||
|
||||
@@ -701,7 +701,7 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c
|
||||
|
||||
SetUInt32Value(UNIT_FIELD_BYTES_0, (RaceClassGender | (powertype << 24)));
|
||||
InitDisplayIds();
|
||||
if (sWorld.getConfig(CONFIG_GAME_TYPE) == REALM_TYPE_PVP || sWorld.getConfig(CONFIG_GAME_TYPE) == REALM_TYPE_RPPVP)
|
||||
if (sWorld.getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_PVP || sWorld.getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_RPPVP)
|
||||
{
|
||||
SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP);
|
||||
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
|
||||
@@ -733,12 +733,12 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c
|
||||
|
||||
// set starting level
|
||||
uint32 start_level = getClass() != CLASS_DEATH_KNIGHT
|
||||
? sWorld.getConfig(CONFIG_START_PLAYER_LEVEL)
|
||||
: sWorld.getConfig(CONFIG_START_HEROIC_PLAYER_LEVEL);
|
||||
? sWorld.getIntConfig(CONFIG_START_PLAYER_LEVEL)
|
||||
: sWorld.getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL);
|
||||
|
||||
if (GetSession()->GetSecurity() >= SEC_MODERATOR)
|
||||
{
|
||||
uint32 gm_level = sWorld.getConfig(CONFIG_START_GM_LEVEL);
|
||||
uint32 gm_level = sWorld.getIntConfig(CONFIG_START_GM_LEVEL);
|
||||
if (gm_level > start_level)
|
||||
start_level = gm_level;
|
||||
}
|
||||
@@ -747,19 +747,19 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c
|
||||
|
||||
InitRunes();
|
||||
|
||||
SetUInt32Value(PLAYER_FIELD_COINAGE, sWorld.getConfig(CONFIG_START_PLAYER_MONEY));
|
||||
SetHonorPoints(sWorld.getConfig(CONFIG_START_HONOR_POINTS));
|
||||
SetArenaPoints(sWorld.getConfig(CONFIG_START_ARENA_POINTS));
|
||||
SetUInt32Value(PLAYER_FIELD_COINAGE, sWorld.getIntConfig(CONFIG_START_PLAYER_MONEY));
|
||||
SetHonorPoints(sWorld.getIntConfig(CONFIG_START_HONOR_POINTS));
|
||||
SetArenaPoints(sWorld.getIntConfig(CONFIG_START_ARENA_POINTS));
|
||||
|
||||
// start with every map explored
|
||||
if (sWorld.getConfig(CONFIG_START_ALL_EXPLORED))
|
||||
if (sWorld.getBoolConfig(CONFIG_START_ALL_EXPLORED))
|
||||
{
|
||||
for (uint8 i=0; i<PLAYER_EXPLORED_ZONES_SIZE; i++)
|
||||
SetFlag(PLAYER_EXPLORED_ZONES_1+i,0xFFFFFFFF);
|
||||
}
|
||||
|
||||
//Reputations if "StartAllReputation" is enabled, -- TODO: Fix this in a better way
|
||||
if (sWorld.getConfig(CONFIG_START_ALL_REP))
|
||||
if (sWorld.getBoolConfig(CONFIG_START_ALL_REP))
|
||||
{
|
||||
GetReputationMgr().SetReputation(sFactionStore.LookupEntry(942),42999);
|
||||
GetReputationMgr().SetReputation(sFactionStore.LookupEntry(935),42999);
|
||||
@@ -1041,7 +1041,7 @@ int32 Player::getMaxTimer(MirrorTimerType timer)
|
||||
return MINUTE*IN_MILLISECONDS;
|
||||
case BREATH_TIMER:
|
||||
{
|
||||
if (!isAlive() || HasAuraType(SPELL_AURA_WATER_BREATHING) || GetSession()->GetSecurity() >= AccountTypes(sWorld.getConfig(CONFIG_DISABLE_BREATHING)))
|
||||
if (!isAlive() || HasAuraType(SPELL_AURA_WATER_BREATHING) || GetSession()->GetSecurity() >= AccountTypes(sWorld.getIntConfig(CONFIG_DISABLE_BREATHING)))
|
||||
return DISABLED_MIRROR_TIMER;
|
||||
int32 UnderWaterTime = 3*MINUTE*IN_MILLISECONDS;
|
||||
AuraEffectList const& mModWaterBreathing = GetAuraEffectsByType(SPELL_AURA_MOD_WATER_BREATHING);
|
||||
@@ -1636,7 +1636,7 @@ bool Player::BuildEnumData(QueryResult_AutoPtr result, WorldPacket * p_data)
|
||||
char_flags |= CHARACTER_FLAG_GHOST;
|
||||
if (atLoginFlags & AT_LOGIN_RENAME)
|
||||
char_flags |= CHARACTER_FLAG_RENAME;
|
||||
if (sWorld.getConfig(CONFIG_DECLINED_NAMES_USED))
|
||||
if (sWorld.getBoolConfig(CONFIG_DECLINED_NAMES_USED))
|
||||
{
|
||||
if (!fields[20].GetCppString().empty())
|
||||
char_flags |= CHARACTER_FLAG_DECLINED;
|
||||
@@ -2537,7 +2537,7 @@ void Player::SetGMVisible(bool on)
|
||||
|
||||
bool Player::IsGroupVisibleFor(Player* p) const
|
||||
{
|
||||
switch(sWorld.getConfig(CONFIG_GROUP_VISIBILITY))
|
||||
switch(sWorld.getIntConfig(CONFIG_GROUP_VISIBILITY))
|
||||
{
|
||||
default: return IsInSameGroupWith(p);
|
||||
case 1: return IsInSameRaidWith(p);
|
||||
@@ -2633,7 +2633,7 @@ void Player::GiveXP(uint32 xp, Unit *victim, float group_rate)
|
||||
// Favored experience increase END
|
||||
|
||||
// XP to money conversion processed in Player::RewardQuest
|
||||
if (level >= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (level >= sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
return;
|
||||
|
||||
uint32 bonus_xp = 0;
|
||||
@@ -2651,11 +2651,11 @@ void Player::GiveXP(uint32 xp, Unit *victim, float group_rate)
|
||||
uint32 nextLvlXP = GetUInt32Value(PLAYER_NEXT_LEVEL_XP);
|
||||
uint32 newXP = curXP + xp + bonus_xp;
|
||||
|
||||
while (newXP >= nextLvlXP && level < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
while (newXP >= nextLvlXP && level < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
newXP -= nextLvlXP;
|
||||
|
||||
if (level < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (level < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
GiveLevel(level + 1);
|
||||
|
||||
level = getLevel();
|
||||
@@ -2722,7 +2722,7 @@ void Player::GiveLevel(uint8 level)
|
||||
|
||||
UpdateAllStats();
|
||||
|
||||
if (sWorld.getConfig(CONFIG_ALWAYS_MAXSKILL)) // Max weapon skill when leveling up
|
||||
if (sWorld.getBoolConfig(CONFIG_ALWAYS_MAXSKILL)) // Max weapon skill when leveling up
|
||||
UpdateSkillsToMaxSkillsForLevel();
|
||||
|
||||
// set current level health and mana/energy to maximum after applying all mods.
|
||||
@@ -2766,7 +2766,7 @@ void Player::InitTalentForLevel()
|
||||
}
|
||||
else
|
||||
{
|
||||
if (level < sWorld.getConfig(CONFIG_MIN_DUALSPEC_LEVEL) || m_specsCount == 0)
|
||||
if (level < sWorld.getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL) || m_specsCount == 0)
|
||||
{
|
||||
m_specsCount = 1;
|
||||
m_activeSpec = 0;
|
||||
@@ -2802,7 +2802,7 @@ void Player::InitStatsForLevel(bool reapplyMods)
|
||||
PlayerLevelInfo info;
|
||||
sObjectMgr.GetPlayerLevelInfo(getRace(),getClass(),getLevel(),&info);
|
||||
|
||||
SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL));
|
||||
SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL));
|
||||
SetUInt32Value(PLAYER_NEXT_LEVEL_XP, sObjectMgr.GetXPForLevel(getLevel()));
|
||||
|
||||
// reset before any aura state sources (health set/aura apply)
|
||||
@@ -3657,7 +3657,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
|
||||
if (sSpellMgr.IsPrimaryProfessionFirstRankSpell(spell_id))
|
||||
{
|
||||
uint32 freeProfs = GetFreePrimaryProfessionPoints()+1;
|
||||
if (freeProfs <= sWorld.getConfig(CONFIG_MAX_PRIMARY_TRADE_SKILL))
|
||||
if (freeProfs <= sWorld.getIntConfig(CONFIG_MAX_PRIMARY_TRADE_SKILL))
|
||||
SetFreePrimaryProfessions(freeProfs);
|
||||
}
|
||||
|
||||
@@ -3788,7 +3788,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
|
||||
if (spell_id == 46917 && m_canTitanGrip)
|
||||
SetCanTitanGrip(false);
|
||||
|
||||
if (sWorld.getConfig(CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN))
|
||||
if (sWorld.getBoolConfig(CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN))
|
||||
AutoUnequipOffhandIfNeed();
|
||||
|
||||
// remove from spell book if not replaced by lesser rank
|
||||
@@ -4023,7 +4023,7 @@ bool Player::resetTalents(bool no_cost)
|
||||
|
||||
uint32 cost = 0;
|
||||
|
||||
if (!no_cost && !sWorld.getConfig(CONFIG_NO_RESET_TALENT_COST))
|
||||
if (!no_cost && !sWorld.getBoolConfig(CONFIG_NO_RESET_TALENT_COST))
|
||||
{
|
||||
cost = resetTalentsCost();
|
||||
|
||||
@@ -4393,8 +4393,8 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
|
||||
if (accountId == 0)
|
||||
updateRealmChars = false;
|
||||
|
||||
uint32 charDelete_method = sWorld.getConfig(CONFIG_CHARDELETE_METHOD);
|
||||
uint32 charDelete_minLvl = sWorld.getConfig(CONFIG_CHARDELETE_MIN_LEVEL);
|
||||
uint32 charDelete_method = sWorld.getIntConfig(CONFIG_CHARDELETE_METHOD);
|
||||
uint32 charDelete_minLvl = sWorld.getIntConfig(CONFIG_CHARDELETE_MIN_LEVEL);
|
||||
|
||||
// if we want to finally delete the character or the character does not meet the level requirement,
|
||||
// we set it to mode CHAR_DELETE_REMOVE
|
||||
@@ -4576,7 +4576,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
|
||||
*/
|
||||
void Player::DeleteOldCharacters()
|
||||
{
|
||||
uint32 keepDays = sWorld.getConfig(CONFIG_CHARDELETE_KEEP_DAYS);
|
||||
uint32 keepDays = sWorld.getIntConfig(CONFIG_CHARDELETE_KEEP_DAYS);
|
||||
if (!keepDays)
|
||||
return;
|
||||
|
||||
@@ -4731,7 +4731,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
|
||||
//Characters from level 11-19 will suffer from one minute of sickness
|
||||
//for each level they are above 10.
|
||||
//Characters level 20 and up suffer from ten minutes of sickness.
|
||||
int32 startLevel = sWorld.getConfig(CONFIG_DEATH_SICKNESS_LEVEL);
|
||||
int32 startLevel = sWorld.getIntConfig(CONFIG_DEATH_SICKNESS_LEVEL);
|
||||
|
||||
if (int32(getLevel()) >= startLevel)
|
||||
{
|
||||
@@ -5240,7 +5240,7 @@ void Player::LeaveLFGChannel()
|
||||
|
||||
void Player::UpdateDefense()
|
||||
{
|
||||
uint32 defense_skill_gain = sWorld.getConfig(CONFIG_SKILL_GAIN_DEFENSE);
|
||||
uint32 defense_skill_gain = sWorld.getIntConfig(CONFIG_SKILL_GAIN_DEFENSE);
|
||||
|
||||
if (UpdateSkill(SKILL_DEFENSE,defense_skill_gain))
|
||||
{
|
||||
@@ -5660,12 +5660,12 @@ bool Player::UpdateSkill(uint32 skill_id, uint32 step)
|
||||
inline int SkillGainChance(uint32 SkillValue, uint32 GrayLevel, uint32 GreenLevel, uint32 YellowLevel)
|
||||
{
|
||||
if (SkillValue >= GrayLevel)
|
||||
return sWorld.getConfig(CONFIG_SKILL_CHANCE_GREY)*10;
|
||||
return sWorld.getIntConfig(CONFIG_SKILL_CHANCE_GREY)*10;
|
||||
if (SkillValue >= GreenLevel)
|
||||
return sWorld.getConfig(CONFIG_SKILL_CHANCE_GREEN)*10;
|
||||
return sWorld.getIntConfig(CONFIG_SKILL_CHANCE_GREEN)*10;
|
||||
if (SkillValue >= YellowLevel)
|
||||
return sWorld.getConfig(CONFIG_SKILL_CHANCE_YELLOW)*10;
|
||||
return sWorld.getConfig(CONFIG_SKILL_CHANCE_ORANGE)*10;
|
||||
return sWorld.getIntConfig(CONFIG_SKILL_CHANCE_YELLOW)*10;
|
||||
return sWorld.getIntConfig(CONFIG_SKILL_CHANCE_ORANGE)*10;
|
||||
}
|
||||
|
||||
bool Player::UpdateCraftSkill(uint32 spellid)
|
||||
@@ -5688,7 +5688,7 @@ bool Player::UpdateCraftSkill(uint32 spellid)
|
||||
learnSpell(discoveredSpell, false);
|
||||
}
|
||||
|
||||
uint32 craft_skill_gain = sWorld.getConfig(CONFIG_SKILL_GAIN_CRAFTING);
|
||||
uint32 craft_skill_gain = sWorld.getIntConfig(CONFIG_SKILL_GAIN_CRAFTING);
|
||||
|
||||
return UpdateSkillPro(_spell_idx->second->skillId, SkillGainChance(SkillValue,
|
||||
_spell_idx->second->max_value,
|
||||
@@ -5704,7 +5704,7 @@ bool Player::UpdateGatherSkill(uint32 SkillId, uint32 SkillValue, uint32 RedLeve
|
||||
{
|
||||
sLog.outDebug("UpdateGatherSkill(SkillId %d SkillLevel %d RedLevel %d)", SkillId, SkillValue, RedLevel);
|
||||
|
||||
uint32 gathering_skill_gain = sWorld.getConfig(CONFIG_SKILL_GAIN_GATHERING);
|
||||
uint32 gathering_skill_gain = sWorld.getIntConfig(CONFIG_SKILL_GAIN_GATHERING);
|
||||
|
||||
// For skinning and Mining chance decrease with level. 1-74 - no decrease, 75-149 - 2 times, 225-299 - 8 times
|
||||
switch (SkillId)
|
||||
@@ -5715,15 +5715,15 @@ bool Player::UpdateGatherSkill(uint32 SkillId, uint32 SkillValue, uint32 RedLeve
|
||||
case SKILL_INSCRIPTION:
|
||||
return UpdateSkillPro(SkillId, SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator,gathering_skill_gain);
|
||||
case SKILL_SKINNING:
|
||||
if (sWorld.getConfig(CONFIG_SKILL_CHANCE_SKINNING_STEPS) == 0)
|
||||
if (sWorld.getIntConfig(CONFIG_SKILL_CHANCE_SKINNING_STEPS) == 0)
|
||||
return UpdateSkillPro(SkillId, SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator,gathering_skill_gain);
|
||||
else
|
||||
return UpdateSkillPro(SkillId, (SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator) >> (SkillValue/sWorld.getConfig(CONFIG_SKILL_CHANCE_SKINNING_STEPS)), gathering_skill_gain);
|
||||
return UpdateSkillPro(SkillId, (SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator) >> (SkillValue/sWorld.getIntConfig(CONFIG_SKILL_CHANCE_SKINNING_STEPS)), gathering_skill_gain);
|
||||
case SKILL_MINING:
|
||||
if (sWorld.getConfig(CONFIG_SKILL_CHANCE_MINING_STEPS) == 0)
|
||||
if (sWorld.getIntConfig(CONFIG_SKILL_CHANCE_MINING_STEPS) == 0)
|
||||
return UpdateSkillPro(SkillId, SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator,gathering_skill_gain);
|
||||
else
|
||||
return UpdateSkillPro(SkillId, (SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator) >> (SkillValue/sWorld.getConfig(CONFIG_SKILL_CHANCE_MINING_STEPS)),gathering_skill_gain);
|
||||
return UpdateSkillPro(SkillId, (SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator) >> (SkillValue/sWorld.getIntConfig(CONFIG_SKILL_CHANCE_MINING_STEPS)),gathering_skill_gain);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -5736,7 +5736,7 @@ bool Player::UpdateFishingSkill()
|
||||
|
||||
int32 chance = SkillValue < 75 ? 100 : 2500/(SkillValue-50);
|
||||
|
||||
uint32 gathering_skill_gain = sWorld.getConfig(CONFIG_SKILL_GAIN_GATHERING);
|
||||
uint32 gathering_skill_gain = sWorld.getIntConfig(CONFIG_SKILL_GAIN_GATHERING);
|
||||
|
||||
return UpdateSkillPro(SKILL_FISHING,chance*10,gathering_skill_gain);
|
||||
}
|
||||
@@ -5816,7 +5816,7 @@ void Player::UpdateWeaponSkill (WeaponAttackType attType)
|
||||
if (pVictim && pVictim->GetTypeId() == TYPEID_UNIT && (pVictim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_SKILLGAIN))
|
||||
return;
|
||||
|
||||
uint32 weapon_skill_gain = sWorld.getConfig(CONFIG_SKILL_GAIN_WEAPON);
|
||||
uint32 weapon_skill_gain = sWorld.getIntConfig(CONFIG_SKILL_GAIN_WEAPON);
|
||||
|
||||
switch(attType)
|
||||
{
|
||||
@@ -5904,7 +5904,7 @@ void Player::UpdateSkillsForLevel()
|
||||
uint16 maxconfskill = sWorld.GetConfigMaxSkillValue();
|
||||
uint32 maxSkill = GetMaxSkillValueForLevel();
|
||||
|
||||
bool alwaysMaxSkill = sWorld.getConfig(CONFIG_ALWAYS_MAX_SKILL_FOR_LEVEL);
|
||||
bool alwaysMaxSkill = sWorld.getBoolConfig(CONFIG_ALWAYS_MAX_SKILL_FOR_LEVEL);
|
||||
|
||||
for (SkillStatusMap::iterator itr = mSkillStatus.begin(); itr != mSkillStatus.end(); ++itr)
|
||||
{
|
||||
@@ -6412,7 +6412,7 @@ void Player::CheckAreaExploreAndOutdoor()
|
||||
bool isOutdoor;
|
||||
uint16 areaFlag = GetBaseMap()->GetAreaFlag(GetPositionX(),GetPositionY(),GetPositionZ(), &isOutdoor);
|
||||
|
||||
if (sWorld.getConfig(CONFIG_VMAP_INDOOR_CHECK) && !isOutdoor)
|
||||
if (sWorld.getBoolConfig(CONFIG_VMAP_INDOOR_CHECK) && !isOutdoor)
|
||||
RemoveAurasWithAttribute(SPELL_ATTR_OUTDOORS_ONLY);
|
||||
|
||||
if (areaFlag==0xffff)
|
||||
@@ -6442,7 +6442,7 @@ void Player::CheckAreaExploreAndOutdoor()
|
||||
else if (p->area_level > 0)
|
||||
{
|
||||
uint32 area = p->ID;
|
||||
if (getLevel() >= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (getLevel() >= sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
SendExplorationExperience(area,0);
|
||||
}
|
||||
@@ -6837,7 +6837,7 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, int32 honor, bool pvpt
|
||||
}
|
||||
}
|
||||
|
||||
if (sWorld.getConfig(CONFIG_PVP_TOKEN_ENABLE) && pvptoken)
|
||||
if (sWorld.getBoolConfig(CONFIG_PVP_TOKEN_ENABLE) && pvptoken)
|
||||
{
|
||||
if (!uVictim || uVictim == this || uVictim->HasAuraType(SPELL_AURA_NO_PVP_CREDIT))
|
||||
return true;
|
||||
@@ -6845,15 +6845,15 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, int32 honor, bool pvpt
|
||||
if (uVictim->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
// Check if allowed to receive it in current map
|
||||
uint8 MapType = sWorld.getConfig(CONFIG_PVP_TOKEN_MAP_TYPE);
|
||||
uint8 MapType = sWorld.getIntConfig(CONFIG_PVP_TOKEN_MAP_TYPE);
|
||||
if ((MapType == 1 && !InBattleground() && !HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
|
||||
|| (MapType == 2 && !HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
|
||||
|| (MapType == 3 && !InBattleground()))
|
||||
return true;
|
||||
|
||||
uint32 noSpaceForCount = 0;
|
||||
uint32 itemId = sWorld.getConfig(CONFIG_PVP_TOKEN_ID);
|
||||
int32 count = sWorld.getConfig(CONFIG_PVP_TOKEN_COUNT);
|
||||
uint32 itemId = sWorld.getIntConfig(CONFIG_PVP_TOKEN_ID);
|
||||
int32 count = sWorld.getIntConfig(CONFIG_PVP_TOKEN_COUNT);
|
||||
|
||||
// check space and find places
|
||||
ItemPosCountVec dest;
|
||||
@@ -6881,26 +6881,26 @@ void Player::ModifyHonorPoints(int32 value)
|
||||
{
|
||||
if (value < 0)
|
||||
{
|
||||
if (GetHonorPoints() > sWorld.getConfig(CONFIG_MAX_HONOR_POINTS))
|
||||
SetHonorPoints(sWorld.getConfig(CONFIG_MAX_HONOR_POINTS) + value);
|
||||
if (GetHonorPoints() > sWorld.getIntConfig(CONFIG_MAX_HONOR_POINTS))
|
||||
SetHonorPoints(sWorld.getIntConfig(CONFIG_MAX_HONOR_POINTS) + value);
|
||||
else
|
||||
SetHonorPoints(GetHonorPoints() > uint32(-value) ? GetHonorPoints() + value : 0);
|
||||
}
|
||||
else
|
||||
SetHonorPoints(GetHonorPoints() < sWorld.getConfig(CONFIG_MAX_HONOR_POINTS) - value ? GetHonorPoints() + value : sWorld.getConfig(CONFIG_MAX_HONOR_POINTS));
|
||||
SetHonorPoints(GetHonorPoints() < sWorld.getIntConfig(CONFIG_MAX_HONOR_POINTS) - value ? GetHonorPoints() + value : sWorld.getIntConfig(CONFIG_MAX_HONOR_POINTS));
|
||||
}
|
||||
|
||||
void Player::ModifyArenaPoints(int32 value)
|
||||
{
|
||||
if (value < 0)
|
||||
{
|
||||
if (GetArenaPoints() > sWorld.getConfig(CONFIG_MAX_ARENA_POINTS))
|
||||
SetArenaPoints(sWorld.getConfig(CONFIG_MAX_ARENA_POINTS) + value);
|
||||
if (GetArenaPoints() > sWorld.getIntConfig(CONFIG_MAX_ARENA_POINTS))
|
||||
SetArenaPoints(sWorld.getIntConfig(CONFIG_MAX_ARENA_POINTS) + value);
|
||||
else
|
||||
SetArenaPoints(GetArenaPoints() > uint32(-value) ? GetArenaPoints() + value : 0);
|
||||
}
|
||||
else
|
||||
SetArenaPoints(GetArenaPoints() < sWorld.getConfig(CONFIG_MAX_ARENA_POINTS) - value ? GetArenaPoints() + value : sWorld.getConfig(CONFIG_MAX_ARENA_POINTS));
|
||||
SetArenaPoints(GetArenaPoints() < sWorld.getIntConfig(CONFIG_MAX_ARENA_POINTS) - value ? GetArenaPoints() + value : sWorld.getIntConfig(CONFIG_MAX_ARENA_POINTS));
|
||||
}
|
||||
|
||||
uint32 Player::GetGuildIdFromDB(uint64 guid)
|
||||
@@ -7009,7 +7009,7 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
|
||||
if (!zone)
|
||||
return;
|
||||
|
||||
if (sWorld.getConfig(CONFIG_WEATHER))
|
||||
if (sWorld.getBoolConfig(CONFIG_WEATHER))
|
||||
{
|
||||
Weather *wth = sWeatherMgr.FindWeather(zone->ID);
|
||||
if (wth)
|
||||
@@ -7238,7 +7238,7 @@ void Player::DuelComplete(DuelCompleteType type)
|
||||
duel->opponent->ClearComboPoints();
|
||||
|
||||
// Honor points after duel (the winner) - ImpConfig
|
||||
if (uint32 amount = sWorld.getConfig(CONFIG_HONOR_AFTER_DUEL))
|
||||
if (uint32 amount = sWorld.getIntConfig(CONFIG_HONOR_AFTER_DUEL))
|
||||
duel->opponent->RewardHonor(NULL,1,amount);
|
||||
|
||||
//cleanups
|
||||
@@ -8664,9 +8664,9 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)
|
||||
data << uint32(0x8d4) << uint32(0x0); // 5
|
||||
data << uint32(0x8d3) << uint32(0x0); // 6
|
||||
// 7 1 - Arena season in progress, 0 - end of season
|
||||
data << uint32(0xC77) << uint32(sWorld.getConfig(CONFIG_ARENA_SEASON_IN_PROGRESS));
|
||||
data << uint32(0xC77) << uint32(sWorld.getBoolConfig(CONFIG_ARENA_SEASON_IN_PROGRESS));
|
||||
// 8 Arena season id
|
||||
data << uint32(0xF3D) << uint32(sWorld.getConfig(CONFIG_ARENA_SEASON_ID));
|
||||
data << uint32(0xF3D) << uint32(sWorld.getIntConfig(CONFIG_ARENA_SEASON_ID));
|
||||
|
||||
if (mapid == 530) // Outland
|
||||
{
|
||||
@@ -9189,7 +9189,7 @@ void Player::SendTalentWipeConfirm(uint64 guid)
|
||||
{
|
||||
WorldPacket data(MSG_TALENT_WIPE_CONFIRM, (8+4));
|
||||
data << uint64(guid);
|
||||
uint32 cost = sWorld.getConfig(CONFIG_NO_RESET_TALENT_COST) ? 0 : resetTalentsCost();
|
||||
uint32 cost = sWorld.getBoolConfig(CONFIG_NO_RESET_TALENT_COST) ? 0 : resetTalentsCost();
|
||||
data << cost;
|
||||
GetSession()->SendPacket(&data);
|
||||
}
|
||||
@@ -13485,7 +13485,7 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId, bool showQue
|
||||
bCanTalk = false;
|
||||
break;
|
||||
case GOSSIP_OPTION_LEARNDUALSPEC:
|
||||
if (!(GetSpecsCount() == 1 && pCreature->isCanTrainingAndResetTalentsOf(this) && !(getLevel() < sWorld.getConfig(CONFIG_MIN_DUALSPEC_LEVEL))))
|
||||
if (!(GetSpecsCount() == 1 && pCreature->isCanTrainingAndResetTalentsOf(this) && !(getLevel() < sWorld.getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL))))
|
||||
bCanTalk = false;
|
||||
break;
|
||||
case GOSSIP_OPTION_UNLEARNTALENTS:
|
||||
@@ -13697,7 +13697,7 @@ void Player::OnGossipSelect(WorldObject* pSource, uint32 gossipListId, uint32 me
|
||||
GetSession()->SendTrainerList(guid);
|
||||
break;
|
||||
case GOSSIP_OPTION_LEARNDUALSPEC:
|
||||
if (GetSpecsCount() == 1 && !(getLevel() < sWorld.getConfig(CONFIG_MIN_DUALSPEC_LEVEL)))
|
||||
if (GetSpecsCount() == 1 && !(getLevel() < sWorld.getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL)))
|
||||
{
|
||||
if (!HasEnoughMoney(10000000))
|
||||
{
|
||||
@@ -14037,7 +14037,7 @@ bool Player::CanSeeStartQuest(Quest const *pQuest)
|
||||
SatisfyQuestPrevChain(pQuest, false) && SatisfyQuestDay(pQuest, false) && SatisfyQuestWeek(pQuest, false) &&
|
||||
!sDisableMgr.IsDisabledFor(DISABLE_TYPE_QUEST, pQuest->GetQuestId(), this))
|
||||
{
|
||||
return getLevel() + sWorld.getConfig(CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF) >= pQuest->GetMinLevel();
|
||||
return getLevel() + sWorld.getIntConfig(CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF) >= pQuest->GetMinLevel();
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -14420,7 +14420,7 @@ void Player::RewardQuest(Quest const *pQuest, uint32 reward, Object* questGiver,
|
||||
for (Unit::AuraEffectList::const_iterator i = ModXPPctAuras.begin(); i != ModXPPctAuras.end(); ++i)
|
||||
XP = uint32(XP*(1.0f + (*i)->GetAmount() / 100.0f));
|
||||
|
||||
if (getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (getLevel() < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
GiveXP(XP, NULL);
|
||||
else
|
||||
{
|
||||
@@ -15583,7 +15583,7 @@ void Player::SendQuestReward(Quest const *pQuest, uint32 XP, Object * questGiver
|
||||
WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4));
|
||||
data << uint32(questid);
|
||||
|
||||
if (getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (getLevel() < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
data << uint32(XP);
|
||||
data << uint32(pQuest->GetRewOrReqMoney());
|
||||
@@ -15992,8 +15992,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
_LoadArenaTeamInfo(holder->GetResult(PLAYER_LOGIN_QUERY_LOADARENAINFO));
|
||||
|
||||
uint32 arena_currency = fields[39].GetUInt32();
|
||||
if (arena_currency > sWorld.getConfig(CONFIG_MAX_ARENA_POINTS))
|
||||
arena_currency = sWorld.getConfig(CONFIG_MAX_ARENA_POINTS);
|
||||
if (arena_currency > sWorld.getIntConfig(CONFIG_MAX_ARENA_POINTS))
|
||||
arena_currency = sWorld.getIntConfig(CONFIG_MAX_ARENA_POINTS);
|
||||
|
||||
SetArenaPoints(arena_currency);
|
||||
|
||||
@@ -16429,7 +16429,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
// GM state
|
||||
if (GetSession()->GetSecurity() > SEC_PLAYER)
|
||||
{
|
||||
switch (sWorld.getConfig(CONFIG_GM_LOGIN_STATE))
|
||||
switch (sWorld.getIntConfig(CONFIG_GM_LOGIN_STATE))
|
||||
{
|
||||
default:
|
||||
case 0: break; // disable
|
||||
@@ -16440,7 +16440,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
break;
|
||||
}
|
||||
|
||||
switch (sWorld.getConfig(CONFIG_GM_VISIBLE_STATE))
|
||||
switch (sWorld.getIntConfig(CONFIG_GM_VISIBLE_STATE))
|
||||
{
|
||||
default:
|
||||
case 0: SetGMVisible(false); break; // invisible
|
||||
@@ -16451,7 +16451,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
break;
|
||||
}
|
||||
|
||||
/*switch(sWorld.getConfig(CONFIG_GM_ACCEPT_TICKETS))
|
||||
/*switch(sWorld.getIntConfig(CONFIG_GM_ACCEPT_TICKETS))
|
||||
{
|
||||
default:
|
||||
case 0: break; // disable
|
||||
@@ -16462,7 +16462,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
break;
|
||||
}*/
|
||||
|
||||
switch (sWorld.getConfig(CONFIG_GM_CHAT))
|
||||
switch (sWorld.getIntConfig(CONFIG_GM_CHAT))
|
||||
{
|
||||
default:
|
||||
case 0: break; // disable
|
||||
@@ -16473,7 +16473,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
break;
|
||||
}
|
||||
|
||||
switch (sWorld.getConfig(CONFIG_GM_WHISPERING_TO))
|
||||
switch (sWorld.getIntConfig(CONFIG_GM_WHISPERING_TO))
|
||||
{
|
||||
default:
|
||||
case 0: break; // disable
|
||||
@@ -17485,7 +17485,7 @@ bool Player::Satisfy(AccessRequirement const* ar, uint32 target_map, bool report
|
||||
if (!mapEntry)
|
||||
return false;
|
||||
|
||||
if (!sWorld.getConfig(CONFIG_INSTANCE_IGNORE_LEVEL))
|
||||
if (!sWorld.getBoolConfig(CONFIG_INSTANCE_IGNORE_LEVEL))
|
||||
{
|
||||
if (ar->levelMin && getLevel() < ar->levelMin)
|
||||
LevelMin = ar->levelMin;
|
||||
@@ -17620,7 +17620,7 @@ bool Player::_LoadHomeBind(QueryResult_AutoPtr result)
|
||||
void Player::SaveToDB()
|
||||
{
|
||||
// delay auto save at any saves (manual, in code, or autosave)
|
||||
m_nextSave = sWorld.getConfig(CONFIG_INTERVAL_SAVE);
|
||||
m_nextSave = sWorld.getIntConfig(CONFIG_INTERVAL_SAVE);
|
||||
|
||||
//lets allow only players in world to be saved
|
||||
if (IsBeingTeleportedFar())
|
||||
@@ -17800,7 +17800,7 @@ void Player::SaveToDB()
|
||||
|
||||
// check if stats should only be saved on logout
|
||||
// save stats can be out of transaction
|
||||
if (m_session->isLogingOut() || !sWorld.getConfig(CONFIG_STATS_SAVE_ONLY_ON_LOGOUT))
|
||||
if (m_session->isLogingOut() || !sWorld.getBoolConfig(CONFIG_STATS_SAVE_ONLY_ON_LOGOUT))
|
||||
_SaveStats(trans);
|
||||
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
@@ -18173,7 +18173,7 @@ void Player::_SaveSpells(SQLTransaction& trans)
|
||||
void Player::_SaveStats(SQLTransaction& trans)
|
||||
{
|
||||
// check if stat saving is enabled and if char level is high enough
|
||||
if (!sWorld.getConfig(CONFIG_MIN_LEVEL_STAT_SAVE) || getLevel() < sWorld.getConfig(CONFIG_MIN_LEVEL_STAT_SAVE))
|
||||
if (!sWorld.getIntConfig(CONFIG_MIN_LEVEL_STAT_SAVE) || getLevel() < sWorld.getIntConfig(CONFIG_MIN_LEVEL_STAT_SAVE))
|
||||
return;
|
||||
|
||||
trans->PAppend("DELETE FROM character_stats WHERE guid = '%u'", GetGUIDLow());
|
||||
@@ -18234,7 +18234,7 @@ void Player::UpdateSpeakTime()
|
||||
time_t current = time (NULL);
|
||||
if (m_speakTime > current)
|
||||
{
|
||||
uint32 max_count = sWorld.getConfig(CONFIG_CHATFLOOD_MESSAGE_COUNT);
|
||||
uint32 max_count = sWorld.getIntConfig(CONFIG_CHATFLOOD_MESSAGE_COUNT);
|
||||
if (!max_count)
|
||||
return;
|
||||
|
||||
@@ -18242,7 +18242,7 @@ void Player::UpdateSpeakTime()
|
||||
if (m_speakCount >= max_count)
|
||||
{
|
||||
// prevent overwrite mute time, if message send just before mutes set, for example.
|
||||
time_t new_mute = current + sWorld.getConfig(CONFIG_CHATFLOOD_MUTE_TIME);
|
||||
time_t new_mute = current + sWorld.getIntConfig(CONFIG_CHATFLOOD_MUTE_TIME);
|
||||
if (GetSession()->m_muteTime < new_mute)
|
||||
GetSession()->m_muteTime = new_mute;
|
||||
|
||||
@@ -18252,7 +18252,7 @@ void Player::UpdateSpeakTime()
|
||||
else
|
||||
m_speakCount = 0;
|
||||
|
||||
m_speakTime = current + sWorld.getConfig(CONFIG_CHATFLOOD_MESSAGE_DELAY);
|
||||
m_speakTime = current + sWorld.getIntConfig(CONFIG_CHATFLOOD_MESSAGE_DELAY);
|
||||
}
|
||||
|
||||
bool Player::CanSpeak() const
|
||||
@@ -18636,7 +18636,7 @@ void Player::Say(const std::string& text, const uint32 language)
|
||||
|
||||
WorldPacket data(SMSG_MESSAGECHAT, 200);
|
||||
BuildPlayerChat(&data, CHAT_MSG_SAY, text, language);
|
||||
SendMessageToSetInRange(&data,(float)sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY),true);
|
||||
SendMessageToSetInRange(&data,sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_SAY),true);
|
||||
}
|
||||
|
||||
void Player::Yell(const std::string& text, const uint32 language)
|
||||
@@ -18645,7 +18645,7 @@ void Player::Yell(const std::string& text, const uint32 language)
|
||||
|
||||
WorldPacket data(SMSG_MESSAGECHAT, 200);
|
||||
BuildPlayerChat(&data, CHAT_MSG_YELL, text, language);
|
||||
SendMessageToSetInRange(&data,(float)sWorld.getConfig(CONFIG_LISTEN_RANGE_YELL),true);
|
||||
SendMessageToSetInRange(&data,sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_YELL),true);
|
||||
}
|
||||
|
||||
void Player::TextEmote(const std::string& text)
|
||||
@@ -18654,7 +18654,7 @@ void Player::TextEmote(const std::string& text)
|
||||
|
||||
WorldPacket data(SMSG_MESSAGECHAT, 200);
|
||||
BuildPlayerChat(&data, CHAT_MSG_EMOTE, text, LANG_UNIVERSAL);
|
||||
SendMessageToSetInRange(&data,(float)sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),true, !sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT));
|
||||
SendMessageToSetInRange(&data,sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),true, !sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT));
|
||||
}
|
||||
|
||||
void Player::Whisper(const std::string& text, uint32 language,uint64 receiver)
|
||||
@@ -19159,7 +19159,7 @@ void Player::LeaveAllArenaTeams(uint64 guid)
|
||||
void Player::SetRestBonus (float rest_bonus_new)
|
||||
{
|
||||
// Prevent resting on max level
|
||||
if (getLevel() >= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (getLevel() >= sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
rest_bonus_new = 0;
|
||||
|
||||
if (rest_bonus_new < 0)
|
||||
@@ -19414,7 +19414,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc
|
||||
// prevent stealth flight
|
||||
//RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK);
|
||||
|
||||
if (sWorld.getConfig(CONFIG_INSTANT_TAXI))
|
||||
if (sWorld.getBoolConfig(CONFIG_INSTANT_TAXI))
|
||||
{
|
||||
TaxiNodesEntry const* lastnode = sTaxiNodesStore.LookupEntry(nodes[nodes.size()-1]);
|
||||
m_taxi.ClearTaxiDestinations();
|
||||
@@ -20284,7 +20284,7 @@ void Player::LeaveBattleground(bool teleportToEntryPoint)
|
||||
bg->RemovePlayerAtLeave(GetGUID(), teleportToEntryPoint, true);
|
||||
|
||||
// call after remove to be sure that player resurrected for correct cast
|
||||
if (bg->isBattleground() && !isGameMaster() && sWorld.getConfig(CONFIG_BATTLEGROUND_CAST_DESERTER))
|
||||
if (bg->isBattleground() && !isGameMaster() && sWorld.getBoolConfig(CONFIG_BATTLEGROUND_CAST_DESERTER))
|
||||
{
|
||||
if (bg->GetStatus() == STATUS_IN_PROGRESS || bg->GetStatus() == STATUS_WAIT_JOIN)
|
||||
{
|
||||
@@ -20720,7 +20720,7 @@ void Player::UpdateVisibilityForPlayer()
|
||||
|
||||
void Player::InitPrimaryProfessions()
|
||||
{
|
||||
SetFreePrimaryProfessions(sWorld.getConfig(CONFIG_MAX_PRIMARY_TRADE_SKILL));
|
||||
SetFreePrimaryProfessions(sWorld.getIntConfig(CONFIG_MAX_PRIMARY_TRADE_SKILL));
|
||||
}
|
||||
|
||||
void Player::ModifyMoney(int32 d)
|
||||
@@ -21724,7 +21724,7 @@ bool Player::isHonorOrXPTarget(Unit* pVictim)
|
||||
bool Player::GetsRecruitAFriendBonus(bool forXP)
|
||||
{
|
||||
bool recruitAFriend = false;
|
||||
if (getLevel() <= sWorld.getConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL) || !forXP)
|
||||
if (getLevel() <= sWorld.getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL) || !forXP)
|
||||
{
|
||||
if (Group *group = this->GetGroup())
|
||||
{
|
||||
@@ -21740,12 +21740,12 @@ bool Player::GetsRecruitAFriendBonus(bool forXP)
|
||||
if (forXP)
|
||||
{
|
||||
// level must be allowed to get RaF bonus
|
||||
if (pGroupGuy->getLevel() > sWorld.getConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL))
|
||||
if (pGroupGuy->getLevel() > sWorld.getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL))
|
||||
continue;
|
||||
|
||||
// level difference must be small enough to get RaF bonus, UNLESS we are lower level
|
||||
if (pGroupGuy->getLevel() < getLevel())
|
||||
if (uint8(getLevel() - pGroupGuy->getLevel()) > sWorld.getConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE))
|
||||
if (uint8(getLevel() - pGroupGuy->getLevel()) > sWorld.getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE))
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -21908,7 +21908,7 @@ bool Player::IsAtGroupRewardDistance(WorldObject const* pRewardSource) const
|
||||
if (player->GetMapId() != pRewardSource->GetMapId() || player->GetInstanceId() != pRewardSource->GetInstanceId())
|
||||
return false;
|
||||
|
||||
return pRewardSource->GetDistance(player) <= sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE);
|
||||
return pRewardSource->GetDistance(player) <= sWorld.getFloatConfig(CONFIG_GROUP_XP_DISTANCE);
|
||||
}
|
||||
|
||||
bool Player::IsAtRecruitAFriendDistance(WorldObject const* pOther) const
|
||||
@@ -21922,7 +21922,7 @@ bool Player::IsAtRecruitAFriendDistance(WorldObject const* pOther) const
|
||||
if (player->GetMapId() != pOther->GetMapId() || player->GetInstanceId() != pOther->GetInstanceId())
|
||||
return false;
|
||||
|
||||
return pOther->GetDistance(player) <= sWorld.getConfig(CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE);
|
||||
return pOther->GetDistance(player) <= sWorld.getFloatConfig(CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE);
|
||||
}
|
||||
|
||||
uint32 Player::GetBaseWeaponSkillValue (WeaponAttackType attType) const
|
||||
@@ -22027,10 +22027,10 @@ uint32 Player::GetCorpseReclaimDelay(bool pvp) const
|
||||
{
|
||||
if (pvp)
|
||||
{
|
||||
if (!sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP))
|
||||
if (!sWorld.getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP))
|
||||
return copseReclaimDelay[0];
|
||||
}
|
||||
else if (!sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE))
|
||||
else if (!sWorld.getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE))
|
||||
return 0;
|
||||
|
||||
time_t now = time(NULL);
|
||||
@@ -22044,8 +22044,8 @@ void Player::UpdateCorpseReclaimDelay()
|
||||
{
|
||||
bool pvp = m_ExtraFlags & PLAYER_EXTRA_PVP_DEATH;
|
||||
|
||||
if ((pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP)) ||
|
||||
(!pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE)))
|
||||
if ((pvp && !sWorld.getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP)) ||
|
||||
(!pvp && !sWorld.getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE)))
|
||||
return;
|
||||
|
||||
time_t now = time(NULL);
|
||||
@@ -22081,8 +22081,8 @@ void Player::SendCorpseReclaimDelay(bool load)
|
||||
return;
|
||||
|
||||
uint32 count;
|
||||
if ((pvp && sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP)) ||
|
||||
(!pvp && sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE)))
|
||||
if ((pvp && sWorld.getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP)) ||
|
||||
(!pvp && sWorld.getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE)))
|
||||
{
|
||||
count = (m_deathExpireTime-corpse->GetGhostTime())/DEATH_EXPIRE_STEP;
|
||||
if (count >= MAX_DEATH_COUNT)
|
||||
@@ -22824,7 +22824,7 @@ void Player::_LoadSkills(QueryResult_AutoPtr result)
|
||||
// special settings
|
||||
if (getClass() == CLASS_DEATH_KNIGHT)
|
||||
{
|
||||
uint8 base_level = std::min(getLevel(),uint8(sWorld.getConfig(CONFIG_START_HEROIC_PLAYER_LEVEL)));
|
||||
uint8 base_level = std::min(getLevel(),uint8(sWorld.getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL)));
|
||||
if (base_level < 1)
|
||||
base_level = 1;
|
||||
uint16 base_skill = (base_level-1)*5; // 270 at starting level 55
|
||||
|
||||
@@ -190,8 +190,8 @@ void SocialMgr::GetFriendInfo(Player *player, uint32 friendGUID, FriendInfo &fri
|
||||
|
||||
uint32 team = player->GetTeam();
|
||||
AccountTypes security = player->GetSession()->GetSecurity();
|
||||
bool allowTwoSideWhoList = sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST);
|
||||
AccountTypes gmLevelInWhoList = AccountTypes (sWorld.getConfig(CONFIG_GM_LEVEL_IN_WHO_LIST));
|
||||
bool allowTwoSideWhoList = sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST);
|
||||
AccountTypes gmLevelInWhoList = AccountTypes (sWorld.getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST));
|
||||
|
||||
PlayerSocialMap::iterator itr = player->GetSocial()->m_playerSocialMap.find(friendGUID);
|
||||
if (itr != player->GetSocial()->m_playerSocialMap.end())
|
||||
@@ -266,8 +266,8 @@ void SocialMgr::BroadcastToFriendListers(Player *player, WorldPacket *packet)
|
||||
uint32 team = player->GetTeam();
|
||||
AccountTypes security = player->GetSession()->GetSecurity();
|
||||
uint32 guid = player->GetGUIDLow();
|
||||
AccountTypes gmLevelInWhoList = AccountTypes(sWorld.getConfig(CONFIG_GM_LEVEL_IN_WHO_LIST));
|
||||
bool allowTwoSideWhoList = sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST);
|
||||
AccountTypes gmLevelInWhoList = AccountTypes(sWorld.getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST));
|
||||
bool allowTwoSideWhoList = sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST);
|
||||
|
||||
for (SocialMap::const_iterator itr = m_socialMap.begin(); itr != m_socialMap.end(); ++itr)
|
||||
{
|
||||
|
||||
@@ -826,7 +826,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
||||
if (spell->getState() == SPELL_STATE_CASTING)
|
||||
{
|
||||
uint32 channelInterruptFlags = spell->m_spellInfo->ChannelInterruptFlags;
|
||||
if (channelInterruptFlags & CHANNEL_FLAG_DELAY != 0 && damagetype != DOT)
|
||||
if (((channelInterruptFlags & CHANNEL_FLAG_DELAY) != 0) && (damagetype != DOT))
|
||||
spell->DelayedChannel();
|
||||
}
|
||||
}
|
||||
@@ -15163,7 +15163,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss)
|
||||
pVictim->ToPlayer()->SetPvPDeath(player != NULL);
|
||||
|
||||
// only if not player and not controlled by player pet. And not at BG
|
||||
if ((durabilityLoss && !player && !pVictim->ToPlayer()->InBattleground()) || (player && sWorld.getConfig(CONFIG_DURABILITY_LOSS_IN_PVP)))
|
||||
if ((durabilityLoss && !player && !pVictim->ToPlayer()->InBattleground()) || (player && sWorld.getBoolConfig(CONFIG_DURABILITY_LOSS_IN_PVP)))
|
||||
{
|
||||
sLog.outStaticDebug("We are dead, losing %u percent durability", sWorld.getRate(RATE_DURABILITY_LOSS_ON_DEATH));
|
||||
pVictim->ToPlayer()->DurabilityLossAll(sWorld.getRate(RATE_DURABILITY_LOSS_ON_DEATH),false);
|
||||
@@ -15411,7 +15411,7 @@ void Unit::SetFeared(bool apply)
|
||||
caster = ObjectAccessor::GetUnit(*this, fearAuras.front()->GetCasterGUID());
|
||||
if (!caster)
|
||||
caster = getAttackerForHelper();
|
||||
GetMotionMaster()->MoveFleeing(caster, fearAuras.empty() ? sWorld.getConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY) : 0); // caster == NULL processed in MoveFleeing
|
||||
GetMotionMaster()->MoveFleeing(caster, fearAuras.empty() ? sWorld.getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY) : 0); // caster == NULL processed in MoveFleeing
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1068,11 +1068,11 @@ uint32 GameEventMgr::Initialize() // return the next e
|
||||
|
||||
void GameEventMgr::StartArenaSeason()
|
||||
{
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT event FROM season_linked_event WHERE season = '%i'",sWorld.getConfig(CONFIG_ARENA_SEASON_ID));
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT event FROM season_linked_event WHERE season = '%i'",sWorld.getIntConfig(CONFIG_ARENA_SEASON_ID));
|
||||
|
||||
if (!result)
|
||||
{
|
||||
sLog.outError("ArenaSeason (%i) must be an existant Arena Season",sWorld.getConfig(CONFIG_ARENA_SEASON_ID));
|
||||
sLog.outError("ArenaSeason (%i) must be an existant Arena Season",sWorld.getIntConfig(CONFIG_ARENA_SEASON_ID));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1081,7 +1081,7 @@ void GameEventMgr::StartArenaSeason()
|
||||
uint16 eventId = fields[0].GetUInt16();
|
||||
|
||||
StartEvent(eventId,true);
|
||||
sLog.outString("Arena Season %i started...",sWorld.getConfig(CONFIG_ARENA_SEASON_ID));
|
||||
sLog.outString("Arena Season %i started...",sWorld.getIntConfig(CONFIG_ARENA_SEASON_ID));
|
||||
}
|
||||
|
||||
uint32 GameEventMgr::Update() // return the next event delay in ms
|
||||
@@ -1177,7 +1177,7 @@ void GameEventMgr::UnApplyEvent(uint16 event_id)
|
||||
|
||||
void GameEventMgr::ApplyNewEvent(uint16 event_id)
|
||||
{
|
||||
switch(sWorld.getConfig(CONFIG_EVENT_ANNOUNCE))
|
||||
switch(sWorld.getIntConfig(CONFIG_EVENT_ANNOUNCE))
|
||||
{
|
||||
case 0: // disable
|
||||
break;
|
||||
|
||||
@@ -308,7 +308,7 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool /*insign
|
||||
// create the bones only if the map and the grid is loaded at the corpse's location
|
||||
// ignore bones creating option in case insignia
|
||||
if (map && (insignia ||
|
||||
(map->IsBattlegroundOrArena() ? sWorld.getConfig(CONFIG_DEATH_BONES_BG_OR_ARENA) : sWorld.getConfig(CONFIG_DEATH_BONES_WORLD))) &&
|
||||
(map->IsBattlegroundOrArena() ? sWorld.getIntConfig(CONFIG_DEATH_BONES_BG_OR_ARENA) : sWorld.getIntConfig(CONFIG_DEATH_BONES_WORLD))) &&
|
||||
!map->IsRemovalGrid(corpse->GetPositionX(), corpse->GetPositionY()))
|
||||
{
|
||||
// Create bones, don't change Corpse
|
||||
|
||||
@@ -2698,7 +2698,7 @@ void ObjectMgr::LoadPetLevelInfo()
|
||||
}
|
||||
|
||||
uint32 current_level = fields[1].GetUInt32();
|
||||
if (current_level > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (current_level > sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
if (current_level > STRONG_MAX_LEVEL) // hardcoded level maximum
|
||||
sLog.outErrorDb("Wrong (> %u) level %u in `pet_levelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level);
|
||||
@@ -2718,7 +2718,7 @@ void ObjectMgr::LoadPetLevelInfo()
|
||||
PetLevelInfo*& pInfoMapEntry = petInfo[creature_id];
|
||||
|
||||
if (pInfoMapEntry == NULL)
|
||||
pInfoMapEntry = new PetLevelInfo[sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)];
|
||||
pInfoMapEntry = new PetLevelInfo[sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)];
|
||||
|
||||
// data for level 1 stored in [0] array element, ...
|
||||
PetLevelInfo* pLevelInfo = &pInfoMapEntry[current_level-1];
|
||||
@@ -2754,7 +2754,7 @@ void ObjectMgr::LoadPetLevelInfo()
|
||||
}
|
||||
|
||||
// fill level gaps
|
||||
for (uint8 level = 1; level < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL); ++level)
|
||||
for (uint8 level = 1; level < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL); ++level)
|
||||
{
|
||||
if (pInfo[level].health == 0)
|
||||
{
|
||||
@@ -2767,8 +2767,8 @@ void ObjectMgr::LoadPetLevelInfo()
|
||||
|
||||
PetLevelInfo const* ObjectMgr::GetPetLevelInfo(uint32 creature_id, uint8 level) const
|
||||
{
|
||||
if (level > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
level = sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL);
|
||||
if (level > sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
level = sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL);
|
||||
|
||||
PetLevelInfoMap::const_iterator itr = petInfo.find(creature_id);
|
||||
if (itr == petInfo.end())
|
||||
@@ -2994,7 +2994,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
{
|
||||
|
||||
QueryResult_AutoPtr result = QueryResult_AutoPtr(NULL);
|
||||
if (sWorld.getConfig(CONFIG_START_ALL_SPELLS))
|
||||
if (sWorld.getBoolConfig(CONFIG_START_ALL_SPELLS))
|
||||
result = WorldDatabase.Query("SELECT race, class, Spell, Active FROM playercreateinfo_spell_custom");
|
||||
else
|
||||
result = WorldDatabase.Query("SELECT race, class, Spell FROM playercreateinfo_spell");
|
||||
@@ -3137,7 +3137,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
}
|
||||
|
||||
uint8 current_level = fields[1].GetUInt8();
|
||||
if (current_level > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (current_level > sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
if (current_level > STRONG_MAX_LEVEL) // hardcoded level maximum
|
||||
sLog.outErrorDb("Wrong (> %u) level %u in `player_classlevelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level);
|
||||
@@ -3152,7 +3152,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
PlayerClassInfo* pClassInfo = &playerClassInfo[current_class];
|
||||
|
||||
if (!pClassInfo->levelInfo)
|
||||
pClassInfo->levelInfo = new PlayerClassLevelInfo[sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)];
|
||||
pClassInfo->levelInfo = new PlayerClassLevelInfo[sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)];
|
||||
|
||||
PlayerClassLevelInfo* pClassLevelInfo = &pClassInfo->levelInfo[current_level-1];
|
||||
|
||||
@@ -3185,7 +3185,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
}
|
||||
|
||||
// fill level gaps
|
||||
for (uint8 level = 1; level < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL); ++level)
|
||||
for (uint8 level = 1; level < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL); ++level)
|
||||
{
|
||||
if (pClassInfo->levelInfo[level].basehealth == 0)
|
||||
{
|
||||
@@ -3234,7 +3234,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
}
|
||||
|
||||
uint32 current_level = fields[2].GetUInt32();
|
||||
if (current_level > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (current_level > sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
if (current_level > STRONG_MAX_LEVEL) // hardcoded level maximum
|
||||
sLog.outErrorDb("Wrong (> %u) level %u in `player_levelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level);
|
||||
@@ -3249,7 +3249,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
PlayerInfo* pInfo = &playerInfo[current_race][current_class];
|
||||
|
||||
if (!pInfo->levelInfo)
|
||||
pInfo->levelInfo = new PlayerLevelInfo[sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)];
|
||||
pInfo->levelInfo = new PlayerLevelInfo[sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)];
|
||||
|
||||
PlayerLevelInfo* pLevelInfo = &pInfo->levelInfo[current_level-1];
|
||||
|
||||
@@ -3287,11 +3287,11 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
continue;
|
||||
|
||||
// skip expansion races if not playing with expansion
|
||||
if (sWorld.getConfig(CONFIG_EXPANSION) < 1 && (race == RACE_BLOODELF || race == RACE_DRAENEI))
|
||||
if (sWorld.getIntConfig(CONFIG_EXPANSION) < 1 && (race == RACE_BLOODELF || race == RACE_DRAENEI))
|
||||
continue;
|
||||
|
||||
// skip expansion classes if not playing with expansion
|
||||
if (sWorld.getConfig(CONFIG_EXPANSION) < 2 && class_ == CLASS_DEATH_KNIGHT)
|
||||
if (sWorld.getIntConfig(CONFIG_EXPANSION) < 2 && class_ == CLASS_DEATH_KNIGHT)
|
||||
continue;
|
||||
|
||||
// fatal error if no level 1 data
|
||||
@@ -3302,7 +3302,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
}
|
||||
|
||||
// fill level gaps
|
||||
for (uint8 level = 1; level < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL); ++level)
|
||||
for (uint8 level = 1; level < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL); ++level)
|
||||
{
|
||||
if (pInfo->levelInfo[level].stats[0] == 0)
|
||||
{
|
||||
@@ -3316,8 +3316,8 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
// Loading xp per level data
|
||||
sLog.outString("Loading Player Create XP Data...");
|
||||
{
|
||||
mPlayerXPperLevel.resize(sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL));
|
||||
for (uint8 level = 0; level < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL); ++level)
|
||||
mPlayerXPperLevel.resize(sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL));
|
||||
for (uint8 level = 0; level < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL); ++level)
|
||||
mPlayerXPperLevel[level] = 0;
|
||||
|
||||
// 0 1
|
||||
@@ -3344,7 +3344,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
uint32 current_level = fields[0].GetUInt32();
|
||||
uint32 current_xp = fields[1].GetUInt32();
|
||||
|
||||
if (current_level >= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (current_level >= sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
if (current_level > STRONG_MAX_LEVEL) // hardcoded level maximum
|
||||
sLog.outErrorDb("Wrong (> %u) level %u in `player_xp_for_level` table, ignoring.", STRONG_MAX_LEVEL,current_level);
|
||||
@@ -3367,7 +3367,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
}
|
||||
|
||||
// fill level gaps
|
||||
for (uint8 level = 1; level < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL); ++level)
|
||||
for (uint8 level = 1; level < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL); ++level)
|
||||
{
|
||||
if (mPlayerXPperLevel[level] == 0)
|
||||
{
|
||||
@@ -3384,8 +3384,8 @@ void ObjectMgr::GetPlayerClassLevelInfo(uint32 class_, uint8 level, PlayerClassL
|
||||
|
||||
PlayerClassInfo const* pInfo = &playerClassInfo[class_];
|
||||
|
||||
if (level > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
level = sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL);
|
||||
if (level > sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
level = sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL);
|
||||
|
||||
*info = pInfo->levelInfo[level-1];
|
||||
}
|
||||
@@ -3399,7 +3399,7 @@ void ObjectMgr::GetPlayerLevelInfo(uint32 race, uint32 class_, uint8 level, Play
|
||||
if (pInfo->displayId_m == 0 || pInfo->displayId_f == 0)
|
||||
return;
|
||||
|
||||
if (level <= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (level <= sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
*info = pInfo->levelInfo[level-1];
|
||||
else
|
||||
BuildPlayerLevelInfo(race,class_,level,info);
|
||||
@@ -3408,10 +3408,10 @@ void ObjectMgr::GetPlayerLevelInfo(uint32 race, uint32 class_, uint8 level, Play
|
||||
void ObjectMgr::BuildPlayerLevelInfo(uint8 race, uint8 _class, uint8 level, PlayerLevelInfo* info) const
|
||||
{
|
||||
// base data (last known level)
|
||||
*info = playerInfo[race][_class].levelInfo[sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)-1];
|
||||
*info = playerInfo[race][_class].levelInfo[sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)-1];
|
||||
|
||||
// if conversion from uint32 to uint8 causes unexpected behaviour, change lvl to uint32
|
||||
for (uint8 lvl = sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)-1; lvl < level; ++lvl)
|
||||
for (uint8 lvl = sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)-1; lvl < level; ++lvl)
|
||||
{
|
||||
switch(_class)
|
||||
{
|
||||
@@ -3553,8 +3553,8 @@ void ObjectMgr::LoadGuilds()
|
||||
|
||||
//delete unused LogGuid records in guild_eventlog and guild_bank_eventlog table
|
||||
//you can comment these lines if you don't plan to change CONFIG_GUILD_EVENT_LOG_COUNT and CONFIG_GUILD_BANK_EVENT_LOG_COUNT
|
||||
CharacterDatabase.PQuery("DELETE FROM guild_eventlog WHERE LogGuid > '%u'", sWorld.getConfig(CONFIG_GUILD_EVENT_LOG_COUNT));
|
||||
CharacterDatabase.PQuery("DELETE FROM guild_bank_eventlog WHERE LogGuid > '%u'", sWorld.getConfig(CONFIG_GUILD_BANK_EVENT_LOG_COUNT));
|
||||
CharacterDatabase.PQuery("DELETE FROM guild_eventlog WHERE LogGuid > '%u'", sWorld.getIntConfig(CONFIG_GUILD_EVENT_LOG_COUNT));
|
||||
CharacterDatabase.PQuery("DELETE FROM guild_bank_eventlog WHERE LogGuid > '%u'", sWorld.getIntConfig(CONFIG_GUILD_BANK_EVENT_LOG_COUNT));
|
||||
|
||||
sLog.outString();
|
||||
sLog.outString(">> Loaded %u guild definitions", count);
|
||||
@@ -7622,7 +7622,7 @@ enum LanguageType
|
||||
|
||||
static LanguageType GetRealmLanguageType(bool create)
|
||||
{
|
||||
switch(sWorld.getConfig(CONFIG_REALM_ZONE))
|
||||
switch(sWorld.getIntConfig(CONFIG_REALM_ZONE))
|
||||
{
|
||||
case REALM_ZONE_UNKNOWN: // any language
|
||||
case REALM_ZONE_DEVELOPMENT:
|
||||
@@ -7693,11 +7693,11 @@ uint8 ObjectMgr::CheckPlayerName(const std::string& name, bool create)
|
||||
if (wname.size() > MAX_PLAYER_NAME)
|
||||
return CHAR_NAME_TOO_LONG;
|
||||
|
||||
uint32 minName = sWorld.getConfig(CONFIG_MIN_PLAYER_NAME);
|
||||
uint32 minName = sWorld.getIntConfig(CONFIG_MIN_PLAYER_NAME);
|
||||
if (wname.size() < minName)
|
||||
return CHAR_NAME_TOO_SHORT;
|
||||
|
||||
uint32 strictMask = sWorld.getConfig(CONFIG_STRICT_PLAYER_NAMES);
|
||||
uint32 strictMask = sWorld.getIntConfig(CONFIG_STRICT_PLAYER_NAMES);
|
||||
if (!isValidString(wname,strictMask,false,create))
|
||||
return CHAR_NAME_MIXED_LANGUAGES;
|
||||
|
||||
@@ -7713,11 +7713,11 @@ bool ObjectMgr::IsValidCharterName(const std::string& name)
|
||||
if (wname.size() > MAX_CHARTER_NAME)
|
||||
return false;
|
||||
|
||||
uint32 minName = sWorld.getConfig(CONFIG_MIN_CHARTER_NAME);
|
||||
uint32 minName = sWorld.getIntConfig(CONFIG_MIN_CHARTER_NAME);
|
||||
if (wname.size() < minName)
|
||||
return false;
|
||||
|
||||
uint32 strictMask = sWorld.getConfig(CONFIG_STRICT_CHARTER_NAMES);
|
||||
uint32 strictMask = sWorld.getIntConfig(CONFIG_STRICT_CHARTER_NAMES);
|
||||
|
||||
return isValidString(wname,strictMask,true);
|
||||
}
|
||||
@@ -7731,11 +7731,11 @@ PetNameInvalidReason ObjectMgr::CheckPetName(const std::string& name)
|
||||
if (wname.size() > MAX_PET_NAME)
|
||||
return PET_NAME_TOO_LONG;
|
||||
|
||||
uint32 minName = sWorld.getConfig(CONFIG_MIN_PET_NAME);
|
||||
uint32 minName = sWorld.getIntConfig(CONFIG_MIN_PET_NAME);
|
||||
if (wname.size() < minName)
|
||||
return PET_NAME_TOO_SHORT;
|
||||
|
||||
uint32 strictMask = sWorld.getConfig(CONFIG_STRICT_PET_NAMES);
|
||||
uint32 strictMask = sWorld.getIntConfig(CONFIG_STRICT_PET_NAMES);
|
||||
if (!isValidString(wname,strictMask,false))
|
||||
return PET_NAME_MIXED_LANGUAGES;
|
||||
|
||||
|
||||
@@ -264,7 +264,7 @@ ObjectGridUnloader::Visit(GridRefManager<T> &m)
|
||||
{
|
||||
T *obj = m.getFirst()->getSource();
|
||||
// if option set then object already saved at this moment
|
||||
if (!sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY))
|
||||
if (!sWorld.getBoolConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY))
|
||||
obj->SaveRespawnTime();
|
||||
///- object will get delinked from the manager when deleted
|
||||
delete obj;
|
||||
|
||||
@@ -653,7 +653,7 @@ void Group::GroupLoot(Loot *loot, WorldObject* pLootedObject)
|
||||
continue;
|
||||
if (i->AllowedForPlayer(member))
|
||||
{
|
||||
if (member->IsWithinDistInMap(pLootedObject,(float)sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
if (member->IsWithinDistInMap(pLootedObject,sWorld.getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
{
|
||||
r->totalPlayersRolling++;
|
||||
|
||||
@@ -744,7 +744,7 @@ void Group::NeedBeforeGreed(Loot *loot, WorldObject* pLootedObject)
|
||||
|
||||
if (playerToRoll->CanUseItem(item) == EQUIP_ERR_OK && i->AllowedForPlayer(playerToRoll))
|
||||
{
|
||||
if (playerToRoll->IsWithinDistInMap(pLootedObject,(float)sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
if (playerToRoll->IsWithinDistInMap(pLootedObject,sWorld.getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
{
|
||||
r->totalPlayersRolling++;
|
||||
|
||||
@@ -823,7 +823,7 @@ void Group::MasterLoot(Loot* /*loot*/, WorldObject* pLootedObject)
|
||||
if (!looter->IsInWorld())
|
||||
continue;
|
||||
|
||||
if (looter->IsWithinDistInMap(pLootedObject,(float)sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
if (looter->IsWithinDistInMap(pLootedObject,sWorld.getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
{
|
||||
data << uint64(looter->GetGUID());
|
||||
++real_count;
|
||||
@@ -835,7 +835,7 @@ void Group::MasterLoot(Loot* /*loot*/, WorldObject* pLootedObject)
|
||||
for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player *looter = itr->getSource();
|
||||
if (looter->IsWithinDistInMap(pLootedObject,(float)sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
if (looter->IsWithinDistInMap(pLootedObject,sWorld.getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
looter->GetSession()->SendPacket(&data);
|
||||
}
|
||||
}
|
||||
@@ -1545,7 +1545,7 @@ void Group::UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed)
|
||||
{
|
||||
// not update if only update if need and ok
|
||||
Player* looter = ObjectAccessor::FindPlayer(guid_itr->guid);
|
||||
if (looter && looter->IsWithinDistInMap(pLootedObject,(float)sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
if (looter && looter->IsWithinDistInMap(pLootedObject,sWorld.getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
return;
|
||||
}
|
||||
++guid_itr;
|
||||
@@ -1556,7 +1556,7 @@ void Group::UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed)
|
||||
for (member_citerator itr = guid_itr; itr != m_memberSlots.end(); ++itr)
|
||||
{
|
||||
if (Player* pl = ObjectAccessor::FindPlayer(itr->guid))
|
||||
if (pl->IsWithinDistInMap(pLootedObject,(float)sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
if (pl->IsWithinDistInMap(pLootedObject,sWorld.getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
{
|
||||
pNewLooter = pl;
|
||||
break;
|
||||
@@ -1569,7 +1569,7 @@ void Group::UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed)
|
||||
for (member_citerator itr = m_memberSlots.begin(); itr != guid_itr; ++itr)
|
||||
{
|
||||
if (Player* pl = ObjectAccessor::FindPlayer(itr->guid))
|
||||
if (pl->IsWithinDistInMap(pLootedObject,(float)sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
if (pl->IsWithinDistInMap(pLootedObject,sWorld.getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
{
|
||||
pNewLooter = pl;
|
||||
break;
|
||||
|
||||
@@ -880,7 +880,7 @@ void Guild::LoadGuildEventLogFromDB()
|
||||
if (!result)
|
||||
return;
|
||||
bool isNextLogGuidSet = false;
|
||||
//uint32 configCount = sWorld.getConfig(CONFIG_GUILD_EVENT_LOG_COUNT);
|
||||
//uint32 configCount = sWorld.getIntConfig(CONFIG_GUILD_EVENT_LOG_COUNT);
|
||||
// First event in list will be the oldest and the latest event is last event in list
|
||||
do
|
||||
{
|
||||
@@ -919,7 +919,7 @@ void Guild::LogGuildEvent(uint8 EventType, uint32 PlayerGuid1, uint32 PlayerGuid
|
||||
NewEvent.NewRank = NewRank;
|
||||
NewEvent.TimeStamp = uint32(time(NULL));
|
||||
// Count new LogGuid
|
||||
m_GuildEventLogNextGuid = (m_GuildEventLogNextGuid + 1) % sWorld.getConfig(CONFIG_GUILD_EVENT_LOG_COUNT);
|
||||
m_GuildEventLogNextGuid = (m_GuildEventLogNextGuid + 1) % sWorld.getIntConfig(CONFIG_GUILD_EVENT_LOG_COUNT);
|
||||
// Check max records limit
|
||||
if (m_GuildEventLog.size() >= GUILD_EVENTLOG_MAX_RECORDS)
|
||||
m_GuildEventLog.pop_front();
|
||||
@@ -1432,7 +1432,7 @@ void Guild::LoadGuildBankEventLogFromDB()
|
||||
{
|
||||
// Money log is in TabId = GUILD_BANK_MONEY_LOGS_TAB
|
||||
|
||||
//uint32 configCount = sWorld.getConfig(CONFIG_GUILD_BANK_EVENT_LOG_COUNT);
|
||||
//uint32 configCount = sWorld.getIntConfig(CONFIG_GUILD_BANK_EVENT_LOG_COUNT);
|
||||
//cycle through all purchased guild bank item tabs
|
||||
for (uint32 tabId = 0; tabId < uint32(GetPurchasedTabs()); ++tabId)
|
||||
{
|
||||
@@ -1569,7 +1569,7 @@ void Guild::LogBankEvent(SQLTransaction& trans, uint8 EventType, uint8 TabId, ui
|
||||
uint32 currentLogGuid = 0;
|
||||
if (NewEvent.isMoneyEvent())
|
||||
{
|
||||
m_GuildBankEventLogNextGuid_Money = (m_GuildBankEventLogNextGuid_Money + 1) % sWorld.getConfig(CONFIG_GUILD_BANK_EVENT_LOG_COUNT);
|
||||
m_GuildBankEventLogNextGuid_Money = (m_GuildBankEventLogNextGuid_Money + 1) % sWorld.getIntConfig(CONFIG_GUILD_BANK_EVENT_LOG_COUNT);
|
||||
currentLogGuid = m_GuildBankEventLogNextGuid_Money;
|
||||
currentTabId = GUILD_BANK_MONEY_LOGS_TAB;
|
||||
if (m_GuildBankEventLog_Money.size() >= GUILD_BANK_MAX_LOGS)
|
||||
@@ -1579,7 +1579,7 @@ void Guild::LogBankEvent(SQLTransaction& trans, uint8 EventType, uint8 TabId, ui
|
||||
}
|
||||
else
|
||||
{
|
||||
m_GuildBankEventLogNextGuid_Item[TabId] = ((m_GuildBankEventLogNextGuid_Item[TabId]) + 1) % sWorld.getConfig(CONFIG_GUILD_BANK_EVENT_LOG_COUNT);
|
||||
m_GuildBankEventLogNextGuid_Item[TabId] = ((m_GuildBankEventLogNextGuid_Item[TabId]) + 1) % sWorld.getIntConfig(CONFIG_GUILD_BANK_EVENT_LOG_COUNT);
|
||||
currentLogGuid = m_GuildBankEventLogNextGuid_Item[TabId];
|
||||
if (m_GuildBankEventLog_Item[TabId].size() >= GUILD_BANK_MAX_LOGS)
|
||||
m_GuildBankEventLog_Item[TabId].pop_front();
|
||||
@@ -2138,7 +2138,7 @@ void Guild::MoveFromBankToChar(Player * pl, uint8 BankTab, uint8 BankTabSlot, ui
|
||||
if (pItemChar)
|
||||
{
|
||||
// logging item move to bank
|
||||
if (pl->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE))
|
||||
if (pl->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||
{
|
||||
sLog.outCommand(pl->GetSession()->GetAccountId(), "GM %s (Account: %u) deposit item: %s (Entry: %d Count: %u) to guild bank (Guild ID: %u)",
|
||||
pl->GetName(), pl->GetSession()->GetAccountId(),
|
||||
@@ -2212,7 +2212,7 @@ void Guild::MoveFromCharToBank(Player * pl, uint8 PlayerBag, uint8 PlayerSlot, u
|
||||
}
|
||||
|
||||
// logging item move to bank (before items merge
|
||||
if (pl->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE))
|
||||
if (pl->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||
{
|
||||
sLog.outCommand(pl->GetSession()->GetAccountId(), "GM %s (Account: %u) deposit item: %s (Entry: %d Count: %u) to guild bank (Guild ID: %u)",
|
||||
pl->GetName(), pl->GetSession()->GetAccountId(),
|
||||
@@ -2238,7 +2238,7 @@ void Guild::MoveFromCharToBank(Player * pl, uint8 PlayerBag, uint8 PlayerSlot, u
|
||||
if (msg == EQUIP_ERR_OK) // merge
|
||||
{
|
||||
// logging item move to bank
|
||||
if (pl->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE))
|
||||
if (pl->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||
{
|
||||
sLog.outCommand(pl->GetSession()->GetAccountId(), "GM %s (Account: %u) deposit item: %s (Entry: %d Count: %u) to guild bank (Guild ID: %u)",
|
||||
pl->GetName(), pl->GetSession()->GetAccountId(),
|
||||
@@ -2288,7 +2288,7 @@ void Guild::MoveFromCharToBank(Player * pl, uint8 PlayerBag, uint8 PlayerSlot, u
|
||||
}
|
||||
|
||||
// logging item move to bank
|
||||
if (pl->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE))
|
||||
if (pl->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||
{
|
||||
sLog.outCommand(pl->GetSession()->GetAccountId(), "GM %s (Account: %u) deposit item: %s (Entry: %d Count: %u) to guild bank (Guild ID: %u)",
|
||||
pl->GetName(), pl->GetSession()->GetAccountId(),
|
||||
|
||||
@@ -447,7 +447,7 @@ void InstanceSaveManager::LoadResetTimes()
|
||||
}
|
||||
|
||||
// load the global respawn times for raid/heroic instances
|
||||
uint32 diff = sWorld.getConfig(CONFIG_INSTANCE_RESET_TIME_HOUR) * HOUR;
|
||||
uint32 diff = sWorld.getIntConfig(CONFIG_INSTANCE_RESET_TIME_HOUR) * HOUR;
|
||||
result = CharacterDatabase.Query("SELECT mapid, difficulty, resettime FROM instance_reset");
|
||||
if (result)
|
||||
{
|
||||
@@ -655,7 +655,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
|
||||
// calculate the next reset time
|
||||
uint32 diff = sWorld.getConfig(CONFIG_INSTANCE_RESET_TIME_HOUR) * HOUR;
|
||||
uint32 diff = sWorld.getIntConfig(CONFIG_INSTANCE_RESET_TIME_HOUR) * HOUR;
|
||||
|
||||
uint32 period = uint32(((mapDiff->resetTime * sWorld.getRate(RATE_INSTANCE_RESET_TIME))/DAY) * DAY);
|
||||
if (period < DAY)
|
||||
|
||||
@@ -176,7 +176,7 @@ class InstanceScript : public ZoneScript
|
||||
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell);
|
||||
|
||||
// Return wether server allow two side groups or not
|
||||
bool ServerAllowsTwoSideGroups() { return sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP); }
|
||||
bool ServerAllowsTwoSideGroups() { return sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP); }
|
||||
|
||||
virtual bool SetBossState(uint32 id, EncounterState state);
|
||||
EncounterState GetBossState(uint32 id) const { return id < bosses.size() ? bosses[id].state : TO_BE_DECIDED; }
|
||||
|
||||
@@ -92,9 +92,9 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data)
|
||||
|
||||
Player* pl = _player;
|
||||
|
||||
if (pl->getLevel() < sWorld.getConfig(CONFIG_MAIL_LEVEL_REQ))
|
||||
if (pl->getLevel() < sWorld.getIntConfig(CONFIG_MAIL_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetTrinityString(LANG_MAIL_SENDER_REQ), sWorld.getConfig(CONFIG_MAIL_LEVEL_REQ));
|
||||
SendNotification(GetTrinityString(LANG_MAIL_SENDER_REQ), sWorld.getIntConfig(CONFIG_MAIL_LEVEL_REQ));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -175,15 +175,15 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!accountBound && !sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_MAIL) && pl->GetTeam() != rc_team && GetSecurity() == SEC_PLAYER)
|
||||
if (!accountBound && !sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_MAIL) && pl->GetTeam() != rc_team && GetSecurity() == SEC_PLAYER)
|
||||
{
|
||||
pl->SendMailResult(0, MAIL_SEND, MAIL_ERR_NOT_YOUR_TEAM);
|
||||
return;
|
||||
}
|
||||
|
||||
if (receiveLevel < sWorld.getConfig(CONFIG_MAIL_LEVEL_REQ))
|
||||
if (receiveLevel < sWorld.getIntConfig(CONFIG_MAIL_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetTrinityString(LANG_MAIL_RECEIVER_REQ), sWorld.getConfig(CONFIG_MAIL_LEVEL_REQ));
|
||||
SendNotification(GetTrinityString(LANG_MAIL_RECEIVER_REQ), sWorld.getIntConfig(CONFIG_MAIL_LEVEL_REQ));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data)
|
||||
for (uint8 i = 0; i < items_count; ++i)
|
||||
{
|
||||
Item* item = items[i];
|
||||
if (GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE))
|
||||
if (GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||
{
|
||||
sLog.outCommand(GetAccountId(), "GM %s (Account: %u) mail item: %s (Entry: %u Count: %u) to player: %s (Account: %u)",
|
||||
GetPlayerName(), GetAccountId(), item->GetProto()->Name1, item->GetEntry(), item->GetCount(), receiver.c_str(), rc_account);
|
||||
@@ -275,7 +275,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data)
|
||||
needItemDelay = pl->GetSession()->GetAccountId() != rc_account;
|
||||
}
|
||||
|
||||
if (money > 0 && GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE))
|
||||
if (money > 0 && GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||
{
|
||||
sLog.outCommand(GetAccountId(),"GM %s (Account: %u) mail money: %u to player: %s (Account: %u)",
|
||||
GetPlayerName(), GetAccountId(), money, receiver.c_str(), rc_account);
|
||||
@@ -283,7 +283,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// If theres is an item, there is a one hour delivery delay if sent to another account's character.
|
||||
uint32 deliver_delay = needItemDelay ? sWorld.getConfig(CONFIG_MAIL_DELIVERY_DELAY) : 0;
|
||||
uint32 deliver_delay = needItemDelay ? sWorld.getIntConfig(CONFIG_MAIL_DELIVERY_DELAY) : 0;
|
||||
|
||||
// will delete item or place to receiver mail list
|
||||
draft
|
||||
@@ -448,7 +448,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data)
|
||||
|
||||
uint32 sender_accId = 0;
|
||||
|
||||
if (GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE))
|
||||
if (GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||
{
|
||||
std::string sender_name;
|
||||
if (receive)
|
||||
@@ -903,7 +903,7 @@ void MailDraft::SendReturnToSender(uint32 sender_acc, uint32 sender_guid, uint32
|
||||
}
|
||||
|
||||
// If theres is an item, there is a one hour delivery delay.
|
||||
uint32 deliver_delay = needItemDelay ? sWorld.getConfig(CONFIG_MAIL_DELIVERY_DELAY) : 0;
|
||||
uint32 deliver_delay = needItemDelay ? sWorld.getIntConfig(CONFIG_MAIL_DELIVERY_DELAY) : 0;
|
||||
|
||||
// will delete item or place to receiver mail list
|
||||
SendMailTo(trans,MailReceiver(receiver,receiver_guid), MailSender(MAIL_NORMAL, sender_guid), MAIL_CHECK_MASK_RETURNED, deliver_delay);
|
||||
@@ -926,7 +926,7 @@ void MailDraft::SendMailTo(SQLTransaction& trans, MailReceiver const& receiver,
|
||||
|
||||
// auction mail without any items and money
|
||||
if (sender.GetMailMessageType() == MAIL_AUCTION && m_items.empty() && !m_money)
|
||||
expire_delay = sWorld.getConfig(CONFIG_MAIL_DELIVERY_DELAY);
|
||||
expire_delay = sWorld.getIntConfig(CONFIG_MAIL_DELIVERY_DELAY);
|
||||
// mail from battlemaster (rewardmarks) should last only one day
|
||||
else if (sender.GetMailMessageType() == MAIL_CREATURE && sBattlegroundMgr.GetBattleMasterBG(sender.GetSenderId()) != BATTLEGROUND_TYPE_NONE)
|
||||
expire_delay = DAY;
|
||||
|
||||
@@ -345,7 +345,7 @@ Map::EnsureGridCreated(const GridPair &p)
|
||||
{
|
||||
sLog.outDebug("Creating grid[%u,%u] for map %u instance %u", p.x_coord, p.y_coord, GetId(), i_InstanceId);
|
||||
|
||||
setNGrid(new NGridType(p.x_coord*MAX_NUMBER_OF_GRIDS + p.y_coord, p.x_coord, p.y_coord, i_gridExpiry, sWorld.getConfig(CONFIG_GRID_UNLOAD)),
|
||||
setNGrid(new NGridType(p.x_coord*MAX_NUMBER_OF_GRIDS + p.y_coord, p.x_coord, p.y_coord, i_gridExpiry, sWorld.getBoolConfig(CONFIG_GRID_UNLOAD)),
|
||||
p.x_coord, p.y_coord);
|
||||
|
||||
// build a linkage between this map and NGridType
|
||||
@@ -769,7 +769,7 @@ Map::Remove(T *obj, bool remove)
|
||||
if (remove)
|
||||
{
|
||||
// if option set then object already saved at this moment
|
||||
if (!sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY))
|
||||
if (!sWorld.getBoolConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY))
|
||||
obj->SaveRespawnTime();
|
||||
DeleteFromWorld(obj);
|
||||
}
|
||||
@@ -2224,7 +2224,7 @@ InstanceMap::InstanceMap(uint32 id, time_t expiry, uint32 InstanceId, uint8 Spaw
|
||||
|
||||
// the timer is started by default, and stopped when the first player joins
|
||||
// this make sure it gets unloaded if for some reason no player joins
|
||||
m_unloadTimer = std::max(sWorld.getConfig(CONFIG_INSTANCE_UNLOAD_DELAY), (uint32)MIN_UNLOAD_DELAY);
|
||||
m_unloadTimer = std::max(sWorld.getIntConfig(CONFIG_INSTANCE_UNLOAD_DELAY), (uint32)MIN_UNLOAD_DELAY);
|
||||
}
|
||||
|
||||
InstanceMap::~InstanceMap()
|
||||
@@ -2428,7 +2428,7 @@ void InstanceMap::Remove(Player *player, bool remove)
|
||||
sLog.outDetail("MAP: Removing player '%s' from instance '%u' of map '%s' before relocating to another map", player->GetName(), GetInstanceId(), GetMapName());
|
||||
//if last player set unload timer
|
||||
if (!m_unloadTimer && m_mapRefManager.getSize() == 1)
|
||||
m_unloadTimer = m_unloadWhenEmpty ? MIN_UNLOAD_DELAY : std::max(sWorld.getConfig(CONFIG_INSTANCE_UNLOAD_DELAY), (uint32)MIN_UNLOAD_DELAY);
|
||||
m_unloadTimer = m_unloadWhenEmpty ? MIN_UNLOAD_DELAY : std::max(sWorld.getIntConfig(CONFIG_INSTANCE_UNLOAD_DELAY), (uint32)MIN_UNLOAD_DELAY);
|
||||
Map::Remove(player, remove);
|
||||
// for normal instances schedule the reset after all players have left
|
||||
SetResetSchedule(true);
|
||||
|
||||
@@ -234,7 +234,7 @@ bool MapInstanced::DestroyInstance(InstancedMaps::iterator &itr)
|
||||
|
||||
itr->second->UnloadAll();
|
||||
// should only unload VMaps if this is the last instance and grid unloading is enabled
|
||||
if (m_InstancedMaps.size() <= 1 && sWorld.getConfig(CONFIG_GRID_UNLOAD))
|
||||
if (m_InstancedMaps.size() <= 1 && sWorld.getBoolConfig(CONFIG_GRID_UNLOAD))
|
||||
{
|
||||
VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(itr->second->GetId());
|
||||
// in that case, unload grids of the base map, too
|
||||
|
||||
@@ -40,8 +40,8 @@ extern GridState* si_GridStates[]; // debugging code, s
|
||||
|
||||
MapManager::MapManager()
|
||||
{
|
||||
i_gridCleanUpDelay = sWorld.getConfig(CONFIG_INTERVAL_GRIDCLEAN);
|
||||
i_timer.SetInterval(sWorld.getConfig(CONFIG_INTERVAL_MAPUPDATE));
|
||||
i_gridCleanUpDelay = sWorld.getIntConfig(CONFIG_INTERVAL_GRIDCLEAN);
|
||||
i_timer.SetInterval(sWorld.getIntConfig(CONFIG_INTERVAL_MAPUPDATE));
|
||||
}
|
||||
|
||||
MapManager::~MapManager()
|
||||
@@ -72,7 +72,7 @@ void MapManager::Initialize()
|
||||
|
||||
i_GridStateErrorCount = 0;
|
||||
}
|
||||
int num_threads(sWorld.getConfig(CONFIG_NUMTHREADS));
|
||||
int num_threads(sWorld.getIntConfig(CONFIG_NUMTHREADS));
|
||||
// Start mtmaps if needed.
|
||||
if (num_threads > 0 && m_updater.activate(num_threads) == -1)
|
||||
abort();
|
||||
@@ -196,7 +196,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck)
|
||||
if (entry->IsRaid())
|
||||
{
|
||||
// can only enter in a raid group
|
||||
if ((!pGroup || !pGroup->isRaidGroup()) && !sWorld.getConfig(CONFIG_INSTANCE_IGNORE_RAID))
|
||||
if ((!pGroup || !pGroup->isRaidGroup()) && !sWorld.getBoolConfig(CONFIG_INSTANCE_IGNORE_RAID))
|
||||
{
|
||||
// probably there must be special opcode, because client has this string constant in GlobalStrings.lua
|
||||
// TODO: this is not a good place to send the message
|
||||
|
||||
@@ -101,6 +101,6 @@ void AssistanceMovementGenerator::Finalize(Unit &unit)
|
||||
unit.ToCreature()->SetNoCallAssistance(false);
|
||||
unit.ToCreature()->CallAssistance();
|
||||
if (unit.isAlive())
|
||||
unit.GetMotionMaster()->MoveSeekAssistanceDistract(sWorld.getConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY));
|
||||
unit.GetMotionMaster()->MoveSeekAssistanceDistract(sWorld.getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY));
|
||||
}
|
||||
|
||||
|
||||
@@ -212,5 +212,5 @@ bool Quest::IsAllowedInRaid() const
|
||||
if (IsRaidQuest())
|
||||
return true;
|
||||
|
||||
return sWorld.getConfig(CONFIG_QUEST_IGNORE_RAID);
|
||||
return sWorld.getBoolConfig(CONFIG_QUEST_IGNORE_RAID);
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
if (player->getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (player->getLevel() < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", player->GetName(), ERR_ARENA_TEAM_TARGET_TOO_LOW_S);
|
||||
return;
|
||||
@@ -117,7 +117,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recv_data)
|
||||
if (player->GetSocial()->HasIgnore(GetPlayer()->GetGUIDLow()))
|
||||
return;
|
||||
|
||||
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != GetPlayer()->GetTeam())
|
||||
if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != GetPlayer()->GetTeam())
|
||||
{
|
||||
SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED);
|
||||
return;
|
||||
@@ -168,7 +168,7 @@ void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recv_data*/)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && _player->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(at->GetCaptain()))
|
||||
if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && _player->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(at->GetCaptain()))
|
||||
{
|
||||
// not let enemies sign petition
|
||||
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", "", ERR_ARENA_TEAM_NOT_ALLIED);
|
||||
|
||||
@@ -56,9 +56,9 @@ void WorldSession::HandleAuctionHelloOpcode(WorldPacket & recv_data)
|
||||
//this void causes that auction window is opened
|
||||
void WorldSession::SendAuctionHello(uint64 guid, Creature* unit)
|
||||
{
|
||||
if (GetPlayer()->getLevel() < sWorld.getConfig(CONFIG_AUCTION_LEVEL_REQ))
|
||||
if (GetPlayer()->getLevel() < sWorld.getIntConfig(CONFIG_AUCTION_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetTrinityString(LANG_AUCTION_REQ), sWorld.getConfig(CONFIG_AUCTION_LEVEL_REQ));
|
||||
SendNotification(GetTrinityString(LANG_AUCTION_REQ), sWorld.getIntConfig(CONFIG_AUCTION_LEVEL_REQ));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE))
|
||||
if (GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||
{
|
||||
sLog.outCommand(GetAccountId(),"GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)",
|
||||
GetPlayerName(),GetAccountId(),it->GetProto()->Name1,it->GetEntry(),it->GetCount());
|
||||
@@ -216,7 +216,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
|
||||
|
||||
AuctionEntry *AH = new AuctionEntry;
|
||||
AH->Id = sObjectMgr.GenerateAuctionID();
|
||||
if (sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION))
|
||||
if (sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION))
|
||||
AH->auctioneer = 23442;
|
||||
else
|
||||
AH->auctioneer = GUID_LOPART(auctioneer);
|
||||
|
||||
@@ -84,7 +84,7 @@ bool LoginQueryHolder::Initialize()
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADSOCIALLIST, "SELECT friend,flags,note FROM character_social WHERE guid = '%u' LIMIT 255", GUID_LOPART(m_guid));
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADHOMEBIND, "SELECT map,zone,position_x,position_y,position_z FROM character_homebind WHERE guid = '%u'", GUID_LOPART(m_guid));
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADSPELLCOOLDOWNS, "SELECT spell,item,time FROM character_spell_cooldown WHERE guid = '%u'", GUID_LOPART(m_guid));
|
||||
if (sWorld.getConfig(CONFIG_DECLINED_NAMES_USED))
|
||||
if (sWorld.getBoolConfig(CONFIG_DECLINED_NAMES_USED))
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADDECLINEDNAMES, "SELECT genitive, dative, accusative, instrumental, prepositional FROM character_declinedname WHERE guid = '%u'",GUID_LOPART(m_guid));
|
||||
// in other case still be dummy query
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADGUILD, "SELECT guildid,rank FROM guild_member WHERE guid = '%u'", GUID_LOPART(m_guid));
|
||||
@@ -132,7 +132,7 @@ void WorldSession::HandleCharEnumOpcode(WorldPacket & /*recv_data*/)
|
||||
/// get all the data necessary for loading all characters (along with their pets) on the account
|
||||
m_charEnumCallback =
|
||||
CharacterDatabase.AsyncPQuery(
|
||||
!sWorld.getConfig(CONFIG_DECLINED_NAMES_USED) ?
|
||||
!sWorld.getBoolConfig(CONFIG_DECLINED_NAMES_USED) ?
|
||||
// ------- Query Without Declined Names --------
|
||||
// 0 1 2 3 4 5 6 7
|
||||
"SELECT characters.guid, characters.name, characters.race, characters.class, characters.gender, characters.playerBytes, characters.playerBytes2, characters.level, "
|
||||
@@ -173,7 +173,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
|
||||
|
||||
if (GetSecurity() == SEC_PLAYER)
|
||||
{
|
||||
if (uint32 mask = sWorld.getConfig(CONFIG_CHARACTERS_CREATING_DISABLED))
|
||||
if (uint32 mask = sWorld.getIntConfig(CONFIG_CHARACTERS_CREATING_DISABLED))
|
||||
{
|
||||
bool disabled = false;
|
||||
|
||||
@@ -260,7 +260,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
|
||||
Field *fields=resultacct->Fetch();
|
||||
uint32 acctcharcount = fields[0].GetUInt32();
|
||||
|
||||
if (acctcharcount >= sWorld.getConfig(CONFIG_CHARACTERS_PER_ACCOUNT))
|
||||
if (acctcharcount >= sWorld.getIntConfig(CONFIG_CHARACTERS_PER_ACCOUNT))
|
||||
{
|
||||
data << (uint8)CHAR_CREATE_ACCOUNT_LIMIT;
|
||||
SendPacket(&data);
|
||||
@@ -275,7 +275,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
|
||||
Field *fields=result->Fetch();
|
||||
charcount = fields[0].GetUInt8();
|
||||
|
||||
if (charcount >= sWorld.getConfig(CONFIG_CHARACTERS_PER_REALM))
|
||||
if (charcount >= sWorld.getIntConfig(CONFIG_CHARACTERS_PER_REALM))
|
||||
{
|
||||
data << (uint8)CHAR_CREATE_SERVER_LIMIT;
|
||||
SendPacket(&data);
|
||||
@@ -284,7 +284,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// speedup check for heroic class disabled case
|
||||
uint32 heroic_free_slots = sWorld.getConfig(CONFIG_HEROIC_CHARACTERS_PER_REALM);
|
||||
uint32 heroic_free_slots = sWorld.getIntConfig(CONFIG_HEROIC_CHARACTERS_PER_REALM);
|
||||
if (heroic_free_slots == 0 && GetSecurity() == SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT)
|
||||
{
|
||||
data << (uint8)CHAR_CREATE_UNIQUE_CLASS_LIMIT;
|
||||
@@ -293,16 +293,16 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// speedup check for heroic class disabled case
|
||||
uint32 req_level_for_heroic = sWorld.getConfig(CONFIG_MIN_LEVEL_FOR_HEROIC_CHARACTER_CREATING);
|
||||
if (GetSecurity() == SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT && req_level_for_heroic > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
uint32 req_level_for_heroic = sWorld.getIntConfig(CONFIG_MIN_LEVEL_FOR_HEROIC_CHARACTER_CREATING);
|
||||
if (GetSecurity() == SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT && req_level_for_heroic > sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
data << (uint8)CHAR_CREATE_LEVEL_REQUIREMENT;
|
||||
SendPacket(&data);
|
||||
return;
|
||||
}
|
||||
|
||||
bool AllowTwoSideAccounts = !sWorld.IsPvPRealm() || sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_ACCOUNTS) || GetSecurity() > SEC_PLAYER;
|
||||
uint32 skipCinematics = sWorld.getConfig(CONFIG_SKIP_CINEMATICS);
|
||||
bool AllowTwoSideAccounts = !sWorld.IsPvPRealm() || sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_ACCOUNTS) || GetSecurity() > SEC_PLAYER;
|
||||
uint32 skipCinematics = sWorld.getIntConfig(CONFIG_SKIP_CINEMATICS);
|
||||
|
||||
bool have_same_race = false;
|
||||
|
||||
@@ -615,7 +615,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
|
||||
sLog.outStaticDebug("WORLD: Sent motd (SMSG_MOTD)");
|
||||
|
||||
// send server info
|
||||
if (sWorld.getConfig(CONFIG_ENABLE_SINFO_LOGIN) == 1)
|
||||
if (sWorld.getIntConfig(CONFIG_ENABLE_SINFO_LOGIN) == 1)
|
||||
chH.PSendSysMessage(_FULLVERSION);
|
||||
|
||||
sLog.outStaticDebug("WORLD: Sent server info");
|
||||
@@ -765,7 +765,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
|
||||
if (sWorld.IsShutdowning())
|
||||
sWorld.ShutdownMsg(true,pCurrChar);
|
||||
|
||||
if (sWorld.getConfig(CONFIG_ALL_TAXI_PATHS))
|
||||
if (sWorld.getBoolConfig(CONFIG_ALL_TAXI_PATHS))
|
||||
pCurrChar->SetTaxiCheater(true);
|
||||
|
||||
if (pCurrChar->isGameMaster())
|
||||
|
||||
@@ -46,15 +46,15 @@ bool WorldSession::processChatmessageFurtherAfterSecurityChecks(std::string& msg
|
||||
if (lang != LANG_ADDON)
|
||||
{
|
||||
// strip invisible characters for non-addon messages
|
||||
if (sWorld.getConfig(CONFIG_CHAT_FAKE_MESSAGE_PREVENTING))
|
||||
if (sWorld.getBoolConfig(CONFIG_CHAT_FAKE_MESSAGE_PREVENTING))
|
||||
stripLineInvisibleChars(msg);
|
||||
|
||||
if (sWorld.getConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) && GetSecurity() < SEC_MODERATOR
|
||||
if (sWorld.getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) && GetSecurity() < SEC_MODERATOR
|
||||
&& !ChatHandler(this).isValidChatMessage(msg.c_str()))
|
||||
{
|
||||
sLog.outError("Player %s (GUID: %u) sent a chatmessage with an invalid link: %s", GetPlayer()->GetName(),
|
||||
GetPlayer()->GetGUIDLow(), msg.c_str());
|
||||
if (sWorld.getConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_KICK))
|
||||
if (sWorld.getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_KICK))
|
||||
KickPlayer();
|
||||
return false;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
|
||||
|
||||
if (lang == LANG_ADDON)
|
||||
{
|
||||
if (sWorld.getConfig(CONFIG_CHATLOG_ADDON))
|
||||
if (sWorld.getBoolConfig(CONFIG_CHATLOG_ADDON))
|
||||
{
|
||||
std::string msg = "";
|
||||
recv_data >> msg;
|
||||
@@ -123,7 +123,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// Disabled addon channel?
|
||||
if (!sWorld.getConfig(CONFIG_ADDON_CHANNEL))
|
||||
if (!sWorld.getBoolConfig(CONFIG_ADDON_CHANNEL))
|
||||
return;
|
||||
}
|
||||
// LANG_ADDON should not be changed nor be affected by flood control
|
||||
@@ -135,7 +135,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
|
||||
else
|
||||
{
|
||||
// send in universal language in two side iteration allowed mode
|
||||
if (sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT))
|
||||
if (sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT))
|
||||
lang = LANG_UNIVERSAL;
|
||||
else
|
||||
{
|
||||
@@ -146,13 +146,13 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
|
||||
case CHAT_MSG_RAID_LEADER:
|
||||
case CHAT_MSG_RAID_WARNING:
|
||||
// allow two side chat at group channel if two side group allowed
|
||||
if (sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP))
|
||||
if (sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP))
|
||||
lang = LANG_UNIVERSAL;
|
||||
break;
|
||||
case CHAT_MSG_GUILD:
|
||||
case CHAT_MSG_OFFICER:
|
||||
// allow two side chat at guild channel if two side guild allowed
|
||||
if (sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD))
|
||||
if (sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD))
|
||||
lang = LANG_UNIVERSAL;
|
||||
break;
|
||||
}
|
||||
@@ -199,9 +199,9 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
|
||||
if (ChatHandler(this).ParseCommands(msg.c_str()) > 0)
|
||||
break;
|
||||
|
||||
if (_player->getLevel() < sWorld.getConfig(CONFIG_CHAT_SAY_LEVEL_REQ))
|
||||
if (_player->getLevel() < sWorld.getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetTrinityString(LANG_SAY_REQ), sWorld.getConfig(CONFIG_CHAT_SAY_LEVEL_REQ));
|
||||
SendNotification(GetTrinityString(LANG_SAY_REQ), sWorld.getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -225,9 +225,9 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
|
||||
recv_data >> to;
|
||||
recv_data >> msg;
|
||||
|
||||
if (_player->getLevel() < sWorld.getConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ))
|
||||
if (_player->getLevel() < sWorld.getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetTrinityString(LANG_WHISPER_REQ), sWorld.getConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ));
|
||||
SendNotification(GetTrinityString(LANG_WHISPER_REQ), sWorld.getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT) && tSecurity == SEC_PLAYER && pSecurity == SEC_PLAYER)
|
||||
if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT) && tSecurity == SEC_PLAYER && pSecurity == SEC_PLAYER)
|
||||
{
|
||||
uint32 sidea = GetPlayer()->GetTeam();
|
||||
uint32 sideb = player->GetTeam();
|
||||
@@ -508,9 +508,9 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
|
||||
if (!processChatmessageFurtherAfterSecurityChecks(msg, lang))
|
||||
return;
|
||||
|
||||
if (_player->getLevel() < sWorld.getConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ))
|
||||
if (_player->getLevel() < sWorld.getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetTrinityString(LANG_CHANNEL_REQ), sWorld.getConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ));
|
||||
SendNotification(GetTrinityString(LANG_CHANNEL_REQ), sWorld.getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -671,9 +671,9 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket & recv_data)
|
||||
|
||||
Trinity::EmoteChatBuilder emote_builder(*GetPlayer(), text_emote, emoteNum, unit);
|
||||
Trinity::LocalizedPacketDo<Trinity::EmoteChatBuilder > emote_do(emote_builder);
|
||||
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::EmoteChatBuilder > > emote_worker(GetPlayer(), (float)sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), emote_do);
|
||||
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::EmoteChatBuilder > > emote_worker(GetPlayer(), sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), emote_do);
|
||||
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::EmoteChatBuilder> >, WorldTypeMapContainer> message(emote_worker);
|
||||
cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), (float)sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
|
||||
cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
|
||||
|
||||
GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE, text_emote, 0, unit);
|
||||
|
||||
|
||||
@@ -82,11 +82,11 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// restrict invite to GMs
|
||||
if (!sWorld.getConfig(CONFIG_ALLOW_GM_GROUP) && !GetPlayer()->isGameMaster() && player->isGameMaster())
|
||||
if (!sWorld.getBoolConfig(CONFIG_ALLOW_GM_GROUP) && !GetPlayer()->isGameMaster() && player->isGameMaster())
|
||||
return;
|
||||
|
||||
// can't group with
|
||||
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && GetPlayer()->GetTeam() != player->GetTeam())
|
||||
if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && GetPlayer()->GetTeam() != player->GetTeam())
|
||||
{
|
||||
SendPartyResult(PARTY_OP_INVITE, membername, ERR_PLAYER_WRONG_FACTION);
|
||||
return;
|
||||
|
||||
@@ -95,7 +95,7 @@ void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
|
||||
// not let enemies sign guild charter
|
||||
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != GetPlayer()->GetTeam())
|
||||
if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != GetPlayer()->GetTeam())
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, Invitedname, ERR_GUILD_NOT_ALLIED);
|
||||
return;
|
||||
@@ -198,7 +198,7 @@ void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/)
|
||||
return;
|
||||
|
||||
// not let enemies sign guild charter
|
||||
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(guild->GetLeader()))
|
||||
if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(guild->GetLeader()))
|
||||
return;
|
||||
|
||||
if (!guild->AddMember(GetPlayer()->GetGUID(),guild->GetLowestRank()))
|
||||
@@ -894,7 +894,7 @@ void WorldSession::HandleGuildBankDepositMoney(WorldPacket & recv_data)
|
||||
GetPlayer()->SaveGoldToDB(trans);
|
||||
|
||||
// logging money
|
||||
if (_player->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE))
|
||||
if (_player->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||
{
|
||||
sLog.outCommand(_player->GetSession()->GetAccountId(),"GM %s (Account: %u) deposit money (Amount: %u) to guild bank (Guild ID %u)",
|
||||
_player->GetName(),_player->GetSession()->GetAccountId(),money,GuildId);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
void WorldSession::HandleLfgJoinOpcode(WorldPacket &recv_data)
|
||||
{
|
||||
sLog.outDebug("CMSG_LFG_JOIN");
|
||||
if (!sWorld.getConfig(CONFIG_DUNGEON_FINDER_ENABLE))
|
||||
if (!sWorld.getBoolConfig(CONFIG_DUNGEON_FINDER_ENABLE))
|
||||
{
|
||||
recv_data.rpos(recv_data.wpos());
|
||||
return;
|
||||
|
||||
@@ -223,7 +223,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/)
|
||||
Player* playerGroup = itr->getSource();
|
||||
if (!playerGroup)
|
||||
continue;
|
||||
if (player->IsWithinDistInMap(playerGroup,(float)sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
if (player->IsWithinDistInMap(playerGroup,sWorld.getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
playersNear.push_back(playerGroup);
|
||||
}
|
||||
|
||||
|
||||
@@ -224,8 +224,8 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data)
|
||||
|
||||
uint32 team = _player->GetTeam();
|
||||
uint32 security = GetSecurity();
|
||||
bool allowTwoSideWhoList = sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST);
|
||||
uint32 gmLevelInWhoList = sWorld.getConfig(CONFIG_GM_LEVEL_IN_WHO_LIST);
|
||||
bool allowTwoSideWhoList = sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST);
|
||||
uint32 gmLevelInWhoList = sWorld.getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST);
|
||||
|
||||
WorldPacket data(SMSG_WHO, 50); // guess size
|
||||
data << uint32(clientcount); // clientcount place holder, listed count
|
||||
@@ -336,7 +336,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data)
|
||||
|
||||
// 49 is maximum player count sent to client - can be overridden
|
||||
// through config, but is unstable
|
||||
if ((++clientcount) == sWorld.getConfig(CONFIG_MAX_WHO))
|
||||
if ((++clientcount) == sWorld.getIntConfig(CONFIG_MAX_WHO))
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -376,7 +376,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/)
|
||||
|
||||
//instant logout in taverns/cities or on taxi or for admins, gm's, mod's if its enabled in worldserver.conf
|
||||
if (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) || GetPlayer()->isInFlight() ||
|
||||
GetSecurity() >= AccountTypes(sWorld.getConfig(CONFIG_INSTANT_LOGOUT)))
|
||||
GetSecurity() >= AccountTypes(sWorld.getIntConfig(CONFIG_INSTANT_LOGOUT)))
|
||||
{
|
||||
WorldPacket data(SMSG_LOGOUT_RESPONSE, 1+4);
|
||||
data << uint8(0);
|
||||
@@ -575,13 +575,13 @@ void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult_AutoPtr result, std
|
||||
team = Player::TeamForRace((*result)[1].GetUInt8());
|
||||
friendAcctid = (*result)[2].GetUInt32();
|
||||
|
||||
if (GetSecurity() >= SEC_MODERATOR || sWorld.getConfig(CONFIG_ALLOW_GM_FRIEND) || sAccountMgr.GetSecurity(friendAcctid) < SEC_MODERATOR)
|
||||
if (GetSecurity() >= SEC_MODERATOR || sWorld.getBoolConfig(CONFIG_ALLOW_GM_FRIEND) || sAccountMgr.GetSecurity(friendAcctid) < SEC_MODERATOR)
|
||||
{
|
||||
if (friendGuid)
|
||||
{
|
||||
if (friendGuid == GetPlayer()->GetGUID())
|
||||
friendResult = FRIEND_SELF;
|
||||
else if (GetPlayer()->GetTeam() != team && !sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND) && GetSecurity() < SEC_MODERATOR)
|
||||
else if (GetPlayer()->GetTeam() != team && !sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND) && GetSecurity() < SEC_MODERATOR)
|
||||
friendResult = FRIEND_ENEMY;
|
||||
else if (GetPlayer()->GetSocial()->HasFriend(GUID_LOPART(friendGuid)))
|
||||
friendResult = FRIEND_ALREADY;
|
||||
@@ -1216,7 +1216,7 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data)
|
||||
WorldPacket data(SMSG_INSPECT_TALENT, guid_size+4+talent_points);
|
||||
data.append(plr->GetPackGUID());
|
||||
|
||||
if (sWorld.getConfig(CONFIG_TALENTS_INSPECTING) || _player->isGameMaster())
|
||||
if (sWorld.getBoolConfig(CONFIG_TALENTS_INSPECTING) || _player->isGameMaster())
|
||||
{
|
||||
plr->BuildPlayerTalentsInfoData(&data);
|
||||
}
|
||||
|
||||
@@ -159,12 +159,10 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid
|
||||
return;
|
||||
|
||||
// Not let attack through obstructions
|
||||
if (sWorld.getConfig(CONFIG_PET_LOS))
|
||||
if (sWorld.getBoolConfig(CONFIG_PET_LOS))
|
||||
{
|
||||
|
||||
if (!pet->IsWithinLOSInMap(TargetUnit))
|
||||
return;
|
||||
|
||||
if (!pet->IsWithinLOSInMap(TargetUnit))
|
||||
return;
|
||||
}
|
||||
|
||||
pet->clearUnitState(UNIT_STAT_FOLLOW);
|
||||
|
||||
@@ -110,9 +110,9 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
|
||||
else
|
||||
{
|
||||
// TODO: find correct opcode
|
||||
if (_player->getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (_player->getLevel() < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
SendNotification(LANG_ARENA_ONE_TOOLOW, sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL));
|
||||
SendNotification(LANG_ARENA_ONE_TOOLOW, sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -467,7 +467,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
|
||||
return;
|
||||
|
||||
// not let enemies sign guild charter
|
||||
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && GetPlayer()->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(ownerguid))
|
||||
if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && GetPlayer()->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(ownerguid))
|
||||
{
|
||||
if (type != 9)
|
||||
SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED);
|
||||
@@ -478,7 +478,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
|
||||
|
||||
if (type != 9)
|
||||
{
|
||||
if (_player->getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (_player->getLevel() < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", _player->GetName(), ERR_ARENA_TEAM_TARGET_TOO_LOW_S);
|
||||
return;
|
||||
@@ -611,7 +611,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data)
|
||||
|
||||
sLog.outDebug("OFFER PETITION: type %u, GUID1 %u, to player id: %u", type, GUID_LOPART(petitionguid), GUID_LOPART(plguid));
|
||||
|
||||
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && GetPlayer()->GetTeam() != player->GetTeam())
|
||||
if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && GetPlayer()->GetTeam() != player->GetTeam())
|
||||
{
|
||||
if (type != 9)
|
||||
SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED);
|
||||
@@ -622,7 +622,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data)
|
||||
|
||||
if (type != 9)
|
||||
{
|
||||
if (player->getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (player->getLevel() < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
// player is too low level to join an arena team
|
||||
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, player->GetName(), "", ERR_ARENA_TEAM_TARGET_TOO_LOW_S);
|
||||
@@ -755,9 +755,9 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
|
||||
signs = 0;
|
||||
|
||||
uint32 count;
|
||||
//if (signs < sWorld.getConfig(CONFIG_MIN_PETITION_SIGNS))
|
||||
//if (signs < sWorld.getIntConfig(CONFIG_MIN_PETITION_SIGNS))
|
||||
if (type == 9)
|
||||
count = sWorld.getConfig(CONFIG_MIN_PETITION_SIGNS);
|
||||
count = sWorld.getIntConfig(CONFIG_MIN_PETITION_SIGNS);
|
||||
else
|
||||
count = type-1;
|
||||
if (signs < count)
|
||||
|
||||
@@ -62,7 +62,7 @@ void WorldSession::SendNameQueryOpcodeFromDB(uint64 guid)
|
||||
{
|
||||
ACE_Future<QueryResult_AutoPtr> lFutureResult =
|
||||
CharacterDatabase.AsyncPQuery(
|
||||
!sWorld.getConfig(CONFIG_DECLINED_NAMES_USED) ?
|
||||
!sWorld.getBoolConfig(CONFIG_DECLINED_NAMES_USED) ?
|
||||
// ------- Query Without Declined Names --------
|
||||
// 0 1 2 3 4
|
||||
"SELECT guid, name, race, gender, class "
|
||||
@@ -110,7 +110,7 @@ void WorldSession::SendNameQueryOpcodeFromDBCallBack(QueryResult_AutoPtr result)
|
||||
data << uint8(pClass); // class
|
||||
|
||||
// if the first declined name field (5) is empty, the rest must be too
|
||||
if (sWorld.getConfig(CONFIG_DECLINED_NAMES_USED) && fields[5].GetCppString() != "")
|
||||
if (sWorld.getBoolConfig(CONFIG_DECLINED_NAMES_USED) && fields[5].GetCppString() != "")
|
||||
{
|
||||
data << uint8(1); // is declined
|
||||
for (int i = 5; i < MAX_DECLINED_NAME_CASES+5; ++i)
|
||||
|
||||
@@ -632,7 +632,7 @@ uint32 WorldSession::getDialogStatus(Player *pPlayer, Object* questgiver, uint32
|
||||
{
|
||||
if (pQuest->IsAutoComplete() || (pQuest->IsRepeatable() && pPlayer->getQuestStatusMap()[quest_id].m_rewarded))
|
||||
result2 = DIALOG_STATUS_REWARD_REP;
|
||||
else if (pPlayer->getLevel() <= ((pPlayer->GetQuestLevel(pQuest) == -1) ? pPlayer->getLevel() : pPlayer->GetQuestLevel(pQuest) + sWorld.getConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF)))
|
||||
else if (pPlayer->getLevel() <= ((pPlayer->GetQuestLevel(pQuest) == -1) ? pPlayer->getLevel() : pPlayer->GetQuestLevel(pQuest) + sWorld.getIntConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF)))
|
||||
{
|
||||
if (pQuest->HasFlag(QUEST_FLAGS_DAILY) || pQuest->HasFlag(QUEST_FLAGS_WEEKLY))
|
||||
result2 = DIALOG_STATUS_AVAILABLE_REP;
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
|
||||
void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
if (GetPlayer()->getLevel() < sWorld.getConfig(CONFIG_TICKET_LEVEL_REQ))
|
||||
if (GetPlayer()->getLevel() < sWorld.getIntConfig(CONFIG_TICKET_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetTrinityString(LANG_TICKET_REQ), sWorld.getConfig(CONFIG_TICKET_LEVEL_REQ));
|
||||
SendNotification(GetTrinityString(LANG_TICKET_REQ), sWorld.getIntConfig(CONFIG_TICKET_LEVEL_REQ));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[])
|
||||
{
|
||||
// logging
|
||||
sLog.outDebug("partner storing: %u",myItems[i]->GetGUIDLow());
|
||||
if (_player->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE))
|
||||
if (_player->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||
{
|
||||
sLog.outCommand(_player->GetSession()->GetAccountId(), "GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)",
|
||||
_player->GetName(), _player->GetSession()->GetAccountId(),
|
||||
@@ -169,7 +169,7 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[])
|
||||
{
|
||||
// logging
|
||||
sLog.outDebug("player storing: %u",hisItems[i]->GetGUIDLow());
|
||||
if (trader->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE))
|
||||
if (trader->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||
{
|
||||
sLog.outCommand(trader->GetSession()->GetAccountId(),"GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)",
|
||||
trader->GetName(), trader->GetSession()->GetAccountId(),
|
||||
@@ -442,7 +442,7 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/)
|
||||
moveItems(myItems, hisItems);
|
||||
|
||||
// logging money
|
||||
if (sWorld.getConfig(CONFIG_GM_LOG_TRADE))
|
||||
if (sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||
{
|
||||
if (_player->GetSession()->GetSecurity() > SEC_PLAYER && my_trade->GetMoney() > 0)
|
||||
{
|
||||
@@ -559,9 +559,9 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetPlayer()->getLevel() < sWorld.getConfig(CONFIG_TRADE_LEVEL_REQ))
|
||||
if (GetPlayer()->getLevel() < sWorld.getIntConfig(CONFIG_TRADE_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetTrinityString(LANG_TRADE_REQ), sWorld.getConfig(CONFIG_TRADE_LEVEL_REQ));
|
||||
SendNotification(GetTrinityString(LANG_TRADE_REQ), sWorld.getIntConfig(CONFIG_TRADE_LEVEL_REQ));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -611,7 +611,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_TRADE) && pOther->GetTeam() !=_player->GetTeam())
|
||||
if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_TRADE) && pOther->GetTeam() !=_player->GetTeam())
|
||||
{
|
||||
SendTradeStatus(TRADE_STATUS_WRONG_FACTION);
|
||||
return;
|
||||
@@ -623,9 +623,9 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
if (pOther->getLevel() < sWorld.getConfig(CONFIG_TRADE_LEVEL_REQ))
|
||||
if (pOther->getLevel() < sWorld.getIntConfig(CONFIG_TRADE_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetTrinityString(LANG_TRADE_OTHER_REQ), sWorld.getConfig(CONFIG_TRADE_LEVEL_REQ));
|
||||
SendNotification(GetTrinityString(LANG_TRADE_OTHER_REQ), sWorld.getIntConfig(CONFIG_TRADE_LEVEL_REQ));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -295,7 +295,7 @@ class WorldSession
|
||||
}
|
||||
void ResetTimeOutTime()
|
||||
{
|
||||
m_timeOutTime = sWorld.getConfig(CONFIG_SOCKET_TIMEOUTTIME);
|
||||
m_timeOutTime = sWorld.getIntConfig(CONFIG_SOCKET_TIMEOUTTIME);
|
||||
}
|
||||
bool IsConnectionIdle() const
|
||||
{
|
||||
|
||||
@@ -843,10 +843,10 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint8 expansion = fields[6].GetUInt8();
|
||||
uint32 world_expansion = sWorld.getConfig(CONFIG_EXPANSION);
|
||||
uint32 world_expansion = sWorld.getIntConfig(CONFIG_EXPANSION);
|
||||
if (expansion > world_expansion)
|
||||
expansion = world_expansion;
|
||||
//expansion = ((sWorld.getConfig(CONFIG_EXPANSION) > fields[6].GetUInt8()) ? fields[6].GetUInt8() : sWorld.getConfig(CONFIG_EXPANSION));
|
||||
//expansion = ((sWorld.getIntConfig(CONFIG_EXPANSION) > fields[6].GetUInt8()) ? fields[6].GetUInt8() : sWorld.getIntConfig(CONFIG_EXPANSION));
|
||||
|
||||
N.SetHexStr ("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7");
|
||||
g.SetDword (7);
|
||||
@@ -994,7 +994,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
|
||||
m_Session->ReadAddonsInfo(recvPacket);
|
||||
|
||||
// Sleep this Network thread for
|
||||
uint32 sleepTime = sWorld.getConfig(CONFIG_SESSION_ADD_DELAY);
|
||||
uint32 sleepTime = sWorld.getIntConfig(CONFIG_SESSION_ADD_DELAY);
|
||||
ACE_OS::sleep (ACE_Time_Value (0, sleepTime));
|
||||
|
||||
sWorld.AddSession (m_Session);
|
||||
@@ -1024,7 +1024,7 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket)
|
||||
{
|
||||
++m_OverSpeedPings;
|
||||
|
||||
uint32 max_count = sWorld.getConfig (CONFIG_MAX_OVERSPEED_PINGS);
|
||||
uint32 max_count = sWorld.getIntConfig (CONFIG_MAX_OVERSPEED_PINGS);
|
||||
|
||||
if (max_count && m_OverSpeedPings > max_count)
|
||||
{
|
||||
|
||||
@@ -159,13 +159,13 @@ class ReactorRunnable : protected ACE_Task_Base
|
||||
sLog.outStaticDebug ("Network Thread Starting");
|
||||
|
||||
bool needInit = true;
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_LOGINDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_LOGINDB) & MYSQL_BUNDLE_RA))
|
||||
{
|
||||
LoginDatabase.Init_MySQL_Connection();
|
||||
needInit = false;
|
||||
}
|
||||
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_CHARDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_CHARDB) & MYSQL_BUNDLE_RA))
|
||||
{
|
||||
CharacterDatabase.Init_MySQL_Connection();
|
||||
needInit = false;
|
||||
@@ -210,9 +210,9 @@ class ReactorRunnable : protected ACE_Task_Base
|
||||
}
|
||||
|
||||
///- Free MySQL thread resources and deallocate lingering connections
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_LOGINDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_LOGINDB) & MYSQL_BUNDLE_RA))
|
||||
LoginDatabase.End_MySQL_Connection();
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_CHARDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_CHARDB) & MYSQL_BUNDLE_RA))
|
||||
CharacterDatabase.End_MySQL_Connection();
|
||||
|
||||
if (needInit)
|
||||
|
||||
@@ -3763,7 +3763,7 @@ void Spell::EffectEnchantItemPerm(uint32 effect_idx)
|
||||
if (!item_owner)
|
||||
return;
|
||||
|
||||
if (item_owner != p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE))
|
||||
if (item_owner != p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||
{
|
||||
sLog.outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)",
|
||||
p_caster->GetName(),p_caster->GetSession()->GetAccountId(),
|
||||
@@ -3822,7 +3822,7 @@ void Spell::EffectEnchantItemPrismatic(uint32 effect_idx)
|
||||
if (!item_owner)
|
||||
return;
|
||||
|
||||
if (item_owner != p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE))
|
||||
if (item_owner != p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||
{
|
||||
sLog.outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)",
|
||||
p_caster->GetName(),p_caster->GetSession()->GetAccountId(),
|
||||
@@ -3950,7 +3950,7 @@ void Spell::EffectEnchantItemTmp(uint32 i)
|
||||
if (!item_owner)
|
||||
return;
|
||||
|
||||
if (item_owner != p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE))
|
||||
if (item_owner != p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||
{
|
||||
sLog.outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(temp): %s (Entry: %d) for player: %s (Account: %u)",
|
||||
p_caster->GetName(), p_caster->GetSession()->GetAccountId(),
|
||||
@@ -5804,7 +5804,7 @@ void Spell::EffectStuck(uint32 /*i*/)
|
||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
if (!sWorld.getConfig(CONFIG_CAST_UNSTUCK))
|
||||
if (!sWorld.getBoolConfig(CONFIG_CAST_UNSTUCK))
|
||||
return;
|
||||
|
||||
Player* pTarget = (Player*)unitTarget;
|
||||
@@ -6746,7 +6746,7 @@ void Spell::EffectProspecting(uint32 /*i*/)
|
||||
if (itemTarget->GetCount() < 5)
|
||||
return;
|
||||
|
||||
if (sWorld.getConfig(CONFIG_SKILL_PROSPECTING))
|
||||
if (sWorld.getBoolConfig(CONFIG_SKILL_PROSPECTING))
|
||||
{
|
||||
uint32 SkillValue = p_caster->GetPureSkillValue(SKILL_JEWELCRAFTING);
|
||||
uint32 reqSkillValue = itemTarget->GetProto()->RequiredSkillRank;
|
||||
@@ -6768,7 +6768,7 @@ void Spell::EffectMilling(uint32 /*i*/)
|
||||
if (itemTarget->GetCount() < 5)
|
||||
return;
|
||||
|
||||
if (sWorld.getConfig(CONFIG_SKILL_MILLING))
|
||||
if (sWorld.getBoolConfig(CONFIG_SKILL_MILLING))
|
||||
{
|
||||
uint32 SkillValue = p_caster->GetPureSkillValue(SKILL_INSCRIPTION);
|
||||
uint32 reqSkillValue = itemTarget->GetProto()->RequiredSkillRank;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
void CharacterDatabaseCleaner::CleanDatabase()
|
||||
{
|
||||
// config to disable
|
||||
if(!sWorld.getConfig(CONFIG_CLEAN_CHARACTER_DB))
|
||||
if(!sWorld.getBoolConfig(CONFIG_CLEAN_CHARACTER_DB))
|
||||
return;
|
||||
|
||||
sLog.outString("Cleaning character database...");
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
Weather::Weather(uint32 zone, WeatherData const* weatherChances)
|
||||
: m_zone(zone), m_weatherChances(weatherChances)
|
||||
{
|
||||
m_timer.SetInterval(sWorld.getConfig(CONFIG_INTERVAL_CHANGEWEATHER));
|
||||
m_timer.SetInterval(sWorld.getIntConfig(CONFIG_INTERVAL_CHANGEWEATHER));
|
||||
m_type = WEATHER_TYPE_FINE;
|
||||
m_grade = 0;
|
||||
|
||||
|
||||
+350
-390
File diff suppressed because it is too large
Load Diff
+133
-95
@@ -88,25 +88,14 @@ enum WorldTimers
|
||||
};
|
||||
|
||||
/// Configuration elements
|
||||
enum WorldConfigs
|
||||
enum WorldBoolConfigs
|
||||
{
|
||||
CONFIG_COMPRESSION = 0,
|
||||
CONFIG_DURABILITY_LOSS_IN_PVP = 0,
|
||||
CONFIG_ADDON_CHANNEL,
|
||||
CONFIG_ALLOW_PLAYER_COMMANDS,
|
||||
CONFIG_CLEAN_CHARACTER_DB,
|
||||
CONFIG_GRID_UNLOAD,
|
||||
CONFIG_INTERVAL_SAVE,
|
||||
CONFIG_INTERVAL_GRIDCLEAN,
|
||||
CONFIG_INTERVAL_MAPUPDATE,
|
||||
CONFIG_INTERVAL_CHANGEWEATHER,
|
||||
CONFIG_INTERVAL_DISCONNECT_TOLERANCE,
|
||||
CONFIG_PORT_WORLD,
|
||||
CONFIG_SOCKET_SELECTTIME,
|
||||
CONFIG_SOCKET_TIMEOUTTIME,
|
||||
CONFIG_SESSION_ADD_DELAY,
|
||||
CONFIG_GROUP_XP_DISTANCE,
|
||||
CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE,
|
||||
CONFIG_SIGHT_MONSTER,
|
||||
CONFIG_SIGHT_GUARDER,
|
||||
CONFIG_GAME_TYPE,
|
||||
CONFIG_REALM_ZONE,
|
||||
CONFIG_STATS_SAVE_ONLY_ON_LOGOUT,
|
||||
CONFIG_ALLOW_TWO_SIDE_ACCOUNTS,
|
||||
CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT,
|
||||
CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL,
|
||||
@@ -117,6 +106,94 @@ enum WorldConfigs
|
||||
CONFIG_ALLOW_TWO_SIDE_WHO_LIST,
|
||||
CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND,
|
||||
CONFIG_ALLOW_TWO_SIDE_TRADE,
|
||||
CONFIG_ALL_TAXI_PATHS,
|
||||
CONFIG_INSTANT_TAXI,
|
||||
CONFIG_INSTANCE_IGNORE_LEVEL,
|
||||
CONFIG_INSTANCE_IGNORE_RAID,
|
||||
CONFIG_CAST_UNSTUCK,
|
||||
CONFIG_GM_LOG_TRADE,
|
||||
CONFIG_ALLOW_GM_GROUP,
|
||||
CONFIG_ALLOW_GM_FRIEND,
|
||||
CONFIG_GM_LOWER_SECURITY,
|
||||
CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS,
|
||||
CONFIG_SKILL_PROSPECTING,
|
||||
CONFIG_SKILL_MILLING,
|
||||
CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY,
|
||||
CONFIG_WEATHER,
|
||||
CONFIG_ALWAYS_MAX_SKILL_FOR_LEVEL,
|
||||
CONFIG_QUEST_IGNORE_RAID,
|
||||
CONFIG_DETECT_POS_COLLISION,
|
||||
CONFIG_RESTRICTED_LFG_CHANNEL,
|
||||
CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL,
|
||||
CONFIG_TALENTS_INSPECTING,
|
||||
CONFIG_CHAT_FAKE_MESSAGE_PREVENTING,
|
||||
CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP,
|
||||
CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE,
|
||||
CONFIG_DEATH_BONES_WORLD,
|
||||
CONFIG_DEATH_BONES_BG_OR_ARENA,
|
||||
CONFIG_DIE_COMMAND_MODE,
|
||||
CONFIG_DECLINED_NAMES_USED,
|
||||
CONFIG_BATTLEGROUND_CAST_DESERTER,
|
||||
CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE,
|
||||
CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY,
|
||||
CONFIG_BG_XP_FOR_KILL,
|
||||
CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS,
|
||||
CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE,
|
||||
CONFIG_ARENA_QUEUE_ANNOUNCER_PLAYERONLY,
|
||||
CONFIG_ARENA_SEASON_IN_PROGRESS,
|
||||
CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN,
|
||||
CONFIG_VMAP_INDOOR_CHECK,
|
||||
CONFIG_PET_LOS,
|
||||
CONFIG_BG_START_MUSIC,
|
||||
CONFIG_START_ALL_SPELLS,
|
||||
CONFIG_START_ALL_EXPLORED,
|
||||
CONFIG_START_ALL_REP,
|
||||
CONFIG_ALWAYS_MAXSKILL,
|
||||
CONFIG_PVP_TOKEN_ENABLE,
|
||||
CONFIG_NO_RESET_TALENT_COST,
|
||||
CONFIG_SHOW_KICK_IN_WORLD,
|
||||
CONFIG_CHATLOG_CHANNEL,
|
||||
CONFIG_CHATLOG_WHISPER,
|
||||
CONFIG_CHATLOG_SYSCHAN,
|
||||
CONFIG_CHATLOG_PARTY,
|
||||
CONFIG_CHATLOG_RAID,
|
||||
CONFIG_CHATLOG_GUILD,
|
||||
CONFIG_CHATLOG_PUBLIC,
|
||||
CONFIG_CHATLOG_ADDON,
|
||||
CONFIG_CHATLOG_BGROUND,
|
||||
CONFIG_DUNGEON_FINDER_ENABLE,
|
||||
BOOL_CONFIG_VALUE_COUNT
|
||||
};
|
||||
|
||||
enum WorldFloatConfigs
|
||||
{
|
||||
CONFIG_GROUP_XP_DISTANCE = 0,
|
||||
CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE,
|
||||
CONFIG_SIGHT_MONSTER,
|
||||
CONFIG_SIGHT_GUARDER,
|
||||
CONFIG_LISTEN_RANGE_SAY,
|
||||
CONFIG_LISTEN_RANGE_TEXTEMOTE,
|
||||
CONFIG_LISTEN_RANGE_YELL,
|
||||
CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS,
|
||||
CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS,
|
||||
CONFIG_THREAT_RADIUS,
|
||||
FLOAT_CONFIG_VALUE_COUNT
|
||||
};
|
||||
|
||||
enum WorldIntConfigs
|
||||
{
|
||||
CONFIG_COMPRESSION = 0,
|
||||
CONFIG_INTERVAL_SAVE,
|
||||
CONFIG_INTERVAL_GRIDCLEAN,
|
||||
CONFIG_INTERVAL_MAPUPDATE,
|
||||
CONFIG_INTERVAL_CHANGEWEATHER,
|
||||
CONFIG_INTERVAL_DISCONNECT_TOLERANCE,
|
||||
CONFIG_PORT_WORLD,
|
||||
CONFIG_SOCKET_SELECTTIME,
|
||||
CONFIG_SOCKET_TIMEOUTTIME,
|
||||
CONFIG_SESSION_ADD_DELAY,
|
||||
CONFIG_GAME_TYPE,
|
||||
CONFIG_REALM_ZONE,
|
||||
CONFIG_STRICT_PLAYER_NAMES,
|
||||
CONFIG_STRICT_CHARTER_NAMES,
|
||||
CONFIG_STRICT_PET_NAMES,
|
||||
@@ -140,11 +217,8 @@ enum WorldConfigs
|
||||
CONFIG_START_ARENA_POINTS,
|
||||
CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL,
|
||||
CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE,
|
||||
CONFIG_INSTANCE_IGNORE_LEVEL,
|
||||
CONFIG_INSTANCE_IGNORE_RAID,
|
||||
CONFIG_INSTANCE_RESET_TIME_HOUR,
|
||||
CONFIG_INSTANCE_UNLOAD_DELAY,
|
||||
CONFIG_CAST_UNSTUCK,
|
||||
CONFIG_MAX_PRIMARY_TRADE_SKILL,
|
||||
CONFIG_MIN_PETITION_SIGNS,
|
||||
CONFIG_GM_LOGIN_STATE,
|
||||
@@ -154,12 +228,7 @@ enum WorldConfigs
|
||||
CONFIG_GM_WHISPERING_TO,
|
||||
CONFIG_GM_LEVEL_IN_GM_LIST,
|
||||
CONFIG_GM_LEVEL_IN_WHO_LIST,
|
||||
CONFIG_GM_LOG_TRADE,
|
||||
CONFIG_START_GM_LEVEL,
|
||||
CONFIG_ALLOW_GM_GROUP,
|
||||
CONFIG_ALLOW_GM_FRIEND,
|
||||
CONFIG_GM_LOWER_SECURITY,
|
||||
CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS,
|
||||
CONFIG_GROUP_VISIBILITY,
|
||||
CONFIG_MAIL_DELIVERY_DELAY,
|
||||
CONFIG_UPTIME_UPDATE,
|
||||
@@ -169,34 +238,21 @@ enum WorldConfigs
|
||||
CONFIG_SKILL_CHANCE_GREY,
|
||||
CONFIG_SKILL_CHANCE_MINING_STEPS,
|
||||
CONFIG_SKILL_CHANCE_SKINNING_STEPS,
|
||||
CONFIG_SKILL_PROSPECTING,
|
||||
CONFIG_SKILL_GAIN_CRAFTING,
|
||||
CONFIG_SKILL_GAIN_DEFENSE,
|
||||
CONFIG_SKILL_GAIN_GATHERING,
|
||||
CONFIG_SKILL_GAIN_WEAPON,
|
||||
CONFIG_DURABILITY_LOSS_IN_PVP,
|
||||
CONFIG_MAX_OVERSPEED_PINGS,
|
||||
CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY,
|
||||
CONFIG_ALWAYS_MAX_SKILL_FOR_LEVEL,
|
||||
CONFIG_WEATHER,
|
||||
CONFIG_EXPANSION,
|
||||
CONFIG_CHATFLOOD_MESSAGE_COUNT,
|
||||
CONFIG_CHATFLOOD_MESSAGE_DELAY,
|
||||
CONFIG_CHATFLOOD_MUTE_TIME,
|
||||
CONFIG_EVENT_ANNOUNCE,
|
||||
CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS,
|
||||
CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS,
|
||||
CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY,
|
||||
CONFIG_CREATURE_FAMILY_FLEE_DELAY,
|
||||
CONFIG_WORLD_BOSS_LEVEL_DIFF,
|
||||
CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF,
|
||||
CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF,
|
||||
CONFIG_QUEST_IGNORE_RAID,
|
||||
CONFIG_DETECT_POS_COLLISION,
|
||||
CONFIG_RESTRICTED_LFG_CHANNEL,
|
||||
CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL,
|
||||
CONFIG_TALENTS_INSPECTING,
|
||||
CONFIG_CHAT_FAKE_MESSAGE_PREVENTING,
|
||||
CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY,
|
||||
CONFIG_CHAT_STRICT_LINK_CHECKING_KICK,
|
||||
CONFIG_CHAT_CHANNEL_LEVEL_REQ,
|
||||
@@ -206,93 +262,47 @@ enum WorldConfigs
|
||||
CONFIG_TICKET_LEVEL_REQ,
|
||||
CONFIG_AUCTION_LEVEL_REQ,
|
||||
CONFIG_MAIL_LEVEL_REQ,
|
||||
CONFIG_ALLOW_PLAYER_COMMANDS,
|
||||
CONFIG_CORPSE_DECAY_NORMAL,
|
||||
CONFIG_CORPSE_DECAY_RARE,
|
||||
CONFIG_CORPSE_DECAY_ELITE,
|
||||
CONFIG_CORPSE_DECAY_RAREELITE,
|
||||
CONFIG_CORPSE_DECAY_WORLDBOSS,
|
||||
CONFIG_ADDON_CHANNEL,
|
||||
CONFIG_DEATH_SICKNESS_LEVEL,
|
||||
CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP,
|
||||
CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE,
|
||||
CONFIG_DEATH_BONES_WORLD,
|
||||
CONFIG_DEATH_BONES_BG_OR_ARENA,
|
||||
CONFIG_DIE_COMMAND_MODE,
|
||||
CONFIG_THREAT_RADIUS,
|
||||
CONFIG_INSTANT_LOGOUT,
|
||||
CONFIG_DISABLE_BREATHING,
|
||||
CONFIG_ALL_TAXI_PATHS,
|
||||
CONFIG_INSTANT_TAXI,
|
||||
CONFIG_DECLINED_NAMES_USED,
|
||||
CONFIG_LISTEN_RANGE_SAY,
|
||||
CONFIG_LISTEN_RANGE_TEXTEMOTE,
|
||||
CONFIG_LISTEN_RANGE_YELL,
|
||||
CONFIG_SKILL_MILLING,
|
||||
CONFIG_BATTLEGROUND_CAST_DESERTER,
|
||||
CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE,
|
||||
CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY,
|
||||
CONFIG_BATTLEGROUND_INVITATION_TYPE,
|
||||
CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER,
|
||||
CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH,
|
||||
CONFIG_ARENA_MAX_RATING_DIFFERENCE,
|
||||
CONFIG_ARENA_RATING_DISCARD_TIMER,
|
||||
CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS,
|
||||
CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS,
|
||||
CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE,
|
||||
CONFIG_ARENA_QUEUE_ANNOUNCER_PLAYERONLY,
|
||||
CONFIG_ARENA_SEASON_ID,
|
||||
CONFIG_ARENA_SEASON_IN_PROGRESS,
|
||||
CONFIG_ARENA_START_RATING,
|
||||
CONFIG_ARENA_START_PERSONAL_RATING,
|
||||
CONFIG_MAX_WHO,
|
||||
CONFIG_BG_START_MUSIC,
|
||||
CONFIG_START_ALL_SPELLS,
|
||||
CONFIG_HONOR_AFTER_DUEL,
|
||||
CONFIG_START_ALL_EXPLORED,
|
||||
CONFIG_START_ALL_REP,
|
||||
CONFIG_ALWAYS_MAXSKILL,
|
||||
CONFIG_PVP_TOKEN_ENABLE,
|
||||
CONFIG_PVP_TOKEN_MAP_TYPE,
|
||||
CONFIG_PVP_TOKEN_ID,
|
||||
CONFIG_PVP_TOKEN_COUNT,
|
||||
CONFIG_NO_RESET_TALENT_COST,
|
||||
CONFIG_SHOW_KICK_IN_WORLD,
|
||||
CONFIG_INTERVAL_LOG_UPDATE,
|
||||
CONFIG_MIN_LOG_UPDATE,
|
||||
CONFIG_ENABLE_SINFO_LOGIN,
|
||||
CONFIG_PLAYER_ALLOW_COMMANDS,
|
||||
CONFIG_PET_LOS,
|
||||
CONFIG_NUMTHREADS,
|
||||
CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN,
|
||||
CONFIG_CHATLOG_CHANNEL,
|
||||
CONFIG_CHATLOG_WHISPER,
|
||||
CONFIG_CHATLOG_SYSCHAN,
|
||||
CONFIG_CHATLOG_PARTY,
|
||||
CONFIG_CHATLOG_RAID,
|
||||
CONFIG_CHATLOG_GUILD,
|
||||
CONFIG_CHATLOG_PUBLIC,
|
||||
CONFIG_CHATLOG_ADDON,
|
||||
CONFIG_CHATLOG_BGROUND,
|
||||
CONFIG_LOGDB_CLEARINTERVAL,
|
||||
CONFIG_LOGDB_CLEARTIME,
|
||||
CONFIG_CLIENTCACHE_VERSION,
|
||||
CONFIG_GUILD_EVENT_LOG_COUNT,
|
||||
CONFIG_GUILD_BANK_EVENT_LOG_COUNT,
|
||||
CONFIG_MIN_LEVEL_STAT_SAVE,
|
||||
CONFIG_STATS_SAVE_ONLY_ON_LOGOUT,
|
||||
CONFIG_BG_XP_FOR_KILL,
|
||||
CONFIG_RANDOM_BG_RESET_HOUR,
|
||||
CONFIG_VMAP_INDOOR_CHECK,
|
||||
CONFIG_CHARDELETE_KEEP_DAYS,
|
||||
CONFIG_CHARDELETE_METHOD,
|
||||
CONFIG_CHARDELETE_MIN_LEVEL,
|
||||
CONFIG_CLEAN_CHARACTER_DB,
|
||||
CONFIG_DUNGEON_FINDER_ENABLE,
|
||||
CONFIG_MYSQL_BUNDLE_LOGINDB,
|
||||
CONFIG_MYSQL_BUNDLE_CHARDB,
|
||||
CONFIG_MYSQL_BUNDLE_WORLDDB,
|
||||
CONFIG_VALUE_COUNT
|
||||
INT_CONFIG_VALUE_COUNT
|
||||
};
|
||||
|
||||
/// Server rates
|
||||
@@ -579,7 +589,7 @@ class World
|
||||
uint32 GetUptime() const { return uint32(m_gameTime - m_startTime); }
|
||||
/// Update time
|
||||
uint32 GetUpdateTime() const { return m_updateTime; }
|
||||
void SetRecordDiffInterval(int32 t) { if (t >= 0) m_configs[CONFIG_INTERVAL_LOG_UPDATE] = (uint32)t; }
|
||||
void SetRecordDiffInterval(int32 t) { if (t >= 0) m_int_configs[CONFIG_INTERVAL_LOG_UPDATE] = (uint32)t; }
|
||||
|
||||
/// Next daily quests and random bg reset time
|
||||
time_t GetNextDailyQuestsResetTime() const { return m_NextDailyQuestReset; }
|
||||
@@ -589,7 +599,7 @@ class World
|
||||
/// Get the maximum skill level a player can reach
|
||||
uint16 GetConfigMaxSkillValue() const
|
||||
{
|
||||
uint8 lvl = getConfig(CONFIG_MAX_PLAYER_LEVEL);
|
||||
uint8 lvl = getIntConfig(CONFIG_MAX_PLAYER_LEVEL);
|
||||
return lvl > 60 ? 300 + ((lvl - 60) * 75) / 10 : lvl*5;
|
||||
}
|
||||
|
||||
@@ -623,16 +633,42 @@ class World
|
||||
float getRate(Rates rate) const { return rate_values[rate]; }
|
||||
|
||||
/// Set a server configuration element (see #WorldConfigs)
|
||||
void setConfig(uint32 index,uint32 value)
|
||||
void setBoolConfig(WorldBoolConfigs index, bool value)
|
||||
{
|
||||
if (index < CONFIG_VALUE_COUNT)
|
||||
m_configs[index] = value;
|
||||
if (index < BOOL_CONFIG_VALUE_COUNT)
|
||||
m_bool_configs[index] = value;
|
||||
}
|
||||
|
||||
/// Get a server configuration element (see #WorldConfigs)
|
||||
uint32 getConfig(uint32 index) const
|
||||
bool getBoolConfig(WorldBoolConfigs index) const
|
||||
{
|
||||
return index < CONFIG_VALUE_COUNT ? m_configs[index] : 0;
|
||||
return index < BOOL_CONFIG_VALUE_COUNT ? m_bool_configs[index] : 0;
|
||||
}
|
||||
|
||||
/// Set a server configuration element (see #WorldConfigs)
|
||||
void setFloatConfig(WorldFloatConfigs index, float value)
|
||||
{
|
||||
if (index < FLOAT_CONFIG_VALUE_COUNT)
|
||||
m_float_configs[index] = value;
|
||||
}
|
||||
|
||||
/// Get a server configuration element (see #WorldConfigs)
|
||||
float getFloatConfig(WorldFloatConfigs index) const
|
||||
{
|
||||
return index < FLOAT_CONFIG_VALUE_COUNT ? m_float_configs[index] : 0;
|
||||
}
|
||||
|
||||
/// Set a server configuration element (see #WorldConfigs)
|
||||
void setIntConfig(WorldIntConfigs index,uint32 value)
|
||||
{
|
||||
if (index < INT_CONFIG_VALUE_COUNT)
|
||||
m_int_configs[index] = value;
|
||||
}
|
||||
|
||||
/// Get a server configuration element (see #WorldConfigs)
|
||||
uint32 getIntConfig(WorldIntConfigs index) const
|
||||
{
|
||||
return index < INT_CONFIG_VALUE_COUNT ? m_int_configs[index] : 0;
|
||||
}
|
||||
|
||||
void setWorldState(uint32 index, uint64 value);
|
||||
@@ -640,8 +676,8 @@ class World
|
||||
void LoadWorldStates();
|
||||
|
||||
/// Are we on a "Player versus Player" server?
|
||||
bool IsPvPRealm() { return (getConfig(CONFIG_GAME_TYPE) == REALM_TYPE_PVP || getConfig(CONFIG_GAME_TYPE) == REALM_TYPE_RPPVP || getConfig(CONFIG_GAME_TYPE) == REALM_TYPE_FFA_PVP); }
|
||||
bool IsFFAPvPRealm() { return getConfig(CONFIG_GAME_TYPE) == REALM_TYPE_FFA_PVP; }
|
||||
bool IsPvPRealm() { return (getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_PVP || getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_RPPVP || getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_FFA_PVP); }
|
||||
bool IsFFAPvPRealm() { return getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_FFA_PVP; }
|
||||
|
||||
void KickAll();
|
||||
void KickAllLess(AccountTypes sec);
|
||||
@@ -737,7 +773,9 @@ class World
|
||||
std::string m_newCharString;
|
||||
|
||||
float rate_values[MAX_RATES];
|
||||
uint32 m_configs[CONFIG_VALUE_COUNT];
|
||||
uint32 m_int_configs[INT_CONFIG_VALUE_COUNT];
|
||||
bool m_bool_configs[BOOL_CONFIG_VALUE_COUNT];
|
||||
float m_float_configs[FLOAT_CONFIG_VALUE_COUNT];
|
||||
typedef std::map<uint32,uint64> WorldStatesMap;
|
||||
WorldStatesMap m_worldstates;
|
||||
int32 m_playerLimit;
|
||||
|
||||
@@ -30,31 +30,31 @@ public:
|
||||
switch (type)
|
||||
{
|
||||
case CHAT_MSG_ADDON:
|
||||
if (sWorld.getConfig(CONFIG_CHATLOG_ADDON))
|
||||
if (sWorld.getBoolConfig(CONFIG_CHATLOG_ADDON))
|
||||
sLog.outChat("[ADDON] Player %s sends: %s",
|
||||
player->GetName(), msg.c_str());
|
||||
break;
|
||||
|
||||
case CHAT_MSG_SAY:
|
||||
if (sWorld.getConfig(CONFIG_CHATLOG_PUBLIC))
|
||||
if (sWorld.getBoolConfig(CONFIG_CHATLOG_PUBLIC))
|
||||
sLog.outChat("[SAY] Player %s says (language %u): %s",
|
||||
player->GetName(), lang, msg.c_str());
|
||||
break;
|
||||
|
||||
case CHAT_MSG_EMOTE:
|
||||
if (sWorld.getConfig(CONFIG_CHATLOG_PUBLIC))
|
||||
if (sWorld.getBoolConfig(CONFIG_CHATLOG_PUBLIC))
|
||||
sLog.outChat("[TEXTEMOTE] Player %s emotes: %s",
|
||||
player->GetName(), msg.c_str());
|
||||
break;
|
||||
|
||||
case CHAT_MSG_YELL:
|
||||
if (sWorld.getConfig(CONFIG_CHATLOG_PUBLIC))
|
||||
if (sWorld.getBoolConfig(CONFIG_CHATLOG_PUBLIC))
|
||||
sLog.outChat("[YELL] Player %s yells (language %u): %s",
|
||||
player->GetName(), lang, msg.c_str());
|
||||
break;
|
||||
|
||||
case CHAT_MSG_WHISPER:
|
||||
if (sWorld.getConfig(CONFIG_CHATLOG_WHISPER))
|
||||
if (sWorld.getBoolConfig(CONFIG_CHATLOG_WHISPER))
|
||||
{
|
||||
Player* pReceiver = reinterpret_cast <Player*> (param);
|
||||
sLog.outChat("[WHISPER] Player %s tells %s: %s",
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
break;
|
||||
|
||||
case CHAT_MSG_PARTY:
|
||||
if (sWorld.getConfig(CONFIG_CHATLOG_PARTY))
|
||||
if (sWorld.getBoolConfig(CONFIG_CHATLOG_PARTY))
|
||||
{
|
||||
Group* pGroup = reinterpret_cast <Group*> (param);
|
||||
sLog.outChat("[PARTY] Player %s tells group with leader %s: %s",
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
break;
|
||||
|
||||
case CHAT_MSG_PARTY_LEADER:
|
||||
if (sWorld.getConfig(CONFIG_CHATLOG_PARTY))
|
||||
if (sWorld.getBoolConfig(CONFIG_CHATLOG_PARTY))
|
||||
sLog.outChat("[PARTY] Leader %s tells group: %s",
|
||||
player->GetName(), msg.c_str());
|
||||
break;
|
||||
@@ -80,12 +80,12 @@ public:
|
||||
case CHAT_MSG_GUILD:
|
||||
{
|
||||
Guild* pGuild = reinterpret_cast <Guild*> (param);
|
||||
if (lang != LANG_ADDON && sWorld.getConfig(CONFIG_CHATLOG_GUILD))
|
||||
if (lang != LANG_ADDON && sWorld.getBoolConfig(CONFIG_CHATLOG_GUILD))
|
||||
{
|
||||
sLog.outChat("[GUILD] Player %s tells guild %s: %s",
|
||||
player->GetName(), pGuild ? pGuild->GetName().c_str() : "<unknown>", msg.c_str());
|
||||
}
|
||||
else if (lang == LANG_ADDON && sWorld.getConfig(CONFIG_CHATLOG_ADDON))
|
||||
else if (lang == LANG_ADDON && sWorld.getBoolConfig(CONFIG_CHATLOG_ADDON))
|
||||
{
|
||||
sLog.outChat("[ADDON] Player %s sends to guild %s: %s",
|
||||
player->GetName(), pGuild ? pGuild->GetName().c_str() : "<unknown>", msg.c_str());
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
}
|
||||
|
||||
case CHAT_MSG_OFFICER:
|
||||
if (sWorld.getConfig(CONFIG_CHATLOG_GUILD))
|
||||
if (sWorld.getBoolConfig(CONFIG_CHATLOG_GUILD))
|
||||
{
|
||||
Guild* pGuild = reinterpret_cast <Guild*> (param);
|
||||
sLog.outChat("[OFFICER] Player %s tells guild %s officers: %s",
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
break;
|
||||
|
||||
case CHAT_MSG_RAID:
|
||||
if (sWorld.getConfig(CONFIG_CHATLOG_RAID))
|
||||
if (sWorld.getBoolConfig(CONFIG_CHATLOG_RAID))
|
||||
{
|
||||
Group* pGroup = reinterpret_cast <Group*> (param);
|
||||
sLog.outChat("[RAID] Player %s tells raid with leader %s: %s",
|
||||
@@ -112,19 +112,19 @@ public:
|
||||
break;
|
||||
|
||||
case CHAT_MSG_RAID_LEADER:
|
||||
if (sWorld.getConfig(CONFIG_CHATLOG_RAID))
|
||||
if (sWorld.getBoolConfig(CONFIG_CHATLOG_RAID))
|
||||
sLog.outChat("[RAID] Leader player %s tells raid: %s",
|
||||
player->GetName(), msg.c_str());
|
||||
break;
|
||||
|
||||
case CHAT_MSG_RAID_WARNING:
|
||||
if (sWorld.getConfig(CONFIG_CHATLOG_RAID))
|
||||
if (sWorld.getBoolConfig(CONFIG_CHATLOG_RAID))
|
||||
sLog.outChat("[RAID] Leader player %s warns raid with: %s",
|
||||
player->GetName(), msg.c_str());
|
||||
break;
|
||||
|
||||
case CHAT_MSG_BATTLEGROUND:
|
||||
if (sWorld.getConfig(CONFIG_CHATLOG_BGROUND))
|
||||
if (sWorld.getBoolConfig(CONFIG_CHATLOG_BGROUND))
|
||||
{
|
||||
Group* pGroup = reinterpret_cast <Group*> (param);
|
||||
sLog.outChat("[BATTLEGROUND] Player %s tells battleground with leader %s: %s",
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
break;
|
||||
|
||||
case CHAT_MSG_BATTLEGROUND_LEADER:
|
||||
if (sWorld.getConfig(CONFIG_CHATLOG_BGROUND))
|
||||
if (sWorld.getBoolConfig(CONFIG_CHATLOG_BGROUND))
|
||||
sLog.outChat("[RAID] Leader player %s tells battleground: %s",
|
||||
player->GetName(), msg.c_str());
|
||||
break;
|
||||
@@ -146,10 +146,10 @@ public:
|
||||
pChannel->HasFlag(CHANNEL_FLAG_GENERAL) ||
|
||||
pChannel->HasFlag(CHANNEL_FLAG_CITY) ||
|
||||
pChannel->HasFlag(CHANNEL_FLAG_LFG));
|
||||
if (sWorld.getConfig(CONFIG_CHATLOG_SYSCHAN) && isSystem)
|
||||
if (sWorld.getBoolConfig(CONFIG_CHATLOG_SYSCHAN) && isSystem)
|
||||
sLog.outChat("[SYSCHAN] Player %s tells channel %s: %s",
|
||||
player->GetName(), pChannel->GetName().c_str(), msg.c_str());
|
||||
else if (sWorld.getConfig(CONFIG_CHATLOG_CHANNEL))
|
||||
else if (sWorld.getBoolConfig(CONFIG_CHATLOG_CHANNEL))
|
||||
sLog.outChat("[CHANNEL] Player %s tells channel %s: %s",
|
||||
player->GetName(), pChannel ? pChannel->GetName().c_str() : "<unknown>", msg.c_str());
|
||||
break;
|
||||
|
||||
@@ -1283,7 +1283,7 @@ public:
|
||||
if (pCreature->isCanTrainingAndResetTalentsOf(pPlayer))
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_HELLO_ROGUE1, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_UNLEARNTALENTS);
|
||||
|
||||
if (!(pPlayer->GetSpecsCount() == 1 && pCreature->isCanTrainingAndResetTalentsOf(pPlayer) && !(pPlayer->getLevel() < sWorld.getConfig(CONFIG_MIN_DUALSPEC_LEVEL))))
|
||||
if (!(pPlayer->GetSpecsCount() == 1 && pCreature->isCanTrainingAndResetTalentsOf(pPlayer) && !(pPlayer->getLevel() < sWorld.getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL))))
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_HELLO_ROGUE3, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_LEARNDUALSPEC);
|
||||
|
||||
if (pPlayer->getClass() == CLASS_ROGUE && pPlayer->getLevel() >= 24 && !pPlayer->HasItemCount(17126,1) && !pPlayer->GetQuestRewardStatus(6681))
|
||||
@@ -1312,7 +1312,7 @@ public:
|
||||
pPlayer->SendTalentWipeConfirm(pCreature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_OPTION_LEARNDUALSPEC:
|
||||
if (pPlayer->GetSpecsCount() == 1 && !(pPlayer->getLevel() < sWorld.getConfig(CONFIG_MIN_DUALSPEC_LEVEL)))
|
||||
if (pPlayer->GetSpecsCount() == 1 && !(pPlayer->getLevel() < sWorld.getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL)))
|
||||
{
|
||||
if (!pPlayer->HasEnoughMoney(10000000))
|
||||
{
|
||||
|
||||
@@ -471,7 +471,7 @@ bool ChatHandler::HandleCharacterDeletedDeleteCommand(const char* args)
|
||||
*/
|
||||
bool ChatHandler::HandleCharacterDeletedOldCommand(const char* args)
|
||||
{
|
||||
int32 keepDays = sWorld.getConfig(CONFIG_CHARDELETE_KEEP_DAYS);
|
||||
int32 keepDays = sWorld.getIntConfig(CONFIG_CHARDELETE_KEEP_DAYS);
|
||||
|
||||
char* px = strtok((char*)args, " ");
|
||||
if (px)
|
||||
@@ -700,19 +700,19 @@ void CliRunnable::run()
|
||||
{
|
||||
///- Init MySQL threads or connections
|
||||
bool needInit = true;
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_WORLDDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_WORLDDB) & MYSQL_BUNDLE_RA))
|
||||
{
|
||||
WorldDatabase.Init_MySQL_Connection();
|
||||
needInit = false;
|
||||
}
|
||||
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_LOGINDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_LOGINDB) & MYSQL_BUNDLE_RA))
|
||||
{
|
||||
LoginDatabase.Init_MySQL_Connection();
|
||||
needInit = false;
|
||||
}
|
||||
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_CHARDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_CHARDB) & MYSQL_BUNDLE_RA))
|
||||
{
|
||||
CharacterDatabase.Init_MySQL_Connection();
|
||||
needInit = false;
|
||||
@@ -788,12 +788,12 @@ void CliRunnable::run()
|
||||
}
|
||||
|
||||
///- Free MySQL thread resources and deallocate lingering connections
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_WORLDDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_WORLDDB) & MYSQL_BUNDLE_RA))
|
||||
WorldDatabase.End_MySQL_Connection();
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_LOGINDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_LOGINDB) & MYSQL_BUNDLE_RA))
|
||||
LoginDatabase.End_MySQL_Connection();
|
||||
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_CHARDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_CHARDB) & MYSQL_BUNDLE_RA))
|
||||
CharacterDatabase.End_MySQL_Connection();
|
||||
if (needInit)
|
||||
MySQL::Thread_End();
|
||||
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
|
||||
RARunnable ()
|
||||
{
|
||||
uint32 socketSelecttime = sWorld.getConfig (CONFIG_SOCKET_SELECTTIME);
|
||||
uint32 socketSelecttime = sWorld.getIntConfig(CONFIG_SOCKET_SELECTTIME);
|
||||
numLoops = (sConfig.GetIntDefault ("MaxPingTime", 30) * (MINUTE * 1000000 / socketSelecttime));
|
||||
loopCounter = 0;
|
||||
}
|
||||
@@ -166,7 +166,7 @@ public:
|
||||
}
|
||||
|
||||
// Socket Selet time is in microseconds , not miliseconds!!
|
||||
uint32 socketSelecttime = sWorld.getConfig (CONFIG_SOCKET_SELECTTIME);
|
||||
uint32 socketSelecttime = sWorld.getIntConfig(CONFIG_SOCKET_SELECTTIME);
|
||||
|
||||
// if use ra spend time waiting for io, if not use ra ,just sleep
|
||||
if (usera)
|
||||
@@ -339,7 +339,7 @@ int Master::Run()
|
||||
}
|
||||
|
||||
///- Launch the world listener socket
|
||||
port_t wsport = sWorld.getConfig (CONFIG_PORT_WORLD);
|
||||
port_t wsport = sWorld.getIntConfig(CONFIG_PORT_WORLD);
|
||||
std::string bind_ip = sConfig.GetStringDefault ("BindIP", "0.0.0.0");
|
||||
|
||||
if (sWorldSocketMgr->StartNetwork (wsport, bind_ip.c_str ()) == -1)
|
||||
|
||||
@@ -45,18 +45,18 @@ void WorldRunnable::run()
|
||||
{
|
||||
///- Init MySQL threads or connections
|
||||
bool needInit = true;
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_WORLDDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_WORLDDB) & MYSQL_BUNDLE_RA))
|
||||
{
|
||||
WorldDatabase.Init_MySQL_Connection();
|
||||
needInit = false;
|
||||
}
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_LOGINDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_LOGINDB) & MYSQL_BUNDLE_RA))
|
||||
{
|
||||
LoginDatabase.Init_MySQL_Connection();
|
||||
needInit = false;
|
||||
}
|
||||
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_CHARDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_CHARDB) & MYSQL_BUNDLE_RA))
|
||||
{
|
||||
CharacterDatabase.Init_MySQL_Connection();
|
||||
needInit = false;
|
||||
@@ -117,13 +117,13 @@ void WorldRunnable::run()
|
||||
sMapMgr.UnloadAll(); // unload all grids (including locked in memory)
|
||||
|
||||
///- Free MySQL thread resources and deallocate lingering connections
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_WORLDDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_WORLDDB) & MYSQL_BUNDLE_RA))
|
||||
WorldDatabase.End_MySQL_Connection();
|
||||
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_LOGINDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_LOGINDB) & MYSQL_BUNDLE_RA))
|
||||
LoginDatabase.End_MySQL_Connection();
|
||||
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_CHARDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_CHARDB) & MYSQL_BUNDLE_RA))
|
||||
CharacterDatabase.End_MySQL_Connection();
|
||||
|
||||
if (needInit)
|
||||
|
||||
Reference in New Issue
Block a user