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);
+6
View File
@@ -122,6 +122,11 @@ EAIErrorLevel = 2
# selection screen is disconnected.
# Default: 900000 (15 minutes)
#
# SessionAddDelay
# Time in microseconds that a network thread will sleep after authentication
# protocol and adding a connection to the world session map.
# Default: 10000 (10 milliseconds, 0,01 second)
#
# GridCleanUpDelay
# Grid clean up delay (in milliseconds)
# Default: 300000 (5 min)
@@ -226,6 +231,7 @@ MaxOverspeedPings = 2
GridUnload = 1
SocketSelectTime = 10000
SocketTimeOutTime = 900000
SessionAddDelay = 10000
GridCleanUpDelay = 300000
MapUpdateInterval = 100
ChangeWeatherInterval = 600000