mirror of
https://github.com/evennia/evennia.git
synced 2026-03-31 21:17:17 +02:00
Further caching and optimization, making some operations noticeable faster in the end.
This commit is contained in:
parent
1a6ef5d983
commit
6e08c011a1
13 changed files with 78 additions and 73 deletions
|
|
@ -14,7 +14,6 @@ There are two similar but separate stores of sessions:
|
|||
|
||||
import time
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import User
|
||||
from src.server.models import ServerConfig
|
||||
|
||||
from src.commands.cmdhandler import CMD_LOGINSTART
|
||||
|
|
@ -259,12 +258,7 @@ class ServerSessionHandler(SessionHandler):
|
|||
"""
|
||||
Given a player, return any matching sessions.
|
||||
"""
|
||||
username = player.user.username
|
||||
try:
|
||||
uobj = User.objects.get(username=username)
|
||||
except User.DoesNotExist:
|
||||
return None
|
||||
uid = uobj.id
|
||||
uid = player.uid
|
||||
return [session for session in self.sessions.values() if session.logged_in and session.uid == uid]
|
||||
|
||||
def sessions_from_character(self, character):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue