本文整理汇总了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)
示例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')
示例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')
示例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")