mirror of
https://github.com/evennia/evennia.git
synced 2026-04-02 14:07:16 +02:00
cleaned up and rewritten to make it easier to add new protocols in the future - all new protocols need to inherit from server.session.Session, whi ch implements a set of hooks that Evennia uses to communicate. The current web client protocol is functional but does not implement any of rcaskey 's suggestions as of yet - it uses a separate data object passed through msg() to communicate between the server and the various protocols. Also the client itself could probably need cleanup and 'prettification'. The fact that the system runs a hybrid of Django and Twisted, getting the best of both worlds should allow for many possibilities in the future. /Griatch
47 lines
1.3 KiB
Python
47 lines
1.3 KiB
Python
#
|
|
# This file defines global variables that will always be
|
|
# available in a view context without having to repeatedly
|
|
# include it. For this to work, this file is included in
|
|
# the settings file, in the TEMPLATE_CONTEXT_PROCESSORS
|
|
# tuple.
|
|
#
|
|
|
|
from django.db import models
|
|
from django.conf import settings
|
|
from src.utils.utils import get_evennia_version
|
|
|
|
# Determine the site name and server version
|
|
|
|
try:
|
|
GAME_NAME = settings.SERVERNAME.strip()
|
|
except AttributeError:
|
|
GAME_NAME = "Evennia"
|
|
SERVER_VERSION = get_evennia_version()
|
|
|
|
|
|
# Setup lists of the most relevant apps so
|
|
# the adminsite becomes more readable.
|
|
|
|
USER_RELATED = ['Auth', 'Players']
|
|
GAME_ENTITIES = ['Objects', 'Scripts', 'Comms', 'Help']
|
|
GAME_SETUP = ['Permissions', 'Config']
|
|
CONNECTIONS = ['Irc', 'Imc2']
|
|
WEBSITE = ['Flatpages', 'News', 'Sites']
|
|
|
|
# The main context processor function
|
|
|
|
def general_context(request):
|
|
"""
|
|
Returns common Evennia-related context stuff, which
|
|
is automatically added to context of all views.
|
|
"""
|
|
return {
|
|
'game_name': GAME_NAME,
|
|
'game_slogan': SERVER_VERSION,
|
|
'evennia_userapps': USER_RELATED,
|
|
'evennia_entityapps': GAME_ENTITIES,
|
|
'evennia_setupapps': GAME_SETUP,
|
|
'evennia_connectapps': CONNECTIONS,
|
|
'evennia_websiteapps':WEBSITE,
|
|
"webclient_enabled" : settings.WEBCLIENT_ENABLED
|
|
}
|