Skip to content

Commit

Permalink
Fix for #219
Browse files Browse the repository at this point in the history
  • Loading branch information
smilechaser committed Mar 23, 2016
1 parent 2787cca commit 92149bb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spockbot/plugins/core/net.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ class NetPlugin(PluginBase):
'SOCKET_ERR': 'handle_err',
'SOCKET_HUP': 'handle_hup',
'PLAY<Disconnect': 'handle_disconnect',
'LOGIN<Disconnect': 'handle_login_disconnect',
'HANDSHAKE>Handshake': 'handle_handshake',
'LOGIN<Login Success': 'handle_login_success',
'LOGIN<Set Compression': 'handle_comp',
Expand Down Expand Up @@ -259,6 +260,13 @@ def handle_disconnect(self, name, packet):
logger.debug("NETPLUGIN: Disconnected: %s", packet.data['reason'])
self.event.emit('net_disconnect', packet.data['reason'])

def handle_login_disconnect(self, name, packet):

reason = packet.data.get('json_data', {}).get('text', '???')

logger.debug("NETPLUGIN: Disconnected: %s", reason)
self.event.emit('net_disconnect', reason)

# Kill event - Try to shutdown the socket politely
def handle_kill(self, name, data):
if self.net.connected:
Expand Down

0 comments on commit 92149bb

Please sign in to comment.