Changed the way server reports logged-in/unlogged-in sessions to the log file.

This commit is contained in:
Griatch 2012-03-28 21:42:06 +02:00
parent da51cb063f
commit 06566c3e8f

View file

@ -268,15 +268,14 @@ class ServerSession(Session):
String representation of the user session class. We use String representation of the user session class. We use
this a lot in the server logs. this a lot in the server logs.
""" """
if self.logged_in: symbol = ""
symbol = '#' if self.logged_in and hasattr(self, "player") and self.player:
else: symbol = "(#%s)" % self.player.id
symbol = '?'
try: try:
address = ":".join([str(part) for part in self.address]) address = ":".join([str(part) for part in self.address])
except Exception: except Exception:
address = self.address address = self.address
return "<%s> %s@%s" % (symbol, self.uname, address) return "%s%s@%s" % (self.uname, symbol, address)
def __unicode__(self): def __unicode__(self):
""" """