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
This commit is contained in:
Stefan Hacker 2016-10-21 23:02:40 +02:00 committed by Stefan Hacker
parent 0361021fbd
commit e595ea861b
2 changed files with 6 additions and 2 deletions

View File

@ -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_<serverid>] section. For example:
; Overriding [all] for server with the id 1 would look like this
;[server_1]
;threshold = 60

View File

@ -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):