'Main client loop.'

def serve_forever(self):

    if (not self.login()):
        logger.critical('The    server    version    is    not    compatible    with    the    client')
        self.end()
        return self.client_mode
    exitkey = False
    try:
        while (True and (not exitkey)):
            cs_status = self.update()
            exitkey = self.screen.update(self.stats, cs_status=cs_status, return_to_browser=self.return_to_browser)
            self.stats.export(self.stats)
    except Exception as e:
        logger.critical(e)
        self.end()
    return self.client_mode
