def lineReceived(self, line):
    passcheck = line.split(b' ')
    if ((passcheck[0] == b'login') and (len(passcheck) > 2)):
        passcheck = b' '.join((passcheck[:2] + [b'********']))
        self._log.info('Client {peer} sending message: {line}', peer=self.peer, line=passcheck)
    elif ((passcheck[0] == b'register') and (len(passcheck) > 2)):
        passcheck = b' '.join((passcheck[:2] + [b'********']))
        self._log.info('Client {peer} sending message: {line}', peer=self.peer, line=passcheck)
    elif ((passcheck[0] == b'password') and (len(passcheck) > 1)):
        passcheck = b' '.join((passcheck[:1] + [b'********']))
        self._log.info('Client {peer} sending message: {line}', peer=self.peer, line=passcheck)
    else:
        self._log.info('Client {peer} sending message: {line}', peer=self.peer, line=line)
    try:
        line = line.decode('utf-8')
    except:
        self._log.info('Discarded garbage line from {peer}', peer=self.peer)
        return
    if (line == 'quit'):
        self.transport.loseConnection()
        return
    try:
        self.factory.router.shell.command(self.factory.router[self.peer]['console'], line)
    except:
        self.factory.communicate(self.peer, traceback.format_exc().encode('utf-8'))
        self._log.error(traceback.format_exc())
def lineReceived(self, line):
    passcheck = line.split(b' ')
    if ((passcheck[0] == b'login') and (len(passcheck) > 2)):
        passcheck = b' '.join((passcheck[:2] + [b'********']))
        self._log.info('Client {peer} sending message: {line}', peer=self.peer, line=passcheck)
    elif ((passcheck[0] == b'register') and (len(passcheck) > 2)):
        passcheck = b' '.join((passcheck[:2] + [b'********']))
        self._log.info('Client {peer} sending message: {line}', peer=self.peer, line=passcheck)
    elif ((passcheck[0] == b'password') and (len(passcheck) > 1)):
        passcheck = b' '.join((passcheck[:1] + [b'********']))
        self._log.info('Client {peer} sending message: {line}', peer=self.peer, line=passcheck)
    else:
        self._log.info('Client {peer} sending message: {line}', peer=self.peer, line=line)
    try:
        line = line.decode('utf-8')
    except:
        self._log.info('Discarded garbage line from {peer}', peer=self.peer)
        return
    if (line == 'quit'):
        self.transport.loseConnection()
        return
    try:
        self.factory.router.shell.command(self.factory.router[self.peer]['console'], line)
    except:
        self.factory.communicate(self.peer, traceback.format_exc().encode('utf-8'))
        self._log.error(traceback.format_exc())