[9389] Cleanup config data. Use proper names and expected types.

This commit is contained in:
AlexDereka 2010-02-15 15:28:59 +03:00
parent 58d188f21a
commit ebfb0f9835
63 changed files with 1591 additions and 967 deletions

View file

@ -385,7 +385,7 @@ void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uin
if((sLog.getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES)==0) if((sLog.getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES)==0)
sLog.outDetail("AchievementMgr::ResetAchievementCriteria(%u, %u, %u)", type, miscvalue1, miscvalue2); 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.getConfig(CONFIG_BOOL_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER)
return; return;
AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr.GetAchievementCriteriaByType(type); AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr.GetAchievementCriteriaByType(type);
@ -625,9 +625,9 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
MaNGOS::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED,achievement->ID); MaNGOS::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED,achievement->ID);
MaNGOS::LocalizedPacketDo<MaNGOS::AchievementChatBuilder> say_do(say_builder); MaNGOS::LocalizedPacketDo<MaNGOS::AchievementChatBuilder> say_do(say_builder);
MaNGOS::PlayerDistWorker<MaNGOS::LocalizedPacketDo<MaNGOS::AchievementChatBuilder> > say_worker(GetPlayer(),sWorld.getRate(RATE_LISTEN_RANGE_SAY),say_do); MaNGOS::PlayerDistWorker<MaNGOS::LocalizedPacketDo<MaNGOS::AchievementChatBuilder> > say_worker(GetPlayer(),sWorld.getConfig(CONFIG_FLOAT_LISTEN_RANGE_SAY),say_do);
TypeContainerVisitor<MaNGOS::PlayerDistWorker<MaNGOS::LocalizedPacketDo<MaNGOS::AchievementChatBuilder> >, WorldTypeMapContainer > message(say_worker); TypeContainerVisitor<MaNGOS::PlayerDistWorker<MaNGOS::LocalizedPacketDo<MaNGOS::AchievementChatBuilder> >, WorldTypeMapContainer > message(say_worker);
cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld.getRate(RATE_LISTEN_RANGE_SAY)); cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld.getConfig(CONFIG_FLOAT_LISTEN_RANGE_SAY));
} }
WorldPacket data(SMSG_ACHIEVEMENT_EARNED, 8+4+8); WorldPacket data(SMSG_ACHIEVEMENT_EARNED, 8+4+8);
@ -635,7 +635,7 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
data << uint32(achievement->ID); data << uint32(achievement->ID);
data << uint32(secsToTimeBitFields(time(NULL))); data << uint32(secsToTimeBitFields(time(NULL)));
data << uint32(0); data << uint32(0);
GetPlayer()->SendMessageToSetInRange(&data, sWorld.getRate(RATE_LISTEN_RANGE_SAY), true); GetPlayer()->SendMessageToSetInRange(&data, sWorld.getConfig(CONFIG_FLOAT_LISTEN_RANGE_SAY), true);
} }
void AchievementMgr::SendCriteriaUpdate(uint32 id, CriteriaProgress const* progress) void AchievementMgr::SendCriteriaUpdate(uint32 id, CriteriaProgress const* progress)
@ -684,7 +684,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
if((sLog.getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES)==0) if((sLog.getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES)==0)
sLog.outDetail("AchievementMgr::UpdateAchievementCriteria(%u, %u, %u, %u)", type, miscvalue1, miscvalue2, time); 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.getConfig(CONFIG_BOOL_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER)
return; return;
AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr.GetAchievementCriteriaByType(type); AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr.GetAchievementCriteriaByType(type);

View file

@ -141,7 +141,7 @@ AggressorAI::UpdateAI(const uint32 /*diff*/)
bool bool
AggressorAI::IsVisible(Unit *pl) const AggressorAI::IsVisible(Unit *pl) const
{ {
return m_creature->IsWithinDist(pl,sWorld.getRate(RATE_SIGHT_MONSTER)) return m_creature->IsWithinDist(pl,sWorld.getConfig(CONFIG_FLOAT_SIGHT_MONSTER))
&& pl->isVisibleForOrDetect(m_creature,m_creature,true); && pl->isVisibleForOrDetect(m_creature,m_creature,true);
} }

View file

