[an error occurred while processing this directive]
[<a href="index.shtml">Package Index</a></code> | <a href="index_std.shtml">Mudlib Index</a></code> | <a href="index_eff.shtml">Effect Index</a></code>]<br><h2>File /std/shops/inherit/auction_house.c</h2>
This inherit handles auctioning stuff.<p>Written by Pinkfish<p>Started Mon Apr 30 22:47:38 PDT 2001
<h2>Inherits</h2>
This class inherits the following classes <a href="std.shops.inherit.shop_event.c.shtml">/std/shops/inherit/shop_event.c</a> and <a href="std.shops.inherit.open_shop.c.shtml">/std/shops/inherit/open_shop.c</a><h2>Includes</h2>
This class includes the following files <a href="include.player_handler.h.shtml">/include/player_handler.h</a>, <a href="include.mail.h.shtml">/include/mail.h</a>, <a href="include.room.auction.h.shtml">/include/room/auction.h</a>, <a href="include.money.h.shtml">/include/money.h</a>, <a href="include.player.h.shtml">/include/player.h</a>, <a href="include.am_time.h.shtml">/include/am_time.h</a>, <a href="include.move_failures.h.shtml">/include/move_failures.h</a>, /include/shops/bank.h and <a href="include.playtesters.h.shtml">/include/playtesters.h</a><h2>Class Index</h2>
<ul><li><a href="#class_auction">auction</a>
</ul><h2>Method index</h2>
<dl><ul>
<li><a href="#add_item_to_auction">add_item_to_auction</a>(object *, string, int, string, int, string, mixed)<br/>
This method puts an item up for auction.
<li><a href="#bid_on_item">bid_on_item</a>(class auction, int, string)<br/>
This method makes a bid on an item.
<li><a href="#confirm_auction">confirm_auction</a>(string, string, object *, int, int)<br/>Confirm the addition 
<li><a href="#do_add">do_add</a>(string, object *, string, string)<br/>
This method adds an item for bidding.
<li><a href="#do_bid">do_bid</a>(string, string)<br/>
This method makes a bid on the specified item.
<li><a href="#do_browse">do_browse</a>(string)<br/>
This method allows you to browse the item.
<li><a href="#do_claim">do_claim</a>()<br/>
This method claims anything that you can bought and is waiting for
pickup.
<li><a href="#do_info">do_info</a>()<br/>
This method shoes information about the auction house, like the
amount of time for each type of auction.
<li><a href="#do_list">do_list</a>()<br/>
This method lists all the current auctions.
<li><a href="#do_withdraw">do_withdraw</a>(string)<br/>
This method withdraws the item from bidding.
<li><a href="#finish_auction">finish_auction</a>(class auction)<br/>
This method finishes the aution on the specified item.
<li><a href="#force_finish_auction">force_finish_auction</a>(string)<br/>
This method forcibly finishes the auction on the specified item.
<li><a href="#load_me">load_me</a>()<br/>
This method loads the auction house up.
<li><a href="#next_auction_finish">next_auction_finish</a>()<br/>
This method figures out when the next auction finishes and sets up
a timeout.
<li><a href="#query_auction_end_string">query_auction_end_string</a>(class auction)<br/>
This method printsd a nice string showing how long till the auction
ends.
<li><a href="#query_auction_item">query_auction_item</a>(string)<br/>
This method finds the item based on some useful string.
<li><a href="#query_auction_objects">query_auction_objects</a>(class auction)<br/>
This method finds the objects associated with the auction item.
<li><a href="#query_auction_times">query_auction_times</a>()<br/>
This method returns the length of auctions in seconds.
<li><a href="#query_auctions">query_auctions</a>()<br/>
This method returns the current list of available auctions.
<li><a href="#query_finished_auctions">query_finished_auctions</a>()<br/>
This method returns the current list of finished auctions.
<li><a href="#query_last_auction_finish_time">query_last_auction_finish_time</a>()<br/>
This method figures out when the last auction will finish.
<li><a href="#query_save_file">query_save_file</a>()<br/>
This method queries the save file name.
<li><a href="#query_time_end_string">query_time_end_string</a>(int)<br/>
This method prints a nice string showing how long it is till then
end of the thing.
<li><a href="#remove_auction_item">remove_auction_item</a>(class auction)<br/>
This method removes the specified auction from the list.
<li><a href="#remove_finished_auction_item">remove_finished_auction_item</a>(class auction)<br/>
This method removes the specified auction from the list.
<li><a href="#remove_finished_auction_number">remove_finished_auction_number</a>(int)<li><a href="#retry_auction">retry_auction</a>(class auction)<br/>
This method retries the aution on the specified item.
<li><a href="#save_me">save_me</a>()<br/>
This method saves the auction house.
<li><a href="#set_allowed_add">set_allowed_add</a>(int)<br/>
This method sets the allowed add flag.
<li><a href="#set_auction_time">set_auction_time</a>(string, int)<br/>
This method sets the length of auctions in seconds.
<li><a href="#set_check_can_bid">set_check_can_bid</a>(function)<br/>
This method sets a function to be called to check if someone can
bid or not.
<li><a href="#set_max_auctions">set_max_auctions</a>(int)<br/>
This method sets the maximum number of simultaneous auctions.
<li><a href="#set_max_retries">set_max_retries</a>(int)<br/>
This method sets the number of times an item will be retried before
the auction is failed.
<li><a href="#set_min_bid_increase">set_min_bid_increase</a>(int)<br/>
This method sets the minimum bid increase (as a percentage of the
current bid).
<li><a href="#set_retrieval_time">set_retrieval_time</a>(int)<br/>
This method sets the length of the retrieval time.
<li><a href="#set_save_file">set_save_file</a>(string)<br/>
This method sets the save file name.
</ul><h2>Public Functions</h2>
These are functions that everyone can access.<p>
.<ul><a name="add_item_to_auction">
add_item_to_auction</a><pre>
int add_item_to_auction(object * obs,
                        string name,
                        int reserve,
                        string seller,
                        int length,
                        string end_function,
                        mixed extra)
