Fixed an issue with quell not correctly updating its caches in some situations.
This commit is contained in:
parent
ead595c2df
commit
ebdc6cdbd4
3 changed files with 6 additions and 12 deletions
|
|
@ -43,7 +43,7 @@ The Extended Room can be "detailed" with special keywords. This makes
|
||||||
use of a special Look command. Details are "virtual" targets to look
|
use of a special Look command. Details are "virtual" targets to look
|
||||||
at, without there having to be a database object created for it. The
|
at, without there having to be a database object created for it. The
|
||||||
Details are simply stored in a dictionary on the room and if the look
|
Details are simply stored in a dictionary on the room and if the look
|
||||||
command cannot find an object match for a a "look <target>" command it
|
command cannot find an object match for a "look <target>" command it
|
||||||
will also look through the available details at the current location
|
will also look through the available details at the current location
|
||||||
if applicable. An extended @desc command is used to set details.
|
if applicable. An extended @desc command is used to set details.
|
||||||
|
|
||||||
|
|
@ -119,7 +119,7 @@ class ExtendedRoom(Room):
|
||||||
|
|
||||||
def get_time_and_season(self):
|
def get_time_and_season(self):
|
||||||
"""
|
"""
|
||||||
Calcualte the current time and season ids
|
Calculate the current time and season ids
|
||||||
"""
|
"""
|
||||||
# get the current time as parts of year and parts of day
|
# get the current time as parts of year and parts of day
|
||||||
time = gametime.gametime(format=True) # returns a tuple (years,months,weeks,days,hours,minutes,sec)
|
time = gametime.gametime(format=True) # returns a tuple (years,months,weeks,days,hours,minutes,sec)
|
||||||
|
|
|
||||||
|
|
@ -616,6 +616,7 @@ class CmdQuell(MuxPlayerCommand):
|
||||||
# we are already puppeting an object. We need to reset the lock caches
|
# we are already puppeting an object. We need to reset the lock caches
|
||||||
# (otherwise the superuser status change won't be visible until repuppet)
|
# (otherwise the superuser status change won't be visible until repuppet)
|
||||||
char.locks.reset()
|
char.locks.reset()
|
||||||
|
player.locks.reset()
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
"Perform the command"
|
"Perform the command"
|
||||||
|
|
|
||||||
|
|
@ -168,9 +168,7 @@ class LockHandler(object):
|
||||||
self.obj = obj
|
self.obj = obj
|
||||||
self.locks = {}
|
self.locks = {}
|
||||||
self.log_obj = None
|
self.log_obj = None
|
||||||
self.reset_flag = False
|
self.reset()
|
||||||
self._cache_locks(self.obj.lock_storage)
|
|
||||||
self.cache_lock_bypass(obj)
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return ";".join(self.locks[key][2] for key in sorted(self.locks))
|
return ";".join(self.locks[key][2] for key in sorted(self.locks))
|
||||||
|
|
@ -332,7 +330,8 @@ class LockHandler(object):
|
||||||
Set the reset flag, so the the lock will be re-cached at next checking.
|
Set the reset flag, so the the lock will be re-cached at next checking.
|
||||||
This is usually set by @reload.
|
This is usually set by @reload.
|
||||||
"""
|
"""
|
||||||
self.reset_flag = True
|
self._cache_locks(self.obj.lock_storage)
|
||||||
|
self.cache_lock_bypass(self.obj)
|
||||||
|
|
||||||
def check(self, accessing_obj, access_type, default=False, no_superuser_bypass=False):
|
def check(self, accessing_obj, access_type, default=False, no_superuser_bypass=False):
|
||||||
"""
|
"""
|
||||||
|
|
@ -362,12 +361,6 @@ class LockHandler(object):
|
||||||
functions (as defined by your settings) are executed.
|
functions (as defined by your settings) are executed.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if self.reset_flag:
|
|
||||||
# rebuild cache, either directly or next call
|
|
||||||
self._cache_locks(self.obj.lock_storage)
|
|
||||||
self.reset_flag = False
|
|
||||||
self.cache_lock_bypass(self.obj)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# check if the lock should be bypassed (e.g. superuser status)
|
# check if the lock should be bypassed (e.g. superuser status)
|
||||||
if accessing_obj.locks.lock_bypass and not no_superuser_bypass:
|
if accessing_obj.locks.lock_bypass and not no_superuser_bypass:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue