From acb074554fdf3432149dd730f80779fb4721dbea Mon Sep 17 00:00:00 2001 From: chrys Date: Tue, 27 Sep 2016 23:56:32 +0200 Subject: [PATCH] add simple command flood protection --- src/fenrir-package/fenrir.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fenrir-package/fenrir.py b/src/fenrir-package/fenrir.py index 49b09b89..97783fb8 100755 --- a/src/fenrir-package/fenrir.py +++ b/src/fenrir-package/fenrir.py @@ -82,12 +82,12 @@ class fenrir(): self.wasCommand = command != '' if command == '': return + if time.time() - self.environment['commandInfo']['lastCommandExecutionTime'] < 0.3: + return self.environment['runtime']['commandManager'].queueCommand(command) def handleCommands(self): - if time.time() - self.environment['commandInfo']['lastCommandExecutionTime'] < 0.2: - return if not self.environment['runtime']['commandManager'].isCommandQueued(): return self.environment['runtime']['commandManager'].executeCommand( self.environment['commandInfo']['currCommand'], 'commands')