

@tornado.gen.coroutine
def get(self, portid):
    portid = ObjectId(portid)
    portal = (yield self.check_external_portal(portid))
    if (self.twsessionstatus != 'auth'):
        self.set_cookie('tworld_portlink', str(portid), expires_days=0.05)
        self.redirect('/')
        return
    uid = self.twsession['uid']
    msg = {
        'cmd': 'externalcopyportal',
        'uid': str(uid),
        'portid': str(portid),
        'focus': True,
    }
    self.application.twservermgr.tworld_write(0, msg)
    ls = self.application.twconntable.for_uid(uid)
    if (not ls):
        self.redirect('/play')
        return
    portal.twportlink = (yield self.external_portal_description(portid, done=True))
    self.render('portlink.html')

dataset/ETHPy150Open erkyrath/tworld/lib/tweblib/handlers.py PortLinkHandler.get/VarMisuse@160/213 `self`->`portal`