Skip to content

Commit

Permalink
Merge pull request #27 from thekroko/pingfix
Browse files Browse the repository at this point in the history
Fixed immediate ping timeout on quakenet
  • Loading branch information
sbp committed Mar 21, 2013
2 parents a546977 + 7720576 commit bf08c26
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions modules/startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import threading, time

def setup(phenny):
print("Setting up phenny")
# by clsn
phenny.data = {}
refresh_delay = 300.0
Expand Down Expand Up @@ -42,19 +43,13 @@ def pong(phenny, input):
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))

Expand Down

0 comments on commit bf08c26

Please sign in to comment.