Cody Brocious
public python v1 · immutableclass 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)