Made pinging the server optional.

This commit is contained in:
Jeremy Fincher 2003-12-20 07:01:09 +00:00
parent 38b9cfadc7
commit cb5c22c9dc
2 changed files with 10 additions and 1 deletions

View File

@ -233,6 +233,13 @@ telnetPort = 31337
### ###
poll = 1 poll = 1
###
# pingServer: Determines whether the bot will send PINGs to the server it's
# connected to in order to keep the connection alive. Sometimes
# this seems to result in instability.
###
pingServer = True
### ###
# maxHistory: Maximum number of messages kept in an Irc object's state. # maxHistory: Maximum number of messages kept in an Irc object's state.
### ###
@ -364,6 +371,7 @@ types = {
'detailedTracebacks': mybool, 'detailedTracebacks': mybool,
'driverModule': mystr, 'driverModule': mystr,
'showOnlySyntax': mybool, 'showOnlySyntax': mybool,
'pingServer': mybool,
'followIdentificationThroughNickChanges': mybool 'followIdentificationThroughNickChanges': mybool
} }

View File

@ -491,7 +491,8 @@ class Irc(IrcCommandDispatcher):
else: else:
self.lastTake = now self.lastTake = now
msg = self.queue.dequeue() msg = self.queue.dequeue()
elif now > (self.lastping + conf.pingInterval) and self.afterConnect: elif conf.pingServer and \
now > (self.lastping + conf.pingInterval) and self.afterConnect:
if self.outstandingPing: if self.outstandingPing:
s = 'Reconnecting to %s, ping not replied to.' % self.server s = 'Reconnecting to %s, ping not replied to.' % self.server
log.warning(s) log.warning(s)