HTML Utilities

Showing help on 'locking'

It is frequently useful to restrict the use of some object. For example, one might want to keep people from using a particular exit unless they're carrying a bell, a book, and a candle. Alternatively, one might allow anyone to use the exit unless they're carrying that huge golden coffin in the corner. LambdaMOO supports a general locking mechanism designed to make such restrictions easy to implement, usually without any programming.

Every object supports a notion of being 'locked' with respect to certain other objects. For example, the exit above might be locked for any object that was carrying the coffin object but unlocked for all other objects. In general, if some object 'A' is locked for another object, 'B', then 'B' is usually prevented from using 'A'. Of course, the meaning of 'use' in this context depends upon the kind of object.

The various standard classes of objects use locking as follows:
+ Rooms and containers refuse to allow any object inside them if they're locked for it.
+ Exits refuse to transport any object that they're locked for.
+ Things (including notes and letters) cannot be moved to locations that they're locked for.

There are two sides to locking:
+ How is it specified whether one object is locked for another one?
+ What is the effect of an object being locked?
Note that these two questions are entirely independent: one could invent a brand-new way to specify locking, but the effect of an exit being locked would be unchanged.

[Note to programmers: the interface between these two sides is the verb x:is_unlocked_for(y), which is called by x to determine if it is locked for the object y. The way in which 'is_unlocked_for' is implemented is entirely independent of the ways in which x uses its results. Note that you can play on either side of this interface with your own objects, either defining new implementations of 'is_unlocked_for' that match your particular circumstances or having your objects interpret their being locked in new ways.]

There is a default way to specify locks on objects; the following help topics cover the relevant commands:

@lock -- setting a lock on an object
@unlock -- clearing the lock on an object
keys -- describes the language used to describe lock keys



-- telnet://project-mongoose.net:7777 -- Mail us -- http://project-mongoose.net:7780/ --
-- Five users connected --