From 82f35f3b8424b17875773196980e543d7674fa70 Mon Sep 17 00:00:00 2001 From: Greg Taylor Date: Sat, 14 Jun 2008 04:24:53 +0000 Subject: [PATCH] As is in Penn (I think), we'll use two underscores to denote a hidden server attribute. Finished up moving the two hidden attributes that I know need to be hidden and read-only over to the double underscore names as per Issue 27. --- defines_global.py | 5 +++-- functions_comsys.py | 8 ++++---- session.py | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/defines_global.py b/defines_global.py index b62dace345..46ea0f61c3 100755 --- a/defines_global.py +++ b/defines_global.py @@ -30,10 +30,11 @@ NOSAVE_FLAGS = ["CONNECTED"] NOSET_FLAGS = ["CONNECTED"] # These attribute names can't be modified by players. -NOSET_ATTRIBS = ["MONEY", "ALIAS", "LASTPAGED", "CHANLIST", "LAST", "LASTSITE"] +NOSET_ATTRIBS = ["MONEY", "ALIAS", "LASTPAGED", "__CHANLIST", "LAST", + "__PARENT", "LASTSITE"] # These attributes don't show up on objects when examined. -HIDDEN_ATTRIBS = ["CHANLIST"] +HIDDEN_ATTRIBS = ["__CHANLIST", "__PARENT"] # Server version number. REVISION = '$Rev$' diff --git a/functions_comsys.py b/functions_comsys.py index 3f78344d17..97e2770a4b 100644 --- a/functions_comsys.py +++ b/functions_comsys.py @@ -1,3 +1,6 @@ +""" +Comsys functions. +""" import time, datetime from django.utils import simplejson @@ -5,9 +8,6 @@ from django.utils import simplejson from apps.objects.models import CommChannel, CommChannelMessage import session_mgr import ansi -""" -Comsys functions. -""" def plr_get_cdict(session): """ @@ -147,7 +147,7 @@ def plr_jsondump_channels(session): session: (SessionProtocol) A reference to the player session. """ - session.get_pobject().set_attribute("CHANLIST", simplejson.dumps(plr_get_cdict(session))) + session.get_pobject().set_attribute("__CHANLIST", simplejson.dumps(plr_get_cdict(session))) def plr_del_channel(session, alias): """ diff --git a/session.py b/session.py index ca080b4dbb..0981ccc11a 100755 --- a/session.py +++ b/session.py @@ -70,7 +70,7 @@ class SessionProtocol(StatefulTelnetProtocol): """ Parse JSON dict of a user's channel list from their CHANLIST attribute. """ - chan_list = self.get_pobject().get_attribute_value("CHANLIST") + chan_list = self.get_pobject().get_attribute_value("__CHANLIST") if chan_list: self.channels_subscribed = simplejson.loads(chan_list)