Пример #1
0
 def __init__(self, *args, **kwargs):
     "Parent must be initialized first."
     TypedObject.__init__(self, *args, **kwargs)
     # handlers
     _SA(self, "cmdset", CmdSetHandler(self))
     _GA(self, "cmdset").update(init_mode=True)
     _SA(self, "scripts", ScriptHandler(self))
     _SA(self, "attributes", AttributeHandler(self))
     _SA(self, "nicks", NickHandler(self))
     _SA(self, "tags", TagHandler(self))
     _SA(self, "aliases", AliasHandler(self))
Пример #2
0
    def at_login(self, player):
        """
        Hook called by sessionhandler when the session becomes authenticated.

        player - the player associated with the session
        """
        self.player = player
        self.uid = self.player.id
        self.uname = self.player.username
        self.logged_in = True
        self.conn_time = time.time()
        self.puid = None
        self.puppet = None
        self.cmdset_storage = settings.CMDSET_SESSION

        # Update account's last login time.
        self.player.last_login = datetime.now()
        self.player.save()

        # add the session-level cmdset
        self.cmdset = CmdSetHandler(self, True)
Пример #3
0
 def cmdset(self):
     return CmdSetHandler(self, True)
Пример #4
0
 def __init__(self):
     "Initiate to avoid AttributeErrors down the line"
     self.puppet = None
     self.player = None
     self.cmdset_storage_string = ""
     self.cmdset = CmdSetHandler(self, True)