mirror of
https://github.com/evennia/evennia.git
synced 2026-03-27 02:06:32 +01: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
23 lines
681 B
Python
23 lines
681 B
Python
|
|
"""
|
|
This contains a simple view for rendering the webclient
|
|
page and serve it eventual static content.
|
|
|
|
"""
|
|
|
|
from django.shortcuts import render_to_response
|
|
from django.template import RequestContext
|
|
from django.conf import settings
|
|
from src.server import sessionhandler
|
|
from src.config.models import ConfigValue
|
|
|
|
def webclient(request):
|
|
"""
|
|
Webclient page template loading.
|
|
"""
|
|
|
|
# as an example we send the number of connected players to the template
|
|
pagevars = {'num_players_connected': ConfigValue.objects.conf('nr_sessions')}
|
|
|
|
context_instance = RequestContext(request)
|
|
return render_to_response('webclient.html', pagevars, context_instance)
|