本文整理汇总了Python中evennia.server.sessionhandler.SESSIONS.announce_all方法的典型用法代码示例。如果您正苦于以下问题:Python SESSIONS.announce_all方法的具体用法?Python SESSIONS.announce_all怎么用?Python SESSIONS.announce_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类evennia.server.sessionhandler.SESSIONS
的用法示例。
在下文中一共展示了SESSIONS.announce_all方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: func
# 需要导入模块: from evennia.server.sessionhandler import SESSIONS [as 别名]
# 或者: from evennia.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 evennia.server.sessionhandler import SESSIONS [as 别名]
# 或者: from evennia.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 restart initiated %s..." % reason)
SESSIONS.server.shutdown(mode='reload')
示例3: apply_changes
# 需要导入模块: from evennia.server.sessionhandler import SESSIONS [as 别名]
# 或者: from evennia.server.sessionhandler.SESSIONS import announce_all [as 别名]
def apply_changes(request):
"""
Apply the game world's data.
"""
try:
# rebuild the world
build_all()
# reload
SESSIONS.announce_all(" Server restarting ...")
SESSIONS.server.shutdown(mode='reload')
except Exception, e:
ostring = "Can't build world: %s" % e
logger.log_tracemsg(ostring)
raise http.HttpResponseServerError(ostring)
示例4: apply_changes
# 需要导入模块: from evennia.server.sessionhandler import SESSIONS [as 别名]
# 或者: from evennia.server.sessionhandler.SESSIONS import announce_all [as 别名]
def apply_changes(request):
"""
Apply the game world's data.
"""
try:
# rebuild the world
build_all()
# send client settings
CLIENT_SETTINGS.reset()
text = json.dumps({"settings": CLIENT_SETTINGS.all_values()})
SESSIONS.announce_all(text)
# reload
SESSIONS.announce_all(" Server restarting ...")
SESSIONS.server.shutdown(mode='reload')
except Exception, e:
message = "Can't build world: %s" % e
logger.log_tracemsg(message)
return render(request, 'fail.html', {"message": message})
示例5: func
# 需要导入模块: from evennia.server.sessionhandler import SESSIONS [as 别名]
# 或者: from evennia.server.sessionhandler.SESSIONS import announce_all [as 别名]
def func(self, args, request):
try:
# reload system data
# import_syetem_data()
# reload localized strings
# LOCALIZED_STRINGS_HANDLER.reload()
# rebuild the world
build_all()
# send client settings
client_settings = GAME_SETTINGS.get_client_settings()
text = json.dumps({"settings": client_settings})
SESSIONS.announce_all(text)
# restart the server
SESSIONS.announce_all("Server restarting ...")
SESSIONS.portal_restart_server()
except Exception, e:
message = "Can not build the world: %s" % e
logger.log_tracemsg(message)
raise MudderyError(ERR.build_world_error, message)
示例6: apply_changes
# 需要导入模块: from evennia.server.sessionhandler import SESSIONS [as 别名]
# 或者: from evennia.server.sessionhandler.SESSIONS import announce_all [as 别名]
def apply_changes(request):
"""
Apply the game world's data.
"""
try:
# reload localized strings
LOCALIZED_STRINGS_HANDLER.reload()
# rebuild the world
build_all()
# send client settings
client_settings = GAME_SETTINGS.get_client_settings()
text = json.dumps({"settings": client_settings})
SESSIONS.announce_all(text)
# restart the server
SESSIONS.announce_all(" Server restarting ...")
SESSIONS.server.shutdown(mode='reload')
except Exception, e:
message = "Can't build world: %s" % e
logger.log_tracemsg(message)
return render(request, 'fail.html', {"message": message})