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


Python SESSIONS.announce_all方法代码示例

本文整理汇总了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)
开发者ID:helix-0311,项目名称:evennia,代码行数:10,代码来源:admin.py

示例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')
开发者ID:BlauFeuer,项目名称:evennia,代码行数:11,代码来源:system.py

示例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)
开发者ID:noahzaozao,项目名称:muddery,代码行数:17,代码来源:views.py

示例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})
开发者ID:carriercomm,项目名称:muddery,代码行数:22,代码来源:views.py

示例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)
开发者ID:muddery,项目名称:muddery,代码行数:25,代码来源:editor.py

示例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})
开发者ID:kickreg,项目名称:muddery,代码行数:25,代码来源:views.py


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