All pastes #180903 Raw Edit

Cody Brocious

public python v1 · immutable
#180903 ·published 2006-09-24 08:52 UTC
rendered paste body
class SLClient(object):    packet_handlers = {}    def __init__(self, addr):        self.addr = addr    def handlePacket(self, packet):        if packet.opcode in self.packet_handlers:            self.packet_handlers[packet.opcode](packet)        else:            print 'Unhandled packet from client %s: %s' % (`self.addr`, packet)