[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 /obj/handlers/broadcaster.c</h2>
Basic sight and sound broadcaster.
<h2>Includes</h2>
This class includes the following files /include/clubs.h and /include/am_time.h<h2>Method index</h2>
<ul>
<li><a href="#add_object_to_channel">add_object_to_channel</a>(string, object)<br/>
This method adds an object to the list of objects to be told about the
specfied channel.
<li><a href="#broadcast_event">broadcast_event</a>(object *, int *, string, int, int, int)<br/>
Sends an event out to all the things.
<li><a href="#broadcast_to_channel">broadcast_to_channel</a>(mixed, string, mixed)<br/>
Inform channel of message.
<li><a href="#get_direc_dist">get_direc_dist</a>(int *, int *)<br/>
This method returns the square distance, the name of the direction
the sound comes from and the up down offset.
<li><a href="#is_channel">is_channel</a>(string)<br/>
This method checks to see if the channel exists.
<li><a href="#npc_hear_shouts">npc_hear_shouts</a>(object)<br/>
Adds an NPC to the list of NPC's who are to receive shout events.
<li><a href="#npc_shout_event">npc_shout_event</a>(object, string, string, string, int *, int)<br/>
This method is called by the shout command to filter the shouts onto
the npcs that are listening.
<li><a href="#npc_unhear_shouts">npc_unhear_shouts</a>(object)<br/>
Removes an NPC from the list of NPC's who are to receive shout events.
<li><a href="#query_channel_history">query_channel_history</a>(string)<br/>
This message returns the current history list for the channel.
<li><a href="#query_channel_members">query_channel_members</a>(string)<br/>
This method must only be used for debugging purposes.
<li><a href="#query_next_channel_number">query_next_channel_number</a>(string)<br/>
This method keeps track of an ever increasing number for a specified
channel type.
<li><a href="#remove_object_from_channel">remove_object_from_channel</a>(string, object)<br/>
This method removes an object from the list of objects to be told about the
specified channel.
</ul>
<h2>Public Functions</h2>
These are functions that everyone can access.<p>
<dl>
<dt class="autodocfuncname"><a name="add_object_to_channel">
add_object_to_channel</a><pre class="autodocfuncdef">
void add_object_to_channel(string channel_name,
                           object ob)
</pre><dd><br />
This method adds an object to the list of objects to be told about the
specfied channel.  The method called on the object for the channel
will be event_channel_message.  The method will be called with
three arguements, the first is the object generating the event
the second is the channel the event is generated on and the
third is the message being sent to the channel.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
channel_name - the name of the channel<br />
ob - the object to add to the list
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="broadcast_event">
broadcast_event</a><pre class="autodocfuncdef">
void broadcast_event(object * things,
                     int * centre,
                     string message,
                     int range,
                     int inside,
                     int underwater)
</pre><dd><br />
Sends an event out to all the things.  It checks to make sure they
can hear the event and all that stuff.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
things - things that get told about it<br />
centre - coords where event occurs<br />
message - what the things get told<br />
range - range of telling in room units<br />
inside - tell things if indoors<br />
underwater - tell things if underwater
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="broadcast_to_channel">
broadcast_to_channel</a><pre class="autodocfuncdef">
void broadcast_to_channel(mixed ob,
                          string channel,
                          mixed message)
</pre><dd><br />
Inform channel of message.  The message will get sent to all the objects
added to the list to the method event_channel_message.  The method
will be called with three arguements, first is the object that started
the event, the second the channel it is being send to and the last is the
message being sent to the channel.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
ob - the object creating the channel event<br />
channel - the channel to inform people about<br />
message - the message to tell the channel about
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="get_direc_dist">
get_direc_dist</a><pre class="autodocfuncdef">
mixed * get_direc_dist(int * co_ord1,
                       int * co_ord2)
</pre><dd><br />
This method returns the square distance, the name of the direction
the sound comes from and the up down offset.  It is used by the shout
code and by various other things that require this inofmraiont.
The return array is formated as:<br>
({ square_distance, name_of_direction, z_offset })<br />
<br /><dl>
<dd><b>Parameters:</b><br />
co_ord1 - the first co-ordinate<br />
co_ord2 - the co-ordinate to compare against<br />
<br />
<dd><b>Returns:</b>
<br />the array as described above
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="is_channel">
is_channel</a><pre class="autodocfuncdef">
int is_channel(string channel)
</pre><dd><br />
This method checks to see if the channel exists.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
channel - the channel name to check for<br />
<br />
<dd><b>Returns:</b>
<br />1 if the channel eixsts, 0 if not<br /><br />
<dd><b>See also:</b>
<br /><a href="#query_channel_members">query_channel_members()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="npc_hear_shouts">
npc_hear_shouts</a><pre class="autodocfuncdef">
void npc_hear_shouts(object newlistener)
</pre><dd><br />
Adds an NPC to the list of NPC's who are to receive shout events.
The NPC need not be removed from this list when he dies -- desting
the NPC object has the same effect as calling npc_unhear_shouts().
event_person_shout() is activated on the NPC for all shouts.
NPC's do not normally detect shouts.
event_person_shout() on the NPC should be replaced with similar code
to that in the broadcaster to determine if the shouter is within
range and to generate the desired response.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
newlistener - NPC object to be added to the list
<br />
<br />
<dd><b>See also:</b>
<br /><a href="global.events.c.shtml#event_person_shout">/global/events->event_person_shout()</a> and <a href="#npc_unhear_shouts">npc_unhear_shouts()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="npc_shout_event">
npc_shout_event</a><pre class="autodocfuncdef">
void npc_shout_event(object shouter,
                     string start,
                     string message,
                     string lang,
                     int * coord,
                     int range)
</pre><dd><br />
This method is called by the shout command to filter the shouts onto
the npcs that are listening.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
shouter - the person who shouted<br />
start - the start of the message<br />
message - the message shouted<br />
lang - the language the message is in<br />
coord - the co-ordinate it was shouted from<br />
range - the range of the shout
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="npc_unhear_shouts">
npc_unhear_shouts</a><pre class="autodocfuncdef">
int npc_unhear_shouts(object oldlistener)
</pre><dd><br />
Removes an NPC from the list of NPC's who are to receive shout events.
The NPC need not be removed from this list when he dies -- desting
the NPC object has the same effect as calling npc_unhear_shouts().
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
oldlistener - NPC object to be removed from the list<br />
<br />
<dd><b>Returns:</b>
<br />1 if successfully removed
<br /><br />
<dd><b>See also:</b>
<br /><a href="global.events.c.shtml#event_person_shout">/global/events->event_person_shout()</a> and <a href="#npc_hear_shouts">npc_hear_shouts()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_channel_history">
query_channel_history</a><pre class="autodocfuncdef">
mixed * query_channel_history(string channel)
</pre><dd><br />
This message returns the current history list for the channel.  The
array is:<br>
({ ({ person, message }), ... })<br />
<br /><dl>
<dd><b>Parameters:</b><br />
channel - the channel to get the history of<br />
<br />
<dd><b>Returns:</b>
<br />the history of the channel<br /><br />
<dd><b>See also:</b>
<br /><a href="#broadcast_to_channel">broadcast_to_channel()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_channel_members">
query_channel_members</a><pre class="autodocfuncdef">
object * query_channel_members(string channel)
</pre><dd><br />
This method must only be used for debugging purposes.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
channel - the channel which has all these things on it<br />
<br />
<dd><b>Returns:</b>
<br />the array of objects in the channel<br /><br />
<dd><b>See also:</b>
<br /><a href="#is_channel">is_channel()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_next_channel_number">
query_next_channel_number</a><pre class="autodocfuncdef">
int query_next_channel_number(string channel)
</pre><dd><br />
This method keeps track of an ever increasing number for a specified
channel type.  THis is used in the wizards spell (for instance) to
keep track of unique ids for wizard channels.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
channel - the name of the channel<br />
<br />
<dd><b>Returns:</b>
<br />the next number in the series
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="remove_object_from_channel">
remove_object_from_channel</a><pre class="autodocfuncdef">
int remove_object_from_channel(string channel_name,
                               object ob)
</pre><dd><br />
This method removes an object from the list of objects to be told about the
specified channel.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
channel_name - the name of the channel<br />
ob - the object to add to the channel
<br />
<br />
<br /></dl>

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

