add simple command flood protection
This commit is contained in:
parent
d8c597c83f
commit
acb074554f
@ -82,12 +82,12 @@ class fenrir():
|
|||||||
self.wasCommand = command != ''
|
self.wasCommand = command != ''
|
||||||
if command == '':
|
if command == '':
|
||||||
return
|
return
|
||||||
|
if time.time() - self.environment['commandInfo']['lastCommandExecutionTime'] < 0.3:
|
||||||
|
return
|
||||||
self.environment['runtime']['commandManager'].queueCommand(command)
|
self.environment['runtime']['commandManager'].queueCommand(command)
|
||||||
|
|
||||||
|
|
||||||
def handleCommands(self):
|
def handleCommands(self):
|
||||||
if time.time() - self.environment['commandInfo']['lastCommandExecutionTime'] < 0.2:
|
|
||||||
return
|
|
||||||
if not self.environment['runtime']['commandManager'].isCommandQueued():
|
if not self.environment['runtime']['commandManager'].isCommandQueued():
|
||||||
return
|
return
|
||||||
self.environment['runtime']['commandManager'].executeCommand( self.environment['commandInfo']['currCommand'], 'commands')
|
self.environment['runtime']['commandManager'].executeCommand( self.environment['commandInfo']['currCommand'], 'commands')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user