

@tornado.gen.coroutine
def get(self):
    if (not self.twsession):
        self.redirect('/')
        return
    portid = self.get_cookie('tworld_portlink', None)
    if portid:
        self.clear_cookie('tworld_portlink')
        try:
            portid = ObjectId(portid)
            portal = (yield self.check_external_portal(portid))
            uid = self.twsession['uid']
            msg = {
                'cmd': 'externalcopyportal',
                'uid': str(uid),
                'portid': str(portid),
                'focus': True,
            }
            self.application.twservermgr.tworld_write(0, msg)
        except Exception as ex:
            self.application.twlog.info('Unable to load portlink info for play: %s', ex)
    uiprefs = {
        
    }
    if (self.application.mongodb is not None):
        cursor = self.application.mongodb.playprefs.find({
            'uid': self.twsession['uid'],
        })
        while (yield cursor.fetch_next):
            pref = cursor.next_object()
            uiprefs[pref['key']] = pref['val']
    usessl = (self.request.protocol == 'https')
    localize = self.application.twlocalize.all()
    self.render('play.html', uiprefs=json.dumps(uiprefs), usessl=usessl, localize=json.dumps(localize))

dataset/ETHPy150Open erkyrath/tworld/lib/tweblib/handlers.py PlayHandler.get/original