Working with locks

Submitted by raevnos on Thu, 2004-06-03 14:02

This section is an introduction to dealing with locks: Adding new built-in lock types, evaluating an object's locks, adding or changing individual locks, and so forth.


The code for locks is located in hdrs/lock.h and src/lock.c. All information about a specific lock is held in a lock_list struct. lock_lists are stored in a linked list sorted by lock name, in a way similar to attributes. The actual key part of a lock, called a boolexp, is handled by hdrs/boolexp.h and src/boolexp.c.

The fields of a lock_list should be accessed via the macros defined in hdrs/lock.h. They are:

The flags of a lock.
The dbref of the player that set the lock.
The name of the lock ("Basic", "Enter", etc.)
The boolexp