'Called by Portal when a new session has connected.
Creates a new, unlogged-in game session.
Args:
portalsessiondata (dict): a dictionary of all property:value
keys defining the session and which is marked to be
synced.'

def portal_connect(self, portalsessiondata):

    delayed_import()
    global _ServerSession, _PlayerDB, _ScriptDB
    sess = _ServerSession()
    sess.sessionhandler = self
    sess.load_sync_data(portalsessiondata)
    sess.at_sync()
    _ScriptDB.objects.validate()
    self[sess.sessid] = sess
    if (sess.logged_in and sess.uid):
        player = _PlayerDB.objects.get_player_from_uid(sess.uid)
        if player:
            self.login(sess, player, force=True)
            return
        else:
            sess.logged_in = False
            sess.uid = None
    self.data_in(sess, text=[[CMD_LOGINSTART], {}])
