[Package Index | Mudlib Index | Effect Index]

File /obj/proxy.c

This is the basic object to use for the proxy control. A proxy is used by continuous objects to handle bits breaking off when requested. This object is not referenceable by any object matching routines.

The way the proxy works is when a match is made on a continuous object it generates a proxy which it puts in the same location. The proxy is a dummy object which contains a pointer back to the old object and enough data to create a real object from the original object. The proxy only ever turns into a real object if the object is moved, and at that point it actually moves the real object, or the correct chunk of the real object.

Written by Pinkfish

Started Thu Nov 20 14:47:42 PST 2003

Inherits

This class inherits the following classes /std/basic/move.c

Includes

This class includes the following files /include/move_failures.h

Method index

Public Functions

These are functions that everyone can access.

create_real_object
object create_real_object()

This creates the real object from the proxy.

Parameters:
this - returns the real object

destroy_real_object
void destroy_real_object()

This method destroys the real object and merges it's values back into the old object.

Parameters:
real - the real object to merge back

do_cure
int do_cure()

This method is called on the proxy object when a player attempts to cure it, using a pickling stick.
do_dry
int do_dry()

This method is called on the proxy object when a player attempts to dry it.
parse_match_but_remove_from
object * parse_match_but_remove_from(object * obs,
                                     object * removal)

THis code controls how the 'but' handling works in the parser when a proxy object is in the first group to be removed from. The only thing we will check here is if the main object is in the group of things being used as a removal. If it is, then we remove ourselves from the array.
parse_match_but_remove_with
object * parse_match_but_remove_with(object * obs,
                                     object * removal)

THis code controls how the 'but' handleing works in the parser when the proxy object is in the group that is being removed from the first group. For this we want to find either the main object or a proxy object in the first group and do the removal from that. If it it the main object in the first group, then we replace it with a proxy object.
parse_match_handle_but
int parse_match_handle_but()

This allows the proxy object to handle 'but' syntaxes itself.
parse_match_handle_or
int parse_match_handle_or()

This allows the proxty object to handle the various types of 'or' syntax.
parse_match_or
object * parse_match_or(object * obs)

This allows the proxy object to insert itself, or not, in the output list of the object array.

Returns:
obs the current list of objects being returned

proxy_cmd_process
int proxy_cmd_process(string cmd,
                      object * obs,
                      string dir_match,
                      string indir_match,
                      mixed * args,
                      string pattern)

This processes the proxy command and passes it back onto the main object for it to process as it wishes.
query_main_object
object query_main_object()

This returns the main object associated with this proxy.

Returns:
the main object associated with the proxy

See also:
query_real_object()

query_proxy_data
int query_proxy_data()

This returns the proxy data.

Returns:
the proxy data

query_proxy_object
int query_proxy_object()

This is the query to determine if the object is a proxy.

Returns:
1 for a proxy, 0 if not

query_real_object
object query_real_object()

This returns the real object associated with this proxy. This is the object made when the proxy is moved or forced to be created in some way.

Returns:
the real object

See also:
query_main_object()

set_proxy_data
void set_proxy_data(mixed data)

THis allows the proxy data to be changed.

Parameters:
data - the new data

set_proxy_timeout
void set_proxy_timeout(int delay)

This sets a longer timeout for the proxy, so things like delayed give and other delayed things, can work.

Parameters:
delay - the time to live delay

setup_proxy_object
void setup_proxy_object(object ob,
                        string * names,
                        mixed data)

This sets up the proxy with the specific setup data.

Parameters:
ob - the object the proxy is associated with
names - the list of names for the proxy
data - the data used to generate the actual object

turn_into_real_object
object turn_into_real_object()

This method turns us into a real object so we can do what we need to do. Like be eaten or something.