diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/World/World.cpp | 40 | ||||
-rw-r--r-- | src/server/game/World/World.h | 5 |
2 files changed, 24 insertions, 21 deletions
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 0b3aecbad5a..c511c85f0d4 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -202,6 +202,25 @@ void World::SetClosed(bool val) sScriptMgr->OnOpenStateChange(!val); } +void World::LoadDBAllowedSecurityLevel() +{ + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_REALMLIST_SECURITY_LEVEL); + stmt->setInt32(0, int32(realm.Id.Realm)); + PreparedQueryResult result = LoginDatabase.Query(stmt); + + if (result) + SetPlayerSecurityLimit(AccountTypes(result->Fetch()->GetUInt8())); +} + +void World::SetPlayerSecurityLimit(AccountTypes _sec) +{ + AccountTypes sec = _sec < SEC_CONSOLE ? _sec : SEC_PLAYER; + bool update = sec > m_allowedSecurityLevel; + m_allowedSecurityLevel = sec; + if (update) + KickAllLess(m_allowedSecurityLevel); +} + void World::TriggerGuidWarning() { // Lock this only to prevent multiple maps triggering at the same time @@ -3133,6 +3152,8 @@ void World::InitDailyQuestResetTime(bool loading) m_NextDailyQuestReset = mostRecentQuestTime; else // plan next reset time m_NextDailyQuestReset = (curTime >= curDayResetTime) ? curDayResetTime + DAY : curDayResetTime; + + sWorld->setWorldState(WS_DAILY_QUEST_RESET_TIME, uint64(m_NextDailyQuestReset)); } void World::InitMonthlyQuestResetTime() @@ -3213,25 +3234,6 @@ void World::ResetDailyQuests() sPoolMgr->ChangeDailyQuests(); } -void World::LoadDBAllowedSecurityLevel() -{ - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_REALMLIST_SECURITY_LEVEL); - stmt->setInt32(0, int32(realm.Id.Realm)); - PreparedQueryResult result = LoginDatabase.Query(stmt); - - if (result) - SetPlayerSecurityLimit(AccountTypes(result->Fetch()->GetUInt8())); -} - -void World::SetPlayerSecurityLimit(AccountTypes _sec) -{ - AccountTypes sec = _sec < SEC_CONSOLE ? _sec : SEC_PLAYER; - bool update = sec > m_allowedSecurityLevel; - m_allowedSecurityLevel = sec; - if (update) - KickAllLess(m_allowedSecurityLevel); -} - void World::ResetWeeklyQuests() { TC_LOG_INFO("misc", "Weekly quests reset for all characters."); diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index cef6fd39d77..502c913ad30 100644 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -524,11 +524,12 @@ enum RealmZone enum WorldStates { WS_ARENA_DISTRIBUTION_TIME = 20001, // Next arena distribution time - WS_WEEKLY_QUEST_RESET_TIME = 20002, // Next weekly reset time + WS_WEEKLY_QUEST_RESET_TIME = 20002, // Next weekly quest reset time WS_BG_DAILY_RESET_TIME = 20003, // Next daily BG reset time WS_CLEANING_FLAGS = 20004, // Cleaning Flags WS_GUILD_DAILY_RESET_TIME = 20006, // Next guild cap reset time - WS_MONTHLY_QUEST_RESET_TIME = 20007, // Next monthly reset time + WS_MONTHLY_QUEST_RESET_TIME = 20007, // Next monthly quest reset time + WS_DAILY_QUEST_RESET_TIME = 20008 // Next daily quest reset time }; /// Storage class for commands issued for delayed execution |