From 9b8f1cf3eaeb19df8313bd0f144a3379dc53134a Mon Sep 17 00:00:00 2001 From: Greg Taylor Date: Thu, 30 Apr 2009 04:05:19 +0000 Subject: [PATCH] Handle IMC ice-destroy packets. --- src/commands/imc2.py | 8 +++++--- src/imc2/connection.py | 2 ++ src/imc2/trackers.py | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/commands/imc2.py b/src/commands/imc2.py index 5f3de25d48..0b94e77ad4 100644 --- a/src/commands/imc2.py +++ b/src/commands/imc2.py @@ -63,9 +63,11 @@ def cmd_imcchanlist(command): retval += ' Full Name Name Owner Perm Policy\n\r' retval += ' --------- ---- ----- ---- ------\n\r' for channel in IMC2_CHANLIST.get_channel_list(): - retval += ' %-18s %-10s %-15s %-7s %s\n\r' % (channel.full_name, channel.name, - channel.owner, channel.level, - channel.policy) + retval += ' %-18s %-10s %-15s %-7s %s\n\r' % (channel.name, + channel.localname, + channel.owner, + channel.level, + channel.policy) retval += '%s channels found.' % len(IMC2_CHANLIST.chan_list) source_object.emit_to(retval) GLOBAL_CMD_TABLE.add_command("imcchanlist", cmd_imcchanlist) diff --git a/src/imc2/connection.py b/src/imc2/connection.py index 6f86d4f5d2..69b699a212 100644 --- a/src/imc2/connection.py +++ b/src/imc2/connection.py @@ -168,6 +168,8 @@ class IMC2Protocol(StatefulTelnetProtocol): IMC2_MUDLIST.remove_mud_from_packet(packet) elif packet.packet_type == 'ice-update': IMC2_CHANLIST.update_channel_from_packet(packet) + elif packet.packet_type == 'ice-destroy': + IMC2_CHANLIST.remove_channel_from_packet(packet) elif packet.packet_type == 'tell': sessions = session_mgr.find_sessions_from_username(packet.target) for session in sessions: diff --git a/src/imc2/trackers.py b/src/imc2/trackers.py index 757c7cd3ac..5c9230a775 100644 --- a/src/imc2/trackers.py +++ b/src/imc2/trackers.py @@ -61,8 +61,8 @@ class IMC2Channel(object): Stores information about channels available on the network. """ def __init__(self, packet): - self.name = packet.optional_data.get('localname', None) - self.full_name = packet.optional_data.get('channel', None) + self.localname = packet.optional_data.get('localname', None) + self.name = packet.optional_data.get('channel', None) self.level = packet.optional_data.get('level', None) self.owner = packet.optional_data.get('owner', None) self.policy = packet.optional_data.get('policy', None)