#NEWLINE# def at_sync( self ) : #NEWLINE# #INDENT# '\n        This is called whenever a session has been resynced with the\n        portal.  At this point all relevant attributes have already\n        been set and self.player been assigned (if applicable).\n\n        Since this is often called after a server restart we need to\n        set up the session as it was.\n\n        ' #NEWLINE# global _ObjectDB #NEWLINE# if ( not _ObjectDB ) : #NEWLINE# #INDENT# from evennia.objects.models import ObjectDB as _ObjectDB #NEWLINE# #UNINDENT# if ( not self . logged_in ) : #NEWLINE# #INDENT# self . cmdset_storage = settings . CMDSET_UNLOGGEDIN #NEWLINE# #UNINDENT# self . cmdset . update ( init_mode = True ) #NEWLINE# if self . puid : #NEWLINE# #INDENT# obj = _ObjectDB . objects . get ( id = _ObjectDB . puid ) #NEWLINE# obj . sessions . add ( self ) #NEWLINE# obj . player = self . player #NEWLINE# self . puid = obj . id #NEWLINE# self . puppet = obj #NEWLINE# obj . locks . cache_lock_bypass ( obj )