Implemented locks.

The main command to use is @lock, which accept three types of locks at the moment, and three types of keys:
 Locks: DefaultLock, UseLock, EnterLock
 Keys: ObjectIDs, Groups, Permissions
This offers the most useful functionality - stopping people from picking up things, blocking exits and stopping
anyone from using an object.
If the attributes lock_msg, use_lock_msg and enter_lock_msg are defined on the locked object, these will be used
as error messages instead of a standard one (so "the door is locked" instead of "you cannot traverse that exit").

Behind the scenes, there is a new module, src/locks.py that defines Keys and Locks. A Locks object is a collection
of Lock types. This is stored in the LOCKS attribute on objects. Each Lock contains a set of Keys that might be
of mixed type and which the player must match in order to pass the lock.
/Griatch
This commit is contained in:
Griatch 2009-10-05 20:04:15 +00:00
parent 7f7306a6e4
commit 66095a0b16
7 changed files with 491 additions and 26 deletions

View file

@ -23,10 +23,10 @@ OBJECT_TYPES = (
# These attribute names can't be modified by players.
NOSET_ATTRIBS = ["MONEY", "ALIAS", "LASTPAGED", "__CHANLIST", "LAST",
"__PARENT", "LASTSITE"]
"__PARENT", "LASTSITE", "LOCKS"]
# These attributes don't show up on objects when examined.
HIDDEN_ATTRIBS = ["__CHANLIST", "__PARENT"]
HIDDEN_ATTRIBS = ["__CHANLIST", "__PARENT", "LOCKS"]
# Server version number.
REVISION = os.popen('svnversion .', 'r').readline().strip()