mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Addition of BROADCAST_SERVER_RESTART_MESSAGES flag to notify all sessions that the server is restarting.
This commit is contained in:
parent
4db1a1e2e0
commit
bfd6ece47c
3 changed files with 8 additions and 2 deletions
|
|
@ -26,6 +26,7 @@ from evennia.scripts.taskhandler import TaskHandlerTask
|
|||
|
||||
COMMAND_DEFAULT_CLASS = class_from_module(settings.COMMAND_DEFAULT_CLASS)
|
||||
_TASK_HANDLER = None
|
||||
_BROADCAST_SERVER_RESTART_MESSAGES = settings.BROADCAST_SERVER_RESTART_MESSAGES
|
||||
|
||||
# delayed imports
|
||||
_RESOURCE = None
|
||||
|
|
@ -69,7 +70,8 @@ class CmdReload(COMMAND_DEFAULT_CLASS):
|
|||
reason = ""
|
||||
if self.args:
|
||||
reason = "(Reason: %s) " % self.args.rstrip(".")
|
||||
SESSIONS.announce_all(" Server restart initiated %s..." % reason)
|
||||
if _BROADCAST_SERVER_RESTART_MESSAGES:
|
||||
SESSIONS.announce_all(" Server restart initiated %s..." % reason)
|
||||
SESSIONS.portal_restart_server()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ from codecs import decode as codecs_decode
|
|||
from django.utils.translation import gettext as _
|
||||
|
||||
_FUNCPARSER_PARSE_OUTGOING_MESSAGES_ENABLED = settings.FUNCPARSER_PARSE_OUTGOING_MESSAGES_ENABLED
|
||||
_BROADCAST_SERVER_RESTART_MESSAGES = settings.BROADCAST_SERVER_RESTART_MESSAGES
|
||||
|
||||
# delayed imports
|
||||
_AccountDB = None
|
||||
|
|
@ -397,7 +398,8 @@ class ServerSessionHandler(SessionHandler):
|
|||
# tell the server hook we synced
|
||||
self.server.at_post_portal_sync(mode)
|
||||
# announce the reconnection
|
||||
self.announce_all(_(" ... Server restarted."))
|
||||
if _BROADCAST_SERVER_RESTART_MESSAGES:
|
||||
self.announce_all(_(" ... Server restarted."))
|
||||
|
||||
def portal_disconnect(self, session):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -244,6 +244,8 @@ MAX_CHAR_LIMIT_WARNING = (
|
|||
# debugging. OBS: Showing full tracebacks to regular users could be a
|
||||
# security problem -turn this off in a production game!
|
||||
IN_GAME_ERRORS = True
|
||||
# Broadcast "Server restart"-like messages to all sessions.
|
||||
BROADCAST_SERVER_RESTART_MESSAGES = True
|
||||
|
||||
######################################################################
|
||||
# Evennia Database config
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue