[Package Index | Mudlib Index | Effect Index]
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:
Written by Taffyd
.
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.
add_delivery(this_player(), "taffyd", frog, 360);
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.
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.
varargs mixed query_delivery(string person)This method returns the delivery details for a particular person, or the entire delivery mapping of one doesn't exist.
int query_delivery_delay()This method returns how long after the login an item is delivered to the recipient.
string query_delivery_mess()This returns the current delivery message that is displayed to the recipient of a delivery.
string query_save_file()This method is used to query the save file in which the delivery data is stored.
void save_file()This method saves all of the delivery data into the save file, handling saving of the auto loading as well.
void setup_delivery()This method adds the object into the login handler's static login calls list. It only ever needs to be called _once_, and doesn't need to be called every time the object loads.
Once this is done, the object will automatically be loaded whenever someone logs on.
This must be called in order for the delivery system to work at all.
void deliver_item(string who, object ob, string sent_by)This method is called when an item is being delivered to a player. The delivery message or the burdened mess is used depending on how the item is delivered, and then it is removed from the delivery mapping.
Note that this routine uses add_message() to display movement messages to the player, instead of tell_object() or a traditional move message. This is so that the messages can be 'clumped' together properly, otherwise it just doesn't work.
void set_burdened_mess(string s)This method sets the message that is displayed when an item is too heavy to be placed in the victim's inventory. This uses the same format as the normal delivery message.
void set_delivery(mapping x)This is used to set all of the delivery mapping manually. You should not use this method.
void set_delivery_delay(int new_time)This method is used to specify how many seconds to wait after login until the item is delivered. Note that if this is too long, then the receipient may log out before you can give them the item. If the receipient logs out, then the item will be destroyed.
This is set to 5 by default.
void set_delivery_mess(string s)This method sets the delivery message that is displayed to the player when they log on. $S is substituted in the string with the name of the player who sent the message, $N is replaced with the a_short() of the item being sent.
set_delivery_mess("A small frog hops up to you, and thrusts $N " "into your arms. He holds up a large sign that reads: \"" "From $S\", and then runs away.\n"); // Recipient sees: A small frog hops up to you, and thrusts a large blue box into your arms. He holds up a large sign that reads: \"From Taffyd!\", and then runs away.
void set_save_file(string str)This method sets the save file to a file name so that auto loading and delivery details can be successfully saved.
int valid_delivery(class delivery_item delivery, string person)This method is called by the check_delivery() function when it validates someone's deliveries. It is used to determine whether or not it's time for a delivery to be delivered, and whether or not to remove it.
class delivery_item { object delivery_ob; string sent_by; int submit_time; int delay_time; }