Allow special packet handlers to be indexed uniquely

This commit is contained in:
Ben 2019-12-02 23:16:33 +00:00
parent ade40f914b
commit 7da79cecb1
2 changed files with 3 additions and 3 deletions

View File

@ -26,8 +26,8 @@ class _Packet:
class XTPacket(_Packet):
def __init__(self, *packet_id):
super().__init__('#'.join(packet_id))
def __init__(self, *packet_id, ext='s'):
super().__init__(ext + '%' + '#'.join(packet_id))
class XMLPacket(_Packet):

View File

@ -94,7 +94,7 @@ class Spheniscidae:
parsed_data = data.split('%')[1:-1]
packet_id = parsed_data[2]
packet = XTPacket(packet_id)
packet = XTPacket(packet_id, ext=parsed_data[1])
if packet in self.server.xt_listeners:
xt_listeners = self.server.xt_listeners[packet]