From e595ea861b29ed24ff31a49c6472d30da3f4fc88 Mon Sep 17 00:00:00 2001 From: Stefan Hacker Date: Fri, 21 Oct 2016 23:02:40 +0200 Subject: [PATCH] Add channel whitelist for excluding channels from idle handling This adds a new channel_whitelist variable that can be used to specify channels that players won't be moved from even if they are idle. Fixes: #8 --- modules-available/idlemove.ini | 4 +++- modules/idlemove.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules-available/idlemove.ini b/modules-available/idlemove.ini index 6f6d547..cc7ddb6 100644 --- a/modules-available/idlemove.ini +++ b/modules-available/idlemove.ini @@ -28,9 +28,11 @@ channel = 0 ;source_channel = -1 ; Comma seperated list of player names that will not be moved when idle (such as bots) whitelist = +; Comma seperated list of channel ids from which players will not be moved even when idle. +; channel_whitelist = + ; For every server you want to override the [all] section for create ; a [server_] section. For example: - ; Overriding [all] for server with the id 1 would look like this ;[server_1] ;threshold = 60 diff --git a/modules/idlemove.py b/modules/idlemove.py index 96d16ad..1fb82b2 100644 --- a/modules/idlemove.py +++ b/modules/idlemove.py @@ -59,7 +59,8 @@ class idlemove(MumoModule): ('deafen', commaSeperatedBool, [False]), ('channel', commaSeperatedIntegers, [1]), ('source_channel', commaSeperatedIntegers, [-1]), - ('whitelist', commaSeperatedStrings, []) + ('whitelist', commaSeperatedStrings, []), + ('channel_whitelist', commaSeperatedIntegers, []) ), } @@ -159,6 +160,7 @@ class idlemove(MumoModule): continue if user.idlesecs > threshold and\ + user.channel not in scfg.channel_whitelist and\ (source_channel == -1 or\ user.channel == source_channel or\ user.channel == channel):