Minor update to web code.

This commit is contained in:
Griatch 2015-02-22 22:29:37 +01:00
parent e25d8569bb
commit be71aee08f
2 changed files with 24 additions and 3 deletions

View file

@ -10,6 +10,7 @@ from django.conf import settings
from django.contrib.admin.views.decorators import staff_member_required
from django.shortcuts import render
from evennia import SESSION_HANDLER
from evennia.objects.models import ObjectDB
from evennia.players.models import PlayerDB
@ -29,7 +30,8 @@ def page_index(request):
nplyrs_conn_recent = len(recent_users) or "none"
nplyrs = PlayerDB.objects.num_total_players() or "none"
nplyrs_reg_recent = len(PlayerDB.objects.get_recently_created_players()) or "none"
nsess = len(PlayerDB.objects.get_connected_players()) or "no one"
nsess = SESSION_HANDLER.player_count()
# nsess = len(PlayerDB.objects.get_connected_players()) or "no one"
nobjs = ObjectDB.objects.all().count()
nrooms = ObjectDB.objects.filter(db_location__isnull=True).exclude(db_typeclass_path=_BASE_CHAR_TYPECLASS).count()