Break up/extend MULTISESSION_MODE into several new settings

This commit is contained in:
Griatch 2022-09-14 23:46:10 +02:00
parent e9cce46d66
commit a0a0a248a0
13 changed files with 392 additions and 368 deletions

View file

@ -30,7 +30,7 @@ def check_errors(settings):
raise DeprecationWarning(deprstring % ("CMDSET_OOC", "CMDSET_ACCOUNT"))
if settings.WEBSERVER_ENABLED and not isinstance(settings.WEBSERVER_PORTS[0], tuple):
raise DeprecationWarning(
"settings.WEBSERVER_PORTS must be on the form " "[(proxyport, serverport), ...]"
"settings.WEBSERVER_PORTS must be on the form [(proxyport, serverport), ...]"
)
if hasattr(settings, "BASE_COMM_TYPECLASS"):
raise DeprecationWarning(deprstring % ("BASE_COMM_TYPECLASS", "BASE_CHANNEL_TYPECLASS"))
@ -43,7 +43,7 @@ def check_errors(settings):
"(see evennia/settings_default.py)."
)
deprstring = (
"settings.%s is now merged into settings.TYPECLASS_PATHS. " "Update your settings file."
"settings.%s is now merged into settings.TYPECLASS_PATHS. Update your settings file."
)
if hasattr(settings, "OBJECT_TYPECLASS_PATHS"):
raise DeprecationWarning(deprstring % "OBJECT_TYPECLASS_PATHS")
@ -147,6 +147,13 @@ def check_errors(settings):
" 2. Rename your existing `static_overrides` folder to `static` instead."
)
if settings.MULTISESSION_MODE < 2 and settings.MAX_NR_SIMULTANEOUS_PUPPETS > 1:
raise DeprecationWarning(
f"settings.MULTISESSION_MODE={settings.MULTISESSION_MODE} is not compatible with "
f"settings.MAX_NR_SIMULTANEOUS_PUPPETS={settings.MAX_NR_SIMULTANEOUS_PUPPETS}. "
"To allow multiple simultaneous puppets, the multi-session mode must be higher than 1."
)
def check_warnings(settings):
"""

View file

@ -13,22 +13,20 @@ There are two similar but separate stores of sessions:
"""
import time
from codecs import decode as codecs_decode
from django.conf import settings
from evennia.commands.cmdhandler import CMD_LOGINSTART
from evennia.utils.logger import log_trace
from evennia.utils.utils import (
is_iter,
make_iter,
delay,
callables_from_module,
class_from_module,
)
from evennia.server.portal import amp
from evennia.server.signals import SIGNAL_ACCOUNT_POST_LOGIN, SIGNAL_ACCOUNT_POST_LOGOUT
from evennia.server.signals import SIGNAL_ACCOUNT_POST_FIRST_LOGIN, SIGNAL_ACCOUNT_POST_LAST_LOGOUT
from codecs import decode as codecs_decode
from django.utils.translation import gettext as _
from evennia.commands.cmdhandler import CMD_LOGINSTART
from evennia.server.portal import amp
from evennia.server.signals import (
SIGNAL_ACCOUNT_POST_FIRST_LOGIN,
SIGNAL_ACCOUNT_POST_LAST_LOGOUT,
SIGNAL_ACCOUNT_POST_LOGIN,
SIGNAL_ACCOUNT_POST_LOGOUT,
)
from evennia.utils.logger import log_trace
from evennia.utils.utils import callables_from_module, class_from_module, delay, is_iter, make_iter
_FUNCPARSER_PARSE_OUTGOING_MESSAGES_ENABLED = settings.FUNCPARSER_PARSE_OUTGOING_MESSAGES_ENABLED
_BROADCAST_SERVER_RESTART_MESSAGES = settings.BROADCAST_SERVER_RESTART_MESSAGES