</pre></br>
This method puts an item up for auction.
<br/><ul>
<li><b>Parameters:</b>
<br/>obs - the objects to sell
<br/>name - the name of the item
<br/>reserve - the reserve price of the item
<br/>seller - the seller of the item
<br/>length - the length of the auction
<br/>end_function - the function to call when the item is sold
<li><b>Returns:</b>
<br/>1 on success, 0 on failure

</dl>

<ul><a name="bid_on_item">
bid_on_item</a><pre>
void bid_on_item(class auction auct,
                 int bid,
                 string person)
</pre></br>
This method makes a bid on an item.
<br/><ul>
<li><b>Parameters:</b>
<br/>item - the item to bid on
<br/>bid - the amount to bid
<br/>person - the person making the bid

</dl>

<ul><a name="confirm_auction">
confirm_auction</a><pre>
void confirm_auction(string check,
                     string name,
                     object * obs,
                     int reserve,
                     int len)
</pre></br>Confirm the addition 

<ul><a name="do_add">
do_add</a><pre>
int do_add(string name,
           object * obs,
           string res_str,
           string length)
</pre></br>
This method adds an item for bidding.
<br/><ul>
<li><b>Parameters:</b>
<br/>name - the name to put them up for bidding as
<br/>obs - the objects to auction
<br/>res_str - the reserve price
<br/>length - the length of the auction
<li><b>Returns:</b>
<br/>1 on success, 0 on failed

</dl>

<ul><a name="do_bid">
do_bid</a><pre>
int do_bid(string id,
           string bid)
</pre></br>
This method makes a bid on the specified item.
<br/><ul>
<li><b>Parameters:</b>
<br/>id - the item to bid on
<br/>bid - the amount to bid
<li><b>Returns:</b>
<br/>1 on success, 0 on failure

</dl>

<ul><a name="do_browse">
do_browse</a><pre>
int do_browse(string id)
</pre></br>
This method allows you to browse the item.
<br/><ul>
<li><b>Parameters:</b>
<br/>id - the id of the auction thing to browse

</dl>

<ul><a name="do_claim">
do_claim</a><pre>
int do_claim()
</pre></br>
This method claims anything that you can bought and is waiting for
pickup.


<ul><a name="do_info">
do_info</a><pre>
int do_info()
</pre></br>
This method shoes information about the auction house, like the
amount of time for each type of auction.
<br/><ul>
<li><b>Returns:</b>
<br/>1 on success

</dl>

<ul><a name="do_list">
do_list</a><pre>
int do_list()
</pre></br>
This method lists all the current auctions.


<ul><a name="do_withdraw">
do_withdraw</a><pre>
int do_withdraw(string id)
</pre></br>
This method withdraws the item from bidding.  You pay a penalty when you
do this, 10% of the current item cost.
<br/><ul>
<li><b>Parameters:</b>
<br/>id - the id to withdraw

</dl>

<ul><a name="finish_auction">
finish_auction</a><pre>
void finish_auction(class auction auction)
</pre></br>
This method finishes the aution on the specified item.
<br/><ul>
<li><b>Parameters:</b>
<br/>auction - the auction item that is being finished

</dl>

<ul><a name="force_finish_auction">
force_finish_auction</a><pre>
void force_finish_auction(string id)
</pre></br>
This method forcibly finishes the auction on the specified item.
This is only to be used for debugging purposes.
<br/><ul>
<li><b>Parameters:</b>
<br/>auction - the auction item that is being finished

</dl>

<ul><a name="load_me">
load_me</a><pre>
void load_me()
</pre></br>
This method loads the auction house up.


<ul><a name="next_auction_finish">
next_auction_finish</a><pre>
void next_auction_finish()
</pre></br>
This method figures out when the next auction finishes and sets up
a timeout.


<ul><a name="query_auction_end_string">
query_auction_end_string</a><pre>
string query_auction_end_string(class auction auction)
</pre></br>
This method printsd a nice string showing how long till the auction
ends.
<br/><ul>
<li><b>Parameters:</b>
<br/>auction - the auction to get an end string for
<li><b>Returns:</b>
<br/>auction end string

</dl>

<ul><a name="query_auction_item">
query_auction_item</a><pre>
class auction query_auction_item(string id)
</pre></br>
This method finds the item based on some useful string.
<br/><ul>
<li><b>Parameters:</b>
<br/>id - the id to lookup
<li><b>Returns:</b>
<br/>the auction item, 0 in the case of error

</dl>

<ul><a name="query_auction_objects">
query_auction_objects</a><pre>
object * query_auction_objects(class auction auct)
</pre></br>
This method finds the objects associated with the auction item.
<br/><ul>
<li><b>Parameters:</b>
<br/>auction - the auction item
<li><b>Returns:</b>
<br/>the objects associated with it

</dl>

<ul><a name="query_auction_times">
query_auction_times</a><pre>
mapping query_auction_times()
</pre></br>
This method returns the length of auctions in seconds.
<br/><ul>
<li><b>Returns:</b>
<br/>the length of auctions.

</dl>

<ul><a name="query_auctions">
query_auctions</a><pre>
class auction * query_auctions()
</pre></br>
This method returns the current list of available auctions.
<br/><ul>
<li><b>Returns:</b>
<br/>the current auctions

</dl>

<ul><a name="query_finished_auctions">
query_finished_auctions</a><pre>
class auction * query_finished_auctions()
</pre></br>
This method returns the current list of finished auctions.
<br/><ul>
<li><b>Returns:</b>
<br/>the current auctions

</dl>

<ul><a name="query_last_auction_finish_time">
query_last_auction_finish_time</a><pre>
int query_last_auction_finish_time()
</pre></br>
This method figures out when the last auction will finish.
<br/><ul>
<li><b>Returns:</b>
<br/>when the last auction finished

</dl>

<ul><a name="query_save_file">
query_save_file</a><pre>
string query_save_file()
</pre></br>
This method queries the save file name.


<ul><a name="query_time_end_string">
query_time_end_string</a><pre>
string query_time_end_string(int left)
</pre></br>
This method prints a nice string showing how long it is till then
end of the thing.
<br/><ul>
<li><b>Parameters:</b>
<br/>left - the time to get the difference for
<li><b>Returns:</b>
<br/>time end string

</dl>

<ul><a name="remove_auction_item">
remove_auction_item</a><pre>
void remove_auction_item(class auction auction)
</pre></br>
This method removes the specified auction from the list.
<br/><ul>
<li><b>Parameters:</b>
<br/>auction - the auction item that is being removed

</dl>

<ul><a name="remove_finished_auction_item">
remove_finished_auction_item</a><pre>
void remove_finished_auction_item(class auction auction)
</pre></br>
This method removes the specified auction from the list.
<br/><ul>
<li><b>Parameters:</b>
<br/>auction - the auction item that is being removed

</dl>

<ul><a name="remove_finished_auction_number">
remove_finished_auction_number</a><pre>
void remove_finished_auction_number(int i)
</pre>
<ul><a name="retry_auction">
retry_auction</a><pre>
void retry_auction(class auction auction)
</pre></br>
This method retries the aution on the specified item.
<br/><ul>
<li><b>Parameters:</b>
<br/>auction - the auction item that is being finished

</dl>

<ul><a name="save_me">
save_me</a><pre>
void save_me()
</pre></br>
This method saves the auction house.


<ul><a name="set_allowed_add">
set_allowed_add</a><pre>
void set_allowed_add(int flag)
</pre></br>
This method sets the allowed add flag.  If theis flag is set to 0
then it is not possible for players to add items for
auctions.
<br/><ul>
<li><b>Parameters:</b>
<br/>flag - the allowed add flag

</dl>

<ul><a name="set_auction_time">
set_auction_time</a><pre>
void set_auction_time(string index,
                      int i)
</pre></br>
This method sets the length of auctions in seconds.
<br/><ul>
<li><b>Parameters:</b>
<br/>index - the name of the auction type to change
<br/>i - the length of auctions.

</dl>

<ul><a name="set_check_can_bid">
set_check_can_bid</a><pre>
void set_check_can_bid(function f)
</pre></br>
This method sets a function to be called to check if someone can
bid or not.
<br/><ul>
<li><b>Parameters:</b>
<br/>func - the function to call

</dl>

<ul><a name="set_max_auctions">
set_max_auctions</a><pre>
void set_max_auctions(int i)
</pre></br>
This method sets the maximum number of simultaneous auctions.
<br/><ul>
<li><b>Parameters:</b>
<br/>i - the number of items.

</dl>

<ul><a name="set_max_retries">
set_max_retries</a><pre>
void set_max_retries(int i)
</pre></br>
This method sets the number of times an item will be retried before
the auction is failed.

<br/><ul>
<li><b>Parameters:</b>
<br/>i - the number of seconds the item will wait for someone to claim it.

</dl>

<ul><a name="set_min_bid_increase">
set_min_bid_increase</a><pre>
void set_min_bid_increase(int i)
</pre></br>
This method sets the minimum bid increase (as a percentage of the
current bid).

<br/><ul>
<li><b>Parameters:</b>
<br/>i - percentage

</dl>

<ul><a name="set_retrieval_time">
set_retrieval_time</a><pre>
void set_retrieval_time(int i)
</pre></br>
This method sets the length of the retrieval time.

<br/><ul>
<li><b>Parameters:</b>
<br/>i - the number of seconds the item will wait for someone to claim it.

</dl>

<ul><a name="set_save_file">
set_save_file</a><pre>
void set_save_file(string fname)
</pre></br>
This method sets the save file name.
<br/><ul>
<li><b>Parameters:</b>
<br/>fname - the save file name

</dl>


<h2>Classes</h2>
These are nice data types for dealing with...  Data!<p>
<ul>
<li><a name="class_auction">
auction</a><pre>
class auction {
                mixed save_stuff;
                int time_started;
                int auction_length;
                string name;
                string seller;
                string current_bidder;
                int bid;
                int reserve;
                int retries;
                string end_function;
                mixed extra;
}

</pre>
</ul>
[an error occurred while processing this directive]

