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


Python SESSIONS.announce_all方法代码示例

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


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

示例1: func

# 需要导入模块: from src.server.sessionhandler import SESSIONS [as 别名]
# 或者: from src.server.sessionhandler.SESSIONS import announce_all [as 别名]
 def func(self):
     "Implements command"
     if not self.args:
         self.caller.msg("Usage: @wall <message>")
         return
     message = '%s shouts "%s"' % (self.caller.name, self.args)
     self.msg("Announcing to all connected players ...")
     SESSIONS.announce_all(message)
开发者ID:Aumnren,项目名称:evennia,代码行数:10,代码来源:admin.py

示例2: func

# 需要导入模块: from src.server.sessionhandler import SESSIONS [as 别名]
# 或者: from src.server.sessionhandler.SESSIONS import announce_all [as 别名]
 def func(self):
     """
     Reload the system.
     """
     reason = ""
     if self.args:
         reason = "(Reason: %s) " % self.args.rstrip(".")
     SESSIONS.announce_all(" Server restarting %s..." % reason)
     SESSIONS.server.shutdown(mode='reload')
开发者ID:AHecky3,项目名称:evennia,代码行数:11,代码来源:system.py

示例3: func

# 需要导入模块: from src.server.sessionhandler import SESSIONS [as 别名]
# 或者: from src.server.sessionhandler.SESSIONS import announce_all [as 别名]
 def func(self):
     "Define function"
     try:
         session = self.caller.sessions[0]
     except Exception:
         return
     self.caller.msg('Shutting down server ...')
     announcement = "\nServer is being SHUT DOWN!\n"
     if self.args:
         announcement += "%s\n" % self.args
     logger.log_infomsg('Server shutdown by %s.' % self.caller.name)
     SESSIONS.announce_all(announcement)
     SESSIONS.portal_shutdown()
     SESSIONS.server.shutdown(mode='shutdown')
开发者ID:abbacode,项目名称:avaloria,代码行数:16,代码来源:system.py

示例4: func

# 需要导入模块: from src.server.sessionhandler import SESSIONS [as 别名]
# 或者: from src.server.sessionhandler.SESSIONS import announce_all [as 别名]
 def func(self):
     "Define function"
     try:
         # Only allow shutdown if caller has session
         self.caller.sessions[0]
     except Exception:
         return
     self.msg("Shutting down server ...")
     announcement = "\nServer is being SHUT DOWN!\n"
     if self.args:
         announcement += "%s\n" % self.args
     logger.log_infomsg("Server shutdown by %s." % self.caller.name)
     SESSIONS.announce_all(announcement)
     SESSIONS.portal_shutdown()
     SESSIONS.server.shutdown(mode="shutdown")
开发者ID:no-space,项目名称:evennia,代码行数:17,代码来源:system.py


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