feat(core): allow to disable auto-kick for idle players (#1550)

This commit is contained in:
Francesco Borzì
2019-03-03 15:26:07 +01:00
committed by GitHub
parent a958ff6e36
commit be0b7b23f8
4 changed files with 12 additions and 1 deletions

View File

@@ -254,7 +254,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
/// If necessary, kick the player because the client didn't send anything for too long
/// (or they've been idling in character select)
if (IsConnectionIdle())
if (sWorld->getBoolConfig(CONFIG_CLOSE_IDLE_CONNECTIONS) && IsConnectionIdle())
m_Socket->CloseSocket();
}

View File

@@ -689,6 +689,7 @@ void World::LoadConfigSettings(bool reload)
else
m_int_configs[CONFIG_PORT_WORLD] = sConfigMgr->GetIntDefault("WorldServerPort", 8085);
m_bool_configs[CONFIG_CLOSE_IDLE_CONNECTIONS] = sConfigMgr->GetBoolDefault("CloseIdleConnections", true);
m_int_configs[CONFIG_SOCKET_TIMEOUTTIME] = sConfigMgr->GetIntDefault("SocketTimeOutTime", 900000);
m_int_configs[CONFIG_SOCKET_TIMEOUTTIME_ACTIVE] = sConfigMgr->GetIntDefault("SocketTimeOutTimeActive", 60000);
m_int_configs[CONFIG_SESSION_ADD_DELAY] = sConfigMgr->GetIntDefault("SessionAddDelay", 10000);

View File

@@ -166,6 +166,7 @@ enum WorldBoolConfigs
CONFIG_CALCULATE_CREATURE_ZONE_AREA_DATA,
CONFIG_CALCULATE_GAMEOBJECT_ZONE_AREA_DATA,
CONFIG_CHECK_GOBJECT_LOS,
CONFIG_CLOSE_IDLE_CONNECTIONS,
BOOL_CONFIG_VALUE_COUNT
};

View File

@@ -212,6 +212,15 @@ MaxOverspeedPings = 2
GridUnload = 1
#
# CloseIdleConnections
# Description: Automatically close idle connections.
# SocketTimeOutTime and SocketTimeOutTimeActive determine when a connection is considered as idle.
# Default: 1 - (enable, Automatically close idle connections)
# 0 - (disable, Do not close idle connections)
CloseIdleConnections = 1
#
# SocketTimeOutTime
# Description: Time (in milliseconds) after which a connection being idle on the character