@ -36,7 +36,7 @@ ArenaTeam::ArenaTeam()
m_stats.games_week = 0; m_stats.games_week = 0;
m_stats.games_season = 0; m_stats.games_season = 0;
m_stats.rank = 0; m_stats.rank = 0;
if (sWorld.getConfig(CONFIG_ARENA_SEASON_ID) >= 6) if (sWorld.getConfig(CONFIG_UINT32_ARENA_SEASON_ID) >= 6)
m_stats.rating = 0; m_stats.rating = 0;
else else
m_stats.rating = 1500; m_stats.rating = 1500;
@ -134,7 +134,7 @@ bool ArenaTeam::AddMember(const uint64& PlayerGuid)
newmember.games_week = 0; newmember.games_week = 0;
newmember.wins_season = 0; newmember.wins_season = 0;
newmember.wins_week = 0; newmember.wins_week = 0;
if (sWorld.getConfig(CONFIG_ARENA_SEASON_ID) >= 6) if (sWorld.getConfig(CONFIG_UINT32_ARENA_SEASON_ID) >= 6)
{ {
if (m_stats.rating < 1000) if (m_stats.rating < 1000)
newmember.personal_rating = 0; newmember.personal_rating = 0;
@ -543,7 +543,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 // returns the chance to win against a team with the given rating, used in the rating adjustment calculation
// ELO system // ELO system
if (sWorld.getConfig(CONFIG_ARENA_SEASON_ID) >= 6) if (sWorld.getConfig(CONFIG_UINT32_ARENA_SEASON_ID) >= 6)
if (enemy_rating < 1000) if (enemy_rating < 1000)
enemy_rating = 1000; enemy_rating = 1000;
return 1.0f/(1.0f+exp(log(10.0f)*(float)((float)enemy_rating - (float)own_rating)/400.0f)); return 1.0f/(1.0f+exp(log(10.0f)*(float)((float)enemy_rating - (float)own_rating)/400.0f));

View file

@ -97,7 +97,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recv_data)
return; return;
} }
if(player->getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) if(player->getLevel() < sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
{ {
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", player->GetName(), ERR_ARENA_TEAM_TARGET_TOO_LOW_S); SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", player->GetName(), ERR_ARENA_TEAM_TARGET_TOO_LOW_S);
return; return;
@ -114,7 +114,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recv_data)
if(player->GetSocial()->HasIgnore(GetPlayer()->GetGUIDLow())) if(player->GetSocial()->HasIgnore(GetPlayer()->GetGUIDLow()))
return; return;
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != GetPlayer()->GetTeam()) if (!sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != GetPlayer()->GetTeam())
{ {
SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED); SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED);
return; return;
@ -165,7 +165,7 @@ void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recv_data*/)
return; return;
} }
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && _player->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(at->GetCaptain())) if (!sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_GUILD) && _player->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(at->GetCaptain()))
{ {
// not let enemies sign petition // not let enemies sign petition
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", "", ERR_ARENA_TEAM_NOT_ALLIED); SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", "", ERR_ARENA_TEAM_NOT_ALLIED);

View file

@ -238,7 +238,7 @@ void WorldSession::HandleAuctionSellItem( WorldPacket & recv_data )
return; return;
} }
if( GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE) ) if( GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_BOOL_GM_LOG_TRADE) )
{ {
sLog.outCommand(GetAccountId(),"GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)", sLog.outCommand(GetAccountId(),"GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)",
GetPlayerName(),GetAccountId(),it->GetProto()->Name1,it->GetEntry(),it->GetCount()); GetPlayerName(),GetAccountId(),it->GetProto()->Name1,it->GetEntry(),it->GetCount());
@ -246,7 +246,7 @@ void WorldSession::HandleAuctionSellItem( WorldPacket & recv_data )
pl->ModifyMoney( -int32(deposit) ); pl->ModifyMoney( -int32(deposit) );
uint32 auction_time = uint32(etime * sWorld.getRate(RATE_AUCTION_TIME)); uint32 auction_time = uint32(etime * sWorld.getConfig(CONFIG_FLOAT_RATE_AUCTION_TIME));
AuctionEntry *AH = new AuctionEntry; AuctionEntry *AH = new AuctionEntry;
AH->Id = sObjectMgr.GenerateAuctionID(); AH->Id = sObjectMgr.GenerateAuctionID();

View file

@ -50,7 +50,7 @@ AuctionHouseMgr::~AuctionHouseMgr()
AuctionHouseObject * AuctionHouseMgr::GetAuctionsMap( uint32 factionTemplateId ) AuctionHouseObject * AuctionHouseMgr::GetAuctionsMap( uint32 factionTemplateId )
{ {
if(sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION)) if(sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_AUCTION))
return &mNeutralAuctions; return &mNeutralAuctions;
// team have linked auction houses // team have linked auction houses
@ -69,7 +69,7 @@ uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32
{ {
uint32 deposit = pItem->GetProto()->SellPrice * pItem->GetCount() * (time / MIN_AUCTION_TIME ); uint32 deposit = pItem->GetProto()->SellPrice * pItem->GetCount() * (time / MIN_AUCTION_TIME );
return uint32(deposit * entry->depositPercent * 3 * sWorld.getRate(RATE_AUCTION_DEPOSIT) / 100.0f ); return uint32(deposit * entry->depositPercent * 3 * sWorld.getConfig(CONFIG_FLOAT_RATE_AUCTION_DEPOSIT) / 100.0f );
} }
//does not clear ram //does not clear ram
@ -85,7 +85,7 @@ void AuctionHouseMgr::SendAuctionWonMail( AuctionEntry *auction )
uint32 bidder_accId = 0; uint32 bidder_accId = 0;
// data for gm.log // data for gm.log
if( sWorld.getConfig(CONFIG_GM_LOG_TRADE) ) if( sWorld.getConfig(CONFIG_BOOL_GM_LOG_TRADE) )
{ {
uint32 bidder_security = 0; uint32 bidder_security = 0;
std::string bidder_name; std::string bidder_name;
@ -465,7 +465,7 @@ AuctionHouseEntry const* AuctionHouseMgr::GetAuctionHouseEntry(uint32 factionTem
{ {
uint32 houseid = 1; // dwarf auction house (used for normal cut/etc percents) uint32 houseid = 1; // dwarf auction house (used for normal cut/etc percents)
if(!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION)) if(!sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_AUCTION))
{ {
//FIXME: found way for proper auctionhouse selection by another way //FIXME: found way for proper auctionhouse selection by another way
// AuctionHo use.dbc have faction field with _player_ factions associated with auction house races. // AuctionHo use.dbc have faction field with _player_ factions associated with auction house races.
@ -662,7 +662,7 @@ bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const
uint32 AuctionEntry::GetAuctionCut() const uint32 AuctionEntry::GetAuctionCut() const
{ {
return uint32(auctionHouseEntry->cutPercent * bid * sWorld.getRate(RATE_AUCTION_CUT) / 100.0f); return uint32(auctionHouseEntry->cutPercent * bid * sWorld.getConfig(CONFIG_FLOAT_RATE_AUCTION_CUT) / 100.0f);
} }
/// the sum of outbid is (1% from current bid)*5, if bid is very small, it is 1c /// the sum of outbid is (1% from current bid)*5, if bid is very small, it is 1c

View file

@ -471,7 +471,7 @@ void BattleGround::Update(uint32 diff)
if (Player* plr = sObjectMgr.GetPlayer(itr->first)) if (Player* plr = sObjectMgr.GetPlayer(itr->first))
plr->RemoveAurasDueToSpell(SPELL_PREPARATION); plr->RemoveAurasDueToSpell(SPELL_PREPARATION);
//Announce BG starting //Announce BG starting
if (sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE)) if (sWorld.getConfig(CONFIG_BOOL_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE))
{ {
sWorld.SendWorldText(LANG_BG_STARTED_ANNOUNCE_WORLD, GetName(), GetMinLevel(), GetMaxLevel()); sWorld.SendWorldText(LANG_BG_STARTED_ANNOUNCE_WORLD, GetName(), GetMinLevel(), GetMaxLevel());
} }

View file

@ -178,7 +178,7 @@ GroupQueueInfo * BattleGroundQueue::AddGroup(Player *leader, Group* grp, BattleG
uint32 lastOnlineTime = getMSTime(); uint32 lastOnlineTime = getMSTime();
//announce world (this don't need mutex) //announce world (this don't need mutex)
if (isRated && sWorld.getConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE)) if (isRated && sWorld.getConfig(CONFIG_BOOL_ARENA_QUEUE_ANNOUNCER_ENABLE))
{ {
sWorld.SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, ginfo->ArenaType, ginfo->ArenaType, ginfo->ArenaTeamRating); sWorld.SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, ginfo->ArenaType, ginfo->ArenaType, ginfo->ArenaTeamRating);
} }
@ -212,7 +212,7 @@ GroupQueueInfo * BattleGroundQueue::AddGroup(Player *leader, Group* grp, BattleG
m_QueuedGroups[bracketId][index].push_back(ginfo); m_QueuedGroups[bracketId][index].push_back(ginfo);
//announce to world, this code needs mutex //announce to world, this code needs mutex
if (!isRated && !isPremade && sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE)) if (!isRated && !isPremade && sWorld.getConfig(CONFIG_BOOL_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE))
{ {
if (BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(ginfo->BgTypeId)) if (BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(ginfo->BgTypeId))
{ {
@ -231,7 +231,7 @@ GroupQueueInfo * BattleGroundQueue::AddGroup(Player *leader, Group* grp, BattleG
qHorde += (*itr)->Players.size(); qHorde += (*itr)->Players.size();
// Show queue status to player only (when joining queue) // Show queue status to player only (when joining queue)
if (sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY)) if (sWorld.getConfig(CONFIG_BOOL_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY))
{ {
ChatHandler(leader).PSendSysMessage(LANG_BG_QUEUE_ANNOUNCE_SELF, bgName, q_min_level, q_max_level, 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); qAlliance, (MinPlayers > qAlliance) ? MinPlayers - qAlliance : (uint32)0, qHorde, (MinPlayers > qHorde) ? MinPlayers - qHorde : (uint32)0);
@ -372,7 +372,7 @@ void BattleGroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou
m_QueuedPlayers.erase(itr); m_QueuedPlayers.erase(itr);
// announce to world if arena team left queue for rated match, show only once // 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.getConfig(CONFIG_BOOL_ARENA_QUEUE_ANNOUNCER_ENABLE))
sWorld.SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT, group->ArenaType, group->ArenaType, group->ArenaTeamRating); sWorld.SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT, group->ArenaType, group->ArenaType, group->ArenaTeamRating);
//if player leaves queue and he is invited to rated arena match, then he have to loose //if player leaves queue and he is invited to rated arena match, then he have to loose
@ -528,7 +528,7 @@ void BattleGroundQueue::FillPlayersToBG(BattleGround* bg, BattleGroundBracketId
++Horde_itr; ++Horde_itr;
//if ofc like BG queue invitation is set in config, then we are happy //if ofc like BG queue invitation is set in config, then we are happy
if (sWorld.getConfig(CONFIG_BATTLEGROUND_INVITATION_TYPE) == 0) if (sWorld.getConfig(CONFIG_UINT32_BATTLEGROUND_INVITATION_TYPE) == 0)
return; return;
/* /*
@ -624,7 +624,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 - // 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 // 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 // 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.getConfig(CONFIG_UINT32_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH);
for(uint32 i = 0; i < BG_TEAMS_COUNT; i++) for(uint32 i = 0; i < BG_TEAMS_COUNT; i++)
{ {
if (!m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE + i].empty()) if (!m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE + i].empty())
@ -663,7 +663,7 @@ bool BattleGroundQueue::CheckNormalMatch(BattleGround* bg_template, BattleGround
uint32 j = BG_TEAM_ALLIANCE; uint32 j = BG_TEAM_ALLIANCE;
if (m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() < m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount()) if (m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() < m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount())
j = BG_TEAM_HORDE; j = BG_TEAM_HORDE;
if( sWorld.getConfig(CONFIG_BATTLEGROUND_INVITATION_TYPE) != 0 if( sWorld.getConfig(CONFIG_UINT32_BATTLEGROUND_INVITATION_TYPE) != 0
&& m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() >= minPlayers && m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() >= minPlayers ) && 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 //we will try to invite more groups to team with less players indexed by j
@ -1127,7 +1127,7 @@ BattleGroundMgr::BattleGroundMgr() : m_AutoDistributionTimeChecker(0), m_ArenaTe
{ {
for(uint32 i = BATTLEGROUND_TYPE_NONE; i < MAX_BATTLEGROUND_TYPE_ID; i++) for(uint32 i = BATTLEGROUND_TYPE_NONE; i < MAX_BATTLEGROUND_TYPE_ID; i++)
m_BattleGrounds[i].clear(); m_BattleGrounds[i].clear();
m_NextRatingDiscardUpdate = sWorld.getConfig(CONFIG_ARENA_RATING_DISCARD_TIMER); m_NextRatingDiscardUpdate = sWorld.getConfig(CONFIG_UINT32_ARENA_RATING_DISCARD_TIMER);
m_Testing=false; m_Testing=false;
} }
@ -1212,7 +1212,7 @@ void BattleGroundMgr::Update(uint32 diff)
} }
// if rating difference counts, maybe force-update queues // 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.getConfig(CONFIG_UINT32_ARENA_MAX_RATING_DIFFERENCE) && sWorld.getConfig(CONFIG_UINT32_ARENA_RATING_DISCARD_TIMER))
{ {
// it's time to force update // it's time to force update
if (m_NextRatingDiscardUpdate < diff) if (m_NextRatingDiscardUpdate < diff)
@ -1225,19 +1225,19 @@ void BattleGroundMgr::Update(uint32 diff)
BATTLEGROUND_AA, BattleGroundBracketId(bracket), BATTLEGROUND_AA, BattleGroundBracketId(bracket),
BattleGroundMgr::BGArenaType(BattleGroundQueueTypeId(qtype)), true, 0); BattleGroundMgr::BGArenaType(BattleGroundQueueTypeId(qtype)), true, 0);
m_NextRatingDiscardUpdate = sWorld.getConfig(CONFIG_ARENA_RATING_DISCARD_TIMER); m_NextRatingDiscardUpdate = sWorld.getConfig(CONFIG_UINT32_ARENA_RATING_DISCARD_TIMER);
} }
else else
m_NextRatingDiscardUpdate -= diff; m_NextRatingDiscardUpdate -= diff;
} }
if (sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS)) if (sWorld.getConfig(CONFIG_BOOL_ARENA_AUTO_DISTRIBUTE_POINTS))
{ {
if (m_AutoDistributionTimeChecker < diff) if (m_AutoDistributionTimeChecker < diff)
{ {
if (sWorld.GetGameTime() > m_NextAutoDistributionTime) if (sWorld.GetGameTime() > m_NextAutoDistributionTime)
{ {
DistributeArenaPoints(); DistributeArenaPoints();
m_NextAutoDistributionTime = time_t(sWorld.GetGameTime() + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS)); m_NextAutoDistributionTime = time_t(sWorld.GetGameTime() + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getConfig(CONFIG_UINT32_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS));
CharacterDatabase.PExecute("UPDATE saved_variables SET NextArenaPointDistributionTime = '"UI64FMTD"'", uint64(m_NextAutoDistributionTime)); CharacterDatabase.PExecute("UPDATE saved_variables SET NextArenaPointDistributionTime = '"UI64FMTD"'", uint64(m_NextAutoDistributionTime));
} }
m_AutoDistributionTimeChecker = 600000; // check 10 minutes m_AutoDistributionTimeChecker = 600000; // check 10 minutes
@ -1758,14 +1758,14 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
void BattleGroundMgr::InitAutomaticArenaPointDistribution() void BattleGroundMgr::InitAutomaticArenaPointDistribution()
{ {
if (sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS)) if (sWorld.getConfig(CONFIG_BOOL_ARENA_AUTO_DISTRIBUTE_POINTS))
{ {
sLog.outDebug("Initializing Automatic Arena Point Distribution"); sLog.outDebug("Initializing Automatic Arena Point Distribution");
QueryResult * result = CharacterDatabase.Query("SELECT NextArenaPointDistributionTime FROM saved_variables"); QueryResult * result = CharacterDatabase.Query("SELECT NextArenaPointDistributionTime FROM saved_variables");
if (!result) if (!result)
{ {
sLog.outDebug("Battleground: Next arena point distribution time not found in SavedVariables, reseting it now."); sLog.outDebug("Battleground: Next arena point distribution time not found in SavedVariables, reseting it now.");
m_NextAutoDistributionTime = time_t(sWorld.GetGameTime() + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS)); m_NextAutoDistributionTime = time_t(sWorld.GetGameTime() + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getConfig(CONFIG_UINT32_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS));
CharacterDatabase.PExecute("INSERT INTO saved_variables (NextArenaPointDistributionTime) VALUES ('"UI64FMTD"')", uint64(m_NextAutoDistributionTime)); CharacterDatabase.PExecute("INSERT INTO saved_variables (NextArenaPointDistributionTime) VALUES ('"UI64FMTD"')", uint64(m_NextAutoDistributionTime));
} }
else else
@ -2016,7 +2016,7 @@ void BattleGroundMgr::ScheduleQueueUpdate(uint32 arenaRating, uint8 arenaType, B
uint32 BattleGroundMgr::GetMaxRatingDifference() const uint32 BattleGroundMgr::GetMaxRatingDifference() const
{ {
// this is for stupid people who can't use brain and set max rating difference to 0 // 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.getConfig(CONFIG_UINT32_ARENA_MAX_RATING_DIFFERENCE);
if (diff == 0) if (diff == 0)
diff = 5000; diff = 5000;
return diff; return diff;
@ -2024,12 +2024,12 @@ uint32 BattleGroundMgr::GetMaxRatingDifference() const
uint32 BattleGroundMgr::GetRatingDiscardTimer() const uint32 BattleGroundMgr::GetRatingDiscardTimer() const
{ {
return sWorld.getConfig(CONFIG_ARENA_RATING_DISCARD_TIMER); return sWorld.getConfig(CONFIG_UINT32_ARENA_RATING_DISCARD_TIMER);
} }
uint32 BattleGroundMgr::GetPrematureFinishTime() const uint32 BattleGroundMgr::GetPrematureFinishTime() const
{ {
return sWorld.getConfig(CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER); return sWorld.getConfig(CONFIG_UINT32_BATTLEGROUND_PREMATURE_FINISH_TIMER);
} }
void BattleGroundMgr::LoadBattleMastersEntry() void BattleGroundMgr::LoadBattleMastersEntry()

View file

@ -82,7 +82,7 @@ void Channel::Join(uint64 p, const char *pass)
if(plr) if(plr)
{ {
if(HasFlag(CHANNEL_FLAG_LFG) && if(HasFlag(CHANNEL_FLAG_LFG) &&
sWorld.getConfig(CONFIG_RESTRICTED_LFG_CHANNEL) && plr->GetSession()->GetSecurity() == SEC_PLAYER && sWorld.getConfig(CONFIG_BOOL_RESTRICTED_LFG_CHANNEL) && plr->GetSession()->GetSecurity() == SEC_PLAYER &&
(plr->GetGroup() || plr->m_lookingForGroup.Empty()) ) (plr->GetGroup() || plr->m_lookingForGroup.Empty()) )
{ {
MakeNotInLfg(&data); MakeNotInLfg(&data);
@ -96,7 +96,7 @@ void Channel::Join(uint64 p, const char *pass)
plr->JoinedChannel(this); 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.getConfig(CONFIG_BOOL_SILENTLY_GM_JOIN_TO_CHANNEL) ))
{ {
MakeJoined(&data, p); MakeJoined(&data, p);
SendToAll(&data); SendToAll(&data);
@ -150,7 +150,7 @@ void Channel::Leave(uint64 p, bool send)
bool changeowner = players[p].IsOwner(); bool changeowner = players[p].IsOwner();
players.erase(p); 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.getConfig(CONFIG_BOOL_SILENTLY_GM_JOIN_TO_CHANNEL) ))
{ {
WorldPacket data; WorldPacket data;
MakeLeft(&data, p); MakeLeft(&data, p);
@ -342,7 +342,7 @@ void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
// allow make moderator from another team only if both is GMs // 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 // 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) && 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.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_CHANNEL) )
{ {
WorldPacket data; WorldPacket data;
MakePlayerNotFound(&data, p2n); MakePlayerNotFound(&data, p2n);
@ -398,7 +398,7 @@ void Channel::SetOwner(uint64 p, const char *newname)
return; return;
} }
if(newp->GetTeam() != plr->GetTeam() && !sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL)) if(newp->GetTeam() != plr->GetTeam() && !sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
{ {
WorldPacket data; WorldPacket data;
MakePlayerNotFound(&data, newname); MakePlayerNotFound(&data, newname);
@ -446,7 +446,7 @@ void Channel::List(Player* player)
size_t pos = data.wpos(); size_t pos = data.wpos();
data << uint32(0); // size of list, placeholder data << uint32(0); // size of list, placeholder
AccountTypes gmLevelInWhoList = (AccountTypes)sWorld.getConfig(CONFIG_GM_LEVEL_IN_WHO_LIST); AccountTypes gmLevelInWhoList = (AccountTypes)sWorld.getConfig(CONFIG_UINT32_GM_LEVEL_IN_WHO_LIST);
uint32 count = 0; uint32 count = 0;
for(PlayerList::const_iterator i = players.begin(); i != players.end(); ++i) for(PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
@ -538,7 +538,7 @@ void Channel::Say(uint64 p, const char *what, uint32 lang)
{ {
if(!what) if(!what)
return; return;
if (sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL)) if (sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
lang = LANG_UNIVERSAL; lang = LANG_UNIVERSAL;
uint32 sec = 0; uint32 sec = 0;
@ -606,7 +606,7 @@ void Channel::Invite(uint64 p, const char *newname)
if (!plr) if (!plr)
return; return;
if (newp->GetTeam() != plr->GetTeam() && !sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL)) if (newp->GetTeam() != plr->GetTeam() && !sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
{ {
WorldPacket data; WorldPacket data;
MakeInviteWrongFaction(&data); MakeInviteWrongFaction(&data);

View file

@ -25,7 +25,7 @@ INSTANTIATE_SINGLETON_1( HordeChannelMgr );
ChannelMgr* channelMgr(uint32 team) ChannelMgr* channelMgr(uint32 team)
{ {
if (sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL)) if (sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
return &MaNGOS::Singleton<AllianceChannelMgr>::Instance(); // cross-faction return &MaNGOS::Singleton<AllianceChannelMgr>::Instance(); // cross-faction
if(team == ALLIANCE) if(team == ALLIANCE)

View file

@ -87,7 +87,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_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_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)); 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.getConfig(CONFIG_BOOL_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)); 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 // 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)); res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADGUILD, "SELECT guildid,rank FROM guild_member WHERE guid = '%u'", GUID_LOPART(m_guid));
@ -163,7 +163,7 @@ void WorldSession::HandleCharEnumOpcode( WorldPacket & /*recv_data*/ )
{ {
/// get all the data necessary for loading all characters (along with their pets) on the account /// get all the data necessary for loading all characters (along with their pets) on the account
CharacterDatabase.AsyncPQuery(&chrHandler, &CharacterHandler::HandleCharEnumCallback, GetAccountId(), CharacterDatabase.AsyncPQuery(&chrHandler, &CharacterHandler::HandleCharEnumCallback, GetAccountId(),
!sWorld.getConfig(CONFIG_DECLINED_NAMES_USED) ? !sWorld.getConfig(CONFIG_BOOL_DECLINED_NAMES_USED) ?
// ------- Query Without Declined Names -------- // ------- Query Without Declined Names --------
// 0 1 2 3 4 5 6 7 // 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, " "SELECT characters.guid, characters.name, characters.race, characters.class, characters.gender, characters.playerBytes, characters.playerBytes2, characters.level, "
@ -203,7 +203,7 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
if(GetSecurity() == SEC_PLAYER) if(GetSecurity() == SEC_PLAYER)
{ {
if(uint32 mask = sWorld.getConfig(CONFIG_CHARACTERS_CREATING_DISABLED)) if(uint32 mask = sWorld.getConfig(CONFIG_UINT32_CHARACTERS_CREATING_DISABLED))
{ {
bool disabled = false; bool disabled = false;
@ -291,7 +291,7 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
uint32 acctcharcount = fields[0].GetUInt32(); uint32 acctcharcount = fields[0].GetUInt32();
delete resultacct; delete resultacct;
if (acctcharcount >= sWorld.getConfig(CONFIG_CHARACTERS_PER_ACCOUNT)) if (acctcharcount >= sWorld.getConfig(CONFIG_UINT32_CHARACTERS_PER_ACCOUNT))
{ {
data << (uint8)CHAR_CREATE_ACCOUNT_LIMIT; data << (uint8)CHAR_CREATE_ACCOUNT_LIMIT;
SendPacket( &data ); SendPacket( &data );
@ -307,7 +307,7 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
charcount = fields[0].GetUInt8(); charcount = fields[0].GetUInt8();
delete result; delete result;
if (charcount >= sWorld.getConfig(CONFIG_CHARACTERS_PER_REALM)) if (charcount >= sWorld.getConfig(CONFIG_UINT32_CHARACTERS_PER_REALM))
{ {
data << (uint8)CHAR_CREATE_SERVER_LIMIT; data << (uint8)CHAR_CREATE_SERVER_LIMIT;
SendPacket( &data ); SendPacket( &data );
@ -316,7 +316,7 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
} }
// speedup check for heroic class disabled case // speedup check for heroic class disabled case
uint32 heroic_free_slots = sWorld.getConfig(CONFIG_HEROIC_CHARACTERS_PER_REALM); uint32 heroic_free_slots = sWorld.getConfig(CONFIG_UINT32_HEROIC_CHARACTERS_PER_REALM);
if(heroic_free_slots == 0 && GetSecurity() == SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT) if(heroic_free_slots == 0 && GetSecurity() == SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT)
{ {
data << (uint8)CHAR_CREATE_UNIQUE_CLASS_LIMIT; data << (uint8)CHAR_CREATE_UNIQUE_CLASS_LIMIT;
@ -325,16 +325,16 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
} }
// speedup check for heroic class disabled case // speedup check for heroic class disabled case
uint32 req_level_for_heroic = sWorld.getConfig(CONFIG_MIN_LEVEL_FOR_HEROIC_CHARACTER_CREATING); uint32 req_level_for_heroic = sWorld.getConfig(CONFIG_UINT32_MIN_LEVEL_FOR_HEROIC_CHARACTER_CREATING);
if(GetSecurity() == SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT && req_level_for_heroic > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) if(GetSecurity() == SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT && req_level_for_heroic > sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
{ {
data << (uint8)CHAR_CREATE_LEVEL_REQUIREMENT; data << (uint8)CHAR_CREATE_LEVEL_REQUIREMENT;
SendPacket( &data ); SendPacket( &data );
return; return;
} }
bool AllowTwoSideAccounts = sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_ACCOUNTS) || GetSecurity() > SEC_PLAYER; bool AllowTwoSideAccounts = sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_ACCOUNTS) || GetSecurity() > SEC_PLAYER;
CinematicsSkipMode skipCinematics = CinematicsSkipMode(sWorld.getConfig(CONFIG_SKIP_CINEMATICS)); CinematicsSkipMode skipCinematics = CinematicsSkipMode(sWorld.getConfig(CONFIG_UINT32_SKIP_CINEMATICS));
bool have_same_race = false; bool have_same_race = false;
@ -778,7 +778,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder *holder)
if(sWorld.IsShutdowning()) if(sWorld.IsShutdowning())
sWorld.ShutdownMsg(true,pCurrChar); sWorld.ShutdownMsg(true,pCurrChar);
if(sWorld.getConfig(CONFIG_ALL_TAXI_PATHS)) if(sWorld.getConfig(CONFIG_BOOL_ALL_TAXI_PATHS))
pCurrChar->SetTaxiCheater(true); pCurrChar->SetTaxiCheater(true);
if(pCurrChar->isGameMaster()) if(pCurrChar->isGameMaster())

View file

@ -738,7 +738,7 @@ bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_ac
return false; return false;
// ignore only for non-players for non strong checks (when allow apply command at least to same sec level) // 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.getConfig(CONFIG_BOOL_GM_LOWER_SECURITY))
return false; return false;
if (target) if (target)
@ -1028,7 +1028,7 @@ valid examples:
const char* validSequenceIterator = validSequence; const char* validSequenceIterator = validSequence;
// more simple checks // more simple checks
if (sWorld.getConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) < 3) if (sWorld.getConfig(CONFIG_UINT32_CHAT_STRICT_LINK_CHECKING_SEVERITY) < 3)
{ {
const std::string validCommands = "cHhr|"; const std::string validCommands = "cHhr|";
@ -1047,7 +1047,7 @@ valid examples:
++message; ++message;
// validate sequence // validate sequence
if(sWorld.getConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) == 2) if(sWorld.getConfig(CONFIG_UINT32_CHAT_STRICT_LINK_CHECKING_SEVERITY) == 2)
{ {
if(commandChar == *validSequenceIterator) if(commandChar == *validSequenceIterator)
{ {

View file

@ -42,15 +42,15 @@ bool WorldSession::processChatmessageFurtherAfterSecurityChecks(std::string& msg
if (lang != LANG_ADDON) if (lang != LANG_ADDON)
{ {
// strip invisible characters for non-addon messages // strip invisible characters for non-addon messages
if(sWorld.getConfig(CONFIG_CHAT_FAKE_MESSAGE_PREVENTING)) if(sWorld.getConfig(CONFIG_BOOL_CHAT_FAKE_MESSAGE_PREVENTING))
stripLineInvisibleChars(msg); stripLineInvisibleChars(msg);
if (sWorld.getConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) && GetSecurity() < SEC_MODERATOR if (sWorld.getConfig(CONFIG_UINT32_CHAT_STRICT_LINK_CHECKING_SEVERITY) && GetSecurity() < SEC_MODERATOR
&& !ChatHandler(this).isValidChatMessage(msg.c_str())) && !ChatHandler(this).isValidChatMessage(msg.c_str()))
{ {
sLog.outError("Player %s (GUID: %u) sent a chatmessage with an invalid link: %s", GetPlayer()->GetName(), sLog.outError("Player %s (GUID: %u) sent a chatmessage with an invalid link: %s", GetPlayer()->GetName(),
GetPlayer()->GetGUIDLow(), msg.c_str()); GetPlayer()->GetGUIDLow(), msg.c_str());
if (sWorld.getConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_KICK)) if (sWorld.getConfig(CONFIG_UINT32_CHAT_STRICT_LINK_CHECKING_KICK))
KickPlayer(); KickPlayer();
return false; return false;
} }
@ -105,7 +105,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
if(lang == LANG_ADDON) if(lang == LANG_ADDON)
{ {
// Disabled addon channel? // Disabled addon channel?
if(!sWorld.getConfig(CONFIG_ADDON_CHANNEL)) if(!sWorld.getConfig(CONFIG_BOOL_ADDON_CHANNEL))
return; return;
} }
// LANG_ADDON should not be changed nor be affected by flood control // LANG_ADDON should not be changed nor be affected by flood control
@ -117,7 +117,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
else else
{ {
// send in universal language in two side iteration allowed mode // send in universal language in two side iteration allowed mode
if (sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT)) if (sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_CHAT))
lang = LANG_UNIVERSAL; lang = LANG_UNIVERSAL;
else else
{ {
@ -128,13 +128,13 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
case CHAT_MSG_RAID_LEADER: case CHAT_MSG_RAID_LEADER:
case CHAT_MSG_RAID_WARNING: case CHAT_MSG_RAID_WARNING:
// allow two side chat at group channel if two side group allowed // allow two side chat at group channel if two side group allowed
if(sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP)) if(sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_GROUP))
lang = LANG_UNIVERSAL; lang = LANG_UNIVERSAL;
break; break;
case CHAT_MSG_GUILD: case CHAT_MSG_GUILD:
case CHAT_MSG_OFFICER: case CHAT_MSG_OFFICER:
// allow two side chat at guild channel if two side guild allowed // allow two side chat at guild channel if two side guild allowed
if(sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD)) if(sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_GUILD))
lang = LANG_UNIVERSAL; lang = LANG_UNIVERSAL;
break; break;
} }
@ -213,7 +213,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
return; return;
} }
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT) && tSecurity == SEC_PLAYER && pSecurity == SEC_PLAYER ) if (!sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_CHAT) && tSecurity == SEC_PLAYER && pSecurity == SEC_PLAYER )
{ {
uint32 sidea = GetPlayer()->GetTeam(); uint32 sidea = GetPlayer()->GetTeam();
uint32 sideb = player->GetTeam(); uint32 sideb = player->GetTeam();
@ -580,9 +580,9 @@ void WorldSession::HandleTextEmoteOpcode( WorldPacket & recv_data )
MaNGOS::EmoteChatBuilder emote_builder(*GetPlayer(), text_emote, emoteNum, unit); MaNGOS::EmoteChatBuilder emote_builder(*GetPlayer(), text_emote, emoteNum, unit);
MaNGOS::LocalizedPacketDo<MaNGOS::EmoteChatBuilder > emote_do(emote_builder); MaNGOS::LocalizedPacketDo<MaNGOS::EmoteChatBuilder > emote_do(emote_builder);
MaNGOS::PlayerDistWorker<MaNGOS::LocalizedPacketDo<MaNGOS::EmoteChatBuilder > > emote_worker(GetPlayer(), sWorld.getRate(RATE_LISTEN_RANGE_TEXTEMOTE), emote_do); MaNGOS::PlayerDistWorker<MaNGOS::LocalizedPacketDo<MaNGOS::EmoteChatBuilder > > emote_worker(GetPlayer(), sWorld.getConfig(CONFIG_FLOAT_LISTEN_RANGE_TEXTEMOTE), emote_do);
TypeContainerVisitor<MaNGOS::PlayerDistWorker<MaNGOS::LocalizedPacketDo<MaNGOS::EmoteChatBuilder > >, WorldTypeMapContainer> message(emote_worker); TypeContainerVisitor<MaNGOS::PlayerDistWorker<MaNGOS::LocalizedPacketDo<MaNGOS::EmoteChatBuilder > >, WorldTypeMapContainer> message(emote_worker);
cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld.getRate(RATE_LISTEN_RANGE_TEXTEMOTE)); cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld.getConfig(CONFIG_FLOAT_LISTEN_RANGE_TEXTEMOTE));
GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE, text_emote, 0, unit); GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE, text_emote, 0, unit);

View file

@ -490,7 +490,7 @@ void Creature::RegenerateMana()
{ {
if(!IsUnderLastManaUseEffect()) if(!IsUnderLastManaUseEffect())
{ {
float ManaIncreaseRate = sWorld.getRate(RATE_POWER_MANA); float ManaIncreaseRate = sWorld.getConfig(CONFIG_FLOAT_RATE_POWER_MANA);
float Spirit = GetStat(STAT_SPIRIT); float Spirit = GetStat(STAT_SPIRIT);
addvalue = uint32((Spirit / 5.0f + 17.0f) * ManaIncreaseRate); addvalue = uint32((Spirit / 5.0f + 17.0f) * ManaIncreaseRate);
@ -518,7 +518,7 @@ void Creature::RegenerateHealth()
// Not only pet, but any controlled creature // Not only pet, but any controlled creature
if(GetCharmerOrOwnerGUID()) if(GetCharmerOrOwnerGUID())
{ {
float HealthIncreaseRate = sWorld.getRate(RATE_HEALTH); float HealthIncreaseRate = sWorld.getConfig(CONFIG_FLOAT_RATE_HEALTH);
float Spirit = GetStat(STAT_SPIRIT); float Spirit = GetStat(STAT_SPIRIT);
if( GetPower(POWER_MANA) > 0 ) if( GetPower(POWER_MANA) > 0 )
@ -537,7 +537,7 @@ void Creature::DoFleeToGetAssistance()
if (!getVictim()) if (!getVictim())
return; return;
float radius = sWorld.getRate(RATE_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS); float radius = sWorld.getConfig(CONFIG_FLOAT_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS);
if (radius >0) if (radius >0)
{ {
Creature* pCreature = NULL; Creature* pCreature = NULL;
@ -557,7 +557,7 @@ void Creature::DoFleeToGetAssistance()
UpdateSpeed(MOVE_RUN, false); UpdateSpeed(MOVE_RUN, false);
if(!pCreature) if(!pCreature)
SetFeared(true, getVictim()->GetGUID(), 0 ,sWorld.getConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY)); SetFeared(true, getVictim()->GetGUID(), 0 ,sWorld.getConfig(CONFIG_UINT32_CREATURE_FAMILY_FLEE_DELAY));
else else
GetMotionMaster()->MoveSeekAssistance(pCreature->GetPositionX(), pCreature->GetPositionY(), pCreature->GetPositionZ()); GetMotionMaster()->MoveSeekAssistance(pCreature->GetPositionX(), pCreature->GetPositionY(), pCreature->GetPositionZ());
} }
@ -600,19 +600,19 @@ bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry,
switch (GetCreatureInfo()->rank) switch (GetCreatureInfo()->rank)
{ {
case CREATURE_ELITE_RARE: case CREATURE_ELITE_RARE:
m_corpseDelay = sWorld.getConfig(CONFIG_CORPSE_DECAY_RARE); m_corpseDelay = sWorld.getConfig(CONFIG_UINT32_CORPSE_DECAY_RARE);
break; break;
case CREATURE_ELITE_ELITE: case CREATURE_ELITE_ELITE:
m_corpseDelay = sWorld.getConfig(CONFIG_CORPSE_DECAY_ELITE); m_corpseDelay = sWorld.getConfig(CONFIG_UINT32_CORPSE_DECAY_ELITE);
break; break;
case CREATURE_ELITE_RAREELITE: case CREATURE_ELITE_RAREELITE:
m_corpseDelay = sWorld.getConfig(CONFIG_CORPSE_DECAY_RAREELITE); m_corpseDelay = sWorld.getConfig(CONFIG_UINT32_CORPSE_DECAY_RAREELITE);
break; break;
case CREATURE_ELITE_WORLDBOSS: case CREATURE_ELITE_WORLDBOSS:
m_corpseDelay = sWorld.getConfig(CONFIG_CORPSE_DECAY_WORLDBOSS); m_corpseDelay = sWorld.getConfig(CONFIG_UINT32_CORPSE_DECAY_WORLDBOSS);
break; break;
default: default:
m_corpseDelay = sWorld.getConfig(CONFIG_CORPSE_DECAY_NORMAL); m_corpseDelay = sWorld.getConfig(CONFIG_UINT32_CORPSE_DECAY_NORMAL);
break; break;
} }
LoadCreaturesAddon(); LoadCreaturesAddon();
@ -961,17 +961,17 @@ float Creature::_GetHealthMod(int32 Rank)
switch (Rank) // define rates for each elite rank switch (Rank) // define rates for each elite rank
{ {
case CREATURE_ELITE_NORMAL: case CREATURE_ELITE_NORMAL:
return sWorld.getRate(RATE_CREATURE_NORMAL_HP); return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_NORMAL_HP);
case CREATURE_ELITE_ELITE: case CREATURE_ELITE_ELITE:
return sWorld.getRate(RATE_CREATURE_ELITE_ELITE_HP); return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_ELITE_ELITE_HP);
case CREATURE_ELITE_RAREELITE: case CREATURE_ELITE_RAREELITE:
return sWorld.getRate(RATE_CREATURE_ELITE_RAREELITE_HP); return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_ELITE_RAREELITE_HP);
case CREATURE_ELITE_WORLDBOSS: case CREATURE_ELITE_WORLDBOSS:
return sWorld.getRate(RATE_CREATURE_ELITE_WORLDBOSS_HP); return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_ELITE_WORLDBOSS_HP);
case CREATURE_ELITE_RARE: case CREATURE_ELITE_RARE:
return sWorld.getRate(RATE_CREATURE_ELITE_RARE_HP); return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_ELITE_RARE_HP);
default: default:
return sWorld.getRate(RATE_CREATURE_ELITE_ELITE_HP); return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_ELITE_ELITE_HP);
} }
} }
@ -980,17 +980,17 @@ float Creature::_GetDamageMod(int32 Rank)
switch (Rank) // define rates for each elite rank switch (Rank) // define rates for each elite rank
{ {
case CREATURE_ELITE_NORMAL: case CREATURE_ELITE_NORMAL:
return sWorld.getRate(RATE_CREATURE_NORMAL_DAMAGE); return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_NORMAL_DAMAGE);
case CREATURE_ELITE_ELITE: case CREATURE_ELITE_ELITE:
return sWorld.getRate(RATE_CREATURE_ELITE_ELITE_DAMAGE); return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_ELITE_ELITE_DAMAGE);
case CREATURE_ELITE_RAREELITE: case CREATURE_ELITE_RAREELITE:
return sWorld.getRate(RATE_CREATURE_ELITE_RAREELITE_DAMAGE); return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_ELITE_RAREELITE_DAMAGE);
case CREATURE_ELITE_WORLDBOSS: case CREATURE_ELITE_WORLDBOSS:
return sWorld.getRate(RATE_CREATURE_ELITE_WORLDBOSS_DAMAGE); return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_ELITE_WORLDBOSS_DAMAGE);
case CREATURE_ELITE_RARE: case CREATURE_ELITE_RARE:
return sWorld.getRate(RATE_CREATURE_ELITE_RARE_DAMAGE); return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_ELITE_RARE_DAMAGE);
default: default:
return sWorld.getRate(RATE_CREATURE_ELITE_ELITE_DAMAGE); return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_ELITE_ELITE_DAMAGE);
} }
} }
@ -999,17 +999,17 @@ float Creature::GetSpellDamageMod(int32 Rank)
switch (Rank) // define rates for each elite rank switch (Rank) // define rates for each elite rank
{ {
case CREATURE_ELITE_NORMAL: case CREATURE_ELITE_NORMAL:
return sWorld.getRate(RATE_CREATURE_NORMAL_SPELLDAMAGE); return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_NORMAL_SPELLDAMAGE);
case CREATURE_ELITE_ELITE: case CREATURE_ELITE_ELITE:
return sWorld.getRate(RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE); return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE);
case CREATURE_ELITE_RAREELITE: case CREATURE_ELITE_RAREELITE:
return sWorld.getRate(RATE_CREATURE_ELITE_RAREELITE_SPELLDAMAGE); return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_ELITE_RAREELITE_SPELLDAMAGE);
case CREATURE_ELITE_WORLDBOSS: case CREATURE_ELITE_WORLDBOSS:
return sWorld.getRate(RATE_CREATURE_ELITE_WORLDBOSS_SPELLDAMAGE); return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_ELITE_WORLDBOSS_SPELLDAMAGE);
case CREATURE_ELITE_RARE: case CREATURE_ELITE_RARE:
return sWorld.getRate(RATE_CREATURE_ELITE_RARE_SPELLDAMAGE); return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_ELITE_RARE_SPELLDAMAGE);
default: default:
return sWorld.getRate(RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE); return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE);
} }
} }
@ -1176,7 +1176,7 @@ void Creature::DeleteFromDB()
float Creature::GetAttackDistance(Unit const* pl) const float Creature::GetAttackDistance(Unit const* pl) const
{ {
float aggroRate = sWorld.getRate(RATE_CREATURE_AGGRO); float aggroRate = sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_AGGRO);
if(aggroRate == 0) if(aggroRate == 0)
return 0.0f; return 0.0f;
@ -1196,7 +1196,7 @@ float Creature::GetAttackDistance(Unit const* pl) const
// radius grow if playlevel < creaturelevel // radius grow if playlevel < creaturelevel
RetDistance -= (float)leveldif; RetDistance -= (float)leveldif;
if(creaturelevel+5 <= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) if(creaturelevel+5 <= sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
{ {
// detect range auras // detect range auras
RetDistance += GetTotalAuraModifier(SPELL_AURA_MOD_DETECT_RANGE); RetDistance += GetTotalAuraModifier(SPELL_AURA_MOD_DETECT_RANGE);
@ -1219,7 +1219,7 @@ void Creature::setDeathState(DeathState s)
m_deathTimer = m_corpseDelay*IN_MILISECONDS; m_deathTimer = m_corpseDelay*IN_MILISECONDS;
// always save boss respawn time at death to prevent crash cheating // always save boss respawn time at death to prevent crash cheating
if (sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATLY) || isWorldBoss()) if (sWorld.getConfig(CONFIG_BOOL_SAVE_RESPAWN_TIME_IMMEDIATLY) || isWorldBoss())
SaveRespawnTime(); SaveRespawnTime();
if (canFly() && FallGround()) if (canFly() && FallGround())
@ -1478,7 +1478,7 @@ bool Creature::IsVisibleInGridForPlayer(Player* pl) const
if(corpse) if(corpse)
{ {
// 20 - aggro distance for same level, 25 - max additional distance if player level less that creature level // 20 - aggro distance for same level, 25 - max additional distance if player level less that creature level
if(corpse->IsWithinDistInMap(this,(20+25)*sWorld.getRate(RATE_CREATURE_AGGRO))) if(corpse->IsWithinDistInMap(this,(20+25)*sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_AGGRO)))
return true; return true;
} }
} }
@ -1509,7 +1509,7 @@ void Creature::CallAssistance()
{ {
SetNoCallAssistance(true); SetNoCallAssistance(true);
float radius = sWorld.getRate(RATE_CREATURE_FAMILY_ASSISTANCE_RADIUS); float radius = sWorld.getConfig(CONFIG_FLOAT_CREATURE_FAMILY_ASSISTANCE_RADIUS);
if(radius > 0) if(radius > 0)
{ {
std::list<Creature*> assistList; std::list<Creature*> assistList;
@ -1537,7 +1537,7 @@ void Creature::CallAssistance()
e->AddAssistant((*assistList.begin())->GetGUID()); e->AddAssistant((*assistList.begin())->GetGUID());
assistList.pop_front(); 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.getConfig(CONFIG_UINT32_CREATURE_FAMILY_ASSISTANCE_DELAY)));
} }
} }
} }
@ -1630,7 +1630,7 @@ bool Creature::IsOutOfThreatArea(Unit* pVictim) const
return false; return false;
float AttackDist = GetAttackDistance(pVictim); float AttackDist = GetAttackDistance(pVictim);
uint32 ThreatRadius = sWorld.getConfig(CONFIG_THREAT_RADIUS); uint32 ThreatRadius = sWorld.getConfig(CONFIG_UINT32_THREAT_RADIUS);
//Use AttackDistance in distance check if threat radius is lower. This prevents creature bounce in and out of combat every update tick. //Use AttackDistance in distance check if threat radius is lower. This prevents creature bounce in and out of combat every update tick.
return !pVictim->IsWithinDist3d(CombatStartX, CombatStartY, CombatStartZ, return !pVictim->IsWithinDist3d(CombatStartX, CombatStartY, CombatStartZ,
@ -1878,7 +1878,7 @@ void Creature::AllLootRemovedFromCorpse()
// corpse was not skinnable -> apply corpse looted timer // corpse was not skinnable -> apply corpse looted timer
if (!cinfo || !cinfo->SkinLootId) if (!cinfo || !cinfo->SkinLootId)
nDeathTimer = (uint32)((m_corpseDelay * IN_MILISECONDS) * sWorld.getRate(RATE_CORPSE_DECAY_LOOTED)); nDeathTimer = (uint32)((m_corpseDelay * IN_MILISECONDS) * sWorld.getConfig(CONFIG_FLOAT_RATE_CORPSE_DECAY_LOOTED));
// corpse skinnable, but without skinning flag, and then skinned, corpse will despawn next update // corpse skinnable, but without skinning flag, and then skinned, corpse will despawn next update
else else
nDeathTimer = 0; nDeathTimer = 0;
@ -1894,7 +1894,7 @@ uint32 Creature::getLevelForTarget( Unit const* target ) const
if(!isWorldBoss()) if(!isWorldBoss())
return Unit::getLevelForTarget(target); return Unit::getLevelForTarget(target);
uint32 level = target->getLevel()+sWorld.getConfig(CONFIG_WORLD_BOSS_LEVEL_DIFF); uint32 level = target->getLevel()+sWorld.getConfig(CONFIG_UINT32_WORLD_BOSS_LEVEL_DIFF);
if(level < 1) if(level < 1)
return 1; return 1;
if(level > 255) if(level > 255)

View file

@ -1136,7 +1136,7 @@ void CreatureEventAI::UpdateAI(const uint32 diff)
bool CreatureEventAI::IsVisible(Unit *pl) const bool CreatureEventAI::IsVisible(Unit *pl) const
{ {
return m_creature->IsWithinDist(pl,sWorld.getRate(RATE_SIGHT_MONSTER)) return m_creature->IsWithinDist(pl,sWorld.getConfig(CONFIG_FLOAT_SIGHT_MONSTER))
&& pl->isVisibleForOrDetect(m_creature,m_creature,true); && pl->isVisibleForOrDetect(m_creature,m_creature,true);
} }

View file

@ -122,7 +122,7 @@ namespace MaNGOS
if(u->GetTypeId()==TYPEID_UNIT && ((Creature*)u)->isElite()) if(u->GetTypeId()==TYPEID_UNIT && ((Creature*)u)->isElite())
xp_gain *= 2; xp_gain *= 2;
return (uint32)(xp_gain*sWorld.getRate(RATE_XP_KILL)); return (uint32)(xp_gain*sWorld.getConfig(CONFIG_FLOAT_RATE_XP_KILL));
} }
inline float xp_in_group_rate(uint32 count, bool isRaid) inline float xp_in_group_rate(uint32 count, bool isRaid)

View file

@ -481,7 +481,7 @@ void GameEventMgr::UnApplyEvent(uint16 event_id)
void GameEventMgr::ApplyNewEvent(uint16 event_id) void GameEventMgr::ApplyNewEvent(uint16 event_id)
{ {
switch(sWorld.getConfig(CONFIG_EVENT_ANNOUNCE)) switch(sWorld.getConfig(CONFIG_UINT32_EVENT_ANNOUNCE))
{ {
case 0: // disable case 0: // disable
break; break;

View file

@ -448,7 +448,7 @@ void GameObject::Update(uint32 /*p_time*/)
m_respawnTime = time(NULL) + m_respawnDelayTime; m_respawnTime = time(NULL) + m_respawnDelayTime;
// if option not set then object will be saved at grid unload // if option not set then object will be saved at grid unload
if(sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATLY)) if(sWorld.getConfig(CONFIG_BOOL_SAVE_RESPAWN_TIME_IMMEDIATLY))
SaveRespawnTime(); SaveRespawnTime();
UpdateObjectVisibility(); UpdateObjectVisibility();

View file

@ -518,7 +518,7 @@ void PlayerMenu::SendQuestGiverQuestDetails( Quest const *pQuest, uint64 npcGUID
} }
// send rewMoneyMaxLevel explicit for max player level, else send RewOrReqMoney // send rewMoneyMaxLevel explicit for max player level, else send RewOrReqMoney
if (pSession->GetPlayer()->getLevel() >= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) if (pSession->GetPlayer()->getLevel() >= sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
data << uint32(pQuest->GetRewMoneyMaxLevel()); data << uint32(pQuest->GetRewMoneyMaxLevel());
else else
data << uint32(pQuest->GetRewOrReqMoney()); data << uint32(pQuest->GetRewOrReqMoney());
@ -784,7 +784,7 @@ void PlayerMenu::SendQuestGiverOfferReward( Quest const* pQuest, uint64 npcGUID,
} }
// send rewMoneyMaxLevel explicit for max player level, else send RewOrReqMoney // send rewMoneyMaxLevel explicit for max player level, else send RewOrReqMoney
if (pSession->GetPlayer()->getLevel() >= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) if (pSession->GetPlayer()->getLevel() >= sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
data << uint32(pQuest->GetRewMoneyMaxLevel()); data << uint32(pQuest->GetRewMoneyMaxLevel());
else else
data << uint32(pQuest->GetRewOrReqMoney()); data << uint32(pQuest->GetRewOrReqMoney());

View file

@ -566,7 +566,7 @@ void Group::GroupLoot(const uint64& playerGUID, Loot *loot, Creature *creature)
continue; continue;
if ( i->AllowedForPlayer(member) ) if ( i->AllowedForPlayer(member) )
{ {
if (member->IsWithinDist(creature, sWorld.getRate(RATE_GROUP_XP_DISTANCE), false)) if (member->IsWithinDist(creature, sWorld.getConfig(CONFIG_FLOAT_GROUP_XP_DISTANCE), false))
{ {
r->playerVote[member->GetGUID()] = NOT_EMITED_YET; r->playerVote[member->GetGUID()] = NOT_EMITED_YET;
++r->totalPlayersRolling; ++r->totalPlayersRolling;
@ -615,7 +615,7 @@ void Group::NeedBeforeGreed(const uint64& playerGUID, Loot *loot, Creature *crea
if (playerToRoll->CanUseItem(item) && i->AllowedForPlayer(playerToRoll) ) if (playerToRoll->CanUseItem(item) && i->AllowedForPlayer(playerToRoll) )
{ {
if (playerToRoll->IsWithinDist(creature, sWorld.getRate(RATE_GROUP_XP_DISTANCE), false)) if (playerToRoll->IsWithinDist(creature, sWorld.getConfig(CONFIG_FLOAT_GROUP_XP_DISTANCE), false))
{ {
r->playerVote[playerToRoll->GetGUID()] = NOT_EMITED_YET; r->playerVote[playerToRoll->GetGUID()] = NOT_EMITED_YET;
++r->totalPlayersRolling; ++r->totalPlayersRolling;
@ -663,7 +663,7 @@ void Group::MasterLoot(const uint64& playerGUID, Loot* /*loot*/, Creature *creat
if (!looter->IsInWorld()) if (!looter->IsInWorld())
continue; continue;
if (looter->IsWithinDist(creature, sWorld.getRate(RATE_GROUP_XP_DISTANCE), false)) if (looter->IsWithinDist(creature, sWorld.getConfig(CONFIG_FLOAT_GROUP_XP_DISTANCE), false))
{ {
data << looter->GetGUID(); data << looter->GetGUID();
++real_count; ++real_count;
@ -675,7 +675,7 @@ void Group::MasterLoot(const uint64& playerGUID, Loot* /*loot*/, Creature *creat
for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next()) for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
{ {
Player *looter = itr->getSource(); Player *looter = itr->getSource();
if (looter->IsWithinDist(creature, sWorld.getRate(RATE_GROUP_XP_DISTANCE), false)) if (looter->IsWithinDist(creature, sWorld.getConfig(CONFIG_FLOAT_GROUP_XP_DISTANCE), false))
looter->GetSession()->SendPacket(&data); looter->GetSession()->SendPacket(&data);
} }
} }
@ -1374,7 +1374,7 @@ void Group::UpdateLooterGuid( Creature* creature, bool ifneed )
{ {
// not update if only update if need and ok // not update if only update if need and ok
Player* looter = ObjectAccessor::FindPlayer(guid_itr->guid); Player* looter = ObjectAccessor::FindPlayer(guid_itr->guid);
if(looter && looter->IsWithinDist(creature, sWorld.getRate(RATE_GROUP_XP_DISTANCE), false)) if(looter && looter->IsWithinDist(creature, sWorld.getConfig(CONFIG_FLOAT_GROUP_XP_DISTANCE), false))
return; return;
} }
++guid_itr; ++guid_itr;
@ -1387,7 +1387,7 @@ void Group::UpdateLooterGuid( Creature* creature, bool ifneed )
{ {
if(Player* pl = ObjectAccessor::FindPlayer(itr->guid)) if(Player* pl = ObjectAccessor::FindPlayer(itr->guid))
{ {
if (pl->IsWithinDist(creature, sWorld.getRate(RATE_GROUP_XP_DISTANCE), false)) if (pl->IsWithinDist(creature, sWorld.getConfig(CONFIG_FLOAT_GROUP_XP_DISTANCE), false))
{ {
bool refresh = pl->GetLootGUID() == creature->GetGUID(); bool refresh = pl->GetLootGUID() == creature->GetGUID();
@ -1408,7 +1408,7 @@ void Group::UpdateLooterGuid( Creature* creature, bool ifneed )
{ {
if(Player* pl = ObjectAccessor::FindPlayer(itr->guid)) if(Player* pl = ObjectAccessor::FindPlayer(itr->guid))
{ {
if (pl->IsWithinDist(creature, sWorld.getRate(RATE_GROUP_XP_DISTANCE), false)) if (pl->IsWithinDist(creature, sWorld.getConfig(CONFIG_FLOAT_GROUP_XP_DISTANCE), false))
{ {
bool refresh = pl->GetLootGUID()==creature->GetGUID(); bool refresh = pl->GetLootGUID()==creature->GetGUID();

View file

@ -75,7 +75,7 @@ void WorldSession::HandleGroupInviteOpcode( WorldPacket & recv_data )
} }
// can't group with // can't group with
if(!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && GetPlayer()->GetTeam() != player->GetTeam()) if(!sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_GROUP) && GetPlayer()->GetTeam() != player->GetTeam())
{ {
SendPartyResult(PARTY_OP_INVITE, membername, PARTY_RESULT_TARGET_UNFRIENDLY); SendPartyResult(PARTY_OP_INVITE, membername, PARTY_RESULT_TARGET_UNFRIENDLY);
return; return;

View file

@ -125,7 +125,7 @@ void GuardAI::UpdateAI(const uint32 /*diff*/)
bool GuardAI::IsVisible(Unit *pl) const bool GuardAI::IsVisible(Unit *pl) const
{ {
return m_creature->IsWithinDist(pl,sWorld.getRate(RATE_SIGHT_GUARDER)) return m_creature->IsWithinDist(pl,sWorld.getConfig(CONFIG_FLOAT_SIGHT_GUARDER))
&& pl->isVisibleForOrDetect(m_creature,m_creature,true); && pl->isVisibleForOrDetect(m_creature,m_creature,true);
} }

View file

@ -849,7 +849,7 @@ void Guild::LoadGuildEventLogFromDB()
if (!result) if (!result)
return; return;
bool isNextLogGuidSet = false; bool isNextLogGuidSet = false;
//uint32 configCount = sWorld.getConfig(CONFIG_GUILD_EVENT_LOG_COUNT); //uint32 configCount = sWorld.getConfig(CONFIG_UINT32_GUILD_EVENT_LOG_COUNT);
// First event in list will be the oldest and the latest event is last event in list // First event in list will be the oldest and the latest event is last event in list
do do
{ {
@ -889,7 +889,7 @@ void Guild::LogGuildEvent(uint8 EventType, uint32 PlayerGuid1, uint32 PlayerGuid
NewEvent.NewRank = NewRank; NewEvent.NewRank = NewRank;
NewEvent.TimeStamp = uint32(time(NULL)); NewEvent.TimeStamp = uint32(time(NULL));
// Count new LogGuid // Count new LogGuid
m_GuildEventLogNextGuid = (m_GuildEventLogNextGuid + 1) % sWorld.getConfig(CONFIG_GUILD_EVENT_LOG_COUNT); m_GuildEventLogNextGuid = (m_GuildEventLogNextGuid + 1) % sWorld.getConfig(CONFIG_UINT32_GUILD_EVENT_LOG_COUNT);
// Check max records limit // Check max records limit
if (m_GuildEventLog.size() >= GUILD_EVENTLOG_MAX_RECORDS) if (m_GuildEventLog.size() >= GUILD_EVENTLOG_MAX_RECORDS)
m_GuildEventLog.pop_front(); m_GuildEventLog.pop_front();
@ -1415,7 +1415,7 @@ void Guild::LoadGuildBankEventLogFromDB()
{ {
// Money log is in TabId = GUILD_BANK_MONEY_LOGS_TAB // Money log is in TabId = GUILD_BANK_MONEY_LOGS_TAB
// uint32 configCount = sWorld.getConfig(CONFIG_GUILD_BANK_EVENT_LOG_COUNT); // uint32 configCount = sWorld.getConfig(CONFIG_UINT32_GUILD_BANK_EVENT_LOG_COUNT);
// cycle through all purchased guild bank item tabs // cycle through all purchased guild bank item tabs
for (uint32 tabId = 0; tabId < m_PurchasedTabs; ++tabId) for (uint32 tabId = 0; tabId < m_PurchasedTabs; ++tabId)
{ {
@ -1580,7 +1580,7 @@ void Guild::LogBankEvent(uint8 EventType, uint8 TabId, uint32 PlayerGuidLow, uin
uint32 currentLogGuid = 0; uint32 currentLogGuid = 0;
if (NewEvent.isMoneyEvent()) 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.getConfig(CONFIG_UINT32_GUILD_BANK_EVENT_LOG_COUNT);
currentLogGuid = m_GuildBankEventLogNextGuid_Money; currentLogGuid = m_GuildBankEventLogNextGuid_Money;
currentTabId = GUILD_BANK_MONEY_LOGS_TAB; currentTabId = GUILD_BANK_MONEY_LOGS_TAB;
if (m_GuildBankEventLog_Money.size() >= GUILD_BANK_MAX_LOGS) if (m_GuildBankEventLog_Money.size() >= GUILD_BANK_MAX_LOGS)
@ -1590,7 +1590,7 @@ void Guild::LogBankEvent(uint8 EventType, uint8 TabId, uint32 PlayerGuidLow, uin
} }
else 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.getConfig(CONFIG_UINT32_GUILD_BANK_EVENT_LOG_COUNT);
currentLogGuid = m_GuildBankEventLogNextGuid_Item[TabId]; currentLogGuid = m_GuildBankEventLogNextGuid_Item[TabId];
if (m_GuildBankEventLog_Item[TabId].size() >= GUILD_BANK_MAX_LOGS) if (m_GuildBankEventLog_Item[TabId].size() >= GUILD_BANK_MAX_LOGS)
m_GuildBankEventLog_Item[TabId].pop_front(); m_GuildBankEventLog_Item[TabId].pop_front();
@ -2141,7 +2141,7 @@ void Guild::MoveFromBankToChar( Player * pl, uint8 BankTab, uint8 BankTabSlot, u
if (pItemChar) if (pItemChar)
{ {
// logging item move to bank // logging item move to bank
if (pl->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE)) if (pl->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_BOOL_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 )", 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(), pl->GetName(),pl->GetSession()->GetAccountId(),
@ -2216,7 +2216,7 @@ void Guild::MoveFromCharToBank( Player * pl, uint8 PlayerBag, uint8 PlayerSlot,
} }
// logging item move to bank (before items merge // 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.getConfig(CONFIG_BOOL_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 )", 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(), pl->GetName(),pl->GetSession()->GetAccountId(),
@ -2242,7 +2242,7 @@ void Guild::MoveFromCharToBank( Player * pl, uint8 PlayerBag, uint8 PlayerSlot,
if (msg == EQUIP_ERR_OK) // merge if (msg == EQUIP_ERR_OK) // merge
{ {
// logging item move to bank // logging item move to bank
if (pl->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE)) if (pl->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_BOOL_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 )", 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(), pl->GetName(),pl->GetSession()->GetAccountId(),
@ -2292,7 +2292,7 @@ void Guild::MoveFromCharToBank( Player * pl, uint8 PlayerBag, uint8 PlayerSlot,
} }
// logging item move to bank // logging item move to bank
if (pl->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE)) if (pl->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_BOOL_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 )", 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(), pl->GetName(), pl->GetSession()->GetAccountId(),

View file

@ -93,7 +93,7 @@ void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket)
return; return;
// not let enemies sign guild charter // not let enemies sign guild charter
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != GetPlayer()->GetTeam()) if (!sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != GetPlayer()->GetTeam())
{ {
SendGuildCommandResult(GUILD_INVITE_S, Invitedname, ERR_GUILD_NOT_ALLIED); SendGuildCommandResult(GUILD_INVITE_S, Invitedname, ERR_GUILD_NOT_ALLIED);
return; return;
@ -196,7 +196,7 @@ void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/)
return; return;
// not let enemies sign guild charter // not let enemies sign guild charter
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(guild->GetLeader())) if (!sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(guild->GetLeader()))
return; return;
if(!guild->AddMember(GetPlayer()->GetGUID(),guild->GetLowestRank())) if(!guild->AddMember(GetPlayer()->GetGUID(),guild->GetLowestRank()))
@ -891,7 +891,7 @@ void WorldSession::HandleGuildBankDepositMoney( WorldPacket & recv_data )
CharacterDatabase.CommitTransaction(); CharacterDatabase.CommitTransaction();
// logging money // logging money
if(_player->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE)) if(_player->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_BOOL_GM_LOG_TRADE))
{ {
sLog.outCommand(_player->GetSession()->GetAccountId(),"GM %s (Account: %u) deposit money (Amount: %u) to guild bank (Guild ID %u)", 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); _player->GetName(),_player->GetSession()->GetAccountId(),money,GuildId);

View file

@ -430,7 +430,7 @@ void InstanceSaveManager::LoadResetTimes()
} }
// load the global respawn times for raid/heroic instances // load the global respawn times for raid/heroic instances
uint32 diff = sWorld.getConfig(CONFIG_INSTANCE_RESET_TIME_HOUR) * HOUR; uint32 diff = sWorld.getConfig(CONFIG_UINT32_INSTANCE_RESET_TIME_HOUR) * HOUR;
result = CharacterDatabase.Query("SELECT mapid, difficulty, resettime FROM instance_reset"); result = CharacterDatabase.Query("SELECT mapid, difficulty, resettime FROM instance_reset");
if(result) if(result)
{ {
@ -475,7 +475,7 @@ void InstanceSaveManager::LoadResetTimes()
continue; continue;
// the reset_delay must be at least one day // the reset_delay must be at least one day
uint32 period = uint32(mapDiff->resetTime / DAY * sWorld.getRate(RATE_INSTANCE_RESET_TIME)) * DAY; uint32 period = uint32(mapDiff->resetTime / DAY * sWorld.getConfig(CONFIG_FLOAT_RATE_INSTANCE_RESET_TIME)) * DAY;
time_t t = GetResetTimeFor(mapid,difficulty); time_t t = GetResetTimeFor(mapid,difficulty);
if(!t) if(!t)
@ -635,7 +635,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b
CharacterDatabase.CommitTransaction(); CharacterDatabase.CommitTransaction();
// calculate the next reset time // calculate the next reset time
uint32 diff = sWorld.getConfig(CONFIG_INSTANCE_RESET_TIME_HOUR) * HOUR; uint32 diff = sWorld.getConfig(CONFIG_UINT32_INSTANCE_RESET_TIME_HOUR) * HOUR;
uint32 period = mapDiff->resetTime * DAY; uint32 period = mapDiff->resetTime * DAY;
time_t next_reset = ((now + timeLeft + MINUTE) / DAY * DAY) + period + diff; time_t next_reset = ((now + timeLeft + MINUTE) / DAY * DAY) + period + diff;
// update it in the DB // update it in the DB

View file

@ -68,14 +68,14 @@ static void AttemptJoin(Player* _player)
// stop at success join // stop at success join
if(plr->GetGroup()->AddMember(_player->GetGUID(), _player->GetName())) if(plr->GetGroup()->AddMember(_player->GetGUID(), _player->GetName()))
{ {
if( sWorld.getConfig(CONFIG_RESTRICTED_LFG_CHANNEL) && _player->GetSession()->GetSecurity() == SEC_PLAYER ) if( sWorld.getConfig(CONFIG_BOOL_RESTRICTED_LFG_CHANNEL) && _player->GetSession()->GetSecurity() == SEC_PLAYER )
_player->LeaveLFGChannel(); _player->LeaveLFGChannel();
break; break;
} }
// full // full
else else
{ {
if( sWorld.getConfig(CONFIG_RESTRICTED_LFG_CHANNEL) && plr->GetSession()->GetSecurity() == SEC_PLAYER ) if( sWorld.getConfig(CONFIG_BOOL_RESTRICTED_LFG_CHANNEL) && plr->GetSession()->GetSecurity() == SEC_PLAYER )
plr->LeaveLFGChannel(); plr->LeaveLFGChannel();
} }
} }
@ -126,20 +126,20 @@ static void AttemptAddMore(Player* _player)
// stop at join fail (full) // stop at join fail (full)
if(!_player->GetGroup()->AddMember(plr->GetGUID(), plr->GetName()) ) if(!_player->GetGroup()->AddMember(plr->GetGUID(), plr->GetName()) )
{ {
if( sWorld.getConfig(CONFIG_RESTRICTED_LFG_CHANNEL) && _player->GetSession()->GetSecurity() == SEC_PLAYER ) if( sWorld.getConfig(CONFIG_BOOL_RESTRICTED_LFG_CHANNEL) && _player->GetSession()->GetSecurity() == SEC_PLAYER )
_player->LeaveLFGChannel(); _player->LeaveLFGChannel();
break; break;
} }
// joined // joined
if( sWorld.getConfig(CONFIG_RESTRICTED_LFG_CHANNEL) && plr->GetSession()->GetSecurity() == SEC_PLAYER ) if( sWorld.getConfig(CONFIG_BOOL_RESTRICTED_LFG_CHANNEL) && plr->GetSession()->GetSecurity() == SEC_PLAYER )
plr->LeaveLFGChannel(); plr->LeaveLFGChannel();
// and group full // and group full
if(_player->GetGroup()->IsFull() ) if(_player->GetGroup()->IsFull() )
{ {
if( sWorld.getConfig(CONFIG_RESTRICTED_LFG_CHANNEL) && _player->GetSession()->GetSecurity() == SEC_PLAYER ) if( sWorld.getConfig(CONFIG_BOOL_RESTRICTED_LFG_CHANNEL) && _player->GetSession()->GetSecurity() == SEC_PLAYER )
_player->LeaveLFGChannel(); _player->LeaveLFGChannel();
break; break;
@ -189,7 +189,7 @@ void WorldSession::HandleLfgClearOpcode( WorldPacket & /*recv_data */ )
for(int i = 0; i < MAX_LOOKING_FOR_GROUP_SLOT; ++i) for(int i = 0; i < MAX_LOOKING_FOR_GROUP_SLOT; ++i)
_player->m_lookingForGroup.slots[i].Clear(); _player->m_lookingForGroup.slots[i].Clear();
if( sWorld.getConfig(CONFIG_RESTRICTED_LFG_CHANNEL) && _player->GetSession()->GetSecurity() == SEC_PLAYER ) if( sWorld.getConfig(CONFIG_BOOL_RESTRICTED_LFG_CHANNEL) && _player->GetSession()->GetSecurity() == SEC_PLAYER )
_player->LeaveLFGChannel(); _player->LeaveLFGChannel();
SendLfgUpdate(0, 0, 0); SendLfgUpdate(0, 0, 0);

View file

@ -142,7 +142,7 @@ bool ChatHandler::HandleSaveCommand(const char* /*args*/)
} }
// save or plan save after 20 sec (logout delay) if current next save time more this value and _not_ output any messages to prevent cheat planning // save or plan save after 20 sec (logout delay) if current next save time more this value and _not_ output any messages to prevent cheat planning
uint32 save_interval = sWorld.getConfig(CONFIG_INTERVAL_SAVE); uint32 save_interval = sWorld.getConfig(CONFIG_UINT32_INTERVAL_SAVE);
if (save_interval==0 || (save_interval > 20*IN_MILISECONDS && player->GetSaveTimer() <= save_interval - 20*IN_MILISECONDS)) if (save_interval==0 || (save_interval > 20*IN_MILISECONDS && player->GetSaveTimer() <= save_interval - 20*IN_MILISECONDS))
player->SaveToDB(); player->SaveToDB();
@ -158,7 +158,7 @@ bool ChatHandler::HandleGMListIngameCommand(const char* /*args*/)
for(; itr != m.end(); ++itr) for(; itr != m.end(); ++itr)
{ {
AccountTypes itr_sec = itr->second->GetSession()->GetSecurity(); 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.getConfig(CONFIG_UINT32_GM_LEVEL_IN_GM_LIST))) &&
(!m_session || itr->second->IsVisibleGloballyFor(m_session->GetPlayer()))) (!m_session || itr->second->IsVisibleGloballyFor(m_session->GetPlayer())))
{ {
if(first) if(first)

View file

@ -1256,7 +1256,7 @@ bool ChatHandler::HandleNpcChangeLevelCommand(const char* args)
return false; return false;
uint8 lvl = (uint8) atoi((char*)args); uint8 lvl = (uint8) atoi((char*)args);
if ( lvl < 1 || lvl > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL) + 3) if ( lvl < 1 || lvl > sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL) + 3)
{ {
SendSysMessage(LANG_BAD_VALUE); SendSysMessage(LANG_BAD_VALUE);
SetSentErrorMessage(true); SetSentErrorMessage(true);

View file

@ -2354,7 +2354,7 @@ bool ChatHandler::HandleListItemCommand(const char* args)
item_guid,owner_name.c_str(),owner_guid,owner_acc,item_pos); item_guid,owner_name.c_str(),owner_guid,owner_acc,item_pos);
} while (result->NextRow()); } while (result->NextRow());
int64 res_count = result->GetRowCount(); int res_count = (int)result->GetRowCount();
delete result; delete result;
@ -2404,7 +2404,7 @@ bool ChatHandler::HandleListItemCommand(const char* args)
item_guid,item_s_name.c_str(),item_s,item_s_acc,item_r_name.c_str(),item_r,item_r_acc,item_pos); item_guid,item_s_name.c_str(),item_s,item_s_acc,item_r_name.c_str(),item_r,item_r_acc,item_pos);
} while (result->NextRow()); } while (result->NextRow());
int64 res_count = result->GetRowCount(); int res_count = (int)result->GetRowCount();
delete result; delete result;
@ -2481,7 +2481,7 @@ bool ChatHandler::HandleListItemCommand(const char* args)
PSendSysMessage(LANG_ITEMLIST_GUILD,item_guid,guild_name.c_str(),guild_guid,item_pos); PSendSysMessage(LANG_ITEMLIST_GUILD,item_guid,guild_name.c_str(),guild_guid,item_pos);
} while (result->NextRow()); } while (result->NextRow());
int64 res_count = result->GetRowCount(); int res_count = (int)result->GetRowCount();
delete result; delete result;
@ -4175,7 +4175,7 @@ bool ChatHandler::HandleChangeWeather(const char* args)
return false; return false;
//Weather is OFF //Weather is OFF
if (!sWorld.getConfig(CONFIG_WEATHER)) if (!sWorld.getConfig(CONFIG_BOOL_WEATHER))
{ {
SendSysMessage(LANG_WEATHER_DISABLED); SendSysMessage(LANG_WEATHER_DISABLED);
SetSentErrorMessage(true); SetSentErrorMessage(true);
@ -4421,8 +4421,8 @@ bool ChatHandler::HandleResetLevelCommand(const char * args)
// set starting level // set starting level
uint32 start_level = target->getClass() != CLASS_DEATH_KNIGHT uint32 start_level = target->getClass() != CLASS_DEATH_KNIGHT
? sWorld.getConfig(CONFIG_START_PLAYER_LEVEL) ? sWorld.getConfig(CONFIG_UINT32_START_PLAYER_LEVEL)
: sWorld.getConfig(CONFIG_START_HEROIC_PLAYER_LEVEL); : sWorld.getConfig(CONFIG_UINT32_START_HEROIC_PLAYER_LEVEL);
target->_ApplyAllLevelScaleItemMods(false); target->_ApplyAllLevelScaleItemMods(false);

View file

@ -221,7 +221,7 @@ void WorldSession::HandleLootMoneyOpcode( WorldPacket & /*recv_data*/ )
Player* playerGroup = itr->getSource(); Player* playerGroup = itr->getSource();
if(!playerGroup) if(!playerGroup)
continue; continue;
if (player->IsWithinDistInMap(playerGroup,sWorld.getRate(RATE_GROUP_XP_DISTANCE),false)) if (player->IsWithinDistInMap(playerGroup,sWorld.getConfig(CONFIG_FLOAT_GROUP_XP_DISTANCE),false))
playersNear.push_back(playerGroup); playersNear.push_back(playerGroup);
} }
@ -312,7 +312,7 @@ void WorldSession::DoLootRelease( uint64 lguid )
// only vein pass this check // only vein pass this check
if(go_min != 0 && go_max > go_min) if(go_min != 0 && go_max > go_min)
{ {
float amount_rate = sWorld.getRate(RATE_MINING_AMOUNT); float amount_rate = sWorld.getConfig(CONFIG_FLOAT_RATE_MINING_AMOUNT);
float min_amount = go_min*amount_rate; float min_amount = go_min*amount_rate;
float max_amount = go_max*amount_rate; float max_amount = go_max*amount_rate;
@ -323,7 +323,7 @@ void WorldSession::DoLootRelease( uint64 lguid )
{ {
if(uses >= min_amount) if(uses >= min_amount)
{ {
float chance_rate = sWorld.getRate(RATE_MINING_NEXT); float chance_rate = sWorld.getConfig(CONFIG_FLOAT_RATE_MINING_NEXT);
int32 ReqValue = 175; int32 ReqValue = 175;
LockEntry const *lockInfo = sLockStore.LookupEntry(go->GetGOInfo()->chest.lockId); LockEntry const *lockInfo = sLockStore.LookupEntry(go->GetGOInfo()->chest.lockId);

View file

@ -25,14 +25,14 @@
#include "SharedDefines.h" #include "SharedDefines.h"
#include "SpellMgr.h" #include "SpellMgr.h"
static Rates const qualityToRate[MAX_ITEM_QUALITY] = { static eConfigFLoatValues const qualityToRate[MAX_ITEM_QUALITY] = {
RATE_DROP_ITEM_POOR, // ITEM_QUALITY_POOR CONFIG_FLOAT_RATE_DROP_ITEM_POOR, // ITEM_QUALITY_POOR
RATE_DROP_ITEM_NORMAL, // ITEM_QUALITY_NORMAL CONFIG_FLOAT_RATE_DROP_ITEM_NORMAL, // ITEM_QUALITY_NORMAL
RATE_DROP_ITEM_UNCOMMON, // ITEM_QUALITY_UNCOMMON CONFIG_FLOAT_RATE_DROP_ITEM_UNCOMMON, // ITEM_QUALITY_UNCOMMON
RATE_DROP_ITEM_RARE, // ITEM_QUALITY_RARE CONFIG_FLOAT_RATE_DROP_ITEM_RARE, // ITEM_QUALITY_RARE
RATE_DROP_ITEM_EPIC, // ITEM_QUALITY_EPIC CONFIG_FLOAT_RATE_DROP_ITEM_EPIC, // ITEM_QUALITY_EPIC
RATE_DROP_ITEM_LEGENDARY, // ITEM_QUALITY_LEGENDARY CONFIG_FLOAT_RATE_DROP_ITEM_LEGENDARY, // ITEM_QUALITY_LEGENDARY
RATE_DROP_ITEM_ARTIFACT, // ITEM_QUALITY_ARTIFACT CONFIG_FLOAT_RATE_DROP_ITEM_ARTIFACT, // ITEM_QUALITY_ARTIFACT
}; };
LootStore LootTemplates_Creature( "creature_loot_template", "creature entry", true); LootStore LootTemplates_Creature( "creature_loot_template", "creature entry", true);
@ -243,11 +243,11 @@ bool LootStoreItem::Roll(bool rate) const
return true; return true;
if(mincountOrRef < 0) // reference case if(mincountOrRef < 0) // reference case
return roll_chance_f(chance* (rate ? sWorld.getRate(RATE_DROP_ITEM_REFERENCED) : 1.0f)); return roll_chance_f(chance* (rate ? sWorld.getConfig(CONFIG_FLOAT_RATE_DROP_ITEM_REFERENCED) : 1.0f));
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(itemid); ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(itemid);
float qualityModifier = pProto && rate ? sWorld.getRate(qualityToRate[pProto->Quality]) : 1.0f; float qualityModifier = pProto && rate ? sWorld.getConfig(qualityToRate[pProto->Quality]) : 1.0f;
return roll_chance_f(chance*qualityModifier); return roll_chance_f(chance*qualityModifier);
} }
@ -595,11 +595,11 @@ void Loot::generateMoneyLoot( uint32 minAmount, uint32 maxAmount )
if (maxAmount > 0) if (maxAmount > 0)
{ {
if (maxAmount <= minAmount) if (maxAmount <= minAmount)
gold = uint32(maxAmount * sWorld.getRate(RATE_DROP_MONEY)); gold = uint32(maxAmount * sWorld.getConfig(CONFIG_FLOAT_RATE_DROP_MONEY));
else if ((maxAmount - minAmount) < 32700) else if ((maxAmount - minAmount) < 32700)
gold = uint32(urand(minAmount, maxAmount) * sWorld.getRate(RATE_DROP_MONEY)); gold = uint32(urand(minAmount, maxAmount) * sWorld.getConfig(CONFIG_FLOAT_RATE_DROP_MONEY));
else else
gold = uint32(urand(minAmount >> 8, maxAmount >> 8) * sWorld.getRate(RATE_DROP_MONEY)) << 8; gold = uint32(urand(minAmount >> 8, maxAmount >> 8) * sWorld.getConfig(CONFIG_FLOAT_RATE_DROP_MONEY)) << 8;
} }
} }

View file

@ -149,7 +149,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
} }
// check the receiver's Faction... // check the receiver's Faction...
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_MAIL) && pl->GetTeam() != rc_team && GetSecurity() == SEC_PLAYER) if (!sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_MAIL) && pl->GetTeam() != rc_team && GetSecurity() == SEC_PLAYER)
{ {
pl->SendMailResult(0, MAIL_SEND, MAIL_ERR_NOT_YOUR_TEAM); pl->SendMailResult(0, MAIL_SEND, MAIL_ERR_NOT_YOUR_TEAM);
return; return;
@ -223,7 +223,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
for(uint8 i = 0; i < items_count; ++i) for(uint8 i = 0; i < items_count; ++i)
{ {
Item* item = items[i]; Item* item = items[i];
if (GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE)) if (GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_BOOL_GM_LOG_TRADE))
{ {
sLog.outCommand(GetAccountId(), "GM %s (Account: %u) mail item: %s (Entry: %u Count: %u) to player: %s (Account: %u)", 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); GetPlayerName(), GetAccountId(), item->GetProto()->Name1, item->GetEntry(), item->GetCount(), receiver.c_str(), rc_account);
@ -244,7 +244,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
needItemDelay = pl->GetSession()->GetAccountId() != rc_account; 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.getConfig(CONFIG_BOOL_GM_LOG_TRADE))
{ {
sLog.outCommand(GetAccountId(),"GM %s (Account: %u) mail money: %u to player: %s (Account: %u)", sLog.outCommand(GetAccountId(),"GM %s (Account: %u) mail money: %u to player: %s (Account: %u)",
GetPlayerName(), GetAccountId(), money, receiver.c_str(), rc_account); GetPlayerName(), GetAccountId(), money, receiver.c_str(), rc_account);
@ -252,7 +252,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. // 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.getConfig(CONFIG_UINT32_MAIL_DELIVERY_DELAY) : 0;
// will delete item or place to receiver mail list // will delete item or place to receiver mail list
draft draft
@ -420,7 +420,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data )
uint32 sender_accId = 0; uint32 sender_accId = 0;
if( GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE) ) if( GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_BOOL_GM_LOG_TRADE) )
{ {
std::string sender_name; std::string sender_name;
if(receive) if(receive)
@ -897,7 +897,7 @@ void MailDraft::SendReturnToSender(uint32 sender_acc, uint32 sender_guid, uint32
} }
// If theres is an item, there is a one hour delivery delay. // 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.getConfig(CONFIG_UINT32_MAIL_DELIVERY_DELAY) : 0;
// will delete item or place to receiver mail list // will delete item or place to receiver mail list
SendMailTo(MailReceiver(receiver,receiver_guid), MailSender(MAIL_NORMAL, sender_guid), MAIL_CHECK_MASK_RETURNED, deliver_delay); SendMailTo(MailReceiver(receiver,receiver_guid), MailSender(MAIL_NORMAL, sender_guid), MAIL_CHECK_MASK_RETURNED, deliver_delay);

View file

@ -40,7 +40,7 @@
#include "InstanceSaveMgr.h" #include "InstanceSaveMgr.h"
#include "VMapFactory.h" #include "VMapFactory.h"
#define MAX_CREATURE_ATTACK_RADIUS (45.0f * sWorld.getRate(RATE_CREATURE_AGGRO)) #define MAX_CREATURE_ATTACK_RADIUS (45.0f * sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_AGGRO))
GridState* si_GridStates[MAX_GRID_STATE]; GridState* si_GridStates[MAX_GRID_STATE];
@ -357,7 +357,7 @@ Map::EnsureGridCreated(const GridPair &p)
Guard guard(*this); Guard guard(*this);
if(!getNGrid(p.x_coord, p.y_coord)) if(!getNGrid(p.x_coord, p.y_coord))
{ {
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.getConfig(CONFIG_BOOL_GRID_UNLOAD)),
p.x_coord, p.y_coord); p.x_coord, p.y_coord);
// build a linkage between this map and NGridType // build a linkage between this map and NGridType
@ -838,7 +838,7 @@ Map::Remove(T *obj, bool remove)
if( remove ) if( remove )
{ {
// if option set then object already saved at this moment // if option set then object already saved at this moment
if(!sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATLY)) if(!sWorld.getConfig(CONFIG_BOOL_SAVE_RESPAWN_TIME_IMMEDIATLY))
obj->SaveRespawnTime(); obj->SaveRespawnTime();
DeleteFromWorld(obj); DeleteFromWorld(obj);
} }
@ -2349,7 +2349,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 // 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 // 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.getConfig(CONFIG_UINT32_INSTANCE_UNLOAD_DELAY), (uint32)MIN_UNLOAD_DELAY);
} }
InstanceMap::~InstanceMap() InstanceMap::~InstanceMap()
@ -2523,7 +2523,7 @@ void InstanceMap::Remove(Player *player, bool remove)
sLog.outDetail("MAP: Removing player '%s' from instance '%u' of map '%s' before relocating to other map", player->GetName(), GetInstanceId(), GetMapName()); sLog.outDetail("MAP: Removing player '%s' from instance '%u' of map '%s' before relocating to other map", player->GetName(), GetInstanceId(), GetMapName());
//if last player set unload timer //if last player set unload timer
if(!m_unloadTimer && m_mapRefManager.getSize() == 1) 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.getConfig(CONFIG_UINT32_INSTANCE_UNLOAD_DELAY), (uint32)MIN_UNLOAD_DELAY);
Map::Remove(player, remove); Map::Remove(player, remove);
// for normal instances schedule the reset after all players have left // for normal instances schedule the reset after all players have left
SetResetSchedule(true); SetResetSchedule(true);

View file

@ -241,7 +241,7 @@ void MapInstanced::DestroyInstance(InstancedMaps::iterator &itr)
{ {
itr->second->UnloadAll(true); itr->second->UnloadAll(true);
// should only unload VMaps if this is the last instance and grid unloading is enabled // 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.getConfig(CONFIG_BOOL_GRID_UNLOAD))
{ {
VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(itr->second->GetId()); VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(itr->second->GetId());
// in that case, unload grids of the base map, too // in that case, unload grids of the base map, too

View file

@ -36,9 +36,9 @@ INSTANTIATE_CLASS_MUTEX(MapManager, ACE_Thread_Mutex);
extern GridState* si_GridStates[]; // debugging code, should be deleted some day extern GridState* si_GridStates[]; // debugging code, should be deleted some day
MapManager::MapManager() : i_gridCleanUpDelay(sWorld.getConfig(CONFIG_INTERVAL_GRIDCLEAN)) MapManager::MapManager() : i_gridCleanUpDelay(sWorld.getConfig(CONFIG_UINT32_INTERVAL_GRIDCLEAN))
{ {
i_timer.SetInterval(sWorld.getConfig(CONFIG_INTERVAL_MAPUPDATE)); i_timer.SetInterval(sWorld.getConfig(CONFIG_UINT32_INTERVAL_MAPUPDATE));
} }
MapManager::~MapManager() MapManager::~MapManager()
@ -165,7 +165,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player)
if (entry->map_type == MAP_RAID) if (entry->map_type == MAP_RAID)
{ {
// GMs can avoid raid limitations // GMs can avoid raid limitations
if(!player->isGameMaster() && !sWorld.getConfig(CONFIG_INSTANCE_IGNORE_RAID)) if(!player->isGameMaster() && !sWorld.getConfig(CONFIG_BOOL_INSTANCE_IGNORE_RAID))
{ {
// can only enter in a raid group // can only enter in a raid group
Group* group = player->GetGroup(); Group* group = player->GetGroup();
@ -262,7 +262,7 @@ MapManager::Update(uint32 diff)
for(MapMapType::iterator iter=i_maps.begin(); iter != i_maps.end(); ++iter) for(MapMapType::iterator iter=i_maps.begin(); iter != i_maps.end(); ++iter)
{ {
checkAndCorrectGridStatesArray(); // debugging code, should be deleted some day checkAndCorrectGridStatesArray(); // debugging code, should be deleted some day
iter->second->Update(i_timer.GetCurrent()); iter->second->Update((uint32)i_timer.GetCurrent());
} }
for (TransportSet::iterator iter = m_Transports.begin(); iter != m_Transports.end(); ++iter) for (TransportSet::iterator iter = m_Transports.begin(); iter != m_Transports.end(); ++iter)

View file

@ -135,8 +135,8 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
uint32 team = _player->GetTeam(); uint32 team = _player->GetTeam();
uint32 security = GetSecurity(); uint32 security = GetSecurity();
bool allowTwoSideWhoList = sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST); bool allowTwoSideWhoList = sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_WHO_LIST);
AccountTypes gmLevelInWhoList = (AccountTypes)sWorld.getConfig(CONFIG_GM_LEVEL_IN_WHO_LIST); AccountTypes gmLevelInWhoList = (AccountTypes)sWorld.getConfig(CONFIG_UINT32_GM_LEVEL_IN_WHO_LIST);
WorldPacket data( SMSG_WHO, 50 ); // guess size WorldPacket data( SMSG_WHO, 50 ); // guess size
data << clientcount; // clientcount place holder data << clientcount; // clientcount place holder
@ -148,7 +148,7 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
{ {
if (security == SEC_PLAYER) if (security == SEC_PLAYER)
{ {
// player can see member of other team only if CONFIG_ALLOW_TWO_SIDE_WHO_LIST // player can see member of other team only if CONFIG_BOOL_ALLOW_TWO_SIDE_WHO_LIST
if (itr->second->GetTeam() != team && !allowTwoSideWhoList ) if (itr->second->GetTeam() != team && !allowTwoSideWhoList )
continue; continue;
@ -280,7 +280,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 mangosd.conf //instant logout in taverns/cities or on taxi or for admins, gm's, mod's if its enabled in mangosd.conf
if (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) || GetPlayer()->isInFlight() || if (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) || GetPlayer()->isInFlight() ||
GetSecurity() >= (AccountTypes)sWorld.getConfig(CONFIG_INSTANT_LOGOUT)) GetSecurity() >= (AccountTypes)sWorld.getConfig(CONFIG_UINT32_INSTANT_LOGOUT))
{ {
LogoutPlayer(true); LogoutPlayer(true);
return; return;
@ -471,7 +471,7 @@ void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult *result, uint32 acc
{ {
if(friendGuid==session->GetPlayer()->GetGUID()) if(friendGuid==session->GetPlayer()->GetGUID())
friendResult = FRIEND_SELF; friendResult = FRIEND_SELF;
else if(session->GetPlayer()->GetTeam() != team && !sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND) && session->GetSecurity() < SEC_MODERATOR) else if(session->GetPlayer()->GetTeam() != team && !sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_ADD_FRIEND) && session->GetSecurity() < SEC_MODERATOR)
friendResult = FRIEND_ENEMY; friendResult = FRIEND_ENEMY;
else if(session->GetPlayer()->GetSocial()->HasFriend(GUID_LOPART(friendGuid))) else if(session->GetPlayer()->GetSocial()->HasFriend(GUID_LOPART(friendGuid)))
friendResult = FRIEND_ALREADY; friendResult = FRIEND_ALREADY;
@ -792,7 +792,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
if(!GetPlayer()->isGameMaster()) if(!GetPlayer()->isGameMaster())
{ {
uint32 missingLevel = 0; uint32 missingLevel = 0;
if(GetPlayer()->getLevel() < at->requiredLevel && !sWorld.getConfig(CONFIG_INSTANCE_IGNORE_LEVEL)) if(GetPlayer()->getLevel() < at->requiredLevel && !sWorld.getConfig(CONFIG_BOOL_INSTANCE_IGNORE_LEVEL))
missingLevel = at->requiredLevel; missingLevel = at->requiredLevel;
// must have one or the other, report the first one that's missing // must have one or the other, report the first one that's missing
@ -1135,7 +1135,7 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data)
WorldPacket data(SMSG_INSPECT_TALENT, 50); WorldPacket data(SMSG_INSPECT_TALENT, 50);
data.append(plr->GetPackGUID()); data.append(plr->GetPackGUID());
if(sWorld.getConfig(CONFIG_TALENTS_INSPECTING) || _player->isGameMaster()) if(sWorld.getConfig(CONFIG_BOOL_TALENTS_INSPECTING) || _player->isGameMaster())
{ {
plr->BuildPlayerTalentsInfoData(&data); plr->BuildPlayerTalentsInfoData(&data);
plr->BuildEnchantmentsInfoData(&data); plr->BuildEnchantmentsInfoData(&data);

View file

@ -637,6 +637,7 @@ void Object::BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask *
// convert from float to uint32 and send // convert from float to uint32 and send
*data << uint32(m_floatValues[ index ] < 0 ? 0 : m_floatValues[ index ]); *data << uint32(m_floatValues[ index ] < 0 ? 0 : m_floatValues[ index ]);
} }
// there are some float values which may be negative or can't get negative due to other checks // there are some float values which may be negative or can't get negative due to other checks
else if ((index >= UNIT_FIELD_NEGSTAT0 && index <= UNIT_FIELD_NEGSTAT4) || else if ((index >= UNIT_FIELD_NEGSTAT0 && index <= UNIT_FIELD_NEGSTAT4) ||
(index >= UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE && index <= (UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE + 6)) || (index >= UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE && index <= (UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE + 6)) ||
@ -645,6 +646,7 @@ void Object::BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask *
{ {
*data << uint32(m_floatValues[ index ]); *data << uint32(m_floatValues[ index ]);
} }
// Gamemasters should be always able to select units - remove not selectable flag // Gamemasters should be always able to select units - remove not selectable flag
else if(index == UNIT_FIELD_FLAGS && target->isGameMaster()) else if(index == UNIT_FIELD_FLAGS && target->isGameMaster())
{ {
@ -1440,21 +1442,21 @@ void WorldObject::MonsterSay(const char* text, uint32 language, uint64 TargetGui
{ {
WorldPacket data(SMSG_MESSAGECHAT, 200); WorldPacket data(SMSG_MESSAGECHAT, 200);
BuildMonsterChat(&data,CHAT_MSG_MONSTER_SAY,text,language,GetName(),TargetGuid); BuildMonsterChat(&data,CHAT_MSG_MONSTER_SAY,text,language,GetName(),TargetGuid);
SendMessageToSetInRange(&data,sWorld.getRate(RATE_LISTEN_RANGE_SAY),true); SendMessageToSetInRange(&data,sWorld.getConfig(CONFIG_FLOAT_LISTEN_RANGE_SAY),true);
} }
void WorldObject::MonsterYell(const char* text, uint32 language, uint64 TargetGuid) void WorldObject::MonsterYell(const char* text, uint32 language, uint64 TargetGuid)
{ {
WorldPacket data(SMSG_MESSAGECHAT, 200); WorldPacket data(SMSG_MESSAGECHAT, 200);
BuildMonsterChat(&data,CHAT_MSG_MONSTER_YELL,text,language,GetName(),TargetGuid); BuildMonsterChat(&data,CHAT_MSG_MONSTER_YELL,text,language,GetName(),TargetGuid);
SendMessageToSetInRange(&data,sWorld.getRate(RATE_LISTEN_RANGE_YELL),true); SendMessageToSetInRange(&data,sWorld.getConfig(CONFIG_FLOAT_LISTEN_RANGE_YELL),true);
} }
void WorldObject::MonsterTextEmote(const char* text, uint64 TargetGuid, bool IsBossEmote) void WorldObject::MonsterTextEmote(const char* text, uint64 TargetGuid, bool IsBossEmote)
{ {
WorldPacket data(SMSG_MESSAGECHAT, 200); WorldPacket data(SMSG_MESSAGECHAT, 200);
BuildMonsterChat(&data,IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE,text,LANG_UNIVERSAL,GetName(),TargetGuid); BuildMonsterChat(&data,IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE,text,LANG_UNIVERSAL,GetName(),TargetGuid);
SendMessageToSetInRange(&data,sWorld.getRate(IsBossEmote ? RATE_LISTEN_RANGE_YELL : RATE_LISTEN_RANGE_TEXTEMOTE),true); SendMessageToSetInRange(&data,sWorld.getConfig(IsBossEmote ? CONFIG_FLOAT_LISTEN_RANGE_YELL : CONFIG_FLOAT_LISTEN_RANGE_TEXTEMOTE),true);
} }
void WorldObject::MonsterWhisper(const char* text, uint64 receiver, bool IsBossWhisper) void WorldObject::MonsterWhisper(const char* text, uint64 receiver, bool IsBossWhisper)
@ -1503,9 +1505,9 @@ void WorldObject::MonsterSay(int32 textId, uint32 language, uint64 TargetGuid)
MaNGOS::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_SAY, textId,language,TargetGuid); MaNGOS::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_SAY, textId,language,TargetGuid);
MaNGOS::LocalizedPacketDo<MaNGOS::MonsterChatBuilder> say_do(say_build); MaNGOS::LocalizedPacketDo<MaNGOS::MonsterChatBuilder> say_do(say_build);
MaNGOS::PlayerDistWorker<MaNGOS::LocalizedPacketDo<MaNGOS::MonsterChatBuilder> > say_worker(this,sWorld.getRate(RATE_LISTEN_RANGE_SAY),say_do); MaNGOS::PlayerDistWorker<MaNGOS::LocalizedPacketDo<MaNGOS::MonsterChatBuilder> > say_worker(this,sWorld.getConfig(CONFIG_FLOAT_LISTEN_RANGE_SAY),say_do);
TypeContainerVisitor<MaNGOS::PlayerDistWorker<MaNGOS::LocalizedPacketDo<MaNGOS::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker); TypeContainerVisitor<MaNGOS::PlayerDistWorker<MaNGOS::LocalizedPacketDo<MaNGOS::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
cell.Visit(p, message, *GetMap(), *this, sWorld.getRate(RATE_LISTEN_RANGE_SAY)); cell.Visit(p, message, *GetMap(), *this, sWorld.getConfig(CONFIG_FLOAT_LISTEN_RANGE_SAY));
} }
void WorldObject::MonsterYell(int32 textId, uint32 language, uint64 TargetGuid) void WorldObject::MonsterYell(int32 textId, uint32 language, uint64 TargetGuid)
@ -1516,7 +1518,7 @@ void WorldObject::MonsterYell(int32 textId, uint32 language, uint64 TargetGuid)
cell.data.Part.reserved = ALL_DISTRICT; cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate(); cell.SetNoCreate();
float range = sWorld.getRate(RATE_LISTEN_RANGE_YELL); float range = sWorld.getConfig(CONFIG_FLOAT_LISTEN_RANGE_YELL);
MaNGOS::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_YELL, textId,language,TargetGuid); MaNGOS::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_YELL, textId,language,TargetGuid);
MaNGOS::LocalizedPacketDo<MaNGOS::MonsterChatBuilder> say_do(say_build); MaNGOS::LocalizedPacketDo<MaNGOS::MonsterChatBuilder> say_do(say_build);
@ -1546,7 +1548,7 @@ void WorldObject::MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossE
cell.data.Part.reserved = ALL_DISTRICT; cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate(); cell.SetNoCreate();
float range = sWorld.getRate(IsBossEmote ? RATE_LISTEN_RANGE_YELL : RATE_LISTEN_RANGE_TEXTEMOTE); float range = sWorld.getConfig(IsBossEmote ? CONFIG_FLOAT_LISTEN_RANGE_YELL : CONFIG_FLOAT_LISTEN_RANGE_TEXTEMOTE);
MaNGOS::MonsterChatBuilder say_build(*this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId,LANG_UNIVERSAL,TargetGuid); MaNGOS::MonsterChatBuilder say_build(*this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId,LANG_UNIVERSAL,TargetGuid);
MaNGOS::LocalizedPacketDo<MaNGOS::MonsterChatBuilder> say_do(say_build); MaNGOS::LocalizedPacketDo<MaNGOS::MonsterChatBuilder> say_do(say_build);
@ -1764,7 +1766,7 @@ void WorldObject::GetNearPoint(WorldObject const* searcher, float &x, float &y,
z = GetPositionZ(); z = GetPositionZ();
// if detection disabled, return first point // if detection disabled, return first point
if(!sWorld.getConfig(CONFIG_DETECT_POS_COLLISION)) if(!sWorld.getConfig(CONFIG_BOOL_DETECT_POS_COLLISION))
{ {
UpdateGroundPositionZ(x,y,z); // update to LOS height if available UpdateGroundPositionZ(x,y,z); // update to LOS height if available
return; return;

View file

@ -263,7 +263,7 @@ ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia)
// create the bones only if the map and the grid is loaded at the corpse's location // create the bones only if the map and the grid is loaded at the corpse's location
// ignore bones creating option in case insignia // ignore bones creating option in case insignia
if (map && (insignia || if (map && (insignia ||
(map->IsBattleGroundOrArena() ? sWorld.getConfig(CONFIG_DEATH_BONES_BG_OR_ARENA) : sWorld.getConfig(CONFIG_DEATH_BONES_WORLD))) && (map->IsBattleGroundOrArena() ? sWorld.getConfig(CONFIG_BOOL_DEATH_BONES_BG_OR_ARENA) : sWorld.getConfig(CONFIG_BOOL_DEATH_BONES_WORLD))) &&
!map->IsRemovalGrid(corpse->GetPositionX(), corpse->GetPositionY())) !map->IsRemovalGrid(corpse->GetPositionX(), corpse->GetPositionY()))
{ {
// Create bones, don't change Corpse // Create bones, don't change Corpse

View file

@ -266,7 +266,7 @@ ObjectGridUnloader::Visit(GridRefManager<T> &m)
{ {
T *obj = m.getFirst()->getSource(); T *obj = m.getFirst()->getSource();
// if option set then object already saved at this moment // if option set then object already saved at this moment
if(!sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATLY)) if(!sWorld.getConfig(CONFIG_BOOL_SAVE_RESPAWN_TIME_IMMEDIATLY))
obj->SaveRespawnTime(); obj->SaveRespawnTime();
///- object must be out of world before delete ///- object must be out of world before delete
obj->RemoveFromWorld(); obj->RemoveFromWorld();

View file

@ -2224,7 +2224,7 @@ void ObjectMgr::LoadPetLevelInfo()
} }
uint32 current_level = fields[1].GetUInt32(); uint32 current_level = fields[1].GetUInt32();
if(current_level > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) if(current_level > sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
{ {
if(current_level > STRONG_MAX_LEVEL) // hardcoded level maximum 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); sLog.outErrorDb("Wrong (> %u) level %u in `pet_levelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level);
@ -2244,7 +2244,7 @@ void ObjectMgr::LoadPetLevelInfo()
PetLevelInfo*& pInfoMapEntry = petInfo[creature_id]; PetLevelInfo*& pInfoMapEntry = petInfo[creature_id];
if(pInfoMapEntry==NULL) if(pInfoMapEntry==NULL)
pInfoMapEntry = new PetLevelInfo[sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)]; pInfoMapEntry = new PetLevelInfo[sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL)];
// data for level 1 stored in [0] array element, ... // data for level 1 stored in [0] array element, ...
PetLevelInfo* pLevelInfo = &pInfoMapEntry[current_level-1]; PetLevelInfo* pLevelInfo = &pInfoMapEntry[current_level-1];
@ -2282,7 +2282,7 @@ void ObjectMgr::LoadPetLevelInfo()
} }
// fill level gaps // fill level gaps
for (uint32 level = 1; level < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL); ++level) for (uint32 level = 1; level < sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL); ++level)
{ {
if(pInfo[level].health == 0) if(pInfo[level].health == 0)
{ {
@ -2295,8 +2295,8 @@ void ObjectMgr::LoadPetLevelInfo()
PetLevelInfo const* ObjectMgr::GetPetLevelInfo(uint32 creature_id, uint32 level) const PetLevelInfo const* ObjectMgr::GetPetLevelInfo(uint32 creature_id, uint32 level) const
{ {
if(level > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) if(level > sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
level = sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL); level = sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL);
PetLevelInfoMap::const_iterator itr = petInfo.find(creature_id); PetLevelInfoMap::const_iterator itr = petInfo.find(creature_id);
if(itr == petInfo.end()) if(itr == petInfo.end())
@ -2622,7 +2622,7 @@ void ObjectMgr::LoadPlayerInfo()
sLog.outErrorDb("Wrong level %u in `player_classlevelstats` table, ignoring.",current_level); sLog.outErrorDb("Wrong level %u in `player_classlevelstats` table, ignoring.",current_level);
continue; continue;
} }
else if(current_level > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) else if(current_level > sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
{ {
if(current_level > STRONG_MAX_LEVEL) // hardcoded level maximum 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); sLog.outErrorDb("Wrong (> %u) level %u in `player_classlevelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level);
@ -2637,7 +2637,7 @@ void ObjectMgr::LoadPlayerInfo()
PlayerClassInfo* pClassInfo = &playerClassInfo[current_class]; PlayerClassInfo* pClassInfo = &playerClassInfo[current_class];
if(!pClassInfo->levelInfo) if(!pClassInfo->levelInfo)
pClassInfo->levelInfo = new PlayerClassLevelInfo[sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)]; pClassInfo->levelInfo = new PlayerClassLevelInfo[sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL)];
PlayerClassLevelInfo* pClassLevelInfo = &pClassInfo->levelInfo[current_level-1]; PlayerClassLevelInfo* pClassLevelInfo = &pClassInfo->levelInfo[current_level-1];
@ -2672,7 +2672,7 @@ void ObjectMgr::LoadPlayerInfo()
} }
// fill level gaps // fill level gaps
for (uint32 level = 1; level < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL); ++level) for (uint32 level = 1; level < sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL); ++level)
{ {
if(pClassInfo->levelInfo[level].basehealth == 0) if(pClassInfo->levelInfo[level].basehealth == 0)
{ {
@ -2720,7 +2720,7 @@ void ObjectMgr::LoadPlayerInfo()
} }
uint32 current_level = fields[2].GetUInt32(); uint32 current_level = fields[2].GetUInt32();
if(current_level > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) if(current_level > sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
{ {
if(current_level > STRONG_MAX_LEVEL) // hardcoded level maximum 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); sLog.outErrorDb("Wrong (> %u) level %u in `player_levelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level);
@ -2735,7 +2735,7 @@ void ObjectMgr::LoadPlayerInfo()
PlayerInfo* pInfo = &playerInfo[current_race][current_class]; PlayerInfo* pInfo = &playerInfo[current_race][current_class];
if(!pInfo->levelInfo) if(!pInfo->levelInfo)
pInfo->levelInfo = new PlayerLevelInfo[sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)]; pInfo->levelInfo = new PlayerLevelInfo[sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL)];
PlayerLevelInfo* pLevelInfo = &pInfo->levelInfo[current_level-1]; PlayerLevelInfo* pLevelInfo = &pInfo->levelInfo[current_level-1];
@ -2775,11 +2775,11 @@ void ObjectMgr::LoadPlayerInfo()
continue; continue;
// skip expansion races if not playing with expansion // skip expansion races if not playing with expansion
if (sWorld.getConfig(CONFIG_EXPANSION) < 1 && (race == RACE_BLOODELF || race == RACE_DRAENEI)) if (sWorld.getConfig(CONFIG_UINT32_EXPANSION) < 1 && (race == RACE_BLOODELF || race == RACE_DRAENEI))
continue; continue;
// skip expansion classes if not playing with expansion // skip expansion classes if not playing with expansion
if (sWorld.getConfig(CONFIG_EXPANSION) < 2 && class_ == CLASS_DEATH_KNIGHT) if (sWorld.getConfig(CONFIG_UINT32_EXPANSION) < 2 && class_ == CLASS_DEATH_KNIGHT)
continue; continue;
// fatal error if no level 1 data // fatal error if no level 1 data
@ -2790,7 +2790,7 @@ void ObjectMgr::LoadPlayerInfo()
} }
// fill level gaps // fill level gaps
for (uint32 level = 1; level < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL); ++level) for (uint32 level = 1; level < sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL); ++level)
{ {
if(pInfo->levelInfo[level].stats[0] == 0) if(pInfo->levelInfo[level].stats[0] == 0)
{ {
@ -2803,8 +2803,8 @@ void ObjectMgr::LoadPlayerInfo()
// Loading xp per level data // Loading xp per level data
{ {
mPlayerXPperLevel.resize(sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)); mPlayerXPperLevel.resize(sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL));
for (uint32 level = 0; level < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL); ++level) for (uint32 level = 0; level < sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL); ++level)
mPlayerXPperLevel[level] = 0; mPlayerXPperLevel[level] = 0;
// 0 1 // 0 1
@ -2831,7 +2831,7 @@ void ObjectMgr::LoadPlayerInfo()
uint32 current_level = fields[0].GetUInt32(); uint32 current_level = fields[0].GetUInt32();
uint32 current_xp = fields[1].GetUInt32(); uint32 current_xp = fields[1].GetUInt32();
if(current_level >= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) if(current_level >= sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
{ {
if(current_level > STRONG_MAX_LEVEL) // hardcoded level maximum 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); sLog.outErrorDb("Wrong (> %u) level %u in `player_xp_for_level` table, ignoring.", STRONG_MAX_LEVEL,current_level);
@ -2856,7 +2856,7 @@ void ObjectMgr::LoadPlayerInfo()
} }
// fill level gaps // fill level gaps
for (uint32 level = 1; level < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL); ++level) for (uint32 level = 1; level < sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL); ++level)
{ {
if( mPlayerXPperLevel[level] == 0) if( mPlayerXPperLevel[level] == 0)
{ {
@ -2873,8 +2873,8 @@ void ObjectMgr::GetPlayerClassLevelInfo(uint32 class_, uint32 level, PlayerClass
PlayerClassInfo const* pInfo = &playerClassInfo[class_]; PlayerClassInfo const* pInfo = &playerClassInfo[class_];
if(level > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) if(level > sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
level = sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL); level = sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL);
*info = pInfo->levelInfo[level-1]; *info = pInfo->levelInfo[level-1];
} }
@ -2888,7 +2888,7 @@ void ObjectMgr::GetPlayerLevelInfo(uint32 race, uint32 class_, uint32 level, Pla
if(pInfo->displayId_m==0 || pInfo->displayId_f==0) if(pInfo->displayId_m==0 || pInfo->displayId_f==0)
return; return;
if(level <= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) if(level <= sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
*info = pInfo->levelInfo[level-1]; *info = pInfo->levelInfo[level-1];
else else
BuildPlayerLevelInfo(race,class_,level,info); BuildPlayerLevelInfo(race,class_,level,info);
@ -2897,9 +2897,9 @@ void ObjectMgr::GetPlayerLevelInfo(uint32 race, uint32 class_, uint32 level, Pla
void ObjectMgr::BuildPlayerLevelInfo(uint8 race, uint8 _class, uint8 level, PlayerLevelInfo* info) const void ObjectMgr::BuildPlayerLevelInfo(uint8 race, uint8 _class, uint8 level, PlayerLevelInfo* info) const
{ {
// base data (last known level) // base data (last known level)
*info = playerInfo[race][_class].levelInfo[sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)-1]; *info = playerInfo[race][_class].levelInfo[sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL)-1];
for(int lvl = sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)-1; lvl < level; ++lvl) for(int lvl = sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL)-1; lvl < level; ++lvl)
{ {
switch(_class) switch(_class)
{ {
@ -3044,9 +3044,9 @@ void ObjectMgr::LoadGuilds()
delete guildBankTabRightsResult; delete guildBankTabRightsResult;
//delete unused LogGuid records in guild_eventlog and guild_bank_eventlog table //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 //you can comment these lines if you don't plan to change CONFIG_UINT32_GUILD_EVENT_LOG_COUNT and CONFIG_UINT32_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_eventlog WHERE LogGuid > '%u'", sWorld.getConfig(CONFIG_UINT32_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_bank_eventlog WHERE LogGuid > '%u'", sWorld.getConfig(CONFIG_UINT32_GUILD_BANK_EVENT_LOG_COUNT));
sLog.outString(); sLog.outString();
sLog.outString( ">> Loaded %u guild definitions", count ); sLog.outString( ">> Loaded %u guild definitions", count );
@ -6939,7 +6939,7 @@ enum LanguageType
static LanguageType GetRealmLanguageType(bool create) static LanguageType GetRealmLanguageType(bool create)
{ {
switch(sWorld.getConfig(CONFIG_REALM_ZONE)) switch(sWorld.getConfig(CONFIG_UINT32_REALM_ZONE))
{ {
case REALM_ZONE_UNKNOWN: // any language case REALM_ZONE_UNKNOWN: // any language
case REALM_ZONE_DEVELOPMENT: case REALM_ZONE_DEVELOPMENT:
@ -7010,11 +7010,11 @@ uint8 ObjectMgr::CheckPlayerName( const std::string& name, bool create )
if(wname.size() > MAX_PLAYER_NAME) if(wname.size() > MAX_PLAYER_NAME)
return CHAR_NAME_TOO_LONG; return CHAR_NAME_TOO_LONG;
uint32 minName = sWorld.getConfig(CONFIG_MIN_PLAYER_NAME); uint32 minName = sWorld.getConfig(CONFIG_UINT32_MIN_PLAYER_NAME);
if(wname.size() < minName) if(wname.size() < minName)
return CHAR_NAME_TOO_SHORT; return CHAR_NAME_TOO_SHORT;
uint32 strictMask = sWorld.getConfig(CONFIG_STRICT_PLAYER_NAMES); uint32 strictMask = sWorld.getConfig(CONFIG_UINT32_STRICT_PLAYER_NAMES);
if(!isValidString(wname,strictMask,false,create)) if(!isValidString(wname,strictMask,false,create))
return CHAR_NAME_MIXED_LANGUAGES; return CHAR_NAME_MIXED_LANGUAGES;
@ -7030,11 +7030,11 @@ bool ObjectMgr::IsValidCharterName( const std::string& name )
if(wname.size() > MAX_CHARTER_NAME) if(wname.size() > MAX_CHARTER_NAME)
return false; return false;
uint32 minName = sWorld.getConfig(CONFIG_MIN_CHARTER_NAME); uint32 minName = sWorld.getConfig(CONFIG_UINT32_MIN_CHARTER_NAME);
if(wname.size() < minName) if(wname.size() < minName)
return false; return false;
uint32 strictMask = sWorld.getConfig(CONFIG_STRICT_CHARTER_NAMES); uint32 strictMask = sWorld.getConfig(CONFIG_UINT32_STRICT_CHARTER_NAMES);
return isValidString(wname,strictMask,true); return isValidString(wname,strictMask,true);
} }
@ -7048,11 +7048,11 @@ PetNameInvalidReason ObjectMgr::CheckPetName( const std::string& name )
if(wname.size() > MAX_PET_NAME) if(wname.size() > MAX_PET_NAME)
return PET_NAME_TOO_LONG; return PET_NAME_TOO_LONG;
uint32 minName = sWorld.getConfig(CONFIG_MIN_PET_NAME); uint32 minName = sWorld.getConfig(CONFIG_UINT32_MIN_PET_NAME);
if(wname.size() < minName) if(wname.size() < minName)
return PET_NAME_TOO_SHORT; return PET_NAME_TOO_SHORT;
uint32 strictMask = sWorld.getConfig(CONFIG_STRICT_PET_NAMES); uint32 strictMask = sWorld.getConfig(CONFIG_UINT32_STRICT_PET_NAMES);
if(!isValidString(wname,strictMask,false)) if(!isValidString(wname,strictMask,false))
return PET_NAME_MIXED_LANGUAGES; return PET_NAME_MIXED_LANGUAGES;
@ -7620,7 +7620,7 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val
} }
case CONDITION_LEVEL: case CONDITION_LEVEL:
{ {
if (!value1 || value1 > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) if (!value1 || value1 > sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
{ {
sLog.outErrorDb("Level condition has invalid level %u, skipped", value1); sLog.outErrorDb("Level condition has invalid level %u, skipped", value1);
return false; return false;

View file

@ -579,7 +579,7 @@ void Pet::Regenerate(Powers power)
case POWER_FOCUS: case POWER_FOCUS:
{ {
// For hunter pets. // For hunter pets.
addvalue = 24 * sWorld.getRate(RATE_POWER_FOCUS); addvalue = 24 * sWorld.getConfig(CONFIG_FLOAT_RATE_POWER_FOCUS);
break; break;
} }
case POWER_ENERGY: case POWER_ENERGY:
@ -696,7 +696,7 @@ void Pet::GivePetXP(uint32 xp)
uint32 level = getLevel(); uint32 level = getLevel();
// XP to money conversion processed in Player::RewardQuest // XP to money conversion processed in Player::RewardQuest
if(level >= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) if(level >= sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
return; return;
uint32 curXP = GetUInt32Value(UNIT_FIELD_PETEXPERIENCE); uint32 curXP = GetUInt32Value(UNIT_FIELD_PETEXPERIENCE);
@ -709,7 +709,7 @@ void Pet::GivePetXP(uint32 xp)
return; return;
} }
while( newXP >= nextLvlXP && level < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL) ) while( newXP >= nextLvlXP && level < sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL) )
{ {
newXP -= nextLvlXP; newXP -= nextLvlXP;

View file

@ -311,7 +311,7 @@ void PetAI::UpdateAI(const uint32 diff)
bool PetAI::_isVisible(Unit *u) const bool PetAI::_isVisible(Unit *u) const
{ {
return m_creature->IsWithinDist(u,sWorld.getRate(RATE_SIGHT_GUARDER)) return m_creature->IsWithinDist(u,sWorld.getConfig(CONFIG_FLOAT_SIGHT_GUARDER))
&& u->isVisibleForOrDetect(m_creature,m_creature,true); && u->isVisibleForOrDetect(m_creature,m_creature,true);
} }

View file

@ -110,9 +110,9 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
else else
{ {
// TODO: find correct opcode // TODO: find correct opcode
if(_player->getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) if(_player->getLevel() < sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
{ {
SendNotification(LANG_ARENA_ONE_TOOLOW, sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)); SendNotification(LANG_ARENA_ONE_TOOLOW, sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL));
return; return;
} }
@ -475,7 +475,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
return; return;
// not let enemies sign guild charter // not let enemies sign guild charter
if(!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && GetPlayer()->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(ownerguid)) if(!sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_GUILD) && GetPlayer()->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(ownerguid))
{ {
if(type != 9) if(type != 9)
SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED); SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED);
@ -486,7 +486,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
if(type != 9) if(type != 9)
{ {
if(_player->getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) if(_player->getLevel() < sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
{ {
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", _player->GetName(), ERR_ARENA_TEAM_TARGET_TOO_LOW_S); SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", _player->GetName(), ERR_ARENA_TEAM_TARGET_TOO_LOW_S);
return; return;
@ -622,7 +622,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)); 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.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_GUILD) && GetPlayer()->GetTeam() != player->GetTeam() )
{ {
if(type != 9) if(type != 9)
SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED); SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED);
@ -633,7 +633,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data)
if(type != 9) if(type != 9)
{ {
if(player->getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) if(player->getLevel() < sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
{ {
// player is too low level to join an arena team // 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); SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, player->GetName(), "", ERR_ARENA_TEAM_TARGET_TOO_LOW_S);
@ -768,9 +768,9 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
signs = 0; signs = 0;
uint32 count; uint32 count;
//if(signs < sWorld.getConfig(CONFIG_MIN_PETITION_SIGNS)) //if(signs < sWorld.getConfig(CONFIG_UINT32_MIN_PETITION_SIGNS))
if(type == 9) if(type == 9)
count = sWorld.getConfig(CONFIG_MIN_PETITION_SIGNS); count = sWorld.getConfig(CONFIG_UINT32_MIN_PETITION_SIGNS);
else else
count = type - 1; count = type - 1;
if(signs < count) if(signs < count)

View file

@ -346,9 +346,9 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
m_areaUpdateId = 0; m_areaUpdateId = 0;
m_nextSave = sWorld.getConfig(CONFIG_INTERVAL_SAVE); m_nextSave = sWorld.getConfig(CONFIG_UINT32_INTERVAL_SAVE);
// randomize first save time in range [CONFIG_INTERVAL_SAVE] around [CONFIG_INTERVAL_SAVE] // randomize first save time in range [CONFIG_UINT32_INTERVAL_SAVE] around [CONFIG_UINT32_INTERVAL_SAVE]
// this must help in case next save after mass player load after server startup // this must help in case next save after mass player load after server startup
m_nextSave = urand(m_nextSave/2,m_nextSave*3/2); m_nextSave = urand(m_nextSave/2,m_nextSave*3/2);
@ -624,12 +624,12 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8
// set starting level // set starting level
uint32 start_level = getClass() != CLASS_DEATH_KNIGHT uint32 start_level = getClass() != CLASS_DEATH_KNIGHT
? sWorld.getConfig(CONFIG_START_PLAYER_LEVEL) ? sWorld.getConfig(CONFIG_UINT32_START_PLAYER_LEVEL)
: sWorld.getConfig(CONFIG_START_HEROIC_PLAYER_LEVEL); : sWorld.getConfig(CONFIG_UINT32_START_HEROIC_PLAYER_LEVEL);
if (GetSession()->GetSecurity() >= SEC_MODERATOR) if (GetSession()->GetSecurity() >= SEC_MODERATOR)
{ {
uint32 gm_level = sWorld.getConfig(CONFIG_START_GM_LEVEL); uint32 gm_level = sWorld.getConfig(CONFIG_UINT32_START_GM_LEVEL);
if(gm_level > start_level) if(gm_level > start_level)
start_level = gm_level; start_level = gm_level;
} }
@ -638,9 +638,9 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8
InitRunes(); InitRunes();
SetUInt32Value (PLAYER_FIELD_COINAGE, sWorld.getConfig(CONFIG_START_PLAYER_MONEY)); SetUInt32Value (PLAYER_FIELD_COINAGE, sWorld.getConfig(CONFIG_UINT32_START_PLAYER_MONEY));
SetUInt32Value (PLAYER_FIELD_HONOR_CURRENCY, sWorld.getConfig(CONFIG_START_HONOR_POINTS)); SetUInt32Value (PLAYER_FIELD_HONOR_CURRENCY, sWorld.getConfig(CONFIG_UINT32_START_HONOR_POINTS));
SetUInt32Value (PLAYER_FIELD_ARENA_CURRENCY, sWorld.getConfig(CONFIG_START_ARENA_POINTS)); SetUInt32Value (PLAYER_FIELD_ARENA_CURRENCY, sWorld.getConfig(CONFIG_UINT32_START_ARENA_POINTS));
// Played time // Played time
m_Last_tick = time(NULL); m_Last_tick = time(NULL);
@ -901,15 +901,15 @@ int32 Player::getMaxTimer(MirrorTimerType timer)
switch (timer) switch (timer)
{ {
case FATIGUE_TIMER: case FATIGUE_TIMER:
if (GetSession()->GetSecurity() >= (AccountTypes)sWorld.getConfig(CONFIG_TIMERBAR_FATIGUE_GMLEVEL)) if (GetSession()->GetSecurity() >= (AccountTypes)sWorld.getConfig(CONFIG_UINT32_TIMERBAR_FATIGUE_GMLEVEL))
return DISABLED_MIRROR_TIMER; return DISABLED_MIRROR_TIMER;
return sWorld.getConfig(CONFIG_TIMERBAR_FATIGUE_MAX)*IN_MILISECONDS; return sWorld.getConfig(CONFIG_UINT32_TIMERBAR_FATIGUE_MAX)*IN_MILISECONDS;
case BREATH_TIMER: case BREATH_TIMER:
{ {
if (!isAlive() || HasAuraType(SPELL_AURA_WATER_BREATHING) || if (!isAlive() || HasAuraType(SPELL_AURA_WATER_BREATHING) ||
GetSession()->GetSecurity() >= (AccountTypes)sWorld.getConfig(CONFIG_TIMERBAR_BREATH_GMLEVEL)) GetSession()->GetSecurity() >= (AccountTypes)sWorld.getConfig(CONFIG_UINT32_TIMERBAR_BREATH_GMLEVEL))
return DISABLED_MIRROR_TIMER; return DISABLED_MIRROR_TIMER;
int32 UnderWaterTime = sWorld.getConfig(CONFIG_TIMERBAR_BREATH_MAX)*IN_MILISECONDS; int32 UnderWaterTime = sWorld.getConfig(CONFIG_UINT32_TIMERBAR_BREATH_MAX)*IN_MILISECONDS;
AuraList const& mModWaterBreathing = GetAurasByType(SPELL_AURA_MOD_WATER_BREATHING); AuraList const& mModWaterBreathing = GetAurasByType(SPELL_AURA_MOD_WATER_BREATHING);
for(AuraList::const_iterator i = mModWaterBreathing.begin(); i != mModWaterBreathing.end(); ++i) for(AuraList::const_iterator i = mModWaterBreathing.begin(); i != mModWaterBreathing.end(); ++i)
UnderWaterTime = uint32(UnderWaterTime * (100.0f + (*i)->GetModifier()->m_amount) / 100.0f); UnderWaterTime = uint32(UnderWaterTime * (100.0f + (*i)->GetModifier()->m_amount) / 100.0f);
@ -917,9 +917,9 @@ int32 Player::getMaxTimer(MirrorTimerType timer)
} }
case FIRE_TIMER: case FIRE_TIMER:
{ {
if (!isAlive() || GetSession()->GetSecurity() >= (AccountTypes)sWorld.getConfig(CONFIG_TIMERBAR_FIRE_GMLEVEL)) if (!isAlive() || GetSession()->GetSecurity() >= (AccountTypes)sWorld.getConfig(CONFIG_UINT32_TIMERBAR_FIRE_GMLEVEL))
return DISABLED_MIRROR_TIMER; return DISABLED_MIRROR_TIMER;
return sWorld.getConfig(CONFIG_TIMERBAR_FIRE_MAX)*IN_MILISECONDS; return sWorld.getConfig(CONFIG_UINT32_TIMERBAR_FIRE_MAX)*IN_MILISECONDS;
} }
default: default:
return 0; return 0;
@ -1248,7 +1248,7 @@ void Player::Update( uint32 p_time )
time_t time_inn = time(NULL)-GetTimeInnEnter(); time_t time_inn = time(NULL)-GetTimeInnEnter();
if (time_inn >= 10) //freeze update if (time_inn >= 10) //freeze update
{ {
float bubble = 0.125f*sWorld.getRate(RATE_REST_INGAME); float bubble = 0.125f*sWorld.getConfig(CONFIG_FLOAT_RATE_REST_INGAME);
//speed collect rest bonus (section/in hour) //speed collect rest bonus (section/in hour)
SetRestBonus( float(GetRestBonus()+ time_inn*(GetUInt32Value(PLAYER_NEXT_LEVEL_XP)/72000)*bubble )); SetRestBonus( float(GetRestBonus()+ time_inn*(GetUInt32Value(PLAYER_NEXT_LEVEL_XP)/72000)*bubble ));
UpdateInnerTime(time(NULL)); UpdateInnerTime(time(NULL));
@ -1496,7 +1496,7 @@ bool Player::BuildEnumData( QueryResult * result, WorldPacket * p_data )
char_flags |= CHARACTER_FLAG_GHOST; char_flags |= CHARACTER_FLAG_GHOST;
if(atLoginFlags & AT_LOGIN_RENAME) if(atLoginFlags & AT_LOGIN_RENAME)
char_flags |= CHARACTER_FLAG_RENAME; char_flags |= CHARACTER_FLAG_RENAME;
if(sWorld.getConfig(CONFIG_DECLINED_NAMES_USED)) if(sWorld.getConfig(CONFIG_BOOL_DECLINED_NAMES_USED))
{ {
if(!fields[20].GetCppString().empty()) if(!fields[20].GetCppString().empty())
char_flags |= CHARACTER_FLAG_DECLINED; char_flags |= CHARACTER_FLAG_DECLINED;
@ -1964,7 +1964,7 @@ void Player::RewardRage( uint32 damage, uint32 weaponSpeedHitFactor, bool attack
addRage *= 1.3f; addRage *= 1.3f;
} }
addRage *= sWorld.getRate(RATE_POWER_RAGE_INCOME); addRage *= sWorld.getConfig(CONFIG_FLOAT_RATE_POWER_RAGE_INCOME);
ModifyPower(POWER_RAGE, uint32(addRage*10)); ModifyPower(POWER_RAGE, uint32(addRage*10));
} }
@ -2007,7 +2007,7 @@ void Player::Regenerate(Powers power, uint32 diff)
case POWER_MANA: case POWER_MANA:
{ {
bool recentCast = IsUnderLastManaUseEffect(); bool recentCast = IsUnderLastManaUseEffect();
float ManaIncreaseRate = sWorld.getRate(RATE_POWER_MANA); float ManaIncreaseRate = sWorld.getConfig(CONFIG_FLOAT_RATE_POWER_MANA);
if (recentCast) if (recentCast)
{ {
// Mangos Updates Mana in intervals of 2s, which is correct // Mangos Updates Mana in intervals of 2s, which is correct
@ -2020,7 +2020,7 @@ void Player::Regenerate(Powers power, uint32 diff)
} break; } break;
case POWER_RAGE: // Regenerate rage case POWER_RAGE: // Regenerate rage
{ {
float RageDecreaseRate = sWorld.getRate(RATE_POWER_RAGE_LOSS); float RageDecreaseRate = sWorld.getConfig(CONFIG_FLOAT_RATE_POWER_RAGE_LOSS);
addvalue = 20 * RageDecreaseRate; // 2 rage by tick (= 2 seconds => 1 rage/sec) addvalue = 20 * RageDecreaseRate; // 2 rage by tick (= 2 seconds => 1 rage/sec)
} break; } break;
case POWER_ENERGY: // Regenerate energy (rogue) case POWER_ENERGY: // Regenerate energy (rogue)
@ -2028,7 +2028,7 @@ void Player::Regenerate(Powers power, uint32 diff)
break; break;
case POWER_RUNIC_POWER: case POWER_RUNIC_POWER:
{ {
float RunicPowerDecreaseRate = sWorld.getRate(RATE_POWER_RUNICPOWER_LOSS); float RunicPowerDecreaseRate = sWorld.getConfig(CONFIG_FLOAT_RATE_POWER_RUNICPOWER_LOSS);
addvalue = 30 * RunicPowerDecreaseRate; // 3 RunicPower by tick addvalue = 30 * RunicPowerDecreaseRate; // 3 RunicPower by tick
} break; } break;
case POWER_RUNE: case POWER_RUNE:
@ -2084,7 +2084,7 @@ void Player::RegenerateHealth(uint32 diff)
if (curValue >= maxValue) return; if (curValue >= maxValue) return;
float HealthIncreaseRate = sWorld.getRate(RATE_HEALTH); float HealthIncreaseRate = sWorld.getConfig(CONFIG_FLOAT_RATE_HEALTH);
float addvalue = 0.0f; float addvalue = 0.0f;
@ -2317,7 +2317,7 @@ void Player::SetGMVisible(bool on)
bool Player::IsGroupVisibleFor(Player* p) const bool Player::IsGroupVisibleFor(Player* p) const
{ {
switch(sWorld.getConfig(CONFIG_GROUP_VISIBILITY)) switch(sWorld.getConfig(CONFIG_UINT32_GROUP_VISIBILITY))
{ {
default: return IsInSameGroupWith(p); default: return IsInSameGroupWith(p);
case 1: return IsInSameRaidWith(p); case 1: return IsInSameRaidWith(p);
@ -2395,7 +2395,7 @@ void Player::GiveXP(uint32 xp, Unit* victim)
uint32 level = getLevel(); uint32 level = getLevel();
// XP to money conversion processed in Player::RewardQuest // XP to money conversion processed in Player::RewardQuest
if(level >= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) if(level >= sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
return; return;
if(victim) if(victim)
@ -2422,11 +2422,11 @@ void Player::GiveXP(uint32 xp, Unit* victim)
uint32 nextLvlXP = GetUInt32Value(PLAYER_NEXT_LEVEL_XP); uint32 nextLvlXP = GetUInt32Value(PLAYER_NEXT_LEVEL_XP);
uint32 newXP = curXP + xp + rested_bonus_xp; uint32 newXP = curXP + xp + rested_bonus_xp;
while( newXP >= nextLvlXP && level < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL) ) while( newXP >= nextLvlXP && level < sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL) )
{ {
newXP -= nextLvlXP; newXP -= nextLvlXP;
if ( level < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL) ) if ( level < sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL) )
GiveLevel(level + 1); GiveLevel(level + 1);
level = getLevel(); level = getLevel();
@ -2557,7 +2557,7 @@ void Player::InitStatsForLevel(bool reapplyMods)
PlayerLevelInfo info; PlayerLevelInfo info;
sObjectMgr.GetPlayerLevelInfo(getRace(),getClass(),getLevel(),&info); sObjectMgr.GetPlayerLevelInfo(getRace(),getClass(),getLevel(),&info);
SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL) ); SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL) );
SetUInt32Value(PLAYER_NEXT_LEVEL_XP, sObjectMgr.GetXPForLevel(getLevel())); SetUInt32Value(PLAYER_NEXT_LEVEL_XP, sObjectMgr.GetXPForLevel(getLevel()));
// reset before any aura state sources (health set/aura apply) // reset before any aura state sources (health set/aura apply)
@ -3297,7 +3297,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank, bo
if(sSpellMgr.IsPrimaryProfessionFirstRankSpell(spell_id)) if(sSpellMgr.IsPrimaryProfessionFirstRankSpell(spell_id))
{ {
uint32 freeProfs = GetFreePrimaryProfessionPoints()+1; uint32 freeProfs = GetFreePrimaryProfessionPoints()+1;
if(freeProfs <= sWorld.getConfig(CONFIG_MAX_PRIMARY_TRADE_SKILL)) if(freeProfs <= sWorld.getConfig(CONFIG_UINT32_MAX_PRIMARY_TRADE_SKILL))
SetFreePrimaryProfessions(freeProfs); SetFreePrimaryProfessions(freeProfs);
} }
@ -3690,7 +3690,7 @@ bool Player::resetTalents(bool no_cost)
if(m_canTitanGrip) if(m_canTitanGrip)
{ {
m_canTitanGrip = false; m_canTitanGrip = false;
if(sWorld.getConfig(CONFIG_OFFHAND_CHECK_AT_TALENTS_RESET)) if(sWorld.getConfig(CONFIG_BOOL_OFFHAND_CHECK_AT_TALENTS_RESET))
AutoUnequipOffhandIfNeed(); AutoUnequipOffhandIfNeed();
} }
@ -4244,7 +4244,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
//Characters from level 11-19 will suffer from one minute of sickness //Characters from level 11-19 will suffer from one minute of sickness
//for each level they are above 10. //for each level they are above 10.
//Characters level 20 and up suffer from ten minutes of sickness. //Characters level 20 and up suffer from ten minutes of sickness.
int32 startLevel = sWorld.getConfig(CONFIG_DEATH_SICKNESS_LEVEL); int32 startLevel = sWorld.getConfig(CONFIG_UINT32_DEATH_SICKNESS_LEVEL);
if(int32(getLevel()) >= startLevel) if(int32(getLevel()) >= startLevel)
{ {
@ -4718,7 +4718,7 @@ void Player::LeaveLFGChannel()
void Player::UpdateDefense() void Player::UpdateDefense()
{ {
uint32 defense_skill_gain = sWorld.getConfig(CONFIG_SKILL_GAIN_DEFENSE); uint32 defense_skill_gain = sWorld.getConfig(CONFIG_UINT32_SKILL_GAIN_DEFENSE);
if(UpdateSkill(SKILL_DEFENSE,defense_skill_gain)) if(UpdateSkill(SKILL_DEFENSE,defense_skill_gain))
{ {
@ -5125,12 +5125,12 @@ bool Player::UpdateSkill(uint32 skill_id, uint32 step)
inline int SkillGainChance(uint32 SkillValue, uint32 GrayLevel, uint32 GreenLevel, uint32 YellowLevel) inline int SkillGainChance(uint32 SkillValue, uint32 GrayLevel, uint32 GreenLevel, uint32 YellowLevel)
{ {
if ( SkillValue >= GrayLevel ) if ( SkillValue >= GrayLevel )
return sWorld.getConfig(CONFIG_SKILL_CHANCE_GREY)*10; return sWorld.getConfig(CONFIG_UINT32_SKILL_CHANCE_GREY)*10;
if ( SkillValue >= GreenLevel ) if ( SkillValue >= GreenLevel )
return sWorld.getConfig(CONFIG_SKILL_CHANCE_GREEN)*10; return sWorld.getConfig(CONFIG_UINT32_SKILL_CHANCE_GREEN)*10;
if ( SkillValue >= YellowLevel ) if ( SkillValue >= YellowLevel )
return sWorld.getConfig(CONFIG_SKILL_CHANCE_YELLOW)*10; return sWorld.getConfig(CONFIG_UINT32_SKILL_CHANCE_YELLOW)*10;
return sWorld.getConfig(CONFIG_SKILL_CHANCE_ORANGE)*10; return sWorld.getConfig(CONFIG_UINT32_SKILL_CHANCE_ORANGE)*10;
} }
bool Player::UpdateCraftSkill(uint32 spellid) bool Player::UpdateCraftSkill(uint32 spellid)
@ -5153,7 +5153,7 @@ bool Player::UpdateCraftSkill(uint32 spellid)
learnSpell(discoveredSpell,false); learnSpell(discoveredSpell,false);
} }
uint32 craft_skill_gain = sWorld.getConfig(CONFIG_SKILL_GAIN_CRAFTING); uint32 craft_skill_gain = sWorld.getConfig(CONFIG_UINT32_SKILL_GAIN_CRAFTING);
return UpdateSkillPro(_spell_idx->second->skillId, SkillGainChance(SkillValue, return UpdateSkillPro(_spell_idx->second->skillId, SkillGainChance(SkillValue,
_spell_idx->second->max_value, _spell_idx->second->max_value,
@ -5169,7 +5169,7 @@ bool Player::UpdateGatherSkill(uint32 SkillId, uint32 SkillValue, uint32 RedLeve
{ {
sLog.outDebug("UpdateGatherSkill(SkillId %d SkillLevel %d RedLevel %d)", SkillId, SkillValue, RedLevel); 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.getConfig(CONFIG_UINT32_SKILL_GAIN_GATHERING);
// For skinning and Mining chance decrease with level. 1-74 - no decrease, 75-149 - 2 times, 225-299 - 8 times // For skinning and Mining chance decrease with level. 1-74 - no decrease, 75-149 - 2 times, 225-299 - 8 times
switch (SkillId) switch (SkillId)
@ -5180,15 +5180,15 @@ bool Player::UpdateGatherSkill(uint32 SkillId, uint32 SkillValue, uint32 RedLeve
case SKILL_INSCRIPTION: case SKILL_INSCRIPTION:
return UpdateSkillPro(SkillId, SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator,gathering_skill_gain); return UpdateSkillPro(SkillId, SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator,gathering_skill_gain);
case SKILL_SKINNING: case SKILL_SKINNING:
if( sWorld.getConfig(CONFIG_SKILL_CHANCE_SKINNING_STEPS)==0) if( sWorld.getConfig(CONFIG_UINT32_SKILL_CHANCE_SKINNING_STEPS)==0)
return UpdateSkillPro(SkillId, SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator,gathering_skill_gain); return UpdateSkillPro(SkillId, SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator,gathering_skill_gain);
else 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.getConfig(CONFIG_UINT32_SKILL_CHANCE_SKINNING_STEPS)), gathering_skill_gain);
case SKILL_MINING: case SKILL_MINING:
if (sWorld.getConfig(CONFIG_SKILL_CHANCE_MINING_STEPS)==0) if (sWorld.getConfig(CONFIG_UINT32_SKILL_CHANCE_MINING_STEPS)==0)
return UpdateSkillPro(SkillId, SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator,gathering_skill_gain); return UpdateSkillPro(SkillId, SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator,gathering_skill_gain);
else 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.getConfig(CONFIG_UINT32_SKILL_CHANCE_MINING_STEPS)),gathering_skill_gain);
} }
return false; return false;
} }
@ -5201,7 +5201,7 @@ bool Player::UpdateFishingSkill()
int32 chance = SkillValue < 75 ? 100 : 2500/(SkillValue-50); int32 chance = SkillValue < 75 ? 100 : 2500/(SkillValue-50);
uint32 gathering_skill_gain = sWorld.getConfig(CONFIG_SKILL_GAIN_GATHERING); uint32 gathering_skill_gain = sWorld.getConfig(CONFIG_UINT32_SKILL_GAIN_GATHERING);
return UpdateSkillPro(SKILL_FISHING,chance*10,gathering_skill_gain); return UpdateSkillPro(SKILL_FISHING,chance*10,gathering_skill_gain);
} }
@ -5277,7 +5277,7 @@ void Player::UpdateWeaponSkill (WeaponAttackType attType)
if(m_form == FORM_TREE) if(m_form == FORM_TREE)
return; // use weapon but not skill up return; // use weapon but not skill up
uint32 weapon_skill_gain = sWorld.getConfig(CONFIG_SKILL_GAIN_WEAPON); uint32 weapon_skill_gain = sWorld.getConfig(CONFIG_UINT32_SKILL_GAIN_WEAPON);
switch(attType) switch(attType)
{ {
@ -5365,7 +5365,7 @@ void Player::UpdateSkillsForLevel()
uint16 maxconfskill = sWorld.GetConfigMaxSkillValue(); uint16 maxconfskill = sWorld.GetConfigMaxSkillValue();
uint32 maxSkill = GetMaxSkillValueForLevel(); uint32 maxSkill = GetMaxSkillValueForLevel();
bool alwaysMaxSkill = sWorld.getConfig(CONFIG_ALWAYS_MAX_SKILL_FOR_LEVEL); bool alwaysMaxSkill = sWorld.getConfig(CONFIG_BOOL_ALWAYS_MAX_SKILL_FOR_LEVEL);
for(SkillStatusMap::iterator itr = mSkillStatus.begin(); itr != mSkillStatus.end(); ++itr) for(SkillStatusMap::iterator itr = mSkillStatus.begin(); itr != mSkillStatus.end(); ++itr)
{ {
@ -5910,7 +5910,7 @@ void Player::CheckExploreSystem()
else if(p->area_level > 0) else if(p->area_level > 0)
{ {
uint32 area = p->ID; uint32 area = p->ID;
if (getLevel() >= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) if (getLevel() >= sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
{ {
SendExplorationExperience(area,0); SendExplorationExperience(area,0);
} }
@ -5920,7 +5920,7 @@ void Player::CheckExploreSystem()
uint32 XP = 0; uint32 XP = 0;
if (diff < -5) if (diff < -5)
{ {
XP = uint32(sObjectMgr.GetBaseXP(getLevel()+5)*sWorld.getRate(RATE_XP_EXPLORE)); XP = uint32(sObjectMgr.GetBaseXP(getLevel()+5)*sWorld.getConfig(CONFIG_FLOAT_RATE_XP_EXPLORE));
} }
else if (diff > 5) else if (diff > 5)
{ {
@ -5930,11 +5930,11 @@ void Player::CheckExploreSystem()
else if (exploration_percent < 0) else if (exploration_percent < 0)
exploration_percent = 0; exploration_percent = 0;
XP = uint32(sObjectMgr.GetBaseXP(p->area_level)*exploration_percent/100*sWorld.getRate(RATE_XP_EXPLORE)); XP = uint32(sObjectMgr.GetBaseXP(p->area_level)*exploration_percent/100*sWorld.getConfig(CONFIG_FLOAT_RATE_XP_EXPLORE));
} }
else else
{ {
XP = uint32(sObjectMgr.GetBaseXP(p->area_level)*sWorld.getRate(RATE_XP_EXPLORE)); XP = uint32(sObjectMgr.GetBaseXP(p->area_level)*sWorld.getConfig(CONFIG_FLOAT_RATE_XP_EXPLORE));
} }
GiveXP( XP, NULL ); GiveXP( XP, NULL );
@ -5993,7 +5993,7 @@ int32 Player::CalculateReputationGain(uint32 creatureOrQuestLevel, int32 rep, in
{ {
float percent = 100.0f; float percent = 100.0f;
float rate = for_quest ? sWorld.getRate(RATE_REPUTATION_LOWLEVEL_QUEST) : sWorld.getRate(RATE_REPUTATION_LOWLEVEL_KILL); float rate = for_quest ? sWorld.getConfig(CONFIG_FLOAT_RATE_REPUTATION_LOWLEVEL_QUEST) : sWorld.getConfig(CONFIG_FLOAT_RATE_REPUTATION_LOWLEVEL_KILL);
if (rate != 1.0f && creatureOrQuestLevel <= MaNGOS::XP::GetGrayLevel(getLevel())) if (rate != 1.0f && creatureOrQuestLevel <= MaNGOS::XP::GetGrayLevel(getLevel()))
percent *= rate; percent *= rate;
@ -6008,7 +6008,7 @@ int32 Player::CalculateReputationGain(uint32 creatureOrQuestLevel, int32 rep, in
if (percent <= 0.0f) if (percent <= 0.0f)
return 0; return 0;
return int32(sWorld.getRate(RATE_REPUTATION_GAIN)*rep*percent/100.0f); return int32(sWorld.getConfig(CONFIG_FLOAT_RATE_REPUTATION_GAIN)*rep*percent/100.0f);
} }
//Calculates how many reputation points player gains in victim's enemy factions //Calculates how many reputation points player gains in victim's enemy factions
@ -6240,7 +6240,7 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor)
if (uVictim != NULL) if (uVictim != NULL)
{ {
honor *= sWorld.getRate(RATE_HONOR); honor *= sWorld.getConfig(CONFIG_FLOAT_RATE_HONOR);
honor *= (GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HONOR_GAIN) + 100.0f)/100.0f; honor *= (GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HONOR_GAIN) + 100.0f)/100.0f;
if(groupsize > 1) if(groupsize > 1)
@ -6272,26 +6272,26 @@ void Player::ModifyHonorPoints( int32 value )
{ {
if(value < 0) if(value < 0)
{ {
if (GetHonorPoints() > sWorld.getConfig(CONFIG_MAX_HONOR_POINTS)) if (GetHonorPoints() > sWorld.getConfig(CONFIG_UINT32_MAX_HONOR_POINTS))
SetUInt32Value(PLAYER_FIELD_HONOR_CURRENCY, sWorld.getConfig(CONFIG_MAX_HONOR_POINTS) + value); SetUInt32Value(PLAYER_FIELD_HONOR_CURRENCY, sWorld.getConfig(CONFIG_UINT32_MAX_HONOR_POINTS) + value);
else else
SetUInt32Value(PLAYER_FIELD_HONOR_CURRENCY, GetHonorPoints() > uint32(-value) ? GetHonorPoints() + value : 0); SetUInt32Value(PLAYER_FIELD_HONOR_CURRENCY, GetHonorPoints() > uint32(-value) ? GetHonorPoints() + value : 0);
} }
else else
SetUInt32Value(PLAYER_FIELD_HONOR_CURRENCY, GetHonorPoints() < sWorld.getConfig(CONFIG_MAX_HONOR_POINTS) - value ? GetHonorPoints() + value : sWorld.getConfig(CONFIG_MAX_HONOR_POINTS)); SetUInt32Value(PLAYER_FIELD_HONOR_CURRENCY, GetHonorPoints() < sWorld.getConfig(CONFIG_UINT32_MAX_HONOR_POINTS) - value ? GetHonorPoints() + value : sWorld.getConfig(CONFIG_UINT32_MAX_HONOR_POINTS));
} }
void Player::ModifyArenaPoints( int32 value ) void Player::ModifyArenaPoints( int32 value )
{ {
if(value < 0) if(value < 0)
{ {
if (GetArenaPoints() > sWorld.getConfig(CONFIG_MAX_ARENA_POINTS)) if (GetArenaPoints() > sWorld.getConfig(CONFIG_UINT32_MAX_ARENA_POINTS))
SetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY, sWorld.getConfig(CONFIG_MAX_ARENA_POINTS) + value); SetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY, sWorld.getConfig(CONFIG_UINT32_MAX_ARENA_POINTS) + value);
else else
SetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY, GetArenaPoints() > uint32(-value) ? GetArenaPoints() + value : 0); SetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY, GetArenaPoints() > uint32(-value) ? GetArenaPoints() + value : 0);
} }
else else
SetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY, GetArenaPoints() < sWorld.getConfig(CONFIG_MAX_ARENA_POINTS) - value ? GetArenaPoints() + value : sWorld.getConfig(CONFIG_MAX_ARENA_POINTS)); SetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY, GetArenaPoints() < sWorld.getConfig(CONFIG_UINT32_MAX_ARENA_POINTS) - value ? GetArenaPoints() + value : sWorld.getConfig(CONFIG_UINT32_MAX_ARENA_POINTS));
} }
uint32 Player::GetGuildIdFromDB(uint64 guid) uint32 Player::GetGuildIdFromDB(uint64 guid)
@ -6408,7 +6408,7 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
{ {
SendInitWorldStates(newZone, newArea); // only if really enters to new zone, not just area change, works strange... SendInitWorldStates(newZone, newArea); // only if really enters to new zone, not just area change, works strange...
if (sWorld.getConfig(CONFIG_WEATHER)) if (sWorld.getConfig(CONFIG_BOOL_WEATHER))
{ {
if(Weather *wth = sWorld.FindWeather(zone->ID)) if(Weather *wth = sWorld.FindWeather(zone->ID))
wth->SendWeatherUpdateToPlayer(this); wth->SendWeatherUpdateToPlayer(this);
@ -7644,7 +7644,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
loot->FillLoot(0, LootTemplates_Creature, this, false); loot->FillLoot(0, LootTemplates_Creature, this, false);
// It may need a better formula // It may need a better formula
// Now it works like this: lvl10: ~6copper, lvl70: ~9silver // Now it works like this: lvl10: ~6copper, lvl70: ~9silver
bones->loot.gold = (uint32)( urand(50, 150) * 0.016f * pow( ((float)pLevel)/5.76f, 2.5f) * sWorld.getRate(RATE_DROP_MONEY) ); bones->loot.gold = (uint32)( urand(50, 150) * 0.016f * pow( ((float)pLevel)/5.76f, 2.5f) * sWorld.getConfig(CONFIG_FLOAT_RATE_DROP_MONEY) );
} }
if (bones->lootRecipient != this) if (bones->lootRecipient != this)
@ -7682,7 +7682,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
// Generate extra money for pick pocket loot // Generate extra money for pick pocket loot
const uint32 a = urand(0, creature->getLevel()/2); const uint32 a = urand(0, creature->getLevel()/2);
const uint32 b = urand(0, getLevel()/2); const uint32 b = urand(0, getLevel()/2);
loot->gold = uint32(10 * (a + b) * sWorld.getRate(RATE_DROP_MONEY)); loot->gold = uint32(10 * (a + b) * sWorld.getConfig(CONFIG_FLOAT_RATE_DROP_MONEY));
} }
} }
else else
@ -7903,9 +7903,9 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)
data << uint32(0x8d4) << uint32(0x0); // 5 data << uint32(0x8d4) << uint32(0x0); // 5
data << uint32(0x8d3) << uint32(0x0); // 6 data << uint32(0x8d3) << uint32(0x0); // 6
// 7 1 - Arena season in progress, 0 - end of season // 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.getConfig(CONFIG_BOOL_ARENA_SEASON_IN_PROGRESS));
// 8 Arena season id // 8 Arena season id
data << uint32(0xF3D) << uint32(sWorld.getConfig(CONFIG_ARENA_SEASON_ID)); data << uint32(0xF3D) << uint32(sWorld.getConfig(CONFIG_UINT32_ARENA_SEASON_ID));
if(mapid == 530) // Outland if(mapid == 530) // Outland
{ {
data << uint32(0x9bf) << uint32(0x0); // 7 data << uint32(0x9bf) << uint32(0x0); // 7
@ -12857,7 +12857,7 @@ bool Player::CanSeeStartQuest( Quest const *pQuest )
SatisfyQuestPreviousQuest( pQuest, false ) && SatisfyQuestNextChain( pQuest, false ) && SatisfyQuestPreviousQuest( pQuest, false ) && SatisfyQuestNextChain( pQuest, false ) &&
SatisfyQuestPrevChain( pQuest, false ) && SatisfyQuestDay( pQuest, false ) ) SatisfyQuestPrevChain( pQuest, false ) && SatisfyQuestDay( pQuest, false ) )
{ {
return getLevel() + sWorld.getConfig(CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF) >= pQuest->GetMinLevel(); return getLevel() + sWorld.getConfig(CONFIG_UINT32_QUEST_HIGH_LEVEL_HIDE_DIFF) >= pQuest->GetMinLevel();
} }
return false; return false;
@ -13226,13 +13226,13 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver
QuestStatusData& q_status = mQuestStatus[quest_id]; QuestStatusData& q_status = mQuestStatus[quest_id];
// Not give XP in case already completed once repeatable quest // Not give XP in case already completed once repeatable quest
uint32 XP = q_status.m_rewarded ? 0 : uint32(pQuest->XPValue( this )*sWorld.getRate(RATE_XP_QUEST)); uint32 XP = q_status.m_rewarded ? 0 : uint32(pQuest->XPValue( this )*sWorld.getConfig(CONFIG_FLOAT_RATE_XP_QUEST));
if (getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) if (getLevel() < sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
GiveXP( XP , NULL ); GiveXP( XP , NULL );
else else
{ {
uint32 money = uint32(pQuest->GetRewMoneyMaxLevel() * sWorld.getRate(RATE_DROP_MONEY)); uint32 money = uint32(pQuest->GetRewMoneyMaxLevel() * sWorld.getConfig(CONFIG_FLOAT_RATE_DROP_MONEY));
ModifyMoney( money ); ModifyMoney( money );
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD, money); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD, money);
} }
@ -14301,7 +14301,7 @@ void Player::SendQuestReward( Quest const *pQuest, uint32 XP, Object * questGive
WorldPacket data( SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4) ); WorldPacket data( SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4) );
data << uint32(questid); data << uint32(questid);
if ( getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL) ) if ( getLevel() < sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL) )
{ {
data << uint32(XP); data << uint32(XP);
data << uint32(pQuest->GetRewOrReqMoney()); data << uint32(pQuest->GetRewOrReqMoney());
@ -14309,7 +14309,7 @@ void Player::SendQuestReward( Quest const *pQuest, uint32 XP, Object * questGive
else else
{ {
data << uint32(0); data << uint32(0);
data << uint32(pQuest->GetRewOrReqMoney() + int32(pQuest->GetRewMoneyMaxLevel() * sWorld.getRate(RATE_DROP_MONEY))); data << uint32(pQuest->GetRewOrReqMoney() + int32(pQuest->GetRewMoneyMaxLevel() * sWorld.getConfig(CONFIG_FLOAT_RATE_DROP_MONEY)));
} }
data << uint32(10*MaNGOS::Honor::hk_honor_at_level(getLevel(), pQuest->GetRewHonorAddition())); data << uint32(10*MaNGOS::Honor::hk_honor_at_level(getLevel(), pQuest->GetRewHonorAddition()));
@ -14730,8 +14730,8 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
_LoadArenaTeamInfo(holder->GetResult(PLAYER_LOGIN_QUERY_LOADARENAINFO)); _LoadArenaTeamInfo(holder->GetResult(PLAYER_LOGIN_QUERY_LOADARENAINFO));
uint32 arena_currency = fields[40].GetUInt32(); uint32 arena_currency = fields[40].GetUInt32();
if (arena_currency > sWorld.getConfig(CONFIG_MAX_ARENA_POINTS)) if (arena_currency > sWorld.getConfig(CONFIG_UINT32_MAX_ARENA_POINTS))
arena_currency = sWorld.getConfig(CONFIG_MAX_ARENA_POINTS); arena_currency = sWorld.getConfig(CONFIG_UINT32_MAX_ARENA_POINTS);
SetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY, arena_currency); SetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY, arena_currency);
@ -14926,8 +14926,8 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
if(time_diff > 0) if(time_diff > 0)
{ {
float bubble = fields[24].GetUInt32() > 0 float bubble = fields[24].GetUInt32() > 0
? bubble1*sWorld.getRate(RATE_REST_OFFLINE_IN_TAVERN_OR_CITY) ? bubble1*sWorld.getConfig(CONFIG_FLOAT_RATE_REST_OFFLINE_IN_TAVERN_OR_CITY)
: bubble0*sWorld.getRate(RATE_REST_OFFLINE_IN_WILDERNESS); : bubble0*sWorld.getConfig(CONFIG_FLOAT_RATE_REST_OFFLINE_IN_WILDERNESS);
SetRestBonus(GetRestBonus()+ time_diff*((float)GetUInt32Value(PLAYER_NEXT_LEVEL_XP)/72000)*bubble); SetRestBonus(GetRestBonus()+ time_diff*((float)GetUInt32Value(PLAYER_NEXT_LEVEL_XP)/72000)*bubble);
} }
@ -15135,7 +15135,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
// GM state // GM state
if(GetSession()->GetSecurity() > SEC_PLAYER) if(GetSession()->GetSecurity() > SEC_PLAYER)
{ {
switch(sWorld.getConfig(CONFIG_GM_LOGIN_STATE)) switch(sWorld.getConfig(CONFIG_UINT32_GM_LOGIN_STATE))
{ {
default: default:
case 0: break; // disable case 0: break; // disable
@ -15146,7 +15146,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
break; break;
} }
switch(sWorld.getConfig(CONFIG_GM_VISIBLE_STATE)) switch(sWorld.getConfig(CONFIG_UINT32_GM_VISIBLE_STATE))
{ {
default: default:
case 0: SetGMVisible(false); break; // invisible case 0: SetGMVisible(false); break; // invisible
@ -15157,7 +15157,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
break; break;
} }
switch(sWorld.getConfig(CONFIG_GM_ACCEPT_TICKETS)) switch(sWorld.getConfig(CONFIG_UINT32_GM_ACCEPT_TICKETS))
{ {
default: default:
case 0: break; // disable case 0: break; // disable
@ -15168,7 +15168,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
break; break;
} }
switch(sWorld.getConfig(CONFIG_GM_CHAT)) switch(sWorld.getConfig(CONFIG_UINT32_GM_CHAT))
{ {
default: default:
case 0: break; // disable case 0: break; // disable
@ -15179,7 +15179,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
break; break;
} }
switch(sWorld.getConfig(CONFIG_GM_WISPERING_TO)) switch(sWorld.getConfig(CONFIG_UINT32_GM_WISPERING_TO))
{ {
default: default:
case 0: break; // disable case 0: break; // disable
@ -16161,9 +16161,9 @@ bool Player::_LoadHomeBind(QueryResult *result)
void Player::SaveToDB() void Player::SaveToDB()
{ {
// we should assure this: assert((m_nextSave != sWorld.getConfig(CONFIG_INTERVAL_SAVE))); // we should assure this: assert((m_nextSave != sWorld.getConfig(CONFIG_UINT32_INTERVAL_SAVE)));
// delay auto save at any saves (manual, in code, or autosave) // delay auto save at any saves (manual, in code, or autosave)
m_nextSave = sWorld.getConfig(CONFIG_INTERVAL_SAVE); m_nextSave = sWorld.getConfig(CONFIG_UINT32_INTERVAL_SAVE);
//lets allow only players in world to be saved //lets allow only players in world to be saved
if(IsBeingTeleportedFar()) if(IsBeingTeleportedFar())
@ -16725,7 +16725,7 @@ void Player::UpdateSpeakTime()
time_t current = time (NULL); time_t current = time (NULL);
if(m_speakTime > current) if(m_speakTime > current)
{ {
uint32 max_count = sWorld.getConfig(CONFIG_CHATFLOOD_MESSAGE_COUNT); uint32 max_count = sWorld.getConfig(CONFIG_UINT32_CHATFLOOD_MESSAGE_COUNT);
if(!max_count) if(!max_count)
return; return;
@ -16733,7 +16733,7 @@ void Player::UpdateSpeakTime()
if(m_speakCount >= max_count) if(m_speakCount >= max_count)
{ {
// prevent overwrite mute time, if message send just before mutes set, for example. // 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.getConfig(CONFIG_UINT32_CHATFLOOD_MUTE_TIME);
if(GetSession()->m_muteTime < new_mute) if(GetSession()->m_muteTime < new_mute)
GetSession()->m_muteTime = new_mute; GetSession()->m_muteTime = new_mute;
@ -16743,7 +16743,7 @@ void Player::UpdateSpeakTime()
else else
m_speakCount = 0; m_speakCount = 0;
m_speakTime = current + sWorld.getConfig(CONFIG_CHATFLOOD_MESSAGE_DELAY); m_speakTime = current + sWorld.getConfig(CONFIG_UINT32_CHATFLOOD_MESSAGE_DELAY);
} }
bool Player::CanSpeak() const bool Player::CanSpeak() const
@ -17129,21 +17129,21 @@ void Player::Say(const std::string& text, const uint32 language)
{ {
WorldPacket data(SMSG_MESSAGECHAT, 200); WorldPacket data(SMSG_MESSAGECHAT, 200);
BuildPlayerChat(&data, CHAT_MSG_SAY, text, language); BuildPlayerChat(&data, CHAT_MSG_SAY, text, language);
SendMessageToSetInRange(&data,sWorld.getRate(RATE_LISTEN_RANGE_SAY),true); SendMessageToSetInRange(&data,sWorld.getConfig(CONFIG_FLOAT_LISTEN_RANGE_SAY),true);
} }
void Player::Yell(const std::string& text, const uint32 language) void Player::Yell(const std::string& text, const uint32 language)
{ {
WorldPacket data(SMSG_MESSAGECHAT, 200); WorldPacket data(SMSG_MESSAGECHAT, 200);
BuildPlayerChat(&data, CHAT_MSG_YELL, text, language); BuildPlayerChat(&data, CHAT_MSG_YELL, text, language);
SendMessageToSetInRange(&data,sWorld.getRate(RATE_LISTEN_RANGE_YELL),true); SendMessageToSetInRange(&data,sWorld.getConfig(CONFIG_FLOAT_LISTEN_RANGE_YELL),true);
} }
void Player::TextEmote(const std::string& text) void Player::TextEmote(const std::string& text)
{ {
WorldPacket data(SMSG_MESSAGECHAT, 200); WorldPacket data(SMSG_MESSAGECHAT, 200);
BuildPlayerChat(&data, CHAT_MSG_EMOTE, text, LANG_UNIVERSAL); BuildPlayerChat(&data, CHAT_MSG_EMOTE, text, LANG_UNIVERSAL);
SendMessageToSetInRange(&data,sWorld.getRate(RATE_LISTEN_RANGE_TEXTEMOTE),true, !sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT) ); SendMessageToSetInRange(&data,sWorld.getConfig(CONFIG_FLOAT_LISTEN_RANGE_TEXTEMOTE),true, !sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_CHAT) );
} }
void Player::Whisper(const std::string& text, uint32 language,uint64 receiver) void Player::Whisper(const std::string& text, uint32 language,uint64 receiver)
@ -17527,7 +17527,7 @@ void Player::LeaveAllArenaTeams(uint64 guid)
void Player::SetRestBonus (float rest_bonus_new) void Player::SetRestBonus (float rest_bonus_new)
{ {
// Prevent resting on max level // Prevent resting on max level
if(getLevel() >= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) if(getLevel() >= sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
rest_bonus_new = 0; rest_bonus_new = 0;
if(rest_bonus_new < 0) if(rest_bonus_new < 0)
@ -18604,7 +18604,7 @@ void Player::LeaveBattleground(bool teleportToEntryPoint)
bg->RemovePlayerAtLeave(GetGUID(), teleportToEntryPoint, true); bg->RemovePlayerAtLeave(GetGUID(), teleportToEntryPoint, true);
// call after remove to be sure that player resurrected for correct cast // 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.getConfig(CONFIG_BOOL_BATTLEGROUND_CAST_DESERTER) )
{ {
if( bg->GetStatus() == STATUS_IN_PROGRESS || bg->GetStatus() == STATUS_WAIT_JOIN ) if( bg->GetStatus() == STATUS_IN_PROGRESS || bg->GetStatus() == STATUS_WAIT_JOIN )
{ {
@ -18702,7 +18702,7 @@ bool Player::IsVisibleInGridForPlayer( Player* pl ) const
if(corpse) if(corpse)
{ {
// 20 - aggro distance for same level, 25 - max additional distance if player level less that creature level // 20 - aggro distance for same level, 25 - max additional distance if player level less that creature level
if(corpse->IsWithinDistInMap(this,(20+25)*sWorld.getRate(RATE_CREATURE_AGGRO))) if(corpse->IsWithinDistInMap(this,(20+25)*sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_AGGRO)))
return true; return true;
} }
} }
@ -18845,7 +18845,7 @@ template void Player::UpdateVisibilityOf(WorldObject const* viewPoint, DynamicOb
void Player::InitPrimaryProfessions() void Player::InitPrimaryProfessions()
{ {
SetFreePrimaryProfessions(sWorld.getConfig(CONFIG_MAX_PRIMARY_TRADE_SKILL)); SetFreePrimaryProfessions(sWorld.getConfig(CONFIG_UINT32_MAX_PRIMARY_TRADE_SKILL));
} }
void Player::SendComboPoints() void Player::SendComboPoints()
@ -19839,7 +19839,7 @@ void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewar
bool Player::IsAtGroupRewardDistance(WorldObject const* pRewardSource) const bool Player::IsAtGroupRewardDistance(WorldObject const* pRewardSource) const
{ {
if (pRewardSource->IsWithinDistInMap(this,sWorld.getRate(RATE_GROUP_XP_DISTANCE))) if (pRewardSource->IsWithinDistInMap(this,sWorld.getConfig(CONFIG_FLOAT_GROUP_XP_DISTANCE)))
return true; return true;
if (isAlive()) if (isAlive())
@ -19849,7 +19849,7 @@ bool Player::IsAtGroupRewardDistance(WorldObject const* pRewardSource) const
if (!corpse) if (!corpse)
return false; return false;
return pRewardSource->IsWithinDistInMap(corpse,sWorld.getRate(RATE_GROUP_XP_DISTANCE)); return pRewardSource->IsWithinDistInMap(corpse,sWorld.getConfig(CONFIG_FLOAT_GROUP_XP_DISTANCE));
} }
uint32 Player::GetBaseWeaponSkillValue (WeaponAttackType attType) const uint32 Player::GetBaseWeaponSkillValue (WeaponAttackType attType) const
@ -19938,8 +19938,8 @@ void Player::UpdateAreaDependentAuras( uint32 newArea )
uint32 Player::GetCorpseReclaimDelay(bool pvp) const uint32 Player::GetCorpseReclaimDelay(bool pvp) const
{ {
if ((pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP)) || if ((pvp && !sWorld.getConfig(CONFIG_BOOL_DEATH_CORPSE_RECLAIM_DELAY_PVP)) ||
(!pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE) )) (!pvp && !sWorld.getConfig(CONFIG_BOOL_DEATH_CORPSE_RECLAIM_DELAY_PVE) ))
{ {
return copseReclaimDelay[0]; return copseReclaimDelay[0];
} }
@ -19954,8 +19954,8 @@ void Player::UpdateCorpseReclaimDelay()
{ {
bool pvp = m_ExtraFlags & PLAYER_EXTRA_PVP_DEATH; bool pvp = m_ExtraFlags & PLAYER_EXTRA_PVP_DEATH;
if ((pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP)) || if ((pvp && !sWorld.getConfig(CONFIG_BOOL_DEATH_CORPSE_RECLAIM_DELAY_PVP)) ||
(!pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE) )) (!pvp && !sWorld.getConfig(CONFIG_BOOL_DEATH_CORPSE_RECLAIM_DELAY_PVE) ))
return; return;
time_t now = time(NULL); time_t now = time(NULL);
@ -19987,8 +19987,8 @@ void Player::SendCorpseReclaimDelay(bool load)
bool pvp = corpse->GetType()==CORPSE_RESURRECTABLE_PVP; bool pvp = corpse->GetType()==CORPSE_RESURRECTABLE_PVP;
uint32 count; uint32 count;
if( pvp && sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP) || if( pvp && sWorld.getConfig(CONFIG_BOOL_DEATH_CORPSE_RECLAIM_DELAY_PVP) ||
!pvp && sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE) ) !pvp && sWorld.getConfig(CONFIG_BOOL_DEATH_CORPSE_RECLAIM_DELAY_PVE) )
{ {
count = uint32(m_deathExpireTime-corpse->GetGhostTime())/DEATH_EXPIRE_STEP; count = uint32(m_deathExpireTime-corpse->GetGhostTime())/DEATH_EXPIRE_STEP;
if(count>=MAX_DEATH_COUNT) if(count>=MAX_DEATH_COUNT)
@ -20505,7 +20505,7 @@ uint32 Player::CalculateTalentsPoints() const
uint32 base_talent = getLevel() < 10 ? 0 : getLevel()-9; uint32 base_talent = getLevel() < 10 ? 0 : getLevel()-9;
if(getClass() != CLASS_DEATH_KNIGHT) if(getClass() != CLASS_DEATH_KNIGHT)
return uint32(base_talent * sWorld.getRate(RATE_TALENT)); return uint32(base_talent * sWorld.getConfig(CONFIG_FLOAT_RATE_TALENT));
uint32 talentPointsForLevel = getLevel() < 56 ? 0 : getLevel() - 55; uint32 talentPointsForLevel = getLevel() < 56 ? 0 : getLevel() - 55;
talentPointsForLevel += m_questRewardTalentCount; talentPointsForLevel += m_questRewardTalentCount;
@ -20513,7 +20513,7 @@ uint32 Player::CalculateTalentsPoints() const
if(talentPointsForLevel > base_talent) if(talentPointsForLevel > base_talent)
talentPointsForLevel = base_talent; talentPointsForLevel = base_talent;
return uint32(talentPointsForLevel * sWorld.getRate(RATE_TALENT)); return uint32(talentPointsForLevel * sWorld.getConfig(CONFIG_FLOAT_RATE_TALENT));
} }
bool Player::IsKnowHowFlyIn(uint32 mapid, uint32 zone) const bool Player::IsKnowHowFlyIn(uint32 mapid, uint32 zone) const
@ -20615,7 +20615,7 @@ void Player::_LoadSkills(QueryResult *result)
// special settings // special settings
if(getClass()==CLASS_DEATH_KNIGHT) if(getClass()==CLASS_DEATH_KNIGHT)
{ {
uint32 base_level = std::min(getLevel(),sWorld.getConfig (CONFIG_START_HEROIC_PLAYER_LEVEL)); uint32 base_level = std::min(getLevel(),sWorld.getConfig (CONFIG_UINT32_START_HEROIC_PLAYER_LEVEL));
if(base_level < 1) if(base_level < 1)
base_level = 1; base_level = 1;
uint32 base_skill = (base_level-1)*5; // 270 at starting level 55 uint32 base_skill = (base_level-1)*5; // 270 at starting level 55
@ -20740,7 +20740,7 @@ void Player::HandleFall(MovementInfo const& movementInfo)
if(damageperc >0 ) if(damageperc >0 )
{ {
uint32 damage = (uint32)(damageperc * GetMaxHealth()*sWorld.getRate(RATE_DAMAGE_FALL)); uint32 damage = (uint32)(damageperc * GetMaxHealth()*sWorld.getConfig(CONFIG_FLOAT_RATE_DAMAGE_FALL));
float height = movementInfo.GetPos()->z; float height = movementInfo.GetPos()->z;
UpdateGroundPositionZ(movementInfo.GetPos()->x, movementInfo.GetPos()->y, height); UpdateGroundPositionZ(movementInfo.GetPos()->x, movementInfo.GetPos()->y, height);

View file

@ -122,5 +122,5 @@ void AssistanceMovementGenerator::Finalize(Unit &unit)
((Creature*)&unit)->SetNoCallAssistance(false); ((Creature*)&unit)->SetNoCallAssistance(false);
((Creature*)&unit)->CallAssistance(); ((Creature*)&unit)->CallAssistance();
if (unit.isAlive()) if (unit.isAlive())
unit.GetMotionMaster()->MoveSeekAssistanceDistract(sWorld.getConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY)); unit.GetMotionMaster()->MoveSeekAssistanceDistract(sWorld.getConfig(CONFIG_UINT32_CREATURE_FAMILY_ASSISTANCE_DELAY));
} }

View file

@ -61,7 +61,7 @@ void WorldSession::SendNameQueryOpcode(Player *p)
void WorldSession::SendNameQueryOpcodeFromDB(uint64 guid) void WorldSession::SendNameQueryOpcodeFromDB(uint64 guid)
{ {
CharacterDatabase.AsyncPQuery(&WorldSession::SendNameQueryOpcodeFromDBCallBack, GetAccountId(), CharacterDatabase.AsyncPQuery(&WorldSession::SendNameQueryOpcodeFromDBCallBack, GetAccountId(),
!sWorld.getConfig(CONFIG_DECLINED_NAMES_USED) ? !sWorld.getConfig(CONFIG_BOOL_DECLINED_NAMES_USED) ?
// ------- Query Without Declined Names -------- // ------- Query Without Declined Names --------
// 0 1 2 3 4 // 0 1 2 3 4
"SELECT guid, name, race, gender, class " "SELECT guid, name, race, gender, class "
@ -111,7 +111,7 @@ void WorldSession::SendNameQueryOpcodeFromDBCallBack(QueryResult *result, uint32
data << uint8(pClass); // class data << uint8(pClass); // class
// if the first declined name field (5) is empty, the rest must be too // 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.getConfig(CONFIG_BOOL_DECLINED_NAMES_USED) && fields[5].GetCppString() != "")
{ {
data << uint8(1); // is declined data << uint8(1); // is declined
for(int i = 5; i < MAX_DECLINED_NAME_CASES+5; ++i) for(int i = 5; i < MAX_DECLINED_NAME_CASES+5; ++i)

View file

@ -260,5 +260,5 @@ int32 Quest::GetRewOrReqMoney() const
if(RewOrReqMoney <=0) if(RewOrReqMoney <=0)
return RewOrReqMoney; return RewOrReqMoney;
return int32(RewOrReqMoney * sWorld.getRate(RATE_DROP_MONEY)); return int32(RewOrReqMoney * sWorld.getConfig(CONFIG_FLOAT_RATE_DROP_MONEY));
} }

View file

@ -608,7 +608,7 @@ uint32 WorldSession::getDialogStatus(Player *pPlayer, Object* questgiver, uint32
{ {
if ( pQuest->IsAutoComplete() || (pQuest->IsRepeatable() && pPlayer->getQuestStatusMap()[quest_id].m_rewarded)) if ( pQuest->IsAutoComplete() || (pQuest->IsRepeatable() && pPlayer->getQuestStatusMap()[quest_id].m_rewarded))
result2 = DIALOG_STATUS_REWARD_REP; result2 = DIALOG_STATUS_REWARD_REP;
else if (pPlayer->getLevel() <= pPlayer->GetQuestLevelForPlayer(pQuest) + sWorld.getConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF) ) else if (pPlayer->getLevel() <= pPlayer->GetQuestLevelForPlayer(pQuest) + sWorld.getConfig(CONFIG_UINT32_QUEST_LOW_LEVEL_HIDE_DIFF) )
{ {
if (pQuest->HasFlag(QUEST_FLAGS_DAILY)) if (pQuest->HasFlag(QUEST_FLAGS_DAILY))
result2 = DIALOG_STATUS_AVAILABLE_REP; result2 = DIALOG_STATUS_AVAILABLE_REP;

View file

@ -207,7 +207,7 @@ uint32 GetSkillDiscoverySpell(uint32 skillId, uint32 spellId, Player* player)
{ {
for(SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter) for(SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter)
{ {
if (roll_chance_f(item_iter->chance * sWorld.getRate(RATE_SKILL_DISCOVERY)) && if (roll_chance_f(item_iter->chance * sWorld.getConfig(CONFIG_FLOAT_RATE_SKILL_DISCOVERY)) &&
item_iter->reqSkillValue <= skillvalue && item_iter->reqSkillValue <= skillvalue &&
!player->HasSpell(item_iter->spellId)) !player->HasSpell(item_iter->spellId))
return item_iter->spellId; return item_iter->spellId;
@ -225,7 +225,7 @@ uint32 GetSkillDiscoverySpell(uint32 skillId, uint32 spellId, Player* player)
{ {
for(SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter) for(SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter)
{ {
if (roll_chance_f(item_iter->chance * sWorld.getRate(RATE_SKILL_DISCOVERY)) && if (roll_chance_f(item_iter->chance * sWorld.getConfig(CONFIG_FLOAT_RATE_SKILL_DISCOVERY)) &&
item_iter->reqSkillValue <= skillvalue && item_iter->reqSkillValue <= skillvalue &&
!player->HasSpell(item_iter->spellId)) !player->HasSpell(item_iter->spellId))
return item_iter->spellId; return item_iter->spellId;

View file

@ -190,8 +190,8 @@ void SocialMgr::GetFriendInfo(Player *player, uint32 friendGUID, FriendInfo &fri
uint32 team = player->GetTeam(); uint32 team = player->GetTeam();
AccountTypes security = player->GetSession()->GetSecurity(); AccountTypes security = player->GetSession()->GetSecurity();
bool allowTwoSideWhoList = sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST); bool allowTwoSideWhoList = sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_WHO_LIST);
AccountTypes gmLevelInWhoList = AccountTypes (sWorld.getConfig(CONFIG_GM_LEVEL_IN_WHO_LIST)); AccountTypes gmLevelInWhoList = AccountTypes (sWorld.getConfig(CONFIG_UINT32_GM_LEVEL_IN_WHO_LIST));
PlayerSocialMap::iterator itr = player->GetSocial()->m_playerSocialMap.find(friendGUID); PlayerSocialMap::iterator itr = player->GetSocial()->m_playerSocialMap.find(friendGUID);
if(itr != player->GetSocial()->m_playerSocialMap.end()) if(itr != player->GetSocial()->m_playerSocialMap.end())
@ -273,8 +273,8 @@ void SocialMgr::BroadcastToFriendListers(Player *player, WorldPacket *packet)
uint32 team = player->GetTeam(); uint32 team = player->GetTeam();
AccountTypes security = player->GetSession()->GetSecurity(); AccountTypes security = player->GetSession()->GetSecurity();
uint32 guid = player->GetGUIDLow(); uint32 guid = player->GetGUIDLow();
AccountTypes gmLevelInWhoList = AccountTypes(sWorld.getConfig(CONFIG_GM_LEVEL_IN_WHO_LIST)); AccountTypes gmLevelInWhoList = AccountTypes(sWorld.getConfig(CONFIG_UINT32_GM_LEVEL_IN_WHO_LIST));
bool allowTwoSideWhoList = sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST); bool allowTwoSideWhoList = sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_WHO_LIST);
for(SocialMap::const_iterator itr = m_socialMap.begin(); itr != m_socialMap.end(); ++itr) for(SocialMap::const_iterator itr = m_socialMap.begin(); itr != m_socialMap.end(); ++itr)
{ {

View file

@ -3821,7 +3821,7 @@ SpellCastResult Spell::CheckOrTakeRunePower(bool take)
{ {
// you can gain some runic power when use runes // you can gain some runic power when use runes
float rp = float(src->runePowerGain); float rp = float(src->runePowerGain);
rp *= sWorld.getRate(RATE_POWER_RUNICPOWER_INCOME); rp *= sWorld.getConfig(CONFIG_FLOAT_RATE_POWER_RUNICPOWER_INCOME);
plr->ModifyPower(POWER_RUNIC_POWER, (int32)rp); plr->ModifyPower(POWER_RUNIC_POWER, (int32)rp);
} }

View file

@ -1032,7 +1032,7 @@ void Aura::_AddAura()
{ {
SetAura(false); SetAura(false);
SetAuraFlags((1 << GetEffIndex()) | AFLAG_NOT_CASTER | ((GetAuraMaxDuration() > 0) ? AFLAG_DURATION : AFLAG_NONE) | (IsPositive() ? AFLAG_POSITIVE : AFLAG_NEGATIVE)); SetAuraFlags((1 << GetEffIndex()) | AFLAG_NOT_CASTER | ((GetAuraMaxDuration() > 0) ? AFLAG_DURATION : AFLAG_NONE) | (IsPositive() ? AFLAG_POSITIVE : AFLAG_NEGATIVE));
SetAuraLevel(caster ? caster->getLevel() : sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)); SetAuraLevel(caster ? caster->getLevel() : sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL));
SendAuraUpdate(false); SendAuraUpdate(false);
} }

View file

@ -4106,7 +4106,7 @@ void Spell::EffectEnchantItemPerm(uint32 effect_idx)
if (!item_owner) if (!item_owner)
return; 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.getConfig(CONFIG_BOOL_GM_LOG_TRADE) )
{ {
sLog.outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)", 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(), p_caster->GetName(),p_caster->GetSession()->GetAccountId(),
@ -4168,7 +4168,7 @@ void Spell::EffectEnchantItemPrismatic(uint32 effect_idx)
if (!item_owner) if (!item_owner)
return; 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.getConfig(CONFIG_BOOL_GM_LOG_TRADE) )
{ {
sLog.outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)", 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(), p_caster->GetName(),p_caster->GetSession()->GetAccountId(),
@ -4299,7 +4299,7 @@ void Spell::EffectEnchantItemTmp(uint32 i)
if(!item_owner) if(!item_owner)
return; 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.getConfig(CONFIG_BOOL_GM_LOG_TRADE) )
{ {
sLog.outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(temp): %s (Entry: %d) for player: %s (Account: %u)", 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(), p_caster->GetName(), p_caster->GetSession()->GetAccountId(),
@ -5867,7 +5867,7 @@ void Spell::EffectStuck(uint32 /*i*/)
if(!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) if(!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return; return;
if(!sWorld.getConfig(CONFIG_CAST_UNSTUCK)) if(!sWorld.getConfig(CONFIG_BOOL_CAST_UNSTUCK))
return; return;
Player* pTarget = (Player*)unitTarget; Player* pTarget = (Player*)unitTarget;
@ -6854,7 +6854,7 @@ void Spell::EffectProspecting(uint32 /*i*/)
if(itemTarget->GetCount() < 5) if(itemTarget->GetCount() < 5)
return; return;
if( sWorld.getConfig(CONFIG_SKILL_PROSPECTING)) if( sWorld.getConfig(CONFIG_BOOL_SKILL_PROSPECTING))
{ {
uint32 SkillValue = p_caster->GetPureSkillValue(SKILL_JEWELCRAFTING); uint32 SkillValue = p_caster->GetPureSkillValue(SKILL_JEWELCRAFTING);
uint32 reqSkillValue = itemTarget->GetProto()->RequiredSkillRank; uint32 reqSkillValue = itemTarget->GetProto()->RequiredSkillRank;
@ -6876,7 +6876,7 @@ void Spell::EffectMilling(uint32 /*i*/)
if(itemTarget->GetCount() < 5) if(itemTarget->GetCount() < 5)
return; return;
if( sWorld.getConfig(CONFIG_SKILL_MILLING)) if( sWorld.getConfig(CONFIG_BOOL_SKILL_MILLING))
{ {
uint32 SkillValue = p_caster->GetPureSkillValue(SKILL_INSCRIPTION); uint32 SkillValue = p_caster->GetPureSkillValue(SKILL_INSCRIPTION);
uint32 reqSkillValue = itemTarget->GetProto()->RequiredSkillRank; uint32 reqSkillValue = itemTarget->GetProto()->RequiredSkillRank;

View file

@ -153,7 +153,7 @@ bool TargetedMovementGeneratorMedium<T,D>::Update(T &owner, const uint32 & time_
if (owner.GetObjectSize()) if (owner.GetObjectSize())
i_destinationHolder.ResetUpdate(50); i_destinationHolder.ResetUpdate(50);
float dist = i_target->GetObjectSize() + owner.GetObjectSize() + sWorld.getRate(RATE_TARGET_POS_RECALCULATION_RANGE); float dist = i_target->GetObjectSize() + owner.GetObjectSize() + sWorld.getConfig(CONFIG_FLOAT_RATE_TARGET_POS_RECALCULATION_RANGE);
//More distance let have better performance, less distance let have more sensitive reaction at target move. //More distance let have better performance, less distance let have more sensitive reaction at target move.

View file

@ -192,7 +192,7 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[])
{ {
// logging // logging
sLog.outDebug("partner storing: %u",myItems[i]->GetGUIDLow()); 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.getConfig(CONFIG_BOOL_GM_LOG_TRADE) )
{ {
sLog.outCommand(_player->GetSession()->GetAccountId(),"GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)", 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(), _player->GetName(),_player->GetSession()->GetAccountId(),
@ -207,7 +207,7 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[])
{ {
// logging // logging
sLog.outDebug("player storing: %u",hisItems[i]->GetGUIDLow()); sLog.outDebug("player storing: %u",hisItems[i]->GetGUIDLow());
if( _player->pTrader->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE) ) if( _player->pTrader->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_BOOL_GM_LOG_TRADE) )
{ {
sLog.outCommand(_player->pTrader->GetSession()->GetAccountId(),"GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)", sLog.outCommand(_player->pTrader->GetSession()->GetAccountId(),"GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)",
_player->pTrader->GetName(),_player->pTrader->GetSession()->GetAccountId(), _player->pTrader->GetName(),_player->pTrader->GetSession()->GetAccountId(),
@ -377,7 +377,7 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/)
moveItems(myItems, hisItems); moveItems(myItems, hisItems);
// logging money // logging money
if(sWorld.getConfig(CONFIG_GM_LOG_TRADE)) if(sWorld.getConfig(CONFIG_BOOL_GM_LOG_TRADE))
{ {
if( _player->GetSession()->GetSecurity() > SEC_PLAYER && _player->tradeGold > 0) if( _player->GetSession()->GetSecurity() > SEC_PLAYER && _player->tradeGold > 0)
{ {

View file

@ -922,7 +922,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
} }
// random durability for items (HIT TAKEN) // random durability for items (HIT TAKEN)
if (roll_chance_f(sWorld.getRate(RATE_DURABILITY_LOSS_DAMAGE))) if (roll_chance_f(sWorld.getConfig(CONFIG_FLOAT_RATE_DURABILITY_LOSS_DAMAGE)))
{ {
EquipmentSlots slot = EquipmentSlots(urand(0,EQUIPMENT_SLOT_END-1)); EquipmentSlots slot = EquipmentSlots(urand(0,EQUIPMENT_SLOT_END-1));
((Player*)pVictim)->DurabilityPointLossForEquipSlot(slot); ((Player*)pVictim)->DurabilityPointLossForEquipSlot(slot);
@ -932,7 +932,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
if(GetTypeId()==TYPEID_PLAYER) if(GetTypeId()==TYPEID_PLAYER)
{ {
// random durability for items (HIT DONE) // random durability for items (HIT DONE)
if (roll_chance_f(sWorld.getRate(RATE_DURABILITY_LOSS_DAMAGE))) if (roll_chance_f(sWorld.getConfig(CONFIG_FLOAT_RATE_DURABILITY_LOSS_DAMAGE)))
{ {
EquipmentSlots slot = EquipmentSlots(urand(0,EQUIPMENT_SLOT_END-1)); EquipmentSlots slot = EquipmentSlots(urand(0,EQUIPMENT_SLOT_END-1));
((Player*)this)->DurabilityPointLossForEquipSlot(slot); ((Player*)this)->DurabilityPointLossForEquipSlot(slot);
@ -13440,7 +13440,7 @@ void Unit::CleanupDeletedAuras()
bool Unit::CheckAndIncreaseCastCounter() bool Unit::CheckAndIncreaseCastCounter()
{ {
uint32 maxCasts = sWorld.getConfig(CONFIG_MAX_SPELL_CASTS_IN_CHAIN); uint32 maxCasts = sWorld.getConfig(CONFIG_UINT32_MAX_SPELL_CASTS_IN_CHAIN);
if (maxCasts && m_castCounter >= maxCasts) if (maxCasts && m_castCounter >= maxCasts)
return false; return false;

View file

@ -54,7 +54,7 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size)
c_stream.opaque = (voidpf)0; c_stream.opaque = (voidpf)0;
// default Z_BEST_SPEED (1) // default Z_BEST_SPEED (1)
int z_res = deflateInit(&c_stream, sWorld.getConfig(CONFIG_COMPRESSION)); int z_res = deflateInit(&c_stream, sWorld.getConfig(CONFIG_UINT32_COMPRESSION));
if (z_res != Z_OK) if (z_res != Z_OK)
{ {
sLog.outError("Can't compress update packet (zlib: deflateInit) Error code: %i (%s)",z_res,zError(z_res)); sLog.outError("Can't compress update packet (zlib: deflateInit) Error code: %i (%s)",z_res,zError(z_res));

View file

@ -31,7 +31,7 @@
/// Create the Weather object /// Create the Weather object
Weather::Weather(uint32 zone, WeatherZoneChances const* weatherChances) : m_zone(zone), m_weatherChances(weatherChances) Weather::Weather(uint32 zone, WeatherZoneChances const* weatherChances) : m_zone(zone), m_weatherChances(weatherChances)
{ {
m_timer.SetInterval(sWorld.getConfig(CONFIG_INTERVAL_CHANGEWEATHER)); m_timer.SetInterval(sWorld.getConfig(CONFIG_UINT32_INTERVAL_CHANGEWEATHER));
m_type = WEATHER_TYPE_FINE; m_type = WEATHER_TYPE_FINE;
m_grade = 0; m_grade = 0;

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -808,7 +808,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
Field* fields = result->Fetch (); Field* fields = result->Fetch ();
expansion = ((sWorld.getConfig(CONFIG_EXPANSION) > fields[7].GetUInt8()) ? fields[7].GetUInt8() : sWorld.getConfig(CONFIG_EXPANSION)); expansion = ((sWorld.getConfig(CONFIG_UINT32_EXPANSION) > fields[7].GetUInt8()) ? fields[7].GetUInt8() : sWorld.getConfig(CONFIG_UINT32_EXPANSION));
N.SetHexStr ("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7"); N.SetHexStr ("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7");
g.SetDword (7); g.SetDword (7);
@ -968,7 +968,7 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket)
{ {
++m_OverSpeedPings; ++m_OverSpeedPings;
uint32 max_count = sWorld.getConfig (CONFIG_MAX_OVERSPEED_PINGS); uint32 max_count = sWorld.getConfig (CONFIG_UINT32_MAX_OVERSPEED_PINGS);
if (max_count && m_OverSpeedPings > max_count) if (max_count && m_OverSpeedPings > max_count)
{ {

View file

@ -119,7 +119,7 @@ public:
RARunnable () RARunnable ()
{ {
uint32 socketSelecttime = sWorld.getConfig (CONFIG_SOCKET_SELECTTIME); uint32 socketSelecttime = sWorld.getConfig (CONFIG_UINT32_SOCKET_SELECTTIME);
numLoops = (sConfig.GetIntDefault ("MaxPingTime", 30) * (MINUTE * 1000000 / socketSelecttime)); numLoops = (sConfig.GetIntDefault ("MaxPingTime", 30) * (MINUTE * 1000000 / socketSelecttime));
loopCounter = 0; loopCounter = 0;
} }
@ -163,7 +163,7 @@ public:
} }
// Socket Selet time is in microseconds , not miliseconds!! // Socket Selet time is in microseconds , not miliseconds!!
uint32 socketSelecttime = sWorld.getConfig (CONFIG_SOCKET_SELECTTIME); uint32 socketSelecttime = sWorld.getConfig (CONFIG_UINT32_SOCKET_SELECTTIME);
// if use ra spend time waiting for io, if not use ra ,just sleep // if use ra spend time waiting for io, if not use ra ,just sleep
if (usera) if (usera)
@ -303,7 +303,7 @@ int Master::Run()
} }
///- Launch the world listener socket ///- Launch the world listener socket
port_t wsport = sWorld.getConfig (CONFIG_PORT_WORLD); port_t wsport = sWorld.getConfig (CONFIG_UINT32_PORT_WORLD);
std::string bind_ip = sConfig.GetStringDefault ("BindIP", "0.0.0.0"); std::string bind_ip = sConfig.GetStringDefault ("BindIP", "0.0.0.0");
if (sWorldSocketMgr->StartNetwork (wsport, bind_ip.c_str ()) == -1) if (sWorldSocketMgr->StartNetwork (wsport, bind_ip.c_str ()) == -1)

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "9388" #define REVISION_NR "9389"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__