WS DTO assign rework
This commit is contained in:
@ -29,7 +29,11 @@ class InactivityWatchdog(Thread):
|
||||
)
|
||||
|
||||
for player in self.players:
|
||||
if player.active and player.last_seen < inactivity_threshold:
|
||||
if (
|
||||
player.can_be_deactivated
|
||||
and player.active
|
||||
and player.last_seen < inactivity_threshold
|
||||
):
|
||||
player.active = False
|
||||
logging.info(f"Player {player} set as inactive")
|
||||
|
||||
@ -37,7 +41,7 @@ class InactivityWatchdog(Thread):
|
||||
n = 0
|
||||
while n < len(self.players):
|
||||
player = self.players[n]
|
||||
if player.last_seen < kick_threshold:
|
||||
if player.can_be_deactivated and player.last_seen < kick_threshold:
|
||||
self.players.pop(n)
|
||||
logging.info(f"Player {player} kicked out")
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user