[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/room/auction_room.c</h2>
Auction Room Inheritable
This room will give you everything you need to make an auction
room.<p>Written by Terano<p>Started 3 October, 1998<h3>Change history</h3>
<ul><br/>24 March, 1999 Many exciting things. Terano.
<li>2 October, 1999 Added stability! Excitement! <br/>An excessively complicated browse function! Terano.
<li>8 January, 2000! Made Y2K compliant! (Just kidding)<br/>Added some advertising stuff.
Fixed a missing case as well.
<li>11 January, 2000 Fixed some advertising stuff.<br/></ul>
<h2>Inherits</h2>
This class inherits the following classes <a href="global.auto_load.c.shtml">/global/auto_load.c</a> and <a href="std.room.c.shtml">/std/room.c</a><h2>Includes</h2>
This class includes the following files <a href="include.mail.h.shtml">/include/mail.h</a>, /include/shops/bank.h, <a href="include.player_handler.h.shtml">/include/player_handler.h</a>, <a href="include.money.h.shtml">/include/money.h</a> and <a href="include.move_failures.h.shtml">/include/move_failures.h</a><h2>Class Index</h2>
<ul><li><a href="#class_item">item</a>
<br/>
In this new version, we aren't keeping the objects loaded,
because the auto_load code seems flaky outside of 
/global/player.
<li><a href="#class_lot">lot</a>
<br/>
A few notes about this class, I didn't like the way the old one
worked, when a lot moved to expired_lots, there was no real way to recover it
Instead, we will keep one array of all lots, with differing status's depending
on whats happening.
<li><a href="#class_store">store</a>
<br/>
In this new version, we aren't keeping the objects loaded,
because the auto_load code seems flaky outside of 
/global/player.
</ul><h2>Method index</h2>
<dl><ul>
<li><a href="#adjust_money">adjust_money</a>(int, object)<li><a href="#automated_deposit">automated_deposit</a>(object *, int, string, string, int, string)<br/>
This function allows an object to deposit an item for auction,
Things are the items to auction, auction length is the length in seconds,
function_cb and object_cb are function names and object paths to allow a
call back to be scheduled for when the auction is over, res price is
the reserve price and int_desc is a description that will be written on
the case.
<li><a href="#do_bid">do_bid</a>(string, object *)<br/>
Basic add command function.
<li><a href="#do_browse">do_browse</a>(object *, string, int)<br/>
This function will be a bit horrible, but it is a nicer way of doing it 
then keeping the objects around.
<li><a href="#do_collect">do_collect</a>(string)<li><a href="#do_deposit">do_deposit</a>(object *, int, string, string)<li><a href="#do_describe">do_describe</a>(object *, string)<li><a href="#do_exclude">do_exclude</a>(object *, string)<li><a href="#do_list">do_list</a>()<li><a href="#do_unexclude">do_unexclude</a>(object *, string)<li><a href="#do_withdraw">do_withdraw</a>(object *)<br/>
Withdraw an item from bidding

<li><a href="#extra_look">extra_look</a>(object)<li><a href="#generate_advertising_string">generate_advertising_string</a>(class lot)<br/>
This function generates a string that can be used in any advertising
you might want to do, it returns a human friendly string that passes
information about the lot.
<li><a href="#generate_random_adv_string">generate_random_adv_string</a>()<br/>
A more usable version of above function, call it and it picks a lot
at random and generates a string for it.
<li><a href="#generate_store">generate_store</a>(object *, int)<br/>
Return a store class with info on the objects

<li><a href="#load_file">load_file</a>()<li><a href="#lot_check">lot_check</a>()<br/>
A major component, this function is called once every few minutes to
change the state of our bids.
<li><a href="#query_payments">query_payments</a>()<li><a href="#recover_lot">recover_lot</a>(mixed)<li><a href="#save_file">save_file</a>()<li><a href="#set_admin_cost">set_admin_cost</a>(int)<li><a href="#set_commission">set_commission</a>(int)<li><a href="#set_currency">set_currency</a>(string)<li><a href="#set_save_path">set_save_path</a>(string)<li><a href="#set_shop_name">set_shop_name</a>(string)</ul><h2>Public Functions</h2>
These are functions that everyone can access.<p>
.<ul><a name="adjust_money">
adjust_money</a><pre>
void adjust_money(int amount,
                  object player)
</pre>
<ul><a name="automated_deposit">
automated_deposit</a><pre>
int automated_deposit(object * things,
                      int auction_length,
                      string function_cb,
                      string object_cb,
                      int res_price,
                      string int_desc)
</pre></br>
This function allows an object to deposit an item for auction,
Things are the items to auction, auction length is the length in seconds,
function_cb and object_cb are function names and object paths to allow a
call back to be scheduled for when the auction is over, res price is
the reserve price and int_desc is a description that will be written on
the case. If an error code is generated, it is upon the object calling
this function to pull those objects back. An object reference isn't
kept here.


<ul><a name="do_bid">
do_bid</a><pre>
int do_bid(string offer,
           object * boxes)
</pre></br>
Basic add command function.. lets you bid on stuff


<ul><a name="do_browse">
do_browse</a><pre>
int do_browse(object * boxes,
              string target,
              int identifier)
</pre></br>
This function will be a bit horrible, but it is a nicer way of doing it 
then keeping the objects around.
This function uses Terano's cheap and dirty parser (All rights reserved).
To be added - plural support! (using query_plural)


<ul><a name="do_collect">
do_collect</a><pre>
int do_collect(string pattern)
</pre>
<ul><a name="do_deposit">
do_deposit</a><pre>
int do_deposit(object * things,
               int auction_time,
               string time_type,
               string res_price)
</pre>
<ul><a name="do_describe">
do_describe</a><pre>
int do_describe(object * boxes,
                string int_desc)
</pre>
<ul><a name="do_exclude">
do_exclude</a><pre>
int do_exclude(object * boxes,
               string excluded)
</pre>
<ul><a name="do_list">
do_list</a><pre>
int do_list()
</pre>
<ul><a name="do_unexclude">
do_unexclude</a><pre>
int do_unexclude(object * boxes,
                 string excluded)
</pre>
<ul><a name="do_withdraw">
do_withdraw</a><pre>
int do_withdraw(object * boxes)
</pre></br>
Withdraw an item from bidding


<ul><a name="extra_look">
extra_look</a><pre>
string extra_look(object ob)
</pre>
<ul><a name="generate_advertising_string">
generate_advertising_string</a><pre>
string generate_advertising_string(class lot lot)
</pre></br>
This function generates a string that can be used in any advertising
you might want to do, it returns a human friendly string that passes
information about the lot. (Specifically - contents, cost and exp time)
It takes a lot as an arg.


<ul><a name="generate_random_adv_string">
generate_random_adv_string</a><pre>
string generate_random_adv_string()
</pre></br>
A more usable version of above function, call it and it picks a lot
at random and generates a string for it.
returns "NULL" if there are no lots.
Also returns NULL if the lot chosen isnt open


<ul><a name="generate_store">
generate_store</a><pre>
class store generate_store(object * things,
                           int lot_id)
</pre></br>
Return a store class with info on the objects


<ul><a name="load_file">
load_file</a><pre>
void load_file()
</pre>
<ul><a name="lot_check">
lot_check</a><pre>
void lot_check()
</pre></br>
A major component, this function is called once every few minutes to
change the state of our bids. It puts new bids out on display, and 
modifies the state of in game lots as required. It also removes old ones.


<ul><a name="query_payments">
query_payments</a><pre>
mapping query_payments()
</pre>
<ul><a name="recover_lot">
recover_lot</a><pre>
mixed recover_lot(mixed lot_autoload)
</pre>
<ul><a name="save_file">
save_file</a><pre>
void save_file()
</pre>
<ul><a name="set_admin_cost">
set_admin_cost</a><pre>
void set_admin_cost(int value)
</pre>
<ul><a name="set_commission">
set_commission</a><pre>
void set_commission(int percent)
</pre>
<ul><a name="set_currency">
set_currency</a><pre>
void set_currency(string cur)
</pre>
<ul><a name="set_save_path">
set_save_path</a><pre>
void set_save_path(string path)
</pre>
<ul><a name="set_shop_name">
set_shop_name</a><pre>
void set_shop_name(string _name)
</pre>

<h2>Classes</h2>
These are nice data types for dealing with...  Data!<p>
<ul>
<li><a name="class_item">
item</a><pre>
class item {
             string name;
             string * alias;
             string * adjectives;
             string long;
             string read_mess;
             string enchant_mess;
}

</pre><br/>
In this new version, we aren't keeping the objects loaded,
because the auto_load code seems flaky outside of 
/global/player.c
Instead keep a whole bunch of info about it on file.
<p>

<li><a name="class_lot">
lot</a><pre>
class lot {
            int case_code;
            class store assoc_store;
            string seller;
            string status;
            int expiration_time;
            int reserve_price;
            mapping bids;
            mixed * lot_autoload;
            mixed * current_bid;
            string * auto_bids;
            string notes;
            string * excluded;
}

</pre><br/>
A few notes about this class, I didn't like the way the old one
worked, when a lot moved to expired_lots, there was no real way to recover it
Instead, we will keep one array of all lots, with differing status's depending
on whats happening.
IE: Open: Accepting bids.
    Waiting: Seller: It did not take any acceptable bids and it is waiting collection
      by the seller.
    Waiting: Buyer: A bid was taken and we are waiting for payment.
    Waiting: Buyer (lapsed): A bid was taken, but lapsed. There are no 
      other bidders, so in the next cycle the seller will be mailed and
      status changed to Waiting: Seller.
    Waiting Creator Intervention:  A lot has fallen over in some way,
      and needs a creator to fix it.
    Closed: The bid has been collected (by either buyer or seller),
      lots will stay in this status for 2 hours after collection.
      Then payment will be credited to the payment array and the lot will 
      be deleted.
Case code is used in reference to the store class.
The rest are the same as they were in the last version
<p>

<li><a name="class_store">
store</a><pre>
class store {
              int case_code;
              string colour;
              string inv_string;
              class item * inventory;
}

</pre><br/>
In this new version, we aren't keeping the objects loaded,
because the auto_load code seems flaky outside of 
/global/player.c
Instead keep a whole bunch of info about it on file.
<p>

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

