diff --git a/contrib/chargen.py b/contrib/chargen.py index cdb3989df..c11e00080 100644 --- a/contrib/chargen.py +++ b/contrib/chargen.py @@ -2,6 +2,10 @@ Contribution - Griatch 2011 +[Note - with the advent of MULTISESSION_MODE=2, this is not really +as necessary anymore - the ooclook and @charcreate commands in that +mode replaces this module with better functionality.] + This is a simple character creation commandset. A suggestion is to test this together with menu_login, which doesn't create a Character on its own. This shows some more info and gives the Player the option diff --git a/src/typeclasses/models.py b/src/typeclasses/models.py index 6da144f89..1ce01179d 100644 --- a/src/typeclasses/models.py +++ b/src/typeclasses/models.py @@ -135,28 +135,39 @@ class Attribute(SharedMemoryModel): #@property def __value_get(self): """ - Getter. Allows for value = self.value. Reads from cache if possible. + Getter. Allows for value = self.value. + We cannot cache here since it makes certain cases (such + as storing a dbobj which is then deleted elswhere) out-of-sync. + The overhead of unpickling seems hard to avoid. """ - if self.no_cache: - # re-create data from database and cache it - value = from_pickle(self.db_value, db_obj=self) - self.cached_value = value - self.no_cache = False - return self.cached_value + return from_pickle(self.db_value, db_obj=self) + #if self.no_cache: + # # re-create data from database and cache it + # value = from_pickle(self.db_value, db_obj=self) + # self.cached_value = value + # self.no_cache = False + #return self.cached_value #@value.setter def __value_set(self, new_value): """ Setter. Allows for self.value = value. We make sure to cache everything. """ - to_store = to_pickle(new_value) - self.cached_value = from_pickle(to_store, db_obj=self) - self.no_cache = False - self.db_value = to_store + self.db_value = to_pickle(new_value) self.save() try: self._track_db_value_change.update(self.cached_value) except AttributeError: pass + return + #to_store = to_pickle(new_value) + #self.cached_value = from_pickle(to_store, db_obj=self) + #self.no_cache = False + #self.db_value = to_store + #self.save() + #try: + # self._track_db_value_change.update(self.cached_value) + #except AttributeError: + # pass #@value.deleter def __value_del(self): "Deleter. Allows for del attr.value. This removes the entire attribute."