mirror of
https://github.com/evennia/evennia.git
synced 2026-03-21 15:26:30 +01:00
Added FuncKeys - locking of objects depending on the result from an arbitrary function.
Added AttrKeys and FlagKeys - locks depending on the value of the unlocker's attribute or if they have a flag set. Finally I updated @lock to handle all these lock types. There are a large amount of possible configurations though, so more testing is needed. /Griatch
This commit is contained in:
parent
42254355a0
commit
46e2cd3ecb
4 changed files with 225 additions and 89 deletions
|
|
@ -235,3 +235,14 @@ class EvenniaBasicObject(object):
|
|||
return locks.check("EnterLock", pobject)
|
||||
else:
|
||||
return True
|
||||
|
||||
def lock_func(self, obj):
|
||||
"""
|
||||
This is a custom function called by locks with the FuncKey key. Its
|
||||
return value should match that specified in the lock (so no true/false
|
||||
lock result is actually determined in here). Default desired return
|
||||
value is True. Also remember that the comparison in FuncKey is made
|
||||
using the string representation of the return value, since @lock can
|
||||
only define string lock criteria.
|
||||
"""
|
||||
return False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue