当前位置: 首页>>代码示例>>Python>>正文


Python SESSIONS.session_from_player方法代码示例

本文整理汇总了Python中evennia.server.sessionhandler.SESSIONS.session_from_player方法的典型用法代码示例。如果您正苦于以下问题:Python SESSIONS.session_from_player方法的具体用法?Python SESSIONS.session_from_player怎么用?Python SESSIONS.session_from_player使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在evennia.server.sessionhandler.SESSIONS的用法示例。


在下文中一共展示了SESSIONS.session_from_player方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_session

# 需要导入模块: from evennia.server.sessionhandler import SESSIONS [as 别名]
# 或者: from evennia.server.sessionhandler.SESSIONS import session_from_player [as 别名]
 def get_session(self, sessid):
     """
     Return session with given sessid connected to this player.
     note that the sessionhandler also accepts sessid as an iterable.
     """
     global _SESSIONS
     if not _SESSIONS:
         from evennia.server.sessionhandler import SESSIONS as _SESSIONS
     return _SESSIONS.session_from_player(self, sessid)
开发者ID:Antraeus,项目名称:evennia,代码行数:11,代码来源:players.py

示例2: get_session

# 需要导入模块: from evennia.server.sessionhandler import SESSIONS [as 别名]
# 或者: from evennia.server.sessionhandler.SESSIONS import session_from_player [as 别名]
    def get_session(self, sessid):
        """
        Retrieve given session.

        Args:
            sessid (int or list): A session id or list of such to retrieve.

        Returns:
            session (Session or list): One or more Sessions matching
                the given `sessid`s while also being connected to this
                Player.

        """
        global _SESSIONS
        if not _SESSIONS:
            from evennia.server.sessionhandler import SESSIONS as _SESSIONS
        return _SESSIONS.session_from_player(self, sessid)
开发者ID:secretagentcook,项目名称:evennia,代码行数:19,代码来源:players.py

示例3: get

# 需要导入模块: from evennia.server.sessionhandler import SESSIONS [as 别名]
# 或者: from evennia.server.sessionhandler.SESSIONS import session_from_player [as 别名]
    def get(self, sessid=None):
        """
        Get the sessions linked to this object.

        Args:
            sessid (int, optional): Specify a given session by
                session id.

        Returns:
            sessions (list): A list of Session objects. If `sessid`
                is given, this is a list with one (or zero) elements.

        """
        global _SESSIONS
        if not _SESSIONS:
            from evennia.server.sessionhandler import SESSIONS as _SESSIONS
        if sessid:
            return make_iter(_SESSIONS.session_from_player(self.player, sessid))
        else:
            return _SESSIONS.sessions_from_player(self.player)
开发者ID:noahzaozao,项目名称:muddery,代码行数:22,代码来源:players.py


注:本文中的evennia.server.sessionhandler.SESSIONS.session_from_player方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。