aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMachiavelli <none@none>2010-05-14 00:50:26 +0200
committerMachiavelli <none@none>2010-05-14 00:50:26 +0200
commit98a5c09af038798f196d7283a4112bc69d27462f (patch)
tree0811265c225b03aa6d738e8f520729d4dccccd69
parentd390ff46c22929591cd1cf5a8021055c62a678ea (diff)
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
-rw-r--r--src/game/World.cpp2
-rw-r--r--src/game/World.h1
-rw-r--r--src/game/WorldSocket.cpp5
-rw-r--r--src/trinitycore/trinitycore.conf.dist6
4 files changed, 12 insertions, 2 deletions
diff --git a/src/game/World.cpp b/src/game/World.cpp
index dced43596a4..833687c74b1 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -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);
diff --git a/src/game/World.h b/src/game/World.h
index caf9a54d2c4..ddc804f1968 100644
--- a/src/game/World.h
+++ b/src/game/World.h
@@ -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,
diff --git a/src/game/WorldSocket.cpp b/src/game/WorldSocket.cpp
index 98cfe84a379..559c1d88514 100644
--- a/src/game/WorldSocket.cpp
+++ b/src/game/WorldSocket.cpp
@@ -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);
diff --git a/src/trinitycore/trinitycore.conf.dist b/src/trinitycore/trinitycore.conf.dist
index e260cdd11cd..a2560e1ce25 100644
--- a/src/trinitycore/trinitycore.conf.dist
+++ b/src/trinitycore/trinitycore.conf.dist
@@ -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