summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Linder <matthias@matthiaslinder.com>2013-03-21 13:04:14 +0100
committerMatthias Linder <matthias@matthiaslinder.com>2013-03-21 13:04:14 +0100
commit77205767d936e9abc4881468348aed7208d61a49 (patch)
treee1f6cd229a22472a33eddbbd3dcb43676305c083
parenta546977f70f9b8c4acac632972cd26a2dd8d7676 (diff)
downloadbot-77205767d936e9abc4881468348aed7208d61a49.tar.gz
bot-77205767d936e9abc4881468348aed7208d61a49.tar.bz2
bot-77205767d936e9abc4881468348aed7208d61a49.zip
Fixed immediate ping timeout on quakenet
-rwxr-xr-xmodules/startup.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/modules/startup.py b/modules/startup.py
index 297dfb5..81b3ecf 100755
--- a/modules/startup.py
+++ b/modules/startup.py
@@ -10,6 +10,7 @@ http://inamidst.com/phenny/
import threading, time
def setup(phenny):
+ print("Setting up phenny")
# by clsn
phenny.data = {}
refresh_delay = 300.0
@@ -42,19 +43,13 @@ def setup(phenny):
pong.rule = r'.*'
phenny.variables['pong'] = pong
- # Need to wrap handle_connect to start the loop.
- inner_handle_connect = phenny.handle_connect
-
- def outer_handle_connect():
- inner_handle_connect()
- if phenny.data.get('startup.setup.pingloop'):
- phenny.data['startup.setup.pingloop']()
-
- phenny.handle_connect = outer_handle_connect
-
def startup(phenny, input):
import time
+ # Start the ping loop. Has to be done after USER on e.g. quakenet
+ if phenny.data.get('startup.setup.pingloop'):
+ phenny.data['startup.setup.pingloop']()
+
if hasattr(phenny.config, 'serverpass'):
phenny.write(('PASS', phenny.config.serverpass))