aboutsummaryrefslogtreecommitdiff
path: root/src/game/World.cpp
diff options
context:
space:
mode:
authorChaz Brown <iamparadox@netscape.net>2009-08-29 08:51:24 -0400
committerChaz Brown <iamparadox@netscape.net>2009-08-29 08:51:24 -0400
commit055acc4b8a7d903f450c5ba325f42b845a2b157f (patch)
treed6d7772e5adbc8830e1de6a1e3780fc716476786 /src/game/World.cpp
parent2345c5ca8d431f897d90b290974bc9cdb002a66f (diff)
Replace switch with more proper way of checking allowSecurityLevel, and a few other minor changes.
--HG-- branch : trunk
Diffstat (limited to 'src/game/World.cpp')
-rw-r--r--src/game/World.cpp40
1 files changed, 7 insertions, 33 deletions
diff --git a/src/game/World.cpp b/src/game/World.cpp
index 0d80b9033f0..db791f06bc9 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -2509,46 +2509,20 @@ void World::ResetDailyQuests()
itr->second->GetPlayer()->ResetDailyQuestStatus();
}
-void World::SetPlayerLimit( int32 limit, bool needUpdate )
+void World::UpdateAllowedSecurity()
{
- //if(limit < -SEC_ADMINISTRATOR)
- //limit = -SEC_ADMINISTRATOR;
-
- // lock update need
- //bool db_update_need = needUpdate || (limit < 0) != (m_playerLimit < 0) || (limit < 0 && m_playerLimit < 0 && limit != m_playerLimit);
-
- m_playerLimit = limit;
QueryResult *result = loginDatabase.PQuery("SELECT allowedSecurityLevel from realmlist WHERE id = '%d'", realmID);
if (result)
{
- switch (result->Fetch()->GetUInt8())
- {
- case SEC_ADMINISTRATOR:
- {
- m_allowedSecurityLevel = SEC_ADMINISTRATOR;
- }
- case SEC_MODERATOR:
- {
- m_allowedSecurityLevel = SEC_MODERATOR;
- }
- case SEC_GAMEMASTER:
- {
- m_allowedSecurityLevel = SEC_GAMEMASTER;
- }
- case SEC_PLAYER:
- {
- m_allowedSecurityLevel = SEC_PLAYER;
- }
- default:
- {
- m_allowedSecurityLevel = SEC_ADMINISTRATOR;
- }
- }
+ m_allowedSecurityLevel = AccountTypes(result->Fetch()->GetUInt16());
+ sLog.outDebug("Allowed Level: %u Result %u", m_allowedSecurityLevel, result->Fetch()->GetUInt16());
delete result;
}
+}
- //if(db_update_need)
- //loginDatabase.PExecute("UPDATE realmlist SET allowedSecurityLevel = '%u' WHERE id = '%d'",uint8(GetPlayerSecurityLimit()),realmID);
+void World::SetPlayerLimit( int32 limit, bool needUpdate )
+{
+ m_playerLimit = limit;
}
void World::UpdateMaxSessionCounters()