Add config option SessionAddDelay to replace the hard coded 10ms default Networkthread sleep time after WorldSocket::HandleAuthSession calls and adding the session to the world session map.

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2010-05-14 00:50:26 +02:00
parent d390ff46c2
commit 98a5c09af0
4 changed files with 12 additions and 2 deletions
+2
View File
@@ -662,6 +662,8 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_SOCKET_SELECTTIME] = sConfig.GetIntDefault("SocketSelectTime", DEFAULT_SOCKET_SELECT_TIME);
m_configs[CONFIG_SOCKET_TIMEOUTTIME] = sConfig.GetIntDefault("SocketTimeOutTime", 900000);
m_configs[CONFIG_SESSION_ADD_DELAY] = sConfig.GetIntDefault("SessionAddDelay", 10000);
m_configs[CONFIG_GROUP_XP_DISTANCE] = sConfig.GetIntDefault("MaxGroupXPDistance", 74);
/// \todo Add MonsterSight and GuarderSight (with meaning) in Trinityd.conf or put them as define
m_configs[CONFIG_SIGHT_MONSTER] = sConfig.GetIntDefault("MonsterSight", 50);
+1
View File
@@ -100,6 +100,7 @@ enum WorldConfigs
CONFIG_PORT_WORLD,
CONFIG_SOCKET_SELECTTIME,
CONFIG_SOCKET_TIMEOUTTIME,
CONFIG_SESSION_ADD_DELAY,
CONFIG_GROUP_XP_DISTANCE,
CONFIG_SIGHT_MONSTER,
CONFIG_SIGHT_GUARDER,
+3 -2
View File
@@ -1001,8 +1001,9 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
m_Session->LoadTutorialsData();
m_Session->ReadAddonsInfo(recvPacket);
// In case needed sometime the second arg is in microseconds 1 000 000 = 1 sec
ACE_OS::sleep (ACE_Time_Value (0, 10000));
// Sleep this Network thread for
uint32 sleepTime = sWorld.getConfig(CONFIG_SESSION_ADD_DELAY);
ACE_OS::sleep (ACE_Time_Value (0, sleepTime));
sWorld.AddSession (m_Session);