[Package Index | Mudlib Index | Effect Index]

File /obj/handlers/player_shop.c

This is the handler for player-run shops.

Description

This handler ensures that the very short name (and therefore save file directories) are unique for each shop. Anybody may add a new shop but only a Lord may remove or update an existing shop's details.

Written by Ringo

Started 28th January 2001

Includes

This class includes the following files /include/player_shop.h and /include/mail.h

Method index

Public Functions

These are functions that everyone can access.

add_shop
int add_shop(string short_name,
             string office_path)

Add a shop to the handler.

Parameters:
short_name - The shop name passed to set_very_short()
office_path - The path to the shop's office.

Returns:
1 on success, 0 if this shop already exists or no such path.

See also:
/std/shops/player_shop/office.c


auto_mail
void auto_mail(string to,
               string from,
               string sub,
               string cc,
               string body)

Send mail
query_shop
string query_shop(string short_name)

Query a shop's path. Used by the office to check this is a valid shop.

Parameters:
short_name - The shop name passed to set_very_short()

Returns:
The path to the office, or a blank string if no such shop.

See also:
/std/shops/player_shop/office.c


query_shops
mapping query_shops()

Query the list of shops.

Returns:
The shops mapping.


remove_shop
int remove_shop(string short_name)

Remove a shop from the handler. Lords only.

Parameters:
short_name - The shop name passed to set_very_short()

Returns:
1 on success, 0 if this shop doesn't exist.

See also:
/std/shops/player_shop/office.c


update_shop
int update_shop(string short_name,
                string office_path)

Update a shop's path. Lords only.

Parameters:
short_name - The shop name passed to set_very_short()
office_path - The path to the shop's office.

Returns:
1 on success, 0 if this shop doesn't exists or no such path.

See also:
/std/shops/player_shop/office.c