Skip to content

Commit

Permalink
Move max instances per hour limit to config option.
Browse files Browse the repository at this point in the history
Closes #2235
  • Loading branch information
ratkosrb committed Oct 21, 2023
1 parent 284d838 commit 6c70671
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/game/Objects/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17483,7 +17483,7 @@ void Player::SendResetInstanceFailed(uint32 reason, uint32 MapId) const
/** Implementation of hourly maximum instances per account */
bool Player::CheckInstanceCount(uint32 instanceId) const
{
return IsGameMaster() || sAccountMgr.CheckInstanceCount(GetSession()->GetAccountId(), instanceId, MAX_INSTANCE_PER_ACCOUNT_PER_HOUR);
return IsGameMaster() || sAccountMgr.CheckInstanceCount(GetSession()->GetAccountId(), instanceId, sWorld.getConfig(CONFIG_UINT32_INSTANCE_PER_HOUR_LIMIT));
}

void Player::AddInstanceEnterTime(uint32 instanceId, time_t enterTime) const
Expand Down
1 change: 1 addition & 0 deletions src/game/World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ void World::LoadConfigSettings(bool reload)
setConfig(CONFIG_BOOL_INSTANCE_IGNORE_RAID, "Instance.IgnoreRaid", false);
setConfig(CONFIG_UINT32_INSTANCE_RESET_TIME_HOUR, "Instance.ResetTimeHour", 4);
setConfig(CONFIG_UINT32_INSTANCE_UNLOAD_DELAY, "Instance.UnloadDelay", 30 * MINUTE * IN_MILLISECONDS);
setConfig(CONFIG_UINT32_INSTANCE_PER_HOUR_LIMIT, "Instance.PerHourLimit", MAX_INSTANCE_PER_ACCOUNT_PER_HOUR);

setConfig(CONFIG_UINT32_MAX_PRIMARY_TRADE_SKILL, "MaxPrimaryTradeSkill", 2);
setConfigMinMax(CONFIG_UINT32_MIN_PETITION_SIGNS, "MinPetitionSigns", 9, 0, 9);
Expand Down
1 change: 1 addition & 0 deletions src/game/World.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ enum eConfigUInt32Values
CONFIG_UINT32_MIN_HONOR_KILLS,
CONFIG_UINT32_INSTANCE_RESET_TIME_HOUR,
CONFIG_UINT32_INSTANCE_UNLOAD_DELAY,
CONFIG_UINT32_INSTANCE_PER_HOUR_LIMIT,
CONFIG_UINT32_MAX_SPELL_CASTS_IN_CHAIN,
CONFIG_UINT32_MAX_PRIMARY_TRADE_SKILL,
CONFIG_UINT32_MIN_PETITION_SIGNS,
Expand Down
4 changes: 4 additions & 0 deletions src/mangosd/mangosd.conf.dist.in
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,10 @@ PerformanceLog.SlowPacketBroadcast = 0
# Default: 1800000 (miliseconds, i.e 30 minutes)
# 0 (instance maps are kept in memory until they are reset)
#
# Instance.PerHourLimit
# How many instances players can enter per hour per account.
# Default: 5
#
# Item.InstantSaveQuality
# Save character inventory instantly on receiving item of this quality or higher.
# Default: 6 - Artifact
Expand Down

0 comments on commit 6c70671

Please sign in to comment.