aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/World.cpp40
-rw-r--r--src/game/World.h2
-rw-r--r--src/game/WorldSocket.cpp3
3 files changed, 11 insertions, 34 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()
diff --git a/src/game/World.h b/src/game/World.h
index 8c2692fa4d6..e82546261fe 100644
--- a/src/game/World.h
+++ b/src/game/World.h
@@ -592,6 +592,8 @@ class World
void UpdateRealmCharCount(uint32 accid);
+ void UpdateAllowedSecurity();
+
LocaleConstant GetAvailableDbcLocale(LocaleConstant locale) const { if(m_availableDbcLocaleMask & (1 << locale)) return locale; else return m_defaultDbcLocale; }
//used World DB version
diff --git a/src/game/WorldSocket.cpp b/src/game/WorldSocket.cpp
index 0425085ea9f..0da9c875ba2 100644
--- a/src/game/WorldSocket.cpp
+++ b/src/game/WorldSocket.cpp
@@ -862,8 +862,9 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
}
// Check locked state for server
+ sWorld.UpdateAllowedSecurity();
AccountTypes allowedAccountType = sWorld.GetPlayerSecurityLimit ();
-
+ sLog.outDebug("Allowed Level: %u Player Level %u", allowedAccountType, AccountTypes(security));
if (allowedAccountType > SEC_PLAYER && AccountTypes(security) < allowedAccountType)
{
WorldPacket Packet (SMSG_AUTH_RESPONSE, 1);