|
|
[Package Index | Mudlib Index | Effect Index]
File /std/delivery.c
Inheritable Delivery System
This object provides a way of storing and sending objects to
players while they are not online. It is roughly based on
the concepts found in Post Offices that support parcel
depositing, and also Bernita's Flower Shop. (Which delivers
flowers to people when they log on.)
This object is easy to use, and can be combined with most
other objects on the Disc. (ie, /obj/monster and /std/room).
See delivery_room.c for a pre-made room which handles the
delivery of objects.
Note that this system uses static login calls. These
must be configured first and turned on manually in order for
the delivery system to work.
In order to use this inheritable the following things must be
done:
- The object that uses it created, and this object inherited.
- The save file set using set_save_file().
- Any extra settings such as delivery message and delay configured.
- setup_delivery() called on the object to finalize setup.
Written by Taffyd
Inherits
This class inherits the following classes /global/auto_load.cIncludes
This class includes the following files /include/move_failures.h, /include/player_handler.h, /include/login.h and /include/login_handler.hClass Index
Method index
- add_delivery(mixed, mixed, object, int)
This method adds a new item to the delivery mapping for the specified
recipient.
- check_delivery(mixed, string)
This method is called by the login handler every time someone logs
on to the Disc.
- clean_delivery_mapping()
- clear_delivery()
This method is used to remove all deliveries currently stored within the
delivery system.
- deliver_item(string, object, string)
This method is called when an item is being delivered to a player.
- load_file()
This method loads retrieves data from the save file, and handles the
autoloading of the items.
- query_burdened_mess()
This returns the current delivery message that is displayed to the
recipient of a delivery, if it is too heavy go to in their inventory.
- query_delivery(string)
This method returns the delivery details for a particular person, or
the entire delivery mapping of one doesn't exist.
- query_delivery_delay()
This method returns how long after the login an item is delivered
to the recipient.
- query_delivery_mess()
This returns the current delivery message that is displayed to the
recipient of a delivery.
- query_save_file()
This method is used to query the save file in which the delivery data
is stored.
- save_file()
This method saves all of the delivery data into the save file, handling
saving of the auto loading as well.
- set_burdened_mess(string)
This method sets the message that is displayed when an item is too
heavy to be placed in the victim's inventory.
- set_delivery(mapping)
This is used to set all of the delivery mapping manually.
- set_delivery_delay(int)
This method is used to specify how many seconds to wait after login
until the item is delivered.
- set_delivery_mess(string)
This method sets the delivery message that is displayed to the player
when they log on.
- set_save_file(string)
This method sets the save file to a file name so that auto loading and
delivery details can be successfully saved.
- setup_delivery()
This method adds the object into the login handler's static login calls
list.
- valid_delivery(class delivery_item, string)
This method is called by the check_delivery() function when it validates
someone's deliveries.
Public Functions
These are functions that everyone can access.
.
void add_delivery(mixed who,
mixed sender,
object item,
int delay)
This method adds a new item to the delivery mapping for the specified
recipient. This should always be used instead of set_delivery(), as it
makes sure that all the data structures have been configured correctly.
void check_delivery(mixed person,
string type)
This method is called by the login handler every time someone logs
on to the Disc. It handles the delivery of items and all sorts of
nifty things.
- Parameters:
person - the name of the person logging on
type - the type of login event
void clean_delivery_mapping()
void clear_delivery()
This method is used to remove all deliveries currently stored within the
delivery system.
Be very careful when using this function! It will save the cleared
delivery mapping after it has been called.
void load_file()
This method loads retrieves data from the save file, and handles the
autoloading of the items.
string query_burdened_mess()
This returns the current delivery message that is displayed to the
recipient of a delivery, if it is too heavy go to in their inventory.